var bjA = Object.defineProperty;
var wjA = (A, e, t) => e in A ? bjA(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t;
var yr = (A, e, t) => (wjA(A, typeof e != "symbol" ? e + "" : e, t), t);
function NfA(A, e) {
  for (var t = 0; t < e.length; t++) {
    const i = e[t];
    if (typeof i != "string" && !Array.isArray(i)) {
      for (const n in i)
        if (n !== "default" && !(n in A)) {
          const o = Object.getOwnPropertyDescriptor(i, n);
          o && Object.defineProperty(A, n, o.get ? o : {
            enumerable: !0,
            get: () => i[n]
          });
        }
    }
  }
  return Object.freeze(Object.defineProperty(A, Symbol.toStringTag, { value: "Module" }));
}
var wi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function u8(A) {
  return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
}
function YfA(A) {
  if (A.__esModule)
    return A;
  var e = A.default;
  if (typeof e == "function") {
    var t = function i() {
      if (this instanceof i) {
        var n = [null];
        n.push.apply(n, arguments);
        var o = Function.bind.apply(e, n);
        return new o();
      }
      return e.apply(this, arguments);
    };
    t.prototype = e.prototype;
  } else
    t = {};
  return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(A).forEach(function(i) {
    var n = Object.getOwnPropertyDescriptor(A, i);
    Object.defineProperty(t, i, n.get ? n : {
      enumerable: !0,
      get: function() {
        return A[i];
      }
    });
  }), t;
}
var UN = {}, fjA = {
  get exports() {
    return UN;
  },
  set exports(A) {
    UN = A;
  }
}, gK = {}, u = {}, DjA = {
  get exports() {
    return u;
  },
  set exports(A) {
    u = A;
  }
}, St = {};
/**
 * @license React
 * react.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 iR = Symbol.for("react.element"), GjA = Symbol.for("react.portal"), kjA = Symbol.for("react.fragment"), JjA = Symbol.for("react.strict_mode"), NjA = Symbol.for("react.profiler"), YjA = Symbol.for("react.provider"), RjA = Symbol.for("react.context"), FjA = Symbol.for("react.forward_ref"), MjA = Symbol.for("react.suspense"), xjA = Symbol.for("react.memo"), LjA = Symbol.for("react.lazy"), ZaA = Symbol.iterator;
function vjA(A) {
  return A === null || typeof A != "object" ? null : (A = ZaA && A[ZaA] || A["@@iterator"], typeof A == "function" ? A : null);
}
var RfA = { isMounted: function() {
  return !1;
}, enqueueForceUpdate: function() {
}, enqueueReplaceState: function() {
}, enqueueSetState: function() {
} }, FfA = Object.assign, MfA = {};
function CD(A, e, t) {
  this.props = A, this.context = e, this.refs = MfA, this.updater = t || RfA;
}
CD.prototype.isReactComponent = {};
CD.prototype.setState = function(A, e) {
  if (typeof A != "object" && typeof A != "function" && A != null)
    throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
  this.updater.enqueueSetState(this, A, e, "setState");
};
CD.prototype.forceUpdate = function(A) {
  this.updater.enqueueForceUpdate(this, A, "forceUpdate");
};
function xfA() {
}
xfA.prototype = CD.prototype;
function d8(A, e, t) {
  this.props = A, this.context = e, this.refs = MfA, this.updater = t || RfA;
}
var h8 = d8.prototype = new xfA();
h8.constructor = d8;
FfA(h8, CD.prototype);
h8.isPureReactComponent = !0;
var WaA = Array.isArray, LfA = Object.prototype.hasOwnProperty, m8 = { current: null }, vfA = { key: !0, ref: !0, __self: !0, __source: !0 };
function HfA(A, e, t) {
  var i, n = {}, o = null, g = null;
  if (e != null)
    for (i in e.ref !== void 0 && (g = e.ref), e.key !== void 0 && (o = "" + e.key), e)
      LfA.call(e, i) && !vfA.hasOwnProperty(i) && (n[i] = e[i]);
  var s = arguments.length - 2;
  if (s === 1)
    n.children = t;
  else if (1 < s) {
    for (var I = Array(s), r = 0; r < s; r++)
      I[r] = arguments[r + 2];
    n.children = I;
  }
  if (A && A.defaultProps)
    for (i in s = A.defaultProps, s)
      n[i] === void 0 && (n[i] = s[i]);
  return { $$typeof: iR, type: A, key: o, ref: g, props: n, _owner: m8.current };
}
function HjA(A, e) {
  return { $$typeof: iR, type: A.type, key: e, ref: A.ref, props: A.props, _owner: A._owner };
}
function p8(A) {
  return typeof A == "object" && A !== null && A.$$typeof === iR;
}
function SjA(A) {
  var e = { "=": "=0", ":": "=2" };
  return "$" + A.replace(/[=:]/g, function(t) {
    return e[t];
  });
}
var KaA = /\/+/g;
function p9(A, e) {
  return typeof A == "object" && A !== null && A.key != null ? SjA("" + A.key) : e.toString(36);
}
function hL(A, e, t, i, n) {
  var o = typeof A;
  (o === "undefined" || o === "boolean") && (A = null);
  var g = !1;
  if (A === null)
    g = !0;
  else
    switch (o) {
      case "string":
      case "number":
        g = !0;
        break;
      case "object":
        switch (A.$$typeof) {
          case iR:
          case GjA:
            g = !0;
        }
    }
  if (g)
    return g = A, n = n(g), A = i === "" ? "." + p9(g, 0) : i, WaA(n) ? (t = "", A != null && (t = A.replace(KaA, "$&/") + "/"), hL(n, e, t, "", function(r) {
      return r;
    })) : n != null && (p8(n) && (n = HjA(n, t + (!n.key || g && g.key === n.key ? "" : ("" + n.key).replace(KaA, "$&/") + "/") + A)), e.push(n)), 1;
  if (g = 0, i = i === "" ? "." : i + ":", WaA(A))
    for (var s = 0; s < A.length; s++) {
      o = A[s];
      var I = i + p9(o, s);
      g += hL(o, e, t, I, n);
    }
  else if (I = vjA(A), typeof I == "function")
    for (A = I.call(A), s = 0; !(o = A.next()).done; )
      o = o.value, I = i + p9(o, s++), g += hL(o, e, t, I, n);
  else if (o === "object")
    throw e = String(A), Error("Objects are not valid as a React child (found: " + (e === "[object Object]" ? "object with keys {" + Object.keys(A).join(", ") + "}" : e) + "). If you meant to render a collection of children, use an array instead.");
  return g;
}
function T1(A, e, t) {
  if (A == null)
    return A;
  var i = [], n = 0;
  return hL(A, i, "", "", function(o) {
    return e.call(t, o, n++);
  }), i;
}
function ZjA(A) {
  if (A._status === -1) {
    var e = A._result;
    e = e(), e.then(function(t) {
      (A._status === 0 || A._status === -1) && (A._status = 1, A._result = t);
    }, function(t) {
      (A._status === 0 || A._status === -1) && (A._status = 2, A._result = t);
    }), A._status === -1 && (A._status = 0, A._result = e);
  }
  if (A._status === 1)
    return A._result.default;
  throw A._result;
}
var cs = { current: null }, mL = { transition: null }, WjA = { ReactCurrentDispatcher: cs, ReactCurrentBatchConfig: mL, ReactCurrentOwner: m8 };
St.Children = { map: T1, forEach: function(A, e, t) {
  T1(A, function() {
    e.apply(this, arguments);
  }, t);
}, count: function(A) {
  var e = 0;
  return T1(A, function() {
    e++;
  }), e;
}, toArray: function(A) {
  return T1(A, function(e) {
    return e;
  }) || [];
}, only: function(A) {
  if (!p8(A))
    throw Error("React.Children.only expected to receive a single React element child.");
  return A;
} };
St.Component = CD;
St.Fragment = kjA;
St.Profiler = NjA;
St.PureComponent = d8;
St.StrictMode = JjA;
St.Suspense = MjA;
St.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = WjA;
St.cloneElement = function(A, e, t) {
  if (A == null)
    throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + A + ".");
  var i = FfA({}, A.props), n = A.key, o = A.ref, g = A._owner;
  if (e != null) {
    if (e.ref !== void 0 && (o = e.ref, g = m8.current), e.key !== void 0 && (n = "" + e.key), A.type && A.type.defaultProps)
      var s = A.type.defaultProps;
    for (I in e)
      LfA.call(e, I) && !vfA.hasOwnProperty(I) && (i[I] = e[I] === void 0 && s !== void 0 ? s[I] : e[I]);
  }
  var I = arguments.length - 2;
  if (I === 1)
    i.children = t;
  else if (1 < I) {
    s = Array(I);
    for (var r = 0; r < I; r++)
      s[r] = arguments[r + 2];
    i.children = s;
  }
  return { $$typeof: iR, type: A.type, key: n, ref: o, props: i, _owner: g };
};
St.createContext = function(A) {
  return A = { $$typeof: RjA, _currentValue: A, _currentValue2: A, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, A.Provider = { $$typeof: YjA, _context: A }, A.Consumer = A;
};
St.createElement = HfA;
St.createFactory = function(A) {
  var e = HfA.bind(null, A);
  return e.type = A, e;
};
St.createRef = function() {
  return { current: null };
};
St.forwardRef = function(A) {
  return { $$typeof: FjA, render: A };
};
St.isValidElement = p8;
St.lazy = function(A) {
  return { $$typeof: LjA, _payload: { _status: -1, _result: A }, _init: ZjA };
};
St.memo = function(A, e) {
  return { $$typeof: xjA, type: A, compare: e === void 0 ? null : e };
};
St.startTransition = function(A) {
  var e = mL.transition;
  mL.transition = {};
  try {
    A();
  } finally {
    mL.transition = e;
  }
};
St.unstable_act = function() {
  throw Error("act(...) is not supported in production builds of React.");
};
St.useCallback = function(A, e) {
  return cs.current.useCallback(A, e);
};
St.useContext = function(A) {
  return cs.current.useContext(A);
};
St.useDebugValue = function() {
};
St.useDeferredValue = function(A) {
  return cs.current.useDeferredValue(A);
};
St.useEffect = function(A, e) {
  return cs.current.useEffect(A, e);
};
St.useId = function() {
  return cs.current.useId();
};
St.useImperativeHandle = function(A, e, t) {
  return cs.current.useImperativeHandle(A, e, t);
};
St.useInsertionEffect = function(A, e) {
  return cs.current.useInsertionEffect(A, e);
};
St.useLayoutEffect = function(A, e) {
  return cs.current.useLayoutEffect(A, e);
};
St.useMemo = function(A, e) {
  return cs.current.useMemo(A, e);
};
St.useReducer = function(A, e, t) {
  return cs.current.useReducer(A, e, t);
};
St.useRef = function(A) {
  return cs.current.useRef(A);
};
St.useState = function(A) {
  return cs.current.useState(A);
};
St.useSyncExternalStore = function(A, e, t) {
  return cs.current.useSyncExternalStore(A, e, t);
};
St.useTransition = function() {
  return cs.current.useTransition();
};
St.version = "18.2.0";
(function(A) {
  A.exports = St;
})(DjA);
const b = /* @__PURE__ */ u8(u), y8 = /* @__PURE__ */ NfA({
  __proto__: null,
  default: b
}, [u]);
/**
 * @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 KjA = u, UjA = Symbol.for("react.element"), VjA = Symbol.for("react.fragment"), XjA = Object.prototype.hasOwnProperty, zjA = KjA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, TjA = { key: !0, ref: !0, __self: !0, __source: !0 };
function SfA(A, e, t) {
  var i, n = {}, o = null, g = null;
  t !== void 0 && (o = "" + t), e.key !== void 0 && (o = "" + e.key), e.ref !== void 0 && (g = e.ref);
  for (i in e)
    XjA.call(e, i) && !TjA.hasOwnProperty(i) && (n[i] = e[i]);
  if (A && A.defaultProps)
    for (i in e = A.defaultProps, e)
      n[i] === void 0 && (n[i] = e[i]);
  return { $$typeof: UjA, type: A, key: o, ref: g, props: n, _owner: zjA.current };
}
gK.Fragment = VjA;
gK.jsx = SfA;
gK.jsxs = SfA;
(function(A) {
  A.exports = gK;
})(fjA);
const LB = UN.Fragment, pA = UN.jsx, ue = UN.jsxs;
var Jt = {}, _jA = {
  get exports() {
    return Jt;
  },
  set exports(A) {
    Jt = A;
  }
}, aa = {}, o4 = {}, qjA = {
  get exports() {
    return o4;
  },
  set exports(A) {
    o4 = A;
  }
}, ZfA = {};
/**
 * @license React
 * scheduler.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.
 */
(function(A) {
  function e(O, $) {
    var _ = O.length;
    O.push($);
    A:
      for (; 0 < _; ) {
        var tA = _ - 1 >>> 1, nA = O[tA];
        if (0 < n(nA, $))
          O[tA] = $, O[_] = nA, _ = tA;
        else
          break A;
      }
  }
  function t(O) {
    return O.length === 0 ? null : O[0];
  }
  function i(O) {
    if (O.length === 0)
      return null;
    var $ = O[0], _ = O.pop();
    if (_ !== $) {
      O[0] = _;
      A:
        for (var tA = 0, nA = O.length, AA = nA >>> 1; tA < AA; ) {
          var gA = 2 * (tA + 1) - 1, rA = O[gA], sA = gA + 1, lA = O[sA];
          if (0 > n(rA, _))
            sA < nA && 0 > n(lA, rA) ? (O[tA] = lA, O[sA] = _, tA = sA) : (O[tA] = rA, O[gA] = _, tA = gA);
          else if (sA < nA && 0 > n(lA, _))
            O[tA] = lA, O[sA] = _, tA = sA;
          else
            break A;
        }
    }
    return $;
  }
  function n(O, $) {
    var _ = O.sortIndex - $.sortIndex;
    return _ !== 0 ? _ : O.id - $.id;
  }
  if (typeof performance == "object" && typeof performance.now == "function") {
    var o = performance;
    A.unstable_now = function() {
      return o.now();
    };
  } else {
    var g = Date, s = g.now();
    A.unstable_now = function() {
      return g.now() - s;
    };
  }
  var I = [], r = [], a = 1, C = null, B = 3, l = !1, Q = !1, E = !1, d = typeof setTimeout == "function" ? setTimeout : null, m = typeof clearTimeout == "function" ? clearTimeout : null, y = typeof setImmediate < "u" ? setImmediate : null;
  typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling);
  function f(O) {
    for (var $ = t(r); $ !== null; ) {
      if ($.callback === null)
        i(r);
      else if ($.startTime <= O)
        i(r), $.sortIndex = $.expirationTime, e(I, $);
      else
        break;
      $ = t(r);
    }
  }
  function w(O) {
    if (E = !1, f(O), !Q)
      if (t(I) !== null)
        Q = !0, j(G);
      else {
        var $ = t(r);
        $ !== null && q(w, $.startTime - O);
      }
  }
  function G(O, $) {
    Q = !1, E && (E = !1, m(Z), Z = -1), l = !0;
    var _ = B;
    try {
      for (f($), C = t(I); C !== null && (!(C.expirationTime > $) || O && !p()); ) {
        var tA = C.callback;
        if (typeof tA == "function") {
          C.callback = null, B = C.priorityLevel;
          var nA = tA(C.expirationTime <= $);
          $ = A.unstable_now(), typeof nA == "function" ? C.callback = nA : C === t(I) && i(I), f($);
        } else
          i(I);
        C = t(I);
      }
      if (C !== null)
        var AA = !0;
      else {
        var gA = t(r);
        gA !== null && q(w, gA.startTime - $), AA = !1;
      }
      return AA;
    } finally {
      C = null, B = _, l = !1;
    }
  }
  var R = !1, F = null, Z = -1, c = 5, J = -1;
  function p() {
    return !(A.unstable_now() - J < c);
  }
  function N() {
    if (F !== null) {
      var O = A.unstable_now();
      J = O;
      var $ = !0;
      try {
        $ = F(!0, O);
      } finally {
        $ ? v() : (R = !1, F = null);
      }
    } else
      R = !1;
  }
  var v;
  if (typeof y == "function")
    v = function() {
      y(N);
    };
  else if (typeof MessageChannel < "u") {
    var K = new MessageChannel(), U = K.port2;
    K.port1.onmessage = N, v = function() {
      U.postMessage(null);
    };
  } else
    v = function() {
      d(N, 0);
    };
  function j(O) {
    F = O, R || (R = !0, v());
  }
  function q(O, $) {
    Z = d(function() {
      O(A.unstable_now());
    }, $);
  }
  A.unstable_IdlePriority = 5, A.unstable_ImmediatePriority = 1, A.unstable_LowPriority = 4, A.unstable_NormalPriority = 3, A.unstable_Profiling = null, A.unstable_UserBlockingPriority = 2, A.unstable_cancelCallback = function(O) {
    O.callback = null;
  }, A.unstable_continueExecution = function() {
    Q || l || (Q = !0, j(G));
  }, A.unstable_forceFrameRate = function(O) {
    0 > O || 125 < O ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : c = 0 < O ? Math.floor(1e3 / O) : 5;
  }, A.unstable_getCurrentPriorityLevel = function() {
    return B;
  }, A.unstable_getFirstCallbackNode = function() {
    return t(I);
  }, A.unstable_next = function(O) {
    switch (B) {
      case 1:
      case 2:
      case 3:
        var $ = 3;
        break;
      default:
        $ = B;
    }
    var _ = B;
    B = $;
    try {
      return O();
    } finally {
      B = _;
    }
  }, A.unstable_pauseExecution = function() {
  }, A.unstable_requestPaint = function() {
  }, A.unstable_runWithPriority = function(O, $) {
    switch (O) {
      case 1:
      case 2:
      case 3:
      case 4:
      case 5:
        break;
      default:
        O = 3;
    }
    var _ = B;
    B = O;
    try {
      return $();
    } finally {
      B = _;
    }
  }, A.unstable_scheduleCallback = function(O, $, _) {
    var tA = A.unstable_now();
    switch (typeof _ == "object" && _ !== null ? (_ = _.delay, _ = typeof _ == "number" && 0 < _ ? tA + _ : tA) : _ = tA, O) {
      case 1:
        var nA = -1;
        break;
      case 2:
        nA = 250;
        break;
      case 5:
        nA = 1073741823;
        break;
      case 4:
        nA = 1e4;
        break;
      default:
        nA = 5e3;
    }
    return nA = _ + nA, O = { id: a++, callback: $, priorityLevel: O, startTime: _, expirationTime: nA, sortIndex: -1 }, _ > tA ? (O.sortIndex = _, e(r, O), t(I) === null && O === t(r) && (E ? (m(Z), Z = -1) : E = !0, q(w, _ - tA))) : (O.sortIndex = nA, e(I, O), Q || l || (Q = !0, j(G))), O;
  }, A.unstable_shouldYield = p, A.unstable_wrapCallback = function(O) {
    var $ = B;
    return function() {
      var _ = B;
      B = $;
      try {
        return O.apply(this, arguments);
      } finally {
        B = _;
      }
    };
  };
})(ZfA);
(function(A) {
  A.exports = ZfA;
})(qjA);
/**
 * @license React
 * react-dom.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 WfA = u, qI = o4;
function $A(A) {
  for (var e = "https://reactjs.org/docs/error-decoder.html?invariant=" + A, t = 1; t < arguments.length; t++)
    e += "&args[]=" + encodeURIComponent(arguments[t]);
  return "Minified React error #" + A + "; visit " + e + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
}
var KfA = /* @__PURE__ */ new Set(), VN = {};
function Up(A, e) {
  Lw(A, e), Lw(A + "Capture", e);
}
function Lw(A, e) {
  for (VN[A] = e, A = 0; A < e.length; A++)
    KfA.add(e[A]);
}
var oQ = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), g4 = Object.prototype.hasOwnProperty, OjA = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, UaA = {}, VaA = {};
function jjA(A) {
  return g4.call(VaA, A) ? !0 : g4.call(UaA, A) ? !1 : OjA.test(A) ? VaA[A] = !0 : (UaA[A] = !0, !1);
}
function PjA(A, e, t, i) {
  if (t !== null && t.type === 0)
    return !1;
  switch (typeof e) {
    case "function":
    case "symbol":
      return !0;
    case "boolean":
      return i ? !1 : t !== null ? !t.acceptsBooleans : (A = A.toLowerCase().slice(0, 5), A !== "data-" && A !== "aria-");
    default:
      return !1;
  }
}
function $jA(A, e, t, i) {
  if (e === null || typeof e > "u" || PjA(A, e, t, i))
    return !0;
  if (i)
    return !1;
  if (t !== null)
    switch (t.type) {
      case 3:
        return !e;
      case 4:
        return e === !1;
      case 5:
        return isNaN(e);
      case 6:
        return isNaN(e) || 1 > e;
    }
  return !1;
}
function Qs(A, e, t, i, n, o, g) {
  this.acceptsBooleans = e === 2 || e === 3 || e === 4, this.attributeName = i, this.attributeNamespace = n, this.mustUseProperty = t, this.propertyName = A, this.type = e, this.sanitizeURL = o, this.removeEmptyString = g;
}
var ng = {};
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(A) {
  ng[A] = new Qs(A, 0, !1, A, null, !1, !1);
});
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(A) {
  var e = A[0];
  ng[e] = new Qs(e, 1, !1, A[1], null, !1, !1);
});
["contentEditable", "draggable", "spellCheck", "value"].forEach(function(A) {
  ng[A] = new Qs(A, 2, !1, A.toLowerCase(), null, !1, !1);
});
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(A) {
  ng[A] = new Qs(A, 2, !1, A, null, !1, !1);
});
"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(A) {
  ng[A] = new Qs(A, 3, !1, A.toLowerCase(), null, !1, !1);
});
["checked", "multiple", "muted", "selected"].forEach(function(A) {
  ng[A] = new Qs(A, 3, !0, A, null, !1, !1);
});
["capture", "download"].forEach(function(A) {
  ng[A] = new Qs(A, 4, !1, A, null, !1, !1);
});
["cols", "rows", "size", "span"].forEach(function(A) {
  ng[A] = new Qs(A, 6, !1, A, null, !1, !1);
});
["rowSpan", "start"].forEach(function(A) {
  ng[A] = new Qs(A, 5, !1, A.toLowerCase(), null, !1, !1);
});
var b8 = /[\-:]([a-z])/g;
function w8(A) {
  return A[1].toUpperCase();
}
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(A) {
  var e = A.replace(
    b8,
    w8
  );
  ng[e] = new Qs(e, 1, !1, A, null, !1, !1);
});
"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(A) {
  var e = A.replace(b8, w8);
  ng[e] = new Qs(e, 1, !1, A, "http://www.w3.org/1999/xlink", !1, !1);
});
["xml:base", "xml:lang", "xml:space"].forEach(function(A) {
  var e = A.replace(b8, w8);
  ng[e] = new Qs(e, 1, !1, A, "http://www.w3.org/XML/1998/namespace", !1, !1);
});
["tabIndex", "crossOrigin"].forEach(function(A) {
  ng[A] = new Qs(A, 1, !1, A.toLowerCase(), null, !1, !1);
});
ng.xlinkHref = new Qs("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1);
["src", "href", "action", "formAction"].forEach(function(A) {
  ng[A] = new Qs(A, 1, !1, A.toLowerCase(), null, !0, !0);
});
function f8(A, e, t, i) {
  var n = ng.hasOwnProperty(e) ? ng[e] : null;
  (n !== null ? n.type !== 0 : i || !(2 < e.length) || e[0] !== "o" && e[0] !== "O" || e[1] !== "n" && e[1] !== "N") && ($jA(e, t, n, i) && (t = null), i || n === null ? jjA(e) && (t === null ? A.removeAttribute(e) : A.setAttribute(e, "" + t)) : n.mustUseProperty ? A[n.propertyName] = t === null ? n.type === 3 ? !1 : "" : t : (e = n.attributeName, i = n.attributeNamespace, t === null ? A.removeAttribute(e) : (n = n.type, t = n === 3 || n === 4 && t === !0 ? "" : "" + t, i ? A.setAttributeNS(i, e, t) : A.setAttribute(e, t))));
}
var kQ = WfA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, _1 = Symbol.for("react.element"), ub = Symbol.for("react.portal"), db = Symbol.for("react.fragment"), D8 = Symbol.for("react.strict_mode"), s4 = Symbol.for("react.profiler"), UfA = Symbol.for("react.provider"), VfA = Symbol.for("react.context"), G8 = Symbol.for("react.forward_ref"), I4 = Symbol.for("react.suspense"), a4 = Symbol.for("react.suspense_list"), k8 = Symbol.for("react.memo"), NE = Symbol.for("react.lazy"), XfA = Symbol.for("react.offscreen"), XaA = Symbol.iterator;
function jG(A) {
  return A === null || typeof A != "object" ? null : (A = XaA && A[XaA] || A["@@iterator"], typeof A == "function" ? A : null);
}
var Jn = Object.assign, y9;
function rJ(A) {
  if (y9 === void 0)
    try {
      throw Error();
    } catch (t) {
      var e = t.stack.trim().match(/\n( *(at )?)/);
      y9 = e && e[1] || "";
    }
  return `
` + y9 + A;
}
var b9 = !1;
function w9(A, e) {
  if (!A || b9)
    return "";
  b9 = !0;
  var t = Error.prepareStackTrace;
  Error.prepareStackTrace = void 0;
  try {
    if (e)
      if (e = function() {
        throw Error();
      }, Object.defineProperty(e.prototype, "props", { set: function() {
        throw Error();
      } }), typeof Reflect == "object" && Reflect.construct) {
        try {
          Reflect.construct(e, []);
        } catch (r) {
          var i = r;
        }
        Reflect.construct(A, [], e);
      } else {
        try {
          e.call();
        } catch (r) {
          i = r;
        }
        A.call(e.prototype);
      }
    else {
      try {
        throw Error();
      } catch (r) {
        i = r;
      }
      A();
    }
  } catch (r) {
    if (r && i && typeof r.stack == "string") {
      for (var n = r.stack.split(`
`), o = i.stack.split(`
`), g = n.length - 1, s = o.length - 1; 1 <= g && 0 <= s && n[g] !== o[s]; )
        s--;
      for (; 1 <= g && 0 <= s; g--, s--)
        if (n[g] !== o[s]) {
          if (g !== 1 || s !== 1)
            do
              if (g--, s--, 0 > s || n[g] !== o[s]) {
                var I = `
` + n[g].replace(" at new ", " at ");
                return A.displayName && I.includes("<anonymous>") && (I = I.replace("<anonymous>", A.displayName)), I;
              }
            while (1 <= g && 0 <= s);
          break;
        }
    }
  } finally {
    b9 = !1, Error.prepareStackTrace = t;
  }
  return (A = A ? A.displayName || A.name : "") ? rJ(A) : "";
}
function APA(A) {
  switch (A.tag) {
    case 5:
      return rJ(A.type);
    case 16:
      return rJ("Lazy");
    case 13:
      return rJ("Suspense");
    case 19:
      return rJ("SuspenseList");
    case 0:
    case 2:
    case 15:
      return A = w9(A.type, !1), A;
    case 11:
      return A = w9(A.type.render, !1), A;
    case 1:
      return A = w9(A.type, !0), A;
    default:
      return "";
  }
}
function r4(A) {
  if (A == null)
    return null;
  if (typeof A == "function")
    return A.displayName || A.name || null;
  if (typeof A == "string")
    return A;
  switch (A) {
    case db:
      return "Fragment";
    case ub:
      return "Portal";
    case s4:
      return "Profiler";
    case D8:
      return "StrictMode";
    case I4:
      return "Suspense";
    case a4:
      return "SuspenseList";
  }
  if (typeof A == "object")
    switch (A.$$typeof) {
      case VfA:
        return (A.displayName || "Context") + ".Consumer";
      case UfA:
        return (A._context.displayName || "Context") + ".Provider";
      case G8:
        var e = A.render;
        return A = A.displayName, A || (A = e.displayName || e.name || "", A = A !== "" ? "ForwardRef(" + A + ")" : "ForwardRef"), A;
      case k8:
        return e = A.displayName || null, e !== null ? e : r4(A.type) || "Memo";
      case NE:
        e = A._payload, A = A._init;
        try {
          return r4(A(e));
        } catch {
        }
    }
  return null;
}
function ePA(A) {
  var e = A.type;
  switch (A.tag) {
    case 24:
      return "Cache";
    case 9:
      return (e.displayName || "Context") + ".Consumer";
    case 10:
      return (e._context.displayName || "Context") + ".Provider";
    case 18:
      return "DehydratedFragment";
    case 11:
      return A = e.render, A = A.displayName || A.name || "", e.displayName || (A !== "" ? "ForwardRef(" + A + ")" : "ForwardRef");
    case 7:
      return "Fragment";
    case 5:
      return e;
    case 4:
      return "Portal";
    case 3:
      return "Root";
    case 6:
      return "Text";
    case 16:
      return r4(e);
    case 8:
      return e === D8 ? "StrictMode" : "Mode";
    case 22:
      return "Offscreen";
    case 12:
      return "Profiler";
    case 21:
      return "Scope";
    case 13:
      return "Suspense";
    case 19:
      return "SuspenseList";
    case 25:
      return "TracingMarker";
    case 1:
    case 0:
    case 17:
    case 2:
    case 14:
    case 15:
      if (typeof e == "function")
        return e.displayName || e.name || null;
      if (typeof e == "string")
        return e;
  }
  return null;
}
function xu(A) {
  switch (typeof A) {
    case "boolean":
    case "number":
    case "string":
    case "undefined":
      return A;
    case "object":
      return A;
    default:
      return "";
  }
}
function zfA(A) {
  var e = A.type;
  return (A = A.nodeName) && A.toLowerCase() === "input" && (e === "checkbox" || e === "radio");
}
function tPA(A) {
  var e = zfA(A) ? "checked" : "value", t = Object.getOwnPropertyDescriptor(A.constructor.prototype, e), i = "" + A[e];
  if (!A.hasOwnProperty(e) && typeof t < "u" && typeof t.get == "function" && typeof t.set == "function") {
    var n = t.get, o = t.set;
    return Object.defineProperty(A, e, { configurable: !0, get: function() {
      return n.call(this);
    }, set: function(g) {
      i = "" + g, o.call(this, g);
    } }), Object.defineProperty(A, e, { enumerable: t.enumerable }), { getValue: function() {
      return i;
    }, setValue: function(g) {
      i = "" + g;
    }, stopTracking: function() {
      A._valueTracker = null, delete A[e];
    } };
  }
}
function q1(A) {
  A._valueTracker || (A._valueTracker = tPA(A));
}
function TfA(A) {
  if (!A)
    return !1;
  var e = A._valueTracker;
  if (!e)
    return !0;
  var t = e.getValue(), i = "";
  return A && (i = zfA(A) ? A.checked ? "true" : "false" : A.value), A = i, A !== t ? (e.setValue(A), !0) : !1;
}
function vv(A) {
  if (A = A || (typeof document < "u" ? document : void 0), typeof A > "u")
    return null;
  try {
    return A.activeElement || A.body;
  } catch {
    return A.body;
  }
}
function C4(A, e) {
  var t = e.checked;
  return Jn({}, e, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: t ?? A._wrapperState.initialChecked });
}
function zaA(A, e) {
  var t = e.defaultValue == null ? "" : e.defaultValue, i = e.checked != null ? e.checked : e.defaultChecked;
  t = xu(e.value != null ? e.value : t), A._wrapperState = { initialChecked: i, initialValue: t, controlled: e.type === "checkbox" || e.type === "radio" ? e.checked != null : e.value != null };
}
function _fA(A, e) {
  e = e.checked, e != null && f8(A, "checked", e, !1);
}
function B4(A, e) {
  _fA(A, e);
  var t = xu(e.value), i = e.type;
  if (t != null)
    i === "number" ? (t === 0 && A.value === "" || A.value != t) && (A.value = "" + t) : A.value !== "" + t && (A.value = "" + t);
  else if (i === "submit" || i === "reset") {
    A.removeAttribute("value");
    return;
  }
  e.hasOwnProperty("value") ? l4(A, e.type, t) : e.hasOwnProperty("defaultValue") && l4(A, e.type, xu(e.defaultValue)), e.checked == null && e.defaultChecked != null && (A.defaultChecked = !!e.defaultChecked);
}
function TaA(A, e, t) {
  if (e.hasOwnProperty("value") || e.hasOwnProperty("defaultValue")) {
    var i = e.type;
    if (!(i !== "submit" && i !== "reset" || e.value !== void 0 && e.value !== null))
      return;
    e = "" + A._wrapperState.initialValue, t || e === A.value || (A.value = e), A.defaultValue = e;
  }
  t = A.name, t !== "" && (A.name = ""), A.defaultChecked = !!A._wrapperState.initialChecked, t !== "" && (A.name = t);
}
function l4(A, e, t) {
  (e !== "number" || vv(A.ownerDocument) !== A) && (t == null ? A.defaultValue = "" + A._wrapperState.initialValue : A.defaultValue !== "" + t && (A.defaultValue = "" + t));
}
var CJ = Array.isArray;
function Ob(A, e, t, i) {
  if (A = A.options, e) {
    e = {};
    for (var n = 0; n < t.length; n++)
      e["$" + t[n]] = !0;
    for (t = 0; t < A.length; t++)
      n = e.hasOwnProperty("$" + A[t].value), A[t].selected !== n && (A[t].selected = n), n && i && (A[t].defaultSelected = !0);
  } else {
    for (t = "" + xu(t), e = null, n = 0; n < A.length; n++) {
      if (A[n].value === t) {
        A[n].selected = !0, i && (A[n].defaultSelected = !0);
        return;
      }
      e !== null || A[n].disabled || (e = A[n]);
    }
    e !== null && (e.selected = !0);
  }
}
function c4(A, e) {
  if (e.dangerouslySetInnerHTML != null)
    throw Error($A(91));
  return Jn({}, e, { value: void 0, defaultValue: void 0, children: "" + A._wrapperState.initialValue });
}
function _aA(A, e) {
  var t = e.value;
  if (t == null) {
    if (t = e.children, e = e.defaultValue, t != null) {
      if (e != null)
        throw Error($A(92));
      if (CJ(t)) {
        if (1 < t.length)
          throw Error($A(93));
        t = t[0];
      }
      e = t;
    }
    e == null && (e = ""), t = e;
  }
  A._wrapperState = { initialValue: xu(t) };
}
function qfA(A, e) {
  var t = xu(e.value), i = xu(e.defaultValue);
  t != null && (t = "" + t, t !== A.value && (A.value = t), e.defaultValue == null && A.defaultValue !== t && (A.defaultValue = t)), i != null && (A.defaultValue = "" + i);
}
function qaA(A) {
  var e = A.textContent;
  e === A._wrapperState.initialValue && e !== "" && e !== null && (A.value = e);
}
function OfA(A) {
  switch (A) {
    case "svg":
      return "http://www.w3.org/2000/svg";
    case "math":
      return "http://www.w3.org/1998/Math/MathML";
    default:
      return "http://www.w3.org/1999/xhtml";
  }
}
function Q4(A, e) {
  return A == null || A === "http://www.w3.org/1999/xhtml" ? OfA(e) : A === "http://www.w3.org/2000/svg" && e === "foreignObject" ? "http://www.w3.org/1999/xhtml" : A;
}
var O1, jfA = function(A) {
  return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(e, t, i, n) {
    MSApp.execUnsafeLocalFunction(function() {
      return A(e, t, i, n);
    });
  } : A;
}(function(A, e) {
  if (A.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in A)
    A.innerHTML = e;
  else {
    for (O1 = O1 || document.createElement("div"), O1.innerHTML = "<svg>" + e.valueOf().toString() + "</svg>", e = O1.firstChild; A.firstChild; )
      A.removeChild(A.firstChild);
    for (; e.firstChild; )
      A.appendChild(e.firstChild);
  }
});
function XN(A, e) {
  if (e) {
    var t = A.firstChild;
    if (t && t === A.lastChild && t.nodeType === 3) {
      t.nodeValue = e;
      return;
    }
  }
  A.textContent = e;
}
var PJ = {
  animationIterationCount: !0,
  aspectRatio: !0,
  borderImageOutset: !0,
  borderImageSlice: !0,
  borderImageWidth: !0,
  boxFlex: !0,
  boxFlexGroup: !0,
  boxOrdinalGroup: !0,
  columnCount: !0,
  columns: !0,
  flex: !0,
  flexGrow: !0,
  flexPositive: !0,
  flexShrink: !0,
  flexNegative: !0,
  flexOrder: !0,
  gridArea: !0,
  gridRow: !0,
  gridRowEnd: !0,
  gridRowSpan: !0,
  gridRowStart: !0,
  gridColumn: !0,
  gridColumnEnd: !0,
  gridColumnSpan: !0,
  gridColumnStart: !0,
  fontWeight: !0,
  lineClamp: !0,
  lineHeight: !0,
  opacity: !0,
  order: !0,
  orphans: !0,
  tabSize: !0,
  widows: !0,
  zIndex: !0,
  zoom: !0,
  fillOpacity: !0,
  floodOpacity: !0,
  stopOpacity: !0,
  strokeDasharray: !0,
  strokeDashoffset: !0,
  strokeMiterlimit: !0,
  strokeOpacity: !0,
  strokeWidth: !0
}, iPA = ["Webkit", "ms", "Moz", "O"];
Object.keys(PJ).forEach(function(A) {
  iPA.forEach(function(e) {
    e = e + A.charAt(0).toUpperCase() + A.substring(1), PJ[e] = PJ[A];
  });
});
function PfA(A, e, t) {
  return e == null || typeof e == "boolean" || e === "" ? "" : t || typeof e != "number" || e === 0 || PJ.hasOwnProperty(A) && PJ[A] ? ("" + e).trim() : e + "px";
}
function $fA(A, e) {
  A = A.style;
  for (var t in e)
    if (e.hasOwnProperty(t)) {
      var i = t.indexOf("--") === 0, n = PfA(t, e[t], i);
      t === "float" && (t = "cssFloat"), i ? A.setProperty(t, n) : A[t] = n;
    }
}
var nPA = Jn({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 });
function E4(A, e) {
  if (e) {
    if (nPA[A] && (e.children != null || e.dangerouslySetInnerHTML != null))
      throw Error($A(137, A));
    if (e.dangerouslySetInnerHTML != null) {
      if (e.children != null)
        throw Error($A(60));
      if (typeof e.dangerouslySetInnerHTML != "object" || !("__html" in e.dangerouslySetInnerHTML))
        throw Error($A(61));
    }
    if (e.style != null && typeof e.style != "object")
      throw Error($A(62));
  }
}
function u4(A, e) {
  if (A.indexOf("-") === -1)
    return typeof e.is == "string";
  switch (A) {
    case "annotation-xml":
    case "color-profile":
    case "font-face":
    case "font-face-src":
    case "font-face-uri":
    case "font-face-format":
    case "font-face-name":
    case "missing-glyph":
      return !1;
    default:
      return !0;
  }
}
var d4 = null;
function J8(A) {
  return A = A.target || A.srcElement || window, A.correspondingUseElement && (A = A.correspondingUseElement), A.nodeType === 3 ? A.parentNode : A;
}
var h4 = null, jb = null, Pb = null;
function OaA(A) {
  if (A = gR(A)) {
    if (typeof h4 != "function")
      throw Error($A(280));
    var e = A.stateNode;
    e && (e = CK(e), h4(A.stateNode, A.type, e));
  }
}
function ADA(A) {
  jb ? Pb ? Pb.push(A) : Pb = [A] : jb = A;
}
function eDA() {
  if (jb) {
    var A = jb, e = Pb;
    if (Pb = jb = null, OaA(A), e)
      for (A = 0; A < e.length; A++)
        OaA(e[A]);
  }
}
function tDA(A, e) {
  return A(e);
}
function iDA() {
}
var f9 = !1;
function nDA(A, e, t) {
  if (f9)
    return A(e, t);
  f9 = !0;
  try {
    return tDA(A, e, t);
  } finally {
    f9 = !1, (jb !== null || Pb !== null) && (iDA(), eDA());
  }
}
function zN(A, e) {
  var t = A.stateNode;
  if (t === null)
    return null;
  var i = CK(t);
  if (i === null)
    return null;
  t = i[e];
  A:
    switch (e) {
      case "onClick":
      case "onClickCapture":
      case "onDoubleClick":
      case "onDoubleClickCapture":
      case "onMouseDown":
      case "onMouseDownCapture":
      case "onMouseMove":
      case "onMouseMoveCapture":
      case "onMouseUp":
      case "onMouseUpCapture":
      case "onMouseEnter":
        (i = !i.disabled) || (A = A.type, i = !(A === "button" || A === "input" || A === "select" || A === "textarea")), A = !i;
        break A;
      default:
        A = !1;
    }
  if (A)
    return null;
  if (t && typeof t != "function")
    throw Error($A(231, e, typeof t));
  return t;
}
var m4 = !1;
if (oQ)
  try {
    var PG = {};
    Object.defineProperty(PG, "passive", { get: function() {
      m4 = !0;
    } }), window.addEventListener("test", PG, PG), window.removeEventListener("test", PG, PG);
  } catch {
    m4 = !1;
  }
function oPA(A, e, t, i, n, o, g, s, I) {
  var r = Array.prototype.slice.call(arguments, 3);
  try {
    e.apply(t, r);
  } catch (a) {
    this.onError(a);
  }
}
var $J = !1, Hv = null, Sv = !1, p4 = null, gPA = { onError: function(A) {
  $J = !0, Hv = A;
} };
function sPA(A, e, t, i, n, o, g, s, I) {
  $J = !1, Hv = null, oPA.apply(gPA, arguments);
}
function IPA(A, e, t, i, n, o, g, s, I) {
  if (sPA.apply(this, arguments), $J) {
    if ($J) {
      var r = Hv;
      $J = !1, Hv = null;
    } else
      throw Error($A(198));
    Sv || (Sv = !0, p4 = r);
  }
}
function Vp(A) {
  var e = A, t = A;
  if (A.alternate)
    for (; e.return; )
      e = e.return;
  else {
    A = e;
    do
      e = A, e.flags & 4098 && (t = e.return), A = e.return;
    while (A);
  }
  return e.tag === 3 ? t : null;
}
function oDA(A) {
  if (A.tag === 13) {
    var e = A.memoizedState;
    if (e === null && (A = A.alternate, A !== null && (e = A.memoizedState)), e !== null)
      return e.dehydrated;
  }
  return null;
}
function jaA(A) {
  if (Vp(A) !== A)
    throw Error($A(188));
}
function aPA(A) {
  var e = A.alternate;
  if (!e) {
    if (e = Vp(A), e === null)
      throw Error($A(188));
    return e !== A ? null : A;
  }
  for (var t = A, i = e; ; ) {
    var n = t.return;
    if (n === null)
      break;
    var o = n.alternate;
    if (o === null) {
      if (i = n.return, i !== null) {
        t = i;
        continue;
      }
      break;
    }
    if (n.child === o.child) {
      for (o = n.child; o; ) {
        if (o === t)
          return jaA(n), A;
        if (o === i)
          return jaA(n), e;
        o = o.sibling;
      }
      throw Error($A(188));
    }
    if (t.return !== i.return)
      t = n, i = o;
    else {
      for (var g = !1, s = n.child; s; ) {
        if (s === t) {
          g = !0, t = n, i = o;
          break;
        }
        if (s === i) {
          g = !0, i = n, t = o;
          break;
        }
        s = s.sibling;
      }
      if (!g) {
        for (s = o.child; s; ) {
          if (s === t) {
            g = !0, t = o, i = n;
            break;
          }
          if (s === i) {
            g = !0, i = o, t = n;
            break;
          }
          s = s.sibling;
        }
        if (!g)
          throw Error($A(189));
      }
    }
    if (t.alternate !== i)
      throw Error($A(190));
  }
  if (t.tag !== 3)
    throw Error($A(188));
  return t.stateNode.current === t ? A : e;
}
function gDA(A) {
  return A = aPA(A), A !== null ? sDA(A) : null;
}
function sDA(A) {
  if (A.tag === 5 || A.tag === 6)
    return A;
  for (A = A.child; A !== null; ) {
    var e = sDA(A);
    if (e !== null)
      return e;
    A = A.sibling;
  }
  return null;
}
var IDA = qI.unstable_scheduleCallback, PaA = qI.unstable_cancelCallback, rPA = qI.unstable_shouldYield, CPA = qI.unstable_requestPaint, Vn = qI.unstable_now, BPA = qI.unstable_getCurrentPriorityLevel, N8 = qI.unstable_ImmediatePriority, aDA = qI.unstable_UserBlockingPriority, Zv = qI.unstable_NormalPriority, lPA = qI.unstable_LowPriority, rDA = qI.unstable_IdlePriority, sK = null, vB = null;
function cPA(A) {
  if (vB && typeof vB.onCommitFiberRoot == "function")
    try {
      vB.onCommitFiberRoot(sK, A, void 0, (A.current.flags & 128) === 128);
    } catch {
    }
}
var AC = Math.clz32 ? Math.clz32 : uPA, QPA = Math.log, EPA = Math.LN2;
function uPA(A) {
  return A >>>= 0, A === 0 ? 32 : 31 - (QPA(A) / EPA | 0) | 0;
}
var j1 = 64, P1 = 4194304;
function BJ(A) {
  switch (A & -A) {
    case 1:
      return 1;
    case 2:
      return 2;
    case 4:
      return 4;
    case 8:
      return 8;
    case 16:
      return 16;
    case 32:
      return 32;
    case 64:
    case 128:
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
      return A & 4194240;
    case 4194304:
    case 8388608:
    case 16777216:
    case 33554432:
    case 67108864:
      return A & 130023424;
    case 134217728:
      return 134217728;
    case 268435456:
      return 268435456;
    case 536870912:
      return 536870912;
    case 1073741824:
      return 1073741824;
    default:
      return A;
  }
}
function Wv(A, e) {
  var t = A.pendingLanes;
  if (t === 0)
    return 0;
  var i = 0, n = A.suspendedLanes, o = A.pingedLanes, g = t & 268435455;
  if (g !== 0) {
    var s = g & ~n;
    s !== 0 ? i = BJ(s) : (o &= g, o !== 0 && (i = BJ(o)));
  } else
    g = t & ~n, g !== 0 ? i = BJ(g) : o !== 0 && (i = BJ(o));
  if (i === 0)
    return 0;
  if (e !== 0 && e !== i && !(e & n) && (n = i & -i, o = e & -e, n >= o || n === 16 && (o & 4194240) !== 0))
    return e;
  if (i & 4 && (i |= t & 16), e = A.entangledLanes, e !== 0)
    for (A = A.entanglements, e &= i; 0 < e; )
      t = 31 - AC(e), n = 1 << t, i |= A[t], e &= ~n;
  return i;
}
function dPA(A, e) {
  switch (A) {
    case 1:
    case 2:
    case 4:
      return e + 250;
    case 8:
    case 16:
    case 32:
    case 64:
    case 128:
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
      return e + 5e3;
    case 4194304:
    case 8388608:
    case 16777216:
    case 33554432:
    case 67108864:
      return -1;
    case 134217728:
    case 268435456:
    case 536870912:
    case 1073741824:
      return -1;
    default:
      return -1;
  }
}
function hPA(A, e) {
  for (var t = A.suspendedLanes, i = A.pingedLanes, n = A.expirationTimes, o = A.pendingLanes; 0 < o; ) {
    var g = 31 - AC(o), s = 1 << g, I = n[g];
    I === -1 ? (!(s & t) || s & i) && (n[g] = dPA(s, e)) : I <= e && (A.expiredLanes |= s), o &= ~s;
  }
}
function y4(A) {
  return A = A.pendingLanes & -1073741825, A !== 0 ? A : A & 1073741824 ? 1073741824 : 0;
}
function CDA() {
  var A = j1;
  return j1 <<= 1, !(j1 & 4194240) && (j1 = 64), A;
}
function D9(A) {
  for (var e = [], t = 0; 31 > t; t++)
    e.push(A);
  return e;
}
function nR(A, e, t) {
  A.pendingLanes |= e, e !== 536870912 && (A.suspendedLanes = 0, A.pingedLanes = 0), A = A.eventTimes, e = 31 - AC(e), A[e] = t;
}
function mPA(A, e) {
  var t = A.pendingLanes & ~e;
  A.pendingLanes = e, A.suspendedLanes = 0, A.pingedLanes = 0, A.expiredLanes &= e, A.mutableReadLanes &= e, A.entangledLanes &= e, e = A.entanglements;
  var i = A.eventTimes;
  for (A = A.expirationTimes; 0 < t; ) {
    var n = 31 - AC(t), o = 1 << n;
    e[n] = 0, i[n] = -1, A[n] = -1, t &= ~o;
  }
}
function Y8(A, e) {
  var t = A.entangledLanes |= e;
  for (A = A.entanglements; t; ) {
    var i = 31 - AC(t), n = 1 << i;
    n & e | A[i] & e && (A[i] |= e), t &= ~n;
  }
}
var Ji = 0;
function BDA(A) {
  return A &= -A, 1 < A ? 4 < A ? A & 268435455 ? 16 : 536870912 : 4 : 1;
}
var lDA, R8, cDA, QDA, EDA, b4 = !1, $1 = [], Iu = null, au = null, ru = null, TN = /* @__PURE__ */ new Map(), _N = /* @__PURE__ */ new Map(), SE = [], pPA = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
function $aA(A, e) {
  switch (A) {
    case "focusin":
    case "focusout":
      Iu = null;
      break;
    case "dragenter":
    case "dragleave":
      au = null;
      break;
    case "mouseover":
    case "mouseout":
      ru = null;
      break;
    case "pointerover":
    case "pointerout":
      TN.delete(e.pointerId);
      break;
    case "gotpointercapture":
    case "lostpointercapture":
      _N.delete(e.pointerId);
  }
}
function $G(A, e, t, i, n, o) {
  return A === null || A.nativeEvent !== o ? (A = { blockedOn: e, domEventName: t, eventSystemFlags: i, nativeEvent: o, targetContainers: [n] }, e !== null && (e = gR(e), e !== null && R8(e)), A) : (A.eventSystemFlags |= i, e = A.targetContainers, n !== null && e.indexOf(n) === -1 && e.push(n), A);
}
function yPA(A, e, t, i, n) {
  switch (e) {
    case "focusin":
      return Iu = $G(Iu, A, e, t, i, n), !0;
    case "dragenter":
      return au = $G(au, A, e, t, i, n), !0;
    case "mouseover":
      return ru = $G(ru, A, e, t, i, n), !0;
    case "pointerover":
      var o = n.pointerId;
      return TN.set(o, $G(TN.get(o) || null, A, e, t, i, n)), !0;
    case "gotpointercapture":
      return o = n.pointerId, _N.set(o, $G(_N.get(o) || null, A, e, t, i, n)), !0;
  }
  return !1;
}
function uDA(A) {
  var e = gm(A.target);
  if (e !== null) {
    var t = Vp(e);
    if (t !== null) {
      if (e = t.tag, e === 13) {
        if (e = oDA(t), e !== null) {
          A.blockedOn = e, EDA(A.priority, function() {
            cDA(t);
          });
          return;
        }
      } else if (e === 3 && t.stateNode.current.memoizedState.isDehydrated) {
        A.blockedOn = t.tag === 3 ? t.stateNode.containerInfo : null;
        return;
      }
    }
  }
  A.blockedOn = null;
}
function pL(A) {
  if (A.blockedOn !== null)
    return !1;
  for (var e = A.targetContainers; 0 < e.length; ) {
    var t = w4(A.domEventName, A.eventSystemFlags, e[0], A.nativeEvent);
    if (t === null) {
      t = A.nativeEvent;
      var i = new t.constructor(t.type, t);
      d4 = i, t.target.dispatchEvent(i), d4 = null;
    } else
      return e = gR(t), e !== null && R8(e), A.blockedOn = t, !1;
    e.shift();
  }
  return !0;
}
function ArA(A, e, t) {
  pL(A) && t.delete(e);
}
function bPA() {
  b4 = !1, Iu !== null && pL(Iu) && (Iu = null), au !== null && pL(au) && (au = null), ru !== null && pL(ru) && (ru = null), TN.forEach(ArA), _N.forEach(ArA);
}
function Ak(A, e) {
  A.blockedOn === e && (A.blockedOn = null, b4 || (b4 = !0, qI.unstable_scheduleCallback(qI.unstable_NormalPriority, bPA)));
}
function qN(A) {
  function e(n) {
    return Ak(n, A);
  }
  if (0 < $1.length) {
    Ak($1[0], A);
    for (var t = 1; t < $1.length; t++) {
      var i = $1[t];
      i.blockedOn === A && (i.blockedOn = null);
    }
  }
  for (Iu !== null && Ak(Iu, A), au !== null && Ak(au, A), ru !== null && Ak(ru, A), TN.forEach(e), _N.forEach(e), t = 0; t < SE.length; t++)
    i = SE[t], i.blockedOn === A && (i.blockedOn = null);
  for (; 0 < SE.length && (t = SE[0], t.blockedOn === null); )
    uDA(t), t.blockedOn === null && SE.shift();
}
var $b = kQ.ReactCurrentBatchConfig, Kv = !0;
function wPA(A, e, t, i) {
  var n = Ji, o = $b.transition;
  $b.transition = null;
  try {
    Ji = 1, F8(A, e, t, i);
  } finally {
    Ji = n, $b.transition = o;
  }
}
function fPA(A, e, t, i) {
  var n = Ji, o = $b.transition;
  $b.transition = null;
  try {
    Ji = 4, F8(A, e, t, i);
  } finally {
    Ji = n, $b.transition = o;
  }
}
function F8(A, e, t, i) {
  if (Kv) {
    var n = w4(A, e, t, i);
    if (n === null)
      L9(A, e, i, Uv, t), $aA(A, i);
    else if (yPA(n, A, e, t, i))
      i.stopPropagation();
    else if ($aA(A, i), e & 4 && -1 < pPA.indexOf(A)) {
      for (; n !== null; ) {
        var o = gR(n);
        if (o !== null && lDA(o), o = w4(A, e, t, i), o === null && L9(A, e, i, Uv, t), o === n)
          break;
        n = o;
      }
      n !== null && i.stopPropagation();
    } else
      L9(A, e, i, null, t);
  }
}
var Uv = null;
function w4(A, e, t, i) {
  if (Uv = null, A = J8(i), A = gm(A), A !== null)
    if (e = Vp(A), e === null)
      A = null;
    else if (t = e.tag, t === 13) {
      if (A = oDA(e), A !== null)
        return A;
      A = null;
    } else if (t === 3) {
      if (e.stateNode.current.memoizedState.isDehydrated)
        return e.tag === 3 ? e.stateNode.containerInfo : null;
      A = null;
    } else
      e !== A && (A = null);
  return Uv = A, null;
}
function dDA(A) {
  switch (A) {
    case "cancel":
    case "click":
    case "close":
    case "contextmenu":
    case "copy":
    case "cut":
    case "auxclick":
    case "dblclick":
    case "dragend":
    case "dragstart":
    case "drop":
    case "focusin":
    case "focusout":
    case "input":
    case "invalid":
    case "keydown":
    case "keypress":
    case "keyup":
    case "mousedown":
    case "mouseup":
    case "paste":
    case "pause":
    case "play":
    case "pointercancel":
    case "pointerdown":
    case "pointerup":
    case "ratechange":
    case "reset":
    case "resize":
    case "seeked":
    case "submit":
    case "touchcancel":
    case "touchend":
    case "touchstart":
    case "volumechange":
    case "change":
    case "selectionchange":
    case "textInput":
    case "compositionstart":
    case "compositionend":
    case "compositionupdate":
    case "beforeblur":
    case "afterblur":
    case "beforeinput":
    case "blur":
    case "fullscreenchange":
    case "focus":
    case "hashchange":
    case "popstate":
    case "select":
    case "selectstart":
      return 1;
    case "drag":
    case "dragenter":
    case "dragexit":
    case "dragleave":
    case "dragover":
    case "mousemove":
    case "mouseout":
    case "mouseover":
    case "pointermove":
    case "pointerout":
    case "pointerover":
    case "scroll":
    case "toggle":
    case "touchmove":
    case "wheel":
    case "mouseenter":
    case "mouseleave":
    case "pointerenter":
    case "pointerleave":
      return 4;
    case "message":
      switch (BPA()) {
        case N8:
          return 1;
        case aDA:
          return 4;
        case Zv:
        case lPA:
          return 16;
        case rDA:
          return 536870912;
        default:
          return 16;
      }
    default:
      return 16;
  }
}
var zE = null, M8 = null, yL = null;
function hDA() {
  if (yL)
    return yL;
  var A, e = M8, t = e.length, i, n = "value" in zE ? zE.value : zE.textContent, o = n.length;
  for (A = 0; A < t && e[A] === n[A]; A++)
    ;
  var g = t - A;
  for (i = 1; i <= g && e[t - i] === n[o - i]; i++)
    ;
  return yL = n.slice(A, 1 < i ? 1 - i : void 0);
}
function bL(A) {
  var e = A.keyCode;
  return "charCode" in A ? (A = A.charCode, A === 0 && e === 13 && (A = 13)) : A = e, A === 10 && (A = 13), 32 <= A || A === 13 ? A : 0;
}
function AM() {
  return !0;
}
function erA() {
  return !1;
}
function ra(A) {
  function e(t, i, n, o, g) {
    this._reactName = t, this._targetInst = n, this.type = i, this.nativeEvent = o, this.target = g, this.currentTarget = null;
    for (var s in A)
      A.hasOwnProperty(s) && (t = A[s], this[s] = t ? t(o) : o[s]);
    return this.isDefaultPrevented = (o.defaultPrevented != null ? o.defaultPrevented : o.returnValue === !1) ? AM : erA, this.isPropagationStopped = erA, this;
  }
  return Jn(e.prototype, { preventDefault: function() {
    this.defaultPrevented = !0;
    var t = this.nativeEvent;
    t && (t.preventDefault ? t.preventDefault() : typeof t.returnValue != "unknown" && (t.returnValue = !1), this.isDefaultPrevented = AM);
  }, stopPropagation: function() {
    var t = this.nativeEvent;
    t && (t.stopPropagation ? t.stopPropagation() : typeof t.cancelBubble != "unknown" && (t.cancelBubble = !0), this.isPropagationStopped = AM);
  }, persist: function() {
  }, isPersistent: AM }), e;
}
var BD = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(A) {
  return A.timeStamp || Date.now();
}, defaultPrevented: 0, isTrusted: 0 }, x8 = ra(BD), oR = Jn({}, BD, { view: 0, detail: 0 }), DPA = ra(oR), G9, k9, ek, IK = Jn({}, oR, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: L8, button: 0, buttons: 0, relatedTarget: function(A) {
  return A.relatedTarget === void 0 ? A.fromElement === A.srcElement ? A.toElement : A.fromElement : A.relatedTarget;
}, movementX: function(A) {
  return "movementX" in A ? A.movementX : (A !== ek && (ek && A.type === "mousemove" ? (G9 = A.screenX - ek.screenX, k9 = A.screenY - ek.screenY) : k9 = G9 = 0, ek = A), G9);
}, movementY: function(A) {
  return "movementY" in A ? A.movementY : k9;
} }), trA = ra(IK), GPA = Jn({}, IK, { dataTransfer: 0 }), kPA = ra(GPA), JPA = Jn({}, oR, { relatedTarget: 0 }), J9 = ra(JPA), NPA = Jn({}, BD, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), YPA = ra(NPA), RPA = Jn({}, BD, { clipboardData: function(A) {
  return "clipboardData" in A ? A.clipboardData : window.clipboardData;
} }), FPA = ra(RPA), MPA = Jn({}, BD, { data: 0 }), irA = ra(MPA), xPA = {
  Esc: "Escape",
  Spacebar: " ",
  Left: "ArrowLeft",
  Up: "ArrowUp",
  Right: "ArrowRight",
  Down: "ArrowDown",
  Del: "Delete",
  Win: "OS",
  Menu: "ContextMenu",
  Apps: "ContextMenu",
  Scroll: "ScrollLock",
  MozPrintableKey: "Unidentified"
}, LPA = {
  8: "Backspace",
  9: "Tab",
  12: "Clear",
  13: "Enter",
  16: "Shift",
  17: "Control",
  18: "Alt",
  19: "Pause",
  20: "CapsLock",
  27: "Escape",
  32: " ",
  33: "PageUp",
  34: "PageDown",
  35: "End",
  36: "Home",
  37: "ArrowLeft",
  38: "ArrowUp",
  39: "ArrowRight",
  40: "ArrowDown",
  45: "Insert",
  46: "Delete",
  112: "F1",
  113: "F2",
  114: "F3",
  115: "F4",
  116: "F5",
  117: "F6",
  118: "F7",
  119: "F8",
  120: "F9",
  121: "F10",
  122: "F11",
  123: "F12",
  144: "NumLock",
  145: "ScrollLock",
  224: "Meta"
}, vPA = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };
function HPA(A) {
  var e = this.nativeEvent;
  return e.getModifierState ? e.getModifierState(A) : (A = vPA[A]) ? !!e[A] : !1;
}
function L8() {
  return HPA;
}
var SPA = Jn({}, oR, { key: function(A) {
  if (A.key) {
    var e = xPA[A.key] || A.key;
    if (e !== "Unidentified")
      return e;
  }
  return A.type === "keypress" ? (A = bL(A), A === 13 ? "Enter" : String.fromCharCode(A)) : A.type === "keydown" || A.type === "keyup" ? LPA[A.keyCode] || "Unidentified" : "";
}, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: L8, charCode: function(A) {
  return A.type === "keypress" ? bL(A) : 0;
}, keyCode: function(A) {
  return A.type === "keydown" || A.type === "keyup" ? A.keyCode : 0;
}, which: function(A) {
  return A.type === "keypress" ? bL(A) : A.type === "keydown" || A.type === "keyup" ? A.keyCode : 0;
} }), ZPA = ra(SPA), WPA = Jn({}, IK, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), nrA = ra(WPA), KPA = Jn({}, oR, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: L8 }), UPA = ra(KPA), VPA = Jn({}, BD, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), XPA = ra(VPA), zPA = Jn({}, IK, {
  deltaX: function(A) {
    return "deltaX" in A ? A.deltaX : "wheelDeltaX" in A ? -A.wheelDeltaX : 0;
  },
  deltaY: function(A) {
    return "deltaY" in A ? A.deltaY : "wheelDeltaY" in A ? -A.wheelDeltaY : "wheelDelta" in A ? -A.wheelDelta : 0;
  },
  deltaZ: 0,
  deltaMode: 0
}), TPA = ra(zPA), _PA = [9, 13, 27, 32], v8 = oQ && "CompositionEvent" in window, AN = null;
oQ && "documentMode" in document && (AN = document.documentMode);
var qPA = oQ && "TextEvent" in window && !AN, mDA = oQ && (!v8 || AN && 8 < AN && 11 >= AN), orA = String.fromCharCode(32), grA = !1;
function pDA(A, e) {
  switch (A) {
    case "keyup":
      return _PA.indexOf(e.keyCode) !== -1;
    case "keydown":
      return e.keyCode !== 229;
    case "keypress":
    case "mousedown":
    case "focusout":
      return !0;
    default:
      return !1;
  }
}
function yDA(A) {
  return A = A.detail, typeof A == "object" && "data" in A ? A.data : null;
}
var hb = !1;
function OPA(A, e) {
  switch (A) {
    case "compositionend":
      return yDA(e);
    case "keypress":
      return e.which !== 32 ? null : (grA = !0, orA);
    case "textInput":
      return A = e.data, A === orA && grA ? null : A;
    default:
      return null;
  }
}
function jPA(A, e) {
  if (hb)
    return A === "compositionend" || !v8 && pDA(A, e) ? (A = hDA(), yL = M8 = zE = null, hb = !1, A) : null;
  switch (A) {
    case "paste":
      return null;
    case "keypress":
      if (!(e.ctrlKey || e.altKey || e.metaKey) || e.ctrlKey && e.altKey) {
        if (e.char && 1 < e.char.length)
          return e.char;
        if (e.which)
          return String.fromCharCode(e.which);
      }
      return null;
    case "compositionend":
      return mDA && e.locale !== "ko" ? null : e.data;
    default:
      return null;
  }
}
var PPA = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 };
function srA(A) {
  var e = A && A.nodeName && A.nodeName.toLowerCase();
  return e === "input" ? !!PPA[A.type] : e === "textarea";
}
function bDA(A, e, t, i) {
  ADA(i), e = Vv(e, "onChange"), 0 < e.length && (t = new x8("onChange", "change", null, t, i), A.push({ event: t, listeners: e }));
}
var eN = null, ON = null;
function $PA(A) {
  MDA(A, 0);
}
function aK(A) {
  var e = yb(A);
  if (TfA(e))
    return A;
}
function A6A(A, e) {
  if (A === "change")
    return e;
}
var wDA = !1;
if (oQ) {
  var N9;
  if (oQ) {
    var Y9 = "oninput" in document;
    if (!Y9) {
      var IrA = document.createElement("div");
      IrA.setAttribute("oninput", "return;"), Y9 = typeof IrA.oninput == "function";
    }
    N9 = Y9;
  } else
    N9 = !1;
  wDA = N9 && (!document.documentMode || 9 < document.documentMode);
}
function arA() {
  eN && (eN.detachEvent("onpropertychange", fDA), ON = eN = null);
}
function fDA(A) {
  if (A.propertyName === "value" && aK(ON)) {
    var e = [];
    bDA(e, ON, A, J8(A)), nDA($PA, e);
  }
}
function e6A(A, e, t) {
  A === "focusin" ? (arA(), eN = e, ON = t, eN.attachEvent("onpropertychange", fDA)) : A === "focusout" && arA();
}
function t6A(A) {
  if (A === "selectionchange" || A === "keyup" || A === "keydown")
    return aK(ON);
}
function i6A(A, e) {
  if (A === "click")
    return aK(e);
}
function n6A(A, e) {
  if (A === "input" || A === "change")
    return aK(e);
}
function o6A(A, e) {
  return A === e && (A !== 0 || 1 / A === 1 / e) || A !== A && e !== e;
}
var QC = typeof Object.is == "function" ? Object.is : o6A;
function jN(A, e) {
  if (QC(A, e))
    return !0;
  if (typeof A != "object" || A === null || typeof e != "object" || e === null)
    return !1;
  var t = Object.keys(A), i = Object.keys(e);
  if (t.length !== i.length)
    return !1;
  for (i = 0; i < t.length; i++) {
    var n = t[i];
    if (!g4.call(e, n) || !QC(A[n], e[n]))
      return !1;
  }
  return !0;
}
function rrA(A) {
  for (; A && A.firstChild; )
    A = A.firstChild;
  return A;
}
function CrA(A, e) {
  var t = rrA(A);
  A = 0;
  for (var i; t; ) {
    if (t.nodeType === 3) {
      if (i = A + t.textContent.length, A <= e && i >= e)
        return { node: t, offset: e - A };
      A = i;
    }
    A: {
      for (; t; ) {
        if (t.nextSibling) {
          t = t.nextSibling;
          break A;
        }
        t = t.parentNode;
      }
      t = void 0;
    }
    t = rrA(t);
  }
}
function DDA(A, e) {
  return A && e ? A === e ? !0 : A && A.nodeType === 3 ? !1 : e && e.nodeType === 3 ? DDA(A, e.parentNode) : "contains" in A ? A.contains(e) : A.compareDocumentPosition ? !!(A.compareDocumentPosition(e) & 16) : !1 : !1;
}
function GDA() {
  for (var A = window, e = vv(); e instanceof A.HTMLIFrameElement; ) {
    try {
      var t = typeof e.contentWindow.location.href == "string";
    } catch {
      t = !1;
    }
    if (t)
      A = e.contentWindow;
    else
      break;
    e = vv(A.document);
  }
  return e;
}
function H8(A) {
  var e = A && A.nodeName && A.nodeName.toLowerCase();
  return e && (e === "input" && (A.type === "text" || A.type === "search" || A.type === "tel" || A.type === "url" || A.type === "password") || e === "textarea" || A.contentEditable === "true");
}
function g6A(A) {
  var e = GDA(), t = A.focusedElem, i = A.selectionRange;
  if (e !== t && t && t.ownerDocument && DDA(t.ownerDocument.documentElement, t)) {
    if (i !== null && H8(t)) {
      if (e = i.start, A = i.end, A === void 0 && (A = e), "selectionStart" in t)
        t.selectionStart = e, t.selectionEnd = Math.min(A, t.value.length);
      else if (A = (e = t.ownerDocument || document) && e.defaultView || window, A.getSelection) {
        A = A.getSelection();
        var n = t.textContent.length, o = Math.min(i.start, n);
        i = i.end === void 0 ? o : Math.min(i.end, n), !A.extend && o > i && (n = i, i = o, o = n), n = CrA(t, o);
        var g = CrA(
          t,
          i
        );
        n && g && (A.rangeCount !== 1 || A.anchorNode !== n.node || A.anchorOffset !== n.offset || A.focusNode !== g.node || A.focusOffset !== g.offset) && (e = e.createRange(), e.setStart(n.node, n.offset), A.removeAllRanges(), o > i ? (A.addRange(e), A.extend(g.node, g.offset)) : (e.setEnd(g.node, g.offset), A.addRange(e)));
      }
    }
    for (e = [], A = t; A = A.parentNode; )
      A.nodeType === 1 && e.push({ element: A, left: A.scrollLeft, top: A.scrollTop });
    for (typeof t.focus == "function" && t.focus(), t = 0; t < e.length; t++)
      A = e[t], A.element.scrollLeft = A.left, A.element.scrollTop = A.top;
  }
}
var s6A = oQ && "documentMode" in document && 11 >= document.documentMode, mb = null, f4 = null, tN = null, D4 = !1;
function BrA(A, e, t) {
  var i = t.window === t ? t.document : t.nodeType === 9 ? t : t.ownerDocument;
  D4 || mb == null || mb !== vv(i) || (i = mb, "selectionStart" in i && H8(i) ? i = { start: i.selectionStart, end: i.selectionEnd } : (i = (i.ownerDocument && i.ownerDocument.defaultView || window).getSelection(), i = { anchorNode: i.anchorNode, anchorOffset: i.anchorOffset, focusNode: i.focusNode, focusOffset: i.focusOffset }), tN && jN(tN, i) || (tN = i, i = Vv(f4, "onSelect"), 0 < i.length && (e = new x8("onSelect", "select", null, e, t), A.push({ event: e, listeners: i }), e.target = mb)));
}
function eM(A, e) {
  var t = {};
  return t[A.toLowerCase()] = e.toLowerCase(), t["Webkit" + A] = "webkit" + e, t["Moz" + A] = "moz" + e, t;
}
var pb = { animationend: eM("Animation", "AnimationEnd"), animationiteration: eM("Animation", "AnimationIteration"), animationstart: eM("Animation", "AnimationStart"), transitionend: eM("Transition", "TransitionEnd") }, R9 = {}, kDA = {};
oQ && (kDA = document.createElement("div").style, "AnimationEvent" in window || (delete pb.animationend.animation, delete pb.animationiteration.animation, delete pb.animationstart.animation), "TransitionEvent" in window || delete pb.transitionend.transition);
function rK(A) {
  if (R9[A])
    return R9[A];
  if (!pb[A])
    return A;
  var e = pb[A], t;
  for (t in e)
    if (e.hasOwnProperty(t) && t in kDA)
      return R9[A] = e[t];
  return A;
}
var JDA = rK("animationend"), NDA = rK("animationiteration"), YDA = rK("animationstart"), RDA = rK("transitionend"), FDA = /* @__PURE__ */ new Map(), lrA = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");
function fd(A, e) {
  FDA.set(A, e), Up(e, [A]);
}
for (var F9 = 0; F9 < lrA.length; F9++) {
  var M9 = lrA[F9], I6A = M9.toLowerCase(), a6A = M9[0].toUpperCase() + M9.slice(1);
  fd(I6A, "on" + a6A);
}
fd(JDA, "onAnimationEnd");
fd(NDA, "onAnimationIteration");
fd(YDA, "onAnimationStart");
fd("dblclick", "onDoubleClick");
fd("focusin", "onFocus");
fd("focusout", "onBlur");
fd(RDA, "onTransitionEnd");
Lw("onMouseEnter", ["mouseout", "mouseover"]);
Lw("onMouseLeave", ["mouseout", "mouseover"]);
Lw("onPointerEnter", ["pointerout", "pointerover"]);
Lw("onPointerLeave", ["pointerout", "pointerover"]);
Up("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" "));
Up("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));
Up("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
Up("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" "));
Up("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" "));
Up("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" "));
var lJ = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), r6A = new Set("cancel close invalid load scroll toggle".split(" ").concat(lJ));
function crA(A, e, t) {
  var i = A.type || "unknown-event";
  A.currentTarget = t, IPA(i, e, void 0, A), A.currentTarget = null;
}
function MDA(A, e) {
  e = (e & 4) !== 0;
  for (var t = 0; t < A.length; t++) {
    var i = A[t], n = i.event;
    i = i.listeners;
    A: {
      var o = void 0;
      if (e)
        for (var g = i.length - 1; 0 <= g; g--) {
          var s = i[g], I = s.instance, r = s.currentTarget;
          if (s = s.listener, I !== o && n.isPropagationStopped())
            break A;
          crA(n, s, r), o = I;
        }
      else
        for (g = 0; g < i.length; g++) {
          if (s = i[g], I = s.instance, r = s.currentTarget, s = s.listener, I !== o && n.isPropagationStopped())
            break A;
          crA(n, s, r), o = I;
        }
    }
  }
  if (Sv)
    throw A = p4, Sv = !1, p4 = null, A;
}
function en(A, e) {
  var t = e[Y4];
  t === void 0 && (t = e[Y4] = /* @__PURE__ */ new Set());
  var i = A + "__bubble";
  t.has(i) || (xDA(e, A, 2, !1), t.add(i));
}
function x9(A, e, t) {
  var i = 0;
  e && (i |= 4), xDA(t, A, i, e);
}
var tM = "_reactListening" + Math.random().toString(36).slice(2);
function PN(A) {
  if (!A[tM]) {
    A[tM] = !0, KfA.forEach(function(t) {
      t !== "selectionchange" && (r6A.has(t) || x9(t, !1, A), x9(t, !0, A));
    });
    var e = A.nodeType === 9 ? A : A.ownerDocument;
    e === null || e[tM] || (e[tM] = !0, x9("selectionchange", !1, e));
  }
}
function xDA(A, e, t, i) {
  switch (dDA(e)) {
    case 1:
      var n = wPA;
      break;
    case 4:
      n = fPA;
      break;
    default:
      n = F8;
  }
  t = n.bind(null, e, t, A), n = void 0, !m4 || e !== "touchstart" && e !== "touchmove" && e !== "wheel" || (n = !0), i ? n !== void 0 ? A.addEventListener(e, t, { capture: !0, passive: n }) : A.addEventListener(e, t, !0) : n !== void 0 ? A.addEventListener(e, t, { passive: n }) : A.addEventListener(e, t, !1);
}
function L9(A, e, t, i, n) {
  var o = i;
  if (!(e & 1) && !(e & 2) && i !== null)
    A:
      for (; ; ) {
        if (i === null)
          return;
        var g = i.tag;
        if (g === 3 || g === 4) {
          var s = i.stateNode.containerInfo;
          if (s === n || s.nodeType === 8 && s.parentNode === n)
            break;
          if (g === 4)
            for (g = i.return; g !== null; ) {
              var I = g.tag;
              if ((I === 3 || I === 4) && (I = g.stateNode.containerInfo, I === n || I.nodeType === 8 && I.parentNode === n))
                return;
              g = g.return;
            }
          for (; s !== null; ) {
            if (g = gm(s), g === null)
              return;
            if (I = g.tag, I === 5 || I === 6) {
              i = o = g;
              continue A;
            }
            s = s.parentNode;
          }
        }
        i = i.return;
      }
  nDA(function() {
    var r = o, a = J8(t), C = [];
    A: {
      var B = FDA.get(A);
      if (B !== void 0) {
        var l = x8, Q = A;
        switch (A) {
          case "keypress":
            if (bL(t) === 0)
              break A;
          case "keydown":
          case "keyup":
            l = ZPA;
            break;
          case "focusin":
            Q = "focus", l = J9;
            break;
          case "focusout":
            Q = "blur", l = J9;
            break;
          case "beforeblur":
          case "afterblur":
            l = J9;
            break;
          case "click":
            if (t.button === 2)
              break A;
          case "auxclick":
          case "dblclick":
          case "mousedown":
          case "mousemove":
          case "mouseup":
          case "mouseout":
          case "mouseover":
          case "contextmenu":
            l = trA;
            break;
          case "drag":
          case "dragend":
          case "dragenter":
          case "dragexit":
          case "dragleave":
          case "dragover":
          case "dragstart":
          case "drop":
            l = kPA;
            break;
          case "touchcancel":
          case "touchend":
          case "touchmove":
          case "touchstart":
            l = UPA;
            break;
          case JDA:
          case NDA:
          case YDA:
            l = YPA;
            break;
          case RDA:
            l = XPA;
            break;
          case "scroll":
            l = DPA;
            break;
          case "wheel":
            l = TPA;
            break;
          case "copy":
          case "cut":
          case "paste":
            l = FPA;
            break;
          case "gotpointercapture":
          case "lostpointercapture":
          case "pointercancel":
          case "pointerdown":
          case "pointermove":
          case "pointerout":
          case "pointerover":
          case "pointerup":
            l = nrA;
        }
        var E = (e & 4) !== 0, d = !E && A === "scroll", m = E ? B !== null ? B + "Capture" : null : B;
        E = [];
        for (var y = r, f; y !== null; ) {
          f = y;
          var w = f.stateNode;
          if (f.tag === 5 && w !== null && (f = w, m !== null && (w = zN(y, m), w != null && E.push($N(y, w, f)))), d)
            break;
          y = y.return;
        }
        0 < E.length && (B = new l(B, Q, null, t, a), C.push({ event: B, listeners: E }));
      }
    }
    if (!(e & 7)) {
      A: {
        if (B = A === "mouseover" || A === "pointerover", l = A === "mouseout" || A === "pointerout", B && t !== d4 && (Q = t.relatedTarget || t.fromElement) && (gm(Q) || Q[gQ]))
          break A;
        if ((l || B) && (B = a.window === a ? a : (B = a.ownerDocument) ? B.defaultView || B.parentWindow : window, l ? (Q = t.relatedTarget || t.toElement, l = r, Q = Q ? gm(Q) : null, Q !== null && (d = Vp(Q), Q !== d || Q.tag !== 5 && Q.tag !== 6) && (Q = null)) : (l = null, Q = r), l !== Q)) {
          if (E = trA, w = "onMouseLeave", m = "onMouseEnter", y = "mouse", (A === "pointerout" || A === "pointerover") && (E = nrA, w = "onPointerLeave", m = "onPointerEnter", y = "pointer"), d = l == null ? B : yb(l), f = Q == null ? B : yb(Q), B = new E(w, y + "leave", l, t, a), B.target = d, B.relatedTarget = f, w = null, gm(a) === r && (E = new E(m, y + "enter", Q, t, a), E.target = f, E.relatedTarget = d, w = E), d = w, l && Q)
            e: {
              for (E = l, m = Q, y = 0, f = E; f; f = $0(f))
                y++;
              for (f = 0, w = m; w; w = $0(w))
                f++;
              for (; 0 < y - f; )
                E = $0(E), y--;
              for (; 0 < f - y; )
                m = $0(m), f--;
              for (; y--; ) {
                if (E === m || m !== null && E === m.alternate)
                  break e;
                E = $0(E), m = $0(m);
              }
              E = null;
            }
          else
            E = null;
          l !== null && QrA(C, B, l, E, !1), Q !== null && d !== null && QrA(C, d, Q, E, !0);
        }
      }
      A: {
        if (B = r ? yb(r) : window, l = B.nodeName && B.nodeName.toLowerCase(), l === "select" || l === "input" && B.type === "file")
          var G = A6A;
        else if (srA(B))
          if (wDA)
            G = n6A;
          else {
            G = t6A;
            var R = e6A;
          }
        else
          (l = B.nodeName) && l.toLowerCase() === "input" && (B.type === "checkbox" || B.type === "radio") && (G = i6A);
        if (G && (G = G(A, r))) {
          bDA(C, G, t, a);
          break A;
        }
        R && R(A, B, r), A === "focusout" && (R = B._wrapperState) && R.controlled && B.type === "number" && l4(B, "number", B.value);
      }
      switch (R = r ? yb(r) : window, A) {
        case "focusin":
          (srA(R) || R.contentEditable === "true") && (mb = R, f4 = r, tN = null);
          break;
        case "focusout":
          tN = f4 = mb = null;
          break;
        case "mousedown":
          D4 = !0;
          break;
        case "contextmenu":
        case "mouseup":
        case "dragend":
          D4 = !1, BrA(C, t, a);
          break;
        case "selectionchange":
          if (s6A)
            break;
        case "keydown":
        case "keyup":
          BrA(C, t, a);
      }
      var F;
      if (v8)
        A: {
          switch (A) {
            case "compositionstart":
              var Z = "onCompositionStart";
              break A;
            case "compositionend":
              Z = "onCompositionEnd";
              break A;
            case "compositionupdate":
              Z = "onCompositionUpdate";
              break A;
          }
          Z = void 0;
        }
      else
        hb ? pDA(A, t) && (Z = "onCompositionEnd") : A === "keydown" && t.keyCode === 229 && (Z = "onCompositionStart");
      Z && (mDA && t.locale !== "ko" && (hb || Z !== "onCompositionStart" ? Z === "onCompositionEnd" && hb && (F = hDA()) : (zE = a, M8 = "value" in zE ? zE.value : zE.textContent, hb = !0)), R = Vv(r, Z), 0 < R.length && (Z = new irA(Z, A, null, t, a), C.push({ event: Z, listeners: R }), F ? Z.data = F : (F = yDA(t), F !== null && (Z.data = F)))), (F = qPA ? OPA(A, t) : jPA(A, t)) && (r = Vv(r, "onBeforeInput"), 0 < r.length && (a = new irA("onBeforeInput", "beforeinput", null, t, a), C.push({ event: a, listeners: r }), a.data = F));
    }
    MDA(C, e);
  });
}
function $N(A, e, t) {
  return { instance: A, listener: e, currentTarget: t };
}
function Vv(A, e) {
  for (var t = e + "Capture", i = []; A !== null; ) {
    var n = A, o = n.stateNode;
    n.tag === 5 && o !== null && (n = o, o = zN(A, t), o != null && i.unshift($N(A, o, n)), o = zN(A, e), o != null && i.push($N(A, o, n))), A = A.return;
  }
  return i;
}
function $0(A) {
  if (A === null)
    return null;
  do
    A = A.return;
  while (A && A.tag !== 5);
  return A || null;
}
function QrA(A, e, t, i, n) {
  for (var o = e._reactName, g = []; t !== null && t !== i; ) {
    var s = t, I = s.alternate, r = s.stateNode;
    if (I !== null && I === i)
      break;
    s.tag === 5 && r !== null && (s = r, n ? (I = zN(t, o), I != null && g.unshift($N(t, I, s))) : n || (I = zN(t, o), I != null && g.push($N(t, I, s)))), t = t.return;
  }
  g.length !== 0 && A.push({ event: e, listeners: g });
}
var C6A = /\r\n?/g, B6A = /\u0000|\uFFFD/g;
function ErA(A) {
  return (typeof A == "string" ? A : "" + A).replace(C6A, `
`).replace(B6A, "");
}
function iM(A, e, t) {
  if (e = ErA(e), ErA(A) !== e && t)
    throw Error($A(425));
}
function Xv() {
}
var G4 = null, k4 = null;
function J4(A, e) {
  return A === "textarea" || A === "noscript" || typeof e.children == "string" || typeof e.children == "number" || typeof e.dangerouslySetInnerHTML == "object" && e.dangerouslySetInnerHTML !== null && e.dangerouslySetInnerHTML.__html != null;
}
var N4 = typeof setTimeout == "function" ? setTimeout : void 0, l6A = typeof clearTimeout == "function" ? clearTimeout : void 0, urA = typeof Promise == "function" ? Promise : void 0, c6A = typeof queueMicrotask == "function" ? queueMicrotask : typeof urA < "u" ? function(A) {
  return urA.resolve(null).then(A).catch(Q6A);
} : N4;
function Q6A(A) {
  setTimeout(function() {
    throw A;
  });
}
function v9(A, e) {
  var t = e, i = 0;
  do {
    var n = t.nextSibling;
    if (A.removeChild(t), n && n.nodeType === 8)
      if (t = n.data, t === "/$") {
        if (i === 0) {
          A.removeChild(n), qN(e);
          return;
        }
        i--;
      } else
        t !== "$" && t !== "$?" && t !== "$!" || i++;
    t = n;
  } while (t);
  qN(e);
}
function Cu(A) {
  for (; A != null; A = A.nextSibling) {
    var e = A.nodeType;
    if (e === 1 || e === 3)
      break;
    if (e === 8) {
      if (e = A.data, e === "$" || e === "$!" || e === "$?")
        break;
      if (e === "/$")
        return null;
    }
  }
  return A;
}
function drA(A) {
  A = A.previousSibling;
  for (var e = 0; A; ) {
    if (A.nodeType === 8) {
      var t = A.data;
      if (t === "$" || t === "$!" || t === "$?") {
        if (e === 0)
          return A;
        e--;
      } else
        t === "/$" && e++;
    }
    A = A.previousSibling;
  }
  return null;
}
var lD = Math.random().toString(36).slice(2), QB = "__reactFiber$" + lD, AY = "__reactProps$" + lD, gQ = "__reactContainer$" + lD, Y4 = "__reactEvents$" + lD, E6A = "__reactListeners$" + lD, u6A = "__reactHandles$" + lD;
function gm(A) {
  var e = A[QB];
  if (e)
    return e;
  for (var t = A.parentNode; t; ) {
    if (e = t[gQ] || t[QB]) {
      if (t = e.alternate, e.child !== null || t !== null && t.child !== null)
        for (A = drA(A); A !== null; ) {
          if (t = A[QB])
            return t;
          A = drA(A);
        }
      return e;
    }
    A = t, t = A.parentNode;
  }
  return null;
}
function gR(A) {
  return A = A[QB] || A[gQ], !A || A.tag !== 5 && A.tag !== 6 && A.tag !== 13 && A.tag !== 3 ? null : A;
}
function yb(A) {
  if (A.tag === 5 || A.tag === 6)
    return A.stateNode;
  throw Error($A(33));
}
function CK(A) {
  return A[AY] || null;
}
var R4 = [], bb = -1;
function Dd(A) {
  return { current: A };
}
function In(A) {
  0 > bb || (A.current = R4[bb], R4[bb] = null, bb--);
}
function qi(A, e) {
  bb++, R4[bb] = A.current, A.current = e;
}
var Lu = {}, Jg = Dd(Lu), Ss = Dd(!1), _m = Lu;
function vw(A, e) {
  var t = A.type.contextTypes;
  if (!t)
    return Lu;
  var i = A.stateNode;
  if (i && i.__reactInternalMemoizedUnmaskedChildContext === e)
    return i.__reactInternalMemoizedMaskedChildContext;
  var n = {}, o;
  for (o in t)
    n[o] = e[o];
  return i && (A = A.stateNode, A.__reactInternalMemoizedUnmaskedChildContext = e, A.__reactInternalMemoizedMaskedChildContext = n), n;
}
function Zs(A) {
  return A = A.childContextTypes, A != null;
}
function zv() {
  In(Ss), In(Jg);
}
function hrA(A, e, t) {
  if (Jg.current !== Lu)
    throw Error($A(168));
  qi(Jg, e), qi(Ss, t);
}
function LDA(A, e, t) {
  var i = A.stateNode;
  if (e = e.childContextTypes, typeof i.getChildContext != "function")
    return t;
  i = i.getChildContext();
  for (var n in i)
    if (!(n in e))
      throw Error($A(108, ePA(A) || "Unknown", n));
  return Jn({}, t, i);
}
function Tv(A) {
  return A = (A = A.stateNode) && A.__reactInternalMemoizedMergedChildContext || Lu, _m = Jg.current, qi(Jg, A), qi(Ss, Ss.current), !0;
}
function mrA(A, e, t) {
  var i = A.stateNode;
  if (!i)
    throw Error($A(169));
  t ? (A = LDA(A, e, _m), i.__reactInternalMemoizedMergedChildContext = A, In(Ss), In(Jg), qi(Jg, A)) : In(Ss), qi(Ss, t);
}
var dc = null, BK = !1, H9 = !1;
function vDA(A) {
  dc === null ? dc = [A] : dc.push(A);
}
function d6A(A) {
  BK = !0, vDA(A);
}
function Gd() {
  if (!H9 && dc !== null) {
    H9 = !0;
    var A = 0, e = Ji;
    try {
      var t = dc;
      for (Ji = 1; A < t.length; A++) {
        var i = t[A];
        do
          i = i(!0);
        while (i !== null);
      }
      dc = null, BK = !1;
    } catch (n) {
      throw dc !== null && (dc = dc.slice(A + 1)), IDA(N8, Gd), n;
    } finally {
      Ji = e, H9 = !1;
    }
  }
  return null;
}
var wb = [], fb = 0, _v = null, qv = 0, Da = [], Ga = 0, qm = null, Nc = 1, Yc = "";
function Zh(A, e) {
  wb[fb++] = qv, wb[fb++] = _v, _v = A, qv = e;
}
function HDA(A, e, t) {
  Da[Ga++] = Nc, Da[Ga++] = Yc, Da[Ga++] = qm, qm = A;
  var i = Nc;
  A = Yc;
  var n = 32 - AC(i) - 1;
  i &= ~(1 << n), t += 1;
  var o = 32 - AC(e) + n;
  if (30 < o) {
    var g = n - n % 5;
    o = (i & (1 << g) - 1).toString(32), i >>= g, n -= g, Nc = 1 << 32 - AC(e) + n | t << n | i, Yc = o + A;
  } else
    Nc = 1 << o | t << n | i, Yc = A;
}
function S8(A) {
  A.return !== null && (Zh(A, 1), HDA(A, 1, 0));
}
function Z8(A) {
  for (; A === _v; )
    _v = wb[--fb], wb[fb] = null, qv = wb[--fb], wb[fb] = null;
  for (; A === qm; )
    qm = Da[--Ga], Da[Ga] = null, Yc = Da[--Ga], Da[Ga] = null, Nc = Da[--Ga], Da[Ga] = null;
}
var KI = null, FI = null, cn = !1, Sr = null;
function SDA(A, e) {
  var t = La(5, null, null, 0);
  t.elementType = "DELETED", t.stateNode = e, t.return = A, e = A.deletions, e === null ? (A.deletions = [t], A.flags |= 16) : e.push(t);
}
function prA(A, e) {
  switch (A.tag) {
    case 5:
      var t = A.type;
      return e = e.nodeType !== 1 || t.toLowerCase() !== e.nodeName.toLowerCase() ? null : e, e !== null ? (A.stateNode = e, KI = A, FI = Cu(e.firstChild), !0) : !1;
    case 6:
      return e = A.pendingProps === "" || e.nodeType !== 3 ? null : e, e !== null ? (A.stateNode = e, KI = A, FI = null, !0) : !1;
    case 13:
      return e = e.nodeType !== 8 ? null : e, e !== null ? (t = qm !== null ? { id: Nc, overflow: Yc } : null, A.memoizedState = { dehydrated: e, treeContext: t, retryLane: 1073741824 }, t = La(18, null, null, 0), t.stateNode = e, t.return = A, A.child = t, KI = A, FI = null, !0) : !1;
    default:
      return !1;
  }
}
function F4(A) {
  return (A.mode & 1) !== 0 && (A.flags & 128) === 0;
}
function M4(A) {
  if (cn) {
    var e = FI;
    if (e) {
      var t = e;
      if (!prA(A, e)) {
        if (F4(A))
          throw Error($A(418));
        e = Cu(t.nextSibling);
        var i = KI;
        e && prA(A, e) ? SDA(i, t) : (A.flags = A.flags & -4097 | 2, cn = !1, KI = A);
      }
    } else {
      if (F4(A))
        throw Error($A(418));
      A.flags = A.flags & -4097 | 2, cn = !1, KI = A;
    }
  }
}
function yrA(A) {
  for (A = A.return; A !== null && A.tag !== 5 && A.tag !== 3 && A.tag !== 13; )
    A = A.return;
  KI = A;
}
function nM(A) {
  if (A !== KI)
    return !1;
  if (!cn)
    return yrA(A), cn = !0, !1;
  var e;
  if ((e = A.tag !== 3) && !(e = A.tag !== 5) && (e = A.type, e = e !== "head" && e !== "body" && !J4(A.type, A.memoizedProps)), e && (e = FI)) {
    if (F4(A))
      throw ZDA(), Error($A(418));
    for (; e; )
      SDA(A, e), e = Cu(e.nextSibling);
  }
  if (yrA(A), A.tag === 13) {
    if (A = A.memoizedState, A = A !== null ? A.dehydrated : null, !A)
      throw Error($A(317));
    A: {
      for (A = A.nextSibling, e = 0; A; ) {
        if (A.nodeType === 8) {
          var t = A.data;
          if (t === "/$") {
            if (e === 0) {
              FI = Cu(A.nextSibling);
              break A;
            }
            e--;
          } else
            t !== "$" && t !== "$!" && t !== "$?" || e++;
        }
        A = A.nextSibling;
      }
      FI = null;
    }
  } else
    FI = KI ? Cu(A.stateNode.nextSibling) : null;
  return !0;
}
function ZDA() {
  for (var A = FI; A; )
    A = Cu(A.nextSibling);
}
function Hw() {
  FI = KI = null, cn = !1;
}
function W8(A) {
  Sr === null ? Sr = [A] : Sr.push(A);
}
var h6A = kQ.ReactCurrentBatchConfig;
function Fr(A, e) {
  if (A && A.defaultProps) {
    e = Jn({}, e), A = A.defaultProps;
    for (var t in A)
      e[t] === void 0 && (e[t] = A[t]);
    return e;
  }
  return e;
}
var Ov = Dd(null), jv = null, Db = null, K8 = null;
function U8() {
  K8 = Db = jv = null;
}
function V8(A) {
  var e = Ov.current;
  In(Ov), A._currentValue = e;
}
function x4(A, e, t) {
  for (; A !== null; ) {
    var i = A.alternate;
    if ((A.childLanes & e) !== e ? (A.childLanes |= e, i !== null && (i.childLanes |= e)) : i !== null && (i.childLanes & e) !== e && (i.childLanes |= e), A === t)
      break;
    A = A.return;
  }
}
function Aw(A, e) {
  jv = A, K8 = Db = null, A = A.dependencies, A !== null && A.firstContext !== null && (A.lanes & e && (Ls = !0), A.firstContext = null);
}
function qa(A) {
  var e = A._currentValue;
  if (K8 !== A)
    if (A = { context: A, memoizedValue: e, next: null }, Db === null) {
      if (jv === null)
        throw Error($A(308));
      Db = A, jv.dependencies = { lanes: 0, firstContext: A };
    } else
      Db = Db.next = A;
  return e;
}
var sm = null;
function X8(A) {
  sm === null ? sm = [A] : sm.push(A);
}
function WDA(A, e, t, i) {
  var n = e.interleaved;
  return n === null ? (t.next = t, X8(e)) : (t.next = n.next, n.next = t), e.interleaved = t, sQ(A, i);
}
function sQ(A, e) {
  A.lanes |= e;
  var t = A.alternate;
  for (t !== null && (t.lanes |= e), t = A, A = A.return; A !== null; )
    A.childLanes |= e, t = A.alternate, t !== null && (t.childLanes |= e), t = A, A = A.return;
  return t.tag === 3 ? t.stateNode : null;
}
var YE = !1;
function z8(A) {
  A.updateQueue = { baseState: A.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null };
}
function KDA(A, e) {
  A = A.updateQueue, e.updateQueue === A && (e.updateQueue = { baseState: A.baseState, firstBaseUpdate: A.firstBaseUpdate, lastBaseUpdate: A.lastBaseUpdate, shared: A.shared, effects: A.effects });
}
function Vc(A, e) {
  return { eventTime: A, lane: e, tag: 0, payload: null, callback: null, next: null };
}
function Bu(A, e, t) {
  var i = A.updateQueue;
  if (i === null)
    return null;
  if (i = i.shared, Ai & 2) {
    var n = i.pending;
    return n === null ? e.next = e : (e.next = n.next, n.next = e), i.pending = e, sQ(A, t);
  }
  return n = i.interleaved, n === null ? (e.next = e, X8(i)) : (e.next = n.next, n.next = e), i.interleaved = e, sQ(A, t);
}
function wL(A, e, t) {
  if (e = e.updateQueue, e !== null && (e = e.shared, (t & 4194240) !== 0)) {
    var i = e.lanes;
    i &= A.pendingLanes, t |= i, e.lanes = t, Y8(A, t);
  }
}
function brA(A, e) {
  var t = A.updateQueue, i = A.alternate;
  if (i !== null && (i = i.updateQueue, t === i)) {
    var n = null, o = null;
    if (t = t.firstBaseUpdate, t !== null) {
      do {
        var g = { eventTime: t.eventTime, lane: t.lane, tag: t.tag, payload: t.payload, callback: t.callback, next: null };
        o === null ? n = o = g : o = o.next = g, t = t.next;
      } while (t !== null);
      o === null ? n = o = e : o = o.next = e;
    } else
      n = o = e;
    t = { baseState: i.baseState, firstBaseUpdate: n, lastBaseUpdate: o, shared: i.shared, effects: i.effects }, A.updateQueue = t;
    return;
  }
  A = t.lastBaseUpdate, A === null ? t.firstBaseUpdate = e : A.next = e, t.lastBaseUpdate = e;
}
function Pv(A, e, t, i) {
  var n = A.updateQueue;
  YE = !1;
  var o = n.firstBaseUpdate, g = n.lastBaseUpdate, s = n.shared.pending;
  if (s !== null) {
    n.shared.pending = null;
    var I = s, r = I.next;
    I.next = null, g === null ? o = r : g.next = r, g = I;
    var a = A.alternate;
    a !== null && (a = a.updateQueue, s = a.lastBaseUpdate, s !== g && (s === null ? a.firstBaseUpdate = r : s.next = r, a.lastBaseUpdate = I));
  }
  if (o !== null) {
    var C = n.baseState;
    g = 0, a = r = I = null, s = o;
    do {
      var B = s.lane, l = s.eventTime;
      if ((i & B) === B) {
        a !== null && (a = a.next = {
          eventTime: l,
          lane: 0,
          tag: s.tag,
          payload: s.payload,
          callback: s.callback,
          next: null
        });
        A: {
          var Q = A, E = s;
          switch (B = e, l = t, E.tag) {
            case 1:
              if (Q = E.payload, typeof Q == "function") {
                C = Q.call(l, C, B);
                break A;
              }
              C = Q;
              break A;
            case 3:
              Q.flags = Q.flags & -65537 | 128;
            case 0:
              if (Q = E.payload, B = typeof Q == "function" ? Q.call(l, C, B) : Q, B == null)
                break A;
              C = Jn({}, C, B);
              break A;
            case 2:
              YE = !0;
          }
        }
        s.callback !== null && s.lane !== 0 && (A.flags |= 64, B = n.effects, B === null ? n.effects = [s] : B.push(s));
      } else
        l = { eventTime: l, lane: B, tag: s.tag, payload: s.payload, callback: s.callback, next: null }, a === null ? (r = a = l, I = C) : a = a.next = l, g |= B;
      if (s = s.next, s === null) {
        if (s = n.shared.pending, s === null)
          break;
        B = s, s = B.next, B.next = null, n.lastBaseUpdate = B, n.shared.pending = null;
      }
    } while (1);
    if (a === null && (I = C), n.baseState = I, n.firstBaseUpdate = r, n.lastBaseUpdate = a, e = n.shared.interleaved, e !== null) {
      n = e;
      do
        g |= n.lane, n = n.next;
      while (n !== e);
    } else
      o === null && (n.shared.lanes = 0);
    jm |= g, A.lanes = g, A.memoizedState = C;
  }
}
function wrA(A, e, t) {
  if (A = e.effects, e.effects = null, A !== null)
    for (e = 0; e < A.length; e++) {
      var i = A[e], n = i.callback;
      if (n !== null) {
        if (i.callback = null, i = t, typeof n != "function")
          throw Error($A(191, n));
        n.call(i);
      }
    }
}
var UDA = new WfA.Component().refs;
function L4(A, e, t, i) {
  e = A.memoizedState, t = t(i, e), t = t == null ? e : Jn({}, e, t), A.memoizedState = t, A.lanes === 0 && (A.updateQueue.baseState = t);
}
var lK = { isMounted: function(A) {
  return (A = A._reactInternals) ? Vp(A) === A : !1;
}, enqueueSetState: function(A, e, t) {
  A = A._reactInternals;
  var i = os(), n = cu(A), o = Vc(i, n);
  o.payload = e, t != null && (o.callback = t), e = Bu(A, o, n), e !== null && (eC(e, A, n, i), wL(e, A, n));
}, enqueueReplaceState: function(A, e, t) {
  A = A._reactInternals;
  var i = os(), n = cu(A), o = Vc(i, n);
  o.tag = 1, o.payload = e, t != null && (o.callback = t), e = Bu(A, o, n), e !== null && (eC(e, A, n, i), wL(e, A, n));
}, enqueueForceUpdate: function(A, e) {
  A = A._reactInternals;
  var t = os(), i = cu(A), n = Vc(t, i);
  n.tag = 2, e != null && (n.callback = e), e = Bu(A, n, i), e !== null && (eC(e, A, i, t), wL(e, A, i));
} };
function frA(A, e, t, i, n, o, g) {
  return A = A.stateNode, typeof A.shouldComponentUpdate == "function" ? A.shouldComponentUpdate(i, o, g) : e.prototype && e.prototype.isPureReactComponent ? !jN(t, i) || !jN(n, o) : !0;
}
function VDA(A, e, t) {
  var i = !1, n = Lu, o = e.contextType;
  return typeof o == "object" && o !== null ? o = qa(o) : (n = Zs(e) ? _m : Jg.current, i = e.contextTypes, o = (i = i != null) ? vw(A, n) : Lu), e = new e(t, o), A.memoizedState = e.state !== null && e.state !== void 0 ? e.state : null, e.updater = lK, A.stateNode = e, e._reactInternals = A, i && (A = A.stateNode, A.__reactInternalMemoizedUnmaskedChildContext = n, A.__reactInternalMemoizedMaskedChildContext = o), e;
}
function DrA(A, e, t, i) {
  A = e.state, typeof e.componentWillReceiveProps == "function" && e.componentWillReceiveProps(t, i), typeof e.UNSAFE_componentWillReceiveProps == "function" && e.UNSAFE_componentWillReceiveProps(t, i), e.state !== A && lK.enqueueReplaceState(e, e.state, null);
}
function v4(A, e, t, i) {
  var n = A.stateNode;
  n.props = t, n.state = A.memoizedState, n.refs = UDA, z8(A);
  var o = e.contextType;
  typeof o == "object" && o !== null ? n.context = qa(o) : (o = Zs(e) ? _m : Jg.current, n.context = vw(A, o)), n.state = A.memoizedState, o = e.getDerivedStateFromProps, typeof o == "function" && (L4(A, e, o, t), n.state = A.memoizedState), typeof e.getDerivedStateFromProps == "function" || typeof n.getSnapshotBeforeUpdate == "function" || typeof n.UNSAFE_componentWillMount != "function" && typeof n.componentWillMount != "function" || (e = n.state, typeof n.componentWillMount == "function" && n.componentWillMount(), typeof n.UNSAFE_componentWillMount == "function" && n.UNSAFE_componentWillMount(), e !== n.state && lK.enqueueReplaceState(n, n.state, null), Pv(A, t, n, i), n.state = A.memoizedState), typeof n.componentDidMount == "function" && (A.flags |= 4194308);
}
function tk(A, e, t) {
  if (A = t.ref, A !== null && typeof A != "function" && typeof A != "object") {
    if (t._owner) {
      if (t = t._owner, t) {
        if (t.tag !== 1)
          throw Error($A(309));
        var i = t.stateNode;
      }
      if (!i)
        throw Error($A(147, A));
      var n = i, o = "" + A;
      return e !== null && e.ref !== null && typeof e.ref == "function" && e.ref._stringRef === o ? e.ref : (e = function(g) {
        var s = n.refs;
        s === UDA && (s = n.refs = {}), g === null ? delete s[o] : s[o] = g;
      }, e._stringRef = o, e);
    }
    if (typeof A != "string")
      throw Error($A(284));
    if (!t._owner)
      throw Error($A(290, A));
  }
  return A;
}
function oM(A, e) {
  throw A = Object.prototype.toString.call(e), Error($A(31, A === "[object Object]" ? "object with keys {" + Object.keys(e).join(", ") + "}" : A));
}
function GrA(A) {
  var e = A._init;
  return e(A._payload);
}
function XDA(A) {
  function e(m, y) {
    if (A) {
      var f = m.deletions;
      f === null ? (m.deletions = [y], m.flags |= 16) : f.push(y);
    }
  }
  function t(m, y) {
    if (!A)
      return null;
    for (; y !== null; )
      e(m, y), y = y.sibling;
    return null;
  }
  function i(m, y) {
    for (m = /* @__PURE__ */ new Map(); y !== null; )
      y.key !== null ? m.set(y.key, y) : m.set(y.index, y), y = y.sibling;
    return m;
  }
  function n(m, y) {
    return m = Qu(m, y), m.index = 0, m.sibling = null, m;
  }
  function o(m, y, f) {
    return m.index = f, A ? (f = m.alternate, f !== null ? (f = f.index, f < y ? (m.flags |= 2, y) : f) : (m.flags |= 2, y)) : (m.flags |= 1048576, y);
  }
  function g(m) {
    return A && m.alternate === null && (m.flags |= 2), m;
  }
  function s(m, y, f, w) {
    return y === null || y.tag !== 6 ? (y = X9(f, m.mode, w), y.return = m, y) : (y = n(y, f), y.return = m, y);
  }
  function I(m, y, f, w) {
    var G = f.type;
    return G === db ? a(m, y, f.props.children, w, f.key) : y !== null && (y.elementType === G || typeof G == "object" && G !== null && G.$$typeof === NE && GrA(G) === y.type) ? (w = n(y, f.props), w.ref = tk(m, y, f), w.return = m, w) : (w = NL(f.type, f.key, f.props, null, m.mode, w), w.ref = tk(m, y, f), w.return = m, w);
  }
  function r(m, y, f, w) {
    return y === null || y.tag !== 4 || y.stateNode.containerInfo !== f.containerInfo || y.stateNode.implementation !== f.implementation ? (y = z9(f, m.mode, w), y.return = m, y) : (y = n(y, f.children || []), y.return = m, y);
  }
  function a(m, y, f, w, G) {
    return y === null || y.tag !== 7 ? (y = km(f, m.mode, w, G), y.return = m, y) : (y = n(y, f), y.return = m, y);
  }
  function C(m, y, f) {
    if (typeof y == "string" && y !== "" || typeof y == "number")
      return y = X9("" + y, m.mode, f), y.return = m, y;
    if (typeof y == "object" && y !== null) {
      switch (y.$$typeof) {
        case _1:
          return f = NL(y.type, y.key, y.props, null, m.mode, f), f.ref = tk(m, null, y), f.return = m, f;
        case ub:
          return y = z9(y, m.mode, f), y.return = m, y;
        case NE:
          var w = y._init;
          return C(m, w(y._payload), f);
      }
      if (CJ(y) || jG(y))
        return y = km(y, m.mode, f, null), y.return = m, y;
      oM(m, y);
    }
    return null;
  }
  function B(m, y, f, w) {
    var G = y !== null ? y.key : null;
    if (typeof f == "string" && f !== "" || typeof f == "number")
      return G !== null ? null : s(m, y, "" + f, w);
    if (typeof f == "object" && f !== null) {
      switch (f.$$typeof) {
        case _1:
          return f.key === G ? I(m, y, f, w) : null;
        case ub:
          return f.key === G ? r(m, y, f, w) : null;
        case NE:
          return G = f._init, B(
            m,
            y,
            G(f._payload),
            w
          );
      }
      if (CJ(f) || jG(f))
        return G !== null ? null : a(m, y, f, w, null);
      oM(m, f);
    }
    return null;
  }
  function l(m, y, f, w, G) {
    if (typeof w == "string" && w !== "" || typeof w == "number")
      return m = m.get(f) || null, s(y, m, "" + w, G);
    if (typeof w == "object" && w !== null) {
      switch (w.$$typeof) {
        case _1:
          return m = m.get(w.key === null ? f : w.key) || null, I(y, m, w, G);
        case ub:
          return m = m.get(w.key === null ? f : w.key) || null, r(y, m, w, G);
        case NE:
          var R = w._init;
          return l(m, y, f, R(w._payload), G);
      }
      if (CJ(w) || jG(w))
        return m = m.get(f) || null, a(y, m, w, G, null);
      oM(y, w);
    }
    return null;
  }
  function Q(m, y, f, w) {
    for (var G = null, R = null, F = y, Z = y = 0, c = null; F !== null && Z < f.length; Z++) {
      F.index > Z ? (c = F, F = null) : c = F.sibling;
      var J = B(m, F, f[Z], w);
      if (J === null) {
        F === null && (F = c);
        break;
      }
      A && F && J.alternate === null && e(m, F), y = o(J, y, Z), R === null ? G = J : R.sibling = J, R = J, F = c;
    }
    if (Z === f.length)
      return t(m, F), cn && Zh(m, Z), G;
    if (F === null) {
      for (; Z < f.length; Z++)
        F = C(m, f[Z], w), F !== null && (y = o(F, y, Z), R === null ? G = F : R.sibling = F, R = F);
      return cn && Zh(m, Z), G;
    }
    for (F = i(m, F); Z < f.length; Z++)
      c = l(F, m, Z, f[Z], w), c !== null && (A && c.alternate !== null && F.delete(c.key === null ? Z : c.key), y = o(c, y, Z), R === null ? G = c : R.sibling = c, R = c);
    return A && F.forEach(function(p) {
      return e(m, p);
    }), cn && Zh(m, Z), G;
  }
  function E(m, y, f, w) {
    var G = jG(f);
    if (typeof G != "function")
      throw Error($A(150));
    if (f = G.call(f), f == null)
      throw Error($A(151));
    for (var R = G = null, F = y, Z = y = 0, c = null, J = f.next(); F !== null && !J.done; Z++, J = f.next()) {
      F.index > Z ? (c = F, F = null) : c = F.sibling;
      var p = B(m, F, J.value, w);
      if (p === null) {
        F === null && (F = c);
        break;
      }
      A && F && p.alternate === null && e(m, F), y = o(p, y, Z), R === null ? G = p : R.sibling = p, R = p, F = c;
    }
    if (J.done)
      return t(
        m,
        F
      ), cn && Zh(m, Z), G;
    if (F === null) {
      for (; !J.done; Z++, J = f.next())
        J = C(m, J.value, w), J !== null && (y = o(J, y, Z), R === null ? G = J : R.sibling = J, R = J);
      return cn && Zh(m, Z), G;
    }
    for (F = i(m, F); !J.done; Z++, J = f.next())
      J = l(F, m, Z, J.value, w), J !== null && (A && J.alternate !== null && F.delete(J.key === null ? Z : J.key), y = o(J, y, Z), R === null ? G = J : R.sibling = J, R = J);
    return A && F.forEach(function(N) {
      return e(m, N);
    }), cn && Zh(m, Z), G;
  }
  function d(m, y, f, w) {
    if (typeof f == "object" && f !== null && f.type === db && f.key === null && (f = f.props.children), typeof f == "object" && f !== null) {
      switch (f.$$typeof) {
        case _1:
          A: {
            for (var G = f.key, R = y; R !== null; ) {
              if (R.key === G) {
                if (G = f.type, G === db) {
                  if (R.tag === 7) {
                    t(m, R.sibling), y = n(R, f.props.children), y.return = m, m = y;
                    break A;
                  }
                } else if (R.elementType === G || typeof G == "object" && G !== null && G.$$typeof === NE && GrA(G) === R.type) {
                  t(m, R.sibling), y = n(R, f.props), y.ref = tk(m, R, f), y.return = m, m = y;
                  break A;
                }
                t(m, R);
                break;
              } else
                e(m, R);
              R = R.sibling;
            }
            f.type === db ? (y = km(f.props.children, m.mode, w, f.key), y.return = m, m = y) : (w = NL(f.type, f.key, f.props, null, m.mode, w), w.ref = tk(m, y, f), w.return = m, m = w);
          }
          return g(m);
        case ub:
          A: {
            for (R = f.key; y !== null; ) {
              if (y.key === R)
                if (y.tag === 4 && y.stateNode.containerInfo === f.containerInfo && y.stateNode.implementation === f.implementation) {
                  t(m, y.sibling), y = n(y, f.children || []), y.return = m, m = y;
                  break A;
                } else {
                  t(m, y);
                  break;
                }
              else
                e(m, y);
              y = y.sibling;
            }
            y = z9(f, m.mode, w), y.return = m, m = y;
          }
          return g(m);
        case NE:
          return R = f._init, d(m, y, R(f._payload), w);
      }
      if (CJ(f))
        return Q(m, y, f, w);
      if (jG(f))
        return E(m, y, f, w);
      oM(m, f);
    }
    return typeof f == "string" && f !== "" || typeof f == "number" ? (f = "" + f, y !== null && y.tag === 6 ? (t(m, y.sibling), y = n(y, f), y.return = m, m = y) : (t(m, y), y = X9(f, m.mode, w), y.return = m, m = y), g(m)) : t(m, y);
  }
  return d;
}
var Sw = XDA(!0), zDA = XDA(!1), sR = {}, HB = Dd(sR), eY = Dd(sR), tY = Dd(sR);
function Im(A) {
  if (A === sR)
    throw Error($A(174));
  return A;
}
function T8(A, e) {
  switch (qi(tY, e), qi(eY, A), qi(HB, sR), A = e.nodeType, A) {
    case 9:
    case 11:
      e = (e = e.documentElement) ? e.namespaceURI : Q4(null, "");
      break;
    default:
      A = A === 8 ? e.parentNode : e, e = A.namespaceURI || null, A = A.tagName, e = Q4(e, A);
  }
  In(HB), qi(HB, e);
}
function Zw() {
  In(HB), In(eY), In(tY);
}
function TDA(A) {
  Im(tY.current);
  var e = Im(HB.current), t = Q4(e, A.type);
  e !== t && (qi(eY, A), qi(HB, t));
}
function _8(A) {
  eY.current === A && (In(HB), In(eY));
}
var fn = Dd(0);
function $v(A) {
  for (var e = A; e !== null; ) {
    if (e.tag === 13) {
      var t = e.memoizedState;
      if (t !== null && (t = t.dehydrated, t === null || t.data === "$?" || t.data === "$!"))
        return e;
    } else if (e.tag === 19 && e.memoizedProps.revealOrder !== void 0) {
      if (e.flags & 128)
        return e;
    } else if (e.child !== null) {
      e.child.return = e, e = e.child;
      continue;
    }
    if (e === A)
      break;
    for (; e.sibling === null; ) {
      if (e.return === null || e.return === A)
        return null;
      e = e.return;
    }
    e.sibling.return = e.return, e = e.sibling;
  }
  return null;
}
var S9 = [];
function q8() {
  for (var A = 0; A < S9.length; A++)
    S9[A]._workInProgressVersionPrimary = null;
  S9.length = 0;
}
var fL = kQ.ReactCurrentDispatcher, Z9 = kQ.ReactCurrentBatchConfig, Om = 0, kn = null, so = null, Go = null, AH = !1, iN = !1, iY = 0, m6A = 0;
function Cg() {
  throw Error($A(321));
}
function O8(A, e) {
  if (e === null)
    return !1;
  for (var t = 0; t < e.length && t < A.length; t++)
    if (!QC(A[t], e[t]))
      return !1;
  return !0;
}
function j8(A, e, t, i, n, o) {
  if (Om = o, kn = e, e.memoizedState = null, e.updateQueue = null, e.lanes = 0, fL.current = A === null || A.memoizedState === null ? w6A : f6A, A = t(i, n), iN) {
    o = 0;
    do {
      if (iN = !1, iY = 0, 25 <= o)
        throw Error($A(301));
      o += 1, Go = so = null, e.updateQueue = null, fL.current = D6A, A = t(i, n);
    } while (iN);
  }
  if (fL.current = eH, e = so !== null && so.next !== null, Om = 0, Go = so = kn = null, AH = !1, e)
    throw Error($A(300));
  return A;
}
function P8() {
  var A = iY !== 0;
  return iY = 0, A;
}
function oB() {
  var A = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null };
  return Go === null ? kn.memoizedState = Go = A : Go = Go.next = A, Go;
}
function Oa() {
  if (so === null) {
    var A = kn.alternate;
    A = A !== null ? A.memoizedState : null;
  } else
    A = so.next;
  var e = Go === null ? kn.memoizedState : Go.next;
  if (e !== null)
    Go = e, so = A;
  else {
    if (A === null)
      throw Error($A(310));
    so = A, A = { memoizedState: so.memoizedState, baseState: so.baseState, baseQueue: so.baseQueue, queue: so.queue, next: null }, Go === null ? kn.memoizedState = Go = A : Go = Go.next = A;
  }
  return Go;
}
function nY(A, e) {
  return typeof e == "function" ? e(A) : e;
}
function W9(A) {
  var e = Oa(), t = e.queue;
  if (t === null)
    throw Error($A(311));
  t.lastRenderedReducer = A;
  var i = so, n = i.baseQueue, o = t.pending;
  if (o !== null) {
    if (n !== null) {
      var g = n.next;
      n.next = o.next, o.next = g;
    }
    i.baseQueue = n = o, t.pending = null;
  }
  if (n !== null) {
    o = n.next, i = i.baseState;
    var s = g = null, I = null, r = o;
    do {
      var a = r.lane;
      if ((Om & a) === a)
        I !== null && (I = I.next = { lane: 0, action: r.action, hasEagerState: r.hasEagerState, eagerState: r.eagerState, next: null }), i = r.hasEagerState ? r.eagerState : A(i, r.action);
      else {
        var C = {
          lane: a,
          action: r.action,
          hasEagerState: r.hasEagerState,
          eagerState: r.eagerState,
          next: null
        };
        I === null ? (s = I = C, g = i) : I = I.next = C, kn.lanes |= a, jm |= a;
      }
      r = r.next;
    } while (r !== null && r !== o);
    I === null ? g = i : I.next = s, QC(i, e.memoizedState) || (Ls = !0), e.memoizedState = i, e.baseState = g, e.baseQueue = I, t.lastRenderedState = i;
  }
  if (A = t.interleaved, A !== null) {
    n = A;
    do
      o = n.lane, kn.lanes |= o, jm |= o, n = n.next;
    while (n !== A);
  } else
    n === null && (t.lanes = 0);
  return [e.memoizedState, t.dispatch];
}
function K9(A) {
  var e = Oa(), t = e.queue;
  if (t === null)
    throw Error($A(311));
  t.lastRenderedReducer = A;
  var i = t.dispatch, n = t.pending, o = e.memoizedState;
  if (n !== null) {
    t.pending = null;
    var g = n = n.next;
    do
      o = A(o, g.action), g = g.next;
    while (g !== n);
    QC(o, e.memoizedState) || (Ls = !0), e.memoizedState = o, e.baseQueue === null && (e.baseState = o), t.lastRenderedState = o;
  }
  return [o, i];
}
function _DA() {
}
function qDA(A, e) {
  var t = kn, i = Oa(), n = e(), o = !QC(i.memoizedState, n);
  if (o && (i.memoizedState = n, Ls = !0), i = i.queue, $8(PDA.bind(null, t, i, A), [A]), i.getSnapshot !== e || o || Go !== null && Go.memoizedState.tag & 1) {
    if (t.flags |= 2048, oY(9, jDA.bind(null, t, i, n, e), void 0, null), xo === null)
      throw Error($A(349));
    Om & 30 || ODA(t, e, n);
  }
  return n;
}
function ODA(A, e, t) {
  A.flags |= 16384, A = { getSnapshot: e, value: t }, e = kn.updateQueue, e === null ? (e = { lastEffect: null, stores: null }, kn.updateQueue = e, e.stores = [A]) : (t = e.stores, t === null ? e.stores = [A] : t.push(A));
}
function jDA(A, e, t, i) {
  e.value = t, e.getSnapshot = i, $DA(e) && AGA(A);
}
function PDA(A, e, t) {
  return t(function() {
    $DA(e) && AGA(A);
  });
}
function $DA(A) {
  var e = A.getSnapshot;
  A = A.value;
  try {
    var t = e();
    return !QC(A, t);
  } catch {
    return !0;
  }
}
function AGA(A) {
  var e = sQ(A, 1);
  e !== null && eC(e, A, 1, -1);
}
function krA(A) {
  var e = oB();
  return typeof A == "function" && (A = A()), e.memoizedState = e.baseState = A, A = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: nY, lastRenderedState: A }, e.queue = A, A = A.dispatch = b6A.bind(null, kn, A), [e.memoizedState, A];
}
function oY(A, e, t, i) {
  return A = { tag: A, create: e, destroy: t, deps: i, next: null }, e = kn.updateQueue, e === null ? (e = { lastEffect: null, stores: null }, kn.updateQueue = e, e.lastEffect = A.next = A) : (t = e.lastEffect, t === null ? e.lastEffect = A.next = A : (i = t.next, t.next = A, A.next = i, e.lastEffect = A)), A;
}
function eGA() {
  return Oa().memoizedState;
}
function DL(A, e, t, i) {
  var n = oB();
  kn.flags |= A, n.memoizedState = oY(1 | e, t, void 0, i === void 0 ? null : i);
}
function cK(A, e, t, i) {
  var n = Oa();
  i = i === void 0 ? null : i;
  var o = void 0;
  if (so !== null) {
    var g = so.memoizedState;
    if (o = g.destroy, i !== null && O8(i, g.deps)) {
      n.memoizedState = oY(e, t, o, i);
      return;
    }
  }
  kn.flags |= A, n.memoizedState = oY(1 | e, t, o, i);
}
function JrA(A, e) {
  return DL(8390656, 8, A, e);
}
function $8(A, e) {
  return cK(2048, 8, A, e);
}
function tGA(A, e) {
  return cK(4, 2, A, e);
}
function iGA(A, e) {
  return cK(4, 4, A, e);
}
function nGA(A, e) {
  if (typeof e == "function")
    return A = A(), e(A), function() {
      e(null);
    };
  if (e != null)
    return A = A(), e.current = A, function() {
      e.current = null;
    };
}
function oGA(A, e, t) {
  return t = t != null ? t.concat([A]) : null, cK(4, 4, nGA.bind(null, e, A), t);
}
function A$() {
}
function gGA(A, e) {
  var t = Oa();
  e = e === void 0 ? null : e;
  var i = t.memoizedState;
  return i !== null && e !== null && O8(e, i[1]) ? i[0] : (t.memoizedState = [A, e], A);
}
function sGA(A, e) {
  var t = Oa();
  e = e === void 0 ? null : e;
  var i = t.memoizedState;
  return i !== null && e !== null && O8(e, i[1]) ? i[0] : (A = A(), t.memoizedState = [A, e], A);
}
function IGA(A, e, t) {
  return Om & 21 ? (QC(t, e) || (t = CDA(), kn.lanes |= t, jm |= t, A.baseState = !0), e) : (A.baseState && (A.baseState = !1, Ls = !0), A.memoizedState = t);
}
function p6A(A, e) {
  var t = Ji;
  Ji = t !== 0 && 4 > t ? t : 4, A(!0);
  var i = Z9.transition;
  Z9.transition = {};
  try {
    A(!1), e();
  } finally {
    Ji = t, Z9.transition = i;
  }
}
function aGA() {
  return Oa().memoizedState;
}
function y6A(A, e, t) {
  var i = cu(A);
  if (t = { lane: i, action: t, hasEagerState: !1, eagerState: null, next: null }, rGA(A))
    CGA(e, t);
  else if (t = WDA(A, e, t, i), t !== null) {
    var n = os();
    eC(t, A, i, n), BGA(t, e, i);
  }
}
function b6A(A, e, t) {
  var i = cu(A), n = { lane: i, action: t, hasEagerState: !1, eagerState: null, next: null };
  if (rGA(A))
    CGA(e, n);
  else {
    var o = A.alternate;
    if (A.lanes === 0 && (o === null || o.lanes === 0) && (o = e.lastRenderedReducer, o !== null))
      try {
        var g = e.lastRenderedState, s = o(g, t);
        if (n.hasEagerState = !0, n.eagerState = s, QC(s, g)) {
          var I = e.interleaved;
          I === null ? (n.next = n, X8(e)) : (n.next = I.next, I.next = n), e.interleaved = n;
          return;
        }
      } catch {
      } finally {
      }
    t = WDA(A, e, n, i), t !== null && (n = os(), eC(t, A, i, n), BGA(t, e, i));
  }
}
function rGA(A) {
  var e = A.alternate;
  return A === kn || e !== null && e === kn;
}
function CGA(A, e) {
  iN = AH = !0;
  var t = A.pending;
  t === null ? e.next = e : (e.next = t.next, t.next = e), A.pending = e;
}
function BGA(A, e, t) {
  if (t & 4194240) {
    var i = e.lanes;
    i &= A.pendingLanes, t |= i, e.lanes = t, Y8(A, t);
  }
}
var eH = { readContext: qa, useCallback: Cg, useContext: Cg, useEffect: Cg, useImperativeHandle: Cg, useInsertionEffect: Cg, useLayoutEffect: Cg, useMemo: Cg, useReducer: Cg, useRef: Cg, useState: Cg, useDebugValue: Cg, useDeferredValue: Cg, useTransition: Cg, useMutableSource: Cg, useSyncExternalStore: Cg, useId: Cg, unstable_isNewReconciler: !1 }, w6A = { readContext: qa, useCallback: function(A, e) {
  return oB().memoizedState = [A, e === void 0 ? null : e], A;
}, useContext: qa, useEffect: JrA, useImperativeHandle: function(A, e, t) {
  return t = t != null ? t.concat([A]) : null, DL(
    4194308,
    4,
    nGA.bind(null, e, A),
    t
  );
}, useLayoutEffect: function(A, e) {
  return DL(4194308, 4, A, e);
}, useInsertionEffect: function(A, e) {
  return DL(4, 2, A, e);
}, useMemo: function(A, e) {
  var t = oB();
  return e = e === void 0 ? null : e, A = A(), t.memoizedState = [A, e], A;
}, useReducer: function(A, e, t) {
  var i = oB();
  return e = t !== void 0 ? t(e) : e, i.memoizedState = i.baseState = e, A = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: A, lastRenderedState: e }, i.queue = A, A = A.dispatch = y6A.bind(null, kn, A), [i.memoizedState, A];
}, useRef: function(A) {
  var e = oB();
  return A = { current: A }, e.memoizedState = A;
}, useState: krA, useDebugValue: A$, useDeferredValue: function(A) {
  return oB().memoizedState = A;
}, useTransition: function() {
  var A = krA(!1), e = A[0];
  return A = p6A.bind(null, A[1]), oB().memoizedState = A, [e, A];
}, useMutableSource: function() {
}, useSyncExternalStore: function(A, e, t) {
  var i = kn, n = oB();
  if (cn) {
    if (t === void 0)
      throw Error($A(407));
    t = t();
  } else {
    if (t = e(), xo === null)
      throw Error($A(349));
    Om & 30 || ODA(i, e, t);
  }
  n.memoizedState = t;
  var o = { value: t, getSnapshot: e };
  return n.queue = o, JrA(PDA.bind(
    null,
    i,
    o,
    A
  ), [A]), i.flags |= 2048, oY(9, jDA.bind(null, i, o, t, e), void 0, null), t;
}, useId: function() {
  var A = oB(), e = xo.identifierPrefix;
  if (cn) {
    var t = Yc, i = Nc;
    t = (i & ~(1 << 32 - AC(i) - 1)).toString(32) + t, e = ":" + e + "R" + t, t = iY++, 0 < t && (e += "H" + t.toString(32)), e += ":";
  } else
    t = m6A++, e = ":" + e + "r" + t.toString(32) + ":";
  return A.memoizedState = e;
}, unstable_isNewReconciler: !1 }, f6A = {
  readContext: qa,
  useCallback: gGA,
  useContext: qa,
  useEffect: $8,
  useImperativeHandle: oGA,
  useInsertionEffect: tGA,
  useLayoutEffect: iGA,
  useMemo: sGA,
  useReducer: W9,
  useRef: eGA,
  useState: function() {
    return W9(nY);
  },
  useDebugValue: A$,
  useDeferredValue: function(A) {
    var e = Oa();
    return IGA(e, so.memoizedState, A);
  },
  useTransition: function() {
    var A = W9(nY)[0], e = Oa().memoizedState;
    return [A, e];
  },
  useMutableSource: _DA,
  useSyncExternalStore: qDA,
  useId: aGA,
  unstable_isNewReconciler: !1
}, D6A = { readContext: qa, useCallback: gGA, useContext: qa, useEffect: $8, useImperativeHandle: oGA, useInsertionEffect: tGA, useLayoutEffect: iGA, useMemo: sGA, useReducer: K9, useRef: eGA, useState: function() {
  return K9(nY);
}, useDebugValue: A$, useDeferredValue: function(A) {
  var e = Oa();
  return so === null ? e.memoizedState = A : IGA(e, so.memoizedState, A);
}, useTransition: function() {
  var A = K9(nY)[0], e = Oa().memoizedState;
  return [A, e];
}, useMutableSource: _DA, useSyncExternalStore: qDA, useId: aGA, unstable_isNewReconciler: !1 };
function Ww(A, e) {
  try {
    var t = "", i = e;
    do
      t += APA(i), i = i.return;
    while (i);
    var n = t;
  } catch (o) {
    n = `
Error generating stack: ` + o.message + `
` + o.stack;
  }
  return { value: A, source: e, stack: n, digest: null };
}
function U9(A, e, t) {
  return { value: A, source: null, stack: t ?? null, digest: e ?? null };
}
function H4(A, e) {
  try {
    console.error(e.value);
  } catch (t) {
    setTimeout(function() {
      throw t;
    });
  }
}
var G6A = typeof WeakMap == "function" ? WeakMap : Map;
function lGA(A, e, t) {
  t = Vc(-1, t), t.tag = 3, t.payload = { element: null };
  var i = e.value;
  return t.callback = function() {
    iH || (iH = !0, _4 = i), H4(A, e);
  }, t;
}
function cGA(A, e, t) {
  t = Vc(-1, t), t.tag = 3;
  var i = A.type.getDerivedStateFromError;
  if (typeof i == "function") {
    var n = e.value;
    t.payload = function() {
      return i(n);
    }, t.callback = function() {
      H4(A, e);
    };
  }
  var o = A.stateNode;
  return o !== null && typeof o.componentDidCatch == "function" && (t.callback = function() {
    H4(A, e), typeof i != "function" && (lu === null ? lu = /* @__PURE__ */ new Set([this]) : lu.add(this));
    var g = e.stack;
    this.componentDidCatch(e.value, { componentStack: g !== null ? g : "" });
  }), t;
}
function NrA(A, e, t) {
  var i = A.pingCache;
  if (i === null) {
    i = A.pingCache = new G6A();
    var n = /* @__PURE__ */ new Set();
    i.set(e, n);
  } else
    n = i.get(e), n === void 0 && (n = /* @__PURE__ */ new Set(), i.set(e, n));
  n.has(t) || (n.add(t), A = W6A.bind(null, A, e, t), e.then(A, A));
}
function YrA(A) {
  do {
    var e;
    if ((e = A.tag === 13) && (e = A.memoizedState, e = e !== null ? e.dehydrated !== null : !0), e)
      return A;
    A = A.return;
  } while (A !== null);
  return null;
}
function RrA(A, e, t, i, n) {
  return A.mode & 1 ? (A.flags |= 65536, A.lanes = n, A) : (A === e ? A.flags |= 65536 : (A.flags |= 128, t.flags |= 131072, t.flags &= -52805, t.tag === 1 && (t.alternate === null ? t.tag = 17 : (e = Vc(-1, 1), e.tag = 2, Bu(t, e, 1))), t.lanes |= 1), A);
}
var k6A = kQ.ReactCurrentOwner, Ls = !1;
function _g(A, e, t, i) {
  e.child = A === null ? zDA(e, null, t, i) : Sw(e, A.child, t, i);
}
function FrA(A, e, t, i, n) {
  t = t.render;
  var o = e.ref;
  return Aw(e, n), i = j8(A, e, t, i, o, n), t = P8(), A !== null && !Ls ? (e.updateQueue = A.updateQueue, e.flags &= -2053, A.lanes &= ~n, IQ(A, e, n)) : (cn && t && S8(e), e.flags |= 1, _g(A, e, i, n), e.child);
}
function MrA(A, e, t, i, n) {
  if (A === null) {
    var o = t.type;
    return typeof o == "function" && !I$(o) && o.defaultProps === void 0 && t.compare === null && t.defaultProps === void 0 ? (e.tag = 15, e.type = o, QGA(A, e, o, i, n)) : (A = NL(t.type, null, i, e, e.mode, n), A.ref = e.ref, A.return = e, e.child = A);
  }
  if (o = A.child, !(A.lanes & n)) {
    var g = o.memoizedProps;
    if (t = t.compare, t = t !== null ? t : jN, t(g, i) && A.ref === e.ref)
      return IQ(A, e, n);
  }
  return e.flags |= 1, A = Qu(o, i), A.ref = e.ref, A.return = e, e.child = A;
}
function QGA(A, e, t, i, n) {
  if (A !== null) {
    var o = A.memoizedProps;
    if (jN(o, i) && A.ref === e.ref)
      if (Ls = !1, e.pendingProps = i = o, (A.lanes & n) !== 0)
        A.flags & 131072 && (Ls = !0);
      else
        return e.lanes = A.lanes, IQ(A, e, n);
  }
  return S4(A, e, t, i, n);
}
function EGA(A, e, t) {
  var i = e.pendingProps, n = i.children, o = A !== null ? A.memoizedState : null;
  if (i.mode === "hidden")
    if (!(e.mode & 1))
      e.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, qi(kb, bI), bI |= t;
    else {
      if (!(t & 1073741824))
        return A = o !== null ? o.baseLanes | t : t, e.lanes = e.childLanes = 1073741824, e.memoizedState = { baseLanes: A, cachePool: null, transitions: null }, e.updateQueue = null, qi(kb, bI), bI |= A, null;
      e.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, i = o !== null ? o.baseLanes : t, qi(kb, bI), bI |= i;
    }
  else
    o !== null ? (i = o.baseLanes | t, e.memoizedState = null) : i = t, qi(kb, bI), bI |= i;
  return _g(A, e, n, t), e.child;
}
function uGA(A, e) {
  var t = e.ref;
  (A === null && t !== null || A !== null && A.ref !== t) && (e.flags |= 512, e.flags |= 2097152);
}
function S4(A, e, t, i, n) {
  var o = Zs(t) ? _m : Jg.current;
  return o = vw(e, o), Aw(e, n), t = j8(A, e, t, i, o, n), i = P8(), A !== null && !Ls ? (e.updateQueue = A.updateQueue, e.flags &= -2053, A.lanes &= ~n, IQ(A, e, n)) : (cn && i && S8(e), e.flags |= 1, _g(A, e, t, n), e.child);
}
function xrA(A, e, t, i, n) {
  if (Zs(t)) {
    var o = !0;
    Tv(e);
  } else
    o = !1;
  if (Aw(e, n), e.stateNode === null)
    GL(A, e), VDA(e, t, i), v4(e, t, i, n), i = !0;
  else if (A === null) {
    var g = e.stateNode, s = e.memoizedProps;
    g.props = s;
    var I = g.context, r = t.contextType;
    typeof r == "object" && r !== null ? r = qa(r) : (r = Zs(t) ? _m : Jg.current, r = vw(e, r));
    var a = t.getDerivedStateFromProps, C = typeof a == "function" || typeof g.getSnapshotBeforeUpdate == "function";
    C || typeof g.UNSAFE_componentWillReceiveProps != "function" && typeof g.componentWillReceiveProps != "function" || (s !== i || I !== r) && DrA(e, g, i, r), YE = !1;
    var B = e.memoizedState;
    g.state = B, Pv(e, i, g, n), I = e.memoizedState, s !== i || B !== I || Ss.current || YE ? (typeof a == "function" && (L4(e, t, a, i), I = e.memoizedState), (s = YE || frA(e, t, s, i, B, I, r)) ? (C || typeof g.UNSAFE_componentWillMount != "function" && typeof g.componentWillMount != "function" || (typeof g.componentWillMount == "function" && g.componentWillMount(), typeof g.UNSAFE_componentWillMount == "function" && g.UNSAFE_componentWillMount()), typeof g.componentDidMount == "function" && (e.flags |= 4194308)) : (typeof g.componentDidMount == "function" && (e.flags |= 4194308), e.memoizedProps = i, e.memoizedState = I), g.props = i, g.state = I, g.context = r, i = s) : (typeof g.componentDidMount == "function" && (e.flags |= 4194308), i = !1);
  } else {
    g = e.stateNode, KDA(A, e), s = e.memoizedProps, r = e.type === e.elementType ? s : Fr(e.type, s), g.props = r, C = e.pendingProps, B = g.context, I = t.contextType, typeof I == "object" && I !== null ? I = qa(I) : (I = Zs(t) ? _m : Jg.current, I = vw(e, I));
    var l = t.getDerivedStateFromProps;
    (a = typeof l == "function" || typeof g.getSnapshotBeforeUpdate == "function") || typeof g.UNSAFE_componentWillReceiveProps != "function" && typeof g.componentWillReceiveProps != "function" || (s !== C || B !== I) && DrA(e, g, i, I), YE = !1, B = e.memoizedState, g.state = B, Pv(e, i, g, n);
    var Q = e.memoizedState;
    s !== C || B !== Q || Ss.current || YE ? (typeof l == "function" && (L4(e, t, l, i), Q = e.memoizedState), (r = YE || frA(e, t, r, i, B, Q, I) || !1) ? (a || typeof g.UNSAFE_componentWillUpdate != "function" && typeof g.componentWillUpdate != "function" || (typeof g.componentWillUpdate == "function" && g.componentWillUpdate(i, Q, I), typeof g.UNSAFE_componentWillUpdate == "function" && g.UNSAFE_componentWillUpdate(i, Q, I)), typeof g.componentDidUpdate == "function" && (e.flags |= 4), typeof g.getSnapshotBeforeUpdate == "function" && (e.flags |= 1024)) : (typeof g.componentDidUpdate != "function" || s === A.memoizedProps && B === A.memoizedState || (e.flags |= 4), typeof g.getSnapshotBeforeUpdate != "function" || s === A.memoizedProps && B === A.memoizedState || (e.flags |= 1024), e.memoizedProps = i, e.memoizedState = Q), g.props = i, g.state = Q, g.context = I, i = r) : (typeof g.componentDidUpdate != "function" || s === A.memoizedProps && B === A.memoizedState || (e.flags |= 4), typeof g.getSnapshotBeforeUpdate != "function" || s === A.memoizedProps && B === A.memoizedState || (e.flags |= 1024), i = !1);
  }
  return Z4(A, e, t, i, o, n);
}
function Z4(A, e, t, i, n, o) {
  uGA(A, e);
  var g = (e.flags & 128) !== 0;
  if (!i && !g)
    return n && mrA(e, t, !1), IQ(A, e, o);
  i = e.stateNode, k6A.current = e;
  var s = g && typeof t.getDerivedStateFromError != "function" ? null : i.render();
  return e.flags |= 1, A !== null && g ? (e.child = Sw(e, A.child, null, o), e.child = Sw(e, null, s, o)) : _g(A, e, s, o), e.memoizedState = i.state, n && mrA(e, t, !0), e.child;
}
function dGA(A) {
  var e = A.stateNode;
  e.pendingContext ? hrA(A, e.pendingContext, e.pendingContext !== e.context) : e.context && hrA(A, e.context, !1), T8(A, e.containerInfo);
}
function LrA(A, e, t, i, n) {
  return Hw(), W8(n), e.flags |= 256, _g(A, e, t, i), e.child;
}
var W4 = { dehydrated: null, treeContext: null, retryLane: 0 };
function K4(A) {
  return { baseLanes: A, cachePool: null, transitions: null };
}
function hGA(A, e, t) {
  var i = e.pendingProps, n = fn.current, o = !1, g = (e.flags & 128) !== 0, s;
  if ((s = g) || (s = A !== null && A.memoizedState === null ? !1 : (n & 2) !== 0), s ? (o = !0, e.flags &= -129) : (A === null || A.memoizedState !== null) && (n |= 1), qi(fn, n & 1), A === null)
    return M4(e), A = e.memoizedState, A !== null && (A = A.dehydrated, A !== null) ? (e.mode & 1 ? A.data === "$!" ? e.lanes = 8 : e.lanes = 1073741824 : e.lanes = 1, null) : (g = i.children, A = i.fallback, o ? (i = e.mode, o = e.child, g = { mode: "hidden", children: g }, !(i & 1) && o !== null ? (o.childLanes = 0, o.pendingProps = g) : o = uK(g, i, 0, null), A = km(A, i, t, null), o.return = e, A.return = e, o.sibling = A, e.child = o, e.child.memoizedState = K4(t), e.memoizedState = W4, A) : e$(e, g));
  if (n = A.memoizedState, n !== null && (s = n.dehydrated, s !== null))
    return J6A(A, e, g, i, s, n, t);
  if (o) {
    o = i.fallback, g = e.mode, n = A.child, s = n.sibling;
    var I = { mode: "hidden", children: i.children };
    return !(g & 1) && e.child !== n ? (i = e.child, i.childLanes = 0, i.pendingProps = I, e.deletions = null) : (i = Qu(n, I), i.subtreeFlags = n.subtreeFlags & 14680064), s !== null ? o = Qu(s, o) : (o = km(o, g, t, null), o.flags |= 2), o.return = e, i.return = e, i.sibling = o, e.child = i, i = o, o = e.child, g = A.child.memoizedState, g = g === null ? K4(t) : { baseLanes: g.baseLanes | t, cachePool: null, transitions: g.transitions }, o.memoizedState = g, o.childLanes = A.childLanes & ~t, e.memoizedState = W4, i;
  }
  return o = A.child, A = o.sibling, i = Qu(o, { mode: "visible", children: i.children }), !(e.mode & 1) && (i.lanes = t), i.return = e, i.sibling = null, A !== null && (t = e.deletions, t === null ? (e.deletions = [A], e.flags |= 16) : t.push(A)), e.child = i, e.memoizedState = null, i;
}
function e$(A, e) {
  return e = uK({ mode: "visible", children: e }, A.mode, 0, null), e.return = A, A.child = e;
}
function gM(A, e, t, i) {
  return i !== null && W8(i), Sw(e, A.child, null, t), A = e$(e, e.pendingProps.children), A.flags |= 2, e.memoizedState = null, A;
}
function J6A(A, e, t, i, n, o, g) {
  if (t)
    return e.flags & 256 ? (e.flags &= -257, i = U9(Error($A(422))), gM(A, e, g, i)) : e.memoizedState !== null ? (e.child = A.child, e.flags |= 128, null) : (o = i.fallback, n = e.mode, i = uK({ mode: "visible", children: i.children }, n, 0, null), o = km(o, n, g, null), o.flags |= 2, i.return = e, o.return = e, i.sibling = o, e.child = i, e.mode & 1 && Sw(e, A.child, null, g), e.child.memoizedState = K4(g), e.memoizedState = W4, o);
  if (!(e.mode & 1))
    return gM(A, e, g, null);
  if (n.data === "$!") {
    if (i = n.nextSibling && n.nextSibling.dataset, i)
      var s = i.dgst;
    return i = s, o = Error($A(419)), i = U9(o, i, void 0), gM(A, e, g, i);
  }
  if (s = (g & A.childLanes) !== 0, Ls || s) {
    if (i = xo, i !== null) {
      switch (g & -g) {
        case 4:
          n = 2;
          break;
        case 16:
          n = 8;
          break;
        case 64:
        case 128:
        case 256:
        case 512:
        case 1024:
        case 2048:
        case 4096:
        case 8192:
        case 16384:
        case 32768:
        case 65536:
        case 131072:
        case 262144:
        case 524288:
        case 1048576:
        case 2097152:
        case 4194304:
        case 8388608:
        case 16777216:
        case 33554432:
        case 67108864:
          n = 32;
          break;
        case 536870912:
          n = 268435456;
          break;
        default:
          n = 0;
      }
      n = n & (i.suspendedLanes | g) ? 0 : n, n !== 0 && n !== o.retryLane && (o.retryLane = n, sQ(A, n), eC(i, A, n, -1));
    }
    return s$(), i = U9(Error($A(421))), gM(A, e, g, i);
  }
  return n.data === "$?" ? (e.flags |= 128, e.child = A.child, e = K6A.bind(null, A), n._reactRetry = e, null) : (A = o.treeContext, FI = Cu(n.nextSibling), KI = e, cn = !0, Sr = null, A !== null && (Da[Ga++] = Nc, Da[Ga++] = Yc, Da[Ga++] = qm, Nc = A.id, Yc = A.overflow, qm = e), e = e$(e, i.children), e.flags |= 4096, e);
}
function vrA(A, e, t) {
  A.lanes |= e;
  var i = A.alternate;
  i !== null && (i.lanes |= e), x4(A.return, e, t);
}
function V9(A, e, t, i, n) {
  var o = A.memoizedState;
  o === null ? A.memoizedState = { isBackwards: e, rendering: null, renderingStartTime: 0, last: i, tail: t, tailMode: n } : (o.isBackwards = e, o.rendering = null, o.renderingStartTime = 0, o.last = i, o.tail = t, o.tailMode = n);
}
function mGA(A, e, t) {
  var i = e.pendingProps, n = i.revealOrder, o = i.tail;
  if (_g(A, e, i.children, t), i = fn.current, i & 2)
    i = i & 1 | 2, e.flags |= 128;
  else {
    if (A !== null && A.flags & 128)
      A:
        for (A = e.child; A !== null; ) {
          if (A.tag === 13)
            A.memoizedState !== null && vrA(A, t, e);
          else if (A.tag === 19)
            vrA(A, t, e);
          else if (A.child !== null) {
            A.child.return = A, A = A.child;
            continue;
          }
          if (A === e)
            break A;
          for (; A.sibling === null; ) {
            if (A.return === null || A.return === e)
              break A;
            A = A.return;
          }
          A.sibling.return = A.return, A = A.sibling;
        }
    i &= 1;
  }
  if (qi(fn, i), !(e.mode & 1))
    e.memoizedState = null;
  else
    switch (n) {
      case "forwards":
        for (t = e.child, n = null; t !== null; )
          A = t.alternate, A !== null && $v(A) === null && (n = t), t = t.sibling;
        t = n, t === null ? (n = e.child, e.child = null) : (n = t.sibling, t.sibling = null), V9(e, !1, n, t, o);
        break;
      case "backwards":
        for (t = null, n = e.child, e.child = null; n !== null; ) {
          if (A = n.alternate, A !== null && $v(A) === null) {
            e.child = n;
            break;
          }
          A = n.sibling, n.sibling = t, t = n, n = A;
        }
        V9(e, !0, t, null, o);
        break;
      case "together":
        V9(e, !1, null, null, void 0);
        break;
      default:
        e.memoizedState = null;
    }
  return e.child;
}
function GL(A, e) {
  !(e.mode & 1) && A !== null && (A.alternate = null, e.alternate = null, e.flags |= 2);
}
function IQ(A, e, t) {
  if (A !== null && (e.dependencies = A.dependencies), jm |= e.lanes, !(t & e.childLanes))
    return null;
  if (A !== null && e.child !== A.child)
    throw Error($A(153));
  if (e.child !== null) {
    for (A = e.child, t = Qu(A, A.pendingProps), e.child = t, t.return = e; A.sibling !== null; )
      A = A.sibling, t = t.sibling = Qu(A, A.pendingProps), t.return = e;
    t.sibling = null;
  }
  return e.child;
}
function N6A(A, e, t) {
  switch (e.tag) {
    case 3:
      dGA(e), Hw();
      break;
    case 5:
      TDA(e);
      break;
    case 1:
      Zs(e.type) && Tv(e);
      break;
    case 4:
      T8(e, e.stateNode.containerInfo);
      break;
    case 10:
      var i = e.type._context, n = e.memoizedProps.value;
      qi(Ov, i._currentValue), i._currentValue = n;
      break;
    case 13:
      if (i = e.memoizedState, i !== null)
        return i.dehydrated !== null ? (qi(fn, fn.current & 1), e.flags |= 128, null) : t & e.child.childLanes ? hGA(A, e, t) : (qi(fn, fn.current & 1), A = IQ(A, e, t), A !== null ? A.sibling : null);
      qi(fn, fn.current & 1);
      break;
    case 19:
      if (i = (t & e.childLanes) !== 0, A.flags & 128) {
        if (i)
          return mGA(A, e, t);
        e.flags |= 128;
      }
      if (n = e.memoizedState, n !== null && (n.rendering = null, n.tail = null, n.lastEffect = null), qi(fn, fn.current), i)
        break;
      return null;
    case 22:
    case 23:
      return e.lanes = 0, EGA(A, e, t);
  }
  return IQ(A, e, t);
}
var pGA, U4, yGA, bGA;
pGA = function(A, e) {
  for (var t = e.child; t !== null; ) {
    if (t.tag === 5 || t.tag === 6)
      A.appendChild(t.stateNode);
    else if (t.tag !== 4 && t.child !== null) {
      t.child.return = t, t = t.child;
      continue;
    }
    if (t === e)
      break;
    for (; t.sibling === null; ) {
      if (t.return === null || t.return === e)
        return;
      t = t.return;
    }
    t.sibling.return = t.return, t = t.sibling;
  }
};
U4 = function() {
};
yGA = function(A, e, t, i) {
  var n = A.memoizedProps;
  if (n !== i) {
    A = e.stateNode, Im(HB.current);
    var o = null;
    switch (t) {
      case "input":
        n = C4(A, n), i = C4(A, i), o = [];
        break;
      case "select":
        n = Jn({}, n, { value: void 0 }), i = Jn({}, i, { value: void 0 }), o = [];
        break;
      case "textarea":
        n = c4(A, n), i = c4(A, i), o = [];
        break;
      default:
        typeof n.onClick != "function" && typeof i.onClick == "function" && (A.onclick = Xv);
    }
    E4(t, i);
    var g;
    t = null;
    for (r in n)
      if (!i.hasOwnProperty(r) && n.hasOwnProperty(r) && n[r] != null)
        if (r === "style") {
          var s = n[r];
          for (g in s)
            s.hasOwnProperty(g) && (t || (t = {}), t[g] = "");
        } else
          r !== "dangerouslySetInnerHTML" && r !== "children" && r !== "suppressContentEditableWarning" && r !== "suppressHydrationWarning" && r !== "autoFocus" && (VN.hasOwnProperty(r) ? o || (o = []) : (o = o || []).push(r, null));
    for (r in i) {
      var I = i[r];
      if (s = n != null ? n[r] : void 0, i.hasOwnProperty(r) && I !== s && (I != null || s != null))
        if (r === "style")
          if (s) {
            for (g in s)
              !s.hasOwnProperty(g) || I && I.hasOwnProperty(g) || (t || (t = {}), t[g] = "");
            for (g in I)
              I.hasOwnProperty(g) && s[g] !== I[g] && (t || (t = {}), t[g] = I[g]);
          } else
            t || (o || (o = []), o.push(
              r,
              t
            )), t = I;
        else
          r === "dangerouslySetInnerHTML" ? (I = I ? I.__html : void 0, s = s ? s.__html : void 0, I != null && s !== I && (o = o || []).push(r, I)) : r === "children" ? typeof I != "string" && typeof I != "number" || (o = o || []).push(r, "" + I) : r !== "suppressContentEditableWarning" && r !== "suppressHydrationWarning" && (VN.hasOwnProperty(r) ? (I != null && r === "onScroll" && en("scroll", A), o || s === I || (o = [])) : (o = o || []).push(r, I));
    }
    t && (o = o || []).push("style", t);
    var r = o;
    (e.updateQueue = r) && (e.flags |= 4);
  }
};
bGA = function(A, e, t, i) {
  t !== i && (e.flags |= 4);
};
function ik(A, e) {
  if (!cn)
    switch (A.tailMode) {
      case "hidden":
        e = A.tail;
        for (var t = null; e !== null; )
          e.alternate !== null && (t = e), e = e.sibling;
        t === null ? A.tail = null : t.sibling = null;
        break;
      case "collapsed":
        t = A.tail;
        for (var i = null; t !== null; )
          t.alternate !== null && (i = t), t = t.sibling;
        i === null ? e || A.tail === null ? A.tail = null : A.tail.sibling = null : i.sibling = null;
    }
}
function Bg(A) {
  var e = A.alternate !== null && A.alternate.child === A.child, t = 0, i = 0;
  if (e)
    for (var n = A.child; n !== null; )
      t |= n.lanes | n.childLanes, i |= n.subtreeFlags & 14680064, i |= n.flags & 14680064, n.return = A, n = n.sibling;
  else
    for (n = A.child; n !== null; )
      t |= n.lanes | n.childLanes, i |= n.subtreeFlags, i |= n.flags, n.return = A, n = n.sibling;
  return A.subtreeFlags |= i, A.childLanes = t, e;
}
function Y6A(A, e, t) {
  var i = e.pendingProps;
  switch (Z8(e), e.tag) {
    case 2:
    case 16:
    case 15:
    case 0:
    case 11:
    case 7:
    case 8:
    case 12:
    case 9:
    case 14:
      return Bg(e), null;
    case 1:
      return Zs(e.type) && zv(), Bg(e), null;
    case 3:
      return i = e.stateNode, Zw(), In(Ss), In(Jg), q8(), i.pendingContext && (i.context = i.pendingContext, i.pendingContext = null), (A === null || A.child === null) && (nM(e) ? e.flags |= 4 : A === null || A.memoizedState.isDehydrated && !(e.flags & 256) || (e.flags |= 1024, Sr !== null && (j4(Sr), Sr = null))), U4(A, e), Bg(e), null;
    case 5:
      _8(e);
      var n = Im(tY.current);
      if (t = e.type, A !== null && e.stateNode != null)
        yGA(A, e, t, i, n), A.ref !== e.ref && (e.flags |= 512, e.flags |= 2097152);
      else {
        if (!i) {
          if (e.stateNode === null)
            throw Error($A(166));
          return Bg(e), null;
        }
        if (A = Im(HB.current), nM(e)) {
          i = e.stateNode, t = e.type;
          var o = e.memoizedProps;
          switch (i[QB] = e, i[AY] = o, A = (e.mode & 1) !== 0, t) {
            case "dialog":
              en("cancel", i), en("close", i);
              break;
            case "iframe":
            case "object":
            case "embed":
              en("load", i);
              break;
            case "video":
            case "audio":
              for (n = 0; n < lJ.length; n++)
                en(lJ[n], i);
              break;
            case "source":
              en("error", i);
              break;
            case "img":
            case "image":
            case "link":
              en(
                "error",
                i
              ), en("load", i);
              break;
            case "details":
              en("toggle", i);
              break;
            case "input":
              zaA(i, o), en("invalid", i);
              break;
            case "select":
              i._wrapperState = { wasMultiple: !!o.multiple }, en("invalid", i);
              break;
            case "textarea":
              _aA(i, o), en("invalid", i);
          }
          E4(t, o), n = null;
          for (var g in o)
            if (o.hasOwnProperty(g)) {
              var s = o[g];
              g === "children" ? typeof s == "string" ? i.textContent !== s && (o.suppressHydrationWarning !== !0 && iM(i.textContent, s, A), n = ["children", s]) : typeof s == "number" && i.textContent !== "" + s && (o.suppressHydrationWarning !== !0 && iM(
                i.textContent,
                s,
                A
              ), n = ["children", "" + s]) : VN.hasOwnProperty(g) && s != null && g === "onScroll" && en("scroll", i);
            }
          switch (t) {
            case "input":
              q1(i), TaA(i, o, !0);
              break;
            case "textarea":
              q1(i), qaA(i);
              break;
            case "select":
            case "option":
              break;
            default:
              typeof o.onClick == "function" && (i.onclick = Xv);
          }
          i = n, e.updateQueue = i, i !== null && (e.flags |= 4);
        } else {
          g = n.nodeType === 9 ? n : n.ownerDocument, A === "http://www.w3.org/1999/xhtml" && (A = OfA(t)), A === "http://www.w3.org/1999/xhtml" ? t === "script" ? (A = g.createElement("div"), A.innerHTML = "<script><\/script>", A = A.removeChild(A.firstChild)) : typeof i.is == "string" ? A = g.createElement(t, { is: i.is }) : (A = g.createElement(t), t === "select" && (g = A, i.multiple ? g.multiple = !0 : i.size && (g.size = i.size))) : A = g.createElementNS(A, t), A[QB] = e, A[AY] = i, pGA(A, e, !1, !1), e.stateNode = A;
          A: {
            switch (g = u4(t, i), t) {
              case "dialog":
                en("cancel", A), en("close", A), n = i;
                break;
              case "iframe":
              case "object":
              case "embed":
                en("load", A), n = i;
                break;
              case "video":
              case "audio":
                for (n = 0; n < lJ.length; n++)
                  en(lJ[n], A);
                n = i;
                break;
              case "source":
                en("error", A), n = i;
                break;
              case "img":
              case "image":
              case "link":
                en(
                  "error",
                  A
                ), en("load", A), n = i;
                break;
              case "details":
                en("toggle", A), n = i;
                break;
              case "input":
                zaA(A, i), n = C4(A, i), en("invalid", A);
                break;
              case "option":
                n = i;
                break;
              case "select":
                A._wrapperState = { wasMultiple: !!i.multiple }, n = Jn({}, i, { value: void 0 }), en("invalid", A);
                break;
              case "textarea":
                _aA(A, i), n = c4(A, i), en("invalid", A);
                break;
              default:
                n = i;
            }
            E4(t, n), s = n;
            for (o in s)
              if (s.hasOwnProperty(o)) {
                var I = s[o];
                o === "style" ? $fA(A, I) : o === "dangerouslySetInnerHTML" ? (I = I ? I.__html : void 0, I != null && jfA(A, I)) : o === "children" ? typeof I == "string" ? (t !== "textarea" || I !== "") && XN(A, I) : typeof I == "number" && XN(A, "" + I) : o !== "suppressContentEditableWarning" && o !== "suppressHydrationWarning" && o !== "autoFocus" && (VN.hasOwnProperty(o) ? I != null && o === "onScroll" && en("scroll", A) : I != null && f8(A, o, I, g));
              }
            switch (t) {
              case "input":
                q1(A), TaA(A, i, !1);
                break;
              case "textarea":
                q1(A), qaA(A);
                break;
              case "option":
                i.value != null && A.setAttribute("value", "" + xu(i.value));
                break;
              case "select":
                A.multiple = !!i.multiple, o = i.value, o != null ? Ob(A, !!i.multiple, o, !1) : i.defaultValue != null && Ob(
                  A,
                  !!i.multiple,
                  i.defaultValue,
                  !0
                );
                break;
              default:
                typeof n.onClick == "function" && (A.onclick = Xv);
            }
            switch (t) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                i = !!i.autoFocus;
                break A;
              case "img":
                i = !0;
                break A;
              default:
                i = !1;
            }
          }
          i && (e.flags |= 4);
        }
        e.ref !== null && (e.flags |= 512, e.flags |= 2097152);
      }
      return Bg(e), null;
    case 6:
      if (A && e.stateNode != null)
        bGA(A, e, A.memoizedProps, i);
      else {
        if (typeof i != "string" && e.stateNode === null)
          throw Error($A(166));
        if (t = Im(tY.current), Im(HB.current), nM(e)) {
          if (i = e.stateNode, t = e.memoizedProps, i[QB] = e, (o = i.nodeValue !== t) && (A = KI, A !== null))
            switch (A.tag) {
              case 3:
                iM(i.nodeValue, t, (A.mode & 1) !== 0);
                break;
              case 5:
                A.memoizedProps.suppressHydrationWarning !== !0 && iM(i.nodeValue, t, (A.mode & 1) !== 0);
            }
          o && (e.flags |= 4);
        } else
          i = (t.nodeType === 9 ? t : t.ownerDocument).createTextNode(i), i[QB] = e, e.stateNode = i;
      }
      return Bg(e), null;
    case 13:
      if (In(fn), i = e.memoizedState, A === null || A.memoizedState !== null && A.memoizedState.dehydrated !== null) {
        if (cn && FI !== null && e.mode & 1 && !(e.flags & 128))
          ZDA(), Hw(), e.flags |= 98560, o = !1;
        else if (o = nM(e), i !== null && i.dehydrated !== null) {
          if (A === null) {
            if (!o)
              throw Error($A(318));
            if (o = e.memoizedState, o = o !== null ? o.dehydrated : null, !o)
              throw Error($A(317));
            o[QB] = e;
          } else
            Hw(), !(e.flags & 128) && (e.memoizedState = null), e.flags |= 4;
          Bg(e), o = !1;
        } else
          Sr !== null && (j4(Sr), Sr = null), o = !0;
        if (!o)
          return e.flags & 65536 ? e : null;
      }
      return e.flags & 128 ? (e.lanes = t, e) : (i = i !== null, i !== (A !== null && A.memoizedState !== null) && i && (e.child.flags |= 8192, e.mode & 1 && (A === null || fn.current & 1 ? Bo === 0 && (Bo = 3) : s$())), e.updateQueue !== null && (e.flags |= 4), Bg(e), null);
    case 4:
      return Zw(), U4(A, e), A === null && PN(e.stateNode.containerInfo), Bg(e), null;
    case 10:
      return V8(e.type._context), Bg(e), null;
    case 17:
      return Zs(e.type) && zv(), Bg(e), null;
    case 19:
      if (In(fn), o = e.memoizedState, o === null)
        return Bg(e), null;
      if (i = (e.flags & 128) !== 0, g = o.rendering, g === null)
        if (i)
          ik(o, !1);
        else {
          if (Bo !== 0 || A !== null && A.flags & 128)
            for (A = e.child; A !== null; ) {
              if (g = $v(A), g !== null) {
                for (e.flags |= 128, ik(o, !1), i = g.updateQueue, i !== null && (e.updateQueue = i, e.flags |= 4), e.subtreeFlags = 0, i = t, t = e.child; t !== null; )
                  o = t, A = i, o.flags &= 14680066, g = o.alternate, g === null ? (o.childLanes = 0, o.lanes = A, o.child = null, o.subtreeFlags = 0, o.memoizedProps = null, o.memoizedState = null, o.updateQueue = null, o.dependencies = null, o.stateNode = null) : (o.childLanes = g.childLanes, o.lanes = g.lanes, o.child = g.child, o.subtreeFlags = 0, o.deletions = null, o.memoizedProps = g.memoizedProps, o.memoizedState = g.memoizedState, o.updateQueue = g.updateQueue, o.type = g.type, A = g.dependencies, o.dependencies = A === null ? null : { lanes: A.lanes, firstContext: A.firstContext }), t = t.sibling;
                return qi(fn, fn.current & 1 | 2), e.child;
              }
              A = A.sibling;
            }
          o.tail !== null && Vn() > Kw && (e.flags |= 128, i = !0, ik(o, !1), e.lanes = 4194304);
        }
      else {
        if (!i)
          if (A = $v(g), A !== null) {
            if (e.flags |= 128, i = !0, t = A.updateQueue, t !== null && (e.updateQueue = t, e.flags |= 4), ik(o, !0), o.tail === null && o.tailMode === "hidden" && !g.alternate && !cn)
              return Bg(e), null;
          } else
            2 * Vn() - o.renderingStartTime > Kw && t !== 1073741824 && (e.flags |= 128, i = !0, ik(o, !1), e.lanes = 4194304);
        o.isBackwards ? (g.sibling = e.child, e.child = g) : (t = o.last, t !== null ? t.sibling = g : e.child = g, o.last = g);
      }
      return o.tail !== null ? (e = o.tail, o.rendering = e, o.tail = e.sibling, o.renderingStartTime = Vn(), e.sibling = null, t = fn.current, qi(fn, i ? t & 1 | 2 : t & 1), e) : (Bg(e), null);
    case 22:
    case 23:
      return g$(), i = e.memoizedState !== null, A !== null && A.memoizedState !== null !== i && (e.flags |= 8192), i && e.mode & 1 ? bI & 1073741824 && (Bg(e), e.subtreeFlags & 6 && (e.flags |= 8192)) : Bg(e), null;
    case 24:
      return null;
    case 25:
      return null;
  }
  throw Error($A(156, e.tag));
}
function R6A(A, e) {
  switch (Z8(e), e.tag) {
    case 1:
      return Zs(e.type) && zv(), A = e.flags, A & 65536 ? (e.flags = A & -65537 | 128, e) : null;
    case 3:
      return Zw(), In(Ss), In(Jg), q8(), A = e.flags, A & 65536 && !(A & 128) ? (e.flags = A & -65537 | 128, e) : null;
    case 5:
      return _8(e), null;
    case 13:
      if (In(fn), A = e.memoizedState, A !== null && A.dehydrated !== null) {
        if (e.alternate === null)
          throw Error($A(340));
        Hw();
      }
      return A = e.flags, A & 65536 ? (e.flags = A & -65537 | 128, e) : null;
    case 19:
      return In(fn), null;
    case 4:
      return Zw(), null;
    case 10:
      return V8(e.type._context), null;
    case 22:
    case 23:
      return g$(), null;
    case 24:
      return null;
    default:
      return null;
  }
}
var sM = !1, mg = !1, F6A = typeof WeakSet == "function" ? WeakSet : Set, pe = null;
function Gb(A, e) {
  var t = A.ref;
  if (t !== null)
    if (typeof t == "function")
      try {
        t(null);
      } catch (i) {
        Mn(A, e, i);
      }
    else
      t.current = null;
}
function V4(A, e, t) {
  try {
    t();
  } catch (i) {
    Mn(A, e, i);
  }
}
var HrA = !1;
function M6A(A, e) {
  if (G4 = Kv, A = GDA(), H8(A)) {
    if ("selectionStart" in A)
      var t = { start: A.selectionStart, end: A.selectionEnd };
    else
      A: {
        t = (t = A.ownerDocument) && t.defaultView || window;
        var i = t.getSelection && t.getSelection();
        if (i && i.rangeCount !== 0) {
          t = i.anchorNode;
          var n = i.anchorOffset, o = i.focusNode;
          i = i.focusOffset;
          try {
            t.nodeType, o.nodeType;
          } catch {
            t = null;
            break A;
          }
          var g = 0, s = -1, I = -1, r = 0, a = 0, C = A, B = null;
          e:
            for (; ; ) {
              for (var l; C !== t || n !== 0 && C.nodeType !== 3 || (s = g + n), C !== o || i !== 0 && C.nodeType !== 3 || (I = g + i), C.nodeType === 3 && (g += C.nodeValue.length), (l = C.firstChild) !== null; )
                B = C, C = l;
              for (; ; ) {
                if (C === A)
                  break e;
                if (B === t && ++r === n && (s = g), B === o && ++a === i && (I = g), (l = C.nextSibling) !== null)
                  break;
                C = B, B = C.parentNode;
              }
              C = l;
            }
          t = s === -1 || I === -1 ? null : { start: s, end: I };
        } else
          t = null;
      }
    t = t || { start: 0, end: 0 };
  } else
    t = null;
  for (k4 = { focusedElem: A, selectionRange: t }, Kv = !1, pe = e; pe !== null; )
    if (e = pe, A = e.child, (e.subtreeFlags & 1028) !== 0 && A !== null)
      A.return = e, pe = A;
    else
      for (; pe !== null; ) {
        e = pe;
        try {
          var Q = e.alternate;
          if (e.flags & 1024)
            switch (e.tag) {
              case 0:
              case 11:
              case 15:
                break;
              case 1:
                if (Q !== null) {
                  var E = Q.memoizedProps, d = Q.memoizedState, m = e.stateNode, y = m.getSnapshotBeforeUpdate(e.elementType === e.type ? E : Fr(e.type, E), d);
                  m.__reactInternalSnapshotBeforeUpdate = y;
                }
                break;
              case 3:
                var f = e.stateNode.containerInfo;
                f.nodeType === 1 ? f.textContent = "" : f.nodeType === 9 && f.documentElement && f.removeChild(f.documentElement);
                break;
              case 5:
              case 6:
              case 4:
              case 17:
                break;
              default:
                throw Error($A(163));
            }
        } catch (w) {
          Mn(e, e.return, w);
        }
        if (A = e.sibling, A !== null) {
          A.return = e.return, pe = A;
          break;
        }
        pe = e.return;
      }
  return Q = HrA, HrA = !1, Q;
}
function nN(A, e, t) {
  var i = e.updateQueue;
  if (i = i !== null ? i.lastEffect : null, i !== null) {
    var n = i = i.next;
    do {
      if ((n.tag & A) === A) {
        var o = n.destroy;
        n.destroy = void 0, o !== void 0 && V4(e, t, o);
      }
      n = n.next;
    } while (n !== i);
  }
}
function QK(A, e) {
  if (e = e.updateQueue, e = e !== null ? e.lastEffect : null, e !== null) {
    var t = e = e.next;
    do {
      if ((t.tag & A) === A) {
        var i = t.create;
        t.destroy = i();
      }
      t = t.next;
    } while (t !== e);
  }
}
function X4(A) {
  var e = A.ref;
  if (e !== null) {
    var t = A.stateNode;
    switch (A.tag) {
      case 5:
        A = t;
        break;
      default:
        A = t;
    }
    typeof e == "function" ? e(A) : e.current = A;
  }
}
function wGA(A) {
  var e = A.alternate;
  e !== null && (A.alternate = null, wGA(e)), A.child = null, A.deletions = null, A.sibling = null, A.tag === 5 && (e = A.stateNode, e !== null && (delete e[QB], delete e[AY], delete e[Y4], delete e[E6A], delete e[u6A])), A.stateNode = null, A.return = null, A.dependencies = null, A.memoizedProps = null, A.memoizedState = null, A.pendingProps = null, A.stateNode = null, A.updateQueue = null;
}
function fGA(A) {
  return A.tag === 5 || A.tag === 3 || A.tag === 4;
}
function SrA(A) {
  A:
    for (; ; ) {
      for (; A.sibling === null; ) {
        if (A.return === null || fGA(A.return))
          return null;
        A = A.return;
      }
      for (A.sibling.return = A.return, A = A.sibling; A.tag !== 5 && A.tag !== 6 && A.tag !== 18; ) {
        if (A.flags & 2 || A.child === null || A.tag === 4)
          continue A;
        A.child.return = A, A = A.child;
      }
      if (!(A.flags & 2))
        return A.stateNode;
    }
}
function z4(A, e, t) {
  var i = A.tag;
  if (i === 5 || i === 6)
    A = A.stateNode, e ? t.nodeType === 8 ? t.parentNode.insertBefore(A, e) : t.insertBefore(A, e) : (t.nodeType === 8 ? (e = t.parentNode, e.insertBefore(A, t)) : (e = t, e.appendChild(A)), t = t._reactRootContainer, t != null || e.onclick !== null || (e.onclick = Xv));
  else if (i !== 4 && (A = A.child, A !== null))
    for (z4(A, e, t), A = A.sibling; A !== null; )
      z4(A, e, t), A = A.sibling;
}
function T4(A, e, t) {
  var i = A.tag;
  if (i === 5 || i === 6)
    A = A.stateNode, e ? t.insertBefore(A, e) : t.appendChild(A);
  else if (i !== 4 && (A = A.child, A !== null))
    for (T4(A, e, t), A = A.sibling; A !== null; )
      T4(A, e, t), A = A.sibling;
}
var _o = null, xr = !1;
function CE(A, e, t) {
  for (t = t.child; t !== null; )
    DGA(A, e, t), t = t.sibling;
}
function DGA(A, e, t) {
  if (vB && typeof vB.onCommitFiberUnmount == "function")
    try {
      vB.onCommitFiberUnmount(sK, t);
    } catch {
    }
  switch (t.tag) {
    case 5:
      mg || Gb(t, e);
    case 6:
      var i = _o, n = xr;
      _o = null, CE(A, e, t), _o = i, xr = n, _o !== null && (xr ? (A = _o, t = t.stateNode, A.nodeType === 8 ? A.parentNode.removeChild(t) : A.removeChild(t)) : _o.removeChild(t.stateNode));
      break;
    case 18:
      _o !== null && (xr ? (A = _o, t = t.stateNode, A.nodeType === 8 ? v9(A.parentNode, t) : A.nodeType === 1 && v9(A, t), qN(A)) : v9(_o, t.stateNode));
      break;
    case 4:
      i = _o, n = xr, _o = t.stateNode.containerInfo, xr = !0, CE(A, e, t), _o = i, xr = n;
      break;
    case 0:
    case 11:
    case 14:
    case 15:
      if (!mg && (i = t.updateQueue, i !== null && (i = i.lastEffect, i !== null))) {
        n = i = i.next;
        do {
          var o = n, g = o.destroy;
          o = o.tag, g !== void 0 && (o & 2 || o & 4) && V4(t, e, g), n = n.next;
        } while (n !== i);
      }
      CE(A, e, t);
      break;
    case 1:
      if (!mg && (Gb(t, e), i = t.stateNode, typeof i.componentWillUnmount == "function"))
        try {
          i.props = t.memoizedProps, i.state = t.memoizedState, i.componentWillUnmount();
        } catch (s) {
          Mn(t, e, s);
        }
      CE(A, e, t);
      break;
    case 21:
      CE(A, e, t);
      break;
    case 22:
      t.mode & 1 ? (mg = (i = mg) || t.memoizedState !== null, CE(A, e, t), mg = i) : CE(A, e, t);
      break;
    default:
      CE(A, e, t);
  }
}
function ZrA(A) {
  var e = A.updateQueue;
  if (e !== null) {
    A.updateQueue = null;
    var t = A.stateNode;
    t === null && (t = A.stateNode = new F6A()), e.forEach(function(i) {
      var n = U6A.bind(null, A, i);
      t.has(i) || (t.add(i), i.then(n, n));
    });
  }
}
function br(A, e) {
  var t = e.deletions;
  if (t !== null)
    for (var i = 0; i < t.length; i++) {
      var n = t[i];
      try {
        var o = A, g = e, s = g;
        A:
          for (; s !== null; ) {
            switch (s.tag) {
              case 5:
                _o = s.stateNode, xr = !1;
                break A;
              case 3:
                _o = s.stateNode.containerInfo, xr = !0;
                break A;
              case 4:
                _o = s.stateNode.containerInfo, xr = !0;
                break A;
            }
            s = s.return;
          }
        if (_o === null)
          throw Error($A(160));
        DGA(o, g, n), _o = null, xr = !1;
        var I = n.alternate;
        I !== null && (I.return = null), n.return = null;
      } catch (r) {
        Mn(n, e, r);
      }
    }
  if (e.subtreeFlags & 12854)
    for (e = e.child; e !== null; )
      GGA(e, A), e = e.sibling;
}
function GGA(A, e) {
  var t = A.alternate, i = A.flags;
  switch (A.tag) {
    case 0:
    case 11:
    case 14:
    case 15:
      if (br(e, A), TC(A), i & 4) {
        try {
          nN(3, A, A.return), QK(3, A);
        } catch (E) {
          Mn(A, A.return, E);
        }
        try {
          nN(5, A, A.return);
        } catch (E) {
          Mn(A, A.return, E);
        }
      }
      break;
    case 1:
      br(e, A), TC(A), i & 512 && t !== null && Gb(t, t.return);
      break;
    case 5:
      if (br(e, A), TC(A), i & 512 && t !== null && Gb(t, t.return), A.flags & 32) {
        var n = A.stateNode;
        try {
          XN(n, "");
        } catch (E) {
          Mn(A, A.return, E);
        }
      }
      if (i & 4 && (n = A.stateNode, n != null)) {
        var o = A.memoizedProps, g = t !== null ? t.memoizedProps : o, s = A.type, I = A.updateQueue;
        if (A.updateQueue = null, I !== null)
          try {
            s === "input" && o.type === "radio" && o.name != null && _fA(n, o), u4(s, g);
            var r = u4(s, o);
            for (g = 0; g < I.length; g += 2) {
              var a = I[g], C = I[g + 1];
              a === "style" ? $fA(n, C) : a === "dangerouslySetInnerHTML" ? jfA(n, C) : a === "children" ? XN(n, C) : f8(n, a, C, r);
            }
            switch (s) {
              case "input":
                B4(n, o);
                break;
              case "textarea":
                qfA(n, o);
                break;
              case "select":
                var B = n._wrapperState.wasMultiple;
                n._wrapperState.wasMultiple = !!o.multiple;
                var l = o.value;
                l != null ? Ob(n, !!o.multiple, l, !1) : B !== !!o.multiple && (o.defaultValue != null ? Ob(
                  n,
                  !!o.multiple,
                  o.defaultValue,
                  !0
                ) : Ob(n, !!o.multiple, o.multiple ? [] : "", !1));
            }
            n[AY] = o;
          } catch (E) {
            Mn(A, A.return, E);
          }
      }
      break;
    case 6:
      if (br(e, A), TC(A), i & 4) {
        if (A.stateNode === null)
          throw Error($A(162));
        n = A.stateNode, o = A.memoizedProps;
        try {
          n.nodeValue = o;
        } catch (E) {
          Mn(A, A.return, E);
        }
      }
      break;
    case 3:
      if (br(e, A), TC(A), i & 4 && t !== null && t.memoizedState.isDehydrated)
        try {
          qN(e.containerInfo);
        } catch (E) {
          Mn(A, A.return, E);
        }
      break;
    case 4:
      br(e, A), TC(A);
      break;
    case 13:
      br(e, A), TC(A), n = A.child, n.flags & 8192 && (o = n.memoizedState !== null, n.stateNode.isHidden = o, !o || n.alternate !== null && n.alternate.memoizedState !== null || (n$ = Vn())), i & 4 && ZrA(A);
      break;
    case 22:
      if (a = t !== null && t.memoizedState !== null, A.mode & 1 ? (mg = (r = mg) || a, br(e, A), mg = r) : br(e, A), TC(A), i & 8192) {
        if (r = A.memoizedState !== null, (A.stateNode.isHidden = r) && !a && A.mode & 1)
          for (pe = A, a = A.child; a !== null; ) {
            for (C = pe = a; pe !== null; ) {
              switch (B = pe, l = B.child, B.tag) {
                case 0:
                case 11:
                case 14:
                case 15:
                  nN(4, B, B.return);
                  break;
                case 1:
                  Gb(B, B.return);
                  var Q = B.stateNode;
                  if (typeof Q.componentWillUnmount == "function") {
                    i = B, t = B.return;
                    try {
                      e = i, Q.props = e.memoizedProps, Q.state = e.memoizedState, Q.componentWillUnmount();
                    } catch (E) {
                      Mn(i, t, E);
                    }
                  }
                  break;
                case 5:
                  Gb(B, B.return);
                  break;
                case 22:
                  if (B.memoizedState !== null) {
                    KrA(C);
                    continue;
                  }
              }
              l !== null ? (l.return = B, pe = l) : KrA(C);
            }
            a = a.sibling;
          }
        A:
          for (a = null, C = A; ; ) {
            if (C.tag === 5) {
              if (a === null) {
                a = C;
                try {
                  n = C.stateNode, r ? (o = n.style, typeof o.setProperty == "function" ? o.setProperty("display", "none", "important") : o.display = "none") : (s = C.stateNode, I = C.memoizedProps.style, g = I != null && I.hasOwnProperty("display") ? I.display : null, s.style.display = PfA("display", g));
                } catch (E) {
                  Mn(A, A.return, E);
                }
              }
            } else if (C.tag === 6) {
              if (a === null)
                try {
                  C.stateNode.nodeValue = r ? "" : C.memoizedProps;
                } catch (E) {
                  Mn(A, A.return, E);
                }
            } else if ((C.tag !== 22 && C.tag !== 23 || C.memoizedState === null || C === A) && C.child !== null) {
              C.child.return = C, C = C.child;
              continue;
            }
            if (C === A)
              break A;
            for (; C.sibling === null; ) {
              if (C.return === null || C.return === A)
                break A;
              a === C && (a = null), C = C.return;
            }
            a === C && (a = null), C.sibling.return = C.return, C = C.sibling;
          }
      }
      break;
    case 19:
      br(e, A), TC(A), i & 4 && ZrA(A);
      break;
    case 21:
      break;
    default:
      br(
        e,
        A
      ), TC(A);
  }
}
function TC(A) {
  var e = A.flags;
  if (e & 2) {
    try {
      A: {
        for (var t = A.return; t !== null; ) {
          if (fGA(t)) {
            var i = t;
            break A;
          }
          t = t.return;
        }
        throw Error($A(160));
      }
      switch (i.tag) {
        case 5:
          var n = i.stateNode;
          i.flags & 32 && (XN(n, ""), i.flags &= -33);
          var o = SrA(A);
          T4(A, o, n);
          break;
        case 3:
        case 4:
          var g = i.stateNode.containerInfo, s = SrA(A);
          z4(A, s, g);
          break;
        default:
          throw Error($A(161));
      }
    } catch (I) {
      Mn(A, A.return, I);
    }
    A.flags &= -3;
  }
  e & 4096 && (A.flags &= -4097);
}
function x6A(A, e, t) {
  pe = A, kGA(A);
}
function kGA(A, e, t) {
  for (var i = (A.mode & 1) !== 0; pe !== null; ) {
    var n = pe, o = n.child;
    if (n.tag === 22 && i) {
      var g = n.memoizedState !== null || sM;
      if (!g) {
        var s = n.alternate, I = s !== null && s.memoizedState !== null || mg;
        s = sM;
        var r = mg;
        if (sM = g, (mg = I) && !r)
          for (pe = n; pe !== null; )
            g = pe, I = g.child, g.tag === 22 && g.memoizedState !== null ? UrA(n) : I !== null ? (I.return = g, pe = I) : UrA(n);
        for (; o !== null; )
          pe = o, kGA(o), o = o.sibling;
        pe = n, sM = s, mg = r;
      }
      WrA(A);
    } else
      n.subtreeFlags & 8772 && o !== null ? (o.return = n, pe = o) : WrA(A);
  }
}
function WrA(A) {
  for (; pe !== null; ) {
    var e = pe;
    if (e.flags & 8772) {
      var t = e.alternate;
      try {
        if (e.flags & 8772)
          switch (e.tag) {
            case 0:
            case 11:
            case 15:
              mg || QK(5, e);
              break;
            case 1:
              var i = e.stateNode;
              if (e.flags & 4 && !mg)
                if (t === null)
                  i.componentDidMount();
                else {
                  var n = e.elementType === e.type ? t.memoizedProps : Fr(e.type, t.memoizedProps);
                  i.componentDidUpdate(n, t.memoizedState, i.__reactInternalSnapshotBeforeUpdate);
                }
              var o = e.updateQueue;
              o !== null && wrA(e, o, i);
              break;
            case 3:
              var g = e.updateQueue;
              if (g !== null) {
                if (t = null, e.child !== null)
                  switch (e.child.tag) {
                    case 5:
                      t = e.child.stateNode;
                      break;
                    case 1:
                      t = e.child.stateNode;
                  }
                wrA(e, g, t);
              }
              break;
            case 5:
              var s = e.stateNode;
              if (t === null && e.flags & 4) {
                t = s;
                var I = e.memoizedProps;
                switch (e.type) {
                  case "button":
                  case "input":
                  case "select":
                  case "textarea":
                    I.autoFocus && t.focus();
                    break;
                  case "img":
                    I.src && (t.src = I.src);
                }
              }
              break;
            case 6:
              break;
            case 4:
              break;
            case 12:
              break;
            case 13:
              if (e.memoizedState === null) {
                var r = e.alternate;
                if (r !== null) {
                  var a = r.memoizedState;
                  if (a !== null) {
                    var C = a.dehydrated;
                    C !== null && qN(C);
                  }
                }
              }
              break;
            case 19:
            case 17:
            case 21:
            case 22:
            case 23:
            case 25:
              break;
            default:
              throw Error($A(163));
          }
        mg || e.flags & 512 && X4(e);
      } catch (B) {
        Mn(e, e.return, B);
      }
    }
    if (e === A) {
      pe = null;
      break;
    }
    if (t = e.sibling, t !== null) {
      t.return = e.return, pe = t;
      break;
    }
    pe = e.return;
  }
}
function KrA(A) {
  for (; pe !== null; ) {
    var e = pe;
    if (e === A) {
      pe = null;
      break;
    }
    var t = e.sibling;
    if (t !== null) {
      t.return = e.return, pe = t;
      break;
    }
    pe = e.return;
  }
}
function UrA(A) {
  for (; pe !== null; ) {
    var e = pe;
    try {
      switch (e.tag) {
        case 0:
        case 11:
        case 15:
          var t = e.return;
          try {
            QK(4, e);
          } catch (I) {
            Mn(e, t, I);
          }
          break;
        case 1:
          var i = e.stateNode;
          if (typeof i.componentDidMount == "function") {
            var n = e.return;
            try {
              i.componentDidMount();
            } catch (I) {
              Mn(e, n, I);
            }
          }
          var o = e.return;
          try {
            X4(e);
          } catch (I) {
            Mn(e, o, I);
          }
          break;
        case 5:
          var g = e.return;
          try {
            X4(e);
          } catch (I) {
            Mn(e, g, I);
          }
      }
    } catch (I) {
      Mn(e, e.return, I);
    }
    if (e === A) {
      pe = null;
      break;
    }
    var s = e.sibling;
    if (s !== null) {
      s.return = e.return, pe = s;
      break;
    }
    pe = e.return;
  }
}
var L6A = Math.ceil, tH = kQ.ReactCurrentDispatcher, t$ = kQ.ReactCurrentOwner, Va = kQ.ReactCurrentBatchConfig, Ai = 0, xo = null, eo = null, $o = 0, bI = 0, kb = Dd(0), Bo = 0, gY = null, jm = 0, EK = 0, i$ = 0, oN = null, Js = null, n$ = 0, Kw = 1 / 0, ac = null, iH = !1, _4 = null, lu = null, IM = !1, TE = null, nH = 0, gN = 0, q4 = null, kL = -1, JL = 0;
function os() {
  return Ai & 6 ? Vn() : kL !== -1 ? kL : kL = Vn();
}
function cu(A) {
  return A.mode & 1 ? Ai & 2 && $o !== 0 ? $o & -$o : h6A.transition !== null ? (JL === 0 && (JL = CDA()), JL) : (A = Ji, A !== 0 || (A = window.event, A = A === void 0 ? 16 : dDA(A.type)), A) : 1;
}
function eC(A, e, t, i) {
  if (50 < gN)
    throw gN = 0, q4 = null, Error($A(185));
  nR(A, t, i), (!(Ai & 2) || A !== xo) && (A === xo && (!(Ai & 2) && (EK |= t), Bo === 4 && ZE(A, $o)), Ws(A, i), t === 1 && Ai === 0 && !(e.mode & 1) && (Kw = Vn() + 500, BK && Gd()));
}
function Ws(A, e) {
  var t = A.callbackNode;
  hPA(A, e);
  var i = Wv(A, A === xo ? $o : 0);
  if (i === 0)
    t !== null && PaA(t), A.callbackNode = null, A.callbackPriority = 0;
  else if (e = i & -i, A.callbackPriority !== e) {
    if (t != null && PaA(t), e === 1)
      A.tag === 0 ? d6A(VrA.bind(null, A)) : vDA(VrA.bind(null, A)), c6A(function() {
        !(Ai & 6) && Gd();
      }), t = null;
    else {
      switch (BDA(i)) {
        case 1:
          t = N8;
          break;
        case 4:
          t = aDA;
          break;
        case 16:
          t = Zv;
          break;
        case 536870912:
          t = rDA;
          break;
        default:
          t = Zv;
      }
      t = LGA(t, JGA.bind(null, A));
    }
    A.callbackPriority = e, A.callbackNode = t;
  }
}
function JGA(A, e) {
  if (kL = -1, JL = 0, Ai & 6)
    throw Error($A(327));
  var t = A.callbackNode;
  if (ew() && A.callbackNode !== t)
    return null;
  var i = Wv(A, A === xo ? $o : 0);
  if (i === 0)
    return null;
  if (i & 30 || i & A.expiredLanes || e)
    e = oH(A, i);
  else {
    e = i;
    var n = Ai;
    Ai |= 2;
    var o = YGA();
    (xo !== A || $o !== e) && (ac = null, Kw = Vn() + 500, Gm(A, e));
    do
      try {
        S6A();
        break;
      } catch (s) {
        NGA(A, s);
      }
    while (1);
    U8(), tH.current = o, Ai = n, eo !== null ? e = 0 : (xo = null, $o = 0, e = Bo);
  }
  if (e !== 0) {
    if (e === 2 && (n = y4(A), n !== 0 && (i = n, e = O4(A, n))), e === 1)
      throw t = gY, Gm(A, 0), ZE(A, i), Ws(A, Vn()), t;
    if (e === 6)
      ZE(A, i);
    else {
      if (n = A.current.alternate, !(i & 30) && !v6A(n) && (e = oH(A, i), e === 2 && (o = y4(A), o !== 0 && (i = o, e = O4(A, o))), e === 1))
        throw t = gY, Gm(A, 0), ZE(A, i), Ws(A, Vn()), t;
      switch (A.finishedWork = n, A.finishedLanes = i, e) {
        case 0:
        case 1:
          throw Error($A(345));
        case 2:
          Wh(A, Js, ac);
          break;
        case 3:
          if (ZE(A, i), (i & 130023424) === i && (e = n$ + 500 - Vn(), 10 < e)) {
            if (Wv(A, 0) !== 0)
              break;
            if (n = A.suspendedLanes, (n & i) !== i) {
              os(), A.pingedLanes |= A.suspendedLanes & n;
              break;
            }
            A.timeoutHandle = N4(Wh.bind(null, A, Js, ac), e);
            break;
          }
          Wh(A, Js, ac);
          break;
        case 4:
          if (ZE(A, i), (i & 4194240) === i)
            break;
          for (e = A.eventTimes, n = -1; 0 < i; ) {
            var g = 31 - AC(i);
            o = 1 << g, g = e[g], g > n && (n = g), i &= ~o;
          }
          if (i = n, i = Vn() - i, i = (120 > i ? 120 : 480 > i ? 480 : 1080 > i ? 1080 : 1920 > i ? 1920 : 3e3 > i ? 3e3 : 4320 > i ? 4320 : 1960 * L6A(i / 1960)) - i, 10 < i) {
            A.timeoutHandle = N4(Wh.bind(null, A, Js, ac), i);
            break;
          }
          Wh(A, Js, ac);
          break;
        case 5:
          Wh(A, Js, ac);
          break;
        default:
          throw Error($A(329));
      }
    }
  }
  return Ws(A, Vn()), A.callbackNode === t ? JGA.bind(null, A) : null;
}
function O4(A, e) {
  var t = oN;
  return A.current.memoizedState.isDehydrated && (Gm(A, e).flags |= 256), A = oH(A, e), A !== 2 && (e = Js, Js = t, e !== null && j4(e)), A;
}
function j4(A) {
  Js === null ? Js = A : Js.push.apply(Js, A);
}
function v6A(A) {
  for (var e = A; ; ) {
    if (e.flags & 16384) {
      var t = e.updateQueue;
      if (t !== null && (t = t.stores, t !== null))
        for (var i = 0; i < t.length; i++) {
          var n = t[i], o = n.getSnapshot;
          n = n.value;
          try {
            if (!QC(o(), n))
              return !1;
          } catch {
            return !1;
          }
        }
    }
    if (t = e.child, e.subtreeFlags & 16384 && t !== null)
      t.return = e, e = t;
    else {
      if (e === A)
        break;
      for (; e.sibling === null; ) {
        if (e.return === null || e.return === A)
          return !0;
        e = e.return;
      }
      e.sibling.return = e.return, e = e.sibling;
    }
  }
  return !0;
}
function ZE(A, e) {
  for (e &= ~i$, e &= ~EK, A.suspendedLanes |= e, A.pingedLanes &= ~e, A = A.expirationTimes; 0 < e; ) {
    var t = 31 - AC(e), i = 1 << t;
    A[t] = -1, e &= ~i;
  }
}
function VrA(A) {
  if (Ai & 6)
    throw Error($A(327));
  ew();
  var e = Wv(A, 0);
  if (!(e & 1))
    return Ws(A, Vn()), null;
  var t = oH(A, e);
  if (A.tag !== 0 && t === 2) {
    var i = y4(A);
    i !== 0 && (e = i, t = O4(A, i));
  }
  if (t === 1)
    throw t = gY, Gm(A, 0), ZE(A, e), Ws(A, Vn()), t;
  if (t === 6)
    throw Error($A(345));
  return A.finishedWork = A.current.alternate, A.finishedLanes = e, Wh(A, Js, ac), Ws(A, Vn()), null;
}
function o$(A, e) {
  var t = Ai;
  Ai |= 1;
  try {
    return A(e);
  } finally {
    Ai = t, Ai === 0 && (Kw = Vn() + 500, BK && Gd());
  }
}
function Pm(A) {
  TE !== null && TE.tag === 0 && !(Ai & 6) && ew();
  var e = Ai;
  Ai |= 1;
  var t = Va.transition, i = Ji;
  try {
    if (Va.transition = null, Ji = 1, A)
      return A();
  } finally {
    Ji = i, Va.transition = t, Ai = e, !(Ai & 6) && Gd();
  }
}
function g$() {
  bI = kb.current, In(kb);
}
function Gm(A, e) {
  A.finishedWork = null, A.finishedLanes = 0;
  var t = A.timeoutHandle;
  if (t !== -1 && (A.timeoutHandle = -1, l6A(t)), eo !== null)
    for (t = eo.return; t !== null; ) {
      var i = t;
      switch (Z8(i), i.tag) {
        case 1:
          i = i.type.childContextTypes, i != null && zv();
          break;
        case 3:
          Zw(), In(Ss), In(Jg), q8();
          break;
        case 5:
          _8(i);
          break;
        case 4:
          Zw();
          break;
        case 13:
          In(fn);
          break;
        case 19:
          In(fn);
          break;
        case 10:
          V8(i.type._context);
          break;
        case 22:
        case 23:
          g$();
      }
      t = t.return;
    }
  if (xo = A, eo = A = Qu(A.current, null), $o = bI = e, Bo = 0, gY = null, i$ = EK = jm = 0, Js = oN = null, sm !== null) {
    for (e = 0; e < sm.length; e++)
      if (t = sm[e], i = t.interleaved, i !== null) {
        t.interleaved = null;
        var n = i.next, o = t.pending;
        if (o !== null) {
          var g = o.next;
          o.next = n, i.next = g;
        }
        t.pending = i;
      }
    sm = null;
  }
  return A;
}
function NGA(A, e) {
  do {
    var t = eo;
    try {
      if (U8(), fL.current = eH, AH) {
        for (var i = kn.memoizedState; i !== null; ) {
          var n = i.queue;
          n !== null && (n.pending = null), i = i.next;
        }
        AH = !1;
      }
      if (Om = 0, Go = so = kn = null, iN = !1, iY = 0, t$.current = null, t === null || t.return === null) {
        Bo = 1, gY = e, eo = null;
        break;
      }
      A: {
        var o = A, g = t.return, s = t, I = e;
        if (e = $o, s.flags |= 32768, I !== null && typeof I == "object" && typeof I.then == "function") {
          var r = I, a = s, C = a.tag;
          if (!(a.mode & 1) && (C === 0 || C === 11 || C === 15)) {
            var B = a.alternate;
            B ? (a.updateQueue = B.updateQueue, a.memoizedState = B.memoizedState, a.lanes = B.lanes) : (a.updateQueue = null, a.memoizedState = null);
          }
          var l = YrA(g);
          if (l !== null) {
            l.flags &= -257, RrA(l, g, s, o, e), l.mode & 1 && NrA(o, r, e), e = l, I = r;
            var Q = e.updateQueue;
            if (Q === null) {
              var E = /* @__PURE__ */ new Set();
              E.add(I), e.updateQueue = E;
            } else
              Q.add(I);
            break A;
          } else {
            if (!(e & 1)) {
              NrA(o, r, e), s$();
              break A;
            }
            I = Error($A(426));
          }
        } else if (cn && s.mode & 1) {
          var d = YrA(g);
          if (d !== null) {
            !(d.flags & 65536) && (d.flags |= 256), RrA(d, g, s, o, e), W8(Ww(I, s));
            break A;
          }
        }
        o = I = Ww(I, s), Bo !== 4 && (Bo = 2), oN === null ? oN = [o] : oN.push(o), o = g;
        do {
          switch (o.tag) {
            case 3:
              o.flags |= 65536, e &= -e, o.lanes |= e;
              var m = lGA(o, I, e);
              brA(o, m);
              break A;
            case 1:
              s = I;
              var y = o.type, f = o.stateNode;
              if (!(o.flags & 128) && (typeof y.getDerivedStateFromError == "function" || f !== null && typeof f.componentDidCatch == "function" && (lu === null || !lu.has(f)))) {
                o.flags |= 65536, e &= -e, o.lanes |= e;
                var w = cGA(o, s, e);
                brA(o, w);
                break A;
              }
          }
          o = o.return;
        } while (o !== null);
      }
      FGA(t);
    } catch (G) {
      e = G, eo === t && t !== null && (eo = t = t.return);
      continue;
    }
    break;
  } while (1);
}
function YGA() {
  var A = tH.current;
  return tH.current = eH, A === null ? eH : A;
}
function s$() {
  (Bo === 0 || Bo === 3 || Bo === 2) && (Bo = 4), xo === null || !(jm & 268435455) && !(EK & 268435455) || ZE(xo, $o);
}
function oH(A, e) {
  var t = Ai;
  Ai |= 2;
  var i = YGA();
  (xo !== A || $o !== e) && (ac = null, Gm(A, e));
  do
    try {
      H6A();
      break;
    } catch (n) {
      NGA(A, n);
    }
  while (1);
  if (U8(), Ai = t, tH.current = i, eo !== null)
    throw Error($A(261));
  return xo = null, $o = 0, Bo;
}
function H6A() {
  for (; eo !== null; )
    RGA(eo);
}
function S6A() {
  for (; eo !== null && !rPA(); )
    RGA(eo);
}
function RGA(A) {
  var e = xGA(A.alternate, A, bI);
  A.memoizedProps = A.pendingProps, e === null ? FGA(A) : eo = e, t$.current = null;
}
function FGA(A) {
  var e = A;
  do {
    var t = e.alternate;
    if (A = e.return, e.flags & 32768) {
      if (t = R6A(t, e), t !== null) {
        t.flags &= 32767, eo = t;
        return;
      }
      if (A !== null)
        A.flags |= 32768, A.subtreeFlags = 0, A.deletions = null;
      else {
        Bo = 6, eo = null;
        return;
      }
    } else if (t = Y6A(t, e, bI), t !== null) {
      eo = t;
      return;
    }
    if (e = e.sibling, e !== null) {
      eo = e;
      return;
    }
    eo = e = A;
  } while (e !== null);
  Bo === 0 && (Bo = 5);
}
function Wh(A, e, t) {
  var i = Ji, n = Va.transition;
  try {
    Va.transition = null, Ji = 1, Z6A(A, e, t, i);
  } finally {
    Va.transition = n, Ji = i;
  }
  return null;
}
function Z6A(A, e, t, i) {
  do
    ew();
  while (TE !== null);
  if (Ai & 6)
    throw Error($A(327));
  t = A.finishedWork;
  var n = A.finishedLanes;
  if (t === null)
    return null;
  if (A.finishedWork = null, A.finishedLanes = 0, t === A.current)
    throw Error($A(177));
  A.callbackNode = null, A.callbackPriority = 0;
  var o = t.lanes | t.childLanes;
  if (mPA(A, o), A === xo && (eo = xo = null, $o = 0), !(t.subtreeFlags & 2064) && !(t.flags & 2064) || IM || (IM = !0, LGA(Zv, function() {
    return ew(), null;
  })), o = (t.flags & 15990) !== 0, t.subtreeFlags & 15990 || o) {
    o = Va.transition, Va.transition = null;
    var g = Ji;
    Ji = 1;
    var s = Ai;
    Ai |= 4, t$.current = null, M6A(A, t), GGA(t, A), g6A(k4), Kv = !!G4, k4 = G4 = null, A.current = t, x6A(t), CPA(), Ai = s, Ji = g, Va.transition = o;
  } else
    A.current = t;
  if (IM && (IM = !1, TE = A, nH = n), o = A.pendingLanes, o === 0 && (lu = null), cPA(t.stateNode), Ws(A, Vn()), e !== null)
    for (i = A.onRecoverableError, t = 0; t < e.length; t++)
      n = e[t], i(n.value, { componentStack: n.stack, digest: n.digest });
  if (iH)
    throw iH = !1, A = _4, _4 = null, A;
  return nH & 1 && A.tag !== 0 && ew(), o = A.pendingLanes, o & 1 ? A === q4 ? gN++ : (gN = 0, q4 = A) : gN = 0, Gd(), null;
}
function ew() {
  if (TE !== null) {
    var A = BDA(nH), e = Va.transition, t = Ji;
    try {
      if (Va.transition = null, Ji = 16 > A ? 16 : A, TE === null)
        var i = !1;
      else {
        if (A = TE, TE = null, nH = 0, Ai & 6)
          throw Error($A(331));
        var n = Ai;
        for (Ai |= 4, pe = A.current; pe !== null; ) {
          var o = pe, g = o.child;
          if (pe.flags & 16) {
            var s = o.deletions;
            if (s !== null) {
              for (var I = 0; I < s.length; I++) {
                var r = s[I];
                for (pe = r; pe !== null; ) {
                  var a = pe;
                  switch (a.tag) {
                    case 0:
                    case 11:
                    case 15:
                      nN(8, a, o);
                  }
                  var C = a.child;
                  if (C !== null)
                    C.return = a, pe = C;
                  else
                    for (; pe !== null; ) {
                      a = pe;
                      var B = a.sibling, l = a.return;
                      if (wGA(a), a === r) {
                        pe = null;
                        break;
                      }
                      if (B !== null) {
                        B.return = l, pe = B;
                        break;
                      }
                      pe = l;
                    }
                }
              }
              var Q = o.alternate;
              if (Q !== null) {
                var E = Q.child;
                if (E !== null) {
                  Q.child = null;
                  do {
                    var d = E.sibling;
                    E.sibling = null, E = d;
                  } while (E !== null);
                }
              }
              pe = o;
            }
          }
          if (o.subtreeFlags & 2064 && g !== null)
            g.return = o, pe = g;
          else
            A:
              for (; pe !== null; ) {
                if (o = pe, o.flags & 2048)
                  switch (o.tag) {
                    case 0:
                    case 11:
                    case 15:
                      nN(9, o, o.return);
                  }
                var m = o.sibling;
                if (m !== null) {
                  m.return = o.return, pe = m;
                  break A;
                }
                pe = o.return;
              }
        }
        var y = A.current;
        for (pe = y; pe !== null; ) {
          g = pe;
          var f = g.child;
          if (g.subtreeFlags & 2064 && f !== null)
            f.return = g, pe = f;
          else
            A:
              for (g = y; pe !== null; ) {
                if (s = pe, s.flags & 2048)
                  try {
                    switch (s.tag) {
                      case 0:
                      case 11:
                      case 15:
                        QK(9, s);
                    }
                  } catch (G) {
                    Mn(s, s.return, G);
                  }
                if (s === g) {
                  pe = null;
                  break A;
                }
                var w = s.sibling;
                if (w !== null) {
                  w.return = s.return, pe = w;
                  break A;
                }
                pe = s.return;
              }
        }
        if (Ai = n, Gd(), vB && typeof vB.onPostCommitFiberRoot == "function")
          try {
            vB.onPostCommitFiberRoot(sK, A);
          } catch {
          }
        i = !0;
      }
      return i;
    } finally {
      Ji = t, Va.transition = e;
    }
  }
  return !1;
}
function XrA(A, e, t) {
  e = Ww(t, e), e = lGA(A, e, 1), A = Bu(A, e, 1), e = os(), A !== null && (nR(A, 1, e), Ws(A, e));
}
function Mn(A, e, t) {
  if (A.tag === 3)
    XrA(A, A, t);
  else
    for (; e !== null; ) {
      if (e.tag === 3) {
        XrA(e, A, t);
        break;
      } else if (e.tag === 1) {
        var i = e.stateNode;
        if (typeof e.type.getDerivedStateFromError == "function" || typeof i.componentDidCatch == "function" && (lu === null || !lu.has(i))) {
          A = Ww(t, A), A = cGA(e, A, 1), e = Bu(e, A, 1), A = os(), e !== null && (nR(e, 1, A), Ws(e, A));
          break;
        }
      }
      e = e.return;
    }
}
function W6A(A, e, t) {
  var i = A.pingCache;
  i !== null && i.delete(e), e = os(), A.pingedLanes |= A.suspendedLanes & t, xo === A && ($o & t) === t && (Bo === 4 || Bo === 3 && ($o & 130023424) === $o && 500 > Vn() - n$ ? Gm(A, 0) : i$ |= t), Ws(A, e);
}
function MGA(A, e) {
  e === 0 && (A.mode & 1 ? (e = P1, P1 <<= 1, !(P1 & 130023424) && (P1 = 4194304)) : e = 1);
  var t = os();
  A = sQ(A, e), A !== null && (nR(A, e, t), Ws(A, t));
}
function K6A(A) {
  var e = A.memoizedState, t = 0;
  e !== null && (t = e.retryLane), MGA(A, t);
}
function U6A(A, e) {
  var t = 0;
  switch (A.tag) {
    case 13:
      var i = A.stateNode, n = A.memoizedState;
      n !== null && (t = n.retryLane);
      break;
    case 19:
      i = A.stateNode;
      break;
    default:
      throw Error($A(314));
  }
  i !== null && i.delete(e), MGA(A, t);
}
var xGA;
xGA = function(A, e, t) {
  if (A !== null)
    if (A.memoizedProps !== e.pendingProps || Ss.current)
      Ls = !0;
    else {
      if (!(A.lanes & t) && !(e.flags & 128))
        return Ls = !1, N6A(A, e, t);
      Ls = !!(A.flags & 131072);
    }
  else
    Ls = !1, cn && e.flags & 1048576 && HDA(e, qv, e.index);
  switch (e.lanes = 0, e.tag) {
    case 2:
      var i = e.type;
      GL(A, e), A = e.pendingProps;
      var n = vw(e, Jg.current);
      Aw(e, t), n = j8(null, e, i, A, n, t);
      var o = P8();
      return e.flags |= 1, typeof n == "object" && n !== null && typeof n.render == "function" && n.$$typeof === void 0 ? (e.tag = 1, e.memoizedState = null, e.updateQueue = null, Zs(i) ? (o = !0, Tv(e)) : o = !1, e.memoizedState = n.state !== null && n.state !== void 0 ? n.state : null, z8(e), n.updater = lK, e.stateNode = n, n._reactInternals = e, v4(e, i, A, t), e = Z4(null, e, i, !0, o, t)) : (e.tag = 0, cn && o && S8(e), _g(null, e, n, t), e = e.child), e;
    case 16:
      i = e.elementType;
      A: {
        switch (GL(A, e), A = e.pendingProps, n = i._init, i = n(i._payload), e.type = i, n = e.tag = X6A(i), A = Fr(i, A), n) {
          case 0:
            e = S4(null, e, i, A, t);
            break A;
          case 1:
            e = xrA(null, e, i, A, t);
            break A;
          case 11:
            e = FrA(null, e, i, A, t);
            break A;
          case 14:
            e = MrA(null, e, i, Fr(i.type, A), t);
            break A;
        }
        throw Error($A(
          306,
          i,
          ""
        ));
      }
      return e;
    case 0:
      return i = e.type, n = e.pendingProps, n = e.elementType === i ? n : Fr(i, n), S4(A, e, i, n, t);
    case 1:
      return i = e.type, n = e.pendingProps, n = e.elementType === i ? n : Fr(i, n), xrA(A, e, i, n, t);
    case 3:
      A: {
        if (dGA(e), A === null)
          throw Error($A(387));
        i = e.pendingProps, o = e.memoizedState, n = o.element, KDA(A, e), Pv(e, i, null, t);
        var g = e.memoizedState;
        if (i = g.element, o.isDehydrated)
          if (o = { element: i, isDehydrated: !1, cache: g.cache, pendingSuspenseBoundaries: g.pendingSuspenseBoundaries, transitions: g.transitions }, e.updateQueue.baseState = o, e.memoizedState = o, e.flags & 256) {
            n = Ww(Error($A(423)), e), e = LrA(A, e, i, t, n);
            break A;
          } else if (i !== n) {
            n = Ww(Error($A(424)), e), e = LrA(A, e, i, t, n);
            break A;
          } else
            for (FI = Cu(e.stateNode.containerInfo.firstChild), KI = e, cn = !0, Sr = null, t = zDA(e, null, i, t), e.child = t; t; )
              t.flags = t.flags & -3 | 4096, t = t.sibling;
        else {
          if (Hw(), i === n) {
            e = IQ(A, e, t);
            break A;
          }
          _g(A, e, i, t);
        }
        e = e.child;
      }
      return e;
    case 5:
      return TDA(e), A === null && M4(e), i = e.type, n = e.pendingProps, o = A !== null ? A.memoizedProps : null, g = n.children, J4(i, n) ? g = null : o !== null && J4(i, o) && (e.flags |= 32), uGA(A, e), _g(A, e, g, t), e.child;
    case 6:
      return A === null && M4(e), null;
    case 13:
      return hGA(A, e, t);
    case 4:
      return T8(e, e.stateNode.containerInfo), i = e.pendingProps, A === null ? e.child = Sw(e, null, i, t) : _g(A, e, i, t), e.child;
    case 11:
      return i = e.type, n = e.pendingProps, n = e.elementType === i ? n : Fr(i, n), FrA(A, e, i, n, t);
    case 7:
      return _g(A, e, e.pendingProps, t), e.child;
    case 8:
      return _g(A, e, e.pendingProps.children, t), e.child;
    case 12:
      return _g(A, e, e.pendingProps.children, t), e.child;
    case 10:
      A: {
        if (i = e.type._context, n = e.pendingProps, o = e.memoizedProps, g = n.value, qi(Ov, i._currentValue), i._currentValue = g, o !== null)
          if (QC(o.value, g)) {
            if (o.children === n.children && !Ss.current) {
              e = IQ(A, e, t);
              break A;
            }
          } else
            for (o = e.child, o !== null && (o.return = e); o !== null; ) {
              var s = o.dependencies;
              if (s !== null) {
                g = o.child;
                for (var I = s.firstContext; I !== null; ) {
                  if (I.context === i) {
                    if (o.tag === 1) {
                      I = Vc(-1, t & -t), I.tag = 2;
                      var r = o.updateQueue;
                      if (r !== null) {
                        r = r.shared;
                        var a = r.pending;
                        a === null ? I.next = I : (I.next = a.next, a.next = I), r.pending = I;
                      }
                    }
                    o.lanes |= t, I = o.alternate, I !== null && (I.lanes |= t), x4(
                      o.return,
                      t,
                      e
                    ), s.lanes |= t;
                    break;
                  }
                  I = I.next;
                }
              } else if (o.tag === 10)
                g = o.type === e.type ? null : o.child;
              else if (o.tag === 18) {
                if (g = o.return, g === null)
                  throw Error($A(341));
                g.lanes |= t, s = g.alternate, s !== null && (s.lanes |= t), x4(g, t, e), g = o.sibling;
              } else
                g = o.child;
              if (g !== null)
                g.return = o;
              else
                for (g = o; g !== null; ) {
                  if (g === e) {
                    g = null;
                    break;
                  }
                  if (o = g.sibling, o !== null) {
                    o.return = g.return, g = o;
                    break;
                  }
                  g = g.return;
                }
              o = g;
            }
        _g(A, e, n.children, t), e = e.child;
      }
      return e;
    case 9:
      return n = e.type, i = e.pendingProps.children, Aw(e, t), n = qa(n), i = i(n), e.flags |= 1, _g(A, e, i, t), e.child;
    case 14:
      return i = e.type, n = Fr(i, e.pendingProps), n = Fr(i.type, n), MrA(A, e, i, n, t);
    case 15:
      return QGA(A, e, e.type, e.pendingProps, t);
    case 17:
      return i = e.type, n = e.pendingProps, n = e.elementType === i ? n : Fr(i, n), GL(A, e), e.tag = 1, Zs(i) ? (A = !0, Tv(e)) : A = !1, Aw(e, t), VDA(e, i, n), v4(e, i, n, t), Z4(null, e, i, !0, A, t);
    case 19:
      return mGA(A, e, t);
    case 22:
      return EGA(A, e, t);
  }
  throw Error($A(156, e.tag));
};
function LGA(A, e) {
  return IDA(A, e);
}
function V6A(A, e, t, i) {
  this.tag = A, this.key = t, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.ref = null, this.pendingProps = e, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = i, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null;
}
function La(A, e, t, i) {
  return new V6A(A, e, t, i);
}
function I$(A) {
  return A = A.prototype, !(!A || !A.isReactComponent);
}
function X6A(A) {
  if (typeof A == "function")
    return I$(A) ? 1 : 0;
  if (A != null) {
    if (A = A.$$typeof, A === G8)
      return 11;
    if (A === k8)
      return 14;
  }
  return 2;
}
function Qu(A, e) {
  var t = A.alternate;
  return t === null ? (t = La(A.tag, e, A.key, A.mode), t.elementType = A.elementType, t.type = A.type, t.stateNode = A.stateNode, t.alternate = A, A.alternate = t) : (t.pendingProps = e, t.type = A.type, t.flags = 0, t.subtreeFlags = 0, t.deletions = null), t.flags = A.flags & 14680064, t.childLanes = A.childLanes, t.lanes = A.lanes, t.child = A.child, t.memoizedProps = A.memoizedProps, t.memoizedState = A.memoizedState, t.updateQueue = A.updateQueue, e = A.dependencies, t.dependencies = e === null ? null : { lanes: e.lanes, firstContext: e.firstContext }, t.sibling = A.sibling, t.index = A.index, t.ref = A.ref, t;
}
function NL(A, e, t, i, n, o) {
  var g = 2;
  if (i = A, typeof A == "function")
    I$(A) && (g = 1);
  else if (typeof A == "string")
    g = 5;
  else
    A:
      switch (A) {
        case db:
          return km(t.children, n, o, e);
        case D8:
          g = 8, n |= 8;
          break;
        case s4:
          return A = La(12, t, e, n | 2), A.elementType = s4, A.lanes = o, A;
        case I4:
          return A = La(13, t, e, n), A.elementType = I4, A.lanes = o, A;
        case a4:
          return A = La(19, t, e, n), A.elementType = a4, A.lanes = o, A;
        case XfA:
          return uK(t, n, o, e);
        default:
          if (typeof A == "object" && A !== null)
            switch (A.$$typeof) {
              case UfA:
                g = 10;
                break A;
              case VfA:
                g = 9;
                break A;
              case G8:
                g = 11;
                break A;
              case k8:
                g = 14;
                break A;
              case NE:
                g = 16, i = null;
                break A;
            }
          throw Error($A(130, A == null ? A : typeof A, ""));
      }
  return e = La(g, t, e, n), e.elementType = A, e.type = i, e.lanes = o, e;
}
function km(A, e, t, i) {
  return A = La(7, A, i, e), A.lanes = t, A;
}
function uK(A, e, t, i) {
  return A = La(22, A, i, e), A.elementType = XfA, A.lanes = t, A.stateNode = { isHidden: !1 }, A;
}
function X9(A, e, t) {
  return A = La(6, A, null, e), A.lanes = t, A;
}
function z9(A, e, t) {
  return e = La(4, A.children !== null ? A.children : [], A.key, e), e.lanes = t, e.stateNode = { containerInfo: A.containerInfo, pendingChildren: null, implementation: A.implementation }, e;
}
function z6A(A, e, t, i, n) {
  this.tag = e, this.containerInfo = A, this.finishedWork = this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = -1, this.callbackNode = this.pendingContext = this.context = null, this.callbackPriority = 0, this.eventTimes = D9(0), this.expirationTimes = D9(-1), this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = D9(0), this.identifierPrefix = i, this.onRecoverableError = n, this.mutableSourceEagerHydrationData = null;
}
function a$(A, e, t, i, n, o, g, s, I) {
  return A = new z6A(A, e, t, s, I), e === 1 ? (e = 1, o === !0 && (e |= 8)) : e = 0, o = La(3, null, null, e), A.current = o, o.stateNode = A, o.memoizedState = { element: i, isDehydrated: t, cache: null, transitions: null, pendingSuspenseBoundaries: null }, z8(o), A;
}
function T6A(A, e, t) {
  var i = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
  return { $$typeof: ub, key: i == null ? null : "" + i, children: A, containerInfo: e, implementation: t };
}
function vGA(A) {
  if (!A)
    return Lu;
  A = A._reactInternals;
  A: {
    if (Vp(A) !== A || A.tag !== 1)
      throw Error($A(170));
    var e = A;
    do {
      switch (e.tag) {
        case 3:
          e = e.stateNode.context;
          break A;
        case 1:
          if (Zs(e.type)) {
            e = e.stateNode.__reactInternalMemoizedMergedChildContext;
            break A;
          }
      }
      e = e.return;
    } while (e !== null);
    throw Error($A(171));
  }
  if (A.tag === 1) {
    var t = A.type;
    if (Zs(t))
      return LDA(A, t, e);
  }
  return e;
}
function HGA(A, e, t, i, n, o, g, s, I) {
  return A = a$(t, i, !0, A, n, o, g, s, I), A.context = vGA(null), t = A.current, i = os(), n = cu(t), o = Vc(i, n), o.callback = e ?? null, Bu(t, o, n), A.current.lanes = n, nR(A, n, i), Ws(A, i), A;
}
function dK(A, e, t, i) {
  var n = e.current, o = os(), g = cu(n);
  return t = vGA(t), e.context === null ? e.context = t : e.pendingContext = t, e = Vc(o, g), e.payload = { element: A }, i = i === void 0 ? null : i, i !== null && (e.callback = i), A = Bu(n, e, g), A !== null && (eC(A, n, g, o), wL(A, n, g)), g;
}
function gH(A) {
  if (A = A.current, !A.child)
    return null;
  switch (A.child.tag) {
    case 5:
      return A.child.stateNode;
    default:
      return A.child.stateNode;
  }
}
function zrA(A, e) {
  if (A = A.memoizedState, A !== null && A.dehydrated !== null) {
    var t = A.retryLane;
    A.retryLane = t !== 0 && t < e ? t : e;
  }
}
function r$(A, e) {
  zrA(A, e), (A = A.alternate) && zrA(A, e);
}
function _6A() {
  return null;
}
var SGA = typeof reportError == "function" ? reportError : function(A) {
  console.error(A);
};
function C$(A) {
  this._internalRoot = A;
}
hK.prototype.render = C$.prototype.render = function(A) {
  var e = this._internalRoot;
  if (e === null)
    throw Error($A(409));
  dK(A, e, null, null);
};
hK.prototype.unmount = C$.prototype.unmount = function() {
  var A = this._internalRoot;
  if (A !== null) {
    this._internalRoot = null;
    var e = A.containerInfo;
    Pm(function() {
      dK(null, A, null, null);
    }), e[gQ] = null;
  }
};
function hK(A) {
  this._internalRoot = A;
}
hK.prototype.unstable_scheduleHydration = function(A) {
  if (A) {
    var e = QDA();
    A = { blockedOn: null, target: A, priority: e };
    for (var t = 0; t < SE.length && e !== 0 && e < SE[t].priority; t++)
      ;
    SE.splice(t, 0, A), t === 0 && uDA(A);
  }
};
function B$(A) {
  return !(!A || A.nodeType !== 1 && A.nodeType !== 9 && A.nodeType !== 11);
}
function mK(A) {
  return !(!A || A.nodeType !== 1 && A.nodeType !== 9 && A.nodeType !== 11 && (A.nodeType !== 8 || A.nodeValue !== " react-mount-point-unstable "));
}
function TrA() {
}
function q6A(A, e, t, i, n) {
  if (n) {
    if (typeof i == "function") {
      var o = i;
      i = function() {
        var r = gH(g);
        o.call(r);
      };
    }
    var g = HGA(e, i, A, 0, null, !1, !1, "", TrA);
    return A._reactRootContainer = g, A[gQ] = g.current, PN(A.nodeType === 8 ? A.parentNode : A), Pm(), g;
  }
  for (; n = A.lastChild; )
    A.removeChild(n);
  if (typeof i == "function") {
    var s = i;
    i = function() {
      var r = gH(I);
      s.call(r);
    };
  }
  var I = a$(A, 0, !1, null, null, !1, !1, "", TrA);
  return A._reactRootContainer = I, A[gQ] = I.current, PN(A.nodeType === 8 ? A.parentNode : A), Pm(function() {
    dK(e, I, t, i);
  }), I;
}
function pK(A, e, t, i, n) {
  var o = t._reactRootContainer;
  if (o) {
    var g = o;
    if (typeof n == "function") {
      var s = n;
      n = function() {
        var I = gH(g);
        s.call(I);
      };
    }
    dK(e, g, A, n);
  } else
    g = q6A(t, e, A, n, i);
  return gH(g);
}
lDA = function(A) {
  switch (A.tag) {
    case 3:
      var e = A.stateNode;
      if (e.current.memoizedState.isDehydrated) {
        var t = BJ(e.pendingLanes);
        t !== 0 && (Y8(e, t | 1), Ws(e, Vn()), !(Ai & 6) && (Kw = Vn() + 500, Gd()));
      }
      break;
    case 13:
      Pm(function() {
        var i = sQ(A, 1);
        if (i !== null) {
          var n = os();
          eC(i, A, 1, n);
        }
      }), r$(A, 1);
  }
};
R8 = function(A) {
  if (A.tag === 13) {
    var e = sQ(A, 134217728);
    if (e !== null) {
      var t = os();
      eC(e, A, 134217728, t);
    }
    r$(A, 134217728);
  }
};
cDA = function(A) {
  if (A.tag === 13) {
    var e = cu(A), t = sQ(A, e);
    if (t !== null) {
      var i = os();
      eC(t, A, e, i);
    }
    r$(A, e);
  }
};
QDA = function() {
  return Ji;
};
EDA = function(A, e) {
  var t = Ji;
  try {
    return Ji = A, e();
  } finally {
    Ji = t;
  }
};
h4 = function(A, e, t) {
  switch (e) {
    case "input":
      if (B4(A, t), e = t.name, t.type === "radio" && e != null) {
        for (t = A; t.parentNode; )
          t = t.parentNode;
        for (t = t.querySelectorAll("input[name=" + JSON.stringify("" + e) + '][type="radio"]'), e = 0; e < t.length; e++) {
          var i = t[e];
          if (i !== A && i.form === A.form) {
            var n = CK(i);
            if (!n)
              throw Error($A(90));
            TfA(i), B4(i, n);
          }
        }
      }
      break;
    case "textarea":
      qfA(A, t);
      break;
    case "select":
      e = t.value, e != null && Ob(A, !!t.multiple, e, !1);
  }
};
tDA = o$;
iDA = Pm;
var O6A = { usingClientEntryPoint: !1, Events: [gR, yb, CK, ADA, eDA, o$] }, nk = { findFiberByHostInstance: gm, bundleType: 0, version: "18.2.0", rendererPackageName: "react-dom" }, j6A = { bundleType: nk.bundleType, version: nk.version, rendererPackageName: nk.rendererPackageName, rendererConfig: nk.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: kQ.ReactCurrentDispatcher, findHostInstanceByFiber: function(A) {
  return A = gDA(A), A === null ? null : A.stateNode;
}, findFiberByHostInstance: nk.findFiberByHostInstance || _6A, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.2.0-next-9e3b772b8-20220608" };
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") {
  var aM = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  if (!aM.isDisabled && aM.supportsFiber)
    try {
      sK = aM.inject(j6A), vB = aM;
    } catch {
    }
}
aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = O6A;
aa.createPortal = function(A, e) {
  var t = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
  if (!B$(e))
    throw Error($A(200));
  return T6A(A, e, null, t);
};
aa.createRoot = function(A, e) {
  if (!B$(A))
    throw Error($A(299));
  var t = !1, i = "", n = SGA;
  return e != null && (e.unstable_strictMode === !0 && (t = !0), e.identifierPrefix !== void 0 && (i = e.identifierPrefix), e.onRecoverableError !== void 0 && (n = e.onRecoverableError)), e = a$(A, 1, !1, null, null, t, !1, i, n), A[gQ] = e.current, PN(A.nodeType === 8 ? A.parentNode : A), new C$(e);
};
aa.findDOMNode = function(A) {
  if (A == null)
    return null;
  if (A.nodeType === 1)
    return A;
  var e = A._reactInternals;
  if (e === void 0)
    throw typeof A.render == "function" ? Error($A(188)) : (A = Object.keys(A).join(","), Error($A(268, A)));
  return A = gDA(e), A = A === null ? null : A.stateNode, A;
};
aa.flushSync = function(A) {
  return Pm(A);
};
aa.hydrate = function(A, e, t) {
  if (!mK(e))
    throw Error($A(200));
  return pK(null, A, e, !0, t);
};
aa.hydrateRoot = function(A, e, t) {
  if (!B$(A))
    throw Error($A(405));
  var i = t != null && t.hydratedSources || null, n = !1, o = "", g = SGA;
  if (t != null && (t.unstable_strictMode === !0 && (n = !0), t.identifierPrefix !== void 0 && (o = t.identifierPrefix), t.onRecoverableError !== void 0 && (g = t.onRecoverableError)), e = HGA(e, null, A, 1, t ?? null, n, !1, o, g), A[gQ] = e.current, PN(A), i)
    for (A = 0; A < i.length; A++)
      t = i[A], n = t._getVersion, n = n(t._source), e.mutableSourceEagerHydrationData == null ? e.mutableSourceEagerHydrationData = [t, n] : e.mutableSourceEagerHydrationData.push(
        t,
        n
      );
  return new hK(e);
};
aa.render = function(A, e, t) {
  if (!mK(e))
    throw Error($A(200));
  return pK(null, A, e, !1, t);
};
aa.unmountComponentAtNode = function(A) {
  if (!mK(A))
    throw Error($A(40));
  return A._reactRootContainer ? (Pm(function() {
    pK(null, null, A, !1, function() {
      A._reactRootContainer = null, A[gQ] = null;
    });
  }), !0) : !1;
};
aa.unstable_batchedUpdates = o$;
aa.unstable_renderSubtreeIntoContainer = function(A, e, t, i) {
  if (!mK(t))
    throw Error($A(200));
  if (A == null || A._reactInternals === void 0)
    throw Error($A(38));
  return pK(A, e, t, !1, i);
};
aa.version = "18.2.0-next-9e3b772b8-20220608";
(function(A) {
  function e() {
    if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function"))
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
      } catch (t) {
        console.error(t);
      }
  }
  e(), A.exports = aa;
})(_jA);
const kd = /* @__PURE__ */ u8(Jt);
function ei(A) {
  for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  throw new Error(typeof A == "number" ? "[MobX] minified error nr: " + A + (t.length ? " " + t.map(String).join(",") : "") + ". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts" : "[MobX] " + A);
}
var P6A = {};
function l$() {
  return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : P6A;
}
var ZGA = Object.assign, sH = Object.getOwnPropertyDescriptor, SB = Object.defineProperty, yK = Object.prototype, P4 = [];
Object.freeze(P4);
var c$ = {};
Object.freeze(c$);
var $6A = typeof Proxy < "u", A8A = /* @__PURE__ */ Object.toString();
function WGA() {
  $6A || ei("Proxy not available");
}
function KGA(A) {
  var e = !1;
  return function() {
    if (!e)
      return e = !0, A.apply(this, arguments);
  };
}
var Jb = function() {
};
function EC(A) {
  return typeof A == "function";
}
function $m(A) {
  var e = typeof A;
  switch (e) {
    case "string":
    case "symbol":
    case "number":
      return !0;
  }
  return !1;
}
function bK(A) {
  return A !== null && typeof A == "object";
}
function vu(A) {
  if (!bK(A))
    return !1;
  var e = Object.getPrototypeOf(A);
  if (e == null)
    return !0;
  var t = Object.hasOwnProperty.call(e, "constructor") && e.constructor;
  return typeof t == "function" && t.toString() === A8A;
}
function UGA(A) {
  var e = A == null ? void 0 : A.constructor;
  return e ? e.name === "GeneratorFunction" || e.displayName === "GeneratorFunction" : !1;
}
function wK(A, e, t) {
  SB(A, e, {
    enumerable: !1,
    writable: !0,
    configurable: !0,
    value: t
  });
}
function VGA(A, e, t) {
  SB(A, e, {
    enumerable: !1,
    writable: !1,
    configurable: !0,
    value: t
  });
}
function Xp(A, e) {
  var t = "isMobX" + A;
  return e.prototype[t] = !0, function(i) {
    return bK(i) && i[t] === !0;
  };
}
function cD(A) {
  return A instanceof Map;
}
function IR(A) {
  return A instanceof Set;
}
var XGA = typeof Object.getOwnPropertySymbols < "u";
function e8A(A) {
  var e = Object.keys(A);
  if (!XGA)
    return e;
  var t = Object.getOwnPropertySymbols(A);
  return t.length ? [].concat(e, t.filter(function(i) {
    return yK.propertyIsEnumerable.call(A, i);
  })) : e;
}
var fK = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : XGA ? function(A) {
  return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A));
} : (
  /* istanbul ignore next */
  Object.getOwnPropertyNames
);
function zGA(A) {
  return A === null ? null : typeof A == "object" ? "" + A : A;
}
function Xc(A, e) {
  return yK.hasOwnProperty.call(A, e);
}
var t8A = Object.getOwnPropertyDescriptors || function(e) {
  var t = {};
  return fK(e).forEach(function(i) {
    t[i] = sH(e, i);
  }), t;
};
function _rA(A, e) {
  for (var t = 0; t < e.length; t++) {
    var i = e[t];
    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(A, o8A(i.key), i);
  }
}
function Q$(A, e, t) {
  return e && _rA(A.prototype, e), t && _rA(A, t), Object.defineProperty(A, "prototype", {
    writable: !1
  }), A;
}
function Uw() {
  return Uw = Object.assign ? Object.assign.bind() : function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, Uw.apply(this, arguments);
}
function TGA(A, e) {
  A.prototype = Object.create(e.prototype), A.prototype.constructor = A, $4(A, e);
}
function $4(A, e) {
  return $4 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(i, n) {
    return i.__proto__ = n, i;
  }, $4(A, e);
}
function T9(A) {
  if (A === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return A;
}
function i8A(A, e) {
  if (A) {
    if (typeof A == "string")
      return qrA(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    if (t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set")
      return Array.from(A);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return qrA(A, e);
  }
}
function qrA(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}
function Nb(A, e) {
  var t = typeof Symbol < "u" && A[Symbol.iterator] || A["@@iterator"];
  if (t)
    return (t = t.call(A)).next.bind(t);
  if (Array.isArray(A) || (t = i8A(A)) || e && A && typeof A.length == "number") {
    t && (A = t);
    var i = 0;
    return function() {
      return i >= A.length ? {
        done: !0
      } : {
        done: !1,
        value: A[i++]
      };
    };
  }
  throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function n8A(A, e) {
  if (typeof A != "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (typeof i != "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function o8A(A) {
  var e = n8A(A, "string");
  return typeof e == "symbol" ? e : String(e);
}
var GB = /* @__PURE__ */ Symbol("mobx-stored-annotations");
function ZB(A) {
  function e(t, i) {
    aR(t, i, A);
  }
  return Object.assign(e, A);
}
function aR(A, e, t) {
  Xc(A, GB) || wK(A, GB, Uw({}, A[GB])), c8A(t) || (A[GB][e] = t);
}
function g8A(A) {
  return Xc(A, GB) || wK(A, GB, Uw({}, A[GB])), A[GB];
}
var mt = /* @__PURE__ */ Symbol("mobx administration"), rR = /* @__PURE__ */ function() {
  function A(t) {
    t === void 0 && (t = "Atom"), this.name_ = void 0, this.isPendingUnobservation_ = !1, this.isBeingObserved_ = !1, this.observers_ = /* @__PURE__ */ new Set(), this.diffValue_ = 0, this.lastAccessedBy_ = 0, this.lowestObserverState_ = gi.NOT_TRACKING_, this.onBOL = void 0, this.onBUOL = void 0, this.name_ = t;
  }
  var e = A.prototype;
  return e.onBO = function() {
    this.onBOL && this.onBOL.forEach(function(i) {
      return i();
    });
  }, e.onBUO = function() {
    this.onBUOL && this.onBUOL.forEach(function(i) {
      return i();
    });
  }, e.reportObserved = function() {
    return ckA(this);
  }, e.reportChanged = function() {
    MI(), QkA(this), Ie.stateVersion = Ie.stateVersion < Number.MAX_SAFE_INTEGER ? Ie.stateVersion + 1 : Number.MIN_SAFE_INTEGER, xI();
  }, e.toString = function() {
    return this.name_;
  }, A;
}(), E$ = /* @__PURE__ */ Xp("Atom", rR);
function _GA(A, e, t) {
  e === void 0 && (e = Jb), t === void 0 && (t = Jb);
  var i = new rR(A);
  return e !== Jb && c$A(i, e), t !== Jb && bkA(i, t), i;
}
function s8A(A, e) {
  return A === e;
}
function I8A(A, e) {
  return b$(A, e);
}
function a8A(A, e) {
  return b$(A, e, 1);
}
function r8A(A, e) {
  return Object.is ? Object.is(A, e) : A === e ? A !== 0 || 1 / A === 1 / e : A !== A && e !== e;
}
var Vw = {
  identity: s8A,
  structural: I8A,
  default: r8A,
  shallow: a8A
};
function Xw(A, e, t) {
  return GkA(A) ? A : Array.isArray(A) ? _i.array(A, {
    name: t
  }) : vu(A) ? _i.object(A, void 0, {
    name: t
  }) : cD(A) ? _i.map(A, {
    name: t
  }) : IR(A) ? _i.set(A, {
    name: t
  }) : typeof A == "function" && !h$(A) && !CH(A) ? UGA(A) ? aY(A) : IY(t, A) : A;
}
function C8A(A, e, t) {
  if (A == null || rY(A) || NK(A) || zp(A) || ED(A))
    return A;
  if (Array.isArray(A))
    return _i.array(A, {
      name: t,
      deep: !1
    });
  if (vu(A))
    return _i.object(A, void 0, {
      name: t,
      deep: !1
    });
  if (cD(A))
    return _i.map(A, {
      name: t,
      deep: !1
    });
  if (IR(A))
    return _i.set(A, {
      name: t,
      deep: !1
    });
}
function DK(A) {
  return A;
}
function B8A(A, e) {
  return b$(A, e) ? e : A;
}
var l8A = "override";
function c8A(A) {
  return A.annotationType_ === l8A;
}
function CR(A, e) {
  return {
    annotationType_: A,
    options_: e,
    make_: Q8A,
    extend_: E8A
  };
}
function Q8A(A, e, t, i) {
  var n;
  if ((n = this.options_) != null && n.bound)
    return this.extend_(A, e, t, !1) === null ? 0 : 1;
  if (i === A.target_)
    return this.extend_(A, e, t, !1) === null ? 0 : 2;
  if (h$(t.value))
    return 1;
  var o = qGA(A, this, e, t, !1);
  return SB(i, e, o), 2;
}
function E8A(A, e, t, i) {
  var n = qGA(A, this, e, t);
  return A.defineProperty_(e, n, i);
}
function u8A(A, e, t, i) {
  e.annotationType_, i.value;
}
function qGA(A, e, t, i, n) {
  var o, g, s, I, r, a, C;
  n === void 0 && (n = Ie.safeDescriptors), u8A(A, e, t, i);
  var B = i.value;
  if ((o = e.options_) != null && o.bound) {
    var l;
    B = B.bind((l = A.proxy_) != null ? l : A.target_);
  }
  return {
    value: zw(
      (g = (s = e.options_) == null ? void 0 : s.name) != null ? g : t.toString(),
      B,
      (I = (r = e.options_) == null ? void 0 : r.autoAction) != null ? I : !1,
      // https://github.com/mobxjs/mobx/discussions/3140
      (a = e.options_) != null && a.bound ? (C = A.proxy_) != null ? C : A.target_ : void 0
    ),
    // Non-configurable for classes
    // prevents accidental field redefinition in subclass
    configurable: n ? A.isPlainObject_ : !0,
    // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058
    enumerable: !1,
    // Non-obsevable, therefore non-writable
    // Also prevents rewriting in subclass constructor
    writable: !n
  };
}
function OGA(A, e) {
  return {
    annotationType_: A,
    options_: e,
    make_: d8A,
    extend_: h8A
  };
}
function d8A(A, e, t, i) {
  var n;
  if (i === A.target_)
    return this.extend_(A, e, t, !1) === null ? 0 : 2;
  if ((n = this.options_) != null && n.bound && (!Xc(A.target_, e) || !CH(A.target_[e])) && this.extend_(A, e, t, !1) === null)
    return 0;
  if (CH(t.value))
    return 1;
  var o = jGA(A, this, e, t, !1, !1);
  return SB(i, e, o), 2;
}
function h8A(A, e, t, i) {
  var n, o = jGA(A, this, e, t, (n = this.options_) == null ? void 0 : n.bound);
  return A.defineProperty_(e, o, i);
}
function m8A(A, e, t, i) {
  e.annotationType_, i.value;
}
function jGA(A, e, t, i, n, o) {
  o === void 0 && (o = Ie.safeDescriptors), m8A(A, e, t, i);
  var g = i.value;
  if (CH(g) || (g = aY(g)), n) {
    var s;
    g = g.bind((s = A.proxy_) != null ? s : A.target_), g.isMobXFlow = !0;
  }
  return {
    value: g,
    // Non-configurable for classes
    // prevents accidental field redefinition in subclass
    configurable: o ? A.isPlainObject_ : !0,
    // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058
    enumerable: !1,
    // Non-obsevable, therefore non-writable
    // Also prevents rewriting in subclass constructor
    writable: !o
  };
}
function u$(A, e) {
  return {
    annotationType_: A,
    options_: e,
    make_: p8A,
    extend_: y8A
  };
}
function p8A(A, e, t) {
  return this.extend_(A, e, t, !1) === null ? 0 : 1;
}
function y8A(A, e, t, i) {
  return b8A(A, this, e, t), A.defineComputedProperty_(e, Uw({}, this.options_, {
    get: t.get,
    set: t.set
  }), i);
}
function b8A(A, e, t, i) {
  e.annotationType_, i.get;
}
function GK(A, e) {
  return {
    annotationType_: A,
    options_: e,
    make_: w8A,
    extend_: f8A
  };
}
function w8A(A, e, t) {
  return this.extend_(A, e, t, !1) === null ? 0 : 1;
}
function f8A(A, e, t, i) {
  var n, o;
  return D8A(A, this), A.defineObservableProperty_(e, t.value, (n = (o = this.options_) == null ? void 0 : o.enhancer) != null ? n : Xw, i);
}
function D8A(A, e, t, i) {
  e.annotationType_;
}
var G8A = "true", k8A = /* @__PURE__ */ PGA();
function PGA(A) {
  return {
    annotationType_: G8A,
    options_: A,
    make_: J8A,
    extend_: N8A
  };
}
function J8A(A, e, t, i) {
  var n, o;
  if (t.get)
    return kK.make_(A, e, t, i);
  if (t.set) {
    var g = zw(e.toString(), t.set);
    return i === A.target_ ? A.defineProperty_(e, {
      configurable: Ie.safeDescriptors ? A.isPlainObject_ : !0,
      set: g
    }) === null ? 0 : 2 : (SB(i, e, {
      configurable: !0,
      set: g
    }), 2);
  }
  if (i !== A.target_ && typeof t.value == "function") {
    var s;
    if (UGA(t.value)) {
      var I, r = (I = this.options_) != null && I.autoBind ? aY.bound : aY;
      return r.make_(A, e, t, i);
    }
    var a = (s = this.options_) != null && s.autoBind ? IY.bound : IY;
    return a.make_(A, e, t, i);
  }
  var C = ((n = this.options_) == null ? void 0 : n.deep) === !1 ? _i.ref : _i;
  if (typeof t.value == "function" && (o = this.options_) != null && o.autoBind) {
    var B;
    t.value = t.value.bind((B = A.proxy_) != null ? B : A.target_);
  }
  return C.make_(A, e, t, i);
}
function N8A(A, e, t, i) {
  var n, o;
  if (t.get)
    return kK.extend_(A, e, t, i);
  if (t.set)
    return A.defineProperty_(e, {
      configurable: Ie.safeDescriptors ? A.isPlainObject_ : !0,
      set: zw(e.toString(), t.set)
    }, i);
  if (typeof t.value == "function" && (n = this.options_) != null && n.autoBind) {
    var g;
    t.value = t.value.bind((g = A.proxy_) != null ? g : A.target_);
  }
  var s = ((o = this.options_) == null ? void 0 : o.deep) === !1 ? _i.ref : _i;
  return s.extend_(A, e, t, i);
}
var Y8A = "observable", R8A = "observable.ref", F8A = "observable.shallow", M8A = "observable.struct", $GA = {
  deep: !0,
  name: void 0,
  defaultDecorator: void 0,
  proxy: !0
};
Object.freeze($GA);
function rM(A) {
  return A || $GA;
}
var AkA = /* @__PURE__ */ GK(Y8A), x8A = /* @__PURE__ */ GK(R8A, {
  enhancer: DK
}), L8A = /* @__PURE__ */ GK(F8A, {
  enhancer: C8A
}), v8A = /* @__PURE__ */ GK(M8A, {
  enhancer: B8A
}), ekA = /* @__PURE__ */ ZB(AkA);
function CM(A) {
  return A.deep === !0 ? Xw : A.deep === !1 ? DK : S8A(A.defaultDecorator);
}
function H8A(A) {
  var e;
  return A ? (e = A.defaultDecorator) != null ? e : PGA(A) : void 0;
}
function S8A(A) {
  var e, t;
  return A && (e = (t = A.options_) == null ? void 0 : t.enhancer) != null ? e : Xw;
}
function tkA(A, e, t) {
  if ($m(e)) {
    aR(A, e, AkA);
    return;
  }
  return GkA(A) ? A : vu(A) ? _i.object(A, e, t) : Array.isArray(A) ? _i.array(A, e) : cD(A) ? _i.map(A, e) : IR(A) ? _i.set(A, e) : typeof A == "object" && A !== null ? A : _i.box(A, e);
}
ZGA(tkA, ekA);
var Z8A = {
  box: function(e, t) {
    var i = rM(t);
    return new tw(e, CM(i), i.name, !0, i.equals);
  },
  array: function(e, t) {
    var i = rM(t);
    return (Ie.useProxies === !1 || i.proxy === !1 ? S$A : N$A)(e, CM(i), i.name);
  },
  map: function(e, t) {
    var i = rM(t);
    return new YkA(e, CM(i), i.name);
  },
  set: function(e, t) {
    var i = rM(t);
    return new MkA(e, CM(i), i.name);
  },
  object: function(e, t, i) {
    return d$A(Ie.useProxies === !1 || (i == null ? void 0 : i.proxy) === !1 ? YK({}, i) : G$A({}, i), e, t);
  },
  ref: /* @__PURE__ */ ZB(x8A),
  shallow: /* @__PURE__ */ ZB(L8A),
  deep: ekA,
  struct: /* @__PURE__ */ ZB(v8A)
}, _i = /* @__PURE__ */ ZGA(tkA, Z8A), ikA = "computed", W8A = "computed.struct", nkA = /* @__PURE__ */ u$(ikA), K8A = /* @__PURE__ */ u$(W8A, {
  equals: Vw.structural
}), kK = function(e, t) {
  if ($m(t))
    return aR(e, t, nkA);
  if (vu(e))
    return ZB(u$(ikA, e));
  var i = vu(t) ? t : {};
  return i.get = e, i.name || (i.name = e.name || ""), new sY(i);
};
Object.assign(kK, nkA);
kK.struct = /* @__PURE__ */ ZB(K8A);
var OrA, jrA, IH = 0, U8A = 1, V8A = (OrA = (jrA = /* @__PURE__ */ sH(function() {
}, "name")) == null ? void 0 : jrA.configurable) != null ? OrA : !1, PrA = {
  value: "action",
  configurable: !0,
  writable: !1,
  enumerable: !1
};
function zw(A, e, t, i) {
  t === void 0 && (t = !1);
  function n() {
    return X8A(A, t, e, i || this, arguments);
  }
  return n.isMobxAction = !0, V8A && (PrA.value = A, SB(n, "name", PrA)), n;
}
function X8A(A, e, t, i, n) {
  var o = z8A(A, e);
  try {
    return t.apply(i, n);
  } catch (g) {
    throw o.error_ = g, g;
  } finally {
    T8A(o);
  }
}
function z8A(A, e, t, i) {
  var n = !1, o = 0, g = Ie.trackingDerivation, s = !e || !g;
  MI();
  var I = Ie.allowStateChanges;
  s && (QD(), I = BR(!0));
  var r = d$(!0), a = {
    runAsAction_: s,
    prevDerivation_: g,
    prevAllowStateChanges_: I,
    prevAllowStateReads_: r,
    notifySpy_: n,
    startTime_: o,
    actionId_: U8A++,
    parentActionId_: IH
  };
  return IH = a.actionId_, a;
}
function T8A(A) {
  IH !== A.actionId_ && ei(30), IH = A.parentActionId_, A.error_ !== void 0 && (Ie.suppressReactionErrors = !0), lR(A.prevAllowStateChanges_), sN(A.prevAllowStateReads_), xI(), A.runAsAction_ && Eu(A.prevDerivation_), Ie.suppressReactionErrors = !1;
}
function okA(A, e) {
  var t = BR(A);
  try {
    return e();
  } finally {
    lR(t);
  }
}
function BR(A) {
  var e = Ie.allowStateChanges;
  return Ie.allowStateChanges = A, e;
}
function lR(A) {
  Ie.allowStateChanges = A;
}
var gkA;
gkA = Symbol.toPrimitive;
var tw = /* @__PURE__ */ function(A) {
  TGA(e, A);
  function e(i, n, o, g, s) {
    var I;
    return o === void 0 && (o = "ObservableValue"), s === void 0 && (s = Vw.default), I = A.call(this, o) || this, I.enhancer = void 0, I.name_ = void 0, I.equals = void 0, I.hasUnreportedChange_ = !1, I.interceptors_ = void 0, I.changeListeners_ = void 0, I.value_ = void 0, I.dehancer = void 0, I.enhancer = n, I.name_ = o, I.equals = s, I.value_ = n(i, void 0, o), I;
  }
  var t = e.prototype;
  return t.dehanceValue = function(n) {
    return this.dehancer !== void 0 ? this.dehancer(n) : n;
  }, t.set = function(n) {
    this.value_, n = this.prepareNewValue_(n), n !== Ie.UNCHANGED && this.setNewValue_(n);
  }, t.prepareNewValue_ = function(n) {
    if (Ya(this)) {
      var o = Ra(this, {
        object: this,
        type: WB,
        newValue: n
      });
      if (!o)
        return Ie.UNCHANGED;
      n = o.newValue;
    }
    return n = this.enhancer(n, this.value_, this.name_), this.equals(this.value_, n) ? Ie.UNCHANGED : n;
  }, t.setNewValue_ = function(n) {
    var o = this.value_;
    this.value_ = n, this.reportChanged(), tC(this) && iC(this, {
      type: WB,
      object: this,
      newValue: n,
      oldValue: o
    });
  }, t.get = function() {
    return this.reportObserved(), this.dehanceValue(this.value_);
  }, t.intercept_ = function(n) {
    return cR(this, n);
  }, t.observe_ = function(n, o) {
    return o && n({
      observableKind: "value",
      debugObjectName: this.name_,
      object: this,
      type: WB,
      newValue: this.value_,
      oldValue: void 0
    }), QR(this, n);
  }, t.raw = function() {
    return this.value_;
  }, t.toJSON = function() {
    return this.get();
  }, t.toString = function() {
    return this.name_ + "[" + this.value_ + "]";
  }, t.valueOf = function() {
    return zGA(this.get());
  }, t[gkA] = function() {
    return this.valueOf();
  }, e;
}(rR), skA;
skA = Symbol.toPrimitive;
var sY = /* @__PURE__ */ function() {
  function A(t) {
    this.dependenciesState_ = gi.NOT_TRACKING_, this.observing_ = [], this.newObserving_ = null, this.isBeingObserved_ = !1, this.isPendingUnobservation_ = !1, this.observers_ = /* @__PURE__ */ new Set(), this.diffValue_ = 0, this.runId_ = 0, this.lastAccessedBy_ = 0, this.lowestObserverState_ = gi.UP_TO_DATE_, this.unboundDepsCount_ = 0, this.value_ = new aH(null), this.name_ = void 0, this.triggeredBy_ = void 0, this.isComputing_ = !1, this.isRunningSetter_ = !1, this.derivation = void 0, this.setter_ = void 0, this.isTracing_ = Jm.NONE, this.scope_ = void 0, this.equals_ = void 0, this.requiresReaction_ = void 0, this.keepAlive_ = void 0, this.onBOL = void 0, this.onBUOL = void 0, t.get || ei(31), this.derivation = t.get, this.name_ = t.name || "ComputedValue", t.set && (this.setter_ = zw("ComputedValue-setter", t.set)), this.equals_ = t.equals || (t.compareStructural || t.struct ? Vw.structural : Vw.default), this.scope_ = t.context, this.requiresReaction_ = t.requiresReaction, this.keepAlive_ = !!t.keepAlive;
  }
  var e = A.prototype;
  return e.onBecomeStale_ = function() {
    P8A(this);
  }, e.onBO = function() {
    this.onBOL && this.onBOL.forEach(function(i) {
      return i();
    });
  }, e.onBUO = function() {
    this.onBUOL && this.onBUOL.forEach(function(i) {
      return i();
    });
  }, e.get = function() {
    if (this.isComputing_ && ei(32, this.name_, this.derivation), Ie.inBatch === 0 && // !globalState.trackingDerivatpion &&
    this.observers_.size === 0 && !this.keepAlive_)
      Aq(this) && (this.warnAboutUntrackedRead_(), MI(), this.value_ = this.computeValue_(!1), xI());
    else if (ckA(this), Aq(this)) {
      var i = Ie.trackingContext;
      this.keepAlive_ && !i && (Ie.trackingContext = this), this.trackAndCompute() && j8A(this), Ie.trackingContext = i;
    }
    var n = this.value_;
    if (YL(n))
      throw n.cause;
    return n;
  }, e.set = function(i) {
    if (this.setter_) {
      this.isRunningSetter_ && ei(33, this.name_), this.isRunningSetter_ = !0;
      try {
        this.setter_.call(this.scope_, i);
      } finally {
        this.isRunningSetter_ = !1;
      }
    } else
      ei(34, this.name_);
  }, e.trackAndCompute = function() {
    var i = this.value_, n = (
      /* see #1208 */
      this.dependenciesState_ === gi.NOT_TRACKING_
    ), o = this.computeValue_(!0), g = n || YL(i) || YL(o) || !this.equals_(i, o);
    return g && (this.value_ = o), g;
  }, e.computeValue_ = function(i) {
    this.isComputing_ = !0;
    var n = BR(!1), o;
    if (i)
      o = IkA(this, this.derivation, this.scope_);
    else if (Ie.disableErrorBoundaries === !0)
      o = this.derivation.call(this.scope_);
    else
      try {
        o = this.derivation.call(this.scope_);
      } catch (g) {
        o = new aH(g);
      }
    return lR(n), this.isComputing_ = !1, o;
  }, e.suspend_ = function() {
    this.keepAlive_ || (eq(this), this.value_ = void 0);
  }, e.observe_ = function(i, n) {
    var o = this, g = !0, s = void 0;
    return I$A(function() {
      var I = o.get();
      if (!g || n) {
        var r = QD();
        i({
          observableKind: "computed",
          debugObjectName: o.name_,
          type: WB,
          object: o,
          newValue: I,
          oldValue: s
        }), Eu(r);
      }
      g = !1, s = I;
    });
  }, e.warnAboutUntrackedRead_ = function() {
  }, e.toString = function() {
    return this.name_ + "[" + this.derivation.toString() + "]";
  }, e.valueOf = function() {
    return zGA(this.get());
  }, e[skA] = function() {
    return this.valueOf();
  }, A;
}(), JK = /* @__PURE__ */ Xp("ComputedValue", sY), gi;
(function(A) {
  A[A.NOT_TRACKING_ = -1] = "NOT_TRACKING_", A[A.UP_TO_DATE_ = 0] = "UP_TO_DATE_", A[A.POSSIBLY_STALE_ = 1] = "POSSIBLY_STALE_", A[A.STALE_ = 2] = "STALE_";
})(gi || (gi = {}));
var Jm;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.LOG = 1] = "LOG", A[A.BREAK = 2] = "BREAK";
})(Jm || (Jm = {}));
var aH = function(e) {
  this.cause = void 0, this.cause = e;
};
function YL(A) {
  return A instanceof aH;
}
function Aq(A) {
  switch (A.dependenciesState_) {
    case gi.UP_TO_DATE_:
      return !1;
    case gi.NOT_TRACKING_:
    case gi.STALE_:
      return !0;
    case gi.POSSIBLY_STALE_: {
      for (var e = d$(!0), t = QD(), i = A.observing_, n = i.length, o = 0; o < n; o++) {
        var g = i[o];
        if (JK(g)) {
          if (Ie.disableErrorBoundaries)
            g.get();
          else
            try {
              g.get();
            } catch {
              return Eu(t), sN(e), !0;
            }
          if (A.dependenciesState_ === gi.STALE_)
            return Eu(t), sN(e), !0;
        }
      }
      return rkA(A), Eu(t), sN(e), !1;
    }
  }
}
function IkA(A, e, t) {
  var i = d$(!0);
  rkA(A), A.newObserving_ = new Array(A.observing_.length + 100), A.unboundDepsCount_ = 0, A.runId_ = ++Ie.runId;
  var n = Ie.trackingDerivation;
  Ie.trackingDerivation = A, Ie.inBatch++;
  var o;
  if (Ie.disableErrorBoundaries === !0)
    o = e.call(t);
  else
    try {
      o = e.call(t);
    } catch (g) {
      o = new aH(g);
    }
  return Ie.inBatch--, Ie.trackingDerivation = n, _8A(A), sN(i), o;
}
function _8A(A) {
  for (var e = A.observing_, t = A.observing_ = A.newObserving_, i = gi.UP_TO_DATE_, n = 0, o = A.unboundDepsCount_, g = 0; g < o; g++) {
    var s = t[g];
    s.diffValue_ === 0 && (s.diffValue_ = 1, n !== g && (t[n] = s), n++), s.dependenciesState_ > i && (i = s.dependenciesState_);
  }
  for (t.length = n, A.newObserving_ = null, o = e.length; o--; ) {
    var I = e[o];
    I.diffValue_ === 0 && BkA(I, A), I.diffValue_ = 0;
  }
  for (; n--; ) {
    var r = t[n];
    r.diffValue_ === 1 && (r.diffValue_ = 0, O8A(r, A));
  }
  i !== gi.UP_TO_DATE_ && (A.dependenciesState_ = i, A.onBecomeStale_());
}
function eq(A) {
  var e = A.observing_;
  A.observing_ = [];
  for (var t = e.length; t--; )
    BkA(e[t], A);
  A.dependenciesState_ = gi.NOT_TRACKING_;
}
function akA(A) {
  var e = QD();
  try {
    return A();
  } finally {
    Eu(e);
  }
}
function QD() {
  var A = Ie.trackingDerivation;
  return Ie.trackingDerivation = null, A;
}
function Eu(A) {
  Ie.trackingDerivation = A;
}
function d$(A) {
  var e = Ie.allowStateReads;
  return Ie.allowStateReads = A, e;
}
function sN(A) {
  Ie.allowStateReads = A;
}
function rkA(A) {
  if (A.dependenciesState_ !== gi.UP_TO_DATE_) {
    A.dependenciesState_ = gi.UP_TO_DATE_;
    for (var e = A.observing_, t = e.length; t--; )
      e[t].lowestObserverState_ = gi.UP_TO_DATE_;
  }
}
var RL = function() {
  this.version = 6, this.UNCHANGED = {}, this.trackingDerivation = null, this.trackingContext = null, this.runId = 0, this.mobxGuid = 0, this.inBatch = 0, this.pendingUnobservations = [], this.pendingReactions = [], this.isRunningReactions = !1, this.allowStateChanges = !1, this.allowStateReads = !0, this.enforceActions = !0, this.spyListeners = [], this.globalReactionErrorHandlers = [], this.computedRequiresReaction = !1, this.reactionRequiresObservable = !1, this.observableRequiresReaction = !1, this.disableErrorBoundaries = !1, this.suppressReactionErrors = !1, this.useProxies = !0, this.verifyProxies = !1, this.safeDescriptors = !0, this.stateVersion = Number.MIN_SAFE_INTEGER;
}, FL = !0, CkA = !1, Ie = /* @__PURE__ */ function() {
  var A = /* @__PURE__ */ l$();
  return A.__mobxInstanceCount > 0 && !A.__mobxGlobals && (FL = !1), A.__mobxGlobals && A.__mobxGlobals.version !== new RL().version && (FL = !1), FL ? A.__mobxGlobals ? (A.__mobxInstanceCount += 1, A.__mobxGlobals.UNCHANGED || (A.__mobxGlobals.UNCHANGED = {}), A.__mobxGlobals) : (A.__mobxInstanceCount = 1, A.__mobxGlobals = /* @__PURE__ */ new RL()) : (setTimeout(function() {
    CkA || ei(35);
  }, 1), new RL());
}();
function q8A() {
  if ((Ie.pendingReactions.length || Ie.inBatch || Ie.isRunningReactions) && ei(36), CkA = !0, FL) {
    var A = l$();
    --A.__mobxInstanceCount === 0 && (A.__mobxGlobals = void 0), Ie = new RL();
  }
}
function O8A(A, e) {
  A.observers_.add(e), A.lowestObserverState_ > e.dependenciesState_ && (A.lowestObserverState_ = e.dependenciesState_);
}
function BkA(A, e) {
  A.observers_.delete(e), A.observers_.size === 0 && lkA(A);
}
function lkA(A) {
  A.isPendingUnobservation_ === !1 && (A.isPendingUnobservation_ = !0, Ie.pendingUnobservations.push(A));
}
function MI() {
  Ie.inBatch++;
}
function xI() {
  if (--Ie.inBatch === 0) {
    EkA();
    for (var A = Ie.pendingUnobservations, e = 0; e < A.length; e++) {
      var t = A[e];
      t.isPendingUnobservation_ = !1, t.observers_.size === 0 && (t.isBeingObserved_ && (t.isBeingObserved_ = !1, t.onBUO()), t instanceof sY && t.suspend_());
    }
    Ie.pendingUnobservations = [];
  }
}
function ckA(A) {
  var e = Ie.trackingDerivation;
  return e !== null ? (e.runId_ !== A.lastAccessedBy_ && (A.lastAccessedBy_ = e.runId_, e.newObserving_[e.unboundDepsCount_++] = A, !A.isBeingObserved_ && Ie.trackingContext && (A.isBeingObserved_ = !0, A.onBO())), A.isBeingObserved_) : (A.observers_.size === 0 && Ie.inBatch > 0 && lkA(A), !1);
}
function QkA(A) {
  A.lowestObserverState_ !== gi.STALE_ && (A.lowestObserverState_ = gi.STALE_, A.observers_.forEach(function(e) {
    e.dependenciesState_ === gi.UP_TO_DATE_ && e.onBecomeStale_(), e.dependenciesState_ = gi.STALE_;
  }));
}
function j8A(A) {
  A.lowestObserverState_ !== gi.STALE_ && (A.lowestObserverState_ = gi.STALE_, A.observers_.forEach(function(e) {
    e.dependenciesState_ === gi.POSSIBLY_STALE_ ? e.dependenciesState_ = gi.STALE_ : e.dependenciesState_ === gi.UP_TO_DATE_ && (A.lowestObserverState_ = gi.UP_TO_DATE_);
  }));
}
function P8A(A) {
  A.lowestObserverState_ === gi.UP_TO_DATE_ && (A.lowestObserverState_ = gi.POSSIBLY_STALE_, A.observers_.forEach(function(e) {
    e.dependenciesState_ === gi.UP_TO_DATE_ && (e.dependenciesState_ = gi.POSSIBLY_STALE_, e.onBecomeStale_());
  }));
}
var Tw = /* @__PURE__ */ function() {
  function A(t, i, n, o) {
    t === void 0 && (t = "Reaction"), this.name_ = void 0, this.onInvalidate_ = void 0, this.errorHandler_ = void 0, this.requiresObservable_ = void 0, this.observing_ = [], this.newObserving_ = [], this.dependenciesState_ = gi.NOT_TRACKING_, this.diffValue_ = 0, this.runId_ = 0, this.unboundDepsCount_ = 0, this.isDisposed_ = !1, this.isScheduled_ = !1, this.isTrackPending_ = !1, this.isRunning_ = !1, this.isTracing_ = Jm.NONE, this.name_ = t, this.onInvalidate_ = i, this.errorHandler_ = n, this.requiresObservable_ = o;
  }
  var e = A.prototype;
  return e.onBecomeStale_ = function() {
    this.schedule_();
  }, e.schedule_ = function() {
    this.isScheduled_ || (this.isScheduled_ = !0, Ie.pendingReactions.push(this), EkA());
  }, e.isScheduled = function() {
    return this.isScheduled_;
  }, e.runReaction_ = function() {
    if (!this.isDisposed_) {
      MI(), this.isScheduled_ = !1;
      var i = Ie.trackingContext;
      if (Ie.trackingContext = this, Aq(this)) {
        this.isTrackPending_ = !0;
        try {
          this.onInvalidate_();
        } catch (n) {
          this.reportExceptionInDerivation_(n);
        }
      }
      Ie.trackingContext = i, xI();
    }
  }, e.track = function(i) {
    if (!this.isDisposed_) {
      MI(), this.isRunning_ = !0;
      var n = Ie.trackingContext;
      Ie.trackingContext = this;
      var o = IkA(this, i, void 0);
      Ie.trackingContext = n, this.isRunning_ = !1, this.isTrackPending_ = !1, this.isDisposed_ && eq(this), YL(o) && this.reportExceptionInDerivation_(o.cause), xI();
    }
  }, e.reportExceptionInDerivation_ = function(i) {
    var n = this;
    if (this.errorHandler_) {
      this.errorHandler_(i, this);
      return;
    }
    if (Ie.disableErrorBoundaries)
      throw i;
    var o = "[mobx] uncaught error in '" + this + "'";
    Ie.suppressReactionErrors || console.error(o, i), Ie.globalReactionErrorHandlers.forEach(function(g) {
      return g(i, n);
    });
  }, e.dispose = function() {
    this.isDisposed_ || (this.isDisposed_ = !0, this.isRunning_ || (MI(), eq(this), xI()));
  }, e.getDisposer_ = function() {
    var i = this.dispose.bind(this);
    return i[mt] = this, i;
  }, e.toString = function() {
    return "Reaction[" + this.name_ + "]";
  }, e.trace = function(i) {
    i === void 0 && (i = !1), w$A(this, i);
  }, A;
}(), $8A = 100, tq = function(e) {
  return e();
};
function EkA() {
  Ie.inBatch > 0 || Ie.isRunningReactions || tq(A$A);
}
function A$A() {
  Ie.isRunningReactions = !0;
  for (var A = Ie.pendingReactions, e = 0; A.length > 0; ) {
    ++e === $8A && (console.error("[mobx] cycle in reaction: " + A[0]), A.splice(0));
    for (var t = A.splice(0), i = 0, n = t.length; i < n; i++)
      t[i].runReaction_();
  }
  Ie.isRunningReactions = !1;
}
var rH = /* @__PURE__ */ Xp("Reaction", Tw);
function e$A(A) {
  var e = tq;
  tq = function(i) {
    return A(function() {
      return e(i);
    });
  };
}
function IN() {
  return !1;
}
function t$A(A) {
  return console.warn("[mobx.spy] Is a no-op in production builds"), function() {
  };
}
var ukA = "action", i$A = "action.bound", dkA = "autoAction", n$A = "autoAction.bound", o$A = "<unnamed action>", hkA = /* @__PURE__ */ CR(ukA), g$A = /* @__PURE__ */ CR(i$A, {
  bound: !0
}), mkA = /* @__PURE__ */ CR(dkA, {
  autoAction: !0
}), s$A = /* @__PURE__ */ CR(n$A, {
  autoAction: !0,
  bound: !0
});
function pkA(A) {
  var e = function(i, n) {
    if (EC(i))
      return zw(i.name || o$A, i, A);
    if (EC(n))
      return zw(i, n, A);
    if ($m(n))
      return aR(i, n, A ? mkA : hkA);
    if ($m(i))
      return ZB(CR(A ? dkA : ukA, {
        name: i,
        autoAction: A
      }));
  };
  return e;
}
var hg = /* @__PURE__ */ pkA(!1);
Object.assign(hg, hkA);
var IY = /* @__PURE__ */ pkA(!0);
Object.assign(IY, mkA);
hg.bound = /* @__PURE__ */ ZB(g$A);
IY.bound = /* @__PURE__ */ ZB(s$A);
function h$(A) {
  return EC(A) && A.isMobxAction === !0;
}
function I$A(A, e) {
  var t, i;
  e === void 0 && (e = c$);
  var n = (t = (i = e) == null ? void 0 : i.name) != null ? t : "Autorun", o = !e.scheduler && !e.delay, g;
  if (o)
    g = new Tw(n, function() {
      this.track(r);
    }, e.onError, e.requiresObservable);
  else {
    var s = ykA(e), I = !1;
    g = new Tw(n, function() {
      I || (I = !0, s(function() {
        I = !1, g.isDisposed_ || g.track(r);
      }));
    }, e.onError, e.requiresObservable);
  }
  function r() {
    A(g);
  }
  return g.schedule_(), g.getDisposer_();
}
var a$A = function(e) {
  return e();
};
function ykA(A) {
  return A.scheduler ? A.scheduler : A.delay ? function(e) {
    return setTimeout(e, A.delay);
  } : a$A;
}
function r$A(A, e, t) {
  var i;
  t === void 0 && (t = c$);
  var n = (i = t.name) != null ? i : "Reaction", o = hg(n, t.onError ? C$A(t.onError, e) : e), g = !t.scheduler && !t.delay, s = ykA(t), I = !0, r = !1, a, C, B = t.compareStructural ? Vw.structural : t.equals || Vw.default, l = new Tw(n, function() {
    I || g ? Q() : r || (r = !0, s(Q));
  }, t.onError, t.requiresObservable);
  function Q() {
    if (r = !1, !l.isDisposed_) {
      var E = !1;
      l.track(function() {
        var d = okA(!1, function() {
          return A(l);
        });
        E = I || !B(a, d), C = a, a = d;
      }), (I && t.fireImmediately || !I && E) && o(a, C, l), I = !1;
    }
  }
  return l.schedule_(), l.getDisposer_();
}
function C$A(A, e) {
  return function() {
    try {
      return e.apply(this, arguments);
    } catch (t) {
      A.call(this, t);
    }
  };
}
var B$A = "onBO", l$A = "onBUO";
function c$A(A, e, t) {
  return wkA(B$A, A, e, t);
}
function bkA(A, e, t) {
  return wkA(l$A, A, e, t);
}
function wkA(A, e, t, i) {
  var n = typeof i == "function" ? Hu(e, t) : Hu(e), o = EC(i) ? i : t, g = A + "L";
  return n[g] ? n[g].add(o) : n[g] = /* @__PURE__ */ new Set([o]), function() {
    var s = n[g];
    s && (s.delete(o), s.size === 0 && delete n[g]);
  };
}
var Q$A = "never", BM = "always", E$A = "observed";
function u$A(A) {
  A.isolateGlobalState === !0 && q8A();
  var e = A.useProxies, t = A.enforceActions;
  if (e !== void 0 && (Ie.useProxies = e === BM ? !0 : e === Q$A ? !1 : typeof Proxy < "u"), e === "ifavailable" && (Ie.verifyProxies = !0), t !== void 0) {
    var i = t === BM ? BM : t === E$A;
    Ie.enforceActions = i, Ie.allowStateChanges = !(i === !0 || i === BM);
  }
  ["computedRequiresReaction", "reactionRequiresObservable", "observableRequiresReaction", "disableErrorBoundaries", "safeDescriptors"].forEach(function(n) {
    n in A && (Ie[n] = !!A[n]);
  }), Ie.allowStateReads = !Ie.observableRequiresReaction, A.reactionScheduler && e$A(A.reactionScheduler);
}
function d$A(A, e, t, i) {
  var n = t8A(e), o = YK(A, i)[mt];
  MI();
  try {
    fK(n).forEach(function(g) {
      o.extend_(
        g,
        n[g],
        // must pass "undefined" for { key: undefined }
        t && g in t ? t[g] : !0
      );
    });
  } finally {
    xI();
  }
  return A;
}
function h$A(A, e) {
  return fkA(Hu(A, e));
}
function fkA(A) {
  var e = {
    name: A.name_
  };
  return A.observing_ && A.observing_.length > 0 && (e.dependencies = m$A(A.observing_).map(fkA)), e;
}
function m$A(A) {
  return Array.from(new Set(A));
}
var p$A = 0;
function DkA() {
  this.message = "FLOW_CANCELLED";
}
DkA.prototype = /* @__PURE__ */ Object.create(Error.prototype);
var $rA = /* @__PURE__ */ OGA("flow"), y$A = /* @__PURE__ */ OGA("flow.bound", {
  bound: !0
}), aY = /* @__PURE__ */ Object.assign(function(e, t) {
  if ($m(t))
    return aR(e, t, $rA);
  var i = e, n = i.name || "<unnamed flow>", o = function() {
    var s = this, I = arguments, r = ++p$A, a = hg(n + " - runid: " + r + " - init", i).apply(s, I), C, B = void 0, l = new Promise(function(Q, E) {
      var d = 0;
      C = E;
      function m(w) {
        B = void 0;
        var G;
        try {
          G = hg(n + " - runid: " + r + " - yield " + d++, a.next).call(a, w);
        } catch (R) {
          return E(R);
        }
        f(G);
      }
      function y(w) {
        B = void 0;
        var G;
        try {
          G = hg(n + " - runid: " + r + " - yield " + d++, a.throw).call(a, w);
        } catch (R) {
          return E(R);
        }
        f(G);
      }
      function f(w) {
        if (EC(w == null ? void 0 : w.then)) {
          w.then(f, E);
          return;
        }
        return w.done ? Q(w.value) : (B = Promise.resolve(w.value), B.then(m, y));
      }
      m(void 0);
    });
    return l.cancel = hg(n + " - runid: " + r + " - cancel", function() {
      try {
        B && ACA(B);
        var Q = a.return(void 0), E = Promise.resolve(Q.value);
        E.then(Jb, Jb), ACA(E), C(new DkA());
      } catch (d) {
        C(d);
      }
    }), l;
  };
  return o.isMobXFlow = !0, o;
}, $rA);
aY.bound = /* @__PURE__ */ ZB(y$A);
function ACA(A) {
  EC(A.cancel) && A.cancel();
}
function CH(A) {
  return (A == null ? void 0 : A.isMobXFlow) === !0;
}
function b$A(A, e) {
  return A ? e !== void 0 ? rY(A) ? A[mt].values_.has(e) : !1 : rY(A) || !!A[mt] || E$(A) || rH(A) || JK(A) : !1;
}
function GkA(A) {
  return b$A(A);
}
function w$A() {
  ei("trace() is not available in production builds");
  for (var A = !1, e = arguments.length, t = new Array(e), i = 0; i < e; i++)
    t[i] = arguments[i];
  typeof t[t.length - 1] == "boolean" && (A = t.pop());
  var n = f$A(t);
  if (!n)
    return ei("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");
  n.isTracing_ === Jm.NONE && console.log("[mobx.trace] '" + n.name_ + "' tracing enabled"), n.isTracing_ = A ? Jm.BREAK : Jm.LOG;
}
function f$A(A) {
  switch (A.length) {
    case 0:
      return Ie.trackingDerivation;
    case 1:
      return Hu(A[0]);
    case 2:
      return Hu(A[0], A[1]);
  }
}
function wc(A, e) {
  e === void 0 && (e = void 0), MI();
  try {
    return A.apply(e);
  } finally {
    xI();
  }
}
function Ay(A) {
  return A[mt];
}
var D$A = {
  has: function(e, t) {
    return Ay(e).has_(t);
  },
  get: function(e, t) {
    return Ay(e).get_(t);
  },
  set: function(e, t, i) {
    var n;
    return $m(t) ? (n = Ay(e).set_(t, i, !0)) != null ? n : !0 : !1;
  },
  deleteProperty: function(e, t) {
    var i;
    return $m(t) ? (i = Ay(e).delete_(t, !0)) != null ? i : !0 : !1;
  },
  defineProperty: function(e, t, i) {
    var n;
    return (n = Ay(e).defineProperty_(t, i)) != null ? n : !0;
  },
  ownKeys: function(e) {
    return Ay(e).ownKeys_();
  },
  preventExtensions: function(e) {
    ei(13);
  }
};
function G$A(A, e) {
  var t, i;
  return WGA(), A = YK(A, e), (i = (t = A[mt]).proxy_) != null ? i : t.proxy_ = new Proxy(A, D$A);
}
function Ya(A) {
  return A.interceptors_ !== void 0 && A.interceptors_.length > 0;
}
function cR(A, e) {
  var t = A.interceptors_ || (A.interceptors_ = []);
  return t.push(e), KGA(function() {
    var i = t.indexOf(e);
    i !== -1 && t.splice(i, 1);
  });
}
function Ra(A, e) {
  var t = QD();
  try {
    for (var i = [].concat(A.interceptors_ || []), n = 0, o = i.length; n < o && (e = i[n](e), e && !e.type && ei(14), !!e); n++)
      ;
    return e;
  } finally {
    Eu(t);
  }
}
function tC(A) {
  return A.changeListeners_ !== void 0 && A.changeListeners_.length > 0;
}
function QR(A, e) {
  var t = A.changeListeners_ || (A.changeListeners_ = []);
  return t.push(e), KGA(function() {
    var i = t.indexOf(e);
    i !== -1 && t.splice(i, 1);
  });
}
function iC(A, e) {
  var t = QD(), i = A.changeListeners_;
  if (i) {
    i = i.slice();
    for (var n = 0, o = i.length; n < o; n++)
      i[n](e);
    Eu(t);
  }
}
function m$(A, e, t) {
  var i = YK(A, t)[mt];
  MI();
  try {
    var n;
    (n = e) != null || (e = g8A(A)), fK(e).forEach(function(o) {
      return i.make_(o, e[o]);
    });
  } finally {
    xI();
  }
  return A;
}
var eCA = "splice", WB = "update", k$A = 1e4, J$A = {
  get: function(e, t) {
    var i = e[mt];
    return t === mt ? i : t === "length" ? i.getArrayLength_() : typeof t == "string" && !isNaN(t) ? i.get_(parseInt(t)) : Xc(BH, t) ? BH[t] : e[t];
  },
  set: function(e, t, i) {
    var n = e[mt];
    return t === "length" && n.setArrayLength_(i), typeof t == "symbol" || isNaN(t) ? e[t] = i : n.set_(parseInt(t), i), !0;
  },
  preventExtensions: function() {
    ei(15);
  }
}, p$ = /* @__PURE__ */ function() {
  function A(t, i, n, o) {
    t === void 0 && (t = "ObservableArray"), this.owned_ = void 0, this.legacyMode_ = void 0, this.atom_ = void 0, this.values_ = [], this.interceptors_ = void 0, this.changeListeners_ = void 0, this.enhancer_ = void 0, this.dehancer = void 0, this.proxy_ = void 0, this.lastKnownLength_ = 0, this.owned_ = n, this.legacyMode_ = o, this.atom_ = new rR(t), this.enhancer_ = function(g, s) {
      return i(g, s, "ObservableArray[..]");
    };
  }
  var e = A.prototype;
  return e.dehanceValue_ = function(i) {
    return this.dehancer !== void 0 ? this.dehancer(i) : i;
  }, e.dehanceValues_ = function(i) {
    return this.dehancer !== void 0 && i.length > 0 ? i.map(this.dehancer) : i;
  }, e.intercept_ = function(i) {
    return cR(this, i);
  }, e.observe_ = function(i, n) {
    return n === void 0 && (n = !1), n && i({
      observableKind: "array",
      object: this.proxy_,
      debugObjectName: this.atom_.name_,
      type: "splice",
      index: 0,
      added: this.values_.slice(),
      addedCount: this.values_.length,
      removed: [],
      removedCount: 0
    }), QR(this, i);
  }, e.getArrayLength_ = function() {
    return this.atom_.reportObserved(), this.values_.length;
  }, e.setArrayLength_ = function(i) {
    (typeof i != "number" || isNaN(i) || i < 0) && ei("Out of range: " + i);
    var n = this.values_.length;
    if (i !== n)
      if (i > n) {
        for (var o = new Array(i - n), g = 0; g < i - n; g++)
          o[g] = void 0;
        this.spliceWithArray_(n, 0, o);
      } else
        this.spliceWithArray_(i, n - i);
  }, e.updateArrayLength_ = function(i, n) {
    i !== this.lastKnownLength_ && ei(16), this.lastKnownLength_ += n, this.legacyMode_ && n > 0 && HkA(i + n + 1);
  }, e.spliceWithArray_ = function(i, n, o) {
    var g = this;
    this.atom_;
    var s = this.values_.length;
    if (i === void 0 ? i = 0 : i > s ? i = s : i < 0 && (i = Math.max(0, s + i)), arguments.length === 1 ? n = s - i : n == null ? n = 0 : n = Math.max(0, Math.min(n, s - i)), o === void 0 && (o = P4), Ya(this)) {
      var I = Ra(this, {
        object: this.proxy_,
        type: eCA,
        index: i,
        removedCount: n,
        added: o
      });
      if (!I)
        return P4;
      n = I.removedCount, o = I.added;
    }
    if (o = o.length === 0 ? o : o.map(function(C) {
      return g.enhancer_(C, void 0);
    }), this.legacyMode_) {
      var r = o.length - n;
      this.updateArrayLength_(s, r);
    }
    var a = this.spliceItemsIntoValues_(i, n, o);
    return (n !== 0 || o.length !== 0) && this.notifyArraySplice_(i, o, a), this.dehanceValues_(a);
  }, e.spliceItemsIntoValues_ = function(i, n, o) {
    if (o.length < k$A) {
      var g;
      return (g = this.values_).splice.apply(g, [i, n].concat(o));
    } else {
      var s = this.values_.slice(i, i + n), I = this.values_.slice(i + n);
      this.values_.length += o.length - n;
      for (var r = 0; r < o.length; r++)
        this.values_[i + r] = o[r];
      for (var a = 0; a < I.length; a++)
        this.values_[i + o.length + a] = I[a];
      return s;
    }
  }, e.notifyArrayChildUpdate_ = function(i, n, o) {
    var g = !this.owned_ && IN(), s = tC(this), I = s || g ? {
      observableKind: "array",
      object: this.proxy_,
      type: WB,
      debugObjectName: this.atom_.name_,
      index: i,
      newValue: n,
      oldValue: o
    } : null;
    this.atom_.reportChanged(), s && iC(this, I);
  }, e.notifyArraySplice_ = function(i, n, o) {
    var g = !this.owned_ && IN(), s = tC(this), I = s || g ? {
      observableKind: "array",
      object: this.proxy_,
      debugObjectName: this.atom_.name_,
      type: eCA,
      index: i,
      removed: o,
      added: n,
      removedCount: o.length,
      addedCount: n.length
    } : null;
    this.atom_.reportChanged(), s && iC(this, I);
  }, e.get_ = function(i) {
    if (this.legacyMode_ && i >= this.values_.length) {
      console.warn("[mobx] Out of bounds read: " + i);
      return;
    }
    return this.atom_.reportObserved(), this.dehanceValue_(this.values_[i]);
  }, e.set_ = function(i, n) {
    var o = this.values_;
    if (this.legacyMode_ && i > o.length && ei(17, i, o.length), i < o.length) {
      this.atom_;
      var g = o[i];
      if (Ya(this)) {
        var s = Ra(this, {
          type: WB,
          object: this.proxy_,
          index: i,
          newValue: n
        });
        if (!s)
          return;
        n = s.newValue;
      }
      n = this.enhancer_(n, g);
      var I = n !== g;
      I && (o[i] = n, this.notifyArrayChildUpdate_(i, n, g));
    } else {
      for (var r = new Array(i + 1 - o.length), a = 0; a < r.length - 1; a++)
        r[a] = void 0;
      r[r.length - 1] = n, this.spliceWithArray_(o.length, 0, r);
    }
  }, A;
}();
function N$A(A, e, t, i) {
  t === void 0 && (t = "ObservableArray"), i === void 0 && (i = !1), WGA();
  var n = new p$(t, e, i, !1);
  VGA(n.values_, mt, n);
  var o = new Proxy(n.values_, J$A);
  if (n.proxy_ = o, A && A.length) {
    var g = BR(!0);
    n.spliceWithArray_(0, 0, A), lR(g);
  }
  return o;
}
var BH = {
  clear: function() {
    return this.splice(0);
  },
  replace: function(e) {
    var t = this[mt];
    return t.spliceWithArray_(0, t.values_.length, e);
  },
  // Used by JSON.stringify
  toJSON: function() {
    return this.slice();
  },
  /*
   * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)
   * since these functions alter the inner structure of the array, the have side effects.
   * Because the have side effects, they should not be used in computed function,
   * and for that reason the do not call dependencyState.notifyObserved
   */
  splice: function(e, t) {
    for (var i = arguments.length, n = new Array(i > 2 ? i - 2 : 0), o = 2; o < i; o++)
      n[o - 2] = arguments[o];
    var g = this[mt];
    switch (arguments.length) {
      case 0:
        return [];
      case 1:
        return g.spliceWithArray_(e);
      case 2:
        return g.spliceWithArray_(e, t);
    }
    return g.spliceWithArray_(e, t, n);
  },
  spliceWithArray: function(e, t, i) {
    return this[mt].spliceWithArray_(e, t, i);
  },
  push: function() {
    for (var e = this[mt], t = arguments.length, i = new Array(t), n = 0; n < t; n++)
      i[n] = arguments[n];
    return e.spliceWithArray_(e.values_.length, 0, i), e.values_.length;
  },
  pop: function() {
    return this.splice(Math.max(this[mt].values_.length - 1, 0), 1)[0];
  },
  shift: function() {
    return this.splice(0, 1)[0];
  },
  unshift: function() {
    for (var e = this[mt], t = arguments.length, i = new Array(t), n = 0; n < t; n++)
      i[n] = arguments[n];
    return e.spliceWithArray_(0, 0, i), e.values_.length;
  },
  reverse: function() {
    return Ie.trackingDerivation && ei(37, "reverse"), this.replace(this.slice().reverse()), this;
  },
  sort: function() {
    Ie.trackingDerivation && ei(37, "sort");
    var e = this.slice();
    return e.sort.apply(e, arguments), this.replace(e), this;
  },
  remove: function(e) {
    var t = this[mt], i = t.dehanceValues_(t.values_).indexOf(e);
    return i > -1 ? (this.splice(i, 1), !0) : !1;
  }
};
Eo("concat", JQ);
Eo("flat", JQ);
Eo("includes", JQ);
Eo("indexOf", JQ);
Eo("join", JQ);
Eo("lastIndexOf", JQ);
Eo("slice", JQ);
Eo("toString", JQ);
Eo("toLocaleString", JQ);
Eo("every", Jd);
Eo("filter", Jd);
Eo("find", Jd);
Eo("findIndex", Jd);
Eo("flatMap", Jd);
Eo("forEach", Jd);
Eo("map", Jd);
Eo("some", Jd);
Eo("reduce", kkA);
Eo("reduceRight", kkA);
function Eo(A, e) {
  typeof Array.prototype[A] == "function" && (BH[A] = e(A));
}
function JQ(A) {
  return function() {
    var e = this[mt];
    e.atom_.reportObserved();
    var t = e.dehanceValues_(e.values_);
    return t[A].apply(t, arguments);
  };
}
function Jd(A) {
  return function(e, t) {
    var i = this, n = this[mt];
    n.atom_.reportObserved();
    var o = n.dehanceValues_(n.values_);
    return o[A](function(g, s) {
      return e.call(t, g, s, i);
    });
  };
}
function kkA(A) {
  return function() {
    var e = this, t = this[mt];
    t.atom_.reportObserved();
    var i = t.dehanceValues_(t.values_), n = arguments[0];
    return arguments[0] = function(o, g, s) {
      return n(o, g, s, e);
    }, i[A].apply(i, arguments);
  };
}
var Y$A = /* @__PURE__ */ Xp("ObservableArrayAdministration", p$);
function NK(A) {
  return bK(A) && Y$A(A[mt]);
}
var JkA, NkA, R$A = {}, _E = "add", lH = "delete";
JkA = Symbol.iterator;
NkA = Symbol.toStringTag;
var YkA = /* @__PURE__ */ function() {
  function A(t, i, n) {
    var o = this;
    i === void 0 && (i = Xw), n === void 0 && (n = "ObservableMap"), this.enhancer_ = void 0, this.name_ = void 0, this[mt] = R$A, this.data_ = void 0, this.hasMap_ = void 0, this.keysAtom_ = void 0, this.interceptors_ = void 0, this.changeListeners_ = void 0, this.dehancer = void 0, this.enhancer_ = i, this.name_ = n, EC(Map) || ei(18), this.keysAtom_ = _GA("ObservableMap.keys()"), this.data_ = /* @__PURE__ */ new Map(), this.hasMap_ = /* @__PURE__ */ new Map(), okA(!0, function() {
      o.merge(t);
    });
  }
  var e = A.prototype;
  return e.has_ = function(i) {
    return this.data_.has(i);
  }, e.has = function(i) {
    var n = this;
    if (!Ie.trackingDerivation)
      return this.has_(i);
    var o = this.hasMap_.get(i);
    if (!o) {
      var g = o = new tw(this.has_(i), DK, "ObservableMap.key?", !1);
      this.hasMap_.set(i, g), bkA(g, function() {
        return n.hasMap_.delete(i);
      });
    }
    return o.get();
  }, e.set = function(i, n) {
    var o = this.has_(i);
    if (Ya(this)) {
      var g = Ra(this, {
        type: o ? WB : _E,
        object: this,
        newValue: n,
        name: i
      });
      if (!g)
        return this;
      n = g.newValue;
    }
    return o ? this.updateValue_(i, n) : this.addValue_(i, n), this;
  }, e.delete = function(i) {
    var n = this;
    if (this.keysAtom_, Ya(this)) {
      var o = Ra(this, {
        type: lH,
        object: this,
        name: i
      });
      if (!o)
        return !1;
    }
    if (this.has_(i)) {
      var g = IN(), s = tC(this), I = s || g ? {
        observableKind: "map",
        debugObjectName: this.name_,
        type: lH,
        object: this,
        oldValue: this.data_.get(i).value_,
        name: i
      } : null;
      return wc(function() {
        var r;
        n.keysAtom_.reportChanged(), (r = n.hasMap_.get(i)) == null || r.setNewValue_(!1);
        var a = n.data_.get(i);
        a.setNewValue_(void 0), n.data_.delete(i);
      }), s && iC(this, I), !0;
    }
    return !1;
  }, e.updateValue_ = function(i, n) {
    var o = this.data_.get(i);
    if (n = o.prepareNewValue_(n), n !== Ie.UNCHANGED) {
      var g = IN(), s = tC(this), I = s || g ? {
        observableKind: "map",
        debugObjectName: this.name_,
        type: WB,
        object: this,
        oldValue: o.value_,
        name: i,
        newValue: n
      } : null;
      o.setNewValue_(n), s && iC(this, I);
    }
  }, e.addValue_ = function(i, n) {
    var o = this;
    this.keysAtom_, wc(function() {
      var r, a = new tw(n, o.enhancer_, "ObservableMap.key", !1);
      o.data_.set(i, a), n = a.value_, (r = o.hasMap_.get(i)) == null || r.setNewValue_(!0), o.keysAtom_.reportChanged();
    });
    var g = IN(), s = tC(this), I = s || g ? {
      observableKind: "map",
      debugObjectName: this.name_,
      type: _E,
      object: this,
      name: i,
      newValue: n
    } : null;
    s && iC(this, I);
  }, e.get = function(i) {
    return this.has(i) ? this.dehanceValue_(this.data_.get(i).get()) : this.dehanceValue_(void 0);
  }, e.dehanceValue_ = function(i) {
    return this.dehancer !== void 0 ? this.dehancer(i) : i;
  }, e.keys = function() {
    return this.keysAtom_.reportObserved(), this.data_.keys();
  }, e.values = function() {
    var i = this, n = this.keys();
    return CY({
      next: function() {
        var g = n.next(), s = g.done, I = g.value;
        return {
          done: s,
          value: s ? void 0 : i.get(I)
        };
      }
    });
  }, e.entries = function() {
    var i = this, n = this.keys();
    return CY({
      next: function() {
        var g = n.next(), s = g.done, I = g.value;
        return {
          done: s,
          value: s ? void 0 : [I, i.get(I)]
        };
      }
    });
  }, e[JkA] = function() {
    return this.entries();
  }, e.forEach = function(i, n) {
    for (var o = Nb(this), g; !(g = o()).done; ) {
      var s = g.value, I = s[0], r = s[1];
      i.call(n, r, I, this);
    }
  }, e.merge = function(i) {
    var n = this;
    return zp(i) && (i = new Map(i)), wc(function() {
      vu(i) ? e8A(i).forEach(function(o) {
        return n.set(o, i[o]);
      }) : Array.isArray(i) ? i.forEach(function(o) {
        var g = o[0], s = o[1];
        return n.set(g, s);
      }) : cD(i) ? (i.constructor !== Map && ei(19, i), i.forEach(function(o, g) {
        return n.set(g, o);
      })) : i != null && ei(20, i);
    }), this;
  }, e.clear = function() {
    var i = this;
    wc(function() {
      akA(function() {
        for (var n = Nb(i.keys()), o; !(o = n()).done; ) {
          var g = o.value;
          i.delete(g);
        }
      });
    });
  }, e.replace = function(i) {
    var n = this;
    return wc(function() {
      for (var o = F$A(i), g = /* @__PURE__ */ new Map(), s = !1, I = Nb(n.data_.keys()), r; !(r = I()).done; ) {
        var a = r.value;
        if (!o.has(a)) {
          var C = n.delete(a);
          if (C)
            s = !0;
          else {
            var B = n.data_.get(a);
            g.set(a, B);
          }
        }
      }
      for (var l = Nb(o.entries()), Q; !(Q = l()).done; ) {
        var E = Q.value, d = E[0], m = E[1], y = n.data_.has(d);
        if (n.set(d, m), n.data_.has(d)) {
          var f = n.data_.get(d);
          g.set(d, f), y || (s = !0);
        }
      }
      if (!s)
        if (n.data_.size !== g.size)
          n.keysAtom_.reportChanged();
        else
          for (var w = n.data_.keys(), G = g.keys(), R = w.next(), F = G.next(); !R.done; ) {
            if (R.value !== F.value) {
              n.keysAtom_.reportChanged();
              break;
            }
            R = w.next(), F = G.next();
          }
      n.data_ = g;
    }), this;
  }, e.toString = function() {
    return "[object ObservableMap]";
  }, e.toJSON = function() {
    return Array.from(this);
  }, e.observe_ = function(i, n) {
    return QR(this, i);
  }, e.intercept_ = function(i) {
    return cR(this, i);
  }, Q$(A, [{
    key: "size",
    get: function() {
      return this.keysAtom_.reportObserved(), this.data_.size;
    }
  }, {
    key: NkA,
    get: function() {
      return "Map";
    }
  }]), A;
}(), zp = /* @__PURE__ */ Xp("ObservableMap", YkA);
function F$A(A) {
  if (cD(A) || zp(A))
    return A;
  if (Array.isArray(A))
    return new Map(A);
  if (vu(A)) {
    var e = /* @__PURE__ */ new Map();
    for (var t in A)
      e.set(t, A[t]);
    return e;
  } else
    return ei(21, A);
}
var RkA, FkA, M$A = {};
RkA = Symbol.iterator;
FkA = Symbol.toStringTag;
var MkA = /* @__PURE__ */ function() {
  function A(t, i, n) {
    i === void 0 && (i = Xw), n === void 0 && (n = "ObservableSet"), this.name_ = void 0, this[mt] = M$A, this.data_ = /* @__PURE__ */ new Set(), this.atom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.dehancer = void 0, this.enhancer_ = void 0, this.name_ = n, EC(Set) || ei(22), this.atom_ = _GA(this.name_), this.enhancer_ = function(o, g) {
      return i(o, g, n);
    }, t && this.replace(t);
  }
  var e = A.prototype;
  return e.dehanceValue_ = function(i) {
    return this.dehancer !== void 0 ? this.dehancer(i) : i;
  }, e.clear = function() {
    var i = this;
    wc(function() {
      akA(function() {
        for (var n = Nb(i.data_.values()), o; !(o = n()).done; ) {
          var g = o.value;
          i.delete(g);
        }
      });
    });
  }, e.forEach = function(i, n) {
    for (var o = Nb(this), g; !(g = o()).done; ) {
      var s = g.value;
      i.call(n, s, s, this);
    }
  }, e.add = function(i) {
    var n = this;
    if (this.atom_, Ya(this)) {
      var o = Ra(this, {
        type: _E,
        object: this,
        newValue: i
      });
      if (!o)
        return this;
    }
    if (!this.has(i)) {
      wc(function() {
        n.data_.add(n.enhancer_(i, void 0)), n.atom_.reportChanged();
      });
      var g = !1, s = tC(this), I = s || g ? {
        observableKind: "set",
        debugObjectName: this.name_,
        type: _E,
        object: this,
        newValue: i
      } : null;
      s && iC(this, I);
    }
    return this;
  }, e.delete = function(i) {
    var n = this;
    if (Ya(this)) {
      var o = Ra(this, {
        type: lH,
        object: this,
        oldValue: i
      });
      if (!o)
        return !1;
    }
    if (this.has(i)) {
      var g = !1, s = tC(this), I = s || g ? {
        observableKind: "set",
        debugObjectName: this.name_,
        type: lH,
        object: this,
        oldValue: i
      } : null;
      return wc(function() {
        n.atom_.reportChanged(), n.data_.delete(i);
      }), s && iC(this, I), !0;
    }
    return !1;
  }, e.has = function(i) {
    return this.atom_.reportObserved(), this.data_.has(this.dehanceValue_(i));
  }, e.entries = function() {
    var i = 0, n = Array.from(this.keys()), o = Array.from(this.values());
    return CY({
      next: function() {
        var s = i;
        return i += 1, s < o.length ? {
          value: [n[s], o[s]],
          done: !1
        } : {
          done: !0
        };
      }
    });
  }, e.keys = function() {
    return this.values();
  }, e.values = function() {
    this.atom_.reportObserved();
    var i = this, n = 0, o = Array.from(this.data_.values());
    return CY({
      next: function() {
        return n < o.length ? {
          value: i.dehanceValue_(o[n++]),
          done: !1
        } : {
          done: !0
        };
      }
    });
  }, e.replace = function(i) {
    var n = this;
    return ED(i) && (i = new Set(i)), wc(function() {
      Array.isArray(i) ? (n.clear(), i.forEach(function(o) {
        return n.add(o);
      })) : IR(i) ? (n.clear(), i.forEach(function(o) {
        return n.add(o);
      })) : i != null && ei("Cannot initialize set from " + i);
    }), this;
  }, e.observe_ = function(i, n) {
    return QR(this, i);
  }, e.intercept_ = function(i) {
    return cR(this, i);
  }, e.toJSON = function() {
    return Array.from(this);
  }, e.toString = function() {
    return "[object ObservableSet]";
  }, e[RkA] = function() {
    return this.values();
  }, Q$(A, [{
    key: "size",
    get: function() {
      return this.atom_.reportObserved(), this.data_.size;
    }
  }, {
    key: FkA,
    get: function() {
      return "Set";
    }
  }]), A;
}(), ED = /* @__PURE__ */ Xp("ObservableSet", MkA), tCA = /* @__PURE__ */ Object.create(null), iCA = "remove", xkA = /* @__PURE__ */ function() {
  function A(t, i, n, o) {
    i === void 0 && (i = /* @__PURE__ */ new Map()), o === void 0 && (o = k8A), this.target_ = void 0, this.values_ = void 0, this.name_ = void 0, this.defaultAnnotation_ = void 0, this.keysAtom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.proxy_ = void 0, this.isPlainObject_ = void 0, this.appliedAnnotations_ = void 0, this.pendingKeys_ = void 0, this.target_ = t, this.values_ = i, this.name_ = n, this.defaultAnnotation_ = o, this.keysAtom_ = new rR("ObservableObject.keys"), this.isPlainObject_ = vu(this.target_);
  }
  var e = A.prototype;
  return e.getObservablePropValue_ = function(i) {
    return this.values_.get(i).get();
  }, e.setObservablePropValue_ = function(i, n) {
    var o = this.values_.get(i);
    if (o instanceof sY)
      return o.set(n), !0;
    if (Ya(this)) {
      var g = Ra(this, {
        type: WB,
        object: this.proxy_ || this.target_,
        name: i,
        newValue: n
      });
      if (!g)
        return null;
      n = g.newValue;
    }
    if (n = o.prepareNewValue_(n), n !== Ie.UNCHANGED) {
      var s = tC(this), I = !1, r = s || I ? {
        type: WB,
        observableKind: "object",
        debugObjectName: this.name_,
        object: this.proxy_ || this.target_,
        oldValue: o.value_,
        name: i,
        newValue: n
      } : null;
      o.setNewValue_(n), s && iC(this, r);
    }
    return !0;
  }, e.get_ = function(i) {
    return Ie.trackingDerivation && !Xc(this.target_, i) && this.has_(i), this.target_[i];
  }, e.set_ = function(i, n, o) {
    return o === void 0 && (o = !1), Xc(this.target_, i) ? this.values_.has(i) ? this.setObservablePropValue_(i, n) : o ? Reflect.set(this.target_, i, n) : (this.target_[i] = n, !0) : this.extend_(i, {
      value: n,
      enumerable: !0,
      writable: !0,
      configurable: !0
    }, this.defaultAnnotation_, o);
  }, e.has_ = function(i) {
    if (!Ie.trackingDerivation)
      return i in this.target_;
    this.pendingKeys_ || (this.pendingKeys_ = /* @__PURE__ */ new Map());
    var n = this.pendingKeys_.get(i);
    return n || (n = new tw(i in this.target_, DK, "ObservableObject.key?", !1), this.pendingKeys_.set(i, n)), n.get();
  }, e.make_ = function(i, n) {
    if (n === !0 && (n = this.defaultAnnotation_), n !== !1) {
      if (!(i in this.target_)) {
        var o;
        if ((o = this.target_[GB]) != null && o[i])
          return;
        ei(1, n.annotationType_, this.name_ + "." + i.toString());
      }
      for (var g = this.target_; g && g !== yK; ) {
        var s = sH(g, i);
        if (s) {
          var I = n.make_(this, i, s, g);
          if (I === 0)
            return;
          if (I === 1)
            break;
        }
        g = Object.getPrototypeOf(g);
      }
      oCA(this, n, i);
    }
  }, e.extend_ = function(i, n, o, g) {
    if (g === void 0 && (g = !1), o === !0 && (o = this.defaultAnnotation_), o === !1)
      return this.defineProperty_(i, n, g);
    var s = o.extend_(this, i, n, g);
    return s && oCA(this, o, i), s;
  }, e.defineProperty_ = function(i, n, o) {
    o === void 0 && (o = !1);
    try {
      MI();
      var g = this.delete_(i);
      if (!g)
        return g;
      if (Ya(this)) {
        var s = Ra(this, {
          object: this.proxy_ || this.target_,
          name: i,
          type: _E,
          newValue: n.value
        });
        if (!s)
          return null;
        var I = s.newValue;
        n.value !== I && (n = Uw({}, n, {
          value: I
        }));
      }
      if (o) {
        if (!Reflect.defineProperty(this.target_, i, n))
          return !1;
      } else
        SB(this.target_, i, n);
      this.notifyPropertyAddition_(i, n.value);
    } finally {
      xI();
    }
    return !0;
  }, e.defineObservableProperty_ = function(i, n, o, g) {
    g === void 0 && (g = !1);
    try {
      MI();
      var s = this.delete_(i);
      if (!s)
        return s;
      if (Ya(this)) {
        var I = Ra(this, {
          object: this.proxy_ || this.target_,
          name: i,
          type: _E,
          newValue: n
        });
        if (!I)
          return null;
        n = I.newValue;
      }
      var r = nCA(i), a = {
        configurable: Ie.safeDescriptors ? this.isPlainObject_ : !0,
        enumerable: !0,
        get: r.get,
        set: r.set
      };
      if (g) {
        if (!Reflect.defineProperty(this.target_, i, a))
          return !1;
      } else
        SB(this.target_, i, a);
      var C = new tw(n, o, "ObservableObject.key", !1);
      this.values_.set(i, C), this.notifyPropertyAddition_(i, C.value_);
    } finally {
      xI();
    }
    return !0;
  }, e.defineComputedProperty_ = function(i, n, o) {
    o === void 0 && (o = !1);
    try {
      MI();
      var g = this.delete_(i);
      if (!g)
        return g;
      if (Ya(this)) {
        var s = Ra(this, {
          object: this.proxy_ || this.target_,
          name: i,
          type: _E,
          newValue: void 0
        });
        if (!s)
          return null;
      }
      n.name || (n.name = "ObservableObject.key"), n.context = this.proxy_ || this.target_;
      var I = nCA(i), r = {
        configurable: Ie.safeDescriptors ? this.isPlainObject_ : !0,
        enumerable: !1,
        get: I.get,
        set: I.set
      };
      if (o) {
        if (!Reflect.defineProperty(this.target_, i, r))
          return !1;
      } else
        SB(this.target_, i, r);
      this.values_.set(i, new sY(n)), this.notifyPropertyAddition_(i, void 0);
    } finally {
      xI();
    }
    return !0;
  }, e.delete_ = function(i, n) {
    if (n === void 0 && (n = !1), !Xc(this.target_, i))
      return !0;
    if (Ya(this)) {
      var o = Ra(this, {
        object: this.proxy_ || this.target_,
        name: i,
        type: iCA
      });
      if (!o)
        return null;
    }
    try {
      var g, s;
      MI();
      var I = tC(this), r = !1, a = this.values_.get(i), C = void 0;
      if (!a && (I || r)) {
        var B;
        C = (B = sH(this.target_, i)) == null ? void 0 : B.value;
      }
      if (n) {
        if (!Reflect.deleteProperty(this.target_, i))
          return !1;
      } else
        delete this.target_[i];
      if (a && (this.values_.delete(i), a instanceof tw && (C = a.value_), QkA(a)), this.keysAtom_.reportChanged(), (g = this.pendingKeys_) == null || (s = g.get(i)) == null || s.set(i in this.target_), I || r) {
        var l = {
          type: iCA,
          observableKind: "object",
          object: this.proxy_ || this.target_,
          debugObjectName: this.name_,
          oldValue: C,
          name: i
        };
        I && iC(this, l);
      }
    } finally {
      xI();
    }
    return !0;
  }, e.observe_ = function(i, n) {
    return QR(this, i);
  }, e.intercept_ = function(i) {
    return cR(this, i);
  }, e.notifyPropertyAddition_ = function(i, n) {
    var o, g, s = tC(this), I = !1;
    if (s || I) {
      var r = s || I ? {
        type: _E,
        observableKind: "object",
        debugObjectName: this.name_,
        object: this.proxy_ || this.target_,
        name: i,
        newValue: n
      } : null;
      s && iC(this, r);
    }
    (o = this.pendingKeys_) == null || (g = o.get(i)) == null || g.set(!0), this.keysAtom_.reportChanged();
  }, e.ownKeys_ = function() {
    return this.keysAtom_.reportObserved(), fK(this.target_);
  }, e.keys_ = function() {
    return this.keysAtom_.reportObserved(), Object.keys(this.target_);
  }, A;
}();
function YK(A, e) {
  var t;
  if (Xc(A, mt))
    return A;
  var i = (t = e == null ? void 0 : e.name) != null ? t : "ObservableObject", n = new xkA(A, /* @__PURE__ */ new Map(), String(i), H8A(e));
  return wK(A, mt, n), A;
}
var x$A = /* @__PURE__ */ Xp("ObservableObjectAdministration", xkA);
function nCA(A) {
  return tCA[A] || (tCA[A] = {
    get: function() {
      return this[mt].getObservablePropValue_(A);
    },
    set: function(t) {
      return this[mt].setObservablePropValue_(A, t);
    }
  });
}
function rY(A) {
  return bK(A) ? x$A(A[mt]) : !1;
}
function oCA(A, e, t) {
  var i;
  (i = A.target_[GB]) == null || delete i[t];
}
var L$A = /* @__PURE__ */ vkA(0), _9 = 0, LkA = function() {
};
function v$A(A, e) {
  Object.setPrototypeOf ? Object.setPrototypeOf(A.prototype, e) : A.prototype.__proto__ !== void 0 ? A.prototype.__proto__ = e : A.prototype = e;
}
v$A(LkA, Array.prototype);
var y$ = /* @__PURE__ */ function(A, e, t) {
  TGA(i, A);
  function i(o, g, s, I) {
    var r;
    s === void 0 && (s = "ObservableArray"), I === void 0 && (I = !1), r = A.call(this) || this;
    var a = new p$(s, g, I, !0);
    if (a.proxy_ = T9(r), VGA(T9(r), mt, a), o && o.length) {
      var C = BR(!0);
      r.spliceWithArray(0, 0, o), lR(C);
    }
    return Object.defineProperty(T9(r), "0", L$A), r;
  }
  var n = i.prototype;
  return n.concat = function() {
    this[mt].atom_.reportObserved();
    for (var g = arguments.length, s = new Array(g), I = 0; I < g; I++)
      s[I] = arguments[I];
    return Array.prototype.concat.apply(
      this.slice(),
      //@ts-ignore
      s.map(function(r) {
        return NK(r) ? r.slice() : r;
      })
    );
  }, n[t] = function() {
    var o = this, g = 0;
    return CY({
      next: function() {
        return g < o.length ? {
          value: o[g++],
          done: !1
        } : {
          done: !0,
          value: void 0
        };
      }
    });
  }, Q$(i, [{
    key: "length",
    get: function() {
      return this[mt].getArrayLength_();
    },
    set: function(g) {
      this[mt].setArrayLength_(g);
    }
  }, {
    key: e,
    get: function() {
      return "Array";
    }
  }]), i;
}(LkA, Symbol.toStringTag, Symbol.iterator);
Object.entries(BH).forEach(function(A) {
  var e = A[0], t = A[1];
  e !== "concat" && wK(y$.prototype, e, t);
});
function vkA(A) {
  return {
    enumerable: !1,
    configurable: !0,
    get: function() {
      return this[mt].get_(A);
    },
    set: function(t) {
      this[mt].set_(A, t);
    }
  };
}
function H$A(A) {
  SB(y$.prototype, "" + A, vkA(A));
}
function HkA(A) {
  if (A > _9) {
    for (var e = _9; e < A + 100; e++)
      H$A(e);
    _9 = A;
  }
}
HkA(1e3);
function S$A(A, e, t) {
  return new y$(A, e, t);
}
function Hu(A, e) {
  if (typeof A == "object" && A !== null) {
    if (NK(A))
      return e !== void 0 && ei(23), A[mt].atom_;
    if (ED(A))
      return A.atom_;
    if (zp(A)) {
      if (e === void 0)
        return A.keysAtom_;
      var t = A.data_.get(e) || A.hasMap_.get(e);
      return t || ei(25, e, iq(A)), t;
    }
    if (rY(A)) {
      if (!e)
        return ei(26);
      var i = A[mt].values_.get(e);
      return i || ei(27, e, iq(A)), i;
    }
    if (E$(A) || JK(A) || rH(A))
      return A;
  } else if (EC(A) && rH(A[mt]))
    return A[mt];
  ei(28);
}
function SkA(A, e) {
  if (A || ei(29), e !== void 0)
    return SkA(Hu(A, e));
  if (E$(A) || JK(A) || rH(A) || zp(A) || ED(A))
    return A;
  if (A[mt])
    return A[mt];
  ei(24, A);
}
function iq(A, e) {
  var t;
  if (e !== void 0)
    t = Hu(A, e);
  else {
    if (h$(A))
      return A.name;
    rY(A) || zp(A) || ED(A) ? t = SkA(A) : t = Hu(A);
  }
  return t.name_;
}
var gCA = yK.toString;
function b$(A, e, t) {
  return t === void 0 && (t = -1), nq(A, e, t);
}
function nq(A, e, t, i, n) {
  if (A === e)
    return A !== 0 || 1 / A === 1 / e;
  if (A == null || e == null)
    return !1;
  if (A !== A)
    return e !== e;
  var o = typeof A;
  if (o !== "function" && o !== "object" && typeof e != "object")
    return !1;
  var g = gCA.call(A);
  if (g !== gCA.call(e))
    return !1;
  switch (g) {
    case "[object RegExp]":
    case "[object String]":
      return "" + A == "" + e;
    case "[object Number]":
      return +A != +A ? +e != +e : +A == 0 ? 1 / +A === 1 / e : +A == +e;
    case "[object Date]":
    case "[object Boolean]":
      return +A == +e;
    case "[object Symbol]":
      return typeof Symbol < "u" && Symbol.valueOf.call(A) === Symbol.valueOf.call(e);
    case "[object Map]":
    case "[object Set]":
      t >= 0 && t++;
      break;
  }
  A = sCA(A), e = sCA(e);
  var s = g === "[object Array]";
  if (!s) {
    if (typeof A != "object" || typeof e != "object")
      return !1;
    var I = A.constructor, r = e.constructor;
    if (I !== r && !(EC(I) && I instanceof I && EC(r) && r instanceof r) && "constructor" in A && "constructor" in e)
      return !1;
  }
  if (t === 0)
    return !1;
  t < 0 && (t = -1), i = i || [], n = n || [];
  for (var a = i.length; a--; )
    if (i[a] === A)
      return n[a] === e;
  if (i.push(A), n.push(e), s) {
    if (a = A.length, a !== e.length)
      return !1;
    for (; a--; )
      if (!nq(A[a], e[a], t - 1, i, n))
        return !1;
  } else {
    var C = Object.keys(A), B;
    if (a = C.length, Object.keys(e).length !== a)
      return !1;
    for (; a--; )
      if (B = C[a], !(Xc(e, B) && nq(A[B], e[B], t - 1, i, n)))
        return !1;
  }
  return i.pop(), n.pop(), !0;
}
function sCA(A) {
  return NK(A) ? A.slice() : cD(A) || zp(A) || IR(A) || ED(A) ? Array.from(A.entries()) : A;
}
function CY(A) {
  return A[Symbol.iterator] = Z$A, A;
}
function Z$A() {
  return this;
}
["Symbol", "Map", "Set"].forEach(function(A) {
  var e = l$();
  typeof e[A] > "u" && ei("MobX requires global '" + A + "' to be available or polyfilled");
});
typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ == "object" && __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({
  spy: t$A,
  extras: {
    getDebugName: iq
  },
  $mobx: mt
});
if (!u.useState)
  throw new Error("mobx-react-lite requires React with Hooks support");
if (!m$)
  throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");
function W$A(A) {
  A();
}
function K$A(A) {
  A || (A = W$A), u$A({ reactionScheduler: A });
}
function U$A(A) {
  return h$A(A);
}
var V$A = 1e4, X$A = 1e4, z$A = (
  /** @class */
  function() {
    function A(e) {
      var t = this;
      Object.defineProperty(this, "finalize", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: e
      }), Object.defineProperty(this, "registrations", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: /* @__PURE__ */ new Map()
      }), Object.defineProperty(this, "sweepTimeout", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "sweep", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: function(i) {
          i === void 0 && (i = V$A), clearTimeout(t.sweepTimeout), t.sweepTimeout = void 0;
          var n = Date.now();
          t.registrations.forEach(function(o, g) {
            n - o.registeredAt >= i && (t.finalize(o.value), t.registrations.delete(g));
          }), t.registrations.size > 0 && t.scheduleSweep();
        }
      }), Object.defineProperty(this, "finalizeAllImmediately", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: function() {
          t.sweep(0);
        }
      });
    }
    return Object.defineProperty(A.prototype, "register", {
      enumerable: !1,
      configurable: !0,
      writable: !0,
      value: function(e, t, i) {
        this.registrations.set(i, {
          value: t,
          registeredAt: Date.now()
        }), this.scheduleSweep();
      }
    }), Object.defineProperty(A.prototype, "unregister", {
      enumerable: !1,
      configurable: !0,
      writable: !0,
      value: function(e) {
        this.registrations.delete(e);
      }
    }), Object.defineProperty(A.prototype, "scheduleSweep", {
      enumerable: !1,
      configurable: !0,
      writable: !0,
      value: function() {
        this.sweepTimeout === void 0 && (this.sweepTimeout = setTimeout(this.sweep, X$A));
      }
    }), A;
  }()
), T$A = typeof FinalizationRegistry < "u" ? FinalizationRegistry : z$A, oq = new T$A(function(A) {
  var e;
  (e = A.reaction) === null || e === void 0 || e.dispose(), A.reaction = null;
}), ICA = globalThis && globalThis.__read || function(A, e) {
  var t = typeof Symbol == "function" && A[Symbol.iterator];
  if (!t)
    return A;
  var i = t.call(A), n, o = [], g;
  try {
    for (; (e === void 0 || e-- > 0) && !(n = i.next()).done; )
      o.push(n.value);
  } catch (s) {
    g = { error: s };
  } finally {
    try {
      n && !n.done && (t = i.return) && t.call(i);
    } finally {
      if (g)
        throw g.error;
    }
  }
  return o;
};
function aCA(A) {
  return "observer".concat(A);
}
var _$A = (
  /** @class */
  function() {
    function A() {
    }
    return A;
  }()
);
function q$A() {
  return new _$A();
}
function O$A(A, e) {
  e === void 0 && (e = "observed");
  var t = ICA(b.useState(q$A), 1), i = t[0], n = ICA(b.useState(), 2), o = n[1], g = function() {
    return o([]);
  }, s = b.useRef(null);
  s.current || (s.current = {
    reaction: null,
    mounted: !1,
    changedBeforeMount: !1
  });
  var I = s.current;
  I.reaction || (I.reaction = new Tw(aCA(e), function() {
    I.mounted ? g() : I.changedBeforeMount = !0;
  }), oq.register(i, I, I)), b.useDebugValue(I.reaction, U$A), b.useEffect(function() {
    return oq.unregister(I), I.mounted = !0, I.reaction ? I.changedBeforeMount && (I.changedBeforeMount = !1, g()) : (I.reaction = new Tw(aCA(e), function() {
      g();
    }), g()), function() {
      I.reaction.dispose(), I.reaction = null, I.mounted = !1, I.changedBeforeMount = !1;
    };
  }, []);
  var r, a;
  if (I.reaction.track(function() {
    try {
      r = A();
    } catch (C) {
      a = C;
    }
  }), a)
    throw a;
  return r;
}
var ZkA = typeof Symbol == "function" && Symbol.for, rCA = ZkA ? Symbol.for("react.forward_ref") : typeof u.forwardRef == "function" && u.forwardRef(function(A) {
  return null;
}).$$typeof, CCA = ZkA ? Symbol.for("react.memo") : typeof u.memo == "function" && u.memo(function(A) {
  return null;
}).$$typeof;
function NQ(A, e) {
  var t;
  if (CCA && A.$$typeof === CCA)
    throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");
  var i = (t = e == null ? void 0 : e.forwardRef) !== null && t !== void 0 ? t : !1, n = A, o = A.displayName || A.name;
  if (rCA && A.$$typeof === rCA && (i = !0, n = A.render, typeof n != "function"))
    throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");
  var g = function(s, I) {
    return O$A(function() {
      return n(s, I);
    }, o);
  };
  return o !== "" && (g.displayName = o), A.contextTypes && (g.contextTypes = A.contextTypes), i && (g = u.forwardRef(g)), g = u.memo(g), P$A(A, g), g;
}
var j$A = {
  $$typeof: !0,
  render: !0,
  compare: !0,
  type: !0,
  // Don't redefine `displayName`,
  // it's defined as getter-setter pair on `memo` (see #3192).
  displayName: !0
};
function P$A(A, e) {
  Object.keys(A).forEach(function(t) {
    j$A[t] || Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(A, t));
  });
}
globalThis && globalThis.__read;
var q9;
K$A(Jt.unstable_batchedUpdates);
q9 = oq.finalizeAllImmediately;
var BY = {}, $$A = {
  get exports() {
    return BY;
  },
  set exports(A) {
    BY = A;
  }
}, Ni = {};
/** @license React v16.13.1
 * react-is.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 Ko = typeof Symbol == "function" && Symbol.for, w$ = Ko ? Symbol.for("react.element") : 60103, f$ = Ko ? Symbol.for("react.portal") : 60106, RK = Ko ? Symbol.for("react.fragment") : 60107, FK = Ko ? Symbol.for("react.strict_mode") : 60108, MK = Ko ? Symbol.for("react.profiler") : 60114, xK = Ko ? Symbol.for("react.provider") : 60109, LK = Ko ? Symbol.for("react.context") : 60110, D$ = Ko ? Symbol.for("react.async_mode") : 60111, vK = Ko ? Symbol.for("react.concurrent_mode") : 60111, HK = Ko ? Symbol.for("react.forward_ref") : 60112, SK = Ko ? Symbol.for("react.suspense") : 60113, A7A = Ko ? Symbol.for("react.suspense_list") : 60120, ZK = Ko ? Symbol.for("react.memo") : 60115, WK = Ko ? Symbol.for("react.lazy") : 60116, e7A = Ko ? Symbol.for("react.block") : 60121, t7A = Ko ? Symbol.for("react.fundamental") : 60117, i7A = Ko ? Symbol.for("react.responder") : 60118, n7A = Ko ? Symbol.for("react.scope") : 60119;
function Ca(A) {
  if (typeof A == "object" && A !== null) {
    var e = A.$$typeof;
    switch (e) {
      case w$:
        switch (A = A.type, A) {
          case D$:
          case vK:
          case RK:
          case MK:
          case FK:
          case SK:
            return A;
          default:
            switch (A = A && A.$$typeof, A) {
              case LK:
              case HK:
              case WK:
              case ZK:
              case xK:
                return A;
              default:
                return e;
            }
        }
      case f$:
        return e;
    }
  }
}
function WkA(A) {
  return Ca(A) === vK;
}
Ni.AsyncMode = D$;
Ni.ConcurrentMode = vK;
Ni.ContextConsumer = LK;
Ni.ContextProvider = xK;
Ni.Element = w$;
Ni.ForwardRef = HK;
Ni.Fragment = RK;
Ni.Lazy = WK;
Ni.Memo = ZK;
Ni.Portal = f$;
Ni.Profiler = MK;
Ni.StrictMode = FK;
Ni.Suspense = SK;
Ni.isAsyncMode = function(A) {
  return WkA(A) || Ca(A) === D$;
};
Ni.isConcurrentMode = WkA;
Ni.isContextConsumer = function(A) {
  return Ca(A) === LK;
};
Ni.isContextProvider = function(A) {
  return Ca(A) === xK;
};
Ni.isElement = function(A) {
  return typeof A == "object" && A !== null && A.$$typeof === w$;
};
Ni.isForwardRef = function(A) {
  return Ca(A) === HK;
};
Ni.isFragment = function(A) {
  return Ca(A) === RK;
};
Ni.isLazy = function(A) {
  return Ca(A) === WK;
};
Ni.isMemo = function(A) {
  return Ca(A) === ZK;
};
Ni.isPortal = function(A) {
  return Ca(A) === f$;
};
Ni.isProfiler = function(A) {
  return Ca(A) === MK;
};
Ni.isStrictMode = function(A) {
  return Ca(A) === FK;
};
Ni.isSuspense = function(A) {
  return Ca(A) === SK;
};
Ni.isValidElementType = function(A) {
  return typeof A == "string" || typeof A == "function" || A === RK || A === vK || A === MK || A === FK || A === SK || A === A7A || typeof A == "object" && A !== null && (A.$$typeof === WK || A.$$typeof === ZK || A.$$typeof === xK || A.$$typeof === LK || A.$$typeof === HK || A.$$typeof === t7A || A.$$typeof === i7A || A.$$typeof === n7A || A.$$typeof === e7A);
};
Ni.typeOf = Ca;
(function(A) {
  A.exports = Ni;
})($$A);
var o7A = function(e, t, i, n) {
  var o = i ? i.call(n, e, t) : void 0;
  if (o !== void 0)
    return !!o;
  if (e === t)
    return !0;
  if (typeof e != "object" || !e || typeof t != "object" || !t)
    return !1;
  var g = Object.keys(e), s = Object.keys(t);
  if (g.length !== s.length)
    return !1;
  for (var I = Object.prototype.hasOwnProperty.bind(t), r = 0; r < g.length; r++) {
    var a = g[r];
    if (!I(a))
      return !1;
    var C = e[a], B = t[a];
    if (o = i ? i.call(n, C, B, a) : void 0, o === !1 || o === void 0 && C !== B)
      return !1;
  }
  return !0;
};
function g7A(A) {
  function e(nA, AA, gA, rA, sA) {
    for (var lA = 0, cA = 0, aA = 0, QA = 0, hA, EA, RA = 0, xA = 0, HA, ne = HA = hA = 0, VA = 0, le = 0, we = 0, De = 0, Ke = gA.length, ee = Ke - 1, re, wA = "", WA = "", Pe = "", je = "", it; VA < Ke; ) {
      if (EA = gA.charCodeAt(VA), VA === ee && cA + QA + aA + lA !== 0 && (cA !== 0 && (EA = cA === 47 ? 10 : 47), QA = aA = lA = 0, Ke++, ee++), cA + QA + aA + lA === 0) {
        if (VA === ee && (0 < le && (wA = wA.replace(B, "")), 0 < wA.trim().length)) {
          switch (EA) {
            case 32:
            case 9:
            case 59:
            case 13:
            case 10:
              break;
            default:
              wA += gA.charAt(VA);
          }
          EA = 59;
        }
        switch (EA) {
          case 123:
            for (wA = wA.trim(), hA = wA.charCodeAt(0), HA = 1, De = ++VA; VA < Ke; ) {
              switch (EA = gA.charCodeAt(VA)) {
                case 123:
                  HA++;
                  break;
                case 125:
                  HA--;
                  break;
                case 47:
                  switch (EA = gA.charCodeAt(VA + 1)) {
                    case 42:
                    case 47:
                      A: {
                        for (ne = VA + 1; ne < ee; ++ne)
                          switch (gA.charCodeAt(ne)) {
                            case 47:
                              if (EA === 42 && gA.charCodeAt(ne - 1) === 42 && VA + 2 !== ne) {
                                VA = ne + 1;
                                break A;
                              }
                              break;
                            case 10:
                              if (EA === 47) {
                                VA = ne + 1;
                                break A;
                              }
                          }
                        VA = ne;
                      }
                  }
                  break;
                case 91:
                  EA++;
                case 40:
                  EA++;
                case 34:
                case 39:
                  for (; VA++ < ee && gA.charCodeAt(VA) !== EA; )
                    ;
              }
              if (HA === 0)
                break;
              VA++;
            }
            switch (HA = gA.substring(De, VA), hA === 0 && (hA = (wA = wA.replace(C, "").trim()).charCodeAt(0)), hA) {
              case 64:
                switch (0 < le && (wA = wA.replace(B, "")), EA = wA.charCodeAt(1), EA) {
                  case 100:
                  case 109:
                  case 115:
                  case 45:
                    le = AA;
                    break;
                  default:
                    le = j;
                }
                if (HA = e(AA, le, HA, EA, sA + 1), De = HA.length, 0 < O && (le = t(j, wA, we), it = s(3, HA, le, AA, v, N, De, EA, sA, rA), wA = le.join(""), it !== void 0 && (De = (HA = it.trim()).length) === 0 && (EA = 0, HA = "")), 0 < De)
                  switch (EA) {
                    case 115:
                      wA = wA.replace(R, g);
                    case 100:
                    case 109:
                    case 45:
                      HA = wA + "{" + HA + "}";
                      break;
                    case 107:
                      wA = wA.replace(y, "$1 $2"), HA = wA + "{" + HA + "}", HA = U === 1 || U === 2 && o("@" + HA, 3) ? "@-webkit-" + HA + "@" + HA : "@" + HA;
                      break;
                    default:
                      HA = wA + HA, rA === 112 && (HA = (WA += HA, ""));
                  }
                else
                  HA = "";
                break;
              default:
                HA = e(AA, t(AA, wA, we), HA, rA, sA + 1);
            }
            Pe += HA, HA = we = le = ne = hA = 0, wA = "", EA = gA.charCodeAt(++VA);
            break;
          case 125:
          case 59:
            if (wA = (0 < le ? wA.replace(B, "") : wA).trim(), 1 < (De = wA.length))
              switch (ne === 0 && (hA = wA.charCodeAt(0), hA === 45 || 96 < hA && 123 > hA) && (De = (wA = wA.replace(" ", ":")).length), 0 < O && (it = s(1, wA, AA, nA, v, N, WA.length, rA, sA, rA)) !== void 0 && (De = (wA = it.trim()).length) === 0 && (wA = "\0\0"), hA = wA.charCodeAt(0), EA = wA.charCodeAt(1), hA) {
                case 0:
                  break;
                case 64:
                  if (EA === 105 || EA === 99) {
                    je += wA + gA.charAt(VA);
                    break;
                  }
                default:
                  wA.charCodeAt(De - 1) !== 58 && (WA += n(wA, hA, EA, wA.charCodeAt(2)));
              }
            we = le = ne = hA = 0, wA = "", EA = gA.charCodeAt(++VA);
        }
      }
      switch (EA) {
        case 13:
        case 10:
          cA === 47 ? cA = 0 : 1 + hA === 0 && rA !== 107 && 0 < wA.length && (le = 1, wA += "\0"), 0 < O * _ && s(0, wA, AA, nA, v, N, WA.length, rA, sA, rA), N = 1, v++;
          break;
        case 59:
        case 125:
          if (cA + QA + aA + lA === 0) {
            N++;
            break;
          }
        default:
          switch (N++, re = gA.charAt(VA), EA) {
            case 9:
            case 32:
              if (QA + lA + cA === 0)
                switch (RA) {
                  case 44:
                  case 58:
                  case 9:
                  case 32:
                    re = "";
                    break;
                  default:
                    EA !== 32 && (re = " ");
                }
              break;
            case 0:
              re = "\\0";
              break;
            case 12:
              re = "\\f";
              break;
            case 11:
              re = "\\v";
              break;
            case 38:
              QA + cA + lA === 0 && (le = we = 1, re = "\f" + re);
              break;
            case 108:
              if (QA + cA + lA + K === 0 && 0 < ne)
                switch (VA - ne) {
                  case 2:
                    RA === 112 && gA.charCodeAt(VA - 3) === 58 && (K = RA);
                  case 8:
                    xA === 111 && (K = xA);
                }
              break;
            case 58:
              QA + cA + lA === 0 && (ne = VA);
              break;
            case 44:
              cA + aA + QA + lA === 0 && (le = 1, re += "\r");
              break;
            case 34:
            case 39:
              cA === 0 && (QA = QA === EA ? 0 : QA === 0 ? EA : QA);
              break;
            case 91:
              QA + cA + aA === 0 && lA++;
              break;
            case 93:
              QA + cA + aA === 0 && lA--;
              break;
            case 41:
              QA + cA + lA === 0 && aA--;
              break;
            case 40:
              if (QA + cA + lA === 0) {
                if (hA === 0)
                  switch (2 * RA + 3 * xA) {
                    case 533:
                      break;
                    default:
                      hA = 1;
                  }
                aA++;
              }
              break;
            case 64:
              cA + aA + QA + lA + ne + HA === 0 && (HA = 1);
              break;
            case 42:
            case 47:
              if (!(0 < QA + lA + aA))
                switch (cA) {
                  case 0:
                    switch (2 * EA + 3 * gA.charCodeAt(VA + 1)) {
                      case 235:
                        cA = 47;
                        break;
                      case 220:
                        De = VA, cA = 42;
                    }
                    break;
                  case 42:
                    EA === 47 && RA === 42 && De + 2 !== VA && (gA.charCodeAt(De + 2) === 33 && (WA += gA.substring(De, VA + 1)), re = "", cA = 0);
                }
          }
          cA === 0 && (wA += re);
      }
      xA = RA, RA = EA, VA++;
    }
    if (De = WA.length, 0 < De) {
      if (le = AA, 0 < O && (it = s(2, WA, le, nA, v, N, De, rA, sA, rA), it !== void 0 && (WA = it).length === 0))
        return je + WA + Pe;
      if (WA = le.join(",") + "{" + WA + "}", U * K !== 0) {
        switch (U !== 2 || o(WA, 2) || (K = 0), K) {
          case 111:
            WA = WA.replace(w, ":-moz-$1") + WA;
            break;
          case 112:
            WA = WA.replace(f, "::-webkit-input-$1") + WA.replace(f, "::-moz-$1") + WA.replace(f, ":-ms-input-$1") + WA;
        }
        K = 0;
      }
    }
    return je + WA + Pe;
  }
  function t(nA, AA, gA) {
    var rA = AA.trim().split(d);
    AA = rA;
    var sA = rA.length, lA = nA.length;
    switch (lA) {
      case 0:
      case 1:
        var cA = 0;
        for (nA = lA === 0 ? "" : nA[0] + " "; cA < sA; ++cA)
          AA[cA] = i(nA, AA[cA], gA).trim();
        break;
      default:
        var aA = cA = 0;
        for (AA = []; cA < sA; ++cA)
          for (var QA = 0; QA < lA; ++QA)
            AA[aA++] = i(nA[QA] + " ", rA[cA], gA).trim();
    }
    return AA;
  }
  function i(nA, AA, gA) {
    var rA = AA.charCodeAt(0);
    switch (33 > rA && (rA = (AA = AA.trim()).charCodeAt(0)), rA) {
      case 38:
        return AA.replace(m, "$1" + nA.trim());
      case 58:
        return nA.trim() + AA.replace(m, "$1" + nA.trim());
      default:
        if (0 < 1 * gA && 0 < AA.indexOf("\f"))
          return AA.replace(m, (nA.charCodeAt(0) === 58 ? "" : "$1") + nA.trim());
    }
    return nA + AA;
  }
  function n(nA, AA, gA, rA) {
    var sA = nA + ";", lA = 2 * AA + 3 * gA + 4 * rA;
    if (lA === 944) {
      nA = sA.indexOf(":", 9) + 1;
      var cA = sA.substring(nA, sA.length - 1).trim();
      return cA = sA.substring(0, nA).trim() + cA + ";", U === 1 || U === 2 && o(cA, 1) ? "-webkit-" + cA + cA : cA;
    }
    if (U === 0 || U === 2 && !o(sA, 1))
      return sA;
    switch (lA) {
      case 1015:
        return sA.charCodeAt(10) === 97 ? "-webkit-" + sA + sA : sA;
      case 951:
        return sA.charCodeAt(3) === 116 ? "-webkit-" + sA + sA : sA;
      case 963:
        return sA.charCodeAt(5) === 110 ? "-webkit-" + sA + sA : sA;
      case 1009:
        if (sA.charCodeAt(4) !== 100)
          break;
      case 969:
      case 942:
        return "-webkit-" + sA + sA;
      case 978:
        return "-webkit-" + sA + "-moz-" + sA + sA;
      case 1019:
      case 983:
        return "-webkit-" + sA + "-moz-" + sA + "-ms-" + sA + sA;
      case 883:
        if (sA.charCodeAt(8) === 45)
          return "-webkit-" + sA + sA;
        if (0 < sA.indexOf("image-set(", 11))
          return sA.replace(p, "$1-webkit-$2") + sA;
        break;
      case 932:
        if (sA.charCodeAt(4) === 45)
          switch (sA.charCodeAt(5)) {
            case 103:
              return "-webkit-box-" + sA.replace("-grow", "") + "-webkit-" + sA + "-ms-" + sA.replace("grow", "positive") + sA;
            case 115:
              return "-webkit-" + sA + "-ms-" + sA.replace("shrink", "negative") + sA;
            case 98:
              return "-webkit-" + sA + "-ms-" + sA.replace("basis", "preferred-size") + sA;
          }
        return "-webkit-" + sA + "-ms-" + sA + sA;
      case 964:
        return "-webkit-" + sA + "-ms-flex-" + sA + sA;
      case 1023:
        if (sA.charCodeAt(8) !== 99)
          break;
        return cA = sA.substring(sA.indexOf(":", 15)).replace("flex-", "").replace("space-between", "justify"), "-webkit-box-pack" + cA + "-webkit-" + sA + "-ms-flex-pack" + cA + sA;
      case 1005:
        return Q.test(sA) ? sA.replace(l, ":-webkit-") + sA.replace(l, ":-moz-") + sA : sA;
      case 1e3:
        switch (cA = sA.substring(13).trim(), AA = cA.indexOf("-") + 1, cA.charCodeAt(0) + cA.charCodeAt(AA)) {
          case 226:
            cA = sA.replace(G, "tb");
            break;
          case 232:
            cA = sA.replace(G, "tb-rl");
            break;
          case 220:
            cA = sA.replace(G, "lr");
            break;
          default:
            return sA;
        }
        return "-webkit-" + sA + "-ms-" + cA + sA;
      case 1017:
        if (sA.indexOf("sticky", 9) === -1)
          break;
      case 975:
        switch (AA = (sA = nA).length - 10, cA = (sA.charCodeAt(AA) === 33 ? sA.substring(0, AA) : sA).substring(nA.indexOf(":", 7) + 1).trim(), lA = cA.charCodeAt(0) + (cA.charCodeAt(7) | 0)) {
          case 203:
            if (111 > cA.charCodeAt(8))
              break;
          case 115:
            sA = sA.replace(cA, "-webkit-" + cA) + ";" + sA;
            break;
          case 207:
          case 102:
            sA = sA.replace(cA, "-webkit-" + (102 < lA ? "inline-" : "") + "box") + ";" + sA.replace(cA, "-webkit-" + cA) + ";" + sA.replace(cA, "-ms-" + cA + "box") + ";" + sA;
        }
        return sA + ";";
      case 938:
        if (sA.charCodeAt(5) === 45)
          switch (sA.charCodeAt(6)) {
            case 105:
              return cA = sA.replace("-items", ""), "-webkit-" + sA + "-webkit-box-" + cA + "-ms-flex-" + cA + sA;
            case 115:
              return "-webkit-" + sA + "-ms-flex-item-" + sA.replace(Z, "") + sA;
            default:
              return "-webkit-" + sA + "-ms-flex-line-pack" + sA.replace("align-content", "").replace(Z, "") + sA;
          }
        break;
      case 973:
      case 989:
        if (sA.charCodeAt(3) !== 45 || sA.charCodeAt(4) === 122)
          break;
      case 931:
      case 953:
        if (J.test(nA) === !0)
          return (cA = nA.substring(nA.indexOf(":") + 1)).charCodeAt(0) === 115 ? n(nA.replace("stretch", "fill-available"), AA, gA, rA).replace(":fill-available", ":stretch") : sA.replace(cA, "-webkit-" + cA) + sA.replace(cA, "-moz-" + cA.replace("fill-", "")) + sA;
        break;
      case 962:
        if (sA = "-webkit-" + sA + (sA.charCodeAt(5) === 102 ? "-ms-" + sA : "") + sA, gA + rA === 211 && sA.charCodeAt(13) === 105 && 0 < sA.indexOf("transform", 10))
          return sA.substring(0, sA.indexOf(";", 27) + 1).replace(E, "$1-webkit-$2") + sA;
    }
    return sA;
  }
  function o(nA, AA) {
    var gA = nA.indexOf(AA === 1 ? ":" : "{"), rA = nA.substring(0, AA !== 3 ? gA : 10);
    return gA = nA.substring(gA + 1, nA.length - 1), $(AA !== 2 ? rA : rA.replace(c, "$1"), gA, AA);
  }
  function g(nA, AA) {
    var gA = n(AA, AA.charCodeAt(0), AA.charCodeAt(1), AA.charCodeAt(2));
    return gA !== AA + ";" ? gA.replace(F, " or ($1)").substring(4) : "(" + AA + ")";
  }
  function s(nA, AA, gA, rA, sA, lA, cA, aA, QA, hA) {
    for (var EA = 0, RA = AA, xA; EA < O; ++EA)
      switch (xA = q[EA].call(a, nA, RA, gA, rA, sA, lA, cA, aA, QA, hA)) {
        case void 0:
        case !1:
        case !0:
        case null:
          break;
        default:
          RA = xA;
      }
    if (RA !== AA)
      return RA;
  }
  function I(nA) {
    switch (nA) {
      case void 0:
      case null:
        O = q.length = 0;
        break;
      default:
        if (typeof nA == "function")
          q[O++] = nA;
        else if (typeof nA == "object")
          for (var AA = 0, gA = nA.length; AA < gA; ++AA)
            I(nA[AA]);
        else
          _ = !!nA | 0;
    }
    return I;
  }
  function r(nA) {
    return nA = nA.prefix, nA !== void 0 && ($ = null, nA ? typeof nA != "function" ? U = 1 : (U = 2, $ = nA) : U = 0), r;
  }
  function a(nA, AA) {
    var gA = nA;
    if (33 > gA.charCodeAt(0) && (gA = gA.trim()), tA = gA, gA = [tA], 0 < O) {
      var rA = s(-1, AA, gA, gA, v, N, 0, 0, 0, 0);
      rA !== void 0 && typeof rA == "string" && (AA = rA);
    }
    var sA = e(j, gA, AA, 0, 0);
    return 0 < O && (rA = s(-2, sA, gA, gA, v, N, sA.length, 0, 0, 0), rA !== void 0 && (sA = rA)), tA = "", K = 0, N = v = 1, sA;
  }
  var C = /^\0+/g, B = /[\0\r\f]/g, l = /: */g, Q = /zoo|gra/, E = /([,: ])(transform)/g, d = /,\r+?/g, m = /([\t\r\n ])*\f?&/g, y = /@(k\w+)\s*(\S*)\s*/, f = /::(place)/g, w = /:(read-only)/g, G = /[svh]\w+-[tblr]{2}/, R = /\(\s*(.*)\s*\)/g, F = /([\s\S]*?);/g, Z = /-self|flex-/g, c = /[^]*?(:[rp][el]a[\w-]+)[^]*/, J = /stretch|:\s*\w+\-(?:conte|avail)/, p = /([^-])(image-set\()/, N = 1, v = 1, K = 0, U = 1, j = [], q = [], O = 0, $ = null, _ = 0, tA = "";
  return a.use = I, a.set = r, A !== void 0 && r(A), a;
}
var s7A = {
  animationIterationCount: 1,
  borderImageOutset: 1,
  borderImageSlice: 1,
  borderImageWidth: 1,
  boxFlex: 1,
  boxFlexGroup: 1,
  boxOrdinalGroup: 1,
  columnCount: 1,
  columns: 1,
  flex: 1,
  flexGrow: 1,
  flexPositive: 1,
  flexShrink: 1,
  flexNegative: 1,
  flexOrder: 1,
  gridRow: 1,
  gridRowEnd: 1,
  gridRowSpan: 1,
  gridRowStart: 1,
  gridColumn: 1,
  gridColumnEnd: 1,
  gridColumnSpan: 1,
  gridColumnStart: 1,
  msGridRow: 1,
  msGridRowSpan: 1,
  msGridColumn: 1,
  msGridColumnSpan: 1,
  fontWeight: 1,
  lineHeight: 1,
  opacity: 1,
  order: 1,
  orphans: 1,
  tabSize: 1,
  widows: 1,
  zIndex: 1,
  zoom: 1,
  WebkitLineClamp: 1,
  // SVG-related properties
  fillOpacity: 1,
  floodOpacity: 1,
  stopOpacity: 1,
  strokeDasharray: 1,
  strokeDashoffset: 1,
  strokeMiterlimit: 1,
  strokeOpacity: 1,
  strokeWidth: 1
};
function I7A(A) {
  var e = /* @__PURE__ */ Object.create(null);
  return function(t) {
    return e[t] === void 0 && (e[t] = A(t)), e[t];
  };
}
var a7A = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, BCA = /* @__PURE__ */ I7A(
  function(A) {
    return a7A.test(A) || A.charCodeAt(0) === 111 && A.charCodeAt(1) === 110 && A.charCodeAt(2) < 91;
  }
  /* Z+1 */
), G$ = BY, r7A = {
  childContextTypes: !0,
  contextType: !0,
  contextTypes: !0,
  defaultProps: !0,
  displayName: !0,
  getDefaultProps: !0,
  getDerivedStateFromError: !0,
  getDerivedStateFromProps: !0,
  mixins: !0,
  propTypes: !0,
  type: !0
}, C7A = {
  name: !0,
  length: !0,
  prototype: !0,
  caller: !0,
  callee: !0,
  arguments: !0,
  arity: !0
}, B7A = {
  $$typeof: !0,
  render: !0,
  defaultProps: !0,
  displayName: !0,
  propTypes: !0
}, KkA = {
  $$typeof: !0,
  compare: !0,
  defaultProps: !0,
  displayName: !0,
  propTypes: !0,
  type: !0
}, k$ = {};
k$[G$.ForwardRef] = B7A;
k$[G$.Memo] = KkA;
function lCA(A) {
  return G$.isMemo(A) ? KkA : k$[A.$$typeof] || r7A;
}
var l7A = Object.defineProperty, c7A = Object.getOwnPropertyNames, cCA = Object.getOwnPropertySymbols, Q7A = Object.getOwnPropertyDescriptor, E7A = Object.getPrototypeOf, QCA = Object.prototype;
function UkA(A, e, t) {
  if (typeof e != "string") {
    if (QCA) {
      var i = E7A(e);
      i && i !== QCA && UkA(A, i, t);
    }
    var n = c7A(e);
    cCA && (n = n.concat(cCA(e)));
    for (var o = lCA(A), g = lCA(e), s = 0; s < n.length; ++s) {
      var I = n[s];
      if (!C7A[I] && !(t && t[I]) && !(g && g[I]) && !(o && o[I])) {
        var r = Q7A(e, I);
        try {
          l7A(A, I, r);
        } catch {
        }
      }
    }
  }
  return A;
}
var VkA = UkA;
function Rc() {
  return (Rc = Object.assign || function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }).apply(this, arguments);
}
var ECA = function(A, e) {
  for (var t = [A[0]], i = 0, n = e.length; i < n; i += 1)
    t.push(e[i], A[i + 1]);
  return t;
}, gq = function(A) {
  return A !== null && typeof A == "object" && (A.toString ? A.toString() : Object.prototype.toString.call(A)) === "[object Object]" && !BY.typeOf(A);
}, cH = Object.freeze([]), uu = Object.freeze({});
function lY(A) {
  return typeof A == "function";
}
function uCA(A) {
  return A.displayName || A.name || "Component";
}
function J$(A) {
  return A && typeof A.styledComponentId == "string";
}
var _w = typeof process < "u" && process.env !== void 0 && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", N$ = typeof window < "u" && "HTMLElement" in window, u7A = Boolean(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && (process.env.REACT_APP_SC_DISABLE_SPEEDY !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== "" ? process.env.REACT_APP_SC_DISABLE_SPEEDY !== "false" && process.env.REACT_APP_SC_DISABLE_SPEEDY : process.env.SC_DISABLE_SPEEDY !== void 0 && process.env.SC_DISABLE_SPEEDY !== "" ? process.env.SC_DISABLE_SPEEDY !== "false" && process.env.SC_DISABLE_SPEEDY : !1));
function ER(A) {
  for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  throw new Error("An error occurred. See https://git.io/JUIaE#" + A + " for more information." + (t.length > 0 ? " Args: " + t.join(", ") : ""));
}
var d7A = function() {
  function A(t) {
    this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = t;
  }
  var e = A.prototype;
  return e.indexOfGroup = function(t) {
    for (var i = 0, n = 0; n < t; n++)
      i += this.groupSizes[n];
    return i;
  }, e.insertRules = function(t, i) {
    if (t >= this.groupSizes.length) {
      for (var n = this.groupSizes, o = n.length, g = o; t >= g; )
        (g <<= 1) < 0 && ER(16, "" + t);
      this.groupSizes = new Uint32Array(g), this.groupSizes.set(n), this.length = g;
      for (var s = o; s < g; s++)
        this.groupSizes[s] = 0;
    }
    for (var I = this.indexOfGroup(t + 1), r = 0, a = i.length; r < a; r++)
      this.tag.insertRule(I, i[r]) && (this.groupSizes[t]++, I++);
  }, e.clearGroup = function(t) {
    if (t < this.length) {
      var i = this.groupSizes[t], n = this.indexOfGroup(t), o = n + i;
      this.groupSizes[t] = 0;
      for (var g = n; g < o; g++)
        this.tag.deleteRule(n);
    }
  }, e.getGroup = function(t) {
    var i = "";
    if (t >= this.length || this.groupSizes[t] === 0)
      return i;
    for (var n = this.groupSizes[t], o = this.indexOfGroup(t), g = o + n, s = o; s < g; s++)
      i += this.tag.getRule(s) + `/*!sc*/
`;
    return i;
  }, A;
}(), ML = /* @__PURE__ */ new Map(), QH = /* @__PURE__ */ new Map(), aN = 1, lM = function(A) {
  if (ML.has(A))
    return ML.get(A);
  for (; QH.has(aN); )
    aN++;
  var e = aN++;
  return ML.set(A, e), QH.set(e, A), e;
}, h7A = function(A) {
  return QH.get(A);
}, m7A = function(A, e) {
  e >= aN && (aN = e + 1), ML.set(A, e), QH.set(e, A);
}, p7A = "style[" + _w + '][data-styled-version="5.3.10"]', y7A = new RegExp("^" + _w + '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'), b7A = function(A, e, t) {
  for (var i, n = t.split(","), o = 0, g = n.length; o < g; o++)
    (i = n[o]) && A.registerName(e, i);
}, w7A = function(A, e) {
  for (var t = (e.textContent || "").split(`/*!sc*/
`), i = [], n = 0, o = t.length; n < o; n++) {
    var g = t[n].trim();
    if (g) {
      var s = g.match(y7A);
      if (s) {
        var I = 0 | parseInt(s[1], 10), r = s[2];
        I !== 0 && (m7A(r, I), b7A(A, r, s[3]), A.getTag().insertRules(I, i)), i.length = 0;
      } else
        i.push(g);
    }
  }
}, f7A = function() {
  return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : null;
}, XkA = function(A) {
  var e = document.head, t = A || e, i = document.createElement("style"), n = function(s) {
    for (var I = s.childNodes, r = I.length; r >= 0; r--) {
      var a = I[r];
      if (a && a.nodeType === 1 && a.hasAttribute(_w))
        return a;
    }
  }(t), o = n !== void 0 ? n.nextSibling : null;
  i.setAttribute(_w, "active"), i.setAttribute("data-styled-version", "5.3.10");
  var g = f7A();
  return g && i.setAttribute("nonce", g), t.insertBefore(i, o), i;
}, D7A = function() {
  function A(t) {
    var i = this.element = XkA(t);
    i.appendChild(document.createTextNode("")), this.sheet = function(n) {
      if (n.sheet)
        return n.sheet;
      for (var o = document.styleSheets, g = 0, s = o.length; g < s; g++) {
        var I = o[g];
        if (I.ownerNode === n)
          return I;
      }
      ER(17);
    }(i), this.length = 0;
  }
  var e = A.prototype;
  return e.insertRule = function(t, i) {
    try {
      return this.sheet.insertRule(i, t), this.length++, !0;
    } catch {
      return !1;
    }
  }, e.deleteRule = function(t) {
    this.sheet.deleteRule(t), this.length--;
  }, e.getRule = function(t) {
    var i = this.sheet.cssRules[t];
    return i !== void 0 && typeof i.cssText == "string" ? i.cssText : "";
  }, A;
}(), G7A = function() {
  function A(t) {
    var i = this.element = XkA(t);
    this.nodes = i.childNodes, this.length = 0;
  }
  var e = A.prototype;
  return e.insertRule = function(t, i) {
    if (t <= this.length && t >= 0) {
      var n = document.createTextNode(i), o = this.nodes[t];
      return this.element.insertBefore(n, o || null), this.length++, !0;
    }
    return !1;
  }, e.deleteRule = function(t) {
    this.element.removeChild(this.nodes[t]), this.length--;
  }, e.getRule = function(t) {
    return t < this.length ? this.nodes[t].textContent : "";
  }, A;
}(), k7A = function() {
  function A(t) {
    this.rules = [], this.length = 0;
  }
  var e = A.prototype;
  return e.insertRule = function(t, i) {
    return t <= this.length && (this.rules.splice(t, 0, i), this.length++, !0);
  }, e.deleteRule = function(t) {
    this.rules.splice(t, 1), this.length--;
  }, e.getRule = function(t) {
    return t < this.length ? this.rules[t] : "";
  }, A;
}(), dCA = N$, J7A = { isServer: !N$, useCSSOMInjection: !u7A }, zkA = function() {
  function A(t, i, n) {
    t === void 0 && (t = uu), i === void 0 && (i = {}), this.options = Rc({}, J7A, {}, t), this.gs = i, this.names = new Map(n), this.server = !!t.isServer, !this.server && N$ && dCA && (dCA = !1, function(o) {
      for (var g = document.querySelectorAll(p7A), s = 0, I = g.length; s < I; s++) {
        var r = g[s];
        r && r.getAttribute(_w) !== "active" && (w7A(o, r), r.parentNode && r.parentNode.removeChild(r));
      }
    }(this));
  }
  A.registerId = function(t) {
    return lM(t);
  };
  var e = A.prototype;
  return e.reconstructWithOptions = function(t, i) {
    return i === void 0 && (i = !0), new A(Rc({}, this.options, {}, t), this.gs, i && this.names || void 0);
  }, e.allocateGSInstance = function(t) {
    return this.gs[t] = (this.gs[t] || 0) + 1;
  }, e.getTag = function() {
    return this.tag || (this.tag = (n = (i = this.options).isServer, o = i.useCSSOMInjection, g = i.target, t = n ? new k7A(g) : o ? new D7A(g) : new G7A(g), new d7A(t)));
    var t, i, n, o, g;
  }, e.hasNameForId = function(t, i) {
    return this.names.has(t) && this.names.get(t).has(i);
  }, e.registerName = function(t, i) {
    if (lM(t), this.names.has(t))
      this.names.get(t).add(i);
    else {
      var n = /* @__PURE__ */ new Set();
      n.add(i), this.names.set(t, n);
    }
  }, e.insertRules = function(t, i, n) {
    this.registerName(t, i), this.getTag().insertRules(lM(t), n);
  }, e.clearNames = function(t) {
    this.names.has(t) && this.names.get(t).clear();
  }, e.clearRules = function(t) {
    this.getTag().clearGroup(lM(t)), this.clearNames(t);
  }, e.clearTag = function() {
    this.tag = void 0;
  }, e.toString = function() {
    return function(t) {
      for (var i = t.getTag(), n = i.length, o = "", g = 0; g < n; g++) {
        var s = h7A(g);
        if (s !== void 0) {
          var I = t.names.get(s), r = i.getGroup(g);
          if (I && r && I.size) {
            var a = _w + ".g" + g + '[id="' + s + '"]', C = "";
            I !== void 0 && I.forEach(function(B) {
              B.length > 0 && (C += B + ",");
            }), o += "" + r + a + '{content:"' + C + `"}/*!sc*/
`;
          }
        }
      }
      return o;
    }(this);
  }, A;
}(), N7A = /(a)(d)/gi, hCA = function(A) {
  return String.fromCharCode(A + (A > 25 ? 39 : 97));
};
function sq(A) {
  var e, t = "";
  for (e = Math.abs(A); e > 52; e = e / 52 | 0)
    t = hCA(e % 52) + t;
  return (hCA(e % 52) + t).replace(N7A, "$1-$2");
}
var Yb = function(A, e) {
  for (var t = e.length; t; )
    A = 33 * A ^ e.charCodeAt(--t);
  return A;
}, TkA = function(A) {
  return Yb(5381, A);
};
function Y7A(A) {
  for (var e = 0; e < A.length; e += 1) {
    var t = A[e];
    if (lY(t) && !J$(t))
      return !1;
  }
  return !0;
}
var R7A = TkA("5.3.10"), F7A = function() {
  function A(e, t, i) {
    this.rules = e, this.staticRulesId = "", this.isStatic = (i === void 0 || i.isStatic) && Y7A(e), this.componentId = t, this.baseHash = Yb(R7A, t), this.baseStyle = i, zkA.registerId(t);
  }
  return A.prototype.generateAndInjectStyles = function(e, t, i) {
    var n = this.componentId, o = [];
    if (this.baseStyle && o.push(this.baseStyle.generateAndInjectStyles(e, t, i)), this.isStatic && !i.hash)
      if (this.staticRulesId && t.hasNameForId(n, this.staticRulesId))
        o.push(this.staticRulesId);
      else {
        var g = qw(this.rules, e, t, i).join(""), s = sq(Yb(this.baseHash, g) >>> 0);
        if (!t.hasNameForId(n, s)) {
          var I = i(g, "." + s, void 0, n);
          t.insertRules(n, s, I);
        }
        o.push(s), this.staticRulesId = s;
      }
    else {
      for (var r = this.rules.length, a = Yb(this.baseHash, i.hash), C = "", B = 0; B < r; B++) {
        var l = this.rules[B];
        if (typeof l == "string")
          C += l;
        else if (l) {
          var Q = qw(l, e, t, i), E = Array.isArray(Q) ? Q.join("") : Q;
          a = Yb(a, E + B), C += E;
        }
      }
      if (C) {
        var d = sq(a >>> 0);
        if (!t.hasNameForId(n, d)) {
          var m = i(C, "." + d, void 0, n);
          t.insertRules(n, d, m);
        }
        o.push(d);
      }
    }
    return o.join(" ");
  }, A;
}(), M7A = /^\s*\/\/.*$/gm, x7A = [":", "[", ".", "#"];
function _kA(A) {
  var e, t, i, n, o = A === void 0 ? uu : A, g = o.options, s = g === void 0 ? uu : g, I = o.plugins, r = I === void 0 ? cH : I, a = new g7A(s), C = [], B = function(E) {
    function d(m) {
      if (m)
        try {
          E(m + "}");
        } catch {
        }
    }
    return function(m, y, f, w, G, R, F, Z, c, J) {
      switch (m) {
        case 1:
          if (c === 0 && y.charCodeAt(0) === 64)
            return E(y + ";"), "";
          break;
        case 2:
          if (Z === 0)
            return y + "/*|*/";
          break;
        case 3:
          switch (Z) {
            case 102:
            case 112:
              return E(f[0] + y), "";
            default:
              return y + (J === 0 ? "/*|*/" : "");
          }
        case -2:
          y.split("/*|*/}").forEach(d);
      }
    };
  }(function(E) {
    C.push(E);
  }), l = function(E, d, m) {
    return d === 0 && x7A.indexOf(m[t.length]) !== -1 || m.match(n) ? E : "." + e;
  };
  function Q(E, d, m, y) {
    y === void 0 && (y = "&");
    var f = E.replace(M7A, ""), w = d && m ? m + " " + d + " { " + f + " }" : f;
    return e = y, t = d, i = new RegExp("\\" + t + "\\b", "g"), n = new RegExp("(\\" + t + "\\b){2,}"), a(m || !d ? "" : d, w);
  }
  return a.use([].concat(r, [function(E, d, m) {
    E === 2 && m.length && m[0].lastIndexOf(t) > 0 && (m[0] = m[0].replace(i, l));
  }, B, function(E) {
    if (E === -2) {
      var d = C;
      return C = [], d;
    }
  }])), Q.hash = r.length ? r.reduce(function(E, d) {
    return d.name || ER(15), Yb(E, d.name);
  }, 5381).toString() : "", Q;
}
var Y$ = b.createContext();
Y$.Consumer;
var R$ = b.createContext(), L7A = (R$.Consumer, new zkA()), Iq = _kA();
function qkA() {
  return u.useContext(Y$) || L7A;
}
function v7A() {
  return u.useContext(R$) || Iq;
}
function H7A(A) {
  var e = u.useState(A.stylisPlugins), t = e[0], i = e[1], n = qkA(), o = u.useMemo(function() {
    var s = n;
    return A.sheet ? s = A.sheet : A.target && (s = s.reconstructWithOptions({ target: A.target }, !1)), A.disableCSSOMInjection && (s = s.reconstructWithOptions({ useCSSOMInjection: !1 })), s;
  }, [A.disableCSSOMInjection, A.sheet, A.target]), g = u.useMemo(function() {
    return _kA({ options: { prefix: !A.disableVendorPrefixes }, plugins: t });
  }, [A.disableVendorPrefixes, t]);
  return u.useEffect(function() {
    o7A(t, A.stylisPlugins) || i(A.stylisPlugins);
  }, [A.stylisPlugins]), b.createElement(Y$.Provider, { value: o }, b.createElement(R$.Provider, { value: g }, A.children));
}
var S7A = function() {
  function A(e, t) {
    var i = this;
    this.inject = function(n, o) {
      o === void 0 && (o = Iq);
      var g = i.name + o.hash;
      n.hasNameForId(i.id, g) || n.insertRules(i.id, g, o(i.rules, g, "@keyframes"));
    }, this.toString = function() {
      return ER(12, String(i.name));
    }, this.name = e, this.id = "sc-keyframes-" + e, this.rules = t;
  }
  return A.prototype.getName = function(e) {
    return e === void 0 && (e = Iq), this.name + e.hash;
  }, A;
}(), Z7A = /([A-Z])/, W7A = /([A-Z])/g, K7A = /^ms-/, U7A = function(A) {
  return "-" + A.toLowerCase();
};
function mCA(A) {
  return Z7A.test(A) ? A.replace(W7A, U7A).replace(K7A, "-ms-") : A;
}
var pCA = function(A) {
  return A == null || A === !1 || A === "";
};
function qw(A, e, t, i) {
  if (Array.isArray(A)) {
    for (var n, o = [], g = 0, s = A.length; g < s; g += 1)
      (n = qw(A[g], e, t, i)) !== "" && (Array.isArray(n) ? o.push.apply(o, n) : o.push(n));
    return o;
  }
  if (pCA(A))
    return "";
  if (J$(A))
    return "." + A.styledComponentId;
  if (lY(A)) {
    if (typeof (r = A) != "function" || r.prototype && r.prototype.isReactComponent || !e)
      return A;
    var I = A(e);
    return qw(I, e, t, i);
  }
  var r;
  return A instanceof S7A ? t ? (A.inject(t, i), A.getName(i)) : A : gq(A) ? function a(C, B) {
    var l, Q, E = [];
    for (var d in C)
      C.hasOwnProperty(d) && !pCA(C[d]) && (Array.isArray(C[d]) && C[d].isCss || lY(C[d]) ? E.push(mCA(d) + ":", C[d], ";") : gq(C[d]) ? E.push.apply(E, a(C[d], d)) : E.push(mCA(d) + ": " + (l = d, (Q = C[d]) == null || typeof Q == "boolean" || Q === "" ? "" : typeof Q != "number" || Q === 0 || l in s7A || l.startsWith("--") ? String(Q).trim() : Q + "px") + ";"));
    return B ? [B + " {"].concat(E, ["}"]) : E;
  }(A) : A.toString();
}
var yCA = function(A) {
  return Array.isArray(A) && (A.isCss = !0), A;
};
function V7A(A) {
  for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  return lY(A) || gq(A) ? yCA(qw(ECA(cH, [A].concat(t)))) : t.length === 0 && A.length === 1 && typeof A[0] == "string" ? A : yCA(qw(ECA(A, t)));
}
var X7A = function(A, e, t) {
  return t === void 0 && (t = uu), A.theme !== t.theme && A.theme || e || t.theme;
}, z7A = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, T7A = /(^-|-$)/g;
function O9(A) {
  return A.replace(z7A, "-").replace(T7A, "");
}
var _7A = function(A) {
  return sq(TkA(A) >>> 0);
};
function cM(A) {
  return typeof A == "string" && !0;
}
var aq = function(A) {
  return typeof A == "function" || typeof A == "object" && A !== null && !Array.isArray(A);
}, q7A = function(A) {
  return A !== "__proto__" && A !== "constructor" && A !== "prototype";
};
function O7A(A, e, t) {
  var i = A[t];
  aq(e) && aq(i) ? OkA(i, e) : A[t] = e;
}
function OkA(A) {
  for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  for (var n = 0, o = t; n < o.length; n++) {
    var g = o[n];
    if (aq(g))
      for (var s in g)
        q7A(s) && O7A(A, g[s], s);
  }
  return A;
}
var jkA = b.createContext();
jkA.Consumer;
var j9 = {};
function PkA(A, e, t) {
  var i = J$(A), n = !cM(A), o = e.attrs, g = o === void 0 ? cH : o, s = e.componentId, I = s === void 0 ? function(y, f) {
    var w = typeof y != "string" ? "sc" : O9(y);
    j9[w] = (j9[w] || 0) + 1;
    var G = w + "-" + _7A("5.3.10" + w + j9[w]);
    return f ? f + "-" + G : G;
  }(e.displayName, e.parentComponentId) : s, r = e.displayName, a = r === void 0 ? function(y) {
    return cM(y) ? "styled." + y : "Styled(" + uCA(y) + ")";
  }(A) : r, C = e.displayName && e.componentId ? O9(e.displayName) + "-" + e.componentId : e.componentId || I, B = i && A.attrs ? Array.prototype.concat(A.attrs, g).filter(Boolean) : g, l = e.shouldForwardProp;
  i && A.shouldForwardProp && (l = e.shouldForwardProp ? function(y, f, w) {
    return A.shouldForwardProp(y, f, w) && e.shouldForwardProp(y, f, w);
  } : A.shouldForwardProp);
  var Q, E = new F7A(t, C, i ? A.componentStyle : void 0), d = E.isStatic && g.length === 0, m = function(y, f) {
    return function(w, G, R, F) {
      var Z = w.attrs, c = w.componentStyle, J = w.defaultProps, p = w.foldedComponentIds, N = w.shouldForwardProp, v = w.styledComponentId, K = w.target, U = function(rA, sA, lA) {
        rA === void 0 && (rA = uu);
        var cA = Rc({}, sA, { theme: rA }), aA = {};
        return lA.forEach(function(QA) {
          var hA, EA, RA, xA = QA;
          for (hA in lY(xA) && (xA = xA(cA)), xA)
            cA[hA] = aA[hA] = hA === "className" ? (EA = aA[hA], RA = xA[hA], EA && RA ? EA + " " + RA : EA || RA) : xA[hA];
        }), [cA, aA];
      }(X7A(G, u.useContext(jkA), J) || uu, G, Z), j = U[0], q = U[1], O = function(rA, sA, lA, cA) {
        var aA = qkA(), QA = v7A(), hA = sA ? rA.generateAndInjectStyles(uu, aA, QA) : rA.generateAndInjectStyles(lA, aA, QA);
        return hA;
      }(c, F, j), $ = R, _ = q.$as || G.$as || q.as || G.as || K, tA = cM(_), nA = q !== G ? Rc({}, G, {}, q) : G, AA = {};
      for (var gA in nA)
        gA[0] !== "$" && gA !== "as" && (gA === "forwardedAs" ? AA.as = nA[gA] : (N ? N(gA, BCA, _) : !tA || BCA(gA)) && (AA[gA] = nA[gA]));
      return G.style && q.style !== G.style && (AA.style = Rc({}, G.style, {}, q.style)), AA.className = Array.prototype.concat(p, v, O !== v ? O : null, G.className, q.className).filter(Boolean).join(" "), AA.ref = $, u.createElement(_, AA);
    }(Q, y, f, d);
  };
  return m.displayName = a, (Q = b.forwardRef(m)).attrs = B, Q.componentStyle = E, Q.displayName = a, Q.shouldForwardProp = l, Q.foldedComponentIds = i ? Array.prototype.concat(A.foldedComponentIds, A.styledComponentId) : cH, Q.styledComponentId = C, Q.target = i ? A.target : A, Q.withComponent = function(y) {
    var f = e.componentId, w = function(R, F) {
      if (R == null)
        return {};
      var Z, c, J = {}, p = Object.keys(R);
      for (c = 0; c < p.length; c++)
        Z = p[c], F.indexOf(Z) >= 0 || (J[Z] = R[Z]);
      return J;
    }(e, ["componentId"]), G = f && f + "-" + (cM(y) ? y : O9(uCA(y)));
    return PkA(y, Rc({}, w, { attrs: B, componentId: G }), t);
  }, Object.defineProperty(Q, "defaultProps", { get: function() {
    return this._foldedDefaultProps;
  }, set: function(y) {
    this._foldedDefaultProps = i ? OkA({}, A.defaultProps, y) : y;
  } }), Object.defineProperty(Q, "toString", { value: function() {
    return "." + Q.styledComponentId;
  } }), n && VkA(Q, A, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0, withComponent: !0 }), Q;
}
var rq = function(A) {
  return function e(t, i, n) {
    if (n === void 0 && (n = uu), !BY.isValidElementType(i))
      return ER(1, String(i));
    var o = function() {
      return t(i, n, V7A.apply(void 0, arguments));
    };
    return o.withConfig = function(g) {
      return e(t, i, Rc({}, n, {}, g));
    }, o.attrs = function(g) {
      return e(t, i, Rc({}, n, { attrs: Array.prototype.concat(n.attrs, g).filter(Boolean) }));
    }, o;
  }(PkA, A);
};
["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "textPath", "tspan"].forEach(function(A) {
  rq[A] = rq(A);
});
const ji = rq;
var j7A = Object.defineProperty, P7A = (A, e, t) => e in A ? j7A(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t, ui = (A, e, t) => (P7A(A, typeof e != "symbol" ? e + "" : e, t), t);
function Cq(A, e) {
  return Cq = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, i) {
    return t.__proto__ = i, t;
  }, Cq(A, e);
}
function $kA(A, e) {
  A.prototype = Object.create(e.prototype), A.prototype.constructor = A, Cq(A, e);
}
function rt() {
  return rt = Object.assign ? Object.assign.bind() : function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, rt.apply(this, arguments);
}
function cY(A) {
  return cY = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, cY(A);
}
function $7A(A, e) {
  if (cY(A) !== "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (cY(i) !== "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function AAe(A) {
  var e = $7A(A, "string");
  return cY(e) === "symbol" ? e : String(e);
}
function eAe(A, e, t) {
  return e = AAe(e), e in A ? Object.defineProperty(A, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : A[e] = t, A;
}
function bCA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function wCA(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? bCA(Object(t), !0).forEach(function(i) {
      eAe(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : bCA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function ws(A) {
  return "Minified Redux error #" + A + "; visit https://redux.js.org/Errors?code=" + A + " for the full message or use the non-minified dev environment for full errors. ";
}
var fCA = function() {
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
}(), P9 = function() {
  return Math.random().toString(36).substring(7).split("").join(".");
}, DCA = {
  INIT: "@@redux/INIT" + P9(),
  REPLACE: "@@redux/REPLACE" + P9(),
  PROBE_UNKNOWN_ACTION: function() {
    return "@@redux/PROBE_UNKNOWN_ACTION" + P9();
  }
};
function tAe(A) {
  if (typeof A != "object" || A === null)
    return !1;
  for (var e = A; Object.getPrototypeOf(e) !== null; )
    e = Object.getPrototypeOf(e);
  return Object.getPrototypeOf(A) === e;
}
function AJA(A, e, t) {
  var i;
  if (typeof e == "function" && typeof t == "function" || typeof t == "function" && typeof arguments[3] == "function")
    throw new Error(ws(0));
  if (typeof e == "function" && typeof t > "u" && (t = e, e = void 0), typeof t < "u") {
    if (typeof t != "function")
      throw new Error(ws(1));
    return t(AJA)(A, e);
  }
  if (typeof A != "function")
    throw new Error(ws(2));
  var n = A, o = e, g = [], s = g, I = !1;
  function r() {
    s === g && (s = g.slice());
  }
  function a() {
    if (I)
      throw new Error(ws(3));
    return o;
  }
  function C(E) {
    if (typeof E != "function")
      throw new Error(ws(4));
    if (I)
      throw new Error(ws(5));
    var d = !0;
    return r(), s.push(E), function() {
      if (d) {
        if (I)
          throw new Error(ws(6));
        d = !1, r();
        var m = s.indexOf(E);
        s.splice(m, 1), g = null;
      }
    };
  }
  function B(E) {
    if (!tAe(E))
      throw new Error(ws(7));
    if (typeof E.type > "u")
      throw new Error(ws(8));
    if (I)
      throw new Error(ws(9));
    try {
      I = !0, o = n(o, E);
    } finally {
      I = !1;
    }
    for (var d = g = s, m = 0; m < d.length; m++) {
      var y = d[m];
      y();
    }
    return E;
  }
  function l(E) {
    if (typeof E != "function")
      throw new Error(ws(10));
    n = E, B({
      type: DCA.REPLACE
    });
  }
  function Q() {
    var E, d = C;
    return E = {
      /**
       * The minimal observable subscription method.
       * @param {Object} observer Any object that can be used as an observer.
       * The observer object should have a `next` method.
       * @returns {subscription} An object with an `unsubscribe` method that can
       * be used to unsubscribe the observable from the store, and prevent further
       * emission of values from the observable.
       */
      subscribe: function(m) {
        if (typeof m != "object" || m === null)
          throw new Error(ws(11));
        function y() {
          m.next && m.next(a());
        }
        y();
        var f = d(y);
        return {
          unsubscribe: f
        };
      }
    }, E[fCA] = function() {
      return this;
    }, E;
  }
  return B({
    type: DCA.INIT
  }), i = {
    dispatch: B,
    subscribe: C,
    getState: a,
    replaceReducer: l
  }, i[fCA] = Q, i;
}
function GCA(A, e) {
  return function() {
    return e(A.apply(this, arguments));
  };
}
function kCA(A, e) {
  if (typeof A == "function")
    return GCA(A, e);
  if (typeof A != "object" || A === null)
    throw new Error(ws(16));
  var t = {};
  for (var i in A) {
    var n = A[i];
    typeof n == "function" && (t[i] = GCA(n, e));
  }
  return t;
}
function eJA() {
  for (var A = arguments.length, e = new Array(A), t = 0; t < A; t++)
    e[t] = arguments[t];
  return e.length === 0 ? function(i) {
    return i;
  } : e.length === 1 ? e[0] : e.reduce(function(i, n) {
    return function() {
      return i(n.apply(void 0, arguments));
    };
  });
}
function iAe() {
  for (var A = arguments.length, e = new Array(A), t = 0; t < A; t++)
    e[t] = arguments[t];
  return function(i) {
    return function() {
      var n = i.apply(void 0, arguments), o = function() {
        throw new Error(ws(15));
      }, g = {
        getState: n.getState,
        dispatch: function() {
          return o.apply(void 0, arguments);
        }
      }, s = e.map(function(I) {
        return I(g);
      });
      return o = eJA.apply(void 0, s)(n.dispatch), wCA(wCA({}, n), {}, {
        dispatch: o
      });
    };
  };
}
var qE = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Br(A) {
  return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
}
var tJA = { exports: {} }, $9 = {};
/**
 * @license React
 * use-sync-external-store-shim.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 JCA;
function nAe() {
  if (JCA)
    return $9;
  JCA = 1;
  var A = b;
  function e(C, B) {
    return C === B && (C !== 0 || 1 / C === 1 / B) || C !== C && B !== B;
  }
  var t = typeof Object.is == "function" ? Object.is : e, i = A.useState, n = A.useEffect, o = A.useLayoutEffect, g = A.useDebugValue;
  function s(C, B) {
    var l = B(), Q = i({ inst: { value: l, getSnapshot: B } }), E = Q[0].inst, d = Q[1];
    return o(function() {
      E.value = l, E.getSnapshot = B, I(E) && d({ inst: E });
    }, [C, l, B]), n(function() {
      return I(E) && d({ inst: E }), C(function() {
        I(E) && d({ inst: E });
      });
    }, [C]), g(l), l;
  }
  function I(C) {
    var B = C.getSnapshot;
    C = C.value;
    try {
      var l = B();
      return !t(C, l);
    } catch {
      return !0;
    }
  }
  function r(C, B) {
    return B();
  }
  var a = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : s;
  return $9.useSyncExternalStore = A.useSyncExternalStore !== void 0 ? A.useSyncExternalStore : a, $9;
}
tJA.exports = nAe();
var iJA = tJA.exports, A5 = {};
/**
 * @license React
 * use-sync-external-store-shim/with-selector.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 NCA;
function oAe() {
  if (NCA)
    return A5;
  NCA = 1;
  var A = b, e = iJA;
  function t(r, a) {
    return r === a && (r !== 0 || 1 / r === 1 / a) || r !== r && a !== a;
  }
  var i = typeof Object.is == "function" ? Object.is : t, n = e.useSyncExternalStore, o = A.useRef, g = A.useEffect, s = A.useMemo, I = A.useDebugValue;
  return A5.useSyncExternalStoreWithSelector = function(r, a, C, B, l) {
    var Q = o(null);
    if (Q.current === null) {
      var E = { hasValue: !1, value: null };
      Q.current = E;
    } else
      E = Q.current;
    Q = s(function() {
      function m(R) {
        if (!y) {
          if (y = !0, f = R, R = B(R), l !== void 0 && E.hasValue) {
            var F = E.value;
            if (l(F, R))
              return w = F;
          }
          return w = R;
        }
        if (F = w, i(f, R))
          return F;
        var Z = B(R);
        return l !== void 0 && l(F, Z) ? F : (f = R, w = Z);
      }
      var y = !1, f, w, G = C === void 0 ? null : C;
      return [function() {
        return m(a());
      }, G === null ? void 0 : function() {
        return m(G());
      }];
    }, [a, C, B, l]);
    var d = n(r, Q[0], Q[1]);
    return g(function() {
      E.hasValue = !0, E.value = d;
    }, [d]), I(d), d;
  }, A5;
}
oAe();
function gAe(A) {
  A();
}
let nJA = gAe;
const sAe = (A) => nJA = A, IAe = () => nJA, YCA = Symbol.for("react-redux-context"), RCA = typeof globalThis < "u" ? globalThis : (
  /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
  {}
);
function aAe() {
  var A;
  if (!u.createContext)
    return {};
  const e = (A = RCA[YCA]) != null ? A : RCA[YCA] = /* @__PURE__ */ new Map();
  let t = e.get(u.createContext);
  return t || (t = u.createContext(null), e.set(u.createContext, t)), t;
}
const oJA = /* @__PURE__ */ aAe(), rAe = () => {
  throw new Error("uSES not initialized!");
};
function iw() {
  return iw = Object.assign ? Object.assign.bind() : function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, iw.apply(this, arguments);
}
function gJA(A, e) {
  if (A == null)
    return {};
  var t = {}, i = Object.keys(A), n, o;
  for (o = 0; o < i.length; o++)
    n = i[o], !(e.indexOf(n) >= 0) && (t[n] = A[n]);
  return t;
}
var FCA = { exports: {} }, di = {};
/** @license React v16.13.1
 * react-is.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 MCA;
function CAe() {
  if (MCA)
    return di;
  MCA = 1;
  var A = typeof Symbol == "function" && Symbol.for, e = A ? Symbol.for("react.element") : 60103, t = A ? Symbol.for("react.portal") : 60106, i = A ? Symbol.for("react.fragment") : 60107, n = A ? Symbol.for("react.strict_mode") : 60108, o = A ? Symbol.for("react.profiler") : 60114, g = A ? Symbol.for("react.provider") : 60109, s = A ? Symbol.for("react.context") : 60110, I = A ? Symbol.for("react.async_mode") : 60111, r = A ? Symbol.for("react.concurrent_mode") : 60111, a = A ? Symbol.for("react.forward_ref") : 60112, C = A ? Symbol.for("react.suspense") : 60113, B = A ? Symbol.for("react.suspense_list") : 60120, l = A ? Symbol.for("react.memo") : 60115, Q = A ? Symbol.for("react.lazy") : 60116, E = A ? Symbol.for("react.block") : 60121, d = A ? Symbol.for("react.fundamental") : 60117, m = A ? Symbol.for("react.responder") : 60118, y = A ? Symbol.for("react.scope") : 60119;
  function f(G) {
    if (typeof G == "object" && G !== null) {
      var R = G.$$typeof;
      switch (R) {
        case e:
          switch (G = G.type, G) {
            case I:
            case r:
            case i:
            case o:
            case n:
            case C:
              return G;
            default:
              switch (G = G && G.$$typeof, G) {
                case s:
                case a:
                case Q:
                case l:
                case g:
                  return G;
                default:
                  return R;
              }
          }
        case t:
          return R;
      }
    }
  }
  function w(G) {
    return f(G) === r;
  }
  return di.AsyncMode = I, di.ConcurrentMode = r, di.ContextConsumer = s, di.ContextProvider = g, di.Element = e, di.ForwardRef = a, di.Fragment = i, di.Lazy = Q, di.Memo = l, di.Portal = t, di.Profiler = o, di.StrictMode = n, di.Suspense = C, di.isAsyncMode = function(G) {
    return w(G) || f(G) === I;
  }, di.isConcurrentMode = w, di.isContextConsumer = function(G) {
    return f(G) === s;
  }, di.isContextProvider = function(G) {
    return f(G) === g;
  }, di.isElement = function(G) {
    return typeof G == "object" && G !== null && G.$$typeof === e;
  }, di.isForwardRef = function(G) {
    return f(G) === a;
  }, di.isFragment = function(G) {
    return f(G) === i;
  }, di.isLazy = function(G) {
    return f(G) === Q;
  }, di.isMemo = function(G) {
    return f(G) === l;
  }, di.isPortal = function(G) {
    return f(G) === t;
  }, di.isProfiler = function(G) {
    return f(G) === o;
  }, di.isStrictMode = function(G) {
    return f(G) === n;
  }, di.isSuspense = function(G) {
    return f(G) === C;
  }, di.isValidElementType = function(G) {
    return typeof G == "string" || typeof G == "function" || G === i || G === r || G === o || G === n || G === C || G === B || typeof G == "object" && G !== null && (G.$$typeof === Q || G.$$typeof === l || G.$$typeof === g || G.$$typeof === s || G.$$typeof === a || G.$$typeof === d || G.$$typeof === m || G.$$typeof === y || G.$$typeof === E);
  }, di.typeOf = f, di;
}
var xCA;
function BAe() {
  return xCA || (xCA = 1, FCA.exports = CAe()), FCA.exports;
}
var F$ = BAe(), lAe = {
  childContextTypes: !0,
  contextType: !0,
  contextTypes: !0,
  defaultProps: !0,
  displayName: !0,
  getDefaultProps: !0,
  getDerivedStateFromError: !0,
  getDerivedStateFromProps: !0,
  mixins: !0,
  propTypes: !0,
  type: !0
}, cAe = {
  name: !0,
  length: !0,
  prototype: !0,
  caller: !0,
  callee: !0,
  arguments: !0,
  arity: !0
}, QAe = {
  $$typeof: !0,
  render: !0,
  defaultProps: !0,
  displayName: !0,
  propTypes: !0
}, sJA = {
  $$typeof: !0,
  compare: !0,
  defaultProps: !0,
  displayName: !0,
  propTypes: !0,
  type: !0
}, M$ = {};
M$[F$.ForwardRef] = QAe;
M$[F$.Memo] = sJA;
function LCA(A) {
  return F$.isMemo(A) ? sJA : M$[A.$$typeof] || lAe;
}
var EAe = Object.defineProperty, uAe = Object.getOwnPropertyNames, vCA = Object.getOwnPropertySymbols, dAe = Object.getOwnPropertyDescriptor, hAe = Object.getPrototypeOf, HCA = Object.prototype;
function IJA(A, e, t) {
  if (typeof e != "string") {
    if (HCA) {
      var i = hAe(e);
      i && i !== HCA && IJA(A, i, t);
    }
    var n = uAe(e);
    vCA && (n = n.concat(vCA(e)));
    for (var o = LCA(A), g = LCA(e), s = 0; s < n.length; ++s) {
      var I = n[s];
      if (!cAe[I] && !(t && t[I]) && !(g && g[I]) && !(o && o[I])) {
        var r = dAe(e, I);
        try {
          EAe(A, I, r);
        } catch {
        }
      }
    }
  }
  return A;
}
var mAe = IJA;
const SCA = /* @__PURE__ */ Br(mAe);
var aJA = { exports: {} }, hi = {};
/**
 * @license React
 * react-is.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 ZCA;
function pAe() {
  if (ZCA)
    return hi;
  ZCA = 1;
  var A = Symbol.for("react.element"), e = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), n = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), g = Symbol.for("react.context"), s = Symbol.for("react.server_context"), I = Symbol.for("react.forward_ref"), r = Symbol.for("react.suspense"), a = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), l = Symbol.for("react.offscreen"), Q;
  Q = Symbol.for("react.module.reference");
  function E(d) {
    if (typeof d == "object" && d !== null) {
      var m = d.$$typeof;
      switch (m) {
        case A:
          switch (d = d.type, d) {
            case t:
            case n:
            case i:
            case r:
            case a:
              return d;
            default:
              switch (d = d && d.$$typeof, d) {
                case s:
                case g:
                case I:
                case B:
                case C:
                case o:
                  return d;
                default:
                  return m;
              }
          }
        case e:
          return m;
      }
    }
  }
  return hi.ContextConsumer = g, hi.ContextProvider = o, hi.Element = A, hi.ForwardRef = I, hi.Fragment = t, hi.Lazy = B, hi.Memo = C, hi.Portal = e, hi.Profiler = n, hi.StrictMode = i, hi.Suspense = r, hi.SuspenseList = a, hi.isAsyncMode = function() {
    return !1;
  }, hi.isConcurrentMode = function() {
    return !1;
  }, hi.isContextConsumer = function(d) {
    return E(d) === g;
  }, hi.isContextProvider = function(d) {
    return E(d) === o;
  }, hi.isElement = function(d) {
    return typeof d == "object" && d !== null && d.$$typeof === A;
  }, hi.isForwardRef = function(d) {
    return E(d) === I;
  }, hi.isFragment = function(d) {
    return E(d) === t;
  }, hi.isLazy = function(d) {
    return E(d) === B;
  }, hi.isMemo = function(d) {
    return E(d) === C;
  }, hi.isPortal = function(d) {
    return E(d) === e;
  }, hi.isProfiler = function(d) {
    return E(d) === n;
  }, hi.isStrictMode = function(d) {
    return E(d) === i;
  }, hi.isSuspense = function(d) {
    return E(d) === r;
  }, hi.isSuspenseList = function(d) {
    return E(d) === a;
  }, hi.isValidElementType = function(d) {
    return typeof d == "string" || typeof d == "function" || d === t || d === n || d === i || d === r || d === a || d === l || typeof d == "object" && d !== null && (d.$$typeof === B || d.$$typeof === C || d.$$typeof === o || d.$$typeof === g || d.$$typeof === I || d.$$typeof === Q || d.getModuleId !== void 0);
  }, hi.typeOf = E, hi;
}
aJA.exports = pAe();
var yAe = aJA.exports;
const bAe = ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"];
function wAe(A, e, t, i, {
  areStatesEqual: n,
  areOwnPropsEqual: o,
  areStatePropsEqual: g
}) {
  let s = !1, I, r, a, C, B;
  function l(y, f) {
    return I = y, r = f, a = A(I, r), C = e(i, r), B = t(a, C, r), s = !0, B;
  }
  function Q() {
    return a = A(I, r), e.dependsOnOwnProps && (C = e(i, r)), B = t(a, C, r), B;
  }
  function E() {
    return A.dependsOnOwnProps && (a = A(I, r)), e.dependsOnOwnProps && (C = e(i, r)), B = t(a, C, r), B;
  }
  function d() {
    const y = A(I, r), f = !g(y, a);
    return a = y, f && (B = t(a, C, r)), B;
  }
  function m(y, f) {
    const w = !o(f, r), G = !n(y, I, f, r);
    return I = y, r = f, w && G ? Q() : w ? E() : G ? d() : B;
  }
  return function(y, f) {
    return s ? m(y, f) : l(y, f);
  };
}
function fAe(A, e) {
  let {
    initMapStateToProps: t,
    initMapDispatchToProps: i,
    initMergeProps: n
  } = e, o = gJA(e, bAe);
  const g = t(A, o), s = i(A, o), I = n(A, o);
  return wAe(g, s, I, A, o);
}
function DAe(A, e) {
  const t = {};
  for (const i in A) {
    const n = A[i];
    typeof n == "function" && (t[i] = (...o) => e(n(...o)));
  }
  return t;
}
function Bq(A) {
  return function(e) {
    const t = A(e);
    function i() {
      return t;
    }
    return i.dependsOnOwnProps = !1, i;
  };
}
function WCA(A) {
  return A.dependsOnOwnProps ? !!A.dependsOnOwnProps : A.length !== 1;
}
function rJA(A, e) {
  return function(t, {
    displayName: i
  }) {
    const n = function(o, g) {
      return n.dependsOnOwnProps ? n.mapToProps(o, g) : n.mapToProps(o, void 0);
    };
    return n.dependsOnOwnProps = !0, n.mapToProps = function(o, g) {
      n.mapToProps = A, n.dependsOnOwnProps = WCA(A);
      let s = n(o, g);
      return typeof s == "function" && (n.mapToProps = s, n.dependsOnOwnProps = WCA(s), s = n(o, g)), s;
    }, n;
  };
}
function x$(A, e) {
  return (t, i) => {
    throw new Error(`Invalid value of type ${typeof A} for ${e} argument when connecting component ${i.wrappedComponentName}.`);
  };
}
function GAe(A) {
  return A && typeof A == "object" ? Bq((e) => (
    // @ts-ignore
    DAe(A, e)
  )) : A ? typeof A == "function" ? (
    // @ts-ignore
    rJA(A)
  ) : x$(A, "mapDispatchToProps") : Bq((e) => ({
    dispatch: e
  }));
}
function kAe(A) {
  return A ? typeof A == "function" ? (
    // @ts-ignore
    rJA(A)
  ) : x$(A, "mapStateToProps") : Bq(() => ({}));
}
function JAe(A, e, t) {
  return iw({}, t, A, e);
}
function NAe(A) {
  return function(e, {
    displayName: t,
    areMergedPropsEqual: i
  }) {
    let n = !1, o;
    return function(g, s, I) {
      const r = A(g, s, I);
      return n ? i(r, o) || (o = r) : (n = !0, o = r), o;
    };
  };
}
function YAe(A) {
  return A ? typeof A == "function" ? NAe(A) : x$(A, "mergeProps") : () => JAe;
}
function RAe() {
  const A = IAe();
  let e = null, t = null;
  return {
    clear() {
      e = null, t = null;
    },
    notify() {
      A(() => {
        let i = e;
        for (; i; )
          i.callback(), i = i.next;
      });
    },
    get() {
      let i = [], n = e;
      for (; n; )
        i.push(n), n = n.next;
      return i;
    },
    subscribe(i) {
      let n = !0, o = t = {
        callback: i,
        next: null,
        prev: t
      };
      return o.prev ? o.prev.next = o : e = o, function() {
        !n || e === null || (n = !1, o.next ? o.next.prev = o.prev : t = o.prev, o.prev ? o.prev.next = o.next : e = o.next);
      };
    }
  };
}
const KCA = {
  notify() {
  },
  get: () => []
};
function CJA(A, e) {
  let t, i = KCA, n = 0, o = !1;
  function g(E) {
    a();
    const d = i.subscribe(E);
    let m = !1;
    return () => {
      m || (m = !0, d(), C());
    };
  }
  function s() {
    i.notify();
  }
  function I() {
    Q.onStateChange && Q.onStateChange();
  }
  function r() {
    return o;
  }
  function a() {
    n++, t || (t = e ? e.addNestedSub(I) : A.subscribe(I), i = RAe());
  }
  function C() {
    n--, t && n === 0 && (t(), t = void 0, i.clear(), i = KCA);
  }
  function B() {
    o || (o = !0, a());
  }
  function l() {
    o && (o = !1, C());
  }
  const Q = {
    addNestedSub: g,
    notifyNestedSubs: s,
    handleChangeWrapper: I,
    isSubscribed: r,
    trySubscribe: B,
    tryUnsubscribe: l,
    getListeners: () => i
  };
  return Q;
}
const FAe = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", EH = FAe ? u.useLayoutEffect : u.useEffect;
function UCA(A, e) {
  return A === e ? A !== 0 || e !== 0 || 1 / A === 1 / e : A !== A && e !== e;
}
function e5(A, e) {
  if (UCA(A, e))
    return !0;
  if (typeof A != "object" || A === null || typeof e != "object" || e === null)
    return !1;
  const t = Object.keys(A), i = Object.keys(e);
  if (t.length !== i.length)
    return !1;
  for (let n = 0; n < t.length; n++)
    if (!Object.prototype.hasOwnProperty.call(e, t[n]) || !UCA(A[t[n]], e[t[n]]))
      return !1;
  return !0;
}
const MAe = ["reactReduxForwardedRef"];
let BJA = rAe;
const xAe = (A) => {
  BJA = A;
}, LAe = [null, null];
function vAe(A, e, t) {
  EH(() => A(...e), t);
}
function HAe(A, e, t, i, n, o) {
  A.current = i, t.current = !1, n.current && (n.current = null, o());
}
function SAe(A, e, t, i, n, o, g, s, I, r, a) {
  if (!A)
    return () => {
    };
  let C = !1, B = null;
  const l = () => {
    if (C || !s.current)
      return;
    const Q = e.getState();
    let E, d;
    try {
      E = i(Q, n.current);
    } catch (m) {
      d = m, B = m;
    }
    d || (B = null), E === o.current ? g.current || r() : (o.current = E, I.current = E, g.current = !0, a());
  };
  return t.onStateChange = l, t.trySubscribe(), l(), () => {
    if (C = !0, t.tryUnsubscribe(), t.onStateChange = null, B)
      throw B;
  };
}
function ZAe(A, e) {
  return A === e;
}
function lJA(A, e, t, {
  // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.
  // @ts-ignore
  pure: i,
  areStatesEqual: n = ZAe,
  areOwnPropsEqual: o = e5,
  areStatePropsEqual: g = e5,
  areMergedPropsEqual: s = e5,
  // use React's forwardRef to expose a ref of the wrapped component
  forwardRef: I = !1,
  // the context consumer to use
  context: r = oJA
} = {}) {
  const a = r, C = kAe(A), B = GAe(e), l = YAe(t), Q = !!A;
  return (E) => {
    const d = E.displayName || E.name || "Component", m = `Connect(${d})`, y = {
      shouldHandleStateChanges: Q,
      displayName: m,
      wrappedComponentName: d,
      WrappedComponent: E,
      // @ts-ignore
      initMapStateToProps: C,
      // @ts-ignore
      initMapDispatchToProps: B,
      initMergeProps: l,
      areStatesEqual: n,
      areStatePropsEqual: g,
      areOwnPropsEqual: o,
      areMergedPropsEqual: s
    };
    function f(G) {
      const [R, F, Z] = u.useMemo(() => {
        const {
          reactReduxForwardedRef: aA
        } = G, QA = gJA(G, MAe);
        return [G.context, aA, QA];
      }, [G]), c = u.useMemo(() => R && R.Consumer && // @ts-ignore
      yAe.isContextConsumer(/* @__PURE__ */ u.createElement(R.Consumer, null)) ? R : a, [R, a]), J = u.useContext(c), p = !!G.store && !!G.store.getState && !!G.store.dispatch, N = !!J && !!J.store, v = p ? G.store : J.store, K = N ? J.getServerState : v.getState, U = u.useMemo(() => fAe(v.dispatch, y), [v]), [j, q] = u.useMemo(() => {
        if (!Q)
          return LAe;
        const aA = CJA(v, p ? void 0 : J.subscription), QA = aA.notifyNestedSubs.bind(aA);
        return [aA, QA];
      }, [v, p, J]), O = u.useMemo(() => p ? J : iw({}, J, {
        subscription: j
      }), [p, J, j]), $ = u.useRef(), _ = u.useRef(Z), tA = u.useRef(), nA = u.useRef(!1);
      u.useRef(!1);
      const AA = u.useRef(!1), gA = u.useRef();
      EH(() => (AA.current = !0, () => {
        AA.current = !1;
      }), []);
      const rA = u.useMemo(() => () => tA.current && Z === _.current ? tA.current : U(v.getState(), Z), [v, Z]), sA = u.useMemo(() => (aA) => j ? SAe(
        Q,
        v,
        j,
        // @ts-ignore
        U,
        _,
        $,
        nA,
        AA,
        tA,
        q,
        aA
      ) : () => {
      }, [j]);
      vAe(HAe, [_, $, nA, Z, tA, q]);
      let lA;
      try {
        lA = BJA(
          // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing
          sA,
          // TODO This is incredibly hacky. We've already processed the store update and calculated new child props,
          // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.
          rA,
          K ? () => U(K(), Z) : rA
        );
      } catch (aA) {
        throw gA.current && (aA.message += `
The error may be correlated with this previous error:
${gA.current.stack}

`), aA;
      }
      EH(() => {
        gA.current = void 0, tA.current = void 0, $.current = lA;
      });
      const cA = u.useMemo(() => (
        // @ts-ignore
        /* @__PURE__ */ u.createElement(E, iw({}, lA, {
          ref: F
        }))
      ), [F, E, lA]);
      return u.useMemo(() => Q ? /* @__PURE__ */ u.createElement(c.Provider, {
        value: O
      }, cA) : cA, [c, cA, O]);
    }
    const w = u.memo(f);
    if (w.WrappedComponent = E, w.displayName = f.displayName = m, I) {
      const G = u.forwardRef(function(R, F) {
        return /* @__PURE__ */ u.createElement(w, iw({}, R, {
          reactReduxForwardedRef: F
        }));
      });
      return G.displayName = m, G.WrappedComponent = E, SCA(G, E);
    }
    return SCA(w, E);
  };
}
function WAe({
  store: A,
  context: e,
  children: t,
  serverState: i,
  stabilityCheck: n = "once",
  noopCheck: o = "once"
}) {
  const g = u.useMemo(() => {
    const r = CJA(A);
    return {
      store: A,
      subscription: r,
      getServerState: i ? () => i : void 0,
      stabilityCheck: n,
      noopCheck: o
    };
  }, [A, i, n, o]), s = u.useMemo(() => A.getState(), [A]);
  EH(() => {
    const {
      subscription: r
    } = g;
    return r.onStateChange = r.notifyNestedSubs, r.trySubscribe(), s !== A.getState() && r.notifyNestedSubs(), () => {
      r.tryUnsubscribe(), r.onStateChange = void 0;
    };
  }, [g, s]);
  const I = e || oJA;
  return /* @__PURE__ */ u.createElement(I.Provider, {
    value: g
  }, t);
}
xAe(iJA.useSyncExternalStore);
sAe(Jt.unstable_batchedUpdates);
function KAe(A, e) {
  if (A.length !== e.length)
    return !1;
  for (var t = 0; t < A.length; t++)
    if (A[t] !== e[t])
      return !1;
  return !0;
}
function cJA(A, e) {
  var t = u.useState(function() {
    return {
      inputs: e,
      result: A()
    };
  })[0], i = u.useRef(!0), n = u.useRef(t), o = i.current || !!(e && n.current.inputs && KAe(e, n.current.inputs)), g = o ? n.current : {
    inputs: e,
    result: A()
  };
  return u.useEffect(function() {
    i.current = !1, n.current = g;
  }, [g]), g.result;
}
function UAe(A, e) {
  return cJA(function() {
    return A;
  }, e);
}
var $t = cJA, He = UAe, VAe = "Invariant failed";
function XAe(A, e) {
  if (!A)
    throw new Error(VAe);
}
var Tr = function(A) {
  var e = A.top, t = A.right, i = A.bottom, n = A.left, o = t - n, g = i - e, s = {
    top: e,
    right: t,
    bottom: i,
    left: n,
    width: o,
    height: g,
    x: n,
    y: e,
    center: {
      x: (t + n) / 2,
      y: (i + e) / 2
    }
  };
  return s;
}, L$ = function(A, e) {
  return {
    top: A.top - e.top,
    left: A.left - e.left,
    bottom: A.bottom + e.bottom,
    right: A.right + e.right
  };
}, VCA = function(A, e) {
  return {
    top: A.top + e.top,
    left: A.left + e.left,
    bottom: A.bottom - e.bottom,
    right: A.right - e.right
  };
}, zAe = function(A, e) {
  return {
    top: A.top + e.y,
    left: A.left + e.x,
    bottom: A.bottom + e.y,
    right: A.right + e.x
  };
}, t5 = {
  top: 0,
  right: 0,
  bottom: 0,
  left: 0
}, v$ = function(A) {
  var e = A.borderBox, t = A.margin, i = t === void 0 ? t5 : t, n = A.border, o = n === void 0 ? t5 : n, g = A.padding, s = g === void 0 ? t5 : g, I = Tr(L$(e, i)), r = Tr(VCA(e, o)), a = Tr(VCA(r, s));
  return {
    marginBox: I,
    borderBox: Tr(e),
    paddingBox: r,
    contentBox: a,
    margin: i,
    border: o,
    padding: s
  };
}, ma = function(A) {
  var e = A.slice(0, -2), t = A.slice(-2);
  if (t !== "px")
    return 0;
  var i = Number(e);
  return isNaN(i) && XAe(!1), i;
}, TAe = function() {
  return {
    x: window.pageXOffset,
    y: window.pageYOffset
  };
}, uH = function(A, e) {
  var t = A.borderBox, i = A.border, n = A.margin, o = A.padding, g = zAe(t, e);
  return v$({
    borderBox: g,
    border: i,
    margin: n,
    padding: o
  });
}, dH = function(A, e) {
  return e === void 0 && (e = TAe()), uH(A, e);
}, QJA = function(A, e) {
  var t = {
    top: ma(e.marginTop),
    right: ma(e.marginRight),
    bottom: ma(e.marginBottom),
    left: ma(e.marginLeft)
  }, i = {
    top: ma(e.paddingTop),
    right: ma(e.paddingRight),
    bottom: ma(e.paddingBottom),
    left: ma(e.paddingLeft)
  }, n = {
    top: ma(e.borderTopWidth),
    right: ma(e.borderRightWidth),
    bottom: ma(e.borderBottomWidth),
    left: ma(e.borderLeftWidth)
  };
  return v$({
    borderBox: A,
    margin: t,
    padding: i,
    border: n
  });
}, EJA = function(A) {
  var e = A.getBoundingClientRect(), t = window.getComputedStyle(A);
  return QJA(e, t);
}, XCA = Number.isNaN || function(A) {
  return typeof A == "number" && A !== A;
};
function _Ae(A, e) {
  return !!(A === e || XCA(A) && XCA(e));
}
function qAe(A, e) {
  if (A.length !== e.length)
    return !1;
  for (var t = 0; t < A.length; t++)
    if (!_Ae(A[t], e[t]))
      return !1;
  return !0;
}
function Lo(A, e) {
  e === void 0 && (e = qAe);
  var t, i = [], n, o = !1;
  function g() {
    for (var s = [], I = 0; I < arguments.length; I++)
      s[I] = arguments[I];
    return o && t === this && e(s, i) || (n = A.apply(this, s), o = !0, t = this, i = s), n;
  }
  return g;
}
var OAe = function(A) {
  var e = [], t = null, i = function() {
    for (var n = arguments.length, o = new Array(n), g = 0; g < n; g++)
      o[g] = arguments[g];
    e = o, !t && (t = requestAnimationFrame(function() {
      t = null, A.apply(void 0, e);
    }));
  };
  return i.cancel = function() {
    t && (cancelAnimationFrame(t), t = null);
  }, i;
};
const QY = OAe;
var uJA = u.createContext({
  head: document.head,
  body: document.body
}), DC = function() {
  return u.useContext(uJA);
}, H$ = uJA.Provider;
function dJA(A, e) {
}
var XVt = dJA.bind(null, "warn");
dJA.bind(null, "error");
function du() {
}
function jAe(A, e) {
  return rt({}, A, {}, e);
}
function va(A, e, t) {
  var i = e.map(function(n) {
    var o = jAe(t, n.options);
    return A.addEventListener(n.eventName, n.fn, o), function() {
      A.removeEventListener(n.eventName, n.fn, o);
    };
  });
  return function() {
    i.forEach(function(n) {
      n();
    });
  };
}
var PAe = "Invariant failed";
function hH(A) {
  this.message = A;
}
hH.prototype.toString = function() {
  return this.message;
};
function ae(A, e) {
  if (!A)
    throw new hH(PAe);
}
var $Ae = function(A) {
  $kA(e, A);
  function e() {
    for (var i, n = arguments.length, o = new Array(n), g = 0; g < n; g++)
      o[g] = arguments[g];
    return i = A.call.apply(A, [this].concat(o)) || this, i.callbacks = null, i.unbind = du, i.onWindowError = function(s) {
      var I = i.getCallbacks();
      I.isDragging() && I.tryAbort();
      var r = s.error;
      r instanceof hH && s.preventDefault();
    }, i.getCallbacks = function() {
      if (!i.callbacks)
        throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");
      return i.callbacks;
    }, i.setCallbacks = function(s) {
      i.callbacks = s;
    }, i;
  }
  var t = e.prototype;
  return t.componentDidMount = function() {
    this.unbind = va(window, [{
      eventName: "error",
      fn: this.onWindowError
    }]);
  }, t.componentDidCatch = function(i) {
    if (i instanceof hH) {
      this.setState({});
      return;
    }
    throw i;
  }, t.componentWillUnmount = function() {
    this.unbind();
  }, t.render = function() {
    return this.props.children(this.setCallbacks);
  }, e;
}(b.Component), Aee = `
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key
`, mH = function(A) {
  return A + 1;
}, eee = function(A) {
  return `
  You have lifted an item in position ` + mH(A.source.index) + `
`;
}, hJA = function(A, e) {
  var t = A.droppableId === e.droppableId, i = mH(A.index), n = mH(e.index);
  return t ? `
      You have moved the item from position ` + i + `
      to position ` + n + `
    ` : `
    You have moved the item from position ` + i + `
    in list ` + A.droppableId + `
    to list ` + e.droppableId + `
    in position ` + n + `
  `;
}, mJA = function(A, e, t) {
  var i = e.droppableId === t.droppableId;
  return i ? `
      The item ` + A + `
      has been combined with ` + t.draggableId : `
      The item ` + A + `
      in list ` + e.droppableId + `
      has been combined with ` + t.draggableId + `
      in list ` + t.droppableId + `
    `;
}, tee = function(A) {
  var e = A.destination;
  if (e)
    return hJA(A.source, e);
  var t = A.combine;
  return t ? mJA(A.draggableId, A.source, t) : "You are over an area that cannot be dropped on";
}, zCA = function(A) {
  return `
  The item has returned to its starting position
  of ` + mH(A.index) + `
`;
}, iee = function(A) {
  if (A.reason === "CANCEL")
    return `
      Movement cancelled.
      ` + zCA(A.source) + `
    `;
  var e = A.destination, t = A.combine;
  return e ? `
      You have dropped the item.
      ` + hJA(A.source, e) + `
    ` : t ? `
      You have dropped the item.
      ` + mJA(A.draggableId, A.source, t) + `
    ` : `
    The item has been dropped while not over a drop area.
    ` + zCA(A.source) + `
  `;
}, xL = {
  dragHandleUsageInstructions: Aee,
  onDragStart: eee,
  onDragUpdate: tee,
  onDragEnd: iee
}, Zo = {
  x: 0,
  y: 0
}, Oo = function(A, e) {
  return {
    x: A.x + e.x,
    y: A.y + e.y
  };
}, LI = function(A, e) {
  return {
    x: A.x - e.x,
    y: A.y - e.y
  };
}, hu = function(A, e) {
  return A.x === e.x && A.y === e.y;
}, uD = function(A) {
  return {
    x: A.x !== 0 ? -A.x : 0,
    y: A.y !== 0 ? -A.y : 0
  };
}, Ap = function(A, e, t) {
  var i;
  return t === void 0 && (t = 0), i = {}, i[A] = e, i[A === "x" ? "y" : "x"] = t, i;
}, EY = function(A, e) {
  return Math.sqrt(Math.pow(e.x - A.x, 2) + Math.pow(e.y - A.y, 2));
}, TCA = function(A, e) {
  return Math.min.apply(Math, e.map(function(t) {
    return EY(A, t);
  }));
}, pJA = function(A) {
  return function(e) {
    return {
      x: A(e.x),
      y: A(e.y)
    };
  };
}, nee = function(A, e) {
  var t = Tr({
    top: Math.max(e.top, A.top),
    right: Math.min(e.right, A.right),
    bottom: Math.min(e.bottom, A.bottom),
    left: Math.max(e.left, A.left)
  });
  return t.width <= 0 || t.height <= 0 ? null : t;
}, uR = function(A, e) {
  return {
    top: A.top + e.y,
    left: A.left + e.x,
    bottom: A.bottom + e.y,
    right: A.right + e.x
  };
}, _CA = function(A) {
  return [{
    x: A.left,
    y: A.top
  }, {
    x: A.right,
    y: A.top
  }, {
    x: A.left,
    y: A.bottom
  }, {
    x: A.right,
    y: A.bottom
  }];
}, oee = {
  top: 0,
  right: 0,
  bottom: 0,
  left: 0
}, gee = function(A, e) {
  return e ? uR(A, e.scroll.diff.displacement) : A;
}, see = function(A, e, t) {
  if (t && t.increasedBy) {
    var i;
    return rt({}, A, (i = {}, i[e.end] = A[e.end] + t.increasedBy[e.line], i));
  }
  return A;
}, Iee = function(A, e) {
  return e && e.shouldClipSubject ? nee(e.pageMarginBox, A) : Tr(A);
}, Ow = function(A) {
  var e = A.page, t = A.withPlaceholder, i = A.axis, n = A.frame, o = gee(e.marginBox, n), g = see(o, i, t), s = Iee(g, n);
  return {
    page: e,
    withPlaceholder: t,
    active: s
  };
}, S$ = function(A, e) {
  A.frame || ae(!1);
  var t = A.frame, i = LI(e, t.scroll.initial), n = uD(i), o = rt({}, t, {
    scroll: {
      initial: t.scroll.initial,
      current: e,
      diff: {
        value: i,
        displacement: n
      },
      max: t.scroll.max
    }
  }), g = Ow({
    page: A.subject.page,
    withPlaceholder: A.subject.withPlaceholder,
    axis: A.axis,
    frame: o
  }), s = rt({}, A, {
    frame: o,
    subject: g
  });
  return s;
};
function pH(A) {
  return Object.values ? Object.values(A) : Object.keys(A).map(function(e) {
    return A[e];
  });
}
function Z$(A, e) {
  if (A.findIndex)
    return A.findIndex(e);
  for (var t = 0; t < A.length; t++)
    if (e(A[t]))
      return t;
  return -1;
}
function Nd(A, e) {
  if (A.find)
    return A.find(e);
  var t = Z$(A, e);
  if (t !== -1)
    return A[t];
}
function yJA(A) {
  return Array.prototype.slice.call(A);
}
var bJA = Lo(function(A) {
  return A.reduce(function(e, t) {
    return e[t.descriptor.id] = t, e;
  }, {});
}), wJA = Lo(function(A) {
  return A.reduce(function(e, t) {
    return e[t.descriptor.id] = t, e;
  }, {});
}), KK = Lo(function(A) {
  return pH(A);
}), aee = Lo(function(A) {
  return pH(A);
}), dD = Lo(function(A, e) {
  var t = aee(e).filter(function(i) {
    return A === i.descriptor.droppableId;
  }).sort(function(i, n) {
    return i.descriptor.index - n.descriptor.index;
  });
  return t;
});
function W$(A) {
  return A.at && A.at.type === "REORDER" ? A.at.destination : null;
}
function UK(A) {
  return A.at && A.at.type === "COMBINE" ? A.at.combine : null;
}
var VK = Lo(function(A, e) {
  return e.filter(function(t) {
    return t.descriptor.id !== A.descriptor.id;
  });
}), ree = function(A) {
  var e = A.isMovingForward, t = A.draggable, i = A.destination, n = A.insideDestination, o = A.previousImpact;
  if (!i.isCombineEnabled)
    return null;
  var g = W$(o);
  if (!g)
    return null;
  function s(E) {
    var d = {
      type: "COMBINE",
      combine: {
        draggableId: E,
        droppableId: i.descriptor.id
      }
    };
    return rt({}, o, {
      at: d
    });
  }
  var I = o.displaced.all, r = I.length ? I[0] : null;
  if (e)
    return r ? s(r) : null;
  var a = VK(t, n);
  if (!r) {
    if (!a.length)
      return null;
    var C = a[a.length - 1];
    return s(C.descriptor.id);
  }
  var B = Z$(a, function(E) {
    return E.descriptor.id === r;
  });
  B === -1 && ae(!1);
  var l = B - 1;
  if (l < 0)
    return null;
  var Q = a[l];
  return s(Q.descriptor.id);
}, hD = function(A, e) {
  return A.descriptor.droppableId === e.descriptor.id;
}, fJA = {
  point: Zo,
  value: 0
}, uY = {
  invisible: {},
  visible: {},
  all: []
}, Cee = {
  displaced: uY,
  displacedBy: fJA,
  at: null
}, Xa = function(A, e) {
  return function(t) {
    return A <= t && t <= e;
  };
}, DJA = function(A) {
  var e = Xa(A.top, A.bottom), t = Xa(A.left, A.right);
  return function(i) {
    var n = e(i.top) && e(i.bottom) && t(i.left) && t(i.right);
    if (n)
      return !0;
    var o = e(i.top) || e(i.bottom), g = t(i.left) || t(i.right), s = o && g;
    if (s)
      return !0;
    var I = i.top < A.top && i.bottom > A.bottom, r = i.left < A.left && i.right > A.right, a = I && r;
    if (a)
      return !0;
    var C = I && g || r && o;
    return C;
  };
}, Bee = function(A) {
  var e = Xa(A.top, A.bottom), t = Xa(A.left, A.right);
  return function(i) {
    var n = e(i.top) && e(i.bottom) && t(i.left) && t(i.right);
    return n;
  };
}, K$ = {
  direction: "vertical",
  line: "y",
  crossAxisLine: "x",
  start: "top",
  end: "bottom",
  size: "height",
  crossAxisStart: "left",
  crossAxisEnd: "right",
  crossAxisSize: "width"
}, GJA = {
  direction: "horizontal",
  line: "x",
  crossAxisLine: "y",
  start: "left",
  end: "right",
  size: "width",
  crossAxisStart: "top",
  crossAxisEnd: "bottom",
  crossAxisSize: "height"
}, lee = function(A) {
  return function(e) {
    var t = Xa(e.top, e.bottom), i = Xa(e.left, e.right);
    return function(n) {
      return A === K$ ? t(n.top) && t(n.bottom) : i(n.left) && i(n.right);
    };
  };
}, cee = function(A, e) {
  var t = e.frame ? e.frame.scroll.diff.displacement : Zo;
  return uR(A, t);
}, Qee = function(A, e, t) {
  return e.subject.active ? t(e.subject.active)(A) : !1;
}, Eee = function(A, e, t) {
  return t(e)(A);
}, U$ = function(A) {
  var e = A.target, t = A.destination, i = A.viewport, n = A.withDroppableDisplacement, o = A.isVisibleThroughFrameFn, g = n ? cee(e, t) : e;
  return Qee(g, t, o) && Eee(g, i, o);
}, uee = function(A) {
  return U$(rt({}, A, {
    isVisibleThroughFrameFn: DJA
  }));
}, kJA = function(A) {
  return U$(rt({}, A, {
    isVisibleThroughFrameFn: Bee
  }));
}, dee = function(A) {
  return U$(rt({}, A, {
    isVisibleThroughFrameFn: lee(A.destination.axis)
  }));
}, hee = function(A, e, t) {
  if (typeof t == "boolean")
    return t;
  if (!e)
    return !0;
  var i = e.invisible, n = e.visible;
  if (i[A])
    return !1;
  var o = n[A];
  return o ? o.shouldAnimate : !0;
};
function mee(A, e) {
  var t = A.page.marginBox, i = {
    top: e.point.y,
    right: 0,
    bottom: 0,
    left: e.point.x
  };
  return Tr(L$(t, i));
}
function dY(A) {
  var e = A.afterDragging, t = A.destination, i = A.displacedBy, n = A.viewport, o = A.forceShouldAnimate, g = A.last;
  return e.reduce(function(s, I) {
    var r = mee(I, i), a = I.descriptor.id;
    s.all.push(a);
    var C = uee({
      target: r,
      destination: t,
      viewport: n,
      withDroppableDisplacement: !0
    });
    if (!C)
      return s.invisible[I.descriptor.id] = !0, s;
    var B = hee(a, g, o), l = {
      draggableId: a,
      shouldAnimate: B
    };
    return s.visible[a] = l, s;
  }, {
    all: [],
    visible: {},
    invisible: {}
  });
}
function pee(A, e) {
  if (!A.length)
    return 0;
  var t = A[A.length - 1].descriptor.index;
  return e.inHomeList ? t : t + 1;
}
function qCA(A) {
  var e = A.insideDestination, t = A.inHomeList, i = A.displacedBy, n = A.destination, o = pee(e, {
    inHomeList: t
  });
  return {
    displaced: uY,
    displacedBy: i,
    at: {
      type: "REORDER",
      destination: {
        droppableId: n.descriptor.id,
        index: o
      }
    }
  };
}
function yH(A) {
  var e = A.draggable, t = A.insideDestination, i = A.destination, n = A.viewport, o = A.displacedBy, g = A.last, s = A.index, I = A.forceShouldAnimate, r = hD(e, i);
  if (s == null)
    return qCA({
      insideDestination: t,
      inHomeList: r,
      displacedBy: o,
      destination: i
    });
  var a = Nd(t, function(E) {
    return E.descriptor.index === s;
  });
  if (!a)
    return qCA({
      insideDestination: t,
      inHomeList: r,
      displacedBy: o,
      destination: i
    });
  var C = VK(e, t), B = t.indexOf(a), l = C.slice(B), Q = dY({
    afterDragging: l,
    destination: i,
    displacedBy: o,
    last: g,
    viewport: n.frame,
    forceShouldAnimate: I
  });
  return {
    displaced: Q,
    displacedBy: o,
    at: {
      type: "REORDER",
      destination: {
        droppableId: i.descriptor.id,
        index: s
      }
    }
  };
}
function Su(A, e) {
  return !!e.effected[A];
}
var yee = function(A) {
  var e = A.isMovingForward, t = A.destination, i = A.draggables, n = A.combine, o = A.afterCritical;
  if (!t.isCombineEnabled)
    return null;
  var g = n.draggableId, s = i[g], I = s.descriptor.index, r = Su(g, o);
  return r ? e ? I : I - 1 : e ? I + 1 : I;
}, bee = function(A) {
  var e = A.isMovingForward, t = A.isInHomeList, i = A.insideDestination, n = A.location;
  if (!i.length)
    return null;
  var o = n.index, g = e ? o + 1 : o - 1, s = i[0].descriptor.index, I = i[i.length - 1].descriptor.index, r = t ? I : I + 1;
  return g < s || g > r ? null : g;
}, wee = function(A) {
  var e = A.isMovingForward, t = A.isInHomeList, i = A.draggable, n = A.draggables, o = A.destination, g = A.insideDestination, s = A.previousImpact, I = A.viewport, r = A.afterCritical, a = s.at;
  if (a || ae(!1), a.type === "REORDER") {
    var C = bee({
      isMovingForward: e,
      isInHomeList: t,
      location: a.destination,
      insideDestination: g
    });
    return C == null ? null : yH({
      draggable: i,
      insideDestination: g,
      destination: o,
      viewport: I,
      last: s.displaced,
      displacedBy: s.displacedBy,
      index: C
    });
  }
  var B = yee({
    isMovingForward: e,
    destination: o,
    displaced: s.displaced,
    draggables: n,
    combine: a.combine,
    afterCritical: r
  });
  return B == null ? null : yH({
    draggable: i,
    insideDestination: g,
    destination: o,
    viewport: I,
    last: s.displaced,
    displacedBy: s.displacedBy,
    index: B
  });
}, fee = function(A) {
  var e = A.displaced, t = A.afterCritical, i = A.combineWith, n = A.displacedBy, o = !!(e.visible[i] || e.invisible[i]);
  return Su(i, t) ? o ? Zo : uD(n.point) : o ? n.point : Zo;
}, Dee = function(A) {
  var e = A.afterCritical, t = A.impact, i = A.draggables, n = UK(t);
  n || ae(!1);
  var o = n.draggableId, g = i[o].page.borderBox.center, s = fee({
    displaced: t.displaced,
    afterCritical: e,
    combineWith: o,
    displacedBy: t.displacedBy
  });
  return Oo(g, s);
}, JJA = function(A, e) {
  return e.margin[A.start] + e.borderBox[A.size] / 2;
}, Gee = function(A, e) {
  return e.margin[A.end] + e.borderBox[A.size] / 2;
}, V$ = function(A, e, t) {
  return e[A.crossAxisStart] + t.margin[A.crossAxisStart] + t.borderBox[A.crossAxisSize] / 2;
}, OCA = function(A) {
  var e = A.axis, t = A.moveRelativeTo, i = A.isMoving;
  return Ap(e.line, t.marginBox[e.end] + JJA(e, i), V$(e, t.marginBox, i));
}, jCA = function(A) {
  var e = A.axis, t = A.moveRelativeTo, i = A.isMoving;
  return Ap(e.line, t.marginBox[e.start] - Gee(e, i), V$(e, t.marginBox, i));
}, kee = function(A) {
  var e = A.axis, t = A.moveInto, i = A.isMoving;
  return Ap(e.line, t.contentBox[e.start] + JJA(e, i), V$(e, t.contentBox, i));
}, Jee = function(A) {
  var e = A.impact, t = A.draggable, i = A.draggables, n = A.droppable, o = A.afterCritical, g = dD(n.descriptor.id, i), s = t.page, I = n.axis;
  if (!g.length)
    return kee({
      axis: I,
      moveInto: n.page,
      isMoving: s
    });
  var r = e.displaced, a = e.displacedBy, C = r.all[0];
  if (C) {
    var B = i[C];
    if (Su(C, o))
      return jCA({
        axis: I,
        moveRelativeTo: B.page,
        isMoving: s
      });
    var l = uH(B.page, a.point);
    return jCA({
      axis: I,
      moveRelativeTo: l,
      isMoving: s
    });
  }
  var Q = g[g.length - 1];
  if (Q.descriptor.id === t.descriptor.id)
    return s.borderBox.center;
  if (Su(Q.descriptor.id, o)) {
    var E = uH(Q.page, uD(o.displacedBy.point));
    return OCA({
      axis: I,
      moveRelativeTo: E,
      isMoving: s
    });
  }
  return OCA({
    axis: I,
    moveRelativeTo: Q.page,
    isMoving: s
  });
}, lq = function(A, e) {
  var t = A.frame;
  return t ? Oo(e, t.scroll.diff.displacement) : e;
}, Nee = function(A) {
  var e = A.impact, t = A.draggable, i = A.droppable, n = A.draggables, o = A.afterCritical, g = t.page.borderBox.center, s = e.at;
  return !i || !s ? g : s.type === "REORDER" ? Jee({
    impact: e,
    draggable: t,
    draggables: n,
    droppable: i,
    afterCritical: o
  }) : Dee({
    impact: e,
    draggables: n,
    afterCritical: o
  });
}, XK = function(A) {
  var e = Nee(A), t = A.droppable, i = t ? lq(t, e) : e;
  return i;
}, NJA = function(A, e) {
  var t = LI(e, A.scroll.initial), i = uD(t), n = Tr({
    top: e.y,
    bottom: e.y + A.frame.height,
    left: e.x,
    right: e.x + A.frame.width
  }), o = {
    frame: n,
    scroll: {
      initial: A.scroll.initial,
      max: A.scroll.max,
      current: e,
      diff: {
        value: t,
        displacement: i
      }
    }
  };
  return o;
};
function PCA(A, e) {
  return A.map(function(t) {
    return e[t];
  });
}
function Yee(A, e) {
  for (var t = 0; t < e.length; t++) {
    var i = e[t].visible[A];
    if (i)
      return i;
  }
  return null;
}
var Ree = function(A) {
  var e = A.impact, t = A.viewport, i = A.destination, n = A.draggables, o = A.maxScrollChange, g = NJA(t, Oo(t.scroll.current, o)), s = i.frame ? S$(i, Oo(i.frame.scroll.current, o)) : i, I = e.displaced, r = dY({
    afterDragging: PCA(I.all, n),
    destination: i,
    displacedBy: e.displacedBy,
    viewport: g.frame,
    last: I,
    forceShouldAnimate: !1
  }), a = dY({
    afterDragging: PCA(I.all, n),
    destination: s,
    displacedBy: e.displacedBy,
    viewport: t.frame,
    last: I,
    forceShouldAnimate: !1
  }), C = {}, B = {}, l = [I, r, a];
  I.all.forEach(function(E) {
    var d = Yee(E, l);
    if (d) {
      B[E] = d;
      return;
    }
    C[E] = !0;
  });
  var Q = rt({}, e, {
    displaced: {
      all: I.all,
      invisible: C,
      visible: B
    }
  });
  return Q;
}, Fee = function(A, e) {
  return Oo(A.scroll.diff.displacement, e);
}, X$ = function(A) {
  var e = A.pageBorderBoxCenter, t = A.draggable, i = A.viewport, n = Fee(i, e), o = LI(n, t.page.borderBox.center);
  return Oo(t.client.borderBox.center, o);
}, YJA = function(A) {
  var e = A.draggable, t = A.destination, i = A.newPageBorderBoxCenter, n = A.viewport, o = A.withDroppableDisplacement, g = A.onlyOnMainAxis, s = g === void 0 ? !1 : g, I = LI(i, e.page.borderBox.center), r = uR(e.page.borderBox, I), a = {
    target: r,
    destination: t,
    withDroppableDisplacement: o,
    viewport: n
  };
  return s ? dee(a) : kJA(a);
}, Mee = function(A) {
  var e = A.isMovingForward, t = A.draggable, i = A.destination, n = A.draggables, o = A.previousImpact, g = A.viewport, s = A.previousPageBorderBoxCenter, I = A.previousClientSelection, r = A.afterCritical;
  if (!i.isEnabled)
    return null;
  var a = dD(i.descriptor.id, n), C = hD(t, i), B = ree({
    isMovingForward: e,
    draggable: t,
    destination: i,
    insideDestination: a,
    previousImpact: o
  }) || wee({
    isMovingForward: e,
    isInHomeList: C,
    draggable: t,
    draggables: n,
    destination: i,
    insideDestination: a,
    previousImpact: o,
    viewport: g,
    afterCritical: r
  });
  if (!B)
    return null;
  var l = XK({
    impact: B,
    draggable: t,
    droppable: i,
    draggables: n,
    afterCritical: r
  }), Q = YJA({
    draggable: t,
    destination: i,
    newPageBorderBoxCenter: l,
    viewport: g.frame,
    withDroppableDisplacement: !1,
    onlyOnMainAxis: !0
  });
  if (Q) {
    var E = X$({
      pageBorderBoxCenter: l,
      draggable: t,
      viewport: g
    });
    return {
      clientSelection: E,
      impact: B,
      scrollJumpRequest: null
    };
  }
  var d = LI(l, s), m = Ree({
    impact: B,
    viewport: g,
    destination: i,
    draggables: n,
    maxScrollChange: d
  });
  return {
    clientSelection: I,
    impact: m,
    scrollJumpRequest: d
  };
}, Wg = function(A) {
  var e = A.subject.active;
  return e || ae(!1), e;
}, xee = function(A) {
  var e = A.isMovingForward, t = A.pageBorderBoxCenter, i = A.source, n = A.droppables, o = A.viewport, g = i.subject.active;
  if (!g)
    return null;
  var s = i.axis, I = Xa(g[s.start], g[s.end]), r = KK(n).filter(function(C) {
    return C !== i;
  }).filter(function(C) {
    return C.isEnabled;
  }).filter(function(C) {
    return !!C.subject.active;
  }).filter(function(C) {
    return DJA(o.frame)(Wg(C));
  }).filter(function(C) {
    var B = Wg(C);
    return e ? g[s.crossAxisEnd] < B[s.crossAxisEnd] : B[s.crossAxisStart] < g[s.crossAxisStart];
  }).filter(function(C) {
    var B = Wg(C), l = Xa(B[s.start], B[s.end]);
    return I(B[s.start]) || I(B[s.end]) || l(g[s.start]) || l(g[s.end]);
  }).sort(function(C, B) {
    var l = Wg(C)[s.crossAxisStart], Q = Wg(B)[s.crossAxisStart];
    return e ? l - Q : Q - l;
  }).filter(function(C, B, l) {
    return Wg(C)[s.crossAxisStart] === Wg(l[0])[s.crossAxisStart];
  });
  if (!r.length)
    return null;
  if (r.length === 1)
    return r[0];
  var a = r.filter(function(C) {
    var B = Xa(Wg(C)[s.start], Wg(C)[s.end]);
    return B(t[s.line]);
  });
  return a.length === 1 ? a[0] : a.length > 1 ? a.sort(function(C, B) {
    return Wg(C)[s.start] - Wg(B)[s.start];
  })[0] : r.sort(function(C, B) {
    var l = TCA(t, _CA(Wg(C))), Q = TCA(t, _CA(Wg(B)));
    return l !== Q ? l - Q : Wg(C)[s.start] - Wg(B)[s.start];
  })[0];
}, $CA = function(A, e) {
  var t = A.page.borderBox.center;
  return Su(A.descriptor.id, e) ? LI(t, e.displacedBy.point) : t;
}, Lee = function(A, e) {
  var t = A.page.borderBox;
  return Su(A.descriptor.id, e) ? uR(t, uD(e.displacedBy.point)) : t;
}, vee = function(A) {
  var e = A.pageBorderBoxCenter, t = A.viewport, i = A.destination, n = A.insideDestination, o = A.afterCritical, g = n.filter(function(s) {
    return kJA({
      target: Lee(s, o),
      destination: i,
      viewport: t.frame,
      withDroppableDisplacement: !0
    });
  }).sort(function(s, I) {
    var r = EY(e, lq(i, $CA(s, o))), a = EY(e, lq(i, $CA(I, o)));
    return r < a ? -1 : a < r ? 1 : s.descriptor.index - I.descriptor.index;
  });
  return g[0] || null;
}, dR = Lo(function(A, e) {
  var t = e[A.line];
  return {
    value: t,
    point: Ap(A.line, t)
  };
}), Hee = function(A, e, t) {
  var i = A.axis;
  if (A.descriptor.mode === "virtual")
    return Ap(i.line, e[i.line]);
  var n = A.subject.page.contentBox[i.size], o = dD(A.descriptor.id, t), g = o.reduce(function(r, a) {
    return r + a.client.marginBox[i.size];
  }, 0), s = g + e[i.line], I = s - n;
  return I <= 0 ? null : Ap(i.line, I);
}, RJA = function(A, e) {
  return rt({}, A, {
    scroll: rt({}, A.scroll, {
      max: e
    })
  });
}, FJA = function(A, e, t) {
  var i = A.frame;
  hD(e, A) && ae(!1), A.subject.withPlaceholder && ae(!1);
  var n = dR(A.axis, e.displaceBy).point, o = Hee(A, n, t), g = {
    placeholderSize: n,
    increasedBy: o,
    oldFrameMaxScroll: A.frame ? A.frame.scroll.max : null
  };
  if (!i) {
    var s = Ow({
      page: A.subject.page,
      withPlaceholder: g,
      axis: A.axis,
      frame: A.frame
    });
    return rt({}, A, {
      subject: s
    });
  }
  var I = o ? Oo(i.scroll.max, o) : i.scroll.max, r = RJA(i, I), a = Ow({
    page: A.subject.page,
    withPlaceholder: g,
    axis: A.axis,
    frame: r
  });
  return rt({}, A, {
    subject: a,
    frame: r
  });
}, See = function(A) {
  var e = A.subject.withPlaceholder;
  e || ae(!1);
  var t = A.frame;
  if (!t) {
    var i = Ow({
      page: A.subject.page,
      axis: A.axis,
      frame: null,
      withPlaceholder: null
    });
    return rt({}, A, {
      subject: i
    });
  }
  var n = e.oldFrameMaxScroll;
  n || ae(!1);
  var o = RJA(t, n), g = Ow({
    page: A.subject.page,
    axis: A.axis,
    frame: o,
    withPlaceholder: null
  });
  return rt({}, A, {
    subject: g,
    frame: o
  });
}, Zee = function(A) {
  var e = A.previousPageBorderBoxCenter, t = A.moveRelativeTo, i = A.insideDestination, n = A.draggable, o = A.draggables, g = A.destination, s = A.viewport, I = A.afterCritical;
  if (!t) {
    if (i.length)
      return null;
    var r = {
      displaced: uY,
      displacedBy: fJA,
      at: {
        type: "REORDER",
        destination: {
          droppableId: g.descriptor.id,
          index: 0
        }
      }
    }, a = XK({
      impact: r,
      draggable: n,
      droppable: g,
      draggables: o,
      afterCritical: I
    }), C = hD(n, g) ? g : FJA(g, n, o), B = YJA({
      draggable: n,
      destination: C,
      newPageBorderBoxCenter: a,
      viewport: s.frame,
      withDroppableDisplacement: !1,
      onlyOnMainAxis: !0
    });
    return B ? r : null;
  }
  var l = e[g.axis.line] <= t.page.borderBox.center[g.axis.line], Q = function() {
    var d = t.descriptor.index;
    return t.descriptor.id === n.descriptor.id || l ? d : d + 1;
  }(), E = dR(g.axis, n.displaceBy);
  return yH({
    draggable: n,
    insideDestination: i,
    destination: g,
    viewport: s,
    displacedBy: E,
    last: uY,
    index: Q
  });
}, Wee = function(A) {
  var e = A.isMovingForward, t = A.previousPageBorderBoxCenter, i = A.draggable, n = A.isOver, o = A.draggables, g = A.droppables, s = A.viewport, I = A.afterCritical, r = xee({
    isMovingForward: e,
    pageBorderBoxCenter: t,
    source: n,
    droppables: g,
    viewport: s
  });
  if (!r)
    return null;
  var a = dD(r.descriptor.id, o), C = vee({
    pageBorderBoxCenter: t,
    viewport: s,
    destination: r,
    insideDestination: a,
    afterCritical: I
  }), B = Zee({
    previousPageBorderBoxCenter: t,
    destination: r,
    draggable: i,
    draggables: o,
    moveRelativeTo: C,
    insideDestination: a,
    viewport: s,
    afterCritical: I
  });
  if (!B)
    return null;
  var l = XK({
    impact: B,
    draggable: i,
    droppable: r,
    draggables: o,
    afterCritical: I
  }), Q = X$({
    pageBorderBoxCenter: l,
    draggable: i,
    viewport: s
  });
  return {
    clientSelection: Q,
    impact: B,
    scrollJumpRequest: null
  };
}, UI = function(A) {
  var e = A.at;
  return e ? e.type === "REORDER" ? e.destination.droppableId : e.combine.droppableId : null;
}, Kee = function(A, e) {
  var t = UI(A);
  return t ? e[t] : null;
}, Uee = function(A) {
  var e = A.state, t = A.type, i = Kee(e.impact, e.dimensions.droppables), n = !!i, o = e.dimensions.droppables[e.critical.droppable.id], g = i || o, s = g.axis.direction, I = s === "vertical" && (t === "MOVE_UP" || t === "MOVE_DOWN") || s === "horizontal" && (t === "MOVE_LEFT" || t === "MOVE_RIGHT");
  if (I && !n)
    return null;
  var r = t === "MOVE_DOWN" || t === "MOVE_RIGHT", a = e.dimensions.draggables[e.critical.draggable.id], C = e.current.page.borderBoxCenter, B = e.dimensions, l = B.draggables, Q = B.droppables;
  return I ? Mee({
    isMovingForward: r,
    previousPageBorderBoxCenter: C,
    draggable: a,
    destination: g,
    draggables: l,
    viewport: e.viewport,
    previousClientSelection: e.current.client.selection,
    previousImpact: e.impact,
    afterCritical: e.afterCritical
  }) : Wee({
    isMovingForward: r,
    previousPageBorderBoxCenter: C,
    draggable: a,
    isOver: g,
    draggables: l,
    droppables: Q,
    viewport: e.viewport,
    afterCritical: e.afterCritical
  });
};
function Kh(A) {
  return A.phase === "DRAGGING" || A.phase === "COLLECTING";
}
function MJA(A) {
  var e = Xa(A.top, A.bottom), t = Xa(A.left, A.right);
  return function(i) {
    return e(i.y) && t(i.x);
  };
}
function Vee(A, e) {
  return A.left < e.right && A.right > e.left && A.top < e.bottom && A.bottom > e.top;
}
function Xee(A) {
  var e = A.pageBorderBox, t = A.draggable, i = A.candidates, n = t.page.borderBox.center, o = i.map(function(g) {
    var s = g.axis, I = Ap(g.axis.line, e.center[s.line], g.page.borderBox.center[s.crossAxisLine]);
    return {
      id: g.descriptor.id,
      distance: EY(n, I)
    };
  }).sort(function(g, s) {
    return s.distance - g.distance;
  });
  return o[0] ? o[0].id : null;
}
function zee(A) {
  var e = A.pageBorderBox, t = A.draggable, i = A.droppables, n = KK(i).filter(function(o) {
    if (!o.isEnabled)
      return !1;
    var g = o.subject.active;
    if (!g || !Vee(e, g))
      return !1;
    if (MJA(g)(e.center))
      return !0;
    var s = o.axis, I = g.center[s.crossAxisLine], r = e[s.crossAxisStart], a = e[s.crossAxisEnd], C = Xa(g[s.crossAxisStart], g[s.crossAxisEnd]), B = C(r), l = C(a);
    return !B && !l ? !0 : B ? r < I : a > I;
  });
  return n.length ? n.length === 1 ? n[0].descriptor.id : Xee({
    pageBorderBox: e,
    draggable: t,
    candidates: n
  }) : null;
}
var xJA = function(A, e) {
  return Tr(uR(A, e));
}, Tee = function(A, e) {
  var t = A.frame;
  return t ? xJA(e, t.scroll.diff.value) : e;
};
function LJA(A) {
  var e = A.displaced, t = A.id;
  return !!(e.visible[t] || e.invisible[t]);
}
function _ee(A) {
  var e = A.draggable, t = A.closest, i = A.inHomeList;
  return t ? i && t.descriptor.index > e.descriptor.index ? t.descriptor.index - 1 : t.descriptor.index : null;
}
var qee = function(A) {
  var e = A.pageBorderBoxWithDroppableScroll, t = A.draggable, i = A.destination, n = A.insideDestination, o = A.last, g = A.viewport, s = A.afterCritical, I = i.axis, r = dR(i.axis, t.displaceBy), a = r.value, C = e[I.start], B = e[I.end], l = VK(t, n), Q = Nd(l, function(d) {
    var m = d.descriptor.id, y = d.page.borderBox.center[I.line], f = Su(m, s), w = LJA({
      displaced: o,
      id: m
    });
    return f ? w ? B <= y : C < y - a : w ? B <= y + a : C < y;
  }), E = _ee({
    draggable: t,
    closest: Q,
    inHomeList: hD(t, i)
  });
  return yH({
    draggable: t,
    insideDestination: n,
    destination: i,
    viewport: g,
    last: o,
    displacedBy: r,
    index: E
  });
}, Oee = 4, jee = function(A) {
  var e = A.draggable, t = A.pageBorderBoxWithDroppableScroll, i = A.previousImpact, n = A.destination, o = A.insideDestination, g = A.afterCritical;
  if (!n.isCombineEnabled)
    return null;
  var s = n.axis, I = dR(n.axis, e.displaceBy), r = I.value, a = t[s.start], C = t[s.end], B = VK(e, o), l = Nd(B, function(E) {
    var d = E.descriptor.id, m = E.page.borderBox, y = m[s.size], f = y / Oee, w = Su(d, g), G = LJA({
      displaced: i.displaced,
      id: d
    });
    return w ? G ? C > m[s.start] + f && C < m[s.end] - f : a > m[s.start] - r + f && a < m[s.end] - r - f : G ? C > m[s.start] + r + f && C < m[s.end] + r - f : a > m[s.start] + f && a < m[s.end] - f;
  });
  if (!l)
    return null;
  var Q = {
    displacedBy: I,
    displaced: i.displaced,
    at: {
      type: "COMBINE",
      combine: {
        draggableId: l.descriptor.id,
        droppableId: n.descriptor.id
      }
    }
  };
  return Q;
}, vJA = function(A) {
  var e = A.pageOffset, t = A.draggable, i = A.draggables, n = A.droppables, o = A.previousImpact, g = A.viewport, s = A.afterCritical, I = xJA(t.page.borderBox, e), r = zee({
    pageBorderBox: I,
    draggable: t,
    droppables: n
  });
  if (!r)
    return Cee;
  var a = n[r], C = dD(a.descriptor.id, i), B = Tee(a, I);
  return jee({
    pageBorderBoxWithDroppableScroll: B,
    draggable: t,
    previousImpact: o,
    destination: a,
    insideDestination: C,
    afterCritical: s
  }) || qee({
    pageBorderBoxWithDroppableScroll: B,
    draggable: t,
    destination: a,
    insideDestination: C,
    last: o.displaced,
    viewport: g,
    afterCritical: s
  });
}, z$ = function(A, e) {
  var t;
  return rt({}, A, (t = {}, t[e.descriptor.id] = e, t));
}, Pee = function(A) {
  var e = A.previousImpact, t = A.impact, i = A.droppables, n = UI(e), o = UI(t);
  if (!n || n === o)
    return i;
  var g = i[n];
  if (!g.subject.withPlaceholder)
    return i;
  var s = See(g);
  return z$(i, s);
}, $ee = function(A) {
  var e = A.draggable, t = A.draggables, i = A.droppables, n = A.previousImpact, o = A.impact, g = Pee({
    previousImpact: n,
    impact: o,
    droppables: i
  }), s = UI(o);
  if (!s)
    return g;
  var I = i[s];
  if (hD(e, I) || I.subject.withPlaceholder)
    return g;
  var r = FJA(I, e, t);
  return z$(g, r);
}, rN = function(A) {
  var e = A.state, t = A.clientSelection, i = A.dimensions, n = A.viewport, o = A.impact, g = A.scrollJumpRequest, s = n || e.viewport, I = i || e.dimensions, r = t || e.current.client.selection, a = LI(r, e.initial.client.selection), C = {
    offset: a,
    selection: r,
    borderBoxCenter: Oo(e.initial.client.borderBoxCenter, a)
  }, B = {
    selection: Oo(C.selection, s.scroll.current),
    borderBoxCenter: Oo(C.borderBoxCenter, s.scroll.current),
    offset: Oo(C.offset, s.scroll.diff.value)
  }, l = {
    client: C,
    page: B
  };
  if (e.phase === "COLLECTING")
    return rt({
      phase: "COLLECTING"
    }, e, {
      dimensions: I,
      viewport: s,
      current: l
    });
  var Q = I.draggables[e.critical.draggable.id], E = o || vJA({
    pageOffset: B.offset,
    draggable: Q,
    draggables: I.draggables,
    droppables: I.droppables,
    previousImpact: e.impact,
    viewport: s,
    afterCritical: e.afterCritical
  }), d = $ee({
    draggable: Q,
    impact: E,
    previousImpact: e.impact,
    draggables: I.draggables,
    droppables: I.droppables
  }), m = rt({}, e, {
    current: l,
    dimensions: {
      draggables: I.draggables,
      droppables: d
    },
    impact: E,
    viewport: s,
    scrollJumpRequest: g || null,
    forceShouldAnimate: g ? !1 : null
  });
  return m;
};
function Ate(A, e) {
  return A.map(function(t) {
    return e[t];
  });
}
var HJA = function(A) {
  var e = A.impact, t = A.viewport, i = A.draggables, n = A.destination, o = A.forceShouldAnimate, g = e.displaced, s = Ate(g.all, i), I = dY({
    afterDragging: s,
    destination: n,
    displacedBy: e.displacedBy,
    viewport: t.frame,
    forceShouldAnimate: o,
    last: g
  });
  return rt({}, e, {
    displaced: I
  });
}, SJA = function(A) {
  var e = A.impact, t = A.draggable, i = A.droppable, n = A.draggables, o = A.viewport, g = A.afterCritical, s = XK({
    impact: e,
    draggable: t,
    draggables: n,
    droppable: i,
    afterCritical: g
  });
  return X$({
    pageBorderBoxCenter: s,
    draggable: t,
    viewport: o
  });
}, ZJA = function(A) {
  var e = A.state, t = A.dimensions, i = A.viewport;
  e.movementMode !== "SNAP" && ae(!1);
  var n = e.impact, o = i || e.viewport, g = t || e.dimensions, s = g.draggables, I = g.droppables, r = s[e.critical.draggable.id], a = UI(n);
  a || ae(!1);
  var C = I[a], B = HJA({
    impact: n,
    viewport: o,
    destination: C,
    draggables: s
  }), l = SJA({
    impact: B,
    draggable: r,
    droppable: C,
    draggables: s,
    viewport: o,
    afterCritical: e.afterCritical
  });
  return rN({
    impact: B,
    clientSelection: l,
    state: e,
    dimensions: g,
    viewport: o
  });
}, ete = function(A) {
  return {
    index: A.index,
    droppableId: A.droppableId
  };
}, WJA = function(A) {
  var e = A.draggable, t = A.home, i = A.draggables, n = A.viewport, o = dR(t.axis, e.displaceBy), g = dD(t.descriptor.id, i), s = g.indexOf(e);
  s === -1 && ae(!1);
  var I = g.slice(s + 1), r = I.reduce(function(l, Q) {
    return l[Q.descriptor.id] = !0, l;
  }, {}), a = {
    inVirtualList: t.descriptor.mode === "virtual",
    displacedBy: o,
    effected: r
  }, C = dY({
    afterDragging: I,
    destination: t,
    displacedBy: o,
    last: null,
    viewport: n.frame,
    forceShouldAnimate: !1
  }), B = {
    displaced: C,
    displacedBy: o,
    at: {
      type: "REORDER",
      destination: ete(e.descriptor)
    }
  };
  return {
    impact: B,
    afterCritical: a
  };
}, tte = function(A, e) {
  return {
    draggables: A.draggables,
    droppables: z$(A.droppables, e)
  };
}, ite = function(A) {
  var e = A.draggable, t = A.offset, i = A.initialWindowScroll, n = uH(e.client, t), o = dH(n, i), g = rt({}, e, {
    placeholder: rt({}, e.placeholder, {
      client: n
    }),
    client: n,
    page: o
  });
  return g;
}, nte = function(A) {
  var e = A.frame;
  return e || ae(!1), e;
}, ote = function(A) {
  var e = A.additions, t = A.updatedDroppables, i = A.viewport, n = i.scroll.diff.value;
  return e.map(function(o) {
    var g = o.descriptor.droppableId, s = t[g], I = nte(s), r = I.scroll.diff.value, a = Oo(n, r), C = ite({
      draggable: o,
      offset: a,
      initialWindowScroll: i.scroll.initial
    });
    return C;
  });
}, gte = function(A) {
  var e = A.state, t = A.published, i = t.modified.map(function(f) {
    var w = e.dimensions.droppables[f.droppableId], G = S$(w, f.scroll);
    return G;
  }), n = rt({}, e.dimensions.droppables, {}, bJA(i)), o = wJA(ote({
    additions: t.additions,
    updatedDroppables: n,
    viewport: e.viewport
  })), g = rt({}, e.dimensions.draggables, {}, o);
  t.removals.forEach(function(f) {
    delete g[f];
  });
  var s = {
    droppables: n,
    draggables: g
  }, I = UI(e.impact), r = I ? s.droppables[I] : null, a = s.draggables[e.critical.draggable.id], C = s.droppables[e.critical.droppable.id], B = WJA({
    draggable: a,
    home: C,
    draggables: g,
    viewport: e.viewport
  }), l = B.impact, Q = B.afterCritical, E = r && r.isCombineEnabled ? e.impact : l, d = vJA({
    pageOffset: e.current.page.offset,
    draggable: s.draggables[e.critical.draggable.id],
    draggables: s.draggables,
    droppables: s.droppables,
    previousImpact: E,
    viewport: e.viewport,
    afterCritical: Q
  }), m = rt({
    phase: "DRAGGING"
  }, e, {
    phase: "DRAGGING",
    impact: d,
    onLiftImpact: l,
    dimensions: s,
    afterCritical: Q,
    forceShouldAnimate: !1
  });
  if (e.phase === "COLLECTING")
    return m;
  var y = rt({
    phase: "DROP_PENDING"
  }, m, {
    phase: "DROP_PENDING",
    reason: e.reason,
    isWaiting: !1
  });
  return y;
}, cq = function(A) {
  return A.movementMode === "SNAP";
}, i5 = function(A, e, t) {
  var i = tte(A.dimensions, e);
  return !cq(A) || t ? rN({
    state: A,
    dimensions: i
  }) : ZJA({
    state: A,
    dimensions: i
  });
};
function ABA(A) {
  return A.isDragging && A.movementMode === "SNAP" ? rt({
    phase: "DRAGGING"
  }, A, {
    scrollJumpRequest: null
  }) : A;
}
var eBA = {
  phase: "IDLE",
  completed: null,
  shouldFlush: !1
}, ste = function(A, e) {
  if (A === void 0 && (A = eBA), e.type === "FLUSH")
    return rt({}, eBA, {
      shouldFlush: !0
    });
  if (e.type === "INITIAL_PUBLISH") {
    A.phase !== "IDLE" && ae(!1);
    var t = e.payload, i = t.critical, n = t.clientSelection, o = t.viewport, g = t.dimensions, s = t.movementMode, I = g.draggables[i.draggable.id], r = g.droppables[i.droppable.id], a = {
      selection: n,
      borderBoxCenter: I.client.borderBox.center,
      offset: Zo
    }, C = {
      client: a,
      page: {
        selection: Oo(a.selection, o.scroll.initial),
        borderBoxCenter: Oo(a.selection, o.scroll.initial),
        offset: Oo(a.selection, o.scroll.diff.value)
      }
    }, B = KK(g.droppables).every(function(hA) {
      return !hA.isFixedOnPage;
    }), l = WJA({
      draggable: I,
      home: r,
      draggables: g.draggables,
      viewport: o
    }), Q = l.impact, E = l.afterCritical, d = {
      phase: "DRAGGING",
      isDragging: !0,
      critical: i,
      movementMode: s,
      dimensions: g,
      initial: C,
      current: C,
      isWindowScrollAllowed: B,
      impact: Q,
      afterCritical: E,
      onLiftImpact: Q,
      viewport: o,
      scrollJumpRequest: null,
      forceShouldAnimate: null
    };
    return d;
  }
  if (e.type === "COLLECTION_STARTING") {
    if (A.phase === "COLLECTING" || A.phase === "DROP_PENDING")
      return A;
    A.phase !== "DRAGGING" && ae(!1);
    var m = rt({
      phase: "COLLECTING"
    }, A, {
      phase: "COLLECTING"
    });
    return m;
  }
  if (e.type === "PUBLISH_WHILE_DRAGGING")
    return A.phase === "COLLECTING" || A.phase === "DROP_PENDING" || ae(!1), gte({
      state: A,
      published: e.payload
    });
  if (e.type === "MOVE") {
    if (A.phase === "DROP_PENDING")
      return A;
    Kh(A) || ae(!1);
    var y = e.payload.client;
    return hu(y, A.current.client.selection) ? A : rN({
      state: A,
      clientSelection: y,
      impact: cq(A) ? A.impact : null
    });
  }
  if (e.type === "UPDATE_DROPPABLE_SCROLL") {
    if (A.phase === "DROP_PENDING" || A.phase === "COLLECTING")
      return ABA(A);
    Kh(A) || ae(!1);
    var f = e.payload, w = f.id, G = f.newScroll, R = A.dimensions.droppables[w];
    if (!R)
      return A;
    var F = S$(R, G);
    return i5(A, F, !1);
  }
  if (e.type === "UPDATE_DROPPABLE_IS_ENABLED") {
    if (A.phase === "DROP_PENDING")
      return A;
    Kh(A) || ae(!1);
    var Z = e.payload, c = Z.id, J = Z.isEnabled, p = A.dimensions.droppables[c];
    p || ae(!1), p.isEnabled === J && ae(!1);
    var N = rt({}, p, {
      isEnabled: J
    });
    return i5(A, N, !0);
  }
  if (e.type === "UPDATE_DROPPABLE_IS_COMBINE_ENABLED") {
    if (A.phase === "DROP_PENDING")
      return A;
    Kh(A) || ae(!1);
    var v = e.payload, K = v.id, U = v.isCombineEnabled, j = A.dimensions.droppables[K];
    j || ae(!1), j.isCombineEnabled === U && ae(!1);
    var q = rt({}, j, {
      isCombineEnabled: U
    });
    return i5(A, q, !0);
  }
  if (e.type === "MOVE_BY_WINDOW_SCROLL") {
    if (A.phase === "DROP_PENDING" || A.phase === "DROP_ANIMATING")
      return A;
    Kh(A) || ae(!1), A.isWindowScrollAllowed || ae(!1);
    var O = e.payload.newScroll;
    if (hu(A.viewport.scroll.current, O))
      return ABA(A);
    var $ = NJA(A.viewport, O);
    return cq(A) ? ZJA({
      state: A,
      viewport: $
    }) : rN({
      state: A,
      viewport: $
    });
  }
  if (e.type === "UPDATE_VIEWPORT_MAX_SCROLL") {
    if (!Kh(A))
      return A;
    var _ = e.payload.maxScroll;
    if (hu(_, A.viewport.scroll.max))
      return A;
    var tA = rt({}, A.viewport, {
      scroll: rt({}, A.viewport.scroll, {
        max: _
      })
    });
    return rt({
      phase: "DRAGGING"
    }, A, {
      viewport: tA
    });
  }
  if (e.type === "MOVE_UP" || e.type === "MOVE_DOWN" || e.type === "MOVE_LEFT" || e.type === "MOVE_RIGHT") {
    if (A.phase === "COLLECTING" || A.phase === "DROP_PENDING")
      return A;
    A.phase !== "DRAGGING" && ae(!1);
    var nA = Uee({
      state: A,
      type: e.type
    });
    return nA ? rN({
      state: A,
      impact: nA.impact,
      clientSelection: nA.clientSelection,
      scrollJumpRequest: nA.scrollJumpRequest
    }) : A;
  }
  if (e.type === "DROP_PENDING") {
    var AA = e.payload.reason;
    A.phase !== "COLLECTING" && ae(!1);
    var gA = rt({
      phase: "DROP_PENDING"
    }, A, {
      phase: "DROP_PENDING",
      isWaiting: !0,
      reason: AA
    });
    return gA;
  }
  if (e.type === "DROP_ANIMATE") {
    var rA = e.payload, sA = rA.completed, lA = rA.dropDuration, cA = rA.newHomeClientOffset;
    A.phase === "DRAGGING" || A.phase === "DROP_PENDING" || ae(!1);
    var aA = {
      phase: "DROP_ANIMATING",
      completed: sA,
      dropDuration: lA,
      newHomeClientOffset: cA,
      dimensions: A.dimensions
    };
    return aA;
  }
  if (e.type === "DROP_COMPLETE") {
    var QA = e.payload.completed;
    return {
      phase: "IDLE",
      completed: QA,
      shouldFlush: !1
    };
  }
  return A;
}, Ite = function(A) {
  return {
    type: "BEFORE_INITIAL_CAPTURE",
    payload: A
  };
}, ate = function(A) {
  return {
    type: "LIFT",
    payload: A
  };
}, rte = function(A) {
  return {
    type: "INITIAL_PUBLISH",
    payload: A
  };
}, Cte = function(A) {
  return {
    type: "PUBLISH_WHILE_DRAGGING",
    payload: A
  };
}, Bte = function() {
  return {
    type: "COLLECTION_STARTING",
    payload: null
  };
}, lte = function(A) {
  return {
    type: "UPDATE_DROPPABLE_SCROLL",
    payload: A
  };
}, cte = function(A) {
  return {
    type: "UPDATE_DROPPABLE_IS_ENABLED",
    payload: A
  };
}, Qte = function(A) {
  return {
    type: "UPDATE_DROPPABLE_IS_COMBINE_ENABLED",
    payload: A
  };
}, KJA = function(A) {
  return {
    type: "MOVE",
    payload: A
  };
}, Ete = function(A) {
  return {
    type: "MOVE_BY_WINDOW_SCROLL",
    payload: A
  };
}, ute = function(A) {
  return {
    type: "UPDATE_VIEWPORT_MAX_SCROLL",
    payload: A
  };
}, dte = function() {
  return {
    type: "MOVE_UP",
    payload: null
  };
}, hte = function() {
  return {
    type: "MOVE_DOWN",
    payload: null
  };
}, mte = function() {
  return {
    type: "MOVE_RIGHT",
    payload: null
  };
}, pte = function() {
  return {
    type: "MOVE_LEFT",
    payload: null
  };
}, T$ = function() {
  return {
    type: "FLUSH",
    payload: null
  };
}, yte = function(A) {
  return {
    type: "DROP_ANIMATE",
    payload: A
  };
}, _$ = function(A) {
  return {
    type: "DROP_COMPLETE",
    payload: A
  };
}, UJA = function(A) {
  return {
    type: "DROP",
    payload: A
  };
}, bte = function(A) {
  return {
    type: "DROP_PENDING",
    payload: A
  };
}, VJA = function() {
  return {
    type: "DROP_ANIMATION_FINISHED",
    payload: null
  };
}, wte = function(A) {
  return function(e) {
    var t = e.getState, i = e.dispatch;
    return function(n) {
      return function(o) {
        if (o.type !== "LIFT") {
          n(o);
          return;
        }
        var g = o.payload, s = g.id, I = g.clientSelection, r = g.movementMode, a = t();
        a.phase === "DROP_ANIMATING" && i(_$({
          completed: a.completed
        })), t().phase !== "IDLE" && ae(!1), i(T$()), i(Ite({
          draggableId: s,
          movementMode: r
        }));
        var C = {
          shouldPublishImmediately: r === "SNAP"
        }, B = {
          draggableId: s,
          scrollOptions: C
        }, l = A.startPublishing(B), Q = l.critical, E = l.dimensions, d = l.viewport;
        i(rte({
          critical: Q,
          dimensions: E,
          clientSelection: I,
          movementMode: r,
          viewport: d
        }));
      };
    };
  };
}, fte = function(A) {
  return function() {
    return function(e) {
      return function(t) {
        t.type === "INITIAL_PUBLISH" && A.dragging(), t.type === "DROP_ANIMATE" && A.dropping(t.payload.completed.result.reason), (t.type === "FLUSH" || t.type === "DROP_COMPLETE") && A.resting(), e(t);
      };
    };
  };
}, q$ = {
  outOfTheWay: "cubic-bezier(0.2, 0, 0, 1)",
  drop: "cubic-bezier(.2,1,.1,1)"
}, hY = {
  opacity: {
    drop: 0,
    combining: 0.7
  },
  scale: {
    drop: 0.75
  }
}, O$ = {
  outOfTheWay: 0.2,
  minDropTime: 0.33,
  maxDropTime: 0.55
}, yh = O$.outOfTheWay + "s " + q$.outOfTheWay, CN = {
  fluid: "opacity " + yh,
  snap: "transform " + yh + ", opacity " + yh,
  drop: function(A) {
    var e = A + "s " + q$.drop;
    return "transform " + e + ", opacity " + e;
  },
  outOfTheWay: "transform " + yh,
  placeholder: "height " + yh + ", width " + yh + ", margin " + yh
}, tBA = function(A) {
  return hu(A, Zo) ? null : "translate(" + A.x + "px, " + A.y + "px)";
}, Qq = {
  moveTo: tBA,
  drop: function(A, e) {
    var t = tBA(A);
    return t ? e ? t + " scale(" + hY.scale.drop + ")" : t : null;
  }
}, Eq = O$.minDropTime, XJA = O$.maxDropTime, Dte = XJA - Eq, iBA = 1500, Gte = 0.6, kte = function(A) {
  var e = A.current, t = A.destination, i = A.reason, n = EY(e, t);
  if (n <= 0)
    return Eq;
  if (n >= iBA)
    return XJA;
  var o = n / iBA, g = Eq + Dte * o, s = i === "CANCEL" ? g * Gte : g;
  return Number(s.toFixed(2));
}, Jte = function(A) {
  var e = A.impact, t = A.draggable, i = A.dimensions, n = A.viewport, o = A.afterCritical, g = i.draggables, s = i.droppables, I = UI(e), r = I ? s[I] : null, a = s[t.descriptor.droppableId], C = SJA({
    impact: e,
    draggable: t,
    draggables: g,
    afterCritical: o,
    droppable: r || a,
    viewport: n
  }), B = LI(C, t.client.borderBox.center);
  return B;
}, Nte = function(A) {
  var e = A.draggables, t = A.reason, i = A.lastImpact, n = A.home, o = A.viewport, g = A.onLiftImpact;
  if (!i.at || t !== "DROP") {
    var s = HJA({
      draggables: e,
      impact: g,
      destination: n,
      viewport: o,
      forceShouldAnimate: !0
    });
    return {
      impact: s,
      didDropInsideDroppable: !1
    };
  }
  if (i.at.type === "REORDER")
    return {
      impact: i,
      didDropInsideDroppable: !0
    };
  var I = rt({}, i, {
    displaced: uY
  });
  return {
    impact: I,
    didDropInsideDroppable: !0
  };
}, Yte = function(A) {
  var e = A.getState, t = A.dispatch;
  return function(i) {
    return function(n) {
      if (n.type !== "DROP") {
        i(n);
        return;
      }
      var o = e(), g = n.payload.reason;
      if (o.phase === "COLLECTING") {
        t(bte({
          reason: g
        }));
        return;
      }
      if (o.phase !== "IDLE") {
        var s = o.phase === "DROP_PENDING" && o.isWaiting;
        s && ae(!1), o.phase === "DRAGGING" || o.phase === "DROP_PENDING" || ae(!1);
        var I = o.critical, r = o.dimensions, a = r.draggables[o.critical.draggable.id], C = Nte({
          reason: g,
          lastImpact: o.impact,
          afterCritical: o.afterCritical,
          onLiftImpact: o.onLiftImpact,
          home: o.dimensions.droppables[o.critical.droppable.id],
          viewport: o.viewport,
          draggables: o.dimensions.draggables
        }), B = C.impact, l = C.didDropInsideDroppable, Q = l ? W$(B) : null, E = l ? UK(B) : null, d = {
          index: I.draggable.index,
          droppableId: I.droppable.id
        }, m = {
          draggableId: a.descriptor.id,
          type: a.descriptor.type,
          source: d,
          reason: g,
          mode: o.movementMode,
          destination: Q,
          combine: E
        }, y = Jte({
          impact: B,
          draggable: a,
          dimensions: r,
          viewport: o.viewport,
          afterCritical: o.afterCritical
        }), f = {
          critical: o.critical,
          afterCritical: o.afterCritical,
          result: m,
          impact: B
        }, w = !hu(o.current.client.offset, y) || !!m.combine;
        if (!w) {
          t(_$({
            completed: f
          }));
          return;
        }
        var G = kte({
          current: o.current.client.offset,
          destination: y,
          reason: g
        }), R = {
          newHomeClientOffset: y,
          dropDuration: G,
          completed: f
        };
        t(yte(R));
      }
    };
  };
}, zJA = function() {
  return window["__react-beautiful-dnd-disable-scroll-hack"] ? {
    x: 0,
    y: 0
  } : {
    x: window.pageXOffset,
    y: window.pageYOffset
  };
};
function Rte(A) {
  return {
    eventName: "scroll",
    options: {
      passive: !0,
      capture: !1
    },
    fn: function(e) {
      e.target !== window && e.target !== window.document || A();
    }
  };
}
function Fte(A) {
  var e = A.onWindowScroll;
  function t() {
    e(zJA());
  }
  var i = QY(t), n = Rte(i), o = du;
  function g() {
    return o !== du;
  }
  function s() {
    g() && ae(!1), o = va(window, [n]);
  }
  function I() {
    g() || ae(!1), i.cancel(), o(), o = du;
  }
  return {
    start: s,
    stop: I,
    isActive: g
  };
}
var Mte = function(A) {
  return A.type === "DROP_COMPLETE" || A.type === "DROP_ANIMATE" || A.type === "FLUSH";
}, xte = function(A) {
  var e = Fte({
    onWindowScroll: function(t) {
      A.dispatch(Ete({
        newScroll: t
      }));
    }
  });
  return function(t) {
    return function(i) {
      !e.isActive() && i.type === "INITIAL_PUBLISH" && e.start(), e.isActive() && Mte(i) && e.stop(), t(i);
    };
  };
}, Lte = function(A) {
  var e = !1, t = !1, i = setTimeout(function() {
    t = !0;
  }), n = function(o) {
    e || t || (e = !0, A(o), clearTimeout(i));
  };
  return n.wasCalled = function() {
    return e;
  }, n;
}, vte = function() {
  var A = [], e = function(n) {
    var o = Z$(A, function(I) {
      return I.timerId === n;
    });
    o === -1 && ae(!1);
    var g = A.splice(o, 1), s = g[0];
    s.callback();
  }, t = function(n) {
    var o = setTimeout(function() {
      return e(o);
    }), g = {
      timerId: o,
      callback: n
    };
    A.push(g);
  }, i = function() {
    if (A.length) {
      var n = [].concat(A);
      A.length = 0, n.forEach(function(o) {
        clearTimeout(o.timerId), o.callback();
      });
    }
  };
  return {
    add: t,
    flush: i
  };
}, Hte = function(A, e) {
  return A == null && e == null ? !0 : A == null || e == null ? !1 : A.droppableId === e.droppableId && A.index === e.index;
}, Ste = function(A, e) {
  return A == null && e == null ? !0 : A == null || e == null ? !1 : A.draggableId === e.draggableId && A.droppableId === e.droppableId;
}, Zte = function(A, e) {
  if (A === e)
    return !0;
  var t = A.draggable.id === e.draggable.id && A.draggable.droppableId === e.draggable.droppableId && A.draggable.type === e.draggable.type && A.draggable.index === e.draggable.index, i = A.droppable.id === e.droppable.id && A.droppable.type === e.droppable.type;
  return t && i;
}, ok = function(A, e) {
  e();
}, QM = function(A, e) {
  return {
    draggableId: A.draggable.id,
    type: A.droppable.type,
    source: {
      droppableId: A.droppable.id,
      index: A.draggable.index
    },
    mode: e
  };
}, n5 = function(A, e, t, i) {
  if (!A) {
    t(i(e));
    return;
  }
  var n = Lte(t), o = {
    announce: n
  };
  A(e, o), n.wasCalled() || t(i(e));
}, Wte = function(A, e) {
  var t = vte(), i = null, n = function(C, B) {
    i && ae(!1), ok("onBeforeCapture", function() {
      var l = A().onBeforeCapture;
      if (l) {
        var Q = {
          draggableId: C,
          mode: B
        };
        l(Q);
      }
    });
  }, o = function(C, B) {
    i && ae(!1), ok("onBeforeDragStart", function() {
      var l = A().onBeforeDragStart;
      l && l(QM(C, B));
    });
  }, g = function(C, B) {
    i && ae(!1);
    var l = QM(C, B);
    i = {
      mode: B,
      lastCritical: C,
      lastLocation: l.source,
      lastCombine: null
    }, t.add(function() {
      ok("onDragStart", function() {
        return n5(A().onDragStart, l, e, xL.onDragStart);
      });
    });
  }, s = function(C, B) {
    var l = W$(B), Q = UK(B);
    i || ae(!1);
    var E = !Zte(C, i.lastCritical);
    E && (i.lastCritical = C);
    var d = !Hte(i.lastLocation, l);
    d && (i.lastLocation = l);
    var m = !Ste(i.lastCombine, Q);
    if (m && (i.lastCombine = Q), !(!E && !d && !m)) {
      var y = rt({}, QM(C, i.mode), {
        combine: Q,
        destination: l
      });
      t.add(function() {
        ok("onDragUpdate", function() {
          return n5(A().onDragUpdate, y, e, xL.onDragUpdate);
        });
      });
    }
  }, I = function() {
    i || ae(!1), t.flush();
  }, r = function(C) {
    i || ae(!1), i = null, ok("onDragEnd", function() {
      return n5(A().onDragEnd, C, e, xL.onDragEnd);
    });
  }, a = function() {
    if (i) {
      var C = rt({}, QM(i.lastCritical, i.mode), {
        combine: null,
        destination: null,
        reason: "CANCEL"
      });
      r(C);
    }
  };
  return {
    beforeCapture: n,
    beforeStart: o,
    start: g,
    update: s,
    flush: I,
    drop: r,
    abort: a
  };
}, Kte = function(A, e) {
  var t = Wte(A, e);
  return function(i) {
    return function(n) {
      return function(o) {
        if (o.type === "BEFORE_INITIAL_CAPTURE") {
          t.beforeCapture(o.payload.draggableId, o.payload.movementMode);
          return;
        }
        if (o.type === "INITIAL_PUBLISH") {
          var g = o.payload.critical;
          t.beforeStart(g, o.payload.movementMode), n(o), t.start(g, o.payload.movementMode);
          return;
        }
        if (o.type === "DROP_COMPLETE") {
          var s = o.payload.completed.result;
          t.flush(), n(o), t.drop(s);
          return;
        }
        if (n(o), o.type === "FLUSH") {
          t.abort();
          return;
        }
        var I = i.getState();
        I.phase === "DRAGGING" && t.update(I.critical, I.impact);
      };
    };
  };
}, Ute = function(A) {
  return function(e) {
    return function(t) {
      if (t.type !== "DROP_ANIMATION_FINISHED") {
        e(t);
        return;
      }
      var i = A.getState();
      i.phase !== "DROP_ANIMATING" && ae(!1), A.dispatch(_$({
        completed: i.completed
      }));
    };
  };
}, Vte = function(A) {
  var e = null, t = null;
  function i() {
    t && (cancelAnimationFrame(t), t = null), e && (e(), e = null);
  }
  return function(n) {
    return function(o) {
      if ((o.type === "FLUSH" || o.type === "DROP_COMPLETE" || o.type === "DROP_ANIMATION_FINISHED") && i(), n(o), o.type === "DROP_ANIMATE") {
        var g = {
          eventName: "scroll",
          options: {
            capture: !0,
            passive: !1,
            once: !0
          },
          fn: function() {
            var s = A.getState();
            s.phase === "DROP_ANIMATING" && A.dispatch(VJA());
          }
        };
        t = requestAnimationFrame(function() {
          t = null, e = va(window, [g]);
        });
      }
    };
  };
}, Xte = function(A) {
  return function() {
    return function(e) {
      return function(t) {
        (t.type === "DROP_COMPLETE" || t.type === "FLUSH" || t.type === "DROP_ANIMATE") && A.stopPublishing(), e(t);
      };
    };
  };
}, zte = function(A) {
  var e = !1;
  return function() {
    return function(t) {
      return function(i) {
        if (i.type === "INITIAL_PUBLISH") {
          e = !0, A.tryRecordFocus(i.payload.critical.draggable.id), t(i), A.tryRestoreFocusRecorded();
          return;
        }
        if (t(i), !!e) {
          if (i.type === "FLUSH") {
            e = !1, A.tryRestoreFocusRecorded();
            return;
          }
          if (i.type === "DROP_COMPLETE") {
            e = !1;
            var n = i.payload.completed.result;
            n.combine && A.tryShiftRecord(n.draggableId, n.combine.draggableId), A.tryRestoreFocusRecorded();
          }
        }
      };
    };
  };
}, Tte = function(A) {
  return A.type === "DROP_COMPLETE" || A.type === "DROP_ANIMATE" || A.type === "FLUSH";
}, _te = function(A) {
  return function(e) {
    return function(t) {
      return function(i) {
        if (Tte(i)) {
          A.stop(), t(i);
          return;
        }
        if (i.type === "INITIAL_PUBLISH") {
          t(i);
          var n = e.getState();
          n.phase !== "DRAGGING" && ae(!1), A.start(n);
          return;
        }
        t(i), A.scroll(e.getState());
      };
    };
  };
}, qte = function(A) {
  return function(e) {
    return function(t) {
      if (e(t), t.type === "PUBLISH_WHILE_DRAGGING") {
        var i = A.getState();
        i.phase === "DROP_PENDING" && (i.isWaiting || A.dispatch(UJA({
          reason: i.reason
        })));
      }
    };
  };
}, Ote = eJA, jte = function(A) {
  var e = A.dimensionMarshal, t = A.focusMarshal, i = A.styleMarshal, n = A.getResponders, o = A.announce, g = A.autoScroller;
  return AJA(ste, Ote(iAe(fte(i), Xte(e), wte(e), Yte, Ute, Vte, qte, _te(g), xte, zte(t), Kte(n, o))));
}, o5 = function() {
  return {
    additions: {},
    removals: {},
    modified: {}
  };
};
function Pte(A) {
  var e = A.registry, t = A.callbacks, i = o5(), n = null, o = function() {
    n || (t.collectionStarting(), n = requestAnimationFrame(function() {
      n = null;
      var r = i, a = r.additions, C = r.removals, B = r.modified, l = Object.keys(a).map(function(d) {
        return e.draggable.getById(d).getDimension(Zo);
      }).sort(function(d, m) {
        return d.descriptor.index - m.descriptor.index;
      }), Q = Object.keys(B).map(function(d) {
        var m = e.droppable.getById(d), y = m.callbacks.getScrollWhileDragging();
        return {
          droppableId: d,
          scroll: y
        };
      }), E = {
        additions: l,
        removals: Object.keys(C),
        modified: Q
      };
      i = o5(), t.publish(E);
    }));
  }, g = function(r) {
    var a = r.descriptor.id;
    i.additions[a] = r, i.modified[r.descriptor.droppableId] = !0, i.removals[a] && delete i.removals[a], o();
  }, s = function(r) {
    var a = r.descriptor;
    i.removals[a.id] = !0, i.modified[a.droppableId] = !0, i.additions[a.id] && delete i.additions[a.id], o();
  }, I = function() {
    n && (cancelAnimationFrame(n), n = null, i = o5());
  };
  return {
    add: g,
    remove: s,
    stop: I
  };
}
var TJA = function(A) {
  var e = A.scrollHeight, t = A.scrollWidth, i = A.height, n = A.width, o = LI({
    x: t,
    y: e
  }, {
    x: n,
    y: i
  }), g = {
    x: Math.max(0, o.x),
    y: Math.max(0, o.y)
  };
  return g;
}, _JA = function() {
  var A = document.documentElement;
  return A || ae(!1), A;
}, qJA = function() {
  var A = _JA(), e = TJA({
    scrollHeight: A.scrollHeight,
    scrollWidth: A.scrollWidth,
    width: A.clientWidth,
    height: A.clientHeight
  });
  return e;
}, $te = function() {
  var A = zJA(), e = qJA(), t = A.y, i = A.x, n = _JA(), o = n.clientWidth, g = n.clientHeight, s = i + o, I = t + g, r = Tr({
    top: t,
    left: i,
    right: s,
    bottom: I
  }), a = {
    frame: r,
    scroll: {
      initial: A,
      current: A,
      max: e,
      diff: {
        value: Zo,
        displacement: Zo
      }
    }
  };
  return a;
}, Aie = function(A) {
  var e = A.critical, t = A.scrollOptions, i = A.registry, n = $te(), o = n.scroll.current, g = e.droppable, s = i.droppable.getAllByType(g.type).map(function(C) {
    return C.callbacks.getDimensionAndWatchScroll(o, t);
  }), I = i.draggable.getAllByType(e.draggable.type).map(function(C) {
    return C.getDimension(o);
  }), r = {
    draggables: wJA(I),
    droppables: bJA(s)
  }, a = {
    dimensions: r,
    critical: e,
    viewport: n
  };
  return a;
};
function nBA(A, e, t) {
  if (t.descriptor.id === e.id || t.descriptor.type !== e.type)
    return !1;
  var i = A.droppable.getById(t.descriptor.droppableId);
  return i.descriptor.mode === "virtual";
}
var eie = function(A, e) {
  var t = null, i = Pte({
    callbacks: {
      publish: e.publishWhileDragging,
      collectionStarting: e.collectionStarting
    },
    registry: A
  }), n = function(B, l) {
    A.droppable.exists(B) || ae(!1), t && e.updateDroppableIsEnabled({
      id: B,
      isEnabled: l
    });
  }, o = function(B, l) {
    t && (A.droppable.exists(B) || ae(!1), e.updateDroppableIsCombineEnabled({
      id: B,
      isCombineEnabled: l
    }));
  }, g = function(B, l) {
    t && (A.droppable.exists(B) || ae(!1), e.updateDroppableScroll({
      id: B,
      newScroll: l
    }));
  }, s = function(B, l) {
    t && A.droppable.getById(B).callbacks.scroll(l);
  }, I = function() {
    if (t) {
      i.stop();
      var B = t.critical.droppable;
      A.droppable.getAllByType(B.type).forEach(function(l) {
        return l.callbacks.dragStopped();
      }), t.unsubscribe(), t = null;
    }
  }, r = function(B) {
    t || ae(!1);
    var l = t.critical.draggable;
    B.type === "ADDITION" && nBA(A, l, B.value) && i.add(B.value), B.type === "REMOVAL" && nBA(A, l, B.value) && i.remove(B.value);
  }, a = function(B) {
    t && ae(!1);
    var l = A.draggable.getById(B.draggableId), Q = A.droppable.getById(l.descriptor.droppableId), E = {
      draggable: l.descriptor,
      droppable: Q.descriptor
    }, d = A.subscribe(r);
    return t = {
      critical: E,
      unsubscribe: d
    }, Aie({
      critical: E,
      registry: A,
      scrollOptions: B.scrollOptions
    });
  }, C = {
    updateDroppableIsEnabled: n,
    updateDroppableIsCombineEnabled: o,
    scrollDroppable: s,
    updateDroppableScroll: g,
    startPublishing: a,
    stopPublishing: I
  };
  return C;
}, OJA = function(A, e) {
  return A.phase === "IDLE" ? !0 : A.phase !== "DROP_ANIMATING" || A.completed.result.draggableId === e ? !1 : A.completed.result.reason === "DROP";
}, tie = function(A) {
  window.scrollBy(A.x, A.y);
}, iie = Lo(function(A) {
  return KK(A).filter(function(e) {
    return !(!e.isEnabled || !e.frame);
  });
}), nie = function(A, e) {
  var t = Nd(iie(e), function(i) {
    return i.frame || ae(!1), MJA(i.frame.pageMarginBox)(A);
  });
  return t;
}, oie = function(A) {
  var e = A.center, t = A.destination, i = A.droppables;
  if (t) {
    var n = i[t];
    return n.frame ? n : null;
  }
  var o = nie(e, i);
  return o;
}, mu = {
  startFromPercentage: 0.25,
  maxScrollAtPercentage: 0.05,
  maxPixelScroll: 28,
  ease: function(A) {
    return Math.pow(A, 2);
  },
  durationDampening: {
    stopDampeningAt: 1200,
    accelerateAt: 360
  }
}, gie = function(A, e) {
  var t = A[e.size] * mu.startFromPercentage, i = A[e.size] * mu.maxScrollAtPercentage, n = {
    startScrollingFrom: t,
    maxScrollValueAt: i
  };
  return n;
}, jJA = function(A) {
  var e = A.startOfRange, t = A.endOfRange, i = A.current, n = t - e;
  if (n === 0)
    return 0;
  var o = i - e, g = o / n;
  return g;
}, j$ = 1, sie = function(A, e) {
  if (A > e.startScrollingFrom)
    return 0;
  if (A <= e.maxScrollValueAt)
    return mu.maxPixelScroll;
  if (A === e.startScrollingFrom)
    return j$;
  var t = jJA({
    startOfRange: e.maxScrollValueAt,
    endOfRange: e.startScrollingFrom,
    current: A
  }), i = 1 - t, n = mu.maxPixelScroll * mu.ease(i);
  return Math.ceil(n);
}, oBA = mu.durationDampening.accelerateAt, gBA = mu.durationDampening.stopDampeningAt, Iie = function(A, e) {
  var t = e, i = gBA, n = Date.now(), o = n - t;
  if (o >= gBA)
    return A;
  if (o < oBA)
    return j$;
  var g = jJA({
    startOfRange: oBA,
    endOfRange: i,
    current: o
  }), s = A * mu.ease(g);
  return Math.ceil(s);
}, sBA = function(A) {
  var e = A.distanceToEdge, t = A.thresholds, i = A.dragStartTime, n = A.shouldUseTimeDampening, o = sie(e, t);
  return o === 0 ? 0 : n ? Math.max(Iie(o, i), j$) : o;
}, IBA = function(A) {
  var e = A.container, t = A.distanceToEdges, i = A.dragStartTime, n = A.axis, o = A.shouldUseTimeDampening, g = gie(e, n), s = t[n.end] < t[n.start];
  return s ? sBA({
    distanceToEdge: t[n.end],
    thresholds: g,
    dragStartTime: i,
    shouldUseTimeDampening: o
  }) : -1 * sBA({
    distanceToEdge: t[n.start],
    thresholds: g,
    dragStartTime: i,
    shouldUseTimeDampening: o
  });
}, aie = function(A) {
  var e = A.container, t = A.subject, i = A.proposedScroll, n = t.height > e.height, o = t.width > e.width;
  return !o && !n ? i : o && n ? null : {
    x: o ? 0 : i.x,
    y: n ? 0 : i.y
  };
}, rie = pJA(function(A) {
  return A === 0 ? 0 : A;
}), PJA = function(A) {
  var e = A.dragStartTime, t = A.container, i = A.subject, n = A.center, o = A.shouldUseTimeDampening, g = {
    top: n.y - t.top,
    right: t.right - n.x,
    bottom: t.bottom - n.y,
    left: n.x - t.left
  }, s = IBA({
    container: t,
    distanceToEdges: g,
    dragStartTime: e,
    axis: K$,
    shouldUseTimeDampening: o
  }), I = IBA({
    container: t,
    distanceToEdges: g,
    dragStartTime: e,
    axis: GJA,
    shouldUseTimeDampening: o
  }), r = rie({
    x: I,
    y: s
  });
  if (hu(r, Zo))
    return null;
  var a = aie({
    container: t,
    subject: i,
    proposedScroll: r
  });
  return a ? hu(a, Zo) ? null : a : null;
}, Cie = pJA(function(A) {
  return A === 0 ? 0 : A > 0 ? 1 : -1;
}), P$ = function() {
  var A = function(e, t) {
    return e < 0 ? e : e > t ? e - t : 0;
  };
  return function(e) {
    var t = e.current, i = e.max, n = e.change, o = Oo(t, n), g = {
      x: A(o.x, i.x),
      y: A(o.y, i.y)
    };
    return hu(g, Zo) ? null : g;
  };
}(), $JA = function(A) {
  var e = A.max, t = A.current, i = A.change, n = {
    x: Math.max(t.x, e.x),
    y: Math.max(t.y, e.y)
  }, o = Cie(i), g = P$({
    max: n,
    current: t,
    change: o
  });
  return !g || o.x !== 0 && g.x === 0 || o.y !== 0 && g.y === 0;
}, $$ = function(A, e) {
  return $JA({
    current: A.scroll.current,
    max: A.scroll.max,
    change: e
  });
}, Bie = function(A, e) {
  if (!$$(A, e))
    return null;
  var t = A.scroll.max, i = A.scroll.current;
  return P$({
    current: i,
    max: t,
    change: e
  });
}, A7 = function(A, e) {
  var t = A.frame;
  return t ? $JA({
    current: t.scroll.current,
    max: t.scroll.max,
    change: e
  }) : !1;
}, lie = function(A, e) {
  var t = A.frame;
  return !t || !A7(A, e) ? null : P$({
    current: t.scroll.current,
    max: t.scroll.max,
    change: e
  });
}, cie = function(A) {
  var e = A.viewport, t = A.subject, i = A.center, n = A.dragStartTime, o = A.shouldUseTimeDampening, g = PJA({
    dragStartTime: n,
    container: e.frame,
    subject: t,
    center: i,
    shouldUseTimeDampening: o
  });
  return g && $$(e, g) ? g : null;
}, Qie = function(A) {
  var e = A.droppable, t = A.subject, i = A.center, n = A.dragStartTime, o = A.shouldUseTimeDampening, g = e.frame;
  if (!g)
    return null;
  var s = PJA({
    dragStartTime: n,
    container: g.pageMarginBox,
    subject: t,
    center: i,
    shouldUseTimeDampening: o
  });
  return s && A7(e, s) ? s : null;
}, aBA = function(A) {
  var e = A.state, t = A.dragStartTime, i = A.shouldUseTimeDampening, n = A.scrollWindow, o = A.scrollDroppable, g = e.current.page.borderBoxCenter, s = e.dimensions.draggables[e.critical.draggable.id], I = s.page.marginBox;
  if (e.isWindowScrollAllowed) {
    var r = e.viewport, a = cie({
      dragStartTime: t,
      viewport: r,
      subject: I,
      center: g,
      shouldUseTimeDampening: i
    });
    if (a) {
      n(a);
      return;
    }
  }
  var C = oie({
    center: g,
    destination: UI(e.impact),
    droppables: e.dimensions.droppables
  });
  if (C) {
    var B = Qie({
      dragStartTime: t,
      droppable: C,
      subject: I,
      center: g,
      shouldUseTimeDampening: i
    });
    B && o(C.descriptor.id, B);
  }
}, Eie = function(A) {
  var e = A.scrollWindow, t = A.scrollDroppable, i = QY(e), n = QY(t), o = null, g = function(r) {
    o || ae(!1);
    var a = o, C = a.shouldUseTimeDampening, B = a.dragStartTime;
    aBA({
      state: r,
      scrollWindow: i,
      scrollDroppable: n,
      dragStartTime: B,
      shouldUseTimeDampening: C
    });
  }, s = function(r) {
    o && ae(!1);
    var a = Date.now(), C = !1, B = function() {
      C = !0;
    };
    aBA({
      state: r,
      dragStartTime: 0,
      shouldUseTimeDampening: !1,
      scrollWindow: B,
      scrollDroppable: B
    }), o = {
      dragStartTime: a,
      shouldUseTimeDampening: C
    }, C && g(r);
  }, I = function() {
    o && (i.cancel(), n.cancel(), o = null);
  };
  return {
    start: s,
    stop: I,
    scroll: g
  };
}, uie = function(A) {
  var e = A.move, t = A.scrollDroppable, i = A.scrollWindow, n = function(I, r) {
    var a = Oo(I.current.client.selection, r);
    e({
      client: a
    });
  }, o = function(I, r) {
    if (!A7(I, r))
      return r;
    var a = lie(I, r);
    if (!a)
      return t(I.descriptor.id, r), null;
    var C = LI(r, a);
    t(I.descriptor.id, C);
    var B = LI(r, C);
    return B;
  }, g = function(I, r, a) {
    if (!I || !$$(r, a))
      return a;
    var C = Bie(r, a);
    if (!C)
      return i(a), null;
    var B = LI(a, C);
    i(B);
    var l = LI(a, B);
    return l;
  }, s = function(I) {
    var r = I.scrollJumpRequest;
    if (r) {
      var a = UI(I.impact);
      a || ae(!1);
      var C = o(I.dimensions.droppables[a], r);
      if (C) {
        var B = I.viewport, l = g(I.isWindowScrollAllowed, B, C);
        l && n(I, l);
      }
    }
  };
  return s;
}, die = function(A) {
  var e = A.scrollDroppable, t = A.scrollWindow, i = A.move, n = Eie({
    scrollWindow: t,
    scrollDroppable: e
  }), o = uie({
    move: i,
    scrollWindow: t,
    scrollDroppable: e
  }), g = function(I) {
    if (I.phase === "DRAGGING") {
      if (I.movementMode === "FLUID") {
        n.scroll(I);
        return;
      }
      I.scrollJumpRequest && o(I);
    }
  }, s = {
    scroll: g,
    start: n.start,
    stop: n.stop
  };
  return s;
}, jw = "data-rbd", Pw = function() {
  var A = jw + "-drag-handle";
  return {
    base: A,
    draggableId: A + "-draggable-id",
    contextId: A + "-context-id"
  };
}(), uq = function() {
  var A = jw + "-draggable";
  return {
    base: A,
    contextId: A + "-context-id",
    id: A + "-id"
  };
}(), hie = function() {
  var A = jw + "-droppable";
  return {
    base: A,
    contextId: A + "-context-id",
    id: A + "-id"
  };
}(), rBA = {
  contextId: jw + "-scroll-container-context-id"
}, mie = function(A) {
  return function(e) {
    return "[" + e + '="' + A + '"]';
  };
}, gk = function(A, e) {
  return A.map(function(t) {
    var i = t.styles[e];
    return i ? t.selector + " { " + i + " }" : "";
  }).join(" ");
}, pie = "pointer-events: none;", yie = function(A) {
  var e = mie(A), t = function() {
    var s = `
      cursor: -webkit-grab;
      cursor: grab;
    `;
    return {
      selector: e(Pw.contextId),
      styles: {
        always: `
          -webkit-touch-callout: none;
          -webkit-tap-highlight-color: rgba(0,0,0,0);
          touch-action: manipulation;
        `,
        resting: s,
        dragging: pie,
        dropAnimating: s
      }
    };
  }(), i = function() {
    var s = `
      transition: ` + CN.outOfTheWay + `;
    `;
    return {
      selector: e(uq.contextId),
      styles: {
        dragging: s,
        dropAnimating: s,
        userCancel: s
      }
    };
  }(), n = {
    selector: e(hie.contextId),
    styles: {
      always: "overflow-anchor: none;"
    }
  }, o = {
    selector: "body",
    styles: {
      dragging: `
        cursor: grabbing;
        cursor: -webkit-grabbing;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        overflow-anchor: none;
      `
    }
  }, g = [i, t, n, o];
  return {
    always: gk(g, "always"),
    resting: gk(g, "resting"),
    dragging: gk(g, "dragging"),
    dropAnimating: gk(g, "dropAnimating"),
    userCancel: gk(g, "userCancel")
  };
}, VI = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? u.useLayoutEffect : u.useEffect, CBA = function(A) {
  var e = document.createElement("style");
  return A && e.setAttribute("nonce", A), e.type = "text/css", e;
};
function bie(A, e) {
  var t = $t(function() {
    return yie(A);
  }, [A]), i = u.useRef(null), n = u.useRef(null), o = DC(), g = He(Lo(function(B) {
    var l = n.current;
    l || ae(!1), l.textContent = B;
  }), []), s = He(function(B) {
    var l = i.current;
    l || ae(!1), l.textContent = B;
  }, []);
  VI(function() {
    !i.current && !n.current || ae(!1);
    var B = CBA(e), l = CBA(e);
    return i.current = B, n.current = l, B.setAttribute(jw + "-always", A), l.setAttribute(jw + "-dynamic", A), o.head.appendChild(B), o.head.appendChild(l), s(t.always), g(t.resting), function() {
      var Q = function(E) {
        var d = E.current;
        d || ae(!1), o.head.removeChild(d), E.current = null;
      };
      Q(i), Q(n);
    };
  }, [e, s, g, t.always, t.resting, A]);
  var I = He(function() {
    return g(t.dragging);
  }, [g, t.dragging]), r = He(function(B) {
    if (B === "DROP") {
      g(t.dropAnimating);
      return;
    }
    g(t.userCancel);
  }, [g, t.dropAnimating, t.userCancel]), a = He(function() {
    n.current && g(t.resting);
  }, [g, t.resting]), C = $t(function() {
    return {
      dragging: I,
      dropping: r,
      resting: a
    };
  }, [I, r, a]);
  return C;
}
var ANA = function(A) {
  return A && A.ownerDocument ? A.ownerDocument.defaultView : window;
};
function zK(A) {
  return A instanceof ANA(A).HTMLElement;
}
function wie(A, e, t) {
  var i = "[" + Pw.contextId + '="' + e + '"]', n = yJA(A.querySelectorAll(i));
  if (!n.length)
    return null;
  var o = Nd(n, function(g) {
    return g.getAttribute(Pw.draggableId) === t;
  });
  return o && zK(o) ? o : null;
}
function fie(A) {
  var e = u.useRef({}), t = u.useRef(null), i = u.useRef(null), n = u.useRef(!1), o = He(function(B, l) {
    var Q = {
      id: B,
      focus: l
    };
    return e.current[B] = Q, function() {
      var E = e.current, d = E[B];
      d !== Q && delete E[B];
    };
  }, []), g = DC(), s = He(function(B) {
    var l = wie(g.body, A, B);
    l && l !== document.activeElement && l.focus();
  }, [A]), I = He(function(B, l) {
    t.current === B && (t.current = l);
  }, []), r = He(function() {
    i.current || n.current && (i.current = requestAnimationFrame(function() {
      i.current = null;
      var B = t.current;
      B && s(B);
    }));
  }, [s]), a = He(function(B) {
    t.current = null;
    var l = document.activeElement;
    l && l.getAttribute(Pw.draggableId) === B && (t.current = B);
  }, []);
  VI(function() {
    return n.current = !0, function() {
      n.current = !1;
      var B = i.current;
      B && cancelAnimationFrame(B);
    };
  }, []);
  var C = $t(function() {
    return {
      register: o,
      tryRecordFocus: a,
      tryRestoreFocusRecorded: r,
      tryShiftRecord: I
    };
  }, [o, a, r, I]);
  return C;
}
function Die() {
  var A = {
    draggables: {},
    droppables: {}
  }, e = [];
  function t(C) {
    return e.push(C), function() {
      var B = e.indexOf(C);
      B !== -1 && e.splice(B, 1);
    };
  }
  function i(C) {
    e.length && e.forEach(function(B) {
      return B(C);
    });
  }
  function n(C) {
    return A.draggables[C] || null;
  }
  function o(C) {
    var B = n(C);
    return B || ae(!1), B;
  }
  var g = {
    register: function(C) {
      A.draggables[C.descriptor.id] = C, i({
        type: "ADDITION",
        value: C
      });
    },
    update: function(C, B) {
      var l = A.draggables[B.descriptor.id];
      l && l.uniqueId === C.uniqueId && (delete A.draggables[B.descriptor.id], A.draggables[C.descriptor.id] = C);
    },
    unregister: function(C) {
      var B = C.descriptor.id, l = n(B);
      l && C.uniqueId === l.uniqueId && (delete A.draggables[B], i({
        type: "REMOVAL",
        value: C
      }));
    },
    getById: o,
    findById: n,
    exists: function(C) {
      return !!n(C);
    },
    getAllByType: function(C) {
      return pH(A.draggables).filter(function(B) {
        return B.descriptor.type === C;
      });
    }
  };
  function s(C) {
    return A.droppables[C] || null;
  }
  function I(C) {
    var B = s(C);
    return B || ae(!1), B;
  }
  var r = {
    register: function(C) {
      A.droppables[C.descriptor.id] = C;
    },
    unregister: function(C) {
      var B = s(C.descriptor.id);
      B && C.uniqueId === B.uniqueId && delete A.droppables[C.descriptor.id];
    },
    getById: I,
    findById: s,
    exists: function(C) {
      return !!s(C);
    },
    getAllByType: function(C) {
      return pH(A.droppables).filter(function(B) {
        return B.descriptor.type === C;
      });
    }
  };
  function a() {
    A.draggables = {}, A.droppables = {}, e.length = 0;
  }
  return {
    draggable: g,
    droppable: r,
    subscribe: t,
    clean: a
  };
}
function Gie() {
  var A = $t(Die, []), e = u.useRef();
  return u.useEffect(function() {
    return e.current && cancelAnimationFrame(e.current), function() {
      e.current = requestAnimationFrame(A.clean);
    };
  }, [A]), A;
}
var e7 = b.createContext(null), kie = {
  position: "absolute",
  width: "1px",
  height: "1px",
  margin: "-1px",
  border: "0",
  padding: "0",
  overflow: "hidden",
  clip: "rect(0 0 0 0)",
  "clip-path": "inset(100%)"
}, Jie = function(A) {
  return "rbd-announcement-" + A;
};
function Nie(A) {
  var e = $t(function() {
    return Jie(A);
  }, [A]), t = u.useRef(null), i = DC();
  u.useEffect(function() {
    var o = document.createElement("div");
    return t.current = o, o.id = e, o.setAttribute("aria-live", "assertive"), o.setAttribute("aria-atomic", "true"), rt(o.style, kie), i.body.appendChild(o), function() {
      setTimeout(function() {
        var g = i.body;
        g.contains(o) && g.removeChild(o), o === t.current && (t.current = null);
      });
    };
  }, [e]);
  var n = He(function(o) {
    var g = t.current;
    if (g) {
      g.textContent = o;
      return;
    }
  }, []);
  return n;
}
var Yie = 0, Rie = {
  separator: "::"
};
function t7(A, e) {
  return e === void 0 && (e = Rie), $t(function() {
    return "" + A + e.separator + Yie++;
  }, [e.separator, A]);
}
function Fie(A) {
  var e = A.contextId, t = A.uniqueId;
  return "rbd-hidden-text-" + e + "-" + t;
}
function Mie(A) {
  var e = A.contextId, t = A.text, i = t7("hidden-text", {
    separator: "-"
  }), n = $t(function() {
    return Fie({
      contextId: e,
      uniqueId: i
    });
  }, [i, e]), o = DC();
  return u.useEffect(function() {
    var g = document.createElement("div");
    return g.id = n, g.textContent = t, g.style.display = "none", o.body.appendChild(g), function() {
      var s = o.body;
      s.contains(g) && s.removeChild(g);
    };
  }, [n, t]), n;
}
var TK = b.createContext(null);
function eNA(A) {
  var e = u.useRef(A);
  return u.useEffect(function() {
    e.current = A;
  }), e;
}
function xie() {
  var A = null;
  function e() {
    return !!A;
  }
  function t(g) {
    return g === A;
  }
  function i(g) {
    A && ae(!1);
    var s = {
      abandon: g
    };
    return A = s, s;
  }
  function n() {
    A || ae(!1), A = null;
  }
  function o() {
    A && (A.abandon(), n());
  }
  return {
    isClaimed: e,
    isActive: t,
    claim: i,
    release: n,
    tryAbandon: o
  };
}
var Lie = 9, vie = 13, i7 = 27, tNA = 32, Hie = 33, Sie = 34, Zie = 35, Wie = 36, Kie = 37, Uie = 38, Vie = 39, Xie = 40, EM, zie = (EM = {}, EM[vie] = !0, EM[Lie] = !0, EM), iNA = function(A) {
  zie[A.keyCode] && A.preventDefault();
}, _K = function() {
  var A = "visibilitychange";
  if (typeof document > "u")
    return A;
  var e = [A, "ms" + A, "webkit" + A, "moz" + A, "o" + A], t = Nd(e, function(i) {
    return "on" + i in document;
  });
  return t || A;
}(), nNA = 0, BBA = 5;
function Tie(A, e) {
  return Math.abs(e.x - A.x) >= BBA || Math.abs(e.y - A.y) >= BBA;
}
var lBA = {
  type: "IDLE"
};
function _ie(A) {
  var e = A.cancel, t = A.completed, i = A.getPhase, n = A.setPhase;
  return [{
    eventName: "mousemove",
    fn: function(o) {
      var g = o.button, s = o.clientX, I = o.clientY;
      if (g === nNA) {
        var r = {
          x: s,
          y: I
        }, a = i();
        if (a.type === "DRAGGING") {
          o.preventDefault(), a.actions.move(r);
          return;
        }
        a.type !== "PENDING" && ae(!1);
        var C = a.point;
        if (Tie(C, r)) {
          o.preventDefault();
          var B = a.actions.fluidLift(r);
          n({
            type: "DRAGGING",
            actions: B
          });
        }
      }
    }
  }, {
    eventName: "mouseup",
    fn: function(o) {
      var g = i();
      if (g.type !== "DRAGGING") {
        e();
        return;
      }
      o.preventDefault(), g.actions.drop({
        shouldBlockNextClick: !0
      }), t();
    }
  }, {
    eventName: "mousedown",
    fn: function(o) {
      i().type === "DRAGGING" && o.preventDefault(), e();
    }
  }, {
    eventName: "keydown",
    fn: function(o) {
      var g = i();
      if (g.type === "PENDING") {
        e();
        return;
      }
      if (o.keyCode === i7) {
        o.preventDefault(), e();
        return;
      }
      iNA(o);
    }
  }, {
    eventName: "resize",
    fn: e
  }, {
    eventName: "scroll",
    options: {
      passive: !0,
      capture: !1
    },
    fn: function() {
      i().type === "PENDING" && e();
    }
  }, {
    eventName: "webkitmouseforcedown",
    fn: function(o) {
      var g = i();
      if (g.type === "IDLE" && ae(!1), g.actions.shouldRespectForcePress()) {
        e();
        return;
      }
      o.preventDefault();
    }
  }, {
    eventName: _K,
    fn: e
  }];
}
function oNA(A) {
  var e = u.useRef(lBA), t = u.useRef(du), i = DC(), n = $t(function() {
    return {
      eventName: "mousedown",
      fn: function(C) {
        if (!C.defaultPrevented && C.button === nNA && !(C.ctrlKey || C.metaKey || C.shiftKey || C.altKey)) {
          var B = A.findClosestDraggableId(C);
          if (B) {
            var l = A.tryGetLock(B, s, {
              sourceEvent: C
            });
            if (l) {
              C.preventDefault();
              var Q = {
                x: C.clientX,
                y: C.clientY
              };
              t.current(), a(l, Q);
            }
          }
        }
      }
    };
  }, [A]), o = $t(function() {
    return {
      eventName: "webkitmouseforcewillbegin",
      fn: function(C) {
        if (!C.defaultPrevented) {
          var B = A.findClosestDraggableId(C);
          if (B) {
            var l = A.findOptionsForDraggable(B);
            l && (l.shouldRespectForcePress || A.canGetLock(B) && C.preventDefault());
          }
        }
      }
    };
  }, [A]), g = He(function() {
    var C = {
      passive: !1,
      capture: !0
    };
    t.current = va(i.body, [o, n], C);
  }, [o, n]), s = He(function() {
    var C = e.current;
    C.type !== "IDLE" && (e.current = lBA, t.current(), g());
  }, [g]), I = He(function() {
    var C = e.current;
    s(), C.type === "DRAGGING" && C.actions.cancel({
      shouldBlockNextClick: !0
    }), C.type === "PENDING" && C.actions.abort();
  }, [s]), r = He(function() {
    var C = {
      capture: !0,
      passive: !1
    }, B = _ie({
      cancel: I,
      completed: s,
      getPhase: function() {
        return e.current;
      },
      setPhase: function(l) {
        e.current = l;
      }
    });
    t.current = va(i.body, B, C);
  }, [I, s]), a = He(function(C, B) {
    e.current.type !== "IDLE" && ae(!1), e.current = {
      type: "PENDING",
      point: B,
      actions: C
    }, r();
  }, [r]);
  VI(function() {
    return g(), function() {
      t.current();
    };
  }, [g]);
}
var ey;
function qie() {
}
var Oie = (ey = {}, ey[Sie] = !0, ey[Hie] = !0, ey[Wie] = !0, ey[Zie] = !0, ey);
function jie(A, e) {
  function t() {
    e(), A.cancel();
  }
  function i() {
    e(), A.drop();
  }
  return [{
    eventName: "keydown",
    fn: function(n) {
      if (n.keyCode === i7) {
        n.preventDefault(), t();
        return;
      }
      if (n.keyCode === tNA) {
        n.preventDefault(), i();
        return;
      }
      if (n.keyCode === Xie) {
        n.preventDefault(), A.moveDown();
        return;
      }
      if (n.keyCode === Uie) {
        n.preventDefault(), A.moveUp();
        return;
      }
      if (n.keyCode === Vie) {
        n.preventDefault(), A.moveRight();
        return;
      }
      if (n.keyCode === Kie) {
        n.preventDefault(), A.moveLeft();
        return;
      }
      if (Oie[n.keyCode]) {
        n.preventDefault();
        return;
      }
      iNA(n);
    }
  }, {
    eventName: "mousedown",
    fn: t
  }, {
    eventName: "mouseup",
    fn: t
  }, {
    eventName: "click",
    fn: t
  }, {
    eventName: "touchstart",
    fn: t
  }, {
    eventName: "resize",
    fn: t
  }, {
    eventName: "wheel",
    fn: t,
    options: {
      passive: !0
    }
  }, {
    eventName: _K,
    fn: t
  }];
}
function gNA(A) {
  var e = u.useRef(qie), t = DC(), i = $t(function() {
    return {
      eventName: "keydown",
      fn: function(o) {
        if (o.defaultPrevented || o.keyCode !== tNA)
          return;
        var g = A.findClosestDraggableId(o);
        if (!g)
          return;
        var s = A.tryGetLock(g, a, {
          sourceEvent: o
        });
        if (!s)
          return;
        o.preventDefault();
        var I = !0, r = s.snapLift();
        e.current();
        function a() {
          I || ae(!1), I = !1, e.current(), n();
        }
        e.current = va(t.body, jie(r, a), {
          capture: !0,
          passive: !1
        });
      }
    };
  }, [A]), n = He(function() {
    var o = {
      passive: !1,
      capture: !0
    };
    e.current = va(t.body, [i], o);
  }, [i]);
  VI(function() {
    return n(), function() {
      e.current();
    };
  }, [n]);
}
var g5 = {
  type: "IDLE"
}, Pie = 120, $ie = 0.15;
function Ane(A) {
  var e = A.cancel, t = A.getPhase;
  return [{
    eventName: "orientationchange",
    fn: e
  }, {
    eventName: "resize",
    fn: e
  }, {
    eventName: "contextmenu",
    fn: function(i) {
      i.preventDefault();
    }
  }, {
    eventName: "keydown",
    fn: function(i) {
      if (t().type !== "DRAGGING") {
        e();
        return;
      }
      i.keyCode === i7 && i.preventDefault(), e();
    }
  }, {
    eventName: _K,
    fn: e
  }];
}
function ene(A) {
  var e = A.cancel, t = A.completed, i = A.getPhase;
  return [{
    eventName: "touchmove",
    options: {
      capture: !1
    },
    fn: function(n) {
      var o = i();
      if (o.type !== "DRAGGING") {
        e();
        return;
      }
      o.hasMoved = !0;
      var g = n.touches[0], s = g.clientX, I = g.clientY, r = {
        x: s,
        y: I
      };
      n.preventDefault(), o.actions.move(r);
    }
  }, {
    eventName: "touchend",
    fn: function(n) {
      var o = i();
      if (o.type !== "DRAGGING") {
        e();
        return;
      }
      n.preventDefault(), o.actions.drop({
        shouldBlockNextClick: !0
      }), t();
    }
  }, {
    eventName: "touchcancel",
    fn: function(n) {
      if (i().type !== "DRAGGING") {
        e();
        return;
      }
      n.preventDefault(), e();
    }
  }, {
    eventName: "touchforcechange",
    fn: function(n) {
      var o = i();
      o.type === "IDLE" && ae(!1);
      var g = n.touches[0];
      if (g) {
        var s = g.force >= $ie;
        if (s) {
          var I = o.actions.shouldRespectForcePress();
          if (o.type === "PENDING") {
            I && e();
            return;
          }
          if (I) {
            if (o.hasMoved) {
              n.preventDefault();
              return;
            }
            e();
            return;
          }
          n.preventDefault();
        }
      }
    }
  }, {
    eventName: _K,
    fn: e
  }];
}
function sNA(A) {
  var e = u.useRef(g5), t = u.useRef(du), i = DC(), n = He(function() {
    return e.current;
  }, []), o = He(function(l) {
    e.current = l;
  }, []), g = $t(function() {
    return {
      eventName: "touchstart",
      fn: function(l) {
        if (!l.defaultPrevented) {
          var Q = A.findClosestDraggableId(l);
          if (Q) {
            var E = A.tryGetLock(Q, I, {
              sourceEvent: l
            });
            if (E) {
              var d = l.touches[0], m = d.clientX, y = d.clientY, f = {
                x: m,
                y
              };
              t.current(), B(E, f);
            }
          }
        }
      }
    };
  }, [A]), s = He(function() {
    var l = {
      capture: !0,
      passive: !1
    };
    t.current = va(i.body, [g], l);
  }, [g]), I = He(function() {
    var l = e.current;
    l.type !== "IDLE" && (l.type === "PENDING" && clearTimeout(l.longPressTimerId), o(g5), t.current(), s());
  }, [s, o]), r = He(function() {
    var l = e.current;
    I(), l.type === "DRAGGING" && l.actions.cancel({
      shouldBlockNextClick: !0
    }), l.type === "PENDING" && l.actions.abort();
  }, [I]), a = He(function() {
    var l = {
      capture: !0,
      passive: !1
    }, Q = {
      cancel: r,
      completed: I,
      getPhase: n
    }, E = va(i.body, ene(Q), l), d = va(i.body, Ane(Q), l);
    t.current = function() {
      E(), d();
    };
  }, [r, n, I]), C = He(function() {
    var l = n();
    l.type !== "PENDING" && ae(!1);
    var Q = l.actions.fluidLift(l.point);
    o({
      type: "DRAGGING",
      actions: Q,
      hasMoved: !1
    });
  }, [n, o]), B = He(function(l, Q) {
    n().type !== "IDLE" && ae(!1);
    var E = setTimeout(C, Pie);
    o({
      type: "PENDING",
      point: Q,
      actions: l,
      longPressTimerId: E
    }), a();
  }, [a, n, o, C]);
  VI(function() {
    return s(), function() {
      t.current();
      var l = n();
      l.type === "PENDING" && (clearTimeout(l.longPressTimerId), o(g5));
    };
  }, [n, s, o]), VI(function() {
    var l = va(i.body, [{
      eventName: "touchmove",
      fn: function() {
      },
      options: {
        capture: !1,
        passive: !1
      }
    }]);
    return l;
  }, []);
}
var tne = {
  input: !0,
  button: !0,
  textarea: !0,
  select: !0,
  option: !0,
  optgroup: !0,
  video: !0,
  audio: !0
};
function INA(A, e) {
  if (e == null)
    return !1;
  var t = !!tne[e.tagName.toLowerCase()];
  if (t)
    return !0;
  var i = e.getAttribute("contenteditable");
  return i === "true" || i === "" ? !0 : e === A ? !1 : INA(A, e.parentElement);
}
function ine(A, e) {
  var t = e.target;
  return zK(t) ? INA(A, t) : !1;
}
var nne = function(A) {
  return Tr(A.getBoundingClientRect()).center;
};
function one(A) {
  return A instanceof ANA(A).Element;
}
var gne = function() {
  var A = "matches";
  if (typeof document > "u")
    return A;
  var e = [A, "msMatchesSelector", "webkitMatchesSelector"], t = Nd(e, function(i) {
    return i in Element.prototype;
  });
  return t || A;
}();
function aNA(A, e) {
  return A == null ? null : A[gne](e) ? A : aNA(A.parentElement, e);
}
function sne(A, e) {
  return A.closest ? A.closest(e) : aNA(A, e);
}
function Ine(A) {
  return "[" + Pw.contextId + '="' + A + '"]';
}
function ane(A, e) {
  var t = e.target;
  if (!one(t))
    return null;
  var i = Ine(A), n = sne(t, i);
  return n && zK(n) ? n : null;
}
function rne(A, e) {
  var t = ane(A, e);
  return t ? t.getAttribute(Pw.draggableId) : null;
}
function Cne(A, e, t) {
  var i = "[" + uq.contextId + '="' + e + '"]', n = yJA(A.querySelectorAll(i)), o = Nd(n, function(g) {
    return g.getAttribute(uq.id) === t;
  });
  return o && zK(o) ? o : null;
}
function Bne(A) {
  A.preventDefault();
}
function uM(A) {
  var e = A.expected, t = A.phase, i = A.isLockActive, n = A.shouldWarn;
  return i() ? e === t : !1;
}
function rNA(A) {
  var e = A.lockAPI, t = A.store, i = A.registry, n = A.draggableId;
  if (e.isClaimed())
    return !1;
  var o = i.draggable.findById(n);
  return o ? !(!o.options.isEnabled || !OJA(t.getState(), n)) : !1;
}
function lne(A) {
  var e = A.body, t = A.lockAPI, i = A.contextId, n = A.store, o = A.registry, g = A.draggableId, s = A.forceSensorStop, I = A.sourceEvent, r = rNA({
    lockAPI: t,
    store: n,
    registry: o,
    draggableId: g
  });
  if (!r)
    return null;
  var a = o.draggable.getById(g), C = Cne(e, i, a.descriptor.id);
  if (!C || I && !a.options.canDragInteractiveElements && ine(C, I))
    return null;
  var B = t.claim(s || du), l = "PRE_DRAG";
  function Q() {
    return a.options.shouldRespectForcePress;
  }
  function E() {
    return t.isActive(B);
  }
  function d(F, Z) {
    uM({
      expected: F,
      phase: l,
      isLockActive: E,
      shouldWarn: !0
    }) && n.dispatch(Z());
  }
  var m = d.bind(null, "DRAGGING");
  function y(F) {
    function Z() {
      t.release(), l = "COMPLETED";
    }
    l !== "PRE_DRAG" && (Z(), l !== "PRE_DRAG" && ae(!1)), n.dispatch(ate(F.liftActionArgs)), l = "DRAGGING";
    function c(J, p) {
      if (p === void 0 && (p = {
        shouldBlockNextClick: !1
      }), F.cleanup(), p.shouldBlockNextClick) {
        var N = va(window, [{
          eventName: "click",
          fn: Bne,
          options: {
            once: !0,
            passive: !1,
            capture: !0
          }
        }]);
        setTimeout(N);
      }
      Z(), n.dispatch(UJA({
        reason: J
      }));
    }
    return rt({
      isActive: function() {
        return uM({
          expected: "DRAGGING",
          phase: l,
          isLockActive: E,
          shouldWarn: !1
        });
      },
      shouldRespectForcePress: Q,
      drop: function(J) {
        return c("DROP", J);
      },
      cancel: function(J) {
        return c("CANCEL", J);
      }
    }, F.actions);
  }
  function f(F) {
    var Z = QY(function(J) {
      m(function() {
        return KJA({
          client: J
        });
      });
    }), c = y({
      liftActionArgs: {
        id: g,
        clientSelection: F,
        movementMode: "FLUID"
      },
      cleanup: function() {
        return Z.cancel();
      },
      actions: {
        move: Z
      }
    });
    return rt({}, c, {
      move: Z
    });
  }
  function w() {
    var F = {
      moveUp: function() {
        return m(dte);
      },
      moveRight: function() {
        return m(mte);
      },
      moveDown: function() {
        return m(hte);
      },
      moveLeft: function() {
        return m(pte);
      }
    };
    return y({
      liftActionArgs: {
        id: g,
        clientSelection: nne(C),
        movementMode: "SNAP"
      },
      cleanup: du,
      actions: F
    });
  }
  function G() {
    var F = uM({
      expected: "PRE_DRAG",
      phase: l,
      isLockActive: E,
      shouldWarn: !0
    });
    F && t.release();
  }
  var R = {
    isActive: function() {
      return uM({
        expected: "PRE_DRAG",
        phase: l,
        isLockActive: E,
        shouldWarn: !1
      });
    },
    shouldRespectForcePress: Q,
    fluidLift: f,
    snapLift: w,
    abort: G
  };
  return R;
}
var cne = [oNA, gNA, sNA];
function Qne(A) {
  var e = A.contextId, t = A.store, i = A.registry, n = A.customSensors, o = A.enableDefaultSensors, g = [].concat(o ? cne : [], n || []), s = u.useState(function() {
    return xie();
  })[0], I = He(function(y, f) {
    y.isDragging && !f.isDragging && s.tryAbandon();
  }, [s]);
  VI(function() {
    var y = t.getState(), f = t.subscribe(function() {
      var w = t.getState();
      I(y, w), y = w;
    });
    return f;
  }, [s, t, I]), VI(function() {
    return s.tryAbandon;
  }, [s.tryAbandon]);
  for (var r = DC(), a = He(function(y) {
    return rNA({
      lockAPI: s,
      registry: i,
      store: t,
      draggableId: y
    });
  }, [s, i, t]), C = He(function(y, f, w) {
    return lne({
      body: r.body,
      lockAPI: s,
      registry: i,
      contextId: e,
      store: t,
      draggableId: y,
      forceSensorStop: f,
      sourceEvent: w && w.sourceEvent ? w.sourceEvent : null
    });
  }, [e, s, i, t, r]), B = He(function(y) {
    return rne(e, y);
  }, [e]), l = He(function(y) {
    var f = i.draggable.findById(y);
    return f ? f.options : null;
  }, [i.draggable]), Q = He(function() {
    s.isClaimed() && (s.tryAbandon(), t.getState().phase !== "IDLE" && t.dispatch(T$()));
  }, [s, t]), E = He(s.isClaimed, [s]), d = $t(function() {
    return {
      canGetLock: a,
      tryGetLock: C,
      findClosestDraggableId: B,
      findOptionsForDraggable: l,
      tryReleaseLock: Q,
      isLockClaimed: E
    };
  }, [a, C, B, l, Q, E]), m = 0; m < g.length; m++)
    g[m](d);
}
var Ene = function(A) {
  return {
    onBeforeCapture: A.onBeforeCapture,
    onBeforeDragStart: A.onBeforeDragStart,
    onDragStart: A.onDragStart,
    onDragEnd: A.onDragEnd,
    onDragUpdate: A.onDragUpdate
  };
};
function sk(A) {
  return A.current || ae(!1), A.current;
}
function une(A) {
  var e = A.contextId, t = A.setCallbacks, i = A.sensors, n = A.nonce, o = A.dragHandleUsageInstructions, g = u.useRef(null), s = eNA(A), I = He(function() {
    return Ene(s.current);
  }, [s]), r = Nie(e), a = Mie({
    contextId: e,
    text: o
  }), C = bie(e, n), B = He(function(c) {
    sk(g).dispatch(c);
  }, []), l = $t(function() {
    return kCA({
      publishWhileDragging: Cte,
      updateDroppableScroll: lte,
      updateDroppableIsEnabled: cte,
      updateDroppableIsCombineEnabled: Qte,
      collectionStarting: Bte
    }, B);
  }, [B]), Q = Gie(), E = $t(function() {
    return eie(Q, l);
  }, [Q, l]), d = $t(function() {
    return die(rt({
      scrollWindow: tie,
      scrollDroppable: E.scrollDroppable
    }, kCA({
      move: KJA
    }, B)));
  }, [E.scrollDroppable, B]), m = fie(e), y = $t(function() {
    return jte({
      announce: r,
      autoScroller: d,
      dimensionMarshal: E,
      focusMarshal: m,
      getResponders: I,
      styleMarshal: C
    });
  }, [r, d, E, m, I, C]);
  g.current = y;
  var f = He(function() {
    var c = sk(g), J = c.getState();
    J.phase !== "IDLE" && c.dispatch(T$());
  }, []), w = He(function() {
    var c = sk(g).getState();
    return c.isDragging || c.phase === "DROP_ANIMATING";
  }, []), G = $t(function() {
    return {
      isDragging: w,
      tryAbort: f
    };
  }, [w, f]);
  t(G);
  var R = He(function(c) {
    return OJA(sk(g).getState(), c);
  }, []), F = He(function() {
    return Kh(sk(g).getState());
  }, []), Z = $t(function() {
    return {
      marshal: E,
      focus: m,
      contextId: e,
      canLift: R,
      isMovementAllowed: F,
      dragHandleUsageInstructionsId: a,
      registry: Q
    };
  }, [e, E, a, m, R, F, Q]);
  return Qne({
    contextId: e,
    store: y,
    registry: Q,
    customSensors: i,
    enableDefaultSensors: A.enableDefaultSensors !== !1
  }), u.useEffect(function() {
    return f;
  }, [f]), b.createElement(TK.Provider, {
    value: Z
  }, b.createElement(WAe, {
    context: e7,
    store: y
  }, A.children));
}
var dne = 0;
function hne() {
  return $t(function() {
    return "" + dne++;
  }, []);
}
function mne(A) {
  var e = hne(), t = A.dragHandleUsageInstructions || xL.dragHandleUsageInstructions;
  return b.createElement($Ae, null, function(i) {
    return b.createElement(une, {
      nonce: A.nonce,
      contextId: e,
      setCallbacks: i,
      dragHandleUsageInstructions: t,
      enableDefaultSensors: A.enableDefaultSensors,
      sensors: A.sensors,
      onBeforeCapture: A.onBeforeCapture,
      onBeforeDragStart: A.onBeforeDragStart,
      onDragStart: A.onDragStart,
      onDragUpdate: A.onDragUpdate,
      onDragEnd: A.onDragEnd
    }, A.children);
  });
}
var CNA = function(A) {
  return function(e) {
    return A === e;
  };
}, pne = CNA("scroll"), yne = CNA("auto"), cBA = function(A, e) {
  return e(A.overflowX) || e(A.overflowY);
}, bne = function(A) {
  var e = window.getComputedStyle(A), t = {
    overflowX: e.overflowX,
    overflowY: e.overflowY
  };
  return cBA(t, pne) || cBA(t, yne);
}, wne = function(A) {
  return !1;
}, fne = function A(e, t) {
  return t == null ? null : t === document.body ? wne() ? t : null : t === document.documentElement ? null : bne(t) ? t : A(e, t.parentElement);
}, dq = function(A) {
  return {
    x: A.scrollLeft,
    y: A.scrollTop
  };
}, Dne = function A(e) {
  if (!e)
    return !1;
  var t = window.getComputedStyle(e);
  return t.position === "fixed" ? !0 : A(e.parentElement);
}, Gne = function(A, e) {
  var t = fne(A, e), i = Dne(e);
  return {
    closestScrollable: t,
    isFixedOnPage: i
  };
}, kne = function(A) {
  var e = A.descriptor, t = A.isEnabled, i = A.isCombineEnabled, n = A.isFixedOnPage, o = A.direction, g = A.client, s = A.page, I = A.closest, r = function() {
    if (!I)
      return null;
    var l = I.scrollSize, Q = I.client, E = TJA({
      scrollHeight: l.scrollHeight,
      scrollWidth: l.scrollWidth,
      height: Q.paddingBox.height,
      width: Q.paddingBox.width
    });
    return {
      pageMarginBox: I.page.marginBox,
      frameClient: Q,
      scrollSize: l,
      shouldClipSubject: I.shouldClipSubject,
      scroll: {
        initial: I.scroll,
        current: I.scroll,
        max: E,
        diff: {
          value: Zo,
          displacement: Zo
        }
      }
    };
  }(), a = o === "vertical" ? K$ : GJA, C = Ow({
    page: s,
    withPlaceholder: null,
    axis: a,
    frame: r
  }), B = {
    descriptor: e,
    isCombineEnabled: i,
    isFixedOnPage: n,
    axis: a,
    isEnabled: t,
    client: g,
    page: s,
    frame: r,
    subject: C
  };
  return B;
}, Jne = function(A, e) {
  var t = EJA(A);
  if (!e || A !== e)
    return t;
  var i = t.paddingBox.top - e.scrollTop, n = t.paddingBox.left - e.scrollLeft, o = i + e.scrollHeight, g = n + e.scrollWidth, s = {
    top: i,
    right: g,
    bottom: o,
    left: n
  }, I = L$(s, t.border), r = v$({
    borderBox: I,
    margin: t.margin,
    border: t.border,
    padding: t.padding
  });
  return r;
}, Nne = function(A) {
  var e = A.ref, t = A.descriptor, i = A.env, n = A.windowScroll, o = A.direction, g = A.isDropDisabled, s = A.isCombineEnabled, I = A.shouldClipSubject, r = i.closestScrollable, a = Jne(e, r), C = dH(a, n), B = function() {
    if (!r)
      return null;
    var Q = EJA(r), E = {
      scrollHeight: r.scrollHeight,
      scrollWidth: r.scrollWidth
    };
    return {
      client: Q,
      page: dH(Q, n),
      scroll: dq(r),
      scrollSize: E,
      shouldClipSubject: I
    };
  }(), l = kne({
    descriptor: t,
    isEnabled: !g,
    isCombineEnabled: s,
    isFixedOnPage: i.isFixedOnPage,
    direction: o,
    client: a,
    page: C,
    closest: B
  });
  return l;
}, Yne = {
  passive: !1
}, Rne = {
  passive: !0
}, QBA = function(A) {
  return A.shouldPublishImmediately ? Yne : Rne;
};
function bH(A) {
  var e = u.useContext(A);
  return e || ae(!1), e;
}
var dM = function(A) {
  return A && A.env.closestScrollable || null;
};
function Fne(A) {
  var e = u.useRef(null), t = bH(TK), i = t7("droppable"), n = t.registry, o = t.marshal, g = eNA(A), s = $t(function() {
    return {
      id: A.droppableId,
      type: A.type,
      mode: A.mode
    };
  }, [A.droppableId, A.mode, A.type]), I = u.useRef(s), r = $t(function() {
    return Lo(function(G, R) {
      e.current || ae(!1);
      var F = {
        x: G,
        y: R
      };
      o.updateDroppableScroll(s.id, F);
    });
  }, [s.id, o]), a = He(function() {
    var G = e.current;
    return !G || !G.env.closestScrollable ? Zo : dq(G.env.closestScrollable);
  }, []), C = He(function() {
    var G = a();
    r(G.x, G.y);
  }, [a, r]), B = $t(function() {
    return QY(C);
  }, [C]), l = He(function() {
    var G = e.current, R = dM(G);
    G && R || ae(!1);
    var F = G.scrollOptions;
    if (F.shouldPublishImmediately) {
      C();
      return;
    }
    B();
  }, [B, C]), Q = DC(), E = He(function(G, R) {
    e.current && ae(!1);
    var F = g.current, Z = F.getDroppableRef();
    Z || ae(!1);
    var c = Gne(Q.body, Z), J = {
      ref: Z,
      descriptor: s,
      env: c,
      scrollOptions: R
    };
    e.current = J;
    var p = Nne({
      ref: Z,
      descriptor: s,
      env: c,
      windowScroll: G,
      direction: F.direction,
      isDropDisabled: F.isDropDisabled,
      isCombineEnabled: F.isCombineEnabled,
      shouldClipSubject: !F.ignoreContainerClipping
    }), N = c.closestScrollable;
    return N && (N.setAttribute(rBA.contextId, t.contextId), N.addEventListener("scroll", l, QBA(J.scrollOptions))), p;
  }, [t.contextId, s, l, g, Q]), d = He(function() {
    var G = e.current, R = dM(G);
    return G && R || ae(!1), dq(R);
  }, []), m = He(function() {
    var G = e.current;
    G || ae(!1);
    var R = dM(G);
    e.current = null, R && (B.cancel(), R.removeAttribute(rBA.contextId), R.removeEventListener("scroll", l, QBA(G.scrollOptions)));
  }, [l, B]), y = He(function(G) {
    var R = e.current;
    R || ae(!1);
    var F = dM(R);
    F || ae(!1), F.scrollTop += G.y, F.scrollLeft += G.x;
  }, []), f = $t(function() {
    return {
      getDimensionAndWatchScroll: E,
      getScrollWhileDragging: d,
      dragStopped: m,
      scroll: y
    };
  }, [m, E, d, y]), w = $t(function() {
    return {
      uniqueId: i,
      descriptor: s,
      callbacks: f
    };
  }, [f, s, i]);
  VI(function() {
    return I.current = w.descriptor, n.droppable.register(w), function() {
      e.current && m(), n.droppable.unregister(w);
    };
  }, [f, s, m, w, o, n.droppable]), VI(function() {
    e.current && o.updateDroppableIsEnabled(I.current.id, !A.isDropDisabled);
  }, [A.isDropDisabled, o]), VI(function() {
    e.current && o.updateDroppableIsCombineEnabled(I.current.id, A.isCombineEnabled);
  }, [A.isCombineEnabled, o]);
}
function s5() {
}
var Mne = {
  width: 0,
  height: 0,
  margin: oee
}, xne = function(A) {
  var e = A.isAnimatingOpenOnMount, t = A.placeholder, i = A.animate;
  return e || i === "close" ? Mne : {
    height: t.client.borderBox.height,
    width: t.client.borderBox.width,
    margin: t.client.margin
  };
}, Lne = function(A) {
  var e = A.isAnimatingOpenOnMount, t = A.placeholder, i = A.animate, n = xne({
    isAnimatingOpenOnMount: e,
    placeholder: t,
    animate: i
  });
  return {
    display: t.display,
    boxSizing: "border-box",
    width: n.width,
    height: n.height,
    marginTop: n.margin.top,
    marginRight: n.margin.right,
    marginBottom: n.margin.bottom,
    marginLeft: n.margin.left,
    flexShrink: "0",
    flexGrow: "0",
    pointerEvents: "none",
    transition: i !== "none" ? CN.placeholder : null
  };
};
function vne(A) {
  var e = u.useRef(null), t = He(function() {
    e.current && (clearTimeout(e.current), e.current = null);
  }, []), i = A.animate, n = A.onTransitionEnd, o = A.onClose, g = A.contextId, s = u.useState(A.animate === "open"), I = s[0], r = s[1];
  u.useEffect(function() {
    return I ? i !== "open" ? (t(), r(!1), s5) : e.current ? s5 : (e.current = setTimeout(function() {
      e.current = null, r(!1);
    }), t) : s5;
  }, [i, I, t]);
  var a = He(function(B) {
    B.propertyName === "height" && (n(), i === "close" && o());
  }, [i, o, n]), C = Lne({
    isAnimatingOpenOnMount: I,
    animate: A.animate,
    placeholder: A.placeholder
  });
  return b.createElement(A.placeholder.tagName, {
    style: C,
    "data-rbd-placeholder-context-id": g,
    onTransitionEnd: a,
    ref: A.innerRef
  });
}
var Hne = b.memo(vne), n7 = b.createContext(null), Sne = function(A) {
  $kA(e, A);
  function e() {
    for (var i, n = arguments.length, o = new Array(n), g = 0; g < n; g++)
      o[g] = arguments[g];
    return i = A.call.apply(A, [this].concat(o)) || this, i.state = {
      isVisible: !!i.props.on,
      data: i.props.on,
      animate: i.props.shouldAnimate && i.props.on ? "open" : "none"
    }, i.onClose = function() {
      i.state.animate === "close" && i.setState({
        isVisible: !1
      });
    }, i;
  }
  e.getDerivedStateFromProps = function(i, n) {
    return i.shouldAnimate ? i.on ? {
      isVisible: !0,
      data: i.on,
      animate: "open"
    } : n.isVisible ? {
      isVisible: !0,
      data: n.data,
      animate: "close"
    } : {
      isVisible: !1,
      animate: "close",
      data: null
    } : {
      isVisible: !!i.on,
      data: i.on,
      animate: "none"
    };
  };
  var t = e.prototype;
  return t.render = function() {
    if (!this.state.isVisible)
      return null;
    var i = {
      onClose: this.onClose,
      data: this.state.data,
      animate: this.state.animate
    };
    return this.props.children(i);
  }, e;
}(b.PureComponent), EBA = {
  dragging: 5e3,
  dropAnimating: 4500
}, Zne = function(A, e) {
  return e ? CN.drop(e.duration) : A ? CN.snap : CN.fluid;
}, Wne = function(A, e) {
  return A ? e ? hY.opacity.drop : hY.opacity.combining : null;
}, Kne = function(A) {
  return A.forceShouldAnimate != null ? A.forceShouldAnimate : A.mode === "SNAP";
};
function Une(A) {
  var e = A.dimension, t = e.client, i = A.offset, n = A.combineWith, o = A.dropping, g = !!n, s = Kne(A), I = !!o, r = I ? Qq.drop(i, g) : Qq.moveTo(i), a = {
    position: "fixed",
    top: t.marginBox.top,
    left: t.marginBox.left,
    boxSizing: "border-box",
    width: t.borderBox.width,
    height: t.borderBox.height,
    transition: Zne(s, o),
    transform: r,
    opacity: Wne(g, I),
    zIndex: I ? EBA.dropAnimating : EBA.dragging,
    pointerEvents: "none"
  };
  return a;
}
function Vne(A) {
  return {
    transform: Qq.moveTo(A.offset),
    transition: A.shouldAnimateDisplacement ? null : "none"
  };
}
function Xne(A) {
  return A.type === "DRAGGING" ? Une(A) : Vne(A);
}
function zne(A, e, t) {
  t === void 0 && (t = Zo);
  var i = window.getComputedStyle(e), n = e.getBoundingClientRect(), o = QJA(n, i), g = dH(o, t), s = {
    client: o,
    tagName: e.tagName.toLowerCase(),
    display: i.display
  }, I = {
    x: o.marginBox.width,
    y: o.marginBox.height
  }, r = {
    descriptor: A,
    placeholder: s,
    displaceBy: I,
    client: o,
    page: g
  };
  return r;
}
function Tne(A) {
  var e = t7("draggable"), t = A.descriptor, i = A.registry, n = A.getDraggableRef, o = A.canDragInteractiveElements, g = A.shouldRespectForcePress, s = A.isEnabled, I = $t(function() {
    return {
      canDragInteractiveElements: o,
      shouldRespectForcePress: g,
      isEnabled: s
    };
  }, [o, s, g]), r = He(function(l) {
    var Q = n();
    return Q || ae(!1), zne(t, Q, l);
  }, [t, n]), a = $t(function() {
    return {
      uniqueId: e,
      descriptor: t,
      options: I,
      getDimension: r
    };
  }, [t, r, I, e]), C = u.useRef(a), B = u.useRef(!0);
  VI(function() {
    return i.draggable.register(C.current), function() {
      return i.draggable.unregister(C.current);
    };
  }, [i.draggable]), VI(function() {
    if (B.current) {
      B.current = !1;
      return;
    }
    var l = C.current;
    C.current = a, i.draggable.update(a, l);
  }, [a, i.draggable]);
}
function _ne(A, e, t) {
  DC();
}
function qne(A) {
  A.preventDefault();
}
function One(A) {
  var e = u.useRef(null), t = He(function(c) {
    e.current = c;
  }, []), i = He(function() {
    return e.current;
  }, []), n = bH(TK), o = n.contextId, g = n.dragHandleUsageInstructionsId, s = n.registry, I = bH(n7), r = I.type, a = I.droppableId, C = $t(function() {
    return {
      id: A.draggableId,
      index: A.index,
      type: r,
      droppableId: a
    };
  }, [A.draggableId, A.index, r, a]), B = A.children, l = A.draggableId, Q = A.isEnabled, E = A.shouldRespectForcePress, d = A.canDragInteractiveElements, m = A.isClone, y = A.mapped, f = A.dropAnimationFinished;
  if (_ne(), !m) {
    var w = $t(function() {
      return {
        descriptor: C,
        registry: s,
        getDraggableRef: i,
        canDragInteractiveElements: d,
        shouldRespectForcePress: E,
        isEnabled: Q
      };
    }, [C, s, i, d, E, Q]);
    Tne(w);
  }
  var G = $t(function() {
    return Q ? {
      tabIndex: 0,
      role: "button",
      "aria-describedby": g,
      "data-rbd-drag-handle-draggable-id": l,
      "data-rbd-drag-handle-context-id": o,
      draggable: !1,
      onDragStart: qne
    } : null;
  }, [o, g, l, Q]), R = He(function(c) {
    y.type === "DRAGGING" && y.dropping && c.propertyName === "transform" && f();
  }, [f, y]), F = $t(function() {
    var c = Xne(y), J = y.type === "DRAGGING" && y.dropping ? R : null, p = {
      innerRef: t,
      draggableProps: {
        "data-rbd-draggable-context-id": o,
        "data-rbd-draggable-id": l,
        style: c,
        onTransitionEnd: J
      },
      dragHandleProps: G
    };
    return p;
  }, [o, G, l, y, R, t]), Z = $t(function() {
    return {
      draggableId: C.id,
      type: C.type,
      source: {
        index: C.index,
        droppableId: C.droppableId
      }
    };
  }, [C.droppableId, C.id, C.index, C.type]);
  return B(F, y.snapshot, Z);
}
var BNA = function(A, e) {
  return A === e;
}, lNA = function(A) {
  var e = A.combine, t = A.destination;
  return t ? t.droppableId : e ? e.droppableId : null;
}, jne = function(A) {
  return A.combine ? A.combine.draggableId : null;
}, Pne = function(A) {
  return A.at && A.at.type === "COMBINE" ? A.at.combine.draggableId : null;
};
function $ne() {
  var A = Lo(function(n, o) {
    return {
      x: n,
      y: o
    };
  }), e = Lo(function(n, o, g, s, I) {
    return {
      isDragging: !0,
      isClone: o,
      isDropAnimating: !!I,
      dropAnimation: I,
      mode: n,
      draggingOver: g,
      combineWith: s,
      combineTargetFor: null
    };
  }), t = Lo(function(n, o, g, s, I, r, a) {
    return {
      mapped: {
        type: "DRAGGING",
        dropping: null,
        draggingOver: I,
        combineWith: r,
        mode: o,
        offset: n,
        dimension: g,
        forceShouldAnimate: a,
        snapshot: e(o, s, I, r, null)
      }
    };
  }), i = function(n, o) {
    if (n.isDragging) {
      if (n.critical.draggable.id !== o.draggableId)
        return null;
      var g = n.current.client.offset, s = n.dimensions.draggables[o.draggableId], I = UI(n.impact), r = Pne(n.impact), a = n.forceShouldAnimate;
      return t(A(g.x, g.y), n.movementMode, s, o.isClone, I, r, a);
    }
    if (n.phase === "DROP_ANIMATING") {
      var C = n.completed;
      if (C.result.draggableId !== o.draggableId)
        return null;
      var B = o.isClone, l = n.dimensions.draggables[o.draggableId], Q = C.result, E = Q.mode, d = lNA(Q), m = jne(Q), y = n.dropDuration, f = {
        duration: y,
        curve: q$.drop,
        moveTo: n.newHomeClientOffset,
        opacity: m ? hY.opacity.drop : null,
        scale: m ? hY.scale.drop : null
      };
      return {
        mapped: {
          type: "DRAGGING",
          offset: n.newHomeClientOffset,
          dimension: l,
          dropping: f,
          draggingOver: d,
          combineWith: m,
          mode: E,
          forceShouldAnimate: null,
          snapshot: e(E, B, d, m, f)
        }
      };
    }
    return null;
  };
  return i;
}
function cNA(A) {
  return {
    isDragging: !1,
    isDropAnimating: !1,
    isClone: !1,
    dropAnimation: null,
    mode: null,
    draggingOver: null,
    combineTargetFor: A,
    combineWith: null
  };
}
var Aoe = {
  mapped: {
    type: "SECONDARY",
    offset: Zo,
    combineTargetFor: null,
    shouldAnimateDisplacement: !0,
    snapshot: cNA(null)
  }
};
function eoe() {
  var A = Lo(function(g, s) {
    return {
      x: g,
      y: s
    };
  }), e = Lo(cNA), t = Lo(function(g, s, I) {
    return s === void 0 && (s = null), {
      mapped: {
        type: "SECONDARY",
        offset: g,
        combineTargetFor: s,
        shouldAnimateDisplacement: I,
        snapshot: e(s)
      }
    };
  }), i = function(g) {
    return g ? t(Zo, g, !0) : null;
  }, n = function(g, s, I, r) {
    var a = I.displaced.visible[g], C = !!(r.inVirtualList && r.effected[g]), B = UK(I), l = B && B.draggableId === g ? s : null;
    if (!a) {
      if (!C)
        return i(l);
      if (I.displaced.invisible[g])
        return null;
      var Q = uD(r.displacedBy.point), E = A(Q.x, Q.y);
      return t(E, l, !0);
    }
    if (C)
      return i(l);
    var d = I.displacedBy.point, m = A(d.x, d.y);
    return t(m, l, a.shouldAnimate);
  }, o = function(g, s) {
    if (g.isDragging)
      return g.critical.draggable.id === s.draggableId ? null : n(s.draggableId, g.critical.draggable.id, g.impact, g.afterCritical);
    if (g.phase === "DROP_ANIMATING") {
      var I = g.completed;
      return I.result.draggableId === s.draggableId ? null : n(s.draggableId, I.result.draggableId, I.impact, I.afterCritical);
    }
    return null;
  };
  return o;
}
var toe = function() {
  var A = $ne(), e = eoe(), t = function(i, n) {
    return A(i, n) || e(i, n) || Aoe;
  };
  return t;
}, ioe = {
  dropAnimationFinished: VJA
}, noe = lJA(toe, ioe, null, {
  context: e7,
  areStatePropsEqual: BNA
})(One);
function QNA(A) {
  var e = bH(n7), t = e.isUsingCloneFor;
  return t === A.draggableId && !A.isClone ? null : b.createElement(noe, A);
}
function mD(A) {
  var e = typeof A.isDragDisabled == "boolean" ? !A.isDragDisabled : !0, t = !!A.disableInteractiveElementBlocking, i = !!A.shouldRespectForcePress;
  return b.createElement(QNA, rt({}, A, {
    isClone: !1,
    isEnabled: e,
    canDragInteractiveElements: t,
    shouldRespectForcePress: i
  }));
}
function ooe(A) {
  var e = u.useContext(TK);
  e || ae(!1);
  var t = e.contextId, i = e.isMovementAllowed, n = u.useRef(null), o = u.useRef(null), g = A.children, s = A.droppableId, I = A.type, r = A.mode, a = A.direction, C = A.ignoreContainerClipping, B = A.isDropDisabled, l = A.isCombineEnabled, Q = A.snapshot, E = A.useClone, d = A.updateViewportMaxScroll, m = A.getContainerForClone, y = He(function() {
    return n.current;
  }, []), f = He(function(N) {
    n.current = N;
  }, []);
  He(function() {
    return o.current;
  }, []);
  var w = He(function(N) {
    o.current = N;
  }, []), G = He(function() {
    i() && d({
      maxScroll: qJA()
    });
  }, [i, d]);
  Fne({
    droppableId: s,
    type: I,
    mode: r,
    direction: a,
    isDropDisabled: B,
    isCombineEnabled: l,
    ignoreContainerClipping: C,
    getDroppableRef: y
  });
  var R = b.createElement(Sne, {
    on: A.placeholder,
    shouldAnimate: A.shouldAnimatePlaceholder
  }, function(N) {
    var v = N.onClose, K = N.data, U = N.animate;
    return b.createElement(Hne, {
      placeholder: K,
      onClose: v,
      innerRef: w,
      animate: U,
      contextId: t,
      onTransitionEnd: G
    });
  }), F = $t(function() {
    return {
      innerRef: f,
      placeholder: R,
      droppableProps: {
        "data-rbd-droppable-id": s,
        "data-rbd-droppable-context-id": t
      }
    };
  }, [t, s, R, f]), Z = E ? E.dragging.draggableId : null, c = $t(function() {
    return {
      droppableId: s,
      type: I,
      isUsingCloneFor: Z
    };
  }, [s, Z, I]), J = DC();
  function p() {
    if (!E)
      return null;
    var N = E.dragging, v = E.render, K = b.createElement(QNA, {
      draggableId: N.draggableId,
      index: N.source.index,
      isClone: !0,
      isEnabled: !0,
      shouldRespectForcePress: !1,
      canDragInteractiveElements: !0
    }, function(U, j) {
      return v(U, j, N);
    });
    return kd.createPortal(K, m ? m() : J.body);
  }
  return b.createElement(n7.Provider, {
    value: c
  }, g(F, Q), p());
}
var I5 = function(A, e) {
  return A === e.droppable.type;
}, uBA = function(A, e) {
  return e.draggables[A.draggable.id];
}, goe = function() {
  var A = {
    placeholder: null,
    shouldAnimatePlaceholder: !0,
    snapshot: {
      isDraggingOver: !1,
      draggingOverWith: null,
      draggingFromThisWith: null,
      isUsingPlaceholder: !1
    },
    useClone: null
  }, e = rt({}, A, {
    shouldAnimatePlaceholder: !1
  }), t = Lo(function(o) {
    return {
      draggableId: o.id,
      type: o.type,
      source: {
        index: o.index,
        droppableId: o.droppableId
      }
    };
  }), i = Lo(function(o, g, s, I, r, a) {
    var C = r.descriptor.id, B = r.descriptor.droppableId === o;
    if (B) {
      var l = a ? {
        render: a,
        dragging: t(r.descriptor)
      } : null, Q = {
        isDraggingOver: s,
        draggingOverWith: s ? C : null,
        draggingFromThisWith: C,
        isUsingPlaceholder: !0
      };
      return {
        placeholder: r.placeholder,
        shouldAnimatePlaceholder: !1,
        snapshot: Q,
        useClone: l
      };
    }
    if (!g)
      return e;
    if (!I)
      return A;
    var E = {
      isDraggingOver: s,
      draggingOverWith: C,
      draggingFromThisWith: null,
      isUsingPlaceholder: !0
    };
    return {
      placeholder: r.placeholder,
      shouldAnimatePlaceholder: !0,
      snapshot: E,
      useClone: null
    };
  }), n = function(o, g) {
    var s = g.droppableId, I = g.type, r = !g.isDropDisabled, a = g.renderClone;
    if (o.isDragging) {
      var C = o.critical;
      if (!I5(I, C))
        return e;
      var B = uBA(C, o.dimensions), l = UI(o.impact) === s;
      return i(s, r, l, l, B, a);
    }
    if (o.phase === "DROP_ANIMATING") {
      var Q = o.completed;
      if (!I5(I, Q.critical))
        return e;
      var E = uBA(Q.critical, o.dimensions);
      return i(s, r, lNA(Q.result) === s, UI(Q.impact) === s, E, a);
    }
    if (o.phase === "IDLE" && o.completed && !o.shouldFlush) {
      var d = o.completed;
      if (!I5(I, d.critical))
        return e;
      var m = UI(d.impact) === s, y = !!(d.impact.at && d.impact.at.type === "COMBINE"), f = d.critical.droppable.id === s;
      return m ? y ? A : e : f ? A : e;
    }
    return e;
  };
  return n;
}, soe = {
  updateViewportMaxScroll: ute
}, Ioe = {
  mode: "standard",
  type: "DEFAULT",
  direction: "vertical",
  isDropDisabled: !1,
  isCombineEnabled: !1,
  ignoreContainerClipping: !1,
  renderClone: null,
  getContainerForClone: null
}, ep = lJA(goe, soe, null, {
  context: e7,
  areStatePropsEqual: BNA
})(ooe);
ep.defaultProps = Ioe;
function Ot(A) {
  for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  throw new Error(typeof A == "number" ? "[MobX] minified error nr: " + A + (t.length ? " " + t.map(String).join(",") : "") + ". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts" : "[MobX] " + A);
}
var aoe = {};
function o7() {
  return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : aoe;
}
var ENA = Object.assign, wH = Object.getOwnPropertyDescriptor, KB = Object.defineProperty, hR = Object.prototype, hq = [];
Object.freeze(hq);
var uNA = {};
Object.freeze(uNA);
var roe = typeof Proxy < "u", Coe = /* @__PURE__ */ Object.toString();
function dNA() {
  roe || Ot("Proxy not available");
}
function hNA(A) {
  var e = !1;
  return function() {
    if (!e)
      return e = !0, A.apply(this, arguments);
  };
}
var Rb = function() {
};
function uC(A) {
  return typeof A == "function";
}
function tp(A) {
  var e = typeof A;
  switch (e) {
    case "string":
    case "symbol":
    case "number":
      return !0;
  }
  return !1;
}
function qK(A) {
  return A !== null && typeof A == "object";
}
function aQ(A) {
  if (!qK(A))
    return !1;
  var e = Object.getPrototypeOf(A);
  if (e == null)
    return !0;
  var t = Object.hasOwnProperty.call(e, "constructor") && e.constructor;
  return typeof t == "function" && t.toString() === Coe;
}
function mNA(A) {
  var e = A == null ? void 0 : A.constructor;
  return e ? e.name === "GeneratorFunction" || e.displayName === "GeneratorFunction" : !1;
}
function mR(A, e, t) {
  KB(A, e, {
    enumerable: !1,
    writable: !0,
    configurable: !0,
    value: t
  });
}
function pNA(A, e, t) {
  KB(A, e, {
    enumerable: !1,
    writable: !1,
    configurable: !0,
    value: t
  });
}
function Yd(A, e) {
  var t = "isMobX" + A;
  return e.prototype[t] = !0, function(i) {
    return qK(i) && i[t] === !0;
  };
}
function pD(A) {
  return A instanceof Map;
}
function pR(A) {
  return A instanceof Set;
}
var yNA = typeof Object.getOwnPropertySymbols < "u";
function Boe(A) {
  var e = Object.keys(A);
  if (!yNA)
    return e;
  var t = Object.getOwnPropertySymbols(A);
  return t.length ? [].concat(e, t.filter(function(i) {
    return hR.propertyIsEnumerable.call(A, i);
  })) : e;
}
var $w = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : yNA ? function(A) {
  return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A));
} : (
  /* istanbul ignore next */
  Object.getOwnPropertyNames
);
function bNA(A) {
  return A === null ? null : typeof A == "object" ? "" + A : A;
}
function zc(A, e) {
  return hR.hasOwnProperty.call(A, e);
}
var loe = Object.getOwnPropertyDescriptors || function(A) {
  var e = {};
  return $w(A).forEach(function(t) {
    e[t] = wH(A, t);
  }), e;
};
function dBA(A, e) {
  for (var t = 0; t < e.length; t++) {
    var i = e[t];
    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(A, Eoe(i.key), i);
  }
}
function g7(A, e, t) {
  return e && dBA(A.prototype, e), t && dBA(A, t), Object.defineProperty(A, "prototype", {
    writable: !1
  }), A;
}
function ip() {
  return ip = Object.assign ? Object.assign.bind() : function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, ip.apply(this, arguments);
}
function wNA(A, e) {
  A.prototype = Object.create(e.prototype), A.prototype.constructor = A, mq(A, e);
}
function mq(A, e) {
  return mq = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, i) {
    return t.__proto__ = i, t;
  }, mq(A, e);
}
function a5(A) {
  if (A === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return A;
}
function coe(A, e) {
  if (A) {
    if (typeof A == "string")
      return hBA(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    if (t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set")
      return Array.from(A);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return hBA(A, e);
  }
}
function hBA(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}
function Fb(A, e) {
  var t = typeof Symbol < "u" && A[Symbol.iterator] || A["@@iterator"];
  if (t)
    return (t = t.call(A)).next.bind(t);
  if (Array.isArray(A) || (t = coe(A)) || e && A && typeof A.length == "number") {
    t && (A = t);
    var i = 0;
    return function() {
      return i >= A.length ? {
        done: !0
      } : {
        done: !1,
        value: A[i++]
      };
    };
  }
  throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Qoe(A, e) {
  if (typeof A != "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (typeof i != "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function Eoe(A) {
  var e = Qoe(A, "string");
  return typeof e == "symbol" ? e : String(e);
}
var kB = /* @__PURE__ */ Symbol("mobx-stored-annotations");
function UB(A) {
  function e(t, i) {
    if (yR(i))
      return A.decorate_20223_(t, i);
    yD(t, i, A);
  }
  return Object.assign(e, A);
}
function yD(A, e, t) {
  zc(A, kB) || mR(A, kB, ip({}, A[kB])), foe(t) || (A[kB][e] = t);
}
function uoe(A) {
  return zc(A, kB) || mR(A, kB, ip({}, A[kB])), A[kB];
}
function yR(A) {
  return typeof A == "object" && typeof A.kind == "string";
}
var _e = /* @__PURE__ */ Symbol("mobx administration"), bR = /* @__PURE__ */ function() {
  function A(t) {
    t === void 0 && (t = "Atom"), this.name_ = void 0, this.isPendingUnobservation_ = !1, this.isBeingObserved_ = !1, this.observers_ = /* @__PURE__ */ new Set(), this.batchId_ = void 0, this.diffValue_ = 0, this.lastAccessedBy_ = 0, this.lowestObserverState_ = si.NOT_TRACKING_, this.onBOL = void 0, this.onBUOL = void 0, this.name_ = t, this.batchId_ = oe.inBatch ? oe.batchId : NaN;
  }
  var e = A.prototype;
  return e.onBO = function() {
    this.onBOL && this.onBOL.forEach(function(t) {
      return t();
    });
  }, e.onBUO = function() {
    this.onBUOL && this.onBUOL.forEach(function(t) {
      return t();
    });
  }, e.reportObserved = function() {
    return UNA(this);
  }, e.reportChanged = function() {
    (!oe.inBatch || this.batchId_ !== oe.batchId) && (oe.stateVersion = oe.stateVersion < Number.MAX_SAFE_INTEGER ? oe.stateVersion + 1 : Number.MIN_SAFE_INTEGER, this.batchId_ = NaN), Ha(), VNA(this), Sa();
  }, e.toString = function() {
    return this.name_;
  }, A;
}(), s7 = /* @__PURE__ */ Yd("Atom", bR);
function fNA(A, e, t) {
  e === void 0 && (e = Rb), t === void 0 && (t = Rb);
  var i = new bR(A);
  return e !== Rb && kge(i, e), t !== Rb && jNA(i, t), i;
}
function doe(A, e) {
  return A === e;
}
function hoe(A, e) {
  return Q7(A, e);
}
function moe(A, e) {
  return Q7(A, e, 1);
}
function poe(A, e) {
  return Object.is ? Object.is(A, e) : A === e ? A !== 0 || 1 / A === 1 / e : A !== A && e !== e;
}
var fH = {
  identity: doe,
  structural: hoe,
  default: poe,
  shallow: moe
};
function bD(A, e, t) {
  return B7(A) ? A : Array.isArray(A) ? to.array(A, {
    name: t
  }) : aQ(A) ? to.object(A, void 0, {
    name: t
  }) : pD(A) ? to.map(A, {
    name: t
  }) : pR(A) ? to.set(A, {
    name: t
  }) : typeof A == "function" && !PK(A) && !yY(A) ? mNA(A) ? ef(A) : pY(t, A) : A;
}
function yoe(A, e, t) {
  if (A == null || tf(A) || JR(A) || Fd(A) || _p(A))
    return A;
  if (Array.isArray(A))
    return to.array(A, {
      name: t,
      deep: !1
    });
  if (aQ(A))
    return to.object(A, void 0, {
      name: t,
      deep: !1
    });
  if (pD(A))
    return to.map(A, {
      name: t,
      deep: !1
    });
  if (pR(A))
    return to.set(A, {
      name: t,
      deep: !1
    });
}
function OK(A) {
  return A;
}
function boe(A, e) {
  return Q7(A, e) ? e : A;
}
var woe = "override";
function foe(A) {
  return A.annotationType_ === woe;
}
function wR(A, e) {
  return {
    annotationType_: A,
    options_: e,
    make_: Doe,
    extend_: Goe,
    decorate_20223_: koe
  };
}
function Doe(A, e, t, i) {
  var n;
  if ((n = this.options_) != null && n.bound)
    return this.extend_(A, e, t, !1) === null ? 0 : 1;
  if (i === A.target_)
    return this.extend_(A, e, t, !1) === null ? 0 : 2;
  if (PK(t.value))
    return 1;
  var o = DNA(A, this, e, t, !1);
  return KB(i, e, o), 2;
}
function Goe(A, e, t, i) {
  var n = DNA(A, this, e, t);
  return A.defineProperty_(e, n, i);
}
function koe(A, e) {
  var t = e.kind, i = e.name, n = e.addInitializer, o = this, g = function(I) {
    var r, a, C, B;
    return np((r = (a = o.options_) == null ? void 0 : a.name) != null ? r : i.toString(), I, (C = (B = o.options_) == null ? void 0 : B.autoAction) != null ? C : !1);
  };
  if (t == "field") {
    n(function() {
      yD(this, i, o);
    });
    return;
  }
  if (t == "method") {
    var s;
    return PK(A) || (A = g(A)), (s = this.options_) != null && s.bound && n(function() {
      var I = this, r = I[i].bind(I);
      r.isMobxAction = !0, I[i] = r;
    }), A;
  }
  Ot("Cannot apply '" + o.annotationType_ + "' to '" + String(i) + "' (kind: " + t + "):" + (`
'` + o.annotationType_ + "' can only be used on properties with a function value."));
}
function Joe(A, e, t, i) {
  e.annotationType_, i.value;
}
function DNA(A, e, t, i, n) {
  var o, g, s, I, r, a, C;
  n === void 0 && (n = oe.safeDescriptors), Joe(A, e, t, i);
  var B = i.value;
  if ((o = e.options_) != null && o.bound) {
    var l;
    B = B.bind((l = A.proxy_) != null ? l : A.target_);
  }
  return {
    value: np(
      (g = (s = e.options_) == null ? void 0 : s.name) != null ? g : t.toString(),
      B,
      (I = (r = e.options_) == null ? void 0 : r.autoAction) != null ? I : !1,
      // https://github.com/mobxjs/mobx/discussions/3140
      (a = e.options_) != null && a.bound ? (C = A.proxy_) != null ? C : A.target_ : void 0
    ),
    // Non-configurable for classes
    // prevents accidental field redefinition in subclass
    configurable: n ? A.isPlainObject_ : !0,
    // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058
    enumerable: !1,
    // Non-obsevable, therefore non-writable
    // Also prevents rewriting in subclass constructor
    writable: !n
  };
}
function GNA(A, e) {
  return {
    annotationType_: A,
    options_: e,
    make_: Noe,
    extend_: Yoe,
    decorate_20223_: Roe
  };
}
function Noe(A, e, t, i) {
  var n;
  if (i === A.target_)
    return this.extend_(A, e, t, !1) === null ? 0 : 2;
  if ((n = this.options_) != null && n.bound && (!zc(A.target_, e) || !yY(A.target_[e])) && this.extend_(A, e, t, !1) === null)
    return 0;
  if (yY(t.value))
    return 1;
  var o = kNA(A, this, e, t, !1, !1);
  return KB(i, e, o), 2;
}
function Yoe(A, e, t, i) {
  var n, o = kNA(A, this, e, t, (n = this.options_) == null ? void 0 : n.bound);
  return A.defineProperty_(e, o, i);
}
function Roe(A, e) {
  var t, i = e.name, n = e.addInitializer;
  return yY(A) || (A = ef(A)), (t = this.options_) != null && t.bound && n(function() {
    var o = this, g = o[i].bind(o);
    g.isMobXFlow = !0, o[i] = g;
  }), A;
}
function Foe(A, e, t, i) {
  e.annotationType_, i.value;
}
function kNA(A, e, t, i, n, o) {
  o === void 0 && (o = oe.safeDescriptors), Foe(A, e, t, i);
  var g = i.value;
  if (yY(g) || (g = ef(g)), n) {
    var s;
    g = g.bind((s = A.proxy_) != null ? s : A.target_), g.isMobXFlow = !0;
  }
  return {
    value: g,
    // Non-configurable for classes
    // prevents accidental field redefinition in subclass
    configurable: o ? A.isPlainObject_ : !0,
    // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058
    enumerable: !1,
    // Non-obsevable, therefore non-writable
    // Also prevents rewriting in subclass constructor
    writable: !o
  };
}
function I7(A, e) {
  return {
    annotationType_: A,
    options_: e,
    make_: Moe,
    extend_: xoe,
    decorate_20223_: Loe
  };
}
function Moe(A, e, t) {
  return this.extend_(A, e, t, !1) === null ? 0 : 1;
}
function xoe(A, e, t, i) {
  return voe(A, this, e, t), A.defineComputedProperty_(e, ip({}, this.options_, {
    get: t.get,
    set: t.set
  }), i);
}
function Loe(A, e) {
  var t = this, i = e.name, n = e.addInitializer;
  return n(function() {
    var o = qp(this)[_e], g = ip({}, t.options_, {
      get: A,
      context: this
    });
    g.name || (g.name = "ObservableObject." + i.toString()), o.values_.set(i, new Af(g));
  }), function() {
    return this[_e].getObservablePropValue_(i);
  };
}
function voe(A, e, t, i) {
  e.annotationType_, i.get;
}
function jK(A, e) {
  return {
    annotationType_: A,
    options_: e,
    make_: Hoe,
    extend_: Soe,
    decorate_20223_: Zoe
  };
}
function Hoe(A, e, t) {
  return this.extend_(A, e, t, !1) === null ? 0 : 1;
}
function Soe(A, e, t, i) {
  var n, o;
  return Woe(A, this), A.defineObservableProperty_(e, t.value, (n = (o = this.options_) == null ? void 0 : o.enhancer) != null ? n : bD, i);
}
function Zoe(A, e) {
  var t = this, i = e.kind, n = e.name, o = /* @__PURE__ */ new WeakSet();
  function g(s, I) {
    var r, a, C = qp(s)[_e], B = new pu(I, (r = (a = t.options_) == null ? void 0 : a.enhancer) != null ? r : bD, "ObservableObject." + n.toString(), !1);
    C.values_.set(n, B), o.add(s);
  }
  if (i == "accessor")
    return {
      get: function() {
        return o.has(this) || g(this, A.get.call(this)), this[_e].getObservablePropValue_(n);
      },
      set: function(s) {
        return o.has(this) || g(this, s), this[_e].setObservablePropValue_(n, s);
      },
      init: function(s) {
        return o.has(this) || g(this, s), s;
      }
    };
}
function Woe(A, e, t, i) {
  e.annotationType_;
}
var Koe = "true", Uoe = /* @__PURE__ */ JNA();
function JNA(A) {
  return {
    annotationType_: Koe,
    options_: A,
    make_: Voe,
    extend_: Xoe,
    decorate_20223_: zoe
  };
}
function Voe(A, e, t, i) {
  var n, o;
  if (t.get)
    return fR.make_(A, e, t, i);
  if (t.set) {
    var g = np(e.toString(), t.set);
    return i === A.target_ ? A.defineProperty_(e, {
      configurable: oe.safeDescriptors ? A.isPlainObject_ : !0,
      set: g
    }) === null ? 0 : 2 : (KB(i, e, {
      configurable: !0,
      set: g
    }), 2);
  }
  if (i !== A.target_ && typeof t.value == "function") {
    var s;
    if (mNA(t.value)) {
      var I, r = (I = this.options_) != null && I.autoBind ? ef.bound : ef;
      return r.make_(A, e, t, i);
    }
    var a = (s = this.options_) != null && s.autoBind ? pY.bound : pY;
    return a.make_(A, e, t, i);
  }
  var C = ((n = this.options_) == null ? void 0 : n.deep) === !1 ? to.ref : to;
  if (typeof t.value == "function" && (o = this.options_) != null && o.autoBind) {
    var B;
    t.value = t.value.bind((B = A.proxy_) != null ? B : A.target_);
  }
  return C.make_(A, e, t, i);
}
function Xoe(A, e, t, i) {
  var n, o;
  if (t.get)
    return fR.extend_(A, e, t, i);
  if (t.set)
    return A.defineProperty_(e, {
      configurable: oe.safeDescriptors ? A.isPlainObject_ : !0,
      set: np(e.toString(), t.set)
    }, i);
  if (typeof t.value == "function" && (n = this.options_) != null && n.autoBind) {
    var g;
    t.value = t.value.bind((g = A.proxy_) != null ? g : A.target_);
  }
  var s = ((o = this.options_) == null ? void 0 : o.deep) === !1 ? to.ref : to;
  return s.extend_(A, e, t, i);
}
function zoe(A, e) {
  Ot("'" + this.annotationType_ + "' cannot be used as a decorator");
}
var Toe = "observable", _oe = "observable.ref", qoe = "observable.shallow", Ooe = "observable.struct", NNA = {
  deep: !0,
  name: void 0,
  defaultDecorator: void 0,
  proxy: !0
};
Object.freeze(NNA);
function hM(A) {
  return A || NNA;
}
var pq = /* @__PURE__ */ jK(Toe), joe = /* @__PURE__ */ jK(_oe, {
  enhancer: OK
}), Poe = /* @__PURE__ */ jK(qoe, {
  enhancer: yoe
}), $oe = /* @__PURE__ */ jK(Ooe, {
  enhancer: boe
}), YNA = /* @__PURE__ */ UB(pq);
function mM(A) {
  return A.deep === !0 ? bD : A.deep === !1 ? OK : ege(A.defaultDecorator);
}
function Age(A) {
  var e;
  return A ? (e = A.defaultDecorator) != null ? e : JNA(A) : void 0;
}
function ege(A) {
  var e, t;
  return A && (e = (t = A.options_) == null ? void 0 : t.enhancer) != null ? e : bD;
}
function RNA(A, e, t) {
  if (yR(e))
    return pq.decorate_20223_(A, e);
  if (tp(e)) {
    yD(A, e, pq);
    return;
  }
  return B7(A) ? A : aQ(A) ? to.object(A, e, t) : Array.isArray(A) ? to.array(A, e) : pD(A) ? to.map(A, e) : pR(A) ? to.set(A, e) : typeof A == "object" && A !== null ? A : to.box(A, e);
}
ENA(RNA, YNA);
var tge = {
  box: function(A, e) {
    var t = hM(e);
    return new pu(A, mM(t), t.name, !0, t.equals);
  },
  array: function(A, e) {
    var t = hM(e);
    return (oe.useProxies === !1 || t.proxy === !1 ? Ase : Vge)(A, mM(t), t.name);
  },
  map: function(A, e) {
    var t = hM(e);
    return new oYA(A, mM(t), t.name);
  },
  set: function(A, e) {
    var t = hM(e);
    return new IYA(A, mM(t), t.name);
  },
  object: function(A, e, t) {
    return Md(function() {
      return $NA(oe.useProxies === !1 || (t == null ? void 0 : t.proxy) === !1 ? qp({}, t) : Sge({}, t), A, e);
    });
  },
  ref: /* @__PURE__ */ UB(joe),
  shallow: /* @__PURE__ */ UB(Poe),
  deep: YNA,
  struct: /* @__PURE__ */ UB($oe)
}, to = /* @__PURE__ */ ENA(RNA, tge), FNA = "computed", ige = "computed.struct", yq = /* @__PURE__ */ I7(FNA), nge = /* @__PURE__ */ I7(ige, {
  equals: fH.structural
}), fR = function(A, e) {
  if (yR(e))
    return yq.decorate_20223_(A, e);
  if (tp(e))
    return yD(A, e, yq);
  if (aQ(A))
    return UB(I7(FNA, A));
  var t = aQ(e) ? e : {};
  return t.get = A, t.name || (t.name = A.name || ""), new Af(t);
};
Object.assign(fR, yq);
fR.struct = /* @__PURE__ */ UB(nge);
var mBA, pBA, DH = 0, oge = 1, gge = (mBA = (pBA = /* @__PURE__ */ wH(function() {
}, "name")) == null ? void 0 : pBA.configurable) != null ? mBA : !1, yBA = {
  value: "action",
  configurable: !0,
  writable: !1,
  enumerable: !1
};
function np(A, e, t, i) {
  t === void 0 && (t = !1);
  function n() {
    return MNA(A, t, e, i || this, arguments);
  }
  return n.isMobxAction = !0, gge && (yBA.value = A, KB(n, "name", yBA)), n;
}
function MNA(A, e, t, i, n) {
  var o = sge(A, e);
  try {
    return t.apply(i, n);
  } catch (g) {
    throw o.error_ = g, g;
  } finally {
    Ige(o);
  }
}
function sge(A, e, t, i) {
  var n = !1, o = 0, g = oe.trackingDerivation, s = !e || !g;
  Ha();
  var I = oe.allowStateChanges;
  s && (Tp(), I = a7(!0));
  var r = C7(!0), a = {
    runAsAction_: s,
    prevDerivation_: g,
    prevAllowStateChanges_: I,
    prevAllowStateReads_: r,
    notifySpy_: n,
    startTime_: o,
    actionId_: oge++,
    parentActionId_: DH
  };
  return DH = a.actionId_, a;
}
function Ige(A) {
  DH !== A.actionId_ && Ot(30), DH = A.parentActionId_, A.error_ !== void 0 && (oe.suppressReactionErrors = !0), r7(A.prevAllowStateChanges_), BN(A.prevAllowStateReads_), Sa(), A.runAsAction_ && Tc(A.prevDerivation_), oe.suppressReactionErrors = !1;
}
function a7(A) {
  var e = oe.allowStateChanges;
  return oe.allowStateChanges = A, e;
}
function r7(A) {
  oe.allowStateChanges = A;
}
var xNA;
xNA = Symbol.toPrimitive;
var pu = /* @__PURE__ */ function(A) {
  wNA(e, A);
  function e(i, n, o, g, s) {
    var I;
    return o === void 0 && (o = "ObservableValue"), s === void 0 && (s = fH.default), I = A.call(this, o) || this, I.enhancer = void 0, I.name_ = void 0, I.equals = void 0, I.hasUnreportedChange_ = !1, I.interceptors_ = void 0, I.changeListeners_ = void 0, I.value_ = void 0, I.dehancer = void 0, I.enhancer = n, I.name_ = o, I.equals = s, I.value_ = n(i, void 0, o), I;
  }
  var t = e.prototype;
  return t.dehanceValue = function(i) {
    return this.dehancer !== void 0 ? this.dehancer(i) : i;
  }, t.set = function(i) {
    this.value_, i = this.prepareNewValue_(i), i !== oe.UNCHANGED && this.setNewValue_(i);
  }, t.prepareNewValue_ = function(i) {
    if (Fa(this)) {
      var n = Ma(this, {
        object: this,
        type: VB,
        newValue: i
      });
      if (!n)
        return oe.UNCHANGED;
      i = n.newValue;
    }
    return i = this.enhancer(i, this.value_, this.name_), this.equals(this.value_, i) ? oe.UNCHANGED : i;
  }, t.setNewValue_ = function(i) {
    var n = this.value_;
    this.value_ = i, this.reportChanged(), nC(this) && oC(this, {
      type: VB,
      object: this,
      newValue: i,
      oldValue: n
    });
  }, t.get = function() {
    return this.reportObserved(), this.dehanceValue(this.value_);
  }, t.intercept_ = function(i) {
    return GR(this, i);
  }, t.observe_ = function(i, n) {
    return n && i({
      observableKind: "value",
      debugObjectName: this.name_,
      object: this,
      type: VB,
      newValue: this.value_,
      oldValue: void 0
    }), kR(this, i);
  }, t.raw = function() {
    return this.value_;
  }, t.toJSON = function() {
    return this.get();
  }, t.toString = function() {
    return this.name_ + "[" + this.value_ + "]";
  }, t.valueOf = function() {
    return bNA(this.get());
  }, t[xNA] = function() {
    return this.valueOf();
  }, e;
}(bR), age = /* @__PURE__ */ Yd("ObservableValue", pu), LNA;
LNA = Symbol.toPrimitive;
var Af = /* @__PURE__ */ function() {
  function A(t) {
    this.dependenciesState_ = si.NOT_TRACKING_, this.observing_ = [], this.newObserving_ = null, this.isBeingObserved_ = !1, this.isPendingUnobservation_ = !1, this.observers_ = /* @__PURE__ */ new Set(), this.diffValue_ = 0, this.runId_ = 0, this.lastAccessedBy_ = 0, this.lowestObserverState_ = si.UP_TO_DATE_, this.unboundDepsCount_ = 0, this.value_ = new kH(null), this.name_ = void 0, this.triggeredBy_ = void 0, this.isComputing_ = !1, this.isRunningSetter_ = !1, this.derivation = void 0, this.setter_ = void 0, this.isTracing_ = GH.NONE, this.scope_ = void 0, this.equals_ = void 0, this.requiresReaction_ = void 0, this.keepAlive_ = void 0, this.onBOL = void 0, this.onBUOL = void 0, t.get || Ot(31), this.derivation = t.get, this.name_ = t.name || "ComputedValue", t.set && (this.setter_ = np("ComputedValue-setter", t.set)), this.equals_ = t.equals || (t.compareStructural || t.struct ? fH.structural : fH.default), this.scope_ = t.context, this.requiresReaction_ = t.requiresReaction, this.keepAlive_ = !!t.keepAlive;
  }
  var e = A.prototype;
  return e.onBecomeStale_ = function() {
    cge(this);
  }, e.onBO = function() {
    this.onBOL && this.onBOL.forEach(function(t) {
      return t();
    });
  }, e.onBUO = function() {
    this.onBUOL && this.onBUOL.forEach(function(t) {
      return t();
    });
  }, e.get = function() {
    if (this.isComputing_ && Ot(32, this.name_, this.derivation), oe.inBatch === 0 && // !globalState.trackingDerivatpion &&
    this.observers_.size === 0 && !this.keepAlive_)
      bq(this) && (this.warnAboutUntrackedRead_(), Ha(), this.value_ = this.computeValue_(!1), Sa());
    else if (UNA(this), bq(this)) {
      var t = oe.trackingContext;
      this.keepAlive_ && !t && (oe.trackingContext = this), this.trackAndCompute() && lge(this), oe.trackingContext = t;
    }
    var i = this.value_;
    if (LL(i))
      throw i.cause;
    return i;
  }, e.set = function(t) {
    if (this.setter_) {
      this.isRunningSetter_ && Ot(33, this.name_), this.isRunningSetter_ = !0;
      try {
        this.setter_.call(this.scope_, t);
      } finally {
        this.isRunningSetter_ = !1;
      }
    } else
      Ot(34, this.name_);
  }, e.trackAndCompute = function() {
    var t = this.value_, i = (
      /* see #1208 */
      this.dependenciesState_ === si.NOT_TRACKING_
    ), n = this.computeValue_(!0), o = i || LL(t) || LL(n) || !this.equals_(t, n);
    return o && (this.value_ = n), o;
  }, e.computeValue_ = function(t) {
    this.isComputing_ = !0;
    var i = a7(!1), n;
    if (t)
      n = vNA(this, this.derivation, this.scope_);
    else if (oe.disableErrorBoundaries === !0)
      n = this.derivation.call(this.scope_);
    else
      try {
        n = this.derivation.call(this.scope_);
      } catch (o) {
        n = new kH(o);
      }
    return r7(i), this.isComputing_ = !1, n;
  }, e.suspend_ = function() {
    this.keepAlive_ || (wq(this), this.value_ = void 0);
  }, e.observe_ = function(t, i) {
    var n = this, o = !0, g = void 0;
    return bge(function() {
      var s = n.get();
      if (!o || i) {
        var I = Tp();
        t({
          observableKind: "computed",
          debugObjectName: n.name_,
          type: VB,
          object: n,
          newValue: s,
          oldValue: g
        }), Tc(I);
      }
      o = !1, g = s;
    });
  }, e.warnAboutUntrackedRead_ = function() {
  }, e.toString = function() {
    return this.name_ + "[" + this.derivation.toString() + "]";
  }, e.valueOf = function() {
    return bNA(this.get());
  }, e[LNA] = function() {
    return this.valueOf();
  }, A;
}(), DR = /* @__PURE__ */ Yd("ComputedValue", Af), si;
(function(A) {
  A[A.NOT_TRACKING_ = -1] = "NOT_TRACKING_", A[A.UP_TO_DATE_ = 0] = "UP_TO_DATE_", A[A.POSSIBLY_STALE_ = 1] = "POSSIBLY_STALE_", A[A.STALE_ = 2] = "STALE_";
})(si || (si = {}));
var GH;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.LOG = 1] = "LOG", A[A.BREAK = 2] = "BREAK";
})(GH || (GH = {}));
var kH = function(A) {
  this.cause = void 0, this.cause = A;
};
function LL(A) {
  return A instanceof kH;
}
function bq(A) {
  switch (A.dependenciesState_) {
    case si.UP_TO_DATE_:
      return !1;
    case si.NOT_TRACKING_:
    case si.STALE_:
      return !0;
    case si.POSSIBLY_STALE_: {
      for (var e = C7(!0), t = Tp(), i = A.observing_, n = i.length, o = 0; o < n; o++) {
        var g = i[o];
        if (DR(g)) {
          if (oe.disableErrorBoundaries)
            g.get();
          else
            try {
              g.get();
            } catch {
              return Tc(t), BN(e), !0;
            }
          if (A.dependenciesState_ === si.STALE_)
            return Tc(t), BN(e), !0;
        }
      }
      return SNA(A), Tc(t), BN(e), !1;
    }
  }
}
function vNA(A, e, t) {
  var i = C7(!0);
  SNA(A), A.newObserving_ = new Array(A.observing_.length + 100), A.unboundDepsCount_ = 0, A.runId_ = ++oe.runId;
  var n = oe.trackingDerivation;
  oe.trackingDerivation = A, oe.inBatch++;
  var o;
  if (oe.disableErrorBoundaries === !0)
    o = e.call(t);
  else
    try {
      o = e.call(t);
    } catch (g) {
      o = new kH(g);
    }
  return oe.inBatch--, oe.trackingDerivation = n, rge(A), BN(i), o;
}
function rge(A) {
  for (var e = A.observing_, t = A.observing_ = A.newObserving_, i = si.UP_TO_DATE_, n = 0, o = A.unboundDepsCount_, g = 0; g < o; g++) {
    var s = t[g];
    s.diffValue_ === 0 && (s.diffValue_ = 1, n !== g && (t[n] = s), n++), s.dependenciesState_ > i && (i = s.dependenciesState_);
  }
  for (t.length = n, A.newObserving_ = null, o = e.length; o--; ) {
    var I = e[o];
    I.diffValue_ === 0 && WNA(I, A), I.diffValue_ = 0;
  }
  for (; n--; ) {
    var r = t[n];
    r.diffValue_ === 1 && (r.diffValue_ = 0, Bge(r, A));
  }
  i !== si.UP_TO_DATE_ && (A.dependenciesState_ = i, A.onBecomeStale_());
}
function wq(A) {
  var e = A.observing_;
  A.observing_ = [];
  for (var t = e.length; t--; )
    WNA(e[t], A);
  A.dependenciesState_ = si.NOT_TRACKING_;
}
function HNA(A) {
  var e = Tp();
  try {
    return A();
  } finally {
    Tc(e);
  }
}
function Tp() {
  var A = oe.trackingDerivation;
  return oe.trackingDerivation = null, A;
}
function Tc(A) {
  oe.trackingDerivation = A;
}
function C7(A) {
  var e = oe.allowStateReads;
  return oe.allowStateReads = A, e;
}
function BN(A) {
  oe.allowStateReads = A;
}
function SNA(A) {
  if (A.dependenciesState_ !== si.UP_TO_DATE_) {
    A.dependenciesState_ = si.UP_TO_DATE_;
    for (var e = A.observing_, t = e.length; t--; )
      e[t].lowestObserverState_ = si.UP_TO_DATE_;
  }
}
var vL = function() {
  this.version = 6, this.UNCHANGED = {}, this.trackingDerivation = null, this.trackingContext = null, this.runId = 0, this.mobxGuid = 0, this.inBatch = 0, this.batchId = Number.MIN_SAFE_INTEGER, this.pendingUnobservations = [], this.pendingReactions = [], this.isRunningReactions = !1, this.allowStateChanges = !1, this.allowStateReads = !0, this.enforceActions = !0, this.spyListeners = [], this.globalReactionErrorHandlers = [], this.computedRequiresReaction = !1, this.reactionRequiresObservable = !1, this.observableRequiresReaction = !1, this.disableErrorBoundaries = !1, this.suppressReactionErrors = !1, this.useProxies = !0, this.verifyProxies = !1, this.safeDescriptors = !0, this.stateVersion = Number.MIN_SAFE_INTEGER;
}, HL = !0, ZNA = !1, oe = /* @__PURE__ */ function() {
  var A = /* @__PURE__ */ o7();
  return A.__mobxInstanceCount > 0 && !A.__mobxGlobals && (HL = !1), A.__mobxGlobals && A.__mobxGlobals.version !== new vL().version && (HL = !1), HL ? A.__mobxGlobals ? (A.__mobxInstanceCount += 1, A.__mobxGlobals.UNCHANGED || (A.__mobxGlobals.UNCHANGED = {}), A.__mobxGlobals) : (A.__mobxInstanceCount = 1, A.__mobxGlobals = /* @__PURE__ */ new vL()) : (setTimeout(function() {
    ZNA || Ot(35);
  }, 1), new vL());
}();
function Cge() {
  if ((oe.pendingReactions.length || oe.inBatch || oe.isRunningReactions) && Ot(36), ZNA = !0, HL) {
    var A = o7();
    --A.__mobxInstanceCount === 0 && (A.__mobxGlobals = void 0), oe = new vL();
  }
}
function Bge(A, e) {
  A.observers_.add(e), A.lowestObserverState_ > e.dependenciesState_ && (A.lowestObserverState_ = e.dependenciesState_);
}
function WNA(A, e) {
  A.observers_.delete(e), A.observers_.size === 0 && KNA(A);
}
function KNA(A) {
  A.isPendingUnobservation_ === !1 && (A.isPendingUnobservation_ = !0, oe.pendingUnobservations.push(A));
}
function Ha() {
  oe.inBatch === 0 && (oe.batchId = oe.batchId < Number.MAX_SAFE_INTEGER ? oe.batchId + 1 : Number.MIN_SAFE_INTEGER), oe.inBatch++;
}
function Sa() {
  if (--oe.inBatch === 0) {
    XNA();
    for (var A = oe.pendingUnobservations, e = 0; e < A.length; e++) {
      var t = A[e];
      t.isPendingUnobservation_ = !1, t.observers_.size === 0 && (t.isBeingObserved_ && (t.isBeingObserved_ = !1, t.onBUO()), t instanceof Af && t.suspend_());
    }
    oe.pendingUnobservations = [];
  }
}
function UNA(A) {
  var e = oe.trackingDerivation;
  return e !== null ? (e.runId_ !== A.lastAccessedBy_ && (A.lastAccessedBy_ = e.runId_, e.newObserving_[e.unboundDepsCount_++] = A, !A.isBeingObserved_ && oe.trackingContext && (A.isBeingObserved_ = !0, A.onBO())), A.isBeingObserved_) : (A.observers_.size === 0 && oe.inBatch > 0 && KNA(A), !1);
}
function VNA(A) {
  A.lowestObserverState_ !== si.STALE_ && (A.lowestObserverState_ = si.STALE_, A.observers_.forEach(function(e) {
    e.dependenciesState_ === si.UP_TO_DATE_ && e.onBecomeStale_(), e.dependenciesState_ = si.STALE_;
  }));
}
function lge(A) {
  A.lowestObserverState_ !== si.STALE_ && (A.lowestObserverState_ = si.STALE_, A.observers_.forEach(function(e) {
    e.dependenciesState_ === si.POSSIBLY_STALE_ ? e.dependenciesState_ = si.STALE_ : e.dependenciesState_ === si.UP_TO_DATE_ && (A.lowestObserverState_ = si.UP_TO_DATE_);
  }));
}
function cge(A) {
  A.lowestObserverState_ === si.UP_TO_DATE_ && (A.lowestObserverState_ = si.POSSIBLY_STALE_, A.observers_.forEach(function(e) {
    e.dependenciesState_ === si.UP_TO_DATE_ && (e.dependenciesState_ = si.POSSIBLY_STALE_, e.onBecomeStale_());
  }));
}
var mY = /* @__PURE__ */ function() {
  function A(t, i, n, o) {
    t === void 0 && (t = "Reaction"), this.name_ = void 0, this.onInvalidate_ = void 0, this.errorHandler_ = void 0, this.requiresObservable_ = void 0, this.observing_ = [], this.newObserving_ = [], this.dependenciesState_ = si.NOT_TRACKING_, this.diffValue_ = 0, this.runId_ = 0, this.unboundDepsCount_ = 0, this.isDisposed_ = !1, this.isScheduled_ = !1, this.isTrackPending_ = !1, this.isRunning_ = !1, this.isTracing_ = GH.NONE, this.name_ = t, this.onInvalidate_ = i, this.errorHandler_ = n, this.requiresObservable_ = o;
  }
  var e = A.prototype;
  return e.onBecomeStale_ = function() {
    this.schedule_();
  }, e.schedule_ = function() {
    this.isScheduled_ || (this.isScheduled_ = !0, oe.pendingReactions.push(this), XNA());
  }, e.isScheduled = function() {
    return this.isScheduled_;
  }, e.runReaction_ = function() {
    if (!this.isDisposed_) {
      Ha(), this.isScheduled_ = !1;
      var t = oe.trackingContext;
      if (oe.trackingContext = this, bq(this)) {
        this.isTrackPending_ = !0;
        try {
          this.onInvalidate_();
        } catch (i) {
          this.reportExceptionInDerivation_(i);
        }
      }
      oe.trackingContext = t, Sa();
    }
  }, e.track = function(t) {
    if (!this.isDisposed_) {
      Ha(), this.isRunning_ = !0;
      var i = oe.trackingContext;
      oe.trackingContext = this;
      var n = vNA(this, t, void 0);
      oe.trackingContext = i, this.isRunning_ = !1, this.isTrackPending_ = !1, this.isDisposed_ && wq(this), LL(n) && this.reportExceptionInDerivation_(n.cause), Sa();
    }
  }, e.reportExceptionInDerivation_ = function(t) {
    var i = this;
    if (this.errorHandler_) {
      this.errorHandler_(t, this);
      return;
    }
    if (oe.disableErrorBoundaries)
      throw t;
    var n = "[mobx] uncaught error in '" + this + "'";
    oe.suppressReactionErrors || console.error(n, t), oe.globalReactionErrorHandlers.forEach(function(o) {
      return o(t, i);
    });
  }, e.dispose = function() {
    this.isDisposed_ || (this.isDisposed_ = !0, this.isRunning_ || (Ha(), wq(this), Sa()));
  }, e.getDisposer_ = function(t) {
    var i = this, n = function o() {
      i.dispose(), t == null || t.removeEventListener == null || t.removeEventListener("abort", o);
    };
    return t == null || t.addEventListener == null || t.addEventListener("abort", n), n[_e] = this, n;
  }, e.toString = function() {
    return "Reaction[" + this.name_ + "]";
  }, e.trace = function(t) {
  }, A;
}(), Qge = 100, fq = function(A) {
  return A();
};
function XNA() {
  oe.inBatch > 0 || oe.isRunningReactions || fq(Ege);
}
function Ege() {
  oe.isRunningReactions = !0;
  for (var A = oe.pendingReactions, e = 0; A.length > 0; ) {
    ++e === Qge && (console.error("[mobx] cycle in reaction: " + A[0]), A.splice(0));
    for (var t = A.splice(0), i = 0, n = t.length; i < n; i++)
      t[i].runReaction_();
  }
  oe.isRunningReactions = !1;
}
var JH = /* @__PURE__ */ Yd("Reaction", mY);
function uge(A) {
  var e = fq;
  fq = function(t) {
    return A(function() {
      return e(t);
    });
  };
}
function lN() {
  return !1;
}
function dge(A) {
  return console.warn("[mobx.spy] Is a no-op in production builds"), function() {
  };
}
var zNA = "action", hge = "action.bound", TNA = "autoAction", mge = "autoAction.bound", _NA = "<unnamed action>", Dq = /* @__PURE__ */ wR(zNA), pge = /* @__PURE__ */ wR(hge, {
  bound: !0
}), Gq = /* @__PURE__ */ wR(TNA, {
  autoAction: !0
}), yge = /* @__PURE__ */ wR(mge, {
  autoAction: !0,
  bound: !0
});
function qNA(A) {
  var e = function(t, i) {
    if (uC(t))
      return np(t.name || _NA, t, A);
    if (uC(i))
      return np(t, i, A);
    if (yR(i))
      return (A ? Gq : Dq).decorate_20223_(t, i);
    if (tp(i))
      return yD(t, i, A ? Gq : Dq);
    if (tp(t))
      return UB(wR(A ? TNA : zNA, {
        name: t,
        autoAction: A
      }));
  };
  return e;
}
var Mb = /* @__PURE__ */ qNA(!1);
Object.assign(Mb, Dq);
var pY = /* @__PURE__ */ qNA(!0);
Object.assign(pY, Gq);
Mb.bound = /* @__PURE__ */ UB(pge);
pY.bound = /* @__PURE__ */ UB(yge);
function ONA(A) {
  return MNA(A.name || _NA, !1, A, this, void 0);
}
function PK(A) {
  return uC(A) && A.isMobxAction === !0;
}
function bge(A, e) {
  var t, i, n, o, g;
  e === void 0 && (e = uNA);
  var s = (t = (i = e) == null ? void 0 : i.name) != null ? t : "Autorun", I = !e.scheduler && !e.delay, r;
  if (I)
    r = new mY(s, function() {
      this.track(B);
    }, e.onError, e.requiresObservable);
  else {
    var a = fge(e), C = !1;
    r = new mY(s, function() {
      C || (C = !0, a(function() {
        C = !1, r.isDisposed_ || r.track(B);
      }));
    }, e.onError, e.requiresObservable);
  }
  function B() {
    A(r);
  }
  return (n = e) != null && (o = n.signal) != null && o.aborted || r.schedule_(), r.getDisposer_((g = e) == null ? void 0 : g.signal);
}
var wge = function(A) {
  return A();
};
function fge(A) {
  return A.scheduler ? A.scheduler : A.delay ? function(e) {
    return setTimeout(e, A.delay);
  } : wge;
}
var Dge = "onBO", Gge = "onBUO";
function kge(A, e, t) {
  return PNA(Dge, A, e, t);
}
function jNA(A, e, t) {
  return PNA(Gge, A, e, t);
}
function PNA(A, e, t, i) {
  var n = typeof i == "function" ? nf(e, t) : nf(e), o = uC(i) ? i : t, g = A + "L";
  return n[g] ? n[g].add(o) : n[g] = /* @__PURE__ */ new Set([o]), function() {
    var s = n[g];
    s && (s.delete(o), s.size === 0 && delete n[g]);
  };
}
var Jge = "never", pM = "always", Nge = "observed";
function Yge(A) {
  A.isolateGlobalState === !0 && Cge();
  var e = A.useProxies, t = A.enforceActions;
  if (e !== void 0 && (oe.useProxies = e === pM ? !0 : e === Jge ? !1 : typeof Proxy < "u"), e === "ifavailable" && (oe.verifyProxies = !0), t !== void 0) {
    var i = t === pM ? pM : t === Nge;
    oe.enforceActions = i, oe.allowStateChanges = !(i === !0 || i === pM);
  }
  ["computedRequiresReaction", "reactionRequiresObservable", "observableRequiresReaction", "disableErrorBoundaries", "safeDescriptors"].forEach(function(n) {
    n in A && (oe[n] = !!A[n]);
  }), oe.allowStateReads = !oe.observableRequiresReaction, A.reactionScheduler && uge(A.reactionScheduler);
}
function $NA(A, e, t, i) {
  var n = loe(e);
  return Md(function() {
    var o = qp(A, i)[_e];
    $w(n).forEach(function(g) {
      o.extend_(
        g,
        n[g],
        // must pass "undefined" for { key: undefined }
        t && g in t ? t[g] : !0
      );
    });
  }), A;
}
function Rge(A, e) {
  return AYA(nf(A, e));
}
function AYA(A) {
  var e = {
    name: A.name_
  };
  return A.observing_ && A.observing_.length > 0 && (e.dependencies = Fge(A.observing_).map(AYA)), e;
}
function Fge(A) {
  return Array.from(new Set(A));
}
var Mge = 0;
function eYA() {
  this.message = "FLOW_CANCELLED";
}
eYA.prototype = /* @__PURE__ */ Object.create(Error.prototype);
var r5 = /* @__PURE__ */ GNA("flow"), xge = /* @__PURE__ */ GNA("flow.bound", {
  bound: !0
}), ef = /* @__PURE__ */ Object.assign(function(A, e) {
  if (yR(e))
    return r5.decorate_20223_(A, e);
  if (tp(e))
    return yD(A, e, r5);
  var t = A, i = t.name || "<unnamed flow>", n = function() {
    var o = this, g = arguments, s = ++Mge, I = Mb(i + " - runid: " + s + " - init", t).apply(o, g), r, a = void 0, C = new Promise(function(B, l) {
      var Q = 0;
      r = l;
      function E(y) {
        a = void 0;
        var f;
        try {
          f = Mb(i + " - runid: " + s + " - yield " + Q++, I.next).call(I, y);
        } catch (w) {
          return l(w);
        }
        m(f);
      }
      function d(y) {
        a = void 0;
        var f;
        try {
          f = Mb(i + " - runid: " + s + " - yield " + Q++, I.throw).call(I, y);
        } catch (w) {
          return l(w);
        }
        m(f);
      }
      function m(y) {
        if (uC(y == null ? void 0 : y.then)) {
          y.then(m, l);
          return;
        }
        return y.done ? B(y.value) : (a = Promise.resolve(y.value), a.then(E, d));
      }
      E(void 0);
    });
    return C.cancel = Mb(i + " - runid: " + s + " - cancel", function() {
      try {
        a && bBA(a);
        var B = I.return(void 0), l = Promise.resolve(B.value);
        l.then(Rb, Rb), bBA(l), r(new eYA());
      } catch (Q) {
        r(Q);
      }
    }), C;
  };
  return n.isMobXFlow = !0, n;
}, r5);
ef.bound = /* @__PURE__ */ UB(xge);
function bBA(A) {
  uC(A.cancel) && A.cancel();
}
function yY(A) {
  return (A == null ? void 0 : A.isMobXFlow) === !0;
}
function Lge(A, e) {
  return A ? e !== void 0 ? tf(A) ? A[_e].values_.has(e) : !1 : tf(A) || !!A[_e] || s7(A) || JH(A) || DR(A) : !1;
}
function B7(A) {
  return Lge(A);
}
function vge(A) {
  if (tf(A))
    return A[_e].ownKeys_();
  Ot(38);
}
function yM(A, e, t) {
  return A.set(e, t), t;
}
function Vy(A, e) {
  if (A == null || typeof A != "object" || A instanceof Date || !B7(A))
    return A;
  if (age(A) || DR(A))
    return Vy(A.get(), e);
  if (e.has(A))
    return e.get(A);
  if (JR(A)) {
    var t = yM(e, A, new Array(A.length));
    return A.forEach(function(g, s) {
      t[s] = Vy(g, e);
    }), t;
  }
  if (_p(A)) {
    var i = yM(e, A, /* @__PURE__ */ new Set());
    return A.forEach(function(g) {
      i.add(Vy(g, e));
    }), i;
  }
  if (Fd(A)) {
    var n = yM(e, A, /* @__PURE__ */ new Map());
    return A.forEach(function(g, s) {
      n.set(s, Vy(g, e));
    }), n;
  } else {
    var o = yM(e, A, {});
    return vge(A).forEach(function(g) {
      hR.propertyIsEnumerable.call(A, g) && (o[g] = Vy(A[g], e));
    }), o;
  }
}
function $K(A, e) {
  return Vy(A, /* @__PURE__ */ new Map());
}
function fc(A, e) {
  e === void 0 && (e = void 0), Ha();
  try {
    return A.apply(e);
  } finally {
    Sa();
  }
}
function ty(A) {
  return A[_e];
}
var Hge = {
  has: function(A, e) {
    return ty(A).has_(e);
  },
  get: function(A, e) {
    return ty(A).get_(e);
  },
  set: function(A, e, t) {
    var i;
    return tp(e) ? (i = ty(A).set_(e, t, !0)) != null ? i : !0 : !1;
  },
  deleteProperty: function(A, e) {
    var t;
    return tp(e) ? (t = ty(A).delete_(e, !0)) != null ? t : !0 : !1;
  },
  defineProperty: function(A, e, t) {
    var i;
    return (i = ty(A).defineProperty_(e, t)) != null ? i : !0;
  },
  ownKeys: function(A) {
    return ty(A).ownKeys_();
  },
  preventExtensions: function(A) {
    Ot(13);
  }
};
function Sge(A, e) {
  var t, i;
  return dNA(), A = qp(A, e), (i = (t = A[_e]).proxy_) != null ? i : t.proxy_ = new Proxy(A, Hge);
}
function Fa(A) {
  return A.interceptors_ !== void 0 && A.interceptors_.length > 0;
}
function GR(A, e) {
  var t = A.interceptors_ || (A.interceptors_ = []);
  return t.push(e), hNA(function() {
    var i = t.indexOf(e);
    i !== -1 && t.splice(i, 1);
  });
}
function Ma(A, e) {
  var t = Tp();
  try {
    for (var i = [].concat(A.interceptors_ || []), n = 0, o = i.length; n < o && (e = i[n](e), e && !e.type && Ot(14), !!e); n++)
      ;
    return e;
  } finally {
    Tc(t);
  }
}
function nC(A) {
  return A.changeListeners_ !== void 0 && A.changeListeners_.length > 0;
}
function kR(A, e) {
  var t = A.changeListeners_ || (A.changeListeners_ = []);
  return t.push(e), hNA(function() {
    var i = t.indexOf(e);
    i !== -1 && t.splice(i, 1);
  });
}
function oC(A, e) {
  var t = Tp(), i = A.changeListeners_;
  if (i) {
    i = i.slice();
    for (var n = 0, o = i.length; n < o; n++)
      i[n](e);
    Tc(t);
  }
}
function Zge(A, e, t) {
  return Md(function() {
    var i, n = qp(A, t)[_e];
    (i = e) != null || (e = uoe(A)), $w(e).forEach(function(o) {
      return n.make_(o, e[o]);
    });
  }), A;
}
var C5 = /* @__PURE__ */ Symbol("mobx-keys");
function Wge(A, e, t) {
  return aQ(A) ? $NA(A, A, e, t) : (Md(function() {
    var i = qp(A, t)[_e];
    if (!A[C5]) {
      var n = Object.getPrototypeOf(A), o = new Set([].concat($w(A), $w(n)));
      o.delete("constructor"), o.delete(_e), mR(n, C5, o);
    }
    A[C5].forEach(function(g) {
      return i.make_(
        g,
        // must pass "undefined" for { key: undefined }
        e && g in e ? e[g] : !0
      );
    });
  }), A);
}
var wBA = "splice", VB = "update", Kge = 1e4, Uge = {
  get: function(A, e) {
    var t = A[_e];
    return e === _e ? t : e === "length" ? t.getArrayLength_() : typeof e == "string" && !isNaN(e) ? t.get_(parseInt(e)) : zc(NH, e) ? NH[e] : A[e];
  },
  set: function(A, e, t) {
    var i = A[_e];
    return e === "length" && i.setArrayLength_(t), typeof e == "symbol" || isNaN(e) ? A[e] = t : i.set_(parseInt(e), t), !0;
  },
  preventExtensions: function() {
    Ot(15);
  }
}, l7 = /* @__PURE__ */ function() {
  function A(t, i, n, o) {
    t === void 0 && (t = "ObservableArray"), this.owned_ = void 0, this.legacyMode_ = void 0, this.atom_ = void 0, this.values_ = [], this.interceptors_ = void 0, this.changeListeners_ = void 0, this.enhancer_ = void 0, this.dehancer = void 0, this.proxy_ = void 0, this.lastKnownLength_ = 0, this.owned_ = n, this.legacyMode_ = o, this.atom_ = new bR(t), this.enhancer_ = function(g, s) {
      return i(g, s, "ObservableArray[..]");
    };
  }
  var e = A.prototype;
  return e.dehanceValue_ = function(t) {
    return this.dehancer !== void 0 ? this.dehancer(t) : t;
  }, e.dehanceValues_ = function(t) {
    return this.dehancer !== void 0 && t.length > 0 ? t.map(this.dehancer) : t;
  }, e.intercept_ = function(t) {
    return GR(this, t);
  }, e.observe_ = function(t, i) {
    return i === void 0 && (i = !1), i && t({
      observableKind: "array",
      object: this.proxy_,
      debugObjectName: this.atom_.name_,
      type: "splice",
      index: 0,
      added: this.values_.slice(),
      addedCount: this.values_.length,
      removed: [],
      removedCount: 0
    }), kR(this, t);
  }, e.getArrayLength_ = function() {
    return this.atom_.reportObserved(), this.values_.length;
  }, e.setArrayLength_ = function(t) {
    (typeof t != "number" || isNaN(t) || t < 0) && Ot("Out of range: " + t);
    var i = this.values_.length;
    if (t !== i)
      if (t > i) {
        for (var n = new Array(t - i), o = 0; o < t - i; o++)
          n[o] = void 0;
        this.spliceWithArray_(i, 0, n);
      } else
        this.spliceWithArray_(t, i - t);
  }, e.updateArrayLength_ = function(t, i) {
    t !== this.lastKnownLength_ && Ot(16), this.lastKnownLength_ += i, this.legacyMode_ && i > 0 && BYA(t + i + 1);
  }, e.spliceWithArray_ = function(t, i, n) {
    var o = this;
    this.atom_;
    var g = this.values_.length;
    if (t === void 0 ? t = 0 : t > g ? t = g : t < 0 && (t = Math.max(0, g + t)), arguments.length === 1 ? i = g - t : i == null ? i = 0 : i = Math.max(0, Math.min(i, g - t)), n === void 0 && (n = hq), Fa(this)) {
      var s = Ma(this, {
        object: this.proxy_,
        type: wBA,
        index: t,
        removedCount: i,
        added: n
      });
      if (!s)
        return hq;
      i = s.removedCount, n = s.added;
    }
    if (n = n.length === 0 ? n : n.map(function(a) {
      return o.enhancer_(a, void 0);
    }), this.legacyMode_ || !1) {
      var I = n.length - i;
      this.updateArrayLength_(g, I);
    }
    var r = this.spliceItemsIntoValues_(t, i, n);
    return (i !== 0 || n.length !== 0) && this.notifyArraySplice_(t, n, r), this.dehanceValues_(r);
  }, e.spliceItemsIntoValues_ = function(t, i, n) {
    if (n.length < Kge) {
      var o;
      return (o = this.values_).splice.apply(o, [t, i].concat(n));
    } else {
      var g = this.values_.slice(t, t + i), s = this.values_.slice(t + i);
      this.values_.length += n.length - i;
      for (var I = 0; I < n.length; I++)
        this.values_[t + I] = n[I];
      for (var r = 0; r < s.length; r++)
        this.values_[t + n.length + r] = s[r];
      return g;
    }
  }, e.notifyArrayChildUpdate_ = function(t, i, n) {
    var o = !this.owned_ && lN(), g = nC(this), s = g || o ? {
      observableKind: "array",
      object: this.proxy_,
      type: VB,
      debugObjectName: this.atom_.name_,
      index: t,
      newValue: i,
      oldValue: n
    } : null;
    this.atom_.reportChanged(), g && oC(this, s);
  }, e.notifyArraySplice_ = function(t, i, n) {
    var o = !this.owned_ && lN(), g = nC(this), s = g || o ? {
      observableKind: "array",
      object: this.proxy_,
      debugObjectName: this.atom_.name_,
      type: wBA,
      index: t,
      removed: n,
      added: i,
      removedCount: n.length,
      addedCount: i.length
    } : null;
    this.atom_.reportChanged(), g && oC(this, s);
  }, e.get_ = function(t) {
    if (this.legacyMode_ && t >= this.values_.length) {
      console.warn("[mobx] Out of bounds read: " + t);
      return;
    }
    return this.atom_.reportObserved(), this.dehanceValue_(this.values_[t]);
  }, e.set_ = function(t, i) {
    var n = this.values_;
    if (this.legacyMode_ && t > n.length && Ot(17, t, n.length), t < n.length) {
      this.atom_;
      var o = n[t];
      if (Fa(this)) {
        var g = Ma(this, {
          type: VB,
          object: this.proxy_,
          index: t,
          newValue: i
        });
        if (!g)
          return;
        i = g.newValue;
      }
      i = this.enhancer_(i, o);
      var s = i !== o;
      s && (n[t] = i, this.notifyArrayChildUpdate_(t, i, o));
    } else {
      for (var I = new Array(t + 1 - n.length), r = 0; r < I.length - 1; r++)
        I[r] = void 0;
      I[I.length - 1] = i, this.spliceWithArray_(n.length, 0, I);
    }
  }, A;
}();
function Vge(A, e, t, i) {
  return t === void 0 && (t = "ObservableArray"), i === void 0 && (i = !1), dNA(), Md(function() {
    var n = new l7(t, e, i, !1);
    pNA(n.values_, _e, n);
    var o = new Proxy(n.values_, Uge);
    return n.proxy_ = o, A && A.length && n.spliceWithArray_(0, 0, A), o;
  });
}
var NH = {
  clear: function() {
    return this.splice(0);
  },
  replace: function(A) {
    var e = this[_e];
    return e.spliceWithArray_(0, e.values_.length, A);
  },
  // Used by JSON.stringify
  toJSON: function() {
    return this.slice();
  },
  /*
   * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)
   * since these functions alter the inner structure of the array, the have side effects.
   * Because the have side effects, they should not be used in computed function,
   * and for that reason the do not call dependencyState.notifyObserved
   */
  splice: function(A, e) {
    for (var t = arguments.length, i = new Array(t > 2 ? t - 2 : 0), n = 2; n < t; n++)
      i[n - 2] = arguments[n];
    var o = this[_e];
    switch (arguments.length) {
      case 0:
        return [];
      case 1:
        return o.spliceWithArray_(A);
      case 2:
        return o.spliceWithArray_(A, e);
    }
    return o.spliceWithArray_(A, e, i);
  },
  spliceWithArray: function(A, e, t) {
    return this[_e].spliceWithArray_(A, e, t);
  },
  push: function() {
    for (var A = this[_e], e = arguments.length, t = new Array(e), i = 0; i < e; i++)
      t[i] = arguments[i];
    return A.spliceWithArray_(A.values_.length, 0, t), A.values_.length;
  },
  pop: function() {
    return this.splice(Math.max(this[_e].values_.length - 1, 0), 1)[0];
  },
  shift: function() {
    return this.splice(0, 1)[0];
  },
  unshift: function() {
    for (var A = this[_e], e = arguments.length, t = new Array(e), i = 0; i < e; i++)
      t[i] = arguments[i];
    return A.spliceWithArray_(0, 0, t), A.values_.length;
  },
  reverse: function() {
    return oe.trackingDerivation && Ot(37, "reverse"), this.replace(this.slice().reverse()), this;
  },
  sort: function() {
    oe.trackingDerivation && Ot(37, "sort");
    var A = this.slice();
    return A.sort.apply(A, arguments), this.replace(A), this;
  },
  remove: function(A) {
    var e = this[_e], t = e.dehanceValues_(e.values_).indexOf(A);
    return t > -1 ? (this.splice(t, 1), !0) : !1;
  }
};
uo("concat", YQ);
uo("flat", YQ);
uo("includes", YQ);
uo("indexOf", YQ);
uo("join", YQ);
uo("lastIndexOf", YQ);
uo("slice", YQ);
uo("toString", YQ);
uo("toLocaleString", YQ);
uo("every", Rd);
uo("filter", Rd);
uo("find", Rd);
uo("findIndex", Rd);
uo("flatMap", Rd);
uo("forEach", Rd);
uo("map", Rd);
uo("some", Rd);
uo("reduce", tYA);
uo("reduceRight", tYA);
function uo(A, e) {
  typeof Array.prototype[A] == "function" && (NH[A] = e(A));
}
function YQ(A) {
  return function() {
    var e = this[_e];
    e.atom_.reportObserved();
    var t = e.dehanceValues_(e.values_);
    return t[A].apply(t, arguments);
  };
}
function Rd(A) {
  return function(e, t) {
    var i = this, n = this[_e];
    n.atom_.reportObserved();
    var o = n.dehanceValues_(n.values_);
    return o[A](function(g, s) {
      return e.call(t, g, s, i);
    });
  };
}
function tYA(A) {
  return function() {
    var e = this, t = this[_e];
    t.atom_.reportObserved();
    var i = t.dehanceValues_(t.values_), n = arguments[0];
    return arguments[0] = function(o, g, s) {
      return n(o, g, s, e);
    }, i[A].apply(i, arguments);
  };
}
var Xge = /* @__PURE__ */ Yd("ObservableArrayAdministration", l7);
function JR(A) {
  return qK(A) && Xge(A[_e]);
}
var iYA, nYA, zge = {}, OE = "add", YH = "delete";
iYA = Symbol.iterator;
nYA = Symbol.toStringTag;
var oYA = /* @__PURE__ */ function() {
  function A(t, i, n) {
    var o = this;
    i === void 0 && (i = bD), n === void 0 && (n = "ObservableMap"), this.enhancer_ = void 0, this.name_ = void 0, this[_e] = zge, this.data_ = void 0, this.hasMap_ = void 0, this.keysAtom_ = void 0, this.interceptors_ = void 0, this.changeListeners_ = void 0, this.dehancer = void 0, this.enhancer_ = i, this.name_ = n, uC(Map) || Ot(18), Md(function() {
      o.keysAtom_ = fNA("ObservableMap.keys()"), o.data_ = /* @__PURE__ */ new Map(), o.hasMap_ = /* @__PURE__ */ new Map(), t && o.merge(t);
    });
  }
  var e = A.prototype;
  return e.has_ = function(t) {
    return this.data_.has(t);
  }, e.has = function(t) {
    var i = this;
    if (!oe.trackingDerivation)
      return this.has_(t);
    var n = this.hasMap_.get(t);
    if (!n) {
      var o = n = new pu(this.has_(t), OK, "ObservableMap.key?", !1);
      this.hasMap_.set(t, o), jNA(o, function() {
        return i.hasMap_.delete(t);
      });
    }
    return n.get();
  }, e.set = function(t, i) {
    var n = this.has_(t);
    if (Fa(this)) {
      var o = Ma(this, {
        type: n ? VB : OE,
        object: this,
        newValue: i,
        name: t
      });
      if (!o)
        return this;
      i = o.newValue;
    }
    return n ? this.updateValue_(t, i) : this.addValue_(t, i), this;
  }, e.delete = function(t) {
    var i = this;
    if (this.keysAtom_, Fa(this)) {
      var n = Ma(this, {
        type: YH,
        object: this,
        name: t
      });
      if (!n)
        return !1;
    }
    if (this.has_(t)) {
      var o = lN(), g = nC(this), s = g || o ? {
        observableKind: "map",
        debugObjectName: this.name_,
        type: YH,
        object: this,
        oldValue: this.data_.get(t).value_,
        name: t
      } : null;
      return fc(function() {
        var I;
        i.keysAtom_.reportChanged(), (I = i.hasMap_.get(t)) == null || I.setNewValue_(!1);
        var r = i.data_.get(t);
        r.setNewValue_(void 0), i.data_.delete(t);
      }), g && oC(this, s), !0;
    }
    return !1;
  }, e.updateValue_ = function(t, i) {
    var n = this.data_.get(t);
    if (i = n.prepareNewValue_(i), i !== oe.UNCHANGED) {
      var o = lN(), g = nC(this), s = g || o ? {
        observableKind: "map",
        debugObjectName: this.name_,
        type: VB,
        object: this,
        oldValue: n.value_,
        name: t,
        newValue: i
      } : null;
      n.setNewValue_(i), g && oC(this, s);
    }
  }, e.addValue_ = function(t, i) {
    var n = this;
    this.keysAtom_, fc(function() {
      var I, r = new pu(i, n.enhancer_, "ObservableMap.key", !1);
      n.data_.set(t, r), i = r.value_, (I = n.hasMap_.get(t)) == null || I.setNewValue_(!0), n.keysAtom_.reportChanged();
    });
    var o = lN(), g = nC(this), s = g || o ? {
      observableKind: "map",
      debugObjectName: this.name_,
      type: OE,
      object: this,
      name: t,
      newValue: i
    } : null;
    g && oC(this, s);
  }, e.get = function(t) {
    return this.has(t) ? this.dehanceValue_(this.data_.get(t).get()) : this.dehanceValue_(void 0);
  }, e.dehanceValue_ = function(t) {
    return this.dehancer !== void 0 ? this.dehancer(t) : t;
  }, e.keys = function() {
    return this.keysAtom_.reportObserved(), this.data_.keys();
  }, e.values = function() {
    var t = this, i = this.keys();
    return bY({
      next: function() {
        var n = i.next(), o = n.done, g = n.value;
        return {
          done: o,
          value: o ? void 0 : t.get(g)
        };
      }
    });
  }, e.entries = function() {
    var t = this, i = this.keys();
    return bY({
      next: function() {
        var n = i.next(), o = n.done, g = n.value;
        return {
          done: o,
          value: o ? void 0 : [g, t.get(g)]
        };
      }
    });
  }, e[iYA] = function() {
    return this.entries();
  }, e.forEach = function(t, i) {
    for (var n = Fb(this), o; !(o = n()).done; ) {
      var g = o.value, s = g[0], I = g[1];
      t.call(i, I, s, this);
    }
  }, e.merge = function(t) {
    var i = this;
    return Fd(t) && (t = new Map(t)), fc(function() {
      aQ(t) ? Boe(t).forEach(function(n) {
        return i.set(n, t[n]);
      }) : Array.isArray(t) ? t.forEach(function(n) {
        var o = n[0], g = n[1];
        return i.set(o, g);
      }) : pD(t) ? (t.constructor !== Map && Ot(19, t), t.forEach(function(n, o) {
        return i.set(o, n);
      })) : t != null && Ot(20, t);
    }), this;
  }, e.clear = function() {
    var t = this;
    fc(function() {
      HNA(function() {
        for (var i = Fb(t.keys()), n; !(n = i()).done; ) {
          var o = n.value;
          t.delete(o);
        }
      });
    });
  }, e.replace = function(t) {
    var i = this;
    return fc(function() {
      for (var n = Tge(t), o = /* @__PURE__ */ new Map(), g = !1, s = Fb(i.data_.keys()), I; !(I = s()).done; ) {
        var r = I.value;
        if (!n.has(r)) {
          var a = i.delete(r);
          if (a)
            g = !0;
          else {
            var C = i.data_.get(r);
            o.set(r, C);
          }
        }
      }
      for (var B = Fb(n.entries()), l; !(l = B()).done; ) {
        var Q = l.value, E = Q[0], d = Q[1], m = i.data_.has(E);
        if (i.set(E, d), i.data_.has(E)) {
          var y = i.data_.get(E);
          o.set(E, y), m || (g = !0);
        }
      }
      if (!g)
        if (i.data_.size !== o.size)
          i.keysAtom_.reportChanged();
        else
          for (var f = i.data_.keys(), w = o.keys(), G = f.next(), R = w.next(); !G.done; ) {
            if (G.value !== R.value) {
              i.keysAtom_.reportChanged();
              break;
            }
            G = f.next(), R = w.next();
          }
      i.data_ = o;
    }), this;
  }, e.toString = function() {
    return "[object ObservableMap]";
  }, e.toJSON = function() {
    return Array.from(this);
  }, e.observe_ = function(t, i) {
    return kR(this, t);
  }, e.intercept_ = function(t) {
    return GR(this, t);
  }, g7(A, [{
    key: "size",
    get: function() {
      return this.keysAtom_.reportObserved(), this.data_.size;
    }
  }, {
    key: nYA,
    get: function() {
      return "Map";
    }
  }]), A;
}(), Fd = /* @__PURE__ */ Yd("ObservableMap", oYA);
function Tge(A) {
  if (pD(A) || Fd(A))
    return A;
  if (Array.isArray(A))
    return new Map(A);
  if (aQ(A)) {
    var e = /* @__PURE__ */ new Map();
    for (var t in A)
      e.set(t, A[t]);
    return e;
  } else
    return Ot(21, A);
}
var gYA, sYA, _ge = {};
gYA = Symbol.iterator;
sYA = Symbol.toStringTag;
var IYA = /* @__PURE__ */ function() {
  function A(t, i, n) {
    var o = this;
    i === void 0 && (i = bD), n === void 0 && (n = "ObservableSet"), this.name_ = void 0, this[_e] = _ge, this.data_ = /* @__PURE__ */ new Set(), this.atom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.dehancer = void 0, this.enhancer_ = void 0, this.name_ = n, uC(Set) || Ot(22), this.enhancer_ = function(g, s) {
      return i(g, s, n);
    }, Md(function() {
      o.atom_ = fNA(o.name_), t && o.replace(t);
    });
  }
  var e = A.prototype;
  return e.dehanceValue_ = function(t) {
    return this.dehancer !== void 0 ? this.dehancer(t) : t;
  }, e.clear = function() {
    var t = this;
    fc(function() {
      HNA(function() {
        for (var i = Fb(t.data_.values()), n; !(n = i()).done; ) {
          var o = n.value;
          t.delete(o);
        }
      });
    });
  }, e.forEach = function(t, i) {
    for (var n = Fb(this), o; !(o = n()).done; ) {
      var g = o.value;
      t.call(i, g, g, this);
    }
  }, e.add = function(t) {
    var i = this;
    if (this.atom_, Fa(this)) {
      var n = Ma(this, {
        type: OE,
        object: this,
        newValue: t
      });
      if (!n)
        return this;
    }
    if (!this.has(t)) {
      fc(function() {
        i.data_.add(i.enhancer_(t, void 0)), i.atom_.reportChanged();
      });
      var o = !1, g = nC(this), s = g || o ? {
        observableKind: "set",
        debugObjectName: this.name_,
        type: OE,
        object: this,
        newValue: t
      } : null;
      g && oC(this, s);
    }
    return this;
  }, e.delete = function(t) {
    var i = this;
    if (Fa(this)) {
      var n = Ma(this, {
        type: YH,
        object: this,
        oldValue: t
      });
      if (!n)
        return !1;
    }
    if (this.has(t)) {
      var o = !1, g = nC(this), s = g || o ? {
        observableKind: "set",
        debugObjectName: this.name_,
        type: YH,
        object: this,
        oldValue: t
      } : null;
      return fc(function() {
        i.atom_.reportChanged(), i.data_.delete(t);
      }), g && oC(this, s), !0;
    }
    return !1;
  }, e.has = function(t) {
    return this.atom_.reportObserved(), this.data_.has(this.dehanceValue_(t));
  }, e.entries = function() {
    var t = 0, i = Array.from(this.keys()), n = Array.from(this.values());
    return bY({
      next: function() {
        var o = t;
        return t += 1, o < n.length ? {
          value: [i[o], n[o]],
          done: !1
        } : {
          done: !0
        };
      }
    });
  }, e.keys = function() {
    return this.values();
  }, e.values = function() {
    this.atom_.reportObserved();
    var t = this, i = 0, n = Array.from(this.data_.values());
    return bY({
      next: function() {
        return i < n.length ? {
          value: t.dehanceValue_(n[i++]),
          done: !1
        } : {
          done: !0
        };
      }
    });
  }, e.replace = function(t) {
    var i = this;
    return _p(t) && (t = new Set(t)), fc(function() {
      Array.isArray(t) ? (i.clear(), t.forEach(function(n) {
        return i.add(n);
      })) : pR(t) ? (i.clear(), t.forEach(function(n) {
        return i.add(n);
      })) : t != null && Ot("Cannot initialize set from " + t);
    }), this;
  }, e.observe_ = function(t, i) {
    return kR(this, t);
  }, e.intercept_ = function(t) {
    return GR(this, t);
  }, e.toJSON = function() {
    return Array.from(this);
  }, e.toString = function() {
    return "[object ObservableSet]";
  }, e[gYA] = function() {
    return this.values();
  }, g7(A, [{
    key: "size",
    get: function() {
      return this.atom_.reportObserved(), this.data_.size;
    }
  }, {
    key: sYA,
    get: function() {
      return "Set";
    }
  }]), A;
}(), _p = /* @__PURE__ */ Yd("ObservableSet", IYA), fBA = /* @__PURE__ */ Object.create(null), DBA = "remove", aYA = /* @__PURE__ */ function() {
  function A(t, i, n, o) {
    i === void 0 && (i = /* @__PURE__ */ new Map()), o === void 0 && (o = Uoe), this.target_ = void 0, this.values_ = void 0, this.name_ = void 0, this.defaultAnnotation_ = void 0, this.keysAtom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.proxy_ = void 0, this.isPlainObject_ = void 0, this.appliedAnnotations_ = void 0, this.pendingKeys_ = void 0, this.target_ = t, this.values_ = i, this.name_ = n, this.defaultAnnotation_ = o, this.keysAtom_ = new bR("ObservableObject.keys"), this.isPlainObject_ = aQ(this.target_);
  }
  var e = A.prototype;
  return e.getObservablePropValue_ = function(t) {
    return this.values_.get(t).get();
  }, e.setObservablePropValue_ = function(t, i) {
    var n = this.values_.get(t);
    if (n instanceof Af)
      return n.set(i), !0;
    if (Fa(this)) {
      var o = Ma(this, {
        type: VB,
        object: this.proxy_ || this.target_,
        name: t,
        newValue: i
      });
      if (!o)
        return null;
      i = o.newValue;
    }
    if (i = n.prepareNewValue_(i), i !== oe.UNCHANGED) {
      var g = nC(this), s = !1, I = g || s ? {
        type: VB,
        observableKind: "object",
        debugObjectName: this.name_,
        object: this.proxy_ || this.target_,
        oldValue: n.value_,
        name: t,
        newValue: i
      } : null;
      n.setNewValue_(i), g && oC(this, I);
    }
    return !0;
  }, e.get_ = function(t) {
    return oe.trackingDerivation && !zc(this.target_, t) && this.has_(t), this.target_[t];
  }, e.set_ = function(t, i, n) {
    return n === void 0 && (n = !1), zc(this.target_, t) ? this.values_.has(t) ? this.setObservablePropValue_(t, i) : n ? Reflect.set(this.target_, t, i) : (this.target_[t] = i, !0) : this.extend_(t, {
      value: i,
      enumerable: !0,
      writable: !0,
      configurable: !0
    }, this.defaultAnnotation_, n);
  }, e.has_ = function(t) {
    if (!oe.trackingDerivation)
      return t in this.target_;
    this.pendingKeys_ || (this.pendingKeys_ = /* @__PURE__ */ new Map());
    var i = this.pendingKeys_.get(t);
    return i || (i = new pu(t in this.target_, OK, "ObservableObject.key?", !1), this.pendingKeys_.set(t, i)), i.get();
  }, e.make_ = function(t, i) {
    if (i === !0 && (i = this.defaultAnnotation_), i !== !1) {
      if (!(t in this.target_)) {
        var n;
        if ((n = this.target_[kB]) != null && n[t])
          return;
        Ot(1, i.annotationType_, this.name_ + "." + t.toString());
      }
      for (var o = this.target_; o && o !== hR; ) {
        var g = wH(o, t);
        if (g) {
          var s = i.make_(this, t, g, o);
          if (s === 0)
            return;
          if (s === 1)
            break;
        }
        o = Object.getPrototypeOf(o);
      }
      kBA(this, i, t);
    }
  }, e.extend_ = function(t, i, n, o) {
    if (o === void 0 && (o = !1), n === !0 && (n = this.defaultAnnotation_), n === !1)
      return this.defineProperty_(t, i, o);
    var g = n.extend_(this, t, i, o);
    return g && kBA(this, n, t), g;
  }, e.defineProperty_ = function(t, i, n) {
    n === void 0 && (n = !1), this.keysAtom_;
    try {
      Ha();
      var o = this.delete_(t);
      if (!o)
        return o;
      if (Fa(this)) {
        var g = Ma(this, {
          object: this.proxy_ || this.target_,
          name: t,
          type: OE,
          newValue: i.value
        });
        if (!g)
          return null;
        var s = g.newValue;
        i.value !== s && (i = ip({}, i, {
          value: s
        }));
      }
      if (n) {
        if (!Reflect.defineProperty(this.target_, t, i))
          return !1;
      } else
        KB(this.target_, t, i);
      this.notifyPropertyAddition_(t, i.value);
    } finally {
      Sa();
    }
    return !0;
  }, e.defineObservableProperty_ = function(t, i, n, o) {
    o === void 0 && (o = !1), this.keysAtom_;
    try {
      Ha();
      var g = this.delete_(t);
      if (!g)
        return g;
      if (Fa(this)) {
        var s = Ma(this, {
          object: this.proxy_ || this.target_,
          name: t,
          type: OE,
          newValue: i
        });
        if (!s)
          return null;
        i = s.newValue;
      }
      var I = GBA(t), r = {
        configurable: oe.safeDescriptors ? this.isPlainObject_ : !0,
        enumerable: !0,
        get: I.get,
        set: I.set
      };
      if (o) {
        if (!Reflect.defineProperty(this.target_, t, r))
          return !1;
      } else
        KB(this.target_, t, r);
      var a = new pu(i, n, "ObservableObject.key", !1);
      this.values_.set(t, a), this.notifyPropertyAddition_(t, a.value_);
    } finally {
      Sa();
    }
    return !0;
  }, e.defineComputedProperty_ = function(t, i, n) {
    n === void 0 && (n = !1), this.keysAtom_;
    try {
      Ha();
      var o = this.delete_(t);
      if (!o)
        return o;
      if (Fa(this)) {
        var g = Ma(this, {
          object: this.proxy_ || this.target_,
          name: t,
          type: OE,
          newValue: void 0
        });
        if (!g)
          return null;
      }
      i.name || (i.name = "ObservableObject.key"), i.context = this.proxy_ || this.target_;
      var s = GBA(t), I = {
        configurable: oe.safeDescriptors ? this.isPlainObject_ : !0,
        enumerable: !1,
        get: s.get,
        set: s.set
      };
      if (n) {
        if (!Reflect.defineProperty(this.target_, t, I))
          return !1;
      } else
        KB(this.target_, t, I);
      this.values_.set(t, new Af(i)), this.notifyPropertyAddition_(t, void 0);
    } finally {
      Sa();
    }
    return !0;
  }, e.delete_ = function(t, i) {
    if (i === void 0 && (i = !1), this.keysAtom_, !zc(this.target_, t))
      return !0;
    if (Fa(this)) {
      var n = Ma(this, {
        object: this.proxy_ || this.target_,
        name: t,
        type: DBA
      });
      if (!n)
        return null;
    }
    try {
      var o, g;
      Ha();
      var s = nC(this), I = !1, r = this.values_.get(t), a = void 0;
      if (!r && (s || I)) {
        var C;
        a = (C = wH(this.target_, t)) == null ? void 0 : C.value;
      }
      if (i) {
        if (!Reflect.deleteProperty(this.target_, t))
          return !1;
      } else
        delete this.target_[t];
      if (r && (this.values_.delete(t), r instanceof pu && (a = r.value_), VNA(r)), this.keysAtom_.reportChanged(), (o = this.pendingKeys_) == null || (g = o.get(t)) == null || g.set(t in this.target_), s || I) {
        var B = {
          type: DBA,
          observableKind: "object",
          object: this.proxy_ || this.target_,
          debugObjectName: this.name_,
          oldValue: a,
          name: t
        };
        s && oC(this, B);
      }
    } finally {
      Sa();
    }
    return !0;
  }, e.observe_ = function(t, i) {
    return kR(this, t);
  }, e.intercept_ = function(t) {
    return GR(this, t);
  }, e.notifyPropertyAddition_ = function(t, i) {
    var n, o, g = nC(this), s = !1;
    if (g || s) {
      var I = g || s ? {
        type: OE,
        observableKind: "object",
        debugObjectName: this.name_,
        object: this.proxy_ || this.target_,
        name: t,
        newValue: i
      } : null;
      g && oC(this, I);
    }
    (n = this.pendingKeys_) == null || (o = n.get(t)) == null || o.set(!0), this.keysAtom_.reportChanged();
  }, e.ownKeys_ = function() {
    return this.keysAtom_.reportObserved(), $w(this.target_);
  }, e.keys_ = function() {
    return this.keysAtom_.reportObserved(), Object.keys(this.target_);
  }, A;
}();
function qp(A, e) {
  var t;
  if (zc(A, _e))
    return A;
  var i = (t = e == null ? void 0 : e.name) != null ? t : "ObservableObject", n = new aYA(A, /* @__PURE__ */ new Map(), String(i), Age(e));
  return mR(A, _e, n), A;
}
var qge = /* @__PURE__ */ Yd("ObservableObjectAdministration", aYA);
function GBA(A) {
  return fBA[A] || (fBA[A] = {
    get: function() {
      return this[_e].getObservablePropValue_(A);
    },
    set: function(e) {
      return this[_e].setObservablePropValue_(A, e);
    }
  });
}
function tf(A) {
  return qK(A) ? qge(A[_e]) : !1;
}
function kBA(A, e, t) {
  var i;
  (i = A.target_[kB]) == null || delete i[t];
}
var Oge = /* @__PURE__ */ CYA(0), jge = /* @__PURE__ */ function() {
  var A = !1, e = {};
  return Object.defineProperty(e, "0", {
    set: function() {
      A = !0;
    }
  }), Object.create(e)[0] = 1, A === !1;
}(), B5 = 0, rYA = function() {
};
function Pge(A, e) {
  Object.setPrototypeOf ? Object.setPrototypeOf(A.prototype, e) : A.prototype.__proto__ !== void 0 ? A.prototype.__proto__ = e : A.prototype = e;
}
Pge(rYA, Array.prototype);
var c7 = /* @__PURE__ */ function(A, e, t) {
  wNA(i, A);
  function i(o, g, s, I) {
    var r;
    return s === void 0 && (s = "ObservableArray"), I === void 0 && (I = !1), r = A.call(this) || this, Md(function() {
      var a = new l7(s, g, I, !0);
      a.proxy_ = a5(r), pNA(a5(r), _e, a), o && o.length && r.spliceWithArray(0, 0, o), jge && Object.defineProperty(a5(r), "0", Oge);
    }), r;
  }
  var n = i.prototype;
  return n.concat = function() {
    this[_e].atom_.reportObserved();
    for (var o = arguments.length, g = new Array(o), s = 0; s < o; s++)
      g[s] = arguments[s];
    return Array.prototype.concat.apply(
      this.slice(),
      //@ts-ignore
      g.map(function(I) {
        return JR(I) ? I.slice() : I;
      })
    );
  }, n[t] = function() {
    var o = this, g = 0;
    return bY({
      next: function() {
        return g < o.length ? {
          value: o[g++],
          done: !1
        } : {
          done: !0,
          value: void 0
        };
      }
    });
  }, g7(i, [{
    key: "length",
    get: function() {
      return this[_e].getArrayLength_();
    },
    set: function(o) {
      this[_e].setArrayLength_(o);
    }
  }, {
    key: e,
    get: function() {
      return "Array";
    }
  }]), i;
}(rYA, Symbol.toStringTag, Symbol.iterator);
Object.entries(NH).forEach(function(A) {
  var e = A[0], t = A[1];
  e !== "concat" && mR(c7.prototype, e, t);
});
function CYA(A) {
  return {
    enumerable: !1,
    configurable: !0,
    get: function() {
      return this[_e].get_(A);
    },
    set: function(e) {
      this[_e].set_(A, e);
    }
  };
}
function $ge(A) {
  KB(c7.prototype, "" + A, CYA(A));
}
function BYA(A) {
  if (A > B5) {
    for (var e = B5; e < A + 100; e++)
      $ge(e);
    B5 = A;
  }
}
BYA(1e3);
function Ase(A, e, t) {
  return new c7(A, e, t);
}
function nf(A, e) {
  if (typeof A == "object" && A !== null) {
    if (JR(A))
      return e !== void 0 && Ot(23), A[_e].atom_;
    if (_p(A))
      return A.atom_;
    if (Fd(A)) {
      if (e === void 0)
        return A.keysAtom_;
      var t = A.data_.get(e) || A.hasMap_.get(e);
      return t || Ot(25, e, kq(A)), t;
    }
    if (tf(A)) {
      if (!e)
        return Ot(26);
      var i = A[_e].values_.get(e);
      return i || Ot(27, e, kq(A)), i;
    }
    if (s7(A) || DR(A) || JH(A))
      return A;
  } else if (uC(A) && JH(A[_e]))
    return A[_e];
  Ot(28);
}
function lYA(A, e) {
  if (A || Ot(29), e !== void 0)
    return lYA(nf(A, e));
  if (s7(A) || DR(A) || JH(A) || Fd(A) || _p(A))
    return A;
  if (A[_e])
    return A[_e];
  Ot(24, A);
}
function kq(A, e) {
  var t;
  if (e !== void 0)
    t = nf(A, e);
  else {
    if (PK(A))
      return A.name;
    tf(A) || Fd(A) || _p(A) ? t = lYA(A) : t = nf(A);
  }
  return t.name_;
}
function Md(A) {
  var e = Tp(), t = a7(!0);
  Ha();
  try {
    return A();
  } finally {
    Sa(), r7(t), Tc(e);
  }
}
var JBA = hR.toString;
function Q7(A, e, t) {
  return t === void 0 && (t = -1), Jq(A, e, t);
}
function Jq(A, e, t, i, n) {
  if (A === e)
    return A !== 0 || 1 / A === 1 / e;
  if (A == null || e == null)
    return !1;
  if (A !== A)
    return e !== e;
  var o = typeof A;
  if (o !== "function" && o !== "object" && typeof e != "object")
    return !1;
  var g = JBA.call(A);
  if (g !== JBA.call(e))
    return !1;
  switch (g) {
    case "[object RegExp]":
    case "[object String]":
      return "" + A == "" + e;
    case "[object Number]":
      return +A != +A ? +e != +e : +A == 0 ? 1 / +A === 1 / e : +A == +e;
    case "[object Date]":
    case "[object Boolean]":
      return +A == +e;
    case "[object Symbol]":
      return typeof Symbol < "u" && Symbol.valueOf.call(A) === Symbol.valueOf.call(e);
    case "[object Map]":
    case "[object Set]":
      t >= 0 && t++;
      break;
  }
  A = NBA(A), e = NBA(e);
  var s = g === "[object Array]";
  if (!s) {
    if (typeof A != "object" || typeof e != "object")
      return !1;
    var I = A.constructor, r = e.constructor;
    if (I !== r && !(uC(I) && I instanceof I && uC(r) && r instanceof r) && "constructor" in A && "constructor" in e)
      return !1;
  }
  if (t === 0)
    return !1;
  t < 0 && (t = -1), i = i || [], n = n || [];
  for (var a = i.length; a--; )
    if (i[a] === A)
      return n[a] === e;
  if (i.push(A), n.push(e), s) {
    if (a = A.length, a !== e.length)
      return !1;
    for (; a--; )
      if (!Jq(A[a], e[a], t - 1, i, n))
        return !1;
  } else {
    var C = Object.keys(A), B;
    if (a = C.length, Object.keys(e).length !== a)
      return !1;
    for (; a--; )
      if (B = C[a], !(zc(e, B) && Jq(A[B], e[B], t - 1, i, n)))
        return !1;
  }
  return i.pop(), n.pop(), !0;
}
function NBA(A) {
  return JR(A) ? A.slice() : pD(A) || Fd(A) || pR(A) || _p(A) ? Array.from(A.entries()) : A;
}
function bY(A) {
  return A[Symbol.iterator] = ese, A;
}
function ese() {
  return this;
}
["Symbol", "Map", "Set"].forEach(function(A) {
  var e = o7();
  typeof e[A] > "u" && Ot("MobX requires global '" + A + "' to be available or polyfilled");
});
typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ == "object" && __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({
  spy: dge,
  extras: {
    getDebugName: kq
  },
  $mobx: _e
});
if (!u.useState)
  throw new Error("mobx-react-lite requires React with Hooks support");
if (!Zge)
  throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");
function tse(A) {
  A();
}
function ise(A) {
  A || (A = tse), Yge({ reactionScheduler: A });
}
function nse(A) {
  return Rge(A);
}
var ose = 1e4, gse = 1e4, sse = (
  /** @class */
  function() {
    function A(e) {
      var t = this;
      Object.defineProperty(this, "finalize", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: e
      }), Object.defineProperty(this, "registrations", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: /* @__PURE__ */ new Map()
      }), Object.defineProperty(this, "sweepTimeout", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "sweep", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: function(i) {
          i === void 0 && (i = ose), clearTimeout(t.sweepTimeout), t.sweepTimeout = void 0;
          var n = Date.now();
          t.registrations.forEach(function(o, g) {
            n - o.registeredAt >= i && (t.finalize(o.value), t.registrations.delete(g));
          }), t.registrations.size > 0 && t.scheduleSweep();
        }
      }), Object.defineProperty(this, "finalizeAllImmediately", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: function() {
          t.sweep(0);
        }
      });
    }
    return Object.defineProperty(A.prototype, "register", {
      enumerable: !1,
      configurable: !0,
      writable: !0,
      value: function(e, t, i) {
        this.registrations.set(i, {
          value: t,
          registeredAt: Date.now()
        }), this.scheduleSweep();
      }
    }), Object.defineProperty(A.prototype, "unregister", {
      enumerable: !1,
      configurable: !0,
      writable: !0,
      value: function(e) {
        this.registrations.delete(e);
      }
    }), Object.defineProperty(A.prototype, "scheduleSweep", {
      enumerable: !1,
      configurable: !0,
      writable: !0,
      value: function() {
        this.sweepTimeout === void 0 && (this.sweepTimeout = setTimeout(this.sweep, gse));
      }
    }), A;
  }()
), Ise = typeof FinalizationRegistry < "u" ? FinalizationRegistry : sse, Nq = new Ise(function(A) {
  var e;
  (e = A.reaction) === null || e === void 0 || e.dispose(), A.reaction = null;
}), YBA = globalThis && globalThis.__read || function(A, e) {
  var t = typeof Symbol == "function" && A[Symbol.iterator];
  if (!t)
    return A;
  var i = t.call(A), n, o = [], g;
  try {
    for (; (e === void 0 || e-- > 0) && !(n = i.next()).done; )
      o.push(n.value);
  } catch (s) {
    g = { error: s };
  } finally {
    try {
      n && !n.done && (t = i.return) && t.call(i);
    } finally {
      if (g)
        throw g.error;
    }
  }
  return o;
};
function RBA(A) {
  return "observer".concat(A);
}
var ase = (
  /** @class */
  function() {
    function A() {
    }
    return A;
  }()
);
function rse() {
  return new ase();
}
function Cse(A, e) {
  e === void 0 && (e = "observed");
  var t = YBA(b.useState(rse), 1), i = t[0], n = YBA(b.useState(), 2), o = n[1], g = function() {
    return o([]);
  }, s = b.useRef(null);
  s.current || (s.current = {
    reaction: null,
    mounted: !1,
    changedBeforeMount: !1
  });
  var I = s.current;
  I.reaction || (I.reaction = new mY(RBA(e), function() {
    I.mounted ? g() : I.changedBeforeMount = !0;
  }), Nq.register(i, I, I)), b.useDebugValue(I.reaction, nse), b.useEffect(function() {
    return Nq.unregister(I), I.mounted = !0, I.reaction ? I.changedBeforeMount && (I.changedBeforeMount = !1, g()) : (I.reaction = new mY(RBA(e), function() {
      g();
    }), g()), function() {
      I.reaction.dispose(), I.reaction = null, I.mounted = !1, I.changedBeforeMount = !1;
    };
  }, []);
  var r, a;
  if (I.reaction.track(function() {
    try {
      r = A();
    } catch (C) {
      a = C;
    }
  }), a)
    throw a;
  return r;
}
var cYA = typeof Symbol == "function" && Symbol.for, FBA = cYA ? Symbol.for("react.forward_ref") : typeof u.forwardRef == "function" && u.forwardRef(function(A) {
  return null;
}).$$typeof, MBA = cYA ? Symbol.for("react.memo") : typeof u.memo == "function" && u.memo(function(A) {
  return null;
}).$$typeof;
function gt(A, e) {
  var t;
  if (MBA && A.$$typeof === MBA)
    throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");
  var i = (t = e == null ? void 0 : e.forwardRef) !== null && t !== void 0 ? t : !1, n = A, o = A.displayName || A.name;
  if (FBA && A.$$typeof === FBA && (i = !0, n = A.render, typeof n != "function"))
    throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");
  var g = function(s, I) {
    return Cse(function() {
      return n(s, I);
    }, o);
  };
  return o !== "" && (g.displayName = o), A.contextTypes && (g.contextTypes = A.contextTypes), i && (g = u.forwardRef(g)), g = u.memo(g), lse(A, g), g;
}
var Bse = {
  $$typeof: !0,
  render: !0,
  compare: !0,
  type: !0,
  // Don't redefine `displayName`,
  // it's defined as getter-setter pair on `memo` (see #3192).
  displayName: !0
};
function lse(A, e) {
  Object.keys(A).forEach(function(t) {
    Bse[t] || Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(A, t));
  });
}
ise(Jt.unstable_batchedUpdates);
Nq.finalizeAllImmediately;
function wY(A) {
  return wY = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, wY(A);
}
function cse(A, e) {
  if (wY(A) !== "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (wY(i) !== "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function QYA(A) {
  var e = cse(A, "string");
  return wY(e) === "symbol" ? e : String(e);
}
function EYA(A, e, t) {
  return e = QYA(e), e in A ? Object.defineProperty(A, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : A[e] = t, A;
}
function Qse(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function xBA(A, e) {
  for (var t = 0; t < e.length; t++) {
    var i = e[t];
    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(A, QYA(i.key), i);
  }
}
function Ese(A, e, t) {
  return e && xBA(A.prototype, e), t && xBA(A, t), Object.defineProperty(A, "prototype", {
    writable: !1
  }), A;
}
var use = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, dse = {
  "&amp;": "&",
  "&#38;": "&",
  "&lt;": "<",
  "&#60;": "<",
  "&gt;": ">",
  "&#62;": ">",
  "&apos;": "'",
  "&#39;": "'",
  "&quot;": '"',
  "&#34;": '"',
  "&nbsp;": " ",
  "&#160;": " ",
  "&copy;": "©",
  "&#169;": "©",
  "&reg;": "®",
  "&#174;": "®",
  "&hellip;": "…",
  "&#8230;": "…",
  "&#x2F;": "/",
  "&#47;": "/"
}, hse = function(A) {
  return dse[A];
}, mse = function(A) {
  return A.replace(use, hse);
};
function LBA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function vBA(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? LBA(Object(t), !0).forEach(function(i) {
      EYA(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : LBA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
var Yq = {
  bindI18n: "languageChanged",
  bindI18nStore: "",
  transEmptyNodeValue: "",
  transSupportBasicHtmlNodes: !0,
  transWrapTextNodes: "",
  transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
  useSuspense: !0,
  unescape: mse
}, uYA, pse = u.createContext();
function yse() {
  var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  Yq = vBA(vBA({}, Yq), A);
}
function bse() {
  return Yq;
}
var wse = function() {
  function A() {
    Qse(this, A), this.usedNamespaces = {};
  }
  return Ese(A, [{
    key: "addUsedNamespaces",
    value: function(e) {
      var t = this;
      e.forEach(function(i) {
        t.usedNamespaces[i] || (t.usedNamespaces[i] = !0);
      });
    }
  }, {
    key: "getUsedNamespaces",
    value: function() {
      return Object.keys(this.usedNamespaces);
    }
  }]), A;
}();
function fse(A) {
  uYA = A;
}
function Dse() {
  return uYA;
}
var Gse = {
  type: "3rdParty",
  init: function(A) {
    yse(A.options.react), fse(A);
  }
};
function kse() {
  if (console && console.warn) {
    for (var A, e = arguments.length, t = new Array(e), i = 0; i < e; i++)
      t[i] = arguments[i];
    typeof t[0] == "string" && (t[0] = "react-i18next:: ".concat(t[0])), (A = console).warn.apply(A, t);
  }
}
var HBA = {};
function Rq() {
  for (var A = arguments.length, e = new Array(A), t = 0; t < A; t++)
    e[t] = arguments[t];
  typeof e[0] == "string" && HBA[e[0]] || (typeof e[0] == "string" && (HBA[e[0]] = /* @__PURE__ */ new Date()), kse.apply(void 0, e));
}
function SBA(A, e, t) {
  A.loadNamespaces(e, function() {
    if (A.isInitialized)
      t();
    else {
      var i = function n() {
        setTimeout(function() {
          A.off("initialized", n);
        }, 0), t();
      };
      A.on("initialized", i);
    }
  });
}
function Jse(A, e) {
  var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = e.languages[0], n = e.options ? e.options.fallbackLng : !1, o = e.languages[e.languages.length - 1];
  if (i.toLowerCase() === "cimode")
    return !0;
  var g = function(s, I) {
    var r = e.services.backendConnector.state["".concat(s, "|").concat(I)];
    return r === -1 || r === 2;
  };
  return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !g(e.isLanguageChangingTo, A) ? !1 : !!(e.hasResourceBundle(i, A) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || g(i, A) && (!n || g(o, A)));
}
function Nse(A, e) {
  var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  if (!e.languages || !e.languages.length)
    return Rq("i18n.languages were undefined or empty", e.languages), !0;
  var i = e.options.ignoreJSONStructure !== void 0;
  return i ? e.hasLoadedNamespace(A, {
    precheck: function(n, o) {
      if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && n.services.backendConnector.backend && n.isLanguageChangingTo && !o(n.isLanguageChangingTo, A))
        return !1;
    }
  }) : Jse(A, e, t);
}
function Yse(A) {
  if (Array.isArray(A))
    return A;
}
function Rse(A, e) {
  var t = A == null ? null : typeof Symbol < "u" && A[Symbol.iterator] || A["@@iterator"];
  if (t != null) {
    var i, n, o, g, s = [], I = !0, r = !1;
    try {
      if (o = (t = t.call(A)).next, e === 0) {
        if (Object(t) !== t)
          return;
        I = !1;
      } else
        for (; !(I = (i = o.call(t)).done) && (s.push(i.value), s.length !== e); I = !0)
          ;
    } catch (a) {
      r = !0, n = a;
    } finally {
      try {
        if (!I && t.return != null && (g = t.return(), Object(g) !== g))
          return;
      } finally {
        if (r)
          throw n;
      }
    }
    return s;
  }
}
function ZBA(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}
function Fse(A, e) {
  if (A) {
    if (typeof A == "string")
      return ZBA(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    if (t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set")
      return Array.from(A);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return ZBA(A, e);
  }
}
function Mse() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function xse(A, e) {
  return Yse(A) || Rse(A, e) || Fse(A, e) || Mse();
}
function WBA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function l5(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? WBA(Object(t), !0).forEach(function(i) {
      EYA(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : WBA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
var Lse = function(A, e) {
  var t = u.useRef();
  return u.useEffect(function() {
    t.current = e ? t.current : A;
  }, [A, e]), t.current;
};
function qe(A) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = e.i18n, i = u.useContext(pse) || {}, n = i.i18n, o = i.defaultNS, g = t || n || Dse();
  if (g && !g.reportNamespaces && (g.reportNamespaces = new wse()), !g) {
    Rq("You will need to pass in an i18next instance by using initReactI18next");
    var s = function(Z) {
      return Array.isArray(Z) ? Z[Z.length - 1] : Z;
    }, I = [s, {}, !1];
    return I.t = s, I.i18n = {}, I.ready = !1, I;
  }
  g.options.react && g.options.react.wait !== void 0 && Rq("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
  var r = l5(l5(l5({}, bse()), g.options.react), e), a = r.useSuspense, C = r.keyPrefix, B = A || o || g.options && g.options.defaultNS;
  B = typeof B == "string" ? [B] : B || ["translation"], g.reportNamespaces.addUsedNamespaces && g.reportNamespaces.addUsedNamespaces(B);
  var l = (g.isInitialized || g.initializedStoreOnce) && B.every(function(Z) {
    return Nse(Z, g, r);
  });
  function Q() {
    return g.getFixedT(null, r.nsMode === "fallback" ? B : B[0], C);
  }
  var E = u.useState(Q), d = xse(E, 2), m = d[0], y = d[1], f = B.join(), w = Lse(f), G = u.useRef(!0);
  u.useEffect(function() {
    var Z = r.bindI18n, c = r.bindI18nStore;
    G.current = !0, !l && !a && SBA(g, B, function() {
      G.current && y(Q);
    }), l && w && w !== f && G.current && y(Q);
    function J() {
      G.current && y(Q);
    }
    return Z && g && g.on(Z, J), c && g && g.store.on(c, J), function() {
      G.current = !1, Z && g && Z.split(" ").forEach(function(p) {
        return g.off(p, J);
      }), c && g && c.split(" ").forEach(function(p) {
        return g.store.off(p, J);
      });
    };
  }, [g, f]);
  var R = u.useRef(!0);
  u.useEffect(function() {
    G.current && !R.current && y(Q), R.current = !1;
  }, [g, C]);
  var F = [m, g, l];
  if (F.t = m, F.i18n = g, F.ready = l, l || !l && !a)
    return F;
  throw new Promise(function(Z) {
    SBA(g, B, function() {
      Z();
    });
  });
}
var hc;
(function(A) {
  A.vis = "vis", A.data = "data", A.chat = "chat";
})(hc || (hc = {}));
function Ik(A) {
  return Object.fromEntries(A.map((e) => [e, e]));
}
Ik([
  "accent",
  "category10",
  "category20",
  "category20b",
  "category20c",
  "dark2",
  "paired",
  "pastel1",
  "pastel2",
  "set1",
  "set2",
  "set3",
  "tableau10",
  "tableau20"
]), Ik(["blues", "tealblues", "teals", "greens", "browns", "oranges", "reds", "purples", "warmgreys", "greys"]), Ik([
  "viridis",
  "magma",
  "inferno",
  "plasma",
  "cividis",
  "turbo",
  "bluegreen",
  "bluepurple",
  "goldgreen",
  "goldorange",
  "goldred",
  "greenblue",
  "orangered",
  "purplebluegreen",
  "purpleblue",
  "purplered",
  "redpurple",
  "yellowgreenblue",
  "yellowgreen",
  "yelloworangebrown",
  "yelloworangered",
  "darkblue",
  "darkgold",
  "darkgreen",
  "darkmulti",
  "darkred",
  "lightgreyred",
  "lightgreyteal",
  "lightmulti",
  "lightorange",
  "lighttealblue"
]), Ik([
  "blueorange",
  "brownbluegreen",
  "purplegreen",
  "pinkyellowgreen",
  "purpleorange",
  "redblue",
  "redgrey",
  "redyellowblue",
  "redyellowgreen",
  "spectral"
]), Ik(["rainbow", "sinebow"]);
function vse({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"
  }));
}
const Hse = u.forwardRef(vse), Sse = Hse;
function Zse({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"
  }));
}
const Wse = u.forwardRef(Zse), Kse = Wse;
function Use({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3"
  }));
}
const Vse = u.forwardRef(Use), Xse = Vse;
function zse({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M15 15l6-6m0 0l-6-6m6 6H9a6 6 0 000 12h3"
  }));
}
const Tse = u.forwardRef(zse), _se = Tse;
function qse({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"
  }));
}
const Ose = u.forwardRef(qse), jse = Ose;
function Pse({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25"
  }));
}
const $se = u.forwardRef(Pse), E7 = $se;
function AIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"
  }));
}
const eIe = u.forwardRef(AIe), u7 = eIe;
function tIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"
  }));
}
const iIe = u.forwardRef(tIe), nIe = iIe;
function oIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M10.5 6a7.5 7.5 0 107.5 7.5h-7.5V6z"
  }), /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M13.5 10.5H21A7.5 7.5 0 0013.5 3v7.5z"
  }));
}
const gIe = u.forwardRef(oIe), sIe = gIe;
function IIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"
  }));
}
const aIe = u.forwardRef(IIe), rIe = aIe;
function CIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M4.5 12.75l6 6 9-13.5"
  }));
}
const BIe = u.forwardRef(CIe), dYA = BIe;
function lIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M4.5 12.75l7.5-7.5 7.5 7.5m-15 6l7.5-7.5 7.5 7.5"
  }));
}
const cIe = u.forwardRef(lIe), QIe = cIe;
function EIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
  }));
}
const uIe = u.forwardRef(EIe), dIe = uIe;
function hIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M8.25 4.5l7.5 7.5-7.5 7.5"
  }));
}
const mIe = u.forwardRef(hIe), pIe = mIe;
function yIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"
  }));
}
const bIe = u.forwardRef(yIe), NR = bIe;
function wIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M4.5 15.75l7.5-7.5 7.5 7.5"
  }));
}
const fIe = u.forwardRef(wIe), DIe = fIe;
function GIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"
  }));
}
const kIe = u.forwardRef(GIe), JIe = kIe;
function NIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"
  }), /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
  }));
}
const YIe = u.forwardRef(NIe), hYA = YIe;
function RIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 002.25-2.25V6.75a2.25 2.25 0 00-2.25-2.25H6.75A2.25 2.25 0 004.5 6.75v10.5a2.25 2.25 0 002.25 2.25zm.75-12h9v9h-9v-9z"
  }));
}
const FIe = u.forwardRef(RIe), MIe = FIe;
function xIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"
  }));
}
const LIe = u.forwardRef(xIe), vIe = LIe;
function HIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
  }));
}
const SIe = u.forwardRef(HIe), ZIe = SIe;
function WIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
  }));
}
const KIe = u.forwardRef(WIe), UIe = KIe;
function VIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z"
  }));
}
const XIe = u.forwardRef(VIe), fY = XIe;
function zIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"
  }));
}
const TIe = u.forwardRef(zIe), _Ie = TIe;
function qIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"
  }));
}
const OIe = u.forwardRef(qIe), jIe = OIe;
function PIe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M6.115 5.19l.319 1.913A6 6 0 008.11 10.36L9.75 12l-.387.775c-.217.433-.132.956.21 1.298l1.348 1.348c.21.21.329.497.329.795v1.089c0 .426.24.815.622 1.006l.153.076c.433.217.956.132 1.298-.21l.723-.723a8.7 8.7 0 002.288-4.042 1.087 1.087 0 00-.358-1.099l-1.33-1.108c-.251-.21-.582-.299-.905-.245l-1.17.195a1.125 1.125 0 01-.98-.314l-.295-.295a1.125 1.125 0 010-1.591l.13-.132a1.125 1.125 0 011.3-.21l.603.302a.809.809 0 001.086-1.086L14.25 7.5l1.256-.837a4.5 4.5 0 001.528-1.732l.146-.292M6.115 5.19A9 9 0 1017.18 4.64M6.115 5.19A8.965 8.965 0 0112 3c1.929 0 3.716.607 5.18 1.64"
  }));
}
const $Ie = u.forwardRef(PIe), Aae = $Ie;
function eae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M7.5 15h2.25m8.024-9.75c.011.05.028.1.052.148.591 1.2.924 2.55.924 3.977a8.96 8.96 0 01-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398C20.613 14.547 19.833 15 19 15h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 00.303-.54m.023-8.25H16.48a4.5 4.5 0 01-1.423-.23l-3.114-1.04a4.5 4.5 0 00-1.423-.23H6.504c-.618 0-1.217.247-1.605.729A11.95 11.95 0 002.25 12c0 .434.023.863.068 1.285C2.427 14.306 3.346 15 4.372 15h3.126c.618 0 .991.724.725 1.282A7.471 7.471 0 007.5 19.5a2.25 2.25 0 002.25 2.25.75.75 0 00.75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 002.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384"
  }));
}
const tae = u.forwardRef(eae), iae = tae;
function nae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 00-1.302 4.665c0 1.194.232 2.333.654 3.375z"
  }));
}
const oae = u.forwardRef(nae), gae = oae;
function sae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5l-3.9 19.5m-2.1-19.5l-3.9 19.5"
  }));
}
const Iae = u.forwardRef(sae), aae = Iae;
function rae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"
  }));
}
const Cae = u.forwardRef(rae), mYA = Cae;
function Bae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
  }));
}
const lae = u.forwardRef(Bae), cae = lae;
function Qae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M15 10.5a3 3 0 11-6 0 3 3 0 016 0z"
  }), /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1115 0z"
  }));
}
const Eae = u.forwardRef(Qae), uae = Eae;
function dae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M15 12H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
  }));
}
const hae = u.forwardRef(dae), pYA = hae;
function mae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M9.53 16.122a3 3 0 00-5.78 1.128 2.25 2.25 0 01-2.4 2.245 4.5 4.5 0 008.4-2.245c0-.399-.078-.78-.22-1.128zm0 0a15.998 15.998 0 003.388-1.62m-5.043-.025a15.994 15.994 0 011.622-3.395m3.42 3.42a15.995 15.995 0 004.764-4.648l3.876-5.814a1.151 1.151 0 00-1.597-1.597L14.146 6.32a15.996 15.996 0 00-4.649 4.763m3.42 3.42a6.776 6.776 0 00-3.42-3.42"
  }));
}
const pae = u.forwardRef(mae), yae = pae;
function bae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"
  }));
}
const wae = u.forwardRef(bae), fae = wae;
function Dae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"
  }));
}
const Gae = u.forwardRef(Dae), kae = Gae;
function Jae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
  }));
}
const Nae = u.forwardRef(Jae), yYA = Nae;
function Yae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 01-1.125-1.125v-3.75zM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-8.25zM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-2.25z"
  }));
}
const Rae = u.forwardRef(Yae), Fae = Rae;
function Mae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M6.429 9.75L2.25 12l4.179 2.25m0-4.5l5.571 3 5.571-3m-11.142 0L2.25 7.5 12 2.25l9.75 5.25-4.179 2.25m0 0L21.75 12l-4.179 2.25m0 0l4.179 2.25L12 21.75 2.25 16.5l4.179-2.25m11.142 0l-5.571 3-5.571-3"
  }));
}
const xae = u.forwardRef(Mae), Lae = xae;
function vae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"
  }));
}
const Hae = u.forwardRef(vae), Sae = Hae;
function Zae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 01-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0112 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"
  }));
}
const Wae = u.forwardRef(Zae), KBA = Wae;
function Kae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"
  }));
}
const Uae = u.forwardRef(Kae), A3 = Uae;
function Vae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"
  }));
}
const Xae = u.forwardRef(Vae), zae = Xae;
function Tae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M21.75 6.75a4.5 4.5 0 01-4.884 4.484c-1.076-.091-2.264.071-2.95.904l-7.152 8.684a2.548 2.548 0 11-3.586-3.586l8.684-7.152c.833-.686.995-1.874.904-2.95a4.5 4.5 0 016.336-4.486l-3.276 3.276a3.004 3.004 0 002.25 2.25l3.276-3.276c.256.565.398 1.192.398 1.852z"
  }), /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M4.867 19.125h.008v.008h-.008v-.008z"
  }));
}
const _ae = u.forwardRef(Tae), qae = _ae;
function Oae({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M6 18L18 6M6 6l12 12"
  }));
}
const jae = u.forwardRef(Oae), Pae = jae;
function ja(A) {
  var e = typeof A;
  return A != null && (e == "object" || e == "function");
}
var $ae = typeof global == "object" && global && global.Object === Object && global;
const bYA = $ae;
var Are = typeof self == "object" && self && self.Object === Object && self, ere = bYA || Are || Function("return this")();
const GC = ere;
var tre = function() {
  return GC.Date.now();
};
const c5 = tre;
var ire = /\s/;
function nre(A) {
  for (var e = A.length; e-- && ire.test(A.charAt(e)); )
    ;
  return e;
}
var ore = /^\s+/;
function gre(A) {
  return A && A.slice(0, nre(A) + 1).replace(ore, "");
}
var sre = GC.Symbol;
const Zu = sre;
var wYA = Object.prototype, Ire = wYA.hasOwnProperty, are = wYA.toString, ak = Zu ? Zu.toStringTag : void 0;
function rre(A) {
  var e = Ire.call(A, ak), t = A[ak];
  try {
    A[ak] = void 0;
    var i = !0;
  } catch {
  }
  var n = are.call(A);
  return i && (e ? A[ak] = t : delete A[ak]), n;
}
var Cre = Object.prototype, Bre = Cre.toString;
function lre(A) {
  return Bre.call(A);
}
var cre = "[object Null]", Qre = "[object Undefined]", UBA = Zu ? Zu.toStringTag : void 0;
function Op(A) {
  return A == null ? A === void 0 ? Qre : cre : UBA && UBA in Object(A) ? rre(A) : lre(A);
}
function Wu(A) {
  return A != null && typeof A == "object";
}
var Ere = "[object Symbol]";
function e3(A) {
  return typeof A == "symbol" || Wu(A) && Op(A) == Ere;
}
var VBA = 0 / 0, ure = /^[-+]0x[0-9a-f]+$/i, dre = /^0b[01]+$/i, hre = /^0o[0-7]+$/i, mre = parseInt;
function Fq(A) {
  if (typeof A == "number")
    return A;
  if (e3(A))
    return VBA;
  if (ja(A)) {
    var e = typeof A.valueOf == "function" ? A.valueOf() : A;
    A = ja(e) ? e + "" : e;
  }
  if (typeof A != "string")
    return A === 0 ? A : +A;
  A = gre(A);
  var t = dre.test(A);
  return t || hre.test(A) ? mre(A.slice(2), t ? 2 : 8) : ure.test(A) ? VBA : +A;
}
var pre = "Expected a function", yre = Math.max, bre = Math.min;
function wD(A, e, t) {
  var i, n, o, g, s, I, r = 0, a = !1, C = !1, B = !0;
  if (typeof A != "function")
    throw new TypeError(pre);
  e = Fq(e) || 0, ja(t) && (a = !!t.leading, C = "maxWait" in t, o = C ? yre(Fq(t.maxWait) || 0, e) : o, B = "trailing" in t ? !!t.trailing : B);
  function l(R) {
    var F = i, Z = n;
    return i = n = void 0, r = R, g = A.apply(Z, F), g;
  }
  function Q(R) {
    return r = R, s = setTimeout(m, e), a ? l(R) : g;
  }
  function E(R) {
    var F = R - I, Z = R - r, c = e - F;
    return C ? bre(c, o - Z) : c;
  }
  function d(R) {
    var F = R - I, Z = R - r;
    return I === void 0 || F >= e || F < 0 || C && Z >= o;
  }
  function m() {
    var R = c5();
    if (d(R))
      return y(R);
    s = setTimeout(m, E(R));
  }
  function y(R) {
    return s = void 0, B && i ? l(R) : (i = n = void 0, g);
  }
  function f() {
    s !== void 0 && clearTimeout(s), r = 0, i = I = n = s = void 0;
  }
  function w() {
    return s === void 0 ? g : y(c5());
  }
  function G() {
    var R = c5(), F = d(R);
    if (i = arguments, n = this, I = R, F) {
      if (s === void 0)
        return Q(I);
      if (C)
        return clearTimeout(s), s = setTimeout(m, e), l(I);
    }
    return s === void 0 && (s = setTimeout(m, e)), g;
  }
  return G.cancel = f, G.flush = w, G;
}
function d7(A) {
  return function(e) {
    const [t, i] = u.useState(e), n = u.useCallback(A(i), []);
    return u.useEffect(() => n(e), [e]), t;
  };
}
function fYA(A) {
  const e = d7(A);
  return function(t, i) {
    const [n, o] = u.useState(t), g = e(n), s = u.useRef(!0);
    return u.useEffect(() => o(t), [t]), u.useEffect(() => {
      s.current ? s.current = !1 : i(g);
    }, [g]), [n, o];
  };
}
const Mq = fYA((A) => wD(A, 200));
function wre(A) {
  const [e, t] = b.useState(A), i = b.useRef(e);
  i.current = e;
  const n = b.useRef(A), o = b.useRef(!1);
  n.current !== A && (n.current = A, o.current = !1);
  const g = b.useCallback((s) => {
    o.current ? t(s) : (o.current = !0, t(typeof s == "function" ? s(n.current) : s));
  }, []);
  return [o.current ? e : A, g];
}
function NA() {
  return NA = Object.assign ? Object.assign.bind() : function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, NA.apply(this, arguments);
}
function RH(A, [e, t]) {
  return Math.min(t, Math.max(e, A));
}
function ge(A, e, { checkForDefaultPrevented: t = !0 } = {}) {
  return function(i) {
    if (A == null || A(i), t === !1 || !i.defaultPrevented)
      return e == null ? void 0 : e(i);
  };
}
function fre(A, e) {
  typeof A == "function" ? A(e) : A != null && (A.current = e);
}
function t3(...A) {
  return (e) => A.forEach(
    (t) => fre(t, e)
  );
}
function Dt(...A) {
  return u.useCallback(t3(...A), A);
}
function gg(A, e = []) {
  let t = [];
  function i(o, g) {
    const s = /* @__PURE__ */ u.createContext(g), I = t.length;
    t = [
      ...t,
      g
    ];
    function r(C) {
      const { scope: B, children: l, ...Q } = C, E = (B == null ? void 0 : B[A][I]) || s, d = u.useMemo(
        () => Q,
        Object.values(Q)
      );
      return /* @__PURE__ */ u.createElement(E.Provider, {
        value: d
      }, l);
    }
    function a(C, B) {
      const l = (B == null ? void 0 : B[A][I]) || s, Q = u.useContext(l);
      if (Q)
        return Q;
      if (g !== void 0)
        return g;
      throw new Error(`\`${C}\` must be used within \`${o}\``);
    }
    return r.displayName = o + "Provider", [
      r,
      a
    ];
  }
  const n = () => {
    const o = t.map((g) => /* @__PURE__ */ u.createContext(g));
    return function(g) {
      const s = (g == null ? void 0 : g[A]) || o;
      return u.useMemo(
        () => ({
          [`__scope${A}`]: {
            ...g,
            [A]: s
          }
        }),
        [
          g,
          s
        ]
      );
    };
  };
  return n.scopeName = A, [
    i,
    Dre(n, ...e)
  ];
}
function Dre(...A) {
  const e = A[0];
  if (A.length === 1)
    return e;
  const t = () => {
    const i = A.map(
      (n) => ({
        useScope: n(),
        scopeName: n.scopeName
      })
    );
    return function(n) {
      const o = i.reduce((g, { useScope: s, scopeName: I }) => {
        const r = s(n)[`__scope${I}`];
        return {
          ...g,
          ...r
        };
      }, {});
      return u.useMemo(
        () => ({
          [`__scope${e.scopeName}`]: o
        }),
        [
          o
        ]
      );
    };
  };
  return t.scopeName = e.scopeName, t;
}
function Pa(A) {
  const e = u.useRef(A);
  return u.useEffect(() => {
    e.current = A;
  }), u.useMemo(
    () => (...t) => {
      var i;
      return (i = e.current) === null || i === void 0 ? void 0 : i.call(e, ...t);
    },
    []
  );
}
function as({ prop: A, defaultProp: e, onChange: t = () => {
} }) {
  const [i, n] = Gre({
    defaultProp: e,
    onChange: t
  }), o = A !== void 0, g = o ? A : i, s = Pa(t), I = u.useCallback((r) => {
    if (o) {
      const a = typeof r == "function" ? r(A) : r;
      a !== A && s(a);
    } else
      n(r);
  }, [
    o,
    A,
    n,
    s
  ]);
  return [
    g,
    I
  ];
}
function Gre({ defaultProp: A, onChange: e }) {
  const t = u.useState(A), [i] = t, n = u.useRef(i), o = Pa(e);
  return u.useEffect(() => {
    n.current !== i && (o(i), n.current = i);
  }, [
    i,
    n,
    o
  ]), t;
}
const kre = /* @__PURE__ */ u.createContext(void 0);
function fD(A) {
  const e = u.useContext(kre);
  return A || e || "ltr";
}
function YR(A) {
  const e = u.useRef({
    value: A,
    previous: A
  });
  return u.useMemo(() => (e.current.value !== A && (e.current.previous = e.current.value, e.current.value = A), e.current.previous), [
    A
  ]);
}
const rs = globalThis != null && globalThis.document ? u.useLayoutEffect : () => {
};
function RR(A) {
  const [e, t] = u.useState(void 0);
  return rs(() => {
    if (A) {
      t({
        width: A.offsetWidth,
        height: A.offsetHeight
      });
      const i = new ResizeObserver((n) => {
        if (!Array.isArray(n) || !n.length)
          return;
        const o = n[0];
        let g, s;
        if ("borderBoxSize" in o) {
          const I = o.borderBoxSize, r = Array.isArray(I) ? I[0] : I;
          g = r.inlineSize, s = r.blockSize;
        } else
          g = A.offsetWidth, s = A.offsetHeight;
        t({
          width: g,
          height: s
        });
      });
      return i.observe(A, {
        box: "border-box"
      }), () => i.unobserve(A);
    } else
      t(void 0);
  }, [
    A
  ]), e;
}
const rQ = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { children: t, ...i } = A, n = u.Children.toArray(t), o = n.find(Jre);
  if (o) {
    const g = o.props.children, s = n.map((I) => I === o ? u.Children.count(g) > 1 ? u.Children.only(null) : /* @__PURE__ */ u.isValidElement(g) ? g.props.children : null : I);
    return /* @__PURE__ */ u.createElement(xq, NA({}, i, {
      ref: e
    }), /* @__PURE__ */ u.isValidElement(g) ? /* @__PURE__ */ u.cloneElement(g, void 0, s) : null);
  }
  return /* @__PURE__ */ u.createElement(xq, NA({}, i, {
    ref: e
  }), t);
});
rQ.displayName = "Slot";
const xq = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { children: t, ...i } = A;
  return /* @__PURE__ */ u.isValidElement(t) ? /* @__PURE__ */ u.cloneElement(t, {
    ...Nre(i, t.props),
    ref: e ? t3(e, t.ref) : t.ref
  }) : u.Children.count(t) > 1 ? u.Children.only(null) : null;
});
xq.displayName = "SlotClone";
const DYA = ({ children: A }) => /* @__PURE__ */ u.createElement(u.Fragment, null, A);
function Jre(A) {
  return /* @__PURE__ */ u.isValidElement(A) && A.type === DYA;
}
function Nre(A, e) {
  const t = {
    ...e
  };
  for (const i in e) {
    const n = A[i], o = e[i];
    /^on[A-Z]/.test(i) ? n && o ? t[i] = (...g) => {
      o(...g), n(...g);
    } : n && (t[i] = n) : i === "style" ? t[i] = {
      ...n,
      ...o
    } : i === "className" && (t[i] = [
      n,
      o
    ].filter(Boolean).join(" "));
  }
  return {
    ...A,
    ...t
  };
}
const Yre = [
  "a",
  "button",
  "div",
  "form",
  "h2",
  "h3",
  "img",
  "input",
  "label",
  "li",
  "nav",
  "ol",
  "p",
  "span",
  "svg",
  "ul"
], ze = Yre.reduce((A, e) => {
  const t = /* @__PURE__ */ u.forwardRef((i, n) => {
    const { asChild: o, ...g } = i, s = o ? rQ : e;
    return u.useEffect(() => {
      window[Symbol.for("radix-ui")] = !0;
    }, []), /* @__PURE__ */ u.createElement(s, NA({}, g, {
      ref: n
    }));
  });
  return t.displayName = `Primitive.${e}`, {
    ...A,
    [e]: t
  };
}, {});
function GYA(A, e) {
  A && Jt.flushSync(
    () => A.dispatchEvent(e)
  );
}
function i3(A) {
  const e = A + "CollectionProvider", [t, i] = gg(e), [n, o] = t(e, {
    collectionRef: {
      current: null
    },
    itemMap: /* @__PURE__ */ new Map()
  }), g = (l) => {
    const { scope: Q, children: E } = l, d = b.useRef(null), m = b.useRef(/* @__PURE__ */ new Map()).current;
    return /* @__PURE__ */ b.createElement(n, {
      scope: Q,
      itemMap: m,
      collectionRef: d
    }, E);
  }, s = A + "CollectionSlot", I = /* @__PURE__ */ b.forwardRef((l, Q) => {
    const { scope: E, children: d } = l, m = o(s, E), y = Dt(Q, m.collectionRef);
    return /* @__PURE__ */ b.createElement(rQ, {
      ref: y
    }, d);
  }), r = A + "CollectionItemSlot", a = "data-radix-collection-item", C = /* @__PURE__ */ b.forwardRef((l, Q) => {
    const { scope: E, children: d, ...m } = l, y = b.useRef(null), f = Dt(Q, y), w = o(r, E);
    return b.useEffect(() => (w.itemMap.set(y, {
      ref: y,
      ...m
    }), () => void w.itemMap.delete(y))), /* @__PURE__ */ b.createElement(rQ, {
      [a]: "",
      ref: f
    }, d);
  });
  function B(l) {
    const Q = o(A + "CollectionConsumer", l);
    return b.useCallback(() => {
      const E = Q.collectionRef.current;
      if (!E)
        return [];
      const d = Array.from(E.querySelectorAll(`[${a}]`));
      return Array.from(Q.itemMap.values()).sort(
        (m, y) => d.indexOf(m.ref.current) - d.indexOf(y.ref.current)
      );
    }, [
      Q.collectionRef,
      Q.itemMap
    ]);
  }
  return [
    {
      Provider: g,
      Slot: I,
      ItemSlot: C
    },
    B,
    i
  ];
}
const kYA = [
  "PageUp",
  "PageDown"
], JYA = [
  "ArrowUp",
  "ArrowDown",
  "ArrowLeft",
  "ArrowRight"
], NYA = {
  "from-left": [
    "Home",
    "PageDown",
    "ArrowDown",
    "ArrowLeft"
  ],
  "from-right": [
    "Home",
    "PageDown",
    "ArrowDown",
    "ArrowRight"
  ],
  "from-bottom": [
    "Home",
    "PageDown",
    "ArrowDown",
    "ArrowLeft"
  ],
  "from-top": [
    "Home",
    "PageDown",
    "ArrowUp",
    "ArrowLeft"
  ]
}, FR = "Slider", [Lq, Rre, Fre] = i3(FR), [YYA, zVt] = gg(FR, [
  Fre
]), [Mre, n3] = YYA(FR), xre = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { name: t, min: i = 0, max: n = 100, step: o = 1, orientation: g = "horizontal", disabled: s = !1, minStepsBetweenThumbs: I = 0, defaultValue: r = [
    i
  ], value: a, onValueChange: C = () => {
  }, onValueCommit: B = () => {
  }, inverted: l = !1, ...Q } = A, [E, d] = u.useState(null), m = Dt(
    e,
    (K) => d(K)
  ), y = u.useRef(/* @__PURE__ */ new Set()), f = u.useRef(0), w = g === "horizontal", G = E ? !!E.closest("form") : !0, R = w ? Lre : vre, [F = [], Z] = as({
    prop: a,
    defaultProp: r,
    onChange: (K) => {
      var U;
      (U = [
        ...y.current
      ][f.current]) === null || U === void 0 || U.focus(), C(K);
    }
  }), c = u.useRef(F);
  function J(K) {
    const U = zre(F, K);
    v(K, U);
  }
  function p(K) {
    v(K, f.current);
  }
  function N() {
    const K = c.current[f.current];
    F[f.current] !== K && B(F);
  }
  function v(K, U, { commit: j } = {
    commit: !1
  }) {
    const q = Ore(o), O = jre(Math.round((K - i) / o) * o + i, q), $ = RH(O, [
      i,
      n
    ]);
    Z((_ = []) => {
      const tA = Vre(_, $, U);
      if (qre(tA, I * o)) {
        f.current = tA.indexOf($);
        const nA = String(tA) !== String(_);
        return nA && j && B(tA), nA ? tA : _;
      } else
        return _;
    });
  }
  return /* @__PURE__ */ u.createElement(Mre, {
    scope: A.__scopeSlider,
    disabled: s,
    min: i,
    max: n,
    valueIndexToChangeRef: f,
    thumbs: y.current,
    values: F,
    orientation: g
  }, /* @__PURE__ */ u.createElement(Lq.Provider, {
    scope: A.__scopeSlider
  }, /* @__PURE__ */ u.createElement(Lq.Slot, {
    scope: A.__scopeSlider
  }, /* @__PURE__ */ u.createElement(R, NA({
    "aria-disabled": s,
    "data-disabled": s ? "" : void 0
  }, Q, {
    ref: m,
    onPointerDown: ge(Q.onPointerDown, () => {
      s || (c.current = F);
    }),
    min: i,
    max: n,
    inverted: l,
    onSlideStart: s ? void 0 : J,
    onSlideMove: s ? void 0 : p,
    onSlideEnd: s ? void 0 : N,
    onHomeKeyDown: () => !s && v(i, 0, {
      commit: !0
    }),
    onEndKeyDown: () => !s && v(n, F.length - 1, {
      commit: !0
    }),
    onStepKeyDown: ({ event: K, direction: U }) => {
      if (!s) {
        const j = kYA.includes(K.key) || K.shiftKey && JYA.includes(K.key) ? 10 : 1, q = f.current, O = F[q], $ = o * j * U;
        v(O + $, q, {
          commit: !0
        });
      }
    }
  })))), G && F.map(
    (K, U) => /* @__PURE__ */ u.createElement(Ure, {
      key: U,
      name: t ? t + (F.length > 1 ? "[]" : "") : void 0,
      value: K
    })
  ));
}), [RYA, FYA] = YYA(FR, {
  startEdge: "left",
  endEdge: "right",
  size: "width",
  direction: 1
}), Lre = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { min: t, max: i, dir: n, inverted: o, onSlideStart: g, onSlideMove: s, onSlideEnd: I, onStepKeyDown: r, ...a } = A, [C, B] = u.useState(null), l = Dt(
    e,
    (f) => B(f)
  ), Q = u.useRef(), E = fD(n), d = E === "ltr", m = d && !o || !d && o;
  function y(f) {
    const w = Q.current || C.getBoundingClientRect(), G = [
      0,
      w.width
    ], R = h7(G, m ? [
      t,
      i
    ] : [
      i,
      t
    ]);
    return Q.current = w, R(f - w.left);
  }
  return /* @__PURE__ */ u.createElement(RYA, {
    scope: A.__scopeSlider,
    startEdge: m ? "left" : "right",
    endEdge: m ? "right" : "left",
    direction: m ? 1 : -1,
    size: "width"
  }, /* @__PURE__ */ u.createElement(MYA, NA({
    dir: E,
    "data-orientation": "horizontal"
  }, a, {
    ref: l,
    style: {
      ...a.style,
      "--radix-slider-thumb-transform": "translateX(-50%)"
    },
    onSlideStart: (f) => {
      const w = y(f.clientX);
      g == null || g(w);
    },
    onSlideMove: (f) => {
      const w = y(f.clientX);
      s == null || s(w);
    },
    onSlideEnd: () => {
      Q.current = void 0, I == null || I();
    },
    onStepKeyDown: (f) => {
      const w = NYA[m ? "from-left" : "from-right"].includes(f.key);
      r == null || r({
        event: f,
        direction: w ? -1 : 1
      });
    }
  })));
}), vre = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { min: t, max: i, inverted: n, onSlideStart: o, onSlideMove: g, onSlideEnd: s, onStepKeyDown: I, ...r } = A, a = u.useRef(null), C = Dt(e, a), B = u.useRef(), l = !n;
  function Q(E) {
    const d = B.current || a.current.getBoundingClientRect(), m = [
      0,
      d.height
    ], y = h7(m, l ? [
      i,
      t
    ] : [
      t,
      i
    ]);
    return B.current = d, y(E - d.top);
  }
  return /* @__PURE__ */ u.createElement(RYA, {
    scope: A.__scopeSlider,
    startEdge: l ? "bottom" : "top",
    endEdge: l ? "top" : "bottom",
    size: "height",
    direction: l ? 1 : -1
  }, /* @__PURE__ */ u.createElement(MYA, NA({
    "data-orientation": "vertical"
  }, r, {
    ref: C,
    style: {
      ...r.style,
      "--radix-slider-thumb-transform": "translateY(50%)"
    },
    onSlideStart: (E) => {
      const d = Q(E.clientY);
      o == null || o(d);
    },
    onSlideMove: (E) => {
      const d = Q(E.clientY);
      g == null || g(d);
    },
    onSlideEnd: () => {
      B.current = void 0, s == null || s();
    },
    onStepKeyDown: (E) => {
      const d = NYA[l ? "from-bottom" : "from-top"].includes(E.key);
      I == null || I({
        event: E,
        direction: d ? -1 : 1
      });
    }
  })));
}), MYA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSlider: t, onSlideStart: i, onSlideMove: n, onSlideEnd: o, onHomeKeyDown: g, onEndKeyDown: s, onStepKeyDown: I, ...r } = A, a = n3(FR, t);
  return /* @__PURE__ */ u.createElement(ze.span, NA({}, r, {
    ref: e,
    onKeyDown: ge(A.onKeyDown, (C) => {
      C.key === "Home" ? (g(C), C.preventDefault()) : C.key === "End" ? (s(C), C.preventDefault()) : kYA.concat(JYA).includes(C.key) && (I(C), C.preventDefault());
    }),
    onPointerDown: ge(A.onPointerDown, (C) => {
      const B = C.target;
      B.setPointerCapture(C.pointerId), C.preventDefault(), a.thumbs.has(B) ? B.focus() : i(C);
    }),
    onPointerMove: ge(A.onPointerMove, (C) => {
      C.target.hasPointerCapture(C.pointerId) && n(C);
    }),
    onPointerUp: ge(A.onPointerUp, (C) => {
      const B = C.target;
      B.hasPointerCapture(C.pointerId) && (B.releasePointerCapture(C.pointerId), o(C));
    })
  }));
}), Hre = "SliderTrack", Sre = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSlider: t, ...i } = A, n = n3(Hre, t);
  return /* @__PURE__ */ u.createElement(ze.span, NA({
    "data-disabled": n.disabled ? "" : void 0,
    "data-orientation": n.orientation
  }, i, {
    ref: e
  }));
}), XBA = "SliderRange", Zre = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSlider: t, ...i } = A, n = n3(XBA, t), o = FYA(XBA, t), g = u.useRef(null), s = Dt(e, g), I = n.values.length, r = n.values.map(
    (B) => xYA(B, n.min, n.max)
  ), a = I > 1 ? Math.min(...r) : 0, C = 100 - Math.max(...r);
  return /* @__PURE__ */ u.createElement(ze.span, NA({
    "data-orientation": n.orientation,
    "data-disabled": n.disabled ? "" : void 0
  }, i, {
    ref: s,
    style: {
      ...A.style,
      [o.startEdge]: a + "%",
      [o.endEdge]: C + "%"
    }
  }));
}), zBA = "SliderThumb", Wre = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = Rre(A.__scopeSlider), [i, n] = u.useState(null), o = Dt(
    e,
    (s) => n(s)
  ), g = u.useMemo(
    () => i ? t().findIndex(
      (s) => s.ref.current === i
    ) : -1,
    [
      t,
      i
    ]
  );
  return /* @__PURE__ */ u.createElement(Kre, NA({}, A, {
    ref: o,
    index: g
  }));
}), Kre = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSlider: t, index: i, ...n } = A, o = n3(zBA, t), g = FYA(zBA, t), [s, I] = u.useState(null), r = Dt(
    e,
    (d) => I(d)
  ), a = RR(s), C = o.values[i], B = C === void 0 ? 0 : xYA(C, o.min, o.max), l = Xre(i, o.values.length), Q = a == null ? void 0 : a[g.size], E = Q ? Tre(Q, B, g.direction) : 0;
  return u.useEffect(() => {
    if (s)
      return o.thumbs.add(s), () => {
        o.thumbs.delete(s);
      };
  }, [
    s,
    o.thumbs
  ]), /* @__PURE__ */ u.createElement("span", {
    style: {
      transform: "var(--radix-slider-thumb-transform)",
      position: "absolute",
      [g.startEdge]: `calc(${B}% + ${E}px)`
    }
  }, /* @__PURE__ */ u.createElement(Lq.ItemSlot, {
    scope: A.__scopeSlider
  }, /* @__PURE__ */ u.createElement(ze.span, NA({
    role: "slider",
    "aria-label": A["aria-label"] || l,
    "aria-valuemin": o.min,
    "aria-valuenow": C,
    "aria-valuemax": o.max,
    "aria-orientation": o.orientation,
    "data-orientation": o.orientation,
    "data-disabled": o.disabled ? "" : void 0,
    tabIndex: o.disabled ? void 0 : 0
  }, n, {
    ref: r,
    style: C === void 0 ? {
      display: "none"
    } : A.style,
    onFocus: ge(A.onFocus, () => {
      o.valueIndexToChangeRef.current = i;
    })
  }))));
}), Ure = (A) => {
  const { value: e, ...t } = A, i = u.useRef(null), n = YR(e);
  return u.useEffect(() => {
    const o = i.current, g = window.HTMLInputElement.prototype, s = Object.getOwnPropertyDescriptor(g, "value").set;
    if (n !== e && s) {
      const I = new Event("input", {
        bubbles: !0
      });
      s.call(o, e), o.dispatchEvent(I);
    }
  }, [
    n,
    e
  ]), /* @__PURE__ */ u.createElement("input", NA({
    style: {
      display: "none"
    }
  }, t, {
    ref: i,
    defaultValue: e
  }));
};
function Vre(A = [], e, t) {
  const i = [
    ...A
  ];
  return i[t] = e, i.sort(
    (n, o) => n - o
  );
}
function xYA(A, e, t) {
  const i = 100 / (t - e) * (A - e);
  return RH(i, [
    0,
    100
  ]);
}
function Xre(A, e) {
  return e > 2 ? `Value ${A + 1} of ${e}` : e === 2 ? [
    "Minimum",
    "Maximum"
  ][A] : void 0;
}
function zre(A, e) {
  if (A.length === 1)
    return 0;
  const t = A.map(
    (n) => Math.abs(n - e)
  ), i = Math.min(...t);
  return t.indexOf(i);
}
function Tre(A, e, t) {
  const i = A / 2, n = h7([
    0,
    50
  ], [
    0,
    i
  ]);
  return (i - n(e) * t) * t;
}
function _re(A) {
  return A.slice(0, -1).map(
    (e, t) => A[t + 1] - e
  );
}
function qre(A, e) {
  if (e > 0) {
    const t = _re(A);
    return Math.min(...t) >= e;
  }
  return !0;
}
function h7(A, e) {
  return (t) => {
    if (A[0] === A[1] || e[0] === e[1])
      return e[0];
    const i = (e[1] - e[0]) / (A[1] - A[0]);
    return e[0] + i * (t - A[0]);
  };
}
function Ore(A) {
  return (String(A).split(".")[1] || "").length;
}
function jre(A, e) {
  const t = Math.pow(10, e);
  return Math.round(A * t) / t;
}
const o3 = xre, LYA = Sre, vYA = Zre, vq = Wre;
function gC(A) {
  return gC = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, gC(A);
}
function ml(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function Pre(A, e) {
  if (gC(A) !== "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (gC(i) !== "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function HYA(A) {
  var e = Pre(A, "string");
  return gC(e) === "symbol" ? e : String(e);
}
function TBA(A, e) {
  for (var t = 0; t < e.length; t++) {
    var i = e[t];
    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(A, HYA(i.key), i);
  }
}
function pl(A, e, t) {
  return e && TBA(A.prototype, e), t && TBA(A, t), Object.defineProperty(A, "prototype", {
    writable: !1
  }), A;
}
function yu(A) {
  if (A === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return A;
}
function Hq(A, e) {
  return Hq = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, i) {
    return t.__proto__ = i, t;
  }, Hq(A, e);
}
function g3(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function");
  A.prototype = Object.create(e && e.prototype, {
    constructor: {
      value: A,
      writable: !0,
      configurable: !0
    }
  }), Object.defineProperty(A, "prototype", {
    writable: !1
  }), e && Hq(A, e);
}
function MR(A, e) {
  if (e && (gC(e) === "object" || typeof e == "function"))
    return e;
  if (e !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return yu(A);
}
function tl(A) {
  return tl = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
    return e.__proto__ || Object.getPrototypeOf(e);
  }, tl(A);
}
function xd(A, e, t) {
  return e = HYA(e), e in A ? Object.defineProperty(A, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : A[e] = t, A;
}
function $re(A) {
  if (Array.isArray(A))
    return A;
}
function ACe(A) {
  if (typeof Symbol < "u" && A[Symbol.iterator] != null || A["@@iterator"] != null)
    return Array.from(A);
}
function _BA(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}
function eCe(A, e) {
  if (A) {
    if (typeof A == "string")
      return _BA(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    if (t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set")
      return Array.from(A);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return _BA(A, e);
  }
}
function tCe() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function iCe(A) {
  return $re(A) || ACe(A) || eCe(A) || tCe();
}
function qBA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function OBA(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? qBA(Object(t), !0).forEach(function(i) {
      xd(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : qBA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
var nCe = {
  type: "logger",
  log: function(A) {
    this.output("log", A);
  },
  warn: function(A) {
    this.output("warn", A);
  },
  error: function(A) {
    this.output("error", A);
  },
  output: function(A, e) {
    console && console[A] && console[A].apply(console, e);
  }
}, oCe = function() {
  function A(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    ml(this, A), this.init(e, t);
  }
  return pl(A, [{
    key: "init",
    value: function(e) {
      var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      this.prefix = t.prefix || "i18next:", this.logger = e || nCe, this.options = t, this.debug = t.debug;
    }
  }, {
    key: "setDebug",
    value: function(e) {
      this.debug = e;
    }
  }, {
    key: "log",
    value: function() {
      for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
        t[i] = arguments[i];
      return this.forward(t, "log", "", !0);
    }
  }, {
    key: "warn",
    value: function() {
      for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
        t[i] = arguments[i];
      return this.forward(t, "warn", "", !0);
    }
  }, {
    key: "error",
    value: function() {
      for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
        t[i] = arguments[i];
      return this.forward(t, "error", "");
    }
  }, {
    key: "deprecate",
    value: function() {
      for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
        t[i] = arguments[i];
      return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
    }
  }, {
    key: "forward",
    value: function(e, t, i, n) {
      return n && !this.debug ? null : (typeof e[0] == "string" && (e[0] = "".concat(i).concat(this.prefix, " ").concat(e[0])), this.logger[t](e));
    }
  }, {
    key: "create",
    value: function(e) {
      return new A(this.logger, OBA(OBA({}, {
        prefix: "".concat(this.prefix, ":").concat(e, ":")
      }), this.options));
    }
  }, {
    key: "clone",
    value: function(e) {
      return e = e || this.options, e.prefix = e.prefix || this.prefix, new A(this.logger, e);
    }
  }]), A;
}(), JB = new oCe(), Ku = function() {
  function A() {
    ml(this, A), this.observers = {};
  }
  return pl(A, [{
    key: "on",
    value: function(e, t) {
      var i = this;
      return e.split(" ").forEach(function(n) {
        i.observers[n] = i.observers[n] || [], i.observers[n].push(t);
      }), this;
    }
  }, {
    key: "off",
    value: function(e, t) {
      if (this.observers[e]) {
        if (!t) {
          delete this.observers[e];
          return;
        }
        this.observers[e] = this.observers[e].filter(function(i) {
          return i !== t;
        });
      }
    }
  }, {
    key: "emit",
    value: function(e) {
      for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
        i[n - 1] = arguments[n];
      if (this.observers[e]) {
        var o = [].concat(this.observers[e]);
        o.forEach(function(s) {
          s.apply(void 0, i);
        });
      }
      if (this.observers["*"]) {
        var g = [].concat(this.observers["*"]);
        g.forEach(function(s) {
          s.apply(s, [e].concat(i));
        });
      }
    }
  }]), A;
}();
function rk() {
  var A, e, t = new Promise(function(i, n) {
    A = i, e = n;
  });
  return t.resolve = A, t.reject = e, t;
}
function jBA(A) {
  return A == null ? "" : "" + A;
}
function gCe(A, e, t) {
  A.forEach(function(i) {
    e[i] && (t[i] = e[i]);
  });
}
function m7(A, e, t) {
  function i(s) {
    return s && s.indexOf("###") > -1 ? s.replace(/###/g, ".") : s;
  }
  function n() {
    return !A || typeof A == "string";
  }
  for (var o = typeof e != "string" ? [].concat(e) : e.split("."); o.length > 1; ) {
    if (n())
      return {};
    var g = i(o.shift());
    !A[g] && t && (A[g] = new t()), Object.prototype.hasOwnProperty.call(A, g) ? A = A[g] : A = {};
  }
  return n() ? {} : {
    obj: A,
    k: i(o.shift())
  };
}
function PBA(A, e, t) {
  var i = m7(A, e, Object), n = i.obj, o = i.k;
  n[o] = t;
}
function sCe(A, e, t, i) {
  var n = m7(A, e, Object), o = n.obj, g = n.k;
  o[g] = o[g] || [], i && (o[g] = o[g].concat(t)), i || o[g].push(t);
}
function FH(A, e) {
  var t = m7(A, e), i = t.obj, n = t.k;
  if (i)
    return i[n];
}
function $BA(A, e, t) {
  var i = FH(A, t);
  return i !== void 0 ? i : FH(e, t);
}
function SYA(A, e, t) {
  for (var i in e)
    i !== "__proto__" && i !== "constructor" && (i in A ? typeof A[i] == "string" || A[i] instanceof String || typeof e[i] == "string" || e[i] instanceof String ? t && (A[i] = e[i]) : SYA(A[i], e[i], t) : A[i] = e[i]);
  return A;
}
function iy(A) {
  return A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
var ICe = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;",
  "/": "&#x2F;"
};
function aCe(A) {
  return typeof A == "string" ? A.replace(/[&<>"'\/]/g, function(e) {
    return ICe[e];
  }) : A;
}
var s3 = typeof window < "u" && window.navigator && typeof window.navigator.userAgentData > "u" && window.navigator.userAgent && window.navigator.userAgent.indexOf("MSIE") > -1, rCe = [" ", ",", "?", "!", ";"];
function CCe(A, e, t) {
  e = e || "", t = t || "";
  var i = rCe.filter(function(s) {
    return e.indexOf(s) < 0 && t.indexOf(s) < 0;
  });
  if (i.length === 0)
    return !0;
  var n = new RegExp("(".concat(i.map(function(s) {
    return s === "?" ? "\\?" : s;
  }).join("|"), ")")), o = !n.test(A);
  if (!o) {
    var g = A.indexOf(t);
    g > 0 && !n.test(A.substring(0, g)) && (o = !0);
  }
  return o;
}
function AlA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function bM(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? AlA(Object(t), !0).forEach(function(i) {
      xd(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : AlA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function BCe(A) {
  var e = lCe();
  return function() {
    var t = tl(A), i;
    if (e) {
      var n = tl(this).constructor;
      i = Reflect.construct(t, arguments, n);
    } else
      i = t.apply(this, arguments);
    return MR(this, i);
  };
}
function lCe() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
    return !1;
  if (typeof Proxy == "function")
    return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function ZYA(A, e) {
  var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
  if (A) {
    if (A[e])
      return A[e];
    for (var i = e.split(t), n = A, o = 0; o < i.length; ++o) {
      if (!n || typeof n[i[o]] == "string" && o + 1 < i.length)
        return;
      if (n[i[o]] === void 0) {
        for (var g = 2, s = i.slice(o, o + g).join(t), I = n[s]; I === void 0 && i.length > o + g; )
          g++, s = i.slice(o, o + g).join(t), I = n[s];
        if (I === void 0)
          return;
        if (I === null)
          return null;
        if (e.endsWith(s)) {
          if (typeof I == "string")
            return I;
          if (s && typeof I[s] == "string")
            return I[s];
        }
        var r = i.slice(o + g).join(t);
        return r ? ZYA(I, r, t) : void 0;
      }
      n = n[i[o]];
    }
    return n;
  }
}
var cCe = function(A) {
  g3(t, A);
  var e = BCe(t);
  function t(i) {
    var n, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
      ns: ["translation"],
      defaultNS: "translation"
    };
    return ml(this, t), n = e.call(this), s3 && Ku.call(yu(n)), n.data = i || {}, n.options = o, n.options.keySeparator === void 0 && (n.options.keySeparator = "."), n.options.ignoreJSONStructure === void 0 && (n.options.ignoreJSONStructure = !0), n;
  }
  return pl(t, [{
    key: "addNamespaces",
    value: function(i) {
      this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
    }
  }, {
    key: "removeNamespaces",
    value: function(i) {
      var n = this.options.ns.indexOf(i);
      n > -1 && this.options.ns.splice(n, 1);
    }
  }, {
    key: "getResource",
    value: function(i, n, o) {
      var g = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, s = g.keySeparator !== void 0 ? g.keySeparator : this.options.keySeparator, I = g.ignoreJSONStructure !== void 0 ? g.ignoreJSONStructure : this.options.ignoreJSONStructure, r = [i, n];
      o && typeof o != "string" && (r = r.concat(o)), o && typeof o == "string" && (r = r.concat(s ? o.split(s) : o)), i.indexOf(".") > -1 && (r = i.split("."));
      var a = FH(this.data, r);
      return a || !I || typeof o != "string" ? a : ZYA(this.data && this.data[i] && this.data[i][n], o, s);
    }
  }, {
    key: "addResource",
    value: function(i, n, o, g) {
      var s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
        silent: !1
      }, I = this.options.keySeparator;
      I === void 0 && (I = ".");
      var r = [i, n];
      o && (r = r.concat(I ? o.split(I) : o)), i.indexOf(".") > -1 && (r = i.split("."), g = n, n = r[1]), this.addNamespaces(n), PBA(this.data, r, g), s.silent || this.emit("added", i, n, o, g);
    }
  }, {
    key: "addResources",
    value: function(i, n, o) {
      var g = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
        silent: !1
      };
      for (var s in o)
        (typeof o[s] == "string" || Object.prototype.toString.apply(o[s]) === "[object Array]") && this.addResource(i, n, s, o[s], {
          silent: !0
        });
      g.silent || this.emit("added", i, n, o);
    }
  }, {
    key: "addResourceBundle",
    value: function(i, n, o, g, s) {
      var I = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
        silent: !1
      }, r = [i, n];
      i.indexOf(".") > -1 && (r = i.split("."), g = o, o = n, n = r[1]), this.addNamespaces(n);
      var a = FH(this.data, r) || {};
      g ? SYA(a, o, s) : a = bM(bM({}, a), o), PBA(this.data, r, a), I.silent || this.emit("added", i, n, o);
    }
  }, {
    key: "removeResourceBundle",
    value: function(i, n) {
      this.hasResourceBundle(i, n) && delete this.data[i][n], this.removeNamespaces(n), this.emit("removed", i, n);
    }
  }, {
    key: "hasResourceBundle",
    value: function(i, n) {
      return this.getResource(i, n) !== void 0;
    }
  }, {
    key: "getResourceBundle",
    value: function(i, n) {
      return n || (n = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? bM(bM({}, {}), this.getResource(i, n)) : this.getResource(i, n);
    }
  }, {
    key: "getDataByLanguage",
    value: function(i) {
      return this.data[i];
    }
  }, {
    key: "hasLanguageSomeTranslations",
    value: function(i) {
      var n = this.getDataByLanguage(i), o = n && Object.keys(n) || [];
      return !!o.find(function(g) {
        return n[g] && Object.keys(n[g]).length > 0;
      });
    }
  }, {
    key: "toJSON",
    value: function() {
      return this.data;
    }
  }]), t;
}(Ku), WYA = {
  processors: {},
  addPostProcessor: function(A) {
    this.processors[A.name] = A;
  },
  handle: function(A, e, t, i, n) {
    var o = this;
    return A.forEach(function(g) {
      o.processors[g] && (e = o.processors[g].process(e, t, i, n));
    }), e;
  }
};
function elA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function Kg(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? elA(Object(t), !0).forEach(function(i) {
      xd(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : elA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function QCe(A) {
  var e = ECe();
  return function() {
    var t = tl(A), i;
    if (e) {
      var n = tl(this).constructor;
      i = Reflect.construct(t, arguments, n);
    } else
      i = t.apply(this, arguments);
    return MR(this, i);
  };
}
function ECe() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
    return !1;
  if (typeof Proxy == "function")
    return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
var tlA = {}, ilA = function(A) {
  g3(t, A);
  var e = QCe(t);
  function t(i) {
    var n, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return ml(this, t), n = e.call(this), s3 && Ku.call(yu(n)), gCe(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], i, yu(n)), n.options = o, n.options.keySeparator === void 0 && (n.options.keySeparator = "."), n.logger = JB.create("translator"), n;
  }
  return pl(t, [{
    key: "changeLanguage",
    value: function(i) {
      i && (this.language = i);
    }
  }, {
    key: "exists",
    value: function(i) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
        interpolation: {}
      };
      if (i == null)
        return !1;
      var o = this.resolve(i, n);
      return o && o.res !== void 0;
    }
  }, {
    key: "extractFromKey",
    value: function(i, n) {
      var o = n.nsSeparator !== void 0 ? n.nsSeparator : this.options.nsSeparator;
      o === void 0 && (o = ":");
      var g = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, s = n.ns || this.options.defaultNS || [], I = o && i.indexOf(o) > -1, r = !this.options.userDefinedKeySeparator && !n.keySeparator && !this.options.userDefinedNsSeparator && !n.nsSeparator && !CCe(i, o, g);
      if (I && !r) {
        var a = i.match(this.interpolator.nestingRegexp);
        if (a && a.length > 0)
          return {
            key: i,
            namespaces: s
          };
        var C = i.split(o);
        (o !== g || o === g && this.options.ns.indexOf(C[0]) > -1) && (s = C.shift()), i = C.join(g);
      }
      return typeof s == "string" && (s = [s]), {
        key: i,
        namespaces: s
      };
    }
  }, {
    key: "translate",
    value: function(i, n, o) {
      var g = this;
      if (gC(n) !== "object" && this.options.overloadTranslationOptionHandler && (n = this.options.overloadTranslationOptionHandler(arguments)), n || (n = {}), i == null)
        return "";
      Array.isArray(i) || (i = [String(i)]);
      var s = n.returnDetails !== void 0 ? n.returnDetails : this.options.returnDetails, I = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, r = this.extractFromKey(i[i.length - 1], n), a = r.key, C = r.namespaces, B = C[C.length - 1], l = n.lng || this.language, Q = n.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
      if (l && l.toLowerCase() === "cimode") {
        if (Q) {
          var E = n.nsSeparator || this.options.nsSeparator;
          return s ? (d.res = "".concat(B).concat(E).concat(a), d) : "".concat(B).concat(E).concat(a);
        }
        return s ? (d.res = a, d) : a;
      }
      var d = this.resolve(i, n), m = d && d.res, y = d && d.usedKey || a, f = d && d.exactUsedKey || a, w = Object.prototype.toString.apply(m), G = ["[object Number]", "[object Function]", "[object RegExp]"], R = n.joinArrays !== void 0 ? n.joinArrays : this.options.joinArrays, F = !this.i18nFormat || this.i18nFormat.handleAsObject, Z = typeof m != "string" && typeof m != "boolean" && typeof m != "number";
      if (F && m && Z && G.indexOf(w) < 0 && !(typeof R == "string" && w === "[object Array]")) {
        if (!n.returnObjects && !this.options.returnObjects) {
          this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
          var c = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(y, m, Kg(Kg({}, n), {}, {
            ns: C
          })) : "key '".concat(a, " (").concat(this.language, ")' returned an object instead of string.");
          return s ? (d.res = c, d) : c;
        }
        if (I) {
          var J = w === "[object Array]", p = J ? [] : {}, N = J ? f : y;
          for (var v in m)
            if (Object.prototype.hasOwnProperty.call(m, v)) {
              var K = "".concat(N).concat(I).concat(v);
              p[v] = this.translate(K, Kg(Kg({}, n), {
                joinArrays: !1,
                ns: C
              })), p[v] === K && (p[v] = m[v]);
            }
          m = p;
        }
      } else if (F && typeof R == "string" && w === "[object Array]")
        m = m.join(R), m && (m = this.extendTranslation(m, i, n, o));
      else {
        var U = !1, j = !1, q = n.count !== void 0 && typeof n.count != "string", O = t.hasDefaultValue(n), $ = q ? this.pluralResolver.getSuffix(l, n.count, n) : "", _ = n["defaultValue".concat($)] || n.defaultValue;
        !this.isValidLookup(m) && O && (U = !0, m = _), this.isValidLookup(m) || (j = !0, m = a);
        var tA = n.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey, nA = tA && j ? void 0 : m, AA = O && _ !== m && this.options.updateMissing;
        if (j || U || AA) {
          if (this.logger.log(AA ? "updateKey" : "missingKey", l, B, a, AA ? _ : m), I) {
            var gA = this.resolve(a, Kg(Kg({}, n), {}, {
              keySeparator: !1
            }));
            gA && gA.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
          }
          var rA = [], sA = this.languageUtils.getFallbackCodes(this.options.fallbackLng, n.lng || this.language);
          if (this.options.saveMissingTo === "fallback" && sA && sA[0])
            for (var lA = 0; lA < sA.length; lA++)
              rA.push(sA[lA]);
          else
            this.options.saveMissingTo === "all" ? rA = this.languageUtils.toResolveHierarchy(n.lng || this.language) : rA.push(n.lng || this.language);
          var cA = function(aA, QA, hA) {
            var EA = O && hA !== m ? hA : nA;
            g.options.missingKeyHandler ? g.options.missingKeyHandler(aA, B, QA, EA, AA, n) : g.backendConnector && g.backendConnector.saveMissing && g.backendConnector.saveMissing(aA, B, QA, EA, AA, n), g.emit("missingKey", aA, B, QA, m);
          };
          this.options.saveMissing && (this.options.saveMissingPlurals && q ? rA.forEach(function(aA) {
            g.pluralResolver.getSuffixes(aA, n).forEach(function(QA) {
              cA([aA], a + QA, n["defaultValue".concat(QA)] || _);
            });
          }) : cA(rA, a, _));
        }
        m = this.extendTranslation(m, i, n, d, o), j && m === a && this.options.appendNamespaceToMissingKey && (m = "".concat(B, ":").concat(a)), (j || U) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? m = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(B, ":").concat(a) : a, U ? m : void 0) : m = this.options.parseMissingKeyHandler(m));
      }
      return s ? (d.res = m, d) : m;
    }
  }, {
    key: "extendTranslation",
    value: function(i, n, o, g, s) {
      var I = this;
      if (this.i18nFormat && this.i18nFormat.parse)
        i = this.i18nFormat.parse(i, Kg(Kg({}, this.options.interpolation.defaultVariables), o), g.usedLng, g.usedNS, g.usedKey, {
          resolved: g
        });
      else if (!o.skipInterpolation) {
        o.interpolation && this.interpolator.init(Kg(Kg({}, o), {
          interpolation: Kg(Kg({}, this.options.interpolation), o.interpolation)
        }));
        var r = typeof i == "string" && (o && o.interpolation && o.interpolation.skipOnVariables !== void 0 ? o.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables), a;
        if (r) {
          var C = i.match(this.interpolator.nestingRegexp);
          a = C && C.length;
        }
        var B = o.replace && typeof o.replace != "string" ? o.replace : o;
        if (this.options.interpolation.defaultVariables && (B = Kg(Kg({}, this.options.interpolation.defaultVariables), B)), i = this.interpolator.interpolate(i, B, o.lng || this.language, o), r) {
          var l = i.match(this.interpolator.nestingRegexp), Q = l && l.length;
          a < Q && (o.nest = !1);
        }
        o.nest !== !1 && (i = this.interpolator.nest(i, function() {
          for (var m = arguments.length, y = new Array(m), f = 0; f < m; f++)
            y[f] = arguments[f];
          return s && s[0] === y[0] && !o.context ? (I.logger.warn("It seems you are nesting recursively key: ".concat(y[0], " in key: ").concat(n[0])), null) : I.translate.apply(I, y.concat([n]));
        }, o)), o.interpolation && this.interpolator.reset();
      }
      var E = o.postProcess || this.options.postProcess, d = typeof E == "string" ? [E] : E;
      return i != null && d && d.length && o.applyPostProcessor !== !1 && (i = WYA.handle(d, i, n, this.options && this.options.postProcessPassResolved ? Kg({
        i18nResolved: g
      }, o) : o, this)), i;
    }
  }, {
    key: "resolve",
    value: function(i) {
      var n = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g, s, I, r, a;
      return typeof i == "string" && (i = [i]), i.forEach(function(C) {
        if (!n.isValidLookup(g)) {
          var B = n.extractFromKey(C, o), l = B.key;
          s = l;
          var Q = B.namespaces;
          n.options.fallbackNS && (Q = Q.concat(n.options.fallbackNS));
          var E = o.count !== void 0 && typeof o.count != "string", d = E && !o.ordinal && o.count === 0 && n.pluralResolver.shouldUseIntlApi(), m = o.context !== void 0 && (typeof o.context == "string" || typeof o.context == "number") && o.context !== "", y = o.lngs ? o.lngs : n.languageUtils.toResolveHierarchy(o.lng || n.language, o.fallbackLng);
          Q.forEach(function(f) {
            n.isValidLookup(g) || (a = f, !tlA["".concat(y[0], "-").concat(f)] && n.utils && n.utils.hasLoadedNamespace && !n.utils.hasLoadedNamespace(a) && (tlA["".concat(y[0], "-").concat(f)] = !0, n.logger.warn('key "'.concat(s, '" for languages "').concat(y.join(", "), `" won't get resolved as namespace "`).concat(a, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), y.forEach(function(w) {
              if (!n.isValidLookup(g)) {
                r = w;
                var G = [l];
                if (n.i18nFormat && n.i18nFormat.addLookupKeys)
                  n.i18nFormat.addLookupKeys(G, l, w, f, o);
                else {
                  var R;
                  E && (R = n.pluralResolver.getSuffix(w, o.count, o));
                  var F = "".concat(n.options.pluralSeparator, "zero");
                  if (E && (G.push(l + R), d && G.push(l + F)), m) {
                    var Z = "".concat(l).concat(n.options.contextSeparator).concat(o.context);
                    G.push(Z), E && (G.push(Z + R), d && G.push(Z + F));
                  }
                }
                for (var c; c = G.pop(); )
                  n.isValidLookup(g) || (I = c, g = n.getResource(w, f, c, o));
              }
            }));
          });
        }
      }), {
        res: g,
        usedKey: s,
        exactUsedKey: I,
        usedLng: r,
        usedNS: a
      };
    }
  }, {
    key: "isValidLookup",
    value: function(i) {
      return i !== void 0 && !(!this.options.returnNull && i === null) && !(!this.options.returnEmptyString && i === "");
    }
  }, {
    key: "getResource",
    value: function(i, n, o) {
      var g = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
      return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(i, n, o, g) : this.resourceStore.getResource(i, n, o, g);
    }
  }], [{
    key: "hasDefaultValue",
    value: function(i) {
      var n = "defaultValue";
      for (var o in i)
        if (Object.prototype.hasOwnProperty.call(i, o) && n === o.substring(0, n.length) && i[o] !== void 0)
          return !0;
      return !1;
    }
  }]), t;
}(Ku);
function Q5(A) {
  return A.charAt(0).toUpperCase() + A.slice(1);
}
var uCe = function() {
  function A(e) {
    ml(this, A), this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = JB.create("languageUtils");
  }
  return pl(A, [{
    key: "getScriptPartFromCode",
    value: function(e) {
      if (!e || e.indexOf("-") < 0)
        return null;
      var t = e.split("-");
      return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
    }
  }, {
    key: "getLanguagePartFromCode",
    value: function(e) {
      if (!e || e.indexOf("-") < 0)
        return e;
      var t = e.split("-");
      return this.formatLanguageCode(t[0]);
    }
  }, {
    key: "formatLanguageCode",
    value: function(e) {
      if (typeof e == "string" && e.indexOf("-") > -1) {
        var t = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"], i = e.split("-");
        return this.options.lowerCaseLng ? i = i.map(function(n) {
          return n.toLowerCase();
        }) : i.length === 2 ? (i[0] = i[0].toLowerCase(), i[1] = i[1].toUpperCase(), t.indexOf(i[1].toLowerCase()) > -1 && (i[1] = Q5(i[1].toLowerCase()))) : i.length === 3 && (i[0] = i[0].toLowerCase(), i[1].length === 2 && (i[1] = i[1].toUpperCase()), i[0] !== "sgn" && i[2].length === 2 && (i[2] = i[2].toUpperCase()), t.indexOf(i[1].toLowerCase()) > -1 && (i[1] = Q5(i[1].toLowerCase())), t.indexOf(i[2].toLowerCase()) > -1 && (i[2] = Q5(i[2].toLowerCase()))), i.join("-");
      }
      return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
    }
  }, {
    key: "isSupportedCode",
    value: function(e) {
      return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
    }
  }, {
    key: "getBestMatchFromCodes",
    value: function(e) {
      var t = this;
      if (!e)
        return null;
      var i;
      return e.forEach(function(n) {
        if (!i) {
          var o = t.formatLanguageCode(n);
          (!t.options.supportedLngs || t.isSupportedCode(o)) && (i = o);
        }
      }), !i && this.options.supportedLngs && e.forEach(function(n) {
        if (!i) {
          var o = t.getLanguagePartFromCode(n);
          if (t.isSupportedCode(o))
            return i = o;
          i = t.options.supportedLngs.find(function(g) {
            if (g.indexOf(o) === 0)
              return g;
          });
        }
      }), i || (i = this.getFallbackCodes(this.options.fallbackLng)[0]), i;
    }
  }, {
    key: "getFallbackCodes",
    value: function(e, t) {
      if (!e)
        return [];
      if (typeof e == "function" && (e = e(t)), typeof e == "string" && (e = [e]), Object.prototype.toString.apply(e) === "[object Array]")
        return e;
      if (!t)
        return e.default || [];
      var i = e[t];
      return i || (i = e[this.getScriptPartFromCode(t)]), i || (i = e[this.formatLanguageCode(t)]), i || (i = e[this.getLanguagePartFromCode(t)]), i || (i = e.default), i || [];
    }
  }, {
    key: "toResolveHierarchy",
    value: function(e, t) {
      var i = this, n = this.getFallbackCodes(t || this.options.fallbackLng || [], e), o = [], g = function(s) {
        s && (i.isSupportedCode(s) ? o.push(s) : i.logger.warn("rejecting language code not found in supportedLngs: ".concat(s)));
      };
      return typeof e == "string" && e.indexOf("-") > -1 ? (this.options.load !== "languageOnly" && g(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && g(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && g(this.getLanguagePartFromCode(e))) : typeof e == "string" && g(this.formatLanguageCode(e)), n.forEach(function(s) {
        o.indexOf(s) < 0 && g(i.formatLanguageCode(s));
      }), o;
    }
  }]), A;
}(), dCe = [{
  lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
  nr: [1, 2],
  fc: 1
}, {
  lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
  nr: [1, 2],
  fc: 2
}, {
  lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
  nr: [1],
  fc: 3
}, {
  lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
  nr: [1, 2, 5],
  fc: 4
}, {
  lngs: ["ar"],
  nr: [0, 1, 2, 3, 11, 100],
  fc: 5
}, {
  lngs: ["cs", "sk"],
  nr: [1, 2, 5],
  fc: 6
}, {
  lngs: ["csb", "pl"],
  nr: [1, 2, 5],
  fc: 7
}, {
  lngs: ["cy"],
  nr: [1, 2, 3, 8],
  fc: 8
}, {
  lngs: ["fr"],
  nr: [1, 2],
  fc: 9
}, {
  lngs: ["ga"],
  nr: [1, 2, 3, 7, 11],
  fc: 10
}, {
  lngs: ["gd"],
  nr: [1, 2, 3, 20],
  fc: 11
}, {
  lngs: ["is"],
  nr: [1, 2],
  fc: 12
}, {
  lngs: ["jv"],
  nr: [0, 1],
  fc: 13
}, {
  lngs: ["kw"],
  nr: [1, 2, 3, 4],
  fc: 14
}, {
  lngs: ["lt"],
  nr: [1, 2, 10],
  fc: 15
}, {
  lngs: ["lv"],
  nr: [1, 2, 0],
  fc: 16
}, {
  lngs: ["mk"],
  nr: [1, 2],
  fc: 17
}, {
  lngs: ["mnk"],
  nr: [0, 1, 2],
  fc: 18
}, {
  lngs: ["mt"],
  nr: [1, 2, 11, 20],
  fc: 19
}, {
  lngs: ["or"],
  nr: [2, 1],
  fc: 2
}, {
  lngs: ["ro"],
  nr: [1, 2, 20],
  fc: 20
}, {
  lngs: ["sl"],
  nr: [5, 1, 2, 3],
  fc: 21
}, {
  lngs: ["he", "iw"],
  nr: [1, 2, 20, 21],
  fc: 22
}], hCe = {
  1: function(A) {
    return +(A > 1);
  },
  2: function(A) {
    return +(A != 1);
  },
  3: function(A) {
    return 0;
  },
  4: function(A) {
    return A % 10 == 1 && A % 100 != 11 ? 0 : A % 10 >= 2 && A % 10 <= 4 && (A % 100 < 10 || A % 100 >= 20) ? 1 : 2;
  },
  5: function(A) {
    return A == 0 ? 0 : A == 1 ? 1 : A == 2 ? 2 : A % 100 >= 3 && A % 100 <= 10 ? 3 : A % 100 >= 11 ? 4 : 5;
  },
  6: function(A) {
    return A == 1 ? 0 : A >= 2 && A <= 4 ? 1 : 2;
  },
  7: function(A) {
    return A == 1 ? 0 : A % 10 >= 2 && A % 10 <= 4 && (A % 100 < 10 || A % 100 >= 20) ? 1 : 2;
  },
  8: function(A) {
    return A == 1 ? 0 : A == 2 ? 1 : A != 8 && A != 11 ? 2 : 3;
  },
  9: function(A) {
    return +(A >= 2);
  },
  10: function(A) {
    return A == 1 ? 0 : A == 2 ? 1 : A < 7 ? 2 : A < 11 ? 3 : 4;
  },
  11: function(A) {
    return A == 1 || A == 11 ? 0 : A == 2 || A == 12 ? 1 : A > 2 && A < 20 ? 2 : 3;
  },
  12: function(A) {
    return +(A % 10 != 1 || A % 100 == 11);
  },
  13: function(A) {
    return +(A !== 0);
  },
  14: function(A) {
    return A == 1 ? 0 : A == 2 ? 1 : A == 3 ? 2 : 3;
  },
  15: function(A) {
    return A % 10 == 1 && A % 100 != 11 ? 0 : A % 10 >= 2 && (A % 100 < 10 || A % 100 >= 20) ? 1 : 2;
  },
  16: function(A) {
    return A % 10 == 1 && A % 100 != 11 ? 0 : A !== 0 ? 1 : 2;
  },
  17: function(A) {
    return A == 1 || A % 10 == 1 && A % 100 != 11 ? 0 : 1;
  },
  18: function(A) {
    return A == 0 ? 0 : A == 1 ? 1 : 2;
  },
  19: function(A) {
    return A == 1 ? 0 : A == 0 || A % 100 > 1 && A % 100 < 11 ? 1 : A % 100 > 10 && A % 100 < 20 ? 2 : 3;
  },
  20: function(A) {
    return A == 1 ? 0 : A == 0 || A % 100 > 0 && A % 100 < 20 ? 1 : 2;
  },
  21: function(A) {
    return A % 100 == 1 ? 1 : A % 100 == 2 ? 2 : A % 100 == 3 || A % 100 == 4 ? 3 : 0;
  },
  22: function(A) {
    return A == 1 ? 0 : A == 2 ? 1 : (A < 0 || A > 10) && A % 10 == 0 ? 2 : 3;
  }
}, mCe = ["v1", "v2", "v3"], nlA = {
  zero: 0,
  one: 1,
  two: 2,
  few: 3,
  many: 4,
  other: 5
};
function pCe() {
  var A = {};
  return dCe.forEach(function(e) {
    e.lngs.forEach(function(t) {
      A[t] = {
        numbers: e.nr,
        plurals: hCe[e.fc]
      };
    });
  }), A;
}
var yCe = function() {
  function A(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    ml(this, A), this.languageUtils = e, this.options = t, this.logger = JB.create("pluralResolver"), (!this.options.compatibilityJSON || this.options.compatibilityJSON === "v4") && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = pCe();
  }
  return pl(A, [{
    key: "addRule",
    value: function(e, t) {
      this.rules[e] = t;
    }
  }, {
    key: "getRule",
    value: function(e) {
      var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      if (this.shouldUseIntlApi())
        try {
          return new Intl.PluralRules(e, {
            type: t.ordinal ? "ordinal" : "cardinal"
          });
        } catch {
          return;
        }
      return this.rules[e] || this.rules[this.languageUtils.getLanguagePartFromCode(e)];
    }
  }, {
    key: "needsPlural",
    value: function(e) {
      var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = this.getRule(e, t);
      return this.shouldUseIntlApi() ? i && i.resolvedOptions().pluralCategories.length > 1 : i && i.numbers.length > 1;
    }
  }, {
    key: "getPluralFormsOfKey",
    value: function(e, t) {
      var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      return this.getSuffixes(e, i).map(function(n) {
        return "".concat(t).concat(n);
      });
    }
  }, {
    key: "getSuffixes",
    value: function(e) {
      var t = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(e, i);
      return n ? this.shouldUseIntlApi() ? n.resolvedOptions().pluralCategories.sort(function(o, g) {
        return nlA[o] - nlA[g];
      }).map(function(o) {
        return "".concat(t.options.prepend).concat(o);
      }) : n.numbers.map(function(o) {
        return t.getSuffix(e, o, i);
      }) : [];
    }
  }, {
    key: "getSuffix",
    value: function(e, t) {
      var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = this.getRule(e, i);
      return n ? this.shouldUseIntlApi() ? "".concat(this.options.prepend).concat(n.select(t)) : this.getSuffixRetroCompatible(n, t) : (this.logger.warn("no plural rule found for: ".concat(e)), "");
    }
  }, {
    key: "getSuffixRetroCompatible",
    value: function(e, t) {
      var i = this, n = e.noAbs ? e.plurals(t) : e.plurals(Math.abs(t)), o = e.numbers[n];
      this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 && (o === 2 ? o = "plural" : o === 1 && (o = ""));
      var g = function() {
        return i.options.prepend && o.toString() ? i.options.prepend + o.toString() : o.toString();
      };
      return this.options.compatibilityJSON === "v1" ? o === 1 ? "" : typeof o == "number" ? "_plural_".concat(o.toString()) : g() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? g() : this.options.prepend && n.toString() ? this.options.prepend + n.toString() : n.toString();
    }
  }, {
    key: "shouldUseIntlApi",
    value: function() {
      return !mCe.includes(this.options.compatibilityJSON);
    }
  }]), A;
}();
function olA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function wr(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? olA(Object(t), !0).forEach(function(i) {
      xd(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : olA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
var bCe = function() {
  function A() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    ml(this, A), this.logger = JB.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || function(t) {
      return t;
    }, this.init(e);
  }
  return pl(A, [{
    key: "init",
    value: function() {
      var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      e.interpolation || (e.interpolation = {
        escapeValue: !0
      });
      var t = e.interpolation;
      this.escape = t.escape !== void 0 ? t.escape : aCe, this.escapeValue = t.escapeValue !== void 0 ? t.escapeValue : !0, this.useRawValueToEscape = t.useRawValueToEscape !== void 0 ? t.useRawValueToEscape : !1, this.prefix = t.prefix ? iy(t.prefix) : t.prefixEscaped || "{{", this.suffix = t.suffix ? iy(t.suffix) : t.suffixEscaped || "}}", this.formatSeparator = t.formatSeparator ? t.formatSeparator : t.formatSeparator || ",", this.unescapePrefix = t.unescapeSuffix ? "" : t.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t.unescapeSuffix || "", this.nestingPrefix = t.nestingPrefix ? iy(t.nestingPrefix) : t.nestingPrefixEscaped || iy("$t("), this.nestingSuffix = t.nestingSuffix ? iy(t.nestingSuffix) : t.nestingSuffixEscaped || iy(")"), this.nestingOptionsSeparator = t.nestingOptionsSeparator ? t.nestingOptionsSeparator : t.nestingOptionsSeparator || ",", this.maxReplaces = t.maxReplaces ? t.maxReplaces : 1e3, this.alwaysFormat = t.alwaysFormat !== void 0 ? t.alwaysFormat : !1, this.resetRegExp();
    }
  }, {
    key: "reset",
    value: function() {
      this.options && this.init(this.options);
    }
  }, {
    key: "resetRegExp",
    value: function() {
      var e = "".concat(this.prefix, "(.+?)").concat(this.suffix);
      this.regexp = new RegExp(e, "g");
      var t = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
      this.regexpUnescape = new RegExp(t, "g");
      var i = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
      this.nestingRegexp = new RegExp(i, "g");
    }
  }, {
    key: "interpolate",
    value: function(e, t, i, n) {
      var o = this, g, s, I, r = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
      function a(E) {
        return E.replace(/\$/g, "$$$$");
      }
      var C = function(E) {
        if (E.indexOf(o.formatSeparator) < 0) {
          var d = $BA(t, r, E);
          return o.alwaysFormat ? o.format(d, void 0, i, wr(wr(wr({}, n), t), {}, {
            interpolationkey: E
          })) : d;
        }
        var m = E.split(o.formatSeparator), y = m.shift().trim(), f = m.join(o.formatSeparator).trim();
        return o.format($BA(t, r, y), f, i, wr(wr(wr({}, n), t), {}, {
          interpolationkey: y
        }));
      };
      this.resetRegExp();
      var B = n && n.missingInterpolationHandler || this.options.missingInterpolationHandler, l = n && n.interpolation && n.interpolation.skipOnVariables !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables, Q = [{
        regex: this.regexpUnescape,
        safeValue: function(E) {
          return a(E);
        }
      }, {
        regex: this.regexp,
        safeValue: function(E) {
          return o.escapeValue ? a(o.escape(E)) : a(E);
        }
      }];
      return Q.forEach(function(E) {
        for (I = 0; g = E.regex.exec(e); ) {
          var d = g[1].trim();
          if (s = C(d), s === void 0)
            if (typeof B == "function") {
              var m = B(e, g, n);
              s = typeof m == "string" ? m : "";
            } else if (n && n.hasOwnProperty(d))
              s = "";
            else if (l) {
              s = g[0];
              continue;
            } else
              o.logger.warn("missed to pass in variable ".concat(d, " for interpolating ").concat(e)), s = "";
          else
            typeof s != "string" && !o.useRawValueToEscape && (s = jBA(s));
          var y = E.safeValue(s);
          if (e = e.replace(g[0], y), l ? (E.regex.lastIndex += s.length, E.regex.lastIndex -= g[0].length) : E.regex.lastIndex = 0, I++, I >= o.maxReplaces)
            break;
        }
      }), e;
    }
  }, {
    key: "nest",
    value: function(e, t) {
      var i = this, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o, g, s = wr({}, n);
      s.applyPostProcessor = !1, delete s.defaultValue;
      function I(B, l) {
        var Q = this.nestingOptionsSeparator;
        if (B.indexOf(Q) < 0)
          return B;
        var E = B.split(new RegExp("".concat(Q, "[ ]*{"))), d = "{".concat(E[1]);
        B = E[0], d = this.interpolate(d, s);
        var m = d.match(/'/g), y = d.match(/"/g);
        (m && m.length % 2 === 0 && !y || y.length % 2 !== 0) && (d = d.replace(/'/g, '"'));
        try {
          s = JSON.parse(d), l && (s = wr(wr({}, l), s));
        } catch (f) {
          return this.logger.warn("failed parsing options string in nesting for key ".concat(B), f), "".concat(B).concat(Q).concat(d);
        }
        return delete s.defaultValue, B;
      }
      for (; o = this.nestingRegexp.exec(e); ) {
        var r = [], a = !1;
        if (o[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(o[1])) {
          var C = o[1].split(this.formatSeparator).map(function(B) {
            return B.trim();
          });
          o[1] = C.shift(), r = C, a = !0;
        }
        if (g = t(I.call(this, o[1].trim(), s), s), g && o[0] === e && typeof g != "string")
          return g;
        typeof g != "string" && (g = jBA(g)), g || (this.logger.warn("missed to resolve ".concat(o[1], " for nesting ").concat(e)), g = ""), a && (g = r.reduce(function(B, l) {
          return i.format(B, l, n.lng, wr(wr({}, n), {}, {
            interpolationkey: o[1].trim()
          }));
        }, g.trim())), e = e.replace(o[0], g), this.regexp.lastIndex = 0;
      }
      return e;
    }
  }]), A;
}();
function glA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function BE(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? glA(Object(t), !0).forEach(function(i) {
      xd(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : glA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function wCe(A) {
  var e = A.toLowerCase().trim(), t = {};
  if (A.indexOf("(") > -1) {
    var i = A.split("(");
    e = i[0].toLowerCase().trim();
    var n = i[1].substring(0, i[1].length - 1);
    if (e === "currency" && n.indexOf(":") < 0)
      t.currency || (t.currency = n.trim());
    else if (e === "relativetime" && n.indexOf(":") < 0)
      t.range || (t.range = n.trim());
    else {
      var o = n.split(";");
      o.forEach(function(g) {
        if (g) {
          var s = g.split(":"), I = iCe(s), r = I[0], a = I.slice(1), C = a.join(":").trim().replace(/^'+|'+$/g, "");
          t[r.trim()] || (t[r.trim()] = C), C === "false" && (t[r.trim()] = !1), C === "true" && (t[r.trim()] = !0), isNaN(C) || (t[r.trim()] = parseInt(C, 10));
        }
      });
    }
  }
  return {
    formatName: e,
    formatOptions: t
  };
}
function ny(A) {
  var e = {};
  return function(t, i, n) {
    var o = i + JSON.stringify(n), g = e[o];
    return g || (g = A(i, n), e[o] = g), g(t);
  };
}
var fCe = function() {
  function A() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    ml(this, A), this.logger = JB.create("formatter"), this.options = e, this.formats = {
      number: ny(function(t, i) {
        var n = new Intl.NumberFormat(t, i);
        return function(o) {
          return n.format(o);
        };
      }),
      currency: ny(function(t, i) {
        var n = new Intl.NumberFormat(t, BE(BE({}, i), {}, {
          style: "currency"
        }));
        return function(o) {
          return n.format(o);
        };
      }),
      datetime: ny(function(t, i) {
        var n = new Intl.DateTimeFormat(t, BE({}, i));
        return function(o) {
          return n.format(o);
        };
      }),
      relativetime: ny(function(t, i) {
        var n = new Intl.RelativeTimeFormat(t, BE({}, i));
        return function(o) {
          return n.format(o, i.range || "day");
        };
      }),
      list: ny(function(t, i) {
        var n = new Intl.ListFormat(t, BE({}, i));
        return function(o) {
          return n.format(o);
        };
      })
    }, this.init(e);
  }
  return pl(A, [{
    key: "init",
    value: function(e) {
      var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
        interpolation: {}
      }, i = t.interpolation;
      this.formatSeparator = i.formatSeparator ? i.formatSeparator : i.formatSeparator || ",";
    }
  }, {
    key: "add",
    value: function(e, t) {
      this.formats[e.toLowerCase().trim()] = t;
    }
  }, {
    key: "addCached",
    value: function(e, t) {
      this.formats[e.toLowerCase().trim()] = ny(t);
    }
  }, {
    key: "format",
    value: function(e, t, i, n) {
      var o = this, g = t.split(this.formatSeparator), s = g.reduce(function(I, r) {
        var a = wCe(r), C = a.formatName, B = a.formatOptions;
        if (o.formats[C]) {
          var l = I;
          try {
            var Q = n && n.formatParams && n.formatParams[n.interpolationkey] || {}, E = Q.locale || Q.lng || n.locale || n.lng || i;
            l = o.formats[C](I, E, BE(BE(BE({}, B), n), Q));
          } catch (d) {
            o.logger.warn(d);
          }
          return l;
        } else
          o.logger.warn("there was no format function for ".concat(C));
        return I;
      }, e);
      return s;
    }
  }]), A;
}();
function slA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function IlA(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? slA(Object(t), !0).forEach(function(i) {
      xd(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : slA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function DCe(A) {
  var e = GCe();
  return function() {
    var t = tl(A), i;
    if (e) {
      var n = tl(this).constructor;
      i = Reflect.construct(t, arguments, n);
    } else
      i = t.apply(this, arguments);
    return MR(this, i);
  };
}
function GCe() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
    return !1;
  if (typeof Proxy == "function")
    return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function kCe(A, e) {
  A.pending[e] !== void 0 && (delete A.pending[e], A.pendingCount--);
}
var JCe = function(A) {
  g3(t, A);
  var e = DCe(t);
  function t(i, n, o) {
    var g, s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
    return ml(this, t), g = e.call(this), s3 && Ku.call(yu(g)), g.backend = i, g.store = n, g.services = o, g.languageUtils = o.languageUtils, g.options = s, g.logger = JB.create("backendConnector"), g.waitingReads = [], g.maxParallelReads = s.maxParallelReads || 10, g.readingCalls = 0, g.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, g.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, g.state = {}, g.queue = [], g.backend && g.backend.init && g.backend.init(o, s.backend, s), g;
  }
  return pl(t, [{
    key: "queueLoad",
    value: function(i, n, o, g) {
      var s = this, I = {}, r = {}, a = {}, C = {};
      return i.forEach(function(B) {
        var l = !0;
        n.forEach(function(Q) {
          var E = "".concat(B, "|").concat(Q);
          !o.reload && s.store.hasResourceBundle(B, Q) ? s.state[E] = 2 : s.state[E] < 0 || (s.state[E] === 1 ? r[E] === void 0 && (r[E] = !0) : (s.state[E] = 1, l = !1, r[E] === void 0 && (r[E] = !0), I[E] === void 0 && (I[E] = !0), C[Q] === void 0 && (C[Q] = !0)));
        }), l || (a[B] = !0);
      }), (Object.keys(I).length || Object.keys(r).length) && this.queue.push({
        pending: r,
        pendingCount: Object.keys(r).length,
        loaded: {},
        errors: [],
        callback: g
      }), {
        toLoad: Object.keys(I),
        pending: Object.keys(r),
        toLoadLanguages: Object.keys(a),
        toLoadNamespaces: Object.keys(C)
      };
    }
  }, {
    key: "loaded",
    value: function(i, n, o) {
      var g = i.split("|"), s = g[0], I = g[1];
      n && this.emit("failedLoading", s, I, n), o && this.store.addResourceBundle(s, I, o), this.state[i] = n ? -1 : 2;
      var r = {};
      this.queue.forEach(function(a) {
        sCe(a.loaded, [s], I), kCe(a, i), n && a.errors.push(n), a.pendingCount === 0 && !a.done && (Object.keys(a.loaded).forEach(function(C) {
          r[C] || (r[C] = {});
          var B = a.loaded[C];
          B.length && B.forEach(function(l) {
            r[C][l] === void 0 && (r[C][l] = !0);
          });
        }), a.done = !0, a.errors.length ? a.callback(a.errors) : a.callback());
      }), this.emit("loaded", r), this.queue = this.queue.filter(function(a) {
        return !a.done;
      });
    }
  }, {
    key: "read",
    value: function(i, n, o) {
      var g = this, s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, I = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, r = arguments.length > 5 ? arguments[5] : void 0;
      if (!i.length)
        return r(null, {});
      if (this.readingCalls >= this.maxParallelReads) {
        this.waitingReads.push({
          lng: i,
          ns: n,
          fcName: o,
          tried: s,
          wait: I,
          callback: r
        });
        return;
      }
      return this.readingCalls++, this.backend[o](i, n, function(a, C) {
        if (g.readingCalls--, g.waitingReads.length > 0) {
          var B = g.waitingReads.shift();
          g.read(B.lng, B.ns, B.fcName, B.tried, B.wait, B.callback);
        }
        if (a && C && s < g.maxRetries) {
          setTimeout(function() {
            g.read.call(g, i, n, o, s + 1, I * 2, r);
          }, I);
          return;
        }
        r(a, C);
      });
    }
  }, {
    key: "prepareLoading",
    value: function(i, n) {
      var o = this, g = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = arguments.length > 3 ? arguments[3] : void 0;
      if (!this.backend)
        return this.logger.warn("No backend was added via i18next.use. Will not load resources."), s && s();
      typeof i == "string" && (i = this.languageUtils.toResolveHierarchy(i)), typeof n == "string" && (n = [n]);
      var I = this.queueLoad(i, n, g, s);
      if (!I.toLoad.length)
        return I.pending.length || s(), null;
      I.toLoad.forEach(function(r) {
        o.loadOne(r);
      });
    }
  }, {
    key: "load",
    value: function(i, n, o) {
      this.prepareLoading(i, n, {}, o);
    }
  }, {
    key: "reload",
    value: function(i, n, o) {
      this.prepareLoading(i, n, {
        reload: !0
      }, o);
    }
  }, {
    key: "loadOne",
    value: function(i) {
      var n = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", g = i.split("|"), s = g[0], I = g[1];
      this.read(s, I, "read", void 0, void 0, function(r, a) {
        r && n.logger.warn("".concat(o, "loading namespace ").concat(I, " for language ").concat(s, " failed"), r), !r && a && n.logger.log("".concat(o, "loaded namespace ").concat(I, " for language ").concat(s), a), n.loaded(i, r, a);
      });
    }
  }, {
    key: "saveMissing",
    value: function(i, n, o, g, s) {
      var I = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
      if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(n)) {
        this.logger.warn('did not save key "'.concat(o, '" as the namespace "').concat(n, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
        return;
      }
      o == null || o === "" || (this.backend && this.backend.create && this.backend.create(i, n, o, g, null, IlA(IlA({}, I), {}, {
        isUpdate: s
      })), !(!i || !i[0]) && this.store.addResource(i[0], n, o, g));
    }
  }]), t;
}(Ku);
function NCe() {
  return {
    debug: !1,
    initImmediate: !0,
    ns: ["translation"],
    defaultNS: ["translation"],
    fallbackLng: ["dev"],
    fallbackNS: !1,
    supportedLngs: !1,
    nonExplicitSupportedLngs: !1,
    load: "all",
    preload: !1,
    simplifyPluralSuffix: !0,
    keySeparator: ".",
    nsSeparator: ":",
    pluralSeparator: "_",
    contextSeparator: "_",
    partialBundledLanguages: !1,
    saveMissing: !1,
    updateMissing: !1,
    saveMissingTo: "fallback",
    saveMissingPlurals: !0,
    missingKeyHandler: !1,
    missingInterpolationHandler: !1,
    postProcess: !1,
    postProcessPassResolved: !1,
    returnNull: !0,
    returnEmptyString: !0,
    returnObjects: !1,
    joinArrays: !1,
    returnedObjectHandler: !1,
    parseMissingKeyHandler: !1,
    appendNamespaceToMissingKey: !1,
    appendNamespaceToCIMode: !1,
    overloadTranslationOptionHandler: function(A) {
      var e = {};
      if (gC(A[1]) === "object" && (e = A[1]), typeof A[1] == "string" && (e.defaultValue = A[1]), typeof A[2] == "string" && (e.tDescription = A[2]), gC(A[2]) === "object" || gC(A[3]) === "object") {
        var t = A[3] || A[2];
        Object.keys(t).forEach(function(i) {
          e[i] = t[i];
        });
      }
      return e;
    },
    interpolation: {
      escapeValue: !0,
      format: function(A, e, t, i) {
        return A;
      },
      prefix: "{{",
      suffix: "}}",
      formatSeparator: ",",
      unescapePrefix: "-",
      nestingPrefix: "$t(",
      nestingSuffix: ")",
      nestingOptionsSeparator: ",",
      maxReplaces: 1e3,
      skipOnVariables: !0
    }
  };
}
function alA(A) {
  return typeof A.ns == "string" && (A.ns = [A.ns]), typeof A.fallbackLng == "string" && (A.fallbackLng = [A.fallbackLng]), typeof A.fallbackNS == "string" && (A.fallbackNS = [A.fallbackNS]), A.supportedLngs && A.supportedLngs.indexOf("cimode") < 0 && (A.supportedLngs = A.supportedLngs.concat(["cimode"])), A;
}
function rlA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function _C(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? rlA(Object(t), !0).forEach(function(i) {
      xd(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : rlA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function YCe(A) {
  var e = RCe();
  return function() {
    var t = tl(A), i;
    if (e) {
      var n = tl(this).constructor;
      i = Reflect.construct(t, arguments, n);
    } else
      i = t.apply(this, arguments);
    return MR(this, i);
  };
}
function RCe() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
    return !1;
  if (typeof Proxy == "function")
    return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function wM() {
}
function FCe(A) {
  var e = Object.getOwnPropertyNames(Object.getPrototypeOf(A));
  e.forEach(function(t) {
    typeof A[t] == "function" && (A[t] = A[t].bind(A));
  });
}
var MH = function(A) {
  g3(t, A);
  var e = YCe(t);
  function t() {
    var i, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 ? arguments[1] : void 0;
    if (ml(this, t), i = e.call(this), s3 && Ku.call(yu(i)), i.options = alA(n), i.services = {}, i.logger = JB, i.modules = {
      external: []
    }, FCe(yu(i)), o && !i.isInitialized && !n.isClone) {
      if (!i.options.initImmediate)
        return i.init(n, o), MR(i, yu(i));
      setTimeout(function() {
        i.init(n, o);
      }, 0);
    }
    return i;
  }
  return pl(t, [{
    key: "init",
    value: function() {
      var i = this, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 ? arguments[1] : void 0;
      typeof n == "function" && (o = n, n = {}), !n.defaultNS && n.defaultNS !== !1 && n.ns && (typeof n.ns == "string" ? n.defaultNS = n.ns : n.ns.indexOf("translation") < 0 && (n.defaultNS = n.ns[0]));
      var g = NCe();
      this.options = _C(_C(_C({}, g), this.options), alA(n)), this.options.compatibilityAPI !== "v1" && (this.options.interpolation = _C(_C({}, g.interpolation), this.options.interpolation)), n.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = n.keySeparator), n.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = n.nsSeparator);
      function s(d) {
        return d ? typeof d == "function" ? new d() : d : null;
      }
      if (!this.options.isClone) {
        this.modules.logger ? JB.init(s(this.modules.logger), this.options) : JB.init(null, this.options);
        var I;
        this.modules.formatter ? I = this.modules.formatter : typeof Intl < "u" && (I = fCe);
        var r = new uCe(this.options);
        this.store = new cCe(this.options.resources, this.options);
        var a = this.services;
        a.logger = JB, a.resourceStore = this.store, a.languageUtils = r, a.pluralResolver = new yCe(r, {
          prepend: this.options.pluralSeparator,
          compatibilityJSON: this.options.compatibilityJSON,
          simplifyPluralSuffix: this.options.simplifyPluralSuffix
        }), I && (!this.options.interpolation.format || this.options.interpolation.format === g.interpolation.format) && (a.formatter = s(I), a.formatter.init(a, this.options), this.options.interpolation.format = a.formatter.format.bind(a.formatter)), a.interpolator = new bCe(this.options), a.utils = {
          hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
        }, a.backendConnector = new JCe(s(this.modules.backend), a.resourceStore, a, this.options), a.backendConnector.on("*", function(d) {
          for (var m = arguments.length, y = new Array(m > 1 ? m - 1 : 0), f = 1; f < m; f++)
            y[f - 1] = arguments[f];
          i.emit.apply(i, [d].concat(y));
        }), this.modules.languageDetector && (a.languageDetector = s(this.modules.languageDetector), a.languageDetector.init(a, this.options.detection, this.options)), this.modules.i18nFormat && (a.i18nFormat = s(this.modules.i18nFormat), a.i18nFormat.init && a.i18nFormat.init(this)), this.translator = new ilA(this.services, this.options), this.translator.on("*", function(d) {
          for (var m = arguments.length, y = new Array(m > 1 ? m - 1 : 0), f = 1; f < m; f++)
            y[f - 1] = arguments[f];
          i.emit.apply(i, [d].concat(y));
        }), this.modules.external.forEach(function(d) {
          d.init && d.init(i);
        });
      }
      if (this.format = this.options.interpolation.format, o || (o = wM), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
        var C = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
        C.length > 0 && C[0] !== "dev" && (this.options.lng = C[0]);
      }
      !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined");
      var B = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"];
      B.forEach(function(d) {
        i[d] = function() {
          var m;
          return (m = i.store)[d].apply(m, arguments);
        };
      });
      var l = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"];
      l.forEach(function(d) {
        i[d] = function() {
          var m;
          return (m = i.store)[d].apply(m, arguments), i;
        };
      });
      var Q = rk(), E = function() {
        var d = function(m, y) {
          i.isInitialized && !i.initializedStoreOnce && i.logger.warn("init: i18next is already initialized. You should call init just once!"), i.isInitialized = !0, i.options.isClone || i.logger.log("initialized", i.options), i.emit("initialized", i.options), Q.resolve(y), o(m, y);
        };
        if (i.languages && i.options.compatibilityAPI !== "v1" && !i.isInitialized)
          return d(null, i.t.bind(i));
        i.changeLanguage(i.options.lng, d);
      };
      return this.options.resources || !this.options.initImmediate ? E() : setTimeout(E, 0), Q;
    }
  }, {
    key: "loadResources",
    value: function(i) {
      var n = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : wM, g = o, s = typeof i == "string" ? i : this.language;
      if (typeof i == "function" && (g = i), !this.options.resources || this.options.partialBundledLanguages) {
        if (s && s.toLowerCase() === "cimode")
          return g();
        var I = [], r = function(C) {
          if (C) {
            var B = n.services.languageUtils.toResolveHierarchy(C);
            B.forEach(function(l) {
              I.indexOf(l) < 0 && I.push(l);
            });
          }
        };
        if (s)
          r(s);
        else {
          var a = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
          a.forEach(function(C) {
            return r(C);
          });
        }
        this.options.preload && this.options.preload.forEach(function(C) {
          return r(C);
        }), this.services.backendConnector.load(I, this.options.ns, function(C) {
          !C && !n.resolvedLanguage && n.language && n.setResolvedLanguage(n.language), g(C);
        });
      } else
        g(null);
    }
  }, {
    key: "reloadResources",
    value: function(i, n, o) {
      var g = rk();
      return i || (i = this.languages), n || (n = this.options.ns), o || (o = wM), this.services.backendConnector.reload(i, n, function(s) {
        g.resolve(), o(s);
      }), g;
    }
  }, {
    key: "use",
    value: function(i) {
      if (!i)
        throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
      if (!i.type)
        throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
      return i.type === "backend" && (this.modules.backend = i), (i.type === "logger" || i.log && i.warn && i.error) && (this.modules.logger = i), i.type === "languageDetector" && (this.modules.languageDetector = i), i.type === "i18nFormat" && (this.modules.i18nFormat = i), i.type === "postProcessor" && WYA.addPostProcessor(i), i.type === "formatter" && (this.modules.formatter = i), i.type === "3rdParty" && this.modules.external.push(i), this;
    }
  }, {
    key: "setResolvedLanguage",
    value: function(i) {
      if (!(!i || !this.languages) && !(["cimode", "dev"].indexOf(i) > -1))
        for (var n = 0; n < this.languages.length; n++) {
          var o = this.languages[n];
          if (!(["cimode", "dev"].indexOf(o) > -1) && this.store.hasLanguageSomeTranslations(o)) {
            this.resolvedLanguage = o;
            break;
          }
        }
    }
  }, {
    key: "changeLanguage",
    value: function(i, n) {
      var o = this;
      this.isLanguageChangingTo = i;
      var g = rk();
      this.emit("languageChanging", i);
      var s = function(a) {
        o.language = a, o.languages = o.services.languageUtils.toResolveHierarchy(a), o.resolvedLanguage = void 0, o.setResolvedLanguage(a);
      }, I = function(a, C) {
        C ? (s(C), o.translator.changeLanguage(C), o.isLanguageChangingTo = void 0, o.emit("languageChanged", C), o.logger.log("languageChanged", C)) : o.isLanguageChangingTo = void 0, g.resolve(function() {
          return o.t.apply(o, arguments);
        }), n && n(a, function() {
          return o.t.apply(o, arguments);
        });
      }, r = function(a) {
        !i && !a && o.services.languageDetector && (a = []);
        var C = typeof a == "string" ? a : o.services.languageUtils.getBestMatchFromCodes(a);
        C && (o.language || s(C), o.translator.language || o.translator.changeLanguage(C), o.services.languageDetector && o.services.languageDetector.cacheUserLanguage(C)), o.loadResources(C, function(B) {
          I(B, C);
        });
      };
      return !i && this.services.languageDetector && !this.services.languageDetector.async ? r(this.services.languageDetector.detect()) : !i && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect(r) : r(i), g;
    }
  }, {
    key: "getFixedT",
    value: function(i, n, o) {
      var g = this, s = function I(r, a) {
        var C;
        if (gC(a) !== "object") {
          for (var B = arguments.length, l = new Array(B > 2 ? B - 2 : 0), Q = 2; Q < B; Q++)
            l[Q - 2] = arguments[Q];
          C = g.options.overloadTranslationOptionHandler([r, a].concat(l));
        } else
          C = _C({}, a);
        C.lng = C.lng || I.lng, C.lngs = C.lngs || I.lngs, C.ns = C.ns || I.ns, C.keyPrefix = C.keyPrefix || o || I.keyPrefix;
        var E = g.options.keySeparator || ".", d = C.keyPrefix ? "".concat(C.keyPrefix).concat(E).concat(r) : r;
        return g.t(d, C);
      };
      return typeof i == "string" ? s.lng = i : s.lngs = i, s.ns = n, s.keyPrefix = o, s;
    }
  }, {
    key: "t",
    value: function() {
      var i;
      return this.translator && (i = this.translator).translate.apply(i, arguments);
    }
  }, {
    key: "exists",
    value: function() {
      var i;
      return this.translator && (i = this.translator).exists.apply(i, arguments);
    }
  }, {
    key: "setDefaultNamespace",
    value: function(i) {
      this.options.defaultNS = i;
    }
  }, {
    key: "hasLoadedNamespace",
    value: function(i) {
      var n = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      if (!this.isInitialized)
        return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
      if (!this.languages || !this.languages.length)
        return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
      var g = this.resolvedLanguage || this.languages[0], s = this.options ? this.options.fallbackLng : !1, I = this.languages[this.languages.length - 1];
      if (g.toLowerCase() === "cimode")
        return !0;
      var r = function(C, B) {
        var l = n.services.backendConnector.state["".concat(C, "|").concat(B)];
        return l === -1 || l === 2;
      };
      if (o.precheck) {
        var a = o.precheck(this, r);
        if (a !== void 0)
          return a;
      }
      return !!(this.hasResourceBundle(g, i) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || r(g, i) && (!s || r(I, i)));
    }
  }, {
    key: "loadNamespaces",
    value: function(i, n) {
      var o = this, g = rk();
      return this.options.ns ? (typeof i == "string" && (i = [i]), i.forEach(function(s) {
        o.options.ns.indexOf(s) < 0 && o.options.ns.push(s);
      }), this.loadResources(function(s) {
        g.resolve(), n && n(s);
      }), g) : (n && n(), Promise.resolve());
    }
  }, {
    key: "loadLanguages",
    value: function(i, n) {
      var o = rk();
      typeof i == "string" && (i = [i]);
      var g = this.options.preload || [], s = i.filter(function(I) {
        return g.indexOf(I) < 0;
      });
      return s.length ? (this.options.preload = g.concat(s), this.loadResources(function(I) {
        o.resolve(), n && n(I);
      }), o) : (n && n(), Promise.resolve());
    }
  }, {
    key: "dir",
    value: function(i) {
      if (i || (i = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !i)
        return "rtl";
      var n = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"];
      return n.indexOf(this.services.languageUtils.getLanguagePartFromCode(i)) > -1 || i.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
    }
  }, {
    key: "cloneInstance",
    value: function() {
      var i = this, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : wM, g = _C(_C(_C({}, this.options), n), {
        isClone: !0
      }), s = new t(g);
      (n.debug !== void 0 || n.prefix !== void 0) && (s.logger = s.logger.clone(n));
      var I = ["store", "services", "language"];
      return I.forEach(function(r) {
        s[r] = i[r];
      }), s.services = _C({}, this.services), s.services.utils = {
        hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
      }, s.translator = new ilA(s.services, s.options), s.translator.on("*", function(r) {
        for (var a = arguments.length, C = new Array(a > 1 ? a - 1 : 0), B = 1; B < a; B++)
          C[B - 1] = arguments[B];
        s.emit.apply(s, [r].concat(C));
      }), s.init(g, o), s.translator.options = s.options, s.translator.backendConnector.services.utils = {
        hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
      }, s;
    }
  }, {
    key: "toJSON",
    value: function() {
      return {
        options: this.options,
        store: this.store,
        language: this.language,
        languages: this.languages,
        resolvedLanguage: this.resolvedLanguage
      };
    }
  }]), t;
}(Ku);
xd(MH, "createInstance", function() {
  var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = arguments.length > 1 ? arguments[1] : void 0;
  return new MH(A, e);
});
var Es = MH.createInstance();
Es.createInstance = MH.createInstance;
Es.createInstance;
Es.init;
Es.loadResources;
Es.reloadResources;
Es.use;
Es.changeLanguage;
Es.getFixedT;
Es.t;
Es.exists;
Es.setDefaultNamespace;
Es.hasLoadedNamespace;
Es.loadNamespaces;
Es.loadLanguages;
const of = Es, Hn = "gw_count_fid", MCe = ["year", "quarter", "month", "week", "day", "hour", "minute", "second", "iso_year", "iso_week"], xCe = [
  "year",
  "quarter",
  "month",
  "week",
  "weekday",
  "day",
  "hour",
  "minute",
  "second",
  "iso_year",
  "iso_week",
  "iso_weekday"
], Zi = "gw_mea_key_fid", Wi = "gw_mea_val_fid", ln = "gw_paint_fid";
function KYA(A) {
  var e, t, i = "";
  if (typeof A == "string" || typeof A == "number")
    i += A;
  else if (typeof A == "object")
    if (Array.isArray(A)) {
      var n = A.length;
      for (e = 0; e < n; e++)
        A[e] && (t = KYA(A[e])) && (i && (i += " "), i += t);
    } else
      for (t in A)
        A[t] && (i && (i += " "), i += t);
  return i;
}
function LCe() {
  for (var A, e, t = 0, i = "", n = arguments.length; t < n; t++)
    (A = arguments[t]) && (e = KYA(A)) && (i && (i += " "), i += e);
  return i;
}
const p7 = "-";
function vCe(A) {
  const e = SCe(A), {
    conflictingClassGroups: t,
    conflictingClassGroupModifiers: i
  } = A;
  function n(g) {
    const s = g.split(p7);
    return s[0] === "" && s.length !== 1 && s.shift(), UYA(s, e) || HCe(g);
  }
  function o(g, s) {
    const I = t[g] || [];
    return s && i[g] ? [...I, ...i[g]] : I;
  }
  return {
    getClassGroupId: n,
    getConflictingClassGroupIds: o
  };
}
function UYA(A, e) {
  var t;
  if (A.length === 0)
    return e.classGroupId;
  const i = A[0], n = e.nextPart.get(i), o = n ? UYA(A.slice(1), n) : void 0;
  if (o)
    return o;
  if (e.validators.length === 0)
    return;
  const g = A.join(p7);
  return (t = e.validators.find(({
    validator: s
  }) => s(g))) == null ? void 0 : t.classGroupId;
}
const ClA = /^\[(.+)\]$/;
function HCe(A) {
  if (ClA.test(A)) {
    const e = ClA.exec(A)[1], t = e == null ? void 0 : e.substring(0, e.indexOf(":"));
    if (t)
      return "arbitrary.." + t;
  }
}
function SCe(A) {
  const {
    theme: e,
    prefix: t
  } = A, i = {
    nextPart: /* @__PURE__ */ new Map(),
    validators: []
  };
  return WCe(Object.entries(A.classGroups), t).forEach(([n, o]) => {
    Sq(o, i, n, e);
  }), i;
}
function Sq(A, e, t, i) {
  A.forEach((n) => {
    if (typeof n == "string") {
      const o = n === "" ? e : BlA(e, n);
      o.classGroupId = t;
      return;
    }
    if (typeof n == "function") {
      if (ZCe(n)) {
        Sq(n(i), e, t, i);
        return;
      }
      e.validators.push({
        validator: n,
        classGroupId: t
      });
      return;
    }
    Object.entries(n).forEach(([o, g]) => {
      Sq(g, BlA(e, o), t, i);
    });
  });
}
function BlA(A, e) {
  let t = A;
  return e.split(p7).forEach((i) => {
    t.nextPart.has(i) || t.nextPart.set(i, {
      nextPart: /* @__PURE__ */ new Map(),
      validators: []
    }), t = t.nextPart.get(i);
  }), t;
}
function ZCe(A) {
  return A.isThemeGetter;
}
function WCe(A, e) {
  return e ? A.map(([t, i]) => {
    const n = i.map((o) => typeof o == "string" ? e + o : typeof o == "object" ? Object.fromEntries(Object.entries(o).map(([g, s]) => [e + g, s])) : o);
    return [t, n];
  }) : A;
}
function KCe(A) {
  if (A < 1)
    return {
      get: () => {
      },
      set: () => {
      }
    };
  let e = 0, t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
  function n(o, g) {
    t.set(o, g), e++, e > A && (e = 0, i = t, t = /* @__PURE__ */ new Map());
  }
  return {
    get(o) {
      let g = t.get(o);
      if (g !== void 0)
        return g;
      if ((g = i.get(o)) !== void 0)
        return n(o, g), g;
    },
    set(o, g) {
      t.has(o) ? t.set(o, g) : n(o, g);
    }
  };
}
const VYA = "!";
function UCe(A) {
  const e = A.separator, t = e.length === 1, i = e[0], n = e.length;
  return function(o) {
    const g = [];
    let s = 0, I = 0, r;
    for (let Q = 0; Q < o.length; Q++) {
      let E = o[Q];
      if (s === 0) {
        if (E === i && (t || o.slice(Q, Q + n) === e)) {
          g.push(o.slice(I, Q)), I = Q + n;
          continue;
        }
        if (E === "/") {
          r = Q;
          continue;
        }
      }
      E === "[" ? s++ : E === "]" && s--;
    }
    const a = g.length === 0 ? o : o.substring(I), C = a.startsWith(VYA), B = C ? a.substring(1) : a, l = r && r > I ? r - I : void 0;
    return {
      modifiers: g,
      hasImportantModifier: C,
      baseClassName: B,
      maybePostfixModifierPosition: l
    };
  };
}
function VCe(A) {
  if (A.length <= 1)
    return A;
  const e = [];
  let t = [];
  return A.forEach((i) => {
    i[0] === "[" ? (e.push(...t.sort(), i), t = []) : t.push(i);
  }), e.push(...t.sort()), e;
}
function XCe(A) {
  return {
    cache: KCe(A.cacheSize),
    splitModifiers: UCe(A),
    ...vCe(A)
  };
}
const zCe = /\s+/;
function TCe(A, e) {
  const {
    splitModifiers: t,
    getClassGroupId: i,
    getConflictingClassGroupIds: n
  } = e, o = /* @__PURE__ */ new Set();
  return A.trim().split(zCe).map((g) => {
    const {
      modifiers: s,
      hasImportantModifier: I,
      baseClassName: r,
      maybePostfixModifierPosition: a
    } = t(g);
    let C = i(a ? r.substring(0, a) : r), B = !!a;
    if (!C) {
      if (!a)
        return {
          isTailwindClass: !1,
          originalClassName: g
        };
      if (C = i(r), !C)
        return {
          isTailwindClass: !1,
          originalClassName: g
        };
      B = !1;
    }
    const l = VCe(s).join(":");
    return {
      isTailwindClass: !0,
      modifierId: I ? l + VYA : l,
      classGroupId: C,
      originalClassName: g,
      hasPostfixModifier: B
    };
  }).reverse().filter((g) => {
    if (!g.isTailwindClass)
      return !0;
    const {
      modifierId: s,
      classGroupId: I,
      hasPostfixModifier: r
    } = g, a = s + I;
    return o.has(a) ? !1 : (o.add(a), n(I, r).forEach((C) => o.add(s + C)), !0);
  }).reverse().map((g) => g.originalClassName).join(" ");
}
function _Ce() {
  let A = 0, e, t, i = "";
  for (; A < arguments.length; )
    (e = arguments[A++]) && (t = XYA(e)) && (i && (i += " "), i += t);
  return i;
}
function XYA(A) {
  if (typeof A == "string")
    return A;
  let e, t = "";
  for (let i = 0; i < A.length; i++)
    A[i] && (e = XYA(A[i])) && (t && (t += " "), t += e);
  return t;
}
function qCe(A, ...e) {
  let t, i, n, o = g;
  function g(I) {
    const r = e.reduce((a, C) => C(a), A());
    return t = XCe(r), i = t.cache.get, n = t.cache.set, o = s, s(I);
  }
  function s(I) {
    const r = i(I);
    if (r)
      return r;
    const a = TCe(I, t);
    return n(I, a), a;
  }
  return function() {
    return o(_Ce.apply(null, arguments));
  };
}
function Pi(A) {
  const e = (t) => t[A] || [];
  return e.isThemeGetter = !0, e;
}
const zYA = /^\[(?:([a-z-]+):)?(.+)\]$/i, OCe = /^\d+\/\d+$/, jCe = /* @__PURE__ */ new Set(["px", "full", "screen"]), PCe = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, $Ce = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, ABe = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, eBe = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, tBe = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
function tc(A) {
  return am(A) || jCe.has(A) || OCe.test(A);
}
function lE(A) {
  return DD(A, "length", rBe);
}
function am(A) {
  return !!A && !Number.isNaN(Number(A));
}
function fM(A) {
  return DD(A, "number", am);
}
function Ck(A) {
  return !!A && Number.isInteger(Number(A));
}
function iBe(A) {
  return A.endsWith("%") && am(A.slice(0, -1));
}
function wt(A) {
  return zYA.test(A);
}
function cE(A) {
  return PCe.test(A);
}
const nBe = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
function oBe(A) {
  return DD(A, nBe, TYA);
}
function gBe(A) {
  return DD(A, "position", TYA);
}
const sBe = /* @__PURE__ */ new Set(["image", "url"]);
function IBe(A) {
  return DD(A, sBe, BBe);
}
function aBe(A) {
  return DD(A, "", CBe);
}
function Bk() {
  return !0;
}
function DD(A, e, t) {
  const i = zYA.exec(A);
  return i ? i[1] ? typeof e == "string" ? i[1] === e : e.has(i[1]) : t(i[2]) : !1;
}
function rBe(A) {
  return $Ce.test(A) && !ABe.test(A);
}
function TYA() {
  return !1;
}
function CBe(A) {
  return eBe.test(A);
}
function BBe(A) {
  return tBe.test(A);
}
function lBe() {
  const A = Pi("colors"), e = Pi("spacing"), t = Pi("blur"), i = Pi("brightness"), n = Pi("borderColor"), o = Pi("borderRadius"), g = Pi("borderSpacing"), s = Pi("borderWidth"), I = Pi("contrast"), r = Pi("grayscale"), a = Pi("hueRotate"), C = Pi("invert"), B = Pi("gap"), l = Pi("gradientColorStops"), Q = Pi("gradientColorStopPositions"), E = Pi("inset"), d = Pi("margin"), m = Pi("opacity"), y = Pi("padding"), f = Pi("saturate"), w = Pi("scale"), G = Pi("sepia"), R = Pi("skew"), F = Pi("space"), Z = Pi("translate"), c = () => ["auto", "contain", "none"], J = () => ["auto", "hidden", "clip", "visible", "scroll"], p = () => ["auto", wt, e], N = () => [wt, e], v = () => ["", tc, lE], K = () => ["auto", am, wt], U = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], j = () => ["solid", "dashed", "dotted", "double", "none"], q = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity", "plus-lighter"], O = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], $ = () => ["", "0", wt], _ = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], tA = () => [am, fM], nA = () => [am, wt];
  return {
    cacheSize: 500,
    separator: ":",
    theme: {
      colors: [Bk],
      spacing: [tc, lE],
      blur: ["none", "", cE, wt],
      brightness: tA(),
      borderColor: [A],
      borderRadius: ["none", "", "full", cE, wt],
      borderSpacing: N(),
      borderWidth: v(),
      contrast: tA(),
      grayscale: $(),
      hueRotate: nA(),
      invert: $(),
      gap: N(),
      gradientColorStops: [A],
      gradientColorStopPositions: [iBe, lE],
      inset: p(),
      margin: p(),
      opacity: tA(),
      padding: N(),
      saturate: tA(),
      scale: tA(),
      sepia: $(),
      skew: nA(),
      space: N(),
      translate: N()
    },
    classGroups: {
      // Layout
      /**
       * Aspect Ratio
       * @see https://tailwindcss.com/docs/aspect-ratio
       */
      aspect: [{
        aspect: ["auto", "square", "video", wt]
      }],
      /**
       * Container
       * @see https://tailwindcss.com/docs/container
       */
      container: ["container"],
      /**
       * Columns
       * @see https://tailwindcss.com/docs/columns
       */
      columns: [{
        columns: [cE]
      }],
      /**
       * Break After
       * @see https://tailwindcss.com/docs/break-after
       */
      "break-after": [{
        "break-after": _()
      }],
      /**
       * Break Before
       * @see https://tailwindcss.com/docs/break-before
       */
      "break-before": [{
        "break-before": _()
      }],
      /**
       * Break Inside
       * @see https://tailwindcss.com/docs/break-inside
       */
      "break-inside": [{
        "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
      }],
      /**
       * Box Decoration Break
       * @see https://tailwindcss.com/docs/box-decoration-break
       */
      "box-decoration": [{
        "box-decoration": ["slice", "clone"]
      }],
      /**
       * Box Sizing
       * @see https://tailwindcss.com/docs/box-sizing
       */
      box: [{
        box: ["border", "content"]
      }],
      /**
       * Display
       * @see https://tailwindcss.com/docs/display
       */
      display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
      /**
       * Floats
       * @see https://tailwindcss.com/docs/float
       */
      float: [{
        float: ["right", "left", "none", "start", "end"]
      }],
      /**
       * Clear
       * @see https://tailwindcss.com/docs/clear
       */
      clear: [{
        clear: ["left", "right", "both", "none", "start", "end"]
      }],
      /**
       * Isolation
       * @see https://tailwindcss.com/docs/isolation
       */
      isolation: ["isolate", "isolation-auto"],
      /**
       * Object Fit
       * @see https://tailwindcss.com/docs/object-fit
       */
      "object-fit": [{
        object: ["contain", "cover", "fill", "none", "scale-down"]
      }],
      /**
       * Object Position
       * @see https://tailwindcss.com/docs/object-position
       */
      "object-position": [{
        object: [...U(), wt]
      }],
      /**
       * Overflow
       * @see https://tailwindcss.com/docs/overflow
       */
      overflow: [{
        overflow: J()
      }],
      /**
       * Overflow X
       * @see https://tailwindcss.com/docs/overflow
       */
      "overflow-x": [{
        "overflow-x": J()
      }],
      /**
       * Overflow Y
       * @see https://tailwindcss.com/docs/overflow
       */
      "overflow-y": [{
        "overflow-y": J()
      }],
      /**
       * Overscroll Behavior
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      overscroll: [{
        overscroll: c()
      }],
      /**
       * Overscroll Behavior X
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      "overscroll-x": [{
        "overscroll-x": c()
      }],
      /**
       * Overscroll Behavior Y
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      "overscroll-y": [{
        "overscroll-y": c()
      }],
      /**
       * Position
       * @see https://tailwindcss.com/docs/position
       */
      position: ["static", "fixed", "absolute", "relative", "sticky"],
      /**
       * Top / Right / Bottom / Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      inset: [{
        inset: [E]
      }],
      /**
       * Right / Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      "inset-x": [{
        "inset-x": [E]
      }],
      /**
       * Top / Bottom
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      "inset-y": [{
        "inset-y": [E]
      }],
      /**
       * Start
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      start: [{
        start: [E]
      }],
      /**
       * End
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      end: [{
        end: [E]
      }],
      /**
       * Top
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      top: [{
        top: [E]
      }],
      /**
       * Right
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      right: [{
        right: [E]
      }],
      /**
       * Bottom
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      bottom: [{
        bottom: [E]
      }],
      /**
       * Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      left: [{
        left: [E]
      }],
      /**
       * Visibility
       * @see https://tailwindcss.com/docs/visibility
       */
      visibility: ["visible", "invisible", "collapse"],
      /**
       * Z-Index
       * @see https://tailwindcss.com/docs/z-index
       */
      z: [{
        z: ["auto", Ck, wt]
      }],
      // Flexbox and Grid
      /**
       * Flex Basis
       * @see https://tailwindcss.com/docs/flex-basis
       */
      basis: [{
        basis: p()
      }],
      /**
       * Flex Direction
       * @see https://tailwindcss.com/docs/flex-direction
       */
      "flex-direction": [{
        flex: ["row", "row-reverse", "col", "col-reverse"]
      }],
      /**
       * Flex Wrap
       * @see https://tailwindcss.com/docs/flex-wrap
       */
      "flex-wrap": [{
        flex: ["wrap", "wrap-reverse", "nowrap"]
      }],
      /**
       * Flex
       * @see https://tailwindcss.com/docs/flex
       */
      flex: [{
        flex: ["1", "auto", "initial", "none", wt]
      }],
      /**
       * Flex Grow
       * @see https://tailwindcss.com/docs/flex-grow
       */
      grow: [{
        grow: $()
      }],
      /**
       * Flex Shrink
       * @see https://tailwindcss.com/docs/flex-shrink
       */
      shrink: [{
        shrink: $()
      }],
      /**
       * Order
       * @see https://tailwindcss.com/docs/order
       */
      order: [{
        order: ["first", "last", "none", Ck, wt]
      }],
      /**
       * Grid Template Columns
       * @see https://tailwindcss.com/docs/grid-template-columns
       */
      "grid-cols": [{
        "grid-cols": [Bk]
      }],
      /**
       * Grid Column Start / End
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-start-end": [{
        col: ["auto", {
          span: ["full", Ck, wt]
        }, wt]
      }],
      /**
       * Grid Column Start
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-start": [{
        "col-start": K()
      }],
      /**
       * Grid Column End
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-end": [{
        "col-end": K()
      }],
      /**
       * Grid Template Rows
       * @see https://tailwindcss.com/docs/grid-template-rows
       */
      "grid-rows": [{
        "grid-rows": [Bk]
      }],
      /**
       * Grid Row Start / End
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-start-end": [{
        row: ["auto", {
          span: [Ck, wt]
        }, wt]
      }],
      /**
       * Grid Row Start
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-start": [{
        "row-start": K()
      }],
      /**
       * Grid Row End
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-end": [{
        "row-end": K()
      }],
      /**
       * Grid Auto Flow
       * @see https://tailwindcss.com/docs/grid-auto-flow
       */
      "grid-flow": [{
        "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
      }],
      /**
       * Grid Auto Columns
       * @see https://tailwindcss.com/docs/grid-auto-columns
       */
      "auto-cols": [{
        "auto-cols": ["auto", "min", "max", "fr", wt]
      }],
      /**
       * Grid Auto Rows
       * @see https://tailwindcss.com/docs/grid-auto-rows
       */
      "auto-rows": [{
        "auto-rows": ["auto", "min", "max", "fr", wt]
      }],
      /**
       * Gap
       * @see https://tailwindcss.com/docs/gap
       */
      gap: [{
        gap: [B]
      }],
      /**
       * Gap X
       * @see https://tailwindcss.com/docs/gap
       */
      "gap-x": [{
        "gap-x": [B]
      }],
      /**
       * Gap Y
       * @see https://tailwindcss.com/docs/gap
       */
      "gap-y": [{
        "gap-y": [B]
      }],
      /**
       * Justify Content
       * @see https://tailwindcss.com/docs/justify-content
       */
      "justify-content": [{
        justify: ["normal", ...O()]
      }],
      /**
       * Justify Items
       * @see https://tailwindcss.com/docs/justify-items
       */
      "justify-items": [{
        "justify-items": ["start", "end", "center", "stretch"]
      }],
      /**
       * Justify Self
       * @see https://tailwindcss.com/docs/justify-self
       */
      "justify-self": [{
        "justify-self": ["auto", "start", "end", "center", "stretch"]
      }],
      /**
       * Align Content
       * @see https://tailwindcss.com/docs/align-content
       */
      "align-content": [{
        content: ["normal", ...O(), "baseline"]
      }],
      /**
       * Align Items
       * @see https://tailwindcss.com/docs/align-items
       */
      "align-items": [{
        items: ["start", "end", "center", "baseline", "stretch"]
      }],
      /**
       * Align Self
       * @see https://tailwindcss.com/docs/align-self
       */
      "align-self": [{
        self: ["auto", "start", "end", "center", "stretch", "baseline"]
      }],
      /**
       * Place Content
       * @see https://tailwindcss.com/docs/place-content
       */
      "place-content": [{
        "place-content": [...O(), "baseline"]
      }],
      /**
       * Place Items
       * @see https://tailwindcss.com/docs/place-items
       */
      "place-items": [{
        "place-items": ["start", "end", "center", "baseline", "stretch"]
      }],
      /**
       * Place Self
       * @see https://tailwindcss.com/docs/place-self
       */
      "place-self": [{
        "place-self": ["auto", "start", "end", "center", "stretch"]
      }],
      // Spacing
      /**
       * Padding
       * @see https://tailwindcss.com/docs/padding
       */
      p: [{
        p: [y]
      }],
      /**
       * Padding X
       * @see https://tailwindcss.com/docs/padding
       */
      px: [{
        px: [y]
      }],
      /**
       * Padding Y
       * @see https://tailwindcss.com/docs/padding
       */
      py: [{
        py: [y]
      }],
      /**
       * Padding Start
       * @see https://tailwindcss.com/docs/padding
       */
      ps: [{
        ps: [y]
      }],
      /**
       * Padding End
       * @see https://tailwindcss.com/docs/padding
       */
      pe: [{
        pe: [y]
      }],
      /**
       * Padding Top
       * @see https://tailwindcss.com/docs/padding
       */
      pt: [{
        pt: [y]
      }],
      /**
       * Padding Right
       * @see https://tailwindcss.com/docs/padding
       */
      pr: [{
        pr: [y]
      }],
      /**
       * Padding Bottom
       * @see https://tailwindcss.com/docs/padding
       */
      pb: [{
        pb: [y]
      }],
      /**
       * Padding Left
       * @see https://tailwindcss.com/docs/padding
       */
      pl: [{
        pl: [y]
      }],
      /**
       * Margin
       * @see https://tailwindcss.com/docs/margin
       */
      m: [{
        m: [d]
      }],
      /**
       * Margin X
       * @see https://tailwindcss.com/docs/margin
       */
      mx: [{
        mx: [d]
      }],
      /**
       * Margin Y
       * @see https://tailwindcss.com/docs/margin
       */
      my: [{
        my: [d]
      }],
      /**
       * Margin Start
       * @see https://tailwindcss.com/docs/margin
       */
      ms: [{
        ms: [d]
      }],
      /**
       * Margin End
       * @see https://tailwindcss.com/docs/margin
       */
      me: [{
        me: [d]
      }],
      /**
       * Margin Top
       * @see https://tailwindcss.com/docs/margin
       */
      mt: [{
        mt: [d]
      }],
      /**
       * Margin Right
       * @see https://tailwindcss.com/docs/margin
       */
      mr: [{
        mr: [d]
      }],
      /**
       * Margin Bottom
       * @see https://tailwindcss.com/docs/margin
       */
      mb: [{
        mb: [d]
      }],
      /**
       * Margin Left
       * @see https://tailwindcss.com/docs/margin
       */
      ml: [{
        ml: [d]
      }],
      /**
       * Space Between X
       * @see https://tailwindcss.com/docs/space
       */
      "space-x": [{
        "space-x": [F]
      }],
      /**
       * Space Between X Reverse
       * @see https://tailwindcss.com/docs/space
       */
      "space-x-reverse": ["space-x-reverse"],
      /**
       * Space Between Y
       * @see https://tailwindcss.com/docs/space
       */
      "space-y": [{
        "space-y": [F]
      }],
      /**
       * Space Between Y Reverse
       * @see https://tailwindcss.com/docs/space
       */
      "space-y-reverse": ["space-y-reverse"],
      // Sizing
      /**
       * Width
       * @see https://tailwindcss.com/docs/width
       */
      w: [{
        w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", wt, e]
      }],
      /**
       * Min-Width
       * @see https://tailwindcss.com/docs/min-width
       */
      "min-w": [{
        "min-w": [wt, e, "min", "max", "fit"]
      }],
      /**
       * Max-Width
       * @see https://tailwindcss.com/docs/max-width
       */
      "max-w": [{
        "max-w": [wt, e, "none", "full", "min", "max", "fit", "prose", {
          screen: [cE]
        }, cE]
      }],
      /**
       * Height
       * @see https://tailwindcss.com/docs/height
       */
      h: [{
        h: [wt, e, "auto", "min", "max", "fit", "svh", "lvh", "dvh"]
      }],
      /**
       * Min-Height
       * @see https://tailwindcss.com/docs/min-height
       */
      "min-h": [{
        "min-h": [wt, e, "min", "max", "fit", "svh", "lvh", "dvh"]
      }],
      /**
       * Max-Height
       * @see https://tailwindcss.com/docs/max-height
       */
      "max-h": [{
        "max-h": [wt, e, "min", "max", "fit", "svh", "lvh", "dvh"]
      }],
      /**
       * Size
       * @see https://tailwindcss.com/docs/size
       */
      size: [{
        size: [wt, e, "auto", "min", "max", "fit"]
      }],
      // Typography
      /**
       * Font Size
       * @see https://tailwindcss.com/docs/font-size
       */
      "font-size": [{
        text: ["base", cE, lE]
      }],
      /**
       * Font Smoothing
       * @see https://tailwindcss.com/docs/font-smoothing
       */
      "font-smoothing": ["antialiased", "subpixel-antialiased"],
      /**
       * Font Style
       * @see https://tailwindcss.com/docs/font-style
       */
      "font-style": ["italic", "not-italic"],
      /**
       * Font Weight
       * @see https://tailwindcss.com/docs/font-weight
       */
      "font-weight": [{
        font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", fM]
      }],
      /**
       * Font Family
       * @see https://tailwindcss.com/docs/font-family
       */
      "font-family": [{
        font: [Bk]
      }],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-normal": ["normal-nums"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-ordinal": ["ordinal"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-slashed-zero": ["slashed-zero"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-figure": ["lining-nums", "oldstyle-nums"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-spacing": ["proportional-nums", "tabular-nums"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-fraction": ["diagonal-fractions", "stacked-fractons"],
      /**
       * Letter Spacing
       * @see https://tailwindcss.com/docs/letter-spacing
       */
      tracking: [{
        tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", wt]
      }],
      /**
       * Line Clamp
       * @see https://tailwindcss.com/docs/line-clamp
       */
      "line-clamp": [{
        "line-clamp": ["none", am, fM]
      }],
      /**
       * Line Height
       * @see https://tailwindcss.com/docs/line-height
       */
      leading: [{
        leading: ["none", "tight", "snug", "normal", "relaxed", "loose", tc, wt]
      }],
      /**
       * List Style Image
       * @see https://tailwindcss.com/docs/list-style-image
       */
      "list-image": [{
        "list-image": ["none", wt]
      }],
      /**
       * List Style Type
       * @see https://tailwindcss.com/docs/list-style-type
       */
      "list-style-type": [{
        list: ["none", "disc", "decimal", wt]
      }],
      /**
       * List Style Position
       * @see https://tailwindcss.com/docs/list-style-position
       */
      "list-style-position": [{
        list: ["inside", "outside"]
      }],
      /**
       * Placeholder Color
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/placeholder-color
       */
      "placeholder-color": [{
        placeholder: [A]
      }],
      /**
       * Placeholder Opacity
       * @see https://tailwindcss.com/docs/placeholder-opacity
       */
      "placeholder-opacity": [{
        "placeholder-opacity": [m]
      }],
      /**
       * Text Alignment
       * @see https://tailwindcss.com/docs/text-align
       */
      "text-alignment": [{
        text: ["left", "center", "right", "justify", "start", "end"]
      }],
      /**
       * Text Color
       * @see https://tailwindcss.com/docs/text-color
       */
      "text-color": [{
        text: [A]
      }],
      /**
       * Text Opacity
       * @see https://tailwindcss.com/docs/text-opacity
       */
      "text-opacity": [{
        "text-opacity": [m]
      }],
      /**
       * Text Decoration
       * @see https://tailwindcss.com/docs/text-decoration
       */
      "text-decoration": ["underline", "overline", "line-through", "no-underline"],
      /**
       * Text Decoration Style
       * @see https://tailwindcss.com/docs/text-decoration-style
       */
      "text-decoration-style": [{
        decoration: [...j(), "wavy"]
      }],
      /**
       * Text Decoration Thickness
       * @see https://tailwindcss.com/docs/text-decoration-thickness
       */
      "text-decoration-thickness": [{
        decoration: ["auto", "from-font", tc, lE]
      }],
      /**
       * Text Underline Offset
       * @see https://tailwindcss.com/docs/text-underline-offset
       */
      "underline-offset": [{
        "underline-offset": ["auto", tc, wt]
      }],
      /**
       * Text Decoration Color
       * @see https://tailwindcss.com/docs/text-decoration-color
       */
      "text-decoration-color": [{
        decoration: [A]
      }],
      /**
       * Text Transform
       * @see https://tailwindcss.com/docs/text-transform
       */
      "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
      /**
       * Text Overflow
       * @see https://tailwindcss.com/docs/text-overflow
       */
      "text-overflow": ["truncate", "text-ellipsis", "text-clip"],
      /**
       * Text Wrap
       * @see https://tailwindcss.com/docs/text-wrap
       */
      "text-wrap": [{
        text: ["wrap", "nowrap", "balance", "pretty"]
      }],
      /**
       * Text Indent
       * @see https://tailwindcss.com/docs/text-indent
       */
      indent: [{
        indent: N()
      }],
      /**
       * Vertical Alignment
       * @see https://tailwindcss.com/docs/vertical-align
       */
      "vertical-align": [{
        align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", wt]
      }],
      /**
       * Whitespace
       * @see https://tailwindcss.com/docs/whitespace
       */
      whitespace: [{
        whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
      }],
      /**
       * Word Break
       * @see https://tailwindcss.com/docs/word-break
       */
      break: [{
        break: ["normal", "words", "all", "keep"]
      }],
      /**
       * Hyphens
       * @see https://tailwindcss.com/docs/hyphens
       */
      hyphens: [{
        hyphens: ["none", "manual", "auto"]
      }],
      /**
       * Content
       * @see https://tailwindcss.com/docs/content
       */
      content: [{
        content: ["none", wt]
      }],
      // Backgrounds
      /**
       * Background Attachment
       * @see https://tailwindcss.com/docs/background-attachment
       */
      "bg-attachment": [{
        bg: ["fixed", "local", "scroll"]
      }],
      /**
       * Background Clip
       * @see https://tailwindcss.com/docs/background-clip
       */
      "bg-clip": [{
        "bg-clip": ["border", "padding", "content", "text"]
      }],
      /**
       * Background Opacity
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/background-opacity
       */
      "bg-opacity": [{
        "bg-opacity": [m]
      }],
      /**
       * Background Origin
       * @see https://tailwindcss.com/docs/background-origin
       */
      "bg-origin": [{
        "bg-origin": ["border", "padding", "content"]
      }],
      /**
       * Background Position
       * @see https://tailwindcss.com/docs/background-position
       */
      "bg-position": [{
        bg: [...U(), gBe]
      }],
      /**
       * Background Repeat
       * @see https://tailwindcss.com/docs/background-repeat
       */
      "bg-repeat": [{
        bg: ["no-repeat", {
          repeat: ["", "x", "y", "round", "space"]
        }]
      }],
      /**
       * Background Size
       * @see https://tailwindcss.com/docs/background-size
       */
      "bg-size": [{
        bg: ["auto", "cover", "contain", oBe]
      }],
      /**
       * Background Image
       * @see https://tailwindcss.com/docs/background-image
       */
      "bg-image": [{
        bg: ["none", {
          "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
        }, IBe]
      }],
      /**
       * Background Color
       * @see https://tailwindcss.com/docs/background-color
       */
      "bg-color": [{
        bg: [A]
      }],
      /**
       * Gradient Color Stops From Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-from-pos": [{
        from: [Q]
      }],
      /**
       * Gradient Color Stops Via Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-via-pos": [{
        via: [Q]
      }],
      /**
       * Gradient Color Stops To Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-to-pos": [{
        to: [Q]
      }],
      /**
       * Gradient Color Stops From
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-from": [{
        from: [l]
      }],
      /**
       * Gradient Color Stops Via
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-via": [{
        via: [l]
      }],
      /**
       * Gradient Color Stops To
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-to": [{
        to: [l]
      }],
      // Borders
      /**
       * Border Radius
       * @see https://tailwindcss.com/docs/border-radius
       */
      rounded: [{
        rounded: [o]
      }],
      /**
       * Border Radius Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-s": [{
        "rounded-s": [o]
      }],
      /**
       * Border Radius End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-e": [{
        "rounded-e": [o]
      }],
      /**
       * Border Radius Top
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-t": [{
        "rounded-t": [o]
      }],
      /**
       * Border Radius Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-r": [{
        "rounded-r": [o]
      }],
      /**
       * Border Radius Bottom
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-b": [{
        "rounded-b": [o]
      }],
      /**
       * Border Radius Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-l": [{
        "rounded-l": [o]
      }],
      /**
       * Border Radius Start Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-ss": [{
        "rounded-ss": [o]
      }],
      /**
       * Border Radius Start End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-se": [{
        "rounded-se": [o]
      }],
      /**
       * Border Radius End End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-ee": [{
        "rounded-ee": [o]
      }],
      /**
       * Border Radius End Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-es": [{
        "rounded-es": [o]
      }],
      /**
       * Border Radius Top Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-tl": [{
        "rounded-tl": [o]
      }],
      /**
       * Border Radius Top Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-tr": [{
        "rounded-tr": [o]
      }],
      /**
       * Border Radius Bottom Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-br": [{
        "rounded-br": [o]
      }],
      /**
       * Border Radius Bottom Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-bl": [{
        "rounded-bl": [o]
      }],
      /**
       * Border Width
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w": [{
        border: [s]
      }],
      /**
       * Border Width X
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-x": [{
        "border-x": [s]
      }],
      /**
       * Border Width Y
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-y": [{
        "border-y": [s]
      }],
      /**
       * Border Width Start
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-s": [{
        "border-s": [s]
      }],
      /**
       * Border Width End
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-e": [{
        "border-e": [s]
      }],
      /**
       * Border Width Top
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-t": [{
        "border-t": [s]
      }],
      /**
       * Border Width Right
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-r": [{
        "border-r": [s]
      }],
      /**
       * Border Width Bottom
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-b": [{
        "border-b": [s]
      }],
      /**
       * Border Width Left
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-l": [{
        "border-l": [s]
      }],
      /**
       * Border Opacity
       * @see https://tailwindcss.com/docs/border-opacity
       */
      "border-opacity": [{
        "border-opacity": [m]
      }],
      /**
       * Border Style
       * @see https://tailwindcss.com/docs/border-style
       */
      "border-style": [{
        border: [...j(), "hidden"]
      }],
      /**
       * Divide Width X
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-x": [{
        "divide-x": [s]
      }],
      /**
       * Divide Width X Reverse
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-x-reverse": ["divide-x-reverse"],
      /**
       * Divide Width Y
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-y": [{
        "divide-y": [s]
      }],
      /**
       * Divide Width Y Reverse
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-y-reverse": ["divide-y-reverse"],
      /**
       * Divide Opacity
       * @see https://tailwindcss.com/docs/divide-opacity
       */
      "divide-opacity": [{
        "divide-opacity": [m]
      }],
      /**
       * Divide Style
       * @see https://tailwindcss.com/docs/divide-style
       */
      "divide-style": [{
        divide: j()
      }],
      /**
       * Border Color
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color": [{
        border: [n]
      }],
      /**
       * Border Color X
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-x": [{
        "border-x": [n]
      }],
      /**
       * Border Color Y
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-y": [{
        "border-y": [n]
      }],
      /**
       * Border Color Top
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-t": [{
        "border-t": [n]
      }],
      /**
       * Border Color Right
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-r": [{
        "border-r": [n]
      }],
      /**
       * Border Color Bottom
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-b": [{
        "border-b": [n]
      }],
      /**
       * Border Color Left
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-l": [{
        "border-l": [n]
      }],
      /**
       * Divide Color
       * @see https://tailwindcss.com/docs/divide-color
       */
      "divide-color": [{
        divide: [n]
      }],
      /**
       * Outline Style
       * @see https://tailwindcss.com/docs/outline-style
       */
      "outline-style": [{
        outline: ["", ...j()]
      }],
      /**
       * Outline Offset
       * @see https://tailwindcss.com/docs/outline-offset
       */
      "outline-offset": [{
        "outline-offset": [tc, wt]
      }],
      /**
       * Outline Width
       * @see https://tailwindcss.com/docs/outline-width
       */
      "outline-w": [{
        outline: [tc, lE]
      }],
      /**
       * Outline Color
       * @see https://tailwindcss.com/docs/outline-color
       */
      "outline-color": [{
        outline: [A]
      }],
      /**
       * Ring Width
       * @see https://tailwindcss.com/docs/ring-width
       */
      "ring-w": [{
        ring: v()
      }],
      /**
       * Ring Width Inset
       * @see https://tailwindcss.com/docs/ring-width
       */
      "ring-w-inset": ["ring-inset"],
      /**
       * Ring Color
       * @see https://tailwindcss.com/docs/ring-color
       */
      "ring-color": [{
        ring: [A]
      }],
      /**
       * Ring Opacity
       * @see https://tailwindcss.com/docs/ring-opacity
       */
      "ring-opacity": [{
        "ring-opacity": [m]
      }],
      /**
       * Ring Offset Width
       * @see https://tailwindcss.com/docs/ring-offset-width
       */
      "ring-offset-w": [{
        "ring-offset": [tc, lE]
      }],
      /**
       * Ring Offset Color
       * @see https://tailwindcss.com/docs/ring-offset-color
       */
      "ring-offset-color": [{
        "ring-offset": [A]
      }],
      // Effects
      /**
       * Box Shadow
       * @see https://tailwindcss.com/docs/box-shadow
       */
      shadow: [{
        shadow: ["", "inner", "none", cE, aBe]
      }],
      /**
       * Box Shadow Color
       * @see https://tailwindcss.com/docs/box-shadow-color
       */
      "shadow-color": [{
        shadow: [Bk]
      }],
      /**
       * Opacity
       * @see https://tailwindcss.com/docs/opacity
       */
      opacity: [{
        opacity: [m]
      }],
      /**
       * Mix Blend Mode
       * @see https://tailwindcss.com/docs/mix-blend-mode
       */
      "mix-blend": [{
        "mix-blend": q()
      }],
      /**
       * Background Blend Mode
       * @see https://tailwindcss.com/docs/background-blend-mode
       */
      "bg-blend": [{
        "bg-blend": q()
      }],
      // Filters
      /**
       * Filter
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/filter
       */
      filter: [{
        filter: ["", "none"]
      }],
      /**
       * Blur
       * @see https://tailwindcss.com/docs/blur
       */
      blur: [{
        blur: [t]
      }],
      /**
       * Brightness
       * @see https://tailwindcss.com/docs/brightness
       */
      brightness: [{
        brightness: [i]
      }],
      /**
       * Contrast
       * @see https://tailwindcss.com/docs/contrast
       */
      contrast: [{
        contrast: [I]
      }],
      /**
       * Drop Shadow
       * @see https://tailwindcss.com/docs/drop-shadow
       */
      "drop-shadow": [{
        "drop-shadow": ["", "none", cE, wt]
      }],
      /**
       * Grayscale
       * @see https://tailwindcss.com/docs/grayscale
       */
      grayscale: [{
        grayscale: [r]
      }],
      /**
       * Hue Rotate
       * @see https://tailwindcss.com/docs/hue-rotate
       */
      "hue-rotate": [{
        "hue-rotate": [a]
      }],
      /**
       * Invert
       * @see https://tailwindcss.com/docs/invert
       */
      invert: [{
        invert: [C]
      }],
      /**
       * Saturate
       * @see https://tailwindcss.com/docs/saturate
       */
      saturate: [{
        saturate: [f]
      }],
      /**
       * Sepia
       * @see https://tailwindcss.com/docs/sepia
       */
      sepia: [{
        sepia: [G]
      }],
      /**
       * Backdrop Filter
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/backdrop-filter
       */
      "backdrop-filter": [{
        "backdrop-filter": ["", "none"]
      }],
      /**
       * Backdrop Blur
       * @see https://tailwindcss.com/docs/backdrop-blur
       */
      "backdrop-blur": [{
        "backdrop-blur": [t]
      }],
      /**
       * Backdrop Brightness
       * @see https://tailwindcss.com/docs/backdrop-brightness
       */
      "backdrop-brightness": [{
        "backdrop-brightness": [i]
      }],
      /**
       * Backdrop Contrast
       * @see https://tailwindcss.com/docs/backdrop-contrast
       */
      "backdrop-contrast": [{
        "backdrop-contrast": [I]
      }],
      /**
       * Backdrop Grayscale
       * @see https://tailwindcss.com/docs/backdrop-grayscale
       */
      "backdrop-grayscale": [{
        "backdrop-grayscale": [r]
      }],
      /**
       * Backdrop Hue Rotate
       * @see https://tailwindcss.com/docs/backdrop-hue-rotate
       */
      "backdrop-hue-rotate": [{
        "backdrop-hue-rotate": [a]
      }],
      /**
       * Backdrop Invert
       * @see https://tailwindcss.com/docs/backdrop-invert
       */
      "backdrop-invert": [{
        "backdrop-invert": [C]
      }],
      /**
       * Backdrop Opacity
       * @see https://tailwindcss.com/docs/backdrop-opacity
       */
      "backdrop-opacity": [{
        "backdrop-opacity": [m]
      }],
      /**
       * Backdrop Saturate
       * @see https://tailwindcss.com/docs/backdrop-saturate
       */
      "backdrop-saturate": [{
        "backdrop-saturate": [f]
      }],
      /**
       * Backdrop Sepia
       * @see https://tailwindcss.com/docs/backdrop-sepia
       */
      "backdrop-sepia": [{
        "backdrop-sepia": [G]
      }],
      // Tables
      /**
       * Border Collapse
       * @see https://tailwindcss.com/docs/border-collapse
       */
      "border-collapse": [{
        border: ["collapse", "separate"]
      }],
      /**
       * Border Spacing
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing": [{
        "border-spacing": [g]
      }],
      /**
       * Border Spacing X
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing-x": [{
        "border-spacing-x": [g]
      }],
      /**
       * Border Spacing Y
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing-y": [{
        "border-spacing-y": [g]
      }],
      /**
       * Table Layout
       * @see https://tailwindcss.com/docs/table-layout
       */
      "table-layout": [{
        table: ["auto", "fixed"]
      }],
      /**
       * Caption Side
       * @see https://tailwindcss.com/docs/caption-side
       */
      caption: [{
        caption: ["top", "bottom"]
      }],
      // Transitions and Animation
      /**
       * Tranisition Property
       * @see https://tailwindcss.com/docs/transition-property
       */
      transition: [{
        transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", wt]
      }],
      /**
       * Transition Duration
       * @see https://tailwindcss.com/docs/transition-duration
       */
      duration: [{
        duration: nA()
      }],
      /**
       * Transition Timing Function
       * @see https://tailwindcss.com/docs/transition-timing-function
       */
      ease: [{
        ease: ["linear", "in", "out", "in-out", wt]
      }],
      /**
       * Transition Delay
       * @see https://tailwindcss.com/docs/transition-delay
       */
      delay: [{
        delay: nA()
      }],
      /**
       * Animation
       * @see https://tailwindcss.com/docs/animation
       */
      animate: [{
        animate: ["none", "spin", "ping", "pulse", "bounce", wt]
      }],
      // Transforms
      /**
       * Transform
       * @see https://tailwindcss.com/docs/transform
       */
      transform: [{
        transform: ["", "gpu", "none"]
      }],
      /**
       * Scale
       * @see https://tailwindcss.com/docs/scale
       */
      scale: [{
        scale: [w]
      }],
      /**
       * Scale X
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-x": [{
        "scale-x": [w]
      }],
      /**
       * Scale Y
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-y": [{
        "scale-y": [w]
      }],
      /**
       * Rotate
       * @see https://tailwindcss.com/docs/rotate
       */
      rotate: [{
        rotate: [Ck, wt]
      }],
      /**
       * Translate X
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-x": [{
        "translate-x": [Z]
      }],
      /**
       * Translate Y
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-y": [{
        "translate-y": [Z]
      }],
      /**
       * Skew X
       * @see https://tailwindcss.com/docs/skew
       */
      "skew-x": [{
        "skew-x": [R]
      }],
      /**
       * Skew Y
       * @see https://tailwindcss.com/docs/skew
       */
      "skew-y": [{
        "skew-y": [R]
      }],
      /**
       * Transform Origin
       * @see https://tailwindcss.com/docs/transform-origin
       */
      "transform-origin": [{
        origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", wt]
      }],
      // Interactivity
      /**
       * Accent Color
       * @see https://tailwindcss.com/docs/accent-color
       */
      accent: [{
        accent: ["auto", A]
      }],
      /**
       * Appearance
       * @see https://tailwindcss.com/docs/appearance
       */
      appearance: [{
        appearance: ["none", "auto"]
      }],
      /**
       * Cursor
       * @see https://tailwindcss.com/docs/cursor
       */
      cursor: [{
        cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", wt]
      }],
      /**
       * Caret Color
       * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
       */
      "caret-color": [{
        caret: [A]
      }],
      /**
       * Pointer Events
       * @see https://tailwindcss.com/docs/pointer-events
       */
      "pointer-events": [{
        "pointer-events": ["none", "auto"]
      }],
      /**
       * Resize
       * @see https://tailwindcss.com/docs/resize
       */
      resize: [{
        resize: ["none", "y", "x", ""]
      }],
      /**
       * Scroll Behavior
       * @see https://tailwindcss.com/docs/scroll-behavior
       */
      "scroll-behavior": [{
        scroll: ["auto", "smooth"]
      }],
      /**
       * Scroll Margin
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-m": [{
        "scroll-m": N()
      }],
      /**
       * Scroll Margin X
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mx": [{
        "scroll-mx": N()
      }],
      /**
       * Scroll Margin Y
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-my": [{
        "scroll-my": N()
      }],
      /**
       * Scroll Margin Start
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-ms": [{
        "scroll-ms": N()
      }],
      /**
       * Scroll Margin End
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-me": [{
        "scroll-me": N()
      }],
      /**
       * Scroll Margin Top
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mt": [{
        "scroll-mt": N()
      }],
      /**
       * Scroll Margin Right
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mr": [{
        "scroll-mr": N()
      }],
      /**
       * Scroll Margin Bottom
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mb": [{
        "scroll-mb": N()
      }],
      /**
       * Scroll Margin Left
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-ml": [{
        "scroll-ml": N()
      }],
      /**
       * Scroll Padding
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-p": [{
        "scroll-p": N()
      }],
      /**
       * Scroll Padding X
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-px": [{
        "scroll-px": N()
      }],
      /**
       * Scroll Padding Y
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-py": [{
        "scroll-py": N()
      }],
      /**
       * Scroll Padding Start
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-ps": [{
        "scroll-ps": N()
      }],
      /**
       * Scroll Padding End
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pe": [{
        "scroll-pe": N()
      }],
      /**
       * Scroll Padding Top
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pt": [{
        "scroll-pt": N()
      }],
      /**
       * Scroll Padding Right
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pr": [{
        "scroll-pr": N()
      }],
      /**
       * Scroll Padding Bottom
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pb": [{
        "scroll-pb": N()
      }],
      /**
       * Scroll Padding Left
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pl": [{
        "scroll-pl": N()
      }],
      /**
       * Scroll Snap Align
       * @see https://tailwindcss.com/docs/scroll-snap-align
       */
      "snap-align": [{
        snap: ["start", "end", "center", "align-none"]
      }],
      /**
       * Scroll Snap Stop
       * @see https://tailwindcss.com/docs/scroll-snap-stop
       */
      "snap-stop": [{
        snap: ["normal", "always"]
      }],
      /**
       * Scroll Snap Type
       * @see https://tailwindcss.com/docs/scroll-snap-type
       */
      "snap-type": [{
        snap: ["none", "x", "y", "both"]
      }],
      /**
       * Scroll Snap Type Strictness
       * @see https://tailwindcss.com/docs/scroll-snap-type
       */
      "snap-strictness": [{
        snap: ["mandatory", "proximity"]
      }],
      /**
       * Touch Action
       * @see https://tailwindcss.com/docs/touch-action
       */
      touch: [{
        touch: ["auto", "none", "manipulation"]
      }],
      /**
       * Touch Action X
       * @see https://tailwindcss.com/docs/touch-action
       */
      "touch-x": [{
        "touch-pan": ["x", "left", "right"]
      }],
      /**
       * Touch Action Y
       * @see https://tailwindcss.com/docs/touch-action
       */
      "touch-y": [{
        "touch-pan": ["y", "up", "down"]
      }],
      /**
       * Touch Action Pinch Zoom
       * @see https://tailwindcss.com/docs/touch-action
       */
      "touch-pz": ["touch-pinch-zoom"],
      /**
       * User Select
       * @see https://tailwindcss.com/docs/user-select
       */
      select: [{
        select: ["none", "text", "all", "auto"]
      }],
      /**
       * Will Change
       * @see https://tailwindcss.com/docs/will-change
       */
      "will-change": [{
        "will-change": ["auto", "scroll", "contents", "transform", wt]
      }],
      // SVG
      /**
       * Fill
       * @see https://tailwindcss.com/docs/fill
       */
      fill: [{
        fill: [A, "none"]
      }],
      /**
       * Stroke Width
       * @see https://tailwindcss.com/docs/stroke-width
       */
      "stroke-w": [{
        stroke: [tc, lE, fM]
      }],
      /**
       * Stroke
       * @see https://tailwindcss.com/docs/stroke
       */
      stroke: [{
        stroke: [A, "none"]
      }],
      // Accessibility
      /**
       * Screen Readers
       * @see https://tailwindcss.com/docs/screen-readers
       */
      sr: ["sr-only", "not-sr-only"],
      /**
       * Forced Color Adjust
       * @see https://tailwindcss.com/docs/forced-color-adjust
       */
      "forced-color-adjust": [{
        "forced-color-adjust": ["auto", "none"]
      }]
    },
    conflictingClassGroups: {
      overflow: ["overflow-x", "overflow-y"],
      overscroll: ["overscroll-x", "overscroll-y"],
      inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
      "inset-x": ["right", "left"],
      "inset-y": ["top", "bottom"],
      flex: ["basis", "grow", "shrink"],
      gap: ["gap-x", "gap-y"],
      p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
      px: ["pr", "pl"],
      py: ["pt", "pb"],
      m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
      mx: ["mr", "ml"],
      my: ["mt", "mb"],
      size: ["w", "h"],
      "font-size": ["leading"],
      "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
      "fvn-ordinal": ["fvn-normal"],
      "fvn-slashed-zero": ["fvn-normal"],
      "fvn-figure": ["fvn-normal"],
      "fvn-spacing": ["fvn-normal"],
      "fvn-fraction": ["fvn-normal"],
      "line-clamp": ["display", "overflow"],
      rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"],
      "rounded-s": ["rounded-ss", "rounded-es"],
      "rounded-e": ["rounded-se", "rounded-ee"],
      "rounded-t": ["rounded-tl", "rounded-tr"],
      "rounded-r": ["rounded-tr", "rounded-br"],
      "rounded-b": ["rounded-br", "rounded-bl"],
      "rounded-l": ["rounded-tl", "rounded-bl"],
      "border-spacing": ["border-spacing-x", "border-spacing-y"],
      "border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
      "border-w-x": ["border-w-r", "border-w-l"],
      "border-w-y": ["border-w-t", "border-w-b"],
      "border-color": ["border-color-t", "border-color-r", "border-color-b", "border-color-l"],
      "border-color-x": ["border-color-r", "border-color-l"],
      "border-color-y": ["border-color-t", "border-color-b"],
      "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
      "scroll-mx": ["scroll-mr", "scroll-ml"],
      "scroll-my": ["scroll-mt", "scroll-mb"],
      "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
      "scroll-px": ["scroll-pr", "scroll-pl"],
      "scroll-py": ["scroll-pt", "scroll-pb"],
      touch: ["touch-x", "touch-y", "touch-pz"],
      "touch-x": ["touch"],
      "touch-y": ["touch"],
      "touch-pz": ["touch"]
    },
    conflictingClassGroupModifiers: {
      "font-size": ["leading"]
    }
  };
}
const cBe = /* @__PURE__ */ qCe(lBe);
function QBe(A, e) {
  return A.filter((t) => e.every((i) => i.type === "continuous" ? t[i.key] >= i.range[0] && t[i.key] <= i.range[1] : i.range.has(t[i.key])));
}
function EBe() {
  return {
    // viewId: "",
    fid: Hn,
    name: of.t("constant.row_count"),
    analyticType: "measure",
    semanticType: "quantitative",
    aggName: "sum",
    computed: !0,
    expression: {
      op: "one",
      params: [],
      as: Hn
    }
  };
}
function uBe() {
  return [
    {
      fid: Zi,
      name: of.t("constant.mea_key"),
      analyticType: "dimension",
      semanticType: "nominal"
    },
    {
      fid: Wi,
      name: of.t("constant.mea_val"),
      analyticType: "measure",
      semanticType: "quantitative",
      aggName: "sum"
    }
  ];
}
function OI(A) {
  return A.fid;
}
function $a(...A) {
  return A.filter(Boolean).join(" ");
}
function op(A, e) {
  return !e || e === "expr" ? A : `${e}(${A})`;
}
function io(A, e) {
  return !e || e === "expr" ? A : `${A}_${e}`;
}
function rm(A) {
  return A.enableAgg && A.aggName ? io(A.fid, A.aggName) : A.fid;
}
function gf({ rows: A, columns: e }) {
  return A.length && !A.find((t) => t.analyticType === "measure") ? A[A.length - 1].sort || "none" : e.length && !e.find((t) => t.analyticType === "measure") && e[e.length - 1].sort || "none";
}
function _YA({ rows: A, columns: e }) {
  return A.length && !A.find((t) => t.analyticType === "measure") ? "row" : e.length && !e.find((t) => t.analyticType === "measure") ? "column" : "none";
}
function GD(A) {
  return A instanceof Error ? A.message : typeof A == "string" ? A : String(A);
}
const CQ = (A) => {
  const e = A.getFullYear(), t = A.getMonth() + 1, i = A.getDate(), n = A.getHours(), o = A.getMinutes(), g = A.getSeconds(), s = (I) => `${I}`.padStart(2, "0");
  return `${e}-${s(t)}-${s(i)} ${s(n)}:${s(o)}:${s(g)}`;
}, an = (A) => A != null;
function dBe(A) {
  let e = A.value;
  return A.regexp || (e = e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")), A.word && (e = `\\b${e}\\b`), new RegExp(e, A.caseSenstive ? "" : "i");
}
function hBe(A, e, t) {
  if (A.length === 0)
    throw new Error("there is no item in arr.");
  let i = 0, n = A.length - 1, o = A[0];
  for (; i <= n; ) {
    const g = Math.floor((i + n) / 2), s = A[g], I = t(s);
    if ((o === null || Math.abs(I - e) < Math.abs(t(o) - e)) && (o = s), I === e)
      return s;
    I < e ? i = g + 1 : n = g - 1;
  }
  return o;
}
function llA(A) {
  Promise.resolve().then(A);
}
function me(...A) {
  return cBe(LCe(A));
}
function nw(A) {
  return typeof A == "object" ? JSON.stringify(A) : A;
}
function clA(A, e) {
  if (A.length !== e.length)
    return !1;
  for (let t = 0; t < A.length; t++)
    if (A[t] !== e[t])
      return !1;
  return !0;
}
const DY = u.forwardRef(({ className: A, ...e }, t) => u.createElement(
  o3,
  { ref: t, className: me("relative flex w-full touch-none select-none items-center", A), ...e },
  u.createElement(
    LYA,
    { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20" },
    u.createElement(vYA, { className: "absolute h-full bg-primary" })
  ),
  u.createElement(vq, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" })
));
DY.displayName = o3.displayName;
const mBe = (A) => {
  const { onWidthChange: e, onHeightChange: t, width: i, height: n, children: o } = A, { t: g } = qe("translation", { keyPrefix: "main.tabpanel.settings.size_setting" }), [s, I] = Mq(i, e), [r, a] = Mq(n, t), C = u.useMemo(() => [Math.sqrt(s / 1e3)], [s]), B = u.useMemo(() => [Math.sqrt(r / 1e3)], [r]);
  return b.createElement(
    "div",
    { className: "w-60 p-2" },
    o,
    b.createElement(
      "div",
      { className: "mt-4" },
      b.createElement(DY, { min: 0, max: 1, step: 0.01, name: "width", className: "w-full", onValueChange: ([l]) => I(Math.round(l ** 2 * 1e3)), value: C }),
      b.createElement("div", { className: "ml-1 mt-1 text-xs" }, `${g("width")}: ${s}`)
    ),
    b.createElement(
      "div",
      { className: "mt-4" },
      b.createElement(DY, { min: 0, max: 1, step: 0.01, name: "height", className: "w-full", onValueChange: ([l]) => a(Math.round(l ** 2 * 1e3)), value: B }),
      b.createElement(
        "div",
        { className: "ml-1 mt-1 text-xs" },
        " ",
        `${g("height")}: ${r}`
      )
    )
  );
}, pBe = {
  generic: ["auto", "bar", "line", "area", "trail", "point", "circle", "tick", "rect", "arc", "text", "boxplot", "table"],
  geographic: ["poi", "choropleth"]
}, yBe = ["generic", "geographic"], bBe = ["none", "stack", "normalize", "center"], wBe = ["auto", "fixed", "full"], fBe = {
  rows: 1 / 0,
  columns: 1 / 0,
  color: 1,
  opacity: 1,
  size: 1,
  shape: 1,
  theta: 1,
  radius: 1,
  details: 1 / 0,
  text: 1
}, DBe = ["dimensions", "measures"], GBe = ["x", "y"], kBe = ["color", "opacity", "shape", "size"], JBe = ["sum", "mean", "median", "count", "min", "max", "variance", "stdev"], NBe = ["data_interpretation", "data_view"], We = {
  AGGREGATOR_LIST: JBe,
  CHART_LAYOUT_TYPE: wBe,
  COORD_TYPES: yBe,
  GEOM_TYPES: pBe,
  MAX_HISTORY_SIZE: 20,
  STACK_MODE: bBe,
  META_FIELD_KEYS: DBe,
  CHANNEL_LIMIT: fBe,
  POSITION_CHANNEL_CONFIG_LIST: GBe,
  NON_POSITION_CHANNEL_CONFIG_LIST: kBe,
  EMBEDED_MENU_LIST: NBe,
  PAINT_MAP_SIZE: 128,
  PAINT_SIZE_FACTOR: 4,
  PAINT_MIN_BRUSH_SIZE: 1,
  PAINT_DEFAULT_BRUSH_SIZE: 9,
  PAINT_MAX_BRUSH_SIZE: 36,
  KEYWORD_DEBOUNCE_SETTING: { timeout: 300, leading: !0, trailing: !0 }
};
function YBe() {
  return {
    dimensions: [],
    measures: [],
    rows: [],
    columns: [],
    color: [],
    opacity: [],
    size: [],
    shape: [],
    radius: [],
    theta: [],
    longitude: [],
    latitude: [],
    geoId: [],
    details: [],
    filters: [],
    text: []
  };
}
function RBe() {
  const [A] = We.GEOM_TYPES.generic;
  return {
    defaultAggregated: !0,
    geoms: [A],
    showTableSummary: !1,
    coordSystem: "generic",
    stack: "stack",
    showActions: !1,
    interactiveScale: !1,
    sorted: "none",
    zeroScale: !0,
    scaleIncludeUnmatchedChoropleth: !1,
    background: void 0,
    size: {
      mode: "auto",
      width: 320,
      height: 200
    },
    format: {
      numberFormat: void 0,
      timeFormat: void 0,
      normalizedNumberFormat: void 0
    },
    geoKey: "name",
    resolve: {
      x: !1,
      y: !1,
      color: !1,
      opacity: !1,
      shape: !1,
      size: !1
    },
    limit: -1
  };
}
const QlA = {
  showActions: !1,
  showTableSummary: !1,
  stack: "stack",
  interactiveScale: !1,
  zeroScale: !0,
  background: void 0,
  size: {
    mode: "auto",
    width: 320,
    height: 200
  },
  format: {
    numberFormat: void 0,
    timeFormat: void 0,
    normalizedNumberFormat: void 0
  },
  geoKey: "name",
  resolve: {
    x: !1,
    y: !1,
    color: !1,
    opacity: !1,
    shape: !1,
    size: !1
  }
}, Zq = {
  defaultAggregated: !0,
  geoms: [We.GEOM_TYPES.generic[0]],
  coordSystem: "generic",
  limit: -1
}, y7 = {
  dimensions: [],
  measures: [],
  rows: [],
  columns: [],
  color: [],
  opacity: [],
  size: [],
  shape: [],
  radius: [],
  theta: [],
  longitude: [],
  latitude: [],
  geoId: [],
  details: [],
  filters: [],
  text: []
};
function qYA(A) {
  return {
    ...A,
    encodings: {
      ...YBe(),
      ...A.encodings
    }
  };
}
const OYA = (A) => ({
  ...A,
  config: {
    ...RBe(),
    ...A.config
  }
});
function FBe(A, e, t) {
  var i = new Blob([A], { type: t });
  if (window.navigator.msSaveOrOpenBlob)
    window.navigator.msSaveOrOpenBlob(i, e);
  else {
    var n = document.createElement("a"), o = URL.createObjectURL(i);
    n.href = o, n.download = e, document.body.appendChild(n), n.click(), setTimeout(function() {
      document.body.removeChild(n), window.URL.revokeObjectURL(o);
    }, 0);
  }
}
function MBe(A, e) {
  if (window.navigator.msSaveOrOpenBlob)
    window.navigator.msSaveOrOpenBlob(A, e);
  else {
    var t = document.createElement("a"), i = URL.createObjectURL(A);
    t.href = i, t.download = e, document.body.appendChild(t), t.click(), setTimeout(function() {
      document.body.removeChild(t), window.URL.revokeObjectURL(i);
    }, 0);
  }
}
let jYA = (A = 21) => crypto.getRandomValues(new Uint8Array(A)).reduce((e, t) => (t &= 63, t < 36 ? e += t.toString(36) : t < 62 ? e += (t - 26).toString(36).toUpperCase() : t > 62 ? e += "-" : e += "_", e), "");
function Mr() {
  return "gw_" + jYA(4);
}
const DM = (A, e, t) => t === A.length ? A.concat([e]) : A.flatMap((i, n) => n === t ? [e, i] : [i]), ElA = (A, e) => A.filter((t, i) => i !== e), QE = (A, e, t) => A.map((i, n) => n === e ? t(i) : i);
function Tt(A, e, t) {
  const i = (n, o, g) => {
    const [s, ...I] = o;
    return I.length === 0 ? {
      ...n,
      [s]: g(n[s])
    } : {
      ...n,
      [s]: i(n[s], I, g)
    };
  };
  return i(A, e.split("."), t);
}
const b7 = (A) => Math.floor(Math.sqrt(2 * A));
function xBe(A) {
  return (e, t) => {
    const { base: i, cache: n, cursor: o, now: g, timeline: s } = e;
    return {
      base: i,
      now: A(g, t),
      cursor: o + 1,
      cache: o - n.cursor > b7(o) ? {
        value: A(n.value, s[n.cursor]),
        cursor: n.cursor + 1
      } : n,
      timeline: s.slice(0, o).concat([t])
    };
  };
}
function LBe(A) {
  return (e) => {
    const { base: t, cache: i, cursor: n, timeline: o } = e, g = n - 1;
    if (g < 0)
      return e;
    const s = g < i.cursor, I = s ? Math.max(0, g - b7(g)) : i.cursor, r = s ? o.slice(0, I).reduce(A, t) : i.value;
    return {
      base: t,
      now: o.slice(I, g).reduce(A, r),
      cache: s ? { value: r, cursor: I } : i,
      cursor: g,
      timeline: o
    };
  };
}
function vBe(A) {
  return (e) => {
    const { base: t, cache: i, cursor: n, now: o, timeline: g } = e;
    return n === g.length ? e : {
      base: t,
      now: A(o, g[n]),
      cursor: n + 1,
      cache: n - i.cursor > b7(n) ? {
        value: A(i.value, g[i.cursor]),
        cursor: i.cursor + 1
      } : i,
      timeline: g
    };
  };
}
function HBe(A) {
  return (e, t) => t > e.cursor ? e.now : t > e.cache.cursor ? e.timeline.slice(e.cache.cursor, t).reduce(A, e.cache.value) : e.timeline.slice(0, t).reduce(A, e.base);
}
function PYA(A) {
  return {
    base: A,
    cursor: 0,
    cache: {
      value: A,
      cursor: 0
    },
    now: A,
    timeline: []
  };
}
const qC = {
  /**
   * measures should appear after dimensions, for we do not apply cross operator on measures.
   * @param fields
   * @returns
   */
  measureAfterDimension(A) {
    return A.filter((e) => e.analyticType === "dimension").concat(A.filter((e) => e.analyticType === "measure"));
  },
  // due to renderer, we set a limit of var can be applied to cross operator in GoG.
  crossLimit(A) {
    return function(e) {
      let t = 0;
      return e.reduce((i, n) => (n.analyticType === "dimension" && t < A && (i.push(n), t++), n.analyticType === "measure" && i.push(n), i), []);
    };
  },
  forceAnalyticType(A) {
    return function(e) {
      return e.map((t) => ({
        ...t,
        analyticType: A
      }));
    };
  },
  forceSemanticType(A) {
    return function(e) {
      return e.map((t) => ({
        ...t,
        semanticType: A
      }));
    };
  }
};
function GM(A, e) {
  return e.reduce((t, i) => i(t), A);
}
function ulA(A, e) {
  const t = {};
  return e.rows && e.rows.length > 0 && (t.rows = GM(e.rows, [qC.measureAfterDimension, qC.crossLimit(A === "table" ? 1 / 0 : 2)])), e.columns && e.columns.length > 0 && (t.columns = GM(e.columns, [qC.measureAfterDimension, qC.crossLimit(A === "table" ? 1 / 0 : 2)])), e.latitude && e.latitude.length > 0 && (t.latitude = GM(e.latitude, [qC.forceAnalyticType("dimension"), qC.forceSemanticType("quantitative"), qC.crossLimit(1)])), e.longitude && e.longitude.length > 0 && (t.longitude = GM(e.longitude, [qC.forceAnalyticType("dimension"), qC.forceSemanticType("quantitative"), qC.crossLimit(1)])), t;
}
var cN = {}, dlA = { exports: {} }, hlA;
function SBe() {
  return hlA || (hlA = 1, function(A) {
    (function(e, t) {
      A.exports ? A.exports = t() : e.moo = t();
    })(qE, function() {
      var e = Object.prototype.hasOwnProperty, t = Object.prototype.toString, i = typeof new RegExp().sticky == "boolean";
      function n(p) {
        return p && t.call(p) === "[object RegExp]";
      }
      function o(p) {
        return p && typeof p == "object" && !n(p) && !Array.isArray(p);
      }
      function g(p) {
        return p.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
      }
      function s(p) {
        var N = new RegExp("|" + p);
        return N.exec("").length - 1;
      }
      function I(p) {
        return "(" + p + ")";
      }
      function r(p) {
        if (!p.length)
          return "(?!)";
        var N = p.map(function(v) {
          return "(?:" + v + ")";
        }).join("|");
        return "(?:" + N + ")";
      }
      function a(p) {
        if (typeof p == "string")
          return "(?:" + g(p) + ")";
        if (n(p)) {
          if (p.ignoreCase)
            throw new Error("RegExp /i flag not allowed");
          if (p.global)
            throw new Error("RegExp /g flag is implied");
          if (p.sticky)
            throw new Error("RegExp /y flag is implied");
          if (p.multiline)
            throw new Error("RegExp /m flag is implied");
          return p.source;
        } else
          throw new Error("Not a pattern: " + p);
      }
      function C(p, N) {
        return p.length > N ? p : Array(N - p.length + 1).join(" ") + p;
      }
      function B(p, N) {
        for (var v = p.length, K = 0; ; ) {
          var U = p.lastIndexOf(`
`, v - 1);
          if (U === -1 || (K++, v = U, K === N) || v === 0)
            break;
        }
        var j = K < N ? 0 : v + 1;
        return p.substring(j).split(`
`);
      }
      function l(p) {
        for (var N = Object.getOwnPropertyNames(p), v = [], K = 0; K < N.length; K++) {
          var U = N[K], j = p[U], q = [].concat(j);
          if (U === "include") {
            for (var O = 0; O < q.length; O++)
              v.push({ include: q[O] });
            continue;
          }
          var $ = [];
          q.forEach(function(_) {
            o(_) ? ($.length && v.push(E(U, $)), v.push(E(U, _)), $ = []) : $.push(_);
          }), $.length && v.push(E(U, $));
        }
        return v;
      }
      function Q(p) {
        for (var N = [], v = 0; v < p.length; v++) {
          var K = p[v];
          if (K.include) {
            for (var U = [].concat(K.include), j = 0; j < U.length; j++)
              N.push({ include: U[j] });
            continue;
          }
          if (!K.type)
            throw new Error("Rule has no type: " + JSON.stringify(K));
          N.push(E(K.type, K));
        }
        return N;
      }
      function E(p, N) {
        if (o(N) || (N = { match: N }), N.include)
          throw new Error("Matching rules cannot also include states");
        var v = {
          defaultType: p,
          lineBreaks: !!N.error || !!N.fallback,
          pop: !1,
          next: null,
          push: null,
          error: !1,
          fallback: !1,
          value: null,
          type: null,
          shouldThrow: !1
        };
        for (var K in N)
          e.call(N, K) && (v[K] = N[K]);
        if (typeof v.type == "string" && p !== v.type)
          throw new Error("Type transform cannot be a string (type '" + v.type + "' for token '" + p + "')");
        var U = v.match;
        return v.match = Array.isArray(U) ? U : U ? [U] : [], v.match.sort(function(j, q) {
          return n(j) && n(q) ? 0 : n(q) ? -1 : n(j) ? 1 : q.length - j.length;
        }), v;
      }
      function d(p) {
        return Array.isArray(p) ? Q(p) : l(p);
      }
      var m = E("error", { lineBreaks: !0, shouldThrow: !0 });
      function y(p, N) {
        for (var v = null, K = /* @__PURE__ */ Object.create(null), U = !0, j = null, q = [], O = [], $ = 0; $ < p.length; $++)
          p[$].fallback && (U = !1);
        for (var $ = 0; $ < p.length; $++) {
          var _ = p[$];
          if (_.include)
            throw new Error("Inheritance is not allowed in stateless lexers");
          if (_.error || _.fallback) {
            if (v)
              throw !_.fallback == !v.fallback ? new Error("Multiple " + (_.fallback ? "fallback" : "error") + " rules not allowed (for token '" + _.defaultType + "')") : new Error("fallback and error are mutually exclusive (for token '" + _.defaultType + "')");
            v = _;
          }
          var tA = _.match.slice();
          if (U)
            for (; tA.length && typeof tA[0] == "string" && tA[0].length === 1; ) {
              var nA = tA.shift();
              K[nA.charCodeAt(0)] = _;
            }
          if (_.pop || _.push || _.next) {
            if (!N)
              throw new Error("State-switching options are not allowed in stateless lexers (for token '" + _.defaultType + "')");
            if (_.fallback)
              throw new Error("State-switching options are not allowed on fallback tokens (for token '" + _.defaultType + "')");
          }
          if (tA.length !== 0) {
            U = !1, q.push(_);
            for (var AA = 0; AA < tA.length; AA++) {
              var gA = tA[AA];
              if (n(gA)) {
                if (j === null)
                  j = gA.unicode;
                else if (j !== gA.unicode && _.fallback === !1)
                  throw new Error("If one rule is /u then all must be");
              }
            }
            var rA = r(tA.map(a)), sA = new RegExp(rA);
            if (sA.test(""))
              throw new Error("RegExp matches empty string: " + sA);
            var lA = s(rA);
            if (lA > 0)
              throw new Error("RegExp has capture groups: " + sA + `
Use (?: … ) instead`);
            if (!_.lineBreaks && sA.test(`
`))
              throw new Error("Rule should declare lineBreaks: " + sA);
            O.push(I(rA));
          }
        }
        var cA = v && v.fallback, aA = i && !cA ? "ym" : "gm", QA = i || cA ? "" : "|";
        j === !0 && (aA += "u");
        var hA = new RegExp(r(O) + QA, aA);
        return { regexp: hA, groups: q, fast: K, error: v || m };
      }
      function f(p) {
        var N = y(d(p));
        return new F({ start: N }, "start");
      }
      function w(p, N, v) {
        var K = p && (p.push || p.next);
        if (K && !v[K])
          throw new Error("Missing state '" + K + "' (in token '" + p.defaultType + "' of state '" + N + "')");
        if (p && p.pop && +p.pop != 1)
          throw new Error("pop must be 1 (in token '" + p.defaultType + "' of state '" + N + "')");
      }
      function G(p, N) {
        var v = p.$all ? d(p.$all) : [];
        delete p.$all;
        var K = Object.getOwnPropertyNames(p);
        N || (N = K[0]);
        for (var U = /* @__PURE__ */ Object.create(null), j = 0; j < K.length; j++) {
          var q = K[j];
          U[q] = d(p[q]).concat(v);
        }
        for (var j = 0; j < K.length; j++)
          for (var q = K[j], O = U[q], $ = /* @__PURE__ */ Object.create(null), _ = 0; _ < O.length; _++) {
            var tA = O[_];
            if (tA.include) {
              var nA = [_, 1];
              if (tA.include !== q && !$[tA.include]) {
                $[tA.include] = !0;
                var AA = U[tA.include];
                if (!AA)
                  throw new Error("Cannot include nonexistent state '" + tA.include + "' (in state '" + q + "')");
                for (var gA = 0; gA < AA.length; gA++) {
                  var rA = AA[gA];
                  O.indexOf(rA) === -1 && nA.push(rA);
                }
              }
              O.splice.apply(O, nA), _--;
            }
          }
        for (var sA = /* @__PURE__ */ Object.create(null), j = 0; j < K.length; j++) {
          var q = K[j];
          sA[q] = y(U[q], !0);
        }
        for (var j = 0; j < K.length; j++) {
          for (var lA = K[j], cA = sA[lA], aA = cA.groups, _ = 0; _ < aA.length; _++)
            w(aA[_], lA, sA);
          for (var QA = Object.getOwnPropertyNames(cA.fast), _ = 0; _ < QA.length; _++)
            w(cA.fast[QA[_]], lA, sA);
        }
        return new F(sA, N);
      }
      function R(p) {
        for (var N = typeof Map < "u", v = N ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null), K = Object.getOwnPropertyNames(p), U = 0; U < K.length; U++) {
          var j = K[U], q = p[j], O = Array.isArray(q) ? q : [q];
          O.forEach(function($) {
            if (typeof $ != "string")
              throw new Error("keyword must be string (in keyword '" + j + "')");
            N ? v.set($, j) : v[$] = j;
          });
        }
        return function($) {
          return N ? v.get($) : v[$];
        };
      }
      var F = function(p, N) {
        this.startState = N, this.states = p, this.buffer = "", this.stack = [], this.reset();
      };
      F.prototype.reset = function(p, N) {
        return this.buffer = p || "", this.index = 0, this.line = N ? N.line : 1, this.col = N ? N.col : 1, this.queuedToken = N ? N.queuedToken : null, this.queuedText = N ? N.queuedText : "", this.queuedThrow = N ? N.queuedThrow : null, this.setState(N ? N.state : this.startState), this.stack = N && N.stack ? N.stack.slice() : [], this;
      }, F.prototype.save = function() {
        return {
          line: this.line,
          col: this.col,
          state: this.state,
          stack: this.stack.slice(),
          queuedToken: this.queuedToken,
          queuedText: this.queuedText,
          queuedThrow: this.queuedThrow
        };
      }, F.prototype.setState = function(p) {
        if (!(!p || this.state === p)) {
          this.state = p;
          var N = this.states[p];
          this.groups = N.groups, this.error = N.error, this.re = N.regexp, this.fast = N.fast;
        }
      }, F.prototype.popState = function() {
        this.setState(this.stack.pop());
      }, F.prototype.pushState = function(p) {
        this.stack.push(this.state), this.setState(p);
      };
      var Z = i ? function(p, N) {
        return p.exec(N);
      } : function(p, N) {
        var v = p.exec(N);
        return v[0].length === 0 ? null : v;
      };
      F.prototype._getGroup = function(p) {
        for (var N = this.groups.length, v = 0; v < N; v++)
          if (p[v + 1] !== void 0)
            return this.groups[v];
        throw new Error("Cannot find token type for matched text");
      };
      function c() {
        return this.value;
      }
      if (F.prototype.next = function() {
        var p = this.index;
        if (this.queuedGroup) {
          var N = this._token(this.queuedGroup, this.queuedText, p);
          return this.queuedGroup = null, this.queuedText = "", N;
        }
        var v = this.buffer;
        if (p !== v.length) {
          var q = this.fast[v.charCodeAt(p)];
          if (q)
            return this._token(q, v.charAt(p), p);
          var K = this.re;
          K.lastIndex = p;
          var U = Z(K, v), j = this.error;
          if (U == null)
            return this._token(j, v.slice(p, v.length), p);
          var q = this._getGroup(U), O = U[0];
          return j.fallback && U.index !== p ? (this.queuedGroup = q, this.queuedText = O, this._token(j, v.slice(p, U.index), p)) : this._token(q, O, p);
        }
      }, F.prototype._token = function(p, N, v) {
        var K = 0;
        if (p.lineBreaks) {
          var U = /\n/g, j = 1;
          if (N === `
`)
            K = 1;
          else
            for (; U.exec(N); )
              K++, j = U.lastIndex;
        }
        var q = {
          type: typeof p.type == "function" && p.type(N) || p.defaultType,
          value: typeof p.value == "function" ? p.value(N) : N,
          text: N,
          toString: c,
          offset: v,
          lineBreaks: K,
          line: this.line,
          col: this.col
        }, O = N.length;
        if (this.index += O, this.line += K, K !== 0 ? this.col = O - j + 1 : this.col += O, p.shouldThrow) {
          var $ = new Error(this.formatError(q, "invalid syntax"));
          throw $;
        }
        return p.pop ? this.popState() : p.push ? this.pushState(p.push) : p.next && this.setState(p.next), q;
      }, typeof Symbol < "u" && Symbol.iterator) {
        var J = function(p) {
          this.lexer = p;
        };
        J.prototype.next = function() {
          var p = this.lexer.next();
          return { value: p, done: !p };
        }, J.prototype[Symbol.iterator] = function() {
          return this;
        }, F.prototype[Symbol.iterator] = function() {
          return new J(this);
        };
      }
      return F.prototype.formatError = function(K, N) {
        if (K == null)
          var v = this.buffer.slice(this.index), K = {
            text: v,
            offset: this.index,
            lineBreaks: v.indexOf(`
`) === -1 ? 0 : 1,
            line: this.line,
            col: this.col
          };
        var U = 2, j = Math.max(K.line - U, 1), q = K.line + U, O = String(q).length, $ = B(
          this.buffer,
          this.line - K.line + U + 1
        ).slice(0, 5), _ = [];
        _.push(N + " at line " + K.line + " col " + K.col + ":"), _.push("");
        for (var tA = 0; tA < $.length; tA++) {
          var nA = $[tA], AA = j + tA;
          _.push(C(String(AA), O) + "  " + nA), AA === K.line && _.push(C("", O + K.col + 1) + "^");
        }
        return _.join(`
`);
      }, F.prototype.clone = function() {
        return new F(this.states, this.state);
      }, F.prototype.has = function(p) {
        return !0;
      }, {
        compile: f,
        states: G,
        error: Object.freeze({ error: !0 }),
        fallback: Object.freeze({ fallback: !0 }),
        keywords: R
      };
    });
  }(dlA)), dlA.exports;
}
var mlA = { exports: {} }, plA;
function ZBe() {
  return plA || (plA = 1, function(A) {
    (function(e, t) {
      A.exports ? A.exports = t() : e.nearley = t();
    })(qE, function() {
      function e(r, a, C) {
        return this.id = ++e.highestId, this.name = r, this.symbols = a, this.postprocess = C, this;
      }
      e.highestId = 0, e.prototype.toString = function(r) {
        var a = typeof r > "u" ? this.symbols.map(I).join(" ") : this.symbols.slice(0, r).map(I).join(" ") + " ● " + this.symbols.slice(r).map(I).join(" ");
        return this.name + " → " + a;
      };
      function t(r, a, C, B) {
        this.rule = r, this.dot = a, this.reference = C, this.data = [], this.wantedBy = B, this.isComplete = this.dot === r.symbols.length;
      }
      t.prototype.toString = function() {
        return "{" + this.rule.toString(this.dot) + "}, from: " + (this.reference || 0);
      }, t.prototype.nextState = function(r) {
        var a = new t(this.rule, this.dot + 1, this.reference, this.wantedBy);
        return a.left = this, a.right = r, a.isComplete && (a.data = a.build(), a.right = void 0), a;
      }, t.prototype.build = function() {
        var r = [], a = this;
        do
          r.push(a.right.data), a = a.left;
        while (a.left);
        return r.reverse(), r;
      }, t.prototype.finish = function() {
        this.rule.postprocess && (this.data = this.rule.postprocess(this.data, this.reference, g.fail));
      };
      function i(r, a) {
        this.grammar = r, this.index = a, this.states = [], this.wants = {}, this.scannable = [], this.completed = {};
      }
      i.prototype.process = function(r) {
        for (var a = this.states, C = this.wants, B = this.completed, l = 0; l < a.length; l++) {
          var Q = a[l];
          if (Q.isComplete) {
            if (Q.finish(), Q.data !== g.fail) {
              for (var E = Q.wantedBy, d = E.length; d--; ) {
                var m = E[d];
                this.complete(m, Q);
              }
              if (Q.reference === this.index) {
                var y = Q.rule.name;
                (this.completed[y] = this.completed[y] || []).push(Q);
              }
            }
          } else {
            var y = Q.rule.symbols[Q.dot];
            if (typeof y != "string") {
              this.scannable.push(Q);
              continue;
            }
            if (C[y]) {
              if (C[y].push(Q), B.hasOwnProperty(y))
                for (var f = B[y], d = 0; d < f.length; d++) {
                  var w = f[d];
                  this.complete(Q, w);
                }
            } else
              C[y] = [Q], this.predict(y);
          }
        }
      }, i.prototype.predict = function(r) {
        for (var a = this.grammar.byName[r] || [], C = 0; C < a.length; C++) {
          var B = a[C], l = this.wants[r], Q = new t(B, 0, this.index, l);
          this.states.push(Q);
        }
      }, i.prototype.complete = function(r, a) {
        var C = r.nextState(a);
        this.states.push(C);
      };
      function n(r, a) {
        this.rules = r, this.start = a || this.rules[0].name;
        var C = this.byName = {};
        this.rules.forEach(function(B) {
          C.hasOwnProperty(B.name) || (C[B.name] = []), C[B.name].push(B);
        });
      }
      n.fromCompiled = function(B, a) {
        var C = B.Lexer;
        B.ParserStart && (a = B.ParserStart, B = B.ParserRules);
        var B = B.map(function(Q) {
          return new e(Q.name, Q.symbols, Q.postprocess);
        }), l = new n(B, a);
        return l.lexer = C, l;
      };
      function o() {
        this.reset("");
      }
      o.prototype.reset = function(r, a) {
        this.buffer = r, this.index = 0, this.line = a ? a.line : 1, this.lastLineBreak = a ? -a.col : 0;
      }, o.prototype.next = function() {
        if (this.index < this.buffer.length) {
          var r = this.buffer[this.index++];
          return r === `
` && (this.line += 1, this.lastLineBreak = this.index), { value: r };
        }
      }, o.prototype.save = function() {
        return {
          line: this.line,
          col: this.index - this.lastLineBreak
        };
      }, o.prototype.formatError = function(r, a) {
        var C = this.buffer;
        if (typeof C == "string") {
          var B = C.split(`
`).slice(
            Math.max(0, this.line - 5),
            this.line
          ), l = C.indexOf(`
`, this.index);
          l === -1 && (l = C.length);
          var Q = this.index - this.lastLineBreak, E = String(this.line).length;
          return a += " at line " + this.line + " col " + Q + `:

`, a += B.map(function(m, y) {
            return d(this.line - B.length + y + 1, E) + " " + m;
          }, this).join(`
`), a += `
` + d("", E + Q) + `^
`, a;
        } else
          return a + " at index " + (this.index - 1);
        function d(m, y) {
          var f = String(m);
          return Array(y - f.length + 1).join(" ") + f;
        }
      };
      function g(r, a, B) {
        if (r instanceof n)
          var l = r, B = a;
        else
          var l = n.fromCompiled(r, a);
        this.grammar = l, this.options = {
          keepHistory: !1,
          lexer: l.lexer || new o()
        };
        for (var Q in B || {})
          this.options[Q] = B[Q];
        this.lexer = this.options.lexer, this.lexerState = void 0;
        var E = new i(l, 0);
        this.table = [E], E.wants[l.start] = [], E.predict(l.start), E.process(), this.current = 0;
      }
      g.fail = {}, g.prototype.feed = function(r) {
        var a = this.lexer;
        a.reset(r, this.lexerState);
        for (var C; ; ) {
          try {
            if (C = a.next(), !C)
              break;
          } catch (F) {
            var E = new i(this.grammar, this.current + 1);
            this.table.push(E);
            var B = new Error(this.reportLexerError(F));
            throw B.offset = this.current, B.token = F.token, B;
          }
          var l = this.table[this.current];
          this.options.keepHistory || delete this.table[this.current - 1];
          var Q = this.current + 1, E = new i(this.grammar, Q);
          this.table.push(E);
          for (var d = C.text !== void 0 ? C.text : C.value, m = a.constructor === o ? C.value : C, y = l.scannable, f = y.length; f--; ) {
            var w = y[f], G = w.rule.symbols[w.dot];
            if (G.test ? G.test(m) : G.type ? G.type === C.type : G.literal === d) {
              var R = w.nextState({ data: m, token: C, isToken: !0, reference: Q - 1 });
              E.states.push(R);
            }
          }
          if (E.process(), E.states.length === 0) {
            var B = new Error(this.reportError(C));
            throw B.offset = this.current, B.token = C, B;
          }
          this.options.keepHistory && (l.lexerState = a.save()), this.current++;
        }
        return l && (this.lexerState = a.save()), this.results = this.finish(), this;
      }, g.prototype.reportLexerError = function(r) {
        var a, C, B = r.token;
        return B ? (a = "input " + JSON.stringify(B.text[0]) + " (lexer error)", C = this.lexer.formatError(B, "Syntax error")) : (a = "input (lexer error)", C = r.message), this.reportErrorCommon(C, a);
      }, g.prototype.reportError = function(r) {
        var a = (r.type ? r.type + " token: " : "") + JSON.stringify(r.value !== void 0 ? r.value : r), C = this.lexer.formatError(r, "Syntax error");
        return this.reportErrorCommon(C, a);
      }, g.prototype.reportErrorCommon = function(r, a) {
        var C = [];
        C.push(r);
        var B = this.table.length - 2, l = this.table[B], Q = l.states.filter(function(d) {
          var m = d.rule.symbols[d.dot];
          return m && typeof m != "string";
        });
        if (Q.length === 0)
          C.push("Unexpected " + a + `. I did not expect any more input. Here is the state of my parse table:
`), this.displayStateStack(l.states, C);
        else {
          C.push("Unexpected " + a + `. Instead, I was expecting to see one of the following:
`);
          var E = Q.map(function(d) {
            return this.buildFirstStateStack(d, []) || [d];
          }, this);
          E.forEach(function(d) {
            var m = d[0], y = m.rule.symbols[m.dot], f = this.getSymbolDisplay(y);
            C.push("A " + f + " based on:"), this.displayStateStack(d, C);
          }, this);
        }
        return C.push(""), C.join(`
`);
      }, g.prototype.displayStateStack = function(r, a) {
        for (var C, B = 0, l = 0; l < r.length; l++) {
          var Q = r[l], E = Q.rule.toString(Q.dot);
          E === C ? B++ : (B > 0 && a.push("    ^ " + B + " more lines identical to this"), B = 0, a.push("    " + E)), C = E;
        }
      }, g.prototype.getSymbolDisplay = function(r) {
        return s(r);
      }, g.prototype.buildFirstStateStack = function(r, a) {
        if (a.indexOf(r) !== -1)
          return null;
        if (r.wantedBy.length === 0)
          return [r];
        var C = r.wantedBy[0], B = [r].concat(a), l = this.buildFirstStateStack(C, B);
        return l === null ? null : [r].concat(l);
      }, g.prototype.save = function() {
        var r = this.table[this.current];
        return r.lexerState = this.lexerState, r;
      }, g.prototype.restore = function(r) {
        var a = r.index;
        this.current = a, this.table[a] = r, this.table.splice(a + 1), this.lexerState = r.lexerState, this.results = this.finish();
      }, g.prototype.rewind = function(r) {
        if (!this.options.keepHistory)
          throw new Error("set option `keepHistory` to enable rewinding");
        this.restore(this.table[r]);
      }, g.prototype.finish = function() {
        var r = [], a = this.grammar.start, C = this.table[this.table.length - 1];
        return C.states.forEach(function(B) {
          B.rule.name === a && B.dot === B.rule.symbols.length && B.reference === 0 && B.data !== g.fail && r.push(B);
        }), r.map(function(B) {
          return B.data;
        });
      };
      function s(r) {
        var a = typeof r;
        if (a === "string")
          return r;
        if (a === "object") {
          if (r.literal)
            return JSON.stringify(r.literal);
          if (r instanceof RegExp)
            return "character matching " + r;
          if (r.type)
            return r.type + " token";
          if (r.test)
            return "token matching " + String(r.test);
          throw new Error("Unknown symbol type: " + r);
        }
      }
      function I(r) {
        var a = typeof r;
        if (a === "string")
          return r;
        if (a === "object") {
          if (r.literal)
            return JSON.stringify(r.literal);
          if (r instanceof RegExp)
            return r.toString();
          if (r.type)
            return "%" + r.type;
          if (r.test)
            return "<" + String(r.test) + ">";
          throw new Error("Unknown symbol type: " + r);
        }
      }
      return {
        Parser: g,
        Grammar: n,
        Rule: e
      };
    });
  }(mlA)), mlA.exports;
}
(function(A) {
  (function(e, t) {
    for (var i in t)
      e[i] = t[i];
  })(
    A,
    /******/
    function(e) {
      var t = {};
      function i(n) {
        if (t[n])
          return t[n].exports;
        var o = t[n] = {
          /******/
          i: n,
          /******/
          l: !1,
          /******/
          exports: {}
          /******/
        };
        return e[n].call(o.exports, o, o.exports, i), o.l = !0, o.exports;
      }
      return i.m = e, i.c = t, i.d = function(n, o, g) {
        i.o(n, o) || Object.defineProperty(n, o, { enumerable: !0, get: g });
      }, i.r = function(n) {
        typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(n, "__esModule", { value: !0 });
      }, i.t = function(n, o) {
        if (o & 1 && (n = i(n)), o & 8 || o & 4 && typeof n == "object" && n && n.__esModule)
          return n;
        var g = /* @__PURE__ */ Object.create(null);
        if (i.r(g), Object.defineProperty(g, "default", { enumerable: !0, value: n }), o & 2 && typeof n != "string")
          for (var s in n)
            i.d(g, s, function(I) {
              return n[I];
            }.bind(null, s));
        return g;
      }, i.n = function(n) {
        var o = n && n.__esModule ? (
          /******/
          function() {
            return n.default;
          }
        ) : (
          /******/
          function() {
            return n;
          }
        );
        return i.d(o, "a", o), o;
      }, i.o = function(n, o) {
        return Object.prototype.hasOwnProperty.call(n, o);
      }, i.p = "", i(i.s = 7);
    }([
      /* 0 */
      /***/
      function(e, t) {
        e.exports = SBe();
      },
      /* 1 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.unbox = t.doubleQuoted = t.box = t.track = t.tracking = t.trackingComments = t.lexerAny = t.lexer = void 0;
        const n = i(0), o = i(3), g = {};
        for (const G of o.sqlKeywords)
          g["kw_" + G.toLowerCase()] = G;
        const s = (G) => {
          const R = (0, n.keywords)(G);
          return (F) => R(F.toUpperCase());
        };
        t.lexer = (0, n.compile)({
          word: {
            match: /[eE](?!')[A-Za-z0-9_]*|[a-df-zA-DF-Z_][A-Za-z0-9_]*/,
            type: s(g),
            value: (G) => G.toLowerCase()
          },
          wordQuoted: {
            match: /"(?:[^"\*]|"")+"/,
            type: () => "quoted_word",
            value: (G) => G.substring(1, G.length - 1)
          },
          string: {
            match: /'(?:[^']|\'\')*'/,
            value: (G) => G.substring(1, G.length - 1).replace(/''/g, "'")
          },
          eString: {
            match: /\b(?:e|E)'(?:[^'\\]|[\r\n\s]|(?:\\\s)|(?:\\\n)|(?:\\.)|(?:\'\'))+'/,
            value: (G) => G.substring(2, G.length - 1).replace(/''/g, "'").replace(/\\([\s\n])/g, (R, F) => F).replace(/\\./g, (R) => JSON.parse('"' + R + '"'))
          },
          qparam: {
            match: /\$\d+/
          },
          commentLine: /\-\-.*?$[\s\r\n]*/,
          commentFullOpen: /\/\*/,
          commentFullClose: /\*\/[\s\r\n]*/,
          star: "*",
          comma: ",",
          space: { match: /[\s\t\n\v\f\r]+/, lineBreaks: !0 },
          int: /\-?\d+(?![\.\d])/,
          float: /\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,
          // word: /[a-zA-Z][A-Za-z0-9_\-]*/,
          lparen: "(",
          rparen: ")",
          lbracket: "[",
          rbracket: "]",
          semicolon: ";",
          dot: /\.(?!\d)/,
          op_cast: "::",
          op_colon: ":",
          op_plus: "+",
          op_eq: "=",
          op_neq: {
            match: /(?:!=)|(?:\<\>)/,
            value: () => "!="
          },
          op_membertext: "->>",
          op_member: "->",
          op_minus: "-",
          op_div: /\//,
          op_not_ilike: /\!~~\*/,
          op_not_like: /\!~~/,
          op_ilike: /~~\*/,
          op_like: /~~/,
          op_mod: "%",
          op_exp: "^",
          op_additive: {
            // group other additive operators
            match: ["||", "-", "#-", "&&"]
          },
          op_compare: {
            // group other comparison operators
            // ... to add: "IN" and "NOT IN" that are matched by keywords
            match: [">", ">=", "<", "<=", "@>", "<@", "?", "?|", "?&", "#>>", ">>", "<<", "~", "~*", "!~", "!~*", "@@"]
          },
          ops_others: {
            // referenced as (any other operator) in https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-PRECEDENCE
            // see also https://www.postgresql.org/docs/9.0/functions-math.html
            match: ["|", "&", "^", "#"]
          },
          codeblock: {
            match: /\$\$(?:.|[\s\t\n\v\f\r])*?\$\$/s,
            lineBreaks: !0,
            value: (G) => G.substring(2, G.length - 2)
          }
        }), t.lexer.next = ((G) => () => {
          let R, F = null;
          for (; R = G.call(t.lexer); ) {
            if (R.type === "commentFullOpen") {
              if (F === null) {
                F = {
                  nested: 0,
                  offset: R.offset,
                  text: R.text
                };
                continue;
              }
              F.nested++;
            }
            if (F != null) {
              if (F.text += R.text, R.type === "commentFullClose") {
                if (F.nested === 0) {
                  I == null || I.push(r(F)), F = null;
                  continue;
                }
                F.nested--;
              }
              continue;
            }
            if (R.type !== "space") {
              if (R.type === "commentLine") {
                I == null || I.push(r(R));
                continue;
              }
              break;
            }
          }
          if (C && R) {
            const Z = R.offset, c = {
              start: Z,
              end: Z + R.text.length
            };
            R._location = c;
          }
          return R;
        })(t.lexer.next), t.lexerAny = t.lexer;
        let I = null;
        const r = ({ offset: G, text: R }) => ({
          _location: { start: G, end: G + R.length },
          comment: R
        });
        function a(G) {
          if (I)
            throw new Error("WAT ? Recursive comments tracking 🤔🤨 ?");
          try {
            I = [];
            const R = G();
            return { comments: I, ast: R };
          } finally {
            I = null;
          }
        }
        t.trackingComments = a;
        let C = !1;
        function B(G) {
          if (C)
            return G();
          try {
            return C = !0, G();
          } finally {
            C = !1;
          }
        }
        t.tracking = B;
        function l(G, R) {
          if (!C || !R || typeof R != "object")
            return R;
          const F = w(G, !0), Z = w(G, !1);
          if (!F || !Z)
            return R;
          if (F === Z)
            R._location = F;
          else {
            const c = {
              start: F.start,
              end: Z.end
            };
            R._location = c;
          }
          return R;
        }
        t.track = l;
        const Q = Symbol("_literal"), E = Symbol("_doublequoted");
        function d(G, R, F) {
          return !C && !F ? R : l(G, { [Q]: R, [E]: F });
        }
        t.box = d;
        function m(G) {
          return Array.isArray(G) && G.length === 1 && (G = m(G[0])), Array.isArray(G) && !G.length ? null : G;
        }
        function y(G) {
          const R = m(G);
          if (typeof G == "object" && R != null && R[E])
            return { doubleQuoted: !0 };
        }
        t.doubleQuoted = y;
        function f(G) {
          var R;
          return typeof G == "object" && (R = G == null ? void 0 : G[Q]) !== null && R !== void 0 ? R : G;
        }
        t.unbox = f;
        function w(G, R) {
          if (!G)
            return null;
          if (Array.isArray(G)) {
            const F = R ? 1 : -1;
            for (let Z = R ? 0 : G.length - 1; Z >= 0 && Z < G.length; Z += F) {
              const c = w(G[Z], R);
              if (c)
                return c;
            }
            return null;
          }
          return typeof G != "object" ? null : G._location;
        }
      },
      /* 2 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.AstDefaultMapper = t.arrayNilMap = t.assignChanged = t.astMapper = void 0;
        const n = i(6);
        function o(B) {
          const l = new r();
          return l.wrapped = B(l), l;
        }
        t.astMapper = o;
        function g(B, l) {
          if (!B)
            return B;
          let Q = !1;
          for (const E of Object.keys(l))
            if (B[E] !== l[E]) {
              Q = !0;
              break;
            }
          return Q ? (0, n.trimNullish)({
            ...B,
            ...l
          }, 0) : B;
        }
        t.assignChanged = g;
        function s(B, l) {
          if (!(B != null && B.length))
            return B;
          let Q = !1, E = B;
          for (let d = 0; d < B.length; d++) {
            const m = B[d], y = l(m);
            !Q && (!y || y !== m) && (Q = !0, E = B.slice(0, d)), y && Q && E.push(y);
          }
          return E;
        }
        t.arrayNilMap = s;
        function I(B) {
          switch (B == null ? void 0 : B.type) {
            case "select":
            case "delete":
            case "insert":
            case "update":
            case "union":
            case "union all":
            case "with":
              return !0;
            default:
              return !1;
          }
        }
        class r {
          super() {
            return new C(this);
          }
          statement(l) {
            switch (l.type) {
              case "alter table":
                return this.alterTable(l);
              case "alter index":
                return this.alterIndex(l);
              case "commit":
              case "start transaction":
              case "rollback":
                return this.transaction(l);
              case "create index":
                return this.createIndex(l);
              case "create table":
                return this.createTable(l);
              case "truncate table":
                return this.truncateTable(l);
              case "delete":
                return this.delete(l);
              case "insert":
                return this.insert(l);
              case "with":
                return this.with(l);
              case "with recursive":
                return this.withRecursive(l);
              case "select":
                return this.selection(l);
              case "update":
                return this.update(l);
              case "create extension":
                return this.createExtension(l);
              case "tablespace":
                return this.tablespace(l);
              case "set":
                return this.setGlobal(l);
              case "set timezone":
                return this.setTimezone(l);
              case "create sequence":
                return this.createSequence(l);
              case "alter sequence":
                return this.alterSequence(l);
              case "begin":
                return this.begin(l);
              case "drop table":
              case "drop index":
              case "drop sequence":
              case "drop type":
              case "drop trigger":
                return this.drop(l);
              case "create enum":
                return this.createEnum(l);
              case "create composite type":
                return this.createCompositeType(l);
              case "union":
              case "union all":
                return this.union(l);
              case "show":
                return this.show(l);
              case "prepare":
                return this.prepare(l);
              case "deallocate":
                return this.deallocate(l);
              case "create view":
                return this.createView(l);
              case "create materialized view":
                return this.createMaterializedView(l);
              case "refresh materialized view":
                return this.refreshMaterializedView(l);
              case "create schema":
                return this.createSchema(l);
              case "raise":
                return this.raise(l);
              case "comment":
                return this.comment(l);
              case "do":
                return this.do(l);
              case "create function":
                return this.createFunction(l);
              case "drop function":
                return this.dropFunction(l);
              case "values":
                return this.values(l);
              default:
                throw n.NotSupported.never(l);
            }
          }
          comment(l) {
            return l;
          }
          createView(l) {
            const Q = this.select(l.query);
            if (!Q)
              return null;
            const E = this.tableRef(l.name);
            return E ? g(l, {
              query: Q,
              name: E
            }) : null;
          }
          createMaterializedView(l) {
            const Q = this.select(l.query);
            if (!Q)
              return null;
            const E = this.tableRef(l.name);
            return E ? g(l, {
              query: Q,
              name: E
            }) : null;
          }
          refreshMaterializedView(l) {
            return l;
          }
          do(l) {
            return l;
          }
          createFunction(l) {
            const Q = s(l.arguments, (d) => {
              const m = this.dataType(d.type);
              return g(d, { type: m });
            });
            let E;
            if (l.returns)
              switch (l.returns.kind) {
                case "table":
                  E = g(l.returns, {
                    columns: s(l.returns.columns, (d) => {
                      const m = this.dataType(d.type);
                      return m && g(d, { type: m });
                    })
                  });
                  break;
                case void 0:
                case null:
                case "array":
                  E = this.dataType(l.returns);
                  break;
                default:
                  throw n.NotSupported.never(l.returns);
              }
            return g(l, {
              returns: E,
              arguments: Q
            });
          }
          dropFunction(l) {
            const Q = s(l.arguments, (E) => {
              const d = this.dataType(E.type);
              return g(E, { type: d });
            });
            return g(l, {
              arguments: Q
            });
          }
          show(l) {
            return l;
          }
          createEnum(l) {
            return l;
          }
          createCompositeType(l) {
            const Q = s(l.attributes, (E) => g(E, {
              dataType: this.dataType(E.dataType)
            }));
            return g(l, { attributes: Q });
          }
          drop(l) {
            return l;
          }
          alterSequence(l) {
            return l.change.type === "set options" && l.change.as && this.dataType(l.change.as), l;
          }
          begin(l) {
            return l;
          }
          createSequence(l) {
            return l.options.as && this.dataType(l.options.as), l;
          }
          tablespace(l) {
            return l;
          }
          setGlobal(l) {
            return l;
          }
          setTimezone(l) {
            return l;
          }
          update(l) {
            if (!l)
              return l;
            const Q = this.tableRef(l.table);
            if (!Q)
              return null;
            const E = l.from && this.from(l.from), d = l.where && this.expr(l.where), m = s(l.sets, (f) => this.set(f));
            if (!(m != null && m.length))
              return null;
            const y = s(l.returning, (f) => this.selectionColumn(f));
            return g(l, {
              table: Q,
              where: d,
              sets: m,
              from: E,
              returning: y
            });
          }
          insert(l) {
            var Q, E;
            const d = this.tableRef(l.into);
            if (!d)
              return null;
            const m = l.insert && this.select(l.insert);
            if (!m)
              return null;
            const y = s(l.returning, (G) => this.selectionColumn(G));
            let f = (Q = l.onConflict) === null || Q === void 0 ? void 0 : Q.on;
            switch (f == null ? void 0 : f.type) {
              case "on constraint":
                break;
              case "on expr":
                f = g(f, {
                  exprs: s(f.exprs, (G) => this.expr(G))
                });
                break;
              case null:
              case void 0:
                break;
              default:
                throw n.NotSupported.never(f);
            }
            let w = (E = l.onConflict) === null || E === void 0 ? void 0 : E.do;
            if (w && w !== "do nothing") {
              const G = s(w.sets, (R) => this.set(R));
              G != null && G.length ? w.sets !== G && (w = { sets: G }) : w = "do nothing";
            }
            return g(l, {
              into: d,
              insert: m,
              returning: y,
              onConflict: w ? g(l.onConflict, {
                do: w,
                on: f
              }) : l.onConflict
            });
          }
          raise(l) {
            return g(l, {
              formatExprs: l.formatExprs && s(l.formatExprs, (Q) => this.expr(Q)),
              using: l.using && s(l.using, (Q) => g(Q, {
                value: this.expr(Q.value)
              }))
            });
          }
          delete(l) {
            const Q = this.tableRef(l.from);
            if (!Q)
              return null;
            const E = l.where && this.expr(l.where), d = s(l.returning, (m) => this.selectionColumn(m));
            return g(l, {
              where: E,
              returning: d,
              from: Q
            });
          }
          createSchema(l) {
            return l;
          }
          createTable(l) {
            const Q = s(l.columns, (E) => {
              switch (E.kind) {
                case "column":
                  return this.createColumn(E);
                case "like table":
                  return this.likeTable(E);
                default:
                  throw n.NotSupported.never(E);
              }
            });
            return Q != null && Q.length ? g(l, {
              columns: Q
            }) : null;
          }
          likeTable(l) {
            const Q = this.tableRef(l.like);
            return Q ? g(l, { like: Q }) : null;
          }
          truncateTable(l) {
            return l;
          }
          constraint(l) {
            switch (l.type) {
              case "not null":
              case "null":
              case "primary key":
              case "unique":
              case "add generated":
                return l;
              case "default": {
                const Q = this.expr(l.default);
                return Q ? g(l, {
                  default: Q
                }) : null;
              }
              case "check": {
                const Q = this.expr(l.expr);
                return Q ? g(l, {
                  expr: Q
                }) : null;
              }
              case "reference": {
                const Q = this.tableRef(l.foreignTable);
                return Q ? g(l, {
                  foreignTable: Q
                }) : null;
              }
              default:
                throw n.NotSupported.never(l);
            }
          }
          set(l) {
            const Q = this.expr(l.value);
            return Q ? g(l, {
              value: Q
            }) : null;
          }
          // =========================================
          // ================ STUFF ==================
          // =========================================
          /** Called when a data type definition is encountered */
          dataType(l) {
            return l;
          }
          /** Called when an alias of a table is created */
          tableRef(l) {
            return l;
          }
          transaction(l) {
            return l;
          }
          createExtension(l) {
            return l;
          }
          createIndex(l) {
            const Q = s(l.expressions, (E) => {
              const d = this.expr(E.expression);
              return d === E.expression ? E : d ? {
                ...E,
                expression: d
              } : null;
            });
            return Q != null && Q.length ? g(l, {
              expressions: Q
            }) : null;
          }
          prepare(l) {
            const Q = this.statement(l.statement);
            return Q ? g(l, {
              args: s(l.args, (E) => this.dataType(E)),
              statement: Q
            }) : null;
          }
          deallocate(l) {
            return l;
          }
          // =========================================
          // ============== ALTER INDEX ==============
          // =========================================
          alterIndex(l) {
            return l;
          }
          // =========================================
          // ============== ALTER TABLE ==============
          // =========================================
          alterTable(l) {
            var Q;
            const E = this.tableRef(l.table);
            if (!E)
              return null;
            let d = [], m = !1;
            for (let y = 0; y < (((Q = l.changes) === null || Q === void 0 ? void 0 : Q.length) || 0); y++) {
              const f = l.changes[y], w = this.tableAlteration(f, l.table);
              m = m || w != f, w && d.push(w);
            }
            return d.length ? m ? g(l, {
              table: E,
              changes: d
            }) : l : null;
          }
          tableAlteration(l, Q) {
            switch (l.type) {
              case "add column":
                return this.addColumn(l, Q);
              case "add constraint":
                return this.addConstraint(l, Q);
              case "alter column":
                return this.alterColumn(l, Q);
              case "rename":
                return this.renameTable(l, Q);
              case "rename column":
                return this.renameColumn(l, Q);
              case "rename constraint":
                return this.renameConstraint(l, Q);
              case "drop column":
                return this.dropColumn(l, Q);
              case "drop constraint":
                return this.dropConstraint(l, Q);
              case "owner":
                return this.setTableOwner(l, Q);
              default:
                throw n.NotSupported.never(l);
            }
          }
          dropColumn(l, Q) {
            return l;
          }
          dropConstraint(l, Q) {
            return l;
          }
          setTableOwner(l, Q) {
            return l;
          }
          renameConstraint(l, Q) {
            return l;
          }
          renameColumn(l, Q) {
            return l;
          }
          renameTable(l, Q) {
            return l;
          }
          alterColumn(l, Q) {
            let E;
            switch (l.alter.type) {
              case "set default":
                E = this.setColumnDefault(l.alter, Q, l.column);
                break;
              case "set type":
                E = this.setColumnType(l.alter, Q, l.column);
                break;
              case "drop default":
              case "set not null":
              case "drop not null":
                E = this.alterColumnSimple(l.alter, Q, l.column);
                break;
              case "add generated":
                E = this.alterColumnAddGenerated(l.alter, Q, l.column);
                break;
              default:
                throw n.NotSupported.never(l.alter);
            }
            return E ? g(l, {
              alter: E
            }) : null;
          }
          setColumnType(l, Q, E) {
            const d = this.dataType(l.dataType);
            return g(l, {
              dataType: d
            });
          }
          alterColumnAddGenerated(l, Q, E) {
            return l;
          }
          alterColumnSimple(l, Q, E) {
            return l;
          }
          setColumnDefault(l, Q, E) {
            const d = this.expr(l.default);
            return d ? g(l, {
              default: d
            }) : null;
          }
          addConstraint(l, Q) {
            return l;
          }
          addColumn(l, Q) {
            const E = this.createColumn(l.column);
            return E ? g(l, {
              column: E
            }) : null;
          }
          createColumn(l) {
            var Q;
            const E = this.dataType(l.dataType);
            if (!E)
              return null;
            const d = (Q = s(l.constraints, (m) => this.constraint(m))) !== null && Q !== void 0 ? Q : void 0;
            return g(l, {
              dataType: E,
              constraints: d
            });
          }
          // =========================================
          // ============== SELECTIONS ==============
          // =========================================
          select(l) {
            switch (l.type) {
              case "select":
                return this.selection(l);
              case "union":
              case "union all":
                return this.union(l);
              case "with":
                return this.with(l);
              case "values":
                return this.values(l);
              case "with recursive":
                return this.withRecursive(l);
              default:
                throw n.NotSupported.never(l);
            }
          }
          selection(l) {
            var Q, E;
            const d = s(l.from, (F) => this.from(F)), m = s(l.columns, (F) => this.selectionColumn(F)), y = l.where && this.expr(l.where), f = s(l.groupBy, (F) => this.expr(F)), w = l.having && this.expr(l.having), G = this.orderBy(l.orderBy), R = g(l.limit, {
              limit: this.expr((Q = l.limit) === null || Q === void 0 ? void 0 : Q.limit),
              offset: this.expr((E = l.limit) === null || E === void 0 ? void 0 : E.offset)
            });
            return g(l, {
              from: d,
              columns: m,
              where: y,
              groupBy: f,
              having: w,
              orderBy: G,
              limit: R
            });
          }
          orderBy(l) {
            return s(l, (Q) => {
              const E = this.expr(Q.by);
              return E ? E === Q.by ? Q : {
                ...Q,
                by: E
              } : null;
            });
          }
          union(l) {
            const Q = this.select(l.left), E = this.select(l.right);
            return !Q || !E ? Q ?? E : g(l, {
              left: Q,
              right: E
            });
          }
          with(l) {
            const Q = s(l.bind, (d) => {
              const m = this.statement(d.statement);
              return I(m) ? g(d, { statement: m }) : null;
            });
            if (!Q)
              return null;
            const E = this.statement(l.in);
            return I(E) ? g(l, {
              bind: Q,
              in: E
            }) : null;
          }
          withRecursive(l) {
            const Q = this.union(l.bind);
            if (!Q || Q.type !== "union" && Q.type !== "union all")
              return null;
            const E = this.statement(l.in);
            return I(E) ? g(l, {
              bind: Q,
              in: E
            }) : null;
          }
          from(l) {
            switch (l.type) {
              case "table":
                return this.fromTable(l);
              case "statement":
                return this.fromStatement(l);
              case "call":
                return this.fromCall(l);
              default:
                throw n.NotSupported.never(l);
            }
          }
          fromCall(l) {
            const Q = this.call(l);
            return !Q || Q.type !== "call" ? null : g(l, Q);
          }
          fromStatement(l) {
            const Q = this.select(l.statement);
            if (!Q)
              return null;
            const E = l.join && this.join(l.join);
            return g(l, {
              statement: Q,
              join: E
            });
          }
          values(l) {
            const Q = s(l.values, (E) => s(E, (d) => this.expr(d)));
            return Q != null && Q.length ? g(l, {
              values: Q
            }) : null;
          }
          join(l) {
            const Q = l.on && this.expr(l.on);
            return !Q && !l.using ? l : g(l, {
              on: Q
            });
          }
          fromTable(l) {
            const Q = this.tableRef(l.name);
            if (!Q)
              return null;
            const E = l.join && this.join(l.join);
            return g(l, {
              name: Q,
              join: E
            });
          }
          selectionColumn(l) {
            const Q = this.expr(l.expr);
            return Q ? g(l, {
              expr: Q
            }) : null;
          }
          // =========================================
          // ============== EXPRESSIONS ==============
          // =========================================
          expr(l) {
            if (!l)
              return l;
            switch (l.type) {
              case "binary":
                return this.binary(l);
              case "unary":
                return this.unary(l);
              case "ref":
                return this.ref(l);
              case "string":
              case "numeric":
              case "integer":
              case "boolean":
              case "constant":
              case "null":
                return this.constant(l);
              case "list":
              case "array":
                return this.array(l);
              case "array select":
                return this.arraySelect(l);
              case "call":
                return this.call(l);
              case "cast":
                return this.cast(l);
              case "case":
                return this.case(l);
              case "member":
                return this.member(l);
              case "arrayIndex":
                return this.arrayIndex(l);
              case "ternary":
                return this.ternary(l);
              case "select":
              case "union":
              case "union all":
              case "with":
              case "with recursive":
                return this.select(l);
              case "keyword":
                return this.valueKeyword(l);
              case "parameter":
                return this.parameter(l);
              case "extract":
                return this.extract(l);
              case "overlay":
                return this.callOverlay(l);
              case "substring":
                return this.callSubstring(l);
              case "values":
                return this.values(l);
              case "default":
                return this.default(l);
              default:
                throw n.NotSupported.never(l);
            }
          }
          arraySelect(l) {
            const Q = this.select(l.select);
            return Q ? g(l, { select: Q }) : null;
          }
          extract(l) {
            const Q = this.expr(l.from);
            return Q ? g(l, { from: Q }) : null;
          }
          valueKeyword(l) {
            return l;
          }
          ternary(l) {
            const Q = this.expr(l.value), E = this.expr(l.lo), d = this.expr(l.hi);
            return !Q || !E || !d ? null : g(l, {
              value: Q,
              lo: E,
              hi: d
            });
          }
          parameter(l) {
            return l;
          }
          arrayIndex(l) {
            const Q = this.expr(l.array), E = this.expr(l.index);
            return !Q || !E ? null : g(l, {
              array: Q,
              index: E
            });
          }
          member(l) {
            const Q = this.expr(l.operand);
            return Q ? g(l, {
              operand: Q
            }) : null;
          }
          case(l) {
            const Q = l.value && this.expr(l.value), E = s(l.whens, (m) => {
              const y = this.expr(m.when), f = this.expr(m.value);
              return !y || !f ? null : g(m, {
                value: f,
                when: y
              });
            });
            if (!(E != null && E.length))
              return null;
            const d = l.else && this.expr(l.else);
            return g(l, {
              value: Q,
              whens: E,
              else: d
            });
          }
          cast(l) {
            const Q = this.expr(l.operand);
            return Q ? g(l, {
              operand: Q
            }) : null;
          }
          call(l) {
            const Q = s(l.args, (m) => this.expr(m));
            if (!Q)
              return null;
            const E = this.orderBy(l.orderBy), d = this.expr(l.filter);
            return g(l, {
              args: Q,
              orderBy: E,
              filter: d
            });
          }
          callSubstring(l) {
            return g(l, {
              value: this.expr(l.value),
              from: this.expr(l.from),
              for: this.expr(l.for)
            });
          }
          callOverlay(l) {
            return g(l, {
              value: this.expr(l.value),
              placing: this.expr(l.placing),
              from: this.expr(l.from),
              for: this.expr(l.for)
            });
          }
          array(l) {
            const Q = s(l.expressions, (E) => this.expr(E));
            return Q ? g(l, {
              expressions: Q
            }) : null;
          }
          constant(l) {
            return l;
          }
          default(l) {
            return l;
          }
          /** Called when a reference is used */
          ref(l) {
            return l;
          }
          unary(l) {
            const Q = this.expr(l.operand);
            return Q ? g(l, {
              operand: Q
            }) : null;
          }
          binary(l) {
            const Q = this.expr(l.left), E = this.expr(l.right);
            return !Q || !E ? null : g(l, {
              left: Q,
              right: E
            });
          }
        }
        t.AstDefaultMapper = r;
        const a = r.prototype;
        for (const B of Object.getOwnPropertyNames(a)) {
          const l = a[B];
          B === "constructor" || B === "super" || typeof l != "function" || Object.defineProperty(a, B, {
            configurable: !1,
            get() {
              return function(...Q) {
                var E;
                if (this.skipNext)
                  return this.skipNext = !1, l.apply(this, Q);
                const d = (E = this.wrapped) === null || E === void 0 ? void 0 : E[B];
                return d ? d.apply(this.wrapped, Q) : l.apply(this, Q);
              };
            }
          });
        }
        class C extends r {
          constructor(l) {
            super(), this.parent = l;
          }
        }
        for (const B of Object.getOwnPropertyNames(a)) {
          const l = a[B];
          B === "constructor" || B === "super" || typeof l != "function" || Object.defineProperty(C.prototype, B, {
            configurable: !1,
            get() {
              return function(...Q) {
                return this.parent.skipNext = !0, l.apply(this.parent, Q);
              };
            }
          });
        }
      },
      /* 3 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.sqlKeywords = void 0, t.sqlKeywords = [
          "ALL",
          "ANALYSE",
          "ANALYZE",
          "AND",
          "ANY",
          "ARRAY",
          "AS",
          "ASC",
          "ASYMMETRIC",
          "AUTHORIZATION",
          "BINARY",
          "BOTH",
          "CASE",
          "CAST",
          "CHECK",
          "COLLATE",
          "COLLATION",
          "CONCURRENTLY",
          "CONSTRAINT",
          "CREATE",
          "CROSS",
          "CURRENT_CATALOG",
          "CURRENT_DATE",
          "CURRENT_ROLE",
          "CURRENT_SCHEMA",
          "CURRENT_TIME",
          "CURRENT_TIMESTAMP",
          "CURRENT_USER",
          "DEFAULT",
          "DEFERRABLE",
          "DESC",
          "DISTINCT",
          "DO",
          "ELSE",
          "END",
          "EXCEPT",
          "FALSE",
          "FETCH",
          "FOR",
          "FOREIGN",
          "FREEZE",
          "FROM",
          "FULL",
          "GRANT",
          "GROUP",
          "HAVING",
          "ILIKE",
          "IN",
          "INITIALLY",
          "INNER",
          "INTERSECT",
          "INTO",
          "IS",
          "ISNULL",
          "JOIN",
          "LATERAL",
          "LEADING",
          "LEFT",
          "LIKE",
          "LIMIT",
          "LOCALTIME",
          "LOCALTIMESTAMP",
          "NATURAL",
          "NOT",
          "NOTNULL",
          "NULL",
          "OFFSET",
          "ON",
          "ONLY",
          "OR",
          "ORDER",
          "OUTER",
          "OVERLAPS",
          "PLACING",
          "PRIMARY",
          "REFERENCES",
          "RETURNING",
          "RIGHT",
          "SELECT",
          "SESSION_USER",
          "SIMILAR",
          "SOME",
          "SYMMETRIC",
          "TABLE",
          "TABLESAMPLE",
          "THEN",
          "TO",
          "TRAILING",
          "TRUE",
          "UNION",
          "UNIQUE",
          "USER",
          "USING",
          "VARIADIC",
          "VERBOSE",
          "WHEN",
          "WHERE",
          "WINDOW",
          "WITH",
          "PRECISION"
        ];
      },
      /* 4 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.intervalToString = t.normalizeInterval = t.buildInterval = void 0;
        const n = [
          ["years", 12],
          ["months", 30],
          ["days", 24],
          ["hours", 60],
          ["minutes", 60],
          ["seconds", 1e3],
          ["milliseconds", 0]
        ];
        function* o(C) {
          if (typeof C[1] == "number")
            yield C;
          else
            for (const B of C)
              yield* o(B);
        }
        function g(C, B) {
          var l;
          const Q = {};
          if (B === "invalid")
            throw new Error(`invalid input syntax for type interval: "${C}"`);
          for (const [E, d] of o(B))
            Q[E] = ((l = Q[E]) !== null && l !== void 0 ? l : 0) + d;
          return Q;
        }
        t.buildInterval = g;
        function s(C) {
          var B, l, Q, E, d, m, y, f, w;
          const G = { ...C };
          for (let Z = 0; Z < n.length; Z++) {
            const [c, J] = n[Z], p = (B = G[c]) !== null && B !== void 0 ? B : 0, N = p >= 0 ? Math.floor(p) : Math.ceil(p);
            if (!p || N === p)
              continue;
            const v = (l = n[Z + 1]) === null || l === void 0 ? void 0 : l[0];
            v && (G[v] = ((Q = G[v]) !== null && Q !== void 0 ? Q : 0) + J * (p - N)), G[c] = N;
          }
          if (G.months || G.years) {
            const Z = ((E = G.months) !== null && E !== void 0 ? E : 0) + ((d = G.years) !== null && d !== void 0 ? d : 0) * 12;
            G.months = Z % 12, G.years = (Z - G.months) / 12;
          }
          let R = ((m = G.hours) !== null && m !== void 0 ? m : 0) * 3600 + ((y = G.minutes) !== null && y !== void 0 ? y : 0) * 60 + ((f = G.seconds) !== null && f !== void 0 ? f : 0) + ((w = G.milliseconds) !== null && w !== void 0 ? w : 0) / 1e3, F = 1;
          R < 0 && (F = -1, R = -R), R >= 3600 ? (G.hours = F * Math.floor(R / 3600), R -= F * G.hours * 3600) : delete G.hours, R >= 60 ? (G.minutes = F * Math.floor(R / 60), R -= F * G.minutes * 60) : delete G.minutes, R > 0 ? (G.seconds = F * Math.floor(R), R -= F * G.seconds) : delete G.seconds, R > 0 ? G.milliseconds = F * Math.round(R * 1e3) : delete G.milliseconds;
          for (const [Z] of n)
            G[Z] || delete G[Z];
          return G;
        }
        t.normalizeInterval = s;
        function I(C) {
          var B, l, Q;
          C = s(C);
          const E = [];
          if (C.years && E.push(C.years === 1 ? "1 year" : C.years + " years"), C.months && E.push(C.months === 1 ? "1 month" : C.months + " months"), C.days && E.push(C.days === 1 ? "1 day" : C.days + " days"), C.hours || C.minutes || C.seconds || C.milliseconds) {
            let d = `${r((B = C.hours) !== null && B !== void 0 ? B : 0)}:${r((l = C.minutes) !== null && l !== void 0 ? l : 0)}:${r((Q = C.seconds) !== null && Q !== void 0 ? Q : 0)}`;
            C.milliseconds && (d = d + (C.milliseconds / 1e3).toString().substr(1)), (a(C.hours) || a(C.minutes) || a(C.seconds) || a(C.milliseconds)) && (d = "-" + d), E.push(d);
          }
          return E.join(" ");
        }
        t.intervalToString = I;
        function r(C) {
          return C = Math.abs(C), C < 10 ? "0" + C : C.toString();
        }
        function a(C) {
          return C && C < 0;
        }
      },
      /* 5 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.astVisitor = void 0;
        const n = i(2);
        class o {
          super() {
            return new s(this);
          }
        }
        const g = n.AstDefaultMapper.prototype;
        for (const r of Object.getOwnPropertyNames(g)) {
          const a = g[r];
          r === "constructor" || r === "super" || typeof a != "function" || Object.defineProperty(o.prototype, r, {
            configurable: !1,
            get() {
              return function(...C) {
                const B = this.visitor[r];
                return B ? (B.apply(this.visitor, C), C[0]) : a.apply(this, C);
              };
            }
          });
        }
        class s {
          constructor(a) {
            this.parent = a;
          }
        }
        for (const r of Object.getOwnPropertyNames(g)) {
          const a = g[r];
          r === "constructor" || r === "super" || typeof a != "function" || Object.defineProperty(s.prototype, r, {
            configurable: !1,
            get() {
              return function(...C) {
                return a.apply(this.parent, C);
              };
            }
          });
        }
        function I(r) {
          return (0, n.astMapper)((a) => {
            const C = new o();
            return C.mapper = a, C.visitor = r(C), C;
          });
        }
        t.astVisitor = I;
      },
      /* 6 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.trimNullish = t.NotSupported = void 0;
        class n extends Error {
          constructor(s) {
            super("Not supported" + (s ? ": " + s : ""));
          }
          static never(s, I) {
            return new n(`${I ?? ""} ${JSON.stringify(s)}`);
          }
        }
        t.NotSupported = n;
        function o(g, s = 5) {
          if (s < 0 || (g instanceof Array && g.forEach((I) => o(I, s - 1)), typeof g != "object" || g instanceof Date) || !g)
            return g;
          for (const I of Object.keys(g)) {
            const r = g[I];
            r == null ? delete g[I] : o(r, s - 1);
          }
          return g;
        }
        t.trimNullish = o;
      },
      /* 7 */
      /***/
      function(e, t, i) {
        var n = this && this.__createBinding || (Object.create ? function(C, B, l, Q) {
          Q === void 0 && (Q = l);
          var E = Object.getOwnPropertyDescriptor(B, l);
          (!E || ("get" in E ? !B.__esModule : E.writable || E.configurable)) && (E = { enumerable: !0, get: function() {
            return B[l];
          } }), Object.defineProperty(C, Q, E);
        } : function(C, B, l, Q) {
          Q === void 0 && (Q = l), C[Q] = B[l];
        }), o = this && this.__exportStar || function(C, B) {
          for (var l in C)
            l !== "default" && !Object.prototype.hasOwnProperty.call(B, l) && n(B, C, l);
        };
        Object.defineProperty(t, "__esModule", { value: !0 }), t.normalizeInterval = t.intervalToString = t.toSql = t.astMapper = t.assignChanged = t.arrayNilMap = t.astVisitor = t.parseWithComments = t.parseIntervalLiteral = t.parseGeometricLiteral = t.parseArrayLiteral = t.parseFirst = t.parse = void 0;
        var g = i(8);
        Object.defineProperty(t, "parse", { enumerable: !0, get: function() {
          return g.parse;
        } }), Object.defineProperty(t, "parseFirst", { enumerable: !0, get: function() {
          return g.parseFirst;
        } }), Object.defineProperty(t, "parseArrayLiteral", { enumerable: !0, get: function() {
          return g.parseArrayLiteral;
        } }), Object.defineProperty(t, "parseGeometricLiteral", { enumerable: !0, get: function() {
          return g.parseGeometricLiteral;
        } }), Object.defineProperty(t, "parseIntervalLiteral", { enumerable: !0, get: function() {
          return g.parseIntervalLiteral;
        } }), Object.defineProperty(t, "parseWithComments", { enumerable: !0, get: function() {
          return g.parseWithComments;
        } });
        var s = i(5);
        Object.defineProperty(t, "astVisitor", { enumerable: !0, get: function() {
          return s.astVisitor;
        } });
        var I = i(2);
        Object.defineProperty(t, "arrayNilMap", { enumerable: !0, get: function() {
          return I.arrayNilMap;
        } }), Object.defineProperty(t, "assignChanged", { enumerable: !0, get: function() {
          return I.assignChanged;
        } }), Object.defineProperty(t, "astMapper", { enumerable: !0, get: function() {
          return I.astMapper;
        } });
        var r = i(19);
        Object.defineProperty(t, "toSql", { enumerable: !0, get: function() {
          return r.toSql;
        } }), o(i(21), t);
        var a = i(4);
        Object.defineProperty(t, "intervalToString", { enumerable: !0, get: function() {
          return a.intervalToString;
        } }), Object.defineProperty(t, "normalizeInterval", { enumerable: !0, get: function() {
          return a.normalizeInterval;
        } });
      },
      /* 8 */
      /***/
      function(e, t, i) {
        var n = this && this.__importDefault || function(c) {
          return c && c.__esModule ? c : { default: c };
        };
        Object.defineProperty(t, "__esModule", { value: !0 }), t.parseGeometricLiteral = t.parseIntervalLiteral = t.parseArrayLiteral = t.parse = t.parseWithComments = t.parseFirst = void 0;
        const o = i(9), g = n(i(10)), s = n(i(11)), I = n(i(13)), r = n(i(15)), a = n(i(17)), C = i(4), B = i(1);
        let l, Q, E, d, m;
        function y(c) {
          return w(c)[0];
        }
        t.parseFirst = y;
        function f(c, J) {
          return (0, B.trackingComments)(() => w(c, J));
        }
        t.parseWithComments = f;
        function w(c, J) {
          l || (l = o.Grammar.fromCompiled(g.default));
          const p = typeof J == "string" ? J : J == null ? void 0 : J.entry, N = typeof J == "string" ? null : J, v = () => Z(c, l, p);
          let K = N != null && N.locationTracking ? (0, B.tracking)(v) : v();
          return typeof J != "string" && !Array.isArray(K) && (K = [K]), K;
        }
        t.parse = w;
        function G(c) {
          return Q || (Q = o.Grammar.fromCompiled(s.default)), Z(c, Q);
        }
        t.parseArrayLiteral = G;
        function R(c) {
          if (c.startsWith("P"))
            return m || (m = o.Grammar.fromCompiled(a.default)), (0, C.buildInterval)(c, Z(c, m));
          {
            d || (d = o.Grammar.fromCompiled(r.default));
            const J = c.toLowerCase();
            return (0, C.buildInterval)(c, Z(J, d));
          }
        }
        t.parseIntervalLiteral = R;
        function F(c, J) {
          return E || (E = o.Grammar.fromCompiled(I.default)), Z(c, E, J);
        }
        t.parseGeometricLiteral = F;
        function Z(c, J, p) {
          try {
            J.start = p ?? "main";
            const N = new o.Parser(J);
            N.feed(c);
            const v = N.finish();
            if (v.length) {
              if (v.length !== 1)
                throw new Error(`💀 Ambiguous SQL syntax: Please file an issue stating the request that has failed at https://github.com/oguimbal/pgsql-ast-parser:

        ${c}

        `);
            } else
              throw new Error("Unexpected end of input");
            return v[0];
          } catch (N) {
            if (typeof (N == null ? void 0 : N.message) != "string")
              throw N;
            let v = N.message, K = null;
            const U = [], j = /A (.+) token based on:/g;
            let q;
            for (; q = j.exec(v); )
              K = K ?? v.substr(0, q.index), U.push(`    - A "${q[1]}" token`);
            throw K && (v = K + U.join(`
`) + `

`), N.message = v, N;
          }
        }
      },
      /* 9 */
      /***/
      function(e, t) {
        e.exports = ZBe();
      },
      /* 10 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(c) {
          return c[0];
        }
        const o = i(1), g = i(1);
        function s(c) {
          return I(c, void 0);
        }
        function I(c, J) {
          const p = d(c);
          return !J || J.length === 0 ? (0, g.track)(c, { name: p }) : (0, g.track)(c, {
            name: p,
            columns: J.map((N) => ({ name: d(N) }))
          });
        }
        function r(c) {
          const J = d(c);
          return (0, g.track)(c, { value: J });
        }
        function a(c) {
          return Array.isArray(c) && c.length === 1 && (c = a(c[0])), Array.isArray(c) && !c.length ? null : (0, g.unbox)(c);
        }
        const C = (c) => (J) => (0, g.track)(J, J[c]), B = (c) => Array.isArray(c) ? (0, g.track)(c[c.length - 1], c[c.length - 1]) : c;
        function l(c) {
          if (Array.isArray(c)) {
            const J = [];
            for (const p of c)
              J.push(...l(p));
            return J;
          }
          return c ? [c] : [];
        }
        function Q(c) {
          var J;
          return c = (0, g.unbox)(c), (J = c == null ? void 0 : c.value) !== null && J !== void 0 ? J : c;
        }
        function E(c) {
          return l((0, g.unbox)(c)).filter((J) => !!J).map((J) => Q(J)).filter((J) => typeof J == "string").map((J) => J.trim()).filter((J) => !!J);
        }
        function d(c, J) {
          return E(c).join(J || "");
        }
        function m(c) {
          const J = {};
          for (const [p, N] of c)
            J[p] = N;
          return J;
        }
        const y = { sensitivity: "accent" }, f = (c, J) => c.localeCompare(J, void 0, y) === 0, w = (c) => (J, p, N) => {
          const v = Q(J[0]);
          return f(v, c) ? (0, g.box)(J, c) : N;
        }, G = w, R = (...c) => {
          const J = new Set(c);
          return (p, N, v) => {
            const K = typeof p[0] == "string" ? p[0] : p[0].value;
            return J.has(K) ? K : v;
          };
        };
        function F(c, J) {
          const p = /* @__PURE__ */ new Set(), N = J.map(g.unbox);
          for (const [v, K] of N) {
            if (p.has(v))
              throw new Error("conflicting or redundant options");
            p.add(v), c[v] = (0, g.unbox)(K);
          }
        }
        const Z = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "lparen", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen] },
            { name: "rparen", symbols: [o.lexerAny.has("rparen") ? { type: "rparen" } : rparen] },
            { name: "number$subexpression$1", symbols: ["float"] },
            { name: "number$subexpression$1", symbols: ["int"] },
            { name: "number", symbols: ["number$subexpression$1"], postprocess: a },
            { name: "dot", symbols: [o.lexerAny.has("dot") ? { type: "dot" } : dot], postprocess: n },
            { name: "float", symbols: [o.lexerAny.has("float") ? { type: "float" } : float], postprocess: (c) => (0, g.box)(c, parseFloat(a(c))) },
            { name: "int", symbols: [o.lexerAny.has("int") ? { type: "int" } : int], postprocess: (c) => (0, g.box)(c, parseInt(a(c), 10)) },
            { name: "comma", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma], postprocess: n },
            { name: "star", symbols: [o.lexerAny.has("star") ? { type: "star" } : star], postprocess: (c) => (0, g.box)(c, c[0].value) },
            { name: "string$subexpression$1", symbols: [o.lexerAny.has("string") ? { type: "string" } : string] },
            { name: "string$subexpression$1", symbols: [o.lexerAny.has("eString") ? { type: "eString" } : eString] },
            { name: "string", symbols: ["string$subexpression$1"], postprocess: (c) => (0, g.box)(c, a(c[0]).value) },
            { name: "ident", symbols: ["word"], postprocess: C(0) },
            { name: "word", symbols: [o.lexerAny.has("kw_primary") ? { type: "kw_primary" } : kw_primary], postprocess: (c) => (0, g.box)(c, "primary") },
            { name: "word", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique], postprocess: (c) => (0, g.box)(c, "unique") },
            { name: "word", symbols: [o.lexerAny.has("quoted_word") ? { type: "quoted_word" } : quoted_word], postprocess: (c) => (0, g.box)(c, c[0].value, !0) },
            { name: "word", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: (c) => (0, g.box)(c, c[0].value) },
            { name: "collist_paren", symbols: ["lparen", "collist", "rparen"], postprocess: C(1) },
            { name: "collist$ebnf$1", symbols: [] },
            { name: "collist$ebnf$1$subexpression$1", symbols: ["comma", "ident"], postprocess: B },
            { name: "collist$ebnf$1", symbols: ["collist$ebnf$1", "collist$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "collist", symbols: ["ident", "collist$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "kw_between", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("between") },
            { name: "kw_conflict", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("conflict") },
            { name: "kw_nothing", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("nothing") },
            { name: "kw_begin", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("begin") },
            { name: "kw_if", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("if") },
            { name: "kw_exists", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("exists") },
            { name: "kw_key", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("key") },
            { name: "kw_index", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("index") },
            { name: "kw_extension", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("extension") },
            { name: "kw_schema", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("schema") },
            { name: "kw_nulls", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("nulls") },
            { name: "kw_first", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("first") },
            { name: "kw_last", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("last") },
            { name: "kw_start", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("start") },
            { name: "kw_restart", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("restart") },
            { name: "kw_filter", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("filter") },
            { name: "kw_commit", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("commit") },
            { name: "kw_tablespace", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("tablespace") },
            { name: "kw_transaction", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("transaction") },
            { name: "kw_work", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("work") },
            { name: "kw_read", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("read") },
            { name: "kw_write", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("write") },
            { name: "kw_isolation", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("isolation") },
            { name: "kw_level", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("level") },
            { name: "kw_serializable", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("serializable") },
            { name: "kw_rollback", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("rollback") },
            { name: "kw_insert", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("insert") },
            { name: "kw_value", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("value") },
            { name: "kw_values", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("values") },
            { name: "kw_update", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("update") },
            { name: "kw_column", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("column") },
            { name: "kw_set", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("set") },
            { name: "kw_version", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("version") },
            { name: "kw_alter", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("alter") },
            { name: "kw_rename", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("rename") },
            { name: "kw_sequence", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("sequence") },
            { name: "kw_temp", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("temp") },
            { name: "kw_temporary", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("temporary") },
            { name: "kw_add", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("add") },
            { name: "kw_owner", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("owner") },
            { name: "kw_owned", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("owned") },
            { name: "kw_including", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("including") },
            { name: "kw_excluding", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("excluding") },
            { name: "kw_none", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("none") },
            { name: "kw_drop", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("drop") },
            { name: "kw_operator", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("operator") },
            { name: "kw_minvalue", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("minvalue") },
            { name: "kw_maxvalue", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("maxvalue") },
            { name: "kw_data", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("data") },
            { name: "kw_type", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("type") },
            { name: "kw_trigger", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("trigger") },
            { name: "kw_delete", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("delete") },
            { name: "kw_cache", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("cache") },
            { name: "kw_cascade", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("cascade") },
            { name: "kw_no", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("no") },
            { name: "kw_timestamp", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("timestamp") },
            { name: "kw_cycle", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("cycle") },
            { name: "kw_function", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("function") },
            { name: "kw_returns", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("returns") },
            { name: "kw_language", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("language") },
            { name: "kw_out", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("out") },
            { name: "kw_inout", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("inout") },
            { name: "kw_variadic", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("variadic") },
            { name: "kw_action", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("action") },
            { name: "kw_restrict", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("restrict") },
            { name: "kw_truncate", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("truncate") },
            { name: "kw_increment", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("increment") },
            { name: "kw_by", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("by") },
            { name: "kw_row", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("row") },
            { name: "kw_rows", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("rows") },
            { name: "kw_next", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("next") },
            { name: "kw_match", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("match") },
            { name: "kw_replace", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("replace") },
            { name: "kw_recursive", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("recursive") },
            { name: "kw_view", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("view") },
            { name: "kw_cascaded", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("cascaded") },
            { name: "kw_unlogged", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("unlogged") },
            { name: "kw_global", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("global") },
            { name: "kw_option", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("option") },
            { name: "kw_materialized", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("materialized") },
            { name: "kw_partial", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("partial") },
            { name: "kw_partition", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("partition") },
            { name: "kw_simple", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("simple") },
            { name: "kw_generated", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("generated") },
            { name: "kw_always", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("always") },
            { name: "kw_identity", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("identity") },
            { name: "kw_name", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("name") },
            { name: "kw_enum", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("enum") },
            { name: "kw_show", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("show") },
            { name: "kw_ordinality", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("ordinality") },
            { name: "kw_overriding", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("overriding") },
            { name: "kw_over", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("over") },
            { name: "kw_system", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("system") },
            { name: "kw_comment", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("comment") },
            { name: "kw_time", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("time") },
            { name: "kw_at", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("at") },
            { name: "kw_zone", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("zone") },
            { name: "kw_interval", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("interval") },
            { name: "kw_hour", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("hour") },
            { name: "kw_minute", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("minute") },
            { name: "kw_local", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("local") },
            { name: "kw_prepare", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("prepare") },
            { name: "kw_deallocate", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("deallocate") },
            { name: "kw_raise", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("raise") },
            { name: "kw_continue", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("continue") },
            { name: "kw_share", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("share") },
            { name: "kw_refresh", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("refresh") },
            { name: "kw_nowait", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("nowait") },
            { name: "kw_skip", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("skip") },
            { name: "kw_locked", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("locked") },
            { name: "kw_ifnotexists", symbols: ["kw_if", o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not, "kw_exists"] },
            { name: "kw_ifexists", symbols: ["kw_if", "kw_exists"] },
            { name: "kw_withordinality", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "kw_ordinality"] },
            { name: "kw_not_null", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not, o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null] },
            { name: "kw_primary_key", symbols: [o.lexerAny.has("kw_primary") ? { type: "kw_primary" } : kw_primary, "kw_key"] },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$2", symbols: ["int"] },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "data_type$ebnf$1$subexpression$1$macrocall$2"], postprocess: B },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1", symbols: ["data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1", "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$1", symbols: ["data_type$ebnf$1$subexpression$1$macrocall$2", "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "data_type$ebnf$1$subexpression$1", symbols: ["lparen", "data_type$ebnf$1$subexpression$1$macrocall$1", "rparen"], postprocess: C(1) },
            { name: "data_type$ebnf$1", symbols: ["data_type$ebnf$1$subexpression$1"], postprocess: n },
            { name: "data_type$ebnf$1", symbols: [], postprocess: () => null },
            { name: "data_type$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("kw_array") ? { type: "kw_array" } : kw_array] },
            { name: "data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket] },
            { name: "data_type$ebnf$2$subexpression$1$ebnf$1", symbols: ["data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1"] },
            { name: "data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2", symbols: [o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket] },
            { name: "data_type$ebnf$2$subexpression$1$ebnf$1", symbols: ["data_type$ebnf$2$subexpression$1$ebnf$1", "data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "data_type$ebnf$2$subexpression$1", symbols: ["data_type$ebnf$2$subexpression$1$ebnf$1"] },
            { name: "data_type$ebnf$2", symbols: ["data_type$ebnf$2$subexpression$1"], postprocess: n },
            { name: "data_type$ebnf$2", symbols: [], postprocess: () => null },
            { name: "data_type", symbols: ["data_type_simple", "data_type$ebnf$1", "data_type$ebnf$2"], postprocess: (c) => {
              let J = c[2];
              const p = a(c[0]);
              let N;
              if (N = {
                ...p,
                ...Array.isArray(c[1]) && c[1].length ? { config: c[1].map(a) } : {}
              }, J) {
                J[0].type === "kw_array" && (J = [["array"]]);
                for (const v of J[0])
                  N = {
                    kind: "array",
                    arrayOf: N
                  };
              }
              return (0, g.track)(c, N);
            } },
            { name: "data_type_list$ebnf$1", symbols: [] },
            { name: "data_type_list$ebnf$1$subexpression$1", symbols: ["comma", "data_type"], postprocess: B },
            { name: "data_type_list$ebnf$1", symbols: ["data_type_list$ebnf$1", "data_type_list$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "data_type_list", symbols: ["data_type", "data_type_list$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "data_type_simple", symbols: ["data_type_text"], postprocess: (c) => (0, g.track)(c, { name: d(c, " ") }) },
            { name: "data_type_simple", symbols: ["data_type_numeric"], postprocess: (c) => (0, g.track)(c, { name: d(c, " ") }) },
            { name: "data_type_simple", symbols: ["data_type_date"] },
            { name: "data_type_simple", symbols: ["qualified_name_mark_quotes"] },
            { name: "data_type_numeric$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("double") },
            { name: "data_type_numeric", symbols: ["data_type_numeric$subexpression$1", o.lexerAny.has("kw_precision") ? { type: "kw_precision" } : kw_precision] },
            { name: "data_type_text$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("character", "bit") },
            { name: "data_type_text$subexpression$2", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("varying") },
            { name: "data_type_text", symbols: ["data_type_text$subexpression$1", "data_type_text$subexpression$2"] },
            { name: "data_type_date$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("timestamp", "time") },
            { name: "data_type_date$subexpression$2", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with] },
            { name: "data_type_date$subexpression$2", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("without") },
            { name: "data_type_date$subexpression$3", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("time") },
            { name: "data_type_date$subexpression$4", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("zone") },
            { name: "data_type_date", symbols: ["data_type_date$subexpression$1", "data_type_date$subexpression$2", "data_type_date$subexpression$3", "data_type_date$subexpression$4"], postprocess: (c) => (0, g.track)(c, { name: d(c, " ") }) },
            { name: "data_type_date$subexpression$5", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("timestamp", "time") },
            { name: "data_type_date$subexpression$6", symbols: ["lparen", "int", "rparen"], postprocess: C(1) },
            { name: "data_type_date$subexpression$7", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with] },
            { name: "data_type_date$subexpression$7", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("without") },
            { name: "data_type_date$subexpression$8", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("time") },
            { name: "data_type_date$subexpression$9", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("zone") },
            { name: "data_type_date", symbols: ["data_type_date$subexpression$5", "data_type_date$subexpression$6", "data_type_date$subexpression$7", "data_type_date$subexpression$8", "data_type_date$subexpression$9"], postprocess: (c) => (0, g.track)(c, { name: `timestamp ${d(c[2])} time zone`, config: [(0, g.unbox)(c[1])] }) },
            { name: "ident_aliased$subexpression$1", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "ident"], postprocess: B },
            { name: "ident_aliased", symbols: ["ident_aliased$subexpression$1"] },
            { name: "ident_aliased", symbols: ["ident"], postprocess: a },
            { name: "table_ref", symbols: ["qualified_name"], postprocess: a },
            { name: "qcolumn$ebnf$1$subexpression$1", symbols: ["dot", "ident"], postprocess: B },
            { name: "qcolumn$ebnf$1", symbols: ["qcolumn$ebnf$1$subexpression$1"], postprocess: n },
            { name: "qcolumn$ebnf$1", symbols: [], postprocess: () => null },
            { name: "qcolumn", symbols: ["ident", "dot", "ident", "qcolumn$ebnf$1"], postprocess: (c) => c[3] ? (0, g.track)(c, {
              schema: (0, g.unbox)(c[0]),
              table: (0, g.unbox)(c[2]),
              column: (0, g.unbox)(c[3])
            }) : (0, g.track)(c, {
              table: (0, g.unbox)(c[0]),
              column: (0, g.unbox)(c[2])
            }) },
            { name: "table_ref_aliased$ebnf$1", symbols: ["ident_aliased"], postprocess: n },
            { name: "table_ref_aliased$ebnf$1", symbols: [], postprocess: () => null },
            { name: "table_ref_aliased", symbols: ["table_ref", "table_ref_aliased$ebnf$1"], postprocess: (c) => {
              const J = a(c[1]);
              return (0, g.track)(c, {
                ...a(c[0]),
                ...J ? { alias: J } : {}
              });
            } },
            { name: "qualified_name", symbols: ["qname_ident"], postprocess: (c) => (0, g.track)(c, { name: d(c) }) },
            { name: "qualified_name", symbols: ["ident", "dot", "ident_extended"], postprocess: (c) => {
              const J = d(c[0]), p = d(c[2]);
              return (0, g.track)(c, { schema: J, name: p });
            } },
            { name: "qualified_name", symbols: [o.lexerAny.has("kw_current_schema") ? { type: "kw_current_schema" } : kw_current_schema], postprocess: (c) => (0, g.track)(c, { name: "current_schema" }) },
            { name: "qualified_name_mark_quotes", symbols: ["qname_ident"], postprocess: (c) => (0, g.track)(c, { name: d(c), ...(0, g.doubleQuoted)(c) }) },
            { name: "qualified_name_mark_quotes", symbols: ["ident", "dot", "ident_extended"], postprocess: (c) => {
              const J = d(c[0]), p = d(c[2]);
              return (0, g.track)(c, { schema: J, name: p, ...(0, g.doubleQuoted)(c[2]) });
            } },
            { name: "qualified_name_mark_quotes", symbols: [o.lexerAny.has("kw_current_schema") ? { type: "kw_current_schema" } : kw_current_schema], postprocess: (c) => (0, g.track)(c, { name: "current_schema" }) },
            { name: "qname_ident", symbols: ["ident"] },
            { name: "qname_ident", symbols: [o.lexerAny.has("kw_precision") ? { type: "kw_precision" } : kw_precision] },
            { name: "qname", symbols: ["qualified_name"], postprocess: a },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_analyse") ? { type: "kw_analyse" } : kw_analyse] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_analyze") ? { type: "kw_analyze" } : kw_analyze] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_and") ? { type: "kw_and" } : kw_and] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_any") ? { type: "kw_any" } : kw_any] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_array") ? { type: "kw_array" } : kw_array] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_asc") ? { type: "kw_asc" } : kw_asc] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_asymmetric") ? { type: "kw_asymmetric" } : kw_asymmetric] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_authorization") ? { type: "kw_authorization" } : kw_authorization] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_binary") ? { type: "kw_binary" } : kw_binary] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_both") ? { type: "kw_both" } : kw_both] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_case") ? { type: "kw_case" } : kw_case] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_cast") ? { type: "kw_cast" } : kw_cast] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_check") ? { type: "kw_check" } : kw_check] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_collate") ? { type: "kw_collate" } : kw_collate] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_collation") ? { type: "kw_collation" } : kw_collation] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_concurrently") ? { type: "kw_concurrently" } : kw_concurrently] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_cross") ? { type: "kw_cross" } : kw_cross] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_catalog") ? { type: "kw_current_catalog" } : kw_current_catalog] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_date") ? { type: "kw_current_date" } : kw_current_date] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_role") ? { type: "kw_current_role" } : kw_current_role] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_schema") ? { type: "kw_current_schema" } : kw_current_schema] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_time") ? { type: "kw_current_time" } : kw_current_time] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_timestamp") ? { type: "kw_current_timestamp" } : kw_current_timestamp] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_user") ? { type: "kw_current_user" } : kw_current_user] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_deferrable") ? { type: "kw_deferrable" } : kw_deferrable] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_desc") ? { type: "kw_desc" } : kw_desc] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_distinct") ? { type: "kw_distinct" } : kw_distinct] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_do") ? { type: "kw_do" } : kw_do] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_else") ? { type: "kw_else" } : kw_else] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_end") ? { type: "kw_end" } : kw_end] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_except") ? { type: "kw_except" } : kw_except] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_false") ? { type: "kw_false" } : kw_false] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_fetch") ? { type: "kw_fetch" } : kw_fetch] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_for") ? { type: "kw_for" } : kw_for] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_foreign") ? { type: "kw_foreign" } : kw_foreign] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_freeze") ? { type: "kw_freeze" } : kw_freeze] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_full") ? { type: "kw_full" } : kw_full] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_grant") ? { type: "kw_grant" } : kw_grant] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_group") ? { type: "kw_group" } : kw_group] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_having") ? { type: "kw_having" } : kw_having] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_ilike") ? { type: "kw_ilike" } : kw_ilike] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_in") ? { type: "kw_in" } : kw_in] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_initially") ? { type: "kw_initially" } : kw_initially] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_inner") ? { type: "kw_inner" } : kw_inner] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_intersect") ? { type: "kw_intersect" } : kw_intersect] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_into") ? { type: "kw_into" } : kw_into] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_isnull") ? { type: "kw_isnull" } : kw_isnull] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_join") ? { type: "kw_join" } : kw_join] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_lateral") ? { type: "kw_lateral" } : kw_lateral] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_leading") ? { type: "kw_leading" } : kw_leading] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_left") ? { type: "kw_left" } : kw_left] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_like") ? { type: "kw_like" } : kw_like] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_limit") ? { type: "kw_limit" } : kw_limit] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_localtime") ? { type: "kw_localtime" } : kw_localtime] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_localtimestamp") ? { type: "kw_localtimestamp" } : kw_localtimestamp] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_natural") ? { type: "kw_natural" } : kw_natural] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_notnull") ? { type: "kw_notnull" } : kw_notnull] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_offset") ? { type: "kw_offset" } : kw_offset] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_only") ? { type: "kw_only" } : kw_only] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_or") ? { type: "kw_or" } : kw_or] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_order") ? { type: "kw_order" } : kw_order] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_outer") ? { type: "kw_outer" } : kw_outer] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_overlaps") ? { type: "kw_overlaps" } : kw_overlaps] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_placing") ? { type: "kw_placing" } : kw_placing] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_primary") ? { type: "kw_primary" } : kw_primary] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_references") ? { type: "kw_references" } : kw_references] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_returning") ? { type: "kw_returning" } : kw_returning] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_right") ? { type: "kw_right" } : kw_right] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_select") ? { type: "kw_select" } : kw_select] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_session_user") ? { type: "kw_session_user" } : kw_session_user] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_similar") ? { type: "kw_similar" } : kw_similar] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_some") ? { type: "kw_some" } : kw_some] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_symmetric") ? { type: "kw_symmetric" } : kw_symmetric] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_tablesample") ? { type: "kw_tablesample" } : kw_tablesample] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_then") ? { type: "kw_then" } : kw_then] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_trailing") ? { type: "kw_trailing" } : kw_trailing] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_true") ? { type: "kw_true" } : kw_true] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_union") ? { type: "kw_union" } : kw_union] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_user") ? { type: "kw_user" } : kw_user] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_using") ? { type: "kw_using" } : kw_using] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_variadic") ? { type: "kw_variadic" } : kw_variadic] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_verbose") ? { type: "kw_verbose" } : kw_verbose] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_when") ? { type: "kw_when" } : kw_when] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_window") ? { type: "kw_window" } : kw_window] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with] },
            { name: "ident_extended", symbols: ["ident"] },
            { name: "ident_extended", symbols: ["any_keyword"] },
            { name: "select_statement$ebnf$1", symbols: ["select_from"], postprocess: n },
            { name: "select_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$2", symbols: ["select_where"], postprocess: n },
            { name: "select_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$3$subexpression$1$ebnf$1", symbols: ["select_having"], postprocess: n },
            { name: "select_statement$ebnf$3$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$3$subexpression$1", symbols: ["select_groupby", "select_statement$ebnf$3$subexpression$1$ebnf$1"] },
            { name: "select_statement$ebnf$3", symbols: ["select_statement$ebnf$3$subexpression$1"], postprocess: n },
            { name: "select_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$4", symbols: ["select_order_by"], postprocess: n },
            { name: "select_statement$ebnf$4", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$5", symbols: ["select_limit_offset"], postprocess: n },
            { name: "select_statement$ebnf$5", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$6$subexpression$1$ebnf$1", symbols: ["select_skip"], postprocess: n },
            { name: "select_statement$ebnf$6$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$6$subexpression$1", symbols: ["select_for", "select_statement$ebnf$6$subexpression$1$ebnf$1"] },
            { name: "select_statement$ebnf$6", symbols: ["select_statement$ebnf$6$subexpression$1"], postprocess: n },
            { name: "select_statement$ebnf$6", symbols: [], postprocess: () => null },
            { name: "select_statement", symbols: ["select_what", "select_statement$ebnf$1", "select_statement$ebnf$2", "select_statement$ebnf$3", "select_statement$ebnf$4", "select_statement$ebnf$5", "select_statement$ebnf$6"], postprocess: (c) => {
              let [J, p, N, v, K, U, j] = c;
              p = a(p);
              let q = v && v[0], O = v && v[1];
              q = q && (q.length === 1 && q[0].type === "list" ? q[0].expressions : q), O = O && a(O);
              let $ = j && j[0], _ = j && j[1];
              return _ = a(_), (0, g.track)(c, {
                ...J,
                ...p ? { from: Array.isArray(p) ? p : [p] } : {},
                ...q ? { groupBy: q } : {},
                ...O ? { having: O } : {},
                ...U ? { limit: a(U) } : {},
                ...K ? { orderBy: K } : {},
                ...N ? { where: N } : {},
                ...$ ? { for: $[1] } : {},
                ..._ ? { skip: _ } : {},
                type: "select"
              });
            } },
            { name: "select_from", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "select_from_items"], postprocess: B },
            { name: "select_from_items$ebnf$1", symbols: [] },
            { name: "select_from_items$ebnf$1$subexpression$1", symbols: ["comma", "select_from_item"], postprocess: B },
            { name: "select_from_items$ebnf$1", symbols: ["select_from_items$ebnf$1", "select_from_items$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_from_items", symbols: ["select_from_item", "select_from_items$ebnf$1"], postprocess: ([c, J]) => [...c, ...l(J) || []] },
            { name: "select_from_item", symbols: ["select_from_subject"] },
            { name: "select_from_item", symbols: ["select_from_item_joins"], postprocess: C(0) },
            { name: "select_from_item_joins$subexpression$1", symbols: ["select_from_item"], postprocess: C(0) },
            { name: "select_from_item_joins", symbols: ["select_from_item_joins$subexpression$1", "select_table_join"], postprocess: l },
            { name: "select_from_item_joins", symbols: ["lparen", "select_from_item_joins", "rparen"], postprocess: C(1) },
            { name: "select_from_subject", symbols: ["stb_table"], postprocess: a },
            { name: "select_from_subject", symbols: ["stb_statement"], postprocess: a },
            { name: "select_from_subject", symbols: ["stb_call"], postprocess: a },
            { name: "stb_opts$ebnf$1", symbols: ["collist_paren"], postprocess: n },
            { name: "stb_opts$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_opts", symbols: ["ident_aliased", "stb_opts$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              alias: d(c[0]),
              ...c[1] && { columnNames: (0, g.unbox)(c[1]).map(s) }
            }) },
            { name: "stb_table$ebnf$1", symbols: ["stb_opts"], postprocess: n },
            { name: "stb_table$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_table", symbols: ["table_ref", "stb_table$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              type: "table",
              name: (0, g.track)(c, {
                ...c[0],
                ...c[1]
              })
            }) },
            { name: "stb_statement", symbols: ["selection_paren", "stb_opts"], postprocess: (c) => (0, g.track)(c, {
              type: "statement",
              statement: a(c[0]),
              ...c[1]
            }) },
            { name: "select_values", symbols: ["kw_values", "insert_values"], postprocess: (c) => (0, g.track)(c, {
              type: "values",
              values: c[1]
            }) },
            { name: "stb_call$ebnf$1", symbols: ["kw_withordinality"], postprocess: n },
            { name: "stb_call$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_call$ebnf$2", symbols: ["stb_call_alias"], postprocess: n },
            { name: "stb_call$ebnf$2", symbols: [], postprocess: () => null },
            { name: "stb_call", symbols: ["expr_function_call", "stb_call$ebnf$1", "stb_call$ebnf$2"], postprocess: (c) => {
              const J = c[1], p = c[2];
              return !J && !p ? c[0] : (0, g.track)(c, {
                ...c[0],
                ...J && { withOrdinality: !0 },
                alias: p ? I(p[0], p[1]) : void 0
              });
            } },
            { name: "stb_call_alias$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as], postprocess: n },
            { name: "stb_call_alias$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_call_alias$subexpression$1", symbols: ["stb_call_alias$subexpression$1$ebnf$1", "ident"], postprocess: B },
            { name: "stb_call_alias$ebnf$1", symbols: ["stb_call_alias_list"], postprocess: n },
            { name: "stb_call_alias$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_call_alias", symbols: ["stb_call_alias$subexpression$1", "stb_call_alias$ebnf$1"] },
            { name: "stb_call_alias_list", symbols: ["lparen", "stb_call_alias_list_raw", "rparen"], postprocess: C(1) },
            { name: "stb_call_alias_list_raw$ebnf$1", symbols: [] },
            { name: "stb_call_alias_list_raw$ebnf$1$subexpression$1", symbols: ["comma", "ident"], postprocess: B },
            { name: "stb_call_alias_list_raw$ebnf$1", symbols: ["stb_call_alias_list_raw$ebnf$1", "stb_call_alias_list_raw$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "stb_call_alias_list_raw", symbols: ["ident", "stb_call_alias_list_raw$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "select_table_join$ebnf$1", symbols: ["select_table_join_clause"], postprocess: n },
            { name: "select_table_join$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_table_join", symbols: ["select_join_op", o.lexerAny.has("kw_join") ? { type: "kw_join" } : kw_join, "select_from_subject", "select_table_join$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              ...a(c[2]),
              join: {
                type: d(c[0], " "),
                ...c[3] && a(c[3])
              }
            }) },
            { name: "select_table_join_clause", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "expr"], postprocess: (c) => (0, g.track)(c, { on: B(c) }) },
            { name: "select_table_join_clause$macrocall$2", symbols: ["ident"] },
            { name: "select_table_join_clause$macrocall$1$ebnf$1", symbols: [] },
            { name: "select_table_join_clause$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "select_table_join_clause$macrocall$2"], postprocess: B },
            { name: "select_table_join_clause$macrocall$1$ebnf$1", symbols: ["select_table_join_clause$macrocall$1$ebnf$1", "select_table_join_clause$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_table_join_clause$macrocall$1", symbols: ["select_table_join_clause$macrocall$2", "select_table_join_clause$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "select_table_join_clause", symbols: [o.lexerAny.has("kw_using") ? { type: "kw_using" } : kw_using, "lparen", "select_table_join_clause$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, { using: c[2].map(s) }) },
            { name: "select_join_op$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_inner") ? { type: "kw_inner" } : kw_inner], postprocess: n },
            { name: "select_join_op$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_join_op$subexpression$1", symbols: ["select_join_op$subexpression$1$ebnf$1"], postprocess: (c) => (0, g.box)(c, "INNER JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$1"] },
            { name: "select_join_op$subexpression$2", symbols: [o.lexerAny.has("kw_cross") ? { type: "kw_cross" } : kw_cross], postprocess: (c) => (0, g.box)(c, "CROSS JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$2"] },
            { name: "select_join_op$subexpression$3$ebnf$1", symbols: [o.lexerAny.has("kw_outer") ? { type: "kw_outer" } : kw_outer], postprocess: n },
            { name: "select_join_op$subexpression$3$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_join_op$subexpression$3", symbols: [o.lexerAny.has("kw_left") ? { type: "kw_left" } : kw_left, "select_join_op$subexpression$3$ebnf$1"], postprocess: (c) => (0, g.box)(c, "LEFT JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$3"] },
            { name: "select_join_op$subexpression$4$ebnf$1", symbols: [o.lexerAny.has("kw_outer") ? { type: "kw_outer" } : kw_outer], postprocess: n },
            { name: "select_join_op$subexpression$4$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_join_op$subexpression$4", symbols: [o.lexerAny.has("kw_right") ? { type: "kw_right" } : kw_right, "select_join_op$subexpression$4$ebnf$1"], postprocess: (c) => (0, g.box)(c, "RIGHT JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$4"] },
            { name: "select_join_op$subexpression$5$ebnf$1", symbols: [o.lexerAny.has("kw_outer") ? { type: "kw_outer" } : kw_outer], postprocess: n },
            { name: "select_join_op$subexpression$5$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_join_op$subexpression$5", symbols: [o.lexerAny.has("kw_full") ? { type: "kw_full" } : kw_full, "select_join_op$subexpression$5$ebnf$1"], postprocess: (c) => (0, g.box)(c, "FULL JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$5"] },
            { name: "select_what$ebnf$1", symbols: ["select_distinct"], postprocess: n },
            { name: "select_what$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_what$ebnf$2", symbols: ["select_expr_list_aliased"], postprocess: n },
            { name: "select_what$ebnf$2", symbols: [], postprocess: () => null },
            { name: "select_what", symbols: [o.lexerAny.has("kw_select") ? { type: "kw_select" } : kw_select, "select_what$ebnf$1", "select_what$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              columns: c[2],
              ...c[1] && { distinct: (0, g.unbox)(c[1]) }
            }) },
            { name: "select_expr_list_aliased$ebnf$1", symbols: [] },
            { name: "select_expr_list_aliased$ebnf$1$subexpression$1", symbols: ["comma", "select_expr_list_item"], postprocess: B },
            { name: "select_expr_list_aliased$ebnf$1", symbols: ["select_expr_list_aliased$ebnf$1", "select_expr_list_aliased$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_expr_list_aliased", symbols: ["select_expr_list_item", "select_expr_list_aliased$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "select_expr_list_item$ebnf$1", symbols: ["ident_aliased"], postprocess: n },
            { name: "select_expr_list_item$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_expr_list_item", symbols: ["expr", "select_expr_list_item$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              expr: c[0],
              ...c[1] ? { alias: s(c[1]) } : {}
            }) },
            { name: "select_distinct", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all], postprocess: (c) => (0, g.box)(c, "all") },
            { name: "select_distinct$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "lparen", "expr_list_raw", "rparen"], postprocess: C(2) },
            { name: "select_distinct$ebnf$1", symbols: ["select_distinct$ebnf$1$subexpression$1"], postprocess: n },
            { name: "select_distinct$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_distinct", symbols: [o.lexerAny.has("kw_distinct") ? { type: "kw_distinct" } : kw_distinct, "select_distinct$ebnf$1"], postprocess: (c) => (0, g.box)(c, c[1] || "distinct") },
            { name: "select_where", symbols: [o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where, "expr"], postprocess: B },
            { name: "select_groupby", symbols: [o.lexerAny.has("kw_group") ? { type: "kw_group" } : kw_group, "kw_by", "expr_list_raw"], postprocess: B },
            { name: "select_having", symbols: [o.lexerAny.has("kw_having") ? { type: "kw_having" } : kw_having, "expr"], postprocess: B },
            { name: "select_limit_offset$ebnf$1$subexpression$1", symbols: ["select_offset"] },
            { name: "select_limit_offset$ebnf$1$subexpression$1", symbols: ["select_limit"] },
            { name: "select_limit_offset$ebnf$1", symbols: ["select_limit_offset$ebnf$1$subexpression$1"] },
            { name: "select_limit_offset$ebnf$1$subexpression$2", symbols: ["select_offset"] },
            { name: "select_limit_offset$ebnf$1$subexpression$2", symbols: ["select_limit"] },
            { name: "select_limit_offset$ebnf$1", symbols: ["select_limit_offset$ebnf$1", "select_limit_offset$ebnf$1$subexpression$2"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_limit_offset", symbols: ["select_limit_offset$ebnf$1"], postprocess: (c, J) => {
              const p = a(c);
              if (!Array.isArray(p))
                return (0, g.track)(c, p);
              if (p.length != 2)
                return J;
              const N = a(p[0]), v = a(p[1]);
              return N.offset && v.offset || N.limit && v.limit ? J : (0, g.track)(c, {
                ...N,
                ...v
              });
            } },
            { name: "select_offset$ebnf$1$subexpression$1", symbols: ["kw_row"] },
            { name: "select_offset$ebnf$1$subexpression$1", symbols: ["kw_rows"] },
            { name: "select_offset$ebnf$1", symbols: ["select_offset$ebnf$1$subexpression$1"], postprocess: n },
            { name: "select_offset$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_offset", symbols: [o.lexerAny.has("kw_offset") ? { type: "kw_offset" } : kw_offset, "expr_nostar", "select_offset$ebnf$1"], postprocess: (c) => (0, g.track)(c, { offset: a(c[1]) }) },
            { name: "select_limit$subexpression$1", symbols: ["select_limit_1"] },
            { name: "select_limit$subexpression$1", symbols: ["select_limit_2"] },
            { name: "select_limit", symbols: ["select_limit$subexpression$1"], postprocess: (c) => (0, g.track)(c, { limit: a(c) }) },
            { name: "select_limit_1", symbols: [o.lexerAny.has("kw_limit") ? { type: "kw_limit" } : kw_limit, "expr_nostar"], postprocess: B },
            { name: "select_limit_2$ebnf$1$subexpression$1", symbols: ["kw_first"] },
            { name: "select_limit_2$ebnf$1$subexpression$1", symbols: ["kw_next"] },
            { name: "select_limit_2$ebnf$1", symbols: ["select_limit_2$ebnf$1$subexpression$1"], postprocess: n },
            { name: "select_limit_2$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_limit_2$subexpression$1", symbols: ["kw_row"] },
            { name: "select_limit_2$subexpression$1", symbols: ["kw_rows"] },
            { name: "select_limit_2", symbols: [o.lexerAny.has("kw_fetch") ? { type: "kw_fetch" } : kw_fetch, "select_limit_2$ebnf$1", "expr_nostar", "select_limit_2$subexpression$1", o.lexerAny.has("kw_only") ? { type: "kw_only" } : kw_only], postprocess: C(2) },
            { name: "select_for$subexpression$1", symbols: ["kw_update"], postprocess: (c) => (0, g.track)(c, { type: "update" }) },
            { name: "select_for$subexpression$1", symbols: ["kw_no", "kw_key", "kw_update"], postprocess: (c) => (0, g.track)(c, { type: "no key update" }) },
            { name: "select_for$subexpression$1", symbols: ["kw_share"], postprocess: (c) => (0, g.track)(c, { type: "share" }) },
            { name: "select_for$subexpression$1", symbols: ["kw_key", "kw_share"], postprocess: (c) => (0, g.track)(c, { type: "key share" }) },
            { name: "select_for", symbols: [o.lexerAny.has("kw_for") ? { type: "kw_for" } : kw_for, "select_for$subexpression$1"] },
            { name: "select_skip$subexpression$1", symbols: ["kw_nowait"], postprocess: (c) => (0, g.track)(c, { type: "nowait" }) },
            { name: "select_skip$subexpression$1", symbols: ["kw_skip", "kw_locked"], postprocess: (c) => (0, g.track)(c, { type: "skip locked" }) },
            { name: "select_skip", symbols: ["select_skip$subexpression$1"] },
            { name: "select_order_by$subexpression$1", symbols: [o.lexerAny.has("kw_order") ? { type: "kw_order" } : kw_order, "kw_by"] },
            { name: "select_order_by$ebnf$1", symbols: [] },
            { name: "select_order_by$ebnf$1$subexpression$1", symbols: ["comma", "select_order_by_expr"], postprocess: B },
            { name: "select_order_by$ebnf$1", symbols: ["select_order_by$ebnf$1", "select_order_by$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_order_by", symbols: ["select_order_by$subexpression$1", "select_order_by_expr", "select_order_by$ebnf$1"], postprocess: ([c, J, p]) => [J, ...p || []] },
            { name: "select_order_by_expr$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_asc") ? { type: "kw_asc" } : kw_asc] },
            { name: "select_order_by_expr$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_desc") ? { type: "kw_desc" } : kw_desc] },
            { name: "select_order_by_expr$ebnf$1", symbols: ["select_order_by_expr$ebnf$1$subexpression$1"], postprocess: n },
            { name: "select_order_by_expr$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_order_by_expr$ebnf$2$subexpression$1$subexpression$1", symbols: ["kw_first"] },
            { name: "select_order_by_expr$ebnf$2$subexpression$1$subexpression$1", symbols: ["kw_last"] },
            { name: "select_order_by_expr$ebnf$2$subexpression$1", symbols: ["kw_nulls", "select_order_by_expr$ebnf$2$subexpression$1$subexpression$1"], postprocess: B },
            { name: "select_order_by_expr$ebnf$2", symbols: ["select_order_by_expr$ebnf$2$subexpression$1"], postprocess: n },
            { name: "select_order_by_expr$ebnf$2", symbols: [], postprocess: () => null },
            { name: "select_order_by_expr", symbols: ["expr", "select_order_by_expr$ebnf$1", "select_order_by_expr$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              by: c[0],
              ...c[1] && { order: d(c[1]).toUpperCase() },
              ...c[2] && { nulls: d(c[2]).toUpperCase() }
            }) },
            { name: "expr", symbols: ["expr_nostar"], postprocess: a },
            { name: "expr", symbols: ["expr_star"], postprocess: a },
            { name: "expr_nostar", symbols: ["expr_paren"], postprocess: a },
            { name: "expr_nostar", symbols: ["expr_or"], postprocess: a },
            { name: "expr_paren$subexpression$1", symbols: ["expr_or_select"] },
            { name: "expr_paren$subexpression$1", symbols: ["expr_list_many"] },
            { name: "expr_paren", symbols: ["lparen", "expr_paren$subexpression$1", "rparen"], postprocess: C(1) },
            { name: "expr_or$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("kw_or") ? { type: "kw_or" } : kw_or] },
            { name: "expr_or$macrocall$2$macrocall$1", symbols: ["expr_or$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_or$macrocall$2", symbols: ["expr_or$macrocall$2$macrocall$1"] },
            { name: "expr_or$macrocall$3", symbols: ["expr_or"] },
            { name: "expr_or$macrocall$4", symbols: ["expr_and"] },
            { name: "expr_or$macrocall$1$subexpression$1", symbols: ["expr_or$macrocall$3"] },
            { name: "expr_or$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_or$macrocall$1$subexpression$2", symbols: ["expr_or$macrocall$4"] },
            { name: "expr_or$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_or$macrocall$1", symbols: ["expr_or$macrocall$1$subexpression$1", "expr_or$macrocall$2", "expr_or$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_or$macrocall$1", symbols: ["expr_or$macrocall$4"], postprocess: a },
            { name: "expr_or", symbols: ["expr_or$macrocall$1"] },
            { name: "expr_and$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("kw_and") ? { type: "kw_and" } : kw_and] },
            { name: "expr_and$macrocall$2$macrocall$1", symbols: ["expr_and$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_and$macrocall$2", symbols: ["expr_and$macrocall$2$macrocall$1"] },
            { name: "expr_and$macrocall$3", symbols: ["expr_and"] },
            { name: "expr_and$macrocall$4", symbols: ["expr_not"] },
            { name: "expr_and$macrocall$1$subexpression$1", symbols: ["expr_and$macrocall$3"] },
            { name: "expr_and$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_and$macrocall$1$subexpression$2", symbols: ["expr_and$macrocall$4"] },
            { name: "expr_and$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_and$macrocall$1", symbols: ["expr_and$macrocall$1$subexpression$1", "expr_and$macrocall$2", "expr_and$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_and$macrocall$1", symbols: ["expr_and$macrocall$4"], postprocess: a },
            { name: "expr_and", symbols: ["expr_and$macrocall$1"] },
            { name: "expr_not$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not] },
            { name: "expr_not$macrocall$2$macrocall$1", symbols: ["expr_not$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_not$macrocall$2", symbols: ["expr_not$macrocall$2$macrocall$1"] },
            { name: "expr_not$macrocall$3", symbols: ["expr_not"] },
            { name: "expr_not$macrocall$4", symbols: ["expr_eq"] },
            { name: "expr_not$macrocall$1$subexpression$1", symbols: ["expr_not$macrocall$3"] },
            { name: "expr_not$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_not$macrocall$1", symbols: ["expr_not$macrocall$2", "expr_not$macrocall$1$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              type: "unary",
              ...a(c[0]),
              operand: a(c[1])
            }) },
            { name: "expr_not$macrocall$1", symbols: ["expr_not$macrocall$4"], postprocess: a },
            { name: "expr_not", symbols: ["expr_not$macrocall$1"] },
            { name: "expr_eq$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq] },
            { name: "expr_eq$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_neq") ? { type: "op_neq" } : op_neq] },
            { name: "expr_eq$macrocall$2$macrocall$2", symbols: ["expr_eq$macrocall$2$macrocall$2$subexpression$1"] },
            { name: "expr_eq$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_eq$macrocall$2$macrocall$2"] },
            { name: "expr_eq$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_eq$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_eq$macrocall$2$macrocall$1", symbols: ["expr_eq$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_eq$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_eq$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_eq$macrocall$2", symbols: ["expr_eq$macrocall$2$macrocall$1"] },
            { name: "expr_eq$macrocall$3", symbols: ["expr_eq"] },
            { name: "expr_eq$macrocall$4", symbols: ["expr_is"] },
            { name: "expr_eq$macrocall$1$subexpression$1", symbols: ["expr_eq$macrocall$3"] },
            { name: "expr_eq$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_eq$macrocall$1$subexpression$2", symbols: ["expr_eq$macrocall$4"] },
            { name: "expr_eq$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_eq$macrocall$1", symbols: ["expr_eq$macrocall$1$subexpression$1", "expr_eq$macrocall$2", "expr_eq$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_eq$macrocall$1", symbols: ["expr_eq$macrocall$4"], postprocess: a },
            { name: "expr_eq", symbols: ["expr_eq$macrocall$1"] },
            { name: "expr_star", symbols: ["star"], postprocess: (c) => (0, g.track)(c, { type: "ref", name: "*" }) },
            { name: "expr_is$subexpression$1", symbols: ["expr_is"] },
            { name: "expr_is$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_is$subexpression$2", symbols: [o.lexerAny.has("kw_isnull") ? { type: "kw_isnull" } : kw_isnull] },
            { name: "expr_is$subexpression$2", symbols: [o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is, o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null] },
            { name: "expr_is", symbols: ["expr_is$subexpression$1", "expr_is$subexpression$2"], postprocess: (c) => (0, g.track)(c, { type: "unary", op: "IS NULL", operand: a(c[0]) }) },
            { name: "expr_is$subexpression$3", symbols: ["expr_is"] },
            { name: "expr_is$subexpression$3", symbols: ["expr_paren"] },
            { name: "expr_is$subexpression$4", symbols: [o.lexerAny.has("kw_notnull") ? { type: "kw_notnull" } : kw_notnull] },
            { name: "expr_is$subexpression$4", symbols: [o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is, "kw_not_null"] },
            { name: "expr_is", symbols: ["expr_is$subexpression$3", "expr_is$subexpression$4"], postprocess: (c) => (0, g.track)(c, { type: "unary", op: "IS NOT NULL", operand: a(c[0]) }) },
            { name: "expr_is$subexpression$5", symbols: ["expr_is"] },
            { name: "expr_is$subexpression$5", symbols: ["expr_paren"] },
            { name: "expr_is$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "expr_is$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_is$subexpression$6", symbols: [o.lexerAny.has("kw_true") ? { type: "kw_true" } : kw_true] },
            { name: "expr_is$subexpression$6", symbols: [o.lexerAny.has("kw_false") ? { type: "kw_false" } : kw_false] },
            { name: "expr_is", symbols: ["expr_is$subexpression$5", o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is, "expr_is$ebnf$1", "expr_is$subexpression$6"], postprocess: (c) => (0, g.track)(c, {
              type: "unary",
              op: "IS " + E([c[2], c[3]]).join(" ").toUpperCase(),
              operand: a(c[0])
            }) },
            { name: "expr_is", symbols: ["expr_compare"], postprocess: a },
            { name: "expr_compare$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("op_compare") ? { type: "op_compare" } : op_compare] },
            { name: "expr_compare$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_compare$macrocall$2$macrocall$2"] },
            { name: "expr_compare$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_compare$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_compare$macrocall$2$macrocall$1", symbols: ["expr_compare$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_compare$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_compare$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_compare$macrocall$2", symbols: ["expr_compare$macrocall$2$macrocall$1"] },
            { name: "expr_compare$macrocall$3", symbols: ["expr_compare"] },
            { name: "expr_compare$macrocall$4", symbols: ["expr_range"] },
            { name: "expr_compare$macrocall$1$subexpression$1", symbols: ["expr_compare$macrocall$3"] },
            { name: "expr_compare$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_compare$macrocall$1$subexpression$2", symbols: ["expr_compare$macrocall$4"] },
            { name: "expr_compare$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_compare$macrocall$1", symbols: ["expr_compare$macrocall$1$subexpression$1", "expr_compare$macrocall$2", "expr_compare$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_compare$macrocall$1", symbols: ["expr_compare$macrocall$4"], postprocess: a },
            { name: "expr_compare", symbols: ["expr_compare$macrocall$1"] },
            { name: "expr_range$macrocall$2", symbols: ["ops_between"] },
            { name: "expr_range$macrocall$3", symbols: [o.lexerAny.has("kw_and") ? { type: "kw_and" } : kw_and] },
            { name: "expr_range$macrocall$4", symbols: ["expr_range"] },
            { name: "expr_range$macrocall$5", symbols: ["expr_others"] },
            { name: "expr_range$macrocall$1$subexpression$1", symbols: ["expr_range$macrocall$4"] },
            { name: "expr_range$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_range$macrocall$1$subexpression$2", symbols: ["expr_range$macrocall$4"] },
            { name: "expr_range$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_range$macrocall$1$subexpression$3", symbols: ["expr_range$macrocall$5"] },
            { name: "expr_range$macrocall$1$subexpression$3", symbols: ["expr_paren"] },
            { name: "expr_range$macrocall$1", symbols: ["expr_range$macrocall$1$subexpression$1", "expr_range$macrocall$2", "expr_range$macrocall$1$subexpression$2", "expr_range$macrocall$3", "expr_range$macrocall$1$subexpression$3"], postprocess: (c) => (0, g.track)(c, {
              type: "ternary",
              value: a(c[0]),
              lo: a(c[2]),
              hi: a(c[4]),
              op: (E(c[1]).join(" ") || "<error>").toUpperCase()
            }) },
            { name: "expr_range$macrocall$1", symbols: ["expr_range$macrocall$5"], postprocess: a },
            { name: "expr_range", symbols: ["expr_range$macrocall$1"] },
            { name: "expr_others$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("ops_others") ? { type: "ops_others" } : ops_others] },
            { name: "expr_others$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_others$macrocall$2$macrocall$2"] },
            { name: "expr_others$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_others$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_others$macrocall$2$macrocall$1", symbols: ["expr_others$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_others$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_others$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_others$macrocall$2", symbols: ["expr_others$macrocall$2$macrocall$1"] },
            { name: "expr_others$macrocall$3", symbols: ["expr_others"] },
            { name: "expr_others$macrocall$4", symbols: ["expr_like"] },
            { name: "expr_others$macrocall$1$subexpression$1", symbols: ["expr_others$macrocall$3"] },
            { name: "expr_others$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_others$macrocall$1$subexpression$2", symbols: ["expr_others$macrocall$4"] },
            { name: "expr_others$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_others$macrocall$1", symbols: ["expr_others$macrocall$1$subexpression$1", "expr_others$macrocall$2", "expr_others$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_others$macrocall$1", symbols: ["expr_others$macrocall$4"], postprocess: a },
            { name: "expr_others", symbols: ["expr_others$macrocall$1"] },
            { name: "expr_like$macrocall$2$macrocall$2", symbols: ["ops_like"] },
            { name: "expr_like$macrocall$2$macrocall$1", symbols: ["expr_like$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_like$macrocall$2", symbols: ["expr_like$macrocall$2$macrocall$1"] },
            { name: "expr_like$macrocall$3", symbols: ["expr_like"] },
            { name: "expr_like$macrocall$4", symbols: ["expr_in"] },
            { name: "expr_like$macrocall$1$subexpression$1", symbols: ["expr_like$macrocall$3"] },
            { name: "expr_like$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_like$macrocall$1$subexpression$2", symbols: ["expr_like$macrocall$4"] },
            { name: "expr_like$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_like$macrocall$1", symbols: ["expr_like$macrocall$1$subexpression$1", "expr_like$macrocall$2", "expr_like$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_like$macrocall$1", symbols: ["expr_like$macrocall$4"], postprocess: a },
            { name: "expr_like", symbols: ["expr_like$macrocall$1"] },
            { name: "expr_in$macrocall$2$macrocall$2", symbols: ["ops_in"] },
            { name: "expr_in$macrocall$2$macrocall$1", symbols: ["expr_in$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_in$macrocall$2", symbols: ["expr_in$macrocall$2$macrocall$1"] },
            { name: "expr_in$macrocall$3", symbols: ["expr_in"] },
            { name: "expr_in$macrocall$4", symbols: ["expr_add"] },
            { name: "expr_in$macrocall$1$subexpression$1", symbols: ["expr_in$macrocall$3"] },
            { name: "expr_in$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_in$macrocall$1$subexpression$2", symbols: ["expr_in$macrocall$4"] },
            { name: "expr_in$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_in$macrocall$1", symbols: ["expr_in$macrocall$1$subexpression$1", "expr_in$macrocall$2", "expr_in$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_in$macrocall$1", symbols: ["expr_in$macrocall$4"], postprocess: a },
            { name: "expr_in", symbols: ["expr_in$macrocall$1"] },
            { name: "expr_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_plus") ? { type: "op_plus" } : op_plus] },
            { name: "expr_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_minus") ? { type: "op_minus" } : op_minus] },
            { name: "expr_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_additive") ? { type: "op_additive" } : op_additive] },
            { name: "expr_add$macrocall$2$macrocall$2", symbols: ["expr_add$macrocall$2$macrocall$2$subexpression$1"] },
            { name: "expr_add$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_add$macrocall$2$macrocall$2"] },
            { name: "expr_add$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_add$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_add$macrocall$2$macrocall$1", symbols: ["expr_add$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_add$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_add$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_add$macrocall$2", symbols: ["expr_add$macrocall$2$macrocall$1"] },
            { name: "expr_add$macrocall$3", symbols: ["expr_add"] },
            { name: "expr_add$macrocall$4", symbols: ["expr_mult"] },
            { name: "expr_add$macrocall$1$subexpression$1", symbols: ["expr_add$macrocall$3"] },
            { name: "expr_add$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_add$macrocall$1$subexpression$2", symbols: ["expr_add$macrocall$4"] },
            { name: "expr_add$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_add$macrocall$1", symbols: ["expr_add$macrocall$1$subexpression$1", "expr_add$macrocall$2", "expr_add$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_add$macrocall$1", symbols: ["expr_add$macrocall$4"], postprocess: a },
            { name: "expr_add", symbols: ["expr_add$macrocall$1"] },
            { name: "expr_mult$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("star") ? { type: "star" } : star] },
            { name: "expr_mult$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_div") ? { type: "op_div" } : op_div] },
            { name: "expr_mult$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_mod") ? { type: "op_mod" } : op_mod] },
            { name: "expr_mult$macrocall$2$macrocall$2", symbols: ["expr_mult$macrocall$2$macrocall$2$subexpression$1"] },
            { name: "expr_mult$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_mult$macrocall$2$macrocall$2"] },
            { name: "expr_mult$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_mult$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_mult$macrocall$2$macrocall$1", symbols: ["expr_mult$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_mult$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_mult$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_mult$macrocall$2", symbols: ["expr_mult$macrocall$2$macrocall$1"] },
            { name: "expr_mult$macrocall$3", symbols: ["expr_mult"] },
            { name: "expr_mult$macrocall$4", symbols: ["expr_exp"] },
            { name: "expr_mult$macrocall$1$subexpression$1", symbols: ["expr_mult$macrocall$3"] },
            { name: "expr_mult$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_mult$macrocall$1$subexpression$2", symbols: ["expr_mult$macrocall$4"] },
            { name: "expr_mult$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_mult$macrocall$1", symbols: ["expr_mult$macrocall$1$subexpression$1", "expr_mult$macrocall$2", "expr_mult$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_mult$macrocall$1", symbols: ["expr_mult$macrocall$4"], postprocess: a },
            { name: "expr_mult", symbols: ["expr_mult$macrocall$1"] },
            { name: "expr_exp$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("op_exp") ? { type: "op_exp" } : op_exp] },
            { name: "expr_exp$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_exp$macrocall$2$macrocall$2"] },
            { name: "expr_exp$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_exp$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_exp$macrocall$2$macrocall$1", symbols: ["expr_exp$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_exp$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_exp$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_exp$macrocall$2", symbols: ["expr_exp$macrocall$2$macrocall$1"] },
            { name: "expr_exp$macrocall$3", symbols: ["expr_exp"] },
            { name: "expr_exp$macrocall$4", symbols: ["expr_unary_add"] },
            { name: "expr_exp$macrocall$1$subexpression$1", symbols: ["expr_exp$macrocall$3"] },
            { name: "expr_exp$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_exp$macrocall$1$subexpression$2", symbols: ["expr_exp$macrocall$4"] },
            { name: "expr_exp$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_exp$macrocall$1", symbols: ["expr_exp$macrocall$1$subexpression$1", "expr_exp$macrocall$2", "expr_exp$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_exp$macrocall$1", symbols: ["expr_exp$macrocall$4"], postprocess: a },
            { name: "expr_exp", symbols: ["expr_exp$macrocall$1"] },
            { name: "expr_unary_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_plus") ? { type: "op_plus" } : op_plus] },
            { name: "expr_unary_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_minus") ? { type: "op_minus" } : op_minus] },
            { name: "expr_unary_add$macrocall$2$macrocall$2", symbols: ["expr_unary_add$macrocall$2$macrocall$2$subexpression$1"] },
            { name: "expr_unary_add$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_unary_add$macrocall$2$macrocall$2"] },
            { name: "expr_unary_add$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_unary_add$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_unary_add$macrocall$2$macrocall$1", symbols: ["expr_unary_add$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_unary_add$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_unary_add$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_unary_add$macrocall$2", symbols: ["expr_unary_add$macrocall$2$macrocall$1"] },
            { name: "expr_unary_add$macrocall$3", symbols: ["expr_unary_add"] },
            { name: "expr_unary_add$macrocall$4", symbols: ["expr_various_constructs"] },
            { name: "expr_unary_add$macrocall$1$subexpression$1", symbols: ["expr_unary_add$macrocall$3"] },
            { name: "expr_unary_add$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_unary_add$macrocall$1", symbols: ["expr_unary_add$macrocall$2", "expr_unary_add$macrocall$1$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              type: "unary",
              ...a(c[0]),
              operand: a(c[1])
            }) },
            { name: "expr_unary_add$macrocall$1", symbols: ["expr_unary_add$macrocall$4"], postprocess: a },
            { name: "expr_unary_add", symbols: ["expr_unary_add$macrocall$1"] },
            { name: "expr_various_constructs$macrocall$2$macrocall$2", symbols: ["various_binaries"] },
            { name: "expr_various_constructs$macrocall$2$macrocall$1", symbols: ["expr_various_constructs$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_various_constructs$macrocall$2", symbols: ["expr_various_constructs$macrocall$2$macrocall$1"] },
            { name: "expr_various_constructs$macrocall$3", symbols: ["expr_various_constructs"] },
            { name: "expr_various_constructs$macrocall$4", symbols: ["expr_array_index"] },
            { name: "expr_various_constructs$macrocall$1$subexpression$1", symbols: ["expr_various_constructs$macrocall$3"] },
            { name: "expr_various_constructs$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_various_constructs$macrocall$1$subexpression$2", symbols: ["expr_various_constructs$macrocall$4"] },
            { name: "expr_various_constructs$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_various_constructs$macrocall$1", symbols: ["expr_various_constructs$macrocall$1$subexpression$1", "expr_various_constructs$macrocall$2", "expr_various_constructs$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_various_constructs$macrocall$1", symbols: ["expr_various_constructs$macrocall$4"], postprocess: a },
            { name: "expr_various_constructs", symbols: ["expr_various_constructs$macrocall$1"] },
            { name: "expr_array_index$subexpression$1", symbols: ["expr_array_index"] },
            { name: "expr_array_index$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_array_index", symbols: ["expr_array_index$subexpression$1", o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, "expr_nostar", o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket], postprocess: (c) => (0, g.track)(c, {
              type: "arrayIndex",
              array: a(c[0]),
              index: a(c[2])
            }) },
            { name: "expr_array_index", symbols: ["expr_member"], postprocess: a },
            { name: "expr_member$subexpression$1", symbols: ["expr_member"] },
            { name: "expr_member$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_member$subexpression$2", symbols: ["string"] },
            { name: "expr_member$subexpression$2", symbols: ["int"] },
            { name: "expr_member", symbols: ["expr_member$subexpression$1", "ops_member", "expr_member$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "member",
              operand: a(c[0]),
              op: c[1],
              member: a(c[2])
            }) },
            { name: "expr_member$subexpression$3", symbols: ["expr_member"] },
            { name: "expr_member$subexpression$3", symbols: ["expr_paren"] },
            { name: "expr_member", symbols: ["expr_member$subexpression$3", o.lexerAny.has("op_cast") ? { type: "op_cast" } : op_cast, "data_type"], postprocess: (c) => (0, g.track)(c, {
              type: "cast",
              operand: a(c[0]),
              to: c[2]
            }) },
            { name: "expr_member", symbols: [o.lexerAny.has("kw_cast") ? { type: "kw_cast" } : kw_cast, "lparen", "expr_nostar", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "data_type", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "cast",
              operand: a(c[2]),
              to: c[4]
            }) },
            { name: "expr_member", symbols: ["data_type", "string"], postprocess: (c) => (0, g.track)(c, {
              type: "cast",
              operand: (0, g.track)(c[1], {
                type: "string",
                value: (0, g.unbox)(c[1])
              }),
              to: (0, g.unbox)(c[0])
            }) },
            { name: "expr_member", symbols: ["expr_dot"], postprocess: a },
            { name: "expr_dot$subexpression$1", symbols: ["word"] },
            { name: "expr_dot$subexpression$1", symbols: ["star"] },
            { name: "expr_dot", symbols: ["qname", o.lexerAny.has("dot") ? { type: "dot" } : dot, "expr_dot$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              type: "ref",
              table: a(c[0]),
              name: d(c[2])
            }) },
            { name: "expr_dot", symbols: ["expr_final"], postprocess: a },
            { name: "expr_final", symbols: ["expr_basic"] },
            { name: "expr_final", symbols: ["expr_primary"] },
            { name: "expr_basic", symbols: ["expr_special_calls"] },
            { name: "expr_basic", symbols: ["expr_call"] },
            { name: "expr_basic", symbols: ["expr_array"] },
            { name: "expr_basic", symbols: ["expr_case"] },
            { name: "expr_basic", symbols: ["expr_extract"] },
            { name: "expr_basic", symbols: ["word"], postprocess: (c) => (0, g.track)(c, {
              type: "ref",
              name: a(c[0])
            }) },
            { name: "expr_array$ebnf$1", symbols: ["expr_subarray_items"], postprocess: n },
            { name: "expr_array$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_array", symbols: [o.lexerAny.has("kw_array") ? { type: "kw_array" } : kw_array, o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, "expr_array$ebnf$1", o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket], postprocess: (c) => (0, g.track)(c, {
              type: "array",
              expressions: c[2] || []
            }) },
            { name: "expr_array", symbols: [o.lexerAny.has("kw_array") ? { type: "kw_array" } : kw_array, "lparen", "selection", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "array select",
              select: a(c[2])
            }) },
            { name: "expr_subarray$ebnf$1", symbols: ["expr_subarray_items"], postprocess: n },
            { name: "expr_subarray$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_subarray", symbols: [o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, "expr_subarray$ebnf$1", o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket], postprocess: C(1) },
            { name: "expr_subarray_items$macrocall$2", symbols: ["expr_list_item"] },
            { name: "expr_subarray_items$macrocall$1$ebnf$1", symbols: [] },
            { name: "expr_subarray_items$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_subarray_items$macrocall$2"], postprocess: B },
            { name: "expr_subarray_items$macrocall$1$ebnf$1", symbols: ["expr_subarray_items$macrocall$1$ebnf$1", "expr_subarray_items$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_subarray_items$macrocall$1", symbols: ["expr_subarray_items$macrocall$2", "expr_subarray_items$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "expr_subarray_items", symbols: ["expr_subarray_items$macrocall$1"], postprocess: (c) => c[0].map(a) },
            { name: "expr_subarray_items$macrocall$4", symbols: ["expr_subarray"] },
            { name: "expr_subarray_items$macrocall$3$ebnf$1", symbols: [] },
            { name: "expr_subarray_items$macrocall$3$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_subarray_items$macrocall$4"], postprocess: B },
            { name: "expr_subarray_items$macrocall$3$ebnf$1", symbols: ["expr_subarray_items$macrocall$3$ebnf$1", "expr_subarray_items$macrocall$3$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_subarray_items$macrocall$3", symbols: ["expr_subarray_items$macrocall$4", "expr_subarray_items$macrocall$3$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "expr_subarray_items", symbols: ["expr_subarray_items$macrocall$3"], postprocess: (c) => c[0].map((J) => (0, g.track)(J, {
              type: "array",
              expressions: J[0].map(a)
            })) },
            { name: "expr_function_call$ebnf$1", symbols: ["expr_list_raw"], postprocess: n },
            { name: "expr_function_call$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_function_call", symbols: ["expr_fn_name", "lparen", "expr_function_call$ebnf$1", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "call",
              function: a(c[0]),
              args: c[2] || []
            }) },
            { name: "expr_call$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all] },
            { name: "expr_call$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_distinct") ? { type: "kw_distinct" } : kw_distinct] },
            { name: "expr_call$ebnf$1", symbols: ["expr_call$ebnf$1$subexpression$1"], postprocess: n },
            { name: "expr_call$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_call$ebnf$2", symbols: ["expr_list_raw"], postprocess: n },
            { name: "expr_call$ebnf$2", symbols: [], postprocess: () => null },
            { name: "expr_call$ebnf$3", symbols: ["select_order_by"], postprocess: n },
            { name: "expr_call$ebnf$3", symbols: [], postprocess: () => null },
            { name: "expr_call$ebnf$4$subexpression$1", symbols: ["kw_filter", "lparen", o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where, "expr", "rparen"], postprocess: C(3) },
            { name: "expr_call$ebnf$4", symbols: ["expr_call$ebnf$4$subexpression$1"], postprocess: n },
            { name: "expr_call$ebnf$4", symbols: [], postprocess: () => null },
            { name: "expr_call$ebnf$5", symbols: ["expr_call_over"], postprocess: n },
            { name: "expr_call$ebnf$5", symbols: [], postprocess: () => null },
            { name: "expr_call", symbols: ["expr_fn_name", "lparen", "expr_call$ebnf$1", "expr_call$ebnf$2", "expr_call$ebnf$3", "rparen", "expr_call$ebnf$4", "expr_call$ebnf$5"], postprocess: (c) => (0, g.track)(c, {
              type: "call",
              function: a(c[0]),
              ...c[2] && { distinct: d(c[2]) },
              args: c[3] || [],
              ...c[4] && { orderBy: c[4] },
              ...c[6] && { filter: a(c[6]) },
              ...c[7] && { over: a(c[7]) }
            }) },
            { name: "expr_call_over$ebnf$1$subexpression$1", symbols: ["kw_partition", "kw_by", "expr_list_raw"], postprocess: B },
            { name: "expr_call_over$ebnf$1", symbols: ["expr_call_over$ebnf$1$subexpression$1"], postprocess: n },
            { name: "expr_call_over$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_call_over$ebnf$2", symbols: ["select_order_by"], postprocess: n },
            { name: "expr_call_over$ebnf$2", symbols: [], postprocess: () => null },
            { name: "expr_call_over", symbols: ["kw_over", "lparen", "expr_call_over$ebnf$1", "expr_call_over$ebnf$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              ...c[2] && { partitionBy: c[2] },
              ...c[3] && { orderBy: c[3] }
            }) },
            { name: "expr_extract$subexpression$1", symbols: ["word"], postprocess: G("extract") },
            { name: "expr_extract", symbols: ["expr_extract$subexpression$1", "lparen", "word", o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "expr", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "extract",
              field: s(c[2]),
              from: c[4]
            }) },
            { name: "expr_primary", symbols: ["float"], postprocess: (c) => (0, g.track)(c, { type: "numeric", value: (0, g.unbox)(c[0]) }) },
            { name: "expr_primary", symbols: ["int"], postprocess: (c) => (0, g.track)(c, { type: "integer", value: (0, g.unbox)(c[0]) }) },
            { name: "expr_primary", symbols: ["string"], postprocess: (c) => (0, g.track)(c, { type: "string", value: (0, g.unbox)(c[0]) }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("kw_true") ? { type: "kw_true" } : kw_true], postprocess: (c) => (0, g.track)(c, { type: "boolean", value: !0 }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("kw_false") ? { type: "kw_false" } : kw_false], postprocess: (c) => (0, g.track)(c, { type: "boolean", value: !1 }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null], postprocess: (c) => (0, g.track)(c, { type: "null" }) },
            { name: "expr_primary", symbols: ["value_keyword"], postprocess: (c) => (0, g.track)(c, { type: "keyword", keyword: d(c) }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("qparam") ? { type: "qparam" } : qparam], postprocess: (c) => (0, g.track)(c, { type: "parameter", name: d(c[0]) }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default], postprocess: (c) => (0, g.track)(c, { type: "default" }) },
            { name: "ops_like", symbols: ["ops_like_keywors"] },
            { name: "ops_like", symbols: ["ops_like_operators"] },
            { name: "ops_like_keywors$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "ops_like_keywors$ebnf$1", symbols: [], postprocess: () => null },
            { name: "ops_like_keywors$subexpression$1", symbols: [o.lexerAny.has("kw_like") ? { type: "kw_like" } : kw_like] },
            { name: "ops_like_keywors$subexpression$1", symbols: [o.lexerAny.has("kw_ilike") ? { type: "kw_ilike" } : kw_ilike] },
            { name: "ops_like_keywors", symbols: ["ops_like_keywors$ebnf$1", "ops_like_keywors$subexpression$1"] },
            { name: "ops_like_operators$subexpression$1", symbols: [o.lexerAny.has("op_like") ? { type: "op_like" } : op_like], postprocess: () => "LIKE" },
            { name: "ops_like_operators", symbols: ["ops_like_operators$subexpression$1"] },
            { name: "ops_like_operators$subexpression$2", symbols: [o.lexerAny.has("op_ilike") ? { type: "op_ilike" } : op_ilike], postprocess: () => "ILIKE" },
            { name: "ops_like_operators", symbols: ["ops_like_operators$subexpression$2"] },
            { name: "ops_like_operators$subexpression$3", symbols: [o.lexerAny.has("op_not_like") ? { type: "op_not_like" } : op_not_like], postprocess: () => "NOT LIKE" },
            { name: "ops_like_operators", symbols: ["ops_like_operators$subexpression$3"] },
            { name: "ops_like_operators$subexpression$4", symbols: [o.lexerAny.has("op_not_ilike") ? { type: "op_not_ilike" } : op_not_ilike], postprocess: () => "NOT ILIKE" },
            { name: "ops_like_operators", symbols: ["ops_like_operators$subexpression$4"] },
            { name: "ops_in$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "ops_in$ebnf$1", symbols: [], postprocess: () => null },
            { name: "ops_in", symbols: ["ops_in$ebnf$1", o.lexerAny.has("kw_in") ? { type: "kw_in" } : kw_in] },
            { name: "ops_between$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "ops_between$ebnf$1", symbols: [], postprocess: () => null },
            { name: "ops_between", symbols: ["ops_between$ebnf$1", "kw_between"] },
            { name: "ops_member$subexpression$1", symbols: [o.lexerAny.has("op_member") ? { type: "op_member" } : op_member] },
            { name: "ops_member$subexpression$1", symbols: [o.lexerAny.has("op_membertext") ? { type: "op_membertext" } : op_membertext] },
            { name: "ops_member", symbols: ["ops_member$subexpression$1"], postprocess: (c) => {
              var J;
              return (J = a(c)) === null || J === void 0 ? void 0 : J.value;
            } },
            { name: "expr_list_item", symbols: ["expr_or_select"], postprocess: a },
            { name: "expr_list_item", symbols: ["expr_star"], postprocess: a },
            { name: "expr_list_raw$macrocall$2", symbols: ["expr_list_item"] },
            { name: "expr_list_raw$macrocall$1$ebnf$1", symbols: [] },
            { name: "expr_list_raw$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_list_raw$macrocall$2"], postprocess: B },
            { name: "expr_list_raw$macrocall$1$ebnf$1", symbols: ["expr_list_raw$macrocall$1$ebnf$1", "expr_list_raw$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_list_raw$macrocall$1", symbols: ["expr_list_raw$macrocall$2", "expr_list_raw$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "expr_list_raw", symbols: ["expr_list_raw$macrocall$1"], postprocess: ([c]) => c.map(a) },
            { name: "expr_list_raw_many$macrocall$2", symbols: ["expr_list_item"] },
            { name: "expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_list_raw_many$macrocall$2"], postprocess: B },
            { name: "expr_list_raw_many$macrocall$1$ebnf$1", symbols: ["expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1"] },
            { name: "expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_list_raw_many$macrocall$2"], postprocess: B },
            { name: "expr_list_raw_many$macrocall$1$ebnf$1", symbols: ["expr_list_raw_many$macrocall$1$ebnf$1", "expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_list_raw_many$macrocall$1", symbols: ["expr_list_raw_many$macrocall$2", "expr_list_raw_many$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "expr_list_raw_many", symbols: ["expr_list_raw_many$macrocall$1"], postprocess: ([c]) => c.map(a) },
            { name: "expr_or_select", symbols: ["expr_nostar"], postprocess: a },
            { name: "expr_or_select", symbols: ["selection"], postprocess: a },
            { name: "expr_list_many", symbols: ["expr_list_raw_many"], postprocess: (c) => (0, g.track)(c, {
              type: "list",
              expressions: c[0]
            }) },
            { name: "expr_case$ebnf$1", symbols: ["expr_nostar"], postprocess: n },
            { name: "expr_case$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_case$ebnf$2", symbols: [] },
            { name: "expr_case$ebnf$2", symbols: ["expr_case$ebnf$2", "expr_case_whens"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_case$ebnf$3", symbols: ["expr_case_else"], postprocess: n },
            { name: "expr_case$ebnf$3", symbols: [], postprocess: () => null },
            { name: "expr_case", symbols: [o.lexerAny.has("kw_case") ? { type: "kw_case" } : kw_case, "expr_case$ebnf$1", "expr_case$ebnf$2", "expr_case$ebnf$3", o.lexerAny.has("kw_end") ? { type: "kw_end" } : kw_end], postprocess: (c) => (0, g.track)(c, {
              type: "case",
              value: c[1],
              whens: c[2],
              else: c[3]
            }) },
            { name: "expr_case_whens", symbols: [o.lexerAny.has("kw_when") ? { type: "kw_when" } : kw_when, "expr_nostar", o.lexerAny.has("kw_then") ? { type: "kw_then" } : kw_then, "expr_nostar"], postprocess: (c) => (0, g.track)(c, {
              when: c[1],
              value: c[3]
            }) },
            { name: "expr_case_else", symbols: [o.lexerAny.has("kw_else") ? { type: "kw_else" } : kw_else, "expr_nostar"], postprocess: B },
            { name: "expr_fn_name$subexpression$1$ebnf$1$subexpression$1", symbols: ["word", o.lexerAny.has("dot") ? { type: "dot" } : dot] },
            { name: "expr_fn_name$subexpression$1$ebnf$1", symbols: ["expr_fn_name$subexpression$1$ebnf$1$subexpression$1"], postprocess: n },
            { name: "expr_fn_name$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_fn_name$subexpression$1", symbols: ["expr_fn_name$subexpression$1$ebnf$1", "word_or_keyword"], postprocess: (c) => (0, g.track)(c, {
              name: (0, g.unbox)(a(c[1])),
              ...c[0] && { schema: d(c[0][0]) }
            }) },
            { name: "expr_fn_name", symbols: ["expr_fn_name$subexpression$1"] },
            { name: "expr_fn_name$subexpression$2$subexpression$1", symbols: [o.lexerAny.has("kw_any") ? { type: "kw_any" } : kw_any] },
            { name: "expr_fn_name$subexpression$2$subexpression$1", symbols: [o.lexerAny.has("kw_some") ? { type: "kw_some" } : kw_some] },
            { name: "expr_fn_name$subexpression$2$subexpression$1", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all] },
            { name: "expr_fn_name$subexpression$2", symbols: ["expr_fn_name$subexpression$2$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              name: d(a(c))
            }) },
            { name: "expr_fn_name", symbols: ["expr_fn_name$subexpression$2"] },
            { name: "word_or_keyword", symbols: ["word"] },
            { name: "word_or_keyword", symbols: ["value_keyword"], postprocess: (c) => (0, g.box)(c, d(c)) },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_catalog") ? { type: "kw_current_catalog" } : kw_current_catalog] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_date") ? { type: "kw_current_date" } : kw_current_date] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_role") ? { type: "kw_current_role" } : kw_current_role] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_schema") ? { type: "kw_current_schema" } : kw_current_schema] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_timestamp") ? { type: "kw_current_timestamp" } : kw_current_timestamp] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_time") ? { type: "kw_current_time" } : kw_current_time] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_localtimestamp") ? { type: "kw_localtimestamp" } : kw_localtimestamp] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_localtime") ? { type: "kw_localtime" } : kw_localtime] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_session_user") ? { type: "kw_session_user" } : kw_session_user] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_user") ? { type: "kw_user" } : kw_user] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_user") ? { type: "kw_current_user" } : kw_current_user] },
            { name: "expr_special_calls", symbols: ["spe_overlay"] },
            { name: "expr_special_calls", symbols: ["spe_substring"] },
            { name: "spe_overlay$subexpression$1", symbols: ["word"], postprocess: G("overlay") },
            { name: "spe_overlay$subexpression$2", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen, "expr_nostar"] },
            { name: "spe_overlay$subexpression$3", symbols: [o.lexerAny.has("kw_placing") ? { type: "kw_placing" } : kw_placing, "expr_nostar"] },
            { name: "spe_overlay$subexpression$4", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "expr_nostar"] },
            { name: "spe_overlay$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_for") ? { type: "kw_for" } : kw_for, "expr_nostar"] },
            { name: "spe_overlay$ebnf$1", symbols: ["spe_overlay$ebnf$1$subexpression$1"], postprocess: n },
            { name: "spe_overlay$ebnf$1", symbols: [], postprocess: () => null },
            { name: "spe_overlay", symbols: ["spe_overlay$subexpression$1", "spe_overlay$subexpression$2", "spe_overlay$subexpression$3", "spe_overlay$subexpression$4", "spe_overlay$ebnf$1", o.lexerAny.has("rparen") ? { type: "rparen" } : rparen], postprocess: (c) => (0, g.track)(c, {
              type: "overlay",
              value: c[1][1],
              placing: c[2][1],
              from: c[3][1],
              ...c[4] && { for: c[4][1] }
            }) },
            { name: "spe_substring$subexpression$1", symbols: ["word"], postprocess: G("substring") },
            { name: "spe_substring$subexpression$2", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen, "expr_nostar"] },
            { name: "spe_substring$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "expr_nostar"] },
            { name: "spe_substring$ebnf$1", symbols: ["spe_substring$ebnf$1$subexpression$1"], postprocess: n },
            { name: "spe_substring$ebnf$1", symbols: [], postprocess: () => null },
            { name: "spe_substring$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("kw_for") ? { type: "kw_for" } : kw_for, "expr_nostar"] },
            { name: "spe_substring$ebnf$2", symbols: ["spe_substring$ebnf$2$subexpression$1"], postprocess: n },
            { name: "spe_substring$ebnf$2", symbols: [], postprocess: () => null },
            { name: "spe_substring", symbols: ["spe_substring$subexpression$1", "spe_substring$subexpression$2", "spe_substring$ebnf$1", "spe_substring$ebnf$2", o.lexerAny.has("rparen") ? { type: "rparen" } : rparen], postprocess: (c) => (0, g.track)(c, {
              type: "substring",
              value: c[1][1],
              ...c[2] && { from: c[2][1] },
              ...c[3] && { for: c[3][1] }
            }) },
            { name: "various_binaries", symbols: ["kw_at", "kw_time", "kw_zone"], postprocess: () => "AT TIME ZONE" },
            { name: "createtable_statement$ebnf$1", symbols: ["createtable_modifiers"], postprocess: n },
            { name: "createtable_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtable_statement$ebnf$2", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "createtable_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "createtable_statement$ebnf$3", symbols: ["createtable_opts"], postprocess: n },
            { name: "createtable_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "createtable_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "createtable_statement$ebnf$1", o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table, "createtable_statement$ebnf$2", "qname", "lparen", "createtable_declarationlist", "rparen", "createtable_statement$ebnf$3"], postprocess: (c) => {
              const J = c[6].filter((N) => "kind" in N), p = c[6].filter((N) => !("kind" in N));
              return (0, g.track)(c, {
                type: "create table",
                ...c[3] ? { ifNotExists: !0 } : {},
                name: c[4],
                columns: J,
                ...a(c[1]),
                ...p.length ? { constraints: p } : {},
                ...B(c)
              });
            } },
            { name: "createtable_modifiers", symbols: ["kw_unlogged"], postprocess: (c) => c[0] ? { unlogged: !0 } : {} },
            { name: "createtable_modifiers", symbols: ["m_locglob"] },
            { name: "createtable_modifiers", symbols: ["m_tmp"] },
            { name: "createtable_modifiers", symbols: ["m_locglob", "m_tmp"], postprocess: ([c, J]) => ({ ...c, ...J }) },
            { name: "m_locglob$subexpression$1", symbols: ["kw_local"] },
            { name: "m_locglob$subexpression$1", symbols: ["kw_global"] },
            { name: "m_locglob", symbols: ["m_locglob$subexpression$1"], postprocess: (c) => ({ locality: d(c) }) },
            { name: "m_tmp$subexpression$1", symbols: ["kw_temp"] },
            { name: "m_tmp$subexpression$1", symbols: ["kw_temporary"] },
            { name: "m_tmp", symbols: ["m_tmp$subexpression$1"], postprocess: (c) => ({ temporary: !0 }) },
            { name: "createtable_declarationlist$ebnf$1", symbols: [] },
            { name: "createtable_declarationlist$ebnf$1$subexpression$1", symbols: ["comma", "createtable_declaration"], postprocess: B },
            { name: "createtable_declarationlist$ebnf$1", symbols: ["createtable_declarationlist$ebnf$1", "createtable_declarationlist$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_declarationlist", symbols: ["createtable_declaration", "createtable_declarationlist$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "createtable_declaration$subexpression$1", symbols: ["createtable_constraint"] },
            { name: "createtable_declaration$subexpression$1", symbols: ["createtable_column"] },
            { name: "createtable_declaration$subexpression$1", symbols: ["createtable_like"] },
            { name: "createtable_declaration", symbols: ["createtable_declaration$subexpression$1"], postprocess: a },
            { name: "createtable_constraint$macrocall$2", symbols: ["createtable_constraint_def"] },
            { name: "createtable_constraint$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "word"] },
            { name: "createtable_constraint$macrocall$1$ebnf$1", symbols: ["createtable_constraint$macrocall$1$ebnf$1$subexpression$1"], postprocess: n },
            { name: "createtable_constraint$macrocall$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtable_constraint$macrocall$1", symbols: ["createtable_constraint$macrocall$1$ebnf$1", "createtable_constraint$macrocall$2"], postprocess: (c) => {
              const J = c[0] && s(c[0][1]);
              return J ? (0, g.track)(c, {
                constraintName: J,
                ...a(c[1])
              }) : (0, g.track)(c, a(c[1]));
            } },
            { name: "createtable_constraint", symbols: ["createtable_constraint$macrocall$1"], postprocess: a },
            { name: "createtable_constraint_def", symbols: ["createtable_constraint_def_unique"] },
            { name: "createtable_constraint_def", symbols: ["createtable_constraint_def_check"] },
            { name: "createtable_constraint_def", symbols: ["createtable_constraint_foreignkey"] },
            { name: "createtable_constraint_def_unique$subexpression$1", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique] },
            { name: "createtable_constraint_def_unique$subexpression$1", symbols: ["kw_primary_key"] },
            { name: "createtable_constraint_def_unique", symbols: ["createtable_constraint_def_unique$subexpression$1", "lparen", "createtable_collist", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: d(c[0], " "),
              columns: c[2].map(s)
            }) },
            { name: "createtable_constraint_def_check", symbols: [o.lexerAny.has("kw_check") ? { type: "kw_check" } : kw_check, "expr_paren"], postprocess: (c) => (0, g.track)(c, {
              type: "check",
              expr: a(c[1])
            }) },
            { name: "createtable_constraint_foreignkey", symbols: [o.lexerAny.has("kw_foreign") ? { type: "kw_foreign" } : kw_foreign, "kw_key", "collist_paren", "createtable_references"], postprocess: (c) => (0, g.track)(c, {
              type: "foreign key",
              localColumns: c[2].map(s),
              ...c[3]
            }) },
            { name: "createtable_references$ebnf$1", symbols: [] },
            { name: "createtable_references$ebnf$1", symbols: ["createtable_references$ebnf$1", "createtable_constraint_foreignkey_onsometing"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_references", symbols: [o.lexerAny.has("kw_references") ? { type: "kw_references" } : kw_references, "table_ref", "collist_paren", "createtable_references$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              foreignTable: a(c[1]),
              foreignColumns: c[2].map(s),
              ...c[3].reduce((J, p) => ({ ...J, ...p }), {})
            }) },
            { name: "createtable_constraint_foreignkey_onsometing", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "kw_delete", "createtable_constraint_on_action"], postprocess: (c) => (0, g.track)(c, { onDelete: B(c) }) },
            { name: "createtable_constraint_foreignkey_onsometing", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "kw_update", "createtable_constraint_on_action"], postprocess: (c) => (0, g.track)(c, { onUpdate: B(c) }) },
            { name: "createtable_constraint_foreignkey_onsometing$subexpression$1", symbols: [o.lexerAny.has("kw_full") ? { type: "kw_full" } : kw_full] },
            { name: "createtable_constraint_foreignkey_onsometing$subexpression$1", symbols: ["kw_partial"] },
            { name: "createtable_constraint_foreignkey_onsometing$subexpression$1", symbols: ["kw_simple"] },
            { name: "createtable_constraint_foreignkey_onsometing", symbols: ["kw_match", "createtable_constraint_foreignkey_onsometing$subexpression$1"], postprocess: (c) => (0, g.track)(c, { match: d(B(c)) }) },
            { name: "createtable_constraint_on_action$subexpression$1", symbols: ["kw_cascade"] },
            { name: "createtable_constraint_on_action$subexpression$1$subexpression$1", symbols: ["kw_no", "kw_action"] },
            { name: "createtable_constraint_on_action$subexpression$1", symbols: ["createtable_constraint_on_action$subexpression$1$subexpression$1"] },
            { name: "createtable_constraint_on_action$subexpression$1", symbols: ["kw_restrict"] },
            { name: "createtable_constraint_on_action$subexpression$1$subexpression$2", symbols: [o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null] },
            { name: "createtable_constraint_on_action$subexpression$1$subexpression$2", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default] },
            { name: "createtable_constraint_on_action$subexpression$1", symbols: ["kw_set", "createtable_constraint_on_action$subexpression$1$subexpression$2"] },
            { name: "createtable_constraint_on_action", symbols: ["createtable_constraint_on_action$subexpression$1"], postprocess: (c) => d(c, " ") },
            { name: "createtable_collist$ebnf$1", symbols: [] },
            { name: "createtable_collist$ebnf$1$subexpression$1", symbols: ["comma", "ident"], postprocess: B },
            { name: "createtable_collist$ebnf$1", symbols: ["createtable_collist$ebnf$1", "createtable_collist$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_collist", symbols: ["ident", "createtable_collist$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "createtable_column$ebnf$1", symbols: ["createtable_collate"], postprocess: n },
            { name: "createtable_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtable_column$ebnf$2", symbols: [] },
            { name: "createtable_column$ebnf$2", symbols: ["createtable_column$ebnf$2", "createtable_column_constraint"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_column", symbols: ["word", "data_type", "createtable_column$ebnf$1", "createtable_column$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              kind: "column",
              name: s(c[0]),
              dataType: c[1],
              ...c[2] ? { collate: c[2][1] } : {},
              ...c[3] && c[3].length ? { constraints: c[3] } : {}
            }) },
            { name: "createtable_like$ebnf$1", symbols: [] },
            { name: "createtable_like$ebnf$1", symbols: ["createtable_like$ebnf$1", "createtable_like_opt"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_like", symbols: [o.lexerAny.has("kw_like") ? { type: "kw_like" } : kw_like, "qname", "createtable_like$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              kind: "like table",
              like: c[1],
              options: c[2]
            }) },
            { name: "createtable_like_opt$subexpression$1", symbols: ["kw_including"] },
            { name: "createtable_like_opt$subexpression$1", symbols: ["kw_excluding"] },
            { name: "createtable_like_opt", symbols: ["createtable_like_opt$subexpression$1", "createtable_like_opt_val"], postprocess: (c) => (0, g.track)(c, {
              verb: d(c[0]),
              option: d(c[1])
            }) },
            { name: "createtable_like_opt_val", symbols: ["word"], postprocess: R("defaults", "constraints", "indexes", "storage", "comments") },
            { name: "createtable_like_opt_val", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all] },
            { name: "createtable_column_constraint$macrocall$2", symbols: ["createtable_column_constraint_def"] },
            { name: "createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "word"] },
            { name: "createtable_column_constraint$macrocall$1$ebnf$1", symbols: ["createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1"], postprocess: n },
            { name: "createtable_column_constraint$macrocall$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtable_column_constraint$macrocall$1", symbols: ["createtable_column_constraint$macrocall$1$ebnf$1", "createtable_column_constraint$macrocall$2"], postprocess: (c) => {
              const J = c[0] && s(c[0][1]);
              return J ? (0, g.track)(c, {
                constraintName: J,
                ...a(c[1])
              }) : (0, g.track)(c, a(c[1]));
            } },
            { name: "createtable_column_constraint", symbols: ["createtable_column_constraint$macrocall$1"], postprocess: a },
            { name: "createtable_column_constraint_def", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique], postprocess: (c) => (0, g.track)(c, { type: "unique" }) },
            { name: "createtable_column_constraint_def", symbols: ["kw_primary_key"], postprocess: (c) => (0, g.track)(c, { type: "primary key" }) },
            { name: "createtable_column_constraint_def", symbols: ["kw_not_null"], postprocess: (c) => (0, g.track)(c, { type: "not null" }) },
            { name: "createtable_column_constraint_def", symbols: [o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null], postprocess: (c) => (0, g.track)(c, { type: "null" }) },
            { name: "createtable_column_constraint_def", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default, "expr"], postprocess: (c) => (0, g.track)(c, { type: "default", default: a(c[1]) }) },
            { name: "createtable_column_constraint_def", symbols: [o.lexerAny.has("kw_check") ? { type: "kw_check" } : kw_check, "expr_paren"], postprocess: (c) => (0, g.track)(c, { type: "check", expr: a(c[1]) }) },
            { name: "createtable_column_constraint_def", symbols: ["createtable_references"], postprocess: (c) => (0, g.track)(c, { type: "reference", ...a(c) }) },
            { name: "createtable_column_constraint_def", symbols: ["altercol_generated"] },
            { name: "createtable_collate", symbols: [o.lexerAny.has("kw_collate") ? { type: "kw_collate" } : kw_collate, "qualified_name"] },
            { name: "createtable_opts$subexpression$1", symbols: ["word"], postprocess: G("inherits") },
            { name: "createtable_opts$macrocall$2", symbols: ["qname"] },
            { name: "createtable_opts$macrocall$1$ebnf$1", symbols: [] },
            { name: "createtable_opts$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "createtable_opts$macrocall$2"], postprocess: B },
            { name: "createtable_opts$macrocall$1$ebnf$1", symbols: ["createtable_opts$macrocall$1$ebnf$1", "createtable_opts$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_opts$macrocall$1", symbols: ["createtable_opts$macrocall$2", "createtable_opts$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "createtable_opts", symbols: ["createtable_opts$subexpression$1", "lparen", "createtable_opts$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, { inherits: c[2] }) },
            { name: "createindex_statement$ebnf$1", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique], postprocess: n },
            { name: "createindex_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$2", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "createindex_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$3", symbols: ["word"], postprocess: n },
            { name: "createindex_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$4$subexpression$1", symbols: [o.lexerAny.has("kw_using") ? { type: "kw_using" } : kw_using, "ident"], postprocess: B },
            { name: "createindex_statement$ebnf$4", symbols: ["createindex_statement$ebnf$4$subexpression$1"], postprocess: n },
            { name: "createindex_statement$ebnf$4", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$5", symbols: ["createindex_with"], postprocess: n },
            { name: "createindex_statement$ebnf$5", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$6", symbols: ["createindex_tblspace"], postprocess: n },
            { name: "createindex_statement$ebnf$6", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$7", symbols: ["createindex_predicate"], postprocess: n },
            { name: "createindex_statement$ebnf$7", symbols: [], postprocess: () => null },
            { name: "createindex_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "createindex_statement$ebnf$1", "kw_index", "createindex_statement$ebnf$2", "createindex_statement$ebnf$3", o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "table_ref", "createindex_statement$ebnf$4", "lparen", "createindex_expressions", "rparen", "createindex_statement$ebnf$5", "createindex_statement$ebnf$6", "createindex_statement$ebnf$7"], postprocess: (c) => (0, g.track)(c, {
              type: "create index",
              ...c[1] && { unique: !0 },
              ...c[3] && { ifNotExists: !0 },
              ...c[4] && { indexName: s(c[4]) },
              table: c[6],
              ...c[7] && { using: s(c[7]) },
              expressions: c[9],
              ...c[11] && { with: c[11] },
              ...c[12] && { tablespace: a(c[12]) },
              ...c[13] && { where: a(c[13]) }
            }) },
            { name: "createindex_expressions$ebnf$1", symbols: [] },
            { name: "createindex_expressions$ebnf$1$subexpression$1", symbols: ["comma", "createindex_expression"], postprocess: B },
            { name: "createindex_expressions$ebnf$1", symbols: ["createindex_expressions$ebnf$1", "createindex_expressions$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createindex_expressions", symbols: ["createindex_expression", "createindex_expressions$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "createindex_expression$subexpression$1", symbols: ["expr_basic"] },
            { name: "createindex_expression$subexpression$1", symbols: ["expr_paren"] },
            { name: "createindex_expression$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_collate") ? { type: "kw_collate" } : kw_collate, "qualified_name"], postprocess: B },
            { name: "createindex_expression$ebnf$1", symbols: ["createindex_expression$ebnf$1$subexpression$1"], postprocess: n },
            { name: "createindex_expression$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createindex_expression$ebnf$2", symbols: ["qualified_name"], postprocess: n },
            { name: "createindex_expression$ebnf$2", symbols: [], postprocess: () => null },
            { name: "createindex_expression$ebnf$3$subexpression$1", symbols: [o.lexerAny.has("kw_asc") ? { type: "kw_asc" } : kw_asc] },
            { name: "createindex_expression$ebnf$3$subexpression$1", symbols: [o.lexerAny.has("kw_desc") ? { type: "kw_desc" } : kw_desc] },
            { name: "createindex_expression$ebnf$3", symbols: ["createindex_expression$ebnf$3$subexpression$1"], postprocess: n },
            { name: "createindex_expression$ebnf$3", symbols: [], postprocess: () => null },
            { name: "createindex_expression$ebnf$4$subexpression$1$subexpression$1", symbols: ["kw_first"] },
            { name: "createindex_expression$ebnf$4$subexpression$1$subexpression$1", symbols: ["kw_last"] },
            { name: "createindex_expression$ebnf$4$subexpression$1", symbols: ["kw_nulls", "createindex_expression$ebnf$4$subexpression$1$subexpression$1"], postprocess: B },
            { name: "createindex_expression$ebnf$4", symbols: ["createindex_expression$ebnf$4$subexpression$1"], postprocess: n },
            { name: "createindex_expression$ebnf$4", symbols: [], postprocess: () => null },
            { name: "createindex_expression", symbols: ["createindex_expression$subexpression$1", "createindex_expression$ebnf$1", "createindex_expression$ebnf$2", "createindex_expression$ebnf$3", "createindex_expression$ebnf$4"], postprocess: (c) => (0, g.track)(c, {
              expression: a(c[0]),
              ...c[1] && { collate: a(c[1]) },
              ...c[2] && { opclass: a(c[2]) },
              ...c[3] && { order: a(c[3]).value },
              ...c[4] && { nulls: a(c[4]) }
            }) },
            { name: "createindex_predicate", symbols: [o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where, "expr"], postprocess: B },
            { name: "createindex_with$macrocall$2", symbols: ["createindex_with_item"] },
            { name: "createindex_with$macrocall$1$ebnf$1", symbols: [] },
            { name: "createindex_with$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "createindex_with$macrocall$2"], postprocess: B },
            { name: "createindex_with$macrocall$1$ebnf$1", symbols: ["createindex_with$macrocall$1$ebnf$1", "createindex_with$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createindex_with$macrocall$1", symbols: ["createindex_with$macrocall$2", "createindex_with$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "createindex_with", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "lparen", "createindex_with$macrocall$1", "rparen"], postprocess: C(2) },
            { name: "createindex_with_item$subexpression$1", symbols: ["string"] },
            { name: "createindex_with_item$subexpression$1", symbols: ["int"] },
            { name: "createindex_with_item", symbols: ["ident", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "createindex_with_item$subexpression$1"], postprocess: (c) => (0, g.track)(c, { parameter: d(c[0]), value: a(c[2]).toString() }) },
            { name: "createindex_tblspace", symbols: ["kw_tablespace", "ident"], postprocess: B },
            { name: "createextension_statement$ebnf$1", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "createextension_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createextension_statement$ebnf$2", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with], postprocess: n },
            { name: "createextension_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "createextension_statement$ebnf$3$subexpression$1", symbols: ["kw_schema", "word"], postprocess: B },
            { name: "createextension_statement$ebnf$3", symbols: ["createextension_statement$ebnf$3$subexpression$1"], postprocess: n },
            { name: "createextension_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "createextension_statement$ebnf$4$subexpression$1", symbols: ["kw_version", "string"], postprocess: B },
            { name: "createextension_statement$ebnf$4", symbols: ["createextension_statement$ebnf$4$subexpression$1"], postprocess: n },
            { name: "createextension_statement$ebnf$4", symbols: [], postprocess: () => null },
            { name: "createextension_statement$ebnf$5$subexpression$1", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "string"], postprocess: B },
            { name: "createextension_statement$ebnf$5", symbols: ["createextension_statement$ebnf$5$subexpression$1"], postprocess: n },
            { name: "createextension_statement$ebnf$5", symbols: [], postprocess: () => null },
            { name: "createextension_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "kw_extension", "createextension_statement$ebnf$1", "word", "createextension_statement$ebnf$2", "createextension_statement$ebnf$3", "createextension_statement$ebnf$4", "createextension_statement$ebnf$5"], postprocess: (c) => (0, g.track)(c, {
              type: "create extension",
              ...c[2] ? { ifNotExists: !0 } : {},
              extension: s(c[3]),
              ...c[5] ? { schema: s(c[5]) } : {},
              ...c[6] ? { version: r(c[6]) } : {},
              ...c[7] ? { from: r(c[7]) } : {}
            }) },
            { name: "simplestatements_all", symbols: ["simplestatements_start_transaction"] },
            { name: "simplestatements_all", symbols: ["simplestatements_commit"] },
            { name: "simplestatements_all", symbols: ["simplestatements_rollback"] },
            { name: "simplestatements_all", symbols: ["simplestatements_tablespace"] },
            { name: "simplestatements_all", symbols: ["simplestatements_set"] },
            { name: "simplestatements_all", symbols: ["simplestatements_show"] },
            { name: "simplestatements_all", symbols: ["simplestatements_begin"] },
            { name: "simplestatements_start_transaction$subexpression$1", symbols: ["kw_start", "kw_transaction"] },
            { name: "simplestatements_start_transaction", symbols: ["simplestatements_start_transaction$subexpression$1"], postprocess: (c) => (0, g.track)(c, { type: "start transaction" }) },
            { name: "simplestatements_commit", symbols: ["kw_commit"], postprocess: (c) => (0, g.track)(c, { type: "commit" }) },
            { name: "simplestatements_rollback", symbols: ["kw_rollback"], postprocess: (c) => (0, g.track)(c, { type: "rollback" }) },
            { name: "simplestatements_tablespace", symbols: ["kw_tablespace", "word"], postprocess: (c) => (0, g.track)(c, {
              type: "tablespace",
              tablespace: s(c[1])
            }) },
            { name: "simplestatements_set$subexpression$1", symbols: ["simplestatements_set_simple"] },
            { name: "simplestatements_set$subexpression$1", symbols: ["simplestatements_set_timezone"] },
            { name: "simplestatements_set", symbols: ["kw_set", "simplestatements_set$subexpression$1"], postprocess: B },
            { name: "simplestatements_set_timezone", symbols: ["kw_time", "kw_zone", "simplestatements_set_timezone_val"], postprocess: (c) => (0, g.track)(c, { type: "set timezone", to: c[2] }) },
            { name: "simplestatements_set_timezone_val$subexpression$1", symbols: ["string"] },
            { name: "simplestatements_set_timezone_val$subexpression$1", symbols: ["int"] },
            { name: "simplestatements_set_timezone_val", symbols: ["simplestatements_set_timezone_val$subexpression$1"], postprocess: (c) => (0, g.track)(c, { type: "value", value: a(c[0]) }) },
            { name: "simplestatements_set_timezone_val", symbols: ["kw_local"], postprocess: (c) => (0, g.track)(c, { type: "local" }) },
            { name: "simplestatements_set_timezone_val", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default], postprocess: (c) => (0, g.track)(c, { type: "default" }) },
            { name: "simplestatements_set_timezone_val", symbols: ["kw_interval", "string", "kw_hour", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "kw_minute"], postprocess: (c) => (0, g.track)(c, { type: "interval", value: (0, g.unbox)(c[1]) }) },
            { name: "simplestatements_set_simple$subexpression$1", symbols: [o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq] },
            { name: "simplestatements_set_simple$subexpression$1", symbols: [o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to] },
            { name: "simplestatements_set_simple", symbols: ["ident", "simplestatements_set_simple$subexpression$1", "simplestatements_set_val"], postprocess: (c) => (0, g.track)(c, {
              type: "set",
              variable: s(c[0]),
              set: (0, g.unbox)(c[2])
            }) },
            { name: "simplestatements_set_val", symbols: ["simplestatements_set_val_raw"], postprocess: a },
            { name: "simplestatements_set_val", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default], postprocess: (c) => (0, g.track)(c, { type: "default" }) },
            { name: "simplestatements_set_val$ebnf$1$subexpression$1", symbols: ["comma", "simplestatements_set_val_raw"] },
            { name: "simplestatements_set_val$ebnf$1", symbols: ["simplestatements_set_val$ebnf$1$subexpression$1"] },
            { name: "simplestatements_set_val$ebnf$1$subexpression$2", symbols: ["comma", "simplestatements_set_val_raw"] },
            { name: "simplestatements_set_val$ebnf$1", symbols: ["simplestatements_set_val$ebnf$1", "simplestatements_set_val$ebnf$1$subexpression$2"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "simplestatements_set_val", symbols: ["simplestatements_set_val_raw", "simplestatements_set_val$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              type: "list",
              values: [c[0], ...c[1] || []]
            }) },
            { name: "simplestatements_set_val_raw$subexpression$1", symbols: ["string"] },
            { name: "simplestatements_set_val_raw$subexpression$1", symbols: ["int"] },
            { name: "simplestatements_set_val_raw", symbols: ["simplestatements_set_val_raw$subexpression$1"], postprocess: (c) => (0, g.track)(c, { type: "value", value: a(c) }) },
            { name: "simplestatements_set_val_raw$subexpression$2", symbols: [o.lexerAny.has("word") ? { type: "word" } : word] },
            { name: "simplestatements_set_val_raw$subexpression$2", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on] },
            { name: "simplestatements_set_val_raw$subexpression$2", symbols: [o.lexerAny.has("kw_true") ? { type: "kw_true" } : kw_true] },
            { name: "simplestatements_set_val_raw$subexpression$2", symbols: [o.lexerAny.has("kw_false") ? { type: "kw_false" } : kw_false] },
            { name: "simplestatements_set_val_raw", symbols: ["simplestatements_set_val_raw$subexpression$2"], postprocess: (c) => (0, g.track)(c, { type: "identifier", name: a(c).value }) },
            { name: "simplestatements_set_val_raw", symbols: [o.lexerAny.has("quoted_word") ? { type: "quoted_word" } : quoted_word], postprocess: (c) => (0, g.track)(c, { type: "identifier", doubleQuoted: !0, name: a(c).value }) },
            { name: "simplestatements_show", symbols: ["kw_show", "ident"], postprocess: (c) => (0, g.track)(c, { type: "show", variable: s(c[1]) }) },
            { name: "create_schema$subexpression$1", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "kw_schema"] },
            { name: "create_schema$ebnf$1", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "create_schema$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_schema", symbols: ["create_schema$subexpression$1", "create_schema$ebnf$1", "ident"], postprocess: (c) => (0, g.track)(c, {
              type: "create schema",
              name: s(c[2]),
              ...c[1] ? { ifNotExists: !0 } : {}
            }) },
            { name: "raise_statement$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("debug", "log", "info", "notice", "warning", "exception") },
            { name: "raise_statement$ebnf$1", symbols: ["raise_statement$ebnf$1$subexpression$1"], postprocess: n },
            { name: "raise_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "raise_statement$ebnf$2$subexpression$1", symbols: ["comma", "expr_list_raw"], postprocess: B },
            { name: "raise_statement$ebnf$2", symbols: ["raise_statement$ebnf$2$subexpression$1"], postprocess: n },
            { name: "raise_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "raise_statement$ebnf$3", symbols: ["raise_using"], postprocess: n },
            { name: "raise_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "raise_statement", symbols: ["kw_raise", "raise_statement$ebnf$1", "string", "raise_statement$ebnf$2", "raise_statement$ebnf$3"], postprocess: (c) => (0, g.track)(c, {
              type: "raise",
              format: d(c[2]),
              ...c[1] && { level: d(c[1]) },
              ...c[3] && c[3].length && { formatExprs: c[3] },
              ...c[4] && c[4].length && { using: c[4] }
            }) },
            { name: "raise_using$macrocall$2", symbols: ["raise_using_one"] },
            { name: "raise_using$macrocall$1$ebnf$1", symbols: [] },
            { name: "raise_using$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "raise_using$macrocall$2"], postprocess: B },
            { name: "raise_using$macrocall$1$ebnf$1", symbols: ["raise_using$macrocall$1$ebnf$1", "raise_using$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "raise_using$macrocall$1", symbols: ["raise_using$macrocall$2", "raise_using$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "raise_using", symbols: [o.lexerAny.has("kw_using") ? { type: "kw_using" } : kw_using, "raise_using$macrocall$1"], postprocess: B },
            { name: "raise_using_one", symbols: ["raise_using_what", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "expr"], postprocess: (c) => (0, g.track)(c, {
              type: d(c[0]),
              value: c[2]
            }) },
            { name: "raise_using_what", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table] },
            { name: "raise_using_what", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("message", "detail", "hint", "errcode", "column", "constraint", "datatype", "schema") },
            { name: "comment_statement", symbols: ["kw_comment", o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "comment_what", o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is, "string"], postprocess: (c) => (0, g.track)(c, {
              type: "comment",
              comment: (0, g.unbox)(B(c)),
              on: a(c[2])
            }) },
            { name: "comment_what", symbols: ["comment_what_col"] },
            { name: "comment_what", symbols: ["comment_what_nm"] },
            { name: "comment_what_nm$subexpression$1", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table] },
            { name: "comment_what_nm$subexpression$1", symbols: ["kw_materialized", "kw_view"] },
            { name: "comment_what_nm$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("database", "index", "trigger", "type", "view") },
            { name: "comment_what_nm", symbols: ["comment_what_nm$subexpression$1", "qualified_name"], postprocess: (c) => (0, g.track)(c, {
              type: d(c[0]),
              name: c[1]
            }) },
            { name: "comment_what_col", symbols: ["kw_column", "qcolumn"], postprocess: (c) => (0, g.track)(c, {
              type: "column",
              column: B(c)
            }) },
            { name: "simplestatements_begin$ebnf$1$subexpression$1", symbols: ["kw_transaction"] },
            { name: "simplestatements_begin$ebnf$1$subexpression$1", symbols: ["kw_work"] },
            { name: "simplestatements_begin$ebnf$1", symbols: ["simplestatements_begin$ebnf$1$subexpression$1"], postprocess: n },
            { name: "simplestatements_begin$ebnf$1", symbols: [], postprocess: () => null },
            { name: "simplestatements_begin$ebnf$2", symbols: [] },
            { name: "simplestatements_begin$ebnf$2$subexpression$1", symbols: ["simplestatements_begin_isol"] },
            { name: "simplestatements_begin$ebnf$2$subexpression$1", symbols: ["simplestatements_begin_writ"] },
            { name: "simplestatements_begin$ebnf$2$subexpression$1", symbols: ["simplestatements_begin_def"] },
            { name: "simplestatements_begin$ebnf$2", symbols: ["simplestatements_begin$ebnf$2", "simplestatements_begin$ebnf$2$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            {
              name: "simplestatements_begin",
              symbols: ["kw_begin", "simplestatements_begin$ebnf$1", "simplestatements_begin$ebnf$2"],
              postprocess: (c) => (0, g.track)(c, {
                type: "begin",
                ...c[2].reduce((J, p) => ({ ...a(J), ...a(p) }), {})
              })
            },
            { name: "simplestatements_begin_isol$subexpression$1", symbols: ["kw_isolation", "kw_level"] },
            { name: "simplestatements_begin_isol$subexpression$2", symbols: ["kw_serializable"] },
            { name: "simplestatements_begin_isol$subexpression$2$subexpression$1", symbols: ["word"], postprocess: G("repeatable") },
            { name: "simplestatements_begin_isol$subexpression$2", symbols: ["simplestatements_begin_isol$subexpression$2$subexpression$1", "kw_read"] },
            { name: "simplestatements_begin_isol$subexpression$2$subexpression$2", symbols: ["word"], postprocess: G("committed") },
            { name: "simplestatements_begin_isol$subexpression$2", symbols: ["kw_read", "simplestatements_begin_isol$subexpression$2$subexpression$2"] },
            { name: "simplestatements_begin_isol$subexpression$2$subexpression$3", symbols: ["word"], postprocess: G("uncommitted") },
            { name: "simplestatements_begin_isol$subexpression$2", symbols: ["kw_read", "simplestatements_begin_isol$subexpression$2$subexpression$3"] },
            { name: "simplestatements_begin_isol", symbols: ["simplestatements_begin_isol$subexpression$1", "simplestatements_begin_isol$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              isolationLevel: d(c[1], " ")
            }) },
            { name: "simplestatements_begin_writ$subexpression$1", symbols: ["kw_read", "kw_write"] },
            { name: "simplestatements_begin_writ$subexpression$1", symbols: ["kw_read", o.lexerAny.has("kw_only") ? { type: "kw_only" } : kw_only] },
            { name: "simplestatements_begin_writ", symbols: ["simplestatements_begin_writ$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              writeable: d(c, " ")
            }) },
            { name: "simplestatements_begin_def$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "simplestatements_begin_def$ebnf$1", symbols: [], postprocess: () => null },
            { name: "simplestatements_begin_def", symbols: ["simplestatements_begin_def$ebnf$1", o.lexerAny.has("kw_deferrable") ? { type: "kw_deferrable" } : kw_deferrable], postprocess: (c) => (0, g.track)(c, {
              deferrable: !c[0]
            }) },
            { name: "insert_statement$subexpression$1", symbols: ["kw_insert", o.lexerAny.has("kw_into") ? { type: "kw_into" } : kw_into] },
            { name: "insert_statement$ebnf$1", symbols: ["collist_paren"], postprocess: n },
            { name: "insert_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "insert_statement$ebnf$2$subexpression$1$subexpression$1", symbols: ["kw_system"] },
            { name: "insert_statement$ebnf$2$subexpression$1$subexpression$1", symbols: [o.lexerAny.has("kw_user") ? { type: "kw_user" } : kw_user] },
            { name: "insert_statement$ebnf$2$subexpression$1", symbols: ["kw_overriding", "insert_statement$ebnf$2$subexpression$1$subexpression$1", "kw_value"], postprocess: C(1) },
            { name: "insert_statement$ebnf$2", symbols: ["insert_statement$ebnf$2$subexpression$1"], postprocess: n },
            { name: "insert_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "insert_statement$ebnf$3$subexpression$1", symbols: ["selection"] },
            { name: "insert_statement$ebnf$3$subexpression$1", symbols: ["selection_paren"] },
            { name: "insert_statement$ebnf$3", symbols: ["insert_statement$ebnf$3$subexpression$1"], postprocess: n },
            { name: "insert_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "insert_statement$ebnf$4$subexpression$1", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "kw_conflict", "insert_on_conflict"], postprocess: B },
            { name: "insert_statement$ebnf$4", symbols: ["insert_statement$ebnf$4$subexpression$1"], postprocess: n },
            { name: "insert_statement$ebnf$4", symbols: [], postprocess: () => null },
            { name: "insert_statement$ebnf$5$subexpression$1", symbols: [o.lexerAny.has("kw_returning") ? { type: "kw_returning" } : kw_returning, "select_expr_list_aliased"], postprocess: B },
            { name: "insert_statement$ebnf$5", symbols: ["insert_statement$ebnf$5$subexpression$1"], postprocess: n },
            { name: "insert_statement$ebnf$5", symbols: [], postprocess: () => null },
            { name: "insert_statement", symbols: ["insert_statement$subexpression$1", "table_ref_aliased", "insert_statement$ebnf$1", "insert_statement$ebnf$2", "insert_statement$ebnf$3", "insert_statement$ebnf$4", "insert_statement$ebnf$5"], postprocess: (c) => {
              const J = c[2] && c[2].map(s), p = d(c[3]), N = a(c[4]), v = c[5], K = c[6];
              return (0, g.track)(c, {
                type: "insert",
                into: a(c[1]),
                insert: N,
                ...p && { overriding: p },
                ...J && { columns: J },
                ...K && { returning: K },
                ...v && { onConflict: v }
              });
            } },
            { name: "insert_values$ebnf$1", symbols: [] },
            { name: "insert_values$ebnf$1$subexpression$1", symbols: ["comma", "insert_value"], postprocess: B },
            { name: "insert_values$ebnf$1", symbols: ["insert_values$ebnf$1", "insert_values$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "insert_values", symbols: ["insert_value", "insert_values$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "insert_value", symbols: ["lparen", "insert_expr_list_raw", "rparen"], postprocess: C(1) },
            { name: "insert_expr_list_raw$ebnf$1", symbols: [] },
            { name: "insert_expr_list_raw$ebnf$1$subexpression$1", symbols: ["comma", "expr_or_select"], postprocess: B },
            { name: "insert_expr_list_raw$ebnf$1", symbols: ["insert_expr_list_raw$ebnf$1", "insert_expr_list_raw$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "insert_expr_list_raw", symbols: ["expr_or_select", "insert_expr_list_raw$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "insert_on_conflict$ebnf$1", symbols: ["insert_on_conflict_what"], postprocess: n },
            { name: "insert_on_conflict$ebnf$1", symbols: [], postprocess: () => null },
            { name: "insert_on_conflict", symbols: ["insert_on_conflict$ebnf$1", "insert_on_conflict_do"], postprocess: (c) => (0, g.track)(c, {
              ...c[0] ? { on: a(c[0]) } : {},
              ...c[1]
            }) },
            { name: "insert_on_conflict_what", symbols: ["lparen", "expr_list_raw", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "on expr",
              exprs: c[1]
            }) },
            { name: "insert_on_conflict_what", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "qname"], postprocess: (c) => (0, g.track)(c, {
              type: "on constraint",
              constraint: B(c)
            }) },
            { name: "insert_on_conflict_do", symbols: [o.lexerAny.has("kw_do") ? { type: "kw_do" } : kw_do, "kw_nothing"], postprocess: (c) => ({ do: "do nothing" }) },
            { name: "insert_on_conflict_do$subexpression$1", symbols: [o.lexerAny.has("kw_do") ? { type: "kw_do" } : kw_do, "kw_update", "kw_set"] },
            { name: "insert_on_conflict_do$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where, "expr"], postprocess: B },
            { name: "insert_on_conflict_do$ebnf$1", symbols: ["insert_on_conflict_do$ebnf$1$subexpression$1"], postprocess: n },
            { name: "insert_on_conflict_do$ebnf$1", symbols: [], postprocess: () => null },
            { name: "insert_on_conflict_do", symbols: ["insert_on_conflict_do$subexpression$1", "update_set_list", "insert_on_conflict_do$ebnf$1"], postprocess: (c) => ({
              do: { sets: c[1] },
              ...c[2] && { where: c[2] }
            }) },
            { name: "update_statement$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "select_from_subject"], postprocess: B },
            { name: "update_statement$ebnf$1", symbols: ["update_statement$ebnf$1$subexpression$1"], postprocess: n },
            { name: "update_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "update_statement$ebnf$2", symbols: ["select_where"], postprocess: n },
            { name: "update_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "update_statement$ebnf$3$subexpression$1", symbols: [o.lexerAny.has("kw_returning") ? { type: "kw_returning" } : kw_returning, "select_expr_list_aliased"], postprocess: B },
            { name: "update_statement$ebnf$3", symbols: ["update_statement$ebnf$3$subexpression$1"], postprocess: n },
            { name: "update_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "update_statement", symbols: ["kw_update", "table_ref_aliased", "kw_set", "update_set_list", "update_statement$ebnf$1", "update_statement$ebnf$2", "update_statement$ebnf$3"], postprocess: (c) => {
              const J = a(c[4]), p = a(c[5]), N = c[6];
              return (0, g.track)(c, {
                type: "update",
                table: a(c[1]),
                sets: c[3],
                ...p ? { where: p } : {},
                ...J ? { from: J } : {},
                ...N ? { returning: N } : {}
              });
            } },
            { name: "update_set_list$ebnf$1", symbols: [] },
            { name: "update_set_list$ebnf$1$subexpression$1", symbols: ["comma", "update_set"], postprocess: B },
            { name: "update_set_list$ebnf$1", symbols: ["update_set_list$ebnf$1", "update_set_list$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "update_set_list", symbols: ["update_set", "update_set_list$ebnf$1"], postprocess: ([c, J]) => {
              const p = [];
              for (const N of [c, ...J || []]) {
                const v = a(N);
                Array.isArray(v) ? p.push(...v) : p.push(v);
              }
              return p;
            } },
            { name: "update_set", symbols: ["update_set_one"] },
            { name: "update_set", symbols: ["update_set_multiple"] },
            { name: "update_set_one", symbols: ["ident", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "expr"], postprocess: (c) => (0, g.box)(c, {
              column: s(c[0]),
              value: a(c[2])
            }) },
            { name: "update_set_multiple$subexpression$1", symbols: ["lparen", "expr_list_raw", "rparen"], postprocess: C(1) },
            { name: "update_set_multiple", symbols: ["collist_paren", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "update_set_multiple$subexpression$1"], postprocess: (c) => {
              const J = c[0], p = c[2];
              if (J.length !== p.length)
                throw new Error("number of columns does not match number of values");
              return (0, g.box)(c, J.map((N, v) => ({
                column: s(N),
                value: a(p[v])
              })));
            } },
            { name: "altertable_statement$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "altertable_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_statement$ebnf$2", symbols: [o.lexerAny.has("kw_only") ? { type: "kw_only" } : kw_only], postprocess: n },
            { name: "altertable_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altertable_statement", symbols: ["kw_alter", o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table, "altertable_statement$ebnf$1", "altertable_statement$ebnf$2", "table_ref", "altertable_actions"], postprocess: (c) => (0, g.track)(c, {
              type: "alter table",
              ...c[2] ? { ifExists: !0 } : {},
              ...c[3] ? { only: !0 } : {},
              table: a(c[4]),
              changes: (0, g.unbox)(c[5]).map(a)
            }) },
            { name: "altertable_actions$ebnf$1", symbols: [] },
            { name: "altertable_actions$ebnf$1$subexpression$1", symbols: ["comma", "altertable_action"], postprocess: B },
            { name: "altertable_actions$ebnf$1", symbols: ["altertable_actions$ebnf$1", "altertable_actions$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "altertable_actions", symbols: ["altertable_action", "altertable_actions$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "altertable_action", symbols: ["altertable_rename_table"] },
            { name: "altertable_action", symbols: ["altertable_rename_column"] },
            { name: "altertable_action", symbols: ["altertable_rename_constraint"] },
            { name: "altertable_action", symbols: ["altertable_add_column"] },
            { name: "altertable_action", symbols: ["altertable_drop_column"] },
            { name: "altertable_action", symbols: ["altertable_alter_column"] },
            { name: "altertable_action", symbols: ["altertable_add_constraint"] },
            { name: "altertable_action", symbols: ["altertable_drop_constraint"] },
            { name: "altertable_action", symbols: ["altertable_owner"] },
            { name: "altertable_rename_table", symbols: ["kw_rename", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "word"], postprocess: (c) => (0, g.track)(c, {
              type: "rename",
              to: s(B(c))
            }) },
            { name: "altertable_rename_column$ebnf$1", symbols: ["kw_column"], postprocess: n },
            { name: "altertable_rename_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_rename_column", symbols: ["kw_rename", "altertable_rename_column$ebnf$1", "ident", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "ident"], postprocess: (c) => (0, g.track)(c, {
              type: "rename column",
              column: s(c[2]),
              to: s(B(c))
            }) },
            { name: "altertable_rename_constraint", symbols: ["kw_rename", o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "ident", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "ident"], postprocess: (c) => (0, g.track)(c, {
              type: "rename constraint",
              constraint: s(c[2]),
              to: s(B(c))
            }) },
            { name: "altertable_add_column$ebnf$1", symbols: ["kw_column"], postprocess: n },
            { name: "altertable_add_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_add_column$ebnf$2", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "altertable_add_column$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altertable_add_column", symbols: ["kw_add", "altertable_add_column$ebnf$1", "altertable_add_column$ebnf$2", "createtable_column"], postprocess: (c) => (0, g.track)(c, {
              type: "add column",
              ...c[2] ? { ifNotExists: !0 } : {},
              column: a(c[3])
            }) },
            { name: "altertable_drop_column$ebnf$1", symbols: ["kw_column"], postprocess: n },
            { name: "altertable_drop_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_drop_column$ebnf$2", symbols: ["kw_ifexists"], postprocess: n },
            { name: "altertable_drop_column$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altertable_drop_column$ebnf$3$subexpression$1", symbols: ["kw_restrict"] },
            { name: "altertable_drop_column$ebnf$3$subexpression$1", symbols: ["kw_cascade"] },
            { name: "altertable_drop_column$ebnf$3", symbols: ["altertable_drop_column$ebnf$3$subexpression$1"], postprocess: n },
            { name: "altertable_drop_column$ebnf$3", symbols: [], postprocess: () => null },
            { name: "altertable_drop_column", symbols: ["kw_drop", "altertable_drop_column$ebnf$1", "altertable_drop_column$ebnf$2", "ident", "altertable_drop_column$ebnf$3"], postprocess: (c) => (0, g.track)(c, {
              type: "drop column",
              ...c[2] ? { ifExists: !0 } : {},
              column: s(c[3]),
              ...c[4] ? { behaviour: d(c[4], " ") } : {}
            }) },
            { name: "altertable_alter_column$ebnf$1", symbols: ["kw_column"], postprocess: n },
            { name: "altertable_alter_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_alter_column", symbols: ["kw_alter", "altertable_alter_column$ebnf$1", "ident", "altercol"], postprocess: (c) => (0, g.track)(c, {
              type: "alter column",
              column: s(c[2]),
              alter: a(c[3])
            }) },
            { name: "altercol$ebnf$1$subexpression$1", symbols: ["kw_set", "kw_data"] },
            { name: "altercol$ebnf$1", symbols: ["altercol$ebnf$1$subexpression$1"], postprocess: n },
            { name: "altercol$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altercol", symbols: ["altercol$ebnf$1", "kw_type", "data_type"], postprocess: (c) => (0, g.track)(c, { type: "set type", dataType: a(B(c)) }) },
            { name: "altercol", symbols: ["kw_set", o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default, "expr"], postprocess: (c) => (0, g.track)(c, { type: "set default", default: a(B(c)) }) },
            { name: "altercol", symbols: ["kw_drop", o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default], postprocess: (c) => (0, g.track)(c, { type: "drop default" }) },
            { name: "altercol$subexpression$1", symbols: ["kw_set"] },
            { name: "altercol$subexpression$1", symbols: ["kw_drop"] },
            { name: "altercol", symbols: ["altercol$subexpression$1", "kw_not_null"], postprocess: (c) => (0, g.track)(c, { type: d(c, " ") }) },
            { name: "altercol", symbols: ["altercol_generated_add"], postprocess: a },
            { name: "altertable_add_constraint", symbols: ["kw_add", "createtable_constraint"], postprocess: (c) => (0, g.track)(c, {
              type: "add constraint",
              constraint: a(B(c))
            }) },
            { name: "altertable_drop_constraint$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "altertable_drop_constraint$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_drop_constraint$ebnf$2$subexpression$1", symbols: ["kw_restrict"] },
            { name: "altertable_drop_constraint$ebnf$2$subexpression$1", symbols: ["kw_cascade"] },
            { name: "altertable_drop_constraint$ebnf$2", symbols: ["altertable_drop_constraint$ebnf$2$subexpression$1"], postprocess: n },
            { name: "altertable_drop_constraint$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altertable_drop_constraint", symbols: ["kw_drop", o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "altertable_drop_constraint$ebnf$1", "ident", "altertable_drop_constraint$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "drop constraint",
              ...c[2] ? { ifExists: !0 } : {},
              constraint: s(c[3]),
              ...c[4] ? { behaviour: d(c[4], " ") } : {}
            }) },
            { name: "altertable_owner", symbols: ["kw_owner", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "ident"], postprocess: (c) => (0, g.track)(c, {
              type: "owner",
              to: s(B(c))
            }) },
            { name: "altercol_generated_add", symbols: ["kw_add", "altercol_generated"], postprocess: B },
            { name: "altercol_generated$ebnf$1$subexpression$1", symbols: ["kw_always"] },
            { name: "altercol_generated$ebnf$1$subexpression$1", symbols: ["kw_by", o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default] },
            { name: "altercol_generated$ebnf$1", symbols: ["altercol_generated$ebnf$1$subexpression$1"], postprocess: n },
            { name: "altercol_generated$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altercol_generated$subexpression$1", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "kw_identity"] },
            { name: "altercol_generated$ebnf$2$subexpression$1", symbols: ["lparen", "altercol_generated_seq", "rparen"], postprocess: C(1) },
            { name: "altercol_generated$ebnf$2", symbols: ["altercol_generated$ebnf$2$subexpression$1"], postprocess: n },
            { name: "altercol_generated$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altercol_generated", symbols: ["kw_generated", "altercol_generated$ebnf$1", "altercol_generated$subexpression$1", "altercol_generated$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "add generated",
              ...c[1] && { always: d(c[1], " ") },
              ...c[3] && { sequence: a(c[3]) }
            }) },
            { name: "altercol_generated_seq$ebnf$1$subexpression$1", symbols: ["kw_sequence", "kw_name", "qualified_name"] },
            { name: "altercol_generated_seq$ebnf$1", symbols: ["altercol_generated_seq$ebnf$1$subexpression$1"], postprocess: n },
            { name: "altercol_generated_seq$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altercol_generated_seq$ebnf$2", symbols: [] },
            { name: "altercol_generated_seq$ebnf$2", symbols: ["altercol_generated_seq$ebnf$2", "create_sequence_option"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "altercol_generated_seq", symbols: ["altercol_generated_seq$ebnf$1", "altercol_generated_seq$ebnf$2"], postprocess: (c) => {
              const J = {
                ...c[0] && { name: a(B(c[0])) }
              };
              return F(J, c[1]), (0, g.track)(c, J);
            } },
            { name: "alterindex_statement$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "alterindex_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "alterindex_statement", symbols: ["kw_alter", "kw_index", "alterindex_statement$ebnf$1", "table_ref", "alterindex_action"], postprocess: (c) => (0, g.track)(c, {
              type: "alter index",
              ...c[2] ? { ifExists: !0 } : {},
              index: a(c[3]),
              change: a(c[4])
            }) },
            { name: "alterindex_action", symbols: ["alterindex_rename"] },
            { name: "alterindex_action", symbols: ["alterindex_set_tablespace"] },
            { name: "alterindex_rename", symbols: ["kw_rename", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "word"], postprocess: (c) => (0, g.track)(c, {
              type: "rename",
              to: s(B(c))
            }) },
            { name: "alterindex_set_tablespace", symbols: ["kw_set", "kw_tablespace", "word"], postprocess: (c) => (0, g.track)(c, {
              type: "set tablespace",
              tablespace: s(B(c))
            }) },
            { name: "delete_statement", symbols: ["delete_delete"] },
            { name: "delete_statement", symbols: ["delete_truncate"] },
            { name: "delete_delete$subexpression$1", symbols: ["kw_delete", o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from] },
            { name: "delete_delete$ebnf$1", symbols: ["select_where"], postprocess: n },
            { name: "delete_delete$ebnf$1", symbols: [], postprocess: () => null },
            { name: "delete_delete$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("kw_returning") ? { type: "kw_returning" } : kw_returning, "select_expr_list_aliased"], postprocess: B },
            { name: "delete_delete$ebnf$2", symbols: ["delete_delete$ebnf$2$subexpression$1"], postprocess: n },
            { name: "delete_delete$ebnf$2", symbols: [], postprocess: () => null },
            { name: "delete_delete", symbols: ["delete_delete$subexpression$1", "table_ref_aliased", "delete_delete$ebnf$1", "delete_delete$ebnf$2"], postprocess: (c) => {
              const J = c[2], p = c[3];
              return (0, g.track)(c, {
                type: "delete",
                from: a(c[1]),
                ...J ? { where: J } : {},
                ...p ? { returning: p } : {}
              });
            } },
            { name: "delete_truncate$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table], postprocess: n },
            { name: "delete_truncate$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "delete_truncate$subexpression$1", symbols: ["kw_truncate", "delete_truncate$subexpression$1$ebnf$1"] },
            { name: "delete_truncate$macrocall$2", symbols: ["table_ref"] },
            { name: "delete_truncate$macrocall$1$ebnf$1", symbols: [] },
            { name: "delete_truncate$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "delete_truncate$macrocall$2"], postprocess: B },
            { name: "delete_truncate$macrocall$1$ebnf$1", symbols: ["delete_truncate$macrocall$1$ebnf$1", "delete_truncate$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "delete_truncate$macrocall$1", symbols: ["delete_truncate$macrocall$2", "delete_truncate$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "delete_truncate$ebnf$1$subexpression$1$subexpression$1", symbols: ["kw_restart"] },
            { name: "delete_truncate$ebnf$1$subexpression$1$subexpression$1", symbols: ["kw_continue"] },
            { name: "delete_truncate$ebnf$1$subexpression$1", symbols: ["delete_truncate$ebnf$1$subexpression$1$subexpression$1", "kw_identity"] },
            { name: "delete_truncate$ebnf$1", symbols: ["delete_truncate$ebnf$1$subexpression$1"], postprocess: n },
            { name: "delete_truncate$ebnf$1", symbols: [], postprocess: () => null },
            { name: "delete_truncate$ebnf$2$subexpression$1", symbols: ["kw_restrict"] },
            { name: "delete_truncate$ebnf$2$subexpression$1", symbols: ["kw_cascade"] },
            { name: "delete_truncate$ebnf$2", symbols: ["delete_truncate$ebnf$2$subexpression$1"], postprocess: n },
            { name: "delete_truncate$ebnf$2", symbols: [], postprocess: () => null },
            { name: "delete_truncate", symbols: ["delete_truncate$subexpression$1", "delete_truncate$macrocall$1", "delete_truncate$ebnf$1", "delete_truncate$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "truncate table",
              tables: c[1],
              ...c[2] && { identity: d(c[2][0]) },
              ...c[3] && { cascade: d(c[3]) }
            }) },
            { name: "create_sequence_statement$ebnf$1$subexpression$1", symbols: ["kw_temp"] },
            { name: "create_sequence_statement$ebnf$1$subexpression$1", symbols: ["kw_temporary"] },
            { name: "create_sequence_statement$ebnf$1", symbols: ["create_sequence_statement$ebnf$1$subexpression$1"], postprocess: n },
            { name: "create_sequence_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_sequence_statement$ebnf$2", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "create_sequence_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "create_sequence_statement$ebnf$3", symbols: [] },
            { name: "create_sequence_statement$ebnf$3", symbols: ["create_sequence_statement$ebnf$3", "create_sequence_option"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_sequence_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "create_sequence_statement$ebnf$1", "kw_sequence", "create_sequence_statement$ebnf$2", "qualified_name", "create_sequence_statement$ebnf$3"], postprocess: (c) => {
              const J = {
                type: "create sequence",
                ...c[1] && { temp: !0 },
                ...c[3] && { ifNotExists: !0 },
                name: a(c[4]),
                options: {}
              };
              return F(J.options, c[5]), (0, g.track)(c, J);
            } },
            { name: "create_sequence_option", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "data_type"], postprocess: (c) => (0, g.box)(c, ["as", c[1]]) },
            { name: "create_sequence_option$ebnf$1", symbols: ["kw_by"], postprocess: n },
            { name: "create_sequence_option$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_sequence_option", symbols: ["kw_increment", "create_sequence_option$ebnf$1", "int"], postprocess: (c) => (0, g.box)(c, ["incrementBy", c[2]]) },
            { name: "create_sequence_option", symbols: ["create_sequence_minvalue"], postprocess: (c) => (0, g.box)(c, ["minValue", c[0]]) },
            { name: "create_sequence_option", symbols: ["create_sequence_maxvalue"], postprocess: (c) => (0, g.box)(c, ["maxValue", c[0]]) },
            { name: "create_sequence_option$ebnf$2", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with], postprocess: n },
            { name: "create_sequence_option$ebnf$2", symbols: [], postprocess: () => null },
            { name: "create_sequence_option", symbols: ["kw_start", "create_sequence_option$ebnf$2", "int"], postprocess: (c) => (0, g.box)(c, ["startWith", c[2]]) },
            { name: "create_sequence_option", symbols: ["kw_cache", "int"], postprocess: (c) => (0, g.box)(c, ["cache", c[1]]) },
            { name: "create_sequence_option$ebnf$3", symbols: ["kw_no"], postprocess: n },
            { name: "create_sequence_option$ebnf$3", symbols: [], postprocess: () => null },
            { name: "create_sequence_option", symbols: ["create_sequence_option$ebnf$3", "kw_cycle"], postprocess: (c) => (0, g.box)(c, ["cycle", d(c, " ")]) },
            { name: "create_sequence_option", symbols: ["create_sequence_owned_by"], postprocess: (c) => (0, g.box)(c, ["ownedBy", a(c)]) },
            { name: "create_sequence_minvalue", symbols: ["kw_minvalue", "int"], postprocess: B },
            { name: "create_sequence_minvalue", symbols: ["kw_no", "kw_minvalue"], postprocess: (c) => (0, g.box)(c, "no minvalue") },
            { name: "create_sequence_maxvalue", symbols: ["kw_maxvalue", "int"], postprocess: B },
            { name: "create_sequence_maxvalue", symbols: ["kw_no", "kw_maxvalue"], postprocess: (c) => (0, g.box)(c, "no maxvalue") },
            { name: "create_sequence_owned_by$subexpression$1", symbols: ["kw_none"] },
            { name: "create_sequence_owned_by$subexpression$1", symbols: ["qcolumn"] },
            { name: "create_sequence_owned_by", symbols: ["kw_owned", "kw_by", "create_sequence_owned_by$subexpression$1"], postprocess: (c) => (0, g.box)(c, a(B(c))) },
            { name: "alter_sequence_statement$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "alter_sequence_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "alter_sequence_statement", symbols: ["kw_alter", "kw_sequence", "alter_sequence_statement$ebnf$1", "qualified_name", "alter_sequence_statement_body"], postprocess: (c) => {
              const J = {
                type: "alter sequence",
                ...c[2] && { ifExists: !0 },
                name: a(c[3]),
                change: c[4]
              };
              return (0, g.track)(c, J);
            } },
            { name: "alter_sequence_statement_body$ebnf$1", symbols: ["alter_sequence_option"] },
            { name: "alter_sequence_statement_body$ebnf$1", symbols: ["alter_sequence_statement_body$ebnf$1", "alter_sequence_option"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "alter_sequence_statement_body", symbols: ["alter_sequence_statement_body$ebnf$1"], postprocess: (c) => {
              const J = {
                type: "set options"
              };
              return F(J, c[0]), (0, g.track)(c, J);
            } },
            { name: "alter_sequence_statement_body$subexpression$1", symbols: ["ident"] },
            { name: "alter_sequence_statement_body$subexpression$1", symbols: [o.lexerAny.has("kw_session_user") ? { type: "kw_session_user" } : kw_session_user] },
            { name: "alter_sequence_statement_body$subexpression$1", symbols: [o.lexerAny.has("kw_current_user") ? { type: "kw_current_user" } : kw_current_user] },
            { name: "alter_sequence_statement_body", symbols: ["kw_owner", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "alter_sequence_statement_body$subexpression$1"], postprocess: (c) => (0, g.track)(c, { type: "owner to", owner: s(B(c)) }) },
            { name: "alter_sequence_statement_body", symbols: ["kw_rename", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "ident"], postprocess: (c) => (0, g.track)(c, { type: "rename", newName: s(B(c)) }) },
            { name: "alter_sequence_statement_body", symbols: ["kw_set", "kw_schema", "ident"], postprocess: (c) => (0, g.track)(c, { type: "set schema", newSchema: s(B(c)) }) },
            { name: "alter_sequence_option", symbols: ["create_sequence_option"], postprocess: a },
            { name: "alter_sequence_option$ebnf$1$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with], postprocess: n },
            { name: "alter_sequence_option$ebnf$1$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "alter_sequence_option$ebnf$1$subexpression$1", symbols: ["alter_sequence_option$ebnf$1$subexpression$1$ebnf$1", "int"], postprocess: B },
            { name: "alter_sequence_option$ebnf$1", symbols: ["alter_sequence_option$ebnf$1$subexpression$1"], postprocess: n },
            { name: "alter_sequence_option$ebnf$1", symbols: [], postprocess: () => null },
            { name: "alter_sequence_option", symbols: ["kw_restart", "alter_sequence_option$ebnf$1"], postprocess: (c) => (0, g.box)(c, ["restart", typeof (0, g.unbox)(c[1]) == "number" ? (0, g.unbox)(c[1]) : !0]) },
            { name: "drop_statement$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "drop_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "drop_statement$macrocall$2", symbols: ["qualified_name"] },
            { name: "drop_statement$macrocall$1$ebnf$1", symbols: [] },
            { name: "drop_statement$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "drop_statement$macrocall$2"], postprocess: B },
            { name: "drop_statement$macrocall$1$ebnf$1", symbols: ["drop_statement$macrocall$1$ebnf$1", "drop_statement$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "drop_statement$macrocall$1", symbols: ["drop_statement$macrocall$2", "drop_statement$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "drop_statement$ebnf$2$subexpression$1", symbols: ["kw_cascade"] },
            { name: "drop_statement$ebnf$2$subexpression$1", symbols: ["kw_restrict"] },
            { name: "drop_statement$ebnf$2", symbols: ["drop_statement$ebnf$2$subexpression$1"], postprocess: n },
            { name: "drop_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "drop_statement", symbols: ["kw_drop", "drop_what", "drop_statement$ebnf$1", "drop_statement$macrocall$1", "drop_statement$ebnf$2"], postprocess: (c, J) => {
              const p = a(c[1]);
              return (0, g.track)(c, {
                ...p,
                ...c[2] && { ifExists: !0 },
                names: c[3],
                ...c[4] && { cascade: d(c[4]) }
              });
            } },
            { name: "drop_what", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table], postprocess: (c) => (0, g.track)(c, { type: "drop table" }) },
            { name: "drop_what", symbols: ["kw_sequence"], postprocess: (c) => (0, g.track)(c, { type: "drop sequence" }) },
            { name: "drop_what", symbols: ["kw_type"], postprocess: (c) => (0, g.track)(c, { type: "drop type" }) },
            { name: "drop_what", symbols: ["kw_trigger"], postprocess: (c) => (0, g.track)(c, { type: "drop trigger" }) },
            { name: "drop_what$ebnf$1", symbols: [o.lexerAny.has("kw_concurrently") ? { type: "kw_concurrently" } : kw_concurrently], postprocess: n },
            { name: "drop_what$ebnf$1", symbols: [], postprocess: () => null },
            { name: "drop_what", symbols: ["kw_index", "drop_what$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              type: "drop index",
              ...c[1] && { concurrently: !0 }
            }) },
            { name: "with_statement", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "with_statement_bindings", "with_statement_statement"], postprocess: (c) => (0, g.track)(c, {
              type: "with",
              bind: c[1],
              in: a(c[2])
            }) },
            { name: "with_recursive_statement$subexpression$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "kw_recursive"] },
            { name: "with_recursive_statement", symbols: ["with_recursive_statement$subexpression$1", "ident", "collist_paren", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "lparen", "union_statement", "rparen", "with_statement_statement"], postprocess: (c) => (0, g.track)(c, {
              type: "with recursive",
              alias: s(c[1]),
              columnNames: c[2].map(s),
              bind: c[5],
              in: a(c[7])
            }) },
            { name: "with_statement_bindings$ebnf$1", symbols: [] },
            { name: "with_statement_bindings$ebnf$1$subexpression$1", symbols: ["comma", "with_statement_binding"], postprocess: B },
            { name: "with_statement_bindings$ebnf$1", symbols: ["with_statement_bindings$ebnf$1", "with_statement_bindings$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "with_statement_bindings", symbols: ["with_statement_binding", "with_statement_bindings$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "with_statement_binding", symbols: ["word", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "lparen", "with_statement_statement", "rparen"], postprocess: (c) => (0, g.track)(c, {
              alias: s(c[0]),
              statement: a(c[3])
            }) },
            { name: "with_statement_statement", symbols: ["selection"] },
            { name: "with_statement_statement", symbols: ["insert_statement"] },
            { name: "with_statement_statement", symbols: ["update_statement"] },
            { name: "with_statement_statement", symbols: ["delete_statement"] },
            { name: "createtype_statement$subexpression$1", symbols: ["createtype_enum"] },
            { name: "createtype_statement$subexpression$1", symbols: ["createtype_composite"] },
            { name: "createtype_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "kw_type", "qualified_name", "createtype_statement$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              name: c[2],
              ...a(c[3])
            }) },
            { name: "createtype_enum$macrocall$2", symbols: ["enum_value"] },
            { name: "createtype_enum$macrocall$1$ebnf$1", symbols: [] },
            { name: "createtype_enum$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "createtype_enum$macrocall$2"], postprocess: B },
            { name: "createtype_enum$macrocall$1$ebnf$1", symbols: ["createtype_enum$macrocall$1$ebnf$1", "createtype_enum$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtype_enum$macrocall$1", symbols: ["createtype_enum$macrocall$2", "createtype_enum$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "createtype_enum", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "kw_enum", "lparen", "createtype_enum$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "create enum",
              values: c[3]
            }) },
            { name: "enum_value", symbols: ["string"], postprocess: (c) => (0, g.track)(c, { value: d(c) }) },
            { name: "createtype_composite$macrocall$2", symbols: ["createtype_composite_attr"] },
            { name: "createtype_composite$macrocall$1$ebnf$1", symbols: [] },
            { name: "createtype_composite$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "createtype_composite$macrocall$2"], postprocess: B },
            { name: "createtype_composite$macrocall$1$ebnf$1", symbols: ["createtype_composite$macrocall$1$ebnf$1", "createtype_composite$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtype_composite$macrocall$1", symbols: ["createtype_composite$macrocall$2", "createtype_composite$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "createtype_composite", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "lparen", "createtype_composite$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "create composite type",
              attributes: c[2]
            }) },
            { name: "createtype_composite_attr$ebnf$1", symbols: ["createtable_collate"], postprocess: n },
            { name: "createtype_composite_attr$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtype_composite_attr", symbols: ["word", "data_type", "createtype_composite_attr$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              name: s(c[0]),
              dataType: c[1],
              ...c[2] ? { collate: c[2][1] } : {}
            }) },
            { name: "union_left", symbols: ["select_statement"] },
            { name: "union_left", symbols: ["select_values"] },
            { name: "union_left", symbols: ["selection_paren"] },
            { name: "union_right", symbols: ["selection"] },
            { name: "union_right", symbols: ["selection_paren"] },
            { name: "union_statement$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all], postprocess: n },
            { name: "union_statement$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "union_statement$subexpression$1", symbols: [o.lexerAny.has("kw_union") ? { type: "kw_union" } : kw_union, "union_statement$subexpression$1$ebnf$1"] },
            { name: "union_statement", symbols: ["union_left", "union_statement$subexpression$1", "union_right"], postprocess: (c) => (0, g.track)(c, {
              type: d(c[1], " "),
              left: a(c[0]),
              right: a(c[2])
            }) },
            { name: "prepare$ebnf$1$subexpression$1", symbols: ["lparen", "data_type_list", "rparen"], postprocess: C(1) },
            { name: "prepare$ebnf$1", symbols: ["prepare$ebnf$1$subexpression$1"], postprocess: n },
            { name: "prepare$ebnf$1", symbols: [], postprocess: () => null },
            { name: "prepare", symbols: ["kw_prepare", "ident", "prepare$ebnf$1", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "statement_noprep"], postprocess: (c) => (0, g.track)(c, {
              type: "prepare",
              name: s(c[1]),
              ...c[2] && { args: c[2] },
              statement: a(B(c))
            }) },
            { name: "deallocate$ebnf$1", symbols: ["kw_prepare"], postprocess: n },
            { name: "deallocate$ebnf$1", symbols: [], postprocess: () => null },
            { name: "deallocate", symbols: ["kw_deallocate", "deallocate$ebnf$1", "deallocate_target"], postprocess: (c) => (0, g.track)(c, {
              type: "deallocate",
              target: c[2]
            }) },
            { name: "deallocate_target", symbols: ["deallocate_all"], postprocess: a },
            { name: "deallocate_target", symbols: ["deallocate_name"], postprocess: a },
            { name: "deallocate_name", symbols: ["ident"], postprocess: (c) => (0, g.track)(c, s(c[0])) },
            { name: "deallocate_all", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all], postprocess: (c) => (0, g.track)(c, { option: "all" }) },
            { name: "create_view_statements", symbols: ["create_view"] },
            { name: "create_view_statements", symbols: ["create_materialized_view"] },
            { name: "create_view$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_or") ? { type: "kw_or" } : kw_or, "kw_replace"] },
            { name: "create_view$ebnf$1", symbols: ["create_view$ebnf$1$subexpression$1"], postprocess: n },
            { name: "create_view$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$2$subexpression$1", symbols: ["kw_temp"] },
            { name: "create_view$ebnf$2$subexpression$1", symbols: ["kw_temporary"] },
            { name: "create_view$ebnf$2", symbols: ["create_view$ebnf$2$subexpression$1"], postprocess: n },
            { name: "create_view$ebnf$2", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$3", symbols: ["kw_recursive"], postprocess: n },
            { name: "create_view$ebnf$3", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$2", symbols: ["ident"] },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "create_view$ebnf$4$subexpression$1$macrocall$2"], postprocess: B },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1", symbols: ["create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1", "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$1", symbols: ["create_view$ebnf$4$subexpression$1$macrocall$2", "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "create_view$ebnf$4$subexpression$1", symbols: ["lparen", "create_view$ebnf$4$subexpression$1$macrocall$1", "rparen"], postprocess: C(1) },
            { name: "create_view$ebnf$4", symbols: ["create_view$ebnf$4$subexpression$1"], postprocess: n },
            { name: "create_view$ebnf$4", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$5", symbols: ["create_view_opts"], postprocess: n },
            { name: "create_view$ebnf$5", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$6$subexpression$1$subexpression$1", symbols: ["kw_local"] },
            { name: "create_view$ebnf$6$subexpression$1$subexpression$1", symbols: ["kw_cascaded"] },
            { name: "create_view$ebnf$6$subexpression$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "create_view$ebnf$6$subexpression$1$subexpression$1", o.lexerAny.has("kw_check") ? { type: "kw_check" } : kw_check, "kw_option"], postprocess: C(1) },
            { name: "create_view$ebnf$6", symbols: ["create_view$ebnf$6$subexpression$1"], postprocess: n },
            { name: "create_view$ebnf$6", symbols: [], postprocess: () => null },
            { name: "create_view", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "create_view$ebnf$1", "create_view$ebnf$2", "create_view$ebnf$3", "kw_view", "qualified_name", "create_view$ebnf$4", "create_view$ebnf$5", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "selection", "create_view$ebnf$6"], postprocess: (c) => (0, g.track)(c, {
              type: "create view",
              ...c[1] && { orReplace: !0 },
              ...c[2] && { temp: !0 },
              ...c[3] && { recursive: !0 },
              name: c[5],
              ...c[6] && { columnNames: c[6].map(s) },
              ...c[7] && { parameters: m(c[7]) },
              query: c[9],
              ...c[10] && { checkOption: d(c[10]) }
            }) },
            { name: "create_view_opt", symbols: ["ident", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "ident"], postprocess: ([c, J, p]) => [d(c), d(p)] },
            { name: "create_view_opts$macrocall$2", symbols: ["create_view_opt"] },
            { name: "create_view_opts$macrocall$1$ebnf$1", symbols: [] },
            { name: "create_view_opts$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "create_view_opts$macrocall$2"], postprocess: B },
            { name: "create_view_opts$macrocall$1$ebnf$1", symbols: ["create_view_opts$macrocall$1$ebnf$1", "create_view_opts$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_view_opts$macrocall$1", symbols: ["create_view_opts$macrocall$2", "create_view_opts$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "create_view_opts", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "create_view_opts$macrocall$1"], postprocess: B },
            { name: "create_materialized_view$ebnf$1", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "create_materialized_view$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$2", symbols: ["ident"] },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "create_materialized_view$ebnf$2$subexpression$1$macrocall$2"], postprocess: B },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1", symbols: ["create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1", "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$1", symbols: ["create_materialized_view$ebnf$2$subexpression$1$macrocall$2", "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "create_materialized_view$ebnf$2$subexpression$1", symbols: ["lparen", "create_materialized_view$ebnf$2$subexpression$1$macrocall$1", "rparen"], postprocess: C(1) },
            { name: "create_materialized_view$ebnf$2", symbols: ["create_materialized_view$ebnf$2$subexpression$1"], postprocess: n },
            { name: "create_materialized_view$ebnf$2", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$3", symbols: ["create_view_opts"], postprocess: n },
            { name: "create_materialized_view$ebnf$3", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$4$subexpression$1", symbols: ["kw_tablespace", "ident"], postprocess: B },
            { name: "create_materialized_view$ebnf$4", symbols: ["create_materialized_view$ebnf$4$subexpression$1"], postprocess: n },
            { name: "create_materialized_view$ebnf$4", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$5$subexpression$1$ebnf$1", symbols: ["kw_no"], postprocess: n },
            { name: "create_materialized_view$ebnf$5$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$5$subexpression$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "create_materialized_view$ebnf$5$subexpression$1$ebnf$1", "kw_data"] },
            { name: "create_materialized_view$ebnf$5", symbols: ["create_materialized_view$ebnf$5$subexpression$1"], postprocess: n },
            { name: "create_materialized_view$ebnf$5", symbols: [], postprocess: () => null },
            { name: "create_materialized_view", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "kw_materialized", "kw_view", "create_materialized_view$ebnf$1", "qualified_name", "create_materialized_view$ebnf$2", "create_materialized_view$ebnf$3", "create_materialized_view$ebnf$4", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "selection", "create_materialized_view$ebnf$5"], postprocess: (c) => (0, g.track)(c, {
              type: "create materialized view",
              ...c[3] && { ifNotExists: !0 },
              name: c[4],
              ...c[5] && { columnNames: c[6].map(s) },
              ...c[6] && { parameters: m(c[6]) },
              ...c[7] && { tablespace: s(c[7]) },
              query: c[9],
              ...c[10] && { withData: d(c[10][1]) !== "no" }
            }) },
            { name: "refresh_view_statements$ebnf$1", symbols: [o.lexerAny.has("kw_concurrently") ? { type: "kw_concurrently" } : kw_concurrently], postprocess: n },
            { name: "refresh_view_statements$ebnf$1", symbols: [], postprocess: () => null },
            { name: "refresh_view_statements$ebnf$2$subexpression$1$ebnf$1", symbols: ["kw_no"], postprocess: n },
            { name: "refresh_view_statements$ebnf$2$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "refresh_view_statements$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "refresh_view_statements$ebnf$2$subexpression$1$ebnf$1", "kw_data"] },
            { name: "refresh_view_statements$ebnf$2", symbols: ["refresh_view_statements$ebnf$2$subexpression$1"], postprocess: n },
            { name: "refresh_view_statements$ebnf$2", symbols: [], postprocess: () => null },
            { name: "refresh_view_statements", symbols: ["kw_refresh", "kw_materialized", "kw_view", "refresh_view_statements$ebnf$1", "qname", "refresh_view_statements$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "refresh materialized view",
              ...c[3] ? { concurrently: !0 } : {},
              name: c[4],
              ...c[5] ? { withData: d(c[5][1]) !== "no" } : {}
            }) },
            { name: "functions_statements", symbols: ["create_func"] },
            { name: "functions_statements", symbols: ["do_stm"] },
            { name: "functions_statements", symbols: ["drop_func"] },
            { name: "create_func$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_or") ? { type: "kw_or" } : kw_or, "kw_replace"] },
            { name: "create_func$ebnf$1", symbols: ["create_func$ebnf$1$subexpression$1"], postprocess: n },
            { name: "create_func$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$2", symbols: ["func_argdef"] },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "create_func$subexpression$1$ebnf$1$macrocall$2"], postprocess: B },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1", symbols: ["create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1", "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$1", symbols: ["create_func$subexpression$1$ebnf$1$macrocall$2", "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "create_func$subexpression$1$ebnf$1", symbols: ["create_func$subexpression$1$ebnf$1$macrocall$1"], postprocess: n },
            { name: "create_func$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_func$subexpression$1", symbols: ["lparen", "create_func$subexpression$1$ebnf$1", "rparen"], postprocess: C(1) },
            { name: "create_func$ebnf$2", symbols: ["func_spec"] },
            { name: "create_func$ebnf$2", symbols: ["create_func$ebnf$2", "func_spec"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_func", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "create_func$ebnf$1", "kw_function", "qname", "create_func$subexpression$1", "create_func$ebnf$2"], postprocess: (c, J) => {
              var p;
              const N = {};
              for (const v of c[5]) {
                for (const K in v)
                  if (K[0] !== "_" && K in N)
                    throw new Error("conflicting or redundant options " + K);
                Object.assign(N, v);
              }
              return (0, g.track)(c, {
                type: "create function",
                ...c[1] && { orReplace: !0 },
                name: c[3],
                arguments: (p = c[4]) !== null && p !== void 0 ? p : [],
                ...N
              });
            } },
            { name: "func_argdef$ebnf$1", symbols: ["func_argopts"], postprocess: n },
            { name: "func_argdef$ebnf$1", symbols: [], postprocess: () => null },
            { name: "func_argdef$ebnf$2", symbols: ["func_argdefault"], postprocess: n },
            { name: "func_argdef$ebnf$2", symbols: [], postprocess: () => null },
            { name: "func_argdef", symbols: ["func_argdef$ebnf$1", "data_type", "func_argdef$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              default: c[2],
              type: c[1],
              ...c[0]
            }) },
            {
              name: "func_argdefault",
              symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default, "expr"],
              postprocess: (c) => c[1]
            },
            { name: "func_argdefault", symbols: [o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "expr"], postprocess: (c) => c[1] },
            { name: "func_argopts$ebnf$1", symbols: ["word"], postprocess: n },
            { name: "func_argopts$ebnf$1", symbols: [], postprocess: () => null },
            { name: "func_argopts", symbols: ["func_argmod", "func_argopts$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              mode: d(c[0]),
              ...c[1] && { name: s(c[1]) }
            }) },
            { name: "func_argopts", symbols: ["word"], postprocess: (c, J) => {
              const p = s(c);
              return p === "out" || p === "inout" || p === "variadic" ? J : (0, g.track)(c, { name: p });
            } },
            { name: "func_argmod", symbols: [o.lexerAny.has("kw_in") ? { type: "kw_in" } : kw_in] },
            { name: "func_argmod", symbols: ["kw_out"] },
            { name: "func_argmod", symbols: ["kw_inout"] },
            { name: "func_argmod", symbols: ["kw_variadic"] },
            { name: "func_spec", symbols: ["kw_language", "word"], postprocess: (c) => (0, g.track)(c, { language: s(B(c)) }) },
            { name: "func_spec", symbols: ["func_purity"], postprocess: (c) => (0, g.track)(c, { purity: d(c) }) },
            { name: "func_spec$subexpression$1", symbols: [o.lexerAny.has("codeblock") ? { type: "codeblock" } : codeblock] },
            { name: "func_spec$subexpression$1", symbols: ["string"] },
            { name: "func_spec", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "func_spec$subexpression$1"], postprocess: (c) => ({ code: d(B(c)) }) },
            { name: "func_spec$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "func_spec$ebnf$1", symbols: [], postprocess: () => null },
            { name: "func_spec$subexpression$2", symbols: ["word"], postprocess: G("leakproof") },
            { name: "func_spec", symbols: ["func_spec$ebnf$1", "func_spec$subexpression$2"], postprocess: (c) => (0, g.track)(c, { leakproof: !c[0] }) },
            { name: "func_spec", symbols: ["func_returns"], postprocess: (c) => (0, g.track)(c, { returns: a(c) }) },
            { name: "func_spec$subexpression$3", symbols: ["word"], postprocess: G("called") },
            { name: "func_spec", symbols: ["func_spec$subexpression$3", "oninp"], postprocess: () => ({ onNullInput: "call" }) },
            { name: "func_spec$subexpression$4", symbols: ["word"], postprocess: G("returns") },
            { name: "func_spec", symbols: ["func_spec$subexpression$4", o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null, "oninp"], postprocess: () => ({ onNullInput: "null" }) },
            { name: "func_spec$subexpression$5", symbols: ["word"], postprocess: G("strict") },
            { name: "func_spec", symbols: ["func_spec$subexpression$5"], postprocess: () => ({ onNullInput: "strict" }) },
            { name: "func_purity", symbols: ["word"], postprocess: G("immutable") },
            { name: "func_purity", symbols: ["word"], postprocess: G("stable") },
            { name: "func_purity", symbols: ["word"], postprocess: G("volatile") },
            { name: "oninp$subexpression$1", symbols: ["word"], postprocess: G("input") },
            { name: "oninp", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null, "oninp$subexpression$1"] },
            { name: "func_returns", symbols: ["kw_returns", "data_type"], postprocess: B },
            { name: "func_returns$macrocall$2", symbols: ["func_ret_table_col"] },
            { name: "func_returns$macrocall$1$ebnf$1", symbols: [] },
            { name: "func_returns$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "func_returns$macrocall$2"], postprocess: B },
            { name: "func_returns$macrocall$1$ebnf$1", symbols: ["func_returns$macrocall$1$ebnf$1", "func_returns$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "func_returns$macrocall$1", symbols: ["func_returns$macrocall$2", "func_returns$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "func_returns", symbols: ["kw_returns", o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table, "lparen", "func_returns$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, {
              kind: "table",
              columns: c[3]
            }) },
            { name: "func_ret_table_col", symbols: ["word", "data_type"], postprocess: (c) => (0, g.track)(c, { name: s(c[0]), type: c[1] }) },
            { name: "do_stm$ebnf$1$subexpression$1", symbols: ["kw_language", "word"], postprocess: B },
            { name: "do_stm$ebnf$1", symbols: ["do_stm$ebnf$1$subexpression$1"], postprocess: n },
            { name: "do_stm$ebnf$1", symbols: [], postprocess: () => null },
            { name: "do_stm", symbols: [o.lexerAny.has("kw_do") ? { type: "kw_do" } : kw_do, "do_stm$ebnf$1", o.lexerAny.has("codeblock") ? { type: "codeblock" } : codeblock], postprocess: (c) => (0, g.track)(c, {
              type: "do",
              ...c[1] && { language: s(c[1]) },
              code: c[2].value
            }) },
            { name: "drop_func$ebnf$1$subexpression$1", symbols: ["kw_if", "kw_exists"] },
            { name: "drop_func$ebnf$1", symbols: ["drop_func$ebnf$1$subexpression$1"], postprocess: n },
            { name: "drop_func$ebnf$1", symbols: [], postprocess: () => null },
            { name: "drop_func$ebnf$2", symbols: ["drop_func_overload"], postprocess: n },
            { name: "drop_func$ebnf$2", symbols: [], postprocess: () => null },
            { name: "drop_func", symbols: ["kw_drop", "kw_function", "drop_func$ebnf$1", "qname", "drop_func$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "drop function",
              ...c[2] && { ifExists: !0 },
              name: c[3],
              ...c[4] && { arguments: c[4] }
            }) },
            { name: "drop_func_overload$macrocall$2", symbols: ["drop_func_overload_col"] },
            { name: "drop_func_overload$macrocall$1$ebnf$1", symbols: [] },
            { name: "drop_func_overload$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "drop_func_overload$macrocall$2"], postprocess: B },
            { name: "drop_func_overload$macrocall$1$ebnf$1", symbols: ["drop_func_overload$macrocall$1$ebnf$1", "drop_func_overload$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "drop_func_overload$macrocall$1", symbols: ["drop_func_overload$macrocall$2", "drop_func_overload$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "drop_func_overload", symbols: ["lparen", "drop_func_overload$macrocall$1", "rparen"], postprocess: C(1) },
            { name: "drop_func_overload_col$ebnf$1", symbols: ["word"], postprocess: n },
            { name: "drop_func_overload_col$ebnf$1", symbols: [], postprocess: () => null },
            { name: "drop_func_overload_col", symbols: ["drop_func_overload_col$ebnf$1", "qname"], postprocess: (c) => (0, g.track)(c, {
              type: c[1],
              ...c[0] && { name: s(c[0]) }
            }) },
            { name: "main$ebnf$1", symbols: [] },
            { name: "main$ebnf$1", symbols: ["main$ebnf$1", "statement_separator"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "main$ebnf$2", symbols: [] },
            { name: "main$ebnf$2$subexpression$1$ebnf$1", symbols: ["statement_separator"] },
            { name: "main$ebnf$2$subexpression$1$ebnf$1", symbols: ["main$ebnf$2$subexpression$1$ebnf$1", "statement_separator"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "main$ebnf$2$subexpression$1", symbols: ["main$ebnf$2$subexpression$1$ebnf$1", "statement"] },
            { name: "main$ebnf$2", symbols: ["main$ebnf$2", "main$ebnf$2$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "main$ebnf$3", symbols: [] },
            { name: "main$ebnf$3", symbols: ["main$ebnf$3", "statement_separator"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "main", symbols: ["main$ebnf$1", "statement", "main$ebnf$2", "main$ebnf$3"], postprocess: ([c, J, p]) => {
              const N = p, v = [a(J), ...N.map((K) => a(K[1]))];
              return v.length === 1 ? v[0] : v;
            } },
            { name: "statement_separator", symbols: [o.lexerAny.has("semicolon") ? { type: "semicolon" } : semicolon] },
            { name: "statement", symbols: ["statement_noprep"] },
            { name: "statement", symbols: ["prepare"] },
            { name: "statement", symbols: ["deallocate"] },
            { name: "statement_noprep", symbols: ["selection"] },
            { name: "statement_noprep", symbols: ["createtable_statement"] },
            { name: "statement_noprep", symbols: ["createextension_statement"] },
            { name: "statement_noprep", symbols: ["createindex_statement"] },
            { name: "statement_noprep", symbols: ["simplestatements_all"] },
            { name: "statement_noprep", symbols: ["insert_statement"] },
            { name: "statement_noprep", symbols: ["update_statement"] },
            { name: "statement_noprep", symbols: ["altertable_statement"] },
            { name: "statement_noprep", symbols: ["alterindex_statement"] },
            { name: "statement_noprep", symbols: ["delete_statement"] },
            { name: "statement_noprep", symbols: ["create_sequence_statement"] },
            { name: "statement_noprep", symbols: ["alter_sequence_statement"] },
            { name: "statement_noprep", symbols: ["drop_statement"] },
            { name: "statement_noprep", symbols: ["createtype_statement"] },
            { name: "statement_noprep", symbols: ["create_view_statements"] },
            { name: "statement_noprep", symbols: ["refresh_view_statements"] },
            { name: "statement_noprep", symbols: ["create_schema"] },
            { name: "statement_noprep", symbols: ["raise_statement"] },
            { name: "statement_noprep", symbols: ["comment_statement"] },
            { name: "statement_noprep", symbols: ["functions_statements"] },
            { name: "selection", symbols: ["select_statement"], postprocess: a },
            { name: "selection", symbols: ["select_values"], postprocess: a },
            { name: "selection", symbols: ["with_statement"], postprocess: a },
            { name: "selection", symbols: ["with_recursive_statement"], postprocess: a },
            { name: "selection", symbols: ["union_statement"], postprocess: a },
            { name: "selection_paren", symbols: ["lparen", "selection", "rparen"], postprocess: C(1) }
          ],
          ParserStart: "main"
        };
        t.default = Z;
      },
      /* 11 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(I) {
          return I[0];
        }
        const o = i(12), g = (I) => I && I[I.length - 1], s = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "main$ebnf$1", symbols: ["elements"], postprocess: n },
            { name: "main$ebnf$1", symbols: [], postprocess: () => null },
            { name: "main", symbols: [o.lexerAny.has("start_list") ? { type: "start_list" } : start_list, "main$ebnf$1", o.lexerAny.has("end_list") ? { type: "end_list" } : end_list], postprocess: (I) => I[1] || [] },
            { name: "elements$ebnf$1", symbols: [] },
            { name: "elements$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "elt"], postprocess: g },
            { name: "elements$ebnf$1", symbols: ["elements$ebnf$1", "elements$ebnf$1$subexpression$1"], postprocess: (I) => I[0].concat([I[1]]) },
            { name: "elements", symbols: ["elt", "elements$ebnf$1"], postprocess: ([I, r]) => [I, ...r || []] },
            { name: "elt", symbols: [o.lexerAny.has("value") ? { type: "value" } : value], postprocess: (I) => I[0].value },
            { name: "elt", symbols: ["main"], postprocess: (I) => I[0] }
          ],
          ParserStart: "main"
        };
        t.default = s;
      },
      /* 12 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.lexerAny = t.lexer = void 0;
        const n = i(0);
        t.lexer = (0, n.compile)({
          valueString: {
            match: /"(?:\\["\\]|[^\n"\\])*"/,
            value: (o) => JSON.parse(o),
            type: (o) => "value"
          },
          valueRaw: {
            match: /[^\s,\{\}"](?:[^,\{\}"]*[^\s,\{\}"])?/,
            type: () => "value"
          },
          comma: ",",
          space: { match: /[\s\t\n\v\f\r]+/, lineBreaks: !0 },
          start_list: "{",
          end_list: "}"
        }), t.lexer.next = ((o) => () => {
          let g;
          for (; (g = o.call(t.lexer)) && g.type === "space"; )
            ;
          return g;
        })(t.lexer.next), t.lexerAny = t.lexer;
      },
      /* 13 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(a) {
          return a[0];
        }
        const o = i(14), g = (a) => (C) => C[a], s = (a) => a && a[a.length - 1];
        function I(a) {
          return Array.isArray(a) && a.length === 1 && (a = I(a[0])), Array.isArray(a) && !a.length ? null : a;
        }
        const r = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "number$subexpression$1", symbols: ["float"] },
            { name: "number$subexpression$1", symbols: ["int"] },
            { name: "number", symbols: ["number$subexpression$1"], postprocess: I },
            { name: "float", symbols: [o.lexerAny.has("float") ? { type: "float" } : float], postprocess: (a) => parseFloat(I(a)) },
            { name: "int", symbols: [o.lexerAny.has("int") ? { type: "int" } : int], postprocess: (a) => parseInt(I(a), 10) },
            { name: "comma", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma], postprocess: n },
            { name: "point$macrocall$2", symbols: ["point_content"] },
            { name: "point$macrocall$1$subexpression$1", symbols: ["point$macrocall$2"] },
            { name: "point$macrocall$1$subexpression$1", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen, "point$macrocall$2", o.lexerAny.has("rparen") ? { type: "rparen" } : rparen], postprocess: g(1) },
            { name: "point$macrocall$1", symbols: ["point$macrocall$1$subexpression$1"], postprocess: I },
            { name: "point", symbols: ["point$macrocall$1"], postprocess: I },
            { name: "point_content", symbols: ["number", "comma", "number"], postprocess: (a) => ({ x: a[0], y: a[2] }) },
            { name: "line", symbols: [o.lexerAny.has("lcurl") ? { type: "lcurl" } : lcurl, "number", "comma", "number", "comma", "number", o.lexerAny.has("rcurl") ? { type: "rcurl" } : rcurl], postprocess: (a) => ({
              a: a[1],
              b: a[3],
              c: a[5]
            }) },
            { name: "box", symbols: ["closed_path"], postprocess: ([a], C) => a.length !== 2 ? C : a },
            { name: "lseg", symbols: ["path"], postprocess: ([a], C) => a.path.length !== 2 ? C : a.path },
            { name: "path", symbols: ["open_path"], postprocess: ([a]) => ({ closed: !1, path: a }) },
            { name: "path", symbols: ["closed_path"], postprocess: ([a]) => ({ closed: !0, path: a }) },
            { name: "open_path$macrocall$2", symbols: [o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket] },
            { name: "open_path$macrocall$3", symbols: [o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket] },
            { name: "open_path$macrocall$1$macrocall$2", symbols: ["point"] },
            { name: "open_path$macrocall$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "open_path$macrocall$1$macrocall$2"], postprocess: s },
            { name: "open_path$macrocall$1$macrocall$1$ebnf$1", symbols: ["open_path$macrocall$1$macrocall$1$ebnf$1", "open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (a) => a[0].concat([a[1]]) },
            { name: "open_path$macrocall$1$macrocall$1", symbols: ["open_path$macrocall$1$macrocall$2", "open_path$macrocall$1$macrocall$1$ebnf$1"], postprocess: ([a, C]) => [I(a), ...C.map(I) || []] },
            { name: "open_path$macrocall$1", symbols: ["open_path$macrocall$2", "open_path$macrocall$1$macrocall$1", "open_path$macrocall$3"], postprocess: g(1) },
            { name: "open_path", symbols: ["open_path$macrocall$1"], postprocess: s },
            { name: "closed_path$subexpression$1$macrocall$2", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen] },
            { name: "closed_path$subexpression$1$macrocall$3", symbols: [o.lexerAny.has("rparen") ? { type: "rparen" } : rparen] },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$2", symbols: ["point"] },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "closed_path$subexpression$1$macrocall$1$macrocall$2"], postprocess: s },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1", symbols: ["closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1", "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (a) => a[0].concat([a[1]]) },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$1", symbols: ["closed_path$subexpression$1$macrocall$1$macrocall$2", "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1"], postprocess: ([a, C]) => [I(a), ...C.map(I) || []] },
            { name: "closed_path$subexpression$1$macrocall$1", symbols: ["closed_path$subexpression$1$macrocall$2", "closed_path$subexpression$1$macrocall$1$macrocall$1", "closed_path$subexpression$1$macrocall$3"], postprocess: g(1) },
            { name: "closed_path$subexpression$1", symbols: ["closed_path$subexpression$1$macrocall$1"], postprocess: s },
            { name: "closed_path$subexpression$1$macrocall$5", symbols: ["point"] },
            { name: "closed_path$subexpression$1$macrocall$4$ebnf$1", symbols: [] },
            { name: "closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "closed_path$subexpression$1$macrocall$5"], postprocess: s },
            { name: "closed_path$subexpression$1$macrocall$4$ebnf$1", symbols: ["closed_path$subexpression$1$macrocall$4$ebnf$1", "closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1"], postprocess: (a) => a[0].concat([a[1]]) },
            { name: "closed_path$subexpression$1$macrocall$4", symbols: ["closed_path$subexpression$1$macrocall$5", "closed_path$subexpression$1$macrocall$4$ebnf$1"], postprocess: ([a, C]) => [I(a), ...C.map(I) || []] },
            { name: "closed_path$subexpression$1", symbols: ["closed_path$subexpression$1$macrocall$4"], postprocess: s },
            { name: "closed_path", symbols: ["closed_path$subexpression$1"], postprocess: g(0) },
            { name: "polygon", symbols: ["closed_path"], postprocess: g(0) },
            { name: "circle_body", symbols: ["point", "comma", "number"], postprocess: (a) => ({ c: a[0], r: a[2] }) },
            { name: "circle$subexpression$1$macrocall$2", symbols: [o.lexerAny.has("lcomp") ? { type: "lcomp" } : lcomp] },
            { name: "circle$subexpression$1$macrocall$3", symbols: [o.lexerAny.has("rcomp") ? { type: "rcomp" } : rcomp] },
            { name: "circle$subexpression$1$macrocall$1", symbols: ["circle$subexpression$1$macrocall$2", "circle_body", "circle$subexpression$1$macrocall$3"], postprocess: g(1) },
            { name: "circle$subexpression$1", symbols: ["circle$subexpression$1$macrocall$1"] },
            { name: "circle$subexpression$1$macrocall$5", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen] },
            { name: "circle$subexpression$1$macrocall$6", symbols: [o.lexerAny.has("rparen") ? { type: "rparen" } : rparen] },
            { name: "circle$subexpression$1$macrocall$4", symbols: ["circle$subexpression$1$macrocall$5", "circle_body", "circle$subexpression$1$macrocall$6"], postprocess: g(1) },
            { name: "circle$subexpression$1", symbols: ["circle$subexpression$1$macrocall$4"] },
            { name: "circle$subexpression$1", symbols: ["circle_body"] },
            { name: "circle", symbols: ["circle$subexpression$1"], postprocess: I }
          ],
          ParserStart: "number"
        };
        t.default = r;
      },
      /* 14 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.lexerAny = t.lexer = void 0;
        const n = i(0);
        t.lexer = (0, n.compile)({
          comma: ",",
          space: { match: /[\s\t\n\v\f\r]+/, lineBreaks: !0 },
          int: /\-?\d+(?![\.\d])/,
          float: /\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,
          lcurl: "{",
          rcurl: "}",
          lparen: "(",
          rparen: ")",
          lbracket: "[",
          rbracket: "]",
          lcomp: "<",
          rcomp: ">"
        }), t.lexer.next = ((o) => () => {
          let g;
          for (; (g = o.call(t.lexer)) && g.type === "space"; )
            ;
          return g;
        })(t.lexer.next), t.lexerAny = t.lexer;
      },
      /* 15 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(s) {
          return s[0];
        }
        const o = i(16), g = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "main$ebnf$1", symbols: ["elt"] },
            { name: "main$ebnf$1", symbols: ["main$ebnf$1", "elt"], postprocess: (s) => s[0].concat([s[1]]) },
            { name: "main", symbols: ["main$ebnf$1"], postprocess: ([s]) => {
              const I = /* @__PURE__ */ new Set();
              for (const r of s) {
                const a = typeof r[1] == "number" ? r[0] : "time";
                if (I.has(a))
                  return "invalid";
                I.add(a);
              }
              return s;
            } },
            { name: "elt", symbols: ["time"] },
            { name: "elt", symbols: ["num", "unit"], postprocess: ([[s], I]) => (I = I[0].type, [I, s]) },
            { name: "unit", symbols: [o.lexerAny.has("years") ? { type: "years" } : years] },
            { name: "unit", symbols: [o.lexerAny.has("months") ? { type: "months" } : months] },
            { name: "unit", symbols: [o.lexerAny.has("days") ? { type: "days" } : days] },
            { name: "unit", symbols: [o.lexerAny.has("hours") ? { type: "hours" } : hours] },
            { name: "unit", symbols: [o.lexerAny.has("minutes") ? { type: "minutes" } : minutes] },
            { name: "unit", symbols: [o.lexerAny.has("seconds") ? { type: "seconds" } : seconds] },
            { name: "unit", symbols: [o.lexerAny.has("milliseconds") ? { type: "milliseconds" } : milliseconds] },
            { name: "num", symbols: ["int"] },
            { name: "num", symbols: ["float"] },
            { name: "uint", symbols: [o.lexerAny.has("int") ? { type: "int" } : int], postprocess: ([s]) => parseInt(s, 10) },
            { name: "int$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("neg") ? { type: "neg" } : neg] },
            { name: "int$ebnf$1", symbols: ["int$ebnf$1$subexpression$1"], postprocess: n },
            { name: "int$ebnf$1", symbols: [], postprocess: () => null },
            { name: "int", symbols: ["int$ebnf$1", o.lexerAny.has("int") ? { type: "int" } : int], postprocess: ([s, I]) => parseInt(I, 10) * (s ? -1 : 1) },
            { name: "float$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("neg") ? { type: "neg" } : neg] },
            { name: "float$ebnf$1", symbols: ["float$ebnf$1$subexpression$1"], postprocess: n },
            { name: "float$ebnf$1", symbols: [], postprocess: () => null },
            { name: "float$ebnf$2", symbols: [o.lexerAny.has("int") ? { type: "int" } : int], postprocess: n },
            { name: "float$ebnf$2", symbols: [], postprocess: () => null },
            { name: "float", symbols: ["float$ebnf$1", "float$ebnf$2", o.lexerAny.has("dot") ? { type: "dot" } : dot, o.lexerAny.has("int") ? { type: "int" } : int], postprocess: ([s, ...I]) => parseFloat(I.map((r) => r ? r.text : "0").join("")) * (s ? -1 : 1) },
            { name: "time$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("colon") ? { type: "colon" } : colon, "uint"] },
            { name: "time$ebnf$1", symbols: ["time$ebnf$1$subexpression$1"], postprocess: n },
            { name: "time$ebnf$1", symbols: [], postprocess: () => null },
            { name: "time$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("dot") ? { type: "dot" } : dot, o.lexerAny.has("int") ? { type: "int" } : int] },
            { name: "time$ebnf$2", symbols: ["time$ebnf$2$subexpression$1"], postprocess: n },
            { name: "time$ebnf$2", symbols: [], postprocess: () => null },
            { name: "time", symbols: ["uint", o.lexerAny.has("colon") ? { type: "colon" } : colon, "uint", "time$ebnf$1", "time$ebnf$2"], postprocess: ([s, I, r, a, C]) => {
              a = a && a[1], C = C && C[1];
              const B = typeof a == "number" ? [
                ["hours", s],
                ["minutes", r],
                ["seconds", a]
              ] : [
                ["minutes", s],
                ["seconds", r]
              ];
              return C && B.push(["milliseconds", parseFloat("0." + C) * 1e3]), B;
            } }
          ],
          ParserStart: "main"
        };
        t.default = g;
      },
      /* 16 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.lexerAny = t.lexer = void 0;
        const n = i(0);
        t.lexer = (0, n.compile)({
          int: /\d+/,
          neg: "-",
          dot: ".",
          years: /(?:y|yrs?|years?)\b/,
          months: /(?:mon(?:th)?s?)\b/,
          days: /(?:d|days?)\b/,
          hours: /(?:h|hrs?|hours?)\b/,
          minutes: /(?:m|mins?|minutes?)\b/,
          seconds: /(?:s|secs?|seconds?)\b/,
          milliseconds: /(?:ms|milliseconds?)\b/,
          space: { match: /[\s\t\n\v\f\r]+/, lineBreaks: !0 },
          colon: ":"
        }), t.lexer.next = ((o) => () => {
          let g;
          for (; (g = o.call(t.lexer)) && g.type === "space"; )
            ;
          return g;
        })(t.lexer.next), t.lexerAny = t.lexer;
      },
      /* 17 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(s) {
          return s[0];
        }
        const o = i(18), g = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "num", symbols: [o.lexerAny.has("int") ? { type: "int" } : int] },
            { name: "num", symbols: [o.lexerAny.has("float") ? { type: "float" } : float] },
            { name: "main$ebnf$1", symbols: [] },
            { name: "main$ebnf$1", symbols: ["main$ebnf$1", "long"], postprocess: (s) => s[0].concat([s[1]]) },
            { name: "main$ebnf$2$subexpression$1$ebnf$1", symbols: ["short"] },
            { name: "main$ebnf$2$subexpression$1$ebnf$1", symbols: ["main$ebnf$2$subexpression$1$ebnf$1", "short"], postprocess: (s) => s[0].concat([s[1]]) },
            { name: "main$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("T") ? { type: "T" } : T, "main$ebnf$2$subexpression$1$ebnf$1"] },
            { name: "main$ebnf$2", symbols: ["main$ebnf$2$subexpression$1"], postprocess: n },
            { name: "main$ebnf$2", symbols: [], postprocess: () => null },
            { name: "main", symbols: [o.lexerAny.has("P") ? { type: "P" } : P, "main$ebnf$1", "main$ebnf$2"], postprocess: ([s, I, r], a) => (r = r ? r[1] : [], !I.length && !r.length ? a : I.length ? r.length ? [...I, ...r] : I : r) },
            { name: "long$subexpression$1", symbols: [o.lexerAny.has("Y") ? { type: "Y" } : Y] },
            { name: "long$subexpression$1", symbols: [o.lexerAny.has("M") ? { type: "M" } : M] },
            { name: "long$subexpression$1", symbols: [o.lexerAny.has("W") ? { type: "W" } : W] },
            { name: "long$subexpression$1", symbols: [o.lexerAny.has("D") ? { type: "D" } : D] },
            { name: "long", symbols: ["num", "long$subexpression$1"], postprocess: ([s, I]) => {
              switch (s = parseFloat(s[0].value), I = I[0].type, I) {
                case "Y":
                  return ["years", s];
                case "M":
                  return ["months", s];
                case "W":
                  return ["days", s * 7];
                case "D":
                  return ["days", s];
                default:
                  throw new Error("Unexpected unit " + I);
              }
            } },
            { name: "short$ebnf$1", symbols: [o.lexerAny.has("T") ? { type: "T" } : T], postprocess: n },
            { name: "short$ebnf$1", symbols: [], postprocess: () => null },
            { name: "short$subexpression$1", symbols: [o.lexerAny.has("H") ? { type: "H" } : H] },
            { name: "short$subexpression$1", symbols: [o.lexerAny.has("M") ? { type: "M" } : M] },
            { name: "short$subexpression$1", symbols: [o.lexerAny.has("S") ? { type: "S" } : S] },
            { name: "short", symbols: ["short$ebnf$1", "num", "short$subexpression$1"], postprocess: ([s, I, r]) => {
              switch (I = parseFloat(I[0].value), r = r[0].type, r) {
                case "H":
                  return ["hours", I];
                case "M":
                  return ["minutes", I];
                case "S":
                  return ["seconds", I];
                default:
                  throw new Error("Unexpected unit " + r);
              }
            } }
          ],
          ParserStart: "num"
        };
        t.default = g;
      },
      /* 18 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.lexerAny = t.lexer = void 0;
        const n = i(0);
        t.lexer = (0, n.compile)({
          int: /\-?\d+(?![\.\d])/,
          float: /\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,
          P: "P",
          Y: "Y",
          M: "M",
          W: "W",
          D: "D",
          H: "H",
          S: "S",
          T: "T"
        }), t.lexerAny = t.lexer;
      },
      /* 19 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.toSql = void 0;
        const n = i(2), o = i(5), g = i(6), s = i(20), I = i(3), r = new Set(I.sqlKeywords.map((J) => J.toLowerCase()));
        let a = [];
        function C(J) {
          return B(J.name);
        }
        function B(J, p) {
          if (!p) {
            const N = J.toLowerCase();
            if (N === J && !r.has(N) && /^[a-z][a-z0-9_]*$/.test(N))
              return J;
          }
          return '"' + J + '"';
        }
        function l(J, p, N) {
          N && a.push("(");
          let v = !0;
          for (const K of J)
            v || a.push(", "), v = !1, p(K);
          N && a.push(")");
        }
        function Q(J, p) {
          switch (J.type) {
            case "foreign key":
              a.push(" foreign key (", ...J.localColumns.map(C).join(", "), ")");
            case "reference":
              a.push(" REFERENCES "), p.tableRef(J.foreignTable), a.push("(", ...J.foreignColumns.map(C).join(", "), ") "), J.match && a.push(" MATCH ", J.match.toUpperCase()), J.onDelete && a.push(" ON DELETE ", J.onDelete), J.onUpdate && a.push(" ON UPDATE ", J.onUpdate);
              break;
            case "primary key":
            case "unique":
              a.push(" ", J.type, " "), "columns" in J && a.push("(", ...J.columns.map(C).join(", "), ") ");
              break;
            case "check":
              a.push(" check "), p.expr(J.expr);
              break;
            case "not null":
            case "null":
              a.push(" ", J.type, " ");
              break;
            case "default":
              a.push(" default "), p.expr(J.default);
              break;
            case "add generated":
              a.push(" GENERATED "), f(p, J);
              break;
            default:
              throw g.NotSupported.never(J);
          }
          a.push(" ");
        }
        function E(J, p) {
          J.schema && a.push(B(J.schema), "."), a.push(B(J.name, p), " ");
        }
        function d(J) {
          E(J), J.alias && a.push(" AS ", B(J.alias), " ");
        }
        function m(J, p) {
          a.push(" ORDER BY "), l(p, (N) => {
            J.expr(N.by), N.order && a.push(" ", N.order, " "), N.nulls && a.push(" NULLS ", N.nulls, " ");
          }, !1);
        }
        function y(J) {
          switch (J.type) {
            case "default":
              a.push("DEFAULT ");
              break;
            case "identifier":
              a.push(J.name);
              break;
            case "list":
              let p = !0;
              for (const N of J.values)
                p || a.push(", "), p = !1, y(N);
              break;
            case "value":
              a.push(typeof J.value == "number" ? J.value.toString() : (0, s.literal)(J.value));
              break;
            default:
              throw g.NotSupported.never(J);
          }
        }
        function f(J, p) {
          p.always && a.push(p.always.toUpperCase(), " "), a.push("AS IDENTITY "), p.sequence && (a.push("("), p.sequence.name && (a.push("SEQUENCE NAME "), E(p.sequence.name), a.push(" ")), w(J, p.sequence), a.push(") "));
        }
        function w(J, p) {
          p.as && (a.push("AS "), J.dataType(p.as), a.push(" ")), typeof p.incrementBy == "number" && a.push("INCREMENT BY ", p.incrementBy.toString(), " "), p.minValue === "no minvalue" && a.push("NO MINVALUE "), typeof p.minValue == "number" && a.push("MINVALUE ", p.minValue.toString(), " "), p.maxValue === "no maxvalue" && a.push("NO MAXVALUE "), typeof p.maxValue == "number" && a.push("MAXVALUE ", p.maxValue.toString(), " "), typeof p.startWith == "number" && a.push("START WITH ", p.startWith.toString(), " "), typeof p.cache == "number" && a.push("CACHE ", p.cache.toString(), " "), p.cycle && a.push(p.cycle, " "), p.ownedBy === "none" ? a.push("OWNED BY NONE ") : p.ownedBy && (a.push("OWNED BY "), G(p.ownedBy)), "restart" in p && (p.restart === !0 ? a.push("RESTART ") : p.restart && a.push("RESTART WITH ", p.restart.toString(), " "));
        }
        function G(J) {
          J.schema && a.push(B(J.schema), "."), a.push(B(J.table), ".", B(J.column), " ");
        }
        function R(J, p, N) {
          if (!p) {
            N();
            return;
          }
          a.push(p.type, " "), N(), p.on && (a.push("ON "), J.expr(p.on)), p.using && (a.push("USING ("), l(p.using, (v) => a.push(C(v)), !1), a.push(") ")), a.push(" ");
        }
        function F(J) {
          J.opSchema ? a.push(" operator(", B(J.opSchema), ".", J.op, ") ") : a.push(" ", J.op, " ");
        }
        const Z = (0, o.astVisitor)((J) => ({
          addColumn: (...p) => {
            a.push(" ADD COLUMN "), p[0].ifNotExists && a.push("IF NOT EXISTS "), J.super().addColumn(...p);
          },
          createExtension: (p) => {
            a.push("CREATE EXTENSION "), p.ifNotExists && a.push(" IF NOT EXISTS "), a.push(C(p.extension)), !(!p.from && !p.version && !p.schema) && (a.push(" WITH"), p.schema && a.push(" SCHEMA ", C(p.schema)), p.version && a.push(" VERSION ", (0, s.literal)(p.version.value)), p.from && a.push(" FROM ", (0, s.literal)(p.from.value)));
          },
          tablespace: (p) => {
            a.push("TABLESPACE ", C(p.tablespace));
          },
          addConstraint: (p) => {
            a.push(" ADD ");
            const N = p.constraint.constraintName;
            N && a.push(" CONSTRAINT ", C(N), " "), Q(p.constraint, J);
          },
          alterColumn: (p, N) => {
            a.push(" ALTER COLUMN ", C(p.column), " "), J.super().alterColumn(p, N);
          },
          setColumnDefault: (p, N, v) => {
            if (a.push(" SET DEFAULT "), J.expr(p.default), p.updateExisting)
              throw new Error("Not implemented: updateExisting on set column default");
          },
          createEnum: (p) => {
            a.push("CREATE TYPE "), E(p.name), a.push(" AS ENUM "), l(p.values, (N) => a.push((0, s.literal)(N.value)), !0), a.push(" ");
          },
          createCompositeType: (p) => {
            a.push("CREATE TYPE "), E(p.name), a.push(" AS "), l(p.attributes, (N) => {
              a.push(C(N.name), " "), J.dataType(N.dataType), N.collate && (a.push("COLLATE "), E(N.collate));
            }, !0), a.push(" ");
          },
          setTableOwner: (p) => {
            a.push(" OWNER TO ", C(p.to));
          },
          alterColumnSimple: (p) => a.push(p.type),
          alterColumnAddGenerated: (p) => {
            a.push(" ADD GENERATED "), f(J, p);
          },
          setColumnType: (p) => {
            a.push(" SET DATA TYPE "), J.dataType(p.dataType), a.push(" ");
          },
          alterTable: (p) => {
            a.push("ALTER TABLE "), p.ifExists && a.push(" IF EXISTS "), p.only && a.push(" ONLY "), d(p.table), l(p.changes, (N) => J.tableAlteration(N, p.table), !1);
          },
          alterIndex: (p) => {
            switch (a.push("ALTER INDEX "), p.ifExists && a.push(" IF EXISTS "), d(p.index), p.change.type) {
              case "rename":
                a.push(" RENAME TO "), E(p.change.to), a.push(" ");
                break;
              case "set tablespace":
                a.push(" SET TABLESPACE "), E(p.change.tablespace), a.push(" ");
                break;
              default:
                throw g.NotSupported.never(p.change, "Alter index type not supported: ");
            }
          },
          tableAlteration: (p, N) => {
            switch (p.type) {
              case "add column":
                return J.addColumn(p, N);
              case "add constraint":
                return J.addConstraint(p, N);
              case "alter column":
                return J.alterColumn(p, N);
              case "rename":
                return J.renameTable(p, N);
              case "rename column":
                return J.renameColumn(p, N);
              case "rename constraint":
                return J.renameConstraint(p, N);
              case "drop column":
                return J.dropColumn(p, N);
              case "drop constraint":
                return J.dropConstraint(p, N);
              case "owner":
                return J.setTableOwner(p, N);
              default:
                throw g.NotSupported.never(p);
            }
          },
          array: (p) => {
            a.push(p.type === "array" ? "ARRAY[" : "("), l(p.expressions, (N) => J.expr(N), !1), a.push(p.type === "array" ? "]" : ")");
          },
          arrayIndex: (p) => {
            J.expr(p.array), a.push("["), J.expr(p.index), a.push("] ");
          },
          expr: (p) => {
            if (p.type === "ref") {
              J.ref(p);
              return;
            }
            if (p.type === "list") {
              J.super().expr(p);
              return;
            }
            a.push("("), J.super().expr(p), a.push(")");
          },
          callOverlay: (p) => {
            a.push("OVERLAY("), J.expr(p.value), a.push(" PLACING "), J.expr(p.placing), a.push(" FROM "), J.expr(p.from), p.for && (a.push(" FOR "), J.expr(p.for)), a.push(")");
          },
          callSubstring: (p) => {
            a.push("SUBSTRING("), J.expr(p.value), p.from && (a.push(" FROM "), J.expr(p.from)), p.for && (a.push(" FOR "), J.expr(p.for)), a.push(")");
          },
          binary: (p) => {
            J.expr(p.left), F(p), J.expr(p.right);
          },
          call: (p) => {
            E(p.function), a.push("("), p.distinct && a.push(p.distinct, " "), l(p.args, (N) => J.expr(N), !1), p.orderBy && m(J, p.orderBy), a.push(") "), p.filter && (a.push("filter (where "), J.expr(p.filter), a.push(") ")), p.over && (a.push("over ("), p.over.partitionBy && (a.push("PARTITION BY "), l(p.over.partitionBy, (N) => J.expr(N), !1), a.push(" ")), p.over.orderBy && (m(J, p.over.orderBy), a.push(" ")), a.push(") "));
          },
          case: (p) => {
            a.push("CASE "), p.value && J.expr(p.value);
            for (const N of p.whens)
              a.push(" WHEN "), J.expr(N.when), a.push(" THEN "), J.expr(N.value);
            p.else && (a.push(" ELSE "), J.expr(p.else)), a.push(" END ");
          },
          cast: (p) => {
            J.expr(p.operand), a.push("::"), J.dataType(p.to);
          },
          constant: (p) => {
            switch (p.type) {
              case "boolean":
                a.push(p.value ? "true" : "false");
                break;
              case "integer":
                a.push(p.value.toString(10));
                break;
              case "numeric":
                a.push(p.value.toString()), Number.isInteger(p.value) && a.push(".");
                break;
              case "null":
                a.push("null");
                break;
              case "constant":
                break;
              case "string":
                a.push((0, s.literal)(p.value));
                break;
              default:
                throw g.NotSupported.never(p);
            }
          },
          valueKeyword: (p) => {
            a.push(p.keyword, " ");
          },
          comment: (p) => {
            switch (a.push("COMMENT ON ", p.on.type.toUpperCase(), " "), p.on.type) {
              case "column":
                G(p.on.column);
                break;
              default:
                E(p.on.name);
                break;
            }
            a.push(" IS ", (0, s.literal)(p.comment), " ");
          },
          extract: (p) => {
            a.push("EXTRACT (", p.field.name.toUpperCase(), " FROM "), J.expr(p.from), a.push(") ");
          },
          createColumn: (p) => {
            var N;
            a.push(C(p.name), " "), J.dataType(p.dataType), a.push(" "), p.collate && (a.push("COLLATE "), E(p.collate));
            for (const v of (N = p.constraints) !== null && N !== void 0 ? N : [])
              J.constraint(v);
          },
          begin: (p) => {
            a.push("BEGIN "), p.isolationLevel && a.push("ISOLATION LEVEL ", p.isolationLevel.toUpperCase(), " "), p.writeable && a.push(p.writeable.toUpperCase(), " "), typeof p.deferrable == "boolean" && (p.deferrable || a.push("NOT "), a.push("DEFERRABLE "));
          },
          alterSequence: (p) => {
            switch (a.push("ALTER SEQUENCE "), p.ifExists && a.push("IF EXISTS "), E(p.name), p.change.type) {
              case "set options":
                w(J, p.change);
                break;
              case "rename":
                a.push("RENAME TO ", C(p.change.newName), " ");
                break;
              case "set schema":
                a.push("SET SCHEMA ", C(p.change.newSchema), " ");
                break;
              case "owner to":
                p.change.owner, a.push("OWNER TO ", C(p.change.owner), " ");
                break;
              default:
                throw g.NotSupported.never(p.change);
            }
          },
          createSequence: (p) => {
            a.push("CREATE "), p.temp && a.push("TEMPORARY "), a.push("SEQUENCE "), p.ifNotExists && a.push("IF NOT EXISTS "), E(p.name), w(J, p.options);
          },
          drop: (p) => {
            a.push(p.type.toUpperCase(), " "), p.concurrently && a.push("CONCURRENTLY "), p.ifExists && a.push("IF EXISTS "), l(p.names, (N) => J.tableRef(N), !1), p.cascade && a.push(p.cascade.toUpperCase(), " ");
          },
          constraint: (p) => {
            p.constraintName && a.push(" CONSTRAINT ", C(p.constraintName), " "), Q(p, J);
          },
          do: (p) => {
            a.push("DO"), p.language && a.push(" LANGUAGE ", p.language.name), a.push(" $$", p.code, "$$");
          },
          createFunction: (p) => {
            var N;
            if (a.push(p.orReplace ? "CREATE OR REPLACE FUNCTION " : "CREATE FUNCTION "), E(p.name), l(p.arguments, (v) => {
              v.mode && a.push(v.mode, " "), v.name && a.push(C(v.name), " "), J.dataType(v.type), v.default && (a.push(" = "), J.expr(v.default));
            }, !0), p.returns)
              switch (p.returns.kind) {
                case "table":
                  a.push(" RETURNS TABLE "), l(p.returns.columns, (v) => {
                    a.push(C(v.name), " "), J.dataType(v.type);
                  }, !0);
                  break;
                case void 0:
                case null:
                case "array":
                  a.push(" RETURNS "), J.dataType(p.returns);
                  break;
                default:
                  throw g.NotSupported.never(p.returns);
              }
            switch (a.push(" AS $$", (N = p.code) !== null && N !== void 0 ? N : "", "$$"), p.language && a.push("LANGUAGE ", p.language.name, " "), p.purity && a.push(p.purity.toUpperCase(), " "), typeof p.leakproof == "boolean" && a.push(p.leakproof ? "LEAKPROOF " : "NOT LEAKPROOF "), p.onNullInput) {
              case "call":
                a.push("CALLED ON NULL INPUT ");
                break;
              case "null":
                a.push("RETURNS NULL ON NULL INPUT ");
                break;
              case "strict":
                a.push("STRICT ");
                break;
              case null:
              case void 0:
                break;
              default:
                throw g.NotSupported.never(p.onNullInput);
            }
          },
          dropFunction: (p) => {
            a.push("DROP FUNCTION "), p.ifExists && a.push("IF EXISTS "), E(p.name), p.arguments && l(p.arguments, (N) => {
              N.name && (E(N.name), a.push(" ")), J.dataType(N.type);
            }, !0), a.push(" ");
          },
          with: (p) => {
            a.push("WITH "), l(p.bind, (N) => {
              a.push(C(N.alias), " AS ("), J.statement(N.statement), a.push(") ");
            }, !1), J.statement(p.in);
          },
          withRecursive: (p) => {
            a.push("WITH RECURSIVE ", C(p.alias), "(", ...p.columnNames.map(C).join(", "), ") AS ("), J.union(p.bind), a.push(") "), J.statement(p.in);
          },
          setGlobal: (p) => {
            a.push("SET ", C(p.variable), " = "), y(p.set);
          },
          setTimezone: (p) => {
            switch (a.push("SET TIME ZONE "), p.to.type) {
              case "default":
              case "local":
                a.push(p.to.type.toUpperCase(), " ");
                break;
              case "value":
                a.push(typeof p.to.value == "string" ? (0, s.literal)(p.to.value) : p.to.value.toString(10));
                break;
              case "interval":
                a.push("INTERVAL ", (0, s.literal)(p.to.value), " HOUR TO MINUTE");
                break;
              default:
                throw g.NotSupported.never(p.to);
            }
          },
          dataType: (p) => {
            var N, v;
            if ((p == null ? void 0 : p.kind) === "array") {
              J.dataType(p.arrayOf), a.push("[]");
              return;
            }
            if (!(p != null && p.name)) {
              a.push("unkown");
              return;
            }
            let K = !0;
            if (p.schema)
              E(p, p.doubleQuoted);
            else if (p.doubleQuoted)
              E(p, !0);
            else
              switch (p.name) {
                case "double precision":
                case "character varying":
                case "bit varying":
                  a.push(p.name, " ");
                  break;
                case "time without time zone":
                case "timestamp without time zone":
                case "time with time zone":
                case "timestamp with time zone":
                  const U = p.name.split(" ");
                  a.push(U.shift()), !((N = p.config) === null || N === void 0) && N.length && l(p.config, (j) => a.push(j.toString(10)), !0), a.push(" "), a.push(U.join(" "), " "), K = !1;
                  break;
                default:
                  E(p);
                  break;
              }
            K && !((v = p.config) === null || v === void 0) && v.length && l(p.config, (U) => a.push(U.toString(10)), !0);
          },
          createIndex: (p) => {
            a.push(p.unique ? "CREATE UNIQUE INDEX " : "CREATE INDEX "), p.ifNotExists && a.push(" IF NOT EXISTS "), p.indexName && a.push(C(p.indexName), " "), a.push("ON "), J.tableRef(p.table), p.using && a.push("USING ", C(p.using), " "), l(p.expressions, (N) => {
              J.expr(N.expression), a.push(" "), N.collate && (a.push("COLLATE "), E(N.collate)), N.opclass && E(N.opclass), N.order && a.push(N.order, " "), N.nulls && a.push("nulls ", N.nulls, " ");
            }, !0), p.with && (a.push("WITH "), l(p.with, (N) => {
              a.push(N.parameter, " = ", (0, s.literal)(N.value));
            }, !0)), p.tablespace && a.push("TABLESPACE ", B(p.tablespace)), p.where && (a.push(" WHERE "), J.expr(p.where)), a.push(" ");
          },
          createTable: (p) => {
            var N;
            a.push("CREATE "), p.locality && a.push(p.locality.toUpperCase(), " "), p.temporary && a.push("TEMPORARY "), p.unlogged && a.push("UNLOGGED "), a.push(p.ifNotExists ? "TABLE IF NOT EXISTS " : "TABLE "), J.tableRef(p.name), a.push("("), l(p.columns, (v) => {
              switch (v.kind) {
                case "column":
                  return J.createColumn(v);
                case "like table":
                  return J.likeTable(v);
                default:
                  throw g.NotSupported.never(v);
              }
            }, !1), p.constraints && (a.push(", "), l(p.constraints, (v) => {
              const K = v.constraintName;
              K && a.push("CONSTRAINT ", C(K), " "), Q(v, J);
            }, !1)), a.push(") "), !((N = p.inherits) === null || N === void 0) && N.length && (a.push(" INHERITS "), l(p.inherits, (v) => E(v), !0));
          },
          likeTable: (p) => {
            a.push(" LIKE "), J.tableRef(p.like), a.push(" ");
            for (const { verb: N, option: v } of p.options)
              a.push(N.toUpperCase(), " ", v.toUpperCase(), " ");
          },
          createSchema: (p) => {
            a.push(p.ifNotExists ? "CREATE SCHEMA IF NOT EXISTS " : "CREATE SCHEMA "), a.push(C(p.name));
          },
          truncateTable: (p) => {
            a.push("TRUNCATE TABLE ");
            let N = !0;
            for (const v of p.tables)
              N || a.push(", "), N = !1, J.tableRef(v);
            if (p.identity)
              switch (p.identity) {
                case "restart":
                  a.push(" RESTART IDENTITY ");
                  break;
                case "continue":
                  a.push(" CONTINUE IDENTITY ");
                  break;
              }
            p.cascade && a.push(" ", p.cascade, " ");
          },
          delete: (p) => {
            a.push("DELETE FROM "), J.tableRef(p.from), p.where && (a.push(" WHERE "), J.expr(p.where)), p.returning && (a.push(" RETURNING "), l(p.returning, (N) => J.selectionColumn(N), !1)), a.push(" ");
          },
          dropColumn: (p) => {
            a.push(" DROP COLUMN "), p.ifExists && a.push(" IF EXISTS "), a.push(C(p.column)), p.behaviour && a.push(" ", p.behaviour), a.push(" ");
          },
          dropConstraint: (p) => {
            a.push(" DROP CONSTRAINT "), p.ifExists && a.push(" IF EXISTS "), a.push(C(p.constraint)), p.behaviour && a.push(" ", p.behaviour.toUpperCase(), " ");
          },
          from: (p) => J.super().from(p),
          fromCall: (p) => {
            R(J, p.join, () => {
              var N, v;
              if (J.call(p), p.withOrdinality && a.push(" WITH ORDINALITY"), p.alias) {
                a.push(" AS ", C(p.alias), " ");
                const K = (v = (N = p.alias.columns) === null || N === void 0 ? void 0 : N.length) !== null && v !== void 0 ? v : 0;
                if (K > 0) {
                  a.push("(");
                  for (let U = 0; U < K; ++U)
                    U !== 0 && a.push(", "), a.push(C(p.alias.columns[U]));
                  a.push(")");
                }
              }
            }), a.push(" ");
          },
          fromStatement: (p) => {
            R(J, p.join, () => {
              a.push("("), J.select(p.statement), a.push(") "), p.alias && (a.push(" AS ", B(p.alias)), p.columnNames && l(p.columnNames, (N) => a.push(C(N)), !0), a.push(" "));
            }), a.push(" ");
          },
          values: (p) => {
            a.push("VALUES "), l(p.values, (N) => {
              l(N, (v) => {
                J.expr(v);
              }, !0);
            }, !1);
          },
          fromTable: (p) => {
            R(J, p.join, () => {
              if (J.tableRef(p.name), p.name.columnNames) {
                if (!p.name.alias)
                  throw new Error("Cannot specify aliased column names without an alias");
                l(p.name.columnNames, (N) => a.push(C(N)), !0);
              }
            });
          },
          join: (p) => {
            throw new Error("Should not happen 💀");
          },
          insert: (p) => {
            if (a.push("INSERT INTO "), J.tableRef(p.into), p.columns && a.push("(", p.columns.map(C).join(", "), ")"), a.push(" "), p.overriding && a.push("OVERRIDING ", p.overriding.toUpperCase(), " VALUE "), J.select(p.insert), a.push(" "), p.onConflict) {
              a.push("ON CONFLICT ");
              const N = p.onConflict.on;
              switch (N == null ? void 0 : N.type) {
                case "on expr":
                  l(N.exprs, (v) => J.expr(v), !0);
                  break;
                case "on constraint":
                  a.push("ON CONSTRAINT "), E(N.constraint);
                case null:
                case void 0:
                  break;
                default:
                  throw g.NotSupported.never(N);
              }
              p.onConflict.do === "do nothing" ? a.push(" DO NOTHING") : (a.push(" DO UPDATE SET "), l(p.onConflict.do.sets, (v) => J.set(v), !1), p.onConflict.where && (a.push(" WHERE "), J.expr(p.onConflict.where))), a.push(" ");
            }
            p.returning && (a.push(" RETURNING "), l(p.returning, (N) => J.selectionColumn(N), !1));
          },
          raise: (p) => {
            var N, v;
            a.push("RAISE "), p.level && a.push(p.level.toUpperCase(), " "), a.push((0, s.literal)(p.format), " "), !((N = p.formatExprs) === null || N === void 0) && N.length && (a.push(", "), l(p.formatExprs, (K) => J.expr(K), !1)), !((v = p.using) === null || v === void 0) && v.length && (a.push(" USING "), l(p.using, ({ type: K, value: U }) => {
              a.push(K.toUpperCase(), "="), J.expr(U);
            }, !1)), a.push(" ");
          },
          default: () => {
            a.push(" DEFAULT ");
          },
          member: (p) => {
            J.expr(p.operand), a.push(p.op), a.push(typeof p.member == "number" ? p.member.toString(10) : (0, s.literal)(p.member));
          },
          ref: (p) => {
            p.table && (E(p.table), a.push(".")), a.push(p.name === "*" ? "*" : B(p.name));
          },
          parameter: (p) => {
            a.push(p.name);
          },
          renameColumn: (p) => {
            a.push(" RENAME COLUMN ", C(p.column), " TO ", C(p.to));
          },
          renameConstraint: (p) => {
            a.push(" RENAME CONSTRAINT ", C(p.constraint), " TO ", C(p.to));
          },
          renameTable: (p) => {
            a.push(" RENAME TO ", C(p.to));
          },
          createView: (p) => {
            a.push("CREATE "), p.orReplace && a.push("OR REPLACE "), p.temp && a.push("TEMP "), p.recursive && a.push("RECURSIVE "), a.push("VIEW "), J.tableRef(p.name), p.columnNames && l(p.columnNames, (v) => a.push(C(v)), !0);
            const N = p.parameters && Object.entries(p.parameters);
            N != null && N.length && (a.push(" WITH "), l(N, ([v, K]) => a.push(v, "=", K), !1)), a.push(" AS "), J.select(p.query), p.checkOption && a.push(" WITH ", p.checkOption.toUpperCase(), " CHECK OPTION");
          },
          createMaterializedView: (p) => {
            a.push("CREATE MATERIALIZED VIEW "), p.ifNotExists && a.push("IF NOT EXISTS "), J.tableRef(p.name), p.columnNames && l(p.columnNames, (v) => a.push(C(v)), !0);
            const N = p.parameters && Object.entries(p.parameters);
            N != null && N.length && (a.push(" WITH "), l(N, ([v, K]) => a.push(v, "=", K), !1)), p.tablespace && a.push(" TABLESPACE ", C(p.tablespace)), a.push(" AS "), J.select(p.query), typeof p.withData == "boolean" && a.push(p.withData ? " WITH DATA" : " WITH NO DATA");
          },
          refreshMaterializedView: (p) => {
            a.push("REFRESH MATERIALIZED VIEW "), p.concurrently && a.push("CONCURRENTLY "), J.tableRef(p.name), typeof p.withData == "boolean" && a.push(p.withData ? " WITH DATA" : " WITH NO DATA");
          },
          select: (p) => J.super().select(p),
          selection: (p) => {
            if (a.push("SELECT "), p.distinct && (typeof p.distinct == "string" ? a.push(p.distinct.toUpperCase()) : (a.push(" DISTINCT ON "), l(p.distinct, (N) => J.expr(N), !0)), a.push(" ")), p.columns && l(p.columns, (N) => J.selectionColumn(N), !1), a.push(" "), p.from) {
              a.push("FROM ");
              const N = p.from.length;
              for (let v = 0; v < N; v++) {
                const K = p.from[v];
                v > 0 && !K.join && a.push(","), J.from(K);
              }
              a.push(" ");
            }
            p.where && (a.push("WHERE "), J.expr(p.where), a.push(" ")), p.groupBy && (a.push("GROUP BY "), l(p.groupBy, (N) => J.expr(N), !1), a.push(" "), p.having && (a.push(" HAVING "), J.expr(p.having), a.push(" "))), p.orderBy && (m(J, p.orderBy), a.push(" ")), p.limit && (p.limit.offset && (a.push("OFFSET "), J.expr(p.limit.offset)), p.limit.limit && (a.push("LIMIT "), J.expr(p.limit.limit))), p.for && (a.push("FOR ", p.for.type.toUpperCase()), p.skip && a.push(" ", p.skip.type.toUpperCase()));
          },
          show: (p) => {
            a.push("SHOW ", C(p.variable));
          },
          prepare: (p) => {
            var N;
            a.push("PREPARE ", C(p.name)), !((N = p.args) === null || N === void 0) && N.length && l(p.args, (v) => J.dataType(v), !0), a.push(" AS "), J.statement(p.statement);
          },
          deallocate: (p) => {
            if (a.push("DEALLOCATE "), "name" in p.target) {
              a.push(p.target.name);
              return;
            }
            a.push("ALL");
          },
          arraySelect: (p) => {
            a.push("array("), J.select(p.select), a.push(")");
          },
          union: (p) => {
            a.push("("), J.statement(p.left), a.push(") ", p.type.toUpperCase(), " "), p.right.type === "union" || p.right.type === "union all" ? J.union(p.right) : (a.push("("), J.statement(p.right), a.push(")"));
          },
          selectionColumn: (p) => {
            J.expr(p.expr), p.alias && a.push(" AS ", C(p.alias)), a.push(" ");
          },
          set: (p) => {
            a.push(C(p.column), " = "), J.expr(p.value), a.push(" ");
          },
          statement: (p) => J.super().statement(p),
          tableRef: (p) => {
            E(p), p.alias && a.push(" AS ", B(p.alias)), a.push(" ");
          },
          ternary: (p) => {
            J.expr(p.value), a.push(" ", p.op, " "), J.expr(p.lo), a.push(" AND "), J.expr(p.hi), a.push(" ");
          },
          transaction: (p) => {
            a.push(p.type);
          },
          unary: (p) => {
            switch (p.op) {
              case "+":
              case "-":
                F(p), J.expr(p.operand);
                break;
              case "NOT":
                a.push(p.op), a.push(" "), J.expr(p.operand);
                break;
              default:
                J.expr(p.operand), a.push(" "), a.push(p.op);
            }
          },
          update: (p) => {
            a.push("UPDATE "), J.tableRef(p.table), a.push(" SET "), l(p.sets, (N) => J.set(N), !1), a.push(" "), p.from && (a.push("FROM "), J.from(p.from), a.push(" ")), p.where && (a.push("WHERE "), J.expr(p.where), a.push(" ")), p.returning && (a.push(" RETURNING "), l(p.returning, (N) => J.selectionColumn(N), !1), a.push(" "));
          }
        }));
        t.toSql = {};
        const c = n.AstDefaultMapper.prototype;
        for (const J of Object.getOwnPropertyNames(c)) {
          const p = c[J];
          J === "constructor" || J === "super" || typeof p != "function" || (t.toSql[J] = function(...N) {
            try {
              return Z[J].apply(Z, N), a.join("").trim();
            } finally {
              a = [];
            }
          });
        }
      },
      /* 20 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.literal = void 0;
        function n(o) {
          if (o == null)
            return "NULL";
          if (Array.isArray(o)) {
            var g = o.map(n);
            return "(" + g.join(", ") + ")";
          }
          var s = ~o.indexOf("\\"), I = s ? "E" : "";
          return o = o.replace(/'/g, "''"), o = o.replace(/\\/g, "\\\\"), I + "'" + o + "'";
        }
        t.literal = n;
      },
      /* 21 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.locationOf = void 0;
        function n(o) {
          const g = o._location;
          if (!g)
            throw new Error("This statement has not been parsed using location tracking (which has a small performance hit). ");
          return g;
        }
        t.locationOf = n;
      }
      /******/
    ])
  );
})(cN);
function bh(A, e) {
  return new Proxy(new Date(A.getTime() - e * 6e4), {
    get(t, i) {
      if (typeof i == "string") {
        if (i === "getTime")
          return () => t.getTime() + e * 6e4;
        if (i.startsWith("get") && !i.includes("UTC"))
          return t[i.replace("get", "getUTC")].bind(t);
        if (i.startsWith("set") && !i.includes("UTC"))
          return (...n) => t[i.replace("set", "setUTC")].call(t, ...n) + e * 6e4;
      }
      return t[i].bind(t);
    }
  });
}
const WBe = [
  /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/,
  /^\d{4}-(0[1-9]|1[0-2])$/,
  /^\d{4}$/
  // YYYY
], $YA = ["%Y", "%Y-%m", "%Y-%m-%d"];
function GY(A = (/* @__PURE__ */ new Date()).getTimezoneOffset()) {
  function e(...t) {
    if (t.length > 1) {
      const i = A * 6e4 + Date.UTC(...t);
      return bh(new Date(i), A);
    }
    if (t.length > 0) {
      const i = t[0];
      if (i instanceof Date)
        return bh(i, A);
      if (typeof i == "string") {
        if (WBe.find((g) => g.test(i))) {
          const g = new Date(i).getTime();
          return bh(new Date(g + A * 6e4), A);
        }
        if (/(Z|[\+\-][0-2][0-9])$/.test(i))
          return bh(new Date(i), A);
        const n = new Date(i), o = n.getTime() - n.getTimezoneOffset() * 6e4;
        return bh(new Date(o + A * 6e4), A);
      }
      return bh(new Date(i), A);
    }
    return bh(/* @__PURE__ */ new Date(), A);
  }
  return e;
}
function Uu(A, e) {
  const t = GY(A ?? (/* @__PURE__ */ new Date()).getTimezoneOffset()), i = GY(e ?? (/* @__PURE__ */ new Date()).getTimezoneOffset());
  function n(...o) {
    return t(i(...o));
  }
  return n;
}
const E5 = /* @__PURE__ */ new Map(), A2A = (A) => {
  if (E5.has(A))
    return E5.get(A);
  const e = [];
  for (let t = 0; t < A; t++)
    for (let i = 0; i < A; i++)
      ((t - (A - 1) / 2) ** 2 + (i - (A - 1) / 2) ** 2) * 4 < A ** 2 && e.push([t, i]);
  return E5.set(A, e), e;
};
function KBe([A, e], t, i) {
  const n = (t - t % 2) / 2;
  return A2A(t).map(([o, g]) => [o + A - n, g + e - n]).filter(([o, g]) => o >= 0 && o < i && g >= 0 && g < i);
}
function UBe(A, e, t) {
  const [i, n] = t, o = t2A(t);
  if (i.domain.type === "quantitative" && n.domain.type === "quantitative") {
    const s = i.domain.width;
    return KBe(A, e, s).map(([I, r]) => o([r, I]));
  }
  const g = (s, I) => {
    if (I.domain.type === "nominal")
      return [s];
    const r = (e - e % 2) / 2;
    return new Array(e).fill(0).map((a, C) => C + s - r).filter((a) => a >= 0 && a < I.domain.width);
  };
  return g(A[0], n).flatMap((s) => g(A[1], i).map((I) => [s, I])).map(([s, I]) => o([I, s]));
}
async function VBe(A) {
  return await new Promise((e) => {
    const t = new FileReader();
    t.onload = () => e(t.result.substring(37)), t.readAsDataURL(new Blob([A]));
  });
}
async function XBe(A) {
  const e = new Response(A).body.pipeThrough(new CompressionStream("deflate-raw")), t = await new Response(e).arrayBuffer();
  return VBe(t);
}
async function e2A(A) {
  const e = await fetch("data:application/octet-stream;base64," + A).then((i) => i.body.pipeThrough(new DecompressionStream("deflate-raw"))), t = await new Response(e).arrayBuffer();
  return new Uint8Array(t);
}
function xH(A) {
  return new Uint8Array(A.reduce((e, t) => e * t.domain.width, 1));
}
function zBe(A, e, t) {
  return e >= A[1] ? t - 1 : e <= A[0] ? 0 : Math.floor(t * (e - A[0]) / (A[1] - A[0]));
}
function t2A(A) {
  const e = A.map((t) => t.domain.width).reduceRight(([t, ...i], n) => [n * t, t, ...i], [1]).slice(1);
  return (t) => t.map((i, n) => i * e[n]).reduce((i, n) => i + n);
}
function w7(A) {
  const e = A.map(({ domain: i, fid: n }) => {
    if (i.type === "nominal") {
      const g = new Map(i.value.map((s, I) => [`${s}`, I]));
      return (s) => g.get(`${s[n]}`) ?? 0;
    }
    if (i.type === "quantitative")
      return (g) => zBe(i.value, g[n], i.width);
    const o = i;
    throw new Error(`unsupported domain type ${o.type}`);
  }), t = t2A(A);
  return (i) => t(e.map((n) => n(i)));
}
function TBe(A) {
  return {
    dict: A.dict,
    usedColor: A.usedColor,
    facets: [
      {
        map: A.map,
        usedColor: A.usedColor,
        dimensions: [
          {
            fid: A.y,
            domain: {
              type: "quantitative",
              value: A.domainY,
              width: A.mapwidth
            }
          },
          {
            fid: A.x,
            domain: {
              type: "quantitative",
              value: A.domainX,
              width: A.mapwidth
            }
          }
        ]
      }
    ]
  };
}
async function i2A(A, e) {
  const { dict: t, facets: i } = e;
  let n = A.map(() => t[1].name);
  for (const { map: o, dimensions: g } of i) {
    const s = await e2A(o), I = w7(g);
    n = A.map(I).map((r, a) => {
      var C;
      return s[r] !== 0 ? (C = t[s[r]]) == null ? void 0 : C.name : n[a];
    });
  }
  return n;
}
function I3(A) {
  return cN.parse(A, "expr");
}
const _Be = /* @__PURE__ */ new Set([
  "ALL",
  "ANALYSE",
  "ANALYZE",
  "AND",
  "ANY",
  "ARRAY",
  "AS",
  "ASC",
  "ASYMMETRIC",
  "BINARY",
  "BOTH",
  "CASE",
  "CAST",
  "CHECK",
  "COLLATE",
  "COLUMN",
  "CONCURRENTLY",
  "CONSTRAINT",
  "CREATE",
  "CROSS",
  "CURRENT_DATE",
  "CURRENT_ROLE",
  "CURRENT_TIME",
  "CURRENT_TIMESTAMP",
  "CURRENT_USER",
  "DEFAULT",
  "DEFERRABLE",
  "DESC",
  "DISTINCT",
  "DO",
  "ELSE",
  "END",
  "EXCEPT",
  "FALSE",
  "FETCH",
  "FOR",
  "FOREIGN",
  "FREEZE",
  "FROM",
  "FULL",
  "GRANT",
  "GROUP",
  "HAVING",
  "ILIKE",
  "IN",
  "INITIALLY",
  "INNER",
  "INTERSECT",
  "INTO",
  "IS",
  "ISNULL",
  "JOIN",
  "LATERAL",
  "LEADING",
  "LEFT",
  "LIKE",
  "LIMIT",
  "LOCALTIME",
  "LOCALTIMESTAMP",
  "NATURAL",
  "NOT",
  "NOTNULL",
  "NULL",
  "OFFSET",
  "ON",
  "ONLY",
  "OR",
  "ORDER",
  "OUTER",
  "OVERLAPS",
  "PLACING",
  "PRIMARY",
  "REFERENCES",
  "RETURNING",
  "RIGHT",
  "SELECT",
  "SESSION_USER",
  "SIMILAR",
  "SOME",
  "SYMMETRIC",
  "TABLE",
  "THEN",
  "TO",
  "TRAILING",
  "TRUE",
  "UNION",
  "UNIQUE",
  "USER",
  "USING",
  "VARIADIC",
  "VERBOSE",
  "WHEN",
  "WHERE",
  "WINDOW",
  "WITH"
]), qBe = /* @__PURE__ */ new Set([
  "abs",
  "atan2",
  "add",
  "currval",
  "octet_length",
  "array_length",
  "md5_number_lower",
  "upper",
  "make_timestamp",
  "array_resize",
  "ascii",
  "list_contains",
  "day",
  "get_bit",
  "substring",
  "subtract",
  "array_cat",
  "string_to_array",
  "error",
  "in_search_path",
  "list_concat",
  "lower",
  "base64",
  "editdist3",
  "regexp_matches",
  "nextval",
  "date_part",
  "typeof",
  "regexp_extract_all",
  "last_day",
  "millisecond",
  "month",
  "to_base64",
  "prefix",
  "divide",
  "ucase",
  "from_hex",
  "concat",
  "not_ilike_escape",
  "range",
  "substr",
  "unbin",
  "len",
  "split",
  "list_value",
  "list_position",
  "list_indexof",
  "enum_last",
  "not_like_escape",
  "even",
  "set_bit",
  "time_bucket",
  "regexp_replace",
  "struct_extract",
  "gcd",
  "constant_or_null",
  "apply",
  "vector_type",
  "list_filter",
  "chr",
  "array_contains",
  "ceiling",
  "radians",
  "nfc_normalize",
  "log10",
  "regexp_full_match",
  "alias",
  "length_grapheme",
  "suffix",
  "list_aggr",
  "ilike_escape",
  "multiply",
  "array_concat",
  "regexp_extract",
  "like_escape",
  "current_database",
  "hex",
  "isoyear",
  "transaction_timestamp",
  "array_indexof",
  "list_element",
  "jaccard",
  "yearweek",
  "to_months",
  "year",
  "xor",
  "weekofyear",
  "weekday",
  "lpad",
  "bit_length",
  "dayofyear",
  "union_tag",
  "uuid",
  "list_distance",
  "dayname",
  "unhex",
  "txid_current",
  "trunc",
  "encode",
  "to_minutes",
  "to_milliseconds",
  "to_binary",
  "to_base",
  "array_distinct",
  "timezone_hour",
  "tan",
  "struct_pack",
  "strptime",
  "strpos",
  "strlen",
  "atan",
  "str_split_regex",
  "str_split",
  "date_sub",
  "map_values",
  "least_common_multiple",
  "stats",
  "datediff",
  "starts_with",
  "!__postfix",
  "factorial",
  "sqrt",
  "element_at",
  "printf",
  "signbit",
  "sha256",
  "list_extract",
  "setseed",
  "enum_range",
  "second",
  "reverse",
  "replace",
  "damerau_levenshtein",
  "to_hours",
  "substring_grapheme",
  "repeat",
  "length",
  "to_microseconds",
  "century",
  "list_has",
  "current_date",
  "combine",
  "epoch_ns",
  "isinf",
  "rpad",
  "ceil",
  "format",
  "regexp_split_to_array",
  "today",
  "random",
  "quarter",
  "array_aggr",
  "position",
  "isnan",
  "age",
  "pi",
  "aggregate",
  "array_reverse_sort",
  "nextafter",
  "monthname",
  "array_position",
  "unicode",
  "concat_ws",
  "mismatches",
  "epoch",
  "minute",
  "mod",
  "millennium",
  "string_split_regex",
  "microsecond",
  "bit_position",
  "right_grapheme",
  "list_reverse_sort",
  "md5",
  "rtrim",
  "sign",
  "string_split",
  "list_resize",
  "map_keys",
  "map_entries",
  "exp",
  "map_concat",
  "map",
  "make_time",
  "week",
  "make_date",
  "power",
  "__internal_decompress_integral_usmallint",
  "ltrim",
  "log2",
  "pow",
  "log",
  "greatest",
  "list_cat",
  "list_unique",
  "contains",
  "list_transform",
  "timezone_minute",
  "list_sort",
  "list_pack",
  "list_dot_product",
  "list_apply",
  "array_slice",
  "lgamma",
  "map_extract",
  "left_grapheme",
  "least",
  "julian",
  "jaro_winkler_similarity",
  "isodow",
  "union_extract",
  "list_distinct",
  "isfinite",
  "to_years",
  "instr",
  "date_trunc",
  "sin",
  "translate",
  "array_filter",
  "strip_accents",
  "to_timestamp",
  "list_inner_product",
  "array_apply",
  "hash",
  "to_seconds",
  "decade",
  "hamming",
  "greatest_common_divisor",
  "ends_with",
  "get_current_timestamp",
  "try_strptime",
  "to_hex",
  "get_current_time",
  "timezone",
  "md5_number_upper",
  "generate_series",
  "strftime",
  "datepart",
  "levenshtein",
  "__internal_compress_integral_usmallint",
  "union_value",
  "gen_random_uuid",
  "array_extract",
  "from_binary",
  "list_slice",
  "from_base64",
  "row",
  "format_bytes",
  "flatten",
  "filter",
  "datetrunc",
  "cos",
  "era",
  "lcm",
  "decode",
  "hour",
  "finalize",
  "epoch_ms",
  "right",
  "enum_range_boundary",
  "degrees",
  "dayofweek",
  "array_sort",
  "datesub",
  "formatReadableDecimalSize",
  "date_diff",
  "array_has",
  "current_setting",
  "current_schemas",
  "map_from_entries",
  "array_transform",
  "current_query",
  "md5_number",
  "round",
  "list_cosine_similarity",
  "dayofmonth",
  "asin",
  "jaro_similarity",
  "enum_code",
  "cot",
  "list_aggregate",
  "ord",
  "cbrt",
  "array_unique",
  "struct_insert",
  "cardinality",
  "to_days",
  "acos",
  "version",
  "gamma",
  "trim",
  "floor",
  "left",
  "bit_count",
  "current_schema",
  "bin",
  "now",
  "bar",
  "epoch_us",
  "ln",
  "array_aggregate",
  "enum_first",
  "bitstring",
  "lcase"
]), n2A = /* @__PURE__ */ new Set([
  "any_value",
  "arg_max",
  "max_by",
  "arg_min",
  "argMin",
  "min_by",
  "avg",
  "mean",
  "bit_and",
  "bit_or",
  "bit_xor",
  "bitstring_agg",
  "bool_and",
  "bool_or",
  "count",
  "favg",
  "first",
  "arbitrary",
  "fsum",
  "kahan_sum",
  "geomean",
  "geometric_mean",
  "histogram",
  "last",
  "list",
  "array_agg",
  "max",
  "min",
  "product",
  "string_agg",
  "group_concat",
  "listagg",
  "sum",
  "approx_count_distinct",
  "approx_quantile",
  "reservoir_quantile",
  "corr",
  "covar_pop",
  "covar_samp",
  "entropy",
  "kurtosis",
  "mad",
  "median",
  "mode",
  "quantile_cont",
  "quantile_disc",
  "quantile",
  "regr_avgx",
  "regr_avgy",
  "regr_count",
  "regr_intercept",
  "regr_r2",
  "regr_slope",
  "regr_sxx",
  "regr_sxy",
  "regr_syy",
  "skewness",
  "stddev_pop",
  "stddev_samp",
  "stddev",
  "var_pop",
  "var_samp",
  "variance"
]);
function o2A(A, e) {
  const t = /* @__PURE__ */ new Map();
  e.forEach((n) => {
    t.set(n.name ?? n.fid, n);
  });
  const i = (n) => {
    switch (n.type) {
      case "integer":
      case "numeric":
        return ["quantitative", !1];
      case "null":
      case "string":
      case "boolean":
        return ["nominal", !1];
      case "unary":
        const [o, g] = i(n.operand);
        switch (n.op) {
          case "+":
          case "-":
            return ["quantitative", g];
          default:
            return ["nominal", g];
        }
      case "ref": {
        const s = t.get(n.name);
        return s ? [s.semanticType, !1] : ["nominal", !1];
      }
      case "case":
        return n.else ? i(n.else) : i(n.whens[0].value);
      case "array":
      case "list":
        return n.expressions.length ? i(n.expressions[0]) : ["nominal", !1];
      case "binary":
        return i(n.left);
      case "call": {
        if (n.function.name === "count")
          return ["quantitative", !0];
        const [s] = i(n.args[0]);
        return [s, n2A.has(n.function.name.toLowerCase())];
      }
      case "cast": {
        const [s, I] = i(n.operand);
        if ("name" in n.to)
          switch (n.to.name.toLowerCase()) {
            case "date":
            case "timestamp":
            case "timestamp with time zone":
            case "time":
            case "time with time zone":
            case "interval":
              return ["temporal", I];
            case "smallint":
            case "integer":
            case "bigint":
            case "decimal":
            case "numeric":
            case "real":
            case "double precision":
            case "smallserial":
            case "serial":
            case "bigserial":
              return ["quantitative", I];
          }
        return ["nominal", I];
      }
      default:
        return ["nominal", !1];
    }
  };
  return i(A);
}
function OBe(A) {
  const e = /* @__PURE__ */ new Set(), t = (i) => {
    i.type === "ref" ? e.add(i.name) : Object.values(i).forEach((n) => {
      n !== null && typeof n == "object" && "type" in n && t(n);
    });
  };
  return t(I3(A)), Array.from(e);
}
function g2A(A, e) {
  const t = /* @__PURE__ */ new Map();
  e.forEach((o) => {
    t.set((o.name ?? o.fid).toLowerCase(), o);
  });
  const i = I3(A), n = cN.astMapper(() => ({
    ref: (o) => {
      var g;
      return cN.assignChanged(o, { name: ((g = t.get(o.name.toLowerCase())) == null ? void 0 : g.fid) || o.name });
    }
  }));
  return cN.toSql.expr(n.expr(i));
}
function Kr(A) {
  for (var e = arguments.length, t = Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  throw Error("[Immer] minified error nr: " + A + (t.length ? " " + t.map(function(n) {
    return "'" + n + "'";
  }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
}
function sf(A) {
  return !!A && !!A[jI];
}
function gp(A) {
  var e;
  return !!A && (function(t) {
    if (!t || typeof t != "object")
      return !1;
    var i = Object.getPrototypeOf(t);
    if (i === null)
      return !0;
    var n = Object.hasOwnProperty.call(i, "constructor") && i.constructor;
    return n === Object || typeof n == "function" && Function.toString.call(n) === nle;
  }(A) || Array.isArray(A) || !!A[JlA] || !!(!((e = A.constructor) === null || e === void 0) && e[JlA]) || f7(A) || D7(A));
}
function kY(A, e, t) {
  t === void 0 && (t = !1), kD(A) === 0 ? (t ? Object.keys : Y7)(A).forEach(function(i) {
    t && typeof i == "symbol" || e(i, A[i], A);
  }) : A.forEach(function(i, n) {
    return e(n, i, A);
  });
}
function kD(A) {
  var e = A[jI];
  return e ? e.i > 3 ? e.i - 4 : e.i : Array.isArray(A) ? 1 : f7(A) ? 2 : D7(A) ? 3 : 0;
}
function Wq(A, e) {
  return kD(A) === 2 ? A.has(e) : Object.prototype.hasOwnProperty.call(A, e);
}
function jBe(A, e) {
  return kD(A) === 2 ? A.get(e) : A[e];
}
function s2A(A, e, t) {
  var i = kD(A);
  i === 2 ? A.set(e, t) : i === 3 ? A.add(t) : A[e] = t;
}
function PBe(A, e) {
  return A === e ? A !== 0 || 1 / A == 1 / e : A != A && e != e;
}
function f7(A) {
  return tle && A instanceof Map;
}
function D7(A) {
  return ile && A instanceof Set;
}
function Uh(A) {
  return A.o || A.t;
}
function G7(A) {
  if (Array.isArray(A))
    return Array.prototype.slice.call(A);
  var e = ole(A);
  delete e[jI];
  for (var t = Y7(e), i = 0; i < t.length; i++) {
    var n = t[i], o = e[n];
    o.writable === !1 && (o.writable = !0, o.configurable = !0), (o.get || o.set) && (e[n] = { configurable: !0, writable: !0, enumerable: o.enumerable, value: A[n] });
  }
  return Object.create(Object.getPrototypeOf(A), e);
}
function k7(A, e) {
  return e === void 0 && (e = !1), J7(A) || sf(A) || !gp(A) || (kD(A) > 1 && (A.set = A.add = A.clear = A.delete = $Be), Object.freeze(A), e && kY(A, function(t, i) {
    return k7(i, !0);
  }, !0)), A;
}
function $Be() {
  Kr(2);
}
function J7(A) {
  return A == null || typeof A != "object" || Object.isFrozen(A);
}
function XB(A) {
  var e = gle[A];
  return e || Kr(18, A), e;
}
function ylA() {
  return JY;
}
function u5(A, e) {
  e && (XB("Patches"), A.u = [], A.s = [], A.v = e);
}
function LH(A) {
  Kq(A), A.p.forEach(Ale), A.p = null;
}
function Kq(A) {
  A === JY && (JY = A.l);
}
function blA(A) {
  return JY = { p: [], l: JY, h: A, m: !0, _: 0 };
}
function Ale(A) {
  var e = A[jI];
  e.i === 0 || e.i === 1 ? e.j() : e.g = !0;
}
function d5(A, e) {
  e._ = e.p.length;
  var t = e.p[0], i = A !== void 0 && A !== t;
  return e.h.O || XB("ES5").S(e, A, i), i ? (t[jI].P && (LH(e), Kr(4)), gp(A) && (A = vH(e, A), e.l || HH(e, A)), e.u && XB("Patches").M(t[jI].t, A, e.u, e.s)) : A = vH(e, t, []), LH(e), e.u && e.v(e.u, e.s), A !== I2A ? A : void 0;
}
function vH(A, e, t) {
  if (J7(e))
    return e;
  var i = e[jI];
  if (!i)
    return kY(e, function(s, I) {
      return wlA(A, i, e, s, I, t);
    }, !0), e;
  if (i.A !== A)
    return e;
  if (!i.P)
    return HH(A, i.t, !0), i.t;
  if (!i.I) {
    i.I = !0, i.A._--;
    var n = i.i === 4 || i.i === 5 ? i.o = G7(i.k) : i.o, o = n, g = !1;
    i.i === 3 && (o = new Set(n), n.clear(), g = !0), kY(o, function(s, I) {
      return wlA(A, i, n, s, I, t, g);
    }), HH(A, n, !1), t && A.u && XB("Patches").N(i, t, A.u, A.s);
  }
  return i.o;
}
function wlA(A, e, t, i, n, o, g) {
  if (sf(n)) {
    var s = vH(A, n, o && e && e.i !== 3 && !Wq(e.R, i) ? o.concat(i) : void 0);
    if (s2A(t, i, s), !sf(s))
      return;
    A.m = !1;
  } else
    g && t.add(n);
  if (gp(n) && !J7(n)) {
    if (!A.h.D && A._ < 1)
      return;
    vH(A, n), e && e.A.l || HH(A, n);
  }
}
function HH(A, e, t) {
  t === void 0 && (t = !1), !A.l && A.h.D && A.m && k7(e, t);
}
function h5(A, e) {
  var t = A[jI];
  return (t ? Uh(t) : A)[e];
}
function flA(A, e) {
  if (e in A)
    for (var t = Object.getPrototypeOf(A); t; ) {
      var i = Object.getOwnPropertyDescriptor(t, e);
      if (i)
        return i;
      t = Object.getPrototypeOf(t);
    }
}
function Uq(A) {
  A.P || (A.P = !0, A.l && Uq(A.l));
}
function m5(A) {
  A.o || (A.o = G7(A.t));
}
function Vq(A, e, t) {
  var i = f7(e) ? XB("MapSet").F(e, t) : D7(e) ? XB("MapSet").T(e, t) : A.O ? function(n, o) {
    var g = Array.isArray(n), s = { i: g ? 1 : 0, A: o ? o.A : ylA(), P: !1, I: !1, R: {}, l: o, t: n, k: null, o: null, j: null, C: !1 }, I = s, r = Xq;
    g && (I = [s], r = cJ);
    var a = Proxy.revocable(I, r), C = a.revoke, B = a.proxy;
    return s.k = B, s.j = C, B;
  }(e, t) : XB("ES5").J(e, t);
  return (t ? t.A : ylA()).p.push(i), i;
}
function ele(A) {
  return sf(A) || Kr(22, A), function e(t) {
    if (!gp(t))
      return t;
    var i, n = t[jI], o = kD(t);
    if (n) {
      if (!n.P && (n.i < 4 || !XB("ES5").K(n)))
        return n.t;
      n.I = !0, i = DlA(t, o), n.I = !1;
    } else
      i = DlA(t, o);
    return kY(i, function(g, s) {
      n && jBe(n.t, g) === s || s2A(i, g, e(s));
    }), o === 3 ? new Set(i) : i;
  }(A);
}
function DlA(A, e) {
  switch (e) {
    case 2:
      return new Map(A);
    case 3:
      return Array.from(A);
  }
  return G7(A);
}
var GlA, JY, N7 = typeof Symbol < "u" && typeof Symbol("x") == "symbol", tle = typeof Map < "u", ile = typeof Set < "u", klA = typeof Proxy < "u" && Proxy.revocable !== void 0 && typeof Reflect < "u", I2A = N7 ? Symbol.for("immer-nothing") : ((GlA = {})["immer-nothing"] = !0, GlA), JlA = N7 ? Symbol.for("immer-draftable") : "__$immer_draftable", jI = N7 ? Symbol.for("immer-state") : "__$immer_state", nle = "" + Object.prototype.constructor, Y7 = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : Object.getOwnPropertySymbols !== void 0 ? function(A) {
  return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A));
} : Object.getOwnPropertyNames, ole = Object.getOwnPropertyDescriptors || function(A) {
  var e = {};
  return Y7(A).forEach(function(t) {
    e[t] = Object.getOwnPropertyDescriptor(A, t);
  }), e;
}, gle = {}, Xq = { get: function(A, e) {
  if (e === jI)
    return A;
  var t = Uh(A);
  if (!Wq(t, e))
    return function(n, o, g) {
      var s, I = flA(o, g);
      return I ? "value" in I ? I.value : (s = I.get) === null || s === void 0 ? void 0 : s.call(n.k) : void 0;
    }(A, t, e);
  var i = t[e];
  return A.I || !gp(i) ? i : i === h5(A.t, e) ? (m5(A), A.o[e] = Vq(A.A.h, i, A)) : i;
}, has: function(A, e) {
  return e in Uh(A);
}, ownKeys: function(A) {
  return Reflect.ownKeys(Uh(A));
}, set: function(A, e, t) {
  var i = flA(Uh(A), e);
  if (i != null && i.set)
    return i.set.call(A.k, t), !0;
  if (!A.P) {
    var n = h5(Uh(A), e), o = n == null ? void 0 : n[jI];
    if (o && o.t === t)
      return A.o[e] = t, A.R[e] = !1, !0;
    if (PBe(t, n) && (t !== void 0 || Wq(A.t, e)))
      return !0;
    m5(A), Uq(A);
  }
  return A.o[e] === t && (t !== void 0 || e in A.o) || Number.isNaN(t) && Number.isNaN(A.o[e]) || (A.o[e] = t, A.R[e] = !0), !0;
}, deleteProperty: function(A, e) {
  return h5(A.t, e) !== void 0 || e in A.t ? (A.R[e] = !1, m5(A), Uq(A)) : delete A.R[e], A.o && delete A.o[e], !0;
}, getOwnPropertyDescriptor: function(A, e) {
  var t = Uh(A), i = Reflect.getOwnPropertyDescriptor(t, e);
  return i && { writable: !0, configurable: A.i !== 1 || e !== "length", enumerable: i.enumerable, value: t[e] };
}, defineProperty: function() {
  Kr(11);
}, getPrototypeOf: function(A) {
  return Object.getPrototypeOf(A.t);
}, setPrototypeOf: function() {
  Kr(12);
} }, cJ = {};
kY(Xq, function(A, e) {
  cJ[A] = function() {
    return arguments[0] = arguments[0][0], e.apply(this, arguments);
  };
}), cJ.deleteProperty = function(A, e) {
  return cJ.set.call(this, A, e, void 0);
}, cJ.set = function(A, e, t) {
  return Xq.set.call(this, A[0], e, t, A[0]);
};
var sle = function() {
  function A(t) {
    var i = this;
    this.O = klA, this.D = !0, this.produce = function(n, o, g) {
      if (typeof n == "function" && typeof o != "function") {
        var s = o;
        o = n;
        var I = i;
        return function(E) {
          var d = this;
          E === void 0 && (E = s);
          for (var m = arguments.length, y = Array(m > 1 ? m - 1 : 0), f = 1; f < m; f++)
            y[f - 1] = arguments[f];
          return I.produce(E, function(w) {
            var G;
            return (G = o).call.apply(G, [d, w].concat(y));
          });
        };
      }
      var r;
      if (typeof o != "function" && Kr(6), g !== void 0 && typeof g != "function" && Kr(7), gp(n)) {
        var a = blA(i), C = Vq(i, n, void 0), B = !0;
        try {
          r = o(C), B = !1;
        } finally {
          B ? LH(a) : Kq(a);
        }
        return typeof Promise < "u" && r instanceof Promise ? r.then(function(E) {
          return u5(a, g), d5(E, a);
        }, function(E) {
          throw LH(a), E;
        }) : (u5(a, g), d5(r, a));
      }
      if (!n || typeof n != "object") {
        if ((r = o(n)) === void 0 && (r = n), r === I2A && (r = void 0), i.D && k7(r, !0), g) {
          var l = [], Q = [];
          XB("Patches").M(n, r, l, Q), g(l, Q);
        }
        return r;
      }
      Kr(21, n);
    }, this.produceWithPatches = function(n, o) {
      if (typeof n == "function")
        return function(r) {
          for (var a = arguments.length, C = Array(a > 1 ? a - 1 : 0), B = 1; B < a; B++)
            C[B - 1] = arguments[B];
          return i.produceWithPatches(r, function(l) {
            return n.apply(void 0, [l].concat(C));
          });
        };
      var g, s, I = i.produce(n, o, function(r, a) {
        g = r, s = a;
      });
      return typeof Promise < "u" && I instanceof Promise ? I.then(function(r) {
        return [r, g, s];
      }) : [I, g, s];
    }, typeof (t == null ? void 0 : t.useProxies) == "boolean" && this.setUseProxies(t.useProxies), typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze);
  }
  var e = A.prototype;
  return e.createDraft = function(t) {
    gp(t) || Kr(8), sf(t) && (t = ele(t));
    var i = blA(this), n = Vq(this, t, void 0);
    return n[jI].C = !0, Kq(i), n;
  }, e.finishDraft = function(t, i) {
    var n = t && t[jI], o = n.A;
    return u5(o, i), d5(void 0, o);
  }, e.setAutoFreeze = function(t) {
    this.D = t;
  }, e.setUseProxies = function(t) {
    t && !klA && Kr(20), this.O = t;
  }, e.applyPatches = function(t, i) {
    var n;
    for (n = i.length - 1; n >= 0; n--) {
      var o = i[n];
      if (o.path.length === 0 && o.op === "replace") {
        t = o.value;
        break;
      }
    }
    n > -1 && (i = i.slice(n + 1));
    var g = XB("Patches").$;
    return sf(t) ? g(t, i) : this.produce(t, function(s) {
      return g(s, i);
    });
  }, A;
}(), PI = new sle(), R7 = PI.produce;
PI.produceWithPatches.bind(PI);
PI.setAutoFreeze.bind(PI);
PI.setUseProxies.bind(PI);
PI.applyPatches.bind(PI);
PI.createDraft.bind(PI);
PI.finishDraft.bind(PI);
const Ile = R7;
var Ne;
(function(A) {
  A[A.setConfig = 0] = "setConfig", A[A.removeField = 1] = "removeField", A[A.reorderField = 2] = "reorderField", A[A.moveField = 3] = "moveField", A[A.cloneField = 4] = "cloneField", A[A.createBinlogField = 5] = "createBinlogField", A[A.appendFilter = 6] = "appendFilter", A[A.modFilter = 7] = "modFilter", A[A.writeFilter = 8] = "writeFilter", A[A.setName = 9] = "setName", A[A.applySort = 10] = "applySort", A[A.transpose = 11] = "transpose", A[A.setLayout = 12] = "setLayout", A[A.setFieldAggregator = 13] = "setFieldAggregator", A[A.setGeoData = 14] = "setGeoData", A[A.setCoordSystem = 15] = "setCoordSystem", A[A.createDateDrillField = 16] = "createDateDrillField", A[A.createDateFeatureField = 17] = "createDateFeatureField", A[A.changeSemanticType = 18] = "changeSemanticType", A[A.setFilterAggregator = 19] = "setFilterAggregator", A[A.addFoldField = 20] = "addFoldField", A[A.upsertPaintField = 21] = "upsertPaintField", A[A.addSQLComputedField = 22] = "addSQLComputedField", A[A.removeAllField = 23] = "removeAllField", A[A.editAllField = 24] = "editAllField", A[A.replaceWithNLPQuery = 25] = "replaceWithNLPQuery";
})(Ne || (Ne = {}));
const SL = {
  [Ne.setConfig]: (A, e, t) => Tt(A, "config", (i) => ({ ...i, [e]: t })),
  [Ne.removeField]: (A, e, t) => Tt(A, `encodings.${e}`, (i) => ElA(i, t)),
  [Ne.reorderField]: (A, e, t, i) => Tt(A, `encodings.${e}`, (n) => n.map((o, g, s) => g === t ? s[i] : g === i ? s[t] : o)),
  [Ne.moveField]: (A, e, t, i, n, o) => {
    const g = A.encodings[e][t], s = i === "dimensions" ? Tt(g, "analyticType", () => "dimension") : i === "measures" ? Tt(g, "analyticType", () => "measure") : g;
    return Tt(A, "encodings", (I) => ({
      ...I,
      [e]: ElA(A.encodings[e], t),
      [i]: DM(A.encodings[i], s, n).slice(0, o ?? 1 / 0)
    }));
  },
  [Ne.cloneField]: (A, e, t, i, n, o, g) => {
    const s = { ...A.encodings[e][t] };
    return Tt(A, "encodings", (I) => ({
      ...I,
      [i]: DM(A.encodings[i], s, n).slice(0, g ?? 1 / 0)
    }));
  },
  [Ne.createBinlogField]: (A, e, t, i, n, o) => {
    const g = A.encodings[e][t], s = i.startsWith("bin"), I = s ? "dimensions" : e, r = s ? `${i}${o}` : `log${o}`, a = {
      fid: n,
      name: `${r}(${g.name})`,
      semanticType: s ? "ordinal" : "quantitative",
      analyticType: s ? "dimension" : g.analyticType,
      computed: !0,
      expression: {
        op: i,
        as: n,
        params: [
          {
            type: "field",
            value: g.fid
          }
        ],
        num: o
      }
    };
    return s || (a.aggName = "sum"), Tt(A, `encodings.${I}`, (C) => C.concat(a));
  },
  [Ne.appendFilter]: (A, e, t, i, n) => {
    const o = A.encodings[t][i];
    return Tt(A, "encodings.filters", (g) => DM(g, {
      ...o,
      rule: null
    }, e));
  },
  [Ne.modFilter]: (A, e, t, i) => Tt(A, "encodings.filters", (n) => {
    const o = A.encodings[t][i];
    return QE(n, e, (g) => ({
      ...o,
      rule: null
    }));
  }),
  [Ne.writeFilter]: (A, e, t) => Tt(A, "encodings.filters", (i) => QE(i, e, (n) => ({ ...n, rule: t }))),
  [Ne.setName]: (A, e) => ({
    ...A,
    name: e
  }),
  [Ne.applySort]: (A, e) => {
    const { rows: t, columns: i } = A.encodings, n = t.length > 0 ? t[t.length - 1] : null, o = i.length > 0 ? i[i.length - 1] : null;
    return o !== null && o.analyticType === "dimension" && n !== null && n.analyticType === "measure" ? Tt(A, "encodings.columns", (g) => QE(g, g.length - 1, (s) => ({ ...s, sort: e }))) : o !== null && o.analyticType === "measure" && n !== null && n.analyticType === "dimension" ? Tt(A, "encodings.rows", (g) => QE(g, g.length - 1, (s) => ({ ...s, sort: e }))) : A;
  },
  [Ne.transpose]: (A) => Tt(A, "encodings", (e) => ({
    ...e,
    columns: e.rows,
    rows: e.columns
  })),
  [Ne.setLayout]: (A, e) => Tt(A, "layout", (t) => Object.assign({}, t, Object.fromEntries(e))),
  [Ne.setFieldAggregator]: (A, e, t, i) => Tt(A, `encodings.${e}`, (n) => QE(n, t, (o) => ({ ...o, aggName: i }))),
  [Ne.setGeoData]: (A, e, t, i) => Tt(A, "layout", (n) => ({ ...n, geojson: e, geoKey: t, geoUrl: i })),
  [Ne.setCoordSystem]: (A, e) => Tt(A, "config", (t) => ({
    ...t,
    coordSystem: e,
    geoms: [We.GEOM_TYPES[e][0]]
  })),
  [Ne.createDateDrillField]: (A, e, t, i, n, o, g, s) => {
    const I = A.encodings[e][t], r = {
      fid: n,
      name: o,
      semanticType: "temporal",
      analyticType: I.analyticType,
      aggName: "sum",
      computed: !0,
      timeUnit: i,
      expression: {
        op: "dateTimeDrill",
        as: n,
        params: [
          {
            type: "field",
            value: I.fid
          },
          {
            type: "value",
            value: i
          },
          ...g ? [
            {
              type: "format",
              value: g
            }
          ] : [],
          ...an(s) ? [
            {
              type: "offset",
              value: s
            }
          ] : []
        ]
      }
    };
    return Tt(A, `encodings.${e}`, (a) => a.concat(r));
  },
  [Ne.createDateFeatureField]: (A, e, t, i, n, o, g, s) => {
    const I = A.encodings[e][t], r = {
      fid: n,
      name: o,
      semanticType: "ordinal",
      analyticType: I.analyticType,
      aggName: "sum",
      computed: !0,
      expression: {
        op: "dateTimeFeature",
        as: n,
        params: [
          {
            type: "field",
            value: I.fid
          },
          {
            type: "value",
            value: i
          },
          ...g ? [
            {
              type: "format",
              value: g
            }
          ] : [],
          ...an(s) ? [
            {
              type: "offset",
              value: s
            }
          ] : []
        ]
      }
    };
    return Tt(A, `encodings.${e}`, (a) => a.concat(r));
  },
  [Ne.changeSemanticType]: (A, e, t, i) => Tt(A, `encodings.${e}`, (n) => QE(n, t, (o) => ({ ...o, semanticType: i }))),
  [Ne.setFilterAggregator]: (A, e, t) => Tt(A, "encodings.filters", (i) => QE(i, e, (n) => ({ ...n, aggName: t || "sum", enableAgg: !!t, rule: null }))),
  [Ne.addFoldField]: (A, e, t, i, n, o, g) => {
    let s = A;
    const I = s.encodings[e][t];
    if (!s.config.folds) {
      const r = [...s.encodings.measures, ...s.encodings.details].filter((a) => a.analyticType === "measure" && a.fid !== Wi);
      s = SL[Ne.setConfig](s, "folds", r.filter((a, C) => C === 0).map((a) => a.fid));
    }
    if (I.fid === Wi) {
      const r = Object.keys(s.encodings).filter((a) => a !== "filters").map((a) => [a, s.encodings[a].findIndex((C) => C.fid === Zi)]).filter(([a, C]) => C >= 0);
      if (r.length === 1) {
        const [a, C] = r[0];
        s = SL[Ne.cloneField](s, a, C, "details", 0, `${o}_auto`, 1 / 0);
      }
    }
    return SL[Ne.cloneField](s, e, t, i, n, o, g);
  },
  [Ne.upsertPaintField]: (A, e, t) => {
    if (!e)
      return Tt(A, "encodings", (o) => Object.fromEntries(Object.entries(o).map(([g, s]) => [g, s.filter((I) => I.fid !== ln)])));
    const i = "facets" in e ? { op: "paint", as: ln, params: [{ type: "newmap", value: e }] } : {
      op: "paint",
      as: ln,
      params: [{ type: "map", value: e }]
    }, n = e.usedColor.includes(255);
    return Tt(A, "encodings", (o) => {
      let g = !1, s = !1;
      const I = Object.entries(o).map(([B, l]) => {
        const Q = l.findIndex((E) => E.fid === ln);
        return Q > -1 ? (g = !0, B === "filters" && (s = !0), [
          B,
          QE(l, Q, (E) => ({
            ...E,
            expression: i
          }))
        ]) : [B, l];
      }), r = {
        fid: ln,
        analyticType: "dimension",
        name: t,
        semanticType: "nominal",
        computed: !0,
        expression: i,
        rule: {
          type: "not in",
          value: [""]
        }
      };
      if (g)
        return !s && n ? Tt(Object.fromEntries(I), "filters", (B) => B.concat(r)) : Object.fromEntries(I);
      const a = {
        fid: ln,
        analyticType: "dimension",
        name: t,
        semanticType: "nominal",
        computed: !0,
        expression: i
      }, C = Tt(Tt(o, "dimensions", (B) => DM(B, a, B.length)), "color", () => [{ ...a }]);
      return n ? Tt(C, "filters", (B) => B.concat(r)) : C;
    });
  },
  [Ne.addSQLComputedField]: (A, e, t, i) => {
    const [n, o] = o2A(I3(i), A.encodings.dimensions.concat(A.encodings.measures)), g = n === "quantitative" ? "measure" : "dimension";
    return Tt(A, `encodings.${g}s`, (s) => s.concat({
      analyticType: g,
      fid: e,
      name: t,
      semanticType: n,
      computed: !0,
      aggName: o ? "expr" : g === "dimension" ? void 0 : "sum",
      expression: {
        op: "expr",
        as: e,
        params: [{ type: "sql", value: i }]
      }
    }));
  },
  [Ne.removeAllField]: (A, e) => Tt(A, "encodings", (t) => Object.fromEntries(Object.entries(t).map(([i, n]) => {
    const o = n.filter((g) => g.fid !== e);
    return n.length === o.length ? [i, n] : [i, o];
  }))),
  [Ne.editAllField]: (A, e, t) => {
    if (Object.keys(t).includes("name")) {
      const i = A.encodings.dimensions.concat(A.encodings.measures).find((n) => n.fid === e);
      return Ile(A, (n) => {
        i && Object.values(n.encodings).forEach((o) => o.forEach((g, s) => {
          var I;
          if (g.fid === e)
            o[s] = { ...g, ...t };
          else if (((I = g.expression) == null ? void 0 : I.op) === "expr") {
            const r = g.expression.params.find((a) => a.type === "sql");
            if (r) {
              const a = g2A(r.value, [
                { ...i, fid: t.name, name: i.name ?? i.fid }
              ]);
              a !== r.value && (r.value = a);
            }
          }
        }));
      });
    }
    return Tt(A, "encodings", (i) => Object.fromEntries(Object.entries(i).map(([n, o]) => o.find((g) => g.fid === e) ? [n, o.map((g) => g.fid === e ? { ...g, ...t } : g)] : [n, o])));
  },
  [Ne.replaceWithNLPQuery]: (A, e, t) => ({ ...JSON.parse(t), visId: A.visId, name: A.name })
}, ale = (A, e) => {
  const t = {};
  return Object.keys(e.encodings).forEach((i) => {
    e.encodings[i] !== A.encodings[i] && (t[i] = e.encodings[i]);
  }), t;
};
function NlA(A, e) {
  const t = [], i = new Array(e.length).fill(null).map(() => []);
  return A.forEach((n) => {
    const o = e.findIndex((g) => g(n));
    o >= 0 ? i[o].push(n) : t.push(n);
  }), t.concat(i.flat());
}
function YlA(A) {
  const e = {};
  return A.dimensions && A.dimensions.length > 0 && (e.dimensions = NlA(A.dimensions, [(t) => t.fid === ln, (t) => t.fid === Zi])), A.measures && A.measures.length > 0 && (e.measures = NlA(A.measures, [(t) => t.fid === Hn, (t) => t.fid === Wi])), e;
}
const rle = (A, e) => {
  const t = ale(e, A), i = A.config.geoms[0];
  return Object.keys(t).length === 0 && clA(A.config.geoms, e.config.geoms) ? A : clA(A.config.geoms, e.config.geoms) ? Tt(A, "encodings", (n) => ({ ...n, ...ulA(i, t), ...YlA(t) })) : Tt(A, "encodings", (n) => ({ ...n, ...ulA(i, n), ...YlA(n) }));
}, Cle = [rle];
function xR(A, e) {
  const [t, ...i] = e, n = SL[t](A, ...i);
  return Cle.reduce((o, g) => g(o, A), n);
}
const Ble = xR, a2A = xBe(xR), lle = LBe(xR), cle = vBe(xR), Qle = HBe(xR), oi = Object.fromEntries(Object.keys(Ne).map((A) => [A, (e, ...t) => a2A(e, [Ne[A], ...t])]));
function SH(A, e, t) {
  return {
    config: t != null && t.config ? { ...Zq, ...t.config } : Zq,
    encodings: y7,
    layout: t != null && t.layout ? { ...QlA, ...t.layout } : QlA,
    visId: A,
    name: e
  };
}
function a3(A, e, t, i) {
  if (A.length === 0)
    return SH(t || Mr(), e, i);
  const n = [EBe(), ...uBe()], o = n.filter((s) => s.analyticType === "dimension"), g = n.filter((s) => s.analyticType === "measure");
  return Tt(SH(t || Mr(), e, i), "encodings", (s) => ({
    ...s,
    dimensions: A.filter((I) => I.analyticType === "dimension").map((I) => ({
      fid: I.fid,
      name: I.name || I.fid,
      basename: I.basename || I.name || I.fid,
      semanticType: I.semanticType,
      analyticType: I.analyticType,
      offset: I.offset
    })).concat(o),
    measures: A.filter((I) => I.analyticType === "measure").map((I) => ({
      fid: I.fid,
      name: I.name || I.fid,
      basename: I.basename || I.name || I.fid,
      analyticType: I.analyticType,
      semanticType: I.semanticType,
      aggName: "sum",
      offset: I.offset
    })).concat(g)
  }));
}
function r2A(A) {
  var e;
  const t = SH(A.visId || Mr(), A.name || "Chart");
  return t.config = {
    ...t.config,
    ...A.config
  }, t.encodings = {
    ...t.encodings,
    ...A.encodings
  }, t.layout = {
    ...t.layout,
    ...A.layout,
    size: {
      ...t.layout.size,
      ...(e = A.layout) == null ? void 0 : e.size
    }
  }, t;
}
function xb(A) {
  return PYA(r2A(A));
}
function p5(A, e, t) {
  return PYA(a3(A, e, void 0, t));
}
function RlA(A, e = 30) {
  const t = {
    base: A.cursor > e ? Qle(A, A.cursor - e) : A.base,
    timeline: A.timeline.slice(Math.max(0, A.cursor - e))
  };
  return JSON.stringify(t);
}
function Ele(A) {
  return A.now;
}
function ule(A) {
  return xb(A);
}
function FlA(A) {
  const e = JSON.parse(A), t = xb(e.base);
  return e.timeline.reduce(a2A, t);
}
function C2A(A) {
  var e, t, i, n, o, g, s, I, r, a, C, B, l, Q, E, d, m;
  const y = SH(A.visId, A.name || "Chart");
  return y.config = {
    ...y.config,
    defaultAggregated: A.config.defaultAggregated,
    geoms: ((e = A.config.geoms) == null ? void 0 : e.slice()) ?? [],
    limit: A.config.limit,
    coordSystem: A.config.coordSystem,
    folds: A.config.folds
  }, y.encodings = {
    ...y.encodings,
    dimensions: ((t = A.encodings.dimensions) == null ? void 0 : t.slice()) ?? [],
    measures: ((i = A.encodings.measures) == null ? void 0 : i.slice()) ?? [],
    rows: ((n = A.encodings.rows) == null ? void 0 : n.slice()) ?? [],
    columns: ((o = A.encodings.columns) == null ? void 0 : o.slice()) ?? [],
    color: ((g = A.encodings.color) == null ? void 0 : g.slice()) ?? [],
    opacity: ((s = A.encodings.opacity) == null ? void 0 : s.slice()) ?? [],
    size: ((I = A.encodings.size) == null ? void 0 : I.slice()) ?? [],
    shape: ((r = A.encodings.shape) == null ? void 0 : r.slice()) ?? [],
    theta: ((a = A.encodings.theta) == null ? void 0 : a.slice()) ?? [],
    radius: ((C = A.encodings.radius) == null ? void 0 : C.slice()) ?? [],
    longitude: ((B = A.encodings.longitude) == null ? void 0 : B.slice()) ?? [],
    latitude: ((l = A.encodings.latitude) == null ? void 0 : l.slice()) ?? [],
    geoId: ((Q = A.encodings.geoId) == null ? void 0 : Q.slice()) ?? [],
    details: ((E = A.encodings.details) == null ? void 0 : E.slice()) ?? [],
    filters: ((d = A.encodings.filters) == null ? void 0 : d.slice()) ?? [],
    text: ((m = A.encodings.text) == null ? void 0 : m.slice()) ?? []
  }, y.layout = {
    ...y.layout,
    background: A.config.background,
    format: A.config.format,
    interactiveScale: A.config.interactiveScale,
    resolve: A.config.resolve,
    showActions: A.config.showActions,
    stack: A.config.stack,
    zeroScale: A.config.zeroScale,
    size: {
      ...y.layout.size,
      ...A.config.size
    },
    colorPalette: A.config.colorPalette,
    geojson: A.config.geojson,
    geoKey: A.config.geoKey,
    geoUrl: A.config.geoUrl,
    primaryColor: A.config.primaryColor,
    scale: A.config.scale,
    scaleIncludeUnmatchedChoropleth: A.config.scaleIncludeUnmatchedChoropleth,
    showTableSummary: A.config.showTableSummary,
    useSvg: A.config.useSvg
  }, y;
}
function B2A(A) {
  return "layout" in A ? A : C2A(qYA(OYA(A)));
}
function dle(A) {
  return A;
}
function hle(A) {
  if (A == null)
    return dle;
  var e, t, i = A.scale[0], n = A.scale[1], o = A.translate[0], g = A.translate[1];
  return function(s, I) {
    I || (e = t = 0);
    var r = 2, a = s.length, C = new Array(a);
    for (C[0] = (e += s[0]) * i + o, C[1] = (t += s[1]) * n + g; r < a; )
      C[r] = s[r], ++r;
    return C;
  };
}
function mle(A, e) {
  for (var t, i = A.length, n = i - e; n < --i; )
    t = A[n], A[n++] = A[i], A[i] = t;
}
function r3(A, e) {
  return typeof e == "string" && (e = A.objects[e]), e.type === "GeometryCollection" ? { type: "FeatureCollection", features: e.geometries.map(function(t) {
    return MlA(A, t);
  }) } : MlA(A, e);
}
function MlA(A, e) {
  var t = e.id, i = e.bbox, n = e.properties == null ? {} : e.properties, o = l2A(A, e);
  return t == null && i == null ? { type: "Feature", properties: n, geometry: o } : i == null ? { type: "Feature", id: t, properties: n, geometry: o } : { type: "Feature", id: t, bbox: i, properties: n, geometry: o };
}
function l2A(A, e) {
  var t = hle(A.transform), i = A.arcs;
  function n(a, C) {
    C.length && C.pop();
    for (var B = i[a < 0 ? ~a : a], l = 0, Q = B.length; l < Q; ++l)
      C.push(t(B[l], l));
    a < 0 && mle(C, Q);
  }
  function o(a) {
    return t(a);
  }
  function g(a) {
    for (var C = [], B = 0, l = a.length; B < l; ++B)
      n(a[B], C);
    return C.length < 2 && C.push(C[0]), C;
  }
  function s(a) {
    for (var C = g(a); C.length < 4; )
      C.push(C[0]);
    return C;
  }
  function I(a) {
    return a.map(s);
  }
  function r(a) {
    var C = a.type, B;
    switch (C) {
      case "GeometryCollection":
        return { type: C, geometries: a.geometries.map(r) };
      case "Point":
        B = o(a.coordinates);
        break;
      case "MultiPoint":
        B = a.coordinates.map(o);
        break;
      case "LineString":
        B = g(a.arcs);
        break;
      case "MultiLineString":
        B = a.arcs.map(g);
        break;
      case "Polygon":
        B = I(a.arcs);
        break;
      case "MultiPolygon":
        B = a.arcs.map(I);
        break;
      default:
        return null;
    }
    return { type: C, coordinates: B };
  }
  return r(e);
}
function ple(A, e) {
  var t = {}, i = {}, n = {}, o = [], g = -1;
  e.forEach(function(r, a) {
    var C = A.arcs[r < 0 ? ~r : r], B;
    C.length < 3 && !C[1][0] && !C[1][1] && (B = e[++g], e[g] = r, e[a] = B);
  }), e.forEach(function(r) {
    var a = s(r), C = a[0], B = a[1], l, Q;
    if (l = n[C])
      if (delete n[l.end], l.push(r), l.end = B, Q = i[B]) {
        delete i[Q.start];
        var E = Q === l ? l : l.concat(Q);
        i[E.start = l.start] = n[E.end = Q.end] = E;
      } else
        i[l.start] = n[l.end] = l;
    else if (l = i[B])
      if (delete i[l.start], l.unshift(r), l.start = C, Q = n[C]) {
        delete n[Q.end];
        var d = Q === l ? l : Q.concat(l);
        i[d.start = Q.start] = n[d.end = l.end] = d;
      } else
        i[l.start] = n[l.end] = l;
    else
      l = [r], i[l.start = C] = n[l.end = B] = l;
  });
  function s(r) {
    var a = A.arcs[r < 0 ? ~r : r], C = a[0], B;
    return A.transform ? (B = [0, 0], a.forEach(function(l) {
      B[0] += l[0], B[1] += l[1];
    })) : B = a[a.length - 1], r < 0 ? [B, C] : [C, B];
  }
  function I(r, a) {
    for (var C in r) {
      var B = r[C];
      delete a[B.start], delete B.start, delete B.end, B.forEach(function(l) {
        t[l < 0 ? ~l : l] = 1;
      }), o.push(B);
    }
  }
  return I(n, i), I(i, n), e.forEach(function(r) {
    t[r < 0 ? ~r : r] || o.push([r]);
  }), o;
}
function yle(A) {
  return l2A(A, ble.apply(this, arguments));
}
function ble(A, e, t) {
  var i, n, o;
  if (arguments.length > 1)
    i = wle(A, e, t);
  else
    for (n = 0, i = new Array(o = A.arcs.length); n < o; ++n)
      i[n] = n;
  return { type: "MultiLineString", arcs: ple(A, i) };
}
function wle(A, e, t) {
  var i = [], n = [], o;
  function g(C) {
    var B = C < 0 ? ~C : C;
    (n[B] || (n[B] = [])).push({ i: C, g: o });
  }
  function s(C) {
    C.forEach(g);
  }
  function I(C) {
    C.forEach(s);
  }
  function r(C) {
    C.forEach(I);
  }
  function a(C) {
    switch (o = C, C.type) {
      case "GeometryCollection":
        C.geometries.forEach(a);
        break;
      case "LineString":
        s(C.arcs);
        break;
      case "MultiLineString":
      case "Polygon":
        I(C.arcs);
        break;
      case "MultiPolygon":
        r(C.arcs);
        break;
    }
  }
  return a(e), n.forEach(t == null ? function(C) {
    i.push(C[0].i);
  } : function(C) {
    t(C[0].g, C[C.length - 1].g) && i.push(C[0].i);
  }), i;
}
function c2A(A, e) {
  return A.aggName === "expr" ? A : {
    ...A,
    aggName: e
  };
}
function Q2A(A, e, t, i, n, o) {
  const g = i.find((s) => s.fid === Wi);
  if (n.find((s) => s.fid === Zi) && g) {
    if (!(o != null && o.length))
      return [];
    const s = (o ?? []).map((r) => t.find((a) => a.fid === r)).filter(Boolean).filter((r) => e || r.aggName !== "expr").map((r) => {
      if (e) {
        const a = c2A(r, g.aggName);
        return {
          name: op(a.name, a.aggName),
          fid: io(a.fid, a.aggName)
        };
      }
      return { name: r.name, fid: r.fid };
    }), I = new Set(s.map((r) => r.fid));
    return A.flatMap((r) => {
      const a = Object.fromEntries(Object.entries(r).filter((C) => !I.has(C[0])));
      return s.map((C) => ({
        ...a,
        [Zi]: C.name,
        [e ? io(Wi, g.aggName) : Wi]: r[C.fid]
      }));
    });
  }
  return A;
}
const LR = (A) => {
  switch (A) {
    case "choropleth":
      return ["geoId", "color", "opacity", "text", "details"];
    case "poi":
      return ["longitude", "latitude", "color", "opacity", "size", "details"];
    case "arc":
      return ["radius", "theta", "color", "opacity", "size", "details", "text"];
    case "bar":
    case "tick":
    case "line":
    case "area":
    case "boxplot":
      return ["columns", "rows", "color", "opacity", "size", "details", "text"];
    case "text":
      return ["columns", "rows", "color", "opacity", "size", "text"];
    case "table":
      return ["columns", "rows"];
    default:
      return ["columns", "rows", "color", "opacity", "size", "details", "shape"];
  }
}, E2A = (A, e) => {
  for (const t of A.params)
    t.type === "field" ? e(t.value) : t.type === "expression" ? E2A(t.value, e) : t.type === "sql" ? OBe(t.value).forEach(e) : t.type === "map" ? (e(t.value.x), e(t.value.y)) : t.type === "newmap" && t.value.facets.flatMap((i) => i.dimensions).forEach((i) => e(i.fid));
}, xlA = (A, e) => {
  const t = /* @__PURE__ */ new Map();
  return A.forEach((i) => t.set(e(i), i)), [...t.values()];
}, LlA = (A, e) => {
  const t = new Set(e);
  let i = A.filter((g) => t.has(g.key)), n = i.slice(), o = A.filter((g) => !t.has(g.key));
  for (; n.length && o.length; ) {
    const g = /* @__PURE__ */ new Set();
    for (const I of n)
      E2A(I.expression, (r) => g.add(r));
    const s = o.filter((I) => g.has(I.key));
    i = A.filter((I) => g.has(I.key)).concat(i.filter((I) => !g.has(I.key))), n = s, o = o.filter((I) => !g.has(I.key));
  }
  return i;
}, u2A = (A) => {
  const e = rm(A), t = A.rule;
  return t.type === "one of" ? {
    fid: e,
    rule: {
      type: "one of",
      value: [...t.value]
    }
  } : t.type === "temporal range" ? {
    fid: e,
    rule: {
      type: "temporal range",
      value: t.value,
      offset: t.offset,
      format: t.format
    }
  } : t.type === "not in" ? {
    fid: e,
    rule: {
      type: "not in",
      value: [...t.value]
    }
  } : t.type === "range" ? {
    fid: e,
    rule: {
      type: "range",
      value: [t.value[0] ? Number(t.value[0]) : t.value[0], t.value[1] ? Number(t.value[1]) : t.value[1]]
    }
  } : t.type === "regexp" ? {
    fid: e,
    rule: {
      type: "regexp",
      value: t.value,
      caseSensitive: t.caseSensitive
    }
  } : (console.error("unknown rule", t), {
    fid: e,
    rule: t
  });
}, Vu = (A, e, t, i, n, o, g = [], s, I) => {
  const r = t.find((p) => p.fid === Zi) && i.find((p) => p.fid === Wi), a = t.filter((p) => p.fid !== Zi), C = i.filter((p) => p.fid !== Wi);
  if (r) {
    const p = i.find((v) => v.fid === Wi).aggName, N = g.map((v) => e.find((K) => K.fid === v)).filter(Boolean).map((v) => c2A(v, p));
    a.push(...N.filter((v) => (v == null ? void 0 : v.analyticType) === "dimension")), C.push(...N.filter((v) => (v == null ? void 0 : v.analyticType) === "measure"));
  }
  const B = new Set([...a, ...C, ...A].map((p) => p.fid));
  let l = null, Q = null, E = null, d = null, m = null, y = null;
  const f = (p) => {
    const N = u2A(p);
    return B.add(N.fid), N;
  }, w = A.filter((p) => !p.computed && p.rule && !p.enableAgg).map(f);
  w.length && (l = {
    type: "filter",
    filters: w
  });
  const G = LlA(e.filter((p) => p.computed && p.expression && !(p.expression.op === "expr" && p.aggName === "expr")).map((p) => ({
    key: p.fid,
    expression: NY(p.expression, e, { timezoneDisplayOffset: I })
  })), [...B]);
  G.length && (Q = {
    type: "transform",
    transform: G
  });
  const R = A.filter((p) => p.computed && p.rule && !p.enableAgg).map(f);
  R.length && (E = {
    type: "filter",
    filters: R
  });
  const F = A.filter((p) => p.enableAgg && p.aggName && p.rule), Z = LlA(e.filter((p) => p.computed && p.expression && p.expression.op === "expr" && p.aggName === "expr").map((p) => ({
    key: p.fid,
    expression: NY(p.expression, e, { timezoneDisplayOffset: I })
  })), [...B]), c = C.filter((p) => p.aggName).map((p) => [p.fid, p.aggName]).concat(F.map((p) => [p.fid, p.aggName])).concat(Z.map((p) => [p.expression.params[0].value, "expr"])), J = n && (c.length || C.length === 0 && a.length > 0);
  return J ? d = {
    type: "view",
    query: [
      {
        op: "aggregate",
        groupBy: xlA(a.map((p) => p.fid), (p) => p),
        measures: xlA(C.concat(F).map((p) => ({
          field: p.fid,
          agg: p.aggName,
          asFieldKey: io(p.fid, p.aggName)
        })).concat(Z.map((p) => ({
          field: p.expression.params[0].value,
          agg: "expr",
          asFieldKey: p.key
        }))), (p) => p.asFieldKey)
      }
    ]
  } : d = {
    type: "view",
    query: [
      {
        op: "raw",
        fields: [.../* @__PURE__ */ new Set([...a, ...C])].filter((p) => p.aggName !== "expr").map((p) => p.fid)
      }
    ]
  }, J && a.length > 0 && F.length > 0 && (y = {
    type: "filter",
    filters: F.map(f)
  }), o !== "none" && s && s !== -1 && (m = {
    type: "sort",
    by: C.map((p) => J ? io(p.fid, p.aggName) : p.fid),
    sort: o
  }), [
    l,
    Q,
    E,
    d,
    y,
    m
  ].filter(Boolean);
}, fle = (A, e) => e.length === 0 ? A : A.workflow[0].type === "transform" ? {
  ...A,
  workflow: A.workflow.map((t, i) => {
    if (t.type === "transform" && i === 0) {
      const n = new Set(t.transform.map((o) => o.key));
      return {
        type: "transform",
        transform: t.transform.concat(e.filter((o) => !n.has(o.key)))
      };
    }
    return t;
  })
} : { ...A, workflow: [{ type: "transform", transform: e }, ...A.workflow] }, d2A = (A, e) => {
  if (e.length === 0)
    return A;
  const t = A.workflow.findIndex((i) => i.type === "filter");
  return t > -1 ? {
    ...A,
    workflow: A.workflow.map((i, n) => i.type === "filter" && n === t ? {
      type: "filter",
      filters: e.concat(i.filters)
    } : i)
  } : {
    ...A,
    workflow: [{ type: "filter", filters: e }, ...A.workflow]
  };
};
function zq(A) {
  var e, t, i, n, o, g, s, I, r, a, C;
  const B = B2A(A), l = LR(((t = (e = B.config) == null ? void 0 : e.geoms) == null ? void 0 : t[0]) ?? "auto").flatMap((m) => {
    var y;
    return ((y = B.encodings) == null ? void 0 : y[m]) ?? [];
  }), Q = ((i = B.encodings) == null ? void 0 : i.rows) ?? [], E = ((n = B.encodings) == null ? void 0 : n.columns) ?? [], d = ((o = B.config) == null ? void 0 : o.limit) ?? -1;
  return {
    workflow: Vu(((g = B.encodings) == null ? void 0 : g.filters) ?? [], [...((s = B.encodings) == null ? void 0 : s.dimensions) ?? [], ...((I = B.encodings) == null ? void 0 : I.measures) ?? []], l.filter((m) => m.analyticType === "dimension"), l.filter((m) => m.analyticType === "measure"), ((r = B.config) == null ? void 0 : r.defaultAggregated) ?? !0, gf({ rows: Q, columns: E }), ((a = B.config) == null ? void 0 : a.folds) ?? [], d, (C = B.config) == null ? void 0 : C.timezoneDisplayOffset),
    limit: d > 0 ? d : void 0
  };
}
const NY = (A, e, t) => (A == null ? void 0 : A.op) === "expr" ? {
  ...A,
  params: [
    {
      type: "sql",
      value: g2A(A.params.find((i) => i.type === "sql").value, e).trim()
    }
  ]
} : A.op === "dateTimeDrill" || A.op === "dateTimeFeature" ? {
  ...A,
  params: [
    ...A.params,
    {
      type: "displayOffset",
      value: t.timezoneDisplayOffset ?? (/* @__PURE__ */ new Date()).getTimezoneOffset()
    }
  ]
} : A.op === "paint" ? {
  ...A,
  params: A.params.map((i) => {
    if (i.type === "map") {
      const n = {
        ...i.value.dict,
        255: { name: "" }
      };
      return {
        type: "map",
        value: {
          x: i.value.x,
          y: i.value.y,
          domainX: i.value.domainX,
          domainY: i.value.domainY,
          map: i.value.map,
          dict: Object.fromEntries(i.value.usedColor.map((o) => [
            o,
            {
              name: n[o].name
            }
          ])),
          mapwidth: i.value.mapwidth
        }
      };
    } else if (i.type === "newmap") {
      const n = {
        ...i.value.dict,
        255: { name: "" }
      }, o = Array.from(new Set(i.value.usedColor.concat(1)));
      return {
        type: "newmap",
        value: {
          facets: i.value.facets.map(({ dimensions: g, map: s }) => ({ dimensions: g, map: s })),
          dict: Object.fromEntries(o.map((g) => [
            g,
            {
              name: n[g].name
            }
          ]))
        }
      };
    } else
      return i;
  })
} : A, Hi = {
  fid: "",
  name: "",
  semanticType: "quantitative",
  analyticType: "measure",
  aggName: "sum"
};
function Dle(A) {
  return A === "text" ? /* @__PURE__ */ new Set(["text", "color", "size", "x", "y", "xOffset", "yOffset", "opacity"]) : A === "arc" ? /* @__PURE__ */ new Set(["opacity", "color", "size", "theta", "radius"]) : /* @__PURE__ */ new Set(["column", "opacity", "color", "row", "size", "x", "y", "xOffset", "yOffset", "shape"]);
}
function Gle(A) {
  switch (A) {
    case "iso_year":
    case "year":
      return "utcyear";
    case "quarter":
      return "utcyearquarter";
    case "month":
      return "utcyearmonth";
    case "iso_week":
    case "week":
      return "utcyearweek";
    case "day":
      return "utcyearmonthdate";
    case "hour":
      return "utcyearmonthdatehours";
    case "minute":
      return "utcyearmonthdatehoursminutes";
    case "second":
      return "utcyearmonthdatehoursminutesseconds";
  }
  return A;
}
function kle(A) {
  switch (A) {
    case "iso_year":
      return "%G";
    case "iso_week":
      return "%G W%V";
  }
}
function ow(A) {
  return A.replace(/([\"\'\.\[\]\/\\])/g, "\\$1").replace(/\n/g, "\\n").replace(/\t/g, "\\t").replace(/\r/g, "\\r");
}
function Jle(A) {
  const e = Dle(A.geomType), t = {};
  return Object.keys(A).filter((i) => e.has(i)).forEach((i) => {
    var n, o, g, s;
    const I = A[i];
    if (I !== Hi) {
      if (t[i] = {
        field: ow(I.fid),
        title: I.name,
        type: I.semanticType
      }, I.computed && ((n = I.expression) == null ? void 0 : n.op) === "bin") {
        const r = t[i].field;
        t[i].field = `${r}[0]`, delete t[i].type, t[i].bin = {
          binned: !0
        }, t[i].formatType = "formatBin", t[i].format = (o = A.vegaConfig) == null ? void 0 : o.numberFormat, (i === "x" || i === "y") && (t[`${i}2`] = {
          field: `${r}[1]`,
          formatType: "formatBin",
          format: (g = A.vegaConfig) == null ? void 0 : g.numberFormat
        });
      }
      if (I.analyticType !== "measure" && (t[i].aggregate = null), I.analyticType === "measure" && (t[i].type = "quantitative"), I.semanticType === "temporal" && (t[i].scale = { type: "utc" }), I.semanticType === "temporal" && I.timeUnit && (I.timeUnit.startsWith("iso") && (t[i].format = kle(I.timeUnit)), t[i].timeUnit = Gle(I.timeUnit)), i === "color" && ((s = I.expression) == null ? void 0 : s.op) === "paint") {
        const r = I.expression.params.find((C) => C.type === "map" || C.type === "newmap").value, a = r.usedColor.map((C) => r.dict[C]).filter(Boolean);
        t[i].scale = {
          domain: a.map((C) => C.name),
          range: a.map((C) => C.color)
        };
      }
    }
  }), t.x && (t.x.axis = { labelOverlap: !0 }), t && t.y && (t.y.axis = { labelOverlap: !0 }), t.x && t.y && (A.x.sort && A.x.sort || A.y && A.y.sort) && (A.x.sort !== "none" && (A.y.sort === "none" || !A.y.sort) ? t.x.sort = {
    encoding: "y",
    order: A.x.sort
  } : A.y.sort && A.y.sort !== "none" && (A.x.sort === "none" || !A.x.sort) && (t.y.sort = {
    encoding: "x",
    order: A.y.sort
  })), t;
}
function C3(A) {
  if (A.length < 2)
    return A[0] === "temporal" || A[0] === "quantitative" ? "tick" : "bar";
  const e = /* @__PURE__ */ new Map();
  ["nominal", "ordinal", "quantitative", "temporal"].forEach((t) => {
    e.set(t, 0);
  });
  for (let t of A)
    e.set(t, e.get(t) + 1);
  return e.get("nominal") === 1 || e.get("ordinal") === 1 ? "bar" : e.get("temporal") === 1 && e.get("quantitative") === 1 ? "line" : (e.get("quantitative"), "point");
}
function Nle(A, e) {
  Object.values(A).forEach((t) => {
    if (t.aggregate === null)
      return;
    const i = e.find((n) => ow(n.fid) === t.field && (n.analyticType === "measure" || n.fid === Hn));
    i && i.fid === Hn ? (t.title = "Count", t.field = ow(io(i.fid, i.aggName))) : i && (t.title = op(i.name, i.aggName), t.field = ow(io(i.fid, i.aggName)));
  });
}
function Yle(A, e) {
  if (e === "stack" || e === "zero")
    return;
  let t = e === "none" ? null : e;
  const i = ["x", "y", "theta", "radius"];
  for (let n of i)
    A[n] && A[n].type === "quantitative" && (A[n].stack = t);
}
function Rle(A, e = [], t = !1) {
  const i = Object.keys(A).filter((n) => n !== "tooltip" && n !== "x2" && n !== "y2").map((n) => R7({
    field: A[n].field.replace("[0]", ""),
    type: A[n].type,
    title: A[n].title
  }, (o) => {
    A[n].timeUnit && !A[n].format && (o.timeUnit = A[n].timeUnit), A[n].scale && (o.scale = A[n].scale), A[n].formatType && (o.formatType = A[n].formatType), A[n].format && (o.format = A[n].format);
  })).concat(e.map((n) => ({
    field: t && n.analyticType === "measure" ? io(n.fid, n.aggName) : n.fid,
    title: t && n.analyticType === "measure" ? op(n.name, n.aggName) : n.name,
    type: n.semanticType
  })));
  A.tooltip = i;
}
function Fle(A, e) {
  return A.map((t) => {
    const i = {};
    for (let n in e) {
      const { from: o, to: g } = e[n];
      i[g] = xle(t, o);
    }
    return i;
  });
}
function Mle(A) {
  return A.map((e, t) => {
    const i = `gwc_${t}`;
    return {
      ...e,
      key: i,
      fid: i
    };
  });
}
function F7(A, e) {
  const t = Mle(e), i = t.map((n, o) => ({
    from: e[o].path ?? [e[o].fid],
    to: n.fid
  }));
  return {
    safeData: Fle(A, i),
    safeMetas: t
  };
}
function xle(A, e) {
  let t = A;
  for (let i of e)
    t = t[i];
  return t;
}
const Lle = [
  /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/,
  /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/,
  /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4}$/,
  /^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/,
  /^\d{4}\.(0[1-9]|1[0-2])\.(0[1-9]|[12][0-9]|3[01])$/,
  /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])\s\d{2}:\d{2}:\d{2}$/,
  /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T\d{2}:\d{2}:\d{2}$/,
  /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T\d{2}:\d{2}:\d{2}.\d{3}Z$/,
  /^([1-9]|1[0-2])\/([1-9]|[12][0-9]|3[01])\/\d{4}$/,
  /^([1-9]|[12][0-9]|3[01])\/([1-9]|1[0-2])\/\d{4}$/
  // d/m/YYYY
], vle = [
  "%Y-%m-%d",
  "%m/%d/%Y",
  "%d/%m/%Y",
  "%Y/%m/%d",
  "%Y.%m.%d",
  "%Y-%m-%d %H:%M:%S",
  "%Y-%m-%dT%H:%M:%S",
  "%Y-%m-%dT%H:%M:%S.%gZ",
  "%f/%e/%Y",
  "%e/%f/%Y"
];
function YY(A) {
  if (typeof A == "number")
    return "timestamp";
  const e = Lle.findIndex((t) => t.test(A));
  return e >= 0 ? vle[e] : "";
}
function Hle(A, e) {
  return Object.keys(A).forEach((t) => {
    var i;
    if (A[t].bin && (i = e[0]) != null && i[A[t].field.replace("[0]", "")]) {
      const n = e[0][A[t].field.replace("[0]", "")];
      A[t].bin.step = n[1] - n[0];
    }
  }), A;
}
function vlA(A) {
  return A === 0 ? "" : `${A > 0 ? "+" : "-"}${Math.abs(A)}`;
}
function HlA(A) {
  const { x: e, y: t, color: i, opacity: n, size: o, shape: g, theta: s, radius: I, text: r, row: a, column: C, xOffset: B, yOffset: l, details: Q, defaultAggregated: E, stack: d, geomType: m, hasLegend: y = !0, hideLegend: f = !1, displayOffset: w, dataSource: G, vegaConfig: R } = A, F = [e, t, i, n, o, g, a, C, B, l, s, I, r];
  let Z = m, c = {};
  if (y ? f && (c.legend = {
    gradientOpacity: 0,
    labelColor: "transparent",
    symbolOpacity: 0,
    symbolStrokeColor: "transparent",
    titleColor: "transparent",
    titleOpacity: 0
  }) : c.legend = {
    disable: !0
  }, m === "auto") {
    const N = [];
    e !== Hi && N.push(e.semanticType), t !== Hi && N.push(t.semanticType), Z = C3(N);
  }
  const J = F.filter((N) => N.semanticType === "temporal").map((N) => {
    var v;
    let K = (w ?? (/* @__PURE__ */ new Date()).getTimezoneOffset()) * -6e4;
    const U = ow(N.fid), j = (v = G[0]) == null ? void 0 : v[N.fid];
    if (j) {
      const q = YY(j);
      if (q !== "timestamp")
        return K += (N.offset ?? (/* @__PURE__ */ new Date()).getTimezoneOffset()) * 6e4, $YA.includes(q) || (K -= (/* @__PURE__ */ new Date()).getTimezoneOffset() * 6e4), K === 0 ? null : {
          calculate: `toDate(datum[${JSON.stringify(U)}])${vlA(K)}`,
          as: U
        };
    }
    return K === 0 ? null : {
      calculate: `datum[${JSON.stringify(U)}]${vlA(K)}`,
      as: U
    };
  }).filter(Boolean);
  let p = Jle({
    geomType: Z,
    x: e,
    y: t,
    color: i,
    opacity: n,
    size: o,
    shape: g,
    row: a,
    column: C,
    xOffset: B,
    yOffset: l,
    theta: s,
    radius: I,
    details: Q,
    text: r,
    displayOffset: w,
    vegaConfig: R
  });
  return E && Nle(p, F), Hle(p, G), Rle(p, Q, E), Yle(p, d), {
    config: c,
    transform: J,
    mark: {
      type: Z,
      opacity: 0.96,
      tooltip: { content: "data" }
    },
    encoding: p
  };
}
function h2A(A, e, t, i) {
  if (typeof A == "function") {
    if (!e)
      return;
    const n = t.map((o) => o[e.fid]);
    return A({
      semanticType: e.semanticType,
      theme: i,
      values: n
    });
  }
  return A;
}
function SlA(A, e, t, i) {
  const n = { ...e.encoding };
  function o(g) {
    if (A[g] && n[g])
      if (typeof A[g] == "function") {
        const s = n[g].field, I = t.map((r) => r[s]);
        n[g].scale = A[g]({
          semanticType: n[g].type,
          theme: i,
          values: I
        });
      } else
        n[g].scale = A[g];
  }
  return o("color"), o("opacity"), o("size"), o("radius"), o("theta"), {
    ...e,
    encoding: n
  };
}
const ZlA = (A) => Math.max(A, 1);
function Sle({ rows: A, columns: e, color: t, opacity: i, size: n, details: o = [], radius: g, shape: s, text: I, theta: r, interactiveScale: a, dataSource: C, layoutMode: B, width: l, height: Q, defaultAggregated: E, geomType: d, stack: m, scales: y, mediaTheme: f, vegaConfig: w, displayOffset: G }) {
  const R = E ? (AA) => AA ?? Hi : (AA) => AA ? AA.aggName === "expr" ? Hi : AA : Hi, F = A.map(R).filter((AA) => AA !== Hi), Z = e.map(R).filter((AA) => AA !== Hi), c = R(F.length > 0 ? F[F.length - 1] : Hi), J = R(Z.length > 0 ? Z[Z.length - 1] : Hi), p = F.filter((AA) => AA.analyticType === "dimension"), N = Z.filter((AA) => AA.analyticType === "dimension"), v = F.filter((AA) => AA.analyticType === "measure"), K = Z.filter((AA) => AA.analyticType === "measure"), U = v.length === 0 ? p.slice(-1) : v, j = K.length === 0 ? N.slice(-1) : K, q = F.slice(0, -1).filter((AA) => AA.analyticType === "dimension"), O = Z.slice(0, -1).filter((AA) => AA.analyticType === "dimension"), $ = q.length > 0 ? q[q.length - 1] : Hi, _ = O.length > 0 ? O[O.length - 1] : Hi, tA = [...F, ...Z, t, i, n, ...o].filter((AA) => !!AA).filter((AA) => AA.aggName !== "expr").map((AA) => AA.fid), nA = {
    data: {
      values: C
    },
    params: [
      {
        name: "geom",
        select: {
          type: "point",
          fields: tA.map(ow)
        }
      }
    ]
  };
  if (a && nA.params.push({
    name: "grid",
    select: "interval",
    bind: "scales"
  }), U.length <= 1 && j.length <= 1) {
    if (B !== "auto")
      if ($ === Hi && _ === Hi)
        nA.autosize = "fit", nA.width = l - 5, nA.height = Q - 5;
      else {
        const sA = $ !== Hi ? new Set(C.map((cA) => cA[$.fid])).size : 1, lA = _ !== Hi ? new Set(C.map((cA) => cA[_.fid])).size : 1;
        nA.width = Math.floor(l / lA), nA.height = Math.floor(Q / sA);
      }
    const AA = HlA({
      x: J,
      y: c,
      color: R(t),
      opacity: R(i),
      size: R(n),
      shape: R(s),
      theta: R(r),
      radius: R(g),
      text: R(I),
      row: $,
      column: _,
      xOffset: Hi,
      yOffset: Hi,
      details: o.map(R).filter((sA) => sA !== Hi),
      defaultAggregated: E,
      stack: m,
      geomType: d,
      displayOffset: G,
      dataSource: C,
      vegaConfig: w
    }), gA = y ? SlA(y, AA, C, f) : AA;
    nA.mark = gA.mark, "encoding" in gA && (nA.encoding = gA.encoding), "transform" in gA && gA.transform.length > 0 && (nA.transform = gA.transform), nA.resolve || (nA.resolve = {});
    let rA = w.resolve;
    for (let sA in rA) {
      let lA = rA[sA] ? "independent" : "shared";
      nA.resolve.scale = { ...nA.resolve.scale, [sA]: lA }, We.POSITION_CHANNEL_CONFIG_LIST.includes(sA) ? nA.resolve.axis = { ...nA.resolve.axis, [sA]: lA } : We.NON_POSITION_CHANNEL_CONFIG_LIST.includes(sA) && (nA.resolve.legend = { ...nA.resolve.legend, [sA]: lA });
    }
    return [nA];
  } else {
    if (B !== "auto")
      if ($ === Hi && _ === Hi)
        nA.width = Math.floor(l / j.length) - 5, nA.height = Math.floor(Q / U.length) - 5;
      else {
        const rA = $ !== Hi ? new Set(C.map((lA) => lA[$.fid])).size : 1, sA = _ !== Hi ? new Set(C.map((lA) => lA[_.fid])).size : 1;
        nA.width = Math.floor(l / j.length / sA), nA.height = Math.floor(Q / U.length / rA);
      }
    let AA = 0, gA = new Array(U.length * j.length);
    for (let rA = 0; rA < ZlA(U.length); rA++)
      for (let sA = 0; sA < ZlA(j.length); sA++, AA++) {
        const lA = sA === j.length - 1, cA = rA == 0, aA = HlA({
          x: j[sA] || Hi,
          y: U[rA] || Hi,
          color: R(t),
          opacity: R(i),
          size: R(n),
          shape: R(s),
          theta: R(r),
          radius: R(g),
          text: R(I),
          row: $,
          column: _,
          xOffset: Hi,
          yOffset: Hi,
          details: o,
          defaultAggregated: E,
          stack: m,
          geomType: d,
          hasLegend: lA,
          hideLegend: !cA,
          displayOffset: G,
          dataSource: C
        }), QA = y ? SlA(y, aA, C, f) : aA;
        let hA = { ...nA };
        const EA = { ...hA, ...QA };
        "params" in hA && (EA.params = hA.params), gA[AA] = EA;
      }
    return gA;
  }
}
const Zle = {
  [Ne.setConfig]: (A, e, t) => `Set the ${e} config to ${JSON.stringify(t)}.`,
  [Ne.removeField]: (A, e, t) => `Remove the ${A.encodings[e][t].name} field in ${e}.`,
  [Ne.reorderField]: () => "",
  [Ne.moveField]: (A, e, t, i) => `Move the ${A.encodings[e][t].name} field from ${e} to ${i}`,
  [Ne.cloneField]: (A, e, t, i) => `Use the ${A.encodings[e][t].name} field for ${i} encoding.`,
  [Ne.createBinlogField]: (A, e, t, i, n, o) => {
    const g = A.encodings[e][t];
    return `Create a ${i.startsWith("bin") ? `${i}${o}` : `log${o}`} field for ${g.name} field in ${e}.`;
  },
  [Ne.appendFilter]: (A, e, t, i, n) => `Create a empty filter for ${A.encodings[t][i].name} field in ${t}.`,
  [Ne.modFilter]: (A, e, t, i) => {
    const n = A.encodings[t][i];
    return `Change the filter of ${A.encodings.filters[e].name} for ${n.name}.`;
  },
  [Ne.writeFilter]: (A, e, t) => `Change the rule of ${A.encodings.filters[e].name} field to ${JSON.stringify(t)}.`,
  [Ne.setName]: (A, e) => `Change the chart name to ${e}.`,
  [Ne.applySort]: (A, e) => `Change sorting to ${e}.`,
  [Ne.transpose]: () => "Transpose the chart.",
  [Ne.setLayout]: (A, e) => {
    const t = e.find((i) => i[0] === "stack" && i[1]);
    return t ? `Change the stack to ${t[1]}.` : "";
  },
  [Ne.setFieldAggregator]: (A, e, t, i) => `Change the aggregator of ${A.encodings[e][t].name} field to ${i}.`,
  [Ne.setGeoData]: () => "",
  [Ne.setCoordSystem]: (A, e) => `Change the mark to ${We.GEOM_TYPES[e][0]}.`,
  [Ne.createDateDrillField]: () => "",
  [Ne.createDateFeatureField]: () => "",
  [Ne.changeSemanticType]: () => "",
  [Ne.setFilterAggregator]: () => "",
  [Ne.addFoldField]: () => "",
  [Ne.upsertPaintField]: () => "",
  [Ne.addSQLComputedField]: () => "",
  [Ne.removeAllField]: () => "",
  [Ne.editAllField]: () => "",
  [Ne.replaceWithNLPQuery]: () => ""
};
function Wle(A, e) {
  const [t, ...i] = e;
  return Zle[t](A, ...i);
}
function Kle(A) {
  const e = [];
  let t = A.base, i = "";
  const n = () => {
    i && (t.config.geoms[0] === "auto" && (i += `
Change the geom type to ${C3(t.encodings.rows.concat(t.encodings.columns).map((o) => o.semanticType))}.`), LR(t.config.geoms[0] ?? "auto").flatMap((o) => {
      var g;
      return ((g = t.encodings) == null ? void 0 : g[o]) ?? [];
    }).length === 0 || (e.push({ role: "user", content: i, type: "generated" }), e.push({ role: "assistant", chart: t, type: "generated" })), i = "");
  };
  for (let o = 0; o < A.cursor; o++) {
    const g = A.timeline[o];
    if (g[0] === Ne.replaceWithNLPQuery) {
      const [s, I, r] = g;
      n(), e.push({ role: "user", content: I, type: "normal" }), e.push({
        role: "assistant",
        chart: JSON.parse(r),
        type: "normal"
      });
    } else {
      const s = Wle(t, g);
      s && (i ? i += `
${s}` : i = s);
    }
    t = Ble(t, g);
  }
  return n(), e;
}
function m2A(A) {
  return [...A.dimensions, ...A.measures];
}
function p2A(A, e) {
  return LR(e).flatMap((t) => A[t] ?? []);
}
const Ule = Object.keys(y7).filter((A) => !We.META_FIELD_KEYS.includes(A));
class Vle {
  constructor(e, t) {
    ui(this, "visList"), ui(this, "visIndex", 0), ui(this, "createdVis", 0), ui(this, "editingFilterIdx", null), ui(this, "meta"), ui(this, "segmentKey", hc.vis), ui(this, "showInsightBoard", !1), ui(this, "showDataBoard", !1), ui(this, "vizEmbededMenu", { show: !1, position: [0, 0] }), ui(this, "showDataConfig", !1), ui(this, "showCodeExportPanel", !1), ui(this, "showVisualConfigPanel", !1), ui(this, "showGeoJSONConfigPanel", !1), ui(this, "removeConfirmIdx", null), ui(this, "filters", {}), ui(this, "tableCollapsedHeaderMap", /* @__PURE__ */ new Map()), ui(this, "selectedMarkObject", {}), ui(this, "showLogSettingPanel", !1), ui(this, "showBinSettingPanel", !1), ui(this, "showRenamePanel", !1), ui(this, "createField"), ui(this, "localGeoJSON"), ui(this, "showErrorResolutionPanel", 0), ui(this, "showPainterPanel", !1), ui(this, "lastErrorMessage", ""), ui(this, "showAskvizFeedbackIndex", 0), ui(this, "lastSpec", ""), ui(this, "editingComputedFieldFid"), ui(this, "defaultConfig"), ui(this, "onMetaChange"), this.meta = e, this.visList = t != null && t.empty ? [] : [p5(e, "Chart 1", t == null ? void 0 : t.defaultConfig)], this.createdVis = this.visList.length, this.defaultConfig = t == null ? void 0 : t.defaultConfig, this.onMetaChange = t == null ? void 0 : t.onMetaChange, Wge(this, {
      visList: to.shallow,
      allEncodings: fR.struct,
      filters: to.ref,
      tableCollapsedHeaderMap: to.ref
    });
  }
  get visLength() {
    return this.visList.length;
  }
  get vizList() {
    return this.visList.map((e) => e.now);
  }
  get currentVis() {
    return this.visList[this.visIndex].now;
  }
  get currentEncodings() {
    return this.currentVis.encodings;
  }
  get viewFilters() {
    return this.currentEncodings.filters;
  }
  get dimensions() {
    return this.currentEncodings.dimensions;
  }
  get measures() {
    return this.currentEncodings.measures;
  }
  get rows() {
    return this.currentEncodings.rows;
  }
  get columns() {
    return this.currentEncodings.columns;
  }
  get sort() {
    return gf({ columns: this.columns, rows: this.rows });
  }
  get sortedEncoding() {
    return _YA({ columns: this.columns, rows: this.rows });
  }
  get allFields() {
    return m2A(this);
  }
  get config() {
    return this.currentVis.config;
  }
  get layout() {
    return {
      ...this.currentVis.layout,
      ...this.localGeoJSON ? {
        geoJson: this.localGeoJSON
      } : {}
    };
  }
  get allEncodings() {
    const e = {};
    return Ule.forEach((t) => {
      e[t] = this.currentEncodings[t];
    }), e;
  }
  get viewEncodings() {
    const e = {};
    return LR(this.config.geoms[0]).forEach((t) => {
      e[t] = this.currentEncodings[t];
    }), e;
  }
  get viewEncodingFields() {
    return p2A(this.viewEncodings, this.config.geoms[0]);
  }
  get viewDimensions() {
    return this.viewEncodingFields.filter((e) => e.analyticType === "dimension");
  }
  get viewMeasures() {
    return this.viewEncodingFields.filter((e) => e.analyticType === "measure");
  }
  get workflow() {
    return Vu(this.viewFilters, this.allFields, this.viewDimensions, this.viewMeasures, this.config.defaultAggregated, this.sort, this.config.folds, this.config.limit, this.config.timezoneDisplayOffset);
  }
  get limit() {
    return this.config.limit;
  }
  get canUndo() {
    return this.visList[this.visIndex].cursor > 0;
  }
  get canRedo() {
    const e = this.visList[this.visIndex];
    return e.cursor !== e.timeline.length;
  }
  get chatMessages() {
    return Kle(this.visList[this.visIndex]);
  }
  get paintFields() {
    if (this.currentVis.config.defaultAggregated) {
      const { columns: e, rows: t, color: i, shape: n, size: o, opacity: g } = this.currentEncodings;
      if (e.length !== 1 || t.length !== 1)
        return { type: "error", key: "count" };
      const s = e[0], I = t[0];
      if (s.aggName === "expr" || I.aggName === "expr" || s.fid === Zi || s.fid === Wi || I.fid === Zi || I.fid === Wi || s.fid === ln || I.fid === ln)
        return { type: "error", key: "count" };
      const r = (a) => (a == null ? void 0 : a.fid) === ln ? void 0 : a;
      return s.analyticType === "dimension" && I.analyticType === "dimension" ? {
        type: "new",
        x: s,
        y: I
      } : {
        type: "agg",
        x: s,
        y: I,
        color: r(i[0]),
        shape: r(n[0]),
        size: r(o[0]),
        opacity: r(g[0])
      };
    } else {
      const { columns: e, rows: t } = this.currentEncodings;
      if (e.length !== 1 || t.length !== 1)
        return { type: "error", key: "count" };
      const i = e[0], n = t[0];
      return i.semanticType === "temporal" || n.semanticType === "temporal" ? { type: "error", key: "temporal" } : i.aggName === "expr" || n.aggName === "expr" || i.fid === Zi || i.fid === Wi || n.fid === Zi || n.fid === Wi || i.fid === ln || n.fid === ln ? { type: "error", key: "count" } : {
        type: "new",
        x: i,
        y: n
      };
    }
  }
  get paintInfo() {
    var e, t, i, n;
    const o = this.currentEncodings.dimensions.find((g) => g.fid === ln);
    if (o) {
      const g = (t = (e = o.expression) == null ? void 0 : e.params.find((I) => I.type === "map")) == null ? void 0 : t.value;
      if (g)
        return {
          type: "exist",
          item: TBe(g),
          new: this.paintFields
        };
      const s = (n = (i = o.expression) == null ? void 0 : i.params.find((I) => I.type === "newmap")) == null ? void 0 : n.value;
      if (s)
        return {
          type: "exist",
          item: s,
          new: this.paintFields
        };
    }
    return this.paintFields;
  }
  appendFilter(e, t, i) {
    const n = this.currentEncodings[t][i];
    n.fid === Zi || n.fid === Wi || n.fid === Hn || n.aggName === "expr" || (this.visList[this.visIndex] = oi.appendFilter(this.visList[this.visIndex], e, t, i, null), this.editingFilterIdx = e);
  }
  undo() {
    this.visList[this.visIndex] = lle(this.visList[this.visIndex]);
  }
  redo() {
    this.visList[this.visIndex] = cle(this.visList[this.visIndex]);
  }
  setVisName(e, t) {
    this.visList[e] = oi.setName(this.visList[e], t);
  }
  setMeta(e) {
    this.meta = e;
  }
  setOnMetaChange(e) {
    this.onMetaChange = e;
  }
  setDefaultConfig(e) {
    this.defaultConfig = e;
  }
  resetVisualization(e = "Chart 1") {
    this.visList = [p5(this.meta, e, this.defaultConfig)], this.createdVis = 1;
  }
  addVisualization(e) {
    const t = e ? typeof e == "function" ? e(this.createdVis + 1) : e : "Chart " + (this.createdVis + 1);
    this.visList.push(p5(this.meta, t, this.defaultConfig)), this.createdVis += 1, this.visIndex = this.visList.length - 1;
  }
  removeVisualization(e) {
    this.visLength !== 1 && (this.visIndex >= e && this.visIndex > 0 && (this.visIndex -= 1), this.visList.splice(e, 1));
  }
  duplicateVisualization(e) {
    this.visList.push(xb({
      ...this.visList[e].now,
      name: this.visList[e].now.name + " Copy",
      visId: Mr()
    })), this.createdVis += 1, this.visIndex = this.visList.length - 1;
  }
  setFilterEditing(e) {
    this.editingFilterIdx = e;
  }
  closeFilterEditing() {
    this.editingFilterIdx = null;
  }
  setSegmentKey(e) {
    this.segmentKey = e;
  }
  setVisualConfig(...e) {
    this.visList[this.visIndex] = oi.setConfig(this.visList[this.visIndex], ...e);
  }
  setCoordSystem(e) {
    this.visList[this.visIndex] = oi.setCoordSystem(this.visList[this.visIndex], e);
  }
  setVisualLayout(...e) {
    typeof e[0] == "string" ? this.visList[this.visIndex] = oi.setLayout(this.visList[this.visIndex], [e]) : this.visList[this.visIndex] = oi.setLayout(this.visList[this.visIndex], e);
  }
  reorderField(e, t, i) {
    We.META_FIELD_KEYS.includes(e) || t !== i && (this.visList[this.visIndex] = oi.reorderField(this.visList[this.visIndex], e, t, i));
  }
  moveField(e, t, i, n) {
    if (e === "filters")
      return this.removeField(e, t);
    if (i === "filters")
      return this.appendFilter(n, e, t);
    const o = this.currentEncodings[e][t], g = We.META_FIELD_KEYS.includes(e), s = We.META_FIELD_KEYS.includes(i);
    if (g && s && (o.fid === Zi || o.fid === Wi || o.fid === Hn || o.fid === ln))
      return;
    const I = We.CHANNEL_LIMIT[i] ?? 1 / 0;
    if (s === g)
      this.visList[this.visIndex] = oi.moveField(this.visList[this.visIndex], e, t, i, n, I);
    else if (s)
      this.visList[this.visIndex] = oi.removeField(this.visList[this.visIndex], e, t);
    else {
      if (o.fid === Zi || o.fid === Wi) {
        this.visList[this.visIndex] = oi.addFoldField(this.visList[this.visIndex], e, t, i, n, Mr(), I);
        return;
      }
      this.visList[this.visIndex] = oi.cloneField(this.visList[this.visIndex], e, t, i, n, Mr(), I);
    }
  }
  modFilter(e, t, i) {
    this.visList[this.visIndex] = oi.modFilter(this.visList[this.visIndex], e, t, i);
  }
  removeField(e, t) {
    We.META_FIELD_KEYS.includes(e) || (this.visList[this.visIndex] = oi.removeField(this.visList[this.visIndex], e, t));
  }
  writeFilter(e, t) {
    this.visList[this.visIndex] = oi.writeFilter(this.visList[this.visIndex], e, t);
  }
  transpose() {
    this.visList[this.visIndex] = oi.transpose(this.visList[this.visIndex]);
  }
  createBinField(e, t, i, n = 10) {
    const o = Mr(), g = this.currentEncodings, s = g.dimensions.find((I) => I.computed && I.expression && I.expression.op === i && I.expression.params[0].value === g[e][t].fid && I.expression.num === n);
    return s ? s.fid : (this.visList[this.visIndex] = oi.createBinlogField(this.visList[this.visIndex], e, t, i, o, n), o);
  }
  createLogField(e, t, i, n = 10) {
    this.visList[this.visIndex] = oi.createBinlogField(this.visList[this.visIndex], e, t, i, Mr(), n);
  }
  renameFieldInChart(e, t, i) {
    const n = this.currentEncodings[e][t];
    n && (this.visList[this.visIndex] = oi.editAllField(this.visList[this.visIndex], n.fid, { name: i }));
  }
  createDateTimeDrilledField(e, t, i, n, o, g) {
    this.visList[this.visIndex] = oi.createDateDrillField(this.visList[this.visIndex], e, t, i, Mr(), n, o, g ?? (/* @__PURE__ */ new Date()).getTimezoneOffset());
  }
  createDateFeatureField(e, t, i, n, o, g) {
    this.visList[this.visIndex] = oi.createDateFeatureField(this.visList[this.visIndex], e, t, i, Mr(), n, o, g ?? (/* @__PURE__ */ new Date()).getTimezoneOffset());
  }
  setFieldAggregator(e, t, i) {
    this.visList[this.visIndex] = oi.setFieldAggregator(this.visList[this.visIndex], e, t, i);
  }
  setFilterAggregator(e, t) {
    this.visList[this.visIndex] = oi.setFilterAggregator(this.visList[this.visIndex], e, t);
  }
  applyDefaultSort(e = "ascending") {
    this.visList[this.visIndex] = oi.applySort(this.visList[this.visIndex], e);
  }
  exportCurrentChart() {
    return RlA(this.visList[this.visIndex]);
  }
  exportAllCharts() {
    return this.visList.map((e) => RlA(e));
  }
  exportCode() {
    return this.visList.map((e) => Ele(e));
  }
  importCode(e) {
    this.visList = e.map((t) => "layout" in t ? ule(t) : xb(C2A(qYA(OYA(t))))), this.createdVis = this.visList.length, this.visIndex = 0;
  }
  appendRaw(e) {
    const t = FlA(e);
    this.visList.push(t), this.createdVis += 1, this.visIndex = this.visList.length - 1;
  }
  importRaw(e) {
    this.visList = e.map(FlA), this.createdVis = this.visList.length, this.visIndex = 0;
  }
  appendFromCode(e) {
    const t = xb(B2A(e));
    this.visList.push(t), this.createdVis += 1, this.visIndex = this.visList.length - 1;
  }
  setAskvizFeedback(e) {
    this.showAskvizFeedbackIndex = e ? this.visIndex : void 0;
  }
  replaceNow(e) {
    this.visList[this.visIndex] = xb(e);
  }
  selectVisualization(e) {
    this.visIndex = e;
  }
  setShowDataConfig(e) {
    this.showDataConfig = e;
  }
  setShowInsightBoard(e) {
    this.showInsightBoard = e;
  }
  setShowDataBoard(e) {
    this.showDataBoard = e;
  }
  showEmbededMenu(e) {
    this.vizEmbededMenu.show = !0, this.vizEmbededMenu.position = e;
  }
  setShowCodeExportPanel(e) {
    this.showCodeExportPanel = e;
  }
  setShowVisualConfigPanel(e) {
    this.showVisualConfigPanel = e;
  }
  closeEmbededMenu() {
    this.vizEmbededMenu.show = !1;
  }
  setFilters(e) {
    this.filters = e;
  }
  updateCurrentDatasetMetas(e, t) {
    var i;
    const n = this.meta.find((o) => o.fid === e);
    if (n)
      for (let o in t)
        n[o] = t[o];
    (i = this.onMetaChange) == null || i.call(this, e, t);
  }
  openRemoveConfirmModal(e) {
    this.removeConfirmIdx = e;
  }
  closeRemoveConfirmModal() {
    this.removeConfirmIdx = null;
  }
  setGeographicData(e, t, i) {
    const n = e.type === "GeoJSON" ? e.data : r3(e.data, e.objectKey || Object.keys(e.data.objects)[0]);
    if (!("features" in n)) {
      console.error("Invalid GeoJSON: GeoJSON must be a FeatureCollection, but got", n);
      return;
    }
    this.localGeoJSON = n, i ? this.visList[this.visIndex] = oi.setGeoData(this.visList[this.visIndex], void 0, t, i) : this.visList[this.visIndex] = oi.setGeoData(this.visList[this.visIndex], n, t, void 0);
  }
  clearGeographicData() {
    this.visList[this.visIndex] = oi.setGeoData(this.visList[this.visIndex], void 0, void 0, void 0);
  }
  changeSemanticType(e, t, i) {
    this.visList[this.visIndex] = oi.changeSemanticType(this.visList[this.visIndex], e, t, i);
  }
  updatePaint(e, t) {
    this.visList[this.visIndex] = oi.upsertPaintField(this.visList[this.visIndex], e, t);
  }
  updateGeoKey(e) {
    this.setVisualLayout("geoKey", e);
  }
  updateTableCollapsedHeader(e) {
    const { uniqueKey: t, height: i } = e;
    if (i < 1)
      return;
    const n = new Map(this.tableCollapsedHeaderMap);
    n.forEach((o, g) => {
      g.startsWith(t) && g.length > t.length && n.delete(g);
    }), n.has(t) ? n.delete(t) : n.set(t, e.path), this.tableCollapsedHeaderMap = n;
  }
  resetTableCollapsedHeader() {
    const e = /* @__PURE__ */ new Map();
    this.tableCollapsedHeaderMap = e;
  }
  setShowGeoJSONConfigPanel(e) {
    this.showGeoJSONConfigPanel = e;
  }
  setShowBinSettingPanel(e) {
    this.showBinSettingPanel = e;
  }
  setShowLogSettingPanel(e) {
    this.showLogSettingPanel = e;
  }
  setShowRenamePanel(e) {
    this.showRenamePanel = e;
  }
  setCreateField(e) {
    this.createField = e;
  }
  updateSelectedMarkObject(e) {
    this.selectedMarkObject = e;
  }
  updateShowErrorResolutionPanel(e, t = "") {
    this.showErrorResolutionPanel = e, this.lastErrorMessage = t;
  }
  setShowPainter(e) {
    this.showPainterPanel = e;
  }
  updateLastSpec(e) {
    this.lastSpec = e;
  }
  setComputedFieldFid(e) {
    this.editingComputedFieldFid = e;
  }
  upsertComputedField(e, t, i) {
    if (e === "")
      this.visList[this.visIndex] = oi.addSQLComputedField(this.visList[this.visIndex], Mr(), t, i);
    else {
      const n = this.allFields.find((a) => a.fid === e);
      if (!n)
        return;
      const [o, g] = o2A(I3(i), this.allFields), s = o === "quantitative" ? "measure" : "dimension", I = g ? "expr" : s === "dimension" ? void 0 : "sum", r = n.aggName === "expr" ? "expr" : n.aggName === void 0 ? void 0 : "sum";
      this.visList[this.visIndex] = oi.editAllField(this.visList[this.visIndex], e, {
        name: t,
        analyticType: s,
        semanticType: o,
        ...r !== I ? { aggName: I } : {},
        expression: { as: e, op: "expr", params: [{ type: "sql", value: i }] }
      });
    }
  }
  removeComputedField(e, t) {
    const i = this.currentEncodings[e][t];
    i.computed && (this.visList[this.visIndex] = oi.removeAllField(this.visList[this.visIndex], i.fid));
  }
  replaceWithNLPQuery(e, t) {
    this.visList[this.visIndex] = oi.replaceWithNLPQuery(this.visList[this.visIndex], e, t);
  }
}
function y2A(A, e, t, i) {
  var n, o, g;
  const s = a3(e, t, i), I = s.encodings.dimensions.concat(s.encodings.measures);
  if (s.config.defaultAggregated = !!A.aggregate, (((n = A.geomType) == null ? void 0 : n.length) ?? 0) > 0 && (s.config.geoms = ((o = A.geomType) == null ? void 0 : o.map((r) => Xle(r))) ?? ["tick"]), (((g = A.facets) == null ? void 0 : g.length) ?? 0) > 0) {
    const r = (A.facets || []).concat(A.highFacets || []);
    for (let a of r) {
      const C = I.find((B) => B.fid === a);
      C && (s.encodings.rows = s.encodings.rows.concat([C]));
    }
  }
  if (A.position) {
    const [r, a] = A.position;
    if (r) {
      const C = I.find((B) => B.fid === r);
      C && (s.encodings.columns = s.encodings.columns.concat([C]));
    }
    if (a) {
      const C = I.find((B) => B.fid === a);
      C && (s.encodings.rows = s.encodings.rows.concat([C]));
    }
  }
  if (A.color && A.color.length > 0) {
    const r = A.color[0], a = I.find((C) => C.fid === r);
    a && (s.encodings.color = s.encodings.color.concat([a]));
  }
  if (A.size && A.size.length > 0) {
    const r = A.size[0], a = I.find((C) => C.fid === r);
    a && (s.encodings.size = s.encodings.size.concat([a]));
  }
  if (A.opacity && A.opacity.length > 0) {
    const r = A.opacity[0], a = I.find((C) => C.fid === r);
    a && (s.encodings.opacity = s.encodings.opacity.concat([a]));
  }
  return s;
}
function Xle(A) {
  switch (A) {
    case "interval":
    case "bar":
      return "bar";
    case "line":
      return "line";
    case "boxplot":
      return "boxplot";
    case "area":
      return "area";
    case "point":
      return "point";
    case "arc":
      return "arc";
    case "circle":
      return "circle";
    case "heatmap":
      return "circle";
    case "rect":
      return "rect";
    case "tick":
    default:
      return "tick";
  }
}
function zle(A) {
  const e = {};
  return (t, ...i) => t ? (e[t] || (e[t] = A(...i)), e[t]) : A(...i);
}
const Tle = zle((A, e) => new Vle(A, e)), b2A = b.createContext(null), _le = () => {
}, M7 = (A) => {
  const e = A.keepAlive ? `${A.keepAlive}` : "", t = u.useMemo(() => Tle(e, A.meta, { onMetaChange: A.onMetaChange, defaultConfig: A.defaultConfig }), [e]), i = u.useRef(A.meta);
  u.useEffect(() => {
    i.current !== A.meta && (t.setMeta(A.meta), i.current = A.meta);
  }, [A.meta, t]);
  const n = u.useRef(A.onMetaChange);
  u.useEffect(() => {
    n.current !== A.onMetaChange && (t.setOnMetaChange(A.onMetaChange), n.current = A.onMetaChange);
  }, [A.meta, t]);
  const o = u.useRef(A.defaultConfig);
  return u.useEffect(() => {
    o.current !== A.defaultConfig && (t.setDefaultConfig(A.defaultConfig), o.current = A.defaultConfig);
  }, [A.defaultConfig, t]), u.useEffect(() => {
    if (A.storeRef) {
      const g = A.storeRef;
      return g.current = t, () => {
        g.current = null;
      };
    }
    return _le;
  }, [A.storeRef, t]), b.createElement(b2A.Provider, { value: t }, A.children);
};
function xt() {
  return u.useContext(b2A);
}
const vR = u.createContext(async () => []);
function sg() {
  return u.useContext(vR);
}
function x7(A, e) {
  return (...t) => Promise.race([
    A(...t),
    new Promise((i, n) => {
      setTimeout(() => n(new Error("timeout")), e);
    })
  ]);
}
function L7(A, e) {
  return (...t) => A(...t).catch((i) => {
    throw e(i), i;
  });
}
function w2A(A) {
  var e, t, i = "";
  if (typeof A == "string" || typeof A == "number")
    i += A;
  else if (typeof A == "object")
    if (Array.isArray(A))
      for (e = 0; e < A.length; e++)
        A[e] && (t = w2A(A[e])) && (i && (i += " "), i += t);
    else
      for (e in A)
        A[e] && (i && (i += " "), i += e);
  return i;
}
function qle() {
  for (var A, e, t = 0, i = ""; t < arguments.length; )
    (A = arguments[t++]) && (e = w2A(A)) && (i && (i += " "), i += e);
  return i;
}
const WlA = (A) => typeof A == "boolean" ? "".concat(A) : A === 0 ? "0" : A, KlA = qle, B3 = (A, e) => (t) => {
  var i;
  if ((e == null ? void 0 : e.variants) == null)
    return KlA(A, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
  const { variants: n, defaultVariants: o } = e, g = Object.keys(n).map((r) => {
    const a = t == null ? void 0 : t[r], C = o == null ? void 0 : o[r];
    if (a === null)
      return null;
    const B = WlA(a) || WlA(C);
    return n[r][B];
  }), s = t && Object.entries(t).reduce((r, a) => {
    let [C, B] = a;
    return B === void 0 || (r[C] = B), r;
  }, {}), I = e == null || (i = e.compoundVariants) === null || i === void 0 ? void 0 : i.reduce((r, a) => {
    let { class: C, className: B, ...l } = a;
    return Object.entries(l).every((Q) => {
      let [E, d] = Q;
      return Array.isArray(d) ? d.includes({
        ...o,
        ...s
      }[E]) : {
        ...o,
        ...s
      }[E] === d;
    }) ? [
      ...r,
      C,
      B
    ] : r;
  }, []);
  return KlA(A, g, I, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
}, HR = B3("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", {
  variants: {
    variant: {
      default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
      destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
      outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
      secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
      ghost: "hover:bg-accent hover:text-accent-foreground",
      link: "text-primary underline-offset-4 hover:underline",
      toggle: "hover:bg-muted hover:text-muted-foreground",
      none: ""
    },
    size: {
      default: "h-9 px-4 py-2",
      sm: "h-8 rounded-md px-3 text-xs",
      lg: "h-10 rounded-md px-8",
      icon: "h-9 w-9",
      "icon-sm": "h-6 w-6 p-1",
      "icon-xs": "h-4 w-4",
      none: "",
      toolbar: "h-8 w-8"
    }
  },
  defaultVariants: {
    variant: "default",
    size: "default"
  }
}), Re = u.forwardRef(({ className: A, variant: e, size: t, asChild: i = !1, ...n }, o) => {
  const g = i ? rQ : "button";
  return u.createElement(g, { className: me(HR({ variant: e, size: t, className: A })), ref: o, ...n });
});
Re.displayName = "Button";
function Ole(A, e = globalThis == null ? void 0 : globalThis.document) {
  const t = Pa(A);
  u.useEffect(() => {
    const i = (n) => {
      n.key === "Escape" && t(n);
    };
    return e.addEventListener("keydown", i), () => e.removeEventListener("keydown", i);
  }, [
    t,
    e
  ]);
}
const Tq = "dismissableLayer.update", jle = "dismissableLayer.pointerDownOutside", Ple = "dismissableLayer.focusOutside";
let UlA;
const $le = /* @__PURE__ */ u.createContext({
  layers: /* @__PURE__ */ new Set(),
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
  branches: /* @__PURE__ */ new Set()
}), JD = /* @__PURE__ */ u.forwardRef((A, e) => {
  var t;
  const { disableOutsidePointerEvents: i = !1, onEscapeKeyDown: n, onPointerDownOutside: o, onFocusOutside: g, onInteractOutside: s, onDismiss: I, ...r } = A, a = u.useContext($le), [C, B] = u.useState(null), l = (t = C == null ? void 0 : C.ownerDocument) !== null && t !== void 0 ? t : globalThis == null ? void 0 : globalThis.document, [, Q] = u.useState({}), E = Dt(
    e,
    (Z) => B(Z)
  ), d = Array.from(a.layers), [m] = [
    ...a.layersWithOutsidePointerEventsDisabled
  ].slice(-1), y = d.indexOf(m), f = C ? d.indexOf(C) : -1, w = a.layersWithOutsidePointerEventsDisabled.size > 0, G = f >= y, R = Ace((Z) => {
    const c = Z.target, J = [
      ...a.branches
    ].some(
      (p) => p.contains(c)
    );
    !G || J || (o == null || o(Z), s == null || s(Z), Z.defaultPrevented || I == null || I());
  }, l), F = ece((Z) => {
    const c = Z.target;
    [
      ...a.branches
    ].some(
      (J) => J.contains(c)
    ) || (g == null || g(Z), s == null || s(Z), Z.defaultPrevented || I == null || I());
  }, l);
  return Ole((Z) => {
    f === a.layers.size - 1 && (n == null || n(Z), !Z.defaultPrevented && I && (Z.preventDefault(), I()));
  }, l), u.useEffect(() => {
    if (C)
      return i && (a.layersWithOutsidePointerEventsDisabled.size === 0 && (UlA = l.body.style.pointerEvents, l.body.style.pointerEvents = "none"), a.layersWithOutsidePointerEventsDisabled.add(C)), a.layers.add(C), VlA(), () => {
        i && a.layersWithOutsidePointerEventsDisabled.size === 1 && (l.body.style.pointerEvents = UlA);
      };
  }, [
    C,
    l,
    i,
    a
  ]), u.useEffect(() => () => {
    C && (a.layers.delete(C), a.layersWithOutsidePointerEventsDisabled.delete(C), VlA());
  }, [
    C,
    a
  ]), u.useEffect(() => {
    const Z = () => Q({});
    return document.addEventListener(Tq, Z), () => document.removeEventListener(Tq, Z);
  }, []), /* @__PURE__ */ u.createElement(ze.div, NA({}, r, {
    ref: E,
    style: {
      pointerEvents: w ? G ? "auto" : "none" : void 0,
      ...A.style
    },
    onFocusCapture: ge(A.onFocusCapture, F.onFocusCapture),
    onBlurCapture: ge(A.onBlurCapture, F.onBlurCapture),
    onPointerDownCapture: ge(A.onPointerDownCapture, R.onPointerDownCapture)
  }));
});
function Ace(A, e = globalThis == null ? void 0 : globalThis.document) {
  const t = Pa(A), i = u.useRef(!1), n = u.useRef(() => {
  });
  return u.useEffect(() => {
    const o = (s) => {
      if (s.target && !i.current) {
        let I = function() {
          f2A(jle, t, r, {
            discrete: !0
          });
        };
        const r = {
          originalEvent: s
        };
        s.pointerType === "touch" ? (e.removeEventListener("click", n.current), n.current = I, e.addEventListener("click", n.current, {
          once: !0
        })) : I();
      } else
        e.removeEventListener("click", n.current);
      i.current = !1;
    }, g = window.setTimeout(() => {
      e.addEventListener("pointerdown", o);
    }, 0);
    return () => {
      window.clearTimeout(g), e.removeEventListener("pointerdown", o), e.removeEventListener("click", n.current);
    };
  }, [
    e,
    t
  ]), {
    // ensures we check React component tree (not just DOM tree)
    onPointerDownCapture: () => i.current = !0
  };
}
function ece(A, e = globalThis == null ? void 0 : globalThis.document) {
  const t = Pa(A), i = u.useRef(!1);
  return u.useEffect(() => {
    const n = (o) => {
      o.target && !i.current && f2A(Ple, t, {
        originalEvent: o
      }, {
        discrete: !1
      });
    };
    return e.addEventListener("focusin", n), () => e.removeEventListener("focusin", n);
  }, [
    e,
    t
  ]), {
    onFocusCapture: () => i.current = !0,
    onBlurCapture: () => i.current = !1
  };
}
function VlA() {
  const A = new CustomEvent(Tq);
  document.dispatchEvent(A);
}
function f2A(A, e, t, { discrete: i }) {
  const n = t.originalEvent.target, o = new CustomEvent(A, {
    bubbles: !1,
    cancelable: !0,
    detail: t
  });
  e && n.addEventListener(A, e, {
    once: !0
  }), i ? GYA(n, o) : n.dispatchEvent(o);
}
let y5 = 0;
function l3() {
  u.useEffect(() => {
    var A, e;
    const t = document.querySelectorAll("[data-radix-focus-guard]");
    return document.body.insertAdjacentElement("afterbegin", (A = t[0]) !== null && A !== void 0 ? A : XlA()), document.body.insertAdjacentElement("beforeend", (e = t[1]) !== null && e !== void 0 ? e : XlA()), y5++, () => {
      y5 === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach(
        (i) => i.remove()
      ), y5--;
    };
  }, []);
}
function XlA() {
  const A = document.createElement("span");
  return A.setAttribute("data-radix-focus-guard", ""), A.tabIndex = 0, A.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", A;
}
const b5 = "focusScope.autoFocusOnMount", w5 = "focusScope.autoFocusOnUnmount", zlA = {
  bubbles: !1,
  cancelable: !0
}, c3 = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { loop: t = !1, trapped: i = !1, onMountAutoFocus: n, onUnmountAutoFocus: o, ...g } = A, [s, I] = u.useState(null), r = Pa(n), a = Pa(o), C = u.useRef(null), B = Dt(
    e,
    (E) => I(E)
  ), l = u.useRef({
    paused: !1,
    pause() {
      this.paused = !0;
    },
    resume() {
      this.paused = !1;
    }
  }).current;
  u.useEffect(() => {
    if (i) {
      let E = function(f) {
        if (l.paused || !s)
          return;
        const w = f.target;
        s.contains(w) ? C.current = w : bE(C.current, {
          select: !0
        });
      }, d = function(f) {
        if (l.paused || !s)
          return;
        const w = f.relatedTarget;
        w !== null && (s.contains(w) || bE(C.current, {
          select: !0
        }));
      }, m = function(f) {
        if (document.activeElement === document.body)
          for (const w of f)
            w.removedNodes.length > 0 && bE(s);
      };
      document.addEventListener("focusin", E), document.addEventListener("focusout", d);
      const y = new MutationObserver(m);
      return s && y.observe(s, {
        childList: !0,
        subtree: !0
      }), () => {
        document.removeEventListener("focusin", E), document.removeEventListener("focusout", d), y.disconnect();
      };
    }
  }, [
    i,
    s,
    l.paused
  ]), u.useEffect(() => {
    if (s) {
      _lA.add(l);
      const E = document.activeElement;
      if (!s.contains(E)) {
        const d = new CustomEvent(b5, zlA);
        s.addEventListener(b5, r), s.dispatchEvent(d), d.defaultPrevented || (tce(sce(D2A(s)), {
          select: !0
        }), document.activeElement === E && bE(s));
      }
      return () => {
        s.removeEventListener(b5, r), setTimeout(() => {
          const d = new CustomEvent(w5, zlA);
          s.addEventListener(w5, a), s.dispatchEvent(d), d.defaultPrevented || bE(E ?? document.body, {
            select: !0
          }), s.removeEventListener(w5, a), _lA.remove(l);
        }, 0);
      };
    }
  }, [
    s,
    r,
    a,
    l
  ]);
  const Q = u.useCallback((E) => {
    if (!t && !i || l.paused)
      return;
    const d = E.key === "Tab" && !E.altKey && !E.ctrlKey && !E.metaKey, m = document.activeElement;
    if (d && m) {
      const y = E.currentTarget, [f, w] = ice(y);
      f && w ? !E.shiftKey && m === w ? (E.preventDefault(), t && bE(f, {
        select: !0
      })) : E.shiftKey && m === f && (E.preventDefault(), t && bE(w, {
        select: !0
      })) : m === y && E.preventDefault();
    }
  }, [
    t,
    i,
    l.paused
  ]);
  return /* @__PURE__ */ u.createElement(ze.div, NA({
    tabIndex: -1
  }, g, {
    ref: B,
    onKeyDown: Q
  }));
});
function tce(A, { select: e = !1 } = {}) {
  const t = document.activeElement;
  for (const i of A)
    if (bE(i, {
      select: e
    }), document.activeElement !== t)
      return;
}
function ice(A) {
  const e = D2A(A), t = TlA(e, A), i = TlA(e.reverse(), A);
  return [
    t,
    i
  ];
}
function D2A(A) {
  const e = [], t = document.createTreeWalker(A, NodeFilter.SHOW_ELEMENT, {
    acceptNode: (i) => {
      const n = i.tagName === "INPUT" && i.type === "hidden";
      return i.disabled || i.hidden || n ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
    }
  });
  for (; t.nextNode(); )
    e.push(t.currentNode);
  return e;
}
function TlA(A, e) {
  for (const t of A)
    if (!nce(t, {
      upTo: e
    }))
      return t;
}
function nce(A, { upTo: e }) {
  if (getComputedStyle(A).visibility === "hidden")
    return !0;
  for (; A; ) {
    if (e !== void 0 && A === e)
      return !1;
    if (getComputedStyle(A).display === "none")
      return !0;
    A = A.parentElement;
  }
  return !1;
}
function oce(A) {
  return A instanceof HTMLInputElement && "select" in A;
}
function bE(A, { select: e = !1 } = {}) {
  if (A && A.focus) {
    const t = document.activeElement;
    A.focus({
      preventScroll: !0
    }), A !== t && oce(A) && e && A.select();
  }
}
const _lA = gce();
function gce() {
  let A = [];
  return {
    add(e) {
      const t = A[0];
      e !== t && (t == null || t.pause()), A = qlA(A, e), A.unshift(e);
    },
    remove(e) {
      var t;
      A = qlA(A, e), (t = A[0]) === null || t === void 0 || t.resume();
    }
  };
}
function qlA(A, e) {
  const t = [
    ...A
  ], i = t.indexOf(e);
  return i !== -1 && t.splice(i, 1), t;
}
function sce(A) {
  return A.filter(
    (e) => e.tagName !== "A"
  );
}
const Ice = y8["useId".toString()] || (() => {
});
let ace = 0;
function za(A) {
  const [e, t] = u.useState(Ice());
  return rs(() => {
    A || t(
      (i) => i ?? String(ace++)
    );
  }, [
    A
  ]), A || (e ? `radix-${e}` : "");
}
const rce = ["top", "right", "bottom", "left"], Xu = Math.min, DI = Math.max, ZH = Math.round, kM = Math.floor, zu = (A) => ({
  x: A,
  y: A
}), Cce = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
}, Bce = {
  start: "end",
  end: "start"
};
function _q(A, e, t) {
  return DI(A, Xu(e, t));
}
function BQ(A, e) {
  return typeof A == "function" ? A(e) : A;
}
function lQ(A) {
  return A.split("-")[0];
}
function ND(A) {
  return A.split("-")[1];
}
function v7(A) {
  return A === "x" ? "y" : "x";
}
function H7(A) {
  return A === "y" ? "height" : "width";
}
function YD(A) {
  return ["top", "bottom"].includes(lQ(A)) ? "y" : "x";
}
function S7(A) {
  return v7(YD(A));
}
function lce(A, e, t) {
  t === void 0 && (t = !1);
  const i = ND(A), n = S7(A), o = H7(n);
  let g = n === "x" ? i === (t ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
  return e.reference[o] > e.floating[o] && (g = WH(g)), [g, WH(g)];
}
function cce(A) {
  const e = WH(A);
  return [qq(A), e, qq(e)];
}
function qq(A) {
  return A.replace(/start|end/g, (e) => Bce[e]);
}
function Qce(A, e, t) {
  const i = ["left", "right"], n = ["right", "left"], o = ["top", "bottom"], g = ["bottom", "top"];
  switch (A) {
    case "top":
    case "bottom":
      return t ? e ? n : i : e ? i : n;
    case "left":
    case "right":
      return e ? o : g;
    default:
      return [];
  }
}
function Ece(A, e, t, i) {
  const n = ND(A);
  let o = Qce(lQ(A), t === "start", i);
  return n && (o = o.map((g) => g + "-" + n), e && (o = o.concat(o.map(qq)))), o;
}
function WH(A) {
  return A.replace(/left|right|bottom|top/g, (e) => Cce[e]);
}
function uce(A) {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0,
    ...A
  };
}
function G2A(A) {
  return typeof A != "number" ? uce(A) : {
    top: A,
    right: A,
    bottom: A,
    left: A
  };
}
function KH(A) {
  return {
    ...A,
    top: A.y,
    left: A.x,
    right: A.x + A.width,
    bottom: A.y + A.height
  };
}
function OlA(A, e, t) {
  let {
    reference: i,
    floating: n
  } = A;
  const o = YD(e), g = S7(e), s = H7(g), I = lQ(e), r = o === "y", a = i.x + i.width / 2 - n.width / 2, C = i.y + i.height / 2 - n.height / 2, B = i[s] / 2 - n[s] / 2;
  let l;
  switch (I) {
    case "top":
      l = {
        x: a,
        y: i.y - n.height
      };
      break;
    case "bottom":
      l = {
        x: a,
        y: i.y + i.height
      };
      break;
    case "right":
      l = {
        x: i.x + i.width,
        y: C
      };
      break;
    case "left":
      l = {
        x: i.x - n.width,
        y: C
      };
      break;
    default:
      l = {
        x: i.x,
        y: i.y
      };
  }
  switch (ND(e)) {
    case "start":
      l[g] -= B * (t && r ? -1 : 1);
      break;
    case "end":
      l[g] += B * (t && r ? -1 : 1);
      break;
  }
  return l;
}
const dce = async (A, e, t) => {
  const {
    placement: i = "bottom",
    strategy: n = "absolute",
    middleware: o = [],
    platform: g
  } = t, s = o.filter(Boolean), I = await (g.isRTL == null ? void 0 : g.isRTL(e));
  let r = await g.getElementRects({
    reference: A,
    floating: e,
    strategy: n
  }), {
    x: a,
    y: C
  } = OlA(r, i, I), B = i, l = {}, Q = 0;
  for (let E = 0; E < s.length; E++) {
    const {
      name: d,
      fn: m
    } = s[E], {
      x: y,
      y: f,
      data: w,
      reset: G
    } = await m({
      x: a,
      y: C,
      initialPlacement: i,
      placement: B,
      strategy: n,
      middlewareData: l,
      rects: r,
      platform: g,
      elements: {
        reference: A,
        floating: e
      }
    });
    a = y ?? a, C = f ?? C, l = {
      ...l,
      [d]: {
        ...l[d],
        ...w
      }
    }, G && Q <= 50 && (Q++, typeof G == "object" && (G.placement && (B = G.placement), G.rects && (r = G.rects === !0 ? await g.getElementRects({
      reference: A,
      floating: e,
      strategy: n
    }) : G.rects), {
      x: a,
      y: C
    } = OlA(r, B, I)), E = -1);
  }
  return {
    x: a,
    y: C,
    placement: B,
    strategy: n,
    middlewareData: l
  };
};
async function RY(A, e) {
  var t;
  e === void 0 && (e = {});
  const {
    x: i,
    y: n,
    platform: o,
    rects: g,
    elements: s,
    strategy: I
  } = A, {
    boundary: r = "clippingAncestors",
    rootBoundary: a = "viewport",
    elementContext: C = "floating",
    altBoundary: B = !1,
    padding: l = 0
  } = BQ(e, A), Q = G2A(l), E = s[B ? C === "floating" ? "reference" : "floating" : C], d = KH(await o.getClippingRect({
    element: (t = await (o.isElement == null ? void 0 : o.isElement(E))) == null || t ? E : E.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(s.floating)),
    boundary: r,
    rootBoundary: a,
    strategy: I
  })), m = C === "floating" ? {
    ...g.floating,
    x: i,
    y: n
  } : g.reference, y = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(s.floating)), f = await (o.isElement == null ? void 0 : o.isElement(y)) ? await (o.getScale == null ? void 0 : o.getScale(y)) || {
    x: 1,
    y: 1
  } : {
    x: 1,
    y: 1
  }, w = KH(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
    elements: s,
    rect: m,
    offsetParent: y,
    strategy: I
  }) : m);
  return {
    top: (d.top - w.top + Q.top) / f.y,
    bottom: (w.bottom - d.bottom + Q.bottom) / f.y,
    left: (d.left - w.left + Q.left) / f.x,
    right: (w.right - d.right + Q.right) / f.x
  };
}
const hce = (A) => ({
  name: "arrow",
  options: A,
  async fn(e) {
    const {
      x: t,
      y: i,
      placement: n,
      rects: o,
      platform: g,
      elements: s,
      middlewareData: I
    } = e, {
      element: r,
      padding: a = 0
    } = BQ(A, e) || {};
    if (r == null)
      return {};
    const C = G2A(a), B = {
      x: t,
      y: i
    }, l = S7(n), Q = H7(l), E = await g.getDimensions(r), d = l === "y", m = d ? "top" : "left", y = d ? "bottom" : "right", f = d ? "clientHeight" : "clientWidth", w = o.reference[Q] + o.reference[l] - B[l] - o.floating[Q], G = B[l] - o.reference[l], R = await (g.getOffsetParent == null ? void 0 : g.getOffsetParent(r));
    let F = R ? R[f] : 0;
    (!F || !await (g.isElement == null ? void 0 : g.isElement(R))) && (F = s.floating[f] || o.floating[Q]);
    const Z = w / 2 - G / 2, c = F / 2 - E[Q] / 2 - 1, J = Xu(C[m], c), p = Xu(C[y], c), N = J, v = F - E[Q] - p, K = F / 2 - E[Q] / 2 + Z, U = _q(N, K, v), j = !I.arrow && ND(n) != null && K !== U && o.reference[Q] / 2 - (K < N ? J : p) - E[Q] / 2 < 0, q = j ? K < N ? K - N : K - v : 0;
    return {
      [l]: B[l] + q,
      data: {
        [l]: U,
        centerOffset: K - U - q,
        ...j && {
          alignmentOffset: q
        }
      },
      reset: j
    };
  }
}), mce = function(A) {
  return A === void 0 && (A = {}), {
    name: "flip",
    options: A,
    async fn(e) {
      var t, i;
      const {
        placement: n,
        middlewareData: o,
        rects: g,
        initialPlacement: s,
        platform: I,
        elements: r
      } = e, {
        mainAxis: a = !0,
        crossAxis: C = !0,
        fallbackPlacements: B,
        fallbackStrategy: l = "bestFit",
        fallbackAxisSideDirection: Q = "none",
        flipAlignment: E = !0,
        ...d
      } = BQ(A, e);
      if ((t = o.arrow) != null && t.alignmentOffset)
        return {};
      const m = lQ(n), y = lQ(s) === s, f = await (I.isRTL == null ? void 0 : I.isRTL(r.floating)), w = B || (y || !E ? [WH(s)] : cce(s));
      !B && Q !== "none" && w.push(...Ece(s, E, Q, f));
      const G = [s, ...w], R = await RY(e, d), F = [];
      let Z = ((i = o.flip) == null ? void 0 : i.overflows) || [];
      if (a && F.push(R[m]), C) {
        const N = lce(n, g, f);
        F.push(R[N[0]], R[N[1]]);
      }
      if (Z = [...Z, {
        placement: n,
        overflows: F
      }], !F.every((N) => N <= 0)) {
        var c, J;
        const N = (((c = o.flip) == null ? void 0 : c.index) || 0) + 1, v = G[N];
        if (v)
          return {
            data: {
              index: N,
              overflows: Z
            },
            reset: {
              placement: v
            }
          };
        let K = (J = Z.filter((U) => U.overflows[0] <= 0).sort((U, j) => U.overflows[1] - j.overflows[1])[0]) == null ? void 0 : J.placement;
        if (!K)
          switch (l) {
            case "bestFit": {
              var p;
              const U = (p = Z.map((j) => [j.placement, j.overflows.filter((q) => q > 0).reduce((q, O) => q + O, 0)]).sort((j, q) => j[1] - q[1])[0]) == null ? void 0 : p[0];
              U && (K = U);
              break;
            }
            case "initialPlacement":
              K = s;
              break;
          }
        if (n !== K)
          return {
            reset: {
              placement: K
            }
          };
      }
      return {};
    }
  };
};
function jlA(A, e) {
  return {
    top: A.top - e.height,
    right: A.right - e.width,
    bottom: A.bottom - e.height,
    left: A.left - e.width
  };
}
function PlA(A) {
  return rce.some((e) => A[e] >= 0);
}
const pce = function(A) {
  return A === void 0 && (A = {}), {
    name: "hide",
    options: A,
    async fn(e) {
      const {
        rects: t
      } = e, {
        strategy: i = "referenceHidden",
        ...n
      } = BQ(A, e);
      switch (i) {
        case "referenceHidden": {
          const o = await RY(e, {
            ...n,
            elementContext: "reference"
          }), g = jlA(o, t.reference);
          return {
            data: {
              referenceHiddenOffsets: g,
              referenceHidden: PlA(g)
            }
          };
        }
        case "escaped": {
          const o = await RY(e, {
            ...n,
            altBoundary: !0
          }), g = jlA(o, t.floating);
          return {
            data: {
              escapedOffsets: g,
              escaped: PlA(g)
            }
          };
        }
        default:
          return {};
      }
    }
  };
};
async function yce(A, e) {
  const {
    placement: t,
    platform: i,
    elements: n
  } = A, o = await (i.isRTL == null ? void 0 : i.isRTL(n.floating)), g = lQ(t), s = ND(t), I = YD(t) === "y", r = ["left", "top"].includes(g) ? -1 : 1, a = o && I ? -1 : 1, C = BQ(e, A);
  let {
    mainAxis: B,
    crossAxis: l,
    alignmentAxis: Q
  } = typeof C == "number" ? {
    mainAxis: C,
    crossAxis: 0,
    alignmentAxis: null
  } : {
    mainAxis: 0,
    crossAxis: 0,
    alignmentAxis: null,
    ...C
  };
  return s && typeof Q == "number" && (l = s === "end" ? Q * -1 : Q), I ? {
    x: l * a,
    y: B * r
  } : {
    x: B * r,
    y: l * a
  };
}
const bce = function(A) {
  return A === void 0 && (A = 0), {
    name: "offset",
    options: A,
    async fn(e) {
      var t, i;
      const {
        x: n,
        y: o,
        placement: g,
        middlewareData: s
      } = e, I = await yce(e, A);
      return g === ((t = s.offset) == null ? void 0 : t.placement) && (i = s.arrow) != null && i.alignmentOffset ? {} : {
        x: n + I.x,
        y: o + I.y,
        data: {
          ...I,
          placement: g
        }
      };
    }
  };
}, wce = function(A) {
  return A === void 0 && (A = {}), {
    name: "shift",
    options: A,
    async fn(e) {
      const {
        x: t,
        y: i,
        placement: n
      } = e, {
        mainAxis: o = !0,
        crossAxis: g = !1,
        limiter: s = {
          fn: (d) => {
            let {
              x: m,
              y
            } = d;
            return {
              x: m,
              y
            };
          }
        },
        ...I
      } = BQ(A, e), r = {
        x: t,
        y: i
      }, a = await RY(e, I), C = YD(lQ(n)), B = v7(C);
      let l = r[B], Q = r[C];
      if (o) {
        const d = B === "y" ? "top" : "left", m = B === "y" ? "bottom" : "right", y = l + a[d], f = l - a[m];
        l = _q(y, l, f);
      }
      if (g) {
        const d = C === "y" ? "top" : "left", m = C === "y" ? "bottom" : "right", y = Q + a[d], f = Q - a[m];
        Q = _q(y, Q, f);
      }
      const E = s.fn({
        ...e,
        [B]: l,
        [C]: Q
      });
      return {
        ...E,
        data: {
          x: E.x - t,
          y: E.y - i
        }
      };
    }
  };
}, fce = function(A) {
  return A === void 0 && (A = {}), {
    options: A,
    fn(e) {
      const {
        x: t,
        y: i,
        placement: n,
        rects: o,
        middlewareData: g
      } = e, {
        offset: s = 0,
        mainAxis: I = !0,
        crossAxis: r = !0
      } = BQ(A, e), a = {
        x: t,
        y: i
      }, C = YD(n), B = v7(C);
      let l = a[B], Q = a[C];
      const E = BQ(s, e), d = typeof E == "number" ? {
        mainAxis: E,
        crossAxis: 0
      } : {
        mainAxis: 0,
        crossAxis: 0,
        ...E
      };
      if (I) {
        const f = B === "y" ? "height" : "width", w = o.reference[B] - o.floating[f] + d.mainAxis, G = o.reference[B] + o.reference[f] - d.mainAxis;
        l < w ? l = w : l > G && (l = G);
      }
      if (r) {
        var m, y;
        const f = B === "y" ? "width" : "height", w = ["top", "left"].includes(lQ(n)), G = o.reference[C] - o.floating[f] + (w && ((m = g.offset) == null ? void 0 : m[C]) || 0) + (w ? 0 : d.crossAxis), R = o.reference[C] + o.reference[f] + (w ? 0 : ((y = g.offset) == null ? void 0 : y[C]) || 0) - (w ? d.crossAxis : 0);
        Q < G ? Q = G : Q > R && (Q = R);
      }
      return {
        [B]: l,
        [C]: Q
      };
    }
  };
}, Dce = function(A) {
  return A === void 0 && (A = {}), {
    name: "size",
    options: A,
    async fn(e) {
      const {
        placement: t,
        rects: i,
        platform: n,
        elements: o
      } = e, {
        apply: g = () => {
        },
        ...s
      } = BQ(A, e), I = await RY(e, s), r = lQ(t), a = ND(t), C = YD(t) === "y", {
        width: B,
        height: l
      } = i.floating;
      let Q, E;
      r === "top" || r === "bottom" ? (Q = r, E = a === (await (n.isRTL == null ? void 0 : n.isRTL(o.floating)) ? "start" : "end") ? "left" : "right") : (E = r, Q = a === "end" ? "top" : "bottom");
      const d = l - I[Q], m = B - I[E], y = !e.middlewareData.shift;
      let f = d, w = m;
      if (C) {
        const R = B - I.left - I.right;
        w = a || y ? Xu(m, R) : R;
      } else {
        const R = l - I.top - I.bottom;
        f = a || y ? Xu(d, R) : R;
      }
      if (y && !a) {
        const R = DI(I.left, 0), F = DI(I.right, 0), Z = DI(I.top, 0), c = DI(I.bottom, 0);
        C ? w = B - 2 * (R !== 0 || F !== 0 ? R + F : DI(I.left, I.right)) : f = l - 2 * (Z !== 0 || c !== 0 ? Z + c : DI(I.top, I.bottom));
      }
      await g({
        ...e,
        availableWidth: w,
        availableHeight: f
      });
      const G = await n.getDimensions(o.floating);
      return B !== G.width || l !== G.height ? {
        reset: {
          rects: !0
        }
      } : {};
    }
  };
};
function Tu(A) {
  return k2A(A) ? (A.nodeName || "").toLowerCase() : "#document";
}
function XI(A) {
  var e;
  return (A == null || (e = A.ownerDocument) == null ? void 0 : e.defaultView) || window;
}
function RQ(A) {
  var e;
  return (e = (k2A(A) ? A.ownerDocument : A.document) || window.document) == null ? void 0 : e.documentElement;
}
function k2A(A) {
  return A instanceof Node || A instanceof XI(A).Node;
}
function cQ(A) {
  return A instanceof Element || A instanceof XI(A).Element;
}
function il(A) {
  return A instanceof HTMLElement || A instanceof XI(A).HTMLElement;
}
function $lA(A) {
  return typeof ShadowRoot > "u" ? !1 : A instanceof ShadowRoot || A instanceof XI(A).ShadowRoot;
}
function SR(A) {
  const {
    overflow: e,
    overflowX: t,
    overflowY: i,
    display: n
  } = Ar(A);
  return /auto|scroll|overlay|hidden|clip/.test(e + i + t) && !["inline", "contents"].includes(n);
}
function Gce(A) {
  return ["table", "td", "th"].includes(Tu(A));
}
function Z7(A) {
  const e = W7(), t = Ar(A);
  return t.transform !== "none" || t.perspective !== "none" || (t.containerType ? t.containerType !== "normal" : !1) || !e && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !e && (t.filter ? t.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (t.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (t.contain || "").includes(i));
}
function J2A(A) {
  let e = If(A);
  for (; il(e) && !Q3(e); ) {
    if (Z7(e))
      return e;
    e = If(e);
  }
  return null;
}
function W7() {
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
}
function Q3(A) {
  return ["html", "body", "#document"].includes(Tu(A));
}
function Ar(A) {
  return XI(A).getComputedStyle(A);
}
function E3(A) {
  return cQ(A) ? {
    scrollLeft: A.scrollLeft,
    scrollTop: A.scrollTop
  } : {
    scrollLeft: A.pageXOffset,
    scrollTop: A.pageYOffset
  };
}
function If(A) {
  if (Tu(A) === "html")
    return A;
  const e = (
    // Step into the shadow DOM of the parent of a slotted node.
    A.assignedSlot || // DOM Element detected.
    A.parentNode || // ShadowRoot detected.
    $lA(A) && A.host || // Fallback.
    RQ(A)
  );
  return $lA(e) ? e.host : e;
}
function N2A(A) {
  const e = If(A);
  return Q3(e) ? A.ownerDocument ? A.ownerDocument.body : A.body : il(e) && SR(e) ? e : N2A(e);
}
function FY(A, e, t) {
  var i;
  e === void 0 && (e = []), t === void 0 && (t = !0);
  const n = N2A(A), o = n === ((i = A.ownerDocument) == null ? void 0 : i.body), g = XI(n);
  return o ? e.concat(g, g.visualViewport || [], SR(n) ? n : [], g.frameElement && t ? FY(g.frameElement) : []) : e.concat(n, FY(n, [], t));
}
function Y2A(A) {
  const e = Ar(A);
  let t = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
  const n = il(A), o = n ? A.offsetWidth : t, g = n ? A.offsetHeight : i, s = ZH(t) !== o || ZH(i) !== g;
  return s && (t = o, i = g), {
    width: t,
    height: i,
    $: s
  };
}
function K7(A) {
  return cQ(A) ? A : A.contextElement;
}
function gw(A) {
  const e = K7(A);
  if (!il(e))
    return zu(1);
  const t = e.getBoundingClientRect(), {
    width: i,
    height: n,
    $: o
  } = Y2A(e);
  let g = (o ? ZH(t.width) : t.width) / i, s = (o ? ZH(t.height) : t.height) / n;
  return (!g || !Number.isFinite(g)) && (g = 1), (!s || !Number.isFinite(s)) && (s = 1), {
    x: g,
    y: s
  };
}
const kce = /* @__PURE__ */ zu(0);
function R2A(A) {
  const e = XI(A);
  return !W7() || !e.visualViewport ? kce : {
    x: e.visualViewport.offsetLeft,
    y: e.visualViewport.offsetTop
  };
}
function Jce(A, e, t) {
  return e === void 0 && (e = !1), !t || e && t !== XI(A) ? !1 : e;
}
function sp(A, e, t, i) {
  e === void 0 && (e = !1), t === void 0 && (t = !1);
  const n = A.getBoundingClientRect(), o = K7(A);
  let g = zu(1);
  e && (i ? cQ(i) && (g = gw(i)) : g = gw(A));
  const s = Jce(o, t, i) ? R2A(o) : zu(0);
  let I = (n.left + s.x) / g.x, r = (n.top + s.y) / g.y, a = n.width / g.x, C = n.height / g.y;
  if (o) {
    const B = XI(o), l = i && cQ(i) ? XI(i) : i;
    let Q = B.frameElement;
    for (; Q && i && l !== B; ) {
      const E = gw(Q), d = Q.getBoundingClientRect(), m = Ar(Q), y = d.left + (Q.clientLeft + parseFloat(m.paddingLeft)) * E.x, f = d.top + (Q.clientTop + parseFloat(m.paddingTop)) * E.y;
      I *= E.x, r *= E.y, a *= E.x, C *= E.y, I += y, r += f, Q = XI(Q).frameElement;
    }
  }
  return KH({
    width: a,
    height: C,
    x: I,
    y: r
  });
}
const Nce = [":popover-open", ":modal"];
function F2A(A) {
  let e = !1, t = 0, i = 0;
  function n(o) {
    try {
      e = e || A.matches(o);
    } catch {
    }
  }
  if (Nce.forEach((o) => {
    n(o);
  }), e) {
    const o = J2A(A);
    if (o) {
      const g = o.getBoundingClientRect();
      t = g.x, i = g.y;
    }
  }
  return [e, t, i];
}
function Yce(A) {
  let {
    elements: e,
    rect: t,
    offsetParent: i,
    strategy: n
  } = A;
  const o = RQ(i), [g] = e ? F2A(e.floating) : [!1];
  if (i === o || g)
    return t;
  let s = {
    scrollLeft: 0,
    scrollTop: 0
  }, I = zu(1);
  const r = zu(0), a = il(i);
  if ((a || !a && n !== "fixed") && ((Tu(i) !== "body" || SR(o)) && (s = E3(i)), il(i))) {
    const C = sp(i);
    I = gw(i), r.x = C.x + i.clientLeft, r.y = C.y + i.clientTop;
  }
  return {
    width: t.width * I.x,
    height: t.height * I.y,
    x: t.x * I.x - s.scrollLeft * I.x + r.x,
    y: t.y * I.y - s.scrollTop * I.y + r.y
  };
}
function Rce(A) {
  return Array.from(A.getClientRects());
}
function M2A(A) {
  return sp(RQ(A)).left + E3(A).scrollLeft;
}
function Fce(A) {
  const e = RQ(A), t = E3(A), i = A.ownerDocument.body, n = DI(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), o = DI(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
  let g = -t.scrollLeft + M2A(A);
  const s = -t.scrollTop;
  return Ar(i).direction === "rtl" && (g += DI(e.clientWidth, i.clientWidth) - n), {
    width: n,
    height: o,
    x: g,
    y: s
  };
}
function Mce(A, e) {
  const t = XI(A), i = RQ(A), n = t.visualViewport;
  let o = i.clientWidth, g = i.clientHeight, s = 0, I = 0;
  if (n) {
    o = n.width, g = n.height;
    const r = W7();
    (!r || r && e === "fixed") && (s = n.offsetLeft, I = n.offsetTop);
  }
  return {
    width: o,
    height: g,
    x: s,
    y: I
  };
}
function xce(A, e) {
  const t = sp(A, !0, e === "fixed"), i = t.top + A.clientTop, n = t.left + A.clientLeft, o = il(A) ? gw(A) : zu(1), g = A.clientWidth * o.x, s = A.clientHeight * o.y, I = n * o.x, r = i * o.y;
  return {
    width: g,
    height: s,
    x: I,
    y: r
  };
}
function AcA(A, e, t) {
  let i;
  if (e === "viewport")
    i = Mce(A, t);
  else if (e === "document")
    i = Fce(RQ(A));
  else if (cQ(e))
    i = xce(e, t);
  else {
    const n = R2A(A);
    i = {
      ...e,
      x: e.x - n.x,
      y: e.y - n.y
    };
  }
  return KH(i);
}
function x2A(A, e) {
  const t = If(A);
  return t === e || !cQ(t) || Q3(t) ? !1 : Ar(t).position === "fixed" || x2A(t, e);
}
function Lce(A, e) {
  const t = e.get(A);
  if (t)
    return t;
  let i = FY(A, [], !1).filter((s) => cQ(s) && Tu(s) !== "body"), n = null;
  const o = Ar(A).position === "fixed";
  let g = o ? If(A) : A;
  for (; cQ(g) && !Q3(g); ) {
    const s = Ar(g), I = Z7(g);
    !I && s.position === "fixed" && (n = null), (o ? !I && !n : !I && s.position === "static" && n && ["absolute", "fixed"].includes(n.position) || SR(g) && !I && x2A(A, g)) ? i = i.filter((r) => r !== g) : n = s, g = If(g);
  }
  return e.set(A, i), i;
}
function vce(A) {
  let {
    element: e,
    boundary: t,
    rootBoundary: i,
    strategy: n
  } = A;
  const o = [...t === "clippingAncestors" ? Lce(e, this._c) : [].concat(t), i], g = o[0], s = o.reduce((I, r) => {
    const a = AcA(e, r, n);
    return I.top = DI(a.top, I.top), I.right = Xu(a.right, I.right), I.bottom = Xu(a.bottom, I.bottom), I.left = DI(a.left, I.left), I;
  }, AcA(e, g, n));
  return {
    width: s.right - s.left,
    height: s.bottom - s.top,
    x: s.left,
    y: s.top
  };
}
function Hce(A) {
  const {
    width: e,
    height: t
  } = Y2A(A);
  return {
    width: e,
    height: t
  };
}
function Sce(A, e, t, i) {
  const n = il(e), o = RQ(e), g = t === "fixed", s = sp(A, !0, g, e);
  let I = {
    scrollLeft: 0,
    scrollTop: 0
  };
  const r = zu(0);
  if (n || !n && !g)
    if ((Tu(e) !== "body" || SR(o)) && (I = E3(e)), n) {
      const E = sp(e, !0, g, e);
      r.x = E.x + e.clientLeft, r.y = E.y + e.clientTop;
    } else
      o && (r.x = M2A(o));
  let a = s.left + I.scrollLeft - r.x, C = s.top + I.scrollTop - r.y;
  const [B, l, Q] = F2A(i);
  return B && (a += l, C += Q, n && (a += e.clientLeft, C += e.clientTop)), {
    x: a,
    y: C,
    width: s.width,
    height: s.height
  };
}
function ecA(A, e) {
  return !il(A) || Ar(A).position === "fixed" ? null : e ? e(A) : A.offsetParent;
}
function L2A(A, e) {
  const t = XI(A);
  if (!il(A))
    return t;
  let i = ecA(A, e);
  for (; i && Gce(i) && Ar(i).position === "static"; )
    i = ecA(i, e);
  return i && (Tu(i) === "html" || Tu(i) === "body" && Ar(i).position === "static" && !Z7(i)) ? t : i || J2A(A) || t;
}
const Zce = async function(A) {
  const e = this.getOffsetParent || L2A, t = this.getDimensions;
  return {
    reference: Sce(A.reference, await e(A.floating), A.strategy, A.floating),
    floating: {
      x: 0,
      y: 0,
      ...await t(A.floating)
    }
  };
};
function Wce(A) {
  return Ar(A).direction === "rtl";
}
const Kce = {
  convertOffsetParentRelativeRectToViewportRelativeRect: Yce,
  getDocumentElement: RQ,
  getClippingRect: vce,
  getOffsetParent: L2A,
  getElementRects: Zce,
  getClientRects: Rce,
  getDimensions: Hce,
  getScale: gw,
  isElement: cQ,
  isRTL: Wce
};
function Uce(A, e) {
  let t = null, i;
  const n = RQ(A);
  function o() {
    var s;
    clearTimeout(i), (s = t) == null || s.disconnect(), t = null;
  }
  function g(s, I) {
    s === void 0 && (s = !1), I === void 0 && (I = 1), o();
    const {
      left: r,
      top: a,
      width: C,
      height: B
    } = A.getBoundingClientRect();
    if (s || e(), !C || !B)
      return;
    const l = kM(a), Q = kM(n.clientWidth - (r + C)), E = kM(n.clientHeight - (a + B)), d = kM(r), m = {
      rootMargin: -l + "px " + -Q + "px " + -E + "px " + -d + "px",
      threshold: DI(0, Xu(1, I)) || 1
    };
    let y = !0;
    function f(w) {
      const G = w[0].intersectionRatio;
      if (G !== I) {
        if (!y)
          return g();
        G ? g(!1, G) : i = setTimeout(() => {
          g(!1, 1e-7);
        }, 100);
      }
      y = !1;
    }
    try {
      t = new IntersectionObserver(f, {
        ...m,
        // Handle <iframe>s
        root: n.ownerDocument
      });
    } catch {
      t = new IntersectionObserver(f, m);
    }
    t.observe(A);
  }
  return g(!0), o;
}
function Vce(A, e, t, i) {
  i === void 0 && (i = {});
  const {
    ancestorScroll: n = !0,
    ancestorResize: o = !0,
    elementResize: g = typeof ResizeObserver == "function",
    layoutShift: s = typeof IntersectionObserver == "function",
    animationFrame: I = !1
  } = i, r = K7(A), a = n || o ? [...r ? FY(r) : [], ...FY(e)] : [];
  a.forEach((m) => {
    n && m.addEventListener("scroll", t, {
      passive: !0
    }), o && m.addEventListener("resize", t);
  });
  const C = r && s ? Uce(r, t) : null;
  let B = -1, l = null;
  g && (l = new ResizeObserver((m) => {
    let [y] = m;
    y && y.target === r && l && (l.unobserve(e), cancelAnimationFrame(B), B = requestAnimationFrame(() => {
      var f;
      (f = l) == null || f.observe(e);
    })), t();
  }), r && !I && l.observe(r), l.observe(e));
  let Q, E = I ? sp(A) : null;
  I && d();
  function d() {
    const m = sp(A);
    E && (m.x !== E.x || m.y !== E.y || m.width !== E.width || m.height !== E.height) && t(), E = m, Q = requestAnimationFrame(d);
  }
  return t(), () => {
    var m;
    a.forEach((y) => {
      n && y.removeEventListener("scroll", t), o && y.removeEventListener("resize", t);
    }), C == null || C(), (m = l) == null || m.disconnect(), l = null, I && cancelAnimationFrame(Q);
  };
}
const Xce = wce, zce = mce, Tce = Dce, _ce = pce, tcA = hce, qce = fce, Oce = (A, e, t) => {
  const i = /* @__PURE__ */ new Map(), n = {
    platform: Kce,
    ...t
  }, o = {
    ...n.platform,
    _c: i
  };
  return dce(A, e, {
    ...n,
    platform: o
  });
}, jce = (A) => {
  function e(t) {
    return {}.hasOwnProperty.call(t, "current");
  }
  return {
    name: "arrow",
    options: A,
    fn(t) {
      const {
        element: i,
        padding: n
      } = typeof A == "function" ? A(t) : A;
      return i && e(i) ? i.current != null ? tcA({
        element: i.current,
        padding: n
      }).fn(t) : {} : i ? tcA({
        element: i,
        padding: n
      }).fn(t) : {};
    }
  };
};
var ZL = typeof document < "u" ? u.useLayoutEffect : u.useEffect;
function UH(A, e) {
  if (A === e)
    return !0;
  if (typeof A != typeof e)
    return !1;
  if (typeof A == "function" && A.toString() === e.toString())
    return !0;
  let t, i, n;
  if (A && e && typeof A == "object") {
    if (Array.isArray(A)) {
      if (t = A.length, t !== e.length)
        return !1;
      for (i = t; i-- !== 0; )
        if (!UH(A[i], e[i]))
          return !1;
      return !0;
    }
    if (n = Object.keys(A), t = n.length, t !== Object.keys(e).length)
      return !1;
    for (i = t; i-- !== 0; )
      if (!{}.hasOwnProperty.call(e, n[i]))
        return !1;
    for (i = t; i-- !== 0; ) {
      const o = n[i];
      if (!(o === "_owner" && A.$$typeof) && !UH(A[o], e[o]))
        return !1;
    }
    return !0;
  }
  return A !== A && e !== e;
}
function v2A(A) {
  return typeof window > "u" ? 1 : (A.ownerDocument.defaultView || window).devicePixelRatio || 1;
}
function icA(A, e) {
  const t = v2A(A);
  return Math.round(e * t) / t;
}
function ncA(A) {
  const e = u.useRef(A);
  return ZL(() => {
    e.current = A;
  }), e;
}
function Pce(A) {
  A === void 0 && (A = {});
  const {
    placement: e = "bottom",
    strategy: t = "absolute",
    middleware: i = [],
    platform: n,
    elements: {
      reference: o,
      floating: g
    } = {},
    transform: s = !0,
    whileElementsMounted: I,
    open: r
  } = A, [a, C] = u.useState({
    x: 0,
    y: 0,
    strategy: t,
    placement: e,
    middlewareData: {},
    isPositioned: !1
  }), [B, l] = u.useState(i);
  UH(B, i) || l(i);
  const [Q, E] = u.useState(null), [d, m] = u.useState(null), y = u.useCallback((q) => {
    q !== R.current && (R.current = q, E(q));
  }, []), f = u.useCallback((q) => {
    q !== F.current && (F.current = q, m(q));
  }, []), w = o || Q, G = g || d, R = u.useRef(null), F = u.useRef(null), Z = u.useRef(a), c = I != null, J = ncA(I), p = ncA(n), N = u.useCallback(() => {
    if (!R.current || !F.current)
      return;
    const q = {
      placement: e,
      strategy: t,
      middleware: B
    };
    p.current && (q.platform = p.current), Oce(R.current, F.current, q).then((O) => {
      const $ = {
        ...O,
        isPositioned: !0
      };
      v.current && !UH(Z.current, $) && (Z.current = $, Jt.flushSync(() => {
        C($);
      }));
    });
  }, [B, e, t, p]);
  ZL(() => {
    r === !1 && Z.current.isPositioned && (Z.current.isPositioned = !1, C((q) => ({
      ...q,
      isPositioned: !1
    })));
  }, [r]);
  const v = u.useRef(!1);
  ZL(() => (v.current = !0, () => {
    v.current = !1;
  }), []), ZL(() => {
    if (w && (R.current = w), G && (F.current = G), w && G) {
      if (J.current)
        return J.current(w, G, N);
      N();
    }
  }, [w, G, N, J, c]);
  const K = u.useMemo(() => ({
    reference: R,
    floating: F,
    setReference: y,
    setFloating: f
  }), [y, f]), U = u.useMemo(() => ({
    reference: w,
    floating: G
  }), [w, G]), j = u.useMemo(() => {
    const q = {
      position: t,
      left: 0,
      top: 0
    };
    if (!U.floating)
      return q;
    const O = icA(U.floating, a.x), $ = icA(U.floating, a.y);
    return s ? {
      ...q,
      transform: "translate(" + O + "px, " + $ + "px)",
      ...v2A(U.floating) >= 1.5 && {
        willChange: "transform"
      }
    } : {
      position: t,
      left: O,
      top: $
    };
  }, [t, s, U.floating, a.x, a.y]);
  return u.useMemo(() => ({
    ...a,
    update: N,
    refs: K,
    elements: U,
    floatingStyles: j
  }), [a, N, K, U, j]);
}
const H2A = "Popper", [S2A, yl] = gg(H2A), [$ce, Z2A] = S2A(H2A), AQe = (A) => {
  const { __scopePopper: e, children: t } = A, [i, n] = u.useState(null);
  return /* @__PURE__ */ u.createElement($ce, {
    scope: e,
    anchor: i,
    onAnchorChange: n
  }, t);
}, eQe = "PopperAnchor", tQe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopePopper: t, virtualRef: i, ...n } = A, o = Z2A(eQe, t), g = u.useRef(null), s = Dt(e, g);
  return u.useEffect(() => {
    o.onAnchorChange((i == null ? void 0 : i.current) || g.current);
  }), i ? null : /* @__PURE__ */ u.createElement(ze.div, NA({}, n, {
    ref: s
  }));
}), W2A = "PopperContent", [iQe, TVt] = S2A(W2A), nQe = /* @__PURE__ */ u.forwardRef((A, e) => {
  var t, i, n, o, g, s, I, r;
  const { __scopePopper: a, side: C = "bottom", sideOffset: B = 0, align: l = "center", alignOffset: Q = 0, arrowPadding: E = 0, avoidCollisions: d = !0, collisionBoundary: m = [], collisionPadding: y = 0, sticky: f = "partial", hideWhenDetached: w = !1, updatePositionStrategy: G = "optimized", onPlaced: R, ...F } = A, Z = Z2A(W2A, a), [c, J] = u.useState(null), p = Dt(
    e,
    (HA) => J(HA)
  ), [N, v] = u.useState(null), K = RR(N), U = (t = K == null ? void 0 : K.width) !== null && t !== void 0 ? t : 0, j = (i = K == null ? void 0 : K.height) !== null && i !== void 0 ? i : 0, q = C + (l !== "center" ? "-" + l : ""), O = typeof y == "number" ? y : {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0,
    ...y
  }, $ = Array.isArray(m) ? m : [
    m
  ], _ = $.length > 0, tA = {
    padding: O,
    boundary: $.filter(oQe),
    // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
    altBoundary: _
  }, { refs: nA, floatingStyles: AA, placement: gA, isPositioned: rA, middlewareData: sA } = Pce({
    // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
    strategy: "fixed",
    placement: q,
    whileElementsMounted: (...HA) => Vce(...HA, {
      animationFrame: G === "always"
    }),
    elements: {
      reference: Z.anchor
    },
    middleware: [
      bce({
        mainAxis: B + j,
        alignmentAxis: Q
      }),
      d && Xce({
        mainAxis: !0,
        crossAxis: !1,
        limiter: f === "partial" ? qce() : void 0,
        ...tA
      }),
      d && zce({
        ...tA
      }),
      Tce({
        ...tA,
        apply: ({ elements: HA, rects: ne, availableWidth: VA, availableHeight: le }) => {
          const { width: we, height: De } = ne.reference, Ke = HA.floating.style;
          Ke.setProperty("--radix-popper-available-width", `${VA}px`), Ke.setProperty("--radix-popper-available-height", `${le}px`), Ke.setProperty("--radix-popper-anchor-width", `${we}px`), Ke.setProperty("--radix-popper-anchor-height", `${De}px`);
        }
      }),
      N && jce({
        element: N,
        padding: E
      }),
      gQe({
        arrowWidth: U,
        arrowHeight: j
      }),
      w && _ce({
        strategy: "referenceHidden",
        ...tA
      })
    ]
  }), [lA, cA] = K2A(gA), aA = Pa(R);
  rs(() => {
    rA && (aA == null || aA());
  }, [
    rA,
    aA
  ]);
  const QA = (n = sA.arrow) === null || n === void 0 ? void 0 : n.x, hA = (o = sA.arrow) === null || o === void 0 ? void 0 : o.y, EA = ((g = sA.arrow) === null || g === void 0 ? void 0 : g.centerOffset) !== 0, [RA, xA] = u.useState();
  return rs(() => {
    c && xA(window.getComputedStyle(c).zIndex);
  }, [
    c
  ]), /* @__PURE__ */ u.createElement("div", {
    ref: nA.setFloating,
    "data-radix-popper-content-wrapper": "",
    style: {
      ...AA,
      transform: rA ? AA.transform : "translate(0, -200%)",
      // keep off the page when measuring
      minWidth: "max-content",
      zIndex: RA,
      "--radix-popper-transform-origin": [
        (s = sA.transformOrigin) === null || s === void 0 ? void 0 : s.x,
        (I = sA.transformOrigin) === null || I === void 0 ? void 0 : I.y
      ].join(" ")
    },
    dir: A.dir
  }, /* @__PURE__ */ u.createElement(iQe, {
    scope: a,
    placedSide: lA,
    onArrowChange: v,
    arrowX: QA,
    arrowY: hA,
    shouldHideArrow: EA
  }, /* @__PURE__ */ u.createElement(ze.div, NA({
    "data-side": lA,
    "data-align": cA
  }, F, {
    ref: p,
    style: {
      ...F.style,
      // if the PopperContent hasn't been placed yet (not all measurements done)
      // we prevent animations so that users's animation don't kick in too early referring wrong sides
      animation: rA ? void 0 : "none",
      // hide the content if using the hide middleware and should be hidden
      opacity: (r = sA.hide) !== null && r !== void 0 && r.referenceHidden ? 0 : void 0
    }
  }))));
});
function oQe(A) {
  return A !== null;
}
const gQe = (A) => ({
  name: "transformOrigin",
  options: A,
  fn(e) {
    var t, i, n, o, g;
    const { placement: s, rects: I, middlewareData: r } = e, a = ((t = r.arrow) === null || t === void 0 ? void 0 : t.centerOffset) !== 0, C = a ? 0 : A.arrowWidth, B = a ? 0 : A.arrowHeight, [l, Q] = K2A(s), E = {
      start: "0%",
      center: "50%",
      end: "100%"
    }[Q], d = ((i = (n = r.arrow) === null || n === void 0 ? void 0 : n.x) !== null && i !== void 0 ? i : 0) + C / 2, m = ((o = (g = r.arrow) === null || g === void 0 ? void 0 : g.y) !== null && o !== void 0 ? o : 0) + B / 2;
    let y = "", f = "";
    return l === "bottom" ? (y = a ? E : `${d}px`, f = `${-B}px`) : l === "top" ? (y = a ? E : `${d}px`, f = `${I.floating.height + B}px`) : l === "right" ? (y = `${-B}px`, f = a ? E : `${m}px`) : l === "left" && (y = `${I.floating.width + B}px`, f = a ? E : `${m}px`), {
      data: {
        x: y,
        y: f
      }
    };
  }
});
function K2A(A) {
  const [e, t = "center"] = A.split("-");
  return [
    e,
    t
  ];
}
const ZR = AQe, WR = tQe, KR = nQe, UR = /* @__PURE__ */ u.forwardRef((A, e) => {
  var t;
  const { container: i = globalThis == null || (t = globalThis.document) === null || t === void 0 ? void 0 : t.body, ...n } = A;
  return i ? /* @__PURE__ */ kd.createPortal(/* @__PURE__ */ u.createElement(ze.div, NA({}, n, {
    ref: e
  })), i) : null;
});
function sQe(A, e) {
  return u.useReducer((t, i) => e[t][i] ?? t, A);
}
const Ig = (A) => {
  const { present: e, children: t } = A, i = IQe(e), n = typeof t == "function" ? t({
    present: i.isPresent
  }) : u.Children.only(t), o = Dt(i.ref, n.ref);
  return typeof t == "function" || i.isPresent ? /* @__PURE__ */ u.cloneElement(n, {
    ref: o
  }) : null;
};
Ig.displayName = "Presence";
function IQe(A) {
  const [e, t] = u.useState(), i = u.useRef({}), n = u.useRef(A), o = u.useRef("none"), g = A ? "mounted" : "unmounted", [s, I] = sQe(g, {
    mounted: {
      UNMOUNT: "unmounted",
      ANIMATION_OUT: "unmountSuspended"
    },
    unmountSuspended: {
      MOUNT: "mounted",
      ANIMATION_END: "unmounted"
    },
    unmounted: {
      MOUNT: "mounted"
    }
  });
  return u.useEffect(() => {
    const r = JM(i.current);
    o.current = s === "mounted" ? r : "none";
  }, [
    s
  ]), rs(() => {
    const r = i.current, a = n.current;
    if (a !== A) {
      const C = o.current, B = JM(r);
      A ? I("MOUNT") : B === "none" || (r == null ? void 0 : r.display) === "none" ? I("UNMOUNT") : I(a && C !== B ? "ANIMATION_OUT" : "UNMOUNT"), n.current = A;
    }
  }, [
    A,
    I
  ]), rs(() => {
    if (e) {
      const r = (C) => {
        const B = JM(i.current).includes(C.animationName);
        C.target === e && B && Jt.flushSync(
          () => I("ANIMATION_END")
        );
      }, a = (C) => {
        C.target === e && (o.current = JM(i.current));
      };
      return e.addEventListener("animationstart", a), e.addEventListener("animationcancel", r), e.addEventListener("animationend", r), () => {
        e.removeEventListener("animationstart", a), e.removeEventListener("animationcancel", r), e.removeEventListener("animationend", r);
      };
    } else
      I("ANIMATION_END");
  }, [
    e,
    I
  ]), {
    isPresent: [
      "mounted",
      "unmountSuspended"
    ].includes(s),
    ref: u.useCallback((r) => {
      r && (i.current = getComputedStyle(r)), t(r);
    }, [])
  };
}
function JM(A) {
  return (A == null ? void 0 : A.animationName) || "none";
}
var aQe = function(A) {
  if (typeof document > "u")
    return null;
  var e = Array.isArray(A) ? A[0] : A;
  return e.ownerDocument.body;
}, oy = /* @__PURE__ */ new WeakMap(), NM = /* @__PURE__ */ new WeakMap(), YM = {}, f5 = 0, U2A = function(A) {
  return A && (A.host || U2A(A.parentNode));
}, rQe = function(A, e) {
  return e.map(function(t) {
    if (A.contains(t))
      return t;
    var i = U2A(t);
    return i && A.contains(i) ? i : (console.error("aria-hidden", t, "in not contained inside", A, ". Doing nothing"), null);
  }).filter(function(t) {
    return !!t;
  });
}, CQe = function(A, e, t, i) {
  var n = rQe(e, Array.isArray(A) ? A : [A]);
  YM[t] || (YM[t] = /* @__PURE__ */ new WeakMap());
  var o = YM[t], g = [], s = /* @__PURE__ */ new Set(), I = new Set(n), r = function(C) {
    !C || s.has(C) || (s.add(C), r(C.parentNode));
  };
  n.forEach(r);
  var a = function(C) {
    !C || I.has(C) || Array.prototype.forEach.call(C.children, function(B) {
      if (s.has(B))
        a(B);
      else {
        var l = B.getAttribute(i), Q = l !== null && l !== "false", E = (oy.get(B) || 0) + 1, d = (o.get(B) || 0) + 1;
        oy.set(B, E), o.set(B, d), g.push(B), E === 1 && Q && NM.set(B, !0), d === 1 && B.setAttribute(t, "true"), Q || B.setAttribute(i, "true");
      }
    });
  };
  return a(e), s.clear(), f5++, function() {
    g.forEach(function(C) {
      var B = oy.get(C) - 1, l = o.get(C) - 1;
      oy.set(C, B), o.set(C, l), B || (NM.has(C) || C.removeAttribute(i), NM.delete(C)), l || C.removeAttribute(t);
    }), f5--, f5 || (oy = /* @__PURE__ */ new WeakMap(), oy = /* @__PURE__ */ new WeakMap(), NM = /* @__PURE__ */ new WeakMap(), YM = {});
  };
}, VR = function(A, e, t) {
  t === void 0 && (t = "data-aria-hidden");
  var i = Array.from(Array.isArray(A) ? A : [A]), n = e || aQe(A);
  return n ? (i.push.apply(i, Array.from(n.querySelectorAll("[aria-live]"))), CQe(i, n, t, "aria-hidden")) : function() {
    return null;
  };
}, WE = function() {
  return WE = Object.assign || function(A) {
    for (var e, t = 1, i = arguments.length; t < i; t++) {
      e = arguments[t];
      for (var n in e)
        Object.prototype.hasOwnProperty.call(e, n) && (A[n] = e[n]);
    }
    return A;
  }, WE.apply(this, arguments);
};
function BQe(A, e) {
  var t = {};
  for (var i in A)
    Object.prototype.hasOwnProperty.call(A, i) && e.indexOf(i) < 0 && (t[i] = A[i]);
  if (A != null && typeof Object.getOwnPropertySymbols == "function")
    for (var n = 0, i = Object.getOwnPropertySymbols(A); n < i.length; n++)
      e.indexOf(i[n]) < 0 && Object.prototype.propertyIsEnumerable.call(A, i[n]) && (t[i[n]] = A[i[n]]);
  return t;
}
function lQe(A, e, t) {
  if (t || arguments.length === 2)
    for (var i = 0, n = e.length, o; i < n; i++)
      (o || !(i in e)) && (o || (o = Array.prototype.slice.call(e, 0, i)), o[i] = e[i]);
  return A.concat(o || Array.prototype.slice.call(e));
}
var QN = "right-scroll-bar-position", EN = "width-before-scroll-bar", cQe = "with-scroll-bars-hidden", QQe = "--removed-body-scroll-bar-size";
function D5(A, e) {
  return typeof A == "function" ? A(e) : A && (A.current = e), A;
}
function EQe(A, e) {
  var t = u.useState(function() {
    return {
      // value
      value: A,
      // last callback
      callback: e,
      // "memoized" public interface
      facade: {
        get current() {
          return t.value;
        },
        set current(i) {
          var n = t.value;
          n !== i && (t.value = i, t.callback(i, n));
        }
      }
    };
  })[0];
  return t.callback = e, t.facade;
}
var ocA = /* @__PURE__ */ new WeakMap();
function V2A(A, e) {
  var t = EQe(e || null, function(i) {
    return A.forEach(function(n) {
      return D5(n, i);
    });
  });
  return u.useLayoutEffect(function() {
    var i = ocA.get(t);
    if (i) {
      var n = new Set(i), o = new Set(A), g = t.current;
      n.forEach(function(s) {
        o.has(s) || D5(s, null);
      }), o.forEach(function(s) {
        n.has(s) || D5(s, g);
      });
    }
    ocA.set(t, A);
  }, [A]), t;
}
var VH = function() {
  return VH = Object.assign || function(A) {
    for (var e, t = 1, i = arguments.length; t < i; t++) {
      e = arguments[t];
      for (var n in e)
        Object.prototype.hasOwnProperty.call(e, n) && (A[n] = e[n]);
    }
    return A;
  }, VH.apply(this, arguments);
};
function uQe(A, e) {
  var t = {};
  for (var i in A)
    Object.prototype.hasOwnProperty.call(A, i) && e.indexOf(i) < 0 && (t[i] = A[i]);
  if (A != null && typeof Object.getOwnPropertySymbols == "function")
    for (var n = 0, i = Object.getOwnPropertySymbols(A); n < i.length; n++)
      e.indexOf(i[n]) < 0 && Object.prototype.propertyIsEnumerable.call(A, i[n]) && (t[i[n]] = A[i[n]]);
  return t;
}
function RD(A, e, t, i) {
  function n(o) {
    return o instanceof t ? o : new t(function(g) {
      g(o);
    });
  }
  return new (t || (t = Promise))(function(o, g) {
    function s(a) {
      try {
        r(i.next(a));
      } catch (C) {
        g(C);
      }
    }
    function I(a) {
      try {
        r(i.throw(a));
      } catch (C) {
        g(C);
      }
    }
    function r(a) {
      a.done ? o(a.value) : n(a.value).then(s, I);
    }
    r((i = i.apply(A, e || [])).next());
  });
}
function FD(A, e) {
  var t = { label: 0, sent: function() {
    if (o[0] & 1)
      throw o[1];
    return o[1];
  }, trys: [], ops: [] }, i, n, o, g;
  return g = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
    return this;
  }), g;
  function s(r) {
    return function(a) {
      return I([r, a]);
    };
  }
  function I(r) {
    if (i)
      throw new TypeError("Generator is already executing.");
    for (; g && (g = 0, r[0] && (t = 0)), t; )
      try {
        if (i = 1, n && (o = r[0] & 2 ? n.return : r[0] ? n.throw || ((o = n.return) && o.call(n), 0) : n.next) && !(o = o.call(n, r[1])).done)
          return o;
        switch (n = 0, o && (r = [r[0] & 2, o.value]), r[0]) {
          case 0:
          case 1:
            o = r;
            break;
          case 4:
            return t.label++, { value: r[1], done: !1 };
          case 5:
            t.label++, n = r[1], r = [0];
            continue;
          case 7:
            r = t.ops.pop(), t.trys.pop();
            continue;
          default:
            if (o = t.trys, !(o = o.length > 0 && o[o.length - 1]) && (r[0] === 6 || r[0] === 2)) {
              t = 0;
              continue;
            }
            if (r[0] === 3 && (!o || r[1] > o[0] && r[1] < o[3])) {
              t.label = r[1];
              break;
            }
            if (r[0] === 6 && t.label < o[1]) {
              t.label = o[1], o = r;
              break;
            }
            if (o && t.label < o[2]) {
              t.label = o[2], t.ops.push(r);
              break;
            }
            o[2] && t.ops.pop(), t.trys.pop();
            continue;
        }
        r = e.call(A, t);
      } catch (a) {
        r = [6, a], n = 0;
      } finally {
        i = o = 0;
      }
    if (r[0] & 5)
      throw r[1];
    return { value: r[0] ? r[1] : void 0, done: !0 };
  }
}
function gcA(A, e) {
  var t = typeof Symbol == "function" && A[Symbol.iterator];
  if (!t)
    return A;
  var i = t.call(A), n, o = [], g;
  try {
    for (; (e === void 0 || e-- > 0) && !(n = i.next()).done; )
      o.push(n.value);
  } catch (s) {
    g = { error: s };
  } finally {
    try {
      n && !n.done && (t = i.return) && t.call(i);
    } finally {
      if (g)
        throw g.error;
    }
  }
  return o;
}
function scA(A, e, t) {
  if (t || arguments.length === 2)
    for (var i = 0, n = e.length, o; i < n; i++)
      (o || !(i in e)) && (o || (o = Array.prototype.slice.call(e, 0, i)), o[i] = e[i]);
  return A.concat(o || Array.prototype.slice.call(e));
}
function dQe(A) {
  return A;
}
function hQe(A, e) {
  e === void 0 && (e = dQe);
  var t = [], i = !1, n = {
    read: function() {
      if (i)
        throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
      return t.length ? t[t.length - 1] : A;
    },
    useMedium: function(o) {
      var g = e(o, i);
      return t.push(g), function() {
        t = t.filter(function(s) {
          return s !== g;
        });
      };
    },
    assignSyncMedium: function(o) {
      for (i = !0; t.length; ) {
        var g = t;
        t = [], g.forEach(o);
      }
      t = {
        push: function(s) {
          return o(s);
        },
        filter: function() {
          return t;
        }
      };
    },
    assignMedium: function(o) {
      i = !0;
      var g = [];
      if (t.length) {
        var s = t;
        t = [], s.forEach(o), g = t;
      }
      var I = function() {
        var a = g;
        g = [], a.forEach(o);
      }, r = function() {
        return Promise.resolve().then(I);
      };
      r(), t = {
        push: function(a) {
          g.push(a), r();
        },
        filter: function(a) {
          return g = g.filter(a), t;
        }
      };
    }
  };
  return n;
}
function X2A(A) {
  A === void 0 && (A = {});
  var e = hQe(null);
  return e.options = VH({ async: !0, ssr: !1 }, A), e;
}
var z2A = function(A) {
  var e = A.sideCar, t = uQe(A, ["sideCar"]);
  if (!e)
    throw new Error("Sidecar: please provide `sideCar` property to import the right car");
  var i = e.read();
  if (!i)
    throw new Error("Sidecar medium not found");
  return u.createElement(i, VH({}, t));
};
z2A.isSideCarExport = !0;
function T2A(A, e) {
  return A.useMedium(e), z2A;
}
var _2A = X2A(), G5 = function() {
}, u3 = u.forwardRef(function(A, e) {
  var t = u.useRef(null), i = u.useState({
    onScrollCapture: G5,
    onWheelCapture: G5,
    onTouchMoveCapture: G5
  }), n = i[0], o = i[1], g = A.forwardProps, s = A.children, I = A.className, r = A.removeScrollBar, a = A.enabled, C = A.shards, B = A.sideCar, l = A.noIsolation, Q = A.inert, E = A.allowPinchZoom, d = A.as, m = d === void 0 ? "div" : d, y = BQe(A, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), f = B, w = V2A([t, e]), G = WE(WE({}, y), n);
  return u.createElement(
    u.Fragment,
    null,
    a && u.createElement(f, { sideCar: _2A, removeScrollBar: r, shards: C, noIsolation: l, inert: Q, setCallbacks: o, allowPinchZoom: !!E, lockRef: t }),
    g ? u.cloneElement(u.Children.only(s), WE(WE({}, G), { ref: w })) : u.createElement(m, WE({}, G, { className: I, ref: w }), s)
  );
});
u3.defaultProps = {
  enabled: !0,
  removeScrollBar: !0,
  inert: !1
};
u3.classNames = {
  fullWidth: EN,
  zeroRight: QN
};
var mQe = function() {
  if (typeof __webpack_nonce__ < "u")
    return __webpack_nonce__;
};
function pQe() {
  if (!document)
    return null;
  var A = document.createElement("style");
  A.type = "text/css";
  var e = mQe();
  return e && A.setAttribute("nonce", e), A;
}
function yQe(A, e) {
  A.styleSheet ? A.styleSheet.cssText = e : A.appendChild(document.createTextNode(e));
}
function bQe(A) {
  var e = document.head || document.getElementsByTagName("head")[0];
  e.appendChild(A);
}
var wQe = function() {
  var A = 0, e = null;
  return {
    add: function(t) {
      A == 0 && (e = pQe()) && (yQe(e, t), bQe(e)), A++;
    },
    remove: function() {
      A--, !A && e && (e.parentNode && e.parentNode.removeChild(e), e = null);
    }
  };
}, fQe = function() {
  var A = wQe();
  return function(e, t) {
    u.useEffect(function() {
      return A.add(e), function() {
        A.remove();
      };
    }, [e && t]);
  };
}, U7 = function() {
  var A = fQe(), e = function(t) {
    var i = t.styles, n = t.dynamic;
    return A(i, n), null;
  };
  return e;
}, DQe = {
  left: 0,
  top: 0,
  right: 0,
  gap: 0
}, k5 = function(A) {
  return parseInt(A || "", 10) || 0;
}, GQe = function(A) {
  var e = window.getComputedStyle(document.body), t = e[A === "padding" ? "paddingLeft" : "marginLeft"], i = e[A === "padding" ? "paddingTop" : "marginTop"], n = e[A === "padding" ? "paddingRight" : "marginRight"];
  return [k5(t), k5(i), k5(n)];
}, kQe = function(A) {
  if (A === void 0 && (A = "margin"), typeof window > "u")
    return DQe;
  var e = GQe(A), t = document.documentElement.clientWidth, i = window.innerWidth;
  return {
    left: e[0],
    top: e[1],
    right: e[2],
    gap: Math.max(0, i - t + e[2] - e[0])
  };
}, JQe = U7(), NQe = function(A, e, t, i) {
  var n = A.left, o = A.top, g = A.right, s = A.gap;
  return t === void 0 && (t = "margin"), `
  .`.concat(cQe, ` {
   overflow: hidden `).concat(i, `;
   padding-right: `).concat(s, "px ").concat(i, `;
  }
  body {
    overflow: hidden `).concat(i, `;
    overscroll-behavior: contain;
    `).concat([
    e && "position: relative ".concat(i, ";"),
    t === "margin" && `
    padding-left: `.concat(n, `px;
    padding-top: `).concat(o, `px;
    padding-right: `).concat(g, `px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(s, "px ").concat(i, `;
    `),
    t === "padding" && "padding-right: ".concat(s, "px ").concat(i, ";")
  ].filter(Boolean).join(""), `
  }
  
  .`).concat(QN, ` {
    right: `).concat(s, "px ").concat(i, `;
  }
  
  .`).concat(EN, ` {
    margin-right: `).concat(s, "px ").concat(i, `;
  }
  
  .`).concat(QN, " .").concat(QN, ` {
    right: 0 `).concat(i, `;
  }
  
  .`).concat(EN, " .").concat(EN, ` {
    margin-right: 0 `).concat(i, `;
  }
  
  body {
    `).concat(QQe, ": ").concat(s, `px;
  }
`);
}, q2A = function(A) {
  var e = A.noRelative, t = A.noImportant, i = A.gapMode, n = i === void 0 ? "margin" : i, o = u.useMemo(function() {
    return kQe(n);
  }, [n]);
  return u.createElement(JQe, { styles: NQe(o, !e, n, t ? "" : "!important") });
}, Oq = !1;
if (typeof window < "u")
  try {
    var RM = Object.defineProperty({}, "passive", {
      get: function() {
        return Oq = !0, !0;
      }
    });
    window.addEventListener("test", RM, RM), window.removeEventListener("test", RM, RM);
  } catch {
    Oq = !1;
  }
var gy = Oq ? { passive: !1 } : !1, YQe = function(A) {
  return A.tagName === "TEXTAREA";
}, O2A = function(A, e) {
  var t = window.getComputedStyle(A);
  return (
    // not-not-scrollable
    t[e] !== "hidden" && // contains scroll inside self
    !(t.overflowY === t.overflowX && !YQe(A) && t[e] === "visible")
  );
}, RQe = function(A) {
  return O2A(A, "overflowY");
}, FQe = function(A) {
  return O2A(A, "overflowX");
}, IcA = function(A, e) {
  var t = e;
  do {
    typeof ShadowRoot < "u" && t instanceof ShadowRoot && (t = t.host);
    var i = j2A(A, t);
    if (i) {
      var n = P2A(A, t), o = n[1], g = n[2];
      if (o > g)
        return !0;
    }
    t = t.parentNode;
  } while (t && t !== document.body);
  return !1;
}, MQe = function(A) {
  var e = A.scrollTop, t = A.scrollHeight, i = A.clientHeight;
  return [
    e,
    t,
    i
  ];
}, xQe = function(A) {
  var e = A.scrollLeft, t = A.scrollWidth, i = A.clientWidth;
  return [
    e,
    t,
    i
  ];
}, j2A = function(A, e) {
  return A === "v" ? RQe(e) : FQe(e);
}, P2A = function(A, e) {
  return A === "v" ? MQe(e) : xQe(e);
}, LQe = function(A, e) {
  return A === "h" && e === "rtl" ? -1 : 1;
}, vQe = function(A, e, t, i, n) {
  var o = LQe(A, window.getComputedStyle(e).direction), g = o * i, s = t.target, I = e.contains(s), r = !1, a = g > 0, C = 0, B = 0;
  do {
    var l = P2A(A, s), Q = l[0], E = l[1], d = l[2], m = E - d - o * Q;
    (Q || m) && j2A(A, s) && (C += m, B += Q), s = s.parentNode;
  } while (
    // portaled content
    !I && s !== document.body || // self content
    I && (e.contains(s) || e === s)
  );
  return (a && (n && C === 0 || !n && g > C) || !a && (n && B === 0 || !n && -g > B)) && (r = !0), r;
}, FM = function(A) {
  return "changedTouches" in A ? [A.changedTouches[0].clientX, A.changedTouches[0].clientY] : [0, 0];
}, acA = function(A) {
  return [A.deltaX, A.deltaY];
}, rcA = function(A) {
  return A && "current" in A ? A.current : A;
}, HQe = function(A, e) {
  return A[0] === e[0] && A[1] === e[1];
}, SQe = function(A) {
  return `
  .block-interactivity-`.concat(A, ` {pointer-events: none;}
  .allow-interactivity-`).concat(A, ` {pointer-events: all;}
`);
}, ZQe = 0, sy = [];
function WQe(A) {
  var e = u.useRef([]), t = u.useRef([0, 0]), i = u.useRef(), n = u.useState(ZQe++)[0], o = u.useState(function() {
    return U7();
  })[0], g = u.useRef(A);
  u.useEffect(function() {
    g.current = A;
  }, [A]), u.useEffect(function() {
    if (A.inert) {
      document.body.classList.add("block-interactivity-".concat(n));
      var E = lQe([A.lockRef.current], (A.shards || []).map(rcA), !0).filter(Boolean);
      return E.forEach(function(d) {
        return d.classList.add("allow-interactivity-".concat(n));
      }), function() {
        document.body.classList.remove("block-interactivity-".concat(n)), E.forEach(function(d) {
          return d.classList.remove("allow-interactivity-".concat(n));
        });
      };
    }
  }, [A.inert, A.lockRef.current, A.shards]);
  var s = u.useCallback(function(E, d) {
    if ("touches" in E && E.touches.length === 2)
      return !g.current.allowPinchZoom;
    var m = FM(E), y = t.current, f = "deltaX" in E ? E.deltaX : y[0] - m[0], w = "deltaY" in E ? E.deltaY : y[1] - m[1], G, R = E.target, F = Math.abs(f) > Math.abs(w) ? "h" : "v";
    if ("touches" in E && F === "h" && R.type === "range")
      return !1;
    var Z = IcA(F, R);
    if (!Z)
      return !0;
    if (Z ? G = F : (G = F === "v" ? "h" : "v", Z = IcA(F, R)), !Z)
      return !1;
    if (!i.current && "changedTouches" in E && (f || w) && (i.current = G), !G)
      return !0;
    var c = i.current || G;
    return vQe(c, d, E, c === "h" ? f : w, !0);
  }, []), I = u.useCallback(function(E) {
    var d = E;
    if (!(!sy.length || sy[sy.length - 1] !== o)) {
      var m = "deltaY" in d ? acA(d) : FM(d), y = e.current.filter(function(G) {
        return G.name === d.type && G.target === d.target && HQe(G.delta, m);
      })[0];
      if (y && y.should) {
        d.cancelable && d.preventDefault();
        return;
      }
      if (!y) {
        var f = (g.current.shards || []).map(rcA).filter(Boolean).filter(function(G) {
          return G.contains(d.target);
        }), w = f.length > 0 ? s(d, f[0]) : !g.current.noIsolation;
        w && d.cancelable && d.preventDefault();
      }
    }
  }, []), r = u.useCallback(function(E, d, m, y) {
    var f = { name: E, delta: d, target: m, should: y };
    e.current.push(f), setTimeout(function() {
      e.current = e.current.filter(function(w) {
        return w !== f;
      });
    }, 1);
  }, []), a = u.useCallback(function(E) {
    t.current = FM(E), i.current = void 0;
  }, []), C = u.useCallback(function(E) {
    r(E.type, acA(E), E.target, s(E, A.lockRef.current));
  }, []), B = u.useCallback(function(E) {
    r(E.type, FM(E), E.target, s(E, A.lockRef.current));
  }, []);
  u.useEffect(function() {
    return sy.push(o), A.setCallbacks({
      onScrollCapture: C,
      onWheelCapture: C,
      onTouchMoveCapture: B
    }), document.addEventListener("wheel", I, gy), document.addEventListener("touchmove", I, gy), document.addEventListener("touchstart", a, gy), function() {
      sy = sy.filter(function(E) {
        return E !== o;
      }), document.removeEventListener("wheel", I, gy), document.removeEventListener("touchmove", I, gy), document.removeEventListener("touchstart", a, gy);
    };
  }, []);
  var l = A.removeScrollBar, Q = A.inert;
  return u.createElement(
    u.Fragment,
    null,
    Q ? u.createElement(o, { styles: SQe(n) }) : null,
    l ? u.createElement(q2A, { gapMode: "margin" }) : null
  );
}
const KQe = T2A(_2A, WQe);
var $2A = u.forwardRef(function(A, e) {
  return u.createElement(u3, WE({}, A, { ref: e, sideCar: KQe }));
});
$2A.classNames = u3.classNames;
const d3 = $2A, ARA = "Popover", [eRA, _Vt] = gg(ARA, [
  yl
]), V7 = yl(), [UQe, MD] = eRA(ARA), VQe = (A) => {
  const { __scopePopover: e, children: t, open: i, defaultOpen: n, onOpenChange: o, modal: g = !1 } = A, s = V7(e), I = u.useRef(null), [r, a] = u.useState(!1), [C = !1, B] = as({
    prop: i,
    defaultProp: n,
    onChange: o
  });
  return /* @__PURE__ */ u.createElement(ZR, s, /* @__PURE__ */ u.createElement(UQe, {
    scope: e,
    contentId: za(),
    triggerRef: I,
    open: C,
    onOpenChange: B,
    onOpenToggle: u.useCallback(
      () => B(
        (l) => !l
      ),
      [
        B
      ]
    ),
    hasCustomAnchor: r,
    onCustomAnchorAdd: u.useCallback(
      () => a(!0),
      []
    ),
    onCustomAnchorRemove: u.useCallback(
      () => a(!1),
      []
    ),
    modal: g
  }, t));
}, XQe = "PopoverTrigger", zQe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopePopover: t, ...i } = A, n = MD(XQe, t), o = V7(t), g = Dt(e, n.triggerRef), s = /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button",
    "aria-haspopup": "dialog",
    "aria-expanded": n.open,
    "aria-controls": n.contentId,
    "data-state": nRA(n.open)
  }, i, {
    ref: g,
    onClick: ge(A.onClick, n.onOpenToggle)
  }));
  return n.hasCustomAnchor ? s : /* @__PURE__ */ u.createElement(WR, NA({
    asChild: !0
  }, o), s);
}), tRA = "PopoverPortal", [TQe, _Qe] = eRA(tRA, {
  forceMount: void 0
}), qQe = (A) => {
  const { __scopePopover: e, forceMount: t, children: i, container: n } = A, o = MD(tRA, e);
  return /* @__PURE__ */ u.createElement(TQe, {
    scope: e,
    forceMount: t
  }, /* @__PURE__ */ u.createElement(Ig, {
    present: t || o.open
  }, /* @__PURE__ */ u.createElement(UR, {
    asChild: !0,
    container: n
  }, i)));
}, MY = "PopoverContent", OQe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = _Qe(MY, A.__scopePopover), { forceMount: i = t.forceMount, ...n } = A, o = MD(MY, A.__scopePopover);
  return /* @__PURE__ */ u.createElement(Ig, {
    present: i || o.open
  }, o.modal ? /* @__PURE__ */ u.createElement(jQe, NA({}, n, {
    ref: e
  })) : /* @__PURE__ */ u.createElement(PQe, NA({}, n, {
    ref: e
  })));
}), jQe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = MD(MY, A.__scopePopover), i = u.useRef(null), n = Dt(e, i), o = u.useRef(!1);
  return u.useEffect(() => {
    const g = i.current;
    if (g)
      return VR(g);
  }, []), /* @__PURE__ */ u.createElement(d3, {
    as: rQ,
    allowPinchZoom: !0
  }, /* @__PURE__ */ u.createElement(iRA, NA({}, A, {
    ref: n,
    trapFocus: t.open,
    disableOutsidePointerEvents: !0,
    onCloseAutoFocus: ge(A.onCloseAutoFocus, (g) => {
      var s;
      g.preventDefault(), o.current || (s = t.triggerRef.current) === null || s === void 0 || s.focus();
    }),
    onPointerDownOutside: ge(A.onPointerDownOutside, (g) => {
      const s = g.detail.originalEvent, I = s.button === 0 && s.ctrlKey === !0, r = s.button === 2 || I;
      o.current = r;
    }, {
      checkForDefaultPrevented: !1
    }),
    onFocusOutside: ge(
      A.onFocusOutside,
      (g) => g.preventDefault(),
      {
        checkForDefaultPrevented: !1
      }
    )
  })));
}), PQe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = MD(MY, A.__scopePopover), i = u.useRef(!1), n = u.useRef(!1);
  return /* @__PURE__ */ u.createElement(iRA, NA({}, A, {
    ref: e,
    trapFocus: !1,
    disableOutsidePointerEvents: !1,
    onCloseAutoFocus: (o) => {
      var g;
      if ((g = A.onCloseAutoFocus) === null || g === void 0 || g.call(A, o), !o.defaultPrevented) {
        var s;
        i.current || (s = t.triggerRef.current) === null || s === void 0 || s.focus(), o.preventDefault();
      }
      i.current = !1, n.current = !1;
    },
    onInteractOutside: (o) => {
      var g, s;
      (g = A.onInteractOutside) === null || g === void 0 || g.call(A, o), o.defaultPrevented || (i.current = !0, o.detail.originalEvent.type === "pointerdown" && (n.current = !0));
      const I = o.target;
      !((s = t.triggerRef.current) === null || s === void 0) && s.contains(I) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && n.current && o.preventDefault();
    }
  }));
}), iRA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopePopover: t, trapFocus: i, onOpenAutoFocus: n, onCloseAutoFocus: o, disableOutsidePointerEvents: g, onEscapeKeyDown: s, onPointerDownOutside: I, onFocusOutside: r, onInteractOutside: a, ...C } = A, B = MD(MY, t), l = V7(t);
  return l3(), /* @__PURE__ */ u.createElement(c3, {
    asChild: !0,
    loop: !0,
    trapped: i,
    onMountAutoFocus: n,
    onUnmountAutoFocus: o
  }, /* @__PURE__ */ u.createElement(JD, {
    asChild: !0,
    disableOutsidePointerEvents: g,
    onInteractOutside: a,
    onEscapeKeyDown: s,
    onPointerDownOutside: I,
    onFocusOutside: r,
    onDismiss: () => B.onOpenChange(!1)
  }, /* @__PURE__ */ u.createElement(KR, NA({
    "data-state": nRA(B.open),
    role: "dialog",
    id: B.contentId
  }, l, C, {
    ref: e,
    style: {
      ...C.style,
      "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
      "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
      "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
    }
  }))));
});
function nRA(A) {
  return A ? "open" : "closed";
}
const $Qe = VQe, AEe = zQe, eEe = qQe, oRA = OQe;
var gRA = { exports: {} }, tEe = {
  aliceblue: [240, 248, 255],
  antiquewhite: [250, 235, 215],
  aqua: [0, 255, 255],
  aquamarine: [127, 255, 212],
  azure: [240, 255, 255],
  beige: [245, 245, 220],
  bisque: [255, 228, 196],
  black: [0, 0, 0],
  blanchedalmond: [255, 235, 205],
  blue: [0, 0, 255],
  blueviolet: [138, 43, 226],
  brown: [165, 42, 42],
  burlywood: [222, 184, 135],
  cadetblue: [95, 158, 160],
  chartreuse: [127, 255, 0],
  chocolate: [210, 105, 30],
  coral: [255, 127, 80],
  cornflowerblue: [100, 149, 237],
  cornsilk: [255, 248, 220],
  crimson: [220, 20, 60],
  cyan: [0, 255, 255],
  darkblue: [0, 0, 139],
  darkcyan: [0, 139, 139],
  darkgoldenrod: [184, 134, 11],
  darkgray: [169, 169, 169],
  darkgreen: [0, 100, 0],
  darkgrey: [169, 169, 169],
  darkkhaki: [189, 183, 107],
  darkmagenta: [139, 0, 139],
  darkolivegreen: [85, 107, 47],
  darkorange: [255, 140, 0],
  darkorchid: [153, 50, 204],
  darkred: [139, 0, 0],
  darksalmon: [233, 150, 122],
  darkseagreen: [143, 188, 143],
  darkslateblue: [72, 61, 139],
  darkslategray: [47, 79, 79],
  darkslategrey: [47, 79, 79],
  darkturquoise: [0, 206, 209],
  darkviolet: [148, 0, 211],
  deeppink: [255, 20, 147],
  deepskyblue: [0, 191, 255],
  dimgray: [105, 105, 105],
  dimgrey: [105, 105, 105],
  dodgerblue: [30, 144, 255],
  firebrick: [178, 34, 34],
  floralwhite: [255, 250, 240],
  forestgreen: [34, 139, 34],
  fuchsia: [255, 0, 255],
  gainsboro: [220, 220, 220],
  ghostwhite: [248, 248, 255],
  gold: [255, 215, 0],
  goldenrod: [218, 165, 32],
  gray: [128, 128, 128],
  green: [0, 128, 0],
  greenyellow: [173, 255, 47],
  grey: [128, 128, 128],
  honeydew: [240, 255, 240],
  hotpink: [255, 105, 180],
  indianred: [205, 92, 92],
  indigo: [75, 0, 130],
  ivory: [255, 255, 240],
  khaki: [240, 230, 140],
  lavender: [230, 230, 250],
  lavenderblush: [255, 240, 245],
  lawngreen: [124, 252, 0],
  lemonchiffon: [255, 250, 205],
  lightblue: [173, 216, 230],
  lightcoral: [240, 128, 128],
  lightcyan: [224, 255, 255],
  lightgoldenrodyellow: [250, 250, 210],
  lightgray: [211, 211, 211],
  lightgreen: [144, 238, 144],
  lightgrey: [211, 211, 211],
  lightpink: [255, 182, 193],
  lightsalmon: [255, 160, 122],
  lightseagreen: [32, 178, 170],
  lightskyblue: [135, 206, 250],
  lightslategray: [119, 136, 153],
  lightslategrey: [119, 136, 153],
  lightsteelblue: [176, 196, 222],
  lightyellow: [255, 255, 224],
  lime: [0, 255, 0],
  limegreen: [50, 205, 50],
  linen: [250, 240, 230],
  magenta: [255, 0, 255],
  maroon: [128, 0, 0],
  mediumaquamarine: [102, 205, 170],
  mediumblue: [0, 0, 205],
  mediumorchid: [186, 85, 211],
  mediumpurple: [147, 112, 219],
  mediumseagreen: [60, 179, 113],
  mediumslateblue: [123, 104, 238],
  mediumspringgreen: [0, 250, 154],
  mediumturquoise: [72, 209, 204],
  mediumvioletred: [199, 21, 133],
  midnightblue: [25, 25, 112],
  mintcream: [245, 255, 250],
  mistyrose: [255, 228, 225],
  moccasin: [255, 228, 181],
  navajowhite: [255, 222, 173],
  navy: [0, 0, 128],
  oldlace: [253, 245, 230],
  olive: [128, 128, 0],
  olivedrab: [107, 142, 35],
  orange: [255, 165, 0],
  orangered: [255, 69, 0],
  orchid: [218, 112, 214],
  palegoldenrod: [238, 232, 170],
  palegreen: [152, 251, 152],
  paleturquoise: [175, 238, 238],
  palevioletred: [219, 112, 147],
  papayawhip: [255, 239, 213],
  peachpuff: [255, 218, 185],
  peru: [205, 133, 63],
  pink: [255, 192, 203],
  plum: [221, 160, 221],
  powderblue: [176, 224, 230],
  purple: [128, 0, 128],
  rebeccapurple: [102, 51, 153],
  red: [255, 0, 0],
  rosybrown: [188, 143, 143],
  royalblue: [65, 105, 225],
  saddlebrown: [139, 69, 19],
  salmon: [250, 128, 114],
  sandybrown: [244, 164, 96],
  seagreen: [46, 139, 87],
  seashell: [255, 245, 238],
  sienna: [160, 82, 45],
  silver: [192, 192, 192],
  skyblue: [135, 206, 235],
  slateblue: [106, 90, 205],
  slategray: [112, 128, 144],
  slategrey: [112, 128, 144],
  snow: [255, 250, 250],
  springgreen: [0, 255, 127],
  steelblue: [70, 130, 180],
  tan: [210, 180, 140],
  teal: [0, 128, 128],
  thistle: [216, 191, 216],
  tomato: [255, 99, 71],
  turquoise: [64, 224, 208],
  violet: [238, 130, 238],
  wheat: [245, 222, 179],
  white: [255, 255, 255],
  whitesmoke: [245, 245, 245],
  yellow: [255, 255, 0],
  yellowgreen: [154, 205, 50]
}, sRA = { exports: {} }, iEe = function(A) {
  return !A || typeof A == "string" ? !1 : A instanceof Array || Array.isArray(A) || A.length >= 0 && (A.splice instanceof Function || Object.getOwnPropertyDescriptor(A, A.length - 1) && A.constructor.name !== "String");
}, nEe = iEe, oEe = Array.prototype.concat, gEe = Array.prototype.slice, CcA = sRA.exports = function(A) {
  for (var e = [], t = 0, i = A.length; t < i; t++) {
    var n = A[t];
    nEe(n) ? e = oEe.call(e, gEe.call(n)) : e.push(n);
  }
  return e;
};
CcA.wrap = function(A) {
  return function() {
    return A(CcA(arguments));
  };
};
var sEe = sRA.exports, uN = tEe, XR = sEe, IRA = Object.hasOwnProperty, aRA = /* @__PURE__ */ Object.create(null);
for (var J5 in uN)
  IRA.call(uN, J5) && (aRA[uN[J5]] = J5);
var vI = gRA.exports = {
  to: {},
  get: {}
};
vI.get = function(A) {
  var e = A.substring(0, 3).toLowerCase(), t, i;
  switch (e) {
    case "hsl":
      t = vI.get.hsl(A), i = "hsl";
      break;
    case "hwb":
      t = vI.get.hwb(A), i = "hwb";
      break;
    default:
      t = vI.get.rgb(A), i = "rgb";
      break;
  }
  return t ? { model: i, value: t } : null;
};
vI.get.rgb = function(A) {
  if (!A)
    return null;
  var e = /^#([a-f0-9]{3,4})$/i, t = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i, i = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, n = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, o = /^(\w+)$/, g = [0, 0, 0, 1], s, I, r;
  if (s = A.match(t)) {
    for (r = s[2], s = s[1], I = 0; I < 3; I++) {
      var a = I * 2;
      g[I] = parseInt(s.slice(a, a + 2), 16);
    }
    r && (g[3] = parseInt(r, 16) / 255);
  } else if (s = A.match(e)) {
    for (s = s[1], r = s[3], I = 0; I < 3; I++)
      g[I] = parseInt(s[I] + s[I], 16);
    r && (g[3] = parseInt(r + r, 16) / 255);
  } else if (s = A.match(i)) {
    for (I = 0; I < 3; I++)
      g[I] = parseInt(s[I + 1], 0);
    s[4] && (s[5] ? g[3] = parseFloat(s[4]) * 0.01 : g[3] = parseFloat(s[4]));
  } else if (s = A.match(n)) {
    for (I = 0; I < 3; I++)
      g[I] = Math.round(parseFloat(s[I + 1]) * 2.55);
    s[4] && (s[5] ? g[3] = parseFloat(s[4]) * 0.01 : g[3] = parseFloat(s[4]));
  } else
    return (s = A.match(o)) ? s[1] === "transparent" ? [0, 0, 0, 0] : IRA.call(uN, s[1]) ? (g = uN[s[1]], g[3] = 1, g) : null : null;
  for (I = 0; I < 3; I++)
    g[I] = bu(g[I], 0, 255);
  return g[3] = bu(g[3], 0, 1), g;
};
vI.get.hsl = function(A) {
  if (!A)
    return null;
  var e = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, t = A.match(e);
  if (t) {
    var i = parseFloat(t[4]), n = (parseFloat(t[1]) % 360 + 360) % 360, o = bu(parseFloat(t[2]), 0, 100), g = bu(parseFloat(t[3]), 0, 100), s = bu(isNaN(i) ? 1 : i, 0, 1);
    return [n, o, g, s];
  }
  return null;
};
vI.get.hwb = function(A) {
  if (!A)
    return null;
  var e = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, t = A.match(e);
  if (t) {
    var i = parseFloat(t[4]), n = (parseFloat(t[1]) % 360 + 360) % 360, o = bu(parseFloat(t[2]), 0, 100), g = bu(parseFloat(t[3]), 0, 100), s = bu(isNaN(i) ? 1 : i, 0, 1);
    return [n, o, g, s];
  }
  return null;
};
vI.to.hex = function() {
  var A = XR(arguments);
  return "#" + MM(A[0]) + MM(A[1]) + MM(A[2]) + (A[3] < 1 ? MM(Math.round(A[3] * 255)) : "");
};
vI.to.rgb = function() {
  var A = XR(arguments);
  return A.length < 4 || A[3] === 1 ? "rgb(" + Math.round(A[0]) + ", " + Math.round(A[1]) + ", " + Math.round(A[2]) + ")" : "rgba(" + Math.round(A[0]) + ", " + Math.round(A[1]) + ", " + Math.round(A[2]) + ", " + A[3] + ")";
};
vI.to.rgb.percent = function() {
  var A = XR(arguments), e = Math.round(A[0] / 255 * 100), t = Math.round(A[1] / 255 * 100), i = Math.round(A[2] / 255 * 100);
  return A.length < 4 || A[3] === 1 ? "rgb(" + e + "%, " + t + "%, " + i + "%)" : "rgba(" + e + "%, " + t + "%, " + i + "%, " + A[3] + ")";
};
vI.to.hsl = function() {
  var A = XR(arguments);
  return A.length < 4 || A[3] === 1 ? "hsl(" + A[0] + ", " + A[1] + "%, " + A[2] + "%)" : "hsla(" + A[0] + ", " + A[1] + "%, " + A[2] + "%, " + A[3] + ")";
};
vI.to.hwb = function() {
  var A = XR(arguments), e = "";
  return A.length >= 4 && A[3] !== 1 && (e = ", " + A[3]), "hwb(" + A[0] + ", " + A[1] + "%, " + A[2] + "%" + e + ")";
};
vI.to.keyword = function(A) {
  return aRA[A.slice(0, 3)];
};
function bu(A, e, t) {
  return Math.min(Math.max(e, A), t);
}
function MM(A) {
  var e = Math.round(A).toString(16).toUpperCase();
  return e.length < 2 ? "0" + e : e;
}
var IEe = gRA.exports;
const jq = /* @__PURE__ */ Br(IEe), xY = {
  name: "rgb",
  min: [0, 0, 0],
  max: [255, 255, 255],
  channel: ["red", "green", "blue"],
  alias: ["RGB"]
}, XH = {
  name: "hsl",
  min: [0, 0, 0],
  max: [360, 100, 100],
  channel: ["hue", "saturation", "lightness"],
  alias: ["HSL"],
  rgb: function(A) {
    var e = A[0] / 360, t = A[1] / 100, i = A[2] / 100, n, o, g, s, I, r = 0;
    if (t === 0)
      return I = i * 255, [I, I, I];
    for (o = i < 0.5 ? i * (1 + t) : i + t - i * t, n = 2 * i - o, s = [0, 0, 0]; r < 3; )
      g = e + 1 / 3 * -(r - 1), g < 0 ? g++ : g > 1 && g--, I = 6 * g < 1 ? n + (o - n) * 6 * g : 2 * g < 1 ? o : 3 * g < 2 ? n + (o - n) * (2 / 3 - g) * 6 : n, s[r++] = I * 255;
    return s;
  }
};
xY.hsl = function(A) {
  var e = A[0] / 255, t = A[1] / 255, i = A[2] / 255, n = Math.min(e, t, i), o = Math.max(e, t, i), g = o - n, s, I, r;
  return o === n ? s = 0 : e === o ? s = (t - i) / g : t === o ? s = 2 + (i - e) / g : i === o && (s = 4 + (e - t) / g), s = Math.min(s * 60, 360), s < 0 && (s += 360), r = (n + o) / 2, o === n ? I = 0 : r <= 0.5 ? I = g / (o + n) : I = g / (2 - o - n), [s, I * 100, r * 100];
};
const X7 = {
  name: "hsv",
  min: [0, 0, 0],
  max: [360, 100, 100],
  channel: ["hue", "saturation", "value"],
  alias: ["HSV", "HSB"],
  rgb: function(A) {
    var e = A[0] / 60, t = A[1] / 100, i = A[2] / 100, n = Math.floor(e) % 6, o = e - Math.floor(e), g = 255 * i * (1 - t), s = 255 * i * (1 - t * o), I = 255 * i * (1 - t * (1 - o));
    switch (i *= 255, n) {
      case 0:
        return [i, I, g];
      case 1:
        return [s, i, g];
      case 2:
        return [g, i, I];
      case 3:
        return [g, s, i];
      case 4:
        return [I, g, i];
      case 5:
        return [i, g, s];
    }
  },
  hsl: function(A) {
    var e = A[0], t = A[1] / 100, i = A[2] / 100, n, o;
    return o = (2 - t) * i, n = t * i, n /= o <= 1 ? o : 2 - o, n = n || 0, o /= 2, [e, n * 100, o * 100];
  }
};
xY.hsv = function(A) {
  var e = A[0], t = A[1], i = A[2], n = Math.min(e, t, i), o = Math.max(e, t, i), g = o - n, s, I, r;
  return o === 0 ? I = 0 : I = g / o * 100, o === n ? s = 0 : e === o ? s = (t - i) / g : t === o ? s = 2 + (i - e) / g : i === o && (s = 4 + (e - t) / g), s = Math.min(s * 60, 360), s < 0 && (s += 360), r = o / 255 * 1e3 / 10, [s, I, r];
};
XH.hsv = function(A) {
  var e = A[0], t = A[1] / 100, i = A[2] / 100, n, o;
  return i *= 2, t *= i <= 1 ? i : 2 - i, o = (i + t) / 2, n = 2 * t / (i + t) || 0, [e, n * 100, o * 100];
};
var rRA = {
  name: "hwb",
  min: [0, 0, 0],
  max: [360, 100, 100],
  channel: ["hue", "whiteness", "blackness"],
  alias: ["HWB"],
  // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
  rgb: function(A) {
    var e = A[0] / 360, t = A[1] / 100, i = A[2] / 100, n = t + i, o, g, s, I, r, a, C;
    switch (n > 1 && (t /= n, i /= n), o = Math.floor(6 * e), g = 1 - i, s = 6 * e - o, o & 1 && (s = 1 - s), I = t + s * (g - t), o) {
      default:
      case 6:
      case 0:
        r = g, a = I, C = t;
        break;
      case 1:
        r = I, a = g, C = t;
        break;
      case 2:
        r = t, a = g, C = I;
        break;
      case 3:
        r = t, a = I, C = g;
        break;
      case 4:
        r = I, a = t, C = g;
        break;
      case 5:
        r = g, a = t, C = I;
        break;
    }
    return [r * 255, a * 255, C * 255];
  },
  // http://alvyray.com/Papers/CG/HWB_JGTv208.pdf
  hsv: function(A) {
    var e = A[0], t = A[1], i = A[2], n, o;
    return t + i >= 100 ? (n = 0, o = 100 * t / (t + i)) : (n = 100 - t / (1 - i / 100), o = 100 - i), [e, n, o];
  },
  hsl: function(A) {
    return X7.hsl(rRA.hsv(A));
  }
};
xY.hwb = function(A) {
  var e = A[0], t = A[1], i = A[2], n = xY.hsl(A)[0], o = 1 / 255 * Math.min(e, Math.min(t, i));
  return i = 1 - 1 / 255 * Math.max(e, Math.max(t, i)), [n, o * 100, i * 100];
};
X7.hwb = function(A) {
  var e = A[0], t = A[1], i = A[2];
  return [e, i === 0 ? 0 : i * (1 - t / 100), 100 - i];
};
XH.hwb = function(A) {
  return X7.hwb(XH.hsv(A));
};
var CRA = {}, BRA = {}, z7 = { exports: {} }, $i = String, lRA = function() {
  return { isColorSupported: !1, reset: $i, bold: $i, dim: $i, italic: $i, underline: $i, inverse: $i, hidden: $i, strikethrough: $i, black: $i, red: $i, green: $i, yellow: $i, blue: $i, magenta: $i, cyan: $i, white: $i, gray: $i, bgBlack: $i, bgRed: $i, bgGreen: $i, bgYellow: $i, bgBlue: $i, bgMagenta: $i, bgCyan: $i, bgWhite: $i };
};
z7.exports = lRA();
z7.exports.createColors = lRA;
var aEe = z7.exports;
(function(A) {
  Object.defineProperty(A, "__esModule", {
    value: !0
  });
  function e(I, r) {
    for (var a in r)
      Object.defineProperty(I, a, {
        enumerable: !0,
        get: r[a]
      });
  }
  e(A, {
    dim: function() {
      return g;
    },
    default: function() {
      return s;
    }
  });
  const t = /* @__PURE__ */ i(aEe);
  function i(I) {
    return I && I.__esModule ? I : {
      default: I
    };
  }
  let n = /* @__PURE__ */ new Set();
  function o(I, r, a) {
    typeof process < "u" && process.env.JEST_WORKER_ID || a && n.has(a) || (a && n.add(a), console.warn(""), r.forEach((C) => console.warn(I, "-", C)));
  }
  function g(I) {
    return t.default.dim(I);
  }
  const s = {
    info(I, r) {
      o(t.default.bold(t.default.cyan("info")), ...Array.isArray(I) ? [
        I
      ] : [
        r,
        I
      ]);
    },
    warn(I, r) {
      o(t.default.bold(t.default.yellow("warn")), ...Array.isArray(I) ? [
        I
      ] : [
        r,
        I
      ]);
    },
    risk(I, r) {
      o(t.default.bold(t.default.magenta("risk")), ...Array.isArray(I) ? [
        I
      ] : [
        r,
        I
      ]);
    }
  };
})(BRA);
(function(A) {
  Object.defineProperty(A, "__esModule", {
    value: !0
  }), Object.defineProperty(A, "default", {
    enumerable: !0,
    get: function() {
      return n;
    }
  });
  const e = /* @__PURE__ */ t(BRA);
  function t(o) {
    return o && o.__esModule ? o : {
      default: o
    };
  }
  function i({ version: o, from: g, to: s }) {
    e.default.warn(`${g}-color-renamed`, [
      `As of Tailwind CSS ${o}, \`${g}\` has been renamed to \`${s}\`.`,
      "Update your configuration file to silence this warning."
    ]);
  }
  const n = {
    inherit: "inherit",
    current: "currentColor",
    transparent: "transparent",
    black: "#000",
    white: "#fff",
    slate: {
      50: "#f8fafc",
      100: "#f1f5f9",
      200: "#e2e8f0",
      300: "#cbd5e1",
      400: "#94a3b8",
      500: "#64748b",
      600: "#475569",
      700: "#334155",
      800: "#1e293b",
      900: "#0f172a",
      950: "#020617"
    },
    gray: {
      50: "#f9fafb",
      100: "#f3f4f6",
      200: "#e5e7eb",
      300: "#d1d5db",
      400: "#9ca3af",
      500: "#6b7280",
      600: "#4b5563",
      700: "#374151",
      800: "#1f2937",
      900: "#111827",
      950: "#030712"
    },
    zinc: {
      50: "#fafafa",
      100: "#f4f4f5",
      200: "#e4e4e7",
      300: "#d4d4d8",
      400: "#a1a1aa",
      500: "#71717a",
      600: "#52525b",
      700: "#3f3f46",
      800: "#27272a",
      900: "#18181b",
      950: "#09090b"
    },
    neutral: {
      50: "#fafafa",
      100: "#f5f5f5",
      200: "#e5e5e5",
      300: "#d4d4d4",
      400: "#a3a3a3",
      500: "#737373",
      600: "#525252",
      700: "#404040",
      800: "#262626",
      900: "#171717",
      950: "#0a0a0a"
    },
    stone: {
      50: "#fafaf9",
      100: "#f5f5f4",
      200: "#e7e5e4",
      300: "#d6d3d1",
      400: "#a8a29e",
      500: "#78716c",
      600: "#57534e",
      700: "#44403c",
      800: "#292524",
      900: "#1c1917",
      950: "#0c0a09"
    },
    red: {
      50: "#fef2f2",
      100: "#fee2e2",
      200: "#fecaca",
      300: "#fca5a5",
      400: "#f87171",
      500: "#ef4444",
      600: "#dc2626",
      700: "#b91c1c",
      800: "#991b1b",
      900: "#7f1d1d",
      950: "#450a0a"
    },
    orange: {
      50: "#fff7ed",
      100: "#ffedd5",
      200: "#fed7aa",
      300: "#fdba74",
      400: "#fb923c",
      500: "#f97316",
      600: "#ea580c",
      700: "#c2410c",
      800: "#9a3412",
      900: "#7c2d12",
      950: "#431407"
    },
    amber: {
      50: "#fffbeb",
      100: "#fef3c7",
      200: "#fde68a",
      300: "#fcd34d",
      400: "#fbbf24",
      500: "#f59e0b",
      600: "#d97706",
      700: "#b45309",
      800: "#92400e",
      900: "#78350f",
      950: "#451a03"
    },
    yellow: {
      50: "#fefce8",
      100: "#fef9c3",
      200: "#fef08a",
      300: "#fde047",
      400: "#facc15",
      500: "#eab308",
      600: "#ca8a04",
      700: "#a16207",
      800: "#854d0e",
      900: "#713f12",
      950: "#422006"
    },
    lime: {
      50: "#f7fee7",
      100: "#ecfccb",
      200: "#d9f99d",
      300: "#bef264",
      400: "#a3e635",
      500: "#84cc16",
      600: "#65a30d",
      700: "#4d7c0f",
      800: "#3f6212",
      900: "#365314",
      950: "#1a2e05"
    },
    green: {
      50: "#f0fdf4",
      100: "#dcfce7",
      200: "#bbf7d0",
      300: "#86efac",
      400: "#4ade80",
      500: "#22c55e",
      600: "#16a34a",
      700: "#15803d",
      800: "#166534",
      900: "#14532d",
      950: "#052e16"
    },
    emerald: {
      50: "#ecfdf5",
      100: "#d1fae5",
      200: "#a7f3d0",
      300: "#6ee7b7",
      400: "#34d399",
      500: "#10b981",
      600: "#059669",
      700: "#047857",
      800: "#065f46",
      900: "#064e3b",
      950: "#022c22"
    },
    teal: {
      50: "#f0fdfa",
      100: "#ccfbf1",
      200: "#99f6e4",
      300: "#5eead4",
      400: "#2dd4bf",
      500: "#14b8a6",
      600: "#0d9488",
      700: "#0f766e",
      800: "#115e59",
      900: "#134e4a",
      950: "#042f2e"
    },
    cyan: {
      50: "#ecfeff",
      100: "#cffafe",
      200: "#a5f3fc",
      300: "#67e8f9",
      400: "#22d3ee",
      500: "#06b6d4",
      600: "#0891b2",
      700: "#0e7490",
      800: "#155e75",
      900: "#164e63",
      950: "#083344"
    },
    sky: {
      50: "#f0f9ff",
      100: "#e0f2fe",
      200: "#bae6fd",
      300: "#7dd3fc",
      400: "#38bdf8",
      500: "#0ea5e9",
      600: "#0284c7",
      700: "#0369a1",
      800: "#075985",
      900: "#0c4a6e",
      950: "#082f49"
    },
    blue: {
      50: "#eff6ff",
      100: "#dbeafe",
      200: "#bfdbfe",
      300: "#93c5fd",
      400: "#60a5fa",
      500: "#3b82f6",
      600: "#2563eb",
      700: "#1d4ed8",
      800: "#1e40af",
      900: "#1e3a8a",
      950: "#172554"
    },
    indigo: {
      50: "#eef2ff",
      100: "#e0e7ff",
      200: "#c7d2fe",
      300: "#a5b4fc",
      400: "#818cf8",
      500: "#6366f1",
      600: "#4f46e5",
      700: "#4338ca",
      800: "#3730a3",
      900: "#312e81",
      950: "#1e1b4b"
    },
    violet: {
      50: "#f5f3ff",
      100: "#ede9fe",
      200: "#ddd6fe",
      300: "#c4b5fd",
      400: "#a78bfa",
      500: "#8b5cf6",
      600: "#7c3aed",
      700: "#6d28d9",
      800: "#5b21b6",
      900: "#4c1d95",
      950: "#2e1065"
    },
    purple: {
      50: "#faf5ff",
      100: "#f3e8ff",
      200: "#e9d5ff",
      300: "#d8b4fe",
      400: "#c084fc",
      500: "#a855f7",
      600: "#9333ea",
      700: "#7e22ce",
      800: "#6b21a8",
      900: "#581c87",
      950: "#3b0764"
    },
    fuchsia: {
      50: "#fdf4ff",
      100: "#fae8ff",
      200: "#f5d0fe",
      300: "#f0abfc",
      400: "#e879f9",
      500: "#d946ef",
      600: "#c026d3",
      700: "#a21caf",
      800: "#86198f",
      900: "#701a75",
      950: "#4a044e"
    },
    pink: {
      50: "#fdf2f8",
      100: "#fce7f3",
      200: "#fbcfe8",
      300: "#f9a8d4",
      400: "#f472b6",
      500: "#ec4899",
      600: "#db2777",
      700: "#be185d",
      800: "#9d174d",
      900: "#831843",
      950: "#500724"
    },
    rose: {
      50: "#fff1f2",
      100: "#ffe4e6",
      200: "#fecdd3",
      300: "#fda4af",
      400: "#fb7185",
      500: "#f43f5e",
      600: "#e11d48",
      700: "#be123c",
      800: "#9f1239",
      900: "#881337",
      950: "#4c0519"
    },
    get lightBlue() {
      return i({
        version: "v2.2",
        from: "lightBlue",
        to: "sky"
      }), this.sky;
    },
    get warmGray() {
      return i({
        version: "v3.0",
        from: "warmGray",
        to: "stone"
      }), this.stone;
    },
    get trueGray() {
      return i({
        version: "v3.0",
        from: "trueGray",
        to: "neutral"
      }), this.neutral;
    },
    get coolGray() {
      return i({
        version: "v3.0",
        from: "coolGray",
        to: "gray"
      }), this.gray;
    },
    get blueGray() {
      return i({
        version: "v3.0",
        from: "blueGray",
        to: "slate"
      }), this.slate;
    }
  };
})(CRA);
let N5 = CRA;
var rEe = (N5.__esModule ? N5 : { default: N5 }).default;
const wu = /* @__PURE__ */ Br(rEe);
function CEe(A) {
  const e = A.split("-");
  if (e.length === 2) {
    const [t, i] = e;
    if (wu[t] && wu[t][i])
      return jq.get(wu[t][i]);
  }
  return jq.get(A);
}
function cRA(A) {
  const e = CEe(A);
  if (e) {
    if (e.model === "hsl")
      return e.value;
    if (e.model === "rgb")
      return xY.hsl(e.value);
    if (e.model === "hwb")
      return rRA.hsl(e.value);
  }
  throw new Error(`cannot parse color ${A}`);
}
function BEe(A) {
  const [e, t, i] = cRA(A);
  return `${e} ${t}% ${i}%`;
}
function QRA(A) {
  return jq.to.hex(XH.rgb(cRA(A)));
}
function BcA(A) {
  return Object.entries(A).map(([e, t]) => `--${e}:${BEe(t)};`).join("");
}
const lcA = {
  light: {
    destructive: "hsl(0 84.2% 60.2%)",
    "destructive-foreground": "hsl(0 0% 98%)",
    dimension: "hsl(217.2 91.2% 59.8%)",
    measure: "hsl(270.7 91% 65.1%)"
  },
  dark: {
    destructive: "hsl(0 62.8% 30.6%)",
    "destructive-foreground": "hsl(0 0% 98%)",
    dimension: "hsl(213.1 93.9% 67.8%)",
    measure: "hsl(270 95.2% 75.3%)"
  }
};
function ccA(A, e) {
  return {
    ...e,
    card: A.background,
    "card-foreground": A.foreground,
    popover: A.background,
    "popover-foreground": A.foreground,
    secondary: A.muted,
    "secondary-foreground": A.primary,
    accent: A.muted,
    "accent-foreground": A.primary,
    input: A.border,
    ...A
  };
}
function lEe(A) {
  return `:host{${BcA(ccA(A.light, lcA.light))}}
.dark{${BcA(ccA(A.dark, lcA.dark))}}`;
}
function zR(A) {
  return {
    light: {
      background: "white",
      foreground: A[950],
      primary: A[900],
      "primary-foreground": A[50],
      muted: A[100],
      "muted-foreground": A[500],
      border: A[200],
      ring: A[950]
    },
    dark: {
      background: A[950],
      foreground: A[50],
      primary: A[50],
      "primary-foreground": A[900],
      muted: A[800],
      "muted-foreground": A[400],
      border: A[800],
      ring: A[300]
    }
  };
}
const ERA = zR(wu.zinc);
zR(wu.slate);
zR(wu.gray);
zR(wu.neutral);
zR(wu.stone);
const FQ = u.createContext("light"), T7 = u.createContext({}), xD = u.createContext(null), _7 = u.createContext(ERA), q7 = $Qe, O7 = AEe, h3 = u.forwardRef(({ className: A, align: e = "center", sideOffset: t = 4, ...i }, n) => u.createElement(
  eEe,
  { container: u.useContext(xD) },
  u.createElement(oRA, { ref: n, align: e, sideOffset: t, className: me("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", A), ...i })
));
h3.displayName = oRA.displayName;
function cEe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24",
    fill: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    fillRule: "evenodd",
    d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z",
    clipRule: "evenodd"
  }));
}
const QEe = u.forwardRef(cEe), EEe = QEe;
function uEe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24",
    fill: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    fillRule: "evenodd",
    d: "M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 00-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 00-2.282.819l-.922 1.597a1.875 1.875 0 00.432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 000 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 00-.432 2.385l.922 1.597a1.875 1.875 0 002.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 002.28-.819l.923-1.597a1.875 1.875 0 00-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 000-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 00-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 00-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 00-1.85-1.567h-1.843zM12 15.75a3.75 3.75 0 100-7.5 3.75 3.75 0 000 7.5z",
    clipRule: "evenodd"
  }));
}
const dEe = u.forwardRef(uEe), hEe = dEe;
function mEe({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24",
    fill: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    d: "M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32l8.4-8.4z"
  }), /* @__PURE__ */ u.createElement("path", {
    d: "M5.25 5.25a3 3 0 00-3 3v10.5a3 3 0 003 3h10.5a3 3 0 003-3V13.5a.75.75 0 00-1.5 0v5.25a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5V8.25a1.5 1.5 0 011.5-1.5h5.25a.75.75 0 000-1.5H5.25z"
  }));
}
const pEe = u.forwardRef(mEe), yEe = pEe, uRA = /* @__PURE__ */ u.forwardRef((A, e) => /* @__PURE__ */ u.createElement(ze.span, NA({}, A, {
  ref: e,
  style: {
    // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
    position: "absolute",
    border: 0,
    width: 1,
    height: 1,
    padding: 0,
    margin: -1,
    overflow: "hidden",
    clip: "rect(0, 0, 0, 0)",
    whiteSpace: "nowrap",
    wordWrap: "normal",
    ...A.style
  }
}))), bEe = uRA, [m3, qVt] = gg("Tooltip", [
  yl
]), j7 = yl(), wEe = "TooltipProvider", fEe = 700, Pq = "tooltip.open", [DEe, P7] = m3(wEe), GEe = (A) => {
  const { __scopeTooltip: e, delayDuration: t = fEe, skipDelayDuration: i = 300, disableHoverableContent: n = !1, children: o } = A, [g, s] = u.useState(!0), I = u.useRef(!1), r = u.useRef(0);
  return u.useEffect(() => {
    const a = r.current;
    return () => window.clearTimeout(a);
  }, []), /* @__PURE__ */ u.createElement(DEe, {
    scope: e,
    isOpenDelayed: g,
    delayDuration: t,
    onOpen: u.useCallback(() => {
      window.clearTimeout(r.current), s(!1);
    }, []),
    onClose: u.useCallback(() => {
      window.clearTimeout(r.current), r.current = window.setTimeout(
        () => s(!0),
        i
      );
    }, [
      i
    ]),
    isPointerInTransitRef: I,
    onPointerInTransitChange: u.useCallback((a) => {
      I.current = a;
    }, []),
    disableHoverableContent: n
  }, o);
}, $7 = "Tooltip", [kEe, p3] = m3($7), JEe = (A) => {
  const { __scopeTooltip: e, children: t, open: i, defaultOpen: n = !1, onOpenChange: o, disableHoverableContent: g, delayDuration: s } = A, I = P7($7, A.__scopeTooltip), r = j7(e), [a, C] = u.useState(null), B = za(), l = u.useRef(0), Q = g ?? I.disableHoverableContent, E = s ?? I.delayDuration, d = u.useRef(!1), [m = !1, y] = as({
    prop: i,
    defaultProp: n,
    onChange: (F) => {
      F ? (I.onOpen(), document.dispatchEvent(new CustomEvent(Pq))) : I.onClose(), o == null || o(F);
    }
  }), f = u.useMemo(() => m ? d.current ? "delayed-open" : "instant-open" : "closed", [
    m
  ]), w = u.useCallback(() => {
    window.clearTimeout(l.current), d.current = !1, y(!0);
  }, [
    y
  ]), G = u.useCallback(() => {
    window.clearTimeout(l.current), y(!1);
  }, [
    y
  ]), R = u.useCallback(() => {
    window.clearTimeout(l.current), l.current = window.setTimeout(() => {
      d.current = !0, y(!0);
    }, E);
  }, [
    E,
    y
  ]);
  return u.useEffect(() => () => window.clearTimeout(l.current), []), /* @__PURE__ */ u.createElement(ZR, r, /* @__PURE__ */ u.createElement(kEe, {
    scope: e,
    contentId: B,
    open: m,
    stateAttribute: f,
    trigger: a,
    onTriggerChange: C,
    onTriggerEnter: u.useCallback(() => {
      I.isOpenDelayed ? R() : w();
    }, [
      I.isOpenDelayed,
      R,
      w
    ]),
    onTriggerLeave: u.useCallback(() => {
      Q ? G() : window.clearTimeout(l.current);
    }, [
      G,
      Q
    ]),
    onOpen: w,
    onClose: G,
    disableHoverableContent: Q
  }, t));
}, QcA = "TooltipTrigger", NEe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTooltip: t, ...i } = A, n = p3(QcA, t), o = P7(QcA, t), g = j7(t), s = u.useRef(null), I = Dt(e, s, n.onTriggerChange), r = u.useRef(!1), a = u.useRef(!1), C = u.useCallback(
    () => r.current = !1,
    []
  );
  return u.useEffect(() => () => document.removeEventListener("pointerup", C), [
    C
  ]), /* @__PURE__ */ u.createElement(WR, NA({
    asChild: !0
  }, g), /* @__PURE__ */ u.createElement(ze.button, NA({
    // We purposefully avoid adding `type=button` here because tooltip triggers are also
    // commonly anchors and the anchor `type` attribute signifies MIME type.
    "aria-describedby": n.open ? n.contentId : void 0,
    "data-state": n.stateAttribute
  }, i, {
    ref: I,
    onPointerMove: ge(A.onPointerMove, (B) => {
      B.pointerType !== "touch" && !a.current && !o.isPointerInTransitRef.current && (n.onTriggerEnter(), a.current = !0);
    }),
    onPointerLeave: ge(A.onPointerLeave, () => {
      n.onTriggerLeave(), a.current = !1;
    }),
    onPointerDown: ge(A.onPointerDown, () => {
      r.current = !0, document.addEventListener("pointerup", C, {
        once: !0
      });
    }),
    onFocus: ge(A.onFocus, () => {
      r.current || n.onOpen();
    }),
    onBlur: ge(A.onBlur, n.onClose),
    onClick: ge(A.onClick, n.onClose)
  })));
}), YEe = "TooltipPortal", [OVt, REe] = m3(YEe, {
  forceMount: void 0
}), LY = "TooltipContent", FEe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = REe(LY, A.__scopeTooltip), { forceMount: i = t.forceMount, side: n = "top", ...o } = A, g = p3(LY, A.__scopeTooltip);
  return /* @__PURE__ */ u.createElement(Ig, {
    present: i || g.open
  }, g.disableHoverableContent ? /* @__PURE__ */ u.createElement(dRA, NA({
    side: n
  }, o, {
    ref: e
  })) : /* @__PURE__ */ u.createElement(MEe, NA({
    side: n
  }, o, {
    ref: e
  })));
}), MEe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = p3(LY, A.__scopeTooltip), i = P7(LY, A.__scopeTooltip), n = u.useRef(null), o = Dt(e, n), [g, s] = u.useState(null), { trigger: I, onClose: r } = t, a = n.current, { onPointerInTransitChange: C } = i, B = u.useCallback(() => {
    s(null), C(!1);
  }, [
    C
  ]), l = u.useCallback((Q, E) => {
    const d = Q.currentTarget, m = {
      x: Q.clientX,
      y: Q.clientY
    }, y = LEe(m, d.getBoundingClientRect()), f = vEe(m, y), w = HEe(E.getBoundingClientRect()), G = ZEe([
      ...f,
      ...w
    ]);
    s(G), C(!0);
  }, [
    C
  ]);
  return u.useEffect(() => () => B(), [
    B
  ]), u.useEffect(() => {
    if (I && a) {
      const Q = (d) => l(d, a), E = (d) => l(d, I);
      return I.addEventListener("pointerleave", Q), a.addEventListener("pointerleave", E), () => {
        I.removeEventListener("pointerleave", Q), a.removeEventListener("pointerleave", E);
      };
    }
  }, [
    I,
    a,
    l,
    B
  ]), u.useEffect(() => {
    if (g) {
      const Q = (E) => {
        const d = E.target, m = {
          x: E.clientX,
          y: E.clientY
        }, y = (I == null ? void 0 : I.contains(d)) || (a == null ? void 0 : a.contains(d)), f = !SEe(m, g);
        y ? B() : f && (B(), r());
      };
      return document.addEventListener("pointermove", Q), () => document.removeEventListener("pointermove", Q);
    }
  }, [
    I,
    a,
    g,
    r,
    B
  ]), /* @__PURE__ */ u.createElement(dRA, NA({}, A, {
    ref: o
  }));
}), [xEe, jVt] = m3($7, {
  isInside: !1
}), dRA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTooltip: t, children: i, "aria-label": n, onEscapeKeyDown: o, onPointerDownOutside: g, ...s } = A, I = p3(LY, t), r = j7(t), { onClose: a } = I;
  return u.useEffect(() => (document.addEventListener(Pq, a), () => document.removeEventListener(Pq, a)), [
    a
  ]), u.useEffect(() => {
    if (I.trigger) {
      const C = (B) => {
        const l = B.target;
        l != null && l.contains(I.trigger) && a();
      };
      return window.addEventListener("scroll", C, {
        capture: !0
      }), () => window.removeEventListener("scroll", C, {
        capture: !0
      });
    }
  }, [
    I.trigger,
    a
  ]), /* @__PURE__ */ u.createElement(JD, {
    asChild: !0,
    disableOutsidePointerEvents: !1,
    onEscapeKeyDown: o,
    onPointerDownOutside: g,
    onFocusOutside: (C) => C.preventDefault(),
    onDismiss: a
  }, /* @__PURE__ */ u.createElement(KR, NA({
    "data-state": I.stateAttribute
  }, r, s, {
    ref: e,
    style: {
      ...s.style,
      "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
      "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
      "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
    }
  }), /* @__PURE__ */ u.createElement(DYA, null, i), /* @__PURE__ */ u.createElement(xEe, {
    scope: t,
    isInside: !0
  }, /* @__PURE__ */ u.createElement(bEe, {
    id: I.contentId,
    role: "tooltip"
  }, n || i))));
});
function LEe(A, e) {
  const t = Math.abs(e.top - A.y), i = Math.abs(e.bottom - A.y), n = Math.abs(e.right - A.x), o = Math.abs(e.left - A.x);
  switch (Math.min(t, i, n, o)) {
    case o:
      return "left";
    case n:
      return "right";
    case t:
      return "top";
    case i:
      return "bottom";
    default:
      throw new Error("unreachable");
  }
}
function vEe(A, e, t = 5) {
  const i = [];
  switch (e) {
    case "top":
      i.push({
        x: A.x - t,
        y: A.y + t
      }, {
        x: A.x + t,
        y: A.y + t
      });
      break;
    case "bottom":
      i.push({
        x: A.x - t,
        y: A.y - t
      }, {
        x: A.x + t,
        y: A.y - t
      });
      break;
    case "left":
      i.push({
        x: A.x + t,
        y: A.y - t
      }, {
        x: A.x + t,
        y: A.y + t
      });
      break;
    case "right":
      i.push({
        x: A.x - t,
        y: A.y - t
      }, {
        x: A.x - t,
        y: A.y + t
      });
      break;
  }
  return i;
}
function HEe(A) {
  const { top: e, right: t, bottom: i, left: n } = A;
  return [
    {
      x: n,
      y: e
    },
    {
      x: t,
      y: e
    },
    {
      x: t,
      y: i
    },
    {
      x: n,
      y: i
    }
  ];
}
function SEe(A, e) {
  const { x: t, y: i } = A;
  let n = !1;
  for (let o = 0, g = e.length - 1; o < e.length; g = o++) {
    const s = e[o].x, I = e[o].y, r = e[g].x, a = e[g].y;
    I > i != a > i && t < (r - s) * (i - I) / (a - I) + s && (n = !n);
  }
  return n;
}
function ZEe(A) {
  const e = A.slice();
  return e.sort((t, i) => t.x < i.x ? -1 : t.x > i.x ? 1 : t.y < i.y ? -1 : t.y > i.y ? 1 : 0), WEe(e);
}
function WEe(A) {
  if (A.length <= 1)
    return A.slice();
  const e = [];
  for (let i = 0; i < A.length; i++) {
    const n = A[i];
    for (; e.length >= 2; ) {
      const o = e[e.length - 1], g = e[e.length - 2];
      if ((o.x - g.x) * (n.y - g.y) >= (o.y - g.y) * (n.x - g.x))
        e.pop();
      else
        break;
    }
    e.push(n);
  }
  e.pop();
  const t = [];
  for (let i = A.length - 1; i >= 0; i--) {
    const n = A[i];
    for (; t.length >= 2; ) {
      const o = t[t.length - 1], g = t[t.length - 2];
      if ((o.x - g.x) * (n.y - g.y) >= (o.y - g.y) * (n.x - g.x))
        t.pop();
      else
        break;
    }
    t.push(n);
  }
  return t.pop(), e.length === 1 && t.length === 1 && e[0].x === t[0].x && e[0].y === t[0].y ? e : e.concat(t);
}
const KEe = GEe, UEe = JEe, VEe = NEe, hRA = FEe, mRA = KEe, pRA = UEe, yRA = VEe, AAA = u.forwardRef(({ className: A, sideOffset: e = 4, ...t }, i) => u.createElement(hRA, { ref: i, sideOffset: e, className: me("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", A), ...t }));
AAA.displayName = hRA.displayName;
function eAA(A) {
  const { openedKey: e, setOpenedKey: t, children: i, item: n } = A, { key: o, disabled: g, form: s, label: I, styles: r } = n, a = `${o}::form`, C = s && a === e && !g, B = s && A.splitOnly;
  return b.createElement(
    q7,
    { open: C, onOpenChange: (l) => t(l ? a : null) },
    b.createElement(
      mRA,
      null,
      b.createElement(
        pRA,
        null,
        b.createElement(
          yRA,
          { asChild: !0 },
          b.createElement(
            O7,
            { asChild: !0 },
            b.createElement(
              "div",
              { className: "m-0.5 rounded-md flex transition-colors hover:bg-muted hover:text-muted-foreground", style: r == null ? void 0 : r.item },
              b.createElement("div", { onClick: B ? void 0 : (l) => l.stopPropagation() }, i),
              s && b.createElement(
                Re,
                { variant: "none", size: "none", className: "cursor-pointer group flex items-center h-8 mr-1" },
                b.createElement(hEe, { style: r == null ? void 0 : r.splitIcon, className: "group-hover:translate-y-[40%] transition-transform w-2.5 h-2.5" })
              )
            )
          )
        ),
        s && b.createElement(h3, { className: "p-0 w-fit" }, s),
        b.createElement(AAA, { hideWhenDetached: !0 }, I)
      )
    )
  );
}
const XEe = u.memo(function(A) {
  const { item: e } = A, { icon: t, styles: i, disabled: n, onClick: o, href: g } = e;
  return b.createElement(
    eAA,
    { ...A, splitOnly: !o },
    g && b.createElement(
      "a",
      { href: g, target: "_blank", className: HR({ variant: "none", size: "toolbar" }), "aria-disabled": n },
      b.createElement(t, { className: "w-[18px] h-[18px]", style: i == null ? void 0 : i.icon })
    ),
    !g && b.createElement(
      Re,
      { variant: "none", size: "toolbar", onClick: o, disabled: n },
      b.createElement(t, { className: "w-[18px] h-[18px]", style: i == null ? void 0 : i.icon })
    )
  );
}), zEe = XEe, TEe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { pressed: t, defaultPressed: i = !1, onPressedChange: n, ...o } = A, [g = !1, s] = as({
    prop: t,
    onChange: n,
    defaultProp: i
  });
  return /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button",
    "aria-pressed": g,
    "data-state": g ? "on" : "off",
    "data-disabled": A.disabled ? "" : void 0
  }, o, {
    ref: e,
    onClick: ge(A.onClick, () => {
      A.disabled || s(!g);
    })
  }));
}), bRA = TEe, _Ee = B3("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground", {
  variants: {
    variant: {
      none: "",
      default: "hover:bg-muted hover:text-muted-foreground bg-transparent",
      outline: "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"
    },
    size: {
      default: "h-9 px-3",
      toolbar: "h-8 w-8",
      sm: "h-8 px-2",
      lg: "h-10 px-3"
    }
  },
  defaultVariants: {
    variant: "default",
    size: "default"
  }
}), wRA = u.forwardRef(({ className: A, variant: e, size: t, ...i }, n) => u.createElement(bRA, { ref: n, className: me(_Ee({ variant: e, size: t, className: A })), ...i }));
wRA.displayName = bRA.displayName;
const qEe = u.memo(function(A) {
  const { item: e } = A, { icon: t, disabled: i, checked: n, onChange: o, styles: g } = e;
  return b.createElement(
    eAA,
    { ...A },
    b.createElement(
      wRA,
      { variant: "none", disabled: i, size: "toolbar", pressed: n, onPressedChange: o },
      b.createElement(t, { className: "w-[18px] h-[18px]", style: g == null ? void 0 : g.icon })
    )
  );
}), OEe = qEe, Y5 = "rovingFocusGroup.onEntryFocus", jEe = {
  bubbles: !1,
  cancelable: !0
}, tAA = "RovingFocusGroup", [$q, fRA, PEe] = i3(tAA), [$Ee, LD] = gg(tAA, [
  PEe
]), [Aue, eue] = $Ee(tAA), tue = /* @__PURE__ */ u.forwardRef((A, e) => /* @__PURE__ */ u.createElement($q.Provider, {
  scope: A.__scopeRovingFocusGroup
}, /* @__PURE__ */ u.createElement($q.Slot, {
  scope: A.__scopeRovingFocusGroup
}, /* @__PURE__ */ u.createElement(iue, NA({}, A, {
  ref: e
}))))), iue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeRovingFocusGroup: t, orientation: i, loop: n = !1, dir: o, currentTabStopId: g, defaultCurrentTabStopId: s, onCurrentTabStopIdChange: I, onEntryFocus: r, ...a } = A, C = u.useRef(null), B = Dt(e, C), l = fD(o), [Q = null, E] = as({
    prop: g,
    defaultProp: s,
    onChange: I
  }), [d, m] = u.useState(!1), y = Pa(r), f = fRA(t), w = u.useRef(!1), [G, R] = u.useState(0);
  return u.useEffect(() => {
    const F = C.current;
    if (F)
      return F.addEventListener(Y5, y), () => F.removeEventListener(Y5, y);
  }, [
    y
  ]), /* @__PURE__ */ u.createElement(Aue, {
    scope: t,
    orientation: i,
    dir: l,
    loop: n,
    currentTabStopId: Q,
    onItemFocus: u.useCallback(
      (F) => E(F),
      [
        E
      ]
    ),
    onItemShiftTab: u.useCallback(
      () => m(!0),
      []
    ),
    onFocusableItemAdd: u.useCallback(
      () => R(
        (F) => F + 1
      ),
      []
    ),
    onFocusableItemRemove: u.useCallback(
      () => R(
        (F) => F - 1
      ),
      []
    )
  }, /* @__PURE__ */ u.createElement(ze.div, NA({
    tabIndex: d || G === 0 ? -1 : 0,
    "data-orientation": i
  }, a, {
    ref: B,
    style: {
      outline: "none",
      ...A.style
    },
    onMouseDown: ge(A.onMouseDown, () => {
      w.current = !0;
    }),
    onFocus: ge(A.onFocus, (F) => {
      const Z = !w.current;
      if (F.target === F.currentTarget && Z && !d) {
        const c = new CustomEvent(Y5, jEe);
        if (F.currentTarget.dispatchEvent(c), !c.defaultPrevented) {
          const J = f().filter(
            (K) => K.focusable
          ), p = J.find(
            (K) => K.active
          ), N = J.find(
            (K) => K.id === Q
          ), v = [
            p,
            N,
            ...J
          ].filter(Boolean).map(
            (K) => K.ref.current
          );
          DRA(v);
        }
      }
      w.current = !1;
    }),
    onBlur: ge(
      A.onBlur,
      () => m(!1)
    )
  })));
}), nue = "RovingFocusGroupItem", oue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeRovingFocusGroup: t, focusable: i = !0, active: n = !1, tabStopId: o, ...g } = A, s = za(), I = o || s, r = eue(nue, t), a = r.currentTabStopId === I, C = fRA(t), { onFocusableItemAdd: B, onFocusableItemRemove: l } = r;
  return u.useEffect(() => {
    if (i)
      return B(), () => l();
  }, [
    i,
    B,
    l
  ]), /* @__PURE__ */ u.createElement($q.ItemSlot, {
    scope: t,
    id: I,
    focusable: i,
    active: n
  }, /* @__PURE__ */ u.createElement(ze.span, NA({
    tabIndex: a ? 0 : -1,
    "data-orientation": r.orientation
  }, g, {
    ref: e,
    onMouseDown: ge(A.onMouseDown, (Q) => {
      i ? r.onItemFocus(I) : Q.preventDefault();
    }),
    onFocus: ge(
      A.onFocus,
      () => r.onItemFocus(I)
    ),
    onKeyDown: ge(A.onKeyDown, (Q) => {
      if (Q.key === "Tab" && Q.shiftKey) {
        r.onItemShiftTab();
        return;
      }
      if (Q.target !== Q.currentTarget)
        return;
      const E = Iue(Q, r.orientation, r.dir);
      if (E !== void 0) {
        Q.preventDefault();
        let d = C().filter(
          (m) => m.focusable
        ).map(
          (m) => m.ref.current
        );
        if (E === "last")
          d.reverse();
        else if (E === "prev" || E === "next") {
          E === "prev" && d.reverse();
          const m = d.indexOf(Q.currentTarget);
          d = r.loop ? aue(d, m + 1) : d.slice(m + 1);
        }
        setTimeout(
          () => DRA(d)
        );
      }
    })
  })));
}), gue = {
  ArrowLeft: "prev",
  ArrowUp: "prev",
  ArrowRight: "next",
  ArrowDown: "next",
  PageUp: "first",
  Home: "first",
  PageDown: "last",
  End: "last"
};
function sue(A, e) {
  return e !== "rtl" ? A : A === "ArrowLeft" ? "ArrowRight" : A === "ArrowRight" ? "ArrowLeft" : A;
}
function Iue(A, e, t) {
  const i = sue(A.key, t);
  if (!(e === "vertical" && [
    "ArrowLeft",
    "ArrowRight"
  ].includes(i)) && !(e === "horizontal" && [
    "ArrowUp",
    "ArrowDown"
  ].includes(i)))
    return gue[i];
}
function DRA(A) {
  const e = document.activeElement;
  for (const t of A)
    if (t === e || (t.focus(), document.activeElement !== e))
      return;
}
function aue(A, e) {
  return A.map(
    (t, i) => A[(e + i) % A.length]
  );
}
const iAA = tue, nAA = oue, AO = [
  "Enter",
  " "
], rue = [
  "ArrowDown",
  "PageUp",
  "Home"
], GRA = [
  "ArrowUp",
  "PageDown",
  "End"
], Cue = [
  ...rue,
  ...GRA
], Bue = {
  ltr: [
    ...AO,
    "ArrowRight"
  ],
  rtl: [
    ...AO,
    "ArrowLeft"
  ]
}, lue = {
  ltr: [
    "ArrowLeft"
  ],
  rtl: [
    "ArrowRight"
  ]
}, y3 = "Menu", [vY, cue, Que] = i3(y3), [jp, kRA] = gg(y3, [
  Que,
  yl,
  LD
]), oAA = yl(), JRA = LD(), [Eue, Pp] = jp(y3), [uue, TR] = jp(y3), due = (A) => {
  const { __scopeMenu: e, open: t = !1, children: i, dir: n, onOpenChange: o, modal: g = !0 } = A, s = oAA(e), [I, r] = u.useState(null), a = u.useRef(!1), C = Pa(o), B = fD(n);
  return u.useEffect(() => {
    const l = () => {
      a.current = !0, document.addEventListener("pointerdown", Q, {
        capture: !0,
        once: !0
      }), document.addEventListener("pointermove", Q, {
        capture: !0,
        once: !0
      });
    }, Q = () => a.current = !1;
    return document.addEventListener("keydown", l, {
      capture: !0
    }), () => {
      document.removeEventListener("keydown", l, {
        capture: !0
      }), document.removeEventListener("pointerdown", Q, {
        capture: !0
      }), document.removeEventListener("pointermove", Q, {
        capture: !0
      });
    };
  }, []), /* @__PURE__ */ u.createElement(ZR, s, /* @__PURE__ */ u.createElement(Eue, {
    scope: e,
    open: t,
    onOpenChange: C,
    content: I,
    onContentChange: r
  }, /* @__PURE__ */ u.createElement(uue, {
    scope: e,
    onClose: u.useCallback(
      () => C(!1),
      [
        C
      ]
    ),
    isUsingKeyboardRef: a,
    dir: B,
    modal: g
  }, i)));
}, NRA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeMenu: t, ...i } = A, n = oAA(t);
  return /* @__PURE__ */ u.createElement(WR, NA({}, n, i, {
    ref: e
  }));
}), YRA = "MenuPortal", [hue, RRA] = jp(YRA, {
  forceMount: void 0
}), mue = (A) => {
  const { __scopeMenu: e, forceMount: t, children: i, container: n } = A, o = Pp(YRA, e);
  return /* @__PURE__ */ u.createElement(hue, {
    scope: e,
    forceMount: t
  }, /* @__PURE__ */ u.createElement(Ig, {
    present: t || o.open
  }, /* @__PURE__ */ u.createElement(UR, {
    asChild: !0,
    container: n
  }, i)));
}, sC = "MenuContent", [pue, gAA] = jp(sC), yue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = RRA(sC, A.__scopeMenu), { forceMount: i = t.forceMount, ...n } = A, o = Pp(sC, A.__scopeMenu), g = TR(sC, A.__scopeMenu);
  return /* @__PURE__ */ u.createElement(vY.Provider, {
    scope: A.__scopeMenu
  }, /* @__PURE__ */ u.createElement(Ig, {
    present: i || o.open
  }, /* @__PURE__ */ u.createElement(vY.Slot, {
    scope: A.__scopeMenu
  }, g.modal ? /* @__PURE__ */ u.createElement(bue, NA({}, n, {
    ref: e
  })) : /* @__PURE__ */ u.createElement(wue, NA({}, n, {
    ref: e
  })))));
}), bue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = Pp(sC, A.__scopeMenu), i = u.useRef(null), n = Dt(e, i);
  return u.useEffect(() => {
    const o = i.current;
    if (o)
      return VR(o);
  }, []), /* @__PURE__ */ u.createElement(sAA, NA({}, A, {
    ref: n,
    trapFocus: t.open,
    disableOutsidePointerEvents: t.open,
    disableOutsideScroll: !0,
    onFocusOutside: ge(
      A.onFocusOutside,
      (o) => o.preventDefault(),
      {
        checkForDefaultPrevented: !1
      }
    ),
    onDismiss: () => t.onOpenChange(!1)
  }));
}), wue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = Pp(sC, A.__scopeMenu);
  return /* @__PURE__ */ u.createElement(sAA, NA({}, A, {
    ref: e,
    trapFocus: !1,
    disableOutsidePointerEvents: !1,
    disableOutsideScroll: !1,
    onDismiss: () => t.onOpenChange(!1)
  }));
}), sAA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeMenu: t, loop: i = !1, trapFocus: n, onOpenAutoFocus: o, onCloseAutoFocus: g, disableOutsidePointerEvents: s, onEntryFocus: I, onEscapeKeyDown: r, onPointerDownOutside: a, onFocusOutside: C, onInteractOutside: B, onDismiss: l, disableOutsideScroll: Q, ...E } = A, d = Pp(sC, t), m = TR(sC, t), y = oAA(t), f = JRA(t), w = cue(t), [G, R] = u.useState(null), F = u.useRef(null), Z = Dt(e, F, d.onContentChange), c = u.useRef(0), J = u.useRef(""), p = u.useRef(0), N = u.useRef(null), v = u.useRef("right"), K = u.useRef(0), U = Q ? d3 : u.Fragment, j = Q ? {
    as: rQ,
    allowPinchZoom: !0
  } : void 0, q = ($) => {
    var _, tA;
    const nA = J.current + $, AA = w().filter(
      (aA) => !aA.disabled
    ), gA = document.activeElement, rA = (_ = AA.find(
      (aA) => aA.ref.current === gA
    )) === null || _ === void 0 ? void 0 : _.textValue, sA = AA.map(
      (aA) => aA.textValue
    ), lA = Uue(sA, nA, rA), cA = (tA = AA.find(
      (aA) => aA.textValue === lA
    )) === null || tA === void 0 ? void 0 : tA.ref.current;
    (function aA(QA) {
      J.current = QA, window.clearTimeout(c.current), QA !== "" && (c.current = window.setTimeout(
        () => aA(""),
        1e3
      ));
    })(nA), cA && setTimeout(
      () => cA.focus()
    );
  };
  u.useEffect(() => () => window.clearTimeout(c.current), []), l3();
  const O = u.useCallback(($) => {
    var _, tA;
    return v.current === ((_ = N.current) === null || _ === void 0 ? void 0 : _.side) && Xue($, (tA = N.current) === null || tA === void 0 ? void 0 : tA.area);
  }, []);
  return /* @__PURE__ */ u.createElement(pue, {
    scope: t,
    searchRef: J,
    onItemEnter: u.useCallback(($) => {
      O($) && $.preventDefault();
    }, [
      O
    ]),
    onItemLeave: u.useCallback(($) => {
      var _;
      O($) || ((_ = F.current) === null || _ === void 0 || _.focus(), R(null));
    }, [
      O
    ]),
    onTriggerLeave: u.useCallback(($) => {
      O($) && $.preventDefault();
    }, [
      O
    ]),
    pointerGraceTimerRef: p,
    onPointerGraceIntentChange: u.useCallback(($) => {
      N.current = $;
    }, [])
  }, /* @__PURE__ */ u.createElement(U, j, /* @__PURE__ */ u.createElement(c3, {
    asChild: !0,
    trapped: n,
    onMountAutoFocus: ge(o, ($) => {
      var _;
      $.preventDefault(), (_ = F.current) === null || _ === void 0 || _.focus();
    }),
    onUnmountAutoFocus: g
  }, /* @__PURE__ */ u.createElement(JD, {
    asChild: !0,
    disableOutsidePointerEvents: s,
    onEscapeKeyDown: r,
    onPointerDownOutside: a,
    onFocusOutside: C,
    onInteractOutside: B,
    onDismiss: l
  }, /* @__PURE__ */ u.createElement(iAA, NA({
    asChild: !0
  }, f, {
    dir: m.dir,
    orientation: "vertical",
    loop: i,
    currentTabStopId: G,
    onCurrentTabStopIdChange: R,
    onEntryFocus: ge(I, ($) => {
      m.isUsingKeyboardRef.current || $.preventDefault();
    })
  }), /* @__PURE__ */ u.createElement(KR, NA({
    role: "menu",
    "aria-orientation": "vertical",
    "data-state": vRA(d.open),
    "data-radix-menu-content": "",
    dir: m.dir
  }, y, E, {
    ref: Z,
    style: {
      outline: "none",
      ...E.style
    },
    onKeyDown: ge(E.onKeyDown, ($) => {
      const _ = $.target.closest("[data-radix-menu-content]") === $.currentTarget, tA = $.ctrlKey || $.altKey || $.metaKey, nA = $.key.length === 1;
      _ && ($.key === "Tab" && $.preventDefault(), !tA && nA && q($.key));
      const AA = F.current;
      if ($.target !== AA || !Cue.includes($.key))
        return;
      $.preventDefault();
      const gA = w().filter(
        (rA) => !rA.disabled
      ).map(
        (rA) => rA.ref.current
      );
      GRA.includes($.key) && gA.reverse(), Wue(gA);
    }),
    onBlur: ge(A.onBlur, ($) => {
      $.currentTarget.contains($.target) || (window.clearTimeout(c.current), J.current = "");
    }),
    onPointerMove: ge(A.onPointerMove, HY(($) => {
      const _ = $.target, tA = K.current !== $.clientX;
      if ($.currentTarget.contains(_) && tA) {
        const nA = $.clientX > K.current ? "right" : "left";
        v.current = nA, K.current = $.clientX;
      }
    }))
  })))))));
}), fue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeMenu: t, ...i } = A;
  return /* @__PURE__ */ u.createElement(ze.div, NA({
    role: "group"
  }, i, {
    ref: e
  }));
}), Due = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeMenu: t, ...i } = A;
  return /* @__PURE__ */ u.createElement(ze.div, NA({}, i, {
    ref: e
  }));
}), eO = "MenuItem", EcA = "menu.itemSelect", IAA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { disabled: t = !1, onSelect: i, ...n } = A, o = u.useRef(null), g = TR(eO, A.__scopeMenu), s = gAA(eO, A.__scopeMenu), I = Dt(e, o), r = u.useRef(!1), a = () => {
    const C = o.current;
    if (!t && C) {
      const B = new CustomEvent(EcA, {
        bubbles: !0,
        cancelable: !0
      });
      C.addEventListener(
        EcA,
        (l) => i == null ? void 0 : i(l),
        {
          once: !0
        }
      ), GYA(C, B), B.defaultPrevented ? r.current = !1 : g.onClose();
    }
  };
  return /* @__PURE__ */ u.createElement(FRA, NA({}, n, {
    ref: I,
    disabled: t,
    onClick: ge(A.onClick, a),
    onPointerDown: (C) => {
      var B;
      (B = A.onPointerDown) === null || B === void 0 || B.call(A, C), r.current = !0;
    },
    onPointerUp: ge(A.onPointerUp, (C) => {
      var B;
      r.current || (B = C.currentTarget) === null || B === void 0 || B.click();
    }),
    onKeyDown: ge(A.onKeyDown, (C) => {
      const B = s.searchRef.current !== "";
      t || B && C.key === " " || AO.includes(C.key) && (C.currentTarget.click(), C.preventDefault());
    })
  }));
}), FRA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeMenu: t, disabled: i = !1, textValue: n, ...o } = A, g = gAA(eO, t), s = JRA(t), I = u.useRef(null), r = Dt(e, I), [a, C] = u.useState(!1), [B, l] = u.useState("");
  return u.useEffect(() => {
    const Q = I.current;
    if (Q) {
      var E;
      l(((E = Q.textContent) !== null && E !== void 0 ? E : "").trim());
    }
  }, [
    o.children
  ]), /* @__PURE__ */ u.createElement(vY.ItemSlot, {
    scope: t,
    disabled: i,
    textValue: n ?? B
  }, /* @__PURE__ */ u.createElement(nAA, NA({
    asChild: !0
  }, s, {
    focusable: !i
  }), /* @__PURE__ */ u.createElement(ze.div, NA({
    role: "menuitem",
    "data-highlighted": a ? "" : void 0,
    "aria-disabled": i || void 0,
    "data-disabled": i ? "" : void 0
  }, o, {
    ref: r,
    onPointerMove: ge(A.onPointerMove, HY((Q) => {
      i ? g.onItemLeave(Q) : (g.onItemEnter(Q), Q.defaultPrevented || Q.currentTarget.focus());
    })),
    onPointerLeave: ge(A.onPointerLeave, HY(
      (Q) => g.onItemLeave(Q)
    )),
    onFocus: ge(
      A.onFocus,
      () => C(!0)
    ),
    onBlur: ge(
      A.onBlur,
      () => C(!1)
    )
  }))));
}), Gue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { checked: t = !1, onCheckedChange: i, ...n } = A;
  return /* @__PURE__ */ u.createElement(xRA, {
    scope: A.__scopeMenu,
    checked: t
  }, /* @__PURE__ */ u.createElement(IAA, NA({
    role: "menuitemcheckbox",
    "aria-checked": zH(t) ? "mixed" : t
  }, n, {
    ref: e,
    "data-state": aAA(t),
    onSelect: ge(
      n.onSelect,
      () => i == null ? void 0 : i(zH(t) ? !0 : !t),
      {
        checkForDefaultPrevented: !1
      }
    )
  })));
}), kue = "MenuRadioGroup", [Jue, Nue] = jp(kue, {
  value: void 0,
  onValueChange: () => {
  }
}), Yue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { value: t, onValueChange: i, ...n } = A, o = Pa(i);
  return /* @__PURE__ */ u.createElement(Jue, {
    scope: A.__scopeMenu,
    value: t,
    onValueChange: o
  }, /* @__PURE__ */ u.createElement(fue, NA({}, n, {
    ref: e
  })));
}), Rue = "MenuRadioItem", Fue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { value: t, ...i } = A, n = Nue(Rue, A.__scopeMenu), o = t === n.value;
  return /* @__PURE__ */ u.createElement(xRA, {
    scope: A.__scopeMenu,
    checked: o
  }, /* @__PURE__ */ u.createElement(IAA, NA({
    role: "menuitemradio",
    "aria-checked": o
  }, i, {
    ref: e,
    "data-state": aAA(o),
    onSelect: ge(i.onSelect, () => {
      var g;
      return (g = n.onValueChange) === null || g === void 0 ? void 0 : g.call(n, t);
    }, {
      checkForDefaultPrevented: !1
    })
  })));
}), MRA = "MenuItemIndicator", [xRA, Mue] = jp(MRA, {
  checked: !1
}), xue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeMenu: t, forceMount: i, ...n } = A, o = Mue(MRA, t);
  return /* @__PURE__ */ u.createElement(Ig, {
    present: i || zH(o.checked) || o.checked === !0
  }, /* @__PURE__ */ u.createElement(ze.span, NA({}, n, {
    ref: e,
    "data-state": aAA(o.checked)
  })));
}), Lue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeMenu: t, ...i } = A;
  return /* @__PURE__ */ u.createElement(ze.div, NA({
    role: "separator",
    "aria-orientation": "horizontal"
  }, i, {
    ref: e
  }));
}), vue = "MenuSub", [PVt, LRA] = jp(vue), xM = "MenuSubTrigger", Hue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = Pp(xM, A.__scopeMenu), i = TR(xM, A.__scopeMenu), n = LRA(xM, A.__scopeMenu), o = gAA(xM, A.__scopeMenu), g = u.useRef(null), { pointerGraceTimerRef: s, onPointerGraceIntentChange: I } = o, r = {
    __scopeMenu: A.__scopeMenu
  }, a = u.useCallback(() => {
    g.current && window.clearTimeout(g.current), g.current = null;
  }, []);
  return u.useEffect(
    () => a,
    [
      a
    ]
  ), u.useEffect(() => {
    const C = s.current;
    return () => {
      window.clearTimeout(C), I(null);
    };
  }, [
    s,
    I
  ]), /* @__PURE__ */ u.createElement(NRA, NA({
    asChild: !0
  }, r), /* @__PURE__ */ u.createElement(FRA, NA({
    id: n.triggerId,
    "aria-haspopup": "menu",
    "aria-expanded": t.open,
    "aria-controls": n.contentId,
    "data-state": vRA(t.open)
  }, A, {
    ref: t3(e, n.onTriggerChange),
    onClick: (C) => {
      var B;
      (B = A.onClick) === null || B === void 0 || B.call(A, C), !(A.disabled || C.defaultPrevented) && (C.currentTarget.focus(), t.open || t.onOpenChange(!0));
    },
    onPointerMove: ge(A.onPointerMove, HY((C) => {
      o.onItemEnter(C), !C.defaultPrevented && !A.disabled && !t.open && !g.current && (o.onPointerGraceIntentChange(null), g.current = window.setTimeout(() => {
        t.onOpenChange(!0), a();
      }, 100));
    })),
    onPointerLeave: ge(A.onPointerLeave, HY((C) => {
      var B;
      a();
      const l = (B = t.content) === null || B === void 0 ? void 0 : B.getBoundingClientRect();
      if (l) {
        var Q;
        const E = (Q = t.content) === null || Q === void 0 ? void 0 : Q.dataset.side, d = E === "right", m = d ? -5 : 5, y = l[d ? "left" : "right"], f = l[d ? "right" : "left"];
        o.onPointerGraceIntentChange({
          area: [
            // consistently within polygon bounds
            {
              x: C.clientX + m,
              y: C.clientY
            },
            {
              x: y,
              y: l.top
            },
            {
              x: f,
              y: l.top
            },
            {
              x: f,
              y: l.bottom
            },
            {
              x: y,
              y: l.bottom
            }
          ],
          side: E
        }), window.clearTimeout(s.current), s.current = window.setTimeout(
          () => o.onPointerGraceIntentChange(null),
          300
        );
      } else {
        if (o.onTriggerLeave(C), C.defaultPrevented)
          return;
        o.onPointerGraceIntentChange(null);
      }
    })),
    onKeyDown: ge(A.onKeyDown, (C) => {
      const B = o.searchRef.current !== "";
      if (!(A.disabled || B && C.key === " ") && Bue[i.dir].includes(C.key)) {
        var l;
        t.onOpenChange(!0), (l = t.content) === null || l === void 0 || l.focus(), C.preventDefault();
      }
    })
  })));
}), Sue = "MenuSubContent", Zue = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = RRA(sC, A.__scopeMenu), { forceMount: i = t.forceMount, ...n } = A, o = Pp(sC, A.__scopeMenu), g = TR(sC, A.__scopeMenu), s = LRA(Sue, A.__scopeMenu), I = u.useRef(null), r = Dt(e, I);
  return /* @__PURE__ */ u.createElement(vY.Provider, {
    scope: A.__scopeMenu
  }, /* @__PURE__ */ u.createElement(Ig, {
    present: i || o.open
  }, /* @__PURE__ */ u.createElement(vY.Slot, {
    scope: A.__scopeMenu
  }, /* @__PURE__ */ u.createElement(sAA, NA({
    id: s.contentId,
    "aria-labelledby": s.triggerId
  }, n, {
    ref: r,
    align: "start",
    side: g.dir === "rtl" ? "left" : "right",
    disableOutsidePointerEvents: !1,
    disableOutsideScroll: !1,
    trapFocus: !1,
    onOpenAutoFocus: (a) => {
      var C;
      g.isUsingKeyboardRef.current && ((C = I.current) === null || C === void 0 || C.focus()), a.preventDefault();
    },
    onCloseAutoFocus: (a) => a.preventDefault(),
    onFocusOutside: ge(A.onFocusOutside, (a) => {
      a.target !== s.trigger && o.onOpenChange(!1);
    }),
    onEscapeKeyDown: ge(A.onEscapeKeyDown, (a) => {
      g.onClose(), a.preventDefault();
    }),
    onKeyDown: ge(A.onKeyDown, (a) => {
      const C = a.currentTarget.contains(a.target), B = lue[g.dir].includes(a.key);
      if (C && B) {
        var l;
        o.onOpenChange(!1), (l = s.trigger) === null || l === void 0 || l.focus(), a.preventDefault();
      }
    })
  })))));
});
function vRA(A) {
  return A ? "open" : "closed";
}
function zH(A) {
  return A === "indeterminate";
}
function aAA(A) {
  return zH(A) ? "indeterminate" : A ? "checked" : "unchecked";
}
function Wue(A) {
  const e = document.activeElement;
  for (const t of A)
    if (t === e || (t.focus(), document.activeElement !== e))
      return;
}
function Kue(A, e) {
  return A.map(
    (t, i) => A[(e + i) % A.length]
  );
}
function Uue(A, e, t) {
  const i = e.length > 1 && Array.from(e).every(
    (s) => s === e[0]
  ) ? e[0] : e, n = t ? A.indexOf(t) : -1;
  let o = Kue(A, Math.max(n, 0));
  i.length === 1 && (o = o.filter(
    (s) => s !== t
  ));
  const g = o.find(
    (s) => s.toLowerCase().startsWith(i.toLowerCase())
  );
  return g !== t ? g : void 0;
}
function Vue(A, e) {
  const { x: t, y: i } = A;
  let n = !1;
  for (let o = 0, g = e.length - 1; o < e.length; g = o++) {
    const s = e[o].x, I = e[o].y, r = e[g].x, a = e[g].y;
    I > i != a > i && t < (r - s) * (i - I) / (a - I) + s && (n = !n);
  }
  return n;
}
function Xue(A, e) {
  if (!e)
    return !1;
  const t = {
    x: A.clientX,
    y: A.clientY
  };
  return Vue(t, e);
}
function HY(A) {
  return (e) => e.pointerType === "mouse" ? A(e) : void 0;
}
const zue = due, Tue = NRA, _ue = mue, que = yue, Oue = Due, jue = IAA, Pue = Gue, $ue = Yue, Ade = Fue, ede = xue, tde = Lue, ide = Hue, nde = Zue, HRA = "DropdownMenu", [ode, $Vt] = gg(HRA, [
  kRA
]), Ba = kRA(), [gde, SRA] = ode(HRA), sde = (A) => {
  const { __scopeDropdownMenu: e, children: t, dir: i, open: n, defaultOpen: o, onOpenChange: g, modal: s = !0 } = A, I = Ba(e), r = u.useRef(null), [a = !1, C] = as({
    prop: n,
    defaultProp: o,
    onChange: g
  });
  return /* @__PURE__ */ u.createElement(gde, {
    scope: e,
    triggerId: za(),
    triggerRef: r,
    contentId: za(),
    open: a,
    onOpenChange: C,
    onOpenToggle: u.useCallback(
      () => C(
        (B) => !B
      ),
      [
        C
      ]
    ),
    modal: s
  }, /* @__PURE__ */ u.createElement(zue, NA({}, I, {
    open: a,
    onOpenChange: C,
    dir: i,
    modal: s
  }), t));
}, Ide = "DropdownMenuTrigger", ade = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, disabled: i = !1, ...n } = A, o = SRA(Ide, t), g = Ba(t);
  return /* @__PURE__ */ u.createElement(Tue, NA({
    asChild: !0
  }, g), /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button",
    id: o.triggerId,
    "aria-haspopup": "menu",
    "aria-expanded": o.open,
    "aria-controls": o.open ? o.contentId : void 0,
    "data-state": o.open ? "open" : "closed",
    "data-disabled": i ? "" : void 0,
    disabled: i
  }, n, {
    ref: t3(e, o.triggerRef),
    onPointerDown: ge(A.onPointerDown, (s) => {
      !i && s.button === 0 && s.ctrlKey === !1 && (o.onOpenToggle(), o.open || s.preventDefault());
    }),
    onKeyDown: ge(A.onKeyDown, (s) => {
      i || ([
        "Enter",
        " "
      ].includes(s.key) && o.onOpenToggle(), s.key === "ArrowDown" && o.onOpenChange(!0), [
        "Enter",
        " ",
        "ArrowDown"
      ].includes(s.key) && s.preventDefault());
    })
  })));
}), rde = (A) => {
  const { __scopeDropdownMenu: e, ...t } = A, i = Ba(e);
  return /* @__PURE__ */ u.createElement(_ue, NA({}, i, t));
}, Cde = "DropdownMenuContent", Bde = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = SRA(Cde, t), o = Ba(t), g = u.useRef(!1);
  return /* @__PURE__ */ u.createElement(que, NA({
    id: n.contentId,
    "aria-labelledby": n.triggerId
  }, o, i, {
    ref: e,
    onCloseAutoFocus: ge(A.onCloseAutoFocus, (s) => {
      var I;
      g.current || (I = n.triggerRef.current) === null || I === void 0 || I.focus(), g.current = !1, s.preventDefault();
    }),
    onInteractOutside: ge(A.onInteractOutside, (s) => {
      const I = s.detail.originalEvent, r = I.button === 0 && I.ctrlKey === !0, a = I.button === 2 || r;
      (!n.modal || a) && (g.current = !0);
    }),
    style: {
      ...A.style,
      "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
      "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
      "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
    }
  }));
}), lde = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = Ba(t);
  return /* @__PURE__ */ u.createElement(Oue, NA({}, n, i, {
    ref: e
  }));
}), cde = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = Ba(t);
  return /* @__PURE__ */ u.createElement(jue, NA({}, n, i, {
    ref: e
  }));
}), Qde = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = Ba(t);
  return /* @__PURE__ */ u.createElement(Pue, NA({}, n, i, {
    ref: e
  }));
}), Ede = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = Ba(t);
  return /* @__PURE__ */ u.createElement($ue, NA({}, n, i, {
    ref: e
  }));
}), ude = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = Ba(t);
  return /* @__PURE__ */ u.createElement(Ade, NA({}, n, i, {
    ref: e
  }));
}), dde = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = Ba(t);
  return /* @__PURE__ */ u.createElement(ede, NA({}, n, i, {
    ref: e
  }));
}), hde = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = Ba(t);
  return /* @__PURE__ */ u.createElement(tde, NA({}, n, i, {
    ref: e
  }));
}), mde = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = Ba(t);
  return /* @__PURE__ */ u.createElement(ide, NA({}, n, i, {
    ref: e
  }));
}), pde = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDropdownMenu: t, ...i } = A, n = Ba(t);
  return /* @__PURE__ */ u.createElement(nde, NA({}, n, i, {
    ref: e,
    style: {
      ...A.style,
      "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
      "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
      "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
    }
  }));
}), yde = sde, bde = ade, wde = rde, ZRA = Bde, WRA = lde, KRA = cde, URA = Qde, fde = Ede, VRA = ude, XRA = dde, zRA = hde, TRA = mde, _RA = pde;
function bl(A, e) {
  if (A == null)
    return {};
  var t = {}, i = Object.keys(A), n, o;
  for (o = 0; o < i.length; o++)
    n = i[o], !(e.indexOf(n) >= 0) && (t[n] = A[n]);
  return t;
}
var Dde = ["color"], qRA = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, Dde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), Gde = ["color"], _R = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, Gde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), kde = ["color"], Jde = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, kde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), Nde = ["color"], Yde = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, Nde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), Rde = ["color"], ORA = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, Rde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), Fde = ["color"], Mde = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, Fde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), xde = ["color"], Lde = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, xde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), vde = ["color"], Hde = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, vde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",
    fill: i
  }));
}), Sde = ["color"], Zde = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, Sde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), Wde = ["color"], Kde = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = bl(A, Wde);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
});
const rAA = yde, CAA = bde, Ude = fde, Vde = u.forwardRef(({ className: A, inset: e, children: t, ...i }, n) => u.createElement(
  TRA,
  { ref: n, className: me("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", e && "pl-8", A), ...i },
  t,
  u.createElement(ORA, { className: "ml-auto h-4 w-4" })
));
Vde.displayName = TRA.displayName;
const Xde = u.forwardRef(({ className: A, ...e }, t) => u.createElement(_RA, { ref: t, className: me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", A), ...e }));
Xde.displayName = _RA.displayName;
const b3 = u.forwardRef(({ className: A, sideOffset: e = 4, ...t }, i) => u.createElement(
  wde,
  { container: u.useContext(xD) },
  u.createElement(ZRA, { ref: i, sideOffset: e, className: me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", A), ...t })
));
b3.displayName = ZRA.displayName;
const dN = u.forwardRef(({ className: A, inset: e, ...t }, i) => u.createElement(KRA, { ref: i, className: me("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", e && "pl-8", A), ...t }));
dN.displayName = KRA.displayName;
const zde = u.forwardRef(({ className: A, children: e, checked: t, ...i }, n) => u.createElement(
  URA,
  { ref: n, className: me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", A), checked: t, ...i },
  u.createElement(
    "span",
    { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" },
    u.createElement(
      XRA,
      null,
      u.createElement(_R, { className: "h-4 w-4" })
    )
  ),
  e
));
zde.displayName = URA.displayName;
const jRA = u.forwardRef(({ className: A, children: e, ...t }, i) => u.createElement(
  VRA,
  { ref: i, className: me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", A), ...t },
  u.createElement(
    "span",
    { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" },
    u.createElement(
      XRA,
      null,
      u.createElement(Hde, { className: "h-4 w-4 fill-current" })
    )
  ),
  e
));
jRA.displayName = VRA.displayName;
const Tde = u.forwardRef(({ className: A, inset: e, ...t }, i) => u.createElement(WRA, { ref: i, className: me("px-2 py-1.5 text-sm font-semibold", e && "pl-8", A), ...t }));
Tde.displayName = WRA.displayName;
const _de = u.forwardRef(({ className: A, ...e }, t) => u.createElement(zRA, { ref: t, className: me("-mx-1 my-1 h-px bg-muted", A), ...e }));
_de.displayName = zRA.displayName;
const qde = u.memo(function(A) {
  const { item: e, openedKey: t, setOpenedKey: i } = A, { key: n, icon: o, disabled: g, options: s, value: I, onSelect: r, styles: a } = e, C = `${n}::button`, B = t === C, l = s.find((E) => E.key === I), Q = l == null ? void 0 : l.icon;
  return b.createElement(
    rAA,
    { modal: !1, open: B, onOpenChange: (E) => i(E ? C : "") },
    b.createElement(
      eAA,
      { ...A, item: R7(A.item, (E) => {
        l && (E.label = `${E.label}: ${l.label}`);
      }) },
      b.createElement(
        CAA,
        { disabled: g, asChild: !0 },
        b.createElement(
          Re,
          { className: "relative", disabled: g, variant: "none", size: "toolbar" },
          b.createElement(o, { className: "w-[18px] h-[18px]", style: a == null ? void 0 : a.icon }),
          Q && b.createElement(Q, { style: a == null ? void 0 : a.icon, className: "absolute w-[11px] h-[11px] right-[7px] bottom-[5px]" })
        )
      )
    ),
    b.createElement(
      b3,
      { onCloseAutoFocus: (E) => E.preventDefault() },
      b.createElement(Ude, { value: I, onValueChange: r }, s.map((E) => {
        const d = E.icon;
        return b.createElement(
          jRA,
          { key: E.key, value: E.key, className: "gap-2" },
          b.createElement(d, { className: "w-[18px] h-[18px]" }),
          E.label
        );
      }))
    )
  );
}), Ode = qde, jde = "-", Pde = u.memo(function(A) {
  return "checked" in A.item ? b.createElement(OEe, { item: A.item, openedKey: A.openedKey, setOpenedKey: A.setOpenedKey }) : "options" in A.item ? b.createElement(Ode, { item: A.item, openedKey: A.openedKey, setOpenedKey: A.setOpenedKey }) : b.createElement(zEe, { ...A });
}), $de = Pde, tO = "horizontal", Ahe = [
  "horizontal",
  "vertical"
], PRA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { decorative: t, orientation: i = tO, ...n } = A, o = $RA(i) ? i : tO, g = t ? {
    role: "none"
  } : {
    "aria-orientation": o === "vertical" ? o : void 0,
    role: "separator"
  };
  return /* @__PURE__ */ u.createElement(ze.div, NA({
    "data-orientation": o
  }, g, n, {
    ref: e
  }));
});
PRA.propTypes = {
  orientation(A, e, t) {
    const i = A[e], n = String(i);
    return i && !$RA(i) ? new Error(ehe(n, t)) : null;
  }
};
function ehe(A, e) {
  return `Invalid prop \`orientation\` of value \`${A}\` supplied to \`${e}\`, expected one of:
  - horizontal
  - vertical

Defaulting to \`${tO}\`.`;
}
function $RA(A) {
  return Ahe.includes(A);
}
const AFA = PRA, BAA = u.forwardRef(({ className: A, orientation: e = "horizontal", decorative: t = !0, ...i }, n) => u.createElement(AFA, { ref: n, decorative: t, orientation: e, className: me("shrink-0 bg-border", e === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", A), ...i }));
BAA.displayName = AFA.displayName;
const the = u.memo(function({ items: A }) {
  const [e, t] = u.useState(null);
  return b.createElement("div", { className: "flex flex-wrap lg:flex-nowrap border my-1 w-full rounded overflow-hidden" }, A.map((i, n) => i === jde ? b.createElement(BAA, { orientation: "vertical", className: "mx-1 my-1.5 h-6", key: n }) : b.createElement($de, { key: i.key, item: i, openedKey: e, setOpenedKey: t })));
}), ihe = the, ucA = (A, e) => {
  const t = b.useMemo(() => {
    const i = A.split("+").map((n) => n.trim());
    return {
      key: i.filter((n) => /^[a-z]$/i.test(n))[0],
      ctrlKey: i.includes("Ctrl"),
      shiftKey: i.includes("Shift"),
      altKey: i.includes("Alt")
    };
  }, [A]);
  b.useEffect(() => {
    const i = (n) => {
      n.ctrlKey === t.ctrlKey && n.shiftKey === t.shiftKey && n.altKey === t.altKey && n.key.toLowerCase() === t.key.toLowerCase() && (e(), n.stopPropagation());
    };
    return document.body.addEventListener("keydown", i), () => document.body.removeEventListener("keydown", i);
  }, [t, e]);
}, nhe = (A, e, t) => {
  const { leading: i = !0, trailing: n = !1 } = t ?? {};
  let o = !1, g = !1;
  return () => {
    if (o) {
      g = !0;
      return;
    }
    o = !0, i && A(), setTimeout(() => {
      g && n && A(), o = !1, g = !1;
    }, e);
  };
}, Lb = nhe, ohe = "data:image/png;base64, ", ghe = (A) => {
  const { src: e, fallbackSrc: t, timeout: i, ...n } = A, [o, g] = u.useState(!1), s = u.useRef(!1);
  return u.useEffect(() => {
    const I = setTimeout(() => {
      s.current || g(!0);
    }, i);
    return () => clearTimeout(I);
  }, []), b.createElement("img", { ...n, src: o ? t : e, onError: () => {
    g(!0);
  }, onLoad: () => {
    s.current = !0;
  } });
}, eFA = "Checkbox", [she, AXt] = gg(eFA), [Ihe, ahe] = she(eFA), rhe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeCheckbox: t, name: i, checked: n, defaultChecked: o, required: g, disabled: s, value: I = "on", onCheckedChange: r, ...a } = A, [C, B] = u.useState(null), l = Dt(
    e,
    (f) => B(f)
  ), Q = u.useRef(!1), E = C ? !!C.closest("form") : !0, [d = !1, m] = as({
    prop: n,
    defaultProp: o,
    onChange: r
  }), y = u.useRef(d);
  return u.useEffect(() => {
    const f = C == null ? void 0 : C.form;
    if (f) {
      const w = () => m(y.current);
      return f.addEventListener("reset", w), () => f.removeEventListener("reset", w);
    }
  }, [
    C,
    m
  ]), /* @__PURE__ */ u.createElement(Ihe, {
    scope: t,
    state: d,
    disabled: s
  }, /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button",
    role: "checkbox",
    "aria-checked": Nm(d) ? "mixed" : d,
    "aria-required": g,
    "data-state": tFA(d),
    "data-disabled": s ? "" : void 0,
    disabled: s,
    value: I
  }, a, {
    ref: l,
    onKeyDown: ge(A.onKeyDown, (f) => {
      f.key === "Enter" && f.preventDefault();
    }),
    onClick: ge(A.onClick, (f) => {
      m(
        (w) => Nm(w) ? !0 : !w
      ), E && (Q.current = f.isPropagationStopped(), Q.current || f.stopPropagation());
    })
  })), E && /* @__PURE__ */ u.createElement(lhe, {
    control: C,
    bubbles: !Q.current,
    name: i,
    value: I,
    checked: d,
    required: g,
    disabled: s,
    style: {
      transform: "translateX(-100%)"
    }
  }));
}), Che = "CheckboxIndicator", Bhe = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeCheckbox: t, forceMount: i, ...n } = A, o = ahe(Che, t);
  return /* @__PURE__ */ u.createElement(Ig, {
    present: i || Nm(o.state) || o.state === !0
  }, /* @__PURE__ */ u.createElement(ze.span, NA({
    "data-state": tFA(o.state),
    "data-disabled": o.disabled ? "" : void 0
  }, n, {
    ref: e,
    style: {
      pointerEvents: "none",
      ...A.style
    }
  })));
}), lhe = (A) => {
  const { control: e, checked: t, bubbles: i = !0, ...n } = A, o = u.useRef(null), g = YR(t), s = RR(e);
  return u.useEffect(() => {
    const I = o.current, r = window.HTMLInputElement.prototype, a = Object.getOwnPropertyDescriptor(r, "checked").set;
    if (g !== t && a) {
      const C = new Event("click", {
        bubbles: i
      });
      I.indeterminate = Nm(t), a.call(I, Nm(t) ? !1 : t), I.dispatchEvent(C);
    }
  }, [
    g,
    t,
    i
  ]), /* @__PURE__ */ u.createElement("input", NA({
    type: "checkbox",
    "aria-hidden": !0,
    defaultChecked: Nm(t) ? !1 : t
  }, n, {
    tabIndex: -1,
    ref: o,
    style: {
      ...A.style,
      ...s,
      position: "absolute",
      pointerEvents: "none",
      opacity: 0,
      margin: 0
    }
  }));
};
function Nm(A) {
  return A === "indeterminate";
}
function tFA(A) {
  return Nm(A) ? "indeterminate" : A ? "checked" : "unchecked";
}
const iFA = rhe, che = Bhe, Ym = u.forwardRef(({ className: A, ...e }, t) => u.createElement(
  iFA,
  { ref: t, className: me("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", A), ...e },
  u.createElement(
    che,
    { className: me("flex items-center justify-center text-current") },
    u.createElement(_R, { className: "h-4 w-4" })
  )
));
Ym.displayName = iFA.displayName;
const on = u.forwardRef(({ className: A, type: e, ...t }, i) => u.createElement("input", { type: e, className: me("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", A), ref: i, ...t }));
on.displayName = "Input";
const Qhe = fYA((A) => wD(A, 600)), Ehe = 100;
function uhe(A) {
  const { t: e } = qe("translation", { keyPrefix: "main.tabpanel.settings" }), t = Qhe(0, (s) => A.setValue(s))[1], [i, n] = b.useState(A.value > 0 ? A.value : Ehe), [o, g] = b.useState(A.value > 0);
  return b.createElement(
    "div",
    { className: "w-60 mt-2 p-2" },
    b.createElement(on, { className: "h-8", type: "number", min: 0, step: 10, value: i, disabled: !o, onChange: (s) => {
      t(parseInt(s.target.value)), n(parseInt(s.target.value));
    } }),
    b.createElement(
      "div",
      { className: "ml-1 mt-3 flex items-center" },
      b.createElement(Ym, { className: "mr-1", checked: o, onCheckedChange: (s) => {
        g(!!s), s ? A.setValue(i) : A.setValue(0);
      } }),
      e("limit")
    )
  );
}
function dhe(A) {
  const e = A.filter((t, i) => typeof t != "string" || t !== "-" || A[i + 1] !== "-");
  return e.slice(e[0] === "-" ? 1 : 0, e[e.length - 1] === "-" ? -1 : void 0);
}
const hhe = (A) => b.createElement(ghe, { id: "kanaries-logo", className: $a(A.className, "opacity-70 hover:opacity-100"), style: A.style, src: "https://imagedelivery.net/tSvh1MGEu9IgUanmf58srQ/b6bc899f-a129-4c3a-d08f-d406166d0c00/public", fallbackSrc: ohe, timeout: 1e3, alt: "kanaries documents" }), mhe = ({ rendererHandler: A, csvHandler: e, extra: t = [], exclude: i = [], experimentalFeatures: n }) => {
  const o = xt(), { config: g, layout: s, canUndo: I, canRedo: r, limit: a, paintInfo: C } = o, { t: B } = qe(), { t: l } = qe("translation", { keyPrefix: "main.tabpanel.settings" }), { defaultAggregated: Q, coordSystem: E = "generic", geoms: [d] } = g, { showTableSummary: m, stack: y, interactiveScale: f, size: { mode: w, width: G, height: R }, showActions: F } = s, Z = u.useCallback(Lb(() => {
    var v;
    (v = A == null ? void 0 : A.current) == null || v.downloadPNG();
  }, 200), [A]), c = u.useCallback(Lb(() => {
    var v;
    (v = A == null ? void 0 : A.current) == null || v.downloadSVG();
  }, 200), [A]), J = u.useCallback(Lb(() => {
    var v;
    (v = A == null ? void 0 : A.current) == null || v.getCanvasData().then((K) => navigator.clipboard.writeText(K.join(",")));
  }, 200), [A]), p = u.useCallback(Lb(() => {
    var v;
    (v = e == null ? void 0 : e.current) == null || v.download();
  }, 200), []), N = u.useMemo(() => {
    const v = [
      {
        key: "undo",
        label: "undo (Ctrl + Z)",
        icon: (U) => (ucA("Ctrl+Z", o.undo.bind(o)), b.createElement(Xse, { ...U })),
        onClick: () => o.undo(),
        disabled: !I
      },
      {
        key: "redo",
        label: "redo (Ctrl+Shift+Z)",
        icon: (U) => (ucA("Ctrl+Shift+Z", o.redo.bind(o)), b.createElement(_se, { ...U })),
        onClick: () => o.redo(),
        disabled: !r
      },
      "-",
      {
        key: "aggregation",
        label: l("toggle.aggregation"),
        icon: vIe,
        checked: Q,
        onChange: (U) => {
          o.setVisualConfig("defaultAggregated", U);
        }
      },
      {
        key: "mark_type",
        label: B("constant.mark_type.__enum__"),
        icon: Sae,
        styles: {
          icon: {
            color: "rgb(294,115,22)"
          }
        },
        options: We.GEOM_TYPES[E].map((U) => ({
          key: U,
          label: B(`constant.mark_type.${U}`),
          icon: {
            auto: mYA,
            bar: (j) => b.createElement(
              "svg",
              { stroke: "currentColor", fill: "none", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9,4v16h6v-16Z" })
            ),
            line: (j) => b.createElement(
              "svg",
              { stroke: "currentColor", fill: "none", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5,6L19,18" })
            ),
            area: (j) => b.createElement(
              "svg",
              { stroke: "none", fill: "currentColor", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5,20v-17l14,4V20Z" })
            ),
            trail: (j) => b.createElement(
              "svg",
              { stroke: "none", fill: "currentColor", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5,6l7,4l7-2v2l-7,4l-7,-4z" })
            ),
            point: (j) => b.createElement(
              "svg",
              { stroke: "currentColor", fill: "none", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9,12 A3,3,0,0,1,16,12 A3,3,0,0,1,9,12" })
            ),
            circle: (j) => b.createElement(
              "svg",
              { stroke: "none", fill: "currentColor", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6,12 A6,6,0,0,1,18,12 A6,6,0,0,1,6,12" })
            ),
            tick: (j) => b.createElement(
              "svg",
              { stroke: "currentColor", fill: "none", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5,12h14" })
            ),
            rect: (j) => b.createElement(
              "svg",
              { stroke: "none", fill: "currentColor", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5,5v14h14v-14z" })
            ),
            text: (j) => b.createElement(
              "svg",
              { stroke: "currentColor", fill: "currentColor", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.5 21l5.25-11.25L21 21m-9-3h7.5M3 5.621a48.474 48.474 0 016-.371m0 0c1.12 0 2.233.038 3.334.114M9 5.25V3m3.334 2.364C11.176 10.658 7.69 15.08 3 17.502m9.334-12.138c.896.061 1.785.147 2.666.257m-4.589 8.495a18.023 18.023 0 01-3.827-5.802" })
            ),
            arc: (j) => b.createElement(
              "svg",
              { stroke: "none", fill: "currentColor", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12,21l-9,-15a12,12,0,0,1,18,0Z" })
            ),
            boxplot: (j) => b.createElement(
              "svg",
              { stroke: "currentColor", fill: "none", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7,7v9h10v-9Zm0,4h8M12,7v-6m-3,0h6M12,16v7m-3,0h6" })
            ),
            table: (j) => b.createElement(
              "svg",
              { stroke: "currentColor", fill: "none", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 01-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0112 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5" })
            ),
            poi: uae,
            choropleth: Fae
          }[U]
        })),
        value: d,
        onSelect: (U) => {
          o.setVisualConfig("geoms", [U]);
        }
      },
      {
        key: "stack_mode",
        label: B("constant.stack_mode.__enum__"),
        icon: Lae,
        options: We.STACK_MODE.map((U) => ({
          key: U,
          label: B(`constant.stack_mode.${U}`),
          icon: {
            none: Pae,
            stack: QIe,
            normalize: jse,
            center: NR
            // TODO: fix unsafe extends
          }[U]
        })),
        value: y,
        onSelect: (U) => {
          o.setVisualLayout("stack", U);
        }
      },
      "-",
      {
        key: "transpose",
        label: l("button.transpose"),
        icon: (U) => b.createElement(
          "svg",
          { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...U },
          b.createElement("path", { d: "M7.59664 2.93628C7.76085 3.06401 8.00012 2.94698 8.00012 2.73895V1.99998C9.98143 2 11.1848 2.3637 11.9105 3.08945C12.6363 3.81522 13 5.0186 13 6.99998C13 7.27613 13.2239 7.49998 13.5 7.49998C13.7761 7.49998 14 7.27613 14 6.99998C14 4.9438 13.6325 3.39719 12.6176 2.38234C11.6028 1.36752 10.0562 0.999999 8.00012 0.999984V0.261266C8.00012 0.0532293 7.76085 -0.0637944 7.59664 0.063928L6.00384 1.30277C5.87516 1.40286 5.87516 1.59735 6.00384 1.69744L7.59664 2.93628ZM9.5 5H2.5C2.22386 5 2 5.22386 2 5.5V12.5C2 12.7761 2.22386 13 2.5 13H9.5C9.77614 13 10 12.7761 10 12.5V5.5C10 5.22386 9.77614 5 9.5 5ZM2.5 4C1.67157 4 1 4.67157 1 5.5V12.5C1 13.3284 1.67157 14 2.5 14H9.5C10.3284 14 11 13.3284 11 12.5V5.5C11 4.67157 10.3284 4 9.5 4H2.5Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" })
        ),
        onClick: () => o.transpose()
      },
      {
        key: "sort:asc",
        label: l("button.ascending"),
        icon: u7,
        onClick: () => o.applyDefaultSort("ascending")
      },
      {
        key: "sort:dec",
        label: l("button.descending"),
        icon: E7,
        onClick: () => o.applyDefaultSort("descending")
      },
      {
        key: "table:summary",
        label: l("table.summary"),
        icon: KBA,
        checked: m,
        onChange: (U) => {
          o.setVisualLayout("showTableSummary", U);
        }
      },
      ...n != null && n.computedField ? [{ key: "field:add", label: "Add Computed Field", icon: ZIe, onClick: () => o.setComputedFieldFid("") }] : [],
      "-",
      {
        key: "axes_resize",
        label: l("toggle.axes_resize"),
        icon: (U) => b.createElement(
          "svg",
          { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...U },
          b.createElement("path", { d: "M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159ZM4.25 6.5C4.25 6.22386 4.47386 6 4.75 6H6V4.75C6 4.47386 6.22386 4.25 6.5 4.25C6.77614 4.25 7 4.47386 7 4.75V6H8.25C8.52614 6 8.75 6.22386 8.75 6.5C8.75 6.77614 8.52614 7 8.25 7H7V8.25C7 8.52614 6.77614 8.75 6.5 8.75C6.22386 8.75 6 8.52614 6 8.25V7H4.75C4.47386 7 4.25 6.77614 4.25 6.5Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" })
        ),
        checked: f,
        onChange: (U) => {
          o.setVisualLayout("interactiveScale", U);
        }
      },
      {
        key: "scale",
        icon: (U) => b.createElement(
          "svg",
          { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...U },
          b.createElement("path", { d: "M3.00014 2.73895C3.00014 2.94698 2.76087 3.06401 2.59666 2.93628L1.00386 1.69744C0.875177 1.59735 0.875177 1.40286 1.00386 1.30277L2.59666 0.063928C2.76087 -0.0637944 3.00014 0.0532293 3.00014 0.261266V1.00012H9.00009V0.261296C9.00009 0.0532591 9.23936 -0.0637646 9.40358 0.0639578L10.9964 1.3028C11.1251 1.40289 11.1251 1.59738 10.9964 1.69747L9.40358 2.93631C9.23936 3.06404 9.00009 2.94701 9.00009 2.73898V2.00012H3.00014V2.73895ZM9.50002 4.99998H2.50002C2.22388 4.99998 2.00002 5.22384 2.00002 5.49998V12.5C2.00002 12.7761 2.22388 13 2.50002 13H9.50002C9.77616 13 10 12.7761 10 12.5V5.49998C10 5.22384 9.77616 4.99998 9.50002 4.99998ZM2.50002 3.99998C1.67159 3.99998 1.00002 4.67156 1.00002 5.49998V12.5C1.00002 13.3284 1.67159 14 2.50002 14H9.50002C10.3284 14 11 13.3284 11 12.5V5.49998C11 4.67156 10.3284 3.99998 9.50002 3.99998H2.50002ZM14.7389 6.00001H14V12H14.7389C14.9469 12 15.064 12.2393 14.9362 12.4035L13.6974 13.9963C13.5973 14.125 13.4028 14.125 13.3027 13.9963L12.0639 12.4035C11.9362 12.2393 12.0532 12 12.2612 12H13V6.00001H12.2612C12.0532 6.00001 11.9361 5.76074 12.0639 5.59653L13.3027 4.00373C13.4028 3.87505 13.5973 3.87505 13.6974 4.00374L14.9362 5.59653C15.0639 5.76074 14.9469 6.00001 14.7389 6.00001Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" })
        ),
        label: B("constant.layout_type.__enum__"),
        options: [
          {
            key: "fixed",
            label: B("constant.layout_type.fixed"),
            icon: (U) => b.createElement(
              "svg",
              { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...U },
              b.createElement("path", { d: "M1.44995 0.949951C1.31734 0.949951 1.19016 1.00263 1.0964 1.0964C1.00263 1.19017 0.949951 1.31735 0.949951 1.44995L0.949966 3.44995C0.949969 3.7261 1.17383 3.94995 1.44997 3.94995C1.72611 3.94995 1.94997 3.72609 1.94997 3.44995L1.94995 1.94995H3.44997C3.72611 1.94995 3.94997 1.72609 3.94997 1.44995C3.94997 1.17381 3.72611 0.949951 3.44997 0.949951H1.44995ZM5.94995 0.949951C5.67381 0.949951 5.44995 1.17381 5.44995 1.44995C5.44995 1.72609 5.67381 1.94995 5.94995 1.94995H8.94995C9.22609 1.94995 9.44995 1.72609 9.44995 1.44995C9.44995 1.17381 9.22609 0.949951 8.94995 0.949951H5.94995ZM5.44995 13.45C5.44995 13.1738 5.67381 12.95 5.94995 12.95H8.94995C9.22609 12.95 9.44995 13.1738 9.44995 13.45C9.44995 13.7261 9.22609 13.95 8.94995 13.95H5.94995C5.67381 13.95 5.44995 13.7261 5.44995 13.45ZM1.94995 5.94995C1.94995 5.67381 1.72609 5.44995 1.44995 5.44995C1.17381 5.44995 0.949951 5.67381 0.949951 5.94995V8.94995C0.949951 9.22609 1.17381 9.44995 1.44995 9.44995C1.72609 9.44995 1.94995 9.22609 1.94995 8.94995V5.94995ZM13.45 5.44995C13.7261 5.44995 13.95 5.67381 13.95 5.94995V8.94995C13.95 9.22609 13.7261 9.44995 13.45 9.44995C13.1738 9.44995 12.95 9.22609 12.95 8.94995V5.94995C12.95 5.67381 13.1738 5.44995 13.45 5.44995ZM11.45 0.949951C11.1738 0.949951 10.95 1.17381 10.95 1.44995C10.95 1.72609 11.1738 1.94995 11.45 1.94995H12.9499V3.44995C12.9499 3.72609 13.1738 3.94995 13.4499 3.94995C13.7261 3.94995 13.9499 3.72609 13.9499 3.44995V1.44995C13.9499 1.17381 13.7252 0.949951 13.449 0.949951H11.45ZM1.44995 10.95C1.72609 10.95 1.94995 11.1738 1.94995 11.45V12.95H3.44997C3.72611 12.95 3.94997 13.1738 3.94997 13.45C3.94997 13.7261 3.72611 13.95 3.44997 13.95H1.44995C1.17381 13.95 0.949951 13.7261 0.949951 13.45V11.45C0.949951 11.1738 1.17381 10.95 1.44995 10.95ZM13.95 11.45C13.95 11.1738 13.7261 10.95 13.45 10.95C13.1738 10.9499 12.95 11.1738 12.95 11.4499L12.9491 12.95H11.45C11.1738 12.95 10.95 13.1738 10.95 13.45C10.95 13.7261 11.1738 13.95 11.45 13.95H13.4499C13.7261 13.95 13.9499 13.7261 13.9499 13.45L13.95 11.45Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" })
            )
          },
          {
            key: "auto",
            label: B("constant.layout_type.auto"),
            icon: (U) => b.createElement(
              "svg",
              { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...U },
              b.createElement("path", { d: "M1.49988 2.00012C1.77602 2.00012 1.99988 1.77626 1.99988 1.50012C1.99988 1.22398 1.77602 1.00012 1.49988 1.00012C1.22374 1.00012 0.999878 1.22398 0.999878 1.50012C0.999878 1.77626 1.22374 2.00012 1.49988 2.00012ZM4.49988 2.00012C4.77602 2.00012 4.99988 1.77626 4.99988 1.50012C4.99988 1.22398 4.77602 1.00012 4.49988 1.00012C4.22374 1.00012 3.99988 1.22398 3.99988 1.50012C3.99988 1.77626 4.22374 2.00012 4.49988 2.00012ZM7.99988 1.50012C7.99988 1.77626 7.77602 2.00012 7.49988 2.00012C7.22374 2.00012 6.99988 1.77626 6.99988 1.50012C6.99988 1.22398 7.22374 1.00012 7.49988 1.00012C7.77602 1.00012 7.99988 1.22398 7.99988 1.50012ZM10.4999 2.00012C10.776 2.00012 10.9999 1.77626 10.9999 1.50012C10.9999 1.22398 10.776 1.00012 10.4999 1.00012C10.2237 1.00012 9.99988 1.22398 9.99988 1.50012C9.99988 1.77626 10.2237 2.00012 10.4999 2.00012ZM13.9999 1.50012C13.9999 1.77626 13.776 2.00012 13.4999 2.00012C13.2237 2.00012 12.9999 1.77626 12.9999 1.50012C12.9999 1.22398 13.2237 1.00012 13.4999 1.00012C13.776 1.00012 13.9999 1.22398 13.9999 1.50012ZM1.49988 14.0001C1.77602 14.0001 1.99988 13.7763 1.99988 13.5001C1.99988 13.224 1.77602 13.0001 1.49988 13.0001C1.22374 13.0001 0.999878 13.224 0.999878 13.5001C0.999878 13.7763 1.22374 14.0001 1.49988 14.0001ZM1.99988 10.5001C1.99988 10.7763 1.77602 11.0001 1.49988 11.0001C1.22374 11.0001 0.999878 10.7763 0.999878 10.5001C0.999878 10.224 1.22374 10.0001 1.49988 10.0001C1.77602 10.0001 1.99988 10.224 1.99988 10.5001ZM1.49988 8.00012C1.77602 8.00012 1.99988 7.77626 1.99988 7.50012C1.99988 7.22398 1.77602 7.00012 1.49988 7.00012C1.22374 7.00012 0.999878 7.22398 0.999878 7.50012C0.999878 7.77626 1.22374 8.00012 1.49988 8.00012ZM1.99988 4.50012C1.99988 4.77626 1.77602 5.00012 1.49988 5.00012C1.22374 5.00012 0.999878 4.77626 0.999878 4.50012C0.999878 4.22398 1.22374 4.00012 1.49988 4.00012C1.77602 4.00012 1.99988 4.22398 1.99988 4.50012ZM13.4999 11.0001C13.776 11.0001 13.9999 10.7763 13.9999 10.5001C13.9999 10.224 13.776 10.0001 13.4999 10.0001C13.2237 10.0001 12.9999 10.224 12.9999 10.5001C12.9999 10.7763 13.2237 11.0001 13.4999 11.0001ZM13.9999 7.50012C13.9999 7.77626 13.776 8.00012 13.4999 8.00012C13.2237 8.00012 12.9999 7.77626 12.9999 7.50012C12.9999 7.22398 13.2237 7.00012 13.4999 7.00012C13.776 7.00012 13.9999 7.22398 13.9999 7.50012ZM13.4999 5.00012C13.776 5.00012 13.9999 4.77626 13.9999 4.50012C13.9999 4.22398 13.776 4.00012 13.4999 4.00012C13.2237 4.00012 12.9999 4.22398 12.9999 4.50012C12.9999 4.77626 13.2237 5.00012 13.4999 5.00012ZM4.99988 13.5001C4.99988 13.7763 4.77602 14.0001 4.49988 14.0001C4.22374 14.0001 3.99988 13.7763 3.99988 13.5001C3.99988 13.224 4.22374 13.0001 4.49988 13.0001C4.77602 13.0001 4.99988 13.224 4.99988 13.5001ZM7.49988 14.0001C7.77602 14.0001 7.99988 13.7763 7.99988 13.5001C7.99988 13.224 7.77602 13.0001 7.49988 13.0001C7.22374 13.0001 6.99988 13.224 6.99988 13.5001C6.99988 13.7763 7.22374 14.0001 7.49988 14.0001ZM10.9999 13.5001C10.9999 13.7763 10.776 14.0001 10.4999 14.0001C10.2237 14.0001 9.99988 13.7763 9.99988 13.5001C9.99988 13.224 10.2237 13.0001 10.4999 13.0001C10.776 13.0001 10.9999 13.224 10.9999 13.5001ZM13.4999 14.0001C13.776 14.0001 13.9999 13.7763 13.9999 13.5001C13.9999 13.224 13.776 13.0001 13.4999 13.0001C13.2237 13.0001 12.9999 13.224 12.9999 13.5001C12.9999 13.7763 13.2237 14.0001 13.4999 14.0001ZM3.99988 5.00012C3.99988 4.44784 4.44759 4.00012 4.99988 4.00012H9.99988C10.5522 4.00012 10.9999 4.44784 10.9999 5.00012V10.0001C10.9999 10.5524 10.5522 11.0001 9.99988 11.0001H4.99988C4.44759 11.0001 3.99988 10.5524 3.99988 10.0001V5.00012ZM4.99988 5.00012H9.99988V10.0001H4.99988V5.00012Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" })
            )
          },
          {
            key: "full",
            label: B("constant.layout_type.full"),
            icon: (U) => b.createElement(
              "svg",
              { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...U },
              b.createElement("path", { d: "M1.99998 0.999976C1.44769 0.999976 0.999976 1.44769 0.999976 1.99998V13C0.999976 13.5523 1.44769 14 1.99998 14H13C13.5523 14 14 13.5523 14 13V1.99998C14 1.44769 13.5523 0.999976 13 0.999976H1.99998ZM1.99998 1.99998L13 1.99998V13H1.99998V1.99998ZM4.49996 3.99996C4.22382 3.99996 3.99996 4.22382 3.99996 4.49996V10.5C3.99996 10.7761 4.22382 11 4.49996 11H10.5C10.7761 11 11 10.7761 11 10.5V4.49996C11 4.22382 10.7761 3.99996 10.5 3.99996H4.49996ZM4.99996 9.99996V4.99996H9.99996V9.99996H4.99996Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" })
            )
          }
        ],
        // GLOBAL_CONFIG.CHART_LAYOUT_TYPE.map((g) => ({
        //     key: g,
        //     label: tGlobal(`constant.layout_type.${g}`),
        //     icon: g === 'auto' ? LockClosedIcon : LockOpenIcon,
        // })),
        value: w,
        onSelect: (U) => {
          o.setVisualLayout("size", { ...s.size, mode: U });
        },
        form: b.createElement(mBe, { width: G, height: R, onHeightChange: (U) => {
          o.setVisualLayout("size", {
            mode: "fixed",
            height: U,
            width: s.size.width
          });
        }, onWidthChange: (U) => {
          o.setVisualLayout("size", {
            mode: "fixed",
            width: U,
            height: s.size.height
          });
        } })
      },
      "-",
      {
        key: "coord_system",
        label: B("constant.coord_system.__enum__"),
        icon: (U) => b.createElement(
          "svg",
          { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...U },
          b.createElement("path", { d: "M8.8914 2.1937C9.1158 2.35464 9.16725 2.66701 9.00631 2.89141L2.47388 12H13.5C13.7761 12 14 12.2239 14 12.5C14 12.7762 13.7761 13 13.5 13H1.5C1.31254 13 1.14082 12.8952 1.0552 12.7284C0.969578 12.5616 0.984438 12.361 1.09369 12.2086L8.19369 2.30862C8.35462 2.08422 8.667 2.03277 8.8914 2.1937ZM11.1 6.50001C11.1 6.22387 11.3238 6.00001 11.6 6.00001C11.8761 6.00001 12.1 6.22387 12.1 6.50001C12.1 6.77615 11.8761 7.00001 11.6 7.00001C11.3238 7.00001 11.1 6.77615 11.1 6.50001ZM10.4 4.00001C10.1239 4.00001 9.90003 4.22387 9.90003 4.50001C9.90003 4.77615 10.1239 5.00001 10.4 5.00001C10.6762 5.00001 10.9 4.77615 10.9 4.50001C10.9 4.22387 10.6762 4.00001 10.4 4.00001ZM12.1 8.50001C12.1 8.22387 12.3238 8.00001 12.6 8.00001C12.8761 8.00001 13.1 8.22387 13.1 8.50001C13.1 8.77615 12.8761 9.00001 12.6 9.00001C12.3238 9.00001 12.1 8.77615 12.1 8.50001ZM13.4 10C13.1239 10 12.9 10.2239 12.9 10.5C12.9 10.7761 13.1239 11 13.4 11C13.6762 11 13.9 10.7761 13.9 10.5C13.9 10.2239 13.6762 10 13.4 10Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" })
        ),
        options: We.COORD_TYPES.map((U) => ({
          key: U,
          label: B(`constant.coord_system.${U}`),
          icon: {
            generic: (j) => b.createElement(
              "svg",
              { stroke: "currentColor", fill: "none", strokeWidth: "1.5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": !0, ...j },
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2 12h20M12 2v20" }),
              b.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 7h2M12 16h2M7 12v-2M16 12v-2" })
            ),
            geographic: jIe
          }[U]
        })),
        value: E,
        onSelect: (U) => {
          const j = U;
          o.setCoordSystem(j);
        }
      },
      E === "geographic" && d === "choropleth" && {
        key: "geojson",
        label: l("button.geojson"),
        icon: Aae,
        onClick: () => {
          o.setShowGeoJSONConfigPanel(!0);
        }
      },
      "-",
      {
        key: "debug",
        label: l("toggle.debug"),
        icon: qae,
        checked: F,
        onChange: (U) => {
          o.setVisualLayout("showActions", U);
        }
      },
      ...E === "generic" ? [
        {
          key: "export_chart",
          label: l("button.export_chart"),
          icon: kae,
          form: b.createElement(
            "div",
            { className: "flex flex-col" },
            b.createElement(Re, { variant: "ghost", "aria-label": l("button.export_chart_as", { type: "png" }), onClick: () => Z() }, l("button.export_chart_as", { type: "png" })),
            b.createElement(Re, { variant: "ghost", "aria-label": l("button.export_chart_as", { type: "svg" }), onClick: () => c() }, l("button.export_chart_as", { type: "svg" })),
            b.createElement(Re, { variant: "ghost", "aria-label": l("button.export_chart_as", { type: "base64" }), onClick: () => J() }, l("button.export_chart_as", { type: "base64" }))
          )
        }
      ] : [],
      {
        key: "csv",
        label: l("button.export_chart_as", { type: "csv" }),
        icon: KBA,
        onClick: p
      },
      {
        key: "config",
        label: l("button.config"),
        icon: hYA,
        onClick: () => {
          o.setShowVisualConfigPanel(!0);
        }
      },
      {
        key: "export_code",
        label: l("button.export_code"),
        icon: (U) => b.createElement(
          "svg",
          { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...U },
          b.createElement("path", { d: "M9.96424 2.68571C10.0668 2.42931 9.94209 2.13833 9.6857 2.03577C9.4293 1.93322 9.13832 2.05792 9.03576 2.31432L5.03576 12.3143C4.9332 12.5707 5.05791 12.8617 5.3143 12.9642C5.5707 13.0668 5.86168 12.9421 5.96424 12.6857L9.96424 2.68571ZM3.85355 5.14646C4.04882 5.34172 4.04882 5.6583 3.85355 5.85356L2.20711 7.50001L3.85355 9.14646C4.04882 9.34172 4.04882 9.6583 3.85355 9.85356C3.65829 10.0488 3.34171 10.0488 3.14645 9.85356L1.14645 7.85356C0.951184 7.6583 0.951184 7.34172 1.14645 7.14646L3.14645 5.14646C3.34171 4.9512 3.65829 4.9512 3.85355 5.14646ZM11.1464 5.14646C11.3417 4.9512 11.6583 4.9512 11.8536 5.14646L13.8536 7.14646C14.0488 7.34172 14.0488 7.6583 13.8536 7.85356L11.8536 9.85356C11.6583 10.0488 11.3417 10.0488 11.1464 9.85356C10.9512 9.6583 10.9512 9.34172 11.1464 9.14646L12.7929 7.50001L11.1464 5.85356C10.9512 5.6583 10.9512 5.34172 11.1464 5.14646Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" })
        ),
        onClick: () => {
          o.setShowCodeExportPanel(!0);
        }
      },
      ...t.length === 0 ? [] : ["-", ...t],
      "-",
      {
        key: "limit_axis",
        label: l("limit"),
        icon: (U) => b.createElement(
          "svg",
          { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...U },
          b.createElement("path", { d: "M9.94969 7.49989C9.94969 8.85288 8.85288 9.94969 7.49989 9.94969C6.14691 9.94969 5.0501 8.85288 5.0501 7.49989C5.0501 6.14691 6.14691 5.0501 7.49989 5.0501C8.85288 5.0501 9.94969 6.14691 9.94969 7.49989ZM10.8632 8C10.6213 9.64055 9.20764 10.8997 7.49989 10.8997C5.79214 10.8997 4.37847 9.64055 4.13662 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H4.13659C4.37835 5.35935 5.79206 4.1001 7.49989 4.1001C9.20772 4.1001 10.6214 5.35935 10.8632 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H10.8632Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" })
        ),
        form: b.createElement(uhe, { value: a, setValue: (U) => {
          o.setVisualConfig("limit", U);
        } })
      },
      {
        key: "painter",
        label: C.type === "error" ? l(`button.disabled_painter.${C.key}`) : l("button.painter"),
        icon: yae,
        disabled: C.type === "error",
        onClick: () => {
          o.setShowPainter(!0);
        }
      },
      "-",
      {
        key: "kanaries",
        label: "kanaries docs",
        href: "https://docs.kanaries.net",
        // Kanaries brand info is not allowed to be removed or changed unless you are granted with special permission.
        icon: hhe,
        styles: {
          icon: {
            height: 20,
            width: "auto"
          }
        }
      }
    ].filter(Boolean), K = dhe(v.filter((U) => typeof U == "string" || !i.includes(U.key)));
    switch (o.config.geoms[0]) {
      case "table":
        return K;
      default:
        return K.filter((U) => typeof U == "string" || U.key !== "table:summary");
    }
  }, [
    o,
    I,
    r,
    Q,
    d,
    E,
    y,
    f,
    w,
    G,
    R,
    F,
    Z,
    c,
    t,
    i,
    a,
    m,
    n,
    C
  ]);
  return b.createElement(ihe, { items: N });
}, phe = gt(mhe), yhe = (A) => {
  const { t: e } = qe("translation", { keyPrefix: "constant.draggable_key" });
  return b.createElement(
    Dhe,
    { className: "sm:ml-0.5 my-0.5 border relative", style: A.style },
    b.createElement(
      "div",
      { className: "fl-header border-r cursor-default select-none" },
      b.createElement("h4", { className: "font-normal" }, e(A.name))
    ),
    b.createElement("div", { className: "fl-container overflow-hidden" }, A.children)
  );
}, dcA = (A) => {
  const { t: e } = qe("translation", { keyPrefix: "constant.draggable_key" });
  return b.createElement(
    "div",
    { className: "my-0.5 sm:mx-0.5 text-xs border", style: A.style },
    b.createElement(
      "div",
      { className: "border-b p-2 cursor-default select-none" },
      b.createElement("h4", { className: "font-normal" }, e(A.name))
    ),
    b.createElement("div", null, A.children)
  );
}, bhe = (A) => {
  const { t: e } = qe("translation", { keyPrefix: "constant.draggable_key" });
  return b.createElement(
    "div",
    { className: "my-0.5 sm:mx-0.5 text-xs border" },
    b.createElement(
      "div",
      { className: "border-b p-2 cursor-default select-none" },
      b.createElement("h4", { className: "font-normal" }, e("filters"))
    ),
    b.createElement("div", null, A.children)
  );
}, whe = ji.div`
    display: flex;
    padding: 0.2em;
    min-height: 2.4em;
    flex-wrap: wrap;
    > div {
        margin: 1px;
    }
    touch-action: none;
`, fhe = ji.div({
  display: "flex",
  flexDirection: "column",
  paddingBlock: "0.5em 0.8em",
  paddingInline: "0.2em",
  minHeight: "4em",
  "> div": {
    marginBlock: "0.3em",
    marginInline: "1px"
  }
}), Dhe = ji.div`
    display: flex;
    font-size: 12px;
    div.fl-header {
        /* flex-basis: 100px; */
        width: 100px;
        flex-shrink: 0;
        h4 {
            margin: 0.6em;
            font-weight: 400;
        }
    }
    div.fl-container {
        flex-grow: 10;
        position: relative;
    }
`;
ji.div`
    border: 1px solid #e5e7eb;
    @media (prefers-color-scheme: dark) {
        border: 1px solid #2d3748;
    }
    font-size: 12px;
    margin: 0.2em;

    .flt-header {
        border-bottom: 1px solid #e5e7eb;
        @media (prefers-color-scheme: dark) {
            border-bottom: 1px solid #2d3748;
        }
        padding: 0.6em;

        > h4 {
            font-weight: 400;
        }
    }

    .flt-container {
    }
`;
const Ghe = ji.div`
    background-color: ${(A) => A.colType === "continuous" ? "hsl(var(--background))" : "hsl(var(--primary))"};
    border-color: ${(A) => A.colType === "continuous" ? "hsl(var(--muted-foreground))" : "hsl(var(--background))"};
    color: ${(A) => A.colType === "continuous" ? "hsl(var(--foreground))" : "hsl(var(--primary-foreground))"};
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-align-items: center;
    -webkit-user-select: none;
    align-items: center;
    border-radius: calc(var(--radius) - 2px);
    border-style: solid;
    border-width: 1px;
    box-sizing: border-box;
    cursor: default;
    display: -webkit-flex;
    display: flex;
    font-size: 12px;
    height: 20px;
    min-width: 150px;
    max-width: 300px;
    /* overflow-y: hidden; */
    padding: 0 10px;
    user-select: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* --tw-ring-offset-shadow: 0 0 #0000;
    --tw-ring-shadow: 0 0 #0000;
    --tw-shadow-color: rgb(6 182 212/0.5);
    --tw-shadow: var(--tw-shadow-colored);
    --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);
    box-shadow: var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow); */
`;
function R5(A, e) {
  return new Proxy(A, {
    get(t, i) {
      return e[i] ? typeof t[i] == "function" ? (...n) => e[i](n, (...o) => t[i].call(t, ...o)) : e[i]([], t[i]) : t[i];
    }
  });
}
window["__react-beautiful-dnd-disable-dev-warnings"] = !0;
window["__react-beautiful-dnd-disable-scroll-hack"] = !0;
const w3 = u.createContext({ current: null });
function er(A) {
  const e = u.useContext(w3);
  return u.useCallback((t) => {
    if (t === null)
      return A(null);
    const i = Object.defineProperty(t, "getBoundingClientRect", {
      get() {
        return () => {
          var n;
          const o = (n = e.current) == null ? void 0 : n.getBoundingClientRect(), g = HTMLElement.prototype.getBoundingClientRect.call(t);
          return o ? new DOMRect(g.x - o.x, g.y - o.y, g.width, g.height) : g;
        };
      },
      configurable: !0
    });
    A(i);
  }, [A]);
}
function khe(A) {
  return (e) => {
    const t = u.useContext(w3), i = R5(e, {
      tryGetLock: (n, o) => {
        const g = o(...n);
        return g === null ? null : R5(g, {
          fluidLift: ([s], I) => {
            var r;
            const a = (r = t.current) == null ? void 0 : r.getBoundingClientRect(), C = I(a ? {
              x: s.x - a.x,
              y: s.y - a.y
            } : s);
            return R5(C, {
              move: ([B], l) => {
                var Q;
                const E = (Q = t.current) == null ? void 0 : Q.getBoundingClientRect();
                return l(E ? {
                  x: B.x - E.x,
                  y: B.y - E.y
                } : B), C;
              }
            });
          }
        });
      }
    });
    return A(i);
  };
}
const Jhe = [oNA, sNA, gNA].map(khe), Nhe = (A) => {
  const e = xt(), t = u.useRef(null), i = u.useCallback((n, o) => {
    if (!n.destination) {
      e.removeField(n.source.droppableId, n.source.index);
      return;
    }
    const g = n.destination;
    if (g.droppableId === n.source.droppableId) {
      if (g.index === n.source.index)
        return;
      e.reorderField(g.droppableId, n.source.index, g.index);
    } else {
      let s = n.source.droppableId, I = g.droppableId;
      e.moveField(s, n.source.index, I, g.index);
    }
  }, [e]);
  return b.createElement(
    w3.Provider,
    { value: t },
    b.createElement(
      "div",
      { className: "scale-100", ref: t },
      b.createElement(mne, { enableDefaultSensors: !1, sensors: Jhe, onDragEnd: i, onDragStart: () => {
      }, onDragUpdate: () => {
      } }, A.children)
    )
  );
}, Yhe = Nhe, QJ = [
  { id: "columns", mode: 0 },
  { id: "rows", mode: 0 },
  { id: "color", mode: 1 },
  { id: "opacity", mode: 1 },
  { id: "size", mode: 1 },
  { id: "shape", mode: 1 },
  { id: "theta", mode: 1 },
  { id: "radius", mode: 1 },
  { id: "longitude", mode: 1 },
  { id: "latitude", mode: 1 },
  { id: "geoId", mode: 1 },
  { id: "filters", mode: 1 },
  { id: "details", mode: 1 },
  { id: "text", mode: 1 }
], Rhe = (A) => {
  const { options: e = [], disable: t, position: i = "start" } = A;
  return b.createElement(
    rAA,
    null,
    b.createElement(CAA, { disabled: t, asChild: !0 }, A.children),
    b.createElement(b3, { align: i }, e.map((n, o) => b.createElement(dN, { key: n.value, onClick: () => {
      A.onSelect && !A.disable && A.onSelect(n.value, o);
    } }, n.label)))
  );
}, f3 = Rhe;
var Fhe = Object.defineProperty, Mhe = (A, e, t) => e in A ? Fhe(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t, F5 = (A, e, t) => (Mhe(A, typeof e != "symbol" ? e + "" : e, t), t);
let xhe = class {
  constructor() {
    F5(this, "current", this.detect()), F5(this, "handoffState", "pending"), F5(this, "currentId", 0);
  }
  set(A) {
    this.current !== A && (this.handoffState = "pending", this.currentId = 0, this.current = A);
  }
  reset() {
    this.set(this.detect());
  }
  nextId() {
    return ++this.currentId;
  }
  get isServer() {
    return this.current === "server";
  }
  get isClient() {
    return this.current === "client";
  }
  detect() {
    return typeof window > "u" || typeof document > "u" ? "server" : "client";
  }
  handoff() {
    this.handoffState === "pending" && (this.handoffState = "complete");
  }
  get isHandoffComplete() {
    return this.handoffState === "complete";
  }
}, fu = new xhe(), Xn = (A, e) => {
  fu.isServer ? u.useEffect(A, e) : u.useLayoutEffect(A, e);
};
function Ks(A) {
  let e = u.useRef(A);
  return Xn(() => {
    e.current = A;
  }, [A]), e;
}
function nFA(A, e) {
  let [t, i] = u.useState(A), n = Ks(A);
  return Xn(() => i(n.current), [n, i, ...e]), t;
}
function Lhe(A) {
  typeof queueMicrotask == "function" ? queueMicrotask(A) : Promise.resolve().then(A).catch((e) => setTimeout(() => {
    throw e;
  }));
}
function dC() {
  let A = [], e = { addEventListener(t, i, n, o) {
    return t.addEventListener(i, n, o), e.add(() => t.removeEventListener(i, n, o));
  }, requestAnimationFrame(...t) {
    let i = requestAnimationFrame(...t);
    return e.add(() => cancelAnimationFrame(i));
  }, nextFrame(...t) {
    return e.requestAnimationFrame(() => e.requestAnimationFrame(...t));
  }, setTimeout(...t) {
    let i = setTimeout(...t);
    return e.add(() => clearTimeout(i));
  }, microTask(...t) {
    let i = { current: !0 };
    return Lhe(() => {
      i.current && t[0]();
    }), e.add(() => {
      i.current = !1;
    });
  }, add(t) {
    return A.push(t), () => {
      let i = A.indexOf(t);
      if (i >= 0) {
        let [n] = A.splice(i, 1);
        n();
      }
    };
  }, dispose() {
    for (let t of A.splice(0))
      t();
  }, style(t, i, n) {
    let o = t.style.getPropertyValue(i);
    return Object.assign(t.style, { [i]: n }), this.add(() => {
      Object.assign(t.style, { [i]: o });
    });
  } };
  return e;
}
function QQ() {
  let [A] = u.useState(dC);
  return u.useEffect(() => () => A.dispose(), [A]), A;
}
let ye = function(A) {
  let e = Ks(A);
  return b.useCallback((...t) => e.current(...t), [e]);
};
function lAA() {
  let [A, e] = u.useState(fu.isHandoffComplete);
  return A && fu.isHandoffComplete === !1 && e(!1), u.useEffect(() => {
    A !== !0 && e(!0);
  }, [A]), u.useEffect(() => fu.handoff(), []), A;
}
var hcA;
let Ag = (hcA = b.useId) != null ? hcA : function() {
  let A = lAA(), [e, t] = b.useState(A ? () => fu.nextId() : null);
  return Xn(() => {
    e === null && t(fu.nextId());
  }, [e]), e != null ? "" + e : void 0;
};
function Ki(A, e, ...t) {
  if (A in e) {
    let n = e[A];
    return typeof n == "function" ? n(...t) : n;
  }
  let i = new Error(`Tried to handle "${A}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map((n) => `"${n}"`).join(", ")}.`);
  throw Error.captureStackTrace && Error.captureStackTrace(i, Ki), i;
}
function $p(A) {
  return fu.isServer ? null : A instanceof Node ? A.ownerDocument : A != null && A.hasOwnProperty("current") && A.current instanceof Node ? A.current.ownerDocument : document;
}
let iO = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((A) => `${A}:not([tabindex='-1'])`).join(",");
var is = ((A) => (A[A.First = 1] = "First", A[A.Previous = 2] = "Previous", A[A.Next = 4] = "Next", A[A.Last = 8] = "Last", A[A.WrapAround = 16] = "WrapAround", A[A.NoScroll = 32] = "NoScroll", A))(is || {}), af = ((A) => (A[A.Error = 0] = "Error", A[A.Overflow = 1] = "Overflow", A[A.Success = 2] = "Success", A[A.Underflow = 3] = "Underflow", A))(af || {}), vhe = ((A) => (A[A.Previous = -1] = "Previous", A[A.Next = 1] = "Next", A))(vhe || {});
function qR(A = document.body) {
  return A == null ? [] : Array.from(A.querySelectorAll(iO)).sort((e, t) => Math.sign((e.tabIndex || Number.MAX_SAFE_INTEGER) - (t.tabIndex || Number.MAX_SAFE_INTEGER)));
}
var OR = ((A) => (A[A.Strict = 0] = "Strict", A[A.Loose = 1] = "Loose", A))(OR || {});
function jR(A, e = 0) {
  var t;
  return A === ((t = $p(A)) == null ? void 0 : t.body) ? !1 : Ki(e, { 0() {
    return A.matches(iO);
  }, 1() {
    let i = A;
    for (; i !== null; ) {
      if (i.matches(iO))
        return !0;
      i = i.parentElement;
    }
    return !1;
  } });
}
function oFA(A) {
  let e = $p(A);
  dC().nextFrame(() => {
    e && !jR(e.activeElement, 0) && Hhe(A);
  });
}
function Hhe(A) {
  A == null || A.focus({ preventScroll: !0 });
}
let She = ["textarea", "input"].join(",");
function Zhe(A) {
  var e, t;
  return (t = (e = A == null ? void 0 : A.matches) == null ? void 0 : e.call(A, She)) != null ? t : !1;
}
function D3(A, e = (t) => t) {
  return A.slice().sort((t, i) => {
    let n = e(t), o = e(i);
    if (n === null || o === null)
      return 0;
    let g = n.compareDocumentPosition(o);
    return g & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : g & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
  });
}
function Whe(A, e) {
  return NB(qR(), e, { relativeTo: A });
}
function NB(A, e, { sorted: t = !0, relativeTo: i = null, skipElements: n = [] } = {}) {
  let o = Array.isArray(A) ? A.length > 0 ? A[0].ownerDocument : document : A.ownerDocument, g = Array.isArray(A) ? t ? D3(A) : A : qR(A);
  n.length > 0 && g.length > 1 && (g = g.filter((l) => !n.includes(l))), i = i ?? o.activeElement;
  let s = (() => {
    if (e & 5)
      return 1;
    if (e & 10)
      return -1;
    throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
  })(), I = (() => {
    if (e & 1)
      return 0;
    if (e & 2)
      return Math.max(0, g.indexOf(i)) - 1;
    if (e & 4)
      return Math.max(0, g.indexOf(i)) + 1;
    if (e & 8)
      return g.length - 1;
    throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
  })(), r = e & 32 ? { preventScroll: !0 } : {}, a = 0, C = g.length, B;
  do {
    if (a >= C || a + C <= 0)
      return 0;
    let l = I + a;
    if (e & 16)
      l = (l + C) % C;
    else {
      if (l < 0)
        return 3;
      if (l >= C)
        return 1;
    }
    B = g[l], B == null || B.focus(r), a += s;
  } while (B !== o.activeElement);
  return e & 6 && Zhe(B) && B.select(), B.hasAttribute("tabindex") || B.setAttribute("tabindex", "0"), 2;
}
function M5(A, e, t) {
  let i = Ks(e);
  u.useEffect(() => {
    function n(o) {
      i.current(o);
    }
    return document.addEventListener(A, n, t), () => document.removeEventListener(A, n, t);
  }, [A, t]);
}
function cAA(A, e, t = !0) {
  let i = u.useRef(!1);
  u.useEffect(() => {
    requestAnimationFrame(() => {
      i.current = t;
    });
  }, [t]);
  function n(g, s) {
    if (!i.current || g.defaultPrevented)
      return;
    let I = function a(C) {
      return typeof C == "function" ? a(C()) : Array.isArray(C) || C instanceof Set ? C : [C];
    }(A), r = s(g);
    if (r !== null && r.getRootNode().contains(r)) {
      for (let a of I) {
        if (a === null)
          continue;
        let C = a instanceof HTMLElement ? a : a.current;
        if (C != null && C.contains(r) || g.composed && g.composedPath().includes(C))
          return;
      }
      return !jR(r, OR.Loose) && r.tabIndex !== -1 && g.preventDefault(), e(g, r);
    }
  }
  let o = u.useRef(null);
  M5("mousedown", (g) => {
    var s, I;
    i.current && (o.current = ((I = (s = g.composedPath) == null ? void 0 : s.call(g)) == null ? void 0 : I[0]) || g.target);
  }, !0), M5("click", (g) => {
    o.current && (n(g, () => o.current), o.current = null);
  }, !0), M5("blur", (g) => n(g, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
}
function mcA(A) {
  var e;
  if (A.type)
    return A.type;
  let t = (e = A.as) != null ? e : "button";
  if (typeof t == "string" && t.toLowerCase() === "button")
    return "button";
}
function QAA(A, e) {
  let [t, i] = u.useState(() => mcA(A));
  return Xn(() => {
    i(mcA(A));
  }, [A.type, A.as]), Xn(() => {
    t || e.current && e.current instanceof HTMLButtonElement && !e.current.hasAttribute("type") && i("button");
  }, [t, e]), t;
}
let gFA = Symbol();
function Khe(A, e = !0) {
  return Object.assign(A, { [gFA]: e });
}
function Tn(...A) {
  let e = u.useRef(A);
  u.useEffect(() => {
    e.current = A;
  }, [A]);
  let t = ye((i) => {
    for (let n of e.current)
      n != null && (typeof n == "function" ? n(i) : n.current = i);
  });
  return A.every((i) => i == null || (i == null ? void 0 : i[gFA])) ? void 0 : t;
}
function sFA({ container: A, accept: e, walk: t, enabled: i = !0 }) {
  let n = u.useRef(e), o = u.useRef(t);
  u.useEffect(() => {
    n.current = e, o.current = t;
  }, [e, t]), Xn(() => {
    if (!A || !i)
      return;
    let g = $p(A);
    if (!g)
      return;
    let s = n.current, I = o.current, r = Object.assign((C) => s(C), { acceptNode: s }), a = g.createTreeWalker(A, NodeFilter.SHOW_ELEMENT, r, !1);
    for (; a.nextNode(); )
      I(a.currentNode);
  }, [A, i, n, o]);
}
function Uhe(A) {
  throw new Error("Unexpected object: " + A);
}
var Qn = ((A) => (A[A.First = 0] = "First", A[A.Previous = 1] = "Previous", A[A.Next = 2] = "Next", A[A.Last = 3] = "Last", A[A.Specific = 4] = "Specific", A[A.Nothing = 5] = "Nothing", A))(Qn || {});
function IFA(A, e) {
  let t = e.resolveItems();
  if (t.length <= 0)
    return null;
  let i = e.resolveActiveIndex(), n = i ?? -1, o = (() => {
    switch (A.focus) {
      case 0:
        return t.findIndex((g) => !e.resolveDisabled(g));
      case 1: {
        let g = t.slice().reverse().findIndex((s, I, r) => n !== -1 && r.length - I - 1 >= n ? !1 : !e.resolveDisabled(s));
        return g === -1 ? g : t.length - 1 - g;
      }
      case 2:
        return t.findIndex((g, s) => s <= n ? !1 : !e.resolveDisabled(g));
      case 3: {
        let g = t.slice().reverse().findIndex((s) => !e.resolveDisabled(s));
        return g === -1 ? g : t.length - 1 - g;
      }
      case 4:
        return t.findIndex((g) => e.resolveId(g) === A.id);
      case 5:
        return null;
      default:
        Uhe(A);
    }
  })();
  return o === -1 ? i : o;
}
function aFA(...A) {
  return A.filter(Boolean).join(" ");
}
var nl = ((A) => (A[A.None = 0] = "None", A[A.RenderStrategy = 1] = "RenderStrategy", A[A.Static = 2] = "Static", A))(nl || {}), Fc = ((A) => (A[A.Unmount = 0] = "Unmount", A[A.Hidden = 1] = "Hidden", A))(Fc || {});
function jn({ ourProps: A, theirProps: e, slot: t, defaultTag: i, features: n, visible: o = !0, name: g }) {
  let s = rFA(e, A);
  if (o)
    return LM(s, t, i, g);
  let I = n ?? 0;
  if (I & 2) {
    let { static: r = !1, ...a } = s;
    if (r)
      return LM(a, t, i, g);
  }
  if (I & 1) {
    let { unmount: r = !0, ...a } = s;
    return Ki(r ? 0 : 1, { 0() {
      return null;
    }, 1() {
      return LM({ ...a, hidden: !0, style: { display: "none" } }, t, i, g);
    } });
  }
  return LM(s, t, i, g);
}
function LM(A, e = {}, t, i) {
  var n;
  let { as: o = t, children: g, refName: s = "ref", ...I } = x5(A, ["unmount", "static"]), r = A.ref !== void 0 ? { [s]: A.ref } : {}, a = typeof g == "function" ? g(e) : g;
  "className" in I && I.className && typeof I.className == "function" && (I.className = I.className(e));
  let C = {};
  if (e) {
    let B = !1, l = [];
    for (let [Q, E] of Object.entries(e))
      typeof E == "boolean" && (B = !0), E === !0 && l.push(Q);
    B && (C["data-headlessui-state"] = l.join(" "));
  }
  if (o === u.Fragment && Object.keys(TH(I)).length > 0) {
    if (!u.isValidElement(a) || Array.isArray(a) && a.length > 1)
      throw new Error(['Passing props on "Fragment"!', "", `The current component <${i} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(I).map((Q) => `  - ${Q}`).join(`
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((Q) => `  - ${Q}`).join(`
`)].join(`
`));
    let B = aFA((n = a.props) == null ? void 0 : n.className, I.className), l = B ? { className: B } : {};
    return u.cloneElement(a, Object.assign({}, rFA(a.props, TH(x5(I, ["ref"]))), C, r, Vhe(a.ref, r.ref), l));
  }
  return u.createElement(o, Object.assign({}, x5(I, ["ref"]), o !== u.Fragment && r, o !== u.Fragment && C), a);
}
function Vhe(...A) {
  return { ref: A.every((e) => e == null) ? void 0 : (e) => {
    for (let t of A)
      t != null && (typeof t == "function" ? t(e) : t.current = e);
  } };
}
function rFA(...A) {
  if (A.length === 0)
    return {};
  if (A.length === 1)
    return A[0];
  let e = {}, t = {};
  for (let i of A)
    for (let n in i)
      n.startsWith("on") && typeof i[n] == "function" ? (t[n] != null || (t[n] = []), t[n].push(i[n])) : e[n] = i[n];
  if (e.disabled || e["aria-disabled"])
    return Object.assign(e, Object.fromEntries(Object.keys(t).map((i) => [i, void 0])));
  for (let i in t)
    Object.assign(e, { [i](n, ...o) {
      let g = t[i];
      for (let s of g) {
        if ((n instanceof Event || (n == null ? void 0 : n.nativeEvent) instanceof Event) && n.defaultPrevented)
          return;
        s(n, ...o);
      }
    } });
  return e;
}
function Zn(A) {
  var e;
  return Object.assign(u.forwardRef(A), { displayName: (e = A.displayName) != null ? e : A.name });
}
function TH(A) {
  let e = Object.assign({}, A);
  for (let t in e)
    e[t] === void 0 && delete e[t];
  return e;
}
function x5(A, e = []) {
  let t = Object.assign({}, A);
  for (let i of e)
    i in t && delete t[i];
  return t;
}
function rf(A) {
  let e = A.parentElement, t = null;
  for (; e && !(e instanceof HTMLFieldSetElement); )
    e instanceof HTMLLegendElement && (t = e), e = e.parentElement;
  let i = (e == null ? void 0 : e.getAttribute("disabled")) === "";
  return i && Xhe(t) ? !1 : i;
}
function Xhe(A) {
  if (!A)
    return !1;
  let e = A.previousElementSibling;
  for (; e !== null; ) {
    if (e instanceof HTMLLegendElement)
      return !1;
    e = e.previousElementSibling;
  }
  return !0;
}
function EAA(A = {}, e = null, t = []) {
  for (let [i, n] of Object.entries(A))
    BFA(t, CFA(e, i), n);
  return t;
}
function CFA(A, e) {
  return A ? A + "[" + e + "]" : e;
}
function BFA(A, e, t) {
  if (Array.isArray(t))
    for (let [i, n] of t.entries())
      BFA(A, CFA(e, i.toString()), n);
  else
    t instanceof Date ? A.push([e, t.toISOString()]) : typeof t == "boolean" ? A.push([e, t ? "1" : "0"]) : typeof t == "string" ? A.push([e, t]) : typeof t == "number" ? A.push([e, `${t}`]) : t == null ? A.push([e, ""]) : EAA(t, e, A);
}
function zhe(A) {
  var e;
  let t = (e = A == null ? void 0 : A.form) != null ? e : A.closest("form");
  if (t) {
    for (let i of t.elements)
      if (i.tagName === "INPUT" && i.type === "submit" || i.tagName === "BUTTON" && i.type === "submit" || i.nodeName === "INPUT" && i.type === "image") {
        i.click();
        return;
      }
  }
}
let The = "div";
var Cf = ((A) => (A[A.None = 1] = "None", A[A.Focusable = 2] = "Focusable", A[A.Hidden = 4] = "Hidden", A))(Cf || {});
function _he(A, e) {
  let { features: t = 1, ...i } = A, n = { ref: e, "aria-hidden": (t & 2) === 2 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(t & 4) === 4 && (t & 2) !== 2 && { display: "none" } } };
  return jn({ ourProps: n, theirProps: i, slot: {}, defaultTag: The, name: "Hidden" });
}
let SY = Zn(_he), uAA = u.createContext(null);
uAA.displayName = "OpenClosedContext";
var Dn = ((A) => (A[A.Open = 1] = "Open", A[A.Closed = 2] = "Closed", A[A.Closing = 4] = "Closing", A[A.Opening = 8] = "Opening", A))(Dn || {});
function vD() {
  return u.useContext(uAA);
}
function G3({ value: A, children: e }) {
  return b.createElement(uAA.Provider, { value: A }, e);
}
var et = ((A) => (A.Space = " ", A.Enter = "Enter", A.Escape = "Escape", A.Backspace = "Backspace", A.Delete = "Delete", A.ArrowLeft = "ArrowLeft", A.ArrowUp = "ArrowUp", A.ArrowRight = "ArrowRight", A.ArrowDown = "ArrowDown", A.Home = "Home", A.End = "End", A.PageUp = "PageUp", A.PageDown = "PageDown", A.Tab = "Tab", A))(et || {});
function lFA(A, e, t) {
  let [i, n] = u.useState(t), o = A !== void 0, g = u.useRef(o), s = u.useRef(!1), I = u.useRef(!1);
  return o && !g.current && !s.current ? (s.current = !0, g.current = o, console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")) : !o && g.current && !I.current && (I.current = !0, g.current = o, console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")), [o ? A : i, ye((r) => (o || n(r), e == null ? void 0 : e(r)))];
}
function pcA(A) {
  return [A.screenX, A.screenY];
}
function cFA() {
  let A = u.useRef([-1, -1]);
  return { wasMoved(e) {
    let t = pcA(e);
    return A.current[0] === t[0] && A.current[1] === t[1] ? !1 : (A.current = t, !0);
  }, update(e) {
    A.current = pcA(e);
  } };
}
function qhe(A, e, t) {
  let i = Ks(e);
  u.useEffect(() => {
    function n(o) {
      i.current(o);
    }
    return window.addEventListener(A, n, t), () => window.removeEventListener(A, n, t);
  }, [A, t]);
}
var Mc = ((A) => (A[A.Forwards = 0] = "Forwards", A[A.Backwards = 1] = "Backwards", A))(Mc || {});
function QFA() {
  let A = u.useRef(0);
  return qhe("keydown", (e) => {
    e.key === "Tab" && (A.current = e.shiftKey ? 1 : 0);
  }, !0), A;
}
function EFA() {
  let A = u.useRef(!1);
  return Xn(() => (A.current = !0, () => {
    A.current = !1;
  }), []), A;
}
function k3(...A) {
  return u.useMemo(() => $p(...A), [...A]);
}
function Ohe(A, e, t, i) {
  let n = Ks(t);
  u.useEffect(() => {
    A = A ?? window;
    function o(g) {
      n.current(g);
    }
    return A.addEventListener(e, o, i), () => A.removeEventListener(e, o, i);
  }, [A, e, i]);
}
let uFA = u.createContext(null);
function dFA() {
  let A = u.useContext(uFA);
  if (A === null) {
    let e = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
    throw Error.captureStackTrace && Error.captureStackTrace(e, dFA), e;
  }
  return A;
}
function hFA() {
  let [A, e] = u.useState([]);
  return [A.length > 0 ? A.join(" ") : void 0, u.useMemo(() => function(t) {
    let i = ye((o) => (e((g) => [...g, o]), () => e((g) => {
      let s = g.slice(), I = s.indexOf(o);
      return I !== -1 && s.splice(I, 1), s;
    }))), n = u.useMemo(() => ({ register: i, slot: t.slot, name: t.name, props: t.props }), [i, t.slot, t.name, t.props]);
    return b.createElement(uFA.Provider, { value: n }, t.children);
  }, [e])];
}
let jhe = "p";
function Phe(A, e) {
  let t = Ag(), { id: i = `headlessui-description-${t}`, ...n } = A, o = dFA(), g = Tn(e);
  Xn(() => o.register(i), [i, o.register]);
  let s = { ref: g, ...o.props, id: i };
  return jn({ ourProps: s, theirProps: n, slot: o.slot || {}, defaultTag: jhe, name: o.name || "Description" });
}
let $he = Zn(Phe), Ame = Object.assign($he, {});
var eme = ((A) => (A[A.Open = 0] = "Open", A[A.Closed = 1] = "Closed", A))(eme || {}), tme = ((A) => (A[A.Single = 0] = "Single", A[A.Multi = 1] = "Multi", A))(tme || {}), ime = ((A) => (A[A.Pointer = 0] = "Pointer", A[A.Other = 1] = "Other", A))(ime || {}), nme = ((A) => (A[A.OpenListbox = 0] = "OpenListbox", A[A.CloseListbox = 1] = "CloseListbox", A[A.GoToOption = 2] = "GoToOption", A[A.Search = 3] = "Search", A[A.ClearSearch = 4] = "ClearSearch", A[A.RegisterOption = 5] = "RegisterOption", A[A.UnregisterOption = 6] = "UnregisterOption", A[A.RegisterLabel = 7] = "RegisterLabel", A))(nme || {});
function L5(A, e = (t) => t) {
  let t = A.activeOptionIndex !== null ? A.options[A.activeOptionIndex] : null, i = D3(e(A.options.slice()), (o) => o.dataRef.current.domRef.current), n = t ? i.indexOf(t) : null;
  return n === -1 && (n = null), { options: i, activeOptionIndex: n };
}
let ome = { 1(A) {
  return A.dataRef.current.disabled || A.listboxState === 1 ? A : { ...A, activeOptionIndex: null, listboxState: 1 };
}, 0(A) {
  if (A.dataRef.current.disabled || A.listboxState === 0)
    return A;
  let e = A.activeOptionIndex, { isSelected: t } = A.dataRef.current, i = A.options.findIndex((n) => t(n.dataRef.current.value));
  return i !== -1 && (e = i), { ...A, listboxState: 0, activeOptionIndex: e };
}, 2(A, e) {
  var t;
  if (A.dataRef.current.disabled || A.listboxState === 1)
    return A;
  let i = L5(A), n = IFA(e, { resolveItems: () => i.options, resolveActiveIndex: () => i.activeOptionIndex, resolveId: (o) => o.id, resolveDisabled: (o) => o.dataRef.current.disabled });
  return { ...A, ...i, searchQuery: "", activeOptionIndex: n, activationTrigger: (t = e.trigger) != null ? t : 1 };
}, 3: (A, e) => {
  if (A.dataRef.current.disabled || A.listboxState === 1)
    return A;
  let t = A.searchQuery !== "" ? 0 : 1, i = A.searchQuery + e.value.toLowerCase(), n = (A.activeOptionIndex !== null ? A.options.slice(A.activeOptionIndex + t).concat(A.options.slice(0, A.activeOptionIndex + t)) : A.options).find((g) => {
    var s;
    return !g.dataRef.current.disabled && ((s = g.dataRef.current.textValue) == null ? void 0 : s.startsWith(i));
  }), o = n ? A.options.indexOf(n) : -1;
  return o === -1 || o === A.activeOptionIndex ? { ...A, searchQuery: i } : { ...A, searchQuery: i, activeOptionIndex: o, activationTrigger: 1 };
}, 4(A) {
  return A.dataRef.current.disabled || A.listboxState === 1 || A.searchQuery === "" ? A : { ...A, searchQuery: "" };
}, 5: (A, e) => {
  let t = { id: e.id, dataRef: e.dataRef }, i = L5(A, (n) => [...n, t]);
  return A.activeOptionIndex === null && A.dataRef.current.isSelected(e.dataRef.current.value) && (i.activeOptionIndex = i.options.indexOf(t)), { ...A, ...i };
}, 6: (A, e) => {
  let t = L5(A, (i) => {
    let n = i.findIndex((o) => o.id === e.id);
    return n !== -1 && i.splice(n, 1), i;
  });
  return { ...A, ...t, activationTrigger: 1 };
}, 7: (A, e) => ({ ...A, labelId: e.id }) }, dAA = u.createContext(null);
dAA.displayName = "ListboxActionsContext";
function PR(A) {
  let e = u.useContext(dAA);
  if (e === null) {
    let t = new Error(`<${A} /> is missing a parent <Listbox /> component.`);
    throw Error.captureStackTrace && Error.captureStackTrace(t, PR), t;
  }
  return e;
}
let hAA = u.createContext(null);
hAA.displayName = "ListboxDataContext";
function $R(A) {
  let e = u.useContext(hAA);
  if (e === null) {
    let t = new Error(`<${A} /> is missing a parent <Listbox /> component.`);
    throw Error.captureStackTrace && Error.captureStackTrace(t, $R), t;
  }
  return e;
}
function gme(A, e) {
  return Ki(e.type, ome, A, e);
}
let sme = u.Fragment;
function Ime(A, e) {
  let { value: t, defaultValue: i, name: n, onChange: o, by: g = (AA, gA) => AA === gA, disabled: s = !1, horizontal: I = !1, multiple: r = !1, ...a } = A;
  const C = I ? "horizontal" : "vertical";
  let B = Tn(e), [l = r ? [] : void 0, Q] = lFA(t, o, i), [E, d] = u.useReducer(gme, { dataRef: u.createRef(), listboxState: 1, options: [], searchQuery: "", labelId: null, activeOptionIndex: null, activationTrigger: 1 }), m = u.useRef({ static: !1, hold: !1 }), y = u.useRef(null), f = u.useRef(null), w = u.useRef(null), G = ye(typeof g == "string" ? (AA, gA) => {
    let rA = g;
    return (AA == null ? void 0 : AA[rA]) === (gA == null ? void 0 : gA[rA]);
  } : g), R = u.useCallback((AA) => Ki(F.mode, { 1: () => l.some((gA) => G(gA, AA)), 0: () => G(l, AA) }), [l]), F = u.useMemo(() => ({ ...E, value: l, disabled: s, mode: r ? 1 : 0, orientation: C, compare: G, isSelected: R, optionsPropsRef: m, labelRef: y, buttonRef: f, optionsRef: w }), [l, s, r, E]);
  Xn(() => {
    E.dataRef.current = F;
  }, [F]), cAA([F.buttonRef, F.optionsRef], (AA, gA) => {
    var rA;
    d({ type: 1 }), jR(gA, OR.Loose) || (AA.preventDefault(), (rA = F.buttonRef.current) == null || rA.focus());
  }, F.listboxState === 0);
  let Z = u.useMemo(() => ({ open: F.listboxState === 0, disabled: s, value: l }), [F, s, l]), c = ye((AA) => {
    let gA = F.options.find((rA) => rA.id === AA);
    gA && j(gA.dataRef.current.value);
  }), J = ye(() => {
    if (F.activeOptionIndex !== null) {
      let { dataRef: AA, id: gA } = F.options[F.activeOptionIndex];
      j(AA.current.value), d({ type: 2, focus: Qn.Specific, id: gA });
    }
  }), p = ye(() => d({ type: 0 })), N = ye(() => d({ type: 1 })), v = ye((AA, gA, rA) => AA === Qn.Specific ? d({ type: 2, focus: Qn.Specific, id: gA, trigger: rA }) : d({ type: 2, focus: AA, trigger: rA })), K = ye((AA, gA) => (d({ type: 5, id: AA, dataRef: gA }), () => d({ type: 6, id: AA }))), U = ye((AA) => (d({ type: 7, id: AA }), () => d({ type: 7, id: null }))), j = ye((AA) => Ki(F.mode, { 0() {
    return Q == null ? void 0 : Q(AA);
  }, 1() {
    let gA = F.value.slice(), rA = gA.findIndex((sA) => G(sA, AA));
    return rA === -1 ? gA.push(AA) : gA.splice(rA, 1), Q == null ? void 0 : Q(gA);
  } })), q = ye((AA) => d({ type: 3, value: AA })), O = ye(() => d({ type: 4 })), $ = u.useMemo(() => ({ onChange: j, registerOption: K, registerLabel: U, goToOption: v, closeListbox: N, openListbox: p, selectActiveOption: J, selectOption: c, search: q, clearSearch: O }), []), _ = { ref: B }, tA = u.useRef(null), nA = QQ();
  return u.useEffect(() => {
    tA.current && i !== void 0 && nA.addEventListener(tA.current, "reset", () => {
      j(i);
    });
  }, [tA, j]), b.createElement(dAA.Provider, { value: $ }, b.createElement(hAA.Provider, { value: F }, b.createElement(G3, { value: Ki(F.listboxState, { 0: Dn.Open, 1: Dn.Closed }) }, n != null && l != null && EAA({ [n]: l }).map(([AA, gA], rA) => b.createElement(SY, { features: Cf.Hidden, ref: rA === 0 ? (sA) => {
    var lA;
    tA.current = (lA = sA == null ? void 0 : sA.closest("form")) != null ? lA : null;
  } : void 0, ...TH({ key: AA, as: "input", type: "hidden", hidden: !0, readOnly: !0, name: AA, value: gA }) })), jn({ ourProps: _, theirProps: a, slot: Z, defaultTag: sme, name: "Listbox" }))));
}
let ame = "button";
function rme(A, e) {
  var t;
  let i = Ag(), { id: n = `headlessui-listbox-button-${i}`, ...o } = A, g = $R("Listbox.Button"), s = PR("Listbox.Button"), I = Tn(g.buttonRef, e), r = QQ(), a = ye((d) => {
    switch (d.key) {
      case et.Space:
      case et.Enter:
      case et.ArrowDown:
        d.preventDefault(), s.openListbox(), r.nextFrame(() => {
          g.value || s.goToOption(Qn.First);
        });
        break;
      case et.ArrowUp:
        d.preventDefault(), s.openListbox(), r.nextFrame(() => {
          g.value || s.goToOption(Qn.Last);
        });
        break;
    }
  }), C = ye((d) => {
    switch (d.key) {
      case et.Space:
        d.preventDefault();
        break;
    }
  }), B = ye((d) => {
    if (rf(d.currentTarget))
      return d.preventDefault();
    g.listboxState === 0 ? (s.closeListbox(), r.nextFrame(() => {
      var m;
      return (m = g.buttonRef.current) == null ? void 0 : m.focus({ preventScroll: !0 });
    })) : (d.preventDefault(), s.openListbox());
  }), l = nFA(() => {
    if (g.labelId)
      return [g.labelId, n].join(" ");
  }, [g.labelId, n]), Q = u.useMemo(() => ({ open: g.listboxState === 0, disabled: g.disabled, value: g.value }), [g]), E = { ref: I, id: n, type: QAA(A, g.buttonRef), "aria-haspopup": "listbox", "aria-controls": (t = g.optionsRef.current) == null ? void 0 : t.id, "aria-expanded": g.disabled ? void 0 : g.listboxState === 0, "aria-labelledby": l, disabled: g.disabled, onKeyDown: a, onKeyUp: C, onClick: B };
  return jn({ ourProps: E, theirProps: o, slot: Q, defaultTag: ame, name: "Listbox.Button" });
}
let Cme = "label";
function Bme(A, e) {
  let t = Ag(), { id: i = `headlessui-listbox-label-${t}`, ...n } = A, o = $R("Listbox.Label"), g = PR("Listbox.Label"), s = Tn(o.labelRef, e);
  Xn(() => g.registerLabel(i), [i]);
  let I = ye(() => {
    var a;
    return (a = o.buttonRef.current) == null ? void 0 : a.focus({ preventScroll: !0 });
  }), r = u.useMemo(() => ({ open: o.listboxState === 0, disabled: o.disabled }), [o]);
  return jn({ ourProps: { ref: s, id: i, onClick: I }, theirProps: n, slot: r, defaultTag: Cme, name: "Listbox.Label" });
}
let lme = "ul", cme = nl.RenderStrategy | nl.Static;
function Qme(A, e) {
  var t;
  let i = Ag(), { id: n = `headlessui-listbox-options-${i}`, ...o } = A, g = $R("Listbox.Options"), s = PR("Listbox.Options"), I = Tn(g.optionsRef, e), r = QQ(), a = QQ(), C = vD(), B = (() => C !== null ? (C & Dn.Open) === Dn.Open : g.listboxState === 0)();
  u.useEffect(() => {
    var m;
    let y = g.optionsRef.current;
    y && g.listboxState === 0 && y !== ((m = $p(y)) == null ? void 0 : m.activeElement) && y.focus({ preventScroll: !0 });
  }, [g.listboxState, g.optionsRef]);
  let l = ye((m) => {
    switch (a.dispose(), m.key) {
      case et.Space:
        if (g.searchQuery !== "")
          return m.preventDefault(), m.stopPropagation(), s.search(m.key);
      case et.Enter:
        if (m.preventDefault(), m.stopPropagation(), g.activeOptionIndex !== null) {
          let { dataRef: y } = g.options[g.activeOptionIndex];
          s.onChange(y.current.value);
        }
        g.mode === 0 && (s.closeListbox(), dC().nextFrame(() => {
          var y;
          return (y = g.buttonRef.current) == null ? void 0 : y.focus({ preventScroll: !0 });
        }));
        break;
      case Ki(g.orientation, { vertical: et.ArrowDown, horizontal: et.ArrowRight }):
        return m.preventDefault(), m.stopPropagation(), s.goToOption(Qn.Next);
      case Ki(g.orientation, { vertical: et.ArrowUp, horizontal: et.ArrowLeft }):
        return m.preventDefault(), m.stopPropagation(), s.goToOption(Qn.Previous);
      case et.Home:
      case et.PageUp:
        return m.preventDefault(), m.stopPropagation(), s.goToOption(Qn.First);
      case et.End:
      case et.PageDown:
        return m.preventDefault(), m.stopPropagation(), s.goToOption(Qn.Last);
      case et.Escape:
        return m.preventDefault(), m.stopPropagation(), s.closeListbox(), r.nextFrame(() => {
          var y;
          return (y = g.buttonRef.current) == null ? void 0 : y.focus({ preventScroll: !0 });
        });
      case et.Tab:
        m.preventDefault(), m.stopPropagation();
        break;
      default:
        m.key.length === 1 && (s.search(m.key), a.setTimeout(() => s.clearSearch(), 350));
        break;
    }
  }), Q = nFA(() => {
    var m, y, f;
    return (f = (m = g.labelRef.current) == null ? void 0 : m.id) != null ? f : (y = g.buttonRef.current) == null ? void 0 : y.id;
  }, [g.labelRef.current, g.buttonRef.current]), E = u.useMemo(() => ({ open: g.listboxState === 0 }), [g]), d = { "aria-activedescendant": g.activeOptionIndex === null || (t = g.options[g.activeOptionIndex]) == null ? void 0 : t.id, "aria-multiselectable": g.mode === 1 ? !0 : void 0, "aria-labelledby": Q, "aria-orientation": g.orientation, id: n, onKeyDown: l, role: "listbox", tabIndex: 0, ref: I };
  return jn({ ourProps: d, theirProps: o, slot: E, defaultTag: lme, features: cme, visible: B, name: "Listbox.Options" });
}
let Eme = "li";
function ume(A, e) {
  let t = Ag(), { id: i = `headlessui-listbox-option-${t}`, disabled: n = !1, value: o, ...g } = A, s = $R("Listbox.Option"), I = PR("Listbox.Option"), r = s.activeOptionIndex !== null ? s.options[s.activeOptionIndex].id === i : !1, a = s.isSelected(o), C = u.useRef(null), B = Ks({ disabled: n, value: o, domRef: C, get textValue() {
    var G, R;
    return (R = (G = C.current) == null ? void 0 : G.textContent) == null ? void 0 : R.toLowerCase();
  } }), l = Tn(e, C);
  Xn(() => {
    if (s.listboxState !== 0 || !r || s.activationTrigger === 0)
      return;
    let G = dC();
    return G.requestAnimationFrame(() => {
      var R, F;
      (F = (R = C.current) == null ? void 0 : R.scrollIntoView) == null || F.call(R, { block: "nearest" });
    }), G.dispose;
  }, [C, r, s.listboxState, s.activationTrigger, s.activeOptionIndex]), Xn(() => I.registerOption(i, B), [B, i]);
  let Q = ye((G) => {
    if (n)
      return G.preventDefault();
    I.onChange(o), s.mode === 0 && (I.closeListbox(), dC().nextFrame(() => {
      var R;
      return (R = s.buttonRef.current) == null ? void 0 : R.focus({ preventScroll: !0 });
    }));
  }), E = ye(() => {
    if (n)
      return I.goToOption(Qn.Nothing);
    I.goToOption(Qn.Specific, i);
  }), d = cFA(), m = ye((G) => d.update(G)), y = ye((G) => {
    d.wasMoved(G) && (n || r || I.goToOption(Qn.Specific, i, 0));
  }), f = ye((G) => {
    d.wasMoved(G) && (n || r && I.goToOption(Qn.Nothing));
  }), w = u.useMemo(() => ({ active: r, selected: a, disabled: n }), [r, a, n]);
  return jn({ ourProps: { id: i, ref: l, role: "option", tabIndex: n === !0 ? void 0 : -1, "aria-disabled": n === !0 ? !0 : void 0, "aria-selected": a, disabled: void 0, onClick: Q, onFocus: E, onPointerEnter: m, onMouseEnter: m, onPointerMove: y, onMouseMove: y, onPointerLeave: f, onMouseLeave: f }, theirProps: g, slot: w, defaultTag: Eme, name: "Listbox.Option" });
}
let dme = Zn(Ime), hme = Zn(rme), mme = Zn(Bme), pme = Zn(Qme), yme = Zn(ume), v5 = Object.assign(dme, { Button: hme, Label: mme, Options: pme, Option: yme });
var bme = ((A) => (A[A.Open = 0] = "Open", A[A.Closed = 1] = "Closed", A))(bme || {}), wme = ((A) => (A[A.Pointer = 0] = "Pointer", A[A.Other = 1] = "Other", A))(wme || {}), fme = ((A) => (A[A.OpenMenu = 0] = "OpenMenu", A[A.CloseMenu = 1] = "CloseMenu", A[A.GoToItem = 2] = "GoToItem", A[A.Search = 3] = "Search", A[A.ClearSearch = 4] = "ClearSearch", A[A.RegisterItem = 5] = "RegisterItem", A[A.UnregisterItem = 6] = "UnregisterItem", A))(fme || {});
function H5(A, e = (t) => t) {
  let t = A.activeItemIndex !== null ? A.items[A.activeItemIndex] : null, i = D3(e(A.items.slice()), (o) => o.dataRef.current.domRef.current), n = t ? i.indexOf(t) : null;
  return n === -1 && (n = null), { items: i, activeItemIndex: n };
}
let Dme = { 1(A) {
  return A.menuState === 1 ? A : { ...A, activeItemIndex: null, menuState: 1 };
}, 0(A) {
  return A.menuState === 0 ? A : { ...A, menuState: 0 };
}, 2: (A, e) => {
  var t;
  let i = H5(A), n = IFA(e, { resolveItems: () => i.items, resolveActiveIndex: () => i.activeItemIndex, resolveId: (o) => o.id, resolveDisabled: (o) => o.dataRef.current.disabled });
  return { ...A, ...i, searchQuery: "", activeItemIndex: n, activationTrigger: (t = e.trigger) != null ? t : 1 };
}, 3: (A, e) => {
  let t = A.searchQuery !== "" ? 0 : 1, i = A.searchQuery + e.value.toLowerCase(), n = (A.activeItemIndex !== null ? A.items.slice(A.activeItemIndex + t).concat(A.items.slice(0, A.activeItemIndex + t)) : A.items).find((g) => {
    var s;
    return ((s = g.dataRef.current.textValue) == null ? void 0 : s.startsWith(i)) && !g.dataRef.current.disabled;
  }), o = n ? A.items.indexOf(n) : -1;
  return o === -1 || o === A.activeItemIndex ? { ...A, searchQuery: i } : { ...A, searchQuery: i, activeItemIndex: o, activationTrigger: 1 };
}, 4(A) {
  return A.searchQuery === "" ? A : { ...A, searchQuery: "", searchActiveItemIndex: null };
}, 5: (A, e) => {
  let t = H5(A, (i) => [...i, { id: e.id, dataRef: e.dataRef }]);
  return { ...A, ...t };
}, 6: (A, e) => {
  let t = H5(A, (i) => {
    let n = i.findIndex((o) => o.id === e.id);
    return n !== -1 && i.splice(n, 1), i;
  });
  return { ...A, ...t, activationTrigger: 1 };
} }, mAA = u.createContext(null);
mAA.displayName = "MenuContext";
function J3(A) {
  let e = u.useContext(mAA);
  if (e === null) {
    let t = new Error(`<${A} /> is missing a parent <Menu /> component.`);
    throw Error.captureStackTrace && Error.captureStackTrace(t, J3), t;
  }
  return e;
}
function Gme(A, e) {
  return Ki(e.type, Dme, A, e);
}
let kme = u.Fragment;
function Jme(A, e) {
  let t = u.useReducer(Gme, { menuState: 1, buttonRef: u.createRef(), itemsRef: u.createRef(), items: [], searchQuery: "", activeItemIndex: null, activationTrigger: 1 }), [{ menuState: i, itemsRef: n, buttonRef: o }, g] = t, s = Tn(e);
  cAA([o, n], (B, l) => {
    var Q;
    g({ type: 1 }), jR(l, OR.Loose) || (B.preventDefault(), (Q = o.current) == null || Q.focus());
  }, i === 0);
  let I = ye(() => {
    g({ type: 1 });
  }), r = u.useMemo(() => ({ open: i === 0, close: I }), [i, I]), a = A, C = { ref: s };
  return b.createElement(mAA.Provider, { value: t }, b.createElement(G3, { value: Ki(i, { 0: Dn.Open, 1: Dn.Closed }) }, jn({ ourProps: C, theirProps: a, slot: r, defaultTag: kme, name: "Menu" })));
}
let Nme = "button";
function Yme(A, e) {
  var t;
  let i = Ag(), { id: n = `headlessui-menu-button-${i}`, ...o } = A, [g, s] = J3("Menu.Button"), I = Tn(g.buttonRef, e), r = QQ(), a = ye((E) => {
    switch (E.key) {
      case et.Space:
      case et.Enter:
      case et.ArrowDown:
        E.preventDefault(), E.stopPropagation(), s({ type: 0 }), r.nextFrame(() => s({ type: 2, focus: Qn.First }));
        break;
      case et.ArrowUp:
        E.preventDefault(), E.stopPropagation(), s({ type: 0 }), r.nextFrame(() => s({ type: 2, focus: Qn.Last }));
        break;
    }
  }), C = ye((E) => {
    switch (E.key) {
      case et.Space:
        E.preventDefault();
        break;
    }
  }), B = ye((E) => {
    if (rf(E.currentTarget))
      return E.preventDefault();
    A.disabled || (g.menuState === 0 ? (s({ type: 1 }), r.nextFrame(() => {
      var d;
      return (d = g.buttonRef.current) == null ? void 0 : d.focus({ preventScroll: !0 });
    })) : (E.preventDefault(), s({ type: 0 })));
  }), l = u.useMemo(() => ({ open: g.menuState === 0 }), [g]), Q = { ref: I, id: n, type: QAA(A, g.buttonRef), "aria-haspopup": "menu", "aria-controls": (t = g.itemsRef.current) == null ? void 0 : t.id, "aria-expanded": A.disabled ? void 0 : g.menuState === 0, onKeyDown: a, onKeyUp: C, onClick: B };
  return jn({ ourProps: Q, theirProps: o, slot: l, defaultTag: Nme, name: "Menu.Button" });
}
let Rme = "div", Fme = nl.RenderStrategy | nl.Static;
function Mme(A, e) {
  var t, i;
  let n = Ag(), { id: o = `headlessui-menu-items-${n}`, ...g } = A, [s, I] = J3("Menu.Items"), r = Tn(s.itemsRef, e), a = k3(s.itemsRef), C = QQ(), B = vD(), l = (() => B !== null ? (B & Dn.Open) === Dn.Open : s.menuState === 0)();
  u.useEffect(() => {
    let y = s.itemsRef.current;
    y && s.menuState === 0 && y !== (a == null ? void 0 : a.activeElement) && y.focus({ preventScroll: !0 });
  }, [s.menuState, s.itemsRef, a]), sFA({ container: s.itemsRef.current, enabled: s.menuState === 0, accept(y) {
    return y.getAttribute("role") === "menuitem" ? NodeFilter.FILTER_REJECT : y.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
  }, walk(y) {
    y.setAttribute("role", "none");
  } });
  let Q = ye((y) => {
    var f, w;
    switch (C.dispose(), y.key) {
      case et.Space:
        if (s.searchQuery !== "")
          return y.preventDefault(), y.stopPropagation(), I({ type: 3, value: y.key });
      case et.Enter:
        if (y.preventDefault(), y.stopPropagation(), I({ type: 1 }), s.activeItemIndex !== null) {
          let { dataRef: G } = s.items[s.activeItemIndex];
          (w = (f = G.current) == null ? void 0 : f.domRef.current) == null || w.click();
        }
        oFA(s.buttonRef.current);
        break;
      case et.ArrowDown:
        return y.preventDefault(), y.stopPropagation(), I({ type: 2, focus: Qn.Next });
      case et.ArrowUp:
        return y.preventDefault(), y.stopPropagation(), I({ type: 2, focus: Qn.Previous });
      case et.Home:
      case et.PageUp:
        return y.preventDefault(), y.stopPropagation(), I({ type: 2, focus: Qn.First });
      case et.End:
      case et.PageDown:
        return y.preventDefault(), y.stopPropagation(), I({ type: 2, focus: Qn.Last });
      case et.Escape:
        y.preventDefault(), y.stopPropagation(), I({ type: 1 }), dC().nextFrame(() => {
          var G;
          return (G = s.buttonRef.current) == null ? void 0 : G.focus({ preventScroll: !0 });
        });
        break;
      case et.Tab:
        y.preventDefault(), y.stopPropagation(), I({ type: 1 }), dC().nextFrame(() => {
          Whe(s.buttonRef.current, y.shiftKey ? is.Previous : is.Next);
        });
        break;
      default:
        y.key.length === 1 && (I({ type: 3, value: y.key }), C.setTimeout(() => I({ type: 4 }), 350));
        break;
    }
  }), E = ye((y) => {
    switch (y.key) {
      case et.Space:
        y.preventDefault();
        break;
    }
  }), d = u.useMemo(() => ({ open: s.menuState === 0 }), [s]), m = { "aria-activedescendant": s.activeItemIndex === null || (t = s.items[s.activeItemIndex]) == null ? void 0 : t.id, "aria-labelledby": (i = s.buttonRef.current) == null ? void 0 : i.id, id: o, onKeyDown: Q, onKeyUp: E, role: "menu", tabIndex: 0, ref: r };
  return jn({ ourProps: m, theirProps: g, slot: d, defaultTag: Rme, features: Fme, visible: l, name: "Menu.Items" });
}
let xme = u.Fragment;
function Lme(A, e) {
  let t = Ag(), { id: i = `headlessui-menu-item-${t}`, disabled: n = !1, ...o } = A, [g, s] = J3("Menu.Item"), I = g.activeItemIndex !== null ? g.items[g.activeItemIndex].id === i : !1, r = u.useRef(null), a = Tn(e, r);
  Xn(() => {
    if (g.menuState !== 0 || !I || g.activationTrigger === 0)
      return;
    let w = dC();
    return w.requestAnimationFrame(() => {
      var G, R;
      (R = (G = r.current) == null ? void 0 : G.scrollIntoView) == null || R.call(G, { block: "nearest" });
    }), w.dispose;
  }, [r, I, g.menuState, g.activationTrigger, g.activeItemIndex]);
  let C = u.useRef({ disabled: n, domRef: r });
  Xn(() => {
    C.current.disabled = n;
  }, [C, n]), Xn(() => {
    var w, G;
    C.current.textValue = (G = (w = r.current) == null ? void 0 : w.textContent) == null ? void 0 : G.toLowerCase();
  }, [C, r]), Xn(() => (s({ type: 5, id: i, dataRef: C }), () => s({ type: 6, id: i })), [C, i]);
  let B = ye(() => {
    s({ type: 1 });
  }), l = ye((w) => {
    if (n)
      return w.preventDefault();
    s({ type: 1 }), oFA(g.buttonRef.current);
  }), Q = ye(() => {
    if (n)
      return s({ type: 2, focus: Qn.Nothing });
    s({ type: 2, focus: Qn.Specific, id: i });
  }), E = cFA(), d = ye((w) => E.update(w)), m = ye((w) => {
    E.wasMoved(w) && (n || I || s({ type: 2, focus: Qn.Specific, id: i, trigger: 0 }));
  }), y = ye((w) => {
    E.wasMoved(w) && (n || I && s({ type: 2, focus: Qn.Nothing }));
  }), f = u.useMemo(() => ({ active: I, disabled: n, close: B }), [I, n, B]);
  return jn({ ourProps: { id: i, ref: a, role: "menuitem", tabIndex: n === !0 ? void 0 : -1, "aria-disabled": n === !0 ? !0 : void 0, disabled: void 0, onClick: l, onFocus: Q, onPointerEnter: d, onMouseEnter: d, onPointerMove: m, onMouseMove: m, onPointerLeave: y, onMouseLeave: y }, theirProps: o, slot: f, defaultTag: xme, name: "Menu.Item" });
}
let vme = Zn(Jme), Hme = Zn(Yme), Sme = Zn(Mme), Zme = Zn(Lme), S5 = Object.assign(vme, { Button: Hme, Items: Sme, Item: Zme });
var Wme = ((A) => (A[A.Open = 0] = "Open", A[A.Closed = 1] = "Closed", A))(Wme || {}), Kme = ((A) => (A[A.TogglePopover = 0] = "TogglePopover", A[A.ClosePopover = 1] = "ClosePopover", A[A.SetButton = 2] = "SetButton", A[A.SetButtonId = 3] = "SetButtonId", A[A.SetPanel = 4] = "SetPanel", A[A.SetPanelId = 5] = "SetPanelId", A))(Kme || {});
let Ume = { 0: (A) => ({ ...A, popoverState: Ki(A.popoverState, { 0: 1, 1: 0 }) }), 1(A) {
  return A.popoverState === 1 ? A : { ...A, popoverState: 1 };
}, 2(A, e) {
  return A.button === e.button ? A : { ...A, button: e.button };
}, 3(A, e) {
  return A.buttonId === e.buttonId ? A : { ...A, buttonId: e.buttonId };
}, 4(A, e) {
  return A.panel === e.panel ? A : { ...A, panel: e.panel };
}, 5(A, e) {
  return A.panelId === e.panelId ? A : { ...A, panelId: e.panelId };
} }, pAA = u.createContext(null);
pAA.displayName = "PopoverContext";
function N3(A) {
  let e = u.useContext(pAA);
  if (e === null) {
    let t = new Error(`<${A} /> is missing a parent <Popover /> component.`);
    throw Error.captureStackTrace && Error.captureStackTrace(t, N3), t;
  }
  return e;
}
let yAA = u.createContext(null);
yAA.displayName = "PopoverAPIContext";
function bAA(A) {
  let e = u.useContext(yAA);
  if (e === null) {
    let t = new Error(`<${A} /> is missing a parent <Popover /> component.`);
    throw Error.captureStackTrace && Error.captureStackTrace(t, bAA), t;
  }
  return e;
}
let wAA = u.createContext(null);
wAA.displayName = "PopoverGroupContext";
function mFA() {
  return u.useContext(wAA);
}
let fAA = u.createContext(null);
fAA.displayName = "PopoverPanelContext";
function Vme() {
  return u.useContext(fAA);
}
function Xme(A, e) {
  return Ki(e.type, Ume, A, e);
}
let zme = "div";
function Tme(A, e) {
  var t;
  let i = u.useRef(null), n = Tn(e, Khe((N) => {
    i.current = N;
  })), o = u.useRef([]), g = u.useReducer(Xme, { popoverState: 1, buttons: o, button: null, buttonId: null, panel: null, panelId: null, beforePanelSentinel: u.createRef(), afterPanelSentinel: u.createRef() }), [{ popoverState: s, button: I, buttonId: r, panel: a, panelId: C, beforePanelSentinel: B, afterPanelSentinel: l }, Q] = g, E = k3((t = i.current) != null ? t : I), d = u.useMemo(() => {
    if (!I || !a)
      return !1;
    for (let O of document.querySelectorAll("body > *"))
      if (Number(O == null ? void 0 : O.contains(I)) ^ Number(O == null ? void 0 : O.contains(a)))
        return !0;
    let N = qR(), v = N.indexOf(I), K = (v + N.length - 1) % N.length, U = (v + 1) % N.length, j = N[K], q = N[U];
    return !a.contains(j) && !a.contains(q);
  }, [I, a]), m = Ks(r), y = Ks(C), f = u.useMemo(() => ({ buttonId: m, panelId: y, close: () => Q({ type: 1 }) }), [m, y, Q]), w = mFA(), G = w == null ? void 0 : w.registerPopover, R = ye(() => {
    var N;
    return (N = w == null ? void 0 : w.isFocusWithinPopoverGroup()) != null ? N : (E == null ? void 0 : E.activeElement) && ((I == null ? void 0 : I.contains(E.activeElement)) || (a == null ? void 0 : a.contains(E.activeElement)));
  });
  u.useEffect(() => G == null ? void 0 : G(f), [G, f]), Ohe(E == null ? void 0 : E.defaultView, "focus", (N) => {
    var v, K, U, j;
    s === 0 && (R() || I && a && N.target !== window && ((K = (v = B.current) == null ? void 0 : v.contains) != null && K.call(v, N.target) || (j = (U = l.current) == null ? void 0 : U.contains) != null && j.call(U, N.target) || Q({ type: 1 })));
  }, !0), cAA([I, a], (N, v) => {
    Q({ type: 1 }), jR(v, OR.Loose) || (N.preventDefault(), I == null || I.focus());
  }, s === 0);
  let F = ye((N) => {
    Q({ type: 1 });
    let v = (() => N ? N instanceof HTMLElement ? N : "current" in N && N.current instanceof HTMLElement ? N.current : I : I)();
    v == null || v.focus();
  }), Z = u.useMemo(() => ({ close: F, isPortalled: d }), [F, d]), c = u.useMemo(() => ({ open: s === 0, close: F }), [s, F]), J = A, p = { ref: n };
  return b.createElement(pAA.Provider, { value: g }, b.createElement(yAA.Provider, { value: Z }, b.createElement(G3, { value: Ki(s, { 0: Dn.Open, 1: Dn.Closed }) }, jn({ ourProps: p, theirProps: J, slot: c, defaultTag: zme, name: "Popover" }))));
}
let _me = "button";
function qme(A, e) {
  let t = Ag(), { id: i = `headlessui-popover-button-${t}`, ...n } = A, [o, g] = N3("Popover.Button"), { isPortalled: s } = bAA("Popover.Button"), I = u.useRef(null), r = `headlessui-focus-sentinel-${Ag()}`, a = mFA(), C = a == null ? void 0 : a.closeOthers, B = Vme(), l = B === null ? !1 : B === o.panelId;
  u.useEffect(() => {
    if (!l)
      return g({ type: 3, buttonId: i }), () => {
        g({ type: 3, buttonId: null });
      };
  }, [l, i, g]);
  let [Q] = u.useState(() => Symbol()), E = Tn(I, e, l ? null : (N) => {
    if (N)
      o.buttons.current.push(Q);
    else {
      let v = o.buttons.current.indexOf(Q);
      v !== -1 && o.buttons.current.splice(v, 1);
    }
    o.buttons.current.length > 1 && console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."), N && g({ type: 2, button: N });
  }), d = Tn(I, e), m = k3(I), y = ye((N) => {
    var v, K, U;
    if (l) {
      if (o.popoverState === 1)
        return;
      switch (N.key) {
        case et.Space:
        case et.Enter:
          N.preventDefault(), (K = (v = N.target).click) == null || K.call(v), g({ type: 1 }), (U = o.button) == null || U.focus();
          break;
      }
    } else
      switch (N.key) {
        case et.Space:
        case et.Enter:
          N.preventDefault(), N.stopPropagation(), o.popoverState === 1 && (C == null || C(o.buttonId)), g({ type: 0 });
          break;
        case et.Escape:
          if (o.popoverState !== 0)
            return C == null ? void 0 : C(o.buttonId);
          if (!I.current || m != null && m.activeElement && !I.current.contains(m.activeElement))
            return;
          N.preventDefault(), N.stopPropagation(), g({ type: 1 });
          break;
      }
  }), f = ye((N) => {
    l || N.key === et.Space && N.preventDefault();
  }), w = ye((N) => {
    var v, K;
    rf(N.currentTarget) || A.disabled || (l ? (g({ type: 1 }), (v = o.button) == null || v.focus()) : (N.preventDefault(), N.stopPropagation(), o.popoverState === 1 && (C == null || C(o.buttonId)), g({ type: 0 }), (K = o.button) == null || K.focus()));
  }), G = ye((N) => {
    N.preventDefault(), N.stopPropagation();
  }), R = o.popoverState === 0, F = u.useMemo(() => ({ open: R }), [R]), Z = QAA(A, I), c = l ? { ref: d, type: Z, onKeyDown: y, onClick: w } : { ref: E, id: o.buttonId, type: Z, "aria-expanded": A.disabled ? void 0 : o.popoverState === 0, "aria-controls": o.panel ? o.panelId : void 0, onKeyDown: y, onKeyUp: f, onClick: w, onMouseDown: G }, J = QFA(), p = ye(() => {
    let N = o.panel;
    if (!N)
      return;
    function v() {
      Ki(J.current, { [Mc.Forwards]: () => NB(N, is.First), [Mc.Backwards]: () => NB(N, is.Last) }) === af.Error && NB(qR().filter((K) => K.dataset.headlessuiFocusGuard !== "true"), Ki(J.current, { [Mc.Forwards]: is.Next, [Mc.Backwards]: is.Previous }), { relativeTo: o.button });
    }
    v();
  });
  return b.createElement(b.Fragment, null, jn({ ourProps: c, theirProps: n, slot: F, defaultTag: _me, name: "Popover.Button" }), R && !l && s && b.createElement(SY, { id: r, features: Cf.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: p }));
}
let Ome = "div", jme = nl.RenderStrategy | nl.Static;
function Pme(A, e) {
  let t = Ag(), { id: i = `headlessui-popover-overlay-${t}`, ...n } = A, [{ popoverState: o }, g] = N3("Popover.Overlay"), s = Tn(e), I = vD(), r = (() => I !== null ? (I & Dn.Open) === Dn.Open : o === 0)(), a = ye((B) => {
    if (rf(B.currentTarget))
      return B.preventDefault();
    g({ type: 1 });
  }), C = u.useMemo(() => ({ open: o === 0 }), [o]);
  return jn({ ourProps: { ref: s, id: i, "aria-hidden": !0, onClick: a }, theirProps: n, slot: C, defaultTag: Ome, features: jme, visible: r, name: "Popover.Overlay" });
}
let $me = "div", Ape = nl.RenderStrategy | nl.Static;
function epe(A, e) {
  let t = Ag(), { id: i = `headlessui-popover-panel-${t}`, focus: n = !1, ...o } = A, [g, s] = N3("Popover.Panel"), { close: I, isPortalled: r } = bAA("Popover.Panel"), a = `headlessui-focus-sentinel-before-${Ag()}`, C = `headlessui-focus-sentinel-after-${Ag()}`, B = u.useRef(null), l = Tn(B, e, (F) => {
    s({ type: 4, panel: F });
  }), Q = k3(B);
  Xn(() => (s({ type: 5, panelId: i }), () => {
    s({ type: 5, panelId: null });
  }), [i, s]);
  let E = vD(), d = (() => E !== null ? (E & Dn.Open) === Dn.Open : g.popoverState === 0)(), m = ye((F) => {
    var Z;
    switch (F.key) {
      case et.Escape:
        if (g.popoverState !== 0 || !B.current || Q != null && Q.activeElement && !B.current.contains(Q.activeElement))
          return;
        F.preventDefault(), F.stopPropagation(), s({ type: 1 }), (Z = g.button) == null || Z.focus();
        break;
    }
  });
  u.useEffect(() => {
    var F;
    A.static || g.popoverState === 1 && ((F = A.unmount) == null || F) && s({ type: 4, panel: null });
  }, [g.popoverState, A.unmount, A.static, s]), u.useEffect(() => {
    if (!n || g.popoverState !== 0 || !B.current)
      return;
    let F = Q == null ? void 0 : Q.activeElement;
    B.current.contains(F) || NB(B.current, is.First);
  }, [n, B, g.popoverState]);
  let y = u.useMemo(() => ({ open: g.popoverState === 0, close: I }), [g, I]), f = { ref: l, id: i, onKeyDown: m, onBlur: n && g.popoverState === 0 ? (F) => {
    var Z, c, J, p, N;
    let v = F.relatedTarget;
    v && B.current && ((Z = B.current) != null && Z.contains(v) || (s({ type: 1 }), ((J = (c = g.beforePanelSentinel.current) == null ? void 0 : c.contains) != null && J.call(c, v) || (N = (p = g.afterPanelSentinel.current) == null ? void 0 : p.contains) != null && N.call(p, v)) && v.focus({ preventScroll: !0 })));
  } : void 0, tabIndex: -1 }, w = QFA(), G = ye(() => {
    let F = B.current;
    if (!F)
      return;
    function Z() {
      Ki(w.current, { [Mc.Forwards]: () => {
        var c;
        NB(F, is.First) === af.Error && ((c = g.afterPanelSentinel.current) == null || c.focus());
      }, [Mc.Backwards]: () => {
        var c;
        (c = g.button) == null || c.focus({ preventScroll: !0 });
      } });
    }
    Z();
  }), R = ye(() => {
    let F = B.current;
    if (!F)
      return;
    function Z() {
      Ki(w.current, { [Mc.Forwards]: () => {
        var c;
        if (!g.button)
          return;
        let J = qR(), p = J.indexOf(g.button), N = J.slice(0, p + 1), v = [...J.slice(p + 1), ...N];
        for (let K of v.slice())
          if (K.dataset.headlessuiFocusGuard === "true" || (c = g.panel) != null && c.contains(K)) {
            let U = v.indexOf(K);
            U !== -1 && v.splice(U, 1);
          }
        NB(v, is.First, { sorted: !1 });
      }, [Mc.Backwards]: () => {
        var c;
        NB(F, is.Previous) === af.Error && ((c = g.button) == null || c.focus());
      } });
    }
    Z();
  });
  return b.createElement(fAA.Provider, { value: i }, d && r && b.createElement(SY, { id: a, ref: g.beforePanelSentinel, features: Cf.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: G }), jn({ ourProps: f, theirProps: o, slot: y, defaultTag: $me, features: Ape, visible: d, name: "Popover.Panel" }), d && r && b.createElement(SY, { id: C, ref: g.afterPanelSentinel, features: Cf.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: R }));
}
let tpe = "div";
function ipe(A, e) {
  let t = u.useRef(null), i = Tn(t, e), [n, o] = u.useState([]), g = ye((Q) => {
    o((E) => {
      let d = E.indexOf(Q);
      if (d !== -1) {
        let m = E.slice();
        return m.splice(d, 1), m;
      }
      return E;
    });
  }), s = ye((Q) => (o((E) => [...E, Q]), () => g(Q))), I = ye(() => {
    var Q;
    let E = $p(t);
    if (!E)
      return !1;
    let d = E.activeElement;
    return (Q = t.current) != null && Q.contains(d) ? !0 : n.some((m) => {
      var y, f;
      return ((y = E.getElementById(m.buttonId.current)) == null ? void 0 : y.contains(d)) || ((f = E.getElementById(m.panelId.current)) == null ? void 0 : f.contains(d));
    });
  }), r = ye((Q) => {
    for (let E of n)
      E.buttonId.current !== Q && E.close();
  }), a = u.useMemo(() => ({ registerPopover: s, unregisterPopover: g, isFocusWithinPopoverGroup: I, closeOthers: r }), [s, g, I, r]), C = u.useMemo(() => ({}), []), B = A, l = { ref: i };
  return b.createElement(wAA.Provider, { value: a }, jn({ ourProps: l, theirProps: B, slot: C, defaultTag: tpe, name: "Popover.Group" }));
}
let npe = Zn(Tme), ope = Zn(qme), gpe = Zn(Pme), spe = Zn(epe), Ipe = Zn(ipe), Z5 = Object.assign(npe, { Button: ope, Overlay: gpe, Panel: spe, Group: Ipe });
function pFA(A = 0) {
  let [e, t] = u.useState(A), i = u.useCallback((s) => t((I) => I | s), [e]), n = u.useCallback((s) => !!(e & s), [e]), o = u.useCallback((s) => t((I) => I & ~s), [t]), g = u.useCallback((s) => t((I) => I ^ s), [t]);
  return { flags: e, addFlag: i, hasFlag: n, removeFlag: o, toggleFlag: g };
}
let yFA = u.createContext(null);
function bFA() {
  let A = u.useContext(yFA);
  if (A === null) {
    let e = new Error("You used a <Label /> component, but it is not inside a relevant parent.");
    throw Error.captureStackTrace && Error.captureStackTrace(e, bFA), e;
  }
  return A;
}
function wFA() {
  let [A, e] = u.useState([]);
  return [A.length > 0 ? A.join(" ") : void 0, u.useMemo(() => function(t) {
    let i = ye((o) => (e((g) => [...g, o]), () => e((g) => {
      let s = g.slice(), I = s.indexOf(o);
      return I !== -1 && s.splice(I, 1), s;
    }))), n = u.useMemo(() => ({ register: i, slot: t.slot, name: t.name, props: t.props }), [i, t.slot, t.name, t.props]);
    return b.createElement(yFA.Provider, { value: n }, t.children);
  }, [e])];
}
let ape = "label";
function rpe(A, e) {
  let t = Ag(), { id: i = `headlessui-label-${t}`, passive: n = !1, ...o } = A, g = bFA(), s = Tn(e);
  Xn(() => g.register(i), [i, g.register]);
  let I = { ref: s, ...g.props, id: i };
  return n && ("onClick" in I && delete I.onClick, "onClick" in o && delete o.onClick), jn({ ourProps: I, theirProps: o, slot: g.slot || {}, defaultTag: ape, name: g.name || "Label" });
}
let Cpe = Zn(rpe), Bpe = Object.assign(Cpe, {});
var lpe = ((A) => (A[A.RegisterOption = 0] = "RegisterOption", A[A.UnregisterOption = 1] = "UnregisterOption", A))(lpe || {});
let cpe = { 0(A, e) {
  let t = [...A.options, { id: e.id, element: e.element, propsRef: e.propsRef }];
  return { ...A, options: D3(t, (i) => i.element.current) };
}, 1(A, e) {
  let t = A.options.slice(), i = A.options.findIndex((n) => n.id === e.id);
  return i === -1 ? A : (t.splice(i, 1), { ...A, options: t });
} }, DAA = u.createContext(null);
DAA.displayName = "RadioGroupDataContext";
function fFA(A) {
  let e = u.useContext(DAA);
  if (e === null) {
    let t = new Error(`<${A} /> is missing a parent <RadioGroup /> component.`);
    throw Error.captureStackTrace && Error.captureStackTrace(t, fFA), t;
  }
  return e;
}
let GAA = u.createContext(null);
GAA.displayName = "RadioGroupActionsContext";
function DFA(A) {
  let e = u.useContext(GAA);
  if (e === null) {
    let t = new Error(`<${A} /> is missing a parent <RadioGroup /> component.`);
    throw Error.captureStackTrace && Error.captureStackTrace(t, DFA), t;
  }
  return e;
}
function Qpe(A, e) {
  return Ki(e.type, cpe, A, e);
}
let Epe = "div";
function upe(A, e) {
  let t = Ag(), { id: i = `headlessui-radiogroup-${t}`, value: n, defaultValue: o, name: g, onChange: s, by: I = (O, $) => O === $, disabled: r = !1, ...a } = A, C = ye(typeof I == "string" ? (O, $) => {
    let _ = I;
    return (O == null ? void 0 : O[_]) === ($ == null ? void 0 : $[_]);
  } : I), [B, l] = u.useReducer(Qpe, { options: [] }), Q = B.options, [E, d] = wFA(), [m, y] = hFA(), f = u.useRef(null), w = Tn(f, e), [G, R] = lFA(n, s, o), F = u.useMemo(() => Q.find((O) => !O.propsRef.current.disabled), [Q]), Z = u.useMemo(() => Q.some((O) => C(O.propsRef.current.value, G)), [Q, G]), c = ye((O) => {
    var $;
    if (r || C(O, G))
      return !1;
    let _ = ($ = Q.find((tA) => C(tA.propsRef.current.value, O))) == null ? void 0 : $.propsRef.current;
    return _ != null && _.disabled ? !1 : (R == null || R(O), !0);
  });
  sFA({ container: f.current, accept(O) {
    return O.getAttribute("role") === "radio" ? NodeFilter.FILTER_REJECT : O.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
  }, walk(O) {
    O.setAttribute("role", "none");
  } });
  let J = ye((O) => {
    let $ = f.current;
    if (!$)
      return;
    let _ = $p($), tA = Q.filter((nA) => nA.propsRef.current.disabled === !1).map((nA) => nA.element.current);
    switch (O.key) {
      case et.Enter:
        zhe(O.currentTarget);
        break;
      case et.ArrowLeft:
      case et.ArrowUp:
        if (O.preventDefault(), O.stopPropagation(), NB(tA, is.Previous | is.WrapAround) === af.Success) {
          let nA = Q.find((AA) => AA.element.current === (_ == null ? void 0 : _.activeElement));
          nA && c(nA.propsRef.current.value);
        }
        break;
      case et.ArrowRight:
      case et.ArrowDown:
        if (O.preventDefault(), O.stopPropagation(), NB(tA, is.Next | is.WrapAround) === af.Success) {
          let nA = Q.find((AA) => AA.element.current === (_ == null ? void 0 : _.activeElement));
          nA && c(nA.propsRef.current.value);
        }
        break;
      case et.Space:
        {
          O.preventDefault(), O.stopPropagation();
          let nA = Q.find((AA) => AA.element.current === (_ == null ? void 0 : _.activeElement));
          nA && c(nA.propsRef.current.value);
        }
        break;
    }
  }), p = ye((O) => (l({ type: 0, ...O }), () => l({ type: 1, id: O.id }))), N = u.useMemo(() => ({ value: G, firstOption: F, containsCheckedOption: Z, disabled: r, compare: C, ...B }), [G, F, Z, r, C, B]), v = u.useMemo(() => ({ registerOption: p, change: c }), [p, c]), K = { ref: w, id: i, role: "radiogroup", "aria-labelledby": E, "aria-describedby": m, onKeyDown: J }, U = u.useMemo(() => ({ value: G }), [G]), j = u.useRef(null), q = QQ();
  return u.useEffect(() => {
    j.current && o !== void 0 && q.addEventListener(j.current, "reset", () => {
      c(o);
    });
  }, [j, c]), b.createElement(y, { name: "RadioGroup.Description" }, b.createElement(d, { name: "RadioGroup.Label" }, b.createElement(GAA.Provider, { value: v }, b.createElement(DAA.Provider, { value: N }, g != null && G != null && EAA({ [g]: G }).map(([O, $], _) => b.createElement(SY, { features: Cf.Hidden, ref: _ === 0 ? (tA) => {
    var nA;
    j.current = (nA = tA == null ? void 0 : tA.closest("form")) != null ? nA : null;
  } : void 0, ...TH({ key: O, as: "input", type: "radio", checked: $ != null, hidden: !0, readOnly: !0, name: O, value: $ }) })), jn({ ourProps: K, theirProps: a, slot: U, defaultTag: Epe, name: "RadioGroup" })))));
}
var dpe = ((A) => (A[A.Empty = 1] = "Empty", A[A.Active = 2] = "Active", A))(dpe || {});
let hpe = "div";
function mpe(A, e) {
  var t;
  let i = Ag(), { id: n = `headlessui-radiogroup-option-${i}`, value: o, disabled: g = !1, ...s } = A, I = u.useRef(null), r = Tn(I, e), [a, C] = wFA(), [B, l] = hFA(), { addFlag: Q, removeFlag: E, hasFlag: d } = pFA(1), m = Ks({ value: o, disabled: g }), y = fFA("RadioGroup.Option"), f = DFA("RadioGroup.Option");
  Xn(() => f.registerOption({ id: n, element: I, propsRef: m }), [n, f, I, A]);
  let w = ye((N) => {
    var v;
    if (rf(N.currentTarget))
      return N.preventDefault();
    f.change(o) && (Q(2), (v = I.current) == null || v.focus());
  }), G = ye((N) => {
    if (rf(N.currentTarget))
      return N.preventDefault();
    Q(2);
  }), R = ye(() => E(2)), F = ((t = y.firstOption) == null ? void 0 : t.id) === n, Z = y.disabled || g, c = y.compare(y.value, o), J = { ref: r, id: n, role: "radio", "aria-checked": c ? "true" : "false", "aria-labelledby": a, "aria-describedby": B, "aria-disabled": Z ? !0 : void 0, tabIndex: (() => Z ? -1 : c || !y.containsCheckedOption && F ? 0 : -1)(), onClick: Z ? void 0 : w, onFocus: Z ? void 0 : G, onBlur: Z ? void 0 : R }, p = u.useMemo(() => ({ checked: c, disabled: Z, active: d(2) }), [c, Z, d]);
  return b.createElement(l, { name: "RadioGroup.Description" }, b.createElement(C, { name: "RadioGroup.Label" }, jn({ ourProps: J, theirProps: s, slot: p, defaultTag: hpe, name: "RadioGroup.Option" })));
}
let ppe = Zn(upe), ype = Zn(mpe), Cm = Object.assign(ppe, { Option: ype, Label: Bpe, Description: Ame });
function bpe(A) {
  let e = { called: !1 };
  return (...t) => {
    if (!e.called)
      return e.called = !0, A(...t);
  };
}
function W5(A, ...e) {
  A && e.length > 0 && A.classList.add(...e);
}
function K5(A, ...e) {
  A && e.length > 0 && A.classList.remove(...e);
}
function wpe(A, e) {
  let t = dC();
  if (!A)
    return t.dispose;
  let { transitionDuration: i, transitionDelay: n } = getComputedStyle(A), [o, g] = [i, n].map((s) => {
    let [I = 0] = s.split(",").filter(Boolean).map((r) => r.includes("ms") ? parseFloat(r) : parseFloat(r) * 1e3).sort((r, a) => a - r);
    return I;
  });
  if (o + g !== 0) {
    let s = t.addEventListener(A, "transitionend", (I) => {
      I.target === I.currentTarget && (e(), s());
    });
  } else
    e();
  return t.add(() => e()), t.dispose;
}
function fpe(A, e, t, i) {
  let n = t ? "enter" : "leave", o = dC(), g = i !== void 0 ? bpe(i) : () => {
  };
  n === "enter" && (A.removeAttribute("hidden"), A.style.display = "");
  let s = Ki(n, { enter: () => e.enter, leave: () => e.leave }), I = Ki(n, { enter: () => e.enterTo, leave: () => e.leaveTo }), r = Ki(n, { enter: () => e.enterFrom, leave: () => e.leaveFrom });
  return K5(A, ...e.enter, ...e.enterTo, ...e.enterFrom, ...e.leave, ...e.leaveFrom, ...e.leaveTo, ...e.entered), W5(A, ...s, ...r), o.nextFrame(() => {
    K5(A, ...r), W5(A, ...I), wpe(A, () => (K5(A, ...s), W5(A, ...e.entered), g()));
  }), o.dispose;
}
function Dpe({ container: A, direction: e, classes: t, onStart: i, onStop: n }) {
  let o = EFA(), g = QQ(), s = Ks(e);
  Xn(() => {
    let I = dC();
    g.add(I.dispose);
    let r = A.current;
    if (r && s.current !== "idle" && o.current)
      return I.dispose(), i.current(s.current), I.add(fpe(r, t.current, s.current === "enter", () => {
        I.dispose(), n.current(s.current);
      })), I.dispose;
  }, [e]);
}
function wh(A = "") {
  return A.split(" ").filter((e) => e.trim().length > 1);
}
let Y3 = u.createContext(null);
Y3.displayName = "TransitionContext";
var Gpe = ((A) => (A.Visible = "visible", A.Hidden = "hidden", A))(Gpe || {});
function kpe() {
  let A = u.useContext(Y3);
  if (A === null)
    throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
  return A;
}
function Jpe() {
  let A = u.useContext(R3);
  if (A === null)
    throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
  return A;
}
let R3 = u.createContext(null);
R3.displayName = "NestingContext";
function F3(A) {
  return "children" in A ? F3(A.children) : A.current.filter(({ el: e }) => e.current !== null).filter(({ state: e }) => e === "visible").length > 0;
}
function GFA(A, e) {
  let t = Ks(A), i = u.useRef([]), n = EFA(), o = QQ(), g = ye((l, Q = Fc.Hidden) => {
    let E = i.current.findIndex(({ el: d }) => d === l);
    E !== -1 && (Ki(Q, { [Fc.Unmount]() {
      i.current.splice(E, 1);
    }, [Fc.Hidden]() {
      i.current[E].state = "hidden";
    } }), o.microTask(() => {
      var d;
      !F3(i) && n.current && ((d = t.current) == null || d.call(t));
    }));
  }), s = ye((l) => {
    let Q = i.current.find(({ el: E }) => E === l);
    return Q ? Q.state !== "visible" && (Q.state = "visible") : i.current.push({ el: l, state: "visible" }), () => g(l, Fc.Unmount);
  }), I = u.useRef([]), r = u.useRef(Promise.resolve()), a = u.useRef({ enter: [], leave: [], idle: [] }), C = ye((l, Q, E) => {
    I.current.splice(0), e && (e.chains.current[Q] = e.chains.current[Q].filter(([d]) => d !== l)), e == null || e.chains.current[Q].push([l, new Promise((d) => {
      I.current.push(d);
    })]), e == null || e.chains.current[Q].push([l, new Promise((d) => {
      Promise.all(a.current[Q].map(([m, y]) => y)).then(() => d());
    })]), Q === "enter" ? r.current = r.current.then(() => e == null ? void 0 : e.wait.current).then(() => E(Q)) : E(Q);
  }), B = ye((l, Q, E) => {
    Promise.all(a.current[Q].splice(0).map(([d, m]) => m)).then(() => {
      var d;
      (d = I.current.shift()) == null || d();
    }).then(() => E(Q));
  });
  return u.useMemo(() => ({ children: i, register: s, unregister: g, onStart: C, onStop: B, wait: r, chains: a }), [s, g, i, C, B, a, r]);
}
function Npe() {
}
let Ype = ["beforeEnter", "afterEnter", "beforeLeave", "afterLeave"];
function ycA(A) {
  var e;
  let t = {};
  for (let i of Ype)
    t[i] = (e = A[i]) != null ? e : Npe;
  return t;
}
function Rpe(A) {
  let e = u.useRef(ycA(A));
  return u.useEffect(() => {
    e.current = ycA(A);
  }, [A]), e;
}
let Fpe = "div", kFA = nl.RenderStrategy;
function Mpe(A, e) {
  let { beforeEnter: t, afterEnter: i, beforeLeave: n, afterLeave: o, enter: g, enterFrom: s, enterTo: I, entered: r, leave: a, leaveFrom: C, leaveTo: B, ...l } = A, Q = u.useRef(null), E = Tn(Q, e), d = l.unmount ? Fc.Unmount : Fc.Hidden, { show: m, appear: y, initial: f } = kpe(), [w, G] = u.useState(m ? "visible" : "hidden"), R = Jpe(), { register: F, unregister: Z } = R, c = u.useRef(null);
  u.useEffect(() => F(Q), [F, Q]), u.useEffect(() => {
    if (d === Fc.Hidden && Q.current) {
      if (m && w !== "visible") {
        G("visible");
        return;
      }
      return Ki(w, { hidden: () => Z(Q), visible: () => F(Q) });
    }
  }, [w, Q, F, Z, m, d]);
  let J = Ks({ enter: wh(g), enterFrom: wh(s), enterTo: wh(I), entered: wh(r), leave: wh(a), leaveFrom: wh(C), leaveTo: wh(B) }), p = Rpe({ beforeEnter: t, afterEnter: i, beforeLeave: n, afterLeave: o }), N = lAA();
  u.useEffect(() => {
    if (N && w === "visible" && Q.current === null)
      throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
  }, [Q, w, N]);
  let v = f && !y, K = (() => !N || v || c.current === m ? "idle" : m ? "enter" : "leave")(), U = pFA(0), j = ye((tA) => Ki(tA, { enter: () => {
    U.addFlag(Dn.Opening), p.current.beforeEnter();
  }, leave: () => {
    U.addFlag(Dn.Closing), p.current.beforeLeave();
  }, idle: () => {
  } })), q = ye((tA) => Ki(tA, { enter: () => {
    U.removeFlag(Dn.Opening), p.current.afterEnter();
  }, leave: () => {
    U.removeFlag(Dn.Closing), p.current.afterLeave();
  }, idle: () => {
  } })), O = GFA(() => {
    G("hidden"), Z(Q);
  }, R);
  Dpe({ container: Q, classes: J, direction: K, onStart: Ks((tA) => {
    O.onStart(Q, tA, j);
  }), onStop: Ks((tA) => {
    O.onStop(Q, tA, q), tA === "leave" && !F3(O) && (G("hidden"), Z(Q));
  }) }), u.useEffect(() => {
    v && (d === Fc.Hidden ? c.current = null : c.current = m);
  }, [m, v, w]);
  let $ = l, _ = { ref: E };
  return y && m && fu.isServer && ($ = { ...$, className: aFA(l.className, ...J.current.enter, ...J.current.enterFrom) }), b.createElement(R3.Provider, { value: O }, b.createElement(G3, { value: Ki(w, { visible: Dn.Open, hidden: Dn.Closed }) | U.flags }, jn({ ourProps: _, theirProps: $, defaultTag: Fpe, features: kFA, visible: w === "visible", name: "Transition.Child" })));
}
function xpe(A, e) {
  let { show: t, appear: i = !1, unmount: n, ...o } = A, g = u.useRef(null), s = Tn(g, e);
  lAA();
  let I = vD();
  if (t === void 0 && I !== null && (t = (I & Dn.Open) === Dn.Open), ![!0, !1].includes(t))
    throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
  let [r, a] = u.useState(t ? "visible" : "hidden"), C = GFA(() => {
    a("hidden");
  }), [B, l] = u.useState(!0), Q = u.useRef([t]);
  Xn(() => {
    B !== !1 && Q.current[Q.current.length - 1] !== t && (Q.current.push(t), l(!1));
  }, [Q, t]);
  let E = u.useMemo(() => ({ show: t, appear: i, initial: B }), [t, i, B]);
  u.useEffect(() => {
    if (t)
      a("visible");
    else if (!F3(C))
      a("hidden");
    else {
      let m = g.current;
      if (!m)
        return;
      let y = m.getBoundingClientRect();
      y.x === 0 && y.y === 0 && y.width === 0 && y.height === 0 && a("hidden");
    }
  }, [t, C]);
  let d = { unmount: n };
  return b.createElement(R3.Provider, { value: C }, b.createElement(Y3.Provider, { value: E }, jn({ ourProps: { ...d, as: u.Fragment, children: b.createElement(JFA, { ref: s, ...d, ...o }) }, theirProps: {}, defaultTag: u.Fragment, features: kFA, visible: r === "visible", name: "Transition" })));
}
function Lpe(A, e) {
  let t = u.useContext(Y3) !== null, i = vD() !== null;
  return b.createElement(b.Fragment, null, !t && i ? b.createElement(nO, { ref: e, ...A }) : b.createElement(JFA, { ref: e, ...A }));
}
let nO = Zn(xpe), JFA = Zn(Mpe), vpe = Zn(Lpe), M3 = Object.assign(nO, { Child: vpe, Root: nO });
const Hpe = (A) => {
  const { options: e = [], disable: t = !1, selectedKeys: i = [], onSelect: n, className: o = "", required: g } = A, [s, I] = u.useState(e.filter((C) => i.includes(C.key)));
  u.useEffect(() => {
    I(e.filter((C) => i.includes(C.key)));
  }, [e, i]);
  const r = u.useRef(i);
  r.current = i;
  const a = u.useRef(n);
  return a.current = n, u.useEffect(() => {
    var C;
    const B = s.map((l) => l.key);
    (B.length !== r.current.length || B.some((l) => !r.current.includes(l))) && ((C = a.current) == null || C.call(a, B));
  }, [s]), t ? b.createElement(u.Fragment, null, A.children) : b.createElement(
    q7,
    null,
    b.createElement(
      "div",
      { className: "relative w-full flex items-center space-x-2" },
      b.createElement("span", { className: "flex-1 block truncate text-start" }, A.children),
      b.createElement(
        O7,
        { asChild: !0 },
        b.createElement(
          "div",
          { className: "grow-0 shrink-0 flex items-center relative" },
          b.createElement(hYA, { className: "h-4 w-4 text-muted-foreground", "aria-hidden": "true" }),
          s.length > 0 && b.createElement("span", { className: "absolute top-0 right-0 h-4 px-1 translate-x-1/2 -translate-y-1/2 scale-[67%] flex items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-normal pointer-events-none" }, s.length > 10 ? "10+" : s.length)
        )
      )
    ),
    b.createElement(
      h3,
      { className: "mt-1 max-h-60 w-fit overflow-auto rounded-md py-1 px-0 text-base sm:text-sm" },
      b.createElement(
        v5,
        { multiple: !0, value: s, onChange: I },
        b.createElement(v5.Options, { static: !0 }, e.map((C) => b.createElement(v5.Option, { key: C.key, className: "relative cursor-default rounded-md mx-1 select-none py-2 pl-10 pr-4 text-popover-foreground hover:bg-accent hover:text-accent-foreground", value: C }, ({ selected: B }) => b.createElement(
          b.Fragment,
          null,
          b.createElement("span", { className: `block truncate ${B ? "font-medium" : "font-normal"}` }, C.label),
          B && b.createElement(
            "span",
            { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-accent-foreground" },
            b.createElement(dYA, { className: "h-5 w-5", "aria-hidden": "true" })
          )
        ))))
      )
    )
  );
}, kAA = Hpe, Spe = (A) => {
  const { provided: e, dkey: t, fIndex: i } = A, n = xt(), { config: o, allFields: g } = n, s = n.allEncodings[t.id][i], { t: I } = qe("translation", { keyPrefix: "constant.aggregator" }), r = u.useMemo(() => We.AGGREGATOR_LIST.map((B) => ({
    value: B,
    label: I(B)
  })), []), a = u.useMemo(() => g.filter((B) => B.analyticType === "measure" && B.fid !== Wi).map((B) => ({
    key: B.fid,
    label: B.name
  })), [g]), C = s.fid === Zi ? o.folds ?? [] : null;
  return b.createElement(
    Ghe,
    { ref: er(e.innerRef), colType: s.analyticType === "dimension" ? "discrete" : "continuous", className: `${s.aggName === "expr" && !o.defaultAggregated ? "!opacity-50 touch-none" : "touch-none"}`, ...e.draggableProps, ...e.dragHandleProps },
    C && b.createElement(
      kAA,
      { options: a, selectedKeys: C, onSelect: (B) => {
        n.setVisualConfig("folds", B);
      } },
      b.createElement("span", { className: "flex-1 truncate" }, s.name)
    ),
    !C && b.createElement("span", { className: "flex-1 truncate" }, s.name),
    " ",
    s.analyticType === "measure" && s.fid !== Hn && o.defaultAggregated && s.aggName !== "expr" && b.createElement(
      f3,
      { options: r, onSelect: (B) => {
        n.setFieldAggregator(t.id, i, B);
      } },
      b.createElement(
        "span",
        { className: "bg-transparent float-right focus:outline-none focus: dark:focus: flex items-center ml-2" },
        s.aggName || "",
        b.createElement(NR, { className: "w-3" })
      )
    ),
    s.analyticType === "dimension" && s.sort === "ascending" && b.createElement(u7, { className: "float-right w-3", role: "status", "aria-label": "Sorted in ascending order" }),
    s.analyticType === "dimension" && s.sort === "descending" && b.createElement(E7, { className: "float-right w-3", role: "status", "aria-label": "Sorted in descending order" })
  );
}, Zpe = gt(Spe), Wpe = (A) => {
  const { provided: e, dkey: t } = A, i = xt(), { allEncodings: n } = i;
  return b.createElement(whe, { ...e.droppableProps, ref: er(e.innerRef) }, n[t.id].map((o, g) => b.createElement(mD, { key: `encode_${t.id}_${g}_${OI(o)}`, draggableId: `encode_${t.id}_${g}_${OI(o)}`, index: g }, (s, I) => b.createElement(Zpe, { dkey: t, fIndex: g, provided: s }))));
}, Kpe = gt(Wpe), Upe = (A) => {
  const e = xt(), { config: t } = e, { geoms: i, coordSystem: n = "generic" } = t, o = u.useMemo(() => n === "geographic" ? i[0] === "choropleth" ? QJ.filter((g) => g.id === "geoId") : QJ.filter((g) => g.id === "longitude" || g.id === "latitude") : i[0] === "arc" ? QJ.filter((g) => g.id === "radius" || g.id === "theta") : QJ.filter((g) => g.id === "columns" || g.id === "rows"), [i[0], n]);
  return b.createElement("div", null, o.map((g, s) => b.createElement(
    yhe,
    { name: g.id, key: g.id },
    b.createElement(ep, { droppableId: g.id, direction: "horizontal" }, (I, r) => b.createElement(Kpe, { dkey: g, provided: I }))
  )));
}, Vpe = gt(Upe), Xpe = ji.div`
    overflow: visible !important;
    width: calc(100% - 1.875rem);
`, zpe = (A) => {
  const { dkey: e, provided: t, snapshot: i } = A, n = xt(), { allEncodings: o, config: g, allFields: s } = n, I = g.folds ?? [], r = o[e.id][0], { t: a } = qe(), C = u.useMemo(() => We.AGGREGATOR_LIST.map((l) => ({
    value: l,
    label: a(`constant.aggregator.${l}`)
  })), []), B = u.useMemo(() => s.filter((l) => l.analyticType === "measure" && l.fid !== Wi).map((l) => ({
    key: l.fid,
    label: l.name
  })), [s]);
  return b.createElement(
    "div",
    { className: "p-1 select-none relative touch-none", ...t.droppableProps, ref: er(t.innerRef) },
    b.createElement("div", { className: `p-1.5 bg-muted text-muted-foreground border flex item-center justify-center grow ${i.draggingFromThisWith || i.isDraggingOver || !r ? "opacity-100" : "opacity-0"} relative z-0` }, a("actions.drop_field")),
    r && b.createElement(mD, { draggableId: `encode_${e.id}_${OI(r)}`, index: 0 }, (l, Q) => {
      var E;
      return b.createElement(
        "div",
        { ref: er(l.innerRef), ...l.draggableProps, ...l.dragHandleProps, className: "flex items-stretch absolute top-0 left-0 right-0 bottom-0 m-1 touch-none" + ((E = l.draggableProps.style) != null && E.transform ? " z-10" : "") + (r.aggName === "expr" && !g.defaultAggregated ? " !opacity-50" : "") },
        b.createElement(
          "div",
          { onClick: () => {
            n.removeField(e.id, 0);
          }, className: "grow-0 shrink-0 px-1.5 flex items-center justify-center bg-destructive text-destructive-foreground cursor-pointer" },
          b.createElement(A3, { className: "w-4" })
        ),
        b.createElement(
          Xpe,
          { className: "flex-1 flex items-center border border-l-0 px-2 space-x-2 truncate" },
          r.fid === Zi && b.createElement(
            kAA,
            { options: B, selectedKeys: I, onSelect: (d) => {
              n.setVisualConfig("folds", d);
            }, className: "flex-1" },
            b.createElement("span", { className: "flex-1 truncate", title: r.name }, r.name)
          ),
          r.fid !== Zi && b.createElement("span", { className: "flex-1 truncate" }, r.name),
          " ",
          r.analyticType === "measure" && r.fid !== Hn && g.defaultAggregated && r.aggName !== "expr" && b.createElement(
            f3,
            { options: C, onSelect: (d) => {
              n.setFieldAggregator(e.id, 0, d);
            } },
            b.createElement(
              "span",
              { className: "bg-transparent text-muted-foreground float-right focus:outline-none focus: dark:focus: flex items-center ml-2" },
              r.aggName || "",
              b.createElement(NR, { className: "w-3" })
            )
          )
        )
      );
    })
  );
}, Tpe = gt(zpe), _pe = ji.div`
    overflow: visible !important;
    width: calc(100% - 1.875rem);
`, qpe = (A) => {
  const { dkey: e, provided: t, snapshot: i } = A, n = xt(), { currentEncodings: o, config: g, allFields: s } = n, I = g.folds ?? [], r = o[e.id], { t: a } = qe(), C = u.useMemo(() => We.AGGREGATOR_LIST.map((l) => ({
    value: l,
    label: a(`constant.aggregator.${l}`)
  })), []), B = u.useMemo(() => s.filter((l) => l.analyticType === "measure" && l.fid !== Wi).map((l) => ({
    key: l.fid,
    label: l.name
  })), [s]);
  return b.createElement(
    "div",
    { className: "relative select-none flex flex-col py-0.5 px-1 touch-none", ...t.droppableProps, ref: er(t.innerRef) },
    r.map((l, Q) => b.createElement(mD, { key: `encode_${e.id}_${Q}_${OI(l)}`, draggableId: `encode_${e.id}_${Q}_${OI(l)}`, index: Q }, (E, d) => {
      var m;
      return b.createElement(
        "div",
        { ref: er(E.innerRef), ...E.draggableProps, ...E.dragHandleProps, className: "flex items-stretch h-[30px] my-0.5 relative touch-none" + ((m = E.draggableProps.style) != null && m.transform ? " z-10" : "") + (l.aggName === "expr" && !g.defaultAggregated ? " !opacity-50" : "") },
        b.createElement(
          "div",
          { onClick: () => {
            n.removeField(e.id, 0);
          }, className: "grow-0 shrink-0 px-1.5 flex items-center justify-center bg-destructive text-destructive-foreground cursor-pointer" },
          b.createElement(A3, { className: "w-4" })
        ),
        b.createElement(
          _pe,
          { className: "flex-1 flex items-center border border-l-0 px-2 space-x-2 truncate" },
          l.fid === Zi && b.createElement(
            kAA,
            { options: B, selectedKeys: I, onSelect: (y) => {
              n.setVisualConfig("folds", y);
            }, className: "flex-1" },
            b.createElement("span", { className: "flex-1 truncate", title: l.name }, l.name)
          ),
          l.fid !== Zi && b.createElement("span", { className: "flex-1 truncate" }, l.name),
          " ",
          l.analyticType === "measure" && l.fid !== Hn && g.defaultAggregated && l.aggName !== "expr" && b.createElement(
            f3,
            { options: C, onSelect: (y) => {
              n.setFieldAggregator(e.id, 0, y);
            } },
            b.createElement(
              "span",
              { className: "bg-transparent text-muted-foreground float-right focus:outline-none focus: dark:focus: flex items-center ml-2" },
              l.aggName || "",
              b.createElement(NR, { className: "w-3" })
            )
          )
        )
      );
    })),
    r.length !== 0 && t.placeholder,
    r.length === 0 && b.createElement("div", { className: "h-[34px] w-full" }),
    b.createElement("div", { className: `p-1.5 m-1 bg-muted text-muted-foreground pointer-events-none border flex item-center justify-center grow ${i.draggingFromThisWith && r.length === 1 || r.length === 0 ? "opacity-100" : "opacity-0"} absolute inset-0 z-0` }, a("actions.drop_field"))
  );
}, Ope = gt(qpe), lk = QJ.filter((A) => ["color", "opacity", "size", "shape", "details", "text"].includes(A.id)), jpe = (A) => {
  const e = xt(), { config: t } = e, { geoms: i } = t, n = u.useMemo(() => {
    switch (i[0]) {
      case "bar":
      case "tick":
      case "arc":
      case "line":
      case "area":
      case "boxplot":
        return lk.filter((o) => o.id !== "shape");
      case "text":
        return lk.filter((o) => o.id === "text" || o.id === "color" || o.id === "size" || o.id === "opacity");
      case "table":
        return [];
      case "poi":
        return lk.filter((o) => o.id === "color" || o.id === "opacity" || o.id === "size" || o.id === "details");
      case "choropleth":
        return lk.filter((o) => o.id === "color" || o.id === "opacity" || o.id === "text" || o.id === "details");
      default:
        return lk.filter((o) => o.id !== "text");
    }
  }, [i[0]]);
  return b.createElement("div", null, n.map((o, g, { length: s }) => We.CHANNEL_LIMIT[o.id] === 1 ? b.createElement(
    dcA,
    { name: o.id, key: o.id, style: { position: "relative" } },
    b.createElement(ep, { droppableId: o.id, direction: "horizontal" }, (I, r) => b.createElement(Tpe, { dkey: o, provided: I, snapshot: r }))
  ) : b.createElement(
    dcA,
    { name: o.id, key: o.id, style: { position: "relative" } },
    b.createElement(ep, { droppableId: o.id, direction: "vertical" }, (I, r) => b.createElement(Ope, { dkey: o, provided: I, snapshot: r }))
  )));
}, Ppe = gt(jpe), $pe = (A) => {
  const { dataType: e, analyticType: t } = A, i = `w-3 inline-block ${t === "dimension" ? "text-dimension" : "text-measure"}`;
  switch (e) {
    case "quantitative":
    case "ordinal":
      return b.createElement(aae, { className: i });
    case "temporal":
      return b.createElement(nIe, { className: i });
    default:
      return b.createElement(UIe, { className: i });
  }
}, Bf = $pe, A0e = (A) => {
  const { ["aria-expanded"]: e, onPress: t, disabled: i, className: n = "", ...o } = A, g = u.useCallback((I) => {
    I.preventDefault(), I.stopPropagation(), t == null || t();
  }, [t]), s = u.useCallback((I) => {
    switch (I.key) {
      case "Enter":
      case "Space": {
        t == null || t();
        break;
      }
      default:
        return;
    }
    I.preventDefault(), I.stopPropagation();
  }, [t]);
  return u.useMemo(() => ({
    ...o,
    className: $a(n, i ? "cursor-default text-opacity-50" : "cursor-pointer rounded-full focus:outline-none focus:ring-1 focus:ring-ring hover:bg-accent hover:text-accent-foreground", "text-muted-foreground"),
    role: "button",
    "aria-haspopup": "menu",
    "aria-expanded": e,
    "aria-disabled": i,
    tabIndex: i ? void 0 : 0,
    onClick: g,
    onKeyDown: s
  }), [g, s, e, i, n, o]);
};
function e0e(...A) {
  return A.filter(Boolean).join(" ");
}
const t0e = ji.div`
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    & > div {
        /* row */
        display: contents;
        > * {
            background: inherit;
            cursor: pointer;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            overflow: hidden;
            padding-block: 0.2rem;
            padding-inline: 0.2rem;
            &:first-child {
                padding-left: 0.4rem;
            }
        }
        > *:first-child {
            border-top-left-radius: calc(var(--radius) - 4px);
            border-bottom-left-radius: calc(var(--radius) - 4px);
        }
        > *:last-child {
            border-top-right-radius: calc(var(--radius) - 4px);
            border-bottom-right-radius: calc(var(--radius) - 4px);
        }
        &[aria-disabled='true'] > * {
            opacity: 0.5;
            cursor: default;
        }
    }
`, NFA = u.createContext(null), i0e = u.memo(function({ item: A, path: e }) {
  const { icon: t, label: i, disabled: n = !1, children: o = [], onPress: g } = A, [s, I] = u.useState(!1), [r, a] = u.useState(!1), C = u.useContext(NFA), B = o.length > 0 && C.path.length > 0 && e.length <= C.path.length && e.every((E, d) => E === C.path[d]), l = !n && (s || r || B), Q = u.useMemo(() => {
    let E = C.path.findIndex((d, m) => d !== e[m]);
    return E !== -1 ? C.path.slice(0, E) : C.path;
  }, [C.path, e]);
  return u.useEffect(() => {
    o.length === 0 && (s || r) && Q.join(".") !== C.path.join(".") && C.setPath(Q);
  }, [o.length, s, r, C, Q]), b.createElement(
    "div",
    { tabIndex: n ? void 0 : 0, role: "button", "aria-haspopup": o.length ? "menu" : void 0, "aria-disabled": n, className: e0e(l ? "bg-accent text-accent-foreground" : "text-foreground", n ? "text-muted-foreground" : "cursor-pointer", "transition-colors text-xs"), onClick: (E) => {
      if (n || o.length) {
        E.stopPropagation(), E.preventDefault();
        return;
      }
      n || (g == null || g(), C.onDismiss());
    }, onFocus: () => {
      n || a(!0), o.length && !B && C.setPath(e);
    }, onBlur: () => {
      a(!1);
    }, onMouseEnter: () => {
      I(!0), o.length && !B && !n && C.setPath(e);
    }, onMouseLeave: () => {
      I(!1);
    }, onKeyDown: (E) => {
      n || o.length || (E.key === "Enter" || E.key === "Space") && (g == null || g(), C.onDismiss());
    } },
    b.createElement("div", { "aria-hidden": "true" }, t),
    b.createElement(
      "div",
      null,
      b.createElement("span", { className: "truncate self-start" }, i)
    ),
    b.createElement("div", { "aria-hidden": "true", className: "relative" }, o.length > 0 && b.createElement(
      b.Fragment,
      null,
      b.createElement(pIe, { className: "w-4 h-4", "aria-hidden": "true" }),
      b.createElement(
        "div",
        { className: "absolute top-0 right-0" },
        b.createElement(
          M3,
          { appear: !0, as: u.Fragment, show: B, enter: "transition ease-out duration-100", enterFrom: "transform opacity-0 scale-95", enterTo: "transform opacity-100 scale-100", leave: "transition ease-in duration-75", leaveFrom: "transform opacity-100 scale-100", leaveTo: "transform opacity-0 scale-95" },
          b.createElement(
            "div",
            { className: "fixed rounded-md -translate-x-1 z-50 min-w-[8rem] max-w-[16rem] bg-popover shadow-lg border focus:outline-none" },
            b.createElement(YFA, { items: o, path: e })
          )
        )
      )
    ))
  );
}), YFA = u.memo(function({ items: A, path: e, title: t }) {
  return b.createElement(
    "div",
    { className: "p-1 -mx-px" },
    t && b.createElement("header", { className: "px-3 py-1 mb-1.5 text-xs font-medium truncate" }, t),
    t && b.createElement(BAA, { orientation: "horizontal", className: "-mx-1 my-1" }),
    b.createElement(t0e, null, A.map((i, n) => b.createElement(i0e, { key: n, item: i, path: [...e, n] })))
  );
}), n0e = u.memo(function({ onDismiss: A, children: e }) {
  const [t, i] = u.useState([]);
  return b.createElement(NFA.Provider, { value: { path: t, setPath: i, onDismiss: A } }, e);
}), o0e = u.memo(function({ onDismiss: A, items: e, title: t }) {
  return b.createElement(
    n0e,
    { onDismiss: A },
    b.createElement(YFA, { title: t, items: e, path: [] })
  );
}), RFA = u.createContext(null), g0e = (A) => {
  const { menu: e = [], disabled: t = !1, enableContextMenu: i = !1, title: n, ...o } = A, [g, s] = u.useState([0, 0]), I = u.useRef(null), r = t || e.length === 0, a = u.useContext(w3);
  return b.createElement(S5, { as: u.Fragment }, ({ open: C, close: B }) => b.createElement(
    RFA.Provider,
    { value: {
      disabled: t,
      expanded: C,
      moveTo(l, Q) {
        var E;
        const d = (E = a.current) == null ? void 0 : E.getBoundingClientRect(), { x: m, y } = d ?? { x: 0, y: 0 };
        s([l - m, Q - y]);
      },
      open() {
        var l;
        C || (l = I.current) == null || l.click();
      },
      close: B,
      _items: e
    } },
    b.createElement(S5.Button, { ref: I, className: "sr-only", "aria-hidden": !0 }),
    b.createElement("div", { onContextMenu: (l) => {
      var Q, E;
      if (r)
        return;
      l.preventDefault(), l.stopPropagation();
      const d = (Q = a.current) == null ? void 0 : Q.getBoundingClientRect(), { x: m, y } = d ?? { x: 0, y: 0 };
      s([l.clientX - m, l.clientY - y]), C || (E = I.current) == null || E.click();
    }, ...o }, A.children),
    C && b.createElement("div", { className: "fixed inset-0 z-50 bg-transparent", "aria-hidden": "true" }),
    !r && b.createElement(
      M3,
      { as: u.Fragment, enter: "transition ease-out duration-100", enterFrom: "transform opacity-0 scale-95", enterTo: "transform opacity-100 scale-100", leave: "transition ease-in duration-75", leaveFrom: "transform opacity-100 scale-100", leaveTo: "transform opacity-0 scale-95" },
      b.createElement(
        S5.Items,
        { className: "fixed rounded-md z-50 mt-0.5 min-w-[8rem] max-w-[16rem] origin-top-left bg-popover text-popover-foreground shadow-lg border focus:outline-none", style: {
          left: g[0],
          top: g[1]
        } },
        b.createElement(o0e, { title: n, items: e, onDismiss: B })
      )
    )
  ));
}, s0e = function(A) {
  const { as: e = "button", onPress: t, children: i, ...n } = A, o = e, g = u.useContext(RFA), s = u.useRef(null), I = u.useCallback(() => {
    if (g != null && g.disabled)
      return;
    const a = s.current;
    if (a) {
      const C = a.getBoundingClientRect();
      g == null || g.moveTo(C.x + C.width, C.y);
    }
    if (t)
      return t(g ?? void 0);
    g != null && g.expanded ? g.close() : g == null || g.open();
  }, [g, t]), r = A0e({
    ...n,
    "aria-expanded": (g == null ? void 0 : g.expanded) ?? !1,
    onPress: I
  });
  return g != null && g.disabled || !(g != null && g._items.length) ? b.createElement("div", { "aria-hidden": !0 }) : (
    // @ts-expect-error Expression produces a union type that is too complex to represent
    b.createElement(o, { ...r, ref: s }, i)
  );
}, sw = Object.assign(g0e, {
  Button: u.memo(s0e)
}), _H = ji.div`
    transform: ${(A) => !A.isDragging && "translate(0px, 0px) !important"};
    user-select: none;
    align-items: center;
    overflow: hidden;
    > *:not(span) {
        flex: 0 0 unset;
    }
    > span {
        flex: 1;
        display: inline-block;
        padding-inline: 0.1em;
        /* truncate */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    :has([role="button"]:hover) {
        background-color: unset;
    }
`;
function FFA(A, e) {
  for (var t = -1, i = A == null ? 0 : A.length, n = Array(i); ++t < i; )
    n[t] = e(A[t], t, A);
  return n;
}
var I0e = Array.isArray;
const $I = I0e;
var a0e = 1 / 0, bcA = Zu ? Zu.prototype : void 0, wcA = bcA ? bcA.toString : void 0;
function MFA(A) {
  if (typeof A == "string")
    return A;
  if ($I(A))
    return FFA(A, MFA) + "";
  if (e3(A))
    return wcA ? wcA.call(A) : "";
  var e = A + "";
  return e == "0" && 1 / A == -a0e ? "-0" : e;
}
var fcA = 1 / 0, r0e = 17976931348623157e292;
function U5(A) {
  if (!A)
    return A === 0 ? A : 0;
  if (A = Fq(A), A === fcA || A === -fcA) {
    var e = A < 0 ? -1 : 1;
    return e * r0e;
  }
  return A === A ? A : 0;
}
function x3(A) {
  return A;
}
var C0e = "[object AsyncFunction]", B0e = "[object Function]", l0e = "[object GeneratorFunction]", c0e = "[object Proxy]";
function JAA(A) {
  if (!ja(A))
    return !1;
  var e = Op(A);
  return e == B0e || e == l0e || e == C0e || e == c0e;
}
var Q0e = GC["__core-js_shared__"];
const V5 = Q0e;
var DcA = function() {
  var A = /[^.]+$/.exec(V5 && V5.keys && V5.keys.IE_PROTO || "");
  return A ? "Symbol(src)_1." + A : "";
}();
function E0e(A) {
  return !!DcA && DcA in A;
}
var u0e = Function.prototype, d0e = u0e.toString;
function A0(A) {
  if (A != null) {
    try {
      return d0e.call(A);
    } catch {
    }
    try {
      return A + "";
    } catch {
    }
  }
  return "";
}
var h0e = /[\\^$.*+?()[\]{}|]/g, m0e = /^\[object .+?Constructor\]$/, p0e = Function.prototype, y0e = Object.prototype, b0e = p0e.toString, w0e = y0e.hasOwnProperty, f0e = RegExp(
  "^" + b0e.call(w0e).replace(h0e, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function D0e(A) {
  if (!ja(A) || E0e(A))
    return !1;
  var e = JAA(A) ? f0e : m0e;
  return e.test(A0(A));
}
function G0e(A, e) {
  return A == null ? void 0 : A[e];
}
function e0(A, e) {
  var t = G0e(A, e);
  return D0e(t) ? t : void 0;
}
var k0e = e0(GC, "WeakMap");
const oO = k0e;
var GcA = Object.create, J0e = function() {
  function A() {
  }
  return function(e) {
    if (!ja(e))
      return {};
    if (GcA)
      return GcA(e);
    A.prototype = e;
    var t = new A();
    return A.prototype = void 0, t;
  };
}();
const N0e = J0e;
function Y0e(A, e, t) {
  switch (t.length) {
    case 0:
      return A.call(e);
    case 1:
      return A.call(e, t[0]);
    case 2:
      return A.call(e, t[0], t[1]);
    case 3:
      return A.call(e, t[0], t[1], t[2]);
  }
  return A.apply(e, t);
}
function R0e(A, e) {
  var t = -1, i = A.length;
  for (e || (e = Array(i)); ++t < i; )
    e[t] = A[t];
  return e;
}
var F0e = 800, M0e = 16, x0e = Date.now;
function L0e(A) {
  var e = 0, t = 0;
  return function() {
    var i = x0e(), n = M0e - (i - t);
    if (t = i, n > 0) {
      if (++e >= F0e)
        return arguments[0];
    } else
      e = 0;
    return A.apply(void 0, arguments);
  };
}
function v0e(A) {
  return function() {
    return A;
  };
}
var H0e = function() {
  try {
    var A = e0(Object, "defineProperty");
    return A({}, "", {}), A;
  } catch {
  }
}();
const qH = H0e;
var S0e = qH ? function(A, e) {
  return qH(A, "toString", {
    configurable: !0,
    enumerable: !1,
    value: v0e(e),
    writable: !0
  });
} : x3;
const Z0e = S0e;
var W0e = L0e(Z0e);
const K0e = W0e;
function U0e(A, e) {
  for (var t = -1, i = A == null ? 0 : A.length; ++t < i && e(A[t], t, A) !== !1; )
    ;
  return A;
}
var V0e = 9007199254740991, X0e = /^(?:0|[1-9]\d*)$/;
function NAA(A, e) {
  var t = typeof A;
  return e = e ?? V0e, !!e && (t == "number" || t != "symbol" && X0e.test(A)) && A > -1 && A % 1 == 0 && A < e;
}
function YAA(A, e, t) {
  e == "__proto__" && qH ? qH(A, e, {
    configurable: !0,
    enumerable: !0,
    value: t,
    writable: !0
  }) : A[e] = t;
}
function AF(A, e) {
  return A === e || A !== A && e !== e;
}
var z0e = Object.prototype, T0e = z0e.hasOwnProperty;
function _0e(A, e, t) {
  var i = A[e];
  (!(T0e.call(A, e) && AF(i, t)) || t === void 0 && !(e in A)) && YAA(A, e, t);
}
function q0e(A, e, t, i) {
  var n = !t;
  t || (t = {});
  for (var o = -1, g = e.length; ++o < g; ) {
    var s = e[o], I = i ? i(t[s], A[s], s, t, A) : void 0;
    I === void 0 && (I = A[s]), n ? YAA(t, s, I) : _0e(t, s, I);
  }
  return t;
}
var kcA = Math.max;
function O0e(A, e, t) {
  return e = kcA(e === void 0 ? A.length - 1 : e, 0), function() {
    for (var i = arguments, n = -1, o = kcA(i.length - e, 0), g = Array(o); ++n < o; )
      g[n] = i[e + n];
    n = -1;
    for (var s = Array(e + 1); ++n < e; )
      s[n] = i[n];
    return s[e] = t(g), Y0e(A, this, s);
  };
}
function j0e(A, e) {
  return K0e(O0e(A, e, x3), A + "");
}
var P0e = 9007199254740991;
function RAA(A) {
  return typeof A == "number" && A > -1 && A % 1 == 0 && A <= P0e;
}
function HD(A) {
  return A != null && RAA(A.length) && !JAA(A);
}
function xFA(A, e, t) {
  if (!ja(t))
    return !1;
  var i = typeof e;
  return (i == "number" ? HD(t) && NAA(e, t.length) : i == "string" && e in t) ? AF(t[e], A) : !1;
}
function $0e(A) {
  return j0e(function(e, t) {
    var i = -1, n = t.length, o = n > 1 ? t[n - 1] : void 0, g = n > 2 ? t[2] : void 0;
    for (o = A.length > 3 && typeof o == "function" ? (n--, o) : void 0, g && xFA(t[0], t[1], g) && (o = n < 3 ? void 0 : o, n = 1), e = Object(e); ++i < n; ) {
      var s = t[i];
      s && A(e, s, i, o);
    }
    return e;
  });
}
var Aye = Object.prototype;
function FAA(A) {
  var e = A && A.constructor, t = typeof e == "function" && e.prototype || Aye;
  return A === t;
}
function eye(A, e) {
  for (var t = -1, i = Array(A); ++t < A; )
    i[t] = e(t);
  return i;
}
var tye = "[object Arguments]";
function JcA(A) {
  return Wu(A) && Op(A) == tye;
}
var LFA = Object.prototype, iye = LFA.hasOwnProperty, nye = LFA.propertyIsEnumerable, oye = JcA(function() {
  return arguments;
}()) ? JcA : function(A) {
  return Wu(A) && iye.call(A, "callee") && !nye.call(A, "callee");
};
const OH = oye;
function gye() {
  return !1;
}
var vFA = typeof exports == "object" && exports && !exports.nodeType && exports, NcA = vFA && typeof module == "object" && module && !module.nodeType && module, sye = NcA && NcA.exports === vFA, YcA = sye ? GC.Buffer : void 0, Iye = YcA ? YcA.isBuffer : void 0, aye = Iye || gye;
const jH = aye;
var rye = "[object Arguments]", Cye = "[object Array]", Bye = "[object Boolean]", lye = "[object Date]", cye = "[object Error]", Qye = "[object Function]", Eye = "[object Map]", uye = "[object Number]", dye = "[object Object]", hye = "[object RegExp]", mye = "[object Set]", pye = "[object String]", yye = "[object WeakMap]", bye = "[object ArrayBuffer]", wye = "[object DataView]", fye = "[object Float32Array]", Dye = "[object Float64Array]", Gye = "[object Int8Array]", kye = "[object Int16Array]", Jye = "[object Int32Array]", Nye = "[object Uint8Array]", Yye = "[object Uint8ClampedArray]", Rye = "[object Uint16Array]", Fye = "[object Uint32Array]", tn = {};
tn[fye] = tn[Dye] = tn[Gye] = tn[kye] = tn[Jye] = tn[Nye] = tn[Yye] = tn[Rye] = tn[Fye] = !0;
tn[rye] = tn[Cye] = tn[bye] = tn[Bye] = tn[wye] = tn[lye] = tn[cye] = tn[Qye] = tn[Eye] = tn[uye] = tn[dye] = tn[hye] = tn[mye] = tn[pye] = tn[yye] = !1;
function Mye(A) {
  return Wu(A) && RAA(A.length) && !!tn[Op(A)];
}
function xye(A) {
  return function(e) {
    return A(e);
  };
}
var HFA = typeof exports == "object" && exports && !exports.nodeType && exports, hN = HFA && typeof module == "object" && module && !module.nodeType && module, Lye = hN && hN.exports === HFA, X5 = Lye && bYA.process, vye = function() {
  try {
    var A = hN && hN.require && hN.require("util").types;
    return A || X5 && X5.binding && X5.binding("util");
  } catch {
  }
}();
const RcA = vye;
var FcA = RcA && RcA.isTypedArray, Hye = FcA ? xye(FcA) : Mye;
const MAA = Hye;
var Sye = Object.prototype, Zye = Sye.hasOwnProperty;
function SFA(A, e) {
  var t = $I(A), i = !t && OH(A), n = !t && !i && jH(A), o = !t && !i && !n && MAA(A), g = t || i || n || o, s = g ? eye(A.length, String) : [], I = s.length;
  for (var r in A)
    (e || Zye.call(A, r)) && !(g && // Safari 9 has enumerable `arguments.length` in strict mode.
    (r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    n && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    o && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
    NAA(r, I))) && s.push(r);
  return s;
}
function ZFA(A, e) {
  return function(t) {
    return A(e(t));
  };
}
var Wye = ZFA(Object.keys, Object);
const Kye = Wye;
var Uye = Object.prototype, Vye = Uye.hasOwnProperty;
function Xye(A) {
  if (!FAA(A))
    return Kye(A);
  var e = [];
  for (var t in Object(A))
    Vye.call(A, t) && t != "constructor" && e.push(t);
  return e;
}
function xAA(A) {
  return HD(A) ? SFA(A) : Xye(A);
}
function zye(A) {
  var e = [];
  if (A != null)
    for (var t in Object(A))
      e.push(t);
  return e;
}
var Tye = Object.prototype, _ye = Tye.hasOwnProperty;
function qye(A) {
  if (!ja(A))
    return zye(A);
  var e = FAA(A), t = [];
  for (var i in A)
    i == "constructor" && (e || !_ye.call(A, i)) || t.push(i);
  return t;
}
function WFA(A) {
  return HD(A) ? SFA(A, !0) : qye(A);
}
var Oye = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, jye = /^\w*$/;
function LAA(A, e) {
  if ($I(A))
    return !1;
  var t = typeof A;
  return t == "number" || t == "symbol" || t == "boolean" || A == null || e3(A) ? !0 : jye.test(A) || !Oye.test(A) || e != null && A in Object(e);
}
var Pye = e0(Object, "create");
const ZY = Pye;
function $ye() {
  this.__data__ = ZY ? ZY(null) : {}, this.size = 0;
}
function Abe(A) {
  var e = this.has(A) && delete this.__data__[A];
  return this.size -= e ? 1 : 0, e;
}
var ebe = "__lodash_hash_undefined__", tbe = Object.prototype, ibe = tbe.hasOwnProperty;
function nbe(A) {
  var e = this.__data__;
  if (ZY) {
    var t = e[A];
    return t === ebe ? void 0 : t;
  }
  return ibe.call(e, A) ? e[A] : void 0;
}
var obe = Object.prototype, gbe = obe.hasOwnProperty;
function sbe(A) {
  var e = this.__data__;
  return ZY ? e[A] !== void 0 : gbe.call(e, A);
}
var Ibe = "__lodash_hash_undefined__";
function abe(A, e) {
  var t = this.__data__;
  return this.size += this.has(A) ? 0 : 1, t[A] = ZY && e === void 0 ? Ibe : e, this;
}
function Ip(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.clear(); ++e < t; ) {
    var i = A[e];
    this.set(i[0], i[1]);
  }
}
Ip.prototype.clear = $ye;
Ip.prototype.delete = Abe;
Ip.prototype.get = nbe;
Ip.prototype.has = sbe;
Ip.prototype.set = abe;
function rbe() {
  this.__data__ = [], this.size = 0;
}
function L3(A, e) {
  for (var t = A.length; t--; )
    if (AF(A[t][0], e))
      return t;
  return -1;
}
var Cbe = Array.prototype, Bbe = Cbe.splice;
function lbe(A) {
  var e = this.__data__, t = L3(e, A);
  if (t < 0)
    return !1;
  var i = e.length - 1;
  return t == i ? e.pop() : Bbe.call(e, t, 1), --this.size, !0;
}
function cbe(A) {
  var e = this.__data__, t = L3(e, A);
  return t < 0 ? void 0 : e[t][1];
}
function Qbe(A) {
  return L3(this.__data__, A) > -1;
}
function Ebe(A, e) {
  var t = this.__data__, i = L3(t, A);
  return i < 0 ? (++this.size, t.push([A, e])) : t[i][1] = e, this;
}
function MQ(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.clear(); ++e < t; ) {
    var i = A[e];
    this.set(i[0], i[1]);
  }
}
MQ.prototype.clear = rbe;
MQ.prototype.delete = lbe;
MQ.prototype.get = cbe;
MQ.prototype.has = Qbe;
MQ.prototype.set = Ebe;
var ube = e0(GC, "Map");
const WY = ube;
function dbe() {
  this.size = 0, this.__data__ = {
    hash: new Ip(),
    map: new (WY || MQ)(),
    string: new Ip()
  };
}
function hbe(A) {
  var e = typeof A;
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? A !== "__proto__" : A === null;
}
function v3(A, e) {
  var t = A.__data__;
  return hbe(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
}
function mbe(A) {
  var e = v3(this, A).delete(A);
  return this.size -= e ? 1 : 0, e;
}
function pbe(A) {
  return v3(this, A).get(A);
}
function ybe(A) {
  return v3(this, A).has(A);
}
function bbe(A, e) {
  var t = v3(this, A), i = t.size;
  return t.set(A, e), this.size += t.size == i ? 0 : 1, this;
}
function xQ(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.clear(); ++e < t; ) {
    var i = A[e];
    this.set(i[0], i[1]);
  }
}
xQ.prototype.clear = dbe;
xQ.prototype.delete = mbe;
xQ.prototype.get = pbe;
xQ.prototype.has = ybe;
xQ.prototype.set = bbe;
var wbe = "Expected a function";
function vAA(A, e) {
  if (typeof A != "function" || e != null && typeof e != "function")
    throw new TypeError(wbe);
  var t = function() {
    var i = arguments, n = e ? e.apply(this, i) : i[0], o = t.cache;
    if (o.has(n))
      return o.get(n);
    var g = A.apply(this, i);
    return t.cache = o.set(n, g) || o, g;
  };
  return t.cache = new (vAA.Cache || xQ)(), t;
}
vAA.Cache = xQ;
var fbe = 500;
function Dbe(A) {
  var e = vAA(A, function(i) {
    return t.size === fbe && t.clear(), i;
  }), t = e.cache;
  return e;
}
var Gbe = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, kbe = /\\(\\)?/g, Jbe = Dbe(function(A) {
  var e = [];
  return A.charCodeAt(0) === 46 && e.push(""), A.replace(Gbe, function(t, i, n, o) {
    e.push(n ? o.replace(kbe, "$1") : i || t);
  }), e;
});
const Nbe = Jbe;
function Ybe(A) {
  return A == null ? "" : MFA(A);
}
function KFA(A, e) {
  return $I(A) ? A : LAA(A, e) ? [A] : Nbe(Ybe(A));
}
var Rbe = 1 / 0;
function H3(A) {
  if (typeof A == "string" || e3(A))
    return A;
  var e = A + "";
  return e == "0" && 1 / A == -Rbe ? "-0" : e;
}
function UFA(A, e) {
  e = KFA(e, A);
  for (var t = 0, i = e.length; A != null && t < i; )
    A = A[H3(e[t++])];
  return t && t == i ? A : void 0;
}
function Fbe(A, e, t) {
  var i = A == null ? void 0 : UFA(A, e);
  return i === void 0 ? t : i;
}
function Mbe(A, e) {
  for (var t = -1, i = e.length, n = A.length; ++t < i; )
    A[n + t] = e[t];
  return A;
}
var xbe = ZFA(Object.getPrototypeOf, Object);
const VFA = xbe;
var Lbe = "[object Object]", vbe = Function.prototype, Hbe = Object.prototype, XFA = vbe.toString, Sbe = Hbe.hasOwnProperty, Zbe = XFA.call(Object);
function Wbe(A) {
  if (!Wu(A) || Op(A) != Lbe)
    return !1;
  var e = VFA(A);
  if (e === null)
    return !0;
  var t = Sbe.call(e, "constructor") && e.constructor;
  return typeof t == "function" && t instanceof t && XFA.call(t) == Zbe;
}
function Kbe() {
  this.__data__ = new MQ(), this.size = 0;
}
function Ube(A) {
  var e = this.__data__, t = e.delete(A);
  return this.size = e.size, t;
}
function Vbe(A) {
  return this.__data__.get(A);
}
function Xbe(A) {
  return this.__data__.has(A);
}
var zbe = 200;
function Tbe(A, e) {
  var t = this.__data__;
  if (t instanceof MQ) {
    var i = t.__data__;
    if (!WY || i.length < zbe - 1)
      return i.push([A, e]), this.size = ++t.size, this;
    t = this.__data__ = new xQ(i);
  }
  return t.set(A, e), this.size = t.size, this;
}
function zB(A) {
  var e = this.__data__ = new MQ(A);
  this.size = e.size;
}
zB.prototype.clear = Kbe;
zB.prototype.delete = Ube;
zB.prototype.get = Vbe;
zB.prototype.has = Xbe;
zB.prototype.set = Tbe;
var zFA = typeof exports == "object" && exports && !exports.nodeType && exports, McA = zFA && typeof module == "object" && module && !module.nodeType && module, _be = McA && McA.exports === zFA, xcA = _be ? GC.Buffer : void 0, LcA = xcA ? xcA.allocUnsafe : void 0;
function qbe(A, e) {
  if (e)
    return A.slice();
  var t = A.length, i = LcA ? LcA(t) : new A.constructor(t);
  return A.copy(i), i;
}
function Obe(A, e) {
  for (var t = -1, i = A == null ? 0 : A.length, n = 0, o = []; ++t < i; ) {
    var g = A[t];
    e(g, t, A) && (o[n++] = g);
  }
  return o;
}
function jbe() {
  return [];
}
var Pbe = Object.prototype, $be = Pbe.propertyIsEnumerable, vcA = Object.getOwnPropertySymbols, Awe = vcA ? function(A) {
  return A == null ? [] : (A = Object(A), Obe(vcA(A), function(e) {
    return $be.call(A, e);
  }));
} : jbe;
const ewe = Awe;
function twe(A, e, t) {
  var i = e(A);
  return $I(A) ? i : Mbe(i, t(A));
}
function HcA(A) {
  return twe(A, xAA, ewe);
}
var iwe = e0(GC, "DataView");
const gO = iwe;
var nwe = e0(GC, "Promise");
const sO = nwe;
var owe = e0(GC, "Set");
const IO = owe;
var ScA = "[object Map]", gwe = "[object Object]", ZcA = "[object Promise]", WcA = "[object Set]", KcA = "[object WeakMap]", UcA = "[object DataView]", swe = A0(gO), Iwe = A0(WY), awe = A0(sO), rwe = A0(IO), Cwe = A0(oO), Vh = Op;
(gO && Vh(new gO(new ArrayBuffer(1))) != UcA || WY && Vh(new WY()) != ScA || sO && Vh(sO.resolve()) != ZcA || IO && Vh(new IO()) != WcA || oO && Vh(new oO()) != KcA) && (Vh = function(A) {
  var e = Op(A), t = e == gwe ? A.constructor : void 0, i = t ? A0(t) : "";
  if (i)
    switch (i) {
      case swe:
        return UcA;
      case Iwe:
        return ScA;
      case awe:
        return ZcA;
      case rwe:
        return WcA;
      case Cwe:
        return KcA;
    }
  return e;
});
const VcA = Vh;
var Bwe = GC.Uint8Array;
const PH = Bwe;
function lwe(A) {
  var e = new A.constructor(A.byteLength);
  return new PH(e).set(new PH(A)), e;
}
function cwe(A, e) {
  var t = e ? lwe(A.buffer) : A.buffer;
  return new A.constructor(t, A.byteOffset, A.length);
}
function Qwe(A) {
  return typeof A.constructor == "function" && !FAA(A) ? N0e(VFA(A)) : {};
}
var Ewe = "__lodash_hash_undefined__";
function uwe(A) {
  return this.__data__.set(A, Ewe), this;
}
function dwe(A) {
  return this.__data__.has(A);
}
function $H(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.__data__ = new xQ(); ++e < t; )
    this.add(A[e]);
}
$H.prototype.add = $H.prototype.push = uwe;
$H.prototype.has = dwe;
function hwe(A, e) {
  for (var t = -1, i = A == null ? 0 : A.length; ++t < i; )
    if (e(A[t], t, A))
      return !0;
  return !1;
}
function mwe(A, e) {
  return A.has(e);
}
var pwe = 1, ywe = 2;
function TFA(A, e, t, i, n, o) {
  var g = t & pwe, s = A.length, I = e.length;
  if (s != I && !(g && I > s))
    return !1;
  var r = o.get(A), a = o.get(e);
  if (r && a)
    return r == e && a == A;
  var C = -1, B = !0, l = t & ywe ? new $H() : void 0;
  for (o.set(A, e), o.set(e, A); ++C < s; ) {
    var Q = A[C], E = e[C];
    if (i)
      var d = g ? i(E, Q, C, e, A, o) : i(Q, E, C, A, e, o);
    if (d !== void 0) {
      if (d)
        continue;
      B = !1;
      break;
    }
    if (l) {
      if (!hwe(e, function(m, y) {
        if (!mwe(l, y) && (Q === m || n(Q, m, t, i, o)))
          return l.push(y);
      })) {
        B = !1;
        break;
      }
    } else if (!(Q === E || n(Q, E, t, i, o))) {
      B = !1;
      break;
    }
  }
  return o.delete(A), o.delete(e), B;
}
function bwe(A) {
  var e = -1, t = Array(A.size);
  return A.forEach(function(i, n) {
    t[++e] = [n, i];
  }), t;
}
function wwe(A) {
  var e = -1, t = Array(A.size);
  return A.forEach(function(i) {
    t[++e] = i;
  }), t;
}
var fwe = 1, Dwe = 2, Gwe = "[object Boolean]", kwe = "[object Date]", Jwe = "[object Error]", Nwe = "[object Map]", Ywe = "[object Number]", Rwe = "[object RegExp]", Fwe = "[object Set]", Mwe = "[object String]", xwe = "[object Symbol]", Lwe = "[object ArrayBuffer]", vwe = "[object DataView]", XcA = Zu ? Zu.prototype : void 0, z5 = XcA ? XcA.valueOf : void 0;
function Hwe(A, e, t, i, n, o, g) {
  switch (t) {
    case vwe:
      if (A.byteLength != e.byteLength || A.byteOffset != e.byteOffset)
        return !1;
      A = A.buffer, e = e.buffer;
    case Lwe:
      return !(A.byteLength != e.byteLength || !o(new PH(A), new PH(e)));
    case Gwe:
    case kwe:
    case Ywe:
      return AF(+A, +e);
    case Jwe:
      return A.name == e.name && A.message == e.message;
    case Rwe:
    case Mwe:
      return A == e + "";
    case Nwe:
      var s = bwe;
    case Fwe:
      var I = i & fwe;
      if (s || (s = wwe), A.size != e.size && !I)
        return !1;
      var r = g.get(A);
      if (r)
        return r == e;
      i |= Dwe, g.set(A, e);
      var a = TFA(s(A), s(e), i, n, o, g);
      return g.delete(A), a;
    case xwe:
      if (z5)
        return z5.call(A) == z5.call(e);
  }
  return !1;
}
var Swe = 1, Zwe = Object.prototype, Wwe = Zwe.hasOwnProperty;
function Kwe(A, e, t, i, n, o) {
  var g = t & Swe, s = HcA(A), I = s.length, r = HcA(e), a = r.length;
  if (I != a && !g)
    return !1;
  for (var C = I; C--; ) {
    var B = s[C];
    if (!(g ? B in e : Wwe.call(e, B)))
      return !1;
  }
  var l = o.get(A), Q = o.get(e);
  if (l && Q)
    return l == e && Q == A;
  var E = !0;
  o.set(A, e), o.set(e, A);
  for (var d = g; ++C < I; ) {
    B = s[C];
    var m = A[B], y = e[B];
    if (i)
      var f = g ? i(y, m, B, e, A, o) : i(m, y, B, A, e, o);
    if (!(f === void 0 ? m === y || n(m, y, t, i, o) : f)) {
      E = !1;
      break;
    }
    d || (d = B == "constructor");
  }
  if (E && !d) {
    var w = A.constructor, G = e.constructor;
    w != G && "constructor" in A && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof G == "function" && G instanceof G) && (E = !1);
  }
  return o.delete(A), o.delete(e), E;
}
var Uwe = 1, zcA = "[object Arguments]", TcA = "[object Array]", vM = "[object Object]", Vwe = Object.prototype, _cA = Vwe.hasOwnProperty;
function Xwe(A, e, t, i, n, o) {
  var g = $I(A), s = $I(e), I = g ? TcA : VcA(A), r = s ? TcA : VcA(e);
  I = I == zcA ? vM : I, r = r == zcA ? vM : r;
  var a = I == vM, C = r == vM, B = I == r;
  if (B && jH(A)) {
    if (!jH(e))
      return !1;
    g = !0, a = !1;
  }
  if (B && !a)
    return o || (o = new zB()), g || MAA(A) ? TFA(A, e, t, i, n, o) : Hwe(A, e, I, t, i, n, o);
  if (!(t & Uwe)) {
    var l = a && _cA.call(A, "__wrapped__"), Q = C && _cA.call(e, "__wrapped__");
    if (l || Q) {
      var E = l ? A.value() : A, d = Q ? e.value() : e;
      return o || (o = new zB()), n(E, d, t, i, o);
    }
  }
  return B ? (o || (o = new zB()), Kwe(A, e, t, i, n, o)) : !1;
}
function HAA(A, e, t, i, n) {
  return A === e ? !0 : A == null || e == null || !Wu(A) && !Wu(e) ? A !== A && e !== e : Xwe(A, e, t, i, HAA, n);
}
var zwe = 1, Twe = 2;
function _we(A, e, t, i) {
  var n = t.length, o = n, g = !i;
  if (A == null)
    return !o;
  for (A = Object(A); n--; ) {
    var s = t[n];
    if (g && s[2] ? s[1] !== A[s[0]] : !(s[0] in A))
      return !1;
  }
  for (; ++n < o; ) {
    s = t[n];
    var I = s[0], r = A[I], a = s[1];
    if (g && s[2]) {
      if (r === void 0 && !(I in A))
        return !1;
    } else {
      var C = new zB();
      if (i)
        var B = i(r, a, I, A, e, C);
      if (!(B === void 0 ? HAA(a, r, zwe | Twe, i, C) : B))
        return !1;
    }
  }
  return !0;
}
function _FA(A) {
  return A === A && !ja(A);
}
function qwe(A) {
  for (var e = xAA(A), t = e.length; t--; ) {
    var i = e[t], n = A[i];
    e[t] = [i, n, _FA(n)];
  }
  return e;
}
function qFA(A, e) {
  return function(t) {
    return t == null ? !1 : t[A] === e && (e !== void 0 || A in Object(t));
  };
}
function Owe(A) {
  var e = qwe(A);
  return e.length == 1 && e[0][2] ? qFA(e[0][0], e[0][1]) : function(t) {
    return t === A || _we(t, A, e);
  };
}
function jwe(A, e) {
  return A != null && e in Object(A);
}
function Pwe(A, e, t) {
  e = KFA(e, A);
  for (var i = -1, n = e.length, o = !1; ++i < n; ) {
    var g = H3(e[i]);
    if (!(o = A != null && t(A, g)))
      break;
    A = A[g];
  }
  return o || ++i != n ? o : (n = A == null ? 0 : A.length, !!n && RAA(n) && NAA(g, n) && ($I(A) || OH(A)));
}
function $we(A, e) {
  return A != null && Pwe(A, e, jwe);
}
var Afe = 1, efe = 2;
function tfe(A, e) {
  return LAA(A) && _FA(e) ? qFA(H3(A), e) : function(t) {
    var i = Fbe(t, A);
    return i === void 0 && i === e ? $we(t, A) : HAA(e, i, Afe | efe);
  };
}
function ife(A) {
  return function(e) {
    return e == null ? void 0 : e[A];
  };
}
function nfe(A) {
  return function(e) {
    return UFA(e, A);
  };
}
function ofe(A) {
  return LAA(A) ? ife(H3(A)) : nfe(A);
}
function gfe(A) {
  return typeof A == "function" ? A : A == null ? x3 : typeof A == "object" ? $I(A) ? tfe(A[0], A[1]) : Owe(A) : ofe(A);
}
function sfe(A) {
  return function(e, t, i) {
    for (var n = -1, o = Object(e), g = i(e), s = g.length; s--; ) {
      var I = g[A ? s : ++n];
      if (t(o[I], I, o) === !1)
        break;
    }
    return e;
  };
}
var Ife = sfe();
const OFA = Ife;
function afe(A, e) {
  return A && OFA(A, e, xAA);
}
function rfe(A, e) {
  return function(t, i) {
    if (t == null)
      return t;
    if (!HD(t))
      return A(t, i);
    for (var n = t.length, o = e ? n : -1, g = Object(t); (e ? o-- : ++o < n) && i(g[o], o, g) !== !1; )
      ;
    return t;
  };
}
var Cfe = rfe(afe);
const jFA = Cfe;
function aO(A, e, t) {
  (t !== void 0 && !AF(A[e], t) || t === void 0 && !(e in A)) && YAA(A, e, t);
}
function Bfe(A) {
  return Wu(A) && HD(A);
}
function rO(A, e) {
  if (!(e === "constructor" && typeof A[e] == "function") && e != "__proto__")
    return A[e];
}
function lfe(A) {
  return q0e(A, WFA(A));
}
function cfe(A, e, t, i, n, o, g) {
  var s = rO(A, t), I = rO(e, t), r = g.get(I);
  if (r) {
    aO(A, t, r);
    return;
  }
  var a = o ? o(s, I, t + "", A, e, g) : void 0, C = a === void 0;
  if (C) {
    var B = $I(I), l = !B && jH(I), Q = !B && !l && MAA(I);
    a = I, B || l || Q ? $I(s) ? a = s : Bfe(s) ? a = R0e(s) : l ? (C = !1, a = qbe(I, !0)) : Q ? (C = !1, a = cwe(I, !0)) : a = [] : Wbe(I) || OH(I) ? (a = s, OH(s) ? a = lfe(s) : (!ja(s) || JAA(s)) && (a = Qwe(I))) : C = !1;
  }
  C && (g.set(I, a), n(a, I, i, o, g), g.delete(I)), aO(A, t, a);
}
function PFA(A, e, t, i, n) {
  A !== e && OFA(e, function(o, g) {
    if (n || (n = new zB()), ja(o))
      cfe(A, e, g, t, PFA, i, n);
    else {
      var s = i ? i(rO(A, g), o, g + "", A, e, n) : void 0;
      s === void 0 && (s = o), aO(A, g, s);
    }
  }, WFA);
}
function Qfe(A) {
  return typeof A == "function" ? A : x3;
}
function Efe(A, e) {
  var t = $I(A) ? U0e : jFA;
  return t(A, Qfe(e));
}
function ufe(A, e) {
  var t = -1, i = HD(A) ? Array(A.length) : [];
  return jFA(A, function(n, o, g) {
    i[++t] = e(n, o, g);
  }), i;
}
function t0(A, e) {
  var t = $I(A) ? FFA : ufe;
  return t(A, gfe(e));
}
function qcA(A) {
  return A === void 0;
}
var dfe = $0e(function(A, e, t) {
  PFA(A, e, t);
});
const nI = dfe;
var hfe = Math.ceil, mfe = Math.max;
function pfe(A, e, t, i) {
  for (var n = -1, o = mfe(hfe((e - A) / (t || 1)), 0), g = Array(o); o--; )
    g[i ? o : ++n] = A, A += t;
  return g;
}
function yfe(A) {
  return function(e, t, i) {
    return i && typeof i != "number" && xFA(e, t, i) && (t = i = void 0), e = U5(e), t === void 0 ? (t = e, e = 0) : t = U5(t), i = i === void 0 ? e < t ? 1 : -1 : U5(i), pfe(e, t, i, A);
  };
}
var bfe = yfe();
const wfe = bfe;
var ffe = "Expected a function";
function Dfe(A, e, t) {
  var i = !0, n = !0;
  if (typeof A != "function")
    throw new TypeError(ffe);
  return ja(t) && (i = "leading" in t ? !!t.leading : i, n = "trailing" in t ? !!t.trailing : n), wD(A, e, {
    leading: i,
    maxWait: e,
    trailing: n
  });
}
const Gfe = async (A, e, t = 0, i) => await A({
  workflow: [
    ...i != null && i.filters && i.filters.length > 0 ? [
      {
        type: "filter",
        filters: i.filters
      }
    ] : [],
    {
      type: "view",
      query: [
        {
          op: "raw",
          fields: ["*"]
        }
      ]
    },
    ...i != null && i.sorting ? [
      {
        type: "sort",
        by: [i.sorting.fid],
        sort: i.sorting.sort
      }
    ] : []
  ],
  limit: e,
  offset: t * e
}), AS = async (A, e, t) => {
  const i = e.find((n) => n.type === "view");
  return i && i.query.length === 1 && i.query[0].op === "raw" && i.query[0].fields.length === 0 ? [] : await A({
    workflow: e,
    limit: t
  });
}, eS = async (A, e, t, i) => {
  var n;
  const { values: o = !0, range: g = !0, valuesMeta: s = !0, sortBy: I = "none", timezoneDisplayOffset: r, keyword: a } = t, C = `count_${e.fid}`, B = `total_distinct_${e.fid}`, l = `min_${e.fid}`, Q = `max_${e.fid}`, E = an(a) ? dBe(a) : void 0, d = E ? [
    {
      type: "filter",
      filters: [{ fid: e.fid, rule: { type: "regexp", value: E.source, caseSensitive: !E.ignoreCase } }]
    }
  ] : [], m = e.computed ? [
    {
      type: "transform",
      transform: [
        {
          expression: NY(e.expression, i, { timezoneDisplayOffset: r }),
          key: e.fid
        }
      ]
    }
  ] : [], y = {
    workflow: [
      ...m,
      ...d,
      {
        type: "view",
        query: [
          {
            op: "aggregate",
            groupBy: [e.fid],
            measures: [
              {
                field: "*",
                agg: "count",
                asFieldKey: C
              }
            ]
          }
        ]
      },
      {
        type: "view",
        query: [
          {
            op: "aggregate",
            groupBy: [],
            measures: [
              {
                field: "*",
                agg: "count",
                asFieldKey: B
              },
              {
                field: C,
                agg: "sum",
                asFieldKey: "count"
              }
            ]
          }
        ]
      }
    ]
  }, f = {
    workflow: [
      ...m,
      ...d,
      {
        type: "view",
        query: [
          {
            op: "aggregate",
            groupBy: [e.fid],
            measures: [
              {
                field: "*",
                agg: "count",
                asFieldKey: C
              }
            ]
          }
        ]
      },
      ...I === "none" ? [] : [
        {
          type: "sort",
          by: [I.startsWith("value") ? e.fid : C],
          sort: I.endsWith("dsc") ? "descending" : "ascending"
        }
      ]
    ],
    limit: t.valuesLimit,
    offset: t.valuesOffset
  }, [w = { [B]: 0, count: 0 }] = s ? await A(y) : [{ [B]: 0, count: 0 }], G = o ? await A(f) : [], R = {
    workflow: [
      ...m,
      ...d,
      {
        type: "view",
        query: [
          {
            op: "aggregate",
            groupBy: [],
            measures: [
              {
                field: e.fid,
                agg: "min",
                asFieldKey: l
              },
              {
                field: e.fid,
                agg: "max",
                asFieldKey: Q
              }
            ]
          }
        ]
      }
    ]
  }, [F = {
    [l]: 0,
    [Q]: 0
  }] = g ? await A(R) : [
    {
      [l]: 0,
      [Q]: 0
    }
  ], Z = (n = t.selectedCount) != null && n.length ? {
    workflow: [
      ...m,
      ...d,
      {
        type: "filter",
        filters: [
          {
            fid: e.fid,
            rule: {
              type: "one of",
              value: t.selectedCount
            }
          }
        ]
      },
      {
        type: "view",
        query: [
          {
            op: "aggregate",
            groupBy: [],
            measures: [
              {
                field: "*",
                agg: "count",
                asFieldKey: "count"
              }
            ]
          }
        ]
      }
    ]
  } : null, [c = { count: 0 }] = Z ? await A(Z) : [];
  return {
    values: G.map((J) => ({
      value: J[e.fid],
      count: J[C]
    })),
    valuesMeta: {
      total: w.count,
      distinctTotal: w[B]
    },
    range: [F[l], F[Q]],
    selectedCount: c.count
  };
};
function $FA(A, e, t, i) {
  return (n) => {
    const o = A.computed ? [
      {
        type: "transform",
        transform: [
          {
            expression: NY(A.expression, e, i),
            key: A.fid
          }
        ]
      }
    ] : [];
    return n((g) => {
      const s = {
        ...g,
        workflow: [...o, ...g.workflow]
      };
      return t(s);
    });
  };
}
async function CO(A, e) {
  var t;
  const i = await A({
    workflow: [
      {
        type: "view",
        query: [
          {
            op: "raw",
            fields: [e]
          }
        ]
      }
    ],
    limit: 1,
    offset: 0
  });
  return (t = i == null ? void 0 : i[0]) == null ? void 0 : t[e];
}
async function A1A(A, e, t) {
  const i = await CO(A, e), n = YY(i), o = t ?? (/* @__PURE__ */ new Date()).getTimezoneOffset(), g = GY(o), s = `min_${e}`, I = `max_${e}`, r = {
    workflow: [
      {
        type: "view",
        query: [
          {
            op: "aggregate",
            groupBy: [],
            measures: [
              {
                field: e,
                agg: "min",
                asFieldKey: s,
                format: n,
                offset: o
              },
              {
                field: e,
                agg: "max",
                asFieldKey: I,
                format: n,
                offset: o
              }
            ]
          }
        ]
      }
    ]
  }, [a = {
    [s]: 0,
    [I]: 0
  }] = await A(r);
  return [g(a[s]).getTime(), g(a[I]).getTime(), n];
}
async function kfe(A, e) {
  const t = `count_${e}`, i = `total_distinct_${e}`, n = [
    {
      type: "view",
      query: [
        {
          op: "aggregate",
          groupBy: [e],
          measures: [
            {
              field: "*",
              agg: "count",
              asFieldKey: t
            }
          ]
        }
      ]
    },
    {
      type: "view",
      query: [
        {
          op: "aggregate",
          groupBy: [],
          measures: [
            {
              field: "*",
              agg: "count",
              asFieldKey: i
            },
            {
              field: t,
              agg: "sum",
              asFieldKey: "count"
            }
          ]
        }
      ]
    }
  ], [o = { [i]: 0, count: 0 }] = await A({ workflow: n });
  return {
    total: o.count,
    distinctTotal: o[i]
  };
}
async function Jfe(A, e, t = {}) {
  const { sortBy: i = "none", valuesLimit: n, valuesOffset: o } = t, g = `count_${e}`, s = {
    workflow: [
      {
        type: "view",
        query: [
          {
            op: "aggregate",
            groupBy: [e],
            measures: [
              {
                field: "*",
                agg: "count",
                asFieldKey: g
              }
            ]
          }
        ]
      },
      ...i === "none" ? [] : [
        {
          type: "sort",
          by: [i.startsWith("value") ? e : g],
          sort: i.endsWith("dsc") ? "descending" : "ascending"
        }
      ]
    ],
    limit: n,
    offset: o
  };
  return (await A(s)).map((I) => ({
    value: I[e],
    count: I[g]
  }));
}
async function Nfe(A, e) {
  const t = kfe(A, e), i = Jfe(A, e, { sortBy: "count_dsc", valuesLimit: 2 });
  return Promise.all([t, i]);
}
async function Yfe(A, e) {
  const t = `bin_${e}`, i = `${Hn}_sum`, n = 10, o = (await A({ workflow: [
    {
      type: "transform",
      transform: [
        {
          key: t,
          expression: {
            op: "bin",
            as: t,
            params: [
              {
                type: "field",
                value: e
              }
            ],
            num: n
          }
        },
        {
          key: Hn,
          expression: {
            op: "one",
            params: [],
            as: Hn
          }
        }
      ]
    },
    {
      type: "view",
      query: [
        {
          op: "aggregate",
          groupBy: [t],
          measures: [
            {
              field: Hn,
              agg: "sum",
              asFieldKey: i
            }
          ]
        }
      ]
    }
  ] })).sort((a, C) => a[t][0] - C[t][0]);
  if (o.length === 0)
    return {
      max: 0,
      min: 0,
      binValues: []
    };
  const g = o[0][t][0], s = o[o.length - 1][t][1], I = (s - g) / n, r = wfe(0, n).map((a) => a * I + g).map((a) => {
    const C = hBe(o, a, (l) => l[t][0]), B = C[t][0];
    if (Math.abs(B - a) * 2 < I) {
      const l = C[i];
      return {
        from: a,
        to: a + I,
        count: l
      };
    } else
      return {
        from: a,
        to: a + I,
        count: 0
      };
  });
  return {
    min: g,
    max: s,
    binValues: r
  };
}
function e1A(A, e) {
  return (t) => A({
    ...t,
    tag: e
  });
}
const Rfe = (A) => A.filter(Boolean), t1A = (A) => {
  const e = xt(), t = e.currentVis.encodings[A], { t: i } = qe("translation", { keyPrefix: "field_menu" }), n = sg();
  return u.useMemo(() => t.map((o, g) => {
    var s, I;
    const r = ((s = o.expression) == null ? void 0 : s.op) === "dateTimeDrill", a = [Hn, Zi, Wi, ln].includes(o.fid);
    return Rfe([
      A === "dimensions" && {
        label: i("to_mea"),
        disabled: a,
        onPress() {
          e.moveField("dimensions", g, "measures", e.viewMeasures.length);
        }
      },
      A === "measures" && {
        label: i("to_dim"),
        disabled: a,
        onPress() {
          e.moveField("measures", g, "dimensions", e.viewDimensions.length);
        }
      },
      {
        label: i("new_calc"),
        disabled: o.semanticType === "nominal" || o.semanticType === "ordinal" || a,
        children: [
          {
            label: i("bin"),
            onPress() {
              e.createBinField(A, g, "bin");
            }
          },
          {
            label: i("binCount"),
            disabled: o.semanticType === "nominal" || o.semanticType === "ordinal",
            onPress() {
              e.createBinField(A, g, "binCount");
            }
          },
          {
            label: i("log", { base: 10 }),
            disabled: o.semanticType === "nominal" || o.semanticType === "ordinal",
            onPress() {
              e.createLogField(A, g, "log", 10);
            }
          },
          {
            label: i("log", { base: 2 }),
            disabled: o.semanticType === "nominal" || o.semanticType === "ordinal",
            onPress() {
              e.createLogField(A, g, "log", 2);
            }
          },
          {
            label: i("binCustom"),
            disabled: o.semanticType === "nominal" || o.semanticType === "ordinal",
            onPress() {
              e.setShowBinSettingPanel(!0), e.setCreateField({ channel: A, index: g });
            }
          },
          {
            label: i("logCustom"),
            disabled: o.semanticType === "nominal" || o.semanticType === "ordinal",
            onPress() {
              e.setShowLogSettingPanel(!0), e.setCreateField({ channel: A, index: g });
            }
          }
        ]
      },
      {
        label: i("semantic_type.name"),
        disabled: a,
        children: ["nominal", "ordinal", "quantitative", "temporal"].map((C) => ({
          label: i(`semantic_type.types.${C}`),
          disabled: o.semanticType === C,
          onPress() {
            const B = o.analyticType === "dimension" ? "dimensions" : "measures";
            e.changeSemanticType(B, g, C);
          }
        }))
      },
      (o.semanticType === "temporal" || r) && {
        label: i("drill.name"),
        disabled: a,
        children: MCe.map((C) => {
          var B, l;
          return {
            label: i(`drill.levels.${C}`),
            disabled: r && ((l = (B = o.expression) == null ? void 0 : B.params.find((Q) => Q.type === "value")) == null ? void 0 : l.value) === C,
            onPress() {
              const Q = (r ? e.allFields.find((m) => {
                var y, f;
                return m.fid === ((f = (y = o.expression) == null ? void 0 : y.params.find((w) => w.type === "field")) == null ? void 0 : f.value);
              }) : null) ?? o, E = Q.analyticType === "dimension" ? "dimensions" : "measures", d = e.allFields.findIndex((m) => m.fid === Q.fid);
              CO(n, Q.fid).then(YY).then((m) => e.createDateTimeDrilledField(E, d, C, `${i(`drill.levels.${C}`)} (${Q.name || Q.fid})`, m, o.offset));
            }
          };
        })
      },
      (o.semanticType === "temporal" || r) && {
        label: i("drill.feature_name"),
        disabled: a,
        children: xCe.map((C) => {
          var B, l;
          return {
            label: i(`drill.levels.${C}`),
            disabled: r && ((l = (B = o.expression) == null ? void 0 : B.params.find((Q) => Q.type === "value")) == null ? void 0 : l.value) === C,
            onPress() {
              const Q = (r ? e.allFields.find((m) => {
                var y, f;
                return m.fid === ((f = (y = o.expression) == null ? void 0 : y.params.find((w) => w.type === "field")) == null ? void 0 : f.value);
              }) : null) ?? o, E = Q.analyticType === "dimension" ? "dimensions" : "measures", d = e.allFields.findIndex((m) => m.fid === Q.fid);
              CO(n, Q.fid).then(YY).then((m) => e.createDateFeatureField(E, d, C, `${i(`drill.levels.${C}`)} [${Q.name || Q.fid}]`, m, o.offset));
            }
          };
        })
      },
      {
        label: "Rename Field",
        onPress() {
          e.setShowRenamePanel(!0), e.setCreateField({ channel: A, index: g });
        }
      },
      o.computed && !a && ((I = o.expression) == null ? void 0 : I.op) === "expr" && {
        label: "Edit Computed Field",
        onPress() {
          e.setComputedFieldFid(o.fid);
        }
      },
      o.computed && !a && {
        label: "Remove Field",
        onPress() {
          const C = o.analyticType === "dimension" ? "dimensions" : "measures";
          e.removeComputedField(C, g);
        }
      }
    ]);
  }), [A, t, e, i, n]);
}, Ffe = (A) => {
  const e = xt(), { dimensions: t } = e, i = t1A("dimensions");
  return b.createElement("div", { className: "touch-none" }, t.map((n, o) => b.createElement(mD, { key: OI(n), draggableId: `dimension_${OI(n)}`, index: o }, (g, s) => b.createElement(
    sw,
    { title: n.name || n.fid, menu: i[o], enableContextMenu: !1, disabled: s.isDragging },
    b.createElement(
      _H,
      { className: `touch-none flex pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-dimension/20 transition-colors rounded-md truncate border border-transparent ${s.isDragging ? "bg-dimension/20" : ""}`, ref: er(g.innerRef), isDragging: s.isDragging, ...g.draggableProps, ...g.dragHandleProps },
      b.createElement(Bf, { dataType: n.semanticType, analyticType: n.analyticType }),
      b.createElement("span", { className: "ml-0.5", title: n.name }, n.name),
      b.createElement(
        sw.Button,
        { as: "div" },
        b.createElement(fY, { className: "w-4 h-4" })
      )
    ),
    b.createElement(
      _H,
      { className: `pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-dimension/20 rounded-full border border-dimension truncate ${s.isDragging ? "bg-dimension/20 flex" : "hidden"}`, isDragging: s.isDragging },
      b.createElement(Bf, { dataType: n.semanticType, analyticType: n.analyticType }),
      b.createElement("span", { className: "ml-0.5", title: n.name }, n.name),
      b.createElement(
        sw.Button,
        { as: "div" },
        b.createElement(fY, { className: "w-4 h-4" })
      )
    )
  ))));
}, Mfe = gt(Ffe), xfe = (A) => {
  const e = xt(), { measures: t } = e, i = t1A("measures");
  return b.createElement("div", { className: "touch-none" }, t.map((n, o) => b.createElement(mD, { key: OI(n), draggableId: `measure_${OI(n)}`, index: o }, (g, s) => b.createElement(
    "div",
    { className: "block" },
    b.createElement(
      sw,
      { title: n.name || n.fid, menu: i[o], enableContextMenu: !0, disabled: s.isDragging || n.fid === Zi },
      b.createElement(
        _H,
        { className: `touch-none flex pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-measure/20 rounded-md truncate border border-transparent ${s.isDragging ? "bg-measure/20" : ""}`, isDragging: s.isDragging, ref: er(g.innerRef), ...g.draggableProps, ...g.dragHandleProps },
        b.createElement(Bf, { dataType: n.semanticType, analyticType: n.analyticType }),
        b.createElement("span", { className: "ml-0.5", title: n.name }, n.name),
        b.createElement(
          sw.Button,
          { as: "div" },
          b.createElement(fY, { className: "w-4 h-4" })
        )
      ),
      b.createElement(
        _H,
        { className: `pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-measure/20 rounded-md border-measure border truncate ${s.isDragging ? "bg-measure/20 flex" : "hidden"}`, isDragging: s.isDragging },
        b.createElement(Bf, { dataType: n.semanticType, analyticType: n.analyticType }),
        b.createElement("span", { className: "ml-0.5", title: n.name }, n.name),
        b.createElement(
          sw.Button,
          { as: "div" },
          b.createElement(fY, { className: "w-4 h-4" })
        )
      )
    )
  ))));
}, Lfe = gt(xfe), vfe = ji.div`
    @media (min-width: 640px) {
        height: 680px;
    }
`, Hfe = (A) => {
  const { t: e } = qe("translation", { keyPrefix: "main.tabpanel.DatasetFields" });
  return b.createElement(
    vfe,
    { className: "p-1 sm:mr-0.5 my-0.5 border flex sm:flex-col", style: { paddingBlock: 0, paddingInline: "0.6em" } },
    b.createElement("h4", { className: "text-xs mb-2 flex-grow-0 cursor-default select-none mt-2" }, e("field_list")),
    b.createElement(ep, { droppableId: "dimensions", direction: "vertical" }, (t, i) => b.createElement(
      "div",
      { className: "flex-shrink min-w-[0px] min-h-[100px] max-h-[380px]", ...t.droppableProps, ref: er(t.innerRef) },
      b.createElement(
        "div",
        { className: "pd-1 overflow-y-auto h-full" },
        b.createElement(Mfe, null)
      )
    )),
    b.createElement(ep, { droppableId: "measures", direction: "vertical" }, (t, i) => b.createElement(
      "div",
      { className: "flex-shrink flex-grow min-w-[0px] min-h-[200px]", ...t.droppableProps, ref: er(t.innerRef) },
      b.createElement(
        "div",
        { className: "border-t flex-grow pd-1 overflow-y-auto h-full" },
        b.createElement(Lfe, null)
      )
    ))
  );
}, Sfe = Hfe;
var Zfe = globalThis && globalThis.__extends || function() {
  var A = function(e, t) {
    return A = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, n) {
      i.__proto__ = n;
    } || function(i, n) {
      for (var o in n)
        Object.prototype.hasOwnProperty.call(n, o) && (i[o] = n[o]);
    }, A(e, t);
  };
  return function(e, t) {
    A(e, t);
    function i() {
      this.constructor = e;
    }
    e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
  };
}(), Ao = globalThis && globalThis.__assign || function() {
  return Ao = Object.assign || function(A) {
    for (var e, t = 1, i = arguments.length; t < i; t++) {
      e = arguments[t];
      for (var n in e)
        Object.prototype.hasOwnProperty.call(e, n) && (A[n] = e[n]);
    }
    return A;
  }, Ao.apply(this, arguments);
}, OcA = {
  width: "100%",
  height: "10px",
  top: "0px",
  left: "0px",
  cursor: "row-resize"
}, jcA = {
  width: "10px",
  height: "100%",
  top: "0px",
  left: "0px",
  cursor: "col-resize"
}, HM = {
  width: "20px",
  height: "20px",
  position: "absolute"
}, Wfe = {
  top: Ao(Ao({}, OcA), { top: "-5px" }),
  right: Ao(Ao({}, jcA), { left: void 0, right: "-5px" }),
  bottom: Ao(Ao({}, OcA), { top: void 0, bottom: "-5px" }),
  left: Ao(Ao({}, jcA), { left: "-5px" }),
  topRight: Ao(Ao({}, HM), { right: "-10px", top: "-10px", cursor: "ne-resize" }),
  bottomRight: Ao(Ao({}, HM), { right: "-10px", bottom: "-10px", cursor: "se-resize" }),
  bottomLeft: Ao(Ao({}, HM), { left: "-10px", bottom: "-10px", cursor: "sw-resize" }),
  topLeft: Ao(Ao({}, HM), { left: "-10px", top: "-10px", cursor: "nw-resize" })
}, Kfe = (
  /** @class */
  function(A) {
    Zfe(e, A);
    function e() {
      var t = A !== null && A.apply(this, arguments) || this;
      return t.onMouseDown = function(i) {
        t.props.onResizeStart(i, t.props.direction);
      }, t.onTouchStart = function(i) {
        t.props.onResizeStart(i, t.props.direction);
      }, t;
    }
    return e.prototype.render = function() {
      return u.createElement("div", { className: this.props.className || "", style: Ao(Ao({ position: "absolute", userSelect: "none" }, Wfe[this.props.direction]), this.props.replaceStyles || {}), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children);
    }, e;
  }(u.PureComponent)
), Ufe = globalThis && globalThis.__extends || function() {
  var A = function(e, t) {
    return A = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, n) {
      i.__proto__ = n;
    } || function(i, n) {
      for (var o in n)
        Object.prototype.hasOwnProperty.call(n, o) && (i[o] = n[o]);
    }, A(e, t);
  };
  return function(e, t) {
    A(e, t);
    function i() {
      this.constructor = e;
    }
    e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
  };
}(), gB = globalThis && globalThis.__assign || function() {
  return gB = Object.assign || function(A) {
    for (var e, t = 1, i = arguments.length; t < i; t++) {
      e = arguments[t];
      for (var n in e)
        Object.prototype.hasOwnProperty.call(e, n) && (A[n] = e[n]);
    }
    return A;
  }, gB.apply(this, arguments);
}, Vfe = {
  width: "auto",
  height: "auto"
}, SM = function(A, e, t) {
  return Math.max(Math.min(A, t), e);
}, PcA = function(A, e) {
  return Math.round(A / e) * e;
}, Iy = function(A, e) {
  return new RegExp(A, "i").test(e);
}, ZM = function(A) {
  return !!(A.touches && A.touches.length);
}, Xfe = function(A) {
  return !!((A.clientX || A.clientX === 0) && (A.clientY || A.clientY === 0));
}, $cA = function(A, e, t) {
  t === void 0 && (t = 0);
  var i = e.reduce(function(o, g, s) {
    return Math.abs(g - A) < Math.abs(e[o] - A) ? s : o;
  }, 0), n = Math.abs(e[i] - A);
  return t === 0 || n < t ? e[i] : A;
}, T5 = function(A) {
  return A = A.toString(), A === "auto" || A.endsWith("px") || A.endsWith("%") || A.endsWith("vh") || A.endsWith("vw") || A.endsWith("vmax") || A.endsWith("vmin") ? A : A + "px";
}, WM = function(A, e, t, i) {
  if (A && typeof A == "string") {
    if (A.endsWith("px"))
      return Number(A.replace("px", ""));
    if (A.endsWith("%")) {
      var n = Number(A.replace("%", "")) / 100;
      return e * n;
    }
    if (A.endsWith("vw")) {
      var n = Number(A.replace("vw", "")) / 100;
      return t * n;
    }
    if (A.endsWith("vh")) {
      var n = Number(A.replace("vh", "")) / 100;
      return i * n;
    }
  }
  return A;
}, zfe = function(A, e, t, i, n, o, g) {
  return i = WM(i, A.width, e, t), n = WM(n, A.height, e, t), o = WM(o, A.width, e, t), g = WM(g, A.height, e, t), {
    maxWidth: typeof i > "u" ? void 0 : Number(i),
    maxHeight: typeof n > "u" ? void 0 : Number(n),
    minWidth: typeof o > "u" ? void 0 : Number(o),
    minHeight: typeof g > "u" ? void 0 : Number(g)
  };
}, Tfe = [
  "as",
  "style",
  "className",
  "grid",
  "snap",
  "bounds",
  "boundsByDirection",
  "size",
  "defaultSize",
  "minWidth",
  "minHeight",
  "maxWidth",
  "maxHeight",
  "lockAspectRatio",
  "lockAspectRatioExtraWidth",
  "lockAspectRatioExtraHeight",
  "enable",
  "handleStyles",
  "handleClasses",
  "handleWrapperStyle",
  "handleWrapperClass",
  "children",
  "onResizeStart",
  "onResize",
  "onResizeStop",
  "handleComponent",
  "scale",
  "resizeRatio",
  "snapGap"
], AQA = "__resizable_base__", _fe = (
  /** @class */
  function(A) {
    Ufe(e, A);
    function e(t) {
      var i = A.call(this, t) || this;
      return i.ratio = 1, i.resizable = null, i.parentLeft = 0, i.parentTop = 0, i.resizableLeft = 0, i.resizableRight = 0, i.resizableTop = 0, i.resizableBottom = 0, i.targetLeft = 0, i.targetTop = 0, i.appendBase = function() {
        if (!i.resizable || !i.window)
          return null;
        var n = i.parentNode;
        if (!n)
          return null;
        var o = i.window.document.createElement("div");
        return o.style.width = "100%", o.style.height = "100%", o.style.position = "absolute", o.style.transform = "scale(0, 0)", o.style.left = "0", o.style.flex = "0 0 100%", o.classList ? o.classList.add(AQA) : o.className += AQA, n.appendChild(o), o;
      }, i.removeBase = function(n) {
        var o = i.parentNode;
        o && o.removeChild(n);
      }, i.ref = function(n) {
        n && (i.resizable = n);
      }, i.state = {
        isResizing: !1,
        width: typeof (i.propsSize && i.propsSize.width) > "u" ? "auto" : i.propsSize && i.propsSize.width,
        height: typeof (i.propsSize && i.propsSize.height) > "u" ? "auto" : i.propsSize && i.propsSize.height,
        direction: "right",
        original: {
          x: 0,
          y: 0,
          width: 0,
          height: 0
        },
        backgroundStyle: {
          height: "100%",
          width: "100%",
          backgroundColor: "rgba(0,0,0,0)",
          cursor: "auto",
          opacity: 0,
          position: "fixed",
          zIndex: 9999,
          top: "0",
          left: "0",
          bottom: "0",
          right: "0"
        },
        flexBasis: void 0
      }, i.onResizeStart = i.onResizeStart.bind(i), i.onMouseMove = i.onMouseMove.bind(i), i.onMouseUp = i.onMouseUp.bind(i), i;
    }
    return Object.defineProperty(e.prototype, "parentNode", {
      get: function() {
        return this.resizable ? this.resizable.parentNode : null;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e.prototype, "window", {
      get: function() {
        return !this.resizable || !this.resizable.ownerDocument ? null : this.resizable.ownerDocument.defaultView;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e.prototype, "propsSize", {
      get: function() {
        return this.props.size || this.props.defaultSize || Vfe;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e.prototype, "size", {
      get: function() {
        var t = 0, i = 0;
        if (this.resizable && this.window) {
          var n = this.resizable.offsetWidth, o = this.resizable.offsetHeight, g = this.resizable.style.position;
          g !== "relative" && (this.resizable.style.position = "relative"), t = this.resizable.style.width !== "auto" ? this.resizable.offsetWidth : n, i = this.resizable.style.height !== "auto" ? this.resizable.offsetHeight : o, this.resizable.style.position = g;
        }
        return { width: t, height: i };
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e.prototype, "sizeStyle", {
      get: function() {
        var t = this, i = this.props.size, n = function(s) {
          if (typeof t.state[s] > "u" || t.state[s] === "auto")
            return "auto";
          if (t.propsSize && t.propsSize[s] && t.propsSize[s].toString().endsWith("%")) {
            if (t.state[s].toString().endsWith("%"))
              return t.state[s].toString();
            var I = t.getParentSize(), r = Number(t.state[s].toString().replace("px", "")), a = r / I[s] * 100;
            return a + "%";
          }
          return T5(t.state[s]);
        }, o = i && typeof i.width < "u" && !this.state.isResizing ? T5(i.width) : n("width"), g = i && typeof i.height < "u" && !this.state.isResizing ? T5(i.height) : n("height");
        return { width: o, height: g };
      },
      enumerable: !1,
      configurable: !0
    }), e.prototype.getParentSize = function() {
      if (!this.parentNode)
        return this.window ? { width: this.window.innerWidth, height: this.window.innerHeight } : { width: 0, height: 0 };
      var t = this.appendBase();
      if (!t)
        return { width: 0, height: 0 };
      var i = !1, n = this.parentNode.style.flexWrap;
      n !== "wrap" && (i = !0, this.parentNode.style.flexWrap = "wrap"), t.style.position = "relative", t.style.minWidth = "100%", t.style.minHeight = "100%";
      var o = {
        width: t.offsetWidth,
        height: t.offsetHeight
      };
      return i && (this.parentNode.style.flexWrap = n), this.removeBase(t), o;
    }, e.prototype.bindEvents = function() {
      this.window && (this.window.addEventListener("mouseup", this.onMouseUp), this.window.addEventListener("mousemove", this.onMouseMove), this.window.addEventListener("mouseleave", this.onMouseUp), this.window.addEventListener("touchmove", this.onMouseMove, {
        capture: !0,
        passive: !1
      }), this.window.addEventListener("touchend", this.onMouseUp));
    }, e.prototype.unbindEvents = function() {
      this.window && (this.window.removeEventListener("mouseup", this.onMouseUp), this.window.removeEventListener("mousemove", this.onMouseMove), this.window.removeEventListener("mouseleave", this.onMouseUp), this.window.removeEventListener("touchmove", this.onMouseMove, !0), this.window.removeEventListener("touchend", this.onMouseUp));
    }, e.prototype.componentDidMount = function() {
      if (!(!this.resizable || !this.window)) {
        var t = this.window.getComputedStyle(this.resizable);
        this.setState({
          width: this.state.width || this.size.width,
          height: this.state.height || this.size.height,
          flexBasis: t.flexBasis !== "auto" ? t.flexBasis : void 0
        });
      }
    }, e.prototype.componentWillUnmount = function() {
      this.window && this.unbindEvents();
    }, e.prototype.createSizeForCssProperty = function(t, i) {
      var n = this.propsSize && this.propsSize[i];
      return this.state[i] === "auto" && this.state.original[i] === t && (typeof n > "u" || n === "auto") ? "auto" : t;
    }, e.prototype.calculateNewMaxFromBoundary = function(t, i) {
      var n = this.props.boundsByDirection, o = this.state.direction, g = n && Iy("left", o), s = n && Iy("top", o), I, r;
      if (this.props.bounds === "parent") {
        var a = this.parentNode;
        a && (I = g ? this.resizableRight - this.parentLeft : a.offsetWidth + (this.parentLeft - this.resizableLeft), r = s ? this.resizableBottom - this.parentTop : a.offsetHeight + (this.parentTop - this.resizableTop));
      } else
        this.props.bounds === "window" ? this.window && (I = g ? this.resizableRight : this.window.innerWidth - this.resizableLeft, r = s ? this.resizableBottom : this.window.innerHeight - this.resizableTop) : this.props.bounds && (I = g ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft), r = s ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop));
      return I && Number.isFinite(I) && (t = t && t < I ? t : I), r && Number.isFinite(r) && (i = i && i < r ? i : r), { maxWidth: t, maxHeight: i };
    }, e.prototype.calculateNewSizeFromDirection = function(t, i) {
      var n = this.props.scale || 1, o = this.props.resizeRatio || 1, g = this.state, s = g.direction, I = g.original, r = this.props, a = r.lockAspectRatio, C = r.lockAspectRatioExtraHeight, B = r.lockAspectRatioExtraWidth, l = I.width, Q = I.height, E = C || 0, d = B || 0;
      return Iy("right", s) && (l = I.width + (t - I.x) * o / n, a && (Q = (l - d) / this.ratio + E)), Iy("left", s) && (l = I.width - (t - I.x) * o / n, a && (Q = (l - d) / this.ratio + E)), Iy("bottom", s) && (Q = I.height + (i - I.y) * o / n, a && (l = (Q - E) * this.ratio + d)), Iy("top", s) && (Q = I.height - (i - I.y) * o / n, a && (l = (Q - E) * this.ratio + d)), { newWidth: l, newHeight: Q };
    }, e.prototype.calculateNewSizeFromAspectRatio = function(t, i, n, o) {
      var g = this.props, s = g.lockAspectRatio, I = g.lockAspectRatioExtraHeight, r = g.lockAspectRatioExtraWidth, a = typeof o.width > "u" ? 10 : o.width, C = typeof n.width > "u" || n.width < 0 ? t : n.width, B = typeof o.height > "u" ? 10 : o.height, l = typeof n.height > "u" || n.height < 0 ? i : n.height, Q = I || 0, E = r || 0;
      if (s) {
        var d = (B - Q) * this.ratio + E, m = (l - Q) * this.ratio + E, y = (a - E) / this.ratio + Q, f = (C - E) / this.ratio + Q, w = Math.max(a, d), G = Math.min(C, m), R = Math.max(B, y), F = Math.min(l, f);
        t = SM(t, w, G), i = SM(i, R, F);
      } else
        t = SM(t, a, C), i = SM(i, B, l);
      return { newWidth: t, newHeight: i };
    }, e.prototype.setBoundingClientRect = function() {
      if (this.props.bounds === "parent") {
        var t = this.parentNode;
        if (t) {
          var i = t.getBoundingClientRect();
          this.parentLeft = i.left, this.parentTop = i.top;
        }
      }
      if (this.props.bounds && typeof this.props.bounds != "string") {
        var n = this.props.bounds.getBoundingClientRect();
        this.targetLeft = n.left, this.targetTop = n.top;
      }
      if (this.resizable) {
        var o = this.resizable.getBoundingClientRect(), g = o.left, s = o.top, I = o.right, r = o.bottom;
        this.resizableLeft = g, this.resizableRight = I, this.resizableTop = s, this.resizableBottom = r;
      }
    }, e.prototype.onResizeStart = function(t, i) {
      if (!(!this.resizable || !this.window)) {
        var n = 0, o = 0;
        if (t.nativeEvent && Xfe(t.nativeEvent) ? (n = t.nativeEvent.clientX, o = t.nativeEvent.clientY) : t.nativeEvent && ZM(t.nativeEvent) && (n = t.nativeEvent.touches[0].clientX, o = t.nativeEvent.touches[0].clientY), this.props.onResizeStart && this.resizable) {
          var g = this.props.onResizeStart(t, i, this.resizable);
          if (g === !1)
            return;
        }
        this.props.size && (typeof this.props.size.height < "u" && this.props.size.height !== this.state.height && this.setState({ height: this.props.size.height }), typeof this.props.size.width < "u" && this.props.size.width !== this.state.width && this.setState({ width: this.props.size.width })), this.ratio = typeof this.props.lockAspectRatio == "number" ? this.props.lockAspectRatio : this.size.width / this.size.height;
        var s, I = this.window.getComputedStyle(this.resizable);
        if (I.flexBasis !== "auto") {
          var r = this.parentNode;
          if (r) {
            var a = this.window.getComputedStyle(r).flexDirection;
            this.flexDir = a.startsWith("row") ? "row" : "column", s = I.flexBasis;
          }
        }
        this.setBoundingClientRect(), this.bindEvents();
        var C = {
          original: {
            x: n,
            y: o,
            width: this.size.width,
            height: this.size.height
          },
          isResizing: !0,
          backgroundStyle: gB(gB({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(t.target).cursor || "auto" }),
          direction: i,
          flexBasis: s
        };
        this.setState(C);
      }
    }, e.prototype.onMouseMove = function(t) {
      var i = this;
      if (!(!this.state.isResizing || !this.resizable || !this.window)) {
        if (this.window.TouchEvent && ZM(t))
          try {
            t.preventDefault(), t.stopPropagation();
          } catch {
          }
        var n = this.props, o = n.maxWidth, g = n.maxHeight, s = n.minWidth, I = n.minHeight, r = ZM(t) ? t.touches[0].clientX : t.clientX, a = ZM(t) ? t.touches[0].clientY : t.clientY, C = this.state, B = C.direction, l = C.original, Q = C.width, E = C.height, d = this.getParentSize(), m = zfe(d, this.window.innerWidth, this.window.innerHeight, o, g, s, I);
        o = m.maxWidth, g = m.maxHeight, s = m.minWidth, I = m.minHeight;
        var y = this.calculateNewSizeFromDirection(r, a), f = y.newHeight, w = y.newWidth, G = this.calculateNewMaxFromBoundary(o, g);
        this.props.snap && this.props.snap.x && (w = $cA(w, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (f = $cA(f, this.props.snap.y, this.props.snapGap));
        var R = this.calculateNewSizeFromAspectRatio(w, f, { width: G.maxWidth, height: G.maxHeight }, { width: s, height: I });
        if (w = R.newWidth, f = R.newHeight, this.props.grid) {
          var F = PcA(w, this.props.grid[0]), Z = PcA(f, this.props.grid[1]), c = this.props.snapGap || 0;
          w = c === 0 || Math.abs(F - w) <= c ? F : w, f = c === 0 || Math.abs(Z - f) <= c ? Z : f;
        }
        var J = {
          width: w - l.width,
          height: f - l.height
        };
        if (Q && typeof Q == "string") {
          if (Q.endsWith("%")) {
            var p = w / d.width * 100;
            w = p + "%";
          } else if (Q.endsWith("vw")) {
            var N = w / this.window.innerWidth * 100;
            w = N + "vw";
          } else if (Q.endsWith("vh")) {
            var v = w / this.window.innerHeight * 100;
            w = v + "vh";
          }
        }
        if (E && typeof E == "string") {
          if (E.endsWith("%")) {
            var p = f / d.height * 100;
            f = p + "%";
          } else if (E.endsWith("vw")) {
            var N = f / this.window.innerWidth * 100;
            f = N + "vw";
          } else if (E.endsWith("vh")) {
            var v = f / this.window.innerHeight * 100;
            f = v + "vh";
          }
        }
        var K = {
          width: this.createSizeForCssProperty(w, "width"),
          height: this.createSizeForCssProperty(f, "height")
        };
        this.flexDir === "row" ? K.flexBasis = K.width : this.flexDir === "column" && (K.flexBasis = K.height), Jt.flushSync(function() {
          i.setState(K);
        }), this.props.onResize && this.props.onResize(t, B, this.resizable, J);
      }
    }, e.prototype.onMouseUp = function(t) {
      var i = this.state, n = i.isResizing, o = i.direction, g = i.original;
      if (!(!n || !this.resizable)) {
        var s = {
          width: this.size.width - g.width,
          height: this.size.height - g.height
        };
        this.props.onResizeStop && this.props.onResizeStop(t, o, this.resizable, s), this.props.size && this.setState(this.props.size), this.unbindEvents(), this.setState({
          isResizing: !1,
          backgroundStyle: gB(gB({}, this.state.backgroundStyle), { cursor: "auto" })
        });
      }
    }, e.prototype.updateSize = function(t) {
      this.setState({ width: t.width, height: t.height });
    }, e.prototype.renderResizer = function() {
      var t = this, i = this.props, n = i.enable, o = i.handleStyles, g = i.handleClasses, s = i.handleWrapperStyle, I = i.handleWrapperClass, r = i.handleComponent;
      if (!n)
        return null;
      var a = Object.keys(n).map(function(C) {
        return n[C] !== !1 ? u.createElement(Kfe, { key: C, direction: C, onResizeStart: t.onResizeStart, replaceStyles: o && o[C], className: g && g[C] }, r && r[C] ? r[C] : null) : null;
      });
      return u.createElement("div", { className: I, style: s }, a);
    }, e.prototype.render = function() {
      var t = this, i = Object.keys(this.props).reduce(function(g, s) {
        return Tfe.indexOf(s) !== -1 || (g[s] = t.props[s]), g;
      }, {}), n = gB(gB(gB({ position: "relative", userSelect: this.state.isResizing ? "none" : "auto" }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: "border-box", flexShrink: 0 });
      this.state.flexBasis && (n.flexBasis = this.state.flexBasis);
      var o = this.props.as || "div";
      return u.createElement(
        o,
        gB({ ref: this.ref, style: n, className: this.props.className }, i),
        this.state.isResizing && u.createElement("div", { style: this.state.backgroundStyle }),
        this.props.children,
        this.renderResizer()
      );
    }, e.defaultProps = {
      as: "div",
      onResizeStart: function() {
      },
      onResize: function() {
      },
      onResizeStop: function() {
      },
      enable: {
        top: !0,
        right: !0,
        bottom: !0,
        left: !0,
        topRight: !0,
        bottomRight: !0,
        bottomLeft: !0,
        topLeft: !0
      },
      style: {},
      grid: [1, 1],
      lockAspectRatio: !1,
      lockAspectRatioExtraWidth: 0,
      lockAspectRatioExtraHeight: 0,
      scale: 1,
      resizeRatio: 1,
      snapGap: 0
    }, e;
  }(u.PureComponent)
);
const i1A = " ", eQA = typeof window < "u" && window.Blob && new Blob([atob(i1A)], { type: "text/javascript;charset=utf-8" });
function qfe() {
  let A;
  try {
    if (A = eQA && (window.URL || window.webkitURL).createObjectURL(eQA), !A)
      throw "";
    return new Worker(A);
  } catch {
    return new Worker("data:application/javascript;base64," + i1A);
  } finally {
    A && (window.URL || window.webkitURL).revokeObjectURL(A);
  }
}
const n1A = " ", tQA = typeof window < "u" && window.Blob && new Blob([atob(n1A)], { type: "text/javascript;charset=utf-8" });
function Ofe() {
  let A;
  try {
    if (A = tQA && (window.URL || window.webkitURL).createObjectURL(tQA), !A)
      throw "";
    return new Worker(A);
  } catch {
    return new Worker("data:application/javascript;base64," + n1A);
  } finally {
    A && (window.URL || window.webkitURL).revokeObjectURL(A);
  }
}
const o1A = " ", iQA = typeof window < "u" && window.Blob && new Blob([atob(o1A)], { type: "text/javascript;charset=utf-8" });
function jfe() {
  let A;
  try {
    if (A = iQA && (window.URL || window.webkitURL).createObjectURL(iQA), !A)
      throw "";
    return new Worker(A);
  } catch {
    return new Worker("data:application/javascript;base64," + o1A);
  } finally {
    A && (window.URL || window.webkitURL).revokeObjectURL(A);
  }
}
const g1A = " ", nQA = typeof window < "u" && window.Blob && new Blob([atob(g1A)], { type: "text/javascript;charset=utf-8" });
function Pfe() {
  let A;
  try {
    if (A = nQA && (window.URL || window.webkitURL).createObjectURL(nQA), !A)
      throw "";
    return new Worker(A);
  } catch {
    return new Worker("data:application/javascript;base64," + g1A);
  } finally {
    A && (window.URL || window.webkitURL).revokeObjectURL(A);
  }
}
const s1A = " ", oQA = typeof window < "u" && window.Blob && new Blob([atob(s1A)], { type: "text/javascript;charset=utf-8" });
function $fe() {
  let A;
  try {
    if (A = oQA && (window.URL || window.webkitURL).createObjectURL(oQA), !A)
      throw "";
    return new Worker(A);
  } catch {
    return new Worker("data:application/javascript;base64," + s1A);
  } finally {
    A && (window.URL || window.webkitURL).revokeObjectURL(A);
  }
}
function eF(A, e) {
  return new Promise((t, i) => {
    A.postMessage(e), A.onmessage = (n) => {
      typeof n.data == "string" && i({
        success: !1,
        message: n.data
      }), t(n.data);
    }, A.onerror = (n) => {
      i({
        success: !1,
        message: n
      });
    };
  });
}
const ADe = async (A, e) => {
  if (e.length === 0)
    return A;
  const t = new qfe();
  try {
    return await eF(t, {
      dataSource: A,
      filters: e
    });
  } catch (i) {
    throw new Error(i.message);
  } finally {
    t.terminate();
  }
}, eDe = async (A, e) => {
  if (A.length === 0)
    return A;
  const t = new Ofe();
  try {
    return await eF(t, {
      dataSource: A,
      trans: e
    });
  } catch (i) {
    throw new Error(i.message);
  } finally {
    t.terminate();
  }
}, tDe = async (A, e) => {
  const t = new jfe();
  try {
    return await eF(t, {
      dataSource: A,
      query: e
    });
  } catch (i) {
    throw new Error(i.message);
  } finally {
    t.terminate();
  }
}, iDe = async (A, e, t, i, n, o, g) => {
  const s = new Pfe();
  try {
    return await eF(s, {
      dimsInRow: A,
      dimsInColumn: e,
      allData: t,
      aggData: i,
      collapsedKeyList: n,
      showTableSummary: o,
      sort: g
    });
  } catch (I) {
    throw new Error("Uncaught error in TableBuilderDataWorker", { cause: I });
  } finally {
    s.terminate();
  }
}, nDe = async (A, e, t) => {
  const i = new $fe();
  try {
    return await eF(i, {
      data: A,
      viewMeasures: e,
      sort: t
    });
  } catch (n) {
    throw new Error("Uncaught error in ViewQueryWorker", { cause: n });
  } finally {
    i.terminate();
  }
}, I1A = u.createContext(null), SD = () => {
  const A = u.useContext(I1A);
  return A && "current" in A ? A : {
    current: null
  };
}, S3 = u.forwardRef(({ children: A }, e) => (u.useImperativeHandle(e, () => {
  let t = "idle", i = [];
  return {
    get renderStatus() {
      return t;
    },
    onRenderStatusChange: (n) => (i.push(n), () => {
      i = i.filter((o) => o !== n);
    }),
    updateRenderStatus: (n) => {
      t !== n && (t = n, i.forEach((o) => o(t)));
    },
    chartCount: 1,
    chartIndex: 0,
    openChart() {
    },
    exportChart: async (n = "svg") => ({
      mode: n,
      title: "",
      nCols: 0,
      nRows: 0,
      charts: [],
      container: () => null
    }),
    exportChartList: async function* (n = "svg") {
      yield {
        mode: n,
        total: 1,
        completed: 0,
        index: 0,
        data: {
          mode: n,
          title: "",
          nCols: 0,
          nRows: 0,
          charts: [],
          container: () => null
        },
        hasNext: !1
      };
    }
  };
}, []), b.createElement(I1A.Provider, { value: e }, A))), oDe = (A) => (e) => b.createElement(
  S3,
  null,
  b.createElement(A, { ...e })
);
function a1A(A) {
  return A.isCollapsed || A.children.length === 0 ? 1 : A.children.map(a1A).reduce((e, t) => e + t, 0);
}
function r1A(A, e, t, i, n, o, g, s) {
  const I = a1A(A), { isCollapsed: r } = A;
  if (t > e.length)
    return;
  const a = t > 0 ? e[t - 1] : void 0, C = (a == null ? void 0 : a.semanticType) === "temporal" ? (B) => CQ(Uu(s, a.offset)(B)) : (B) => `${B}`;
  if (i[i.length - 1].push(b.createElement(
    "td",
    { key: `${t}-${A.fieldKey}-${A.value}`, className: "bg-secondary text-secondary-foreground align-top whitespace-nowrap p-2 text-xs m-1 border", colSpan: r ? A.height + 1 : 1, rowSpan: r ? Math.max(n, 1) : I * Math.max(n, 1) },
    b.createElement(
      "div",
      { className: "flex" },
      b.createElement("div", null, C(A.value)),
      A.height > 0 && A.key !== "__total" && g && b.createElement(
        b.Fragment,
        null,
        r && b.createElement(yYA, { className: "w-3 ml-1 self-center cursor-pointer", onClick: () => o(A) }),
        !r && b.createElement(pYA, { className: "w-3 ml-1 self-center cursor-pointer", onClick: () => o(A) })
      )
    )
  )), !r)
    for (let B = 0; B < A.children.length; B++) {
      const l = A.children[B];
      r1A(l, e, t + 1, i, n, o, g), B < A.children.length - 1 && i.push([]);
    }
}
const gDe = (A) => {
  const { data: e, dimsInRow: t, measInRow: i, onHeaderCollapse: n } = A, o = u.useMemo(() => {
    const g = [[]];
    if (r1A(e, t, 0, g, i.length, n, A.enableCollapse, A.displayOffset), g[0].shift(), i.length > 0) {
      const s = [];
      for (let I of g) {
        s.push([
          ...I,
          b.createElement(
            "td",
            { key: `0-${i[0].fid}-${i[0].aggName}`, className: "bg-secondary text-secondary-foreground whitespace-nowrap p-2 text-xs m-1 border" },
            i[0].aggName,
            "(",
            i[0].name,
            ")"
          )
        ]);
        for (let r = 1; r < i.length; r++)
          s.push([
            b.createElement(
              "td",
              { key: `${r}-${i[r].fid}-${i[r].aggName}`, className: "bg-secondary text-secondary-foreground whitespace-nowrap p-2 text-xs m-1 border" },
              i[r].aggName,
              "(",
              i[r].name,
              ")"
            )
          ]);
      }
      return s;
    }
    return g;
  }, [e, t, i]);
  return b.createElement("thead", { className: "bg-secondary border" }, o.map((g, s) => b.createElement("tr", { className: "border", key: s }, g)));
}, sDe = gDe;
function SAA(A) {
  return A.isCollapsed || A.children.length === 0 ? 1 : A.children.map(SAA).reduce((e, t) => e + t, 0);
}
function C1A(A, e, t, i, n, o, g, s) {
  const I = SAA(A), { isCollapsed: r } = A;
  if (t > e.length)
    return;
  const a = t > 0 ? e[t - 1] : void 0, C = (a == null ? void 0 : a.semanticType) === "temporal" ? (B) => CQ(Uu(s, a.offset)(B)) : (B) => `${B}`;
  if (i[t].push(b.createElement(
    "td",
    { key: `${t}-${A.fieldKey}-${A.value}-${i[t].length}`, className: "bg-secondary text-secondary-foreground align-top whitespace-nowrap p-2 text-xs m-1 border", colSpan: r ? Math.max(n, 1) : I * Math.max(n, 1), rowSpan: r ? A.height + 1 : 1 },
    b.createElement(
      "div",
      { className: "flex" },
      b.createElement("div", null, C(A.value)),
      A.height > 0 && A.key !== "__total" && g && b.createElement(
        b.Fragment,
        null,
        r && b.createElement(yYA, { className: "w-3 ml-1 self-center cursor-pointer", onClick: () => o(A) }),
        !r && b.createElement(pYA, { className: "w-3 ml-1 self-center cursor-pointer", onClick: () => o(A) })
      )
    )
  )), !r)
    for (let B = 0; B < A.children.length; B++) {
      const l = A.children[B];
      C1A(l, e, t + 1, i, n, o, g, s);
    }
}
const IDe = (A) => {
  const { data: e, dimsInCol: t, measInCol: i, onHeaderCollapse: n, onTopTreeHeaderRowNumChange: o } = A, g = u.useMemo(() => {
    const s = new Array(t.length + 1).fill(0).map(() => []);
    C1A(e, t, 0, s, i.length, n, A.enableCollapse, A.displayOffset);
    const I = SAA(e);
    return s.forEach((r, a) => {
      const C = r.map((B) => b.isValidElement(B) ? B.props.rowSpan : 0);
      C.length > 0 && C[0] > 1 && C.every((B) => B === C[0]) && r.forEach((B, l) => {
        if (b.isValidElement(B)) {
          const Q = b.cloneElement(B, { ...B.props, rowSpan: 1 });
          s[a][l] = Q;
        }
      });
    }), s.push(new Array(I).fill(0).flatMap((r, a) => i.map((C) => b.createElement(
      "td",
      { key: `${s.length}-${C.fid}-${C.aggName}-${a}`, className: "bg-secondary text-secondary-foreground whitespace-nowrap p-2 text-xs m-1 border" },
      C.aggName,
      "(",
      C.name,
      ")"
    )))), s.shift(), s;
  }, [e, t, i]);
  return u.useEffect(() => {
    o(g.filter((s) => s.length > 0).length);
  }, [g]), b.createElement("thead", { className: "border bg-secondary" }, g.map((s, I) => b.createElement("tr", { className: `${(s == null ? void 0 : s.length) > 0 ? "" : "hidden"} border`, key: I }, s)));
}, aDe = IDe;
function rDe(A) {
  return Math.abs(A = Math.round(A)) >= 1e21 ? A.toLocaleString("en").replace(/,/g, "") : A.toString(10);
}
function tS(A, e) {
  if ((t = (A = e ? A.toExponential(e - 1) : A.toExponential()).indexOf("e")) < 0)
    return null;
  var t, i = A.slice(0, t);
  return [
    i.length > 1 ? i[0] + i.slice(2) : i,
    +A.slice(t + 1)
  ];
}
function lf(A) {
  return A = tS(Math.abs(A)), A ? A[1] : NaN;
}
function CDe(A, e) {
  return function(t, i) {
    for (var n = t.length, o = [], g = 0, s = A[0], I = 0; n > 0 && s > 0 && (I + s + 1 > i && (s = Math.max(1, i - I)), o.push(t.substring(n -= s, n + s)), !((I += s + 1) > i)); )
      s = A[g = (g + 1) % A.length];
    return o.reverse().join(e);
  };
}
function BDe(A) {
  return function(e) {
    return e.replace(/[0-9]/g, function(t) {
      return A[+t];
    });
  };
}
var lDe = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
function ap(A) {
  if (!(e = lDe.exec(A)))
    throw new Error("invalid format: " + A);
  var e;
  return new ZAA({
    fill: e[1],
    align: e[2],
    sign: e[3],
    symbol: e[4],
    zero: e[5],
    width: e[6],
    comma: e[7],
    precision: e[8] && e[8].slice(1),
    trim: e[9],
    type: e[10]
  });
}
ap.prototype = ZAA.prototype;
function ZAA(A) {
  this.fill = A.fill === void 0 ? " " : A.fill + "", this.align = A.align === void 0 ? ">" : A.align + "", this.sign = A.sign === void 0 ? "-" : A.sign + "", this.symbol = A.symbol === void 0 ? "" : A.symbol + "", this.zero = !!A.zero, this.width = A.width === void 0 ? void 0 : +A.width, this.comma = !!A.comma, this.precision = A.precision === void 0 ? void 0 : +A.precision, this.trim = !!A.trim, this.type = A.type === void 0 ? "" : A.type + "";
}
ZAA.prototype.toString = function() {
  return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
};
function cDe(A) {
  A:
    for (var e = A.length, t = 1, i = -1, n; t < e; ++t)
      switch (A[t]) {
        case ".":
          i = n = t;
          break;
        case "0":
          i === 0 && (i = t), n = t;
          break;
        default:
          if (!+A[t])
            break A;
          i > 0 && (i = 0);
          break;
      }
  return i > 0 ? A.slice(0, i) + A.slice(n + 1) : A;
}
var B1A;
function QDe(A, e) {
  var t = tS(A, e);
  if (!t)
    return A + "";
  var i = t[0], n = t[1], o = n - (B1A = Math.max(-8, Math.min(8, Math.floor(n / 3))) * 3) + 1, g = i.length;
  return o === g ? i : o > g ? i + new Array(o - g + 1).join("0") : o > 0 ? i.slice(0, o) + "." + i.slice(o) : "0." + new Array(1 - o).join("0") + tS(A, Math.max(0, e + o - 1))[0];
}
function gQA(A, e) {
  var t = tS(A, e);
  if (!t)
    return A + "";
  var i = t[0], n = t[1];
  return n < 0 ? "0." + new Array(-n).join("0") + i : i.length > n + 1 ? i.slice(0, n + 1) + "." + i.slice(n + 1) : i + new Array(n - i.length + 2).join("0");
}
const sQA = {
  "%": (A, e) => (A * 100).toFixed(e),
  b: (A) => Math.round(A).toString(2),
  c: (A) => A + "",
  d: rDe,
  e: (A, e) => A.toExponential(e),
  f: (A, e) => A.toFixed(e),
  g: (A, e) => A.toPrecision(e),
  o: (A) => Math.round(A).toString(8),
  p: (A, e) => gQA(A * 100, e),
  r: gQA,
  s: QDe,
  X: (A) => Math.round(A).toString(16).toUpperCase(),
  x: (A) => Math.round(A).toString(16)
};
function IQA(A) {
  return A;
}
var aQA = Array.prototype.map, rQA = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
function l1A(A) {
  var e = A.grouping === void 0 || A.thousands === void 0 ? IQA : CDe(aQA.call(A.grouping, Number), A.thousands + ""), t = A.currency === void 0 ? "" : A.currency[0] + "", i = A.currency === void 0 ? "" : A.currency[1] + "", n = A.decimal === void 0 ? "." : A.decimal + "", o = A.numerals === void 0 ? IQA : BDe(aQA.call(A.numerals, String)), g = A.percent === void 0 ? "%" : A.percent + "", s = A.minus === void 0 ? "−" : A.minus + "", I = A.nan === void 0 ? "NaN" : A.nan + "";
  function r(C) {
    C = ap(C);
    var B = C.fill, l = C.align, Q = C.sign, E = C.symbol, d = C.zero, m = C.width, y = C.comma, f = C.precision, w = C.trim, G = C.type;
    G === "n" ? (y = !0, G = "g") : sQA[G] || (f === void 0 && (f = 12), w = !0, G = "g"), (d || B === "0" && l === "=") && (d = !0, B = "0", l = "=");
    var R = E === "$" ? t : E === "#" && /[boxX]/.test(G) ? "0" + G.toLowerCase() : "", F = E === "$" ? i : /[%p]/.test(G) ? g : "", Z = sQA[G], c = /[defgprs%]/.test(G);
    f = f === void 0 ? 6 : /[gprs]/.test(G) ? Math.max(1, Math.min(21, f)) : Math.max(0, Math.min(20, f));
    function J(p) {
      var N = R, v = F, K, U, j;
      if (G === "c")
        v = Z(p) + v, p = "";
      else {
        p = +p;
        var q = p < 0 || 1 / p < 0;
        if (p = isNaN(p) ? I : Z(Math.abs(p), f), w && (p = cDe(p)), q && +p == 0 && Q !== "+" && (q = !1), N = (q ? Q === "(" ? Q : s : Q === "-" || Q === "(" ? "" : Q) + N, v = (G === "s" ? rQA[8 + B1A / 3] : "") + v + (q && Q === "(" ? ")" : ""), c) {
          for (K = -1, U = p.length; ++K < U; )
            if (j = p.charCodeAt(K), 48 > j || j > 57) {
              v = (j === 46 ? n + p.slice(K + 1) : p.slice(K)) + v, p = p.slice(0, K);
              break;
            }
        }
      }
      y && !d && (p = e(p, 1 / 0));
      var O = N.length + p.length + v.length, $ = O < m ? new Array(m - O + 1).join(B) : "";
      switch (y && d && (p = e($ + p, $.length ? m - v.length : 1 / 0), $ = ""), l) {
        case "<":
          p = N + p + v + $;
          break;
        case "=":
          p = N + $ + p + v;
          break;
        case "^":
          p = $.slice(0, O = $.length >> 1) + N + p + v + $.slice(O);
          break;
        default:
          p = $ + N + p + v;
          break;
      }
      return o(p);
    }
    return J.toString = function() {
      return C + "";
    }, J;
  }
  function a(C, B) {
    var l = r((C = ap(C), C.type = "f", C)), Q = Math.max(-8, Math.min(8, Math.floor(lf(B) / 3))) * 3, E = Math.pow(10, -Q), d = rQA[8 + Q / 3];
    return function(m) {
      return l(E * m) + d;
    };
  }
  return {
    format: r,
    formatPrefix: a
  };
}
var KM, Ld, WAA;
EDe({
  thousands: ",",
  grouping: [3],
  currency: ["$", ""]
});
function EDe(A) {
  return KM = l1A(A), Ld = KM.format, WAA = KM.formatPrefix, KM;
}
function c1A(A) {
  return Math.max(0, -lf(Math.abs(A)));
}
function Q1A(A, e) {
  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(lf(e) / 3))) * 3 - lf(Math.abs(A)));
}
function E1A(A, e) {
  return A = Math.abs(A), e = Math.abs(e) - A, Math.max(0, lf(e) - lf(A)) + 1;
}
function ay(A, e, t) {
  const i = io(e.fid, e.aggName);
  return A[i] === void 0 ? "--" : t(A[i]);
}
const uDe = b.memo((A) => {
  const { matrix: e, meaInRows: t, meaInColumns: i, numberFormat: n } = A, o = u.useMemo(() => {
    const g = n ? Ld(n) : (s) => s.toLocaleString();
    return (s) => typeof s != "number" ? `${s}` : g(s);
  }, [n]);
  return b.createElement("tbody", { className: "bg-background text-foreground border-r border-b" }, e.map((g, s) => t.length !== 0 ? t.map((I, r) => b.createElement("tr", { className: "divide-x divide-border", key: `${s}-${I.fid}-${I.aggName}` }, g.flatMap((a, C) => (a = a ?? {}, i.length !== 0 ? i.map((B, l) => b.createElement(
    "td",
    { className: "whitespace-nowrap p-2 text-xs", key: `${s}-${C}-${I.fid}-${I.aggName}-${B.fid}-${B.aggName}` },
    ay(a, I, o),
    " , ",
    ay(a, B, o)
  )) : b.createElement("td", { className: "whitespace-nowrap p-2 text-xs", key: `${s}-${C}-${I.fid}-${I.aggName}` }, ay(a, I, o)))))) : b.createElement("tr", { className: "divide-x divide-border", key: s }, g.flatMap((I, r) => (I = I ?? {}, t.length === 0 && i.length !== 0 ? i.map((a, C) => b.createElement("td", { className: "whitespace-nowrap p-2 text-xs", key: `${s}-${r}-${C}-${a.fid}-${a.aggName}` }, ay(I, a, o))) : t.length === 0 && i.length === 0 ? b.createElement("td", { className: "whitespace-nowrap p-2 text-xs", key: `${s}-${r}` }, "True") : t.flatMap((a, C) => b.createElement("td", { className: "whitespace-nowrap p-2 text-xs", key: `${s}-${r}-${C}-${a.fid}-${a.aggName}` }, i.flatMap((B, l) => b.createElement(
    "td",
    { className: "whitespace-nowrap p-2 text-xs", key: `${s}-${r}-${C}-${l}-${B.fid}-${B.aggName}` },
    ay(I, a, o),
    " , ",
    ay(I, B, o)
  )))))))));
}, function(A, e) {
  return JSON.stringify(A.matrix) === JSON.stringify(e.matrix) && A.numberFormat === e.numberFormat;
}), dDe = uDe;
function KAA(A) {
  const e = A.className;
  return b.createElement(
    "svg",
    { className: `animate-spin ${e}`, viewBox: "0 0 24 24" },
    b.createElement("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
    b.createElement("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
  );
}
function Ts() {
  return b.createElement(
    "div",
    { className: "bg-black/10 opacity-50 absolute top-0 left-0 right-0 bottom-0 z-50 flex items-center justify-center" },
    b.createElement(KAA, { className: "text-primary w-4 h-4 mr-2" }),
    b.createElement("span", { className: "text-sm text-primary" }, "Loading...")
  );
}
const hDe = function(A) {
  const { data: e, visualConfig: t, layout: i, draggableFieldState: n } = A, o = sg(), g = SD(), [s, I] = u.useState(null), [r, a] = u.useState(null), [C, B] = u.useState([]), [l, Q] = u.useState(!1), E = !A.disableCollapse, [d, m] = u.useState({}), y = u.useCallback(($) => {
    const { uniqueKey: _, height: tA } = $;
    tA < 1 || m((nA) => {
      const AA = { ...nA };
      return Object.entries(AA).forEach(([gA, rA]) => {
        gA.startsWith(_) && gA.length > _.length && delete AA[gA];
      }), AA[_] ? delete AA[_] : AA[_] = $.path, AA;
    });
  }, []), { rows: f, columns: w } = n, { defaultAggregated: G, folds: R } = t, { showTableSummary: F } = i, Z = u.useRef([]), [c, J] = u.useState(0), p = u.useMemo(() => f.filter(($) => $.analyticType === "dimension"), [f]), N = u.useMemo(() => w.filter(($) => $.analyticType === "dimension"), [w]), v = u.useMemo(() => f.filter(($) => $.analyticType === "measure"), [f]), K = u.useMemo(() => w.filter(($) => $.analyticType === "measure"), [w]);
  u.useEffect(() => {
    if (!E) {
      j();
      return;
    }
    Object.keys(d).length > 0 ? (m({}), F && O()) : U();
  }, [e, E]), u.useEffect(() => {
    !E || F ? j() : U();
  }, [E, d]), u.useEffect(() => {
    U();
  }, [F]);
  const U = async () => {
    await O(), j();
  }, j = () => {
    var $;
    ($ = g.current) == null || $.updateRenderStatus("rendering"), Q(!0);
    const _ = gf(n), tA = _YA(n);
    iDe(p, N, e, Z.current, Object.keys(d), F, _ !== "none" && tA !== "none" ? {
      fid: tA === "column" ? `${v[0].fid}_${v[0].aggName}` : `${K[0].fid}_${K[0].aggName}`,
      mode: tA,
      type: _
    } : void 0).then((nA) => {
      var AA;
      const { lt: gA, tt: rA, metric: sA } = nA;
      Jt.unstable_batchedUpdates(() => {
        I(gA), a(rA), B(sA);
      }), (AA = g.current) == null || AA.updateRenderStatus("idle"), Q(!1);
    }).catch((nA) => {
      var AA;
      (AA = g.current) == null || AA.updateRenderStatus("error"), console.log(nA), Q(!1);
    });
  }, q = u.useRef([]), O = () => {
    var $;
    if (p.length === 0 && N.length === 0 || e.length === 0)
      return;
    let _ = [], tA = [];
    if (F)
      _ = p.map((gA, rA) => p.slice(0, rA)), tA = N.map((gA, rA) => N.slice(0, rA));
    else {
      const gA = Object.entries(d).map(([lA, cA]) => cA[cA.length - 1].key), rA = p.filter((lA) => gA.includes(lA.fid)), sA = N.filter((lA) => gA.includes(lA.fid));
      _ = rA.map((lA) => p.slice(0, p.indexOf(lA) + 1)), tA = sA.map((lA) => N.slice(0, N.indexOf(lA) + 1));
    }
    _.push(p), tA.push(N);
    const nA = tA.flatMap((gA) => _.map((rA) => [...gA, ...rA])).slice(0, -1);
    if (q.current.length === nA.length && q.current.every((gA, rA) => gA.length === nA[rA].length && gA.every((sA, lA) => OI(sA) === OI(nA[rA][lA]))))
      return;
    q.current = nA, Q(!0), ($ = g.current) == null || $.updateRenderStatus("computing");
    const AA = nA.map((gA) => {
      const rA = n.filters, sA = m2A(n), lA = p2A(n, "table").filter((EA) => EA.analyticType === "measure"), cA = gf(n), { limit: aA } = t, { timezoneDisplayOffset: QA } = t, hA = Vu(rA, sA, gA, lA, G, cA, R ?? [], aA > 0 ? aA : void 0, QA);
      return AS(o, hA, aA > 0 ? aA : void 0).then((EA) => Q2A(EA, G, sA, lA, gA, R)).catch((EA) => {
        var RA;
        return (RA = g.current) == null || RA.updateRenderStatus("error"), [];
      });
    });
    return new Promise((gA, rA) => {
      Promise.all(AA).then((sA) => {
        Q(!1);
        const lA = [...sA.flat()];
        Z.current = lA, gA();
      }).catch((sA) => {
        console.error(sA), Q(!1), rA();
      });
    });
  };
  return b.createElement(
    "div",
    { className: "relative" },
    l && b.createElement(Ts, null),
    b.createElement(
      "div",
      { className: "flex" },
      b.createElement(
        "table",
        { className: "border border-collapse" },
        b.createElement(
          "thead",
          { className: "border" },
          new Array(Math.max(c - 1, 0)).fill(0).map(($, _) => b.createElement(
            "tr",
            { className: "", key: _ },
            b.createElement("td", { className: "bg-secondary text-secondary-foreground p-2 m-1 text-xs border", colSpan: p.length + (v.length > 0 ? 1 : 0) }, "_")
          )),
          c > 0 && b.createElement(
            "tr",
            { className: "" },
            p.map(($) => b.createElement("td", { className: "bg-secondary text-secondary-foreground p-2 m-1 text-xs border whitespace-nowrap", colSpan: 1 }, $.name)),
            v.length > 0 && b.createElement("td", { className: "bg-secondary text-secondary-foreground p-2 m-1 text-xs border", colSpan: 1 }, "_")
          )
        ),
        s && b.createElement(sDe, { data: s, dimsInRow: p, measInRow: v, onHeaderCollapse: ($) => y($), enableCollapse: E, displayOffset: t.timezoneDisplayOffset })
      ),
      b.createElement(
        "table",
        { className: "border border-collapse" },
        r && b.createElement(aDe, { data: r, dimsInCol: N, measInCol: K, onHeaderCollapse: ($) => y($), onTopTreeHeaderRowNumChange: ($) => J($), enableCollapse: E, displayOffset: t.timezoneDisplayOffset }),
        C && b.createElement(dDe, { matrix: C, meaInColumns: K, meaInRows: v, numberFormat: i.format.numberFormat || "" })
      )
    )
  );
}, mDe = hDe;
function u1A(A, e) {
  const t = u.useRef(e);
  u.useEffect(function() {
    e !== t.current && A.attributionControl != null && (t.current != null && A.attributionControl.removeAttribution(t.current), e != null && A.attributionControl.addAttribution(e)), t.current = e;
  }, [
    A,
    e
  ]);
}
function pDe(A, e, t) {
  e.center !== t.center && A.setLatLng(e.center), e.radius != null && e.radius !== t.radius && A.setRadius(e.radius);
}
const yDe = 1;
function bDe(A) {
  return Object.freeze({
    __version: yDe,
    map: A
  });
}
function Z3(A, e) {
  return Object.freeze({
    ...A,
    ...e
  });
}
const d1A = u.createContext(null), h1A = d1A.Provider;
function tF() {
  const A = u.useContext(d1A);
  if (A == null)
    throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");
  return A;
}
function m1A(A) {
  function e(t, i) {
    const { instance: n, context: o } = A(t).current;
    return u.useImperativeHandle(i, () => n), t.children == null ? null : /* @__PURE__ */ b.createElement(h1A, {
      value: o
    }, t.children);
  }
  return /* @__PURE__ */ u.forwardRef(e);
}
function wDe(A) {
  function e(t, i) {
    const [n, o] = u.useState(!1), { instance: g } = A(t, o).current;
    u.useImperativeHandle(i, () => g), u.useEffect(function() {
      n && g.update();
    }, [
      g,
      n,
      t.children
    ]);
    const s = g._contentNode;
    return s ? /* @__PURE__ */ Jt.createPortal(t.children, s) : null;
  }
  return /* @__PURE__ */ u.forwardRef(e);
}
function p1A(A) {
  function e(t, i) {
    const { instance: n } = A(t).current;
    return u.useImperativeHandle(i, () => n), null;
  }
  return /* @__PURE__ */ u.forwardRef(e);
}
function fDe(A) {
  return function(e) {
    const t = tF(), i = A(e, t), { instance: n } = i.current, o = u.useRef(e.position), { position: g } = e;
    return u.useEffect(function() {
      return n.addTo(t.map), function() {
        n.remove();
      };
    }, [
      t.map,
      n
    ]), u.useEffect(function() {
      g != null && g !== o.current && (n.setPosition(g), o.current = g);
    }, [
      n,
      g
    ]), i;
  };
}
function UAA(A, e) {
  const t = u.useRef();
  u.useEffect(function() {
    return e != null && A.instance.on(e), t.current = e, function() {
      t.current != null && A.instance.off(t.current), t.current = null;
    };
  }, [
    A,
    e
  ]);
}
function W3(A, e) {
  const t = A.pane ?? e.pane;
  return t ? {
    ...A,
    pane: t
  } : A;
}
function DDe(A, e) {
  return function(t, i) {
    const n = tF(), o = A(W3(t, n), n);
    return u1A(n.map, t.attribution), UAA(o.current, t.eventHandlers), e(o.current, n, t, i), o;
  };
}
var BO = { exports: {} };
/* @preserve
 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
 */
(function(A, e) {
  (function(t, i) {
    i(e);
  })(qE, function(t) {
    var i = "1.9.4";
    function n(h) {
      var k, x, V, eA;
      for (x = 1, V = arguments.length; x < V; x++) {
        eA = arguments[x];
        for (k in eA)
          h[k] = eA[k];
      }
      return h;
    }
    var o = Object.create || function() {
      function h() {
      }
      return function(k) {
        return h.prototype = k, new h();
      };
    }();
    function g(h, k) {
      var x = Array.prototype.slice;
      if (h.bind)
        return h.bind.apply(h, x.call(arguments, 1));
      var V = x.call(arguments, 2);
      return function() {
        return h.apply(k, V.length ? V.concat(x.call(arguments)) : arguments);
      };
    }
    var s = 0;
    function I(h) {
      return "_leaflet_id" in h || (h._leaflet_id = ++s), h._leaflet_id;
    }
    function r(h, k, x) {
      var V, eA, IA, mA;
      return mA = function() {
        V = !1, eA && (IA.apply(x, eA), eA = !1);
      }, IA = function() {
        V ? eA = arguments : (h.apply(x, arguments), setTimeout(mA, k), V = !0);
      }, IA;
    }
    function a(h, k, x) {
      var V = k[1], eA = k[0], IA = V - eA;
      return h === V && x ? h : ((h - eA) % IA + IA) % IA + eA;
    }
    function C() {
      return !1;
    }
    function B(h, k) {
      if (k === !1)
        return h;
      var x = Math.pow(10, k === void 0 ? 6 : k);
      return Math.round(h * x) / x;
    }
    function l(h) {
      return h.trim ? h.trim() : h.replace(/^\s+|\s+$/g, "");
    }
    function Q(h) {
      return l(h).split(/\s+/);
    }
    function E(h, k) {
      Object.prototype.hasOwnProperty.call(h, "options") || (h.options = h.options ? o(h.options) : {});
      for (var x in k)
        h.options[x] = k[x];
      return h.options;
    }
    function d(h, k, x) {
      var V = [];
      for (var eA in h)
        V.push(encodeURIComponent(x ? eA.toUpperCase() : eA) + "=" + encodeURIComponent(h[eA]));
      return (!k || k.indexOf("?") === -1 ? "?" : "&") + V.join("&");
    }
    var m = /\{ *([\w_ -]+) *\}/g;
    function y(h, k) {
      return h.replace(m, function(x, V) {
        var eA = k[V];
        if (eA === void 0)
          throw new Error("No value provided for variable " + x);
        return typeof eA == "function" && (eA = eA(k)), eA;
      });
    }
    var f = Array.isArray || function(h) {
      return Object.prototype.toString.call(h) === "[object Array]";
    };
    function w(h, k) {
      for (var x = 0; x < h.length; x++)
        if (h[x] === k)
          return x;
      return -1;
    }
    var G = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
    function R(h) {
      return window["webkit" + h] || window["moz" + h] || window["ms" + h];
    }
    var F = 0;
    function Z(h) {
      var k = +/* @__PURE__ */ new Date(), x = Math.max(0, 16 - (k - F));
      return F = k + x, window.setTimeout(h, x);
    }
    var c = window.requestAnimationFrame || R("RequestAnimationFrame") || Z, J = window.cancelAnimationFrame || R("CancelAnimationFrame") || R("CancelRequestAnimationFrame") || function(h) {
      window.clearTimeout(h);
    };
    function p(h, k, x) {
      if (x && c === Z)
        h.call(k);
      else
        return c.call(window, g(h, k));
    }
    function N(h) {
      h && J.call(window, h);
    }
    var v = {
      __proto__: null,
      extend: n,
      create: o,
      bind: g,
      get lastId() {
        return s;
      },
      stamp: I,
      throttle: r,
      wrapNum: a,
      falseFn: C,
      formatNum: B,
      trim: l,
      splitWords: Q,
      setOptions: E,
      getParamString: d,
      template: y,
      isArray: f,
      indexOf: w,
      emptyImageUrl: G,
      requestFn: c,
      cancelFn: J,
      requestAnimFrame: p,
      cancelAnimFrame: N
    };
    function K() {
    }
    K.extend = function(h) {
      var k = function() {
        E(this), this.initialize && this.initialize.apply(this, arguments), this.callInitHooks();
      }, x = k.__super__ = this.prototype, V = o(x);
      V.constructor = k, k.prototype = V;
      for (var eA in this)
        Object.prototype.hasOwnProperty.call(this, eA) && eA !== "prototype" && eA !== "__super__" && (k[eA] = this[eA]);
      return h.statics && n(k, h.statics), h.includes && (U(h.includes), n.apply(null, [V].concat(h.includes))), n(V, h), delete V.statics, delete V.includes, V.options && (V.options = x.options ? o(x.options) : {}, n(V.options, h.options)), V._initHooks = [], V.callInitHooks = function() {
        if (!this._initHooksCalled) {
          x.callInitHooks && x.callInitHooks.call(this), this._initHooksCalled = !0;
          for (var IA = 0, mA = V._initHooks.length; IA < mA; IA++)
            V._initHooks[IA].call(this);
        }
      }, k;
    }, K.include = function(h) {
      var k = this.prototype.options;
      return n(this.prototype, h), h.options && (this.prototype.options = k, this.mergeOptions(h.options)), this;
    }, K.mergeOptions = function(h) {
      return n(this.prototype.options, h), this;
    }, K.addInitHook = function(h) {
      var k = Array.prototype.slice.call(arguments, 1), x = typeof h == "function" ? h : function() {
        this[h].apply(this, k);
      };
      return this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(x), this;
    };
    function U(h) {
      if (!(typeof L > "u" || !L || !L.Mixin)) {
        h = f(h) ? h : [h];
        for (var k = 0; k < h.length; k++)
          h[k] === L.Mixin.Events && console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.", new Error().stack);
      }
    }
    var j = {
      /* @method on(type: String, fn: Function, context?: Object): this
       * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).
       *
       * @alternative
       * @method on(eventMap: Object): this
       * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`
       */
      on: function(h, k, x) {
        if (typeof h == "object")
          for (var V in h)
            this._on(V, h[V], k);
        else {
          h = Q(h);
          for (var eA = 0, IA = h.length; eA < IA; eA++)
            this._on(h[eA], k, x);
        }
        return this;
      },
      /* @method off(type: String, fn?: Function, context?: Object): this
       * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.
       *
       * @alternative
       * @method off(eventMap: Object): this
       * Removes a set of type/listener pairs.
       *
       * @alternative
       * @method off: this
       * Removes all listeners to all events on the object. This includes implicitly attached events.
       */
      off: function(h, k, x) {
        if (!arguments.length)
          delete this._events;
        else if (typeof h == "object")
          for (var V in h)
            this._off(V, h[V], k);
        else {
          h = Q(h);
          for (var eA = arguments.length === 1, IA = 0, mA = h.length; IA < mA; IA++)
            eA ? this._off(h[IA]) : this._off(h[IA], k, x);
        }
        return this;
      },
      // attach listener (without syntactic sugar now)
      _on: function(h, k, x, V) {
        if (typeof k != "function") {
          console.warn("wrong listener type: " + typeof k);
          return;
        }
        if (this._listens(h, k, x) === !1) {
          x === this && (x = void 0);
          var eA = { fn: k, ctx: x };
          V && (eA.once = !0), this._events = this._events || {}, this._events[h] = this._events[h] || [], this._events[h].push(eA);
        }
      },
      _off: function(h, k, x) {
        var V, eA, IA;
        if (this._events && (V = this._events[h], !!V)) {
          if (arguments.length === 1) {
            if (this._firingCount)
              for (eA = 0, IA = V.length; eA < IA; eA++)
                V[eA].fn = C;
            delete this._events[h];
            return;
          }
          if (typeof k != "function") {
            console.warn("wrong listener type: " + typeof k);
            return;
          }
          var mA = this._listens(h, k, x);
          if (mA !== !1) {
            var fA = V[mA];
            this._firingCount && (fA.fn = C, this._events[h] = V = V.slice()), V.splice(mA, 1);
          }
        }
      },
      // @method fire(type: String, data?: Object, propagate?: Boolean): this
      // Fires an event of the specified type. You can optionally provide a data
      // object — the first argument of the listener function will contain its
      // properties. The event can optionally be propagated to event parents.
      fire: function(h, k, x) {
        if (!this.listens(h, x))
          return this;
        var V = n({}, k, {
          type: h,
          target: this,
          sourceTarget: k && k.sourceTarget || this
        });
        if (this._events) {
          var eA = this._events[h];
          if (eA) {
            this._firingCount = this._firingCount + 1 || 1;
            for (var IA = 0, mA = eA.length; IA < mA; IA++) {
              var fA = eA[IA], JA = fA.fn;
              fA.once && this.off(h, JA, fA.ctx), JA.call(fA.ctx || this, V);
            }
            this._firingCount--;
          }
        }
        return x && this._propagateEvent(V), this;
      },
      // @method listens(type: String, propagate?: Boolean): Boolean
      // @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean
      // Returns `true` if a particular event type has any listeners attached to it.
      // The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.
      listens: function(h, k, x, V) {
        typeof h != "string" && console.warn('"string" type argument expected');
        var eA = k;
        typeof k != "function" && (V = !!k, eA = void 0, x = void 0);
        var IA = this._events && this._events[h];
        if (IA && IA.length && this._listens(h, eA, x) !== !1)
          return !0;
        if (V) {
          for (var mA in this._eventParents)
            if (this._eventParents[mA].listens(h, k, x, V))
              return !0;
        }
        return !1;
      },
      // returns the index (number) or false
      _listens: function(h, k, x) {
        if (!this._events)
          return !1;
        var V = this._events[h] || [];
        if (!k)
          return !!V.length;
        x === this && (x = void 0);
        for (var eA = 0, IA = V.length; eA < IA; eA++)
          if (V[eA].fn === k && V[eA].ctx === x)
            return eA;
        return !1;
      },
      // @method once(…): this
      // Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.
      once: function(h, k, x) {
        if (typeof h == "object")
          for (var V in h)
            this._on(V, h[V], k, !0);
        else {
          h = Q(h);
          for (var eA = 0, IA = h.length; eA < IA; eA++)
            this._on(h[eA], k, x, !0);
        }
        return this;
      },
      // @method addEventParent(obj: Evented): this
      // Adds an event parent - an `Evented` that will receive propagated events
      addEventParent: function(h) {
        return this._eventParents = this._eventParents || {}, this._eventParents[I(h)] = h, this;
      },
      // @method removeEventParent(obj: Evented): this
      // Removes an event parent, so it will stop receiving propagated events
      removeEventParent: function(h) {
        return this._eventParents && delete this._eventParents[I(h)], this;
      },
      _propagateEvent: function(h) {
        for (var k in this._eventParents)
          this._eventParents[k].fire(h.type, n({
            layer: h.target,
            propagatedFrom: h.target
          }, h), !0);
      }
    };
    j.addEventListener = j.on, j.removeEventListener = j.clearAllEventListeners = j.off, j.addOneTimeEventListener = j.once, j.fireEvent = j.fire, j.hasEventListeners = j.listens;
    var q = K.extend(j);
    function O(h, k, x) {
      this.x = x ? Math.round(h) : h, this.y = x ? Math.round(k) : k;
    }
    var $ = Math.trunc || function(h) {
      return h > 0 ? Math.floor(h) : Math.ceil(h);
    };
    O.prototype = {
      // @method clone(): Point
      // Returns a copy of the current point.
      clone: function() {
        return new O(this.x, this.y);
      },
      // @method add(otherPoint: Point): Point
      // Returns the result of addition of the current and the given points.
      add: function(h) {
        return this.clone()._add(_(h));
      },
      _add: function(h) {
        return this.x += h.x, this.y += h.y, this;
      },
      // @method subtract(otherPoint: Point): Point
      // Returns the result of subtraction of the given point from the current.
      subtract: function(h) {
        return this.clone()._subtract(_(h));
      },
      _subtract: function(h) {
        return this.x -= h.x, this.y -= h.y, this;
      },
      // @method divideBy(num: Number): Point
      // Returns the result of division of the current point by the given number.
      divideBy: function(h) {
        return this.clone()._divideBy(h);
      },
      _divideBy: function(h) {
        return this.x /= h, this.y /= h, this;
      },
      // @method multiplyBy(num: Number): Point
      // Returns the result of multiplication of the current point by the given number.
      multiplyBy: function(h) {
        return this.clone()._multiplyBy(h);
      },
      _multiplyBy: function(h) {
        return this.x *= h, this.y *= h, this;
      },
      // @method scaleBy(scale: Point): Point
      // Multiply each coordinate of the current point by each coordinate of
      // `scale`. In linear algebra terms, multiply the point by the
      // [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)
      // defined by `scale`.
      scaleBy: function(h) {
        return new O(this.x * h.x, this.y * h.y);
      },
      // @method unscaleBy(scale: Point): Point
      // Inverse of `scaleBy`. Divide each coordinate of the current point by
      // each coordinate of `scale`.
      unscaleBy: function(h) {
        return new O(this.x / h.x, this.y / h.y);
      },
      // @method round(): Point
      // Returns a copy of the current point with rounded coordinates.
      round: function() {
        return this.clone()._round();
      },
      _round: function() {
        return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
      },
      // @method floor(): Point
      // Returns a copy of the current point with floored coordinates (rounded down).
      floor: function() {
        return this.clone()._floor();
      },
      _floor: function() {
        return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;
      },
      // @method ceil(): Point
      // Returns a copy of the current point with ceiled coordinates (rounded up).
      ceil: function() {
        return this.clone()._ceil();
      },
      _ceil: function() {
        return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this;
      },
      // @method trunc(): Point
      // Returns a copy of the current point with truncated coordinates (rounded towards zero).
      trunc: function() {
        return this.clone()._trunc();
      },
      _trunc: function() {
        return this.x = $(this.x), this.y = $(this.y), this;
      },
      // @method distanceTo(otherPoint: Point): Number
      // Returns the cartesian distance between the current and the given points.
      distanceTo: function(h) {
        h = _(h);
        var k = h.x - this.x, x = h.y - this.y;
        return Math.sqrt(k * k + x * x);
      },
      // @method equals(otherPoint: Point): Boolean
      // Returns `true` if the given point has the same coordinates.
      equals: function(h) {
        return h = _(h), h.x === this.x && h.y === this.y;
      },
      // @method contains(otherPoint: Point): Boolean
      // Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
      contains: function(h) {
        return h = _(h), Math.abs(h.x) <= Math.abs(this.x) && Math.abs(h.y) <= Math.abs(this.y);
      },
      // @method toString(): String
      // Returns a string representation of the point for debugging purposes.
      toString: function() {
        return "Point(" + B(this.x) + ", " + B(this.y) + ")";
      }
    };
    function _(h, k, x) {
      return h instanceof O ? h : f(h) ? new O(h[0], h[1]) : h == null ? h : typeof h == "object" && "x" in h && "y" in h ? new O(h.x, h.y) : new O(h, k, x);
    }
    function tA(h, k) {
      if (h)
        for (var x = k ? [h, k] : h, V = 0, eA = x.length; V < eA; V++)
          this.extend(x[V]);
    }
    tA.prototype = {
      // @method extend(point: Point): this
      // Extends the bounds to contain the given point.
      // @alternative
      // @method extend(otherBounds: Bounds): this
      // Extend the bounds to contain the given bounds
      extend: function(h) {
        var k, x;
        if (!h)
          return this;
        if (h instanceof O || typeof h[0] == "number" || "x" in h)
          k = x = _(h);
        else if (h = nA(h), k = h.min, x = h.max, !k || !x)
          return this;
        return !this.min && !this.max ? (this.min = k.clone(), this.max = x.clone()) : (this.min.x = Math.min(k.x, this.min.x), this.max.x = Math.max(x.x, this.max.x), this.min.y = Math.min(k.y, this.min.y), this.max.y = Math.max(x.y, this.max.y)), this;
      },
      // @method getCenter(round?: Boolean): Point
      // Returns the center point of the bounds.
      getCenter: function(h) {
        return _(
          (this.min.x + this.max.x) / 2,
          (this.min.y + this.max.y) / 2,
          h
        );
      },
      // @method getBottomLeft(): Point
      // Returns the bottom-left point of the bounds.
      getBottomLeft: function() {
        return _(this.min.x, this.max.y);
      },
      // @method getTopRight(): Point
      // Returns the top-right point of the bounds.
      getTopRight: function() {
        return _(this.max.x, this.min.y);
      },
      // @method getTopLeft(): Point
      // Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).
      getTopLeft: function() {
        return this.min;
      },
      // @method getBottomRight(): Point
      // Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).
      getBottomRight: function() {
        return this.max;
      },
      // @method getSize(): Point
      // Returns the size of the given bounds
      getSize: function() {
        return this.max.subtract(this.min);
      },
      // @method contains(otherBounds: Bounds): Boolean
      // Returns `true` if the rectangle contains the given one.
      // @alternative
      // @method contains(point: Point): Boolean
      // Returns `true` if the rectangle contains the given point.
      contains: function(h) {
        var k, x;
        return typeof h[0] == "number" || h instanceof O ? h = _(h) : h = nA(h), h instanceof tA ? (k = h.min, x = h.max) : k = x = h, k.x >= this.min.x && x.x <= this.max.x && k.y >= this.min.y && x.y <= this.max.y;
      },
      // @method intersects(otherBounds: Bounds): Boolean
      // Returns `true` if the rectangle intersects the given bounds. Two bounds
      // intersect if they have at least one point in common.
      intersects: function(h) {
        h = nA(h);
        var k = this.min, x = this.max, V = h.min, eA = h.max, IA = eA.x >= k.x && V.x <= x.x, mA = eA.y >= k.y && V.y <= x.y;
        return IA && mA;
      },
      // @method overlaps(otherBounds: Bounds): Boolean
      // Returns `true` if the rectangle overlaps the given bounds. Two bounds
      // overlap if their intersection is an area.
      overlaps: function(h) {
        h = nA(h);
        var k = this.min, x = this.max, V = h.min, eA = h.max, IA = eA.x > k.x && V.x < x.x, mA = eA.y > k.y && V.y < x.y;
        return IA && mA;
      },
      // @method isValid(): Boolean
      // Returns `true` if the bounds are properly initialized.
      isValid: function() {
        return !!(this.min && this.max);
      },
      // @method pad(bufferRatio: Number): Bounds
      // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
      // For example, a ratio of 0.5 extends the bounds by 50% in each direction.
      // Negative values will retract the bounds.
      pad: function(h) {
        var k = this.min, x = this.max, V = Math.abs(k.x - x.x) * h, eA = Math.abs(k.y - x.y) * h;
        return nA(
          _(k.x - V, k.y - eA),
          _(x.x + V, x.y + eA)
        );
      },
      // @method equals(otherBounds: Bounds): Boolean
      // Returns `true` if the rectangle is equivalent to the given bounds.
      equals: function(h) {
        return h ? (h = nA(h), this.min.equals(h.getTopLeft()) && this.max.equals(h.getBottomRight())) : !1;
      }
    };
    function nA(h, k) {
      return !h || h instanceof tA ? h : new tA(h, k);
    }
    function AA(h, k) {
      if (h)
        for (var x = k ? [h, k] : h, V = 0, eA = x.length; V < eA; V++)
          this.extend(x[V]);
    }
    AA.prototype = {
      // @method extend(latlng: LatLng): this
      // Extend the bounds to contain the given point
      // @alternative
      // @method extend(otherBounds: LatLngBounds): this
      // Extend the bounds to contain the given bounds
      extend: function(h) {
        var k = this._southWest, x = this._northEast, V, eA;
        if (h instanceof rA)
          V = h, eA = h;
        else if (h instanceof AA) {
          if (V = h._southWest, eA = h._northEast, !V || !eA)
            return this;
        } else
          return h ? this.extend(sA(h) || gA(h)) : this;
        return !k && !x ? (this._southWest = new rA(V.lat, V.lng), this._northEast = new rA(eA.lat, eA.lng)) : (k.lat = Math.min(V.lat, k.lat), k.lng = Math.min(V.lng, k.lng), x.lat = Math.max(eA.lat, x.lat), x.lng = Math.max(eA.lng, x.lng)), this;
      },
      // @method pad(bufferRatio: Number): LatLngBounds
      // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
      // For example, a ratio of 0.5 extends the bounds by 50% in each direction.
      // Negative values will retract the bounds.
      pad: function(h) {
        var k = this._southWest, x = this._northEast, V = Math.abs(k.lat - x.lat) * h, eA = Math.abs(k.lng - x.lng) * h;
        return new AA(
          new rA(k.lat - V, k.lng - eA),
          new rA(x.lat + V, x.lng + eA)
        );
      },
      // @method getCenter(): LatLng
      // Returns the center point of the bounds.
      getCenter: function() {
        return new rA(
          (this._southWest.lat + this._northEast.lat) / 2,
          (this._southWest.lng + this._northEast.lng) / 2
        );
      },
      // @method getSouthWest(): LatLng
      // Returns the south-west point of the bounds.
      getSouthWest: function() {
        return this._southWest;
      },
      // @method getNorthEast(): LatLng
      // Returns the north-east point of the bounds.
      getNorthEast: function() {
        return this._northEast;
      },
      // @method getNorthWest(): LatLng
      // Returns the north-west point of the bounds.
      getNorthWest: function() {
        return new rA(this.getNorth(), this.getWest());
      },
      // @method getSouthEast(): LatLng
      // Returns the south-east point of the bounds.
      getSouthEast: function() {
        return new rA(this.getSouth(), this.getEast());
      },
      // @method getWest(): Number
      // Returns the west longitude of the bounds
      getWest: function() {
        return this._southWest.lng;
      },
      // @method getSouth(): Number
      // Returns the south latitude of the bounds
      getSouth: function() {
        return this._southWest.lat;
      },
      // @method getEast(): Number
      // Returns the east longitude of the bounds
      getEast: function() {
        return this._northEast.lng;
      },
      // @method getNorth(): Number
      // Returns the north latitude of the bounds
      getNorth: function() {
        return this._northEast.lat;
      },
      // @method contains(otherBounds: LatLngBounds): Boolean
      // Returns `true` if the rectangle contains the given one.
      // @alternative
      // @method contains (latlng: LatLng): Boolean
      // Returns `true` if the rectangle contains the given point.
      contains: function(h) {
        typeof h[0] == "number" || h instanceof rA || "lat" in h ? h = sA(h) : h = gA(h);
        var k = this._southWest, x = this._northEast, V, eA;
        return h instanceof AA ? (V = h.getSouthWest(), eA = h.getNorthEast()) : V = eA = h, V.lat >= k.lat && eA.lat <= x.lat && V.lng >= k.lng && eA.lng <= x.lng;
      },
      // @method intersects(otherBounds: LatLngBounds): Boolean
      // Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
      intersects: function(h) {
        h = gA(h);
        var k = this._southWest, x = this._northEast, V = h.getSouthWest(), eA = h.getNorthEast(), IA = eA.lat >= k.lat && V.lat <= x.lat, mA = eA.lng >= k.lng && V.lng <= x.lng;
        return IA && mA;
      },
      // @method overlaps(otherBounds: LatLngBounds): Boolean
      // Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
      overlaps: function(h) {
        h = gA(h);
        var k = this._southWest, x = this._northEast, V = h.getSouthWest(), eA = h.getNorthEast(), IA = eA.lat > k.lat && V.lat < x.lat, mA = eA.lng > k.lng && V.lng < x.lng;
        return IA && mA;
      },
      // @method toBBoxString(): String
      // Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
      toBBoxString: function() {
        return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(",");
      },
      // @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean
      // Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number.
      equals: function(h, k) {
        return h ? (h = gA(h), this._southWest.equals(h.getSouthWest(), k) && this._northEast.equals(h.getNorthEast(), k)) : !1;
      },
      // @method isValid(): Boolean
      // Returns `true` if the bounds are properly initialized.
      isValid: function() {
        return !!(this._southWest && this._northEast);
      }
    };
    function gA(h, k) {
      return h instanceof AA ? h : new AA(h, k);
    }
    function rA(h, k, x) {
      if (isNaN(h) || isNaN(k))
        throw new Error("Invalid LatLng object: (" + h + ", " + k + ")");
      this.lat = +h, this.lng = +k, x !== void 0 && (this.alt = +x);
    }
    rA.prototype = {
      // @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean
      // Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.
      equals: function(h, k) {
        if (!h)
          return !1;
        h = sA(h);
        var x = Math.max(
          Math.abs(this.lat - h.lat),
          Math.abs(this.lng - h.lng)
        );
        return x <= (k === void 0 ? 1e-9 : k);
      },
      // @method toString(): String
      // Returns a string representation of the point (for debugging purposes).
      toString: function(h) {
        return "LatLng(" + B(this.lat, h) + ", " + B(this.lng, h) + ")";
      },
      // @method distanceTo(otherLatLng: LatLng): Number
      // Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).
      distanceTo: function(h) {
        return cA.distance(this, sA(h));
      },
      // @method wrap(): LatLng
      // Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.
      wrap: function() {
        return cA.wrapLatLng(this);
      },
      // @method toBounds(sizeInMeters: Number): LatLngBounds
      // Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.
      toBounds: function(h) {
        var k = 180 * h / 40075017, x = k / Math.cos(Math.PI / 180 * this.lat);
        return gA(
          [this.lat - k, this.lng - x],
          [this.lat + k, this.lng + x]
        );
      },
      clone: function() {
        return new rA(this.lat, this.lng, this.alt);
      }
    };
    function sA(h, k, x) {
      return h instanceof rA ? h : f(h) && typeof h[0] != "object" ? h.length === 3 ? new rA(h[0], h[1], h[2]) : h.length === 2 ? new rA(h[0], h[1]) : null : h == null ? h : typeof h == "object" && "lat" in h ? new rA(h.lat, "lng" in h ? h.lng : h.lon, h.alt) : k === void 0 ? null : new rA(h, k, x);
    }
    var lA = {
      // @method latLngToPoint(latlng: LatLng, zoom: Number): Point
      // Projects geographical coordinates into pixel coordinates for a given zoom.
      latLngToPoint: function(h, k) {
        var x = this.projection.project(h), V = this.scale(k);
        return this.transformation._transform(x, V);
      },
      // @method pointToLatLng(point: Point, zoom: Number): LatLng
      // The inverse of `latLngToPoint`. Projects pixel coordinates on a given
      // zoom into geographical coordinates.
      pointToLatLng: function(h, k) {
        var x = this.scale(k), V = this.transformation.untransform(h, x);
        return this.projection.unproject(V);
      },
      // @method project(latlng: LatLng): Point
      // Projects geographical coordinates into coordinates in units accepted for
      // this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
      project: function(h) {
        return this.projection.project(h);
      },
      // @method unproject(point: Point): LatLng
      // Given a projected coordinate returns the corresponding LatLng.
      // The inverse of `project`.
      unproject: function(h) {
        return this.projection.unproject(h);
      },
      // @method scale(zoom: Number): Number
      // Returns the scale used when transforming projected coordinates into
      // pixel coordinates for a particular zoom. For example, it returns
      // `256 * 2^zoom` for Mercator-based CRS.
      scale: function(h) {
        return 256 * Math.pow(2, h);
      },
      // @method zoom(scale: Number): Number
      // Inverse of `scale()`, returns the zoom level corresponding to a scale
      // factor of `scale`.
      zoom: function(h) {
        return Math.log(h / 256) / Math.LN2;
      },
      // @method getProjectedBounds(zoom: Number): Bounds
      // Returns the projection's bounds scaled and transformed for the provided `zoom`.
      getProjectedBounds: function(h) {
        if (this.infinite)
          return null;
        var k = this.projection.bounds, x = this.scale(h), V = this.transformation.transform(k.min, x), eA = this.transformation.transform(k.max, x);
        return new tA(V, eA);
      },
      // @method distance(latlng1: LatLng, latlng2: LatLng): Number
      // Returns the distance between two geographical coordinates.
      // @property code: String
      // Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`)
      //
      // @property wrapLng: Number[]
      // An array of two numbers defining whether the longitude (horizontal) coordinate
      // axis wraps around a given range and how. Defaults to `[-180, 180]` in most
      // geographical CRSs. If `undefined`, the longitude axis does not wrap around.
      //
      // @property wrapLat: Number[]
      // Like `wrapLng`, but for the latitude (vertical) axis.
      // wrapLng: [min, max],
      // wrapLat: [min, max],
      // @property infinite: Boolean
      // If true, the coordinate space will be unbounded (infinite in both axes)
      infinite: !1,
      // @method wrapLatLng(latlng: LatLng): LatLng
      // Returns a `LatLng` where lat and lng has been wrapped according to the
      // CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.
      wrapLatLng: function(h) {
        var k = this.wrapLng ? a(h.lng, this.wrapLng, !0) : h.lng, x = this.wrapLat ? a(h.lat, this.wrapLat, !0) : h.lat, V = h.alt;
        return new rA(x, k, V);
      },
      // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds
      // Returns a `LatLngBounds` with the same size as the given one, ensuring
      // that its center is within the CRS's bounds.
      // Only accepts actual `L.LatLngBounds` instances, not arrays.
      wrapLatLngBounds: function(h) {
        var k = h.getCenter(), x = this.wrapLatLng(k), V = k.lat - x.lat, eA = k.lng - x.lng;
        if (V === 0 && eA === 0)
          return h;
        var IA = h.getSouthWest(), mA = h.getNorthEast(), fA = new rA(IA.lat - V, IA.lng - eA), JA = new rA(mA.lat - V, mA.lng - eA);
        return new AA(fA, JA);
      }
    }, cA = n({}, lA, {
      wrapLng: [-180, 180],
      // Mean Earth Radius, as recommended for use by
      // the International Union of Geodesy and Geophysics,
      // see https://rosettacode.org/wiki/Haversine_formula
      R: 6371e3,
      // distance between two geographical points using spherical law of cosines approximation
      distance: function(h, k) {
        var x = Math.PI / 180, V = h.lat * x, eA = k.lat * x, IA = Math.sin((k.lat - h.lat) * x / 2), mA = Math.sin((k.lng - h.lng) * x / 2), fA = IA * IA + Math.cos(V) * Math.cos(eA) * mA * mA, JA = 2 * Math.atan2(Math.sqrt(fA), Math.sqrt(1 - fA));
        return this.R * JA;
      }
    }), aA = 6378137, QA = {
      R: aA,
      MAX_LATITUDE: 85.0511287798,
      project: function(h) {
        var k = Math.PI / 180, x = this.MAX_LATITUDE, V = Math.max(Math.min(x, h.lat), -x), eA = Math.sin(V * k);
        return new O(
          this.R * h.lng * k,
          this.R * Math.log((1 + eA) / (1 - eA)) / 2
        );
      },
      unproject: function(h) {
        var k = 180 / Math.PI;
        return new rA(
          (2 * Math.atan(Math.exp(h.y / this.R)) - Math.PI / 2) * k,
          h.x * k / this.R
        );
      },
      bounds: function() {
        var h = aA * Math.PI;
        return new tA([-h, -h], [h, h]);
      }()
    };
    function hA(h, k, x, V) {
      if (f(h)) {
        this._a = h[0], this._b = h[1], this._c = h[2], this._d = h[3];
        return;
      }
      this._a = h, this._b = k, this._c = x, this._d = V;
    }
    hA.prototype = {
      // @method transform(point: Point, scale?: Number): Point
      // Returns a transformed point, optionally multiplied by the given scale.
      // Only accepts actual `L.Point` instances, not arrays.
      transform: function(h, k) {
        return this._transform(h.clone(), k);
      },
      // destructive transform (faster)
      _transform: function(h, k) {
        return k = k || 1, h.x = k * (this._a * h.x + this._b), h.y = k * (this._c * h.y + this._d), h;
      },
      // @method untransform(point: Point, scale?: Number): Point
      // Returns the reverse transformation of the given point, optionally divided
      // by the given scale. Only accepts actual `L.Point` instances, not arrays.
      untransform: function(h, k) {
        return k = k || 1, new O(
          (h.x / k - this._b) / this._a,
          (h.y / k - this._d) / this._c
        );
      }
    };
    function EA(h, k, x, V) {
      return new hA(h, k, x, V);
    }
    var RA = n({}, cA, {
      code: "EPSG:3857",
      projection: QA,
      transformation: function() {
        var h = 0.5 / (Math.PI * QA.R);
        return EA(h, 0.5, -h, 0.5);
      }()
    }), xA = n({}, RA, {
      code: "EPSG:900913"
    });
    function HA(h) {
      return document.createElementNS("http://www.w3.org/2000/svg", h);
    }
    function ne(h, k) {
      var x = "", V, eA, IA, mA, fA, JA;
      for (V = 0, IA = h.length; V < IA; V++) {
        for (fA = h[V], eA = 0, mA = fA.length; eA < mA; eA++)
          JA = fA[eA], x += (eA ? "L" : "M") + JA.x + " " + JA.y;
        x += k ? Je.svg ? "z" : "x" : "";
      }
      return x || "M0 0";
    }
    var VA = document.documentElement.style, le = "ActiveXObject" in window, we = le && !document.addEventListener, De = "msLaunchUri" in navigator && !("documentMode" in document), Ke = Mg("webkit"), ee = Mg("android"), re = Mg("android 2") || Mg("android 3"), wA = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10), WA = ee && Mg("Google") && wA < 537 && !("AudioNode" in window), Pe = !!window.opera, je = !De && Mg("chrome"), it = Mg("gecko") && !Ke && !Pe && !le, Li = !je && Mg("safari"), zA = Mg("phantom"), Qe = "OTransition" in VA, de = navigator.platform.indexOf("Win") === 0, xe = le && "transition" in VA, $e = "WebKitCSSMatrix" in window && "m11" in new window.WebKitCSSMatrix() && !re, Pn = "MozPerspective" in VA, Zt = !window.L_DISABLE_3D && (xe || $e || Pn) && !Qe && !zA, Kn = typeof orientation < "u" || Mg("mobile"), po = Kn && Ke, go = Kn && $e, CI = !window.PointerEvent && window.MSPointerEvent, Vl = !!(window.PointerEvent || CI), Bi = "ontouchstart" in window || !!window.TouchEvent, Xl = !window.L_NO_TOUCH && (Bi || Vl), jQ = Kn && Pe, zl = Kn && it, Qa = (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1, PQ = function() {
      var h = !1;
      try {
        var k = Object.defineProperty({}, "passive", {
          get: function() {
            h = !0;
          }
        });
        window.addEventListener("testPassiveEventSupport", C, k), window.removeEventListener("testPassiveEventSupport", C, k);
      } catch {
      }
      return h;
    }(), Er = function() {
      return !!document.createElement("canvas").getContext;
    }(), $Q = !!(document.createElementNS && HA("svg").createSVGRect), sh = !!$Q && function() {
      var h = document.createElement("div");
      return h.innerHTML = "<svg/>", (h.firstChild && h.firstChild.namespaceURI) === "http://www.w3.org/2000/svg";
    }(), Ih = !$Q && function() {
      try {
        var h = document.createElement("div");
        h.innerHTML = '<v:shape adj="1"/>';
        var k = h.firstChild;
        return k.style.behavior = "url(#default#VML)", k && typeof k.adj == "object";
      } catch {
        return !1;
      }
    }(), M0 = navigator.platform.indexOf("Mac") === 0, x0 = navigator.platform.indexOf("Linux") === 0;
    function Mg(h) {
      return navigator.userAgent.toLowerCase().indexOf(h) >= 0;
    }
    var Je = {
      ie: le,
      ielt9: we,
      edge: De,
      webkit: Ke,
      android: ee,
      android23: re,
      androidStock: WA,
      opera: Pe,
      chrome: je,
      gecko: it,
      safari: Li,
      phantom: zA,
      opera12: Qe,
      win: de,
      ie3d: xe,
      webkit3d: $e,
      gecko3d: Pn,
      any3d: Zt,
      mobile: Kn,
      mobileWebkit: po,
      mobileWebkit3d: go,
      msPointer: CI,
      pointer: Vl,
      touch: Xl,
      touchNative: Bi,
      mobileOpera: jQ,
      mobileGecko: zl,
      retina: Qa,
      passiveEvents: PQ,
      canvas: Er,
      svg: $Q,
      vml: Ih,
      inlineSvg: sh,
      mac: M0,
      linux: x0
    }, L0 = Je.msPointer ? "MSPointerDown" : "pointerdown", Tl = Je.msPointer ? "MSPointerMove" : "pointermove", ah = Je.msPointer ? "MSPointerUp" : "pointerup", _l = Je.msPointer ? "MSPointerCancel" : "pointercancel", ql = {
      touchstart: L0,
      touchmove: Tl,
      touchend: ah,
      touchcancel: _l
    }, v0 = {
      touchstart: Bh,
      touchmove: jl,
      touchend: jl,
      touchcancel: jl
    }, ms = {}, H0 = !1;
    function rh(h, k, x) {
      return k === "touchstart" && S0(), v0[k] ? (x = v0[k].bind(this, x), h.addEventListener(ql[k], x, !1), x) : (console.warn("wrong event specified:", k), C);
    }
    function AE(h, k, x) {
      if (!ql[k]) {
        console.warn("wrong event specified:", k);
        return;
      }
      h.removeEventListener(ql[k], x, !1);
    }
    function Ol(h) {
      ms[h.pointerId] = h;
    }
    function eE(h) {
      ms[h.pointerId] && (ms[h.pointerId] = h);
    }
    function Ch(h) {
      delete ms[h.pointerId];
    }
    function S0() {
      H0 || (document.addEventListener(L0, Ol, !0), document.addEventListener(Tl, eE, !0), document.addEventListener(ah, Ch, !0), document.addEventListener(_l, Ch, !0), H0 = !0);
    }
    function jl(h, k) {
      if (k.pointerType !== (k.MSPOINTER_TYPE_MOUSE || "mouse")) {
        k.touches = [];
        for (var x in ms)
          k.touches.push(ms[x]);
        k.changedTouches = [k], h(k);
      }
    }
    function Bh(h, k) {
      k.MSPOINTER_TYPE_TOUCH && k.pointerType === k.MSPOINTER_TYPE_TOUCH && pn(k), jl(h, k);
    }
    function zo(h) {
      var k = {}, x, V;
      for (V in h)
        x = h[V], k[V] = x && x.bind ? x.bind(h) : x;
      return h = k, k.type = "dblclick", k.detail = 2, k.isTrusted = !1, k._simulated = !0, k;
    }
    var Z0 = 200;
    function lh(h, k) {
      h.addEventListener("dblclick", k);
      var x = 0, V;
      function eA(IA) {
        if (IA.detail !== 1) {
          V = IA.detail;
          return;
        }
        if (!(IA.pointerType === "mouse" || IA.sourceCapabilities && !IA.sourceCapabilities.firesTouchEvents)) {
          var mA = gE(IA);
          if (!(mA.some(function(JA) {
            return JA instanceof HTMLLabelElement && JA.attributes.for;
          }) && !mA.some(function(JA) {
            return JA instanceof HTMLInputElement || JA instanceof HTMLSelectElement;
          }))) {
            var fA = Date.now();
            fA - x <= Z0 ? (V++, V === 2 && k(zo(IA))) : V = 1, x = fA;
          }
        }
      }
      return h.addEventListener("click", eA), {
        dblclick: k,
        simDblclick: eA
      };
    }
    function ch(h, k) {
      h.removeEventListener("dblclick", k.dblclick), h.removeEventListener("click", k.simDblclick);
    }
    var tE = GA(
      ["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]
    ), ps = GA(
      ["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]
    ), ur = ps === "webkitTransition" || ps === "OTransition" ? ps + "End" : "transitionend";
    function Qh(h) {
      return typeof h == "string" ? document.getElementById(h) : h;
    }
    function BI(h, k) {
      var x = h.style[k] || h.currentStyle && h.currentStyle[k];
      if ((!x || x === "auto") && document.defaultView) {
        var V = document.defaultView.getComputedStyle(h, null);
        x = V ? V[k] : null;
      }
      return x === "auto" ? null : x;
    }
    function kt(h, k, x) {
      var V = document.createElement(h);
      return V.className = k || "", x && x.appendChild(V), V;
    }
    function fi(h) {
      var k = h.parentNode;
      k && k.removeChild(h);
    }
    function SC(h) {
      for (; h.firstChild; )
        h.removeChild(h.firstChild);
    }
    function Ea(h) {
      var k = h.parentNode;
      k && k.lastChild !== h && k.appendChild(h);
    }
    function lI(h) {
      var k = h.parentNode;
      k && k.firstChild !== h && k.insertBefore(h, k.firstChild);
    }
    function iE(h, k) {
      if (h.classList !== void 0)
        return h.classList.contains(k);
      var x = oA(h);
      return x.length > 0 && new RegExp("(^|\\s)" + k + "(\\s|$)").test(x);
    }
    function It(h, k) {
      if (h.classList !== void 0)
        for (var x = Q(k), V = 0, eA = x.length; V < eA; V++)
          h.classList.add(x[V]);
      else if (!iE(h, k)) {
        var IA = oA(h);
        X(h, (IA ? IA + " " : "") + k);
      }
    }
    function vi(h, k) {
      h.classList !== void 0 ? h.classList.remove(k) : X(h, l((" " + oA(h) + " ").replace(" " + k + " ", " ")));
    }
    function X(h, k) {
      h.className.baseVal === void 0 ? h.className = k : h.className.baseVal = k;
    }
    function oA(h) {
      return h.correspondingElement && (h = h.correspondingElement), h.className.baseVal === void 0 ? h.className : h.className.baseVal;
    }
    function BA(h, k) {
      "opacity" in h.style ? h.style.opacity = k : "filter" in h.style && dA(h, k);
    }
    function dA(h, k) {
      var x = !1, V = "DXImageTransform.Microsoft.Alpha";
      try {
        x = h.filters.item(V);
      } catch {
        if (k === 1)
          return;
      }
      k = Math.round(k * 100), x ? (x.Enabled = k !== 100, x.Opacity = k) : h.style.filter += " progid:" + V + "(opacity=" + k + ")";
    }
    function GA(h) {
      for (var k = document.documentElement.style, x = 0; x < h.length; x++)
        if (h[x] in k)
          return h[x];
      return !1;
    }
    function yA(h, k, x) {
      var V = k || new O(0, 0);
      h.style[tE] = (Je.ie3d ? "translate(" + V.x + "px," + V.y + "px)" : "translate3d(" + V.x + "px," + V.y + "px,0)") + (x ? " scale(" + x + ")" : "");
    }
    function YA(h, k) {
      h._leaflet_pos = k, Je.any3d ? yA(h, k) : (h.style.left = k.x + "px", h.style.top = k.y + "px");
    }
    function OA(h) {
      return h._leaflet_pos || new O(0, 0);
    }
    var Fe, Ve, nt;
    if ("onselectstart" in document)
      Fe = function() {
        At(window, "selectstart", pn);
      }, Ve = function() {
        Ri(window, "selectstart", pn);
      };
    else {
      var Ei = GA(
        ["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]
      );
      Fe = function() {
        if (Ei) {
          var h = document.documentElement.style;
          nt = h[Ei], h[Ei] = "none";
        }
      }, Ve = function() {
        Ei && (document.documentElement.style[Ei] = nt, nt = void 0);
      };
    }
    function xg() {
      At(window, "dragstart", pn);
    }
    function Lg() {
      Ri(window, "dragstart", pn);
    }
    var yo, dr;
    function cI(h) {
      for (; h.tabIndex === -1; )
        h = h.parentNode;
      h.style && (ZC(), yo = h, dr = h.style.outlineStyle, h.style.outlineStyle = "none", At(window, "keydown", ZC));
    }
    function ZC() {
      yo && (yo.style.outlineStyle = dr, yo = void 0, dr = void 0, Ri(window, "keydown", ZC));
    }
    function WC(h) {
      do
        h = h.parentNode;
      while ((!h.offsetWidth || !h.offsetHeight) && h !== document.body);
      return h;
    }
    function nE(h) {
      var k = h.getBoundingClientRect();
      return {
        x: k.width / h.offsetWidth || 1,
        y: k.height / h.offsetHeight || 1,
        boundingClientRect: k
      };
    }
    var KC = {
      __proto__: null,
      TRANSFORM: tE,
      TRANSITION: ps,
      TRANSITION_END: ur,
      get: Qh,
      getStyle: BI,
      create: kt,
      remove: fi,
      empty: SC,
      toFront: Ea,
      toBack: lI,
      hasClass: iE,
      addClass: It,
      removeClass: vi,
      setClass: X,
      getClass: oA,
      setOpacity: BA,
      testProp: GA,
      setTransform: yA,
      setPosition: YA,
      getPosition: OA,
      get disableTextSelection() {
        return Fe;
      },
      get enableTextSelection() {
        return Ve;
      },
      disableImageDrag: xg,
      enableImageDrag: Lg,
      preventOutline: cI,
      restoreOutline: ZC,
      getSizedParentNode: WC,
      getScale: nE
    };
    function At(h, k, x, V) {
      if (k && typeof k == "object")
        for (var eA in k)
          HG(h, eA, k[eA], x);
      else {
        k = Q(k);
        for (var IA = 0, mA = k.length; IA < mA; IA++)
          HG(h, k[IA], x, V);
      }
      return this;
    }
    var ua = "_leaflet_events";
    function Ri(h, k, x, V) {
      if (arguments.length === 1)
        Y1(h), delete h[ua];
      else if (k && typeof k == "object")
        for (var eA in k)
          QI(h, eA, k[eA], x);
      else if (k = Q(k), arguments.length === 2)
        Y1(h, function(fA) {
          return w(k, fA) !== -1;
        });
      else
        for (var IA = 0, mA = k.length; IA < mA; IA++)
          QI(h, k[IA], x, V);
      return this;
    }
    function Y1(h, k) {
      for (var x in h[ua]) {
        var V = x.split(/\d/)[0];
        (!k || k(V)) && QI(h, V, null, null, x);
      }
    }
    var vG = {
      mouseenter: "mouseover",
      mouseleave: "mouseout",
      wheel: !("onwheel" in window) && "mousewheel"
    };
    function HG(h, k, x, V) {
      var eA = k + I(x) + (V ? "_" + I(V) : "");
      if (h[ua] && h[ua][eA])
        return this;
      var IA = function(fA) {
        return x.call(V || h, fA || window.event);
      }, mA = IA;
      !Je.touchNative && Je.pointer && k.indexOf("touch") === 0 ? IA = rh(h, k, IA) : Je.touch && k === "dblclick" ? IA = lh(h, IA) : "addEventListener" in h ? k === "touchstart" || k === "touchmove" || k === "wheel" || k === "mousewheel" ? h.addEventListener(vG[k] || k, IA, Je.passiveEvents ? { passive: !1 } : !1) : k === "mouseenter" || k === "mouseleave" ? (IA = function(fA) {
        fA = fA || window.event, K0(h, fA) && mA(fA);
      }, h.addEventListener(vG[k], IA, !1)) : h.addEventListener(k, mA, !1) : h.attachEvent("on" + k, IA), h[ua] = h[ua] || {}, h[ua][eA] = IA;
    }
    function QI(h, k, x, V, eA) {
      eA = eA || k + I(x) + (V ? "_" + I(V) : "");
      var IA = h[ua] && h[ua][eA];
      if (!IA)
        return this;
      !Je.touchNative && Je.pointer && k.indexOf("touch") === 0 ? AE(h, k, IA) : Je.touch && k === "dblclick" ? ch(h, IA) : "removeEventListener" in h ? h.removeEventListener(vG[k] || k, IA, !1) : h.detachEvent("on" + k, IA), h[ua][eA] = null;
    }
    function hr(h) {
      return h.stopPropagation ? h.stopPropagation() : h.originalEvent ? h.originalEvent._stopped = !0 : h.cancelBubble = !0, this;
    }
    function oE(h) {
      return HG(h, "wheel", hr), this;
    }
    function ni(h) {
      return At(h, "mousedown touchstart dblclick contextmenu", hr), h._leaflet_disable_click = !0, this;
    }
    function pn(h) {
      return h.preventDefault ? h.preventDefault() : h.returnValue = !1, this;
    }
    function da(h) {
      return pn(h), hr(h), this;
    }
    function gE(h) {
      if (h.composedPath)
        return h.composedPath();
      for (var k = [], x = h.target; x; )
        k.push(x), x = x.parentNode;
      return k;
    }
    function mr(h, k) {
      if (!k)
        return new O(h.clientX, h.clientY);
      var x = nE(k), V = x.boundingClientRect;
      return new O(
        // offset.left/top values are in page scale (like clientX/Y),
        // whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).
        (h.clientX - V.left) / x.x - k.clientLeft,
        (h.clientY - V.top) / x.y - k.clientTop
      );
    }
    var W0 = Je.linux && Je.chrome ? window.devicePixelRatio : Je.mac ? window.devicePixelRatio * 3 : window.devicePixelRatio > 0 ? 2 * window.devicePixelRatio : 1;
    function UC(h) {
      return Je.edge ? h.wheelDeltaY / 2 : (
        // Don't trust window-geometry-based delta
        h.deltaY && h.deltaMode === 0 ? -h.deltaY / W0 : (
          // Pixels
          h.deltaY && h.deltaMode === 1 ? -h.deltaY * 20 : (
            // Lines
            h.deltaY && h.deltaMode === 2 ? -h.deltaY * 60 : (
              // Pages
              h.deltaX || h.deltaZ ? 0 : (
                // Skip horizontal/depth wheel events
                h.wheelDelta ? (h.wheelDeltaY || h.wheelDelta) / 2 : (
                  // Legacy IE pixels
                  h.detail && Math.abs(h.detail) < 32765 ? -h.detail * 20 : (
                    // Legacy Moz lines
                    h.detail ? h.detail / -32765 * 60 : (
                      // Legacy Moz pages
                      0
                    )
                  )
                )
              )
            )
          )
        )
      );
    }
    function K0(h, k) {
      var x = k.relatedTarget;
      if (!x)
        return !0;
      try {
        for (; x && x !== h; )
          x = x.parentNode;
      } catch {
        return !1;
      }
      return x !== h;
    }
    var SG = {
      __proto__: null,
      on: At,
      off: Ri,
      stopPropagation: hr,
      disableScrollPropagation: oE,
      disableClickPropagation: ni,
      preventDefault: pn,
      stop: da,
      getPropagationPath: gE,
      getMousePosition: mr,
      getWheelDelta: UC,
      isExternalTarget: K0,
      addListener: At,
      removeListener: Ri
    }, U0 = q.extend({
      // @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number)
      // Run an animation of a given element to a new position, optionally setting
      // duration in seconds (`0.25` by default) and easing linearity factor (3rd
      // argument of the [cubic bezier curve](https://cubic-bezier.com/#0,0,.5,1),
      // `0.5` by default).
      run: function(h, k, x, V) {
        this.stop(), this._el = h, this._inProgress = !0, this._duration = x || 0.25, this._easeOutPower = 1 / Math.max(V || 0.5, 0.2), this._startPos = OA(h), this._offset = k.subtract(this._startPos), this._startTime = +/* @__PURE__ */ new Date(), this.fire("start"), this._animate();
      },
      // @method stop()
      // Stops the animation (if currently running).
      stop: function() {
        this._inProgress && (this._step(!0), this._complete());
      },
      _animate: function() {
        this._animId = p(this._animate, this), this._step();
      },
      _step: function(h) {
        var k = +/* @__PURE__ */ new Date() - this._startTime, x = this._duration * 1e3;
        k < x ? this._runFrame(this._easeOut(k / x), h) : (this._runFrame(1), this._complete());
      },
      _runFrame: function(h, k) {
        var x = this._startPos.add(this._offset.multiplyBy(h));
        k && x._round(), YA(this._el, x), this.fire("step");
      },
      _complete: function() {
        N(this._animId), this._inProgress = !1, this.fire("end");
      },
      _easeOut: function(h) {
        return 1 - Math.pow(1 - h, this._easeOutPower);
      }
    }), Mt = q.extend({
      options: {
        // @section Map State Options
        // @option crs: CRS = L.CRS.EPSG3857
        // The [Coordinate Reference System](#crs) to use. Don't change this if you're not
        // sure what it means.
        crs: RA,
        // @option center: LatLng = undefined
        // Initial geographic center of the map
        center: void 0,
        // @option zoom: Number = undefined
        // Initial map zoom level
        zoom: void 0,
        // @option minZoom: Number = *
        // Minimum zoom level of the map.
        // If not specified and at least one `GridLayer` or `TileLayer` is in the map,
        // the lowest of their `minZoom` options will be used instead.
        minZoom: void 0,
        // @option maxZoom: Number = *
        // Maximum zoom level of the map.
        // If not specified and at least one `GridLayer` or `TileLayer` is in the map,
        // the highest of their `maxZoom` options will be used instead.
        maxZoom: void 0,
        // @option layers: Layer[] = []
        // Array of layers that will be added to the map initially
        layers: [],
        // @option maxBounds: LatLngBounds = null
        // When this option is set, the map restricts the view to the given
        // geographical bounds, bouncing the user back if the user tries to pan
        // outside the view. To set the restriction dynamically, use
        // [`setMaxBounds`](#map-setmaxbounds) method.
        maxBounds: void 0,
        // @option renderer: Renderer = *
        // The default method for drawing vector layers on the map. `L.SVG`
        // or `L.Canvas` by default depending on browser support.
        renderer: void 0,
        // @section Animation Options
        // @option zoomAnimation: Boolean = true
        // Whether the map zoom animation is enabled. By default it's enabled
        // in all browsers that support CSS3 Transitions except Android.
        zoomAnimation: !0,
        // @option zoomAnimationThreshold: Number = 4
        // Won't animate zoom if the zoom difference exceeds this value.
        zoomAnimationThreshold: 4,
        // @option fadeAnimation: Boolean = true
        // Whether the tile fade animation is enabled. By default it's enabled
        // in all browsers that support CSS3 Transitions except Android.
        fadeAnimation: !0,
        // @option markerZoomAnimation: Boolean = true
        // Whether markers animate their zoom with the zoom animation, if disabled
        // they will disappear for the length of the animation. By default it's
        // enabled in all browsers that support CSS3 Transitions except Android.
        markerZoomAnimation: !0,
        // @option transform3DLimit: Number = 2^23
        // Defines the maximum size of a CSS translation transform. The default
        // value should not be changed unless a web browser positions layers in
        // the wrong place after doing a large `panBy`.
        transform3DLimit: 8388608,
        // Precision limit of a 32-bit float
        // @section Interaction Options
        // @option zoomSnap: Number = 1
        // Forces the map's zoom level to always be a multiple of this, particularly
        // right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom.
        // By default, the zoom level snaps to the nearest integer; lower values
        // (e.g. `0.5` or `0.1`) allow for greater granularity. A value of `0`
        // means the zoom level will not be snapped after `fitBounds` or a pinch-zoom.
        zoomSnap: 1,
        // @option zoomDelta: Number = 1
        // Controls how much the map's zoom level will change after a
        // [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+`
        // or `-` on the keyboard, or using the [zoom controls](#control-zoom).
        // Values smaller than `1` (e.g. `0.5`) allow for greater granularity.
        zoomDelta: 1,
        // @option trackResize: Boolean = true
        // Whether the map automatically handles browser window resize to update itself.
        trackResize: !0
      },
      initialize: function(h, k) {
        k = E(this, k), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = !0, this._initContainer(h), this._initLayout(), this._onResize = g(this._onResize, this), this._initEvents(), k.maxBounds && this.setMaxBounds(k.maxBounds), k.zoom !== void 0 && (this._zoom = this._limitZoom(k.zoom)), k.center && k.zoom !== void 0 && this.setView(sA(k.center), k.zoom, { reset: !0 }), this.callInitHooks(), this._zoomAnimated = ps && Je.any3d && !Je.mobileOpera && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), At(this._proxy, ur, this._catchTransitionEnd, this)), this._addLayers(this.options.layers);
      },
      // @section Methods for modifying map state
      // @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this
      // Sets the view of the map (geographical center and zoom) with the given
      // animation options.
      setView: function(h, k, x) {
        if (k = k === void 0 ? this._zoom : this._limitZoom(k), h = this._limitCenter(sA(h), k, this.options.maxBounds), x = x || {}, this._stop(), this._loaded && !x.reset && x !== !0) {
          x.animate !== void 0 && (x.zoom = n({ animate: x.animate }, x.zoom), x.pan = n({ animate: x.animate, duration: x.duration }, x.pan));
          var V = this._zoom !== k ? this._tryAnimatedZoom && this._tryAnimatedZoom(h, k, x.zoom) : this._tryAnimatedPan(h, x.pan);
          if (V)
            return clearTimeout(this._sizeTimer), this;
        }
        return this._resetView(h, k, x.pan && x.pan.noMoveStart), this;
      },
      // @method setZoom(zoom: Number, options?: Zoom/pan options): this
      // Sets the zoom of the map.
      setZoom: function(h, k) {
        return this._loaded ? this.setView(this.getCenter(), h, { zoom: k }) : (this._zoom = h, this);
      },
      // @method zoomIn(delta?: Number, options?: Zoom options): this
      // Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).
      zoomIn: function(h, k) {
        return h = h || (Je.any3d ? this.options.zoomDelta : 1), this.setZoom(this._zoom + h, k);
      },
      // @method zoomOut(delta?: Number, options?: Zoom options): this
      // Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).
      zoomOut: function(h, k) {
        return h = h || (Je.any3d ? this.options.zoomDelta : 1), this.setZoom(this._zoom - h, k);
      },
      // @method setZoomAround(latlng: LatLng, zoom: Number, options: Zoom options): this
      // Zooms the map while keeping a specified geographical point on the map
      // stationary (e.g. used internally for scroll zoom and double-click zoom).
      // @alternative
      // @method setZoomAround(offset: Point, zoom: Number, options: Zoom options): this
      // Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.
      setZoomAround: function(h, k, x) {
        var V = this.getZoomScale(k), eA = this.getSize().divideBy(2), IA = h instanceof O ? h : this.latLngToContainerPoint(h), mA = IA.subtract(eA).multiplyBy(1 - 1 / V), fA = this.containerPointToLatLng(eA.add(mA));
        return this.setView(fA, k, { zoom: x });
      },
      _getBoundsCenterZoom: function(h, k) {
        k = k || {}, h = h.getBounds ? h.getBounds() : gA(h);
        var x = _(k.paddingTopLeft || k.padding || [0, 0]), V = _(k.paddingBottomRight || k.padding || [0, 0]), eA = this.getBoundsZoom(h, !1, x.add(V));
        if (eA = typeof k.maxZoom == "number" ? Math.min(k.maxZoom, eA) : eA, eA === 1 / 0)
          return {
            center: h.getCenter(),
            zoom: eA
          };
        var IA = V.subtract(x).divideBy(2), mA = this.project(h.getSouthWest(), eA), fA = this.project(h.getNorthEast(), eA), JA = this.unproject(mA.add(fA).divideBy(2).add(IA), eA);
        return {
          center: JA,
          zoom: eA
        };
      },
      // @method fitBounds(bounds: LatLngBounds, options?: fitBounds options): this
      // Sets a map view that contains the given geographical bounds with the
      // maximum zoom level possible.
      fitBounds: function(h, k) {
        if (h = gA(h), !h.isValid())
          throw new Error("Bounds are not valid.");
        var x = this._getBoundsCenterZoom(h, k);
        return this.setView(x.center, x.zoom, k);
      },
      // @method fitWorld(options?: fitBounds options): this
      // Sets a map view that mostly contains the whole world with the maximum
      // zoom level possible.
      fitWorld: function(h) {
        return this.fitBounds([[-90, -180], [90, 180]], h);
      },
      // @method panTo(latlng: LatLng, options?: Pan options): this
      // Pans the map to a given center.
      panTo: function(h, k) {
        return this.setView(h, this._zoom, { pan: k });
      },
      // @method panBy(offset: Point, options?: Pan options): this
      // Pans the map by a given number of pixels (animated).
      panBy: function(h, k) {
        if (h = _(h).round(), k = k || {}, !h.x && !h.y)
          return this.fire("moveend");
        if (k.animate !== !0 && !this.getSize().contains(h))
          return this._resetView(this.unproject(this.project(this.getCenter()).add(h)), this.getZoom()), this;
        if (this._panAnim || (this._panAnim = new U0(), this._panAnim.on({
          step: this._onPanTransitionStep,
          end: this._onPanTransitionEnd
        }, this)), k.noMoveStart || this.fire("movestart"), k.animate !== !1) {
          It(this._mapPane, "leaflet-pan-anim");
          var x = this._getMapPanePos().subtract(h).round();
          this._panAnim.run(this._mapPane, x, k.duration || 0.25, k.easeLinearity);
        } else
          this._rawPanBy(h), this.fire("move").fire("moveend");
        return this;
      },
      // @method flyTo(latlng: LatLng, zoom?: Number, options?: Zoom/pan options): this
      // Sets the view of the map (geographical center and zoom) performing a smooth
      // pan-zoom animation.
      flyTo: function(h, k, x) {
        if (x = x || {}, x.animate === !1 || !Je.any3d)
          return this.setView(h, k, x);
        this._stop();
        var V = this.project(this.getCenter()), eA = this.project(h), IA = this.getSize(), mA = this._zoom;
        h = sA(h), k = k === void 0 ? mA : k;
        var fA = Math.max(IA.x, IA.y), JA = fA * this.getZoomScale(mA, k), XA = eA.distanceTo(V) || 1, he = 1.42, Oe = he * he;
        function Rt($n) {
          var z1 = $n ? -1 : 1, hjA = $n ? JA : fA, mjA = JA * JA - fA * fA + z1 * Oe * Oe * XA * XA, pjA = 2 * hjA * Oe * XA, m9 = mjA / pjA, SaA = Math.sqrt(m9 * m9 + 1) - m9, yjA = SaA < 1e-9 ? -18 : Math.log(SaA);
          return yjA;
        }
        function Zg($n) {
          return (Math.exp($n) - Math.exp(-$n)) / 2;
        }
        function wo($n) {
          return (Math.exp($n) + Math.exp(-$n)) / 2;
        }
        function ha($n) {
          return Zg($n) / wo($n);
        }
        var bs = Rt(0);
        function P0($n) {
          return fA * (wo(bs) / wo(bs + he * $n));
        }
        function QjA($n) {
          return fA * (wo(bs) * ha(bs + he * $n) - Zg(bs)) / Oe;
        }
        function EjA($n) {
          return 1 - Math.pow(1 - $n, 1.5);
        }
        var ujA = Date.now(), vaA = (Rt(1) - bs) / he, djA = x.duration ? 1e3 * x.duration : 1e3 * vaA * 0.8;
        function HaA() {
          var $n = (Date.now() - ujA) / djA, z1 = EjA($n) * vaA;
          $n <= 1 ? (this._flyToFrame = p(HaA, this), this._move(
            this.unproject(V.add(eA.subtract(V).multiplyBy(QjA(z1) / XA)), mA),
            this.getScaleZoom(fA / P0(z1), mA),
            { flyTo: !0 }
          )) : this._move(h, k)._moveEnd(!0);
        }
        return this._moveStart(!0, x.noMoveStart), HaA.call(this), this;
      },
      // @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this
      // Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),
      // but takes a bounds parameter like [`fitBounds`](#map-fitbounds).
      flyToBounds: function(h, k) {
        var x = this._getBoundsCenterZoom(h, k);
        return this.flyTo(x.center, x.zoom, k);
      },
      // @method setMaxBounds(bounds: LatLngBounds): this
      // Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option).
      setMaxBounds: function(h) {
        return h = gA(h), this.listens("moveend", this._panInsideMaxBounds) && this.off("moveend", this._panInsideMaxBounds), h.isValid() ? (this.options.maxBounds = h, this._loaded && this._panInsideMaxBounds(), this.on("moveend", this._panInsideMaxBounds)) : (this.options.maxBounds = null, this);
      },
      // @method setMinZoom(zoom: Number): this
      // Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option).
      setMinZoom: function(h) {
        var k = this.options.minZoom;
        return this.options.minZoom = h, this._loaded && k !== h && (this.fire("zoomlevelschange"), this.getZoom() < this.options.minZoom) ? this.setZoom(h) : this;
      },
      // @method setMaxZoom(zoom: Number): this
      // Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option).
      setMaxZoom: function(h) {
        var k = this.options.maxZoom;
        return this.options.maxZoom = h, this._loaded && k !== h && (this.fire("zoomlevelschange"), this.getZoom() > this.options.maxZoom) ? this.setZoom(h) : this;
      },
      // @method panInsideBounds(bounds: LatLngBounds, options?: Pan options): this
      // Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.
      panInsideBounds: function(h, k) {
        this._enforcingBounds = !0;
        var x = this.getCenter(), V = this._limitCenter(x, this._zoom, gA(h));
        return x.equals(V) || this.panTo(V, k), this._enforcingBounds = !1, this;
      },
      // @method panInside(latlng: LatLng, options?: padding options): this
      // Pans the map the minimum amount to make the `latlng` visible. Use
      // padding options to fit the display to more restricted bounds.
      // If `latlng` is already within the (optionally padded) display bounds,
      // the map will not be panned.
      panInside: function(h, k) {
        k = k || {};
        var x = _(k.paddingTopLeft || k.padding || [0, 0]), V = _(k.paddingBottomRight || k.padding || [0, 0]), eA = this.project(this.getCenter()), IA = this.project(h), mA = this.getPixelBounds(), fA = nA([mA.min.add(x), mA.max.subtract(V)]), JA = fA.getSize();
        if (!fA.contains(IA)) {
          this._enforcingBounds = !0;
          var XA = IA.subtract(fA.getCenter()), he = fA.extend(IA).getSize().subtract(JA);
          eA.x += XA.x < 0 ? -he.x : he.x, eA.y += XA.y < 0 ? -he.y : he.y, this.panTo(this.unproject(eA), k), this._enforcingBounds = !1;
        }
        return this;
      },
      // @method invalidateSize(options: Zoom/pan options): this
      // Checks if the map container size changed and updates the map if so —
      // call it after you've changed the map size dynamically, also animating
      // pan by default. If `options.pan` is `false`, panning will not occur.
      // If `options.debounceMoveend` is `true`, it will delay `moveend` event so
      // that it doesn't happen often even if the method is called many
      // times in a row.
      // @alternative
      // @method invalidateSize(animate: Boolean): this
      // Checks if the map container size changed and updates the map if so —
      // call it after you've changed the map size dynamically, also animating
      // pan by default.
      invalidateSize: function(h) {
        if (!this._loaded)
          return this;
        h = n({
          animate: !1,
          pan: !0
        }, h === !0 ? { animate: !0 } : h);
        var k = this.getSize();
        this._sizeChanged = !0, this._lastCenter = null;
        var x = this.getSize(), V = k.divideBy(2).round(), eA = x.divideBy(2).round(), IA = V.subtract(eA);
        return !IA.x && !IA.y ? this : (h.animate && h.pan ? this.panBy(IA) : (h.pan && this._rawPanBy(IA), this.fire("move"), h.debounceMoveend ? (clearTimeout(this._sizeTimer), this._sizeTimer = setTimeout(g(this.fire, this, "moveend"), 200)) : this.fire("moveend")), this.fire("resize", {
          oldSize: k,
          newSize: x
        }));
      },
      // @section Methods for modifying map state
      // @method stop(): this
      // Stops the currently running `panTo` or `flyTo` animation, if any.
      stop: function() {
        return this.setZoom(this._limitZoom(this._zoom)), this.options.zoomSnap || this.fire("viewreset"), this._stop();
      },
      // @section Geolocation methods
      // @method locate(options?: Locate options): this
      // Tries to locate the user using the Geolocation API, firing a [`locationfound`](#map-locationfound)
      // event with location data on success or a [`locationerror`](#map-locationerror) event on failure,
      // and optionally sets the map view to the user's location with respect to
      // detection accuracy (or to the world view if geolocation failed).
      // Note that, if your page doesn't use HTTPS, this method will fail in
      // modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins))
      // See `Locate options` for more details.
      locate: function(h) {
        if (h = this._locateOptions = n({
          timeout: 1e4,
          watch: !1
          // setView: false
          // maxZoom: <Number>
          // maximumAge: 0
          // enableHighAccuracy: false
        }, h), !("geolocation" in navigator))
          return this._handleGeolocationError({
            code: 0,
            message: "Geolocation not supported."
          }), this;
        var k = g(this._handleGeolocationResponse, this), x = g(this._handleGeolocationError, this);
        return h.watch ? this._locationWatchId = navigator.geolocation.watchPosition(k, x, h) : navigator.geolocation.getCurrentPosition(k, x, h), this;
      },
      // @method stopLocate(): this
      // Stops watching location previously initiated by `map.locate({watch: true})`
      // and aborts resetting the map view if map.locate was called with
      // `{setView: true}`.
      stopLocate: function() {
        return navigator.geolocation && navigator.geolocation.clearWatch && navigator.geolocation.clearWatch(this._locationWatchId), this._locateOptions && (this._locateOptions.setView = !1), this;
      },
      _handleGeolocationError: function(h) {
        if (this._container._leaflet_id) {
          var k = h.code, x = h.message || (k === 1 ? "permission denied" : k === 2 ? "position unavailable" : "timeout");
          this._locateOptions.setView && !this._loaded && this.fitWorld(), this.fire("locationerror", {
            code: k,
            message: "Geolocation error: " + x + "."
          });
        }
      },
      _handleGeolocationResponse: function(h) {
        if (this._container._leaflet_id) {
          var k = h.coords.latitude, x = h.coords.longitude, V = new rA(k, x), eA = V.toBounds(h.coords.accuracy * 2), IA = this._locateOptions;
          if (IA.setView) {
            var mA = this.getBoundsZoom(eA);
            this.setView(V, IA.maxZoom ? Math.min(mA, IA.maxZoom) : mA);
          }
          var fA = {
            latlng: V,
            bounds: eA,
            timestamp: h.timestamp
          };
          for (var JA in h.coords)
            typeof h.coords[JA] == "number" && (fA[JA] = h.coords[JA]);
          this.fire("locationfound", fA);
        }
      },
      // TODO Appropriate docs section?
      // @section Other Methods
      // @method addHandler(name: String, HandlerClass: Function): this
      // Adds a new `Handler` to the map, given its name and constructor function.
      addHandler: function(h, k) {
        if (!k)
          return this;
        var x = this[h] = new k(this);
        return this._handlers.push(x), this.options[h] && x.enable(), this;
      },
      // @method remove(): this
      // Destroys the map and clears all related event listeners.
      remove: function() {
        if (this._initEvents(!0), this.options.maxBounds && this.off("moveend", this._panInsideMaxBounds), this._containerId !== this._container._leaflet_id)
          throw new Error("Map container is being reused by another instance");
        try {
          delete this._container._leaflet_id, delete this._containerId;
        } catch {
          this._container._leaflet_id = void 0, this._containerId = void 0;
        }
        this._locationWatchId !== void 0 && this.stopLocate(), this._stop(), fi(this._mapPane), this._clearControlPos && this._clearControlPos(), this._resizeRequest && (N(this._resizeRequest), this._resizeRequest = null), this._clearHandlers(), this._loaded && this.fire("unload");
        var h;
        for (h in this._layers)
          this._layers[h].remove();
        for (h in this._panes)
          fi(this._panes[h]);
        return this._layers = [], this._panes = [], delete this._mapPane, delete this._renderer, this;
      },
      // @section Other Methods
      // @method createPane(name: String, container?: HTMLElement): HTMLElement
      // Creates a new [map pane](#map-pane) with the given name if it doesn't exist already,
      // then returns it. The pane is created as a child of `container`, or
      // as a child of the main map pane if not set.
      createPane: function(h, k) {
        var x = "leaflet-pane" + (h ? " leaflet-" + h.replace("Pane", "") + "-pane" : ""), V = kt("div", x, k || this._mapPane);
        return h && (this._panes[h] = V), V;
      },
      // @section Methods for Getting Map State
      // @method getCenter(): LatLng
      // Returns the geographical center of the map view
      getCenter: function() {
        return this._checkIfLoaded(), this._lastCenter && !this._moved() ? this._lastCenter.clone() : this.layerPointToLatLng(this._getCenterLayerPoint());
      },
      // @method getZoom(): Number
      // Returns the current zoom level of the map view
      getZoom: function() {
        return this._zoom;
      },
      // @method getBounds(): LatLngBounds
      // Returns the geographical bounds visible in the current map view
      getBounds: function() {
        var h = this.getPixelBounds(), k = this.unproject(h.getBottomLeft()), x = this.unproject(h.getTopRight());
        return new AA(k, x);
      },
      // @method getMinZoom(): Number
      // Returns the minimum zoom level of the map (if set in the `minZoom` option of the map or of any layers), or `0` by default.
      getMinZoom: function() {
        return this.options.minZoom === void 0 ? this._layersMinZoom || 0 : this.options.minZoom;
      },
      // @method getMaxZoom(): Number
      // Returns the maximum zoom level of the map (if set in the `maxZoom` option of the map or of any layers).
      getMaxZoom: function() {
        return this.options.maxZoom === void 0 ? this._layersMaxZoom === void 0 ? 1 / 0 : this._layersMaxZoom : this.options.maxZoom;
      },
      // @method getBoundsZoom(bounds: LatLngBounds, inside?: Boolean, padding?: Point): Number
      // Returns the maximum zoom level on which the given bounds fit to the map
      // view in its entirety. If `inside` (optional) is set to `true`, the method
      // instead returns the minimum zoom level on which the map view fits into
      // the given bounds in its entirety.
      getBoundsZoom: function(h, k, x) {
        h = gA(h), x = _(x || [0, 0]);
        var V = this.getZoom() || 0, eA = this.getMinZoom(), IA = this.getMaxZoom(), mA = h.getNorthWest(), fA = h.getSouthEast(), JA = this.getSize().subtract(x), XA = nA(this.project(fA, V), this.project(mA, V)).getSize(), he = Je.any3d ? this.options.zoomSnap : 1, Oe = JA.x / XA.x, Rt = JA.y / XA.y, Zg = k ? Math.max(Oe, Rt) : Math.min(Oe, Rt);
        return V = this.getScaleZoom(Zg, V), he && (V = Math.round(V / (he / 100)) * (he / 100), V = k ? Math.ceil(V / he) * he : Math.floor(V / he) * he), Math.max(eA, Math.min(IA, V));
      },
      // @method getSize(): Point
      // Returns the current size of the map container (in pixels).
      getSize: function() {
        return (!this._size || this._sizeChanged) && (this._size = new O(
          this._container.clientWidth || 0,
          this._container.clientHeight || 0
        ), this._sizeChanged = !1), this._size.clone();
      },
      // @method getPixelBounds(): Bounds
      // Returns the bounds of the current map view in projected pixel
      // coordinates (sometimes useful in layer and overlay implementations).
      getPixelBounds: function(h, k) {
        var x = this._getTopLeftPoint(h, k);
        return new tA(x, x.add(this.getSize()));
      },
      // TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to
      // the map pane? "left point of the map layer" can be confusing, specially
      // since there can be negative offsets.
      // @method getPixelOrigin(): Point
      // Returns the projected pixel coordinates of the top left point of
      // the map layer (useful in custom layer and overlay implementations).
      getPixelOrigin: function() {
        return this._checkIfLoaded(), this._pixelOrigin;
      },
      // @method getPixelWorldBounds(zoom?: Number): Bounds
      // Returns the world's bounds in pixel coordinates for zoom level `zoom`.
      // If `zoom` is omitted, the map's current zoom level is used.
      getPixelWorldBounds: function(h) {
        return this.options.crs.getProjectedBounds(h === void 0 ? this.getZoom() : h);
      },
      // @section Other Methods
      // @method getPane(pane: String|HTMLElement): HTMLElement
      // Returns a [map pane](#map-pane), given its name or its HTML element (its identity).
      getPane: function(h) {
        return typeof h == "string" ? this._panes[h] : h;
      },
      // @method getPanes(): Object
      // Returns a plain object containing the names of all [panes](#map-pane) as keys and
      // the panes as values.
      getPanes: function() {
        return this._panes;
      },
      // @method getContainer: HTMLElement
      // Returns the HTML element that contains the map.
      getContainer: function() {
        return this._container;
      },
      // @section Conversion Methods
      // @method getZoomScale(toZoom: Number, fromZoom: Number): Number
      // Returns the scale factor to be applied to a map transition from zoom level
      // `fromZoom` to `toZoom`. Used internally to help with zoom animations.
      getZoomScale: function(h, k) {
        var x = this.options.crs;
        return k = k === void 0 ? this._zoom : k, x.scale(h) / x.scale(k);
      },
      // @method getScaleZoom(scale: Number, fromZoom: Number): Number
      // Returns the zoom level that the map would end up at, if it is at `fromZoom`
      // level and everything is scaled by a factor of `scale`. Inverse of
      // [`getZoomScale`](#map-getZoomScale).
      getScaleZoom: function(h, k) {
        var x = this.options.crs;
        k = k === void 0 ? this._zoom : k;
        var V = x.zoom(h * x.scale(k));
        return isNaN(V) ? 1 / 0 : V;
      },
      // @method project(latlng: LatLng, zoom: Number): Point
      // Projects a geographical coordinate `LatLng` according to the projection
      // of the map's CRS, then scales it according to `zoom` and the CRS's
      // `Transformation`. The result is pixel coordinate relative to
      // the CRS origin.
      project: function(h, k) {
        return k = k === void 0 ? this._zoom : k, this.options.crs.latLngToPoint(sA(h), k);
      },
      // @method unproject(point: Point, zoom: Number): LatLng
      // Inverse of [`project`](#map-project).
      unproject: function(h, k) {
        return k = k === void 0 ? this._zoom : k, this.options.crs.pointToLatLng(_(h), k);
      },
      // @method layerPointToLatLng(point: Point): LatLng
      // Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),
      // returns the corresponding geographical coordinate (for the current zoom level).
      layerPointToLatLng: function(h) {
        var k = _(h).add(this.getPixelOrigin());
        return this.unproject(k);
      },
      // @method latLngToLayerPoint(latlng: LatLng): Point
      // Given a geographical coordinate, returns the corresponding pixel coordinate
      // relative to the [origin pixel](#map-getpixelorigin).
      latLngToLayerPoint: function(h) {
        var k = this.project(sA(h))._round();
        return k._subtract(this.getPixelOrigin());
      },
      // @method wrapLatLng(latlng: LatLng): LatLng
      // Returns a `LatLng` where `lat` and `lng` has been wrapped according to the
      // map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the
      // CRS's bounds.
      // By default this means longitude is wrapped around the dateline so its
      // value is between -180 and +180 degrees.
      wrapLatLng: function(h) {
        return this.options.crs.wrapLatLng(sA(h));
      },
      // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds
      // Returns a `LatLngBounds` with the same size as the given one, ensuring that
      // its center is within the CRS's bounds.
      // By default this means the center longitude is wrapped around the dateline so its
      // value is between -180 and +180 degrees, and the majority of the bounds
      // overlaps the CRS's bounds.
      wrapLatLngBounds: function(h) {
        return this.options.crs.wrapLatLngBounds(gA(h));
      },
      // @method distance(latlng1: LatLng, latlng2: LatLng): Number
      // Returns the distance between two geographical coordinates according to
      // the map's CRS. By default this measures distance in meters.
      distance: function(h, k) {
        return this.options.crs.distance(sA(h), sA(k));
      },
      // @method containerPointToLayerPoint(point: Point): Point
      // Given a pixel coordinate relative to the map container, returns the corresponding
      // pixel coordinate relative to the [origin pixel](#map-getpixelorigin).
      containerPointToLayerPoint: function(h) {
        return _(h).subtract(this._getMapPanePos());
      },
      // @method layerPointToContainerPoint(point: Point): Point
      // Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),
      // returns the corresponding pixel coordinate relative to the map container.
      layerPointToContainerPoint: function(h) {
        return _(h).add(this._getMapPanePos());
      },
      // @method containerPointToLatLng(point: Point): LatLng
      // Given a pixel coordinate relative to the map container, returns
      // the corresponding geographical coordinate (for the current zoom level).
      containerPointToLatLng: function(h) {
        var k = this.containerPointToLayerPoint(_(h));
        return this.layerPointToLatLng(k);
      },
      // @method latLngToContainerPoint(latlng: LatLng): Point
      // Given a geographical coordinate, returns the corresponding pixel coordinate
      // relative to the map container.
      latLngToContainerPoint: function(h) {
        return this.layerPointToContainerPoint(this.latLngToLayerPoint(sA(h)));
      },
      // @method mouseEventToContainerPoint(ev: MouseEvent): Point
      // Given a MouseEvent object, returns the pixel coordinate relative to the
      // map container where the event took place.
      mouseEventToContainerPoint: function(h) {
        return mr(h, this._container);
      },
      // @method mouseEventToLayerPoint(ev: MouseEvent): Point
      // Given a MouseEvent object, returns the pixel coordinate relative to
      // the [origin pixel](#map-getpixelorigin) where the event took place.
      mouseEventToLayerPoint: function(h) {
        return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(h));
      },
      // @method mouseEventToLatLng(ev: MouseEvent): LatLng
      // Given a MouseEvent object, returns geographical coordinate where the
      // event took place.
      mouseEventToLatLng: function(h) {
        return this.layerPointToLatLng(this.mouseEventToLayerPoint(h));
      },
      // map initialization methods
      _initContainer: function(h) {
        var k = this._container = Qh(h);
        if (k) {
          if (k._leaflet_id)
            throw new Error("Map container is already initialized.");
        } else
          throw new Error("Map container not found.");
        At(k, "scroll", this._onScroll, this), this._containerId = I(k);
      },
      _initLayout: function() {
        var h = this._container;
        this._fadeAnimated = this.options.fadeAnimation && Je.any3d, It(h, "leaflet-container" + (Je.touch ? " leaflet-touch" : "") + (Je.retina ? " leaflet-retina" : "") + (Je.ielt9 ? " leaflet-oldie" : "") + (Je.safari ? " leaflet-safari" : "") + (this._fadeAnimated ? " leaflet-fade-anim" : ""));
        var k = BI(h, "position");
        k !== "absolute" && k !== "relative" && k !== "fixed" && k !== "sticky" && (h.style.position = "relative"), this._initPanes(), this._initControlPos && this._initControlPos();
      },
      _initPanes: function() {
        var h = this._panes = {};
        this._paneRenderers = {}, this._mapPane = this.createPane("mapPane", this._container), YA(this._mapPane, new O(0, 0)), this.createPane("tilePane"), this.createPane("overlayPane"), this.createPane("shadowPane"), this.createPane("markerPane"), this.createPane("tooltipPane"), this.createPane("popupPane"), this.options.markerZoomAnimation || (It(h.markerPane, "leaflet-zoom-hide"), It(h.shadowPane, "leaflet-zoom-hide"));
      },
      // private methods that modify map state
      // @section Map state change events
      _resetView: function(h, k, x) {
        YA(this._mapPane, new O(0, 0));
        var V = !this._loaded;
        this._loaded = !0, k = this._limitZoom(k), this.fire("viewprereset");
        var eA = this._zoom !== k;
        this._moveStart(eA, x)._move(h, k)._moveEnd(eA), this.fire("viewreset"), V && this.fire("load");
      },
      _moveStart: function(h, k) {
        return h && this.fire("zoomstart"), k || this.fire("movestart"), this;
      },
      _move: function(h, k, x, V) {
        k === void 0 && (k = this._zoom);
        var eA = this._zoom !== k;
        return this._zoom = k, this._lastCenter = h, this._pixelOrigin = this._getNewPixelOrigin(h), V ? x && x.pinch && this.fire("zoom", x) : ((eA || x && x.pinch) && this.fire("zoom", x), this.fire("move", x)), this;
      },
      _moveEnd: function(h) {
        return h && this.fire("zoomend"), this.fire("moveend");
      },
      _stop: function() {
        return N(this._flyToFrame), this._panAnim && this._panAnim.stop(), this;
      },
      _rawPanBy: function(h) {
        YA(this._mapPane, this._getMapPanePos().subtract(h));
      },
      _getZoomSpan: function() {
        return this.getMaxZoom() - this.getMinZoom();
      },
      _panInsideMaxBounds: function() {
        this._enforcingBounds || this.panInsideBounds(this.options.maxBounds);
      },
      _checkIfLoaded: function() {
        if (!this._loaded)
          throw new Error("Set map center and zoom first.");
      },
      // DOM event handling
      // @section Interaction events
      _initEvents: function(h) {
        this._targets = {}, this._targets[I(this._container)] = this;
        var k = h ? Ri : At;
        k(this._container, "click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup", this._handleDOMEvent, this), this.options.trackResize && k(window, "resize", this._onResize, this), Je.any3d && this.options.transform3DLimit && (h ? this.off : this.on).call(this, "moveend", this._onMoveEnd);
      },
      _onResize: function() {
        N(this._resizeRequest), this._resizeRequest = p(
          function() {
            this.invalidateSize({ debounceMoveend: !0 });
          },
          this
        );
      },
      _onScroll: function() {
        this._container.scrollTop = 0, this._container.scrollLeft = 0;
      },
      _onMoveEnd: function() {
        var h = this._getMapPanePos();
        Math.max(Math.abs(h.x), Math.abs(h.y)) >= this.options.transform3DLimit && this._resetView(this.getCenter(), this.getZoom());
      },
      _findEventTargets: function(h, k) {
        for (var x = [], V, eA = k === "mouseout" || k === "mouseover", IA = h.target || h.srcElement, mA = !1; IA; ) {
          if (V = this._targets[I(IA)], V && (k === "click" || k === "preclick") && this._draggableMoved(V)) {
            mA = !0;
            break;
          }
          if (V && V.listens(k, !0) && (eA && !K0(IA, h) || (x.push(V), eA)) || IA === this._container)
            break;
          IA = IA.parentNode;
        }
        return !x.length && !mA && !eA && this.listens(k, !0) && (x = [this]), x;
      },
      _isClickDisabled: function(h) {
        for (; h && h !== this._container; ) {
          if (h._leaflet_disable_click)
            return !0;
          h = h.parentNode;
        }
      },
      _handleDOMEvent: function(h) {
        var k = h.target || h.srcElement;
        if (!(!this._loaded || k._leaflet_disable_events || h.type === "click" && this._isClickDisabled(k))) {
          var x = h.type;
          x === "mousedown" && cI(k), this._fireDOMEvent(h, x);
        }
      },
      _mouseEvents: ["click", "dblclick", "mouseover", "mouseout", "contextmenu"],
      _fireDOMEvent: function(h, k, x) {
        if (h.type === "click") {
          var V = n({}, h);
          V.type = "preclick", this._fireDOMEvent(V, V.type, x);
        }
        var eA = this._findEventTargets(h, k);
        if (x) {
          for (var IA = [], mA = 0; mA < x.length; mA++)
            x[mA].listens(k, !0) && IA.push(x[mA]);
          eA = IA.concat(eA);
        }
        if (eA.length) {
          k === "contextmenu" && pn(h);
          var fA = eA[0], JA = {
            originalEvent: h
          };
          if (h.type !== "keypress" && h.type !== "keydown" && h.type !== "keyup") {
            var XA = fA.getLatLng && (!fA._radius || fA._radius <= 10);
            JA.containerPoint = XA ? this.latLngToContainerPoint(fA.getLatLng()) : this.mouseEventToContainerPoint(h), JA.layerPoint = this.containerPointToLayerPoint(JA.containerPoint), JA.latlng = XA ? fA.getLatLng() : this.layerPointToLatLng(JA.layerPoint);
          }
          for (mA = 0; mA < eA.length; mA++)
            if (eA[mA].fire(k, JA, !0), JA.originalEvent._stopped || eA[mA].options.bubblingMouseEvents === !1 && w(this._mouseEvents, k) !== -1)
              return;
        }
      },
      _draggableMoved: function(h) {
        return h = h.dragging && h.dragging.enabled() ? h : this, h.dragging && h.dragging.moved() || this.boxZoom && this.boxZoom.moved();
      },
      _clearHandlers: function() {
        for (var h = 0, k = this._handlers.length; h < k; h++)
          this._handlers[h].disable();
      },
      // @section Other Methods
      // @method whenReady(fn: Function, context?: Object): this
      // Runs the given function `fn` when the map gets initialized with
      // a view (center and zoom) and at least one layer, or immediately
      // if it's already initialized, optionally passing a function context.
      whenReady: function(h, k) {
        return this._loaded ? h.call(k || this, { target: this }) : this.on("load", h, k), this;
      },
      // private methods for getting map state
      _getMapPanePos: function() {
        return OA(this._mapPane) || new O(0, 0);
      },
      _moved: function() {
        var h = this._getMapPanePos();
        return h && !h.equals([0, 0]);
      },
      _getTopLeftPoint: function(h, k) {
        var x = h && k !== void 0 ? this._getNewPixelOrigin(h, k) : this.getPixelOrigin();
        return x.subtract(this._getMapPanePos());
      },
      _getNewPixelOrigin: function(h, k) {
        var x = this.getSize()._divideBy(2);
        return this.project(h, k)._subtract(x)._add(this._getMapPanePos())._round();
      },
      _latLngToNewLayerPoint: function(h, k, x) {
        var V = this._getNewPixelOrigin(x, k);
        return this.project(h, k)._subtract(V);
      },
      _latLngBoundsToNewLayerBounds: function(h, k, x) {
        var V = this._getNewPixelOrigin(x, k);
        return nA([
          this.project(h.getSouthWest(), k)._subtract(V),
          this.project(h.getNorthWest(), k)._subtract(V),
          this.project(h.getSouthEast(), k)._subtract(V),
          this.project(h.getNorthEast(), k)._subtract(V)
        ]);
      },
      // layer point of the current center
      _getCenterLayerPoint: function() {
        return this.containerPointToLayerPoint(this.getSize()._divideBy(2));
      },
      // offset of the specified place to the current center in pixels
      _getCenterOffset: function(h) {
        return this.latLngToLayerPoint(h).subtract(this._getCenterLayerPoint());
      },
      // adjust center for view to get inside bounds
      _limitCenter: function(h, k, x) {
        if (!x)
          return h;
        var V = this.project(h, k), eA = this.getSize().divideBy(2), IA = new tA(V.subtract(eA), V.add(eA)), mA = this._getBoundsOffset(IA, x, k);
        return Math.abs(mA.x) <= 1 && Math.abs(mA.y) <= 1 ? h : this.unproject(V.add(mA), k);
      },
      // adjust offset for view to get inside bounds
      _limitOffset: function(h, k) {
        if (!k)
          return h;
        var x = this.getPixelBounds(), V = new tA(x.min.add(h), x.max.add(h));
        return h.add(this._getBoundsOffset(V, k));
      },
      // returns offset needed for pxBounds to get inside maxBounds at a specified zoom
      _getBoundsOffset: function(h, k, x) {
        var V = nA(
          this.project(k.getNorthEast(), x),
          this.project(k.getSouthWest(), x)
        ), eA = V.min.subtract(h.min), IA = V.max.subtract(h.max), mA = this._rebound(eA.x, -IA.x), fA = this._rebound(eA.y, -IA.y);
        return new O(mA, fA);
      },
      _rebound: function(h, k) {
        return h + k > 0 ? Math.round(h - k) / 2 : Math.max(0, Math.ceil(h)) - Math.max(0, Math.floor(k));
      },
      _limitZoom: function(h) {
        var k = this.getMinZoom(), x = this.getMaxZoom(), V = Je.any3d ? this.options.zoomSnap : 1;
        return V && (h = Math.round(h / V) * V), Math.max(k, Math.min(x, h));
      },
      _onPanTransitionStep: function() {
        this.fire("move");
      },
      _onPanTransitionEnd: function() {
        vi(this._mapPane, "leaflet-pan-anim"), this.fire("moveend");
      },
      _tryAnimatedPan: function(h, k) {
        var x = this._getCenterOffset(h)._trunc();
        return (k && k.animate) !== !0 && !this.getSize().contains(x) ? !1 : (this.panBy(x, k), !0);
      },
      _createAnimProxy: function() {
        var h = this._proxy = kt("div", "leaflet-proxy leaflet-zoom-animated");
        this._panes.mapPane.appendChild(h), this.on("zoomanim", function(k) {
          var x = tE, V = this._proxy.style[x];
          yA(this._proxy, this.project(k.center, k.zoom), this.getZoomScale(k.zoom, 1)), V === this._proxy.style[x] && this._animatingZoom && this._onZoomTransitionEnd();
        }, this), this.on("load moveend", this._animMoveEnd, this), this._on("unload", this._destroyAnimProxy, this);
      },
      _destroyAnimProxy: function() {
        fi(this._proxy), this.off("load moveend", this._animMoveEnd, this), delete this._proxy;
      },
      _animMoveEnd: function() {
        var h = this.getCenter(), k = this.getZoom();
        yA(this._proxy, this.project(h, k), this.getZoomScale(k, 1));
      },
      _catchTransitionEnd: function(h) {
        this._animatingZoom && h.propertyName.indexOf("transform") >= 0 && this._onZoomTransitionEnd();
      },
      _nothingToAnimate: function() {
        return !this._container.getElementsByClassName("leaflet-zoom-animated").length;
      },
      _tryAnimatedZoom: function(h, k, x) {
        if (this._animatingZoom)
          return !0;
        if (x = x || {}, !this._zoomAnimated || x.animate === !1 || this._nothingToAnimate() || Math.abs(k - this._zoom) > this.options.zoomAnimationThreshold)
          return !1;
        var V = this.getZoomScale(k), eA = this._getCenterOffset(h)._divideBy(1 - 1 / V);
        return x.animate !== !0 && !this.getSize().contains(eA) ? !1 : (p(function() {
          this._moveStart(!0, x.noMoveStart || !1)._animateZoom(h, k, !0);
        }, this), !0);
      },
      _animateZoom: function(h, k, x, V) {
        this._mapPane && (x && (this._animatingZoom = !0, this._animateToCenter = h, this._animateToZoom = k, It(this._mapPane, "leaflet-zoom-anim")), this.fire("zoomanim", {
          center: h,
          zoom: k,
          noUpdate: V
        }), this._tempFireZoomEvent || (this._tempFireZoomEvent = this._zoom !== this._animateToZoom), this._move(this._animateToCenter, this._animateToZoom, void 0, !0), setTimeout(g(this._onZoomTransitionEnd, this), 250));
      },
      _onZoomTransitionEnd: function() {
        this._animatingZoom && (this._mapPane && vi(this._mapPane, "leaflet-zoom-anim"), this._animatingZoom = !1, this._move(this._animateToCenter, this._animateToZoom, void 0, !0), this._tempFireZoomEvent && this.fire("zoom"), delete this._tempFireZoomEvent, this.fire("move"), this._moveEnd(!0));
      }
    });
    function R1(h, k) {
      return new Mt(h, k);
    }
    var ys = K.extend({
      // @section
      // @aka Control Options
      options: {
        // @option position: String = 'topright'
        // The position of the control (one of the map corners). Possible values are `'topleft'`,
        // `'topright'`, `'bottomleft'` or `'bottomright'`
        position: "topright"
      },
      initialize: function(h) {
        E(this, h);
      },
      /* @section
       * Classes extending L.Control will inherit the following methods:
       *
       * @method getPosition: string
       * Returns the position of the control.
       */
      getPosition: function() {
        return this.options.position;
      },
      // @method setPosition(position: string): this
      // Sets the position of the control.
      setPosition: function(h) {
        var k = this._map;
        return k && k.removeControl(this), this.options.position = h, k && k.addControl(this), this;
      },
      // @method getContainer: HTMLElement
      // Returns the HTMLElement that contains the control.
      getContainer: function() {
        return this._container;
      },
      // @method addTo(map: Map): this
      // Adds the control to the given map.
      addTo: function(h) {
        this.remove(), this._map = h;
        var k = this._container = this.onAdd(h), x = this.getPosition(), V = h._controlCorners[x];
        return It(k, "leaflet-control"), x.indexOf("bottom") !== -1 ? V.insertBefore(k, V.firstChild) : V.appendChild(k), this._map.on("unload", this.remove, this), this;
      },
      // @method remove: this
      // Removes the control from the map it is currently active on.
      remove: function() {
        return this._map ? (fi(this._container), this.onRemove && this.onRemove(this._map), this._map.off("unload", this.remove, this), this._map = null, this) : this;
      },
      _refocusOnMap: function(h) {
        this._map && h && h.screenX > 0 && h.screenY > 0 && this._map.getContainer().focus();
      }
    }), Eh = function(h) {
      return new ys(h);
    };
    Mt.include({
      // @method addControl(control: Control): this
      // Adds the given control to the map
      addControl: function(h) {
        return h.addTo(this), this;
      },
      // @method removeControl(control: Control): this
      // Removes the given control from the map
      removeControl: function(h) {
        return h.remove(), this;
      },
      _initControlPos: function() {
        var h = this._controlCorners = {}, k = "leaflet-", x = this._controlContainer = kt("div", k + "control-container", this._container);
        function V(eA, IA) {
          var mA = k + eA + " " + k + IA;
          h[eA + IA] = kt("div", mA, x);
        }
        V("top", "left"), V("top", "right"), V("bottom", "left"), V("bottom", "right");
      },
      _clearControlPos: function() {
        for (var h in this._controlCorners)
          fi(this._controlCorners[h]);
        fi(this._controlContainer), delete this._controlCorners, delete this._controlContainer;
      }
    });
    var F1 = ys.extend({
      // @section
      // @aka Control.Layers options
      options: {
        // @option collapsed: Boolean = true
        // If `true`, the control will be collapsed into an icon and expanded on mouse hover, touch, or keyboard activation.
        collapsed: !0,
        position: "topright",
        // @option autoZIndex: Boolean = true
        // If `true`, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
        autoZIndex: !0,
        // @option hideSingleBase: Boolean = false
        // If `true`, the base layers in the control will be hidden when there is only one.
        hideSingleBase: !1,
        // @option sortLayers: Boolean = false
        // Whether to sort the layers. When `false`, layers will keep the order
        // in which they were added to the control.
        sortLayers: !1,
        // @option sortFunction: Function = *
        // A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)
        // that will be used for sorting the layers, when `sortLayers` is `true`.
        // The function receives both the `L.Layer` instances and their names, as in
        // `sortFunction(layerA, layerB, nameA, nameB)`.
        // By default, it sorts layers alphabetically by their name.
        sortFunction: function(h, k, x, V) {
          return x < V ? -1 : V < x ? 1 : 0;
        }
      },
      initialize: function(h, k, x) {
        E(this, x), this._layerControlInputs = [], this._layers = [], this._lastZIndex = 0, this._handlingClick = !1, this._preventClick = !1;
        for (var V in h)
          this._addLayer(h[V], V);
        for (V in k)
          this._addLayer(k[V], V, !0);
      },
      onAdd: function(h) {
        this._initLayout(), this._update(), this._map = h, h.on("zoomend", this._checkDisabledLayers, this);
        for (var k = 0; k < this._layers.length; k++)
          this._layers[k].layer.on("add remove", this._onLayerChange, this);
        return this._container;
      },
      addTo: function(h) {
        return ys.prototype.addTo.call(this, h), this._expandIfNotCollapsed();
      },
      onRemove: function() {
        this._map.off("zoomend", this._checkDisabledLayers, this);
        for (var h = 0; h < this._layers.length; h++)
          this._layers[h].layer.off("add remove", this._onLayerChange, this);
      },
      // @method addBaseLayer(layer: Layer, name: String): this
      // Adds a base layer (radio button entry) with the given name to the control.
      addBaseLayer: function(h, k) {
        return this._addLayer(h, k), this._map ? this._update() : this;
      },
      // @method addOverlay(layer: Layer, name: String): this
      // Adds an overlay (checkbox entry) with the given name to the control.
      addOverlay: function(h, k) {
        return this._addLayer(h, k, !0), this._map ? this._update() : this;
      },
      // @method removeLayer(layer: Layer): this
      // Remove the given layer from the control.
      removeLayer: function(h) {
        h.off("add remove", this._onLayerChange, this);
        var k = this._getLayer(I(h));
        return k && this._layers.splice(this._layers.indexOf(k), 1), this._map ? this._update() : this;
      },
      // @method expand(): this
      // Expand the control container if collapsed.
      expand: function() {
        It(this._container, "leaflet-control-layers-expanded"), this._section.style.height = null;
        var h = this._map.getSize().y - (this._container.offsetTop + 50);
        return h < this._section.clientHeight ? (It(this._section, "leaflet-control-layers-scrollbar"), this._section.style.height = h + "px") : vi(this._section, "leaflet-control-layers-scrollbar"), this._checkDisabledLayers(), this;
      },
      // @method collapse(): this
      // Collapse the control container if expanded.
      collapse: function() {
        return vi(this._container, "leaflet-control-layers-expanded"), this;
      },
      _initLayout: function() {
        var h = "leaflet-control-layers", k = this._container = kt("div", h), x = this.options.collapsed;
        k.setAttribute("aria-haspopup", !0), ni(k), oE(k);
        var V = this._section = kt("section", h + "-list");
        x && (this._map.on("click", this.collapse, this), At(k, {
          mouseenter: this._expandSafely,
          mouseleave: this.collapse
        }, this));
        var eA = this._layersLink = kt("a", h + "-toggle", k);
        eA.href = "#", eA.title = "Layers", eA.setAttribute("role", "button"), At(eA, {
          keydown: function(IA) {
            IA.keyCode === 13 && this._expandSafely();
          },
          // Certain screen readers intercept the key event and instead send a click event
          click: function(IA) {
            pn(IA), this._expandSafely();
          }
        }, this), x || this.expand(), this._baseLayersList = kt("div", h + "-base", V), this._separator = kt("div", h + "-separator", V), this._overlaysList = kt("div", h + "-overlays", V), k.appendChild(V);
      },
      _getLayer: function(h) {
        for (var k = 0; k < this._layers.length; k++)
          if (this._layers[k] && I(this._layers[k].layer) === h)
            return this._layers[k];
      },
      _addLayer: function(h, k, x) {
        this._map && h.on("add remove", this._onLayerChange, this), this._layers.push({
          layer: h,
          name: k,
          overlay: x
        }), this.options.sortLayers && this._layers.sort(g(function(V, eA) {
          return this.options.sortFunction(V.layer, eA.layer, V.name, eA.name);
        }, this)), this.options.autoZIndex && h.setZIndex && (this._lastZIndex++, h.setZIndex(this._lastZIndex)), this._expandIfNotCollapsed();
      },
      _update: function() {
        if (!this._container)
          return this;
        SC(this._baseLayersList), SC(this._overlaysList), this._layerControlInputs = [];
        var h, k, x, V, eA = 0;
        for (x = 0; x < this._layers.length; x++)
          V = this._layers[x], this._addItem(V), k = k || V.overlay, h = h || !V.overlay, eA += V.overlay ? 0 : 1;
        return this.options.hideSingleBase && (h = h && eA > 1, this._baseLayersList.style.display = h ? "" : "none"), this._separator.style.display = k && h ? "" : "none", this;
      },
      _onLayerChange: function(h) {
        this._handlingClick || this._update();
        var k = this._getLayer(I(h.target)), x = k.overlay ? h.type === "add" ? "overlayadd" : "overlayremove" : h.type === "add" ? "baselayerchange" : null;
        x && this._map.fire(x, k);
      },
      // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see https://stackoverflow.com/a/119079)
      _createRadioElement: function(h, k) {
        var x = '<input type="radio" class="leaflet-control-layers-selector" name="' + h + '"' + (k ? ' checked="checked"' : "") + "/>", V = document.createElement("div");
        return V.innerHTML = x, V.firstChild;
      },
      _addItem: function(h) {
        var k = document.createElement("label"), x = this._map.hasLayer(h.layer), V;
        h.overlay ? (V = document.createElement("input"), V.type = "checkbox", V.className = "leaflet-control-layers-selector", V.defaultChecked = x) : V = this._createRadioElement("leaflet-base-layers_" + I(this), x), this._layerControlInputs.push(V), V.layerId = I(h.layer), At(V, "click", this._onInputClick, this);
        var eA = document.createElement("span");
        eA.innerHTML = " " + h.name;
        var IA = document.createElement("span");
        k.appendChild(IA), IA.appendChild(V), IA.appendChild(eA);
        var mA = h.overlay ? this._overlaysList : this._baseLayersList;
        return mA.appendChild(k), this._checkDisabledLayers(), k;
      },
      _onInputClick: function() {
        if (!this._preventClick) {
          var h = this._layerControlInputs, k, x, V = [], eA = [];
          this._handlingClick = !0;
          for (var IA = h.length - 1; IA >= 0; IA--)
            k = h[IA], x = this._getLayer(k.layerId).layer, k.checked ? V.push(x) : k.checked || eA.push(x);
          for (IA = 0; IA < eA.length; IA++)
            this._map.hasLayer(eA[IA]) && this._map.removeLayer(eA[IA]);
          for (IA = 0; IA < V.length; IA++)
            this._map.hasLayer(V[IA]) || this._map.addLayer(V[IA]);
          this._handlingClick = !1, this._refocusOnMap();
        }
      },
      _checkDisabledLayers: function() {
        for (var h = this._layerControlInputs, k, x, V = this._map.getZoom(), eA = h.length - 1; eA >= 0; eA--)
          k = h[eA], x = this._getLayer(k.layerId).layer, k.disabled = x.options.minZoom !== void 0 && V < x.options.minZoom || x.options.maxZoom !== void 0 && V > x.options.maxZoom;
      },
      _expandIfNotCollapsed: function() {
        return this._map && !this.options.collapsed && this.expand(), this;
      },
      _expandSafely: function() {
        var h = this._section;
        this._preventClick = !0, At(h, "click", pn), this.expand();
        var k = this;
        setTimeout(function() {
          Ri(h, "click", pn), k._preventClick = !1;
        });
      }
    }), V0 = function(h, k, x) {
      return new F1(h, k, x);
    }, X0 = ys.extend({
      // @section
      // @aka Control.Zoom options
      options: {
        position: "topleft",
        // @option zoomInText: String = '<span aria-hidden="true">+</span>'
        // The text set on the 'zoom in' button.
        zoomInText: '<span aria-hidden="true">+</span>',
        // @option zoomInTitle: String = 'Zoom in'
        // The title set on the 'zoom in' button.
        zoomInTitle: "Zoom in",
        // @option zoomOutText: String = '<span aria-hidden="true">&#x2212;</span>'
        // The text set on the 'zoom out' button.
        zoomOutText: '<span aria-hidden="true">&#x2212;</span>',
        // @option zoomOutTitle: String = 'Zoom out'
        // The title set on the 'zoom out' button.
        zoomOutTitle: "Zoom out"
      },
      onAdd: function(h) {
        var k = "leaflet-control-zoom", x = kt("div", k + " leaflet-bar"), V = this.options;
        return this._zoomInButton = this._createButton(
          V.zoomInText,
          V.zoomInTitle,
          k + "-in",
          x,
          this._zoomIn
        ), this._zoomOutButton = this._createButton(
          V.zoomOutText,
          V.zoomOutTitle,
          k + "-out",
          x,
          this._zoomOut
        ), this._updateDisabled(), h.on("zoomend zoomlevelschange", this._updateDisabled, this), x;
      },
      onRemove: function(h) {
        h.off("zoomend zoomlevelschange", this._updateDisabled, this);
      },
      disable: function() {
        return this._disabled = !0, this._updateDisabled(), this;
      },
      enable: function() {
        return this._disabled = !1, this._updateDisabled(), this;
      },
      _zoomIn: function(h) {
        !this._disabled && this._map._zoom < this._map.getMaxZoom() && this._map.zoomIn(this._map.options.zoomDelta * (h.shiftKey ? 3 : 1));
      },
      _zoomOut: function(h) {
        !this._disabled && this._map._zoom > this._map.getMinZoom() && this._map.zoomOut(this._map.options.zoomDelta * (h.shiftKey ? 3 : 1));
      },
      _createButton: function(h, k, x, V, eA) {
        var IA = kt("a", x, V);
        return IA.innerHTML = h, IA.href = "#", IA.title = k, IA.setAttribute("role", "button"), IA.setAttribute("aria-label", k), ni(IA), At(IA, "click", da), At(IA, "click", eA, this), At(IA, "click", this._refocusOnMap, this), IA;
      },
      _updateDisabled: function() {
        var h = this._map, k = "leaflet-disabled";
        vi(this._zoomInButton, k), vi(this._zoomOutButton, k), this._zoomInButton.setAttribute("aria-disabled", "false"), this._zoomOutButton.setAttribute("aria-disabled", "false"), (this._disabled || h._zoom === h.getMinZoom()) && (It(this._zoomOutButton, k), this._zoomOutButton.setAttribute("aria-disabled", "true")), (this._disabled || h._zoom === h.getMaxZoom()) && (It(this._zoomInButton, k), this._zoomInButton.setAttribute("aria-disabled", "true"));
      }
    });
    Mt.mergeOptions({
      zoomControl: !0
    }), Mt.addInitHook(function() {
      this.options.zoomControl && (this.zoomControl = new X0(), this.addControl(this.zoomControl));
    });
    var z0 = function(h) {
      return new X0(h);
    }, T0 = ys.extend({
      // @section
      // @aka Control.Scale options
      options: {
        position: "bottomleft",
        // @option maxWidth: Number = 100
        // Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
        maxWidth: 100,
        // @option metric: Boolean = True
        // Whether to show the metric scale line (m/km).
        metric: !0,
        // @option imperial: Boolean = True
        // Whether to show the imperial scale line (mi/ft).
        imperial: !0
        // @option updateWhenIdle: Boolean = false
        // If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).
      },
      onAdd: function(h) {
        var k = "leaflet-control-scale", x = kt("div", k), V = this.options;
        return this._addScales(V, k + "-line", x), h.on(V.updateWhenIdle ? "moveend" : "move", this._update, this), h.whenReady(this._update, this), x;
      },
      onRemove: function(h) {
        h.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this);
      },
      _addScales: function(h, k, x) {
        h.metric && (this._mScale = kt("div", k, x)), h.imperial && (this._iScale = kt("div", k, x));
      },
      _update: function() {
        var h = this._map, k = h.getSize().y / 2, x = h.distance(
          h.containerPointToLatLng([0, k]),
          h.containerPointToLatLng([this.options.maxWidth, k])
        );
        this._updateScales(x);
      },
      _updateScales: function(h) {
        this.options.metric && h && this._updateMetric(h), this.options.imperial && h && this._updateImperial(h);
      },
      _updateMetric: function(h) {
        var k = this._getRoundNum(h), x = k < 1e3 ? k + " m" : k / 1e3 + " km";
        this._updateScale(this._mScale, x, k / h);
      },
      _updateImperial: function(h) {
        var k = h * 3.2808399, x, V, eA;
        k > 5280 ? (x = k / 5280, V = this._getRoundNum(x), this._updateScale(this._iScale, V + " mi", V / x)) : (eA = this._getRoundNum(k), this._updateScale(this._iScale, eA + " ft", eA / k));
      },
      _updateScale: function(h, k, x) {
        h.style.width = Math.round(this.options.maxWidth * x) + "px", h.innerHTML = k;
      },
      _getRoundNum: function(h) {
        var k = Math.pow(10, (Math.floor(h) + "").length - 1), x = h / k;
        return x = x >= 10 ? 10 : x >= 5 ? 5 : x >= 3 ? 3 : x >= 2 ? 2 : 1, k * x;
      }
    }), c9 = function(h) {
      return new T0(h);
    }, uh = '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>', ZG = ys.extend({
      // @section
      // @aka Control.Attribution options
      options: {
        position: "bottomright",
        // @option prefix: String|false = 'Leaflet'
        // The HTML text shown before the attributions. Pass `false` to disable.
        prefix: '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">' + (Je.inlineSvg ? uh + " " : "") + "Leaflet</a>"
      },
      initialize: function(h) {
        E(this, h), this._attributions = {};
      },
      onAdd: function(h) {
        h.attributionControl = this, this._container = kt("div", "leaflet-control-attribution"), ni(this._container);
        for (var k in h._layers)
          h._layers[k].getAttribution && this.addAttribution(h._layers[k].getAttribution());
        return this._update(), h.on("layeradd", this._addAttribution, this), this._container;
      },
      onRemove: function(h) {
        h.off("layeradd", this._addAttribution, this);
      },
      _addAttribution: function(h) {
        h.layer.getAttribution && (this.addAttribution(h.layer.getAttribution()), h.layer.once("remove", function() {
          this.removeAttribution(h.layer.getAttribution());
        }, this));
      },
      // @method setPrefix(prefix: String|false): this
      // The HTML text shown before the attributions. Pass `false` to disable.
      setPrefix: function(h) {
        return this.options.prefix = h, this._update(), this;
      },
      // @method addAttribution(text: String): this
      // Adds an attribution text (e.g. `'&copy; OpenStreetMap contributors'`).
      addAttribution: function(h) {
        return h ? (this._attributions[h] || (this._attributions[h] = 0), this._attributions[h]++, this._update(), this) : this;
      },
      // @method removeAttribution(text: String): this
      // Removes an attribution text.
      removeAttribution: function(h) {
        return h ? (this._attributions[h] && (this._attributions[h]--, this._update()), this) : this;
      },
      _update: function() {
        if (this._map) {
          var h = [];
          for (var k in this._attributions)
            this._attributions[k] && h.push(k);
          var x = [];
          this.options.prefix && x.push(this.options.prefix), h.length && x.push(h.join(", ")), this._container.innerHTML = x.join(' <span aria-hidden="true">|</span> ');
        }
      }
    });
    Mt.mergeOptions({
      attributionControl: !0
    }), Mt.addInitHook(function() {
      this.options.attributionControl && new ZG().addTo(this);
    });
    var WG = function(h) {
      return new ZG(h);
    };
    ys.Layers = F1, ys.Zoom = X0, ys.Scale = T0, ys.Attribution = ZG, Eh.layers = V0, Eh.zoom = z0, Eh.scale = c9, Eh.attribution = WG;
    var vg = K.extend({
      initialize: function(h) {
        this._map = h;
      },
      // @method enable(): this
      // Enables the handler
      enable: function() {
        return this._enabled ? this : (this._enabled = !0, this.addHooks(), this);
      },
      // @method disable(): this
      // Disables the handler
      disable: function() {
        return this._enabled ? (this._enabled = !1, this.removeHooks(), this) : this;
      },
      // @method enabled(): Boolean
      // Returns `true` if the handler is enabled
      enabled: function() {
        return !!this._enabled;
      }
      // @section Extension methods
      // Classes inheriting from `Handler` must implement the two following methods:
      // @method addHooks()
      // Called when the handler is enabled, should add event hooks.
      // @method removeHooks()
      // Called when the handler is disabled, should remove the event hooks added previously.
    });
    vg.addTo = function(h, k) {
      return h.addHandler(k, this), this;
    };
    var dh = { Events: j }, hh = Je.touch ? "touchstart mousedown" : "mousedown", pr = q.extend({
      options: {
        // @section
        // @aka Draggable options
        // @option clickTolerance: Number = 3
        // The max number of pixels a user can shift the mouse pointer during a click
        // for it to be considered a valid click (as opposed to a mouse drag).
        clickTolerance: 3
      },
      // @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)
      // Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).
      initialize: function(h, k, x, V) {
        E(this, V), this._element = h, this._dragStartTarget = k || h, this._preventOutline = x;
      },
      // @method enable()
      // Enables the dragging ability
      enable: function() {
        this._enabled || (At(this._dragStartTarget, hh, this._onDown, this), this._enabled = !0);
      },
      // @method disable()
      // Disables the dragging ability
      disable: function() {
        this._enabled && (pr._dragging === this && this.finishDrag(!0), Ri(this._dragStartTarget, hh, this._onDown, this), this._enabled = !1, this._moved = !1);
      },
      _onDown: function(h) {
        if (this._enabled && (this._moved = !1, !iE(this._element, "leaflet-zoom-anim"))) {
          if (h.touches && h.touches.length !== 1) {
            pr._dragging === this && this.finishDrag();
            return;
          }
          if (!(pr._dragging || h.shiftKey || h.which !== 1 && h.button !== 1 && !h.touches) && (pr._dragging = this, this._preventOutline && cI(this._element), xg(), Fe(), !this._moving)) {
            this.fire("down");
            var k = h.touches ? h.touches[0] : h, x = WC(this._element);
            this._startPoint = new O(k.clientX, k.clientY), this._startPos = OA(this._element), this._parentScale = nE(x);
            var V = h.type === "mousedown";
            At(document, V ? "mousemove" : "touchmove", this._onMove, this), At(document, V ? "mouseup" : "touchend touchcancel", this._onUp, this);
          }
        }
      },
      _onMove: function(h) {
        if (this._enabled) {
          if (h.touches && h.touches.length > 1) {
            this._moved = !0;
            return;
          }
          var k = h.touches && h.touches.length === 1 ? h.touches[0] : h, x = new O(k.clientX, k.clientY)._subtract(this._startPoint);
          !x.x && !x.y || Math.abs(x.x) + Math.abs(x.y) < this.options.clickTolerance || (x.x /= this._parentScale.x, x.y /= this._parentScale.y, pn(h), this._moved || (this.fire("dragstart"), this._moved = !0, It(document.body, "leaflet-dragging"), this._lastTarget = h.target || h.srcElement, window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance && (this._lastTarget = this._lastTarget.correspondingUseElement), It(this._lastTarget, "leaflet-drag-target")), this._newPos = this._startPos.add(x), this._moving = !0, this._lastEvent = h, this._updatePosition());
        }
      },
      _updatePosition: function() {
        var h = { originalEvent: this._lastEvent };
        this.fire("predrag", h), YA(this._element, this._newPos), this.fire("drag", h);
      },
      _onUp: function() {
        this._enabled && this.finishDrag();
      },
      finishDrag: function(h) {
        vi(document.body, "leaflet-dragging"), this._lastTarget && (vi(this._lastTarget, "leaflet-drag-target"), this._lastTarget = null), Ri(document, "mousemove touchmove", this._onMove, this), Ri(document, "mouseup touchend touchcancel", this._onUp, this), Lg(), Ve();
        var k = this._moved && this._moving;
        this._moving = !1, pr._dragging = !1, k && this.fire("dragend", {
          noInertia: h,
          distance: this._newPos.distanceTo(this._startPos)
        });
      }
    });
    function KG(h, k, x) {
      var V, eA = [1, 4, 2, 8], IA, mA, fA, JA, XA, he, Oe, Rt;
      for (IA = 0, he = h.length; IA < he; IA++)
        h[IA]._code = VC(h[IA], k);
      for (fA = 0; fA < 4; fA++) {
        for (Oe = eA[fA], V = [], IA = 0, he = h.length, mA = he - 1; IA < he; mA = IA++)
          JA = h[IA], XA = h[mA], JA._code & Oe ? XA._code & Oe || (Rt = Pl(XA, JA, Oe, k, x), Rt._code = VC(Rt, k), V.push(Rt)) : (XA._code & Oe && (Rt = Pl(XA, JA, Oe, k, x), Rt._code = VC(Rt, k), V.push(Rt)), V.push(JA));
        h = V;
      }
      return h;
    }
    function UG(h, k) {
      var x, V, eA, IA, mA, fA, JA, XA, he;
      if (!h || h.length === 0)
        throw new Error("latlngs not passed");
      rg(h) || (console.warn("latlngs are not flat! Only the first ring will be used"), h = h[0]);
      var Oe = sA([0, 0]), Rt = gA(h), Zg = Rt.getNorthWest().distanceTo(Rt.getSouthWest()) * Rt.getNorthEast().distanceTo(Rt.getNorthWest());
      Zg < 1700 && (Oe = mh(h));
      var wo = h.length, ha = [];
      for (x = 0; x < wo; x++) {
        var bs = sA(h[x]);
        ha.push(k.project(sA([bs.lat - Oe.lat, bs.lng - Oe.lng])));
      }
      for (fA = JA = XA = 0, x = 0, V = wo - 1; x < wo; V = x++)
        eA = ha[x], IA = ha[V], mA = eA.y * IA.x - IA.y * eA.x, JA += (eA.x + IA.x) * mA, XA += (eA.y + IA.y) * mA, fA += mA * 3;
      fA === 0 ? he = ha[0] : he = [JA / fA, XA / fA];
      var P0 = k.unproject(_(he));
      return sA([P0.lat + Oe.lat, P0.lng + Oe.lng]);
    }
    function mh(h) {
      for (var k = 0, x = 0, V = 0, eA = 0; eA < h.length; eA++) {
        var IA = sA(h[eA]);
        k += IA.lat, x += IA.lng, V++;
      }
      return sA([k / V, x / V]);
    }
    var Hg = {
      __proto__: null,
      clipPolygon: KG,
      polygonCenter: UG,
      centroid: mh
    };
    function VG(h, k) {
      if (!k || !h.length)
        return h.slice();
      var x = k * k;
      return h = x1(h, x), h = M1(h, x), h;
    }
    function _0(h, k, x) {
      return Math.sqrt(IE(h, k, x, !0));
    }
    function Q9(h, k, x) {
      return IE(h, k, x);
    }
    function M1(h, k) {
      var x = h.length, V = typeof Uint8Array != void 0 + "" ? Uint8Array : Array, eA = new V(x);
      eA[0] = eA[x - 1] = 1, sE(h, eA, k, 0, x - 1);
      var IA, mA = [];
      for (IA = 0; IA < x; IA++)
        eA[IA] && mA.push(h[IA]);
      return mA;
    }
    function sE(h, k, x, V, eA) {
      var IA = 0, mA, fA, JA;
      for (fA = V + 1; fA <= eA - 1; fA++)
        JA = IE(h[fA], h[V], h[eA], !0), JA > IA && (mA = fA, IA = JA);
      IA > x && (k[mA] = 1, sE(h, k, x, V, mA), sE(h, k, x, mA, eA));
    }
    function x1(h, k) {
      for (var x = [h[0]], V = 1, eA = 0, IA = h.length; V < IA; V++)
        L1(h[V], h[eA]) > k && (x.push(h[V]), eA = V);
      return eA < IA - 1 && x.push(h[IA - 1]), x;
    }
    var XG;
    function ph(h, k, x, V, eA) {
      var IA = V ? XG : VC(h, x), mA = VC(k, x), fA, JA, XA;
      for (XG = mA; ; ) {
        if (!(IA | mA))
          return [h, k];
        if (IA & mA)
          return !1;
        fA = IA || mA, JA = Pl(h, k, fA, x, eA), XA = VC(JA, x), fA === IA ? (h = JA, IA = XA) : (k = JA, mA = XA);
      }
    }
    function Pl(h, k, x, V, eA) {
      var IA = k.x - h.x, mA = k.y - h.y, fA = V.min, JA = V.max, XA, he;
      return x & 8 ? (XA = h.x + IA * (JA.y - h.y) / mA, he = JA.y) : x & 4 ? (XA = h.x + IA * (fA.y - h.y) / mA, he = fA.y) : x & 2 ? (XA = JA.x, he = h.y + mA * (JA.x - h.x) / IA) : x & 1 && (XA = fA.x, he = h.y + mA * (fA.x - h.x) / IA), new O(XA, he, eA);
    }
    function VC(h, k) {
      var x = 0;
      return h.x < k.min.x ? x |= 1 : h.x > k.max.x && (x |= 2), h.y < k.min.y ? x |= 4 : h.y > k.max.y && (x |= 8), x;
    }
    function L1(h, k) {
      var x = k.x - h.x, V = k.y - h.y;
      return x * x + V * V;
    }
    function IE(h, k, x, V) {
      var eA = k.x, IA = k.y, mA = x.x - eA, fA = x.y - IA, JA = mA * mA + fA * fA, XA;
      return JA > 0 && (XA = ((h.x - eA) * mA + (h.y - IA) * fA) / JA, XA > 1 ? (eA = x.x, IA = x.y) : XA > 0 && (eA += mA * XA, IA += fA * XA)), mA = h.x - eA, fA = h.y - IA, V ? mA * mA + fA * fA : new O(eA, IA);
    }
    function rg(h) {
      return !f(h[0]) || typeof h[0][0] != "object" && typeof h[0][0] < "u";
    }
    function zG(h) {
      return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."), rg(h);
    }
    function z(h, k) {
      var x, V, eA, IA, mA, fA, JA, XA;
      if (!h || h.length === 0)
        throw new Error("latlngs not passed");
      rg(h) || (console.warn("latlngs are not flat! Only the first ring will be used"), h = h[0]);
      var he = sA([0, 0]), Oe = gA(h), Rt = Oe.getNorthWest().distanceTo(Oe.getSouthWest()) * Oe.getNorthEast().distanceTo(Oe.getNorthWest());
      Rt < 1700 && (he = mh(h));
      var Zg = h.length, wo = [];
      for (x = 0; x < Zg; x++) {
        var ha = sA(h[x]);
        wo.push(k.project(sA([ha.lat - he.lat, ha.lng - he.lng])));
      }
      for (x = 0, V = 0; x < Zg - 1; x++)
        V += wo[x].distanceTo(wo[x + 1]) / 2;
      if (V === 0)
        XA = wo[0];
      else
        for (x = 0, IA = 0; x < Zg - 1; x++)
          if (mA = wo[x], fA = wo[x + 1], eA = mA.distanceTo(fA), IA += eA, IA > V) {
            JA = (IA - V) / eA, XA = [
              fA.x - JA * (fA.x - mA.x),
              fA.y - JA * (fA.y - mA.y)
            ];
            break;
          }
      var bs = k.unproject(_(XA));
      return sA([bs.lat + he.lat, bs.lng + he.lng]);
    }
    var iA = {
      __proto__: null,
      simplify: VG,
      pointToSegmentDistance: _0,
      closestPointOnSegment: Q9,
      clipSegment: ph,
      _getEdgeIntersection: Pl,
      _getBitCode: VC,
      _sqClosestPointOnSegment: IE,
      isFlat: rg,
      _flat: zG,
      polylineCenter: z
    }, CA = {
      project: function(h) {
        return new O(h.lng, h.lat);
      },
      unproject: function(h) {
        return new rA(h.y, h.x);
      },
      bounds: new tA([-180, -90], [180, 90])
    }, uA = {
      R: 6378137,
      R_MINOR: 6356752314245179e-9,
      bounds: new tA([-2003750834279e-5, -1549657073972e-5], [2003750834279e-5, 1876465623138e-5]),
      project: function(h) {
        var k = Math.PI / 180, x = this.R, V = h.lat * k, eA = this.R_MINOR / x, IA = Math.sqrt(1 - eA * eA), mA = IA * Math.sin(V), fA = Math.tan(Math.PI / 4 - V / 2) / Math.pow((1 - mA) / (1 + mA), IA / 2);
        return V = -x * Math.log(Math.max(fA, 1e-10)), new O(h.lng * k * x, V);
      },
      unproject: function(h) {
        for (var k = 180 / Math.PI, x = this.R, V = this.R_MINOR / x, eA = Math.sqrt(1 - V * V), IA = Math.exp(-h.y / x), mA = Math.PI / 2 - 2 * Math.atan(IA), fA = 0, JA = 0.1, XA; fA < 15 && Math.abs(JA) > 1e-7; fA++)
          XA = eA * Math.sin(mA), XA = Math.pow((1 - XA) / (1 + XA), eA / 2), JA = Math.PI / 2 - 2 * Math.atan(IA * XA) - mA, mA += JA;
        return new rA(mA * k, h.x * k / x);
      }
    }, kA = {
      __proto__: null,
      LonLat: CA,
      Mercator: uA,
      SphericalMercator: QA
    }, DA = n({}, cA, {
      code: "EPSG:3395",
      projection: uA,
      transformation: function() {
        var h = 0.5 / (Math.PI * uA.R);
        return EA(h, 0.5, -h, 0.5);
      }()
    }), SA = n({}, cA, {
      code: "EPSG:4326",
      projection: CA,
      transformation: EA(1 / 180, 1, -1 / 180, 0.5)
    }), te = n({}, lA, {
      projection: CA,
      transformation: EA(1, 0, -1, 0),
      scale: function(h) {
        return Math.pow(2, h);
      },
      zoom: function(h) {
        return Math.log(h) / Math.LN2;
      },
      distance: function(h, k) {
        var x = k.lng - h.lng, V = k.lat - h.lat;
        return Math.sqrt(x * x + V * V);
      },
      infinite: !0
    });
    lA.Earth = cA, lA.EPSG3395 = DA, lA.EPSG3857 = RA, lA.EPSG900913 = xA, lA.EPSG4326 = SA, lA.Simple = te;
    var Ge = q.extend({
      // Classes extending `L.Layer` will inherit the following options:
      options: {
        // @option pane: String = 'overlayPane'
        // By default the layer will be added to the map's [overlay pane](#map-overlaypane). Overriding this option will cause the layer to be placed on another pane by default.
        pane: "overlayPane",
        // @option attribution: String = null
        // String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
        attribution: null,
        bubblingMouseEvents: !0
      },
      /* @section
       * Classes extending `L.Layer` will inherit the following methods:
       *
       * @method addTo(map: Map|LayerGroup): this
       * Adds the layer to the given map or layer group.
       */
      addTo: function(h) {
        return h.addLayer(this), this;
      },
      // @method remove: this
      // Removes the layer from the map it is currently active on.
      remove: function() {
        return this.removeFrom(this._map || this._mapToAdd);
      },
      // @method removeFrom(map: Map): this
      // Removes the layer from the given map
      //
      // @alternative
      // @method removeFrom(group: LayerGroup): this
      // Removes the layer from the given `LayerGroup`
      removeFrom: function(h) {
        return h && h.removeLayer(this), this;
      },
      // @method getPane(name? : String): HTMLElement
      // Returns the `HTMLElement` representing the named pane on the map. If `name` is omitted, returns the pane for this layer.
      getPane: function(h) {
        return this._map.getPane(h ? this.options[h] || h : this.options.pane);
      },
      addInteractiveTarget: function(h) {
        return this._map._targets[I(h)] = this, this;
      },
      removeInteractiveTarget: function(h) {
        return delete this._map._targets[I(h)], this;
      },
      // @method getAttribution: String
      // Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution).
      getAttribution: function() {
        return this.options.attribution;
      },
      _layerAdd: function(h) {
        var k = h.target;
        if (k.hasLayer(this)) {
          if (this._map = k, this._zoomAnimated = k._zoomAnimated, this.getEvents) {
            var x = this.getEvents();
            k.on(x, this), this.once("remove", function() {
              k.off(x, this);
            }, this);
          }
          this.onAdd(k), this.fire("add"), k.fire("layeradd", { layer: this });
        }
      }
    });
    Mt.include({
      // @method addLayer(layer: Layer): this
      // Adds the given layer to the map
      addLayer: function(h) {
        if (!h._layerAdd)
          throw new Error("The provided object is not a Layer.");
        var k = I(h);
        return this._layers[k] ? this : (this._layers[k] = h, h._mapToAdd = this, h.beforeAdd && h.beforeAdd(this), this.whenReady(h._layerAdd, h), this);
      },
      // @method removeLayer(layer: Layer): this
      // Removes the given layer from the map.
      removeLayer: function(h) {
        var k = I(h);
        return this._layers[k] ? (this._loaded && h.onRemove(this), delete this._layers[k], this._loaded && (this.fire("layerremove", { layer: h }), h.fire("remove")), h._map = h._mapToAdd = null, this) : this;
      },
      // @method hasLayer(layer: Layer): Boolean
      // Returns `true` if the given layer is currently added to the map
      hasLayer: function(h) {
        return I(h) in this._layers;
      },
      /* @method eachLayer(fn: Function, context?: Object): this
       * Iterates over the layers of the map, optionally specifying context of the iterator function.
       * ```
       * map.eachLayer(function(layer){
       *     layer.bindPopup('Hello');
       * });
       * ```
       */
      eachLayer: function(h, k) {
        for (var x in this._layers)
          h.call(k, this._layers[x]);
        return this;
      },
      _addLayers: function(h) {
        h = h ? f(h) ? h : [h] : [];
        for (var k = 0, x = h.length; k < x; k++)
          this.addLayer(h[k]);
      },
      _addZoomLimit: function(h) {
        (!isNaN(h.options.maxZoom) || !isNaN(h.options.minZoom)) && (this._zoomBoundLayers[I(h)] = h, this._updateZoomLevels());
      },
      _removeZoomLimit: function(h) {
        var k = I(h);
        this._zoomBoundLayers[k] && (delete this._zoomBoundLayers[k], this._updateZoomLevels());
      },
      _updateZoomLevels: function() {
        var h = 1 / 0, k = -1 / 0, x = this._getZoomSpan();
        for (var V in this._zoomBoundLayers) {
          var eA = this._zoomBoundLayers[V].options;
          h = eA.minZoom === void 0 ? h : Math.min(h, eA.minZoom), k = eA.maxZoom === void 0 ? k : Math.max(k, eA.maxZoom);
        }
        this._layersMaxZoom = k === -1 / 0 ? void 0 : k, this._layersMinZoom = h === 1 / 0 ? void 0 : h, x !== this._getZoomSpan() && this.fire("zoomlevelschange"), this.options.maxZoom === void 0 && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom && this.setZoom(this._layersMaxZoom), this.options.minZoom === void 0 && this._layersMinZoom && this.getZoom() < this._layersMinZoom && this.setZoom(this._layersMinZoom);
      }
    });
    var ot = Ge.extend({
      initialize: function(h, k) {
        E(this, k), this._layers = {};
        var x, V;
        if (h)
          for (x = 0, V = h.length; x < V; x++)
            this.addLayer(h[x]);
      },
      // @method addLayer(layer: Layer): this
      // Adds the given layer to the group.
      addLayer: function(h) {
        var k = this.getLayerId(h);
        return this._layers[k] = h, this._map && this._map.addLayer(h), this;
      },
      // @method removeLayer(layer: Layer): this
      // Removes the given layer from the group.
      // @alternative
      // @method removeLayer(id: Number): this
      // Removes the layer with the given internal ID from the group.
      removeLayer: function(h) {
        var k = h in this._layers ? h : this.getLayerId(h);
        return this._map && this._layers[k] && this._map.removeLayer(this._layers[k]), delete this._layers[k], this;
      },
      // @method hasLayer(layer: Layer): Boolean
      // Returns `true` if the given layer is currently added to the group.
      // @alternative
      // @method hasLayer(id: Number): Boolean
      // Returns `true` if the given internal ID is currently added to the group.
      hasLayer: function(h) {
        var k = typeof h == "number" ? h : this.getLayerId(h);
        return k in this._layers;
      },
      // @method clearLayers(): this
      // Removes all the layers from the group.
      clearLayers: function() {
        return this.eachLayer(this.removeLayer, this);
      },
      // @method invoke(methodName: String, …): this
      // Calls `methodName` on every layer contained in this group, passing any
      // additional parameters. Has no effect if the layers contained do not
      // implement `methodName`.
      invoke: function(h) {
        var k = Array.prototype.slice.call(arguments, 1), x, V;
        for (x in this._layers)
          V = this._layers[x], V[h] && V[h].apply(V, k);
        return this;
      },
      onAdd: function(h) {
        this.eachLayer(h.addLayer, h);
      },
      onRemove: function(h) {
        this.eachLayer(h.removeLayer, h);
      },
      // @method eachLayer(fn: Function, context?: Object): this
      // Iterates over the layers of the group, optionally specifying context of the iterator function.
      // ```js
      // group.eachLayer(function (layer) {
      // 	layer.bindPopup('Hello');
      // });
      // ```
      eachLayer: function(h, k) {
        for (var x in this._layers)
          h.call(k, this._layers[x]);
        return this;
      },
      // @method getLayer(id: Number): Layer
      // Returns the layer with the given internal ID.
      getLayer: function(h) {
        return this._layers[h];
      },
      // @method getLayers(): Layer[]
      // Returns an array of all the layers added to the group.
      getLayers: function() {
        var h = [];
        return this.eachLayer(h.push, h), h;
      },
      // @method setZIndex(zIndex: Number): this
      // Calls `setZIndex` on every layer contained in this group, passing the z-index.
      setZIndex: function(h) {
        return this.invoke("setZIndex", h);
      },
      // @method getLayerId(layer: Layer): Number
      // Returns the internal ID for a layer
      getLayerId: function(h) {
        return I(h);
      }
    }), Et = function(h, k) {
      return new ot(h, k);
    }, Wt = ot.extend({
      addLayer: function(h) {
        return this.hasLayer(h) ? this : (h.addEventParent(this), ot.prototype.addLayer.call(this, h), this.fire("layeradd", { layer: h }));
      },
      removeLayer: function(h) {
        return this.hasLayer(h) ? (h in this._layers && (h = this._layers[h]), h.removeEventParent(this), ot.prototype.removeLayer.call(this, h), this.fire("layerremove", { layer: h })) : this;
      },
      // @method setStyle(style: Path options): this
      // Sets the given path options to each layer of the group that has a `setStyle` method.
      setStyle: function(h) {
        return this.invoke("setStyle", h);
      },
      // @method bringToFront(): this
      // Brings the layer group to the top of all other layers
      bringToFront: function() {
        return this.invoke("bringToFront");
      },
      // @method bringToBack(): this
      // Brings the layer group to the back of all other layers
      bringToBack: function() {
        return this.invoke("bringToBack");
      },
      // @method getBounds(): LatLngBounds
      // Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
      getBounds: function() {
        var h = new AA();
        for (var k in this._layers) {
          var x = this._layers[k];
          h.extend(x.getBounds ? x.getBounds() : x.getLatLng());
        }
        return h;
      }
    }), Sg = function(h, k) {
      return new Wt(h, k);
    }, bo = K.extend({
      /* @section
       * @aka Icon options
       *
       * @option iconUrl: String = null
       * **(required)** The URL to the icon image (absolute or relative to your script path).
       *
       * @option iconRetinaUrl: String = null
       * The URL to a retina sized version of the icon image (absolute or relative to your
       * script path). Used for Retina screen devices.
       *
       * @option iconSize: Point = null
       * Size of the icon image in pixels.
       *
       * @option iconAnchor: Point = null
       * The coordinates of the "tip" of the icon (relative to its top left corner). The icon
       * will be aligned so that this point is at the marker's geographical location. Centered
       * by default if size is specified, also can be set in CSS with negative margins.
       *
       * @option popupAnchor: Point = [0, 0]
       * The coordinates of the point from which popups will "open", relative to the icon anchor.
       *
       * @option tooltipAnchor: Point = [0, 0]
       * The coordinates of the point from which tooltips will "open", relative to the icon anchor.
       *
       * @option shadowUrl: String = null
       * The URL to the icon shadow image. If not specified, no shadow image will be created.
       *
       * @option shadowRetinaUrl: String = null
       *
       * @option shadowSize: Point = null
       * Size of the shadow image in pixels.
       *
       * @option shadowAnchor: Point = null
       * The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
       * as iconAnchor if not specified).
       *
       * @option className: String = ''
       * A custom class name to assign to both icon and shadow images. Empty by default.
       */
      options: {
        popupAnchor: [0, 0],
        tooltipAnchor: [0, 0],
        // @option crossOrigin: Boolean|String = false
        // Whether the crossOrigin attribute will be added to the tiles.
        // If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
        // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.
        crossOrigin: !1
      },
      initialize: function(h) {
        E(this, h);
      },
      // @method createIcon(oldIcon?: HTMLElement): HTMLElement
      // Called internally when the icon has to be shown, returns a `<img>` HTML element
      // styled according to the options.
      createIcon: function(h) {
        return this._createIcon("icon", h);
      },
      // @method createShadow(oldIcon?: HTMLElement): HTMLElement
      // As `createIcon`, but for the shadow beneath it.
      createShadow: function(h) {
        return this._createIcon("shadow", h);
      },
      _createIcon: function(h, k) {
        var x = this._getIconUrl(h);
        if (!x) {
          if (h === "icon")
            throw new Error("iconUrl not set in Icon options (see the docs).");
          return null;
        }
        var V = this._createImg(x, k && k.tagName === "IMG" ? k : null);
        return this._setIconStyles(V, h), (this.options.crossOrigin || this.options.crossOrigin === "") && (V.crossOrigin = this.options.crossOrigin === !0 ? "" : this.options.crossOrigin), V;
      },
      _setIconStyles: function(h, k) {
        var x = this.options, V = x[k + "Size"];
        typeof V == "number" && (V = [V, V]);
        var eA = _(V), IA = _(k === "shadow" && x.shadowAnchor || x.iconAnchor || eA && eA.divideBy(2, !0));
        h.className = "leaflet-marker-" + k + " " + (x.className || ""), IA && (h.style.marginLeft = -IA.x + "px", h.style.marginTop = -IA.y + "px"), eA && (h.style.width = eA.x + "px", h.style.height = eA.y + "px");
      },
      _createImg: function(h, k) {
        return k = k || document.createElement("img"), k.src = h, k;
      },
      _getIconUrl: function(h) {
        return Je.retina && this.options[h + "RetinaUrl"] || this.options[h + "Url"];
      }
    });
    function EI(h) {
      return new bo(h);
    }
    var XC = bo.extend({
      options: {
        iconUrl: "marker-icon.png",
        iconRetinaUrl: "marker-icon-2x.png",
        shadowUrl: "marker-shadow.png",
        iconSize: [25, 41],
        iconAnchor: [12, 41],
        popupAnchor: [1, -34],
        tooltipAnchor: [16, -28],
        shadowSize: [41, 41]
      },
      _getIconUrl: function(h) {
        return typeof XC.imagePath != "string" && (XC.imagePath = this._detectIconPath()), (this.options.imagePath || XC.imagePath) + bo.prototype._getIconUrl.call(this, h);
      },
      _stripUrl: function(h) {
        var k = function(x, V, eA) {
          var IA = V.exec(x);
          return IA && IA[eA];
        };
        return h = k(h, /^url\((['"])?(.+)\1\)$/, 2), h && k(h, /^(.*)marker-icon\.png$/, 1);
      },
      _detectIconPath: function() {
        var h = kt("div", "leaflet-default-icon-path", document.body), k = BI(h, "background-image") || BI(h, "backgroundImage");
        if (document.body.removeChild(h), k = this._stripUrl(k), k)
          return k;
        var x = document.querySelector('link[href$="leaflet.css"]');
        return x ? x.href.substring(0, x.href.length - 11 - 1) : "";
      }
    }), TG = vg.extend({
      initialize: function(h) {
        this._marker = h;
      },
      addHooks: function() {
        var h = this._marker._icon;
        this._draggable || (this._draggable = new pr(h, h, !0)), this._draggable.on({
          dragstart: this._onDragStart,
          predrag: this._onPreDrag,
          drag: this._onDrag,
          dragend: this._onDragEnd
        }, this).enable(), It(h, "leaflet-marker-draggable");
      },
      removeHooks: function() {
        this._draggable.off({
          dragstart: this._onDragStart,
          predrag: this._onPreDrag,
          drag: this._onDrag,
          dragend: this._onDragEnd
        }, this).disable(), this._marker._icon && vi(this._marker._icon, "leaflet-marker-draggable");
      },
      moved: function() {
        return this._draggable && this._draggable._moved;
      },
      _adjustPan: function(h) {
        var k = this._marker, x = k._map, V = this._marker.options.autoPanSpeed, eA = this._marker.options.autoPanPadding, IA = OA(k._icon), mA = x.getPixelBounds(), fA = x.getPixelOrigin(), JA = nA(
          mA.min._subtract(fA).add(eA),
          mA.max._subtract(fA).subtract(eA)
        );
        if (!JA.contains(IA)) {
          var XA = _(
            (Math.max(JA.max.x, IA.x) - JA.max.x) / (mA.max.x - JA.max.x) - (Math.min(JA.min.x, IA.x) - JA.min.x) / (mA.min.x - JA.min.x),
            (Math.max(JA.max.y, IA.y) - JA.max.y) / (mA.max.y - JA.max.y) - (Math.min(JA.min.y, IA.y) - JA.min.y) / (mA.min.y - JA.min.y)
          ).multiplyBy(V);
          x.panBy(XA, { animate: !1 }), this._draggable._newPos._add(XA), this._draggable._startPos._add(XA), YA(k._icon, this._draggable._newPos), this._onDrag(h), this._panRequest = p(this._adjustPan.bind(this, h));
        }
      },
      _onDragStart: function() {
        this._oldLatLng = this._marker.getLatLng(), this._marker.closePopup && this._marker.closePopup(), this._marker.fire("movestart").fire("dragstart");
      },
      _onPreDrag: function(h) {
        this._marker.options.autoPan && (N(this._panRequest), this._panRequest = p(this._adjustPan.bind(this, h)));
      },
      _onDrag: function(h) {
        var k = this._marker, x = k._shadow, V = OA(k._icon), eA = k._map.layerPointToLatLng(V);
        x && YA(x, V), k._latlng = eA, h.latlng = eA, h.oldLatLng = this._oldLatLng, k.fire("move", h).fire("drag", h);
      },
      _onDragEnd: function(h) {
        N(this._panRequest), delete this._oldLatLng, this._marker.fire("moveend").fire("dragend", h);
      }
    }), aE = Ge.extend({
      // @section
      // @aka Marker options
      options: {
        // @option icon: Icon = *
        // Icon instance to use for rendering the marker.
        // See [Icon documentation](#L.Icon) for details on how to customize the marker icon.
        // If not specified, a common instance of `L.Icon.Default` is used.
        icon: new XC(),
        // Option inherited from "Interactive layer" abstract class
        interactive: !0,
        // @option keyboard: Boolean = true
        // Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
        keyboard: !0,
        // @option title: String = ''
        // Text for the browser tooltip that appear on marker hover (no tooltip by default).
        // [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled).
        title: "",
        // @option alt: String = 'Marker'
        // Text for the `alt` attribute of the icon image.
        // [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled).
        alt: "Marker",
        // @option zIndexOffset: Number = 0
        // By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like `1000` (or high negative value, respectively).
        zIndexOffset: 0,
        // @option opacity: Number = 1.0
        // The opacity of the marker.
        opacity: 1,
        // @option riseOnHover: Boolean = false
        // If `true`, the marker will get on top of others when you hover the mouse over it.
        riseOnHover: !1,
        // @option riseOffset: Number = 250
        // The z-index offset used for the `riseOnHover` feature.
        riseOffset: 250,
        // @option pane: String = 'markerPane'
        // `Map pane` where the markers icon will be added.
        pane: "markerPane",
        // @option shadowPane: String = 'shadowPane'
        // `Map pane` where the markers shadow will be added.
        shadowPane: "shadowPane",
        // @option bubblingMouseEvents: Boolean = false
        // When `true`, a mouse event on this marker will trigger the same event on the map
        // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).
        bubblingMouseEvents: !1,
        // @option autoPanOnFocus: Boolean = true
        // When `true`, the map will pan whenever the marker is focused (via
        // e.g. pressing `tab` on the keyboard) to ensure the marker is
        // visible within the map's bounds
        autoPanOnFocus: !0,
        // @section Draggable marker options
        // @option draggable: Boolean = false
        // Whether the marker is draggable with mouse/touch or not.
        draggable: !1,
        // @option autoPan: Boolean = false
        // Whether to pan the map when dragging this marker near its edge or not.
        autoPan: !1,
        // @option autoPanPadding: Point = Point(50, 50)
        // Distance (in pixels to the left/right and to the top/bottom) of the
        // map edge to start panning the map.
        autoPanPadding: [50, 50],
        // @option autoPanSpeed: Number = 10
        // Number of pixels the map should pan by.
        autoPanSpeed: 10
      },
      /* @section
       *
       * In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods:
       */
      initialize: function(h, k) {
        E(this, k), this._latlng = sA(h);
      },
      onAdd: function(h) {
        this._zoomAnimated = this._zoomAnimated && h.options.markerZoomAnimation, this._zoomAnimated && h.on("zoomanim", this._animateZoom, this), this._initIcon(), this.update();
      },
      onRemove: function(h) {
        this.dragging && this.dragging.enabled() && (this.options.draggable = !0, this.dragging.removeHooks()), delete this.dragging, this._zoomAnimated && h.off("zoomanim", this._animateZoom, this), this._removeIcon(), this._removeShadow();
      },
      getEvents: function() {
        return {
          zoom: this.update,
          viewreset: this.update
        };
      },
      // @method getLatLng: LatLng
      // Returns the current geographical position of the marker.
      getLatLng: function() {
        return this._latlng;
      },
      // @method setLatLng(latlng: LatLng): this
      // Changes the marker position to the given point.
      setLatLng: function(h) {
        var k = this._latlng;
        return this._latlng = sA(h), this.update(), this.fire("move", { oldLatLng: k, latlng: this._latlng });
      },
      // @method setZIndexOffset(offset: Number): this
      // Changes the [zIndex offset](#marker-zindexoffset) of the marker.
      setZIndexOffset: function(h) {
        return this.options.zIndexOffset = h, this.update();
      },
      // @method getIcon: Icon
      // Returns the current icon used by the marker
      getIcon: function() {
        return this.options.icon;
      },
      // @method setIcon(icon: Icon): this
      // Changes the marker icon.
      setIcon: function(h) {
        return this.options.icon = h, this._map && (this._initIcon(), this.update()), this._popup && this.bindPopup(this._popup, this._popup.options), this;
      },
      getElement: function() {
        return this._icon;
      },
      update: function() {
        if (this._icon && this._map) {
          var h = this._map.latLngToLayerPoint(this._latlng).round();
          this._setPos(h);
        }
        return this;
      },
      _initIcon: function() {
        var h = this.options, k = "leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide"), x = h.icon.createIcon(this._icon), V = !1;
        x !== this._icon && (this._icon && this._removeIcon(), V = !0, h.title && (x.title = h.title), x.tagName === "IMG" && (x.alt = h.alt || "")), It(x, k), h.keyboard && (x.tabIndex = "0", x.setAttribute("role", "button")), this._icon = x, h.riseOnHover && this.on({
          mouseover: this._bringToFront,
          mouseout: this._resetZIndex
        }), this.options.autoPanOnFocus && At(x, "focus", this._panOnFocus, this);
        var eA = h.icon.createShadow(this._shadow), IA = !1;
        eA !== this._shadow && (this._removeShadow(), IA = !0), eA && (It(eA, k), eA.alt = ""), this._shadow = eA, h.opacity < 1 && this._updateOpacity(), V && this.getPane().appendChild(this._icon), this._initInteraction(), eA && IA && this.getPane(h.shadowPane).appendChild(this._shadow);
      },
      _removeIcon: function() {
        this.options.riseOnHover && this.off({
          mouseover: this._bringToFront,
          mouseout: this._resetZIndex
        }), this.options.autoPanOnFocus && Ri(this._icon, "focus", this._panOnFocus, this), fi(this._icon), this.removeInteractiveTarget(this._icon), this._icon = null;
      },
      _removeShadow: function() {
        this._shadow && fi(this._shadow), this._shadow = null;
      },
      _setPos: function(h) {
        this._icon && YA(this._icon, h), this._shadow && YA(this._shadow, h), this._zIndex = h.y + this.options.zIndexOffset, this._resetZIndex();
      },
      _updateZIndex: function(h) {
        this._icon && (this._icon.style.zIndex = this._zIndex + h);
      },
      _animateZoom: function(h) {
        var k = this._map._latLngToNewLayerPoint(this._latlng, h.zoom, h.center).round();
        this._setPos(k);
      },
      _initInteraction: function() {
        if (this.options.interactive && (It(this._icon, "leaflet-interactive"), this.addInteractiveTarget(this._icon), TG)) {
          var h = this.options.draggable;
          this.dragging && (h = this.dragging.enabled(), this.dragging.disable()), this.dragging = new TG(this), h && this.dragging.enable();
        }
      },
      // @method setOpacity(opacity: Number): this
      // Changes the opacity of the marker.
      setOpacity: function(h) {
        return this.options.opacity = h, this._map && this._updateOpacity(), this;
      },
      _updateOpacity: function() {
        var h = this.options.opacity;
        this._icon && BA(this._icon, h), this._shadow && BA(this._shadow, h);
      },
      _bringToFront: function() {
        this._updateZIndex(this.options.riseOffset);
      },
      _resetZIndex: function() {
        this._updateZIndex(0);
      },
      _panOnFocus: function() {
        var h = this._map;
        if (h) {
          var k = this.options.icon.options, x = k.iconSize ? _(k.iconSize) : _(0, 0), V = k.iconAnchor ? _(k.iconAnchor) : _(0, 0);
          h.panInside(this._latlng, {
            paddingTopLeft: V,
            paddingBottomRight: x.subtract(V)
          });
        }
      },
      _getPopupAnchor: function() {
        return this.options.icon.options.popupAnchor;
      },
      _getTooltipAnchor: function() {
        return this.options.icon.options.tooltipAnchor;
      }
    });
    function jOA(h, k) {
      return new aE(h, k);
    }
    var rE = Ge.extend({
      // @section
      // @aka Path options
      options: {
        // @option stroke: Boolean = true
        // Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles.
        stroke: !0,
        // @option color: String = '#3388ff'
        // Stroke color
        color: "#3388ff",
        // @option weight: Number = 3
        // Stroke width in pixels
        weight: 3,
        // @option opacity: Number = 1.0
        // Stroke opacity
        opacity: 1,
        // @option lineCap: String= 'round'
        // A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke.
        lineCap: "round",
        // @option lineJoin: String = 'round'
        // A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke.
        lineJoin: "round",
        // @option dashArray: String = null
        // A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
        dashArray: null,
        // @option dashOffset: String = null
        // A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
        dashOffset: null,
        // @option fill: Boolean = depends
        // Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles.
        fill: !1,
        // @option fillColor: String = *
        // Fill color. Defaults to the value of the [`color`](#path-color) option
        fillColor: null,
        // @option fillOpacity: Number = 0.2
        // Fill opacity.
        fillOpacity: 0.2,
        // @option fillRule: String = 'evenodd'
        // A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined.
        fillRule: "evenodd",
        // className: '',
        // Option inherited from "Interactive layer" abstract class
        interactive: !0,
        // @option bubblingMouseEvents: Boolean = true
        // When `true`, a mouse event on this path will trigger the same event on the map
        // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).
        bubblingMouseEvents: !0
      },
      beforeAdd: function(h) {
        this._renderer = h.getRenderer(this);
      },
      onAdd: function() {
        this._renderer._initPath(this), this._reset(), this._renderer._addPath(this);
      },
      onRemove: function() {
        this._renderer._removePath(this);
      },
      // @method redraw(): this
      // Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
      redraw: function() {
        return this._map && this._renderer._updatePath(this), this;
      },
      // @method setStyle(style: Path options): this
      // Changes the appearance of a Path based on the options in the `Path options` object.
      setStyle: function(h) {
        return E(this, h), this._renderer && (this._renderer._updateStyle(this), this.options.stroke && h && Object.prototype.hasOwnProperty.call(h, "weight") && this._updateBounds()), this;
      },
      // @method bringToFront(): this
      // Brings the layer to the top of all path layers.
      bringToFront: function() {
        return this._renderer && this._renderer._bringToFront(this), this;
      },
      // @method bringToBack(): this
      // Brings the layer to the bottom of all path layers.
      bringToBack: function() {
        return this._renderer && this._renderer._bringToBack(this), this;
      },
      getElement: function() {
        return this._path;
      },
      _reset: function() {
        this._project(), this._update();
      },
      _clickTolerance: function() {
        return (this.options.stroke ? this.options.weight / 2 : 0) + (this._renderer.options.tolerance || 0);
      }
    }), v1 = rE.extend({
      // @section
      // @aka CircleMarker options
      options: {
        fill: !0,
        // @option radius: Number = 10
        // Radius of the circle marker, in pixels
        radius: 10
      },
      initialize: function(h, k) {
        E(this, k), this._latlng = sA(h), this._radius = this.options.radius;
      },
      // @method setLatLng(latLng: LatLng): this
      // Sets the position of a circle marker to a new location.
      setLatLng: function(h) {
        var k = this._latlng;
        return this._latlng = sA(h), this.redraw(), this.fire("move", { oldLatLng: k, latlng: this._latlng });
      },
      // @method getLatLng(): LatLng
      // Returns the current geographical position of the circle marker
      getLatLng: function() {
        return this._latlng;
      },
      // @method setRadius(radius: Number): this
      // Sets the radius of a circle marker. Units are in pixels.
      setRadius: function(h) {
        return this.options.radius = this._radius = h, this.redraw();
      },
      // @method getRadius(): Number
      // Returns the current radius of the circle
      getRadius: function() {
        return this._radius;
      },
      setStyle: function(h) {
        var k = h && h.radius || this._radius;
        return rE.prototype.setStyle.call(this, h), this.setRadius(k), this;
      },
      _project: function() {
        this._point = this._map.latLngToLayerPoint(this._latlng), this._updateBounds();
      },
      _updateBounds: function() {
        var h = this._radius, k = this._radiusY || h, x = this._clickTolerance(), V = [h + x, k + x];
        this._pxBounds = new tA(this._point.subtract(V), this._point.add(V));
      },
      _update: function() {
        this._map && this._updatePath();
      },
      _updatePath: function() {
        this._renderer._updateCircle(this);
      },
      _empty: function() {
        return this._radius && !this._renderer._bounds.intersects(this._pxBounds);
      },
      // Needed by the `Canvas` renderer for interactivity
      _containsPoint: function(h) {
        return h.distanceTo(this._point) <= this._radius + this._clickTolerance();
      }
    });
    function POA(h, k) {
      return new v1(h, k);
    }
    var E9 = v1.extend({
      initialize: function(h, k, x) {
        if (typeof k == "number" && (k = n({}, x, { radius: k })), E(this, k), this._latlng = sA(h), isNaN(this.options.radius))
          throw new Error("Circle radius cannot be NaN");
        this._mRadius = this.options.radius;
      },
      // @method setRadius(radius: Number): this
      // Sets the radius of a circle. Units are in meters.
      setRadius: function(h) {
        return this._mRadius = h, this.redraw();
      },
      // @method getRadius(): Number
      // Returns the current radius of a circle. Units are in meters.
      getRadius: function() {
        return this._mRadius;
      },
      // @method getBounds(): LatLngBounds
      // Returns the `LatLngBounds` of the path.
      getBounds: function() {
        var h = [this._radius, this._radiusY || this._radius];
        return new AA(
          this._map.layerPointToLatLng(this._point.subtract(h)),
          this._map.layerPointToLatLng(this._point.add(h))
        );
      },
      setStyle: rE.prototype.setStyle,
      _project: function() {
        var h = this._latlng.lng, k = this._latlng.lat, x = this._map, V = x.options.crs;
        if (V.distance === cA.distance) {
          var eA = Math.PI / 180, IA = this._mRadius / cA.R / eA, mA = x.project([k + IA, h]), fA = x.project([k - IA, h]), JA = mA.add(fA).divideBy(2), XA = x.unproject(JA).lat, he = Math.acos((Math.cos(IA * eA) - Math.sin(k * eA) * Math.sin(XA * eA)) / (Math.cos(k * eA) * Math.cos(XA * eA))) / eA;
          (isNaN(he) || he === 0) && (he = IA / Math.cos(Math.PI / 180 * k)), this._point = JA.subtract(x.getPixelOrigin()), this._radius = isNaN(he) ? 0 : JA.x - x.project([XA, h - he]).x, this._radiusY = JA.y - mA.y;
        } else {
          var Oe = V.unproject(V.project(this._latlng).subtract([this._mRadius, 0]));
          this._point = x.latLngToLayerPoint(this._latlng), this._radius = this._point.x - x.latLngToLayerPoint(Oe).x;
        }
        this._updateBounds();
      }
    });
    function $OA(h, k, x) {
      return new E9(h, k, x);
    }
    var $l = rE.extend({
      // @section
      // @aka Polyline options
      options: {
        // @option smoothFactor: Number = 1.0
        // How much to simplify the polyline on each zoom level. More means
        // better performance and smoother look, and less means more accurate representation.
        smoothFactor: 1,
        // @option noClip: Boolean = false
        // Disable polyline clipping.
        noClip: !1
      },
      initialize: function(h, k) {
        E(this, k), this._setLatLngs(h);
      },
      // @method getLatLngs(): LatLng[]
      // Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
      getLatLngs: function() {
        return this._latlngs;
      },
      // @method setLatLngs(latlngs: LatLng[]): this
      // Replaces all the points in the polyline with the given array of geographical points.
      setLatLngs: function(h) {
        return this._setLatLngs(h), this.redraw();
      },
      // @method isEmpty(): Boolean
      // Returns `true` if the Polyline has no LatLngs.
      isEmpty: function() {
        return !this._latlngs.length;
      },
      // @method closestLayerPoint(p: Point): Point
      // Returns the point closest to `p` on the Polyline.
      closestLayerPoint: function(h) {
        for (var k = 1 / 0, x = null, V = IE, eA, IA, mA = 0, fA = this._parts.length; mA < fA; mA++)
          for (var JA = this._parts[mA], XA = 1, he = JA.length; XA < he; XA++) {
            eA = JA[XA - 1], IA = JA[XA];
            var Oe = V(h, eA, IA, !0);
            Oe < k && (k = Oe, x = V(h, eA, IA));
          }
        return x && (x.distance = Math.sqrt(k)), x;
      },
      // @method getCenter(): LatLng
      // Returns the center ([centroid](https://en.wikipedia.org/wiki/Centroid)) of the polyline.
      getCenter: function() {
        if (!this._map)
          throw new Error("Must add layer to map before using getCenter()");
        return z(this._defaultShape(), this._map.options.crs);
      },
      // @method getBounds(): LatLngBounds
      // Returns the `LatLngBounds` of the path.
      getBounds: function() {
        return this._bounds;
      },
      // @method addLatLng(latlng: LatLng, latlngs?: LatLng[]): this
      // Adds a given point to the polyline. By default, adds to the first ring of
      // the polyline in case of a multi-polyline, but can be overridden by passing
      // a specific ring as a LatLng array (that you can earlier access with [`getLatLngs`](#polyline-getlatlngs)).
      addLatLng: function(h, k) {
        return k = k || this._defaultShape(), h = sA(h), k.push(h), this._bounds.extend(h), this.redraw();
      },
      _setLatLngs: function(h) {
        this._bounds = new AA(), this._latlngs = this._convertLatLngs(h);
      },
      _defaultShape: function() {
        return rg(this._latlngs) ? this._latlngs : this._latlngs[0];
      },
      // recursively convert latlngs input into actual LatLng instances; calculate bounds along the way
      _convertLatLngs: function(h) {
        for (var k = [], x = rg(h), V = 0, eA = h.length; V < eA; V++)
          x ? (k[V] = sA(h[V]), this._bounds.extend(k[V])) : k[V] = this._convertLatLngs(h[V]);
        return k;
      },
      _project: function() {
        var h = new tA();
        this._rings = [], this._projectLatlngs(this._latlngs, this._rings, h), this._bounds.isValid() && h.isValid() && (this._rawPxBounds = h, this._updateBounds());
      },
      _updateBounds: function() {
        var h = this._clickTolerance(), k = new O(h, h);
        this._rawPxBounds && (this._pxBounds = new tA([
          this._rawPxBounds.min.subtract(k),
          this._rawPxBounds.max.add(k)
        ]));
      },
      // recursively turns latlngs into a set of rings with projected coordinates
      _projectLatlngs: function(h, k, x) {
        var V = h[0] instanceof rA, eA = h.length, IA, mA;
        if (V) {
          for (mA = [], IA = 0; IA < eA; IA++)
            mA[IA] = this._map.latLngToLayerPoint(h[IA]), x.extend(mA[IA]);
          k.push(mA);
        } else
          for (IA = 0; IA < eA; IA++)
            this._projectLatlngs(h[IA], k, x);
      },
      // clip polyline by renderer bounds so that we have less to render for performance
      _clipPoints: function() {
        var h = this._renderer._bounds;
        if (this._parts = [], !(!this._pxBounds || !this._pxBounds.intersects(h))) {
          if (this.options.noClip) {
            this._parts = this._rings;
            return;
          }
          var k = this._parts, x, V, eA, IA, mA, fA, JA;
          for (x = 0, eA = 0, IA = this._rings.length; x < IA; x++)
            for (JA = this._rings[x], V = 0, mA = JA.length; V < mA - 1; V++)
              fA = ph(JA[V], JA[V + 1], h, V, !0), fA && (k[eA] = k[eA] || [], k[eA].push(fA[0]), (fA[1] !== JA[V + 1] || V === mA - 2) && (k[eA].push(fA[1]), eA++));
        }
      },
      // simplify each clipped part of the polyline for performance
      _simplifyPoints: function() {
        for (var h = this._parts, k = this.options.smoothFactor, x = 0, V = h.length; x < V; x++)
          h[x] = VG(h[x], k);
      },
      _update: function() {
        this._map && (this._clipPoints(), this._simplifyPoints(), this._updatePath());
      },
      _updatePath: function() {
        this._renderer._updatePoly(this);
      },
      // Needed by the `Canvas` renderer for interactivity
      _containsPoint: function(h, k) {
        var x, V, eA, IA, mA, fA, JA = this._clickTolerance();
        if (!this._pxBounds || !this._pxBounds.contains(h))
          return !1;
        for (x = 0, IA = this._parts.length; x < IA; x++)
          for (fA = this._parts[x], V = 0, mA = fA.length, eA = mA - 1; V < mA; eA = V++)
            if (!(!k && V === 0) && _0(h, fA[eA], fA[V]) <= JA)
              return !0;
        return !1;
      }
    });
    function AjA(h, k) {
      return new $l(h, k);
    }
    $l._flat = zG;
    var q0 = $l.extend({
      options: {
        fill: !0
      },
      isEmpty: function() {
        return !this._latlngs.length || !this._latlngs[0].length;
      },
      // @method getCenter(): LatLng
      // Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the Polygon.
      getCenter: function() {
        if (!this._map)
          throw new Error("Must add layer to map before using getCenter()");
        return UG(this._defaultShape(), this._map.options.crs);
      },
      _convertLatLngs: function(h) {
        var k = $l.prototype._convertLatLngs.call(this, h), x = k.length;
        return x >= 2 && k[0] instanceof rA && k[0].equals(k[x - 1]) && k.pop(), k;
      },
      _setLatLngs: function(h) {
        $l.prototype._setLatLngs.call(this, h), rg(this._latlngs) && (this._latlngs = [this._latlngs]);
      },
      _defaultShape: function() {
        return rg(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];
      },
      _clipPoints: function() {
        var h = this._renderer._bounds, k = this.options.weight, x = new O(k, k);
        if (h = new tA(h.min.subtract(x), h.max.add(x)), this._parts = [], !(!this._pxBounds || !this._pxBounds.intersects(h))) {
          if (this.options.noClip) {
            this._parts = this._rings;
            return;
          }
          for (var V = 0, eA = this._rings.length, IA; V < eA; V++)
            IA = KG(this._rings[V], h, !0), IA.length && this._parts.push(IA);
        }
      },
      _updatePath: function() {
        this._renderer._updatePoly(this, !0);
      },
      // Needed by the `Canvas` renderer for interactivity
      _containsPoint: function(h) {
        var k = !1, x, V, eA, IA, mA, fA, JA, XA;
        if (!this._pxBounds || !this._pxBounds.contains(h))
          return !1;
        for (IA = 0, JA = this._parts.length; IA < JA; IA++)
          for (x = this._parts[IA], mA = 0, XA = x.length, fA = XA - 1; mA < XA; fA = mA++)
            V = x[mA], eA = x[fA], V.y > h.y != eA.y > h.y && h.x < (eA.x - V.x) * (h.y - V.y) / (eA.y - V.y) + V.x && (k = !k);
        return k || $l.prototype._containsPoint.call(this, h, !0);
      }
    });
    function ejA(h, k) {
      return new q0(h, k);
    }
    var Ac = Wt.extend({
      /* @section
       * @aka GeoJSON options
       *
       * @option pointToLayer: Function = *
       * A `Function` defining how GeoJSON points spawn Leaflet layers. It is internally
       * called when data is added, passing the GeoJSON point feature and its `LatLng`.
       * The default is to spawn a default `Marker`:
       * ```js
       * function(geoJsonPoint, latlng) {
       * 	return L.marker(latlng);
       * }
       * ```
       *
       * @option style: Function = *
       * A `Function` defining the `Path options` for styling GeoJSON lines and polygons,
       * called internally when data is added.
       * The default value is to not override any defaults:
       * ```js
       * function (geoJsonFeature) {
       * 	return {}
       * }
       * ```
       *
       * @option onEachFeature: Function = *
       * A `Function` that will be called once for each created `Feature`, after it has
       * been created and styled. Useful for attaching events and popups to features.
       * The default is to do nothing with the newly created layers:
       * ```js
       * function (feature, layer) {}
       * ```
       *
       * @option filter: Function = *
       * A `Function` that will be used to decide whether to include a feature or not.
       * The default is to include all features:
       * ```js
       * function (geoJsonFeature) {
       * 	return true;
       * }
       * ```
       * Note: dynamically changing the `filter` option will have effect only on newly
       * added data. It will _not_ re-evaluate already included features.
       *
       * @option coordsToLatLng: Function = *
       * A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.
       * The default is the `coordsToLatLng` static method.
       *
       * @option markersInheritOptions: Boolean = false
       * Whether default Markers for "Point" type Features inherit from group options.
       */
      initialize: function(h, k) {
        E(this, k), this._layers = {}, h && this.addData(h);
      },
      // @method addData( <GeoJSON> data ): this
      // Adds a GeoJSON object to the layer.
      addData: function(h) {
        var k = f(h) ? h : h.features, x, V, eA;
        if (k) {
          for (x = 0, V = k.length; x < V; x++)
            eA = k[x], (eA.geometries || eA.geometry || eA.features || eA.coordinates) && this.addData(eA);
          return this;
        }
        var IA = this.options;
        if (IA.filter && !IA.filter(h))
          return this;
        var mA = H1(h, IA);
        return mA ? (mA.feature = W1(h), mA.defaultOptions = mA.options, this.resetStyle(mA), IA.onEachFeature && IA.onEachFeature(h, mA), this.addLayer(mA)) : this;
      },
      // @method resetStyle( <Path> layer? ): this
      // Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
      // If `layer` is omitted, the style of all features in the current layer is reset.
      resetStyle: function(h) {
        return h === void 0 ? this.eachLayer(this.resetStyle, this) : (h.options = n({}, h.defaultOptions), this._setLayerStyle(h, this.options.style), this);
      },
      // @method setStyle( <Function> style ): this
      // Changes styles of GeoJSON vector layers with the given style function.
      setStyle: function(h) {
        return this.eachLayer(function(k) {
          this._setLayerStyle(k, h);
        }, this);
      },
      _setLayerStyle: function(h, k) {
        h.setStyle && (typeof k == "function" && (k = k(h.feature)), h.setStyle(k));
      }
    });
    function H1(h, k) {
      var x = h.type === "Feature" ? h.geometry : h, V = x ? x.coordinates : null, eA = [], IA = k && k.pointToLayer, mA = k && k.coordsToLatLng || u9, fA, JA, XA, he;
      if (!V && !x)
        return null;
      switch (x.type) {
        case "Point":
          return fA = mA(V), haA(IA, h, fA, k);
        case "MultiPoint":
          for (XA = 0, he = V.length; XA < he; XA++)
            fA = mA(V[XA]), eA.push(haA(IA, h, fA, k));
          return new Wt(eA);
        case "LineString":
        case "MultiLineString":
          return JA = S1(V, x.type === "LineString" ? 0 : 1, mA), new $l(JA, k);
        case "Polygon":
        case "MultiPolygon":
          return JA = S1(V, x.type === "Polygon" ? 1 : 2, mA), new q0(JA, k);
        case "GeometryCollection":
          for (XA = 0, he = x.geometries.length; XA < he; XA++) {
            var Oe = H1({
              geometry: x.geometries[XA],
              type: "Feature",
              properties: h.properties
            }, k);
            Oe && eA.push(Oe);
          }
          return new Wt(eA);
        case "FeatureCollection":
          for (XA = 0, he = x.features.length; XA < he; XA++) {
            var Rt = H1(x.features[XA], k);
            Rt && eA.push(Rt);
          }
          return new Wt(eA);
        default:
          throw new Error("Invalid GeoJSON object.");
      }
    }
    function haA(h, k, x, V) {
      return h ? h(k, x) : new aE(x, V && V.markersInheritOptions && V);
    }
    function u9(h) {
      return new rA(h[1], h[0], h[2]);
    }
    function S1(h, k, x) {
      for (var V = [], eA = 0, IA = h.length, mA; eA < IA; eA++)
        mA = k ? S1(h[eA], k - 1, x) : (x || u9)(h[eA]), V.push(mA);
      return V;
    }
    function d9(h, k) {
      return h = sA(h), h.alt !== void 0 ? [B(h.lng, k), B(h.lat, k), B(h.alt, k)] : [B(h.lng, k), B(h.lat, k)];
    }
    function Z1(h, k, x, V) {
      for (var eA = [], IA = 0, mA = h.length; IA < mA; IA++)
        eA.push(k ? Z1(h[IA], rg(h[IA]) ? 0 : k - 1, x, V) : d9(h[IA], V));
      return !k && x && eA.length > 0 && eA.push(eA[0].slice()), eA;
    }
    function O0(h, k) {
      return h.feature ? n({}, h.feature, { geometry: k }) : W1(k);
    }
    function W1(h) {
      return h.type === "Feature" || h.type === "FeatureCollection" ? h : {
        type: "Feature",
        properties: {},
        geometry: h
      };
    }
    var h9 = {
      toGeoJSON: function(h) {
        return O0(this, {
          type: "Point",
          coordinates: d9(this.getLatLng(), h)
        });
      }
    };
    aE.include(h9), E9.include(h9), v1.include(h9), $l.include({
      toGeoJSON: function(h) {
        var k = !rg(this._latlngs), x = Z1(this._latlngs, k ? 1 : 0, !1, h);
        return O0(this, {
          type: (k ? "Multi" : "") + "LineString",
          coordinates: x
        });
      }
    }), q0.include({
      toGeoJSON: function(h) {
        var k = !rg(this._latlngs), x = k && !rg(this._latlngs[0]), V = Z1(this._latlngs, x ? 2 : k ? 1 : 0, !0, h);
        return k || (V = [V]), O0(this, {
          type: (x ? "Multi" : "") + "Polygon",
          coordinates: V
        });
      }
    }), ot.include({
      toMultiPoint: function(h) {
        var k = [];
        return this.eachLayer(function(x) {
          k.push(x.toGeoJSON(h).geometry.coordinates);
        }), O0(this, {
          type: "MultiPoint",
          coordinates: k
        });
      },
      // @method toGeoJSON(precision?: Number|false): Object
      // Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.
      // Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`).
      toGeoJSON: function(h) {
        var k = this.feature && this.feature.geometry && this.feature.geometry.type;
        if (k === "MultiPoint")
          return this.toMultiPoint(h);
        var x = k === "GeometryCollection", V = [];
        return this.eachLayer(function(eA) {
          if (eA.toGeoJSON) {
            var IA = eA.toGeoJSON(h);
            if (x)
              V.push(IA.geometry);
            else {
              var mA = W1(IA);
              mA.type === "FeatureCollection" ? V.push.apply(V, mA.features) : V.push(mA);
            }
          }
        }), x ? O0(this, {
          geometries: V,
          type: "GeometryCollection"
        }) : {
          type: "FeatureCollection",
          features: V
        };
      }
    });
    function maA(h, k) {
      return new Ac(h, k);
    }
    var tjA = maA, K1 = Ge.extend({
      // @section
      // @aka ImageOverlay options
      options: {
        // @option opacity: Number = 1.0
        // The opacity of the image overlay.
        opacity: 1,
        // @option alt: String = ''
        // Text for the `alt` attribute of the image (useful for accessibility).
        alt: "",
        // @option interactive: Boolean = false
        // If `true`, the image overlay will emit [mouse events](#interactive-layer) when clicked or hovered.
        interactive: !1,
        // @option crossOrigin: Boolean|String = false
        // Whether the crossOrigin attribute will be added to the image.
        // If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
        // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.
        crossOrigin: !1,
        // @option errorOverlayUrl: String = ''
        // URL to the overlay image to show in place of the overlay that failed to load.
        errorOverlayUrl: "",
        // @option zIndex: Number = 1
        // The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer.
        zIndex: 1,
        // @option className: String = ''
        // A custom class name to assign to the image. Empty by default.
        className: ""
      },
      initialize: function(h, k, x) {
        this._url = h, this._bounds = gA(k), E(this, x);
      },
      onAdd: function() {
        this._image || (this._initImage(), this.options.opacity < 1 && this._updateOpacity()), this.options.interactive && (It(this._image, "leaflet-interactive"), this.addInteractiveTarget(this._image)), this.getPane().appendChild(this._image), this._reset();
      },
      onRemove: function() {
        fi(this._image), this.options.interactive && this.removeInteractiveTarget(this._image);
      },
      // @method setOpacity(opacity: Number): this
      // Sets the opacity of the overlay.
      setOpacity: function(h) {
        return this.options.opacity = h, this._image && this._updateOpacity(), this;
      },
      setStyle: function(h) {
        return h.opacity && this.setOpacity(h.opacity), this;
      },
      // @method bringToFront(): this
      // Brings the layer to the top of all overlays.
      bringToFront: function() {
        return this._map && Ea(this._image), this;
      },
      // @method bringToBack(): this
      // Brings the layer to the bottom of all overlays.
      bringToBack: function() {
        return this._map && lI(this._image), this;
      },
      // @method setUrl(url: String): this
      // Changes the URL of the image.
      setUrl: function(h) {
        return this._url = h, this._image && (this._image.src = h), this;
      },
      // @method setBounds(bounds: LatLngBounds): this
      // Update the bounds that this ImageOverlay covers
      setBounds: function(h) {
        return this._bounds = gA(h), this._map && this._reset(), this;
      },
      getEvents: function() {
        var h = {
          zoom: this._reset,
          viewreset: this._reset
        };
        return this._zoomAnimated && (h.zoomanim = this._animateZoom), h;
      },
      // @method setZIndex(value: Number): this
      // Changes the [zIndex](#imageoverlay-zindex) of the image overlay.
      setZIndex: function(h) {
        return this.options.zIndex = h, this._updateZIndex(), this;
      },
      // @method getBounds(): LatLngBounds
      // Get the bounds that this ImageOverlay covers
      getBounds: function() {
        return this._bounds;
      },
      // @method getElement(): HTMLElement
      // Returns the instance of [`HTMLImageElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement)
      // used by this overlay.
      getElement: function() {
        return this._image;
      },
      _initImage: function() {
        var h = this._url.tagName === "IMG", k = this._image = h ? this._url : kt("img");
        if (It(k, "leaflet-image-layer"), this._zoomAnimated && It(k, "leaflet-zoom-animated"), this.options.className && It(k, this.options.className), k.onselectstart = C, k.onmousemove = C, k.onload = g(this.fire, this, "load"), k.onerror = g(this._overlayOnError, this, "error"), (this.options.crossOrigin || this.options.crossOrigin === "") && (k.crossOrigin = this.options.crossOrigin === !0 ? "" : this.options.crossOrigin), this.options.zIndex && this._updateZIndex(), h) {
          this._url = k.src;
          return;
        }
        k.src = this._url, k.alt = this.options.alt;
      },
      _animateZoom: function(h) {
        var k = this._map.getZoomScale(h.zoom), x = this._map._latLngBoundsToNewLayerBounds(this._bounds, h.zoom, h.center).min;
        yA(this._image, x, k);
      },
      _reset: function() {
        var h = this._image, k = new tA(
          this._map.latLngToLayerPoint(this._bounds.getNorthWest()),
          this._map.latLngToLayerPoint(this._bounds.getSouthEast())
        ), x = k.getSize();
        YA(h, k.min), h.style.width = x.x + "px", h.style.height = x.y + "px";
      },
      _updateOpacity: function() {
        BA(this._image, this.options.opacity);
      },
      _updateZIndex: function() {
        this._image && this.options.zIndex !== void 0 && this.options.zIndex !== null && (this._image.style.zIndex = this.options.zIndex);
      },
      _overlayOnError: function() {
        this.fire("error");
        var h = this.options.errorOverlayUrl;
        h && this._url !== h && (this._url = h, this._image.src = h);
      },
      // @method getCenter(): LatLng
      // Returns the center of the ImageOverlay.
      getCenter: function() {
        return this._bounds.getCenter();
      }
    }), ijA = function(h, k, x) {
      return new K1(h, k, x);
    }, paA = K1.extend({
      // @section
      // @aka VideoOverlay options
      options: {
        // @option autoplay: Boolean = true
        // Whether the video starts playing automatically when loaded.
        // On some browsers autoplay will only work with `muted: true`
        autoplay: !0,
        // @option loop: Boolean = true
        // Whether the video will loop back to the beginning when played.
        loop: !0,
        // @option keepAspectRatio: Boolean = true
        // Whether the video will save aspect ratio after the projection.
        // Relevant for supported browsers. See [browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit)
        keepAspectRatio: !0,
        // @option muted: Boolean = false
        // Whether the video starts on mute when loaded.
        muted: !1,
        // @option playsInline: Boolean = true
        // Mobile browsers will play the video right where it is instead of open it up in fullscreen mode.
        playsInline: !0
      },
      _initImage: function() {
        var h = this._url.tagName === "VIDEO", k = this._image = h ? this._url : kt("video");
        if (It(k, "leaflet-image-layer"), this._zoomAnimated && It(k, "leaflet-zoom-animated"), this.options.className && It(k, this.options.className), k.onselectstart = C, k.onmousemove = C, k.onloadeddata = g(this.fire, this, "load"), h) {
          for (var x = k.getElementsByTagName("source"), V = [], eA = 0; eA < x.length; eA++)
            V.push(x[eA].src);
          this._url = x.length > 0 ? V : [k.src];
          return;
        }
        f(this._url) || (this._url = [this._url]), !this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(k.style, "objectFit") && (k.style.objectFit = "fill"), k.autoplay = !!this.options.autoplay, k.loop = !!this.options.loop, k.muted = !!this.options.muted, k.playsInline = !!this.options.playsInline;
        for (var IA = 0; IA < this._url.length; IA++) {
          var mA = kt("source");
          mA.src = this._url[IA], k.appendChild(mA);
        }
      }
      // @method getElement(): HTMLVideoElement
      // Returns the instance of [`HTMLVideoElement`](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement)
      // used by this overlay.
    });
    function njA(h, k, x) {
      return new paA(h, k, x);
    }
    var yaA = K1.extend({
      _initImage: function() {
        var h = this._image = this._url;
        It(h, "leaflet-image-layer"), this._zoomAnimated && It(h, "leaflet-zoom-animated"), this.options.className && It(h, this.options.className), h.onselectstart = C, h.onmousemove = C;
      }
      // @method getElement(): SVGElement
      // Returns the instance of [`SVGElement`](https://developer.mozilla.org/docs/Web/API/SVGElement)
      // used by this overlay.
    });
    function ojA(h, k, x) {
      return new yaA(h, k, x);
    }
    var zC = Ge.extend({
      // @section
      // @aka DivOverlay options
      options: {
        // @option interactive: Boolean = false
        // If true, the popup/tooltip will listen to the mouse events.
        interactive: !1,
        // @option offset: Point = Point(0, 0)
        // The offset of the overlay position.
        offset: [0, 0],
        // @option className: String = ''
        // A custom CSS class name to assign to the overlay.
        className: "",
        // @option pane: String = undefined
        // `Map pane` where the overlay will be added.
        pane: void 0,
        // @option content: String|HTMLElement|Function = ''
        // Sets the HTML content of the overlay while initializing. If a function is passed the source layer will be
        // passed to the function. The function should return a `String` or `HTMLElement` to be used in the overlay.
        content: ""
      },
      initialize: function(h, k) {
        h && (h instanceof rA || f(h)) ? (this._latlng = sA(h), E(this, k)) : (E(this, h), this._source = k), this.options.content && (this._content = this.options.content);
      },
      // @method openOn(map: Map): this
      // Adds the overlay to the map.
      // Alternative to `map.openPopup(popup)`/`.openTooltip(tooltip)`.
      openOn: function(h) {
        return h = arguments.length ? h : this._source._map, h.hasLayer(this) || h.addLayer(this), this;
      },
      // @method close(): this
      // Closes the overlay.
      // Alternative to `map.closePopup(popup)`/`.closeTooltip(tooltip)`
      // and `layer.closePopup()`/`.closeTooltip()`.
      close: function() {
        return this._map && this._map.removeLayer(this), this;
      },
      // @method toggle(layer?: Layer): this
      // Opens or closes the overlay bound to layer depending on its current state.
      // Argument may be omitted only for overlay bound to layer.
      // Alternative to `layer.togglePopup()`/`.toggleTooltip()`.
      toggle: function(h) {
        return this._map ? this.close() : (arguments.length ? this._source = h : h = this._source, this._prepareOpen(), this.openOn(h._map)), this;
      },
      onAdd: function(h) {
        this._zoomAnimated = h._zoomAnimated, this._container || this._initLayout(), h._fadeAnimated && BA(this._container, 0), clearTimeout(this._removeTimeout), this.getPane().appendChild(this._container), this.update(), h._fadeAnimated && BA(this._container, 1), this.bringToFront(), this.options.interactive && (It(this._container, "leaflet-interactive"), this.addInteractiveTarget(this._container));
      },
      onRemove: function(h) {
        h._fadeAnimated ? (BA(this._container, 0), this._removeTimeout = setTimeout(g(fi, void 0, this._container), 200)) : fi(this._container), this.options.interactive && (vi(this._container, "leaflet-interactive"), this.removeInteractiveTarget(this._container));
      },
      // @namespace DivOverlay
      // @method getLatLng: LatLng
      // Returns the geographical point of the overlay.
      getLatLng: function() {
        return this._latlng;
      },
      // @method setLatLng(latlng: LatLng): this
      // Sets the geographical point where the overlay will open.
      setLatLng: function(h) {
        return this._latlng = sA(h), this._map && (this._updatePosition(), this._adjustPan()), this;
      },
      // @method getContent: String|HTMLElement
      // Returns the content of the overlay.
      getContent: function() {
        return this._content;
      },
      // @method setContent(htmlContent: String|HTMLElement|Function): this
      // Sets the HTML content of the overlay. If a function is passed the source layer will be passed to the function.
      // The function should return a `String` or `HTMLElement` to be used in the overlay.
      setContent: function(h) {
        return this._content = h, this.update(), this;
      },
      // @method getElement: String|HTMLElement
      // Returns the HTML container of the overlay.
      getElement: function() {
        return this._container;
      },
      // @method update: null
      // Updates the overlay content, layout and position. Useful for updating the overlay after something inside changed, e.g. image loaded.
      update: function() {
        this._map && (this._container.style.visibility = "hidden", this._updateContent(), this._updateLayout(), this._updatePosition(), this._container.style.visibility = "", this._adjustPan());
      },
      getEvents: function() {
        var h = {
          zoom: this._updatePosition,
          viewreset: this._updatePosition
        };
        return this._zoomAnimated && (h.zoomanim = this._animateZoom), h;
      },
      // @method isOpen: Boolean
      // Returns `true` when the overlay is visible on the map.
      isOpen: function() {
        return !!this._map && this._map.hasLayer(this);
      },
      // @method bringToFront: this
      // Brings this overlay in front of other overlays (in the same map pane).
      bringToFront: function() {
        return this._map && Ea(this._container), this;
      },
      // @method bringToBack: this
      // Brings this overlay to the back of other overlays (in the same map pane).
      bringToBack: function() {
        return this._map && lI(this._container), this;
      },
      // prepare bound overlay to open: update latlng pos / content source (for FeatureGroup)
      _prepareOpen: function(h) {
        var k = this._source;
        if (!k._map)
          return !1;
        if (k instanceof Wt) {
          k = null;
          var x = this._source._layers;
          for (var V in x)
            if (x[V]._map) {
              k = x[V];
              break;
            }
          if (!k)
            return !1;
          this._source = k;
        }
        if (!h)
          if (k.getCenter)
            h = k.getCenter();
          else if (k.getLatLng)
            h = k.getLatLng();
          else if (k.getBounds)
            h = k.getBounds().getCenter();
          else
            throw new Error("Unable to get source layer LatLng.");
        return this.setLatLng(h), this._map && this.update(), !0;
      },
      _updateContent: function() {
        if (this._content) {
          var h = this._contentNode, k = typeof this._content == "function" ? this._content(this._source || this) : this._content;
          if (typeof k == "string")
            h.innerHTML = k;
          else {
            for (; h.hasChildNodes(); )
              h.removeChild(h.firstChild);
            h.appendChild(k);
          }
          this.fire("contentupdate");
        }
      },
      _updatePosition: function() {
        if (this._map) {
          var h = this._map.latLngToLayerPoint(this._latlng), k = _(this.options.offset), x = this._getAnchor();
          this._zoomAnimated ? YA(this._container, h.add(x)) : k = k.add(h).add(x);
          var V = this._containerBottom = -k.y, eA = this._containerLeft = -Math.round(this._containerWidth / 2) + k.x;
          this._container.style.bottom = V + "px", this._container.style.left = eA + "px";
        }
      },
      _getAnchor: function() {
        return [0, 0];
      }
    });
    Mt.include({
      _initOverlay: function(h, k, x, V) {
        var eA = k;
        return eA instanceof h || (eA = new h(V).setContent(k)), x && eA.setLatLng(x), eA;
      }
    }), Ge.include({
      _initOverlay: function(h, k, x, V) {
        var eA = x;
        return eA instanceof h ? (E(eA, V), eA._source = this) : (eA = k && !V ? k : new h(V, this), eA.setContent(x)), eA;
      }
    });
    var U1 = zC.extend({
      // @section
      // @aka Popup options
      options: {
        // @option pane: String = 'popupPane'
        // `Map pane` where the popup will be added.
        pane: "popupPane",
        // @option offset: Point = Point(0, 7)
        // The offset of the popup position.
        offset: [0, 7],
        // @option maxWidth: Number = 300
        // Max width of the popup, in pixels.
        maxWidth: 300,
        // @option minWidth: Number = 50
        // Min width of the popup, in pixels.
        minWidth: 50,
        // @option maxHeight: Number = null
        // If set, creates a scrollable container of the given height
        // inside a popup if its content exceeds it.
        // The scrollable container can be styled using the
        // `leaflet-popup-scrolled` CSS class selector.
        maxHeight: null,
        // @option autoPan: Boolean = true
        // Set it to `false` if you don't want the map to do panning animation
        // to fit the opened popup.
        autoPan: !0,
        // @option autoPanPaddingTopLeft: Point = null
        // The margin between the popup and the top left corner of the map
        // view after autopanning was performed.
        autoPanPaddingTopLeft: null,
        // @option autoPanPaddingBottomRight: Point = null
        // The margin between the popup and the bottom right corner of the map
        // view after autopanning was performed.
        autoPanPaddingBottomRight: null,
        // @option autoPanPadding: Point = Point(5, 5)
        // Equivalent of setting both top left and bottom right autopan padding to the same value.
        autoPanPadding: [5, 5],
        // @option keepInView: Boolean = false
        // Set it to `true` if you want to prevent users from panning the popup
        // off of the screen while it is open.
        keepInView: !1,
        // @option closeButton: Boolean = true
        // Controls the presence of a close button in the popup.
        closeButton: !0,
        // @option autoClose: Boolean = true
        // Set it to `false` if you want to override the default behavior of
        // the popup closing when another popup is opened.
        autoClose: !0,
        // @option closeOnEscapeKey: Boolean = true
        // Set it to `false` if you want to override the default behavior of
        // the ESC key for closing of the popup.
        closeOnEscapeKey: !0,
        // @option closeOnClick: Boolean = *
        // Set it if you want to override the default behavior of the popup closing when user clicks
        // on the map. Defaults to the map's [`closePopupOnClick`](#map-closepopuponclick) option.
        // @option className: String = ''
        // A custom CSS class name to assign to the popup.
        className: ""
      },
      // @namespace Popup
      // @method openOn(map: Map): this
      // Alternative to `map.openPopup(popup)`.
      // Adds the popup to the map and closes the previous one.
      openOn: function(h) {
        return h = arguments.length ? h : this._source._map, !h.hasLayer(this) && h._popup && h._popup.options.autoClose && h.removeLayer(h._popup), h._popup = this, zC.prototype.openOn.call(this, h);
      },
      onAdd: function(h) {
        zC.prototype.onAdd.call(this, h), h.fire("popupopen", { popup: this }), this._source && (this._source.fire("popupopen", { popup: this }, !0), this._source instanceof rE || this._source.on("preclick", hr));
      },
      onRemove: function(h) {
        zC.prototype.onRemove.call(this, h), h.fire("popupclose", { popup: this }), this._source && (this._source.fire("popupclose", { popup: this }, !0), this._source instanceof rE || this._source.off("preclick", hr));
      },
      getEvents: function() {
        var h = zC.prototype.getEvents.call(this);
        return (this.options.closeOnClick !== void 0 ? this.options.closeOnClick : this._map.options.closePopupOnClick) && (h.preclick = this.close), this.options.keepInView && (h.moveend = this._adjustPan), h;
      },
      _initLayout: function() {
        var h = "leaflet-popup", k = this._container = kt(
          "div",
          h + " " + (this.options.className || "") + " leaflet-zoom-animated"
        ), x = this._wrapper = kt("div", h + "-content-wrapper", k);
        if (this._contentNode = kt("div", h + "-content", x), ni(k), oE(this._contentNode), At(k, "contextmenu", hr), this._tipContainer = kt("div", h + "-tip-container", k), this._tip = kt("div", h + "-tip", this._tipContainer), this.options.closeButton) {
          var V = this._closeButton = kt("a", h + "-close-button", k);
          V.setAttribute("role", "button"), V.setAttribute("aria-label", "Close popup"), V.href = "#close", V.innerHTML = '<span aria-hidden="true">&#215;</span>', At(V, "click", function(eA) {
            pn(eA), this.close();
          }, this);
        }
      },
      _updateLayout: function() {
        var h = this._contentNode, k = h.style;
        k.width = "", k.whiteSpace = "nowrap";
        var x = h.offsetWidth;
        x = Math.min(x, this.options.maxWidth), x = Math.max(x, this.options.minWidth), k.width = x + 1 + "px", k.whiteSpace = "", k.height = "";
        var V = h.offsetHeight, eA = this.options.maxHeight, IA = "leaflet-popup-scrolled";
        eA && V > eA ? (k.height = eA + "px", It(h, IA)) : vi(h, IA), this._containerWidth = this._container.offsetWidth;
      },
      _animateZoom: function(h) {
        var k = this._map._latLngToNewLayerPoint(this._latlng, h.zoom, h.center), x = this._getAnchor();
        YA(this._container, k.add(x));
      },
      _adjustPan: function() {
        if (this.options.autoPan) {
          if (this._map._panAnim && this._map._panAnim.stop(), this._autopanning) {
            this._autopanning = !1;
            return;
          }
          var h = this._map, k = parseInt(BI(this._container, "marginBottom"), 10) || 0, x = this._container.offsetHeight + k, V = this._containerWidth, eA = new O(this._containerLeft, -x - this._containerBottom);
          eA._add(OA(this._container));
          var IA = h.layerPointToContainerPoint(eA), mA = _(this.options.autoPanPadding), fA = _(this.options.autoPanPaddingTopLeft || mA), JA = _(this.options.autoPanPaddingBottomRight || mA), XA = h.getSize(), he = 0, Oe = 0;
          IA.x + V + JA.x > XA.x && (he = IA.x + V - XA.x + JA.x), IA.x - he - fA.x < 0 && (he = IA.x - fA.x), IA.y + x + JA.y > XA.y && (Oe = IA.y + x - XA.y + JA.y), IA.y - Oe - fA.y < 0 && (Oe = IA.y - fA.y), (he || Oe) && (this.options.keepInView && (this._autopanning = !0), h.fire("autopanstart").panBy([he, Oe]));
        }
      },
      _getAnchor: function() {
        return _(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0]);
      }
    }), gjA = function(h, k) {
      return new U1(h, k);
    };
    Mt.mergeOptions({
      closePopupOnClick: !0
    }), Mt.include({
      // @method openPopup(popup: Popup): this
      // Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).
      // @alternative
      // @method openPopup(content: String|HTMLElement, latlng: LatLng, options?: Popup options): this
      // Creates a popup with the specified content and options and opens it in the given point on a map.
      openPopup: function(h, k, x) {
        return this._initOverlay(U1, h, k, x).openOn(this), this;
      },
      // @method closePopup(popup?: Popup): this
      // Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one).
      closePopup: function(h) {
        return h = arguments.length ? h : this._popup, h && h.close(), this;
      }
    }), Ge.include({
      // @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this
      // Binds a popup to the layer with the passed `content` and sets up the
      // necessary event listeners. If a `Function` is passed it will receive
      // the layer as the first argument and should return a `String` or `HTMLElement`.
      bindPopup: function(h, k) {
        return this._popup = this._initOverlay(U1, this._popup, h, k), this._popupHandlersAdded || (this.on({
          click: this._openPopup,
          keypress: this._onKeyPress,
          remove: this.closePopup,
          move: this._movePopup
        }), this._popupHandlersAdded = !0), this;
      },
      // @method unbindPopup(): this
      // Removes the popup previously bound with `bindPopup`.
      unbindPopup: function() {
        return this._popup && (this.off({
          click: this._openPopup,
          keypress: this._onKeyPress,
          remove: this.closePopup,
          move: this._movePopup
        }), this._popupHandlersAdded = !1, this._popup = null), this;
      },
      // @method openPopup(latlng?: LatLng): this
      // Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed.
      openPopup: function(h) {
        return this._popup && (this instanceof Wt || (this._popup._source = this), this._popup._prepareOpen(h || this._latlng) && this._popup.openOn(this._map)), this;
      },
      // @method closePopup(): this
      // Closes the popup bound to this layer if it is open.
      closePopup: function() {
        return this._popup && this._popup.close(), this;
      },
      // @method togglePopup(): this
      // Opens or closes the popup bound to this layer depending on its current state.
      togglePopup: function() {
        return this._popup && this._popup.toggle(this), this;
      },
      // @method isPopupOpen(): boolean
      // Returns `true` if the popup bound to this layer is currently open.
      isPopupOpen: function() {
        return this._popup ? this._popup.isOpen() : !1;
      },
      // @method setPopupContent(content: String|HTMLElement|Popup): this
      // Sets the content of the popup bound to this layer.
      setPopupContent: function(h) {
        return this._popup && this._popup.setContent(h), this;
      },
      // @method getPopup(): Popup
      // Returns the popup bound to this layer.
      getPopup: function() {
        return this._popup;
      },
      _openPopup: function(h) {
        if (!(!this._popup || !this._map)) {
          da(h);
          var k = h.layer || h.target;
          if (this._popup._source === k && !(k instanceof rE)) {
            this._map.hasLayer(this._popup) ? this.closePopup() : this.openPopup(h.latlng);
            return;
          }
          this._popup._source = k, this.openPopup(h.latlng);
        }
      },
      _movePopup: function(h) {
        this._popup.setLatLng(h.latlng);
      },
      _onKeyPress: function(h) {
        h.originalEvent.keyCode === 13 && this._openPopup(h);
      }
    });
    var V1 = zC.extend({
      // @section
      // @aka Tooltip options
      options: {
        // @option pane: String = 'tooltipPane'
        // `Map pane` where the tooltip will be added.
        pane: "tooltipPane",
        // @option offset: Point = Point(0, 0)
        // Optional offset of the tooltip position.
        offset: [0, 0],
        // @option direction: String = 'auto'
        // Direction where to open the tooltip. Possible values are: `right`, `left`,
        // `top`, `bottom`, `center`, `auto`.
        // `auto` will dynamically switch between `right` and `left` according to the tooltip
        // position on the map.
        direction: "auto",
        // @option permanent: Boolean = false
        // Whether to open the tooltip permanently or only on mouseover.
        permanent: !1,
        // @option sticky: Boolean = false
        // If true, the tooltip will follow the mouse instead of being fixed at the feature center.
        sticky: !1,
        // @option opacity: Number = 0.9
        // Tooltip container opacity.
        opacity: 0.9
      },
      onAdd: function(h) {
        zC.prototype.onAdd.call(this, h), this.setOpacity(this.options.opacity), h.fire("tooltipopen", { tooltip: this }), this._source && (this.addEventParent(this._source), this._source.fire("tooltipopen", { tooltip: this }, !0));
      },
      onRemove: function(h) {
        zC.prototype.onRemove.call(this, h), h.fire("tooltipclose", { tooltip: this }), this._source && (this.removeEventParent(this._source), this._source.fire("tooltipclose", { tooltip: this }, !0));
      },
      getEvents: function() {
        var h = zC.prototype.getEvents.call(this);
        return this.options.permanent || (h.preclick = this.close), h;
      },
      _initLayout: function() {
        var h = "leaflet-tooltip", k = h + " " + (this.options.className || "") + " leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide");
        this._contentNode = this._container = kt("div", k), this._container.setAttribute("role", "tooltip"), this._container.setAttribute("id", "leaflet-tooltip-" + I(this));
      },
      _updateLayout: function() {
      },
      _adjustPan: function() {
      },
      _setPosition: function(h) {
        var k, x, V = this._map, eA = this._container, IA = V.latLngToContainerPoint(V.getCenter()), mA = V.layerPointToContainerPoint(h), fA = this.options.direction, JA = eA.offsetWidth, XA = eA.offsetHeight, he = _(this.options.offset), Oe = this._getAnchor();
        fA === "top" ? (k = JA / 2, x = XA) : fA === "bottom" ? (k = JA / 2, x = 0) : fA === "center" ? (k = JA / 2, x = XA / 2) : fA === "right" ? (k = 0, x = XA / 2) : fA === "left" ? (k = JA, x = XA / 2) : mA.x < IA.x ? (fA = "right", k = 0, x = XA / 2) : (fA = "left", k = JA + (he.x + Oe.x) * 2, x = XA / 2), h = h.subtract(_(k, x, !0)).add(he).add(Oe), vi(eA, "leaflet-tooltip-right"), vi(eA, "leaflet-tooltip-left"), vi(eA, "leaflet-tooltip-top"), vi(eA, "leaflet-tooltip-bottom"), It(eA, "leaflet-tooltip-" + fA), YA(eA, h);
      },
      _updatePosition: function() {
        var h = this._map.latLngToLayerPoint(this._latlng);
        this._setPosition(h);
      },
      setOpacity: function(h) {
        this.options.opacity = h, this._container && BA(this._container, h);
      },
      _animateZoom: function(h) {
        var k = this._map._latLngToNewLayerPoint(this._latlng, h.zoom, h.center);
        this._setPosition(k);
      },
      _getAnchor: function() {
        return _(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0]);
      }
    }), sjA = function(h, k) {
      return new V1(h, k);
    };
    Mt.include({
      // @method openTooltip(tooltip: Tooltip): this
      // Opens the specified tooltip.
      // @alternative
      // @method openTooltip(content: String|HTMLElement, latlng: LatLng, options?: Tooltip options): this
      // Creates a tooltip with the specified content and options and open it.
      openTooltip: function(h, k, x) {
        return this._initOverlay(V1, h, k, x).openOn(this), this;
      },
      // @method closeTooltip(tooltip: Tooltip): this
      // Closes the tooltip given as parameter.
      closeTooltip: function(h) {
        return h.close(), this;
      }
    }), Ge.include({
      // @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this
      // Binds a tooltip to the layer with the passed `content` and sets up the
      // necessary event listeners. If a `Function` is passed it will receive
      // the layer as the first argument and should return a `String` or `HTMLElement`.
      bindTooltip: function(h, k) {
        return this._tooltip && this.isTooltipOpen() && this.unbindTooltip(), this._tooltip = this._initOverlay(V1, this._tooltip, h, k), this._initTooltipInteractions(), this._tooltip.options.permanent && this._map && this._map.hasLayer(this) && this.openTooltip(), this;
      },
      // @method unbindTooltip(): this
      // Removes the tooltip previously bound with `bindTooltip`.
      unbindTooltip: function() {
        return this._tooltip && (this._initTooltipInteractions(!0), this.closeTooltip(), this._tooltip = null), this;
      },
      _initTooltipInteractions: function(h) {
        if (!(!h && this._tooltipHandlersAdded)) {
          var k = h ? "off" : "on", x = {
            remove: this.closeTooltip,
            move: this._moveTooltip
          };
          this._tooltip.options.permanent ? x.add = this._openTooltip : (x.mouseover = this._openTooltip, x.mouseout = this.closeTooltip, x.click = this._openTooltip, this._map ? this._addFocusListeners() : x.add = this._addFocusListeners), this._tooltip.options.sticky && (x.mousemove = this._moveTooltip), this[k](x), this._tooltipHandlersAdded = !h;
        }
      },
      // @method openTooltip(latlng?: LatLng): this
      // Opens the bound tooltip at the specified `latlng` or at the default tooltip anchor if no `latlng` is passed.
      openTooltip: function(h) {
        return this._tooltip && (this instanceof Wt || (this._tooltip._source = this), this._tooltip._prepareOpen(h) && (this._tooltip.openOn(this._map), this.getElement ? this._setAriaDescribedByOnLayer(this) : this.eachLayer && this.eachLayer(this._setAriaDescribedByOnLayer, this))), this;
      },
      // @method closeTooltip(): this
      // Closes the tooltip bound to this layer if it is open.
      closeTooltip: function() {
        if (this._tooltip)
          return this._tooltip.close();
      },
      // @method toggleTooltip(): this
      // Opens or closes the tooltip bound to this layer depending on its current state.
      toggleTooltip: function() {
        return this._tooltip && this._tooltip.toggle(this), this;
      },
      // @method isTooltipOpen(): boolean
      // Returns `true` if the tooltip bound to this layer is currently open.
      isTooltipOpen: function() {
        return this._tooltip.isOpen();
      },
      // @method setTooltipContent(content: String|HTMLElement|Tooltip): this
      // Sets the content of the tooltip bound to this layer.
      setTooltipContent: function(h) {
        return this._tooltip && this._tooltip.setContent(h), this;
      },
      // @method getTooltip(): Tooltip
      // Returns the tooltip bound to this layer.
      getTooltip: function() {
        return this._tooltip;
      },
      _addFocusListeners: function() {
        this.getElement ? this._addFocusListenersOnLayer(this) : this.eachLayer && this.eachLayer(this._addFocusListenersOnLayer, this);
      },
      _addFocusListenersOnLayer: function(h) {
        var k = typeof h.getElement == "function" && h.getElement();
        k && (At(k, "focus", function() {
          this._tooltip._source = h, this.openTooltip();
        }, this), At(k, "blur", this.closeTooltip, this));
      },
      _setAriaDescribedByOnLayer: function(h) {
        var k = typeof h.getElement == "function" && h.getElement();
        k && k.setAttribute("aria-describedby", this._tooltip._container.id);
      },
      _openTooltip: function(h) {
        if (!(!this._tooltip || !this._map)) {
          if (this._map.dragging && this._map.dragging.moving() && !this._openOnceFlag) {
            this._openOnceFlag = !0;
            var k = this;
            this._map.once("moveend", function() {
              k._openOnceFlag = !1, k._openTooltip(h);
            });
            return;
          }
          this._tooltip._source = h.layer || h.target, this.openTooltip(this._tooltip.options.sticky ? h.latlng : void 0);
        }
      },
      _moveTooltip: function(h) {
        var k = h.latlng, x, V;
        this._tooltip.options.sticky && h.originalEvent && (x = this._map.mouseEventToContainerPoint(h.originalEvent), V = this._map.containerPointToLayerPoint(x), k = this._map.layerPointToLatLng(V)), this._tooltip.setLatLng(k);
      }
    });
    var baA = bo.extend({
      options: {
        // @section
        // @aka DivIcon options
        iconSize: [12, 12],
        // also can be set through CSS
        // iconAnchor: (Point),
        // popupAnchor: (Point),
        // @option html: String|HTMLElement = ''
        // Custom HTML code to put inside the div element, empty by default. Alternatively,
        // an instance of `HTMLElement`.
        html: !1,
        // @option bgPos: Point = [0, 0]
        // Optional relative position of the background, in pixels
        bgPos: null,
        className: "leaflet-div-icon"
      },
      createIcon: function(h) {
        var k = h && h.tagName === "DIV" ? h : document.createElement("div"), x = this.options;
        if (x.html instanceof Element ? (SC(k), k.appendChild(x.html)) : k.innerHTML = x.html !== !1 ? x.html : "", x.bgPos) {
          var V = _(x.bgPos);
          k.style.backgroundPosition = -V.x + "px " + -V.y + "px";
        }
        return this._setIconStyles(k, "icon"), k;
      },
      createShadow: function() {
        return null;
      }
    });
    function IjA(h) {
      return new baA(h);
    }
    bo.Default = XC;
    var _G = Ge.extend({
      // @section
      // @aka GridLayer options
      options: {
        // @option tileSize: Number|Point = 256
        // Width and height of tiles in the grid. Use a number if width and height are equal, or `L.point(width, height)` otherwise.
        tileSize: 256,
        // @option opacity: Number = 1.0
        // Opacity of the tiles. Can be used in the `createTile()` function.
        opacity: 1,
        // @option updateWhenIdle: Boolean = (depends)
        // Load new tiles only when panning ends.
        // `true` by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
        // `false` otherwise in order to display new tiles _during_ panning, since it is easy to pan outside the
        // [`keepBuffer`](#gridlayer-keepbuffer) option in desktop browsers.
        updateWhenIdle: Je.mobile,
        // @option updateWhenZooming: Boolean = true
        // By default, a smooth zoom animation (during a [touch zoom](#map-touchzoom) or a [`flyTo()`](#map-flyto)) will update grid layers every integer zoom level. Setting this option to `false` will update the grid layer only when the smooth animation ends.
        updateWhenZooming: !0,
        // @option updateInterval: Number = 200
        // Tiles will not update more than once every `updateInterval` milliseconds when panning.
        updateInterval: 200,
        // @option zIndex: Number = 1
        // The explicit zIndex of the tile layer.
        zIndex: 1,
        // @option bounds: LatLngBounds = undefined
        // If set, tiles will only be loaded inside the set `LatLngBounds`.
        bounds: null,
        // @option minZoom: Number = 0
        // The minimum zoom level down to which this layer will be displayed (inclusive).
        minZoom: 0,
        // @option maxZoom: Number = undefined
        // The maximum zoom level up to which this layer will be displayed (inclusive).
        maxZoom: void 0,
        // @option maxNativeZoom: Number = undefined
        // Maximum zoom number the tile source has available. If it is specified,
        // the tiles on all zoom levels higher than `maxNativeZoom` will be loaded
        // from `maxNativeZoom` level and auto-scaled.
        maxNativeZoom: void 0,
        // @option minNativeZoom: Number = undefined
        // Minimum zoom number the tile source has available. If it is specified,
        // the tiles on all zoom levels lower than `minNativeZoom` will be loaded
        // from `minNativeZoom` level and auto-scaled.
        minNativeZoom: void 0,
        // @option noWrap: Boolean = false
        // Whether the layer is wrapped around the antimeridian. If `true`, the
        // GridLayer will only be displayed once at low zoom levels. Has no
        // effect when the [map CRS](#map-crs) doesn't wrap around. Can be used
        // in combination with [`bounds`](#gridlayer-bounds) to prevent requesting
        // tiles outside the CRS limits.
        noWrap: !1,
        // @option pane: String = 'tilePane'
        // `Map pane` where the grid layer will be added.
        pane: "tilePane",
        // @option className: String = ''
        // A custom class name to assign to the tile layer. Empty by default.
        className: "",
        // @option keepBuffer: Number = 2
        // When panning the map, keep this many rows and columns of tiles before unloading them.
        keepBuffer: 2
      },
      initialize: function(h) {
        E(this, h);
      },
      onAdd: function() {
        this._initContainer(), this._levels = {}, this._tiles = {}, this._resetView();
      },
      beforeAdd: function(h) {
        h._addZoomLimit(this);
      },
      onRemove: function(h) {
        this._removeAllTiles(), fi(this._container), h._removeZoomLimit(this), this._container = null, this._tileZoom = void 0;
      },
      // @method bringToFront: this
      // Brings the tile layer to the top of all tile layers.
      bringToFront: function() {
        return this._map && (Ea(this._container), this._setAutoZIndex(Math.max)), this;
      },
      // @method bringToBack: this
      // Brings the tile layer to the bottom of all tile layers.
      bringToBack: function() {
        return this._map && (lI(this._container), this._setAutoZIndex(Math.min)), this;
      },
      // @method getContainer: HTMLElement
      // Returns the HTML element that contains the tiles for this layer.
      getContainer: function() {
        return this._container;
      },
      // @method setOpacity(opacity: Number): this
      // Changes the [opacity](#gridlayer-opacity) of the grid layer.
      setOpacity: function(h) {
        return this.options.opacity = h, this._updateOpacity(), this;
      },
      // @method setZIndex(zIndex: Number): this
      // Changes the [zIndex](#gridlayer-zindex) of the grid layer.
      setZIndex: function(h) {
        return this.options.zIndex = h, this._updateZIndex(), this;
      },
      // @method isLoading: Boolean
      // Returns `true` if any tile in the grid layer has not finished loading.
      isLoading: function() {
        return this._loading;
      },
      // @method redraw: this
      // Causes the layer to clear all the tiles and request them again.
      redraw: function() {
        if (this._map) {
          this._removeAllTiles();
          var h = this._clampZoom(this._map.getZoom());
          h !== this._tileZoom && (this._tileZoom = h, this._updateLevels()), this._update();
        }
        return this;
      },
      getEvents: function() {
        var h = {
          viewprereset: this._invalidateAll,
          viewreset: this._resetView,
          zoom: this._resetView,
          moveend: this._onMoveEnd
        };
        return this.options.updateWhenIdle || (this._onMove || (this._onMove = r(this._onMoveEnd, this.options.updateInterval, this)), h.move = this._onMove), this._zoomAnimated && (h.zoomanim = this._animateZoom), h;
      },
      // @section Extension methods
      // Layers extending `GridLayer` shall reimplement the following method.
      // @method createTile(coords: Object, done?: Function): HTMLElement
      // Called only internally, must be overridden by classes extending `GridLayer`.
      // Returns the `HTMLElement` corresponding to the given `coords`. If the `done` callback
      // is specified, it must be called when the tile has finished loading and drawing.
      createTile: function() {
        return document.createElement("div");
      },
      // @section
      // @method getTileSize: Point
      // Normalizes the [tileSize option](#gridlayer-tilesize) into a point. Used by the `createTile()` method.
      getTileSize: function() {
        var h = this.options.tileSize;
        return h instanceof O ? h : new O(h, h);
      },
      _updateZIndex: function() {
        this._container && this.options.zIndex !== void 0 && this.options.zIndex !== null && (this._container.style.zIndex = this.options.zIndex);
      },
      _setAutoZIndex: function(h) {
        for (var k = this.getPane().children, x = -h(-1 / 0, 1 / 0), V = 0, eA = k.length, IA; V < eA; V++)
          IA = k[V].style.zIndex, k[V] !== this._container && IA && (x = h(x, +IA));
        isFinite(x) && (this.options.zIndex = x + h(-1, 1), this._updateZIndex());
      },
      _updateOpacity: function() {
        if (this._map && !Je.ielt9) {
          BA(this._container, this.options.opacity);
          var h = +/* @__PURE__ */ new Date(), k = !1, x = !1;
          for (var V in this._tiles) {
            var eA = this._tiles[V];
            if (!(!eA.current || !eA.loaded)) {
              var IA = Math.min(1, (h - eA.loaded) / 200);
              BA(eA.el, IA), IA < 1 ? k = !0 : (eA.active ? x = !0 : this._onOpaqueTile(eA), eA.active = !0);
            }
          }
          x && !this._noPrune && this._pruneTiles(), k && (N(this._fadeFrame), this._fadeFrame = p(this._updateOpacity, this));
        }
      },
      _onOpaqueTile: C,
      _initContainer: function() {
        this._container || (this._container = kt("div", "leaflet-layer " + (this.options.className || "")), this._updateZIndex(), this.options.opacity < 1 && this._updateOpacity(), this.getPane().appendChild(this._container));
      },
      _updateLevels: function() {
        var h = this._tileZoom, k = this.options.maxZoom;
        if (h !== void 0) {
          for (var x in this._levels)
            x = Number(x), this._levels[x].el.children.length || x === h ? (this._levels[x].el.style.zIndex = k - Math.abs(h - x), this._onUpdateLevel(x)) : (fi(this._levels[x].el), this._removeTilesAtZoom(x), this._onRemoveLevel(x), delete this._levels[x]);
          var V = this._levels[h], eA = this._map;
          return V || (V = this._levels[h] = {}, V.el = kt("div", "leaflet-tile-container leaflet-zoom-animated", this._container), V.el.style.zIndex = k, V.origin = eA.project(eA.unproject(eA.getPixelOrigin()), h).round(), V.zoom = h, this._setZoomTransform(V, eA.getCenter(), eA.getZoom()), C(V.el.offsetWidth), this._onCreateLevel(V)), this._level = V, V;
        }
      },
      _onUpdateLevel: C,
      _onRemoveLevel: C,
      _onCreateLevel: C,
      _pruneTiles: function() {
        if (this._map) {
          var h, k, x = this._map.getZoom();
          if (x > this.options.maxZoom || x < this.options.minZoom) {
            this._removeAllTiles();
            return;
          }
          for (h in this._tiles)
            k = this._tiles[h], k.retain = k.current;
          for (h in this._tiles)
            if (k = this._tiles[h], k.current && !k.active) {
              var V = k.coords;
              this._retainParent(V.x, V.y, V.z, V.z - 5) || this._retainChildren(V.x, V.y, V.z, V.z + 2);
            }
          for (h in this._tiles)
            this._tiles[h].retain || this._removeTile(h);
        }
      },
      _removeTilesAtZoom: function(h) {
        for (var k in this._tiles)
          this._tiles[k].coords.z === h && this._removeTile(k);
      },
      _removeAllTiles: function() {
        for (var h in this._tiles)
          this._removeTile(h);
      },
      _invalidateAll: function() {
        for (var h in this._levels)
          fi(this._levels[h].el), this._onRemoveLevel(Number(h)), delete this._levels[h];
        this._removeAllTiles(), this._tileZoom = void 0;
      },
      _retainParent: function(h, k, x, V) {
        var eA = Math.floor(h / 2), IA = Math.floor(k / 2), mA = x - 1, fA = new O(+eA, +IA);
        fA.z = +mA;
        var JA = this._tileCoordsToKey(fA), XA = this._tiles[JA];
        return XA && XA.active ? (XA.retain = !0, !0) : (XA && XA.loaded && (XA.retain = !0), mA > V ? this._retainParent(eA, IA, mA, V) : !1);
      },
      _retainChildren: function(h, k, x, V) {
        for (var eA = 2 * h; eA < 2 * h + 2; eA++)
          for (var IA = 2 * k; IA < 2 * k + 2; IA++) {
            var mA = new O(eA, IA);
            mA.z = x + 1;
            var fA = this._tileCoordsToKey(mA), JA = this._tiles[fA];
            if (JA && JA.active) {
              JA.retain = !0;
              continue;
            } else
              JA && JA.loaded && (JA.retain = !0);
            x + 1 < V && this._retainChildren(eA, IA, x + 1, V);
          }
      },
      _resetView: function(h) {
        var k = h && (h.pinch || h.flyTo);
        this._setView(this._map.getCenter(), this._map.getZoom(), k, k);
      },
      _animateZoom: function(h) {
        this._setView(h.center, h.zoom, !0, h.noUpdate);
      },
      _clampZoom: function(h) {
        var k = this.options;
        return k.minNativeZoom !== void 0 && h < k.minNativeZoom ? k.minNativeZoom : k.maxNativeZoom !== void 0 && k.maxNativeZoom < h ? k.maxNativeZoom : h;
      },
      _setView: function(h, k, x, V) {
        var eA = Math.round(k);
        this.options.maxZoom !== void 0 && eA > this.options.maxZoom || this.options.minZoom !== void 0 && eA < this.options.minZoom ? eA = void 0 : eA = this._clampZoom(eA);
        var IA = this.options.updateWhenZooming && eA !== this._tileZoom;
        (!V || IA) && (this._tileZoom = eA, this._abortLoading && this._abortLoading(), this._updateLevels(), this._resetGrid(), eA !== void 0 && this._update(h), x || this._pruneTiles(), this._noPrune = !!x), this._setZoomTransforms(h, k);
      },
      _setZoomTransforms: function(h, k) {
        for (var x in this._levels)
          this._setZoomTransform(this._levels[x], h, k);
      },
      _setZoomTransform: function(h, k, x) {
        var V = this._map.getZoomScale(x, h.zoom), eA = h.origin.multiplyBy(V).subtract(this._map._getNewPixelOrigin(k, x)).round();
        Je.any3d ? yA(h.el, eA, V) : YA(h.el, eA);
      },
      _resetGrid: function() {
        var h = this._map, k = h.options.crs, x = this._tileSize = this.getTileSize(), V = this._tileZoom, eA = this._map.getPixelWorldBounds(this._tileZoom);
        eA && (this._globalTileRange = this._pxBoundsToTileRange(eA)), this._wrapX = k.wrapLng && !this.options.noWrap && [
          Math.floor(h.project([0, k.wrapLng[0]], V).x / x.x),
          Math.ceil(h.project([0, k.wrapLng[1]], V).x / x.y)
        ], this._wrapY = k.wrapLat && !this.options.noWrap && [
          Math.floor(h.project([k.wrapLat[0], 0], V).y / x.x),
          Math.ceil(h.project([k.wrapLat[1], 0], V).y / x.y)
        ];
      },
      _onMoveEnd: function() {
        !this._map || this._map._animatingZoom || this._update();
      },
      _getTiledPixelBounds: function(h) {
        var k = this._map, x = k._animatingZoom ? Math.max(k._animateToZoom, k.getZoom()) : k.getZoom(), V = k.getZoomScale(x, this._tileZoom), eA = k.project(h, this._tileZoom).floor(), IA = k.getSize().divideBy(V * 2);
        return new tA(eA.subtract(IA), eA.add(IA));
      },
      // Private method to load tiles in the grid's active zoom level according to map bounds
      _update: function(h) {
        var k = this._map;
        if (k) {
          var x = this._clampZoom(k.getZoom());
          if (h === void 0 && (h = k.getCenter()), this._tileZoom !== void 0) {
            var V = this._getTiledPixelBounds(h), eA = this._pxBoundsToTileRange(V), IA = eA.getCenter(), mA = [], fA = this.options.keepBuffer, JA = new tA(
              eA.getBottomLeft().subtract([fA, -fA]),
              eA.getTopRight().add([fA, -fA])
            );
            if (!(isFinite(eA.min.x) && isFinite(eA.min.y) && isFinite(eA.max.x) && isFinite(eA.max.y)))
              throw new Error("Attempted to load an infinite number of tiles");
            for (var XA in this._tiles) {
              var he = this._tiles[XA].coords;
              (he.z !== this._tileZoom || !JA.contains(new O(he.x, he.y))) && (this._tiles[XA].current = !1);
            }
            if (Math.abs(x - this._tileZoom) > 1) {
              this._setView(h, x);
              return;
            }
            for (var Oe = eA.min.y; Oe <= eA.max.y; Oe++)
              for (var Rt = eA.min.x; Rt <= eA.max.x; Rt++) {
                var Zg = new O(Rt, Oe);
                if (Zg.z = this._tileZoom, !!this._isValidTile(Zg)) {
                  var wo = this._tiles[this._tileCoordsToKey(Zg)];
                  wo ? wo.current = !0 : mA.push(Zg);
                }
              }
            if (mA.sort(function(bs, P0) {
              return bs.distanceTo(IA) - P0.distanceTo(IA);
            }), mA.length !== 0) {
              this._loading || (this._loading = !0, this.fire("loading"));
              var ha = document.createDocumentFragment();
              for (Rt = 0; Rt < mA.length; Rt++)
                this._addTile(mA[Rt], ha);
              this._level.el.appendChild(ha);
            }
          }
        }
      },
      _isValidTile: function(h) {
        var k = this._map.options.crs;
        if (!k.infinite) {
          var x = this._globalTileRange;
          if (!k.wrapLng && (h.x < x.min.x || h.x > x.max.x) || !k.wrapLat && (h.y < x.min.y || h.y > x.max.y))
            return !1;
        }
        if (!this.options.bounds)
          return !0;
        var V = this._tileCoordsToBounds(h);
        return gA(this.options.bounds).overlaps(V);
      },
      _keyToBounds: function(h) {
        return this._tileCoordsToBounds(this._keyToTileCoords(h));
      },
      _tileCoordsToNwSe: function(h) {
        var k = this._map, x = this.getTileSize(), V = h.scaleBy(x), eA = V.add(x), IA = k.unproject(V, h.z), mA = k.unproject(eA, h.z);
        return [IA, mA];
      },
      // converts tile coordinates to its geographical bounds
      _tileCoordsToBounds: function(h) {
        var k = this._tileCoordsToNwSe(h), x = new AA(k[0], k[1]);
        return this.options.noWrap || (x = this._map.wrapLatLngBounds(x)), x;
      },
      // converts tile coordinates to key for the tile cache
      _tileCoordsToKey: function(h) {
        return h.x + ":" + h.y + ":" + h.z;
      },
      // converts tile cache key to coordinates
      _keyToTileCoords: function(h) {
        var k = h.split(":"), x = new O(+k[0], +k[1]);
        return x.z = +k[2], x;
      },
      _removeTile: function(h) {
        var k = this._tiles[h];
        k && (fi(k.el), delete this._tiles[h], this.fire("tileunload", {
          tile: k.el,
          coords: this._keyToTileCoords(h)
        }));
      },
      _initTile: function(h) {
        It(h, "leaflet-tile");
        var k = this.getTileSize();
        h.style.width = k.x + "px", h.style.height = k.y + "px", h.onselectstart = C, h.onmousemove = C, Je.ielt9 && this.options.opacity < 1 && BA(h, this.options.opacity);
      },
      _addTile: function(h, k) {
        var x = this._getTilePos(h), V = this._tileCoordsToKey(h), eA = this.createTile(this._wrapCoords(h), g(this._tileReady, this, h));
        this._initTile(eA), this.createTile.length < 2 && p(g(this._tileReady, this, h, null, eA)), YA(eA, x), this._tiles[V] = {
          el: eA,
          coords: h,
          current: !0
        }, k.appendChild(eA), this.fire("tileloadstart", {
          tile: eA,
          coords: h
        });
      },
      _tileReady: function(h, k, x) {
        k && this.fire("tileerror", {
          error: k,
          tile: x,
          coords: h
        });
        var V = this._tileCoordsToKey(h);
        x = this._tiles[V], x && (x.loaded = +/* @__PURE__ */ new Date(), this._map._fadeAnimated ? (BA(x.el, 0), N(this._fadeFrame), this._fadeFrame = p(this._updateOpacity, this)) : (x.active = !0, this._pruneTiles()), k || (It(x.el, "leaflet-tile-loaded"), this.fire("tileload", {
          tile: x.el,
          coords: h
        })), this._noTilesToLoad() && (this._loading = !1, this.fire("load"), Je.ielt9 || !this._map._fadeAnimated ? p(this._pruneTiles, this) : setTimeout(g(this._pruneTiles, this), 250)));
      },
      _getTilePos: function(h) {
        return h.scaleBy(this.getTileSize()).subtract(this._level.origin);
      },
      _wrapCoords: function(h) {
        var k = new O(
          this._wrapX ? a(h.x, this._wrapX) : h.x,
          this._wrapY ? a(h.y, this._wrapY) : h.y
        );
        return k.z = h.z, k;
      },
      _pxBoundsToTileRange: function(h) {
        var k = this.getTileSize();
        return new tA(
          h.min.unscaleBy(k).floor(),
          h.max.unscaleBy(k).ceil().subtract([1, 1])
        );
      },
      _noTilesToLoad: function() {
        for (var h in this._tiles)
          if (!this._tiles[h].loaded)
            return !1;
        return !0;
      }
    });
    function ajA(h) {
      return new _G(h);
    }
    var j0 = _G.extend({
      // @section
      // @aka TileLayer options
      options: {
        // @option minZoom: Number = 0
        // The minimum zoom level down to which this layer will be displayed (inclusive).
        minZoom: 0,
        // @option maxZoom: Number = 18
        // The maximum zoom level up to which this layer will be displayed (inclusive).
        maxZoom: 18,
        // @option subdomains: String|String[] = 'abc'
        // Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
        subdomains: "abc",
        // @option errorTileUrl: String = ''
        // URL to the tile image to show in place of the tile that failed to load.
        errorTileUrl: "",
        // @option zoomOffset: Number = 0
        // The zoom number used in tile URLs will be offset with this value.
        zoomOffset: 0,
        // @option tms: Boolean = false
        // If `true`, inverses Y axis numbering for tiles (turn this on for [TMS](https://en.wikipedia.org/wiki/Tile_Map_Service) services).
        tms: !1,
        // @option zoomReverse: Boolean = false
        // If set to true, the zoom number used in tile URLs will be reversed (`maxZoom - zoom` instead of `zoom`)
        zoomReverse: !1,
        // @option detectRetina: Boolean = false
        // If `true` and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
        detectRetina: !1,
        // @option crossOrigin: Boolean|String = false
        // Whether the crossOrigin attribute will be added to the tiles.
        // If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
        // Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.
        crossOrigin: !1,
        // @option referrerPolicy: Boolean|String = false
        // Whether the referrerPolicy attribute will be added to the tiles.
        // If a String is provided, all tiles will have their referrerPolicy attribute set to the String provided.
        // This may be needed if your map's rendering context has a strict default but your tile provider expects a valid referrer
        // (e.g. to validate an API token).
        // Refer to [HTMLImageElement.referrerPolicy](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy) for valid String values.
        referrerPolicy: !1
      },
      initialize: function(h, k) {
        this._url = h, k = E(this, k), k.detectRetina && Je.retina && k.maxZoom > 0 ? (k.tileSize = Math.floor(k.tileSize / 2), k.zoomReverse ? (k.zoomOffset--, k.minZoom = Math.min(k.maxZoom, k.minZoom + 1)) : (k.zoomOffset++, k.maxZoom = Math.max(k.minZoom, k.maxZoom - 1)), k.minZoom = Math.max(0, k.minZoom)) : k.zoomReverse ? k.minZoom = Math.min(k.maxZoom, k.minZoom) : k.maxZoom = Math.max(k.minZoom, k.maxZoom), typeof k.subdomains == "string" && (k.subdomains = k.subdomains.split("")), this.on("tileunload", this._onTileRemove);
      },
      // @method setUrl(url: String, noRedraw?: Boolean): this
      // Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`).
      // If the URL does not change, the layer will not be redrawn unless
      // the noRedraw parameter is set to false.
      setUrl: function(h, k) {
        return this._url === h && k === void 0 && (k = !0), this._url = h, k || this.redraw(), this;
      },
      // @method createTile(coords: Object, done?: Function): HTMLElement
      // Called only internally, overrides GridLayer's [`createTile()`](#gridlayer-createtile)
      // to return an `<img>` HTML element with the appropriate image URL given `coords`. The `done`
      // callback is called when the tile has been loaded.
      createTile: function(h, k) {
        var x = document.createElement("img");
        return At(x, "load", g(this._tileOnLoad, this, k, x)), At(x, "error", g(this._tileOnError, this, k, x)), (this.options.crossOrigin || this.options.crossOrigin === "") && (x.crossOrigin = this.options.crossOrigin === !0 ? "" : this.options.crossOrigin), typeof this.options.referrerPolicy == "string" && (x.referrerPolicy = this.options.referrerPolicy), x.alt = "", x.src = this.getTileUrl(h), x;
      },
      // @section Extension methods
      // @uninheritable
      // Layers extending `TileLayer` might reimplement the following method.
      // @method getTileUrl(coords: Object): String
      // Called only internally, returns the URL for a tile given its coordinates.
      // Classes extending `TileLayer` can override this function to provide custom tile URL naming schemes.
      getTileUrl: function(h) {
        var k = {
          r: Je.retina ? "@2x" : "",
          s: this._getSubdomain(h),
          x: h.x,
          y: h.y,
          z: this._getZoomForUrl()
        };
        if (this._map && !this._map.options.crs.infinite) {
          var x = this._globalTileRange.max.y - h.y;
          this.options.tms && (k.y = x), k["-y"] = x;
        }
        return y(this._url, n(k, this.options));
      },
      _tileOnLoad: function(h, k) {
        Je.ielt9 ? setTimeout(g(h, this, null, k), 0) : h(null, k);
      },
      _tileOnError: function(h, k, x) {
        var V = this.options.errorTileUrl;
        V && k.getAttribute("src") !== V && (k.src = V), h(x, k);
      },
      _onTileRemove: function(h) {
        h.tile.onload = null;
      },
      _getZoomForUrl: function() {
        var h = this._tileZoom, k = this.options.maxZoom, x = this.options.zoomReverse, V = this.options.zoomOffset;
        return x && (h = k - h), h + V;
      },
      _getSubdomain: function(h) {
        var k = Math.abs(h.x + h.y) % this.options.subdomains.length;
        return this.options.subdomains[k];
      },
      // stops loading all tiles in the background layer
      _abortLoading: function() {
        var h, k;
        for (h in this._tiles)
          if (this._tiles[h].coords.z !== this._tileZoom && (k = this._tiles[h].el, k.onload = C, k.onerror = C, !k.complete)) {
            k.src = G;
            var x = this._tiles[h].coords;
            fi(k), delete this._tiles[h], this.fire("tileabort", {
              tile: k,
              coords: x
            });
          }
      },
      _removeTile: function(h) {
        var k = this._tiles[h];
        if (k)
          return k.el.setAttribute("src", G), _G.prototype._removeTile.call(this, h);
      },
      _tileReady: function(h, k, x) {
        if (!(!this._map || x && x.getAttribute("src") === G))
          return _G.prototype._tileReady.call(this, h, k, x);
      }
    });
    function waA(h, k) {
      return new j0(h, k);
    }
    var faA = j0.extend({
      // @section
      // @aka TileLayer.WMS options
      // If any custom options not documented here are used, they will be sent to the
      // WMS server as extra parameters in each request URL. This can be useful for
      // [non-standard vendor WMS parameters](https://docs.geoserver.org/stable/en/user/services/wms/vendor.html).
      defaultWmsParams: {
        service: "WMS",
        request: "GetMap",
        // @option layers: String = ''
        // **(required)** Comma-separated list of WMS layers to show.
        layers: "",
        // @option styles: String = ''
        // Comma-separated list of WMS styles.
        styles: "",
        // @option format: String = 'image/jpeg'
        // WMS image format (use `'image/png'` for layers with transparency).
        format: "image/jpeg",
        // @option transparent: Boolean = false
        // If `true`, the WMS service will return images with transparency.
        transparent: !1,
        // @option version: String = '1.1.1'
        // Version of the WMS service to use
        version: "1.1.1"
      },
      options: {
        // @option crs: CRS = null
        // Coordinate Reference System to use for the WMS requests, defaults to
        // map CRS. Don't change this if you're not sure what it means.
        crs: null,
        // @option uppercase: Boolean = false
        // If `true`, WMS request parameter keys will be uppercase.
        uppercase: !1
      },
      initialize: function(h, k) {
        this._url = h;
        var x = n({}, this.defaultWmsParams);
        for (var V in k)
          V in this.options || (x[V] = k[V]);
        k = E(this, k);
        var eA = k.detectRetina && Je.retina ? 2 : 1, IA = this.getTileSize();
        x.width = IA.x * eA, x.height = IA.y * eA, this.wmsParams = x;
      },
      onAdd: function(h) {
        this._crs = this.options.crs || h.options.crs, this._wmsVersion = parseFloat(this.wmsParams.version);
        var k = this._wmsVersion >= 1.3 ? "crs" : "srs";
        this.wmsParams[k] = this._crs.code, j0.prototype.onAdd.call(this, h);
      },
      getTileUrl: function(h) {
        var k = this._tileCoordsToNwSe(h), x = this._crs, V = nA(x.project(k[0]), x.project(k[1])), eA = V.min, IA = V.max, mA = (this._wmsVersion >= 1.3 && this._crs === SA ? [eA.y, eA.x, IA.y, IA.x] : [eA.x, eA.y, IA.x, IA.y]).join(","), fA = j0.prototype.getTileUrl.call(this, h);
        return fA + d(this.wmsParams, fA, this.options.uppercase) + (this.options.uppercase ? "&BBOX=" : "&bbox=") + mA;
      },
      // @method setParams(params: Object, noRedraw?: Boolean): this
      // Merges an object with the new parameters and re-requests tiles on the current screen (unless `noRedraw` was set to true).
      setParams: function(h, k) {
        return n(this.wmsParams, h), k || this.redraw(), this;
      }
    });
    function rjA(h, k) {
      return new faA(h, k);
    }
    j0.WMS = faA, waA.wms = rjA;
    var ec = Ge.extend({
      // @section
      // @aka Renderer options
      options: {
        // @option padding: Number = 0.1
        // How much to extend the clip area around the map view (relative to its size)
        // e.g. 0.1 would be 10% of map view in each direction
        padding: 0.1
      },
      initialize: function(h) {
        E(this, h), I(this), this._layers = this._layers || {};
      },
      onAdd: function() {
        this._container || (this._initContainer(), It(this._container, "leaflet-zoom-animated")), this.getPane().appendChild(this._container), this._update(), this.on("update", this._updatePaths, this);
      },
      onRemove: function() {
        this.off("update", this._updatePaths, this), this._destroyContainer();
      },
      getEvents: function() {
        var h = {
          viewreset: this._reset,
          zoom: this._onZoom,
          moveend: this._update,
          zoomend: this._onZoomEnd
        };
        return this._zoomAnimated && (h.zoomanim = this._onAnimZoom), h;
      },
      _onAnimZoom: function(h) {
        this._updateTransform(h.center, h.zoom);
      },
      _onZoom: function() {
        this._updateTransform(this._map.getCenter(), this._map.getZoom());
      },
      _updateTransform: function(h, k) {
        var x = this._map.getZoomScale(k, this._zoom), V = this._map.getSize().multiplyBy(0.5 + this.options.padding), eA = this._map.project(this._center, k), IA = V.multiplyBy(-x).add(eA).subtract(this._map._getNewPixelOrigin(h, k));
        Je.any3d ? yA(this._container, IA, x) : YA(this._container, IA);
      },
      _reset: function() {
        this._update(), this._updateTransform(this._center, this._zoom);
        for (var h in this._layers)
          this._layers[h]._reset();
      },
      _onZoomEnd: function() {
        for (var h in this._layers)
          this._layers[h]._project();
      },
      _updatePaths: function() {
        for (var h in this._layers)
          this._layers[h]._update();
      },
      _update: function() {
        var h = this.options.padding, k = this._map.getSize(), x = this._map.containerPointToLayerPoint(k.multiplyBy(-h)).round();
        this._bounds = new tA(x, x.add(k.multiplyBy(1 + h * 2)).round()), this._center = this._map.getCenter(), this._zoom = this._map.getZoom();
      }
    }), DaA = ec.extend({
      // @section
      // @aka Canvas options
      options: {
        // @option tolerance: Number = 0
        // How much to extend the click tolerance around a path/object on the map.
        tolerance: 0
      },
      getEvents: function() {
        var h = ec.prototype.getEvents.call(this);
        return h.viewprereset = this._onViewPreReset, h;
      },
      _onViewPreReset: function() {
        this._postponeUpdatePaths = !0;
      },
      onAdd: function() {
        ec.prototype.onAdd.call(this), this._draw();
      },
      _initContainer: function() {
        var h = this._container = document.createElement("canvas");
        At(h, "mousemove", this._onMouseMove, this), At(h, "click dblclick mousedown mouseup contextmenu", this._onClick, this), At(h, "mouseout", this._handleMouseOut, this), h._leaflet_disable_events = !0, this._ctx = h.getContext("2d");
      },
      _destroyContainer: function() {
        N(this._redrawRequest), delete this._ctx, fi(this._container), Ri(this._container), delete this._container;
      },
      _updatePaths: function() {
        if (!this._postponeUpdatePaths) {
          var h;
          this._redrawBounds = null;
          for (var k in this._layers)
            h = this._layers[k], h._update();
          this._redraw();
        }
      },
      _update: function() {
        if (!(this._map._animatingZoom && this._bounds)) {
          ec.prototype._update.call(this);
          var h = this._bounds, k = this._container, x = h.getSize(), V = Je.retina ? 2 : 1;
          YA(k, h.min), k.width = V * x.x, k.height = V * x.y, k.style.width = x.x + "px", k.style.height = x.y + "px", Je.retina && this._ctx.scale(2, 2), this._ctx.translate(-h.min.x, -h.min.y), this.fire("update");
        }
      },
      _reset: function() {
        ec.prototype._reset.call(this), this._postponeUpdatePaths && (this._postponeUpdatePaths = !1, this._updatePaths());
      },
      _initPath: function(h) {
        this._updateDashArray(h), this._layers[I(h)] = h;
        var k = h._order = {
          layer: h,
          prev: this._drawLast,
          next: null
        };
        this._drawLast && (this._drawLast.next = k), this._drawLast = k, this._drawFirst = this._drawFirst || this._drawLast;
      },
      _addPath: function(h) {
        this._requestRedraw(h);
      },
      _removePath: function(h) {
        var k = h._order, x = k.next, V = k.prev;
        x ? x.prev = V : this._drawLast = V, V ? V.next = x : this._drawFirst = x, delete h._order, delete this._layers[I(h)], this._requestRedraw(h);
      },
      _updatePath: function(h) {
        this._extendRedrawBounds(h), h._project(), h._update(), this._requestRedraw(h);
      },
      _updateStyle: function(h) {
        this._updateDashArray(h), this._requestRedraw(h);
      },
      _updateDashArray: function(h) {
        if (typeof h.options.dashArray == "string") {
          var k = h.options.dashArray.split(/[, ]+/), x = [], V, eA;
          for (eA = 0; eA < k.length; eA++) {
            if (V = Number(k[eA]), isNaN(V))
              return;
            x.push(V);
          }
          h.options._dashArray = x;
        } else
          h.options._dashArray = h.options.dashArray;
      },
      _requestRedraw: function(h) {
        this._map && (this._extendRedrawBounds(h), this._redrawRequest = this._redrawRequest || p(this._redraw, this));
      },
      _extendRedrawBounds: function(h) {
        if (h._pxBounds) {
          var k = (h.options.weight || 0) + 1;
          this._redrawBounds = this._redrawBounds || new tA(), this._redrawBounds.extend(h._pxBounds.min.subtract([k, k])), this._redrawBounds.extend(h._pxBounds.max.add([k, k]));
        }
      },
      _redraw: function() {
        this._redrawRequest = null, this._redrawBounds && (this._redrawBounds.min._floor(), this._redrawBounds.max._ceil()), this._clear(), this._draw(), this._redrawBounds = null;
      },
      _clear: function() {
        var h = this._redrawBounds;
        if (h) {
          var k = h.getSize();
          this._ctx.clearRect(h.min.x, h.min.y, k.x, k.y);
        } else
          this._ctx.save(), this._ctx.setTransform(1, 0, 0, 1, 0, 0), this._ctx.clearRect(0, 0, this._container.width, this._container.height), this._ctx.restore();
      },
      _draw: function() {
        var h, k = this._redrawBounds;
        if (this._ctx.save(), k) {
          var x = k.getSize();
          this._ctx.beginPath(), this._ctx.rect(k.min.x, k.min.y, x.x, x.y), this._ctx.clip();
        }
        this._drawing = !0;
        for (var V = this._drawFirst; V; V = V.next)
          h = V.layer, (!k || h._pxBounds && h._pxBounds.intersects(k)) && h._updatePath();
        this._drawing = !1, this._ctx.restore();
      },
      _updatePoly: function(h, k) {
        if (this._drawing) {
          var x, V, eA, IA, mA = h._parts, fA = mA.length, JA = this._ctx;
          if (fA) {
            for (JA.beginPath(), x = 0; x < fA; x++) {
              for (V = 0, eA = mA[x].length; V < eA; V++)
                IA = mA[x][V], JA[V ? "lineTo" : "moveTo"](IA.x, IA.y);
              k && JA.closePath();
            }
            this._fillStroke(JA, h);
          }
        }
      },
      _updateCircle: function(h) {
        if (!(!this._drawing || h._empty())) {
          var k = h._point, x = this._ctx, V = Math.max(Math.round(h._radius), 1), eA = (Math.max(Math.round(h._radiusY), 1) || V) / V;
          eA !== 1 && (x.save(), x.scale(1, eA)), x.beginPath(), x.arc(k.x, k.y / eA, V, 0, Math.PI * 2, !1), eA !== 1 && x.restore(), this._fillStroke(x, h);
        }
      },
      _fillStroke: function(h, k) {
        var x = k.options;
        x.fill && (h.globalAlpha = x.fillOpacity, h.fillStyle = x.fillColor || x.color, h.fill(x.fillRule || "evenodd")), x.stroke && x.weight !== 0 && (h.setLineDash && h.setLineDash(k.options && k.options._dashArray || []), h.globalAlpha = x.opacity, h.lineWidth = x.weight, h.strokeStyle = x.color, h.lineCap = x.lineCap, h.lineJoin = x.lineJoin, h.stroke());
      },
      // Canvas obviously doesn't have mouse events for individual drawn objects,
      // so we emulate that by calculating what's under the mouse on mousemove/click manually
      _onClick: function(h) {
        for (var k = this._map.mouseEventToLayerPoint(h), x, V, eA = this._drawFirst; eA; eA = eA.next)
          x = eA.layer, x.options.interactive && x._containsPoint(k) && (!(h.type === "click" || h.type === "preclick") || !this._map._draggableMoved(x)) && (V = x);
        this._fireEvent(V ? [V] : !1, h);
      },
      _onMouseMove: function(h) {
        if (!(!this._map || this._map.dragging.moving() || this._map._animatingZoom)) {
          var k = this._map.mouseEventToLayerPoint(h);
          this._handleMouseHover(h, k);
        }
      },
      _handleMouseOut: function(h) {
        var k = this._hoveredLayer;
        k && (vi(this._container, "leaflet-interactive"), this._fireEvent([k], h, "mouseout"), this._hoveredLayer = null, this._mouseHoverThrottled = !1);
      },
      _handleMouseHover: function(h, k) {
        if (!this._mouseHoverThrottled) {
          for (var x, V, eA = this._drawFirst; eA; eA = eA.next)
            x = eA.layer, x.options.interactive && x._containsPoint(k) && (V = x);
          V !== this._hoveredLayer && (this._handleMouseOut(h), V && (It(this._container, "leaflet-interactive"), this._fireEvent([V], h, "mouseover"), this._hoveredLayer = V)), this._fireEvent(this._hoveredLayer ? [this._hoveredLayer] : !1, h), this._mouseHoverThrottled = !0, setTimeout(g(function() {
            this._mouseHoverThrottled = !1;
          }, this), 32);
        }
      },
      _fireEvent: function(h, k, x) {
        this._map._fireDOMEvent(k, x || k.type, h);
      },
      _bringToFront: function(h) {
        var k = h._order;
        if (k) {
          var x = k.next, V = k.prev;
          if (x)
            x.prev = V;
          else
            return;
          V ? V.next = x : x && (this._drawFirst = x), k.prev = this._drawLast, this._drawLast.next = k, k.next = null, this._drawLast = k, this._requestRedraw(h);
        }
      },
      _bringToBack: function(h) {
        var k = h._order;
        if (k) {
          var x = k.next, V = k.prev;
          if (V)
            V.next = x;
          else
            return;
          x ? x.prev = V : V && (this._drawLast = V), k.prev = null, k.next = this._drawFirst, this._drawFirst.prev = k, this._drawFirst = k, this._requestRedraw(h);
        }
      }
    });
    function GaA(h) {
      return Je.canvas ? new DaA(h) : null;
    }
    var qG = function() {
      try {
        return document.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"), function(h) {
          return document.createElement("<lvml:" + h + ' class="lvml">');
        };
      } catch {
      }
      return function(h) {
        return document.createElement("<" + h + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">');
      };
    }(), CjA = {
      _initContainer: function() {
        this._container = kt("div", "leaflet-vml-container");
      },
      _update: function() {
        this._map._animatingZoom || (ec.prototype._update.call(this), this.fire("update"));
      },
      _initPath: function(h) {
        var k = h._container = qG("shape");
        It(k, "leaflet-vml-shape " + (this.options.className || "")), k.coordsize = "1 1", h._path = qG("path"), k.appendChild(h._path), this._updateStyle(h), this._layers[I(h)] = h;
      },
      _addPath: function(h) {
        var k = h._container;
        this._container.appendChild(k), h.options.interactive && h.addInteractiveTarget(k);
      },
      _removePath: function(h) {
        var k = h._container;
        fi(k), h.removeInteractiveTarget(k), delete this._layers[I(h)];
      },
      _updateStyle: function(h) {
        var k = h._stroke, x = h._fill, V = h.options, eA = h._container;
        eA.stroked = !!V.stroke, eA.filled = !!V.fill, V.stroke ? (k || (k = h._stroke = qG("stroke")), eA.appendChild(k), k.weight = V.weight + "px", k.color = V.color, k.opacity = V.opacity, V.dashArray ? k.dashStyle = f(V.dashArray) ? V.dashArray.join(" ") : V.dashArray.replace(/( *, *)/g, " ") : k.dashStyle = "", k.endcap = V.lineCap.replace("butt", "flat"), k.joinstyle = V.lineJoin) : k && (eA.removeChild(k), h._stroke = null), V.fill ? (x || (x = h._fill = qG("fill")), eA.appendChild(x), x.color = V.fillColor || V.color, x.opacity = V.fillOpacity) : x && (eA.removeChild(x), h._fill = null);
      },
      _updateCircle: function(h) {
        var k = h._point.round(), x = Math.round(h._radius), V = Math.round(h._radiusY || x);
        this._setPath(h, h._empty() ? "M0 0" : "AL " + k.x + "," + k.y + " " + x + "," + V + " 0," + 65535 * 360);
      },
      _setPath: function(h, k) {
        h._path.v = k;
      },
      _bringToFront: function(h) {
        Ea(h._container);
      },
      _bringToBack: function(h) {
        lI(h._container);
      }
    }, X1 = Je.vml ? qG : HA, OG = ec.extend({
      _initContainer: function() {
        this._container = X1("svg"), this._container.setAttribute("pointer-events", "none"), this._rootGroup = X1("g"), this._container.appendChild(this._rootGroup);
      },
      _destroyContainer: function() {
        fi(this._container), Ri(this._container), delete this._container, delete this._rootGroup, delete this._svgSize;
      },
      _update: function() {
        if (!(this._map._animatingZoom && this._bounds)) {
          ec.prototype._update.call(this);
          var h = this._bounds, k = h.getSize(), x = this._container;
          (!this._svgSize || !this._svgSize.equals(k)) && (this._svgSize = k, x.setAttribute("width", k.x), x.setAttribute("height", k.y)), YA(x, h.min), x.setAttribute("viewBox", [h.min.x, h.min.y, k.x, k.y].join(" ")), this.fire("update");
        }
      },
      // methods below are called by vector layers implementations
      _initPath: function(h) {
        var k = h._path = X1("path");
        h.options.className && It(k, h.options.className), h.options.interactive && It(k, "leaflet-interactive"), this._updateStyle(h), this._layers[I(h)] = h;
      },
      _addPath: function(h) {
        this._rootGroup || this._initContainer(), this._rootGroup.appendChild(h._path), h.addInteractiveTarget(h._path);
      },
      _removePath: function(h) {
        fi(h._path), h.removeInteractiveTarget(h._path), delete this._layers[I(h)];
      },
      _updatePath: function(h) {
        h._project(), h._update();
      },
      _updateStyle: function(h) {
        var k = h._path, x = h.options;
        k && (x.stroke ? (k.setAttribute("stroke", x.color), k.setAttribute("stroke-opacity", x.opacity), k.setAttribute("stroke-width", x.weight), k.setAttribute("stroke-linecap", x.lineCap), k.setAttribute("stroke-linejoin", x.lineJoin), x.dashArray ? k.setAttribute("stroke-dasharray", x.dashArray) : k.removeAttribute("stroke-dasharray"), x.dashOffset ? k.setAttribute("stroke-dashoffset", x.dashOffset) : k.removeAttribute("stroke-dashoffset")) : k.setAttribute("stroke", "none"), x.fill ? (k.setAttribute("fill", x.fillColor || x.color), k.setAttribute("fill-opacity", x.fillOpacity), k.setAttribute("fill-rule", x.fillRule || "evenodd")) : k.setAttribute("fill", "none"));
      },
      _updatePoly: function(h, k) {
        this._setPath(h, ne(h._parts, k));
      },
      _updateCircle: function(h) {
        var k = h._point, x = Math.max(Math.round(h._radius), 1), V = Math.max(Math.round(h._radiusY), 1) || x, eA = "a" + x + "," + V + " 0 1,0 ", IA = h._empty() ? "M0 0" : "M" + (k.x - x) + "," + k.y + eA + x * 2 + ",0 " + eA + -x * 2 + ",0 ";
        this._setPath(h, IA);
      },
      _setPath: function(h, k) {
        h._path.setAttribute("d", k);
      },
      // SVG does not have the concept of zIndex so we resort to changing the DOM order of elements
      _bringToFront: function(h) {
        Ea(h._path);
      },
      _bringToBack: function(h) {
        lI(h._path);
      }
    });
    Je.vml && OG.include(CjA);
    function kaA(h) {
      return Je.svg || Je.vml ? new OG(h) : null;
    }
    Mt.include({
      // @namespace Map; @method getRenderer(layer: Path): Renderer
      // Returns the instance of `Renderer` that should be used to render the given
      // `Path`. It will ensure that the `renderer` options of the map and paths
      // are respected, and that the renderers do exist on the map.
      getRenderer: function(h) {
        var k = h.options.renderer || this._getPaneRenderer(h.options.pane) || this.options.renderer || this._renderer;
        return k || (k = this._renderer = this._createRenderer()), this.hasLayer(k) || this.addLayer(k), k;
      },
      _getPaneRenderer: function(h) {
        if (h === "overlayPane" || h === void 0)
          return !1;
        var k = this._paneRenderers[h];
        return k === void 0 && (k = this._createRenderer({ pane: h }), this._paneRenderers[h] = k), k;
      },
      _createRenderer: function(h) {
        return this.options.preferCanvas && GaA(h) || kaA(h);
      }
    });
    var JaA = q0.extend({
      initialize: function(h, k) {
        q0.prototype.initialize.call(this, this._boundsToLatLngs(h), k);
      },
      // @method setBounds(latLngBounds: LatLngBounds): this
      // Redraws the rectangle with the passed bounds.
      setBounds: function(h) {
        return this.setLatLngs(this._boundsToLatLngs(h));
      },
      _boundsToLatLngs: function(h) {
        return h = gA(h), [
          h.getSouthWest(),
          h.getNorthWest(),
          h.getNorthEast(),
          h.getSouthEast()
        ];
      }
    });
    function BjA(h, k) {
      return new JaA(h, k);
    }
    OG.create = X1, OG.pointsToPath = ne, Ac.geometryToLayer = H1, Ac.coordsToLatLng = u9, Ac.coordsToLatLngs = S1, Ac.latLngToCoords = d9, Ac.latLngsToCoords = Z1, Ac.getFeature = O0, Ac.asFeature = W1, Mt.mergeOptions({
      // @option boxZoom: Boolean = true
      // Whether the map can be zoomed to a rectangular area specified by
      // dragging the mouse while pressing the shift key.
      boxZoom: !0
    });
    var NaA = vg.extend({
      initialize: function(h) {
        this._map = h, this._container = h._container, this._pane = h._panes.overlayPane, this._resetStateTimeout = 0, h.on("unload", this._destroy, this);
      },
      addHooks: function() {
        At(this._container, "mousedown", this._onMouseDown, this);
      },
      removeHooks: function() {
        Ri(this._container, "mousedown", this._onMouseDown, this);
      },
      moved: function() {
        return this._moved;
      },
      _destroy: function() {
        fi(this._pane), delete this._pane;
      },
      _resetState: function() {
        this._resetStateTimeout = 0, this._moved = !1;
      },
      _clearDeferredResetState: function() {
        this._resetStateTimeout !== 0 && (clearTimeout(this._resetStateTimeout), this._resetStateTimeout = 0);
      },
      _onMouseDown: function(h) {
        if (!h.shiftKey || h.which !== 1 && h.button !== 1)
          return !1;
        this._clearDeferredResetState(), this._resetState(), Fe(), xg(), this._startPoint = this._map.mouseEventToContainerPoint(h), At(document, {
          contextmenu: da,
          mousemove: this._onMouseMove,
          mouseup: this._onMouseUp,
          keydown: this._onKeyDown
        }, this);
      },
      _onMouseMove: function(h) {
        this._moved || (this._moved = !0, this._box = kt("div", "leaflet-zoom-box", this._container), It(this._container, "leaflet-crosshair"), this._map.fire("boxzoomstart")), this._point = this._map.mouseEventToContainerPoint(h);
        var k = new tA(this._point, this._startPoint), x = k.getSize();
        YA(this._box, k.min), this._box.style.width = x.x + "px", this._box.style.height = x.y + "px";
      },
      _finish: function() {
        this._moved && (fi(this._box), vi(this._container, "leaflet-crosshair")), Ve(), Lg(), Ri(document, {
          contextmenu: da,
          mousemove: this._onMouseMove,
          mouseup: this._onMouseUp,
          keydown: this._onKeyDown
        }, this);
      },
      _onMouseUp: function(h) {
        if (!(h.which !== 1 && h.button !== 1) && (this._finish(), !!this._moved)) {
          this._clearDeferredResetState(), this._resetStateTimeout = setTimeout(g(this._resetState, this), 0);
          var k = new AA(
            this._map.containerPointToLatLng(this._startPoint),
            this._map.containerPointToLatLng(this._point)
          );
          this._map.fitBounds(k).fire("boxzoomend", { boxZoomBounds: k });
        }
      },
      _onKeyDown: function(h) {
        h.keyCode === 27 && (this._finish(), this._clearDeferredResetState(), this._resetState());
      }
    });
    Mt.addInitHook("addHandler", "boxZoom", NaA), Mt.mergeOptions({
      // @option doubleClickZoom: Boolean|String = true
      // Whether the map can be zoomed in by double clicking on it and
      // zoomed out by double clicking while holding shift. If passed
      // `'center'`, double-click zoom will zoom to the center of the
      //  view regardless of where the mouse was.
      doubleClickZoom: !0
    });
    var YaA = vg.extend({
      addHooks: function() {
        this._map.on("dblclick", this._onDoubleClick, this);
      },
      removeHooks: function() {
        this._map.off("dblclick", this._onDoubleClick, this);
      },
      _onDoubleClick: function(h) {
        var k = this._map, x = k.getZoom(), V = k.options.zoomDelta, eA = h.originalEvent.shiftKey ? x - V : x + V;
        k.options.doubleClickZoom === "center" ? k.setZoom(eA) : k.setZoomAround(h.containerPoint, eA);
      }
    });
    Mt.addInitHook("addHandler", "doubleClickZoom", YaA), Mt.mergeOptions({
      // @option dragging: Boolean = true
      // Whether the map is draggable with mouse/touch or not.
      dragging: !0,
      // @section Panning Inertia Options
      // @option inertia: Boolean = *
      // If enabled, panning of the map will have an inertia effect where
      // the map builds momentum while dragging and continues moving in
      // the same direction for some time. Feels especially nice on touch
      // devices. Enabled by default.
      inertia: !0,
      // @option inertiaDeceleration: Number = 3000
      // The rate with which the inertial movement slows down, in pixels/second².
      inertiaDeceleration: 3400,
      // px/s^2
      // @option inertiaMaxSpeed: Number = Infinity
      // Max speed of the inertial movement, in pixels/second.
      inertiaMaxSpeed: 1 / 0,
      // px/s
      // @option easeLinearity: Number = 0.2
      easeLinearity: 0.2,
      // TODO refactor, move to CRS
      // @option worldCopyJump: Boolean = false
      // With this option enabled, the map tracks when you pan to another "copy"
      // of the world and seamlessly jumps to the original one so that all overlays
      // like markers and vector layers are still visible.
      worldCopyJump: !1,
      // @option maxBoundsViscosity: Number = 0.0
      // If `maxBounds` is set, this option will control how solid the bounds
      // are when dragging the map around. The default value of `0.0` allows the
      // user to drag outside the bounds at normal speed, higher values will
      // slow down map dragging outside bounds, and `1.0` makes the bounds fully
      // solid, preventing the user from dragging outside the bounds.
      maxBoundsViscosity: 0
    });
    var RaA = vg.extend({
      addHooks: function() {
        if (!this._draggable) {
          var h = this._map;
          this._draggable = new pr(h._mapPane, h._container), this._draggable.on({
            dragstart: this._onDragStart,
            drag: this._onDrag,
            dragend: this._onDragEnd
          }, this), this._draggable.on("predrag", this._onPreDragLimit, this), h.options.worldCopyJump && (this._draggable.on("predrag", this._onPreDragWrap, this), h.on("zoomend", this._onZoomEnd, this), h.whenReady(this._onZoomEnd, this));
        }
        It(this._map._container, "leaflet-grab leaflet-touch-drag"), this._draggable.enable(), this._positions = [], this._times = [];
      },
      removeHooks: function() {
        vi(this._map._container, "leaflet-grab"), vi(this._map._container, "leaflet-touch-drag"), this._draggable.disable();
      },
      moved: function() {
        return this._draggable && this._draggable._moved;
      },
      moving: function() {
        return this._draggable && this._draggable._moving;
      },
      _onDragStart: function() {
        var h = this._map;
        if (h._stop(), this._map.options.maxBounds && this._map.options.maxBoundsViscosity) {
          var k = gA(this._map.options.maxBounds);
          this._offsetLimit = nA(
            this._map.latLngToContainerPoint(k.getNorthWest()).multiplyBy(-1),
            this._map.latLngToContainerPoint(k.getSouthEast()).multiplyBy(-1).add(this._map.getSize())
          ), this._viscosity = Math.min(1, Math.max(0, this._map.options.maxBoundsViscosity));
        } else
          this._offsetLimit = null;
        h.fire("movestart").fire("dragstart"), h.options.inertia && (this._positions = [], this._times = []);
      },
      _onDrag: function(h) {
        if (this._map.options.inertia) {
          var k = this._lastTime = +/* @__PURE__ */ new Date(), x = this._lastPos = this._draggable._absPos || this._draggable._newPos;
          this._positions.push(x), this._times.push(k), this._prunePositions(k);
        }
        this._map.fire("move", h).fire("drag", h);
      },
      _prunePositions: function(h) {
        for (; this._positions.length > 1 && h - this._times[0] > 50; )
          this._positions.shift(), this._times.shift();
      },
      _onZoomEnd: function() {
        var h = this._map.getSize().divideBy(2), k = this._map.latLngToLayerPoint([0, 0]);
        this._initialWorldOffset = k.subtract(h).x, this._worldWidth = this._map.getPixelWorldBounds().getSize().x;
      },
      _viscousLimit: function(h, k) {
        return h - (h - k) * this._viscosity;
      },
      _onPreDragLimit: function() {
        if (!(!this._viscosity || !this._offsetLimit)) {
          var h = this._draggable._newPos.subtract(this._draggable._startPos), k = this._offsetLimit;
          h.x < k.min.x && (h.x = this._viscousLimit(h.x, k.min.x)), h.y < k.min.y && (h.y = this._viscousLimit(h.y, k.min.y)), h.x > k.max.x && (h.x = this._viscousLimit(h.x, k.max.x)), h.y > k.max.y && (h.y = this._viscousLimit(h.y, k.max.y)), this._draggable._newPos = this._draggable._startPos.add(h);
        }
      },
      _onPreDragWrap: function() {
        var h = this._worldWidth, k = Math.round(h / 2), x = this._initialWorldOffset, V = this._draggable._newPos.x, eA = (V - k + x) % h + k - x, IA = (V + k + x) % h - k - x, mA = Math.abs(eA + x) < Math.abs(IA + x) ? eA : IA;
        this._draggable._absPos = this._draggable._newPos.clone(), this._draggable._newPos.x = mA;
      },
      _onDragEnd: function(h) {
        var k = this._map, x = k.options, V = !x.inertia || h.noInertia || this._times.length < 2;
        if (k.fire("dragend", h), V)
          k.fire("moveend");
        else {
          this._prunePositions(+/* @__PURE__ */ new Date());
          var eA = this._lastPos.subtract(this._positions[0]), IA = (this._lastTime - this._times[0]) / 1e3, mA = x.easeLinearity, fA = eA.multiplyBy(mA / IA), JA = fA.distanceTo([0, 0]), XA = Math.min(x.inertiaMaxSpeed, JA), he = fA.multiplyBy(XA / JA), Oe = XA / (x.inertiaDeceleration * mA), Rt = he.multiplyBy(-Oe / 2).round();
          !Rt.x && !Rt.y ? k.fire("moveend") : (Rt = k._limitOffset(Rt, k.options.maxBounds), p(function() {
            k.panBy(Rt, {
              duration: Oe,
              easeLinearity: mA,
              noMoveStart: !0,
              animate: !0
            });
          }));
        }
      }
    });
    Mt.addInitHook("addHandler", "dragging", RaA), Mt.mergeOptions({
      // @option keyboard: Boolean = true
      // Makes the map focusable and allows users to navigate the map with keyboard
      // arrows and `+`/`-` keys.
      keyboard: !0,
      // @option keyboardPanDelta: Number = 80
      // Amount of pixels to pan when pressing an arrow key.
      keyboardPanDelta: 80
    });
    var FaA = vg.extend({
      keyCodes: {
        left: [37],
        right: [39],
        down: [40],
        up: [38],
        zoomIn: [187, 107, 61, 171],
        zoomOut: [189, 109, 54, 173]
      },
      initialize: function(h) {
        this._map = h, this._setPanDelta(h.options.keyboardPanDelta), this._setZoomDelta(h.options.zoomDelta);
      },
      addHooks: function() {
        var h = this._map._container;
        h.tabIndex <= 0 && (h.tabIndex = "0"), At(h, {
          focus: this._onFocus,
          blur: this._onBlur,
          mousedown: this._onMouseDown
        }, this), this._map.on({
          focus: this._addHooks,
          blur: this._removeHooks
        }, this);
      },
      removeHooks: function() {
        this._removeHooks(), Ri(this._map._container, {
          focus: this._onFocus,
          blur: this._onBlur,
          mousedown: this._onMouseDown
        }, this), this._map.off({
          focus: this._addHooks,
          blur: this._removeHooks
        }, this);
      },
      _onMouseDown: function() {
        if (!this._focused) {
          var h = document.body, k = document.documentElement, x = h.scrollTop || k.scrollTop, V = h.scrollLeft || k.scrollLeft;
          this._map._container.focus(), window.scrollTo(V, x);
        }
      },
      _onFocus: function() {
        this._focused = !0, this._map.fire("focus");
      },
      _onBlur: function() {
        this._focused = !1, this._map.fire("blur");
      },
      _setPanDelta: function(h) {
        var k = this._panKeys = {}, x = this.keyCodes, V, eA;
        for (V = 0, eA = x.left.length; V < eA; V++)
          k[x.left[V]] = [-1 * h, 0];
        for (V = 0, eA = x.right.length; V < eA; V++)
          k[x.right[V]] = [h, 0];
        for (V = 0, eA = x.down.length; V < eA; V++)
          k[x.down[V]] = [0, h];
        for (V = 0, eA = x.up.length; V < eA; V++)
          k[x.up[V]] = [0, -1 * h];
      },
      _setZoomDelta: function(h) {
        var k = this._zoomKeys = {}, x = this.keyCodes, V, eA;
        for (V = 0, eA = x.zoomIn.length; V < eA; V++)
          k[x.zoomIn[V]] = h;
        for (V = 0, eA = x.zoomOut.length; V < eA; V++)
          k[x.zoomOut[V]] = -h;
      },
      _addHooks: function() {
        At(document, "keydown", this._onKeyDown, this);
      },
      _removeHooks: function() {
        Ri(document, "keydown", this._onKeyDown, this);
      },
      _onKeyDown: function(h) {
        if (!(h.altKey || h.ctrlKey || h.metaKey)) {
          var k = h.keyCode, x = this._map, V;
          if (k in this._panKeys) {
            if (!x._panAnim || !x._panAnim._inProgress)
              if (V = this._panKeys[k], h.shiftKey && (V = _(V).multiplyBy(3)), x.options.maxBounds && (V = x._limitOffset(_(V), x.options.maxBounds)), x.options.worldCopyJump) {
                var eA = x.wrapLatLng(x.unproject(x.project(x.getCenter()).add(V)));
                x.panTo(eA);
              } else
                x.panBy(V);
          } else if (k in this._zoomKeys)
            x.setZoom(x.getZoom() + (h.shiftKey ? 3 : 1) * this._zoomKeys[k]);
          else if (k === 27 && x._popup && x._popup.options.closeOnEscapeKey)
            x.closePopup();
          else
            return;
          da(h);
        }
      }
    });
    Mt.addInitHook("addHandler", "keyboard", FaA), Mt.mergeOptions({
      // @section Mouse wheel options
      // @option scrollWheelZoom: Boolean|String = true
      // Whether the map can be zoomed by using the mouse wheel. If passed `'center'`,
      // it will zoom to the center of the view regardless of where the mouse was.
      scrollWheelZoom: !0,
      // @option wheelDebounceTime: Number = 40
      // Limits the rate at which a wheel can fire (in milliseconds). By default
      // user can't zoom via wheel more often than once per 40 ms.
      wheelDebounceTime: 40,
      // @option wheelPxPerZoomLevel: Number = 60
      // How many scroll pixels (as reported by [L.DomEvent.getWheelDelta](#domevent-getwheeldelta))
      // mean a change of one full zoom level. Smaller values will make wheel-zooming
      // faster (and vice versa).
      wheelPxPerZoomLevel: 60
    });
    var MaA = vg.extend({
      addHooks: function() {
        At(this._map._container, "wheel", this._onWheelScroll, this), this._delta = 0;
      },
      removeHooks: function() {
        Ri(this._map._container, "wheel", this._onWheelScroll, this);
      },
      _onWheelScroll: function(h) {
        var k = UC(h), x = this._map.options.wheelDebounceTime;
        this._delta += k, this._lastMousePos = this._map.mouseEventToContainerPoint(h), this._startTime || (this._startTime = +/* @__PURE__ */ new Date());
        var V = Math.max(x - (+/* @__PURE__ */ new Date() - this._startTime), 0);
        clearTimeout(this._timer), this._timer = setTimeout(g(this._performZoom, this), V), da(h);
      },
      _performZoom: function() {
        var h = this._map, k = h.getZoom(), x = this._map.options.zoomSnap || 0;
        h._stop();
        var V = this._delta / (this._map.options.wheelPxPerZoomLevel * 4), eA = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(V)))) / Math.LN2, IA = x ? Math.ceil(eA / x) * x : eA, mA = h._limitZoom(k + (this._delta > 0 ? IA : -IA)) - k;
        this._delta = 0, this._startTime = null, mA && (h.options.scrollWheelZoom === "center" ? h.setZoom(k + mA) : h.setZoomAround(this._lastMousePos, k + mA));
      }
    });
    Mt.addInitHook("addHandler", "scrollWheelZoom", MaA);
    var ljA = 600;
    Mt.mergeOptions({
      // @section Touch interaction options
      // @option tapHold: Boolean
      // Enables simulation of `contextmenu` event, default is `true` for mobile Safari.
      tapHold: Je.touchNative && Je.safari && Je.mobile,
      // @option tapTolerance: Number = 15
      // The max number of pixels a user can shift his finger during touch
      // for it to be considered a valid tap.
      tapTolerance: 15
    });
    var xaA = vg.extend({
      addHooks: function() {
        At(this._map._container, "touchstart", this._onDown, this);
      },
      removeHooks: function() {
        Ri(this._map._container, "touchstart", this._onDown, this);
      },
      _onDown: function(h) {
        if (clearTimeout(this._holdTimeout), h.touches.length === 1) {
          var k = h.touches[0];
          this._startPos = this._newPos = new O(k.clientX, k.clientY), this._holdTimeout = setTimeout(g(function() {
            this._cancel(), this._isTapValid() && (At(document, "touchend", pn), At(document, "touchend touchcancel", this._cancelClickPrevent), this._simulateEvent("contextmenu", k));
          }, this), ljA), At(document, "touchend touchcancel contextmenu", this._cancel, this), At(document, "touchmove", this._onMove, this);
        }
      },
      _cancelClickPrevent: function h() {
        Ri(document, "touchend", pn), Ri(document, "touchend touchcancel", h);
      },
      _cancel: function() {
        clearTimeout(this._holdTimeout), Ri(document, "touchend touchcancel contextmenu", this._cancel, this), Ri(document, "touchmove", this._onMove, this);
      },
      _onMove: function(h) {
        var k = h.touches[0];
        this._newPos = new O(k.clientX, k.clientY);
      },
      _isTapValid: function() {
        return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance;
      },
      _simulateEvent: function(h, k) {
        var x = new MouseEvent(h, {
          bubbles: !0,
          cancelable: !0,
          view: window,
          // detail: 1,
          screenX: k.screenX,
          screenY: k.screenY,
          clientX: k.clientX,
          clientY: k.clientY
          // button: 2,
          // buttons: 2
        });
        x._simulated = !0, k.target.dispatchEvent(x);
      }
    });
    Mt.addInitHook("addHandler", "tapHold", xaA), Mt.mergeOptions({
      // @section Touch interaction options
      // @option touchZoom: Boolean|String = *
      // Whether the map can be zoomed by touch-dragging with two fingers. If
      // passed `'center'`, it will zoom to the center of the view regardless of
      // where the touch events (fingers) were. Enabled for touch-capable web
      // browsers.
      touchZoom: Je.touch,
      // @option bounceAtZoomLimits: Boolean = true
      // Set it to false if you don't want the map to zoom beyond min/max zoom
      // and then bounce back when pinch-zooming.
      bounceAtZoomLimits: !0
    });
    var LaA = vg.extend({
      addHooks: function() {
        It(this._map._container, "leaflet-touch-zoom"), At(this._map._container, "touchstart", this._onTouchStart, this);
      },
      removeHooks: function() {
        vi(this._map._container, "leaflet-touch-zoom"), Ri(this._map._container, "touchstart", this._onTouchStart, this);
      },
      _onTouchStart: function(h) {
        var k = this._map;
        if (!(!h.touches || h.touches.length !== 2 || k._animatingZoom || this._zooming)) {
          var x = k.mouseEventToContainerPoint(h.touches[0]), V = k.mouseEventToContainerPoint(h.touches[1]);
          this._centerPoint = k.getSize()._divideBy(2), this._startLatLng = k.containerPointToLatLng(this._centerPoint), k.options.touchZoom !== "center" && (this._pinchStartLatLng = k.containerPointToLatLng(x.add(V)._divideBy(2))), this._startDist = x.distanceTo(V), this._startZoom = k.getZoom(), this._moved = !1, this._zooming = !0, k._stop(), At(document, "touchmove", this._onTouchMove, this), At(document, "touchend touchcancel", this._onTouchEnd, this), pn(h);
        }
      },
      _onTouchMove: function(h) {
        if (!(!h.touches || h.touches.length !== 2 || !this._zooming)) {
          var k = this._map, x = k.mouseEventToContainerPoint(h.touches[0]), V = k.mouseEventToContainerPoint(h.touches[1]), eA = x.distanceTo(V) / this._startDist;
          if (this._zoom = k.getScaleZoom(eA, this._startZoom), !k.options.bounceAtZoomLimits && (this._zoom < k.getMinZoom() && eA < 1 || this._zoom > k.getMaxZoom() && eA > 1) && (this._zoom = k._limitZoom(this._zoom)), k.options.touchZoom === "center") {
            if (this._center = this._startLatLng, eA === 1)
              return;
          } else {
            var IA = x._add(V)._divideBy(2)._subtract(this._centerPoint);
            if (eA === 1 && IA.x === 0 && IA.y === 0)
              return;
            this._center = k.unproject(k.project(this._pinchStartLatLng, this._zoom).subtract(IA), this._zoom);
          }
          this._moved || (k._moveStart(!0, !1), this._moved = !0), N(this._animRequest);
          var mA = g(k._move, k, this._center, this._zoom, { pinch: !0, round: !1 }, void 0);
          this._animRequest = p(mA, this, !0), pn(h);
        }
      },
      _onTouchEnd: function() {
        if (!this._moved || !this._zooming) {
          this._zooming = !1;
          return;
        }
        this._zooming = !1, N(this._animRequest), Ri(document, "touchmove", this._onTouchMove, this), Ri(document, "touchend touchcancel", this._onTouchEnd, this), this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), !0, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom));
      }
    });
    Mt.addInitHook("addHandler", "touchZoom", LaA), Mt.BoxZoom = NaA, Mt.DoubleClickZoom = YaA, Mt.Drag = RaA, Mt.Keyboard = FaA, Mt.ScrollWheelZoom = MaA, Mt.TapHold = xaA, Mt.TouchZoom = LaA, t.Bounds = tA, t.Browser = Je, t.CRS = lA, t.Canvas = DaA, t.Circle = E9, t.CircleMarker = v1, t.Class = K, t.Control = ys, t.DivIcon = baA, t.DivOverlay = zC, t.DomEvent = SG, t.DomUtil = KC, t.Draggable = pr, t.Evented = q, t.FeatureGroup = Wt, t.GeoJSON = Ac, t.GridLayer = _G, t.Handler = vg, t.Icon = bo, t.ImageOverlay = K1, t.LatLng = rA, t.LatLngBounds = AA, t.Layer = Ge, t.LayerGroup = ot, t.LineUtil = iA, t.Map = Mt, t.Marker = aE, t.Mixin = dh, t.Path = rE, t.Point = O, t.PolyUtil = Hg, t.Polygon = q0, t.Polyline = $l, t.Popup = U1, t.PosAnimation = U0, t.Projection = kA, t.Rectangle = JaA, t.Renderer = ec, t.SVG = OG, t.SVGOverlay = yaA, t.TileLayer = j0, t.Tooltip = V1, t.Transformation = hA, t.Util = v, t.VideoOverlay = paA, t.bind = g, t.bounds = nA, t.canvas = GaA, t.circle = $OA, t.circleMarker = POA, t.control = Eh, t.divIcon = IjA, t.extend = n, t.featureGroup = Sg, t.geoJSON = maA, t.geoJson = tjA, t.gridLayer = ajA, t.icon = EI, t.imageOverlay = ijA, t.latLng = sA, t.latLngBounds = gA, t.layerGroup = Et, t.map = R1, t.marker = jOA, t.point = _, t.polygon = ejA, t.polyline = AjA, t.popup = gjA, t.rectangle = BjA, t.setOptions = E, t.stamp = I, t.svg = kaA, t.svgOverlay = ojA, t.tileLayer = waA, t.tooltip = sjA, t.transformation = EA, t.version = i, t.videoOverlay = njA;
    var cjA = window.L;
    t.noConflict = function() {
      return window.L = cjA, this;
    }, window.L = t;
  });
})(BO, BO.exports);
var hC = BO.exports;
function i0(A, e, t) {
  return Object.freeze({
    instance: A,
    context: e,
    container: t
  });
}
function iF(A, e) {
  return e == null ? function(t, i) {
    const n = u.useRef();
    return n.current || (n.current = A(t, i)), n;
  } : function(t, i) {
    const n = u.useRef();
    n.current || (n.current = A(t, i));
    const o = u.useRef(t), { instance: g } = n.current;
    return u.useEffect(function() {
      o.current !== t && (e(g, t, o.current), o.current = t);
    }, [
      g,
      t,
      i
    ]), n;
  };
}
function y1A(A, e) {
  u.useEffect(function() {
    return (e.layerContainer ?? e.map).addLayer(A.instance), function() {
      var t;
      (t = e.layerContainer) == null || t.removeLayer(A.instance), e.map.removeLayer(A.instance);
    };
  }, [
    e,
    A
  ]);
}
function b1A(A) {
  return function(e) {
    const t = tF(), i = A(W3(e, t), t);
    return u1A(t.map, e.attribution), UAA(i.current, e.eventHandlers), y1A(i.current, t), i;
  };
}
function GDe(A, e) {
  const t = u.useRef();
  u.useEffect(function() {
    if (e.pathOptions !== t.current) {
      const i = e.pathOptions ?? {};
      A.instance.setStyle(i), t.current = i;
    }
  }, [
    A,
    e
  ]);
}
function kDe(A) {
  return function(e) {
    const t = tF(), i = A(W3(e, t), t);
    return UAA(i.current, e.eventHandlers), y1A(i.current, t), GDe(i.current, e), i;
  };
}
function JDe(A) {
  function e(n, o) {
    return i0(A(n), o);
  }
  const t = iF(e), i = fDe(t);
  return p1A(i);
}
function NDe(A, e) {
  const t = iF(A, e), i = b1A(t);
  return m1A(i);
}
function YDe(A, e) {
  const t = iF(A), i = DDe(t, e);
  return wDe(i);
}
function VAA(A, e) {
  const t = iF(A, e), i = kDe(t);
  return m1A(i);
}
function RDe(A, e) {
  const t = iF(A, e), i = b1A(t);
  return p1A(i);
}
function FDe(A, e, t) {
  const { opacity: i, zIndex: n } = e;
  i != null && i !== t.opacity && A.setOpacity(i), n != null && n !== t.zIndex && A.setZIndex(n);
}
function MDe() {
  return tF().map;
}
const XAA = JDe(function(A) {
  return new hC.Control.Attribution(A);
}), lO = VAA(function({ center: A, children: e, ...t }, i) {
  const n = new hC.CircleMarker(A, t);
  return i0(n, Z3(i, {
    overlayContainer: n
  }));
}, pDe), xDe = VAA(function({ data: A, ...e }, t) {
  const i = new hC.GeoJSON(A, e);
  return i0(i, Z3(t, {
    overlayContainer: i
  }));
}, function(A, e, t) {
  e.style !== t.style && (e.style == null ? A.resetStyle() : A.setStyle(e.style));
});
function cO() {
  return cO = Object.assign || function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, cO.apply(this, arguments);
}
function LDe({ bounds: A, boundsOptions: e, center: t, children: i, className: n, id: o, placeholder: g, style: s, whenReady: I, zoom: r, ...a }, C) {
  const [B] = u.useState({
    className: n,
    id: o,
    style: s
  }), [l, Q] = u.useState(null);
  u.useImperativeHandle(C, () => (l == null ? void 0 : l.map) ?? null, [
    l
  ]);
  const E = u.useCallback((m) => {
    if (m !== null && l === null) {
      const y = new hC.Map(m, a);
      t != null && r != null ? y.setView(t, r) : A != null && y.fitBounds(A, e), I != null && y.whenReady(I), Q(bDe(y));
    }
  }, []);
  u.useEffect(() => () => {
    l == null || l.map.remove();
  }, [
    l
  ]);
  const d = l ? /* @__PURE__ */ b.createElement(h1A, {
    value: l
  }, i) : g ?? null;
  return /* @__PURE__ */ b.createElement("div", cO({}, B, {
    ref: E
  }), d);
}
const zAA = /* @__PURE__ */ u.forwardRef(LDe), CQA = NDe(function({ position: A, ...e }, t) {
  const i = new hC.Marker(A, e);
  return i0(i, Z3(t, {
    overlayContainer: i
  }));
}, function(A, e, t) {
  e.position !== t.position && A.setLatLng(e.position), e.icon != null && e.icon !== t.icon && A.setIcon(e.icon), e.zIndexOffset != null && e.zIndexOffset !== t.zIndexOffset && A.setZIndexOffset(e.zIndexOffset), e.opacity != null && e.opacity !== t.opacity && A.setOpacity(e.opacity), A.dragging != null && e.draggable !== t.draggable && (e.draggable === !0 ? A.dragging.enable() : A.dragging.disable());
}), BQA = VAA(function({ positions: A, ...e }, t) {
  const i = new hC.Polygon(A, e);
  return i0(i, Z3(t, {
    overlayContainer: i
  }));
}, function(A, e, t) {
  e.positions !== t.positions && A.setLatLngs(e.positions);
}), KY = RDe(function({ url: A, ...e }, t) {
  const i = new hC.TileLayer(A, W3(e, t));
  return i0(i, t);
}, function(A, e, t) {
  FDe(A, e, t);
  const { url: i } = e;
  i != null && i !== t.url && A.setUrl(i);
}), EJ = YDe(function(A, e) {
  const t = new hC.Tooltip(A, e.overlayContainer);
  return i0(t, e);
}, function(A, e, { position: t }, i) {
  u.useEffect(function() {
    const n = e.overlayContainer;
    if (n == null)
      return;
    const { instance: o } = A, g = (I) => {
      I.tooltip === o && (t != null && o.setLatLng(t), o.update(), i(!0));
    }, s = (I) => {
      I.tooltip === o && i(!1);
    };
    return n.on({
      tooltipopen: g,
      tooltipclose: s
    }), n.bindTooltip(o), function() {
      n.off({
        tooltipopen: g,
        tooltipclose: s
      }), n._map != null && n.unbindTooltip();
    };
  }, [
    A,
    e,
    i,
    t
  ]);
});
function _c(A, e) {
  return A == null || e == null ? NaN : A < e ? -1 : A > e ? 1 : A >= e ? 0 : NaN;
}
function vDe(A, e) {
  return A == null || e == null ? NaN : e < A ? -1 : e > A ? 1 : e >= A ? 0 : NaN;
}
function ZD(A) {
  let e, t, i;
  A.length !== 2 ? (e = _c, t = (s, I) => _c(A(s), I), i = (s, I) => A(s) - I) : (e = A === _c || A === vDe ? A : HDe, t = A, i = A);
  function n(s, I, r = 0, a = s.length) {
    if (r < a) {
      if (e(I, I) !== 0)
        return a;
      do {
        const C = r + a >>> 1;
        t(s[C], I) < 0 ? r = C + 1 : a = C;
      } while (r < a);
    }
    return r;
  }
  function o(s, I, r = 0, a = s.length) {
    if (r < a) {
      if (e(I, I) !== 0)
        return a;
      do {
        const C = r + a >>> 1;
        t(s[C], I) <= 0 ? r = C + 1 : a = C;
      } while (r < a);
    }
    return r;
  }
  function g(s, I, r = 0, a = s.length) {
    const C = n(s, I, r, a - 1);
    return C > r && i(s[C - 1], I) > -i(s[C], I) ? C - 1 : C;
  }
  return { left: n, center: g, right: o };
}
function HDe() {
  return 0;
}
function w1A(A) {
  return A === null ? NaN : +A;
}
function* SDe(A, e) {
  if (e === void 0)
    for (let t of A)
      t != null && (t = +t) >= t && (yield t);
  else {
    let t = -1;
    for (let i of A)
      (i = e(i, ++t, A)) != null && (i = +i) >= i && (yield i);
  }
}
const f1A = ZD(_c), iS = f1A.right, ZDe = f1A.left;
ZD(w1A).center;
const nF = iS;
function WDe(A, e) {
  let t = 0, i, n = 0, o = 0;
  if (e === void 0)
    for (let g of A)
      g != null && (g = +g) >= g && (i = g - n, n += i / ++t, o += i * (g - n));
  else {
    let g = -1;
    for (let s of A)
      (s = e(s, ++g, A)) != null && (s = +s) >= s && (i = s - n, n += i / ++t, o += i * (s - n));
  }
  if (t > 1)
    return o / (t - 1);
}
function KDe(A, e) {
  const t = WDe(A, e);
  return t && Math.sqrt(t);
}
class gs {
  constructor() {
    this._partials = new Float64Array(32), this._n = 0;
  }
  add(e) {
    const t = this._partials;
    let i = 0;
    for (let n = 0; n < this._n && n < 32; n++) {
      const o = t[n], g = e + o, s = Math.abs(e) < Math.abs(o) ? e - (g - o) : o - (g - e);
      s && (t[i++] = s), e = g;
    }
    return t[i] = e, this._n = i + 1, this;
  }
  valueOf() {
    const e = this._partials;
    let t = this._n, i, n, o, g = 0;
    if (t > 0) {
      for (g = e[--t]; t > 0 && (i = g, n = e[--t], g = i + n, o = n - (g - i), !o); )
        ;
      t > 0 && (o < 0 && e[t - 1] < 0 || o > 0 && e[t - 1] > 0) && (n = o * 2, i = g + n, n == i - g && (g = i));
    }
    return g;
  }
}
class lQA extends Map {
  constructor(e, t = k1A) {
    if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), e != null)
      for (const [i, n] of e)
        this.set(i, n);
  }
  get(e) {
    return super.get(QO(this, e));
  }
  has(e) {
    return super.has(QO(this, e));
  }
  set(e, t) {
    return super.set(D1A(this, e), t);
  }
  delete(e) {
    return super.delete(G1A(this, e));
  }
}
class nS extends Set {
  constructor(e, t = k1A) {
    if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), e != null)
      for (const i of e)
        this.add(i);
  }
  has(e) {
    return super.has(QO(this, e));
  }
  add(e) {
    return super.add(D1A(this, e));
  }
  delete(e) {
    return super.delete(G1A(this, e));
  }
}
function QO({ _intern: A, _key: e }, t) {
  const i = e(t);
  return A.has(i) ? A.get(i) : t;
}
function D1A({ _intern: A, _key: e }, t) {
  const i = e(t);
  return A.has(i) ? A.get(i) : (A.set(i, t), t);
}
function G1A({ _intern: A, _key: e }, t) {
  const i = e(t);
  return A.has(i) && (t = A.get(i), A.delete(i)), t;
}
function k1A(A) {
  return A !== null && typeof A == "object" ? A.valueOf() : A;
}
function UDe(A, e) {
  return Array.from(e, (t) => A[t]);
}
function VDe(A = _c) {
  if (A === _c)
    return J1A;
  if (typeof A != "function")
    throw new TypeError("compare is not a function");
  return (e, t) => {
    const i = A(e, t);
    return i || i === 0 ? i : (A(t, t) === 0) - (A(e, e) === 0);
  };
}
function J1A(A, e) {
  return (A == null || !(A >= A)) - (e == null || !(e >= e)) || (A < e ? -1 : A > e ? 1 : 0);
}
const XDe = Math.sqrt(50), zDe = Math.sqrt(10), TDe = Math.sqrt(2);
function oS(A, e, t) {
  const i = (e - A) / Math.max(0, t), n = Math.floor(Math.log10(i)), o = i / Math.pow(10, n), g = o >= XDe ? 10 : o >= zDe ? 5 : o >= TDe ? 2 : 1;
  let s, I, r;
  return n < 0 ? (r = Math.pow(10, -n) / g, s = Math.round(A * r), I = Math.round(e * r), s / r < A && ++s, I / r > e && --I, r = -r) : (r = Math.pow(10, n) * g, s = Math.round(A / r), I = Math.round(e / r), s * r < A && ++s, I * r > e && --I), I < s && 0.5 <= t && t < 2 ? oS(A, e, t * 2) : [s, I, r];
}
function EO(A, e, t) {
  if (e = +e, A = +A, t = +t, !(t > 0))
    return [];
  if (A === e)
    return [A];
  const i = e < A, [n, o, g] = i ? oS(e, A, t) : oS(A, e, t);
  if (!(o >= n))
    return [];
  const s = o - n + 1, I = new Array(s);
  if (i)
    if (g < 0)
      for (let r = 0; r < s; ++r)
        I[r] = (o - r) / -g;
    else
      for (let r = 0; r < s; ++r)
        I[r] = (o - r) * g;
  else if (g < 0)
    for (let r = 0; r < s; ++r)
      I[r] = (n + r) / -g;
  else
    for (let r = 0; r < s; ++r)
      I[r] = (n + r) * g;
  return I;
}
function uO(A, e, t) {
  return e = +e, A = +A, t = +t, oS(A, e, t)[2];
}
function _u(A, e, t) {
  e = +e, A = +A, t = +t;
  const i = e < A, n = i ? uO(e, A, t) : uO(A, e, t);
  return (i ? -1 : 1) * (n < 0 ? 1 / -n : n);
}
function Rm(A, e) {
  let t;
  if (e === void 0)
    for (const i of A)
      i != null && (t < i || t === void 0 && i >= i) && (t = i);
  else {
    let i = -1;
    for (let n of A)
      (n = e(n, ++i, A)) != null && (t < n || t === void 0 && n >= n) && (t = n);
  }
  return t;
}
function dO(A, e) {
  let t;
  if (e === void 0)
    for (const i of A)
      i != null && (t > i || t === void 0 && i >= i) && (t = i);
  else {
    let i = -1;
    for (let n of A)
      (n = e(n, ++i, A)) != null && (t > n || t === void 0 && n >= n) && (t = n);
  }
  return t;
}
function N1A(A, e, t = 0, i = 1 / 0, n) {
  if (e = Math.floor(e), t = Math.floor(Math.max(0, t)), i = Math.floor(Math.min(A.length - 1, i)), !(t <= e && e <= i))
    return A;
  for (n = n === void 0 ? J1A : VDe(n); i > t; ) {
    if (i - t > 600) {
      const I = i - t + 1, r = e - t + 1, a = Math.log(I), C = 0.5 * Math.exp(2 * a / 3), B = 0.5 * Math.sqrt(a * C * (I - C) / I) * (r - I / 2 < 0 ? -1 : 1), l = Math.max(t, Math.floor(e - r * C / I + B)), Q = Math.min(i, Math.floor(e + (I - r) * C / I + B));
      N1A(A, e, l, Q, n);
    }
    const o = A[e];
    let g = t, s = i;
    for (ck(A, t, e), n(A[i], o) > 0 && ck(A, t, i); g < s; ) {
      for (ck(A, g, s), ++g, --s; n(A[g], o) < 0; )
        ++g;
      for (; n(A[s], o) > 0; )
        --s;
    }
    n(A[t], o) === 0 ? ck(A, t, s) : (++s, ck(A, s, i)), s <= e && (t = s + 1), e <= s && (i = s - 1);
  }
  return A;
}
function ck(A, e, t) {
  const i = A[e];
  A[e] = A[t], A[t] = i;
}
function hO(A, e, t) {
  if (A = Float64Array.from(SDe(A, t)), !(!(i = A.length) || isNaN(e = +e))) {
    if (e <= 0 || i < 2)
      return dO(A);
    if (e >= 1)
      return Rm(A);
    var i, n = (i - 1) * e, o = Math.floor(n), g = Rm(N1A(A, o).subarray(0, o + 1)), s = dO(A.subarray(o + 1));
    return g + (s - g) * (n - o);
  }
}
function Y1A(A, e, t = w1A) {
  if (!(!(i = A.length) || isNaN(e = +e))) {
    if (e <= 0 || i < 2)
      return +t(A[0], 0, A);
    if (e >= 1)
      return +t(A[i - 1], i - 1, A);
    var i, n = (i - 1) * e, o = Math.floor(n), g = +t(A[o], o, A), s = +t(A[o + 1], o + 1, A);
    return g + (s - g) * (n - o);
  }
}
function _De(A, e) {
  let t = 0, i = 0;
  if (e === void 0)
    for (let n of A)
      n != null && (n = +n) >= n && (++t, i += n);
  else {
    let n = -1;
    for (let o of A)
      (o = e(o, ++n, A)) != null && (o = +o) >= o && (++t, i += o);
  }
  if (t)
    return i / t;
}
function R1A(A, e) {
  return hO(A, 0.5, e);
}
function* qDe(A) {
  for (const e of A)
    yield* e;
}
function F1A(A) {
  return Array.from(qDe(A));
}
function HI(A, e, t) {
  A = +A, e = +e, t = (n = arguments.length) < 2 ? (e = A, A = 0, 1) : n < 3 ? 1 : +t;
  for (var i = -1, n = Math.max(0, Math.ceil((e - A) / t)) | 0, o = new Array(n); ++i < n; )
    o[i] = A + i * t;
  return o;
}
function M1A(A, e) {
  let t = 0;
  if (e === void 0)
    for (let i of A)
      (i = +i) && (t += i);
  else {
    let i = -1;
    for (let n of A)
      (n = +e(n, ++i, A)) && (t += n);
  }
  return t;
}
function ODe(A, ...e) {
  A = new nS(A), e = e.map(jDe);
  A:
    for (const t of A)
      for (const i of e)
        if (!i.has(t)) {
          A.delete(t);
          continue A;
        }
  return A;
}
function jDe(A) {
  return A instanceof nS ? A : new nS(A);
}
function PDe(...A) {
  const e = new nS();
  for (const t of A)
    for (const i of t)
      e.add(i);
  return e;
}
function wl(A, e) {
  switch (arguments.length) {
    case 0:
      break;
    case 1:
      this.range(A);
      break;
    default:
      this.range(e).domain(A);
      break;
  }
  return this;
}
function vd(A, e) {
  switch (arguments.length) {
    case 0:
      break;
    case 1: {
      typeof A == "function" ? this.interpolator(A) : this.range(A);
      break;
    }
    default: {
      this.domain(A), typeof e == "function" ? this.interpolator(e) : this.range(e);
      break;
    }
  }
  return this;
}
const mO = Symbol("implicit");
function K3() {
  var A = new lQA(), e = [], t = [], i = mO;
  function n(o) {
    let g = A.get(o);
    if (g === void 0) {
      if (i !== mO)
        return i;
      A.set(o, g = e.push(o) - 1);
    }
    return t[g % t.length];
  }
  return n.domain = function(o) {
    if (!arguments.length)
      return e.slice();
    e = [], A = new lQA();
    for (const g of o)
      A.has(g) || A.set(g, e.push(g) - 1);
    return n;
  }, n.range = function(o) {
    return arguments.length ? (t = Array.from(o), n) : t.slice();
  }, n.unknown = function(o) {
    return arguments.length ? (i = o, n) : i;
  }, n.copy = function() {
    return K3(e, t).unknown(i);
  }, wl.apply(n, arguments), n;
}
function WD(A, e, t) {
  A.prototype = e.prototype = t, t.constructor = A;
}
function oF(A, e) {
  var t = Object.create(A.prototype);
  for (var i in e)
    t[i] = e[i];
  return t;
}
function Hd() {
}
var rp = 0.7, cf = 1 / rp, Iw = "\\s*([+-]?\\d+)\\s*", UY = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", TB = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", $De = /^#([0-9a-f]{3,8})$/, AGe = new RegExp(`^rgb\\(${Iw},${Iw},${Iw}\\)$`), eGe = new RegExp(`^rgb\\(${TB},${TB},${TB}\\)$`), tGe = new RegExp(`^rgba\\(${Iw},${Iw},${Iw},${UY}\\)$`), iGe = new RegExp(`^rgba\\(${TB},${TB},${TB},${UY}\\)$`), nGe = new RegExp(`^hsl\\(${UY},${TB},${TB}\\)$`), oGe = new RegExp(`^hsla\\(${UY},${TB},${TB},${UY}\\)$`), cQA = {
  aliceblue: 15792383,
  antiquewhite: 16444375,
  aqua: 65535,
  aquamarine: 8388564,
  azure: 15794175,
  beige: 16119260,
  bisque: 16770244,
  black: 0,
  blanchedalmond: 16772045,
  blue: 255,
  blueviolet: 9055202,
  brown: 10824234,
  burlywood: 14596231,
  cadetblue: 6266528,
  chartreuse: 8388352,
  chocolate: 13789470,
  coral: 16744272,
  cornflowerblue: 6591981,
  cornsilk: 16775388,
  crimson: 14423100,
  cyan: 65535,
  darkblue: 139,
  darkcyan: 35723,
  darkgoldenrod: 12092939,
  darkgray: 11119017,
  darkgreen: 25600,
  darkgrey: 11119017,
  darkkhaki: 12433259,
  darkmagenta: 9109643,
  darkolivegreen: 5597999,
  darkorange: 16747520,
  darkorchid: 10040012,
  darkred: 9109504,
  darksalmon: 15308410,
  darkseagreen: 9419919,
  darkslateblue: 4734347,
  darkslategray: 3100495,
  darkslategrey: 3100495,
  darkturquoise: 52945,
  darkviolet: 9699539,
  deeppink: 16716947,
  deepskyblue: 49151,
  dimgray: 6908265,
  dimgrey: 6908265,
  dodgerblue: 2003199,
  firebrick: 11674146,
  floralwhite: 16775920,
  forestgreen: 2263842,
  fuchsia: 16711935,
  gainsboro: 14474460,
  ghostwhite: 16316671,
  gold: 16766720,
  goldenrod: 14329120,
  gray: 8421504,
  green: 32768,
  greenyellow: 11403055,
  grey: 8421504,
  honeydew: 15794160,
  hotpink: 16738740,
  indianred: 13458524,
  indigo: 4915330,
  ivory: 16777200,
  khaki: 15787660,
  lavender: 15132410,
  lavenderblush: 16773365,
  lawngreen: 8190976,
  lemonchiffon: 16775885,
  lightblue: 11393254,
  lightcoral: 15761536,
  lightcyan: 14745599,
  lightgoldenrodyellow: 16448210,
  lightgray: 13882323,
  lightgreen: 9498256,
  lightgrey: 13882323,
  lightpink: 16758465,
  lightsalmon: 16752762,
  lightseagreen: 2142890,
  lightskyblue: 8900346,
  lightslategray: 7833753,
  lightslategrey: 7833753,
  lightsteelblue: 11584734,
  lightyellow: 16777184,
  lime: 65280,
  limegreen: 3329330,
  linen: 16445670,
  magenta: 16711935,
  maroon: 8388608,
  mediumaquamarine: 6737322,
  mediumblue: 205,
  mediumorchid: 12211667,
  mediumpurple: 9662683,
  mediumseagreen: 3978097,
  mediumslateblue: 8087790,
  mediumspringgreen: 64154,
  mediumturquoise: 4772300,
  mediumvioletred: 13047173,
  midnightblue: 1644912,
  mintcream: 16121850,
  mistyrose: 16770273,
  moccasin: 16770229,
  navajowhite: 16768685,
  navy: 128,
  oldlace: 16643558,
  olive: 8421376,
  olivedrab: 7048739,
  orange: 16753920,
  orangered: 16729344,
  orchid: 14315734,
  palegoldenrod: 15657130,
  palegreen: 10025880,
  paleturquoise: 11529966,
  palevioletred: 14381203,
  papayawhip: 16773077,
  peachpuff: 16767673,
  peru: 13468991,
  pink: 16761035,
  plum: 14524637,
  powderblue: 11591910,
  purple: 8388736,
  rebeccapurple: 6697881,
  red: 16711680,
  rosybrown: 12357519,
  royalblue: 4286945,
  saddlebrown: 9127187,
  salmon: 16416882,
  sandybrown: 16032864,
  seagreen: 3050327,
  seashell: 16774638,
  sienna: 10506797,
  silver: 12632256,
  skyblue: 8900331,
  slateblue: 6970061,
  slategray: 7372944,
  slategrey: 7372944,
  snow: 16775930,
  springgreen: 65407,
  steelblue: 4620980,
  tan: 13808780,
  teal: 32896,
  thistle: 14204888,
  tomato: 16737095,
  turquoise: 4251856,
  violet: 15631086,
  wheat: 16113331,
  white: 16777215,
  whitesmoke: 16119285,
  yellow: 16776960,
  yellowgreen: 10145074
};
WD(Hd, VY, {
  copy(A) {
    return Object.assign(new this.constructor(), this, A);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: QQA,
  // Deprecated! Use color.formatHex.
  formatHex: QQA,
  formatHex8: gGe,
  formatHsl: sGe,
  formatRgb: EQA,
  toString: EQA
});
function QQA() {
  return this.rgb().formatHex();
}
function gGe() {
  return this.rgb().formatHex8();
}
function sGe() {
  return x1A(this).formatHsl();
}
function EQA() {
  return this.rgb().formatRgb();
}
function VY(A) {
  var e, t;
  return A = (A + "").trim().toLowerCase(), (e = $De.exec(A)) ? (t = e[1].length, e = parseInt(e[1], 16), t === 6 ? uQA(e) : t === 3 ? new No(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : t === 8 ? UM(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : t === 4 ? UM(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = AGe.exec(A)) ? new No(e[1], e[2], e[3], 1) : (e = eGe.exec(A)) ? new No(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = tGe.exec(A)) ? UM(e[1], e[2], e[3], e[4]) : (e = iGe.exec(A)) ? UM(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = nGe.exec(A)) ? mQA(e[1], e[2] / 100, e[3] / 100, 1) : (e = oGe.exec(A)) ? mQA(e[1], e[2] / 100, e[3] / 100, e[4]) : cQA.hasOwnProperty(A) ? uQA(cQA[A]) : A === "transparent" ? new No(NaN, NaN, NaN, 0) : null;
}
function uQA(A) {
  return new No(A >> 16 & 255, A >> 8 & 255, A & 255, 1);
}
function UM(A, e, t, i) {
  return i <= 0 && (A = e = t = NaN), new No(A, e, t, i);
}
function TAA(A) {
  return A instanceof Hd || (A = VY(A)), A ? (A = A.rgb(), new No(A.r, A.g, A.b, A.opacity)) : new No();
}
function qu(A, e, t, i) {
  return arguments.length === 1 ? TAA(A) : new No(A, e, t, i ?? 1);
}
function No(A, e, t, i) {
  this.r = +A, this.g = +e, this.b = +t, this.opacity = +i;
}
WD(No, qu, oF(Hd, {
  brighter(A) {
    return A = A == null ? cf : Math.pow(cf, A), new No(this.r * A, this.g * A, this.b * A, this.opacity);
  },
  darker(A) {
    return A = A == null ? rp : Math.pow(rp, A), new No(this.r * A, this.g * A, this.b * A, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new No(Fm(this.r), Fm(this.g), Fm(this.b), gS(this.opacity));
  },
  displayable() {
    return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
  },
  hex: dQA,
  // Deprecated! Use color.formatHex.
  formatHex: dQA,
  formatHex8: IGe,
  formatRgb: hQA,
  toString: hQA
}));
function dQA() {
  return `#${Bm(this.r)}${Bm(this.g)}${Bm(this.b)}`;
}
function IGe() {
  return `#${Bm(this.r)}${Bm(this.g)}${Bm(this.b)}${Bm((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function hQA() {
  const A = gS(this.opacity);
  return `${A === 1 ? "rgb(" : "rgba("}${Fm(this.r)}, ${Fm(this.g)}, ${Fm(this.b)}${A === 1 ? ")" : `, ${A})`}`;
}
function gS(A) {
  return isNaN(A) ? 1 : Math.max(0, Math.min(1, A));
}
function Fm(A) {
  return Math.max(0, Math.min(255, Math.round(A) || 0));
}
function Bm(A) {
  return A = Fm(A), (A < 16 ? "0" : "") + A.toString(16);
}
function mQA(A, e, t, i) {
  return i <= 0 ? A = e = t = NaN : t <= 0 || t >= 1 ? A = e = NaN : e <= 0 && (A = NaN), new Ur(A, e, t, i);
}
function x1A(A) {
  if (A instanceof Ur)
    return new Ur(A.h, A.s, A.l, A.opacity);
  if (A instanceof Hd || (A = VY(A)), !A)
    return new Ur();
  if (A instanceof Ur)
    return A;
  A = A.rgb();
  var e = A.r / 255, t = A.g / 255, i = A.b / 255, n = Math.min(e, t, i), o = Math.max(e, t, i), g = NaN, s = o - n, I = (o + n) / 2;
  return s ? (e === o ? g = (t - i) / s + (t < i) * 6 : t === o ? g = (i - e) / s + 2 : g = (e - t) / s + 4, s /= I < 0.5 ? o + n : 2 - o - n, g *= 60) : s = I > 0 && I < 1 ? 0 : g, new Ur(g, s, I, A.opacity);
}
function sS(A, e, t, i) {
  return arguments.length === 1 ? x1A(A) : new Ur(A, e, t, i ?? 1);
}
function Ur(A, e, t, i) {
  this.h = +A, this.s = +e, this.l = +t, this.opacity = +i;
}
WD(Ur, sS, oF(Hd, {
  brighter(A) {
    return A = A == null ? cf : Math.pow(cf, A), new Ur(this.h, this.s, this.l * A, this.opacity);
  },
  darker(A) {
    return A = A == null ? rp : Math.pow(rp, A), new Ur(this.h, this.s, this.l * A, this.opacity);
  },
  rgb() {
    var A = this.h % 360 + (this.h < 0) * 360, e = isNaN(A) || isNaN(this.s) ? 0 : this.s, t = this.l, i = t + (t < 0.5 ? t : 1 - t) * e, n = 2 * t - i;
    return new No(
      _5(A >= 240 ? A - 240 : A + 120, n, i),
      _5(A, n, i),
      _5(A < 120 ? A + 240 : A - 120, n, i),
      this.opacity
    );
  },
  clamp() {
    return new Ur(pQA(this.h), VM(this.s), VM(this.l), gS(this.opacity));
  },
  displayable() {
    return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
  },
  formatHsl() {
    const A = gS(this.opacity);
    return `${A === 1 ? "hsl(" : "hsla("}${pQA(this.h)}, ${VM(this.s) * 100}%, ${VM(this.l) * 100}%${A === 1 ? ")" : `, ${A})`}`;
  }
}));
function pQA(A) {
  return A = (A || 0) % 360, A < 0 ? A + 360 : A;
}
function VM(A) {
  return Math.max(0, Math.min(1, A || 0));
}
function _5(A, e, t) {
  return (A < 60 ? e + (t - e) * A / 60 : A < 180 ? t : A < 240 ? e + (t - e) * (240 - A) / 60 : e) * 255;
}
const L1A = Math.PI / 180, v1A = 180 / Math.PI, IS = 18, H1A = 0.96422, S1A = 1, Z1A = 0.82521, W1A = 4 / 29, aw = 6 / 29, K1A = 3 * aw * aw, aGe = aw * aw * aw;
function U1A(A) {
  if (A instanceof _B)
    return new _B(A.l, A.a, A.b, A.opacity);
  if (A instanceof xc)
    return V1A(A);
  A instanceof No || (A = TAA(A));
  var e = P5(A.r), t = P5(A.g), i = P5(A.b), n = q5((0.2225045 * e + 0.7168786 * t + 0.0606169 * i) / S1A), o, g;
  return e === t && t === i ? o = g = n : (o = q5((0.4360747 * e + 0.3850649 * t + 0.1430804 * i) / H1A), g = q5((0.0139322 * e + 0.0971045 * t + 0.7141733 * i) / Z1A)), new _B(116 * n - 16, 500 * (o - n), 200 * (n - g), A.opacity);
}
function aS(A, e, t, i) {
  return arguments.length === 1 ? U1A(A) : new _B(A, e, t, i ?? 1);
}
function _B(A, e, t, i) {
  this.l = +A, this.a = +e, this.b = +t, this.opacity = +i;
}
WD(_B, aS, oF(Hd, {
  brighter(A) {
    return new _B(this.l + IS * (A ?? 1), this.a, this.b, this.opacity);
  },
  darker(A) {
    return new _B(this.l - IS * (A ?? 1), this.a, this.b, this.opacity);
  },
  rgb() {
    var A = (this.l + 16) / 116, e = isNaN(this.a) ? A : A + this.a / 500, t = isNaN(this.b) ? A : A - this.b / 200;
    return e = H1A * O5(e), A = S1A * O5(A), t = Z1A * O5(t), new No(
      j5(3.1338561 * e - 1.6168667 * A - 0.4906146 * t),
      j5(-0.9787684 * e + 1.9161415 * A + 0.033454 * t),
      j5(0.0719453 * e - 0.2289914 * A + 1.4052427 * t),
      this.opacity
    );
  }
}));
function q5(A) {
  return A > aGe ? Math.pow(A, 1 / 3) : A / K1A + W1A;
}
function O5(A) {
  return A > aw ? A * A * A : K1A * (A - W1A);
}
function j5(A) {
  return 255 * (A <= 31308e-7 ? 12.92 * A : 1.055 * Math.pow(A, 1 / 2.4) - 0.055);
}
function P5(A) {
  return (A /= 255) <= 0.04045 ? A / 12.92 : Math.pow((A + 0.055) / 1.055, 2.4);
}
function rGe(A) {
  if (A instanceof xc)
    return new xc(A.h, A.c, A.l, A.opacity);
  if (A instanceof _B || (A = U1A(A)), A.a === 0 && A.b === 0)
    return new xc(NaN, 0 < A.l && A.l < 100 ? 0 : NaN, A.l, A.opacity);
  var e = Math.atan2(A.b, A.a) * v1A;
  return new xc(e < 0 ? e + 360 : e, Math.sqrt(A.a * A.a + A.b * A.b), A.l, A.opacity);
}
function rS(A, e, t, i) {
  return arguments.length === 1 ? rGe(A) : new xc(A, e, t, i ?? 1);
}
function xc(A, e, t, i) {
  this.h = +A, this.c = +e, this.l = +t, this.opacity = +i;
}
function V1A(A) {
  if (isNaN(A.h))
    return new _B(A.l, 0, 0, A.opacity);
  var e = A.h * L1A;
  return new _B(A.l, Math.cos(e) * A.c, Math.sin(e) * A.c, A.opacity);
}
WD(xc, rS, oF(Hd, {
  brighter(A) {
    return new xc(this.h, this.c, this.l + IS * (A ?? 1), this.opacity);
  },
  darker(A) {
    return new xc(this.h, this.c, this.l - IS * (A ?? 1), this.opacity);
  },
  rgb() {
    return V1A(this).rgb();
  }
}));
var X1A = -0.14861, _AA = 1.78277, qAA = -0.29227, U3 = -0.90649, XY = 1.97294, yQA = XY * U3, bQA = XY * _AA, wQA = _AA * qAA - U3 * X1A;
function CGe(A) {
  if (A instanceof Mm)
    return new Mm(A.h, A.s, A.l, A.opacity);
  A instanceof No || (A = TAA(A));
  var e = A.r / 255, t = A.g / 255, i = A.b / 255, n = (wQA * i + yQA * e - bQA * t) / (wQA + yQA - bQA), o = i - n, g = (XY * (t - n) - qAA * o) / U3, s = Math.sqrt(g * g + o * o) / (XY * n * (1 - n)), I = s ? Math.atan2(g, o) * v1A - 120 : NaN;
  return new Mm(I < 0 ? I + 360 : I, s, n, A.opacity);
}
function pO(A, e, t, i) {
  return arguments.length === 1 ? CGe(A) : new Mm(A, e, t, i ?? 1);
}
function Mm(A, e, t, i) {
  this.h = +A, this.s = +e, this.l = +t, this.opacity = +i;
}
WD(Mm, pO, oF(Hd, {
  brighter(A) {
    return A = A == null ? cf : Math.pow(cf, A), new Mm(this.h, this.s, this.l * A, this.opacity);
  },
  darker(A) {
    return A = A == null ? rp : Math.pow(rp, A), new Mm(this.h, this.s, this.l * A, this.opacity);
  },
  rgb() {
    var A = isNaN(this.h) ? 0 : (this.h + 120) * L1A, e = +this.l, t = isNaN(this.s) ? 0 : this.s * e * (1 - e), i = Math.cos(A), n = Math.sin(A);
    return new No(
      255 * (e + t * (X1A * i + _AA * n)),
      255 * (e + t * (qAA * i + U3 * n)),
      255 * (e + t * (XY * i)),
      this.opacity
    );
  }
}));
function z1A(A, e, t, i, n) {
  var o = A * A, g = o * A;
  return ((1 - 3 * A + 3 * o - g) * e + (4 - 6 * o + 3 * g) * t + (1 + 3 * A + 3 * o - 3 * g) * i + g * n) / 6;
}
function T1A(A) {
  var e = A.length - 1;
  return function(t) {
    var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, e - 1) : Math.floor(t * e), n = A[i], o = A[i + 1], g = i > 0 ? A[i - 1] : 2 * n - o, s = i < e - 1 ? A[i + 2] : 2 * o - n;
    return z1A((t - i / e) * e, g, n, o, s);
  };
}
function _1A(A) {
  var e = A.length;
  return function(t) {
    var i = Math.floor(((t %= 1) < 0 ? ++t : t) * e), n = A[(i + e - 1) % e], o = A[i % e], g = A[(i + 1) % e], s = A[(i + 2) % e];
    return z1A((t - i / e) * e, n, o, g, s);
  };
}
const V3 = (A) => () => A;
function q1A(A, e) {
  return function(t) {
    return A + t * e;
  };
}
function BGe(A, e, t) {
  return A = Math.pow(A, t), e = Math.pow(e, t) - A, t = 1 / t, function(i) {
    return Math.pow(A + i * e, t);
  };
}
function X3(A, e) {
  var t = e - A;
  return t ? q1A(A, t > 180 || t < -180 ? t - 360 * Math.round(t / 360) : t) : V3(isNaN(A) ? e : A);
}
function lGe(A) {
  return (A = +A) == 1 ? Yo : function(e, t) {
    return t - e ? BGe(e, t, A) : V3(isNaN(e) ? t : e);
  };
}
function Yo(A, e) {
  var t = e - A;
  return t ? q1A(A, t) : V3(isNaN(A) ? e : A);
}
const yO = function A(e) {
  var t = lGe(e);
  function i(n, o) {
    var g = t((n = qu(n)).r, (o = qu(o)).r), s = t(n.g, o.g), I = t(n.b, o.b), r = Yo(n.opacity, o.opacity);
    return function(a) {
      return n.r = g(a), n.g = s(a), n.b = I(a), n.opacity = r(a), n + "";
    };
  }
  return i.gamma = A, i;
}(1);
function O1A(A) {
  return function(e) {
    var t = e.length, i = new Array(t), n = new Array(t), o = new Array(t), g, s;
    for (g = 0; g < t; ++g)
      s = qu(e[g]), i[g] = s.r || 0, n[g] = s.g || 0, o[g] = s.b || 0;
    return i = A(i), n = A(n), o = A(o), s.opacity = 1, function(I) {
      return s.r = i(I), s.g = n(I), s.b = o(I), s + "";
    };
  };
}
var cGe = O1A(T1A), QGe = O1A(_1A);
function OAA(A, e) {
  e || (e = []);
  var t = A ? Math.min(e.length, A.length) : 0, i = e.slice(), n;
  return function(o) {
    for (n = 0; n < t; ++n)
      i[n] = A[n] * (1 - o) + e[n] * o;
    return i;
  };
}
function j1A(A) {
  return ArrayBuffer.isView(A) && !(A instanceof DataView);
}
function EGe(A, e) {
  return (j1A(e) ? OAA : P1A)(A, e);
}
function P1A(A, e) {
  var t = e ? e.length : 0, i = A ? Math.min(t, A.length) : 0, n = new Array(i), o = new Array(t), g;
  for (g = 0; g < i; ++g)
    n[g] = Sd(A[g], e[g]);
  for (; g < t; ++g)
    o[g] = e[g];
  return function(s) {
    for (g = 0; g < i; ++g)
      o[g] = n[g](s);
    return o;
  };
}
function $1A(A, e) {
  var t = /* @__PURE__ */ new Date();
  return A = +A, e = +e, function(i) {
    return t.setTime(A * (1 - i) + e * i), t;
  };
}
function Zr(A, e) {
  return A = +A, e = +e, function(t) {
    return A * (1 - t) + e * t;
  };
}
function AMA(A, e) {
  var t = {}, i = {}, n;
  (A === null || typeof A != "object") && (A = {}), (e === null || typeof e != "object") && (e = {});
  for (n in e)
    n in A ? t[n] = Sd(A[n], e[n]) : i[n] = e[n];
  return function(o) {
    for (n in t)
      i[n] = t[n](o);
    return i;
  };
}
var bO = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, $5 = new RegExp(bO.source, "g");
function uGe(A) {
  return function() {
    return A;
  };
}
function dGe(A) {
  return function(e) {
    return A(e) + "";
  };
}
function eMA(A, e) {
  var t = bO.lastIndex = $5.lastIndex = 0, i, n, o, g = -1, s = [], I = [];
  for (A = A + "", e = e + ""; (i = bO.exec(A)) && (n = $5.exec(e)); )
    (o = n.index) > t && (o = e.slice(t, o), s[g] ? s[g] += o : s[++g] = o), (i = i[0]) === (n = n[0]) ? s[g] ? s[g] += n : s[++g] = n : (s[++g] = null, I.push({ i: g, x: Zr(i, n) })), t = $5.lastIndex;
  return t < e.length && (o = e.slice(t), s[g] ? s[g] += o : s[++g] = o), s.length < 2 ? I[0] ? dGe(I[0].x) : uGe(e) : (e = I.length, function(r) {
    for (var a = 0, C; a < e; ++a)
      s[(C = I[a]).i] = C.x(r);
    return s.join("");
  });
}
function Sd(A, e) {
  var t = typeof e, i;
  return e == null || t === "boolean" ? V3(e) : (t === "number" ? Zr : t === "string" ? (i = VY(e)) ? (e = i, yO) : eMA : e instanceof VY ? yO : e instanceof Date ? $1A : j1A(e) ? OAA : Array.isArray(e) ? P1A : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? AMA : Zr)(A, e);
}
function hGe(A) {
  var e = A.length;
  return function(t) {
    return A[Math.max(0, Math.min(e - 1, Math.floor(t * e)))];
  };
}
function mGe(A, e) {
  var t = X3(+A, +e);
  return function(i) {
    var n = t(i);
    return n - 360 * Math.floor(n / 360);
  };
}
function gF(A, e) {
  return A = +A, e = +e, function(t) {
    return Math.round(A * (1 - t) + e * t);
  };
}
var fQA = 180 / Math.PI, tMA = {
  translateX: 0,
  translateY: 0,
  rotate: 0,
  skewX: 0,
  scaleX: 1,
  scaleY: 1
};
function iMA(A, e, t, i, n, o) {
  var g, s, I;
  return (g = Math.sqrt(A * A + e * e)) && (A /= g, e /= g), (I = A * t + e * i) && (t -= A * I, i -= e * I), (s = Math.sqrt(t * t + i * i)) && (t /= s, i /= s, I /= s), A * i < e * t && (A = -A, e = -e, I = -I, g = -g), {
    translateX: n,
    translateY: o,
    rotate: Math.atan2(e, A) * fQA,
    skewX: Math.atan(I) * fQA,
    scaleX: g,
    scaleY: s
  };
}
var XM;
function pGe(A) {
  const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(A + "");
  return e.isIdentity ? tMA : iMA(e.a, e.b, e.c, e.d, e.e, e.f);
}
function yGe(A) {
  return A == null || (XM || (XM = document.createElementNS("http://www.w3.org/2000/svg", "g")), XM.setAttribute("transform", A), !(A = XM.transform.baseVal.consolidate())) ? tMA : (A = A.matrix, iMA(A.a, A.b, A.c, A.d, A.e, A.f));
}
function nMA(A, e, t, i) {
  function n(r) {
    return r.length ? r.pop() + " " : "";
  }
  function o(r, a, C, B, l, Q) {
    if (r !== C || a !== B) {
      var E = l.push("translate(", null, e, null, t);
      Q.push({ i: E - 4, x: Zr(r, C) }, { i: E - 2, x: Zr(a, B) });
    } else
      (C || B) && l.push("translate(" + C + e + B + t);
  }
  function g(r, a, C, B) {
    r !== a ? (r - a > 180 ? a += 360 : a - r > 180 && (r += 360), B.push({ i: C.push(n(C) + "rotate(", null, i) - 2, x: Zr(r, a) })) : a && C.push(n(C) + "rotate(" + a + i);
  }
  function s(r, a, C, B) {
    r !== a ? B.push({ i: C.push(n(C) + "skewX(", null, i) - 2, x: Zr(r, a) }) : a && C.push(n(C) + "skewX(" + a + i);
  }
  function I(r, a, C, B, l, Q) {
    if (r !== C || a !== B) {
      var E = l.push(n(l) + "scale(", null, ",", null, ")");
      Q.push({ i: E - 4, x: Zr(r, C) }, { i: E - 2, x: Zr(a, B) });
    } else
      (C !== 1 || B !== 1) && l.push(n(l) + "scale(" + C + "," + B + ")");
  }
  return function(r, a) {
    var C = [], B = [];
    return r = A(r), a = A(a), o(r.translateX, r.translateY, a.translateX, a.translateY, C, B), g(r.rotate, a.rotate, C, B), s(r.skewX, a.skewX, C, B), I(r.scaleX, r.scaleY, a.scaleX, a.scaleY, C, B), r = a = null, function(l) {
      for (var Q = -1, E = B.length, d; ++Q < E; )
        C[(d = B[Q]).i] = d.x(l);
      return C.join("");
    };
  };
}
var bGe = nMA(pGe, "px, ", "px)", "deg)"), wGe = nMA(yGe, ", ", ")", ")"), fGe = 1e-12;
function DQA(A) {
  return ((A = Math.exp(A)) + 1 / A) / 2;
}
function DGe(A) {
  return ((A = Math.exp(A)) - 1 / A) / 2;
}
function GGe(A) {
  return ((A = Math.exp(2 * A)) - 1) / (A + 1);
}
const kGe = function A(e, t, i) {
  function n(o, g) {
    var s = o[0], I = o[1], r = o[2], a = g[0], C = g[1], B = g[2], l = a - s, Q = C - I, E = l * l + Q * Q, d, m;
    if (E < fGe)
      m = Math.log(B / r) / e, d = function(F) {
        return [
          s + F * l,
          I + F * Q,
          r * Math.exp(e * F * m)
        ];
      };
    else {
      var y = Math.sqrt(E), f = (B * B - r * r + i * E) / (2 * r * t * y), w = (B * B - r * r - i * E) / (2 * B * t * y), G = Math.log(Math.sqrt(f * f + 1) - f), R = Math.log(Math.sqrt(w * w + 1) - w);
      m = (R - G) / e, d = function(F) {
        var Z = F * m, c = DQA(G), J = r / (t * y) * (c * GGe(e * Z + G) - DGe(G));
        return [
          s + J * l,
          I + J * Q,
          r * c / DQA(e * Z + G)
        ];
      };
    }
    return d.duration = m * 1e3 * e / Math.SQRT2, d;
  }
  return n.rho = function(o) {
    var g = Math.max(1e-3, +o), s = g * g, I = s * s;
    return A(g, s, I);
  }, n;
}(Math.SQRT2, 2, 4);
function oMA(A) {
  return function(e, t) {
    var i = A((e = sS(e)).h, (t = sS(t)).h), n = Yo(e.s, t.s), o = Yo(e.l, t.l), g = Yo(e.opacity, t.opacity);
    return function(s) {
      return e.h = i(s), e.s = n(s), e.l = o(s), e.opacity = g(s), e + "";
    };
  };
}
const JGe = oMA(X3);
var NGe = oMA(Yo);
function YGe(A, e) {
  var t = Yo((A = aS(A)).l, (e = aS(e)).l), i = Yo(A.a, e.a), n = Yo(A.b, e.b), o = Yo(A.opacity, e.opacity);
  return function(g) {
    return A.l = t(g), A.a = i(g), A.b = n(g), A.opacity = o(g), A + "";
  };
}
function gMA(A) {
  return function(e, t) {
    var i = A((e = rS(e)).h, (t = rS(t)).h), n = Yo(e.c, t.c), o = Yo(e.l, t.l), g = Yo(e.opacity, t.opacity);
    return function(s) {
      return e.h = i(s), e.c = n(s), e.l = o(s), e.opacity = g(s), e + "";
    };
  };
}
const RGe = gMA(X3);
var FGe = gMA(Yo);
function sMA(A) {
  return function e(t) {
    t = +t;
    function i(n, o) {
      var g = A((n = pO(n)).h, (o = pO(o)).h), s = Yo(n.s, o.s), I = Yo(n.l, o.l), r = Yo(n.opacity, o.opacity);
      return function(a) {
        return n.h = g(a), n.s = s(a), n.l = I(Math.pow(a, t)), n.opacity = r(a), n + "";
      };
    }
    return i.gamma = e, i;
  }(1);
}
const MGe = sMA(X3);
var xGe = sMA(Yo);
function jAA(A, e) {
  e === void 0 && (e = A, A = Sd);
  for (var t = 0, i = e.length - 1, n = e[0], o = new Array(i < 0 ? 0 : i); t < i; )
    o[t] = A(n, n = e[++t]);
  return function(g) {
    var s = Math.max(0, Math.min(i - 1, Math.floor(g *= i)));
    return o[s](g - s);
  };
}
function LGe(A, e) {
  for (var t = new Array(e), i = 0; i < e; ++i)
    t[i] = A(i / (e - 1));
  return t;
}
const vGe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  interpolate: Sd,
  interpolateArray: EGe,
  interpolateBasis: T1A,
  interpolateBasisClosed: _1A,
  interpolateCubehelix: MGe,
  interpolateCubehelixLong: xGe,
  interpolateDate: $1A,
  interpolateDiscrete: hGe,
  interpolateHcl: RGe,
  interpolateHclLong: FGe,
  interpolateHsl: JGe,
  interpolateHslLong: NGe,
  interpolateHue: mGe,
  interpolateLab: YGe,
  interpolateNumber: Zr,
  interpolateNumberArray: OAA,
  interpolateObject: AMA,
  interpolateRgb: yO,
  interpolateRgbBasis: cGe,
  interpolateRgbBasisClosed: QGe,
  interpolateRound: gF,
  interpolateString: eMA,
  interpolateTransformCss: bGe,
  interpolateTransformSvg: wGe,
  interpolateZoom: kGe,
  piecewise: jAA,
  quantize: LGe
}, Symbol.toStringTag, { value: "Module" }));
function HGe(A) {
  return function() {
    return A;
  };
}
function wO(A) {
  return +A;
}
var GQA = [0, 1];
function vs(A) {
  return A;
}
function fO(A, e) {
  return (e -= A = +A) ? function(t) {
    return (t - A) / e;
  } : HGe(isNaN(e) ? NaN : 0.5);
}
function SGe(A, e) {
  var t;
  return A > e && (t = A, A = e, e = t), function(i) {
    return Math.max(A, Math.min(e, i));
  };
}
function ZGe(A, e, t) {
  var i = A[0], n = A[1], o = e[0], g = e[1];
  return n < i ? (i = fO(n, i), o = t(g, o)) : (i = fO(i, n), o = t(o, g)), function(s) {
    return o(i(s));
  };
}
function WGe(A, e, t) {
  var i = Math.min(A.length, e.length) - 1, n = new Array(i), o = new Array(i), g = -1;
  for (A[i] < A[0] && (A = A.slice().reverse(), e = e.slice().reverse()); ++g < i; )
    n[g] = fO(A[g], A[g + 1]), o[g] = t(e[g], e[g + 1]);
  return function(s) {
    var I = nF(A, s, 1, i) - 1;
    return o[I](n[I](s));
  };
}
function sF(A, e) {
  return e.domain(A.domain()).range(A.range()).interpolate(A.interpolate()).clamp(A.clamp()).unknown(A.unknown());
}
function z3() {
  var A = GQA, e = GQA, t = Sd, i, n, o, g = vs, s, I, r;
  function a() {
    var B = Math.min(A.length, e.length);
    return g !== vs && (g = SGe(A[0], A[B - 1])), s = B > 2 ? WGe : ZGe, I = r = null, C;
  }
  function C(B) {
    return B == null || isNaN(B = +B) ? o : (I || (I = s(A.map(i), e, t)))(i(g(B)));
  }
  return C.invert = function(B) {
    return g(n((r || (r = s(e, A.map(i), Zr)))(B)));
  }, C.domain = function(B) {
    return arguments.length ? (A = Array.from(B, wO), a()) : A.slice();
  }, C.range = function(B) {
    return arguments.length ? (e = Array.from(B), a()) : e.slice();
  }, C.rangeRound = function(B) {
    return e = Array.from(B), t = gF, a();
  }, C.clamp = function(B) {
    return arguments.length ? (g = B ? !0 : vs, a()) : g !== vs;
  }, C.interpolate = function(B) {
    return arguments.length ? (t = B, a()) : t;
  }, C.unknown = function(B) {
    return arguments.length ? (o = B, C) : o;
  }, function(B, l) {
    return i = B, n = l, a();
  };
}
function IMA() {
  return z3()(vs, vs);
}
function aMA(A, e, t, i) {
  var n = _u(A, e, t), o;
  switch (i = ap(i ?? ",f"), i.type) {
    case "s": {
      var g = Math.max(Math.abs(A), Math.abs(e));
      return i.precision == null && !isNaN(o = Q1A(n, g)) && (i.precision = o), WAA(i, g);
    }
    case "":
    case "e":
    case "g":
    case "p":
    case "r": {
      i.precision == null && !isNaN(o = E1A(n, Math.max(Math.abs(A), Math.abs(e)))) && (i.precision = o - (i.type === "e"));
      break;
    }
    case "f":
    case "%": {
      i.precision == null && !isNaN(o = c1A(n)) && (i.precision = o - (i.type === "%") * 2);
      break;
    }
  }
  return Ld(i);
}
function n0(A) {
  var e = A.domain;
  return A.ticks = function(t) {
    var i = e();
    return EO(i[0], i[i.length - 1], t ?? 10);
  }, A.tickFormat = function(t, i) {
    var n = e();
    return aMA(n[0], n[n.length - 1], t ?? 10, i);
  }, A.nice = function(t) {
    t == null && (t = 10);
    var i = e(), n = 0, o = i.length - 1, g = i[n], s = i[o], I, r, a = 10;
    for (s < g && (r = g, g = s, s = r, r = n, n = o, o = r); a-- > 0; ) {
      if (r = uO(g, s, t), r === I)
        return i[n] = g, i[o] = s, e(i);
      if (r > 0)
        g = Math.floor(g / r) * r, s = Math.ceil(s / r) * r;
      else if (r < 0)
        g = Math.ceil(g * r) / r, s = Math.floor(s * r) / r;
      else
        break;
      I = r;
    }
    return A;
  }, A;
}
function PAA() {
  var A = IMA();
  return A.copy = function() {
    return sF(A, PAA());
  }, wl.apply(A, arguments), n0(A);
}
function rMA(A) {
  var e;
  function t(i) {
    return i == null || isNaN(i = +i) ? e : i;
  }
  return t.invert = t, t.domain = t.range = function(i) {
    return arguments.length ? (A = Array.from(i, wO), t) : A.slice();
  }, t.unknown = function(i) {
    return arguments.length ? (e = i, t) : e;
  }, t.copy = function() {
    return rMA(A).unknown(e);
  }, A = arguments.length ? Array.from(A, wO) : [0, 1], n0(t);
}
function CMA(A, e) {
  A = A.slice();
  var t = 0, i = A.length - 1, n = A[t], o = A[i], g;
  return o < n && (g = t, t = i, i = g, g = n, n = o, o = g), A[t] = e.floor(n), A[i] = e.ceil(o), A;
}
function kQA(A) {
  return Math.log(A);
}
function JQA(A) {
  return Math.exp(A);
}
function KGe(A) {
  return -Math.log(-A);
}
function UGe(A) {
  return -Math.exp(-A);
}
function VGe(A) {
  return isFinite(A) ? +("1e" + A) : A < 0 ? 0 : A;
}
function XGe(A) {
  return A === 10 ? VGe : A === Math.E ? Math.exp : (e) => Math.pow(A, e);
}
function zGe(A) {
  return A === Math.E ? Math.log : A === 10 && Math.log10 || A === 2 && Math.log2 || (A = Math.log(A), (e) => Math.log(e) / A);
}
function NQA(A) {
  return (e, t) => -A(-e, t);
}
function $AA(A) {
  const e = A(kQA, JQA), t = e.domain;
  let i = 10, n, o;
  function g() {
    return n = zGe(i), o = XGe(i), t()[0] < 0 ? (n = NQA(n), o = NQA(o), A(KGe, UGe)) : A(kQA, JQA), e;
  }
  return e.base = function(s) {
    return arguments.length ? (i = +s, g()) : i;
  }, e.domain = function(s) {
    return arguments.length ? (t(s), g()) : t();
  }, e.ticks = (s) => {
    const I = t();
    let r = I[0], a = I[I.length - 1];
    const C = a < r;
    C && ([r, a] = [a, r]);
    let B = n(r), l = n(a), Q, E;
    const d = s == null ? 10 : +s;
    let m = [];
    if (!(i % 1) && l - B < d) {
      if (B = Math.floor(B), l = Math.ceil(l), r > 0) {
        for (; B <= l; ++B)
          for (Q = 1; Q < i; ++Q)
            if (E = B < 0 ? Q / o(-B) : Q * o(B), !(E < r)) {
              if (E > a)
                break;
              m.push(E);
            }
      } else
        for (; B <= l; ++B)
          for (Q = i - 1; Q >= 1; --Q)
            if (E = B > 0 ? Q / o(-B) : Q * o(B), !(E < r)) {
              if (E > a)
                break;
              m.push(E);
            }
      m.length * 2 < d && (m = EO(r, a, d));
    } else
      m = EO(B, l, Math.min(l - B, d)).map(o);
    return C ? m.reverse() : m;
  }, e.tickFormat = (s, I) => {
    if (s == null && (s = 10), I == null && (I = i === 10 ? "s" : ","), typeof I != "function" && (!(i % 1) && (I = ap(I)).precision == null && (I.trim = !0), I = Ld(I)), s === 1 / 0)
      return I;
    const r = Math.max(1, i * s / e.ticks().length);
    return (a) => {
      let C = a / o(Math.round(n(a)));
      return C * i < i - 0.5 && (C *= i), C <= r ? I(a) : "";
    };
  }, e.nice = () => t(CMA(t(), {
    floor: (s) => o(Math.floor(n(s))),
    ceil: (s) => o(Math.ceil(n(s)))
  })), e;
}
function BMA() {
  const A = $AA(z3()).domain([1, 10]);
  return A.copy = () => sF(A, BMA()).base(A.base()), wl.apply(A, arguments), A;
}
function YQA(A) {
  return function(e) {
    return Math.sign(e) * Math.log1p(Math.abs(e / A));
  };
}
function RQA(A) {
  return function(e) {
    return Math.sign(e) * Math.expm1(Math.abs(e)) * A;
  };
}
function AeA(A) {
  var e = 1, t = A(YQA(e), RQA(e));
  return t.constant = function(i) {
    return arguments.length ? A(YQA(e = +i), RQA(e)) : e;
  }, n0(t);
}
function lMA() {
  var A = AeA(z3());
  return A.copy = function() {
    return sF(A, lMA()).constant(A.constant());
  }, wl.apply(A, arguments);
}
function FQA(A) {
  return function(e) {
    return e < 0 ? -Math.pow(-e, A) : Math.pow(e, A);
  };
}
function TGe(A) {
  return A < 0 ? -Math.sqrt(-A) : Math.sqrt(A);
}
function _Ge(A) {
  return A < 0 ? -A * A : A * A;
}
function eeA(A) {
  var e = A(vs, vs), t = 1;
  function i() {
    return t === 1 ? A(vs, vs) : t === 0.5 ? A(TGe, _Ge) : A(FQA(t), FQA(1 / t));
  }
  return e.exponent = function(n) {
    return arguments.length ? (t = +n, i()) : t;
  }, n0(e);
}
function teA() {
  var A = eeA(z3());
  return A.copy = function() {
    return sF(A, teA()).exponent(A.exponent());
  }, wl.apply(A, arguments), A;
}
function qGe() {
  return teA.apply(null, arguments).exponent(0.5);
}
function cMA() {
  var A = [], e = [], t = [], i;
  function n() {
    var g = 0, s = Math.max(1, e.length);
    for (t = new Array(s - 1); ++g < s; )
      t[g - 1] = Y1A(A, g / s);
    return o;
  }
  function o(g) {
    return g == null || isNaN(g = +g) ? i : e[nF(t, g)];
  }
  return o.invertExtent = function(g) {
    var s = e.indexOf(g);
    return s < 0 ? [NaN, NaN] : [
      s > 0 ? t[s - 1] : A[0],
      s < t.length ? t[s] : A[A.length - 1]
    ];
  }, o.domain = function(g) {
    if (!arguments.length)
      return A.slice();
    A = [];
    for (let s of g)
      s != null && !isNaN(s = +s) && A.push(s);
    return A.sort(_c), n();
  }, o.range = function(g) {
    return arguments.length ? (e = Array.from(g), n()) : e.slice();
  }, o.unknown = function(g) {
    return arguments.length ? (i = g, o) : i;
  }, o.quantiles = function() {
    return t.slice();
  }, o.copy = function() {
    return cMA().domain(A).range(e).unknown(i);
  }, wl.apply(o, arguments);
}
function QMA() {
  var A = 0, e = 1, t = 1, i = [0.5], n = [0, 1], o;
  function g(I) {
    return I != null && I <= I ? n[nF(i, I, 0, t)] : o;
  }
  function s() {
    var I = -1;
    for (i = new Array(t); ++I < t; )
      i[I] = ((I + 1) * e - (I - t) * A) / (t + 1);
    return g;
  }
  return g.domain = function(I) {
    return arguments.length ? ([A, e] = I, A = +A, e = +e, s()) : [A, e];
  }, g.range = function(I) {
    return arguments.length ? (t = (n = Array.from(I)).length - 1, s()) : n.slice();
  }, g.invertExtent = function(I) {
    var r = n.indexOf(I);
    return r < 0 ? [NaN, NaN] : r < 1 ? [A, i[0]] : r >= t ? [i[t - 1], e] : [i[r - 1], i[r]];
  }, g.unknown = function(I) {
    return arguments.length && (o = I), g;
  }, g.thresholds = function() {
    return i.slice();
  }, g.copy = function() {
    return QMA().domain([A, e]).range(n).unknown(o);
  }, wl.apply(n0(g), arguments);
}
function EMA() {
  var A = [0.5], e = [0, 1], t, i = 1;
  function n(o) {
    return o != null && o <= o ? e[nF(A, o, 0, i)] : t;
  }
  return n.domain = function(o) {
    return arguments.length ? (A = Array.from(o), i = Math.min(A.length, e.length - 1), n) : A.slice();
  }, n.range = function(o) {
    return arguments.length ? (e = Array.from(o), i = Math.min(A.length, e.length - 1), n) : e.slice();
  }, n.invertExtent = function(o) {
    var g = e.indexOf(o);
    return [A[g - 1], A[g]];
  }, n.unknown = function(o) {
    return arguments.length ? (t = o, n) : t;
  }, n.copy = function() {
    return EMA().domain(A).range(e).unknown(t);
  }, wl.apply(n, arguments);
}
const Az = /* @__PURE__ */ new Date(), ez = /* @__PURE__ */ new Date();
function ho(A, e, t, i) {
  function n(o) {
    return A(o = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+o)), o;
  }
  return n.floor = (o) => (A(o = /* @__PURE__ */ new Date(+o)), o), n.ceil = (o) => (A(o = new Date(o - 1)), e(o, 1), A(o), o), n.round = (o) => {
    const g = n(o), s = n.ceil(o);
    return o - g < s - o ? g : s;
  }, n.offset = (o, g) => (e(o = /* @__PURE__ */ new Date(+o), g == null ? 1 : Math.floor(g)), o), n.range = (o, g, s) => {
    const I = [];
    if (o = n.ceil(o), s = s == null ? 1 : Math.floor(s), !(o < g) || !(s > 0))
      return I;
    let r;
    do
      I.push(r = new Date(+o)), e(o, s), A(o);
    while (r < o && o < g);
    return I;
  }, n.filter = (o) => ho((g) => {
    if (g >= g)
      for (; A(g), !o(g); )
        g.setTime(g - 1);
  }, (g, s) => {
    if (g >= g)
      if (s < 0)
        for (; ++s <= 0; )
          for (; e(g, -1), !o(g); )
            ;
      else
        for (; --s >= 0; )
          for (; e(g, 1), !o(g); )
            ;
  }), t && (n.count = (o, g) => (Az.setTime(+o), ez.setTime(+g), A(Az), A(ez), Math.floor(t(Az, ez))), n.every = (o) => (o = Math.floor(o), !isFinite(o) || !(o > 0) ? null : o > 1 ? n.filter(i ? (g) => i(g) % o === 0 : (g) => n.count(0, g) % o === 0) : n)), n;
}
const Qf = ho(() => {
}, (A, e) => {
  A.setTime(+A + e);
}, (A, e) => e - A);
Qf.every = (A) => (A = Math.floor(A), !isFinite(A) || !(A > 0) ? null : A > 1 ? ho((e) => {
  e.setTime(Math.floor(e / A) * A);
}, (e, t) => {
  e.setTime(+e + t * A);
}, (e, t) => (t - e) / A) : Qf);
Qf.range;
const Lc = 1e3, Za = Lc * 60, vc = Za * 60, EQ = vc * 24, ieA = EQ * 7, MQA = EQ * 30, tz = EQ * 365, Hc = ho((A) => {
  A.setTime(A - A.getMilliseconds());
}, (A, e) => {
  A.setTime(+A + e * Lc);
}, (A, e) => (e - A) / Lc, (A) => A.getUTCSeconds());
Hc.range;
const T3 = ho((A) => {
  A.setTime(A - A.getMilliseconds() - A.getSeconds() * Lc);
}, (A, e) => {
  A.setTime(+A + e * Za);
}, (A, e) => (e - A) / Za, (A) => A.getMinutes());
T3.range;
const _3 = ho((A) => {
  A.setUTCSeconds(0, 0);
}, (A, e) => {
  A.setTime(+A + e * Za);
}, (A, e) => (e - A) / Za, (A) => A.getUTCMinutes());
_3.range;
const q3 = ho((A) => {
  A.setTime(A - A.getMilliseconds() - A.getSeconds() * Lc - A.getMinutes() * Za);
}, (A, e) => {
  A.setTime(+A + e * vc);
}, (A, e) => (e - A) / vc, (A) => A.getHours());
q3.range;
const O3 = ho((A) => {
  A.setUTCMinutes(0, 0, 0);
}, (A, e) => {
  A.setTime(+A + e * vc);
}, (A, e) => (e - A) / vc, (A) => A.getUTCHours());
O3.range;
const qc = ho(
  (A) => A.setHours(0, 0, 0, 0),
  (A, e) => A.setDate(A.getDate() + e),
  (A, e) => (e - A - (e.getTimezoneOffset() - A.getTimezoneOffset()) * Za) / EQ,
  (A) => A.getDate() - 1
);
qc.range;
const Du = ho((A) => {
  A.setUTCHours(0, 0, 0, 0);
}, (A, e) => {
  A.setUTCDate(A.getUTCDate() + e);
}, (A, e) => (e - A) / EQ, (A) => A.getUTCDate() - 1);
Du.range;
const uMA = ho((A) => {
  A.setUTCHours(0, 0, 0, 0);
}, (A, e) => {
  A.setUTCDate(A.getUTCDate() + e);
}, (A, e) => (e - A) / EQ, (A) => Math.floor(A / EQ));
uMA.range;
function o0(A) {
  return ho((e) => {
    e.setDate(e.getDate() - (e.getDay() + 7 - A) % 7), e.setHours(0, 0, 0, 0);
  }, (e, t) => {
    e.setDate(e.getDate() + t * 7);
  }, (e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * Za) / ieA);
}
const KD = o0(0), CS = o0(1), OGe = o0(2), jGe = o0(3), Ef = o0(4), PGe = o0(5), $Ge = o0(6);
KD.range;
CS.range;
OGe.range;
jGe.range;
Ef.range;
PGe.range;
$Ge.range;
function g0(A) {
  return ho((e) => {
    e.setUTCDate(e.getUTCDate() - (e.getUTCDay() + 7 - A) % 7), e.setUTCHours(0, 0, 0, 0);
  }, (e, t) => {
    e.setUTCDate(e.getUTCDate() + t * 7);
  }, (e, t) => (t - e) / ieA);
}
const UD = g0(0), BS = g0(1), Ake = g0(2), eke = g0(3), uf = g0(4), tke = g0(5), ike = g0(6);
UD.range;
BS.range;
Ake.range;
eke.range;
uf.range;
tke.range;
ike.range;
const zY = ho((A) => {
  A.setDate(1), A.setHours(0, 0, 0, 0);
}, (A, e) => {
  A.setMonth(A.getMonth() + e);
}, (A, e) => e.getMonth() - A.getMonth() + (e.getFullYear() - A.getFullYear()) * 12, (A) => A.getMonth());
zY.range;
const TY = ho((A) => {
  A.setUTCDate(1), A.setUTCHours(0, 0, 0, 0);
}, (A, e) => {
  A.setUTCMonth(A.getUTCMonth() + e);
}, (A, e) => e.getUTCMonth() - A.getUTCMonth() + (e.getUTCFullYear() - A.getUTCFullYear()) * 12, (A) => A.getUTCMonth());
TY.range;
const ol = ho((A) => {
  A.setMonth(0, 1), A.setHours(0, 0, 0, 0);
}, (A, e) => {
  A.setFullYear(A.getFullYear() + e);
}, (A, e) => e.getFullYear() - A.getFullYear(), (A) => A.getFullYear());
ol.every = (A) => !isFinite(A = Math.floor(A)) || !(A > 0) ? null : ho((e) => {
  e.setFullYear(Math.floor(e.getFullYear() / A) * A), e.setMonth(0, 1), e.setHours(0, 0, 0, 0);
}, (e, t) => {
  e.setFullYear(e.getFullYear() + t * A);
});
ol.range;
const gl = ho((A) => {
  A.setUTCMonth(0, 1), A.setUTCHours(0, 0, 0, 0);
}, (A, e) => {
  A.setUTCFullYear(A.getUTCFullYear() + e);
}, (A, e) => e.getUTCFullYear() - A.getUTCFullYear(), (A) => A.getUTCFullYear());
gl.every = (A) => !isFinite(A = Math.floor(A)) || !(A > 0) ? null : ho((e) => {
  e.setUTCFullYear(Math.floor(e.getUTCFullYear() / A) * A), e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
}, (e, t) => {
  e.setUTCFullYear(e.getUTCFullYear() + t * A);
});
gl.range;
function dMA(A, e, t, i, n, o) {
  const g = [
    [Hc, 1, Lc],
    [Hc, 5, 5 * Lc],
    [Hc, 15, 15 * Lc],
    [Hc, 30, 30 * Lc],
    [o, 1, Za],
    [o, 5, 5 * Za],
    [o, 15, 15 * Za],
    [o, 30, 30 * Za],
    [n, 1, vc],
    [n, 3, 3 * vc],
    [n, 6, 6 * vc],
    [n, 12, 12 * vc],
    [i, 1, EQ],
    [i, 2, 2 * EQ],
    [t, 1, ieA],
    [e, 1, MQA],
    [e, 3, 3 * MQA],
    [A, 1, tz]
  ];
  function s(r, a, C) {
    const B = a < r;
    B && ([r, a] = [a, r]);
    const l = C && typeof C.range == "function" ? C : I(r, a, C), Q = l ? l.range(r, +a + 1) : [];
    return B ? Q.reverse() : Q;
  }
  function I(r, a, C) {
    const B = Math.abs(a - r) / C, l = ZD(([, , d]) => d).right(g, B);
    if (l === g.length)
      return A.every(_u(r / tz, a / tz, C));
    if (l === 0)
      return Qf.every(Math.max(_u(r, a, C), 1));
    const [Q, E] = g[B / g[l - 1][2] < g[l][2] / B ? l - 1 : l];
    return Q.every(E);
  }
  return [s, I];
}
const [nke, oke] = dMA(gl, TY, UD, uMA, O3, _3), [gke, ske] = dMA(ol, zY, KD, qc, q3, T3);
function iz(A) {
  if (0 <= A.y && A.y < 100) {
    var e = new Date(-1, A.m, A.d, A.H, A.M, A.S, A.L);
    return e.setFullYear(A.y), e;
  }
  return new Date(A.y, A.m, A.d, A.H, A.M, A.S, A.L);
}
function nz(A) {
  if (0 <= A.y && A.y < 100) {
    var e = new Date(Date.UTC(-1, A.m, A.d, A.H, A.M, A.S, A.L));
    return e.setUTCFullYear(A.y), e;
  }
  return new Date(Date.UTC(A.y, A.m, A.d, A.H, A.M, A.S, A.L));
}
function Qk(A, e, t) {
  return { y: A, m: e, d: t, H: 0, M: 0, S: 0, L: 0 };
}
function hMA(A) {
  var e = A.dateTime, t = A.date, i = A.time, n = A.periods, o = A.days, g = A.shortDays, s = A.months, I = A.shortMonths, r = Ek(n), a = uk(n), C = Ek(o), B = uk(o), l = Ek(g), Q = uk(g), E = Ek(s), d = uk(s), m = Ek(I), y = uk(I), f = {
    a: q,
    A: O,
    b: $,
    B: _,
    c: null,
    d: ZQA,
    e: ZQA,
    f: Nke,
    g: Zke,
    G: Kke,
    H: Gke,
    I: kke,
    j: Jke,
    L: mMA,
    m: Yke,
    M: Rke,
    p: tA,
    q: nA,
    Q: UQA,
    s: VQA,
    S: Fke,
    u: Mke,
    U: xke,
    V: Lke,
    w: vke,
    W: Hke,
    x: null,
    X: null,
    y: Ske,
    Y: Wke,
    Z: Uke,
    "%": KQA
  }, w = {
    a: AA,
    A: gA,
    b: rA,
    B: sA,
    c: null,
    d: WQA,
    e: WQA,
    f: Tke,
    g: iJe,
    G: oJe,
    H: Vke,
    I: Xke,
    j: zke,
    L: yMA,
    m: _ke,
    M: qke,
    p: lA,
    q: cA,
    Q: UQA,
    s: VQA,
    S: Oke,
    u: jke,
    U: Pke,
    V: $ke,
    w: AJe,
    W: eJe,
    x: null,
    X: null,
    y: tJe,
    Y: nJe,
    Z: gJe,
    "%": KQA
  }, G = {
    a: J,
    A: p,
    b: N,
    B: v,
    c: K,
    d: HQA,
    e: HQA,
    f: bke,
    g: vQA,
    G: LQA,
    H: SQA,
    I: SQA,
    j: hke,
    L: yke,
    m: dke,
    M: mke,
    p: c,
    q: uke,
    Q: fke,
    s: Dke,
    S: pke,
    u: Bke,
    U: lke,
    V: cke,
    w: Cke,
    W: Qke,
    x: U,
    X: j,
    y: vQA,
    Y: LQA,
    Z: Eke,
    "%": wke
  };
  f.x = R(t, f), f.X = R(i, f), f.c = R(e, f), w.x = R(t, w), w.X = R(i, w), w.c = R(e, w);
  function R(aA, QA) {
    return function(hA) {
      var EA = [], RA = -1, xA = 0, HA = aA.length, ne, VA, le;
      for (hA instanceof Date || (hA = /* @__PURE__ */ new Date(+hA)); ++RA < HA; )
        aA.charCodeAt(RA) === 37 && (EA.push(aA.slice(xA, RA)), (VA = xQA[ne = aA.charAt(++RA)]) != null ? ne = aA.charAt(++RA) : VA = ne === "e" ? " " : "0", (le = QA[ne]) && (ne = le(hA, VA)), EA.push(ne), xA = RA + 1);
      return EA.push(aA.slice(xA, RA)), EA.join("");
    };
  }
  function F(aA, QA) {
    return function(hA) {
      var EA = Qk(1900, void 0, 1), RA = Z(EA, aA, hA += "", 0), xA, HA;
      if (RA != hA.length)
        return null;
      if ("Q" in EA)
        return new Date(EA.Q);
      if ("s" in EA)
        return new Date(EA.s * 1e3 + ("L" in EA ? EA.L : 0));
      if (QA && !("Z" in EA) && (EA.Z = 0), "p" in EA && (EA.H = EA.H % 12 + EA.p * 12), EA.m === void 0 && (EA.m = "q" in EA ? EA.q : 0), "V" in EA) {
        if (EA.V < 1 || EA.V > 53)
          return null;
        "w" in EA || (EA.w = 1), "Z" in EA ? (xA = nz(Qk(EA.y, 0, 1)), HA = xA.getUTCDay(), xA = HA > 4 || HA === 0 ? BS.ceil(xA) : BS(xA), xA = Du.offset(xA, (EA.V - 1) * 7), EA.y = xA.getUTCFullYear(), EA.m = xA.getUTCMonth(), EA.d = xA.getUTCDate() + (EA.w + 6) % 7) : (xA = iz(Qk(EA.y, 0, 1)), HA = xA.getDay(), xA = HA > 4 || HA === 0 ? CS.ceil(xA) : CS(xA), xA = qc.offset(xA, (EA.V - 1) * 7), EA.y = xA.getFullYear(), EA.m = xA.getMonth(), EA.d = xA.getDate() + (EA.w + 6) % 7);
      } else
        ("W" in EA || "U" in EA) && ("w" in EA || (EA.w = "u" in EA ? EA.u % 7 : "W" in EA ? 1 : 0), HA = "Z" in EA ? nz(Qk(EA.y, 0, 1)).getUTCDay() : iz(Qk(EA.y, 0, 1)).getDay(), EA.m = 0, EA.d = "W" in EA ? (EA.w + 6) % 7 + EA.W * 7 - (HA + 5) % 7 : EA.w + EA.U * 7 - (HA + 6) % 7);
      return "Z" in EA ? (EA.H += EA.Z / 100 | 0, EA.M += EA.Z % 100, nz(EA)) : iz(EA);
    };
  }
  function Z(aA, QA, hA, EA) {
    for (var RA = 0, xA = QA.length, HA = hA.length, ne, VA; RA < xA; ) {
      if (EA >= HA)
        return -1;
      if (ne = QA.charCodeAt(RA++), ne === 37) {
        if (ne = QA.charAt(RA++), VA = G[ne in xQA ? QA.charAt(RA++) : ne], !VA || (EA = VA(aA, hA, EA)) < 0)
          return -1;
      } else if (ne != hA.charCodeAt(EA++))
        return -1;
    }
    return EA;
  }
  function c(aA, QA, hA) {
    var EA = r.exec(QA.slice(hA));
    return EA ? (aA.p = a.get(EA[0].toLowerCase()), hA + EA[0].length) : -1;
  }
  function J(aA, QA, hA) {
    var EA = l.exec(QA.slice(hA));
    return EA ? (aA.w = Q.get(EA[0].toLowerCase()), hA + EA[0].length) : -1;
  }
  function p(aA, QA, hA) {
    var EA = C.exec(QA.slice(hA));
    return EA ? (aA.w = B.get(EA[0].toLowerCase()), hA + EA[0].length) : -1;
  }
  function N(aA, QA, hA) {
    var EA = m.exec(QA.slice(hA));
    return EA ? (aA.m = y.get(EA[0].toLowerCase()), hA + EA[0].length) : -1;
  }
  function v(aA, QA, hA) {
    var EA = E.exec(QA.slice(hA));
    return EA ? (aA.m = d.get(EA[0].toLowerCase()), hA + EA[0].length) : -1;
  }
  function K(aA, QA, hA) {
    return Z(aA, e, QA, hA);
  }
  function U(aA, QA, hA) {
    return Z(aA, t, QA, hA);
  }
  function j(aA, QA, hA) {
    return Z(aA, i, QA, hA);
  }
  function q(aA) {
    return g[aA.getDay()];
  }
  function O(aA) {
    return o[aA.getDay()];
  }
  function $(aA) {
    return I[aA.getMonth()];
  }
  function _(aA) {
    return s[aA.getMonth()];
  }
  function tA(aA) {
    return n[+(aA.getHours() >= 12)];
  }
  function nA(aA) {
    return 1 + ~~(aA.getMonth() / 3);
  }
  function AA(aA) {
    return g[aA.getUTCDay()];
  }
  function gA(aA) {
    return o[aA.getUTCDay()];
  }
  function rA(aA) {
    return I[aA.getUTCMonth()];
  }
  function sA(aA) {
    return s[aA.getUTCMonth()];
  }
  function lA(aA) {
    return n[+(aA.getUTCHours() >= 12)];
  }
  function cA(aA) {
    return 1 + ~~(aA.getUTCMonth() / 3);
  }
  return {
    format: function(aA) {
      var QA = R(aA += "", f);
      return QA.toString = function() {
        return aA;
      }, QA;
    },
    parse: function(aA) {
      var QA = F(aA += "", !1);
      return QA.toString = function() {
        return aA;
      }, QA;
    },
    utcFormat: function(aA) {
      var QA = R(aA += "", w);
      return QA.toString = function() {
        return aA;
      }, QA;
    },
    utcParse: function(aA) {
      var QA = F(aA += "", !0);
      return QA.toString = function() {
        return aA;
      }, QA;
    }
  };
}
var xQA = { "-": "", _: " ", 0: "0" }, Uo = /^\s*\d+/, Ike = /^%/, ake = /[\\^$*+?|[\]().{}]/g;
function ai(A, e, t) {
  var i = A < 0 ? "-" : "", n = (i ? -A : A) + "", o = n.length;
  return i + (o < t ? new Array(t - o + 1).join(e) + n : n);
}
function rke(A) {
  return A.replace(ake, "\\$&");
}
function Ek(A) {
  return new RegExp("^(?:" + A.map(rke).join("|") + ")", "i");
}
function uk(A) {
  return new Map(A.map((e, t) => [e.toLowerCase(), t]));
}
function Cke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 1));
  return i ? (A.w = +i[0], t + i[0].length) : -1;
}
function Bke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 1));
  return i ? (A.u = +i[0], t + i[0].length) : -1;
}
function lke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 2));
  return i ? (A.U = +i[0], t + i[0].length) : -1;
}
function cke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 2));
  return i ? (A.V = +i[0], t + i[0].length) : -1;
}
function Qke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 2));
  return i ? (A.W = +i[0], t + i[0].length) : -1;
}
function LQA(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 4));
  return i ? (A.y = +i[0], t + i[0].length) : -1;
}
function vQA(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 2));
  return i ? (A.y = +i[0] + (+i[0] > 68 ? 1900 : 2e3), t + i[0].length) : -1;
}
function Eke(A, e, t) {
  var i = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t, t + 6));
  return i ? (A.Z = i[1] ? 0 : -(i[2] + (i[3] || "00")), t + i[0].length) : -1;
}
function uke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 1));
  return i ? (A.q = i[0] * 3 - 3, t + i[0].length) : -1;
}
function dke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 2));
  return i ? (A.m = i[0] - 1, t + i[0].length) : -1;
}
function HQA(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 2));
  return i ? (A.d = +i[0], t + i[0].length) : -1;
}
function hke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 3));
  return i ? (A.m = 0, A.d = +i[0], t + i[0].length) : -1;
}
function SQA(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 2));
  return i ? (A.H = +i[0], t + i[0].length) : -1;
}
function mke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 2));
  return i ? (A.M = +i[0], t + i[0].length) : -1;
}
function pke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 2));
  return i ? (A.S = +i[0], t + i[0].length) : -1;
}
function yke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 3));
  return i ? (A.L = +i[0], t + i[0].length) : -1;
}
function bke(A, e, t) {
  var i = Uo.exec(e.slice(t, t + 6));
  return i ? (A.L = Math.floor(i[0] / 1e3), t + i[0].length) : -1;
}
function wke(A, e, t) {
  var i = Ike.exec(e.slice(t, t + 1));
  return i ? t + i[0].length : -1;
}
function fke(A, e, t) {
  var i = Uo.exec(e.slice(t));
  return i ? (A.Q = +i[0], t + i[0].length) : -1;
}
function Dke(A, e, t) {
  var i = Uo.exec(e.slice(t));
  return i ? (A.s = +i[0], t + i[0].length) : -1;
}
function ZQA(A, e) {
  return ai(A.getDate(), e, 2);
}
function Gke(A, e) {
  return ai(A.getHours(), e, 2);
}
function kke(A, e) {
  return ai(A.getHours() % 12 || 12, e, 2);
}
function Jke(A, e) {
  return ai(1 + qc.count(ol(A), A), e, 3);
}
function mMA(A, e) {
  return ai(A.getMilliseconds(), e, 3);
}
function Nke(A, e) {
  return mMA(A, e) + "000";
}
function Yke(A, e) {
  return ai(A.getMonth() + 1, e, 2);
}
function Rke(A, e) {
  return ai(A.getMinutes(), e, 2);
}
function Fke(A, e) {
  return ai(A.getSeconds(), e, 2);
}
function Mke(A) {
  var e = A.getDay();
  return e === 0 ? 7 : e;
}
function xke(A, e) {
  return ai(KD.count(ol(A) - 1, A), e, 2);
}
function pMA(A) {
  var e = A.getDay();
  return e >= 4 || e === 0 ? Ef(A) : Ef.ceil(A);
}
function Lke(A, e) {
  return A = pMA(A), ai(Ef.count(ol(A), A) + (ol(A).getDay() === 4), e, 2);
}
function vke(A) {
  return A.getDay();
}
function Hke(A, e) {
  return ai(CS.count(ol(A) - 1, A), e, 2);
}
function Ske(A, e) {
  return ai(A.getFullYear() % 100, e, 2);
}
function Zke(A, e) {
  return A = pMA(A), ai(A.getFullYear() % 100, e, 2);
}
function Wke(A, e) {
  return ai(A.getFullYear() % 1e4, e, 4);
}
function Kke(A, e) {
  var t = A.getDay();
  return A = t >= 4 || t === 0 ? Ef(A) : Ef.ceil(A), ai(A.getFullYear() % 1e4, e, 4);
}
function Uke(A) {
  var e = A.getTimezoneOffset();
  return (e > 0 ? "-" : (e *= -1, "+")) + ai(e / 60 | 0, "0", 2) + ai(e % 60, "0", 2);
}
function WQA(A, e) {
  return ai(A.getUTCDate(), e, 2);
}
function Vke(A, e) {
  return ai(A.getUTCHours(), e, 2);
}
function Xke(A, e) {
  return ai(A.getUTCHours() % 12 || 12, e, 2);
}
function zke(A, e) {
  return ai(1 + Du.count(gl(A), A), e, 3);
}
function yMA(A, e) {
  return ai(A.getUTCMilliseconds(), e, 3);
}
function Tke(A, e) {
  return yMA(A, e) + "000";
}
function _ke(A, e) {
  return ai(A.getUTCMonth() + 1, e, 2);
}
function qke(A, e) {
  return ai(A.getUTCMinutes(), e, 2);
}
function Oke(A, e) {
  return ai(A.getUTCSeconds(), e, 2);
}
function jke(A) {
  var e = A.getUTCDay();
  return e === 0 ? 7 : e;
}
function Pke(A, e) {
  return ai(UD.count(gl(A) - 1, A), e, 2);
}
function bMA(A) {
  var e = A.getUTCDay();
  return e >= 4 || e === 0 ? uf(A) : uf.ceil(A);
}
function $ke(A, e) {
  return A = bMA(A), ai(uf.count(gl(A), A) + (gl(A).getUTCDay() === 4), e, 2);
}
function AJe(A) {
  return A.getUTCDay();
}
function eJe(A, e) {
  return ai(BS.count(gl(A) - 1, A), e, 2);
}
function tJe(A, e) {
  return ai(A.getUTCFullYear() % 100, e, 2);
}
function iJe(A, e) {
  return A = bMA(A), ai(A.getUTCFullYear() % 100, e, 2);
}
function nJe(A, e) {
  return ai(A.getUTCFullYear() % 1e4, e, 4);
}
function oJe(A, e) {
  var t = A.getUTCDay();
  return A = t >= 4 || t === 0 ? uf(A) : uf.ceil(A), ai(A.getUTCFullYear() % 1e4, e, 4);
}
function gJe() {
  return "+0000";
}
function KQA() {
  return "%";
}
function UQA(A) {
  return +A;
}
function VQA(A) {
  return Math.floor(+A / 1e3);
}
var ry, j3, wMA, neA, fMA;
sJe({
  dateTime: "%x, %X",
  date: "%-m/%-d/%Y",
  time: "%-I:%M:%S %p",
  periods: ["AM", "PM"],
  days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
});
function sJe(A) {
  return ry = hMA(A), j3 = ry.format, wMA = ry.parse, neA = ry.utcFormat, fMA = ry.utcParse, ry;
}
function IJe(A) {
  return new Date(A);
}
function aJe(A) {
  return A instanceof Date ? +A : +/* @__PURE__ */ new Date(+A);
}
function oeA(A, e, t, i, n, o, g, s, I, r) {
  var a = IMA(), C = a.invert, B = a.domain, l = r(".%L"), Q = r(":%S"), E = r("%I:%M"), d = r("%I %p"), m = r("%a %d"), y = r("%b %d"), f = r("%B"), w = r("%Y");
  function G(R) {
    return (I(R) < R ? l : s(R) < R ? Q : g(R) < R ? E : o(R) < R ? d : i(R) < R ? n(R) < R ? m : y : t(R) < R ? f : w)(R);
  }
  return a.invert = function(R) {
    return new Date(C(R));
  }, a.domain = function(R) {
    return arguments.length ? B(Array.from(R, aJe)) : B().map(IJe);
  }, a.ticks = function(R) {
    var F = B();
    return A(F[0], F[F.length - 1], R ?? 10);
  }, a.tickFormat = function(R, F) {
    return F == null ? G : r(F);
  }, a.nice = function(R) {
    var F = B();
    return (!R || typeof R.range != "function") && (R = e(F[0], F[F.length - 1], R ?? 10)), R ? B(CMA(F, R)) : a;
  }, a.copy = function() {
    return sF(a, oeA(A, e, t, i, n, o, g, s, I, r));
  }, a;
}
function rJe() {
  return wl.apply(oeA(gke, ske, ol, zY, KD, qc, q3, T3, Hc, j3).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
}
function CJe() {
  return wl.apply(oeA(nke, oke, gl, TY, UD, Du, O3, _3, Hc, neA).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
}
function P3() {
  var A = 0, e = 1, t, i, n, o, g = vs, s = !1, I;
  function r(C) {
    return C == null || isNaN(C = +C) ? I : g(n === 0 ? 0.5 : (C = (o(C) - t) * n, s ? Math.max(0, Math.min(1, C)) : C));
  }
  r.domain = function(C) {
    return arguments.length ? ([A, e] = C, t = o(A = +A), i = o(e = +e), n = t === i ? 0 : 1 / (i - t), r) : [A, e];
  }, r.clamp = function(C) {
    return arguments.length ? (s = !!C, r) : s;
  }, r.interpolator = function(C) {
    return arguments.length ? (g = C, r) : g;
  };
  function a(C) {
    return function(B) {
      var l, Q;
      return arguments.length ? ([l, Q] = B, g = C(l, Q), r) : [g(0), g(1)];
    };
  }
  return r.range = a(Sd), r.rangeRound = a(gF), r.unknown = function(C) {
    return arguments.length ? (I = C, r) : I;
  }, function(C) {
    return o = C, t = C(A), i = C(e), n = t === i ? 0 : 1 / (i - t), r;
  };
}
function Zd(A, e) {
  return e.domain(A.domain()).interpolator(A.interpolator()).clamp(A.clamp()).unknown(A.unknown());
}
function geA() {
  var A = n0(P3()(vs));
  return A.copy = function() {
    return Zd(A, geA());
  }, vd.apply(A, arguments);
}
function DMA() {
  var A = $AA(P3()).domain([1, 10]);
  return A.copy = function() {
    return Zd(A, DMA()).base(A.base());
  }, vd.apply(A, arguments);
}
function GMA() {
  var A = AeA(P3());
  return A.copy = function() {
    return Zd(A, GMA()).constant(A.constant());
  }, vd.apply(A, arguments);
}
function seA() {
  var A = eeA(P3());
  return A.copy = function() {
    return Zd(A, seA()).exponent(A.exponent());
  }, vd.apply(A, arguments);
}
function BJe() {
  return seA.apply(null, arguments).exponent(0.5);
}
function $3() {
  var A = 0, e = 0.5, t = 1, i = 1, n, o, g, s, I, r = vs, a, C = !1, B;
  function l(E) {
    return isNaN(E = +E) ? B : (E = 0.5 + ((E = +a(E)) - o) * (i * E < i * o ? s : I), r(C ? Math.max(0, Math.min(1, E)) : E));
  }
  l.domain = function(E) {
    return arguments.length ? ([A, e, t] = E, n = a(A = +A), o = a(e = +e), g = a(t = +t), s = n === o ? 0 : 0.5 / (o - n), I = o === g ? 0 : 0.5 / (g - o), i = o < n ? -1 : 1, l) : [A, e, t];
  }, l.clamp = function(E) {
    return arguments.length ? (C = !!E, l) : C;
  }, l.interpolator = function(E) {
    return arguments.length ? (r = E, l) : r;
  };
  function Q(E) {
    return function(d) {
      var m, y, f;
      return arguments.length ? ([m, y, f] = d, r = jAA(E, [m, y, f]), l) : [r(0), r(0.5), r(1)];
    };
  }
  return l.range = Q(Sd), l.rangeRound = Q(gF), l.unknown = function(E) {
    return arguments.length ? (B = E, l) : B;
  }, function(E) {
    return a = E, n = E(A), o = E(e), g = E(t), s = n === o ? 0 : 0.5 / (o - n), I = o === g ? 0 : 0.5 / (g - o), i = o < n ? -1 : 1, l;
  };
}
function kMA() {
  var A = n0($3()(vs));
  return A.copy = function() {
    return Zd(A, kMA());
  }, vd.apply(A, arguments);
}
function JMA() {
  var A = $AA($3()).domain([0.1, 1, 10]);
  return A.copy = function() {
    return Zd(A, JMA()).base(A.base());
  }, vd.apply(A, arguments);
}
function NMA() {
  var A = AeA($3());
  return A.copy = function() {
    return Zd(A, NMA()).constant(A.constant());
  }, vd.apply(A, arguments);
}
function IeA() {
  var A = eeA($3());
  return A.copy = function() {
    return Zd(A, IeA()).exponent(A.exponent());
  }, vd.apply(A, arguments);
}
function lJe() {
  return IeA.apply(null, arguments).exponent(0.5);
}
const fo = "#5B8FF9", aeA = {
  background: "transparent",
  boxplot: {
    ticks: {
      fill: "#d1d5db"
      // change tick color to white
    },
    rule: {
      color: "#d1d5db"
      // change rule color to white
    }
  },
  header: {
    titleColor: "#d1d5db",
    labelColor: "#d1d5db"
    // change label color to white
  },
  axis: {
    gridColor: "#666",
    domainColor: "#d1d5db",
    tickColor: "#d1d5db",
    labelColor: "#d1d5db",
    titleColor: "#d1d5db"
    // change title color to white
  },
  legend: {
    labelColor: "#d1d5db",
    titleColor: "#d1d5db"
    // change legend title color to white
  },
  view: {
    stroke: "#666"
  }
}, cJe = {
  light: {
    background: "transparent",
    boxplot: { ticks: !0 }
  },
  dark: aeA
}, QJe = {
  light: {
    font: "sans-serif",
    background: "transparent",
    fieldTitle: "verbal",
    title: {
      align: "left",
      anchor: "start",
      color: "#31333F",
      titleFontStyle: "normal",
      fontWeight: 600,
      fontSize: 16,
      orient: "top",
      offset: 26
    },
    header: {
      titleFontWeight: 400,
      titleFontSize: 16,
      titleColor: "#808495",
      titleFontStyle: "normal",
      labelFontSize: 12,
      labelFontWeight: 400,
      labelColor: "#808495",
      labelFontStyle: "normal"
    },
    axis: {
      labelFontSize: 12,
      labelFontWeight: 400,
      labelColor: "#808495",
      labelFontStyle: "normal",
      titleFontWeight: 400,
      titleFontSize: 14,
      titleColor: "#808495",
      titleFontStyle: "normal",
      ticks: !1,
      gridColor: "#e6eaf1",
      domain: !1,
      domainWidth: 1,
      domainColor: "#e6eaf1",
      labelFlush: !0,
      labelFlushOffset: 1,
      labelBound: !1,
      labelLimit: 100,
      titlePadding: 16,
      labelPadding: 16,
      labelSeparation: 4,
      labelOverlap: !0
    },
    legend: {
      labelFontSize: 14,
      labelFontWeight: 400,
      labelColor: "#808495",
      titleFontSize: 14,
      titleFontWeight: 400,
      titleFontStyle: "normal",
      titleColor: "#808495",
      titlePadding: 5,
      labelPadding: 16,
      columnPadding: 8,
      rowPadding: 4,
      padding: 7,
      symbolStrokeWidth: 4
    },
    range: {
      category: ["#0068c9", "#83c9ff", "#ff2b2b", "#ffabab", "#29b09d", "#7defa1", "#ff8700", "#ffd16a", "#6d3fc0", "#d5dae5"],
      diverging: ["#7d353b", "#bd4043", "#ff4b4b", "#ff8c8c", "#ffc7c7", "#a6dcff", "#60b4ff", "#1c83e1", "#0054a3", "#004280"],
      ramp: ["#e4f5ff", "#c7ebff", "#a6dcff", "#83c9ff", "#60b4ff", "#3d9df3", "#1c83e1", "#0068c9", "#0054a3", "#004280"],
      heatmap: ["#e4f5ff", "#c7ebff", "#a6dcff", "#83c9ff", "#60b4ff", "#3d9df3", "#1c83e1", "#0068c9", "#0054a3", "#004280"]
    },
    view: {
      columns: 1,
      strokeWidth: 0,
      stroke: "transparent",
      continuousHeight: 350,
      continuousWidth: 400
    },
    concat: { columns: 1 },
    facet: { columns: 1 },
    mark: { tooltip: !0, color: "#0068C9" },
    bar: { binSpacing: 4, discreteBandSize: { band: 0.85 } },
    boxplot: { ticks: !0 },
    axisDiscrete: { grid: !1 },
    axisXPoint: { grid: !1 },
    axisTemporal: { grid: !1 },
    axisXBand: { grid: !1 }
  },
  dark: {
    font: "sans-serif",
    background: "transparent",
    fieldTitle: "verbal",
    title: {
      align: "left",
      anchor: "start",
      color: "#fafafa",
      titleFontStyle: "normal",
      fontWeight: 600,
      fontSize: 16,
      orient: "top",
      offset: 26
    },
    header: {
      titleFontWeight: 400,
      titleFontSize: 16,
      titleColor: "#e6eaf1",
      titleFontStyle: "normal",
      labelFontSize: 12,
      labelFontWeight: 400,
      labelColor: "#e6eaf1",
      labelFontStyle: "normal"
    },
    axis: {
      labelFontSize: 12,
      labelFontWeight: 400,
      labelColor: "#e6eaf1",
      labelFontStyle: "normal",
      titleFontWeight: 400,
      titleFontSize: 14,
      titleColor: "#e6eaf1",
      titleFontStyle: "normal",
      ticks: !1,
      gridColor: "#31333F",
      domain: !1,
      domainWidth: 1,
      domainColor: "#31333F",
      labelFlush: !0,
      labelFlushOffset: 1,
      labelBound: !1,
      labelLimit: 100,
      titlePadding: 16,
      labelPadding: 16,
      labelSeparation: 4,
      labelOverlap: !0
    },
    legend: {
      labelFontSize: 14,
      labelFontWeight: 400,
      labelColor: "#e6eaf1",
      titleFontSize: 14,
      titleFontWeight: 400,
      titleFontStyle: "normal",
      titleColor: "#e6eaf1",
      titlePadding: 5,
      labelPadding: 16,
      columnPadding: 8,
      rowPadding: 4,
      padding: 7,
      symbolStrokeWidth: 4
    },
    range: {
      category: ["#83c9ff", "#0068c9", "#ffabab", "#ff2b2b", "#7defa1", "#29b09d", "#ffd16a", "#ff8700", "#6d3fc0", "#d5dae5"],
      diverging: ["#7d353b", "#bd4043", "#ff4b4b", "#ff8c8c", "#ffc7c7", "#a6dcff", "#60b4ff", "#1c83e1", "#0054a3", "#004280"],
      ramp: ["#004280", "#0054a3", "#0068c9", "#1c83e1", "#3d9df3", "#60b4ff", "#83c9ff", "#a6dcff", "#c7ebff", "#e4f5ff"],
      heatmap: ["#004280", "#0054a3", "#0068c9", "#1c83e1", "#3d9df3", "#60b4ff", "#83c9ff", "#a6dcff", "#c7ebff", "#e4f5ff"]
    },
    view: {
      columns: 1,
      strokeWidth: 0,
      stroke: "transparent",
      continuousHeight: 350,
      continuousWidth: 400
    },
    boxplot: {
      ticks: {
        fill: "#e6eaf1"
      },
      rule: {
        color: "#e6eaf1"
      }
    },
    concat: { columns: 1 },
    facet: { columns: 1 },
    mark: { tooltip: !0, color: "#83C9FF" },
    bar: { binSpacing: 4, discreteBandSize: { band: 0.85 } },
    axisDiscrete: { grid: !1 },
    axisXPoint: { grid: !1 },
    axisTemporal: { grid: !1 },
    axisXBand: { grid: !1 }
  }
}, EJe = {
  light: {
    area: { fill: fo },
    bar: { fill: fo },
    circle: { fill: fo },
    line: { stroke: fo },
    point: { stroke: fo },
    rect: { fill: fo },
    tick: { fill: fo },
    arc: { fill: fo },
    boxplot: { ticks: !0 },
    background: "transparent",
    range: {
      category: ["#5B8FF9", "#61DDAA", "#65789B", "#F6BD16", "#7262FD", "#78D3F8", "#9661BC", "#F6903D", "#008685", "#F08BB4"],
      diverging: ["#7b3294", "#c2a5cf", "#f7f7f7", "#a6dba0", "#008837"],
      heatmap: ["#0d0887", "#46039f", "#7201a8", "#9c179e", "#bd3786", "#d8576b", "#ed7953", "#fb9f3a", "#fdca26", "#f0f921"],
      ramp: ["#EBCCFF", "#CCB0FF", "#AE95FF", "#907BFF", "#7262FD", "#5349E0", "#2F32C3", "#001BA7", "#00068C"]
    },
    // scale for geo only
    scale: {
      continuous: { range: ["#d4d4e8", "#3b196f"] }
    }
  },
  dark: {
    ...aeA,
    area: { fill: fo },
    bar: { fill: fo },
    circle: { fill: fo },
    line: { stroke: fo },
    point: { stroke: fo },
    rect: { fill: fo },
    tick: { fill: fo },
    arc: { fill: fo },
    range: {
      category: ["#5B8FF9", "#61DDAA", "#65789B", "#F6BD16", "#7262FD", "#78D3F8", "#9661BC", "#F6903D", "#008685", "#F08BB4"],
      diverging: ["#7b3294", "#c2a5cf", "#f7f7f7", "#a6dba0", "#008837"],
      heatmap: ["#0d0887", "#46039f", "#7201a8", "#9c179e", "#bd3786", "#d8576b", "#ed7953", "#fb9f3a", "#fdca26", "#f0f921"],
      ramp: ["#EBCCFF", "#CCB0FF", "#AE95FF", "#907BFF", "#7262FD", "#5349E0", "#2F32C3", "#001BA7", "#00068C"]
    },
    // scale for geo only
    scale: {
      continuous: { range: ["#d4d4e8", "#3b196f"] }
    }
  }
}, lS = {
  vega: cJe,
  g2: EJe,
  streamlit: QJe
}, uJe = (A) => ({
  light: {
    area: { fill: A },
    bar: { fill: A },
    circle: { fill: A },
    line: { stroke: A },
    point: { stroke: A },
    rect: { fill: A },
    tick: { fill: A },
    boxplot: { fill: A },
    errorbar: { stroke: A },
    errorband: { fill: A },
    arc: { fill: A },
    background: "transparent"
  },
  dark: {
    ...aeA,
    area: { fill: A },
    bar: { fill: A },
    circle: { fill: A },
    line: { stroke: A },
    point: { stroke: A },
    rect: { fill: A },
    tick: { fill: A },
    boxplot: { fill: A },
    errorbar: { stroke: A },
    errorband: { fill: A },
    arc: { fill: A }
  }
}), dJe = (A) => ({
  light: {
    range: {
      category: { scheme: A },
      diverging: { scheme: A },
      heatmap: { scheme: A },
      ordinal: { scheme: A },
      ramp: { scheme: A }
    }
  },
  dark: {
    range: {
      category: { scheme: A },
      diverging: { scheme: A },
      heatmap: { scheme: A },
      ordinal: { scheme: A },
      ramp: { scheme: A }
    }
  }
}), DO = {
  category10: "1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",
  category20: "1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",
  category20b: "393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",
  category20c: "3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",
  tableau10: "4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",
  tableau20: "4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",
  accent: "7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",
  dark2: "1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",
  paired: "a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",
  pastel1: "fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",
  pastel2: "b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",
  set1: "e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",
  set2: "66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",
  set3: "8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f",
  blues: "cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",
  greens: "d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",
  greys: "e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",
  oranges: "fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",
  purples: "e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",
  reds: "fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",
  blueGreen: "d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",
  bluePurple: "ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",
  greenBlue: "d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",
  orangeRed: "fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",
  purpleBlue: "dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",
  purpleBlueGreen: "dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",
  purpleRed: "dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",
  redPurple: "fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",
  yellowGreen: "e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",
  yellowOrangeBrown: "feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",
  yellowOrangeRed: "fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",
  blueOrange: "134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",
  brownBlueGreen: "704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",
  purpleGreen: "5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",
  purpleOrange: "4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",
  redBlue: "8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",
  redGrey: "8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",
  yellowGreenBlue: "eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",
  redYellowBlue: "a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",
  redYellowGreen: "a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",
  pinkYellowGreen: "8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",
  spectral: "9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",
  viridis: "440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",
  magma: "0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",
  inferno: "0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",
  plasma: "0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",
  cividis: "00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",
  rainbow: "6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",
  sinebow: "ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",
  turbo: "23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",
  browns: "eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",
  tealBlues: "bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",
  teals: "bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",
  warmGreys: "dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",
  goldGreen: "f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",
  goldOrange: "f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",
  goldRed: "f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",
  lightGreyRed: "efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",
  lightGreyTeal: "e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",
  lightMulti: "e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",
  lightOrange: "f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",
  lightTealBlue: "e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",
  darkBlue: "3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",
  darkGold: "3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",
  darkGreen: "3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",
  darkMulti: "3737371f5287197d8c29a86995ce3fffe800ffffff",
  darkRed: "3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"
};
function YMA(A) {
  const e = A.length / 6 | 0, t = new Array(e);
  for (let i = 0; i < e; )
    t[i] = "#" + A.slice(i * 6, ++i * 6);
  return t;
}
const hJe = Object.entries(DO).map(([A, e]) => ({ name: A, value: YMA(e) })), GO = (A) => YMA(DO[A] ?? DO.tableau10), mJe = (A) => {
  if (!A)
    return { r: 91, g: 143, b: 249, a: 1 };
  const e = A.match(/\d+/g) || [], [t = 0, i = 0, n = 0, o = 0] = e.map(Number);
  return { r: t, g: i, b: n, a: o };
}, oz = (A) => A && typeof A == "object" && A.constructor === Object, RMA = (A, e) => {
  if (oz(A) && oz(e)) {
    const t = { ...A };
    return Object.keys(e).forEach((i) => {
      t[i] = oz(t[i]) ? RMA(t[i], e[i]) : e[i];
    }), t;
  }
  return e;
}, pJe = (...A) => A.reduce((e, t) => RMA(e, t), {});
function FMA(A) {
  var e;
  const { vizThemeConfig: t, mediaTheme: i, colorPalette: n, primaryColor: o } = A, g = (typeof t == "string" ? lS[t] : t) ?? lS.vega, s = o ? uJe(o) : {}, I = n ? dJe(n) : {};
  return (e = pJe(g, s, I)) == null ? void 0 : e[i];
}
function XQA(A) {
  if (A) {
    if (A instanceof Array)
      return A;
    if (typeof A == "object" && "scheme" in A)
      return A.scheme instanceof Array ? A.scheme : GO(A.scheme);
  }
}
function yJe(A) {
  var e, t, i;
  const n = ((e = A.point) == null ? void 0 : e.stroke) ?? fo, o = typeof n == "string" ? n : fo, g = XQA((t = A.range) == null ? void 0 : t.category) ?? GO("tableau10"), s = XQA((i = A.range) == null ? void 0 : i.ramp) ?? GO("blues");
  return {
    primaryColor: o,
    nominalPalette: g,
    quantitativePalette: s
  };
}
const MMA = (A, e, t, i) => {
  const { nominalPalette: n, primaryColor: o, quantitativePalette: g } = u.useMemo(() => yJe(i), [i]), s = u.useMemo(() => () => o, [o]), I = u.useMemo(() => e ? t && e.aggName && e.analyticType === "measure" ? io(e.fid, e.aggName) : e.fid : "", [e, t]), r = u.useMemo(() => !e || e.semanticType === "nominal" ? [0, 0] : A.reduce((Q, { [I]: E }) => (E < Q[0] && (Q[0] = E), E > Q[1] && (Q[1] = E), Q), [1 / 0, -1 / 0]), [A, e, I]), a = u.useMemo(() => !e || e.semanticType !== "nominal" ? [] : [
    ...A.reduce((Q, E) => (Q.add(E[I]), Q), /* @__PURE__ */ new Set())
  ], [A, e, I]), C = u.useMemo(() => {
    const [Q, E] = r, d = g.map((y, f) => Q + (E - Q) * f / (g.length - 1)), m = PAA().domain(d).range(g);
    return function(y) {
      return m(Number(y[I]));
    };
  }, [r, I, g]), B = u.useMemo(() => {
    const Q = K3().domain(a).range(n);
    return function(E) {
      return Q(E[I]);
    };
  }, [a, n]), l = u.useMemo(() => a.map((Q) => ({ name: Q, color: B({ [I]: Q }) })), [a, B]);
  return e ? e.semanticType === "quantitative" || e.semanticType === "temporal" ? {
    mapper: C,
    display: { type: e.semanticType, color: g, domain: r }
  } : {
    mapper: B,
    display: { type: "nominal", colors: l }
  } : {
    mapper: s
  };
}, xMA = (A, e, t) => u.useMemo(() => {
  let i, n;
  if (t && (t.domain && (i = Number(t.domain[0]), n = Number(t.domain[1])), an(t.domainMin) && (i = t.domainMin), an(t.domainMax) && (n = t.domainMax)), an(i) && an(n))
    return [i, n];
  if (!A)
    return [i ?? 0, n ?? 0];
  const o = e.map((I) => Number(I[A])).filter((I) => !isNaN(I));
  if (o.length === 0)
    return [i ?? 0, n ?? 0];
  const [g, s] = o.slice(1).reduce((I, r) => (r < I[0] && (I[0] = r), r > I[1] && (I[1] = r), I), [o[0], o[0]]);
  return [i ?? g, n ?? s];
}, [A, e, t]), LMA = (A, e, t) => u.useMemo(() => {
  let i, n;
  return t && (t.range && (i = Number(t.range[0]), n = Number(t.range[1])), an(t.rangeMin) && (i = t.rangeMin), an(t.rangeMax) && (n = t.rangeMax)), [i ?? A, n ?? e];
}, [t, e, A]), bJe = 2, wJe = 10, fJe = 3, DJe = (A, e, t, i) => {
  const n = u.useMemo(() => e ? t && e.aggName && e.analyticType === "measure" ? io(e.fid, e.aggName) : e.fid : "", [e, t]), o = u.useMemo(() => {
    if (i.size)
      return h2A(i.size, e, A, "light");
  }, [i, A, e]), [g, s] = xMA(n, A, o), [I, r] = LMA(bJe, wJe, o);
  return u.useCallback(function(a) {
    const C = Math.max(I, Math.min(fJe, r));
    if (!n)
      return C;
    const B = Number(a[n]);
    if (isNaN(B))
      return C;
    const l = Math.max(Math.min((B - g) / (s - g), 1), 0);
    return I + Math.sqrt(l) * (r - I);
  }, [n, g, s, I, r, t]);
}, GJe = 0.3, kJe = 0.8, JJe = 1, vMA = (A, e, t, i) => {
  const n = u.useMemo(() => e ? t && e.aggName && e.analyticType === "measure" ? io(e.fid, e.aggName) : e.fid : "", [e, t]), o = u.useMemo(() => {
    if (i.opacity)
      return h2A(i.opacity, e, A, "light");
  }, [i, A, e]), [g, s] = xMA(n, A, o), [I, r] = LMA(GJe, kJe, o);
  return u.useCallback(function(a) {
    if (!n)
      return JJe;
    const C = Number(a[n]);
    if (isNaN(C))
      return 0;
    const B = Math.max(Math.min((C - g) / (s - g), 1), 0);
    return I + B * (r - I);
  }, [n, g, s, I, r, t]);
}, NJe = (A) => `${A}`, YJe = (A, e) => {
  const { timeFormat: t = "%b %d, %Y", numberFormat: i } = e, n = u.useMemo(() => {
    const g = j3(t);
    return (s) => {
      if (typeof s != "number" && typeof s != "string")
        return "";
      const I = new Date(s);
      return isNaN(I.getTime()) ? "Invalid Date" : g(I);
    };
  }, [t]), o = u.useMemo(() => {
    if (!i)
      return (s) => typeof s != "number" ? "" : s.toLocaleString();
    const g = Ld(i);
    return (s) => typeof s != "number" ? "" : g(s);
  }, [i]);
  return u.useMemo(() => A === "quantitative" ? o : A === "temporal" ? n : NJe, [A, o, n]);
};
function HMA({ bounds: A }) {
  return MDe().flyToBounds(A), null;
}
const kO = u.memo(function({ allFields: A, vegaConfig: e, field: t, value: i }) {
  const { fid: n, analyticType: o, aggName: g } = t, s = u.useMemo(() => {
    var r;
    const a = ((r = A.find((C) => C.fid === n)) == null ? void 0 : r.name) ?? n;
    return o === "measure" && g ? `${g}(${a})` : a;
  }, [A, n, o, g]), I = YJe(t.semanticType, e);
  return b.createElement(
    "p",
    null,
    s,
    ": ",
    I(i)
  );
}), zM = 15;
function SMA(A) {
  const { display: e, field: t, aggerated: i } = A, n = i && t.analyticType === "measure" && t.aggName ? `${t.aggName}(${t.name})` : t.name;
  return b.createElement(
    "div",
    { className: "absolute right-5 top-5 bg-popover/30 rounded p-2", style: { zIndex: 999 } },
    e.type === "nominal" && b.createElement(
      "div",
      { className: "font-xs flex flex-col space-y-1" },
      b.createElement("div", { className: "font-medium max-w-[160px] overflow-hidden text-ellipsis whitespace-nowrap" }, n),
      e.colors.slice(0, zM).map(({ name: o, color: g }) => b.createElement(
        "div",
        { className: "flex space-x-1 items-center", key: o },
        b.createElement("div", { className: "w-3 h-3", style: { backgroundColor: g } }),
        b.createElement("div", null, o)
      )),
      e.colors.length > zM && b.createElement(
        "div",
        { className: "flex space-x-1 items-center" },
        b.createElement("div", { className: "w-3 h-3", style: { backgroundColor: e.colors[zM].color } }),
        b.createElement(
          "div",
          null,
          "...",
          e.colors.length - zM,
          " entries"
        )
      )
    ),
    e.type === "quantitative" && b.createElement(
      "div",
      { className: "font-xs flex flex-col space-y-1" },
      b.createElement("div", { className: "font-medium max-w-[160px] overflow-hidden text-ellipsis whitespace-nowrap" }, n),
      b.createElement(
        "div",
        { className: "flex space-x-1" },
        b.createElement("div", { className: "w-4 h-48", style: {
          background: `linear-gradient(${[...e.color].reverse().join(",")})`
        } }),
        b.createElement(
          "div",
          { className: "font-xs flex flex-col justify-between" },
          b.createElement("div", null, Math.floor(e.domain[1])),
          b.createElement("div", null, Math.floor(e.domain[1] * 0.75 + e.domain[0] * 0.25)),
          b.createElement("div", null, Math.floor(e.domain[1] * 0.5 + e.domain[0] * 0.5)),
          b.createElement("div", null, Math.floor(e.domain[1] * 0.25 + e.domain[0] * 0.75)),
          b.createElement("div", null, Math.floor(e.domain[0]))
        )
      )
    )
  );
}
const cS = (A, e) => {
  const t = Number(A), i = Number(e);
  return t >= -90 && t <= 90 && i >= -180 && i <= 180;
}, RJe = (A, e) => `${typeof A == "number" ? A : JSON.stringify(A)}, ${typeof e == "number" ? e : JSON.stringify(e)}`, gz = 20, FJe = u.forwardRef(function(A, e) {
  const { name: t, data: i, allFields: n, latitude: o, longitude: g, color: s, opacity: I, size: r, details: a, defaultAggregated: C, vegaConfig: B, scales: l, tileUrl: Q } = A, E = u.useMemo(() => g && o ? i.map((J) => [Number(J[o.fid]), Number(J[g.fid])]).filter((J) => cS(J[0], J[1])) : [], [g, o, i]), [d, m] = u.useMemo(() => {
    if (E.length > 0) {
      const [J, p] = E.reduce(([N, v], [K, U]) => (K < N[0][0] && (N[0][0] = K), K > N[1][0] && (N[1][0] = K), U < N[0][1] && (N[0][1] = U), U > N[1][1] && (N[1][1] = U), [N, [v[0] + U, v[1] + K]]), [
        [[...E[0]], [...E[0]]],
        [0, 0]
      ]);
      return [J, [p[0] / E.length, p[1] / E.length]];
    }
    return [
      [
        [-180, -90],
        [180, 90]
      ],
      [0, 0]
    ];
  }, [E]), y = u.useRef(null);
  u.useEffect(() => {
    var J;
    const p = (J = y.current) == null ? void 0 : J.getContainer();
    if (p) {
      const N = new ResizeObserver(() => {
        var v;
        (v = y.current) == null || v.invalidateSize();
      });
      return N.observe(p), () => {
        N.unobserve(p);
      };
    }
  });
  const f = SD();
  u.useEffect(() => {
    const J = f.current;
    J && (J.exportChart = async (p) => ({
      mode: p,
      title: t || "untitled",
      nCols: 0,
      nRows: 0,
      charts: [],
      container: () => {
        var N;
        return ((N = y.current) == null ? void 0 : N.getContainer()) ?? null;
      },
      chartType: "map"
    }));
  }, []);
  const w = DJe(i, r, C, l), G = vMA(i, I, C, l), { mapper: R, display: F } = MMA(i, s, C, B), Z = u.useMemo(() => a.concat([r, s, I].filter(Boolean)).map((J) => ({
    ...J,
    key: C && J.analyticType === "measure" && J.aggName ? io(J.fid, J.aggName) : J.fid
  })), [C, a, r, s, I]), c = u.useMemo(() => {
    if (o && g) {
      const J = [], p = i.flatMap((N, v) => {
        const K = N[o.fid], U = N[g.fid];
        if (!cS(K, U))
          return J.push([v, K, U]), [];
        const j = w(N), q = G(N), O = R(N);
        return [
          {
            key: `${v}-${j}-${q}-${O}`,
            center: [Number(K), Number(U)],
            radius: j,
            opacity: q,
            color: O,
            row: N
          }
        ];
      });
      return J.length > 0 && console.warn(`Failed to render ${J.length.toLocaleString()} markers of ${i.length.toLocaleString()} rows due to invalid lat/lng.
--------
${`${J.slice(0, gz).map(([N, v, K]) => `[${N + 1}] ${RJe(v, K)}`).join(`
`)}` + (J.length > gz ? `
	... and ${(J.length - gz).toLocaleString()} more` : "")}
`), p;
    } else
      return [];
  }, [o, g, i, w, G, R]);
  return b.createElement(
    zAA,
    { attributionControl: !1, center: m, ref: y, zoom: 5, bounds: d, preferCanvas: !0, style: { width: "100%", height: "100%", zIndex: 1 } },
    b.createElement(HMA, { bounds: d }),
    Q === void 0 && b.createElement(KY, { className: "map-tile", attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" }),
    Q && b.createElement(KY, { className: "map-tile", url: Q }),
    b.createElement(XAA, { prefix: "Leaflet" }),
    c.map(({ key: J, center: p, radius: N, opacity: v, color: K, row: U }) => b.createElement(lO, { key: J, center: p, radius: N, opacity: 0.8, fillOpacity: v, fillColor: K, color: "#00000022", stroke: !0, weight: 1, fill: !0 }, Z.length > 0 && b.createElement(EJ, null, Z.map((j, q) => b.createElement(kO, { key: q, allFields: n, vegaConfig: B, field: j, value: U[j.key] }))))),
    F && b.createElement(SMA, { display: F, field: s })
  );
}), MJe = FJe, sz = {};
function ZMA(A, e) {
  const t = e ? `${e.type}(${e.url})` : "", i = A || sz[t] || e, [n, o] = u.useState(0), g = u.useRef(0);
  return u.useEffect(() => {
    if (i === e && e) {
      const s = Date.now();
      g.current = s, fetch(e.url).then((I) => I.json()).then((I) => {
        if (s === g.current) {
          if (e.type === "GeoJSON")
            if ("features" in I)
              sz[t] = I;
            else
              throw "invalid geojson";
          else
            sz[t] = r3(I, Object.keys(I.objects)[0]);
          o(s);
        }
      }).catch((I) => console.error(I));
    }
  }, [i]), i === e ? void 0 : i;
}
const JO = (A) => {
  switch (A.type) {
    case "Polygon":
      return [A.coordinates[0].map((e) => [e[1], e[0]])];
    case "Point": {
      const e = A.coordinates;
      return [[[e[1], e[0]]]];
    }
    case "GeometryCollection":
      return A.geometries.map(JO).flat();
    case "LineString":
      return [A.coordinates.map((e) => [e[1], e[0]])];
    case "MultiLineString":
      return A.coordinates.map((e) => e.map((t) => [t[1], t[0]]));
    case "MultiPoint":
      return [A.coordinates.map((e) => [e[1], e[0]])];
    case "MultiPolygon":
      return A.coordinates.map((e) => e[0].map((t) => [t[1], t[0]]));
    default:
      return [];
  }
}, zQA = (A) => {
  let e = 0, t = [0, 0];
  for (let i = 0; i < A.length - 1; i++) {
    let [n, o] = A[i], [g, s] = A[i + 1], I = n * s - g * o;
    e += I, t[0] += (n + g) * I, t[1] += (o + s) * I;
  }
  return e /= 2, t[0] /= 6 * e, t[1] /= 6 * e, t;
}, xJe = u.forwardRef(function(A, e) {
  const { name: t, data: i, allFields: n, features: o, featuresUrl: g, geoKey: s, defaultAggregated: I, geoId: r, color: a, opacity: C, text: B, details: l, vegaConfig: Q, scaleIncludeUnmatchedChoropleth: E, showAllGeoshapeInChoropleth: d, scales: m, tileUrl: y } = A, f = u.useContext(FQ);
  u.useImperativeHandle(e, () => ({}));
  const w = ZMA(o, g), { t: G } = qe("translation"), R = u.useMemo(() => r ? i.map((tA) => tA[r.fid]) : [], [r, i]), [F, Z] = u.useMemo(() => {
    if (R.length && s && w) {
      const tA = [], nA = R.map((AA, gA) => {
        const rA = AA ? w.features.find((sA) => sA.properties && sA.properties[s] === AA) : void 0;
        return rA && tA.push(gA), rA;
      });
      return [tA, nA];
    }
    return [[], []];
  }, [R, w, s]), c = u.useMemo(() => {
    if (d && w) {
      const tA = new Set(R);
      return w.features.filter((nA) => nA.properties).filter((nA) => !tA.has(nA.properties[s])).map((nA) => ({ coords: JO(nA.geometry), name: nA.properties[s] }));
    }
    return [];
  }, [R, w, d, s]);
  u.useEffect(() => {
    if (Z.length > 0) {
      const tA = Z.filter((nA) => !nA);
      tA.length && console.warn(`Failed to render ${tA.length.toLocaleString()} items of ${i.length.toLocaleString()} rows due to missing geojson feature.`);
    }
  }, [Z]);
  const J = u.useMemo(() => Z.length > 0 ? Z.map((tA) => tA ? JO(tA.geometry) : [], []) : [], [Z]), [p, N] = u.useMemo(() => {
    const tA = J.flat(2);
    if (tA.length > 0) {
      const [nA, AA] = tA.reduce(([gA, rA], [sA, lA]) => (sA < gA[0][0] && (gA[0][0] = sA), sA > gA[1][0] && (gA[1][0] = sA), lA < gA[0][1] && (gA[0][1] = lA), lA > gA[1][1] && (gA[1][1] = lA), [gA, [rA[0] + lA, rA[1] + sA]]), [
        [[...tA[0]], [...tA[0]]],
        [0, 0]
      ]);
      return [nA, [AA[0] / J.length, AA[1] / J.length]];
    }
    return [
      [
        [-180, -90],
        [180, 90]
      ],
      [0, 0]
    ];
  }, [J]), v = u.useMemo(() => E ? i : F.map((tA) => i[tA]), [i, F, E]), K = vMA(v, C, I, m), { mapper: U, display: j } = MMA(v, a, I, Q), q = u.useMemo(() => l.concat([a, C].filter(Boolean)).map((tA) => ({
    ...tA,
    key: I && tA.analyticType === "measure" && tA.aggName ? io(tA.fid, tA.aggName) : tA.fid
  })), [I, l, a, C]), O = u.useRef(null);
  u.useEffect(() => {
    var tA;
    const nA = (tA = O.current) == null ? void 0 : tA.getContainer();
    if (nA) {
      const AA = new ResizeObserver(() => {
        var gA;
        (gA = O.current) == null || gA.invalidateSize();
      });
      return AA.observe(nA), () => {
        AA.unobserve(nA);
      };
    }
  });
  const $ = SD();
  if (u.useEffect(() => {
    const tA = $.current;
    tA && (tA.exportChart = async (nA) => ({
      mode: nA,
      title: t || "untitled",
      nCols: 0,
      nRows: 0,
      charts: [],
      container: () => {
        var AA;
        return ((AA = O.current) == null ? void 0 : AA.getContainer()) ?? null;
      },
      chartType: "map"
    }));
  }, []), !w && (o || g))
    return b.createElement("div", { className: "flex items-center justify-center w-full h-full" }, G("main.tabpanel.settings.geography_settings.loading"));
  const _ = f === "dark" ? "#fff4" : "#0004";
  return b.createElement(
    zAA,
    { preferCanvas: !0, attributionControl: !1, center: N, ref: O, zoom: 5, bounds: p, style: { width: "100%", height: "100%", zIndex: 1 } },
    b.createElement(HMA, { bounds: p }),
    y === void 0 && b.createElement(KY, { className: "map-tile", attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" }),
    y && b.createElement(KY, { className: "map-tile", url: y }),
    b.createElement(XAA, { prefix: "Leaflet" }),
    J.length > 0 && i.flatMap((tA, nA) => {
      const AA = J[nA], gA = K(tA), rA = U(tA);
      return AA.map((sA, lA) => {
        if (sA.length === 0)
          return null;
        if (sA.length === 1)
          return b.createElement(lO, { key: `${nA}-${gA}-${rA}-${lA}`, center: sA[0], radius: 3, opacity: 0.8, fillOpacity: gA, fillColor: rA, color: _, weight: 1, stroke: !0, fill: !0 }, q.length > 0 && b.createElement(
            EJ,
            null,
            b.createElement("header", null, i[nA][r.fid]),
            q.map((aA, QA) => b.createElement(kO, { key: QA, allFields: n, vegaConfig: Q, field: aA, value: tA[aA.key] }))
          ));
        const cA = B && sA.length >= 3 ? zQA(sA) : [NaN, NaN];
        return b.createElement(
          u.Fragment,
          { key: `${nA}-${gA}-${rA}-${lA}` },
          b.createElement(
            BQA,
            { positions: sA, pathOptions: {
              fillOpacity: gA * 0.8,
              fillColor: rA,
              color: _,
              weight: 1,
              stroke: !0,
              fill: !0
            } },
            b.createElement(
              EJ,
              null,
              b.createElement("header", null, i[nA][r.fid]),
              q.map((aA, QA) => b.createElement(kO, { key: QA, allFields: n, vegaConfig: Q, field: aA, value: tA[aA.key] }))
            )
          ),
          B && i[nA][B.fid] && cS(cA[0], cA[1]) && b.createElement(CQA, { position: cA, interactive: !1, icon: hC.divIcon({
            className: "!bg-transparent !border-none",
            html: `<div style="font-size: 11px; transform: translate(-50%, -50%); opacity: 0.8;">${i[nA][B.fid]}</div>`
          }) })
        );
      });
    }),
    c.flatMap(({ coords: tA, name: nA }, AA) => {
      const gA = "#808080";
      return tA.map((rA, sA) => {
        if (rA.length === 0)
          return null;
        if (rA.length === 1)
          return b.createElement(lO, { key: `missing-${AA}-${sA}`, center: rA[0], radius: 3, opacity: 0.8, fillOpacity: 0.3, fillColor: gA, color: _, weight: 1, stroke: !0, fill: !0 }, q.length > 0 && b.createElement(
            EJ,
            null,
            b.createElement("header", null, nA),
            q.map((cA, aA) => b.createElement(
              "p",
              { key: aA },
              cA.analyticType === "measure" && cA.aggName ? op(cA.name, cA.aggName) : cA.name,
              ": Null"
            ))
          ));
        const lA = B && rA.length >= 3 ? zQA(rA) : [NaN, NaN];
        return b.createElement(
          u.Fragment,
          { key: `missing-${AA}-${sA}` },
          b.createElement(
            BQA,
            { positions: rA, pathOptions: {
              fillOpacity: 0.3 * 0.8,
              fillColor: gA,
              color: _,
              weight: 1,
              stroke: !0,
              fill: !0
            } },
            b.createElement(
              EJ,
              null,
              b.createElement("header", null, nA),
              q.map((cA, aA) => b.createElement(
                "p",
                { key: aA },
                cA.analyticType === "measure" && cA.aggName ? op(cA.name, cA.aggName) : cA.name,
                ": Null"
              ))
            )
          ),
          B && i[AA][B.fid] && cS(lA[0], lA[1]) && b.createElement(CQA, { position: lA, interactive: !1, icon: hC.divIcon({
            className: "!bg-transparent !border-none",
            html: `<div style="font-size: 11px; transform: translate(-50%, -50%); opacity: 0.8;">${i[AA][B.fid]}</div>`
          }) })
        );
      });
    }),
    j && b.createElement(SMA, { display: j, field: a })
  );
}), LJe = xJe, NO = 800, QS = 600, vJe = u.forwardRef(function(A, e) {
  const { name: t, draggableFieldState: i, data: n, visualConfig: o, visualLayout: g, vegaConfig: s = {}, scales: I, scale: r } = A, { latitude: [a], longitude: [C], geoId: [B], dimensions: l, measures: Q, size: [E], color: [d], opacity: [m], text: [y], details: f } = i, { defaultAggregated: w, geoms: [G] } = o, { geojson: R, geoKey: F = "", geoUrl: Z, scaleIncludeUnmatchedChoropleth: c = !1, showAllGeoshapeInChoropleth: J = !1, geoMapTileUrl: p } = g, N = u.useMemo(() => [...l, ...Q], [l, Q]), v = u.useMemo(() => N.find(($) => $.geoRole === "latitude"), [N]), K = u.useMemo(() => N.find(($) => $.geoRole === "longitude"), [N]), U = u.useMemo(() => a ?? v, [a, v]), j = u.useMemo(() => C ?? K, [C, K]), q = u.useMemo(() => {
    const $ = I ?? {};
    return r != null && r.opacity && ($.opacity = {
      ...$.opacity ?? {},
      ...r.opacity
    }), r != null && r.size && ($.size = {
      ...$.size ?? {},
      ...r.size
    }), $;
  }, [I, r]), O = p ?? s.leafletGeoTileUrl;
  return G === "poi" ? b.createElement(MJe, { tileUrl: O, name: t, data: n, allFields: N, defaultAggregated: w, latitude: U, longitude: j, color: d, opacity: m, size: E, details: f, vegaConfig: s, scales: q }) : G === "choropleth" ? b.createElement(LJe, { tileUrl: O, name: t, data: n, allFields: N, features: R, featuresUrl: Z, geoKey: F, defaultAggregated: w, geoId: B, color: d, opacity: m, text: y, details: f, vegaConfig: s, scaleIncludeUnmatchedChoropleth: c, showAllGeoshapeInChoropleth: J, scales: q }) : null;
}), WMA = vJe;
/*!
 * https://github.com/Starcounter-Jack/JSON-Patch
 * (c) 2017-2022 Joachim Wester
 * MIT licensed
 */
var HJe = globalThis && globalThis.__extends || function() {
  var A = function(e, t) {
    return A = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, n) {
      i.__proto__ = n;
    } || function(i, n) {
      for (var o in n)
        n.hasOwnProperty(o) && (i[o] = n[o]);
    }, A(e, t);
  };
  return function(e, t) {
    A(e, t);
    function i() {
      this.constructor = e;
    }
    e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
  };
}(), SJe = Object.prototype.hasOwnProperty;
function YO(A, e) {
  return SJe.call(A, e);
}
function RO(A) {
  if (Array.isArray(A)) {
    for (var e = new Array(A.length), t = 0; t < e.length; t++)
      e[t] = "" + t;
    return e;
  }
  if (Object.keys)
    return Object.keys(A);
  var i = [];
  for (var n in A)
    YO(A, n) && i.push(n);
  return i;
}
function SI(A) {
  switch (typeof A) {
    case "object":
      return JSON.parse(JSON.stringify(A));
    case "undefined":
      return null;
    default:
      return A;
  }
}
function FO(A) {
  for (var e = 0, t = A.length, i; e < t; ) {
    if (i = A.charCodeAt(e), i >= 48 && i <= 57) {
      e++;
      continue;
    }
    return !1;
  }
  return !0;
}
function Xh(A) {
  return A.indexOf("/") === -1 && A.indexOf("~") === -1 ? A : A.replace(/~/g, "~0").replace(/\//g, "~1");
}
function KMA(A) {
  return A.replace(/~1/g, "/").replace(/~0/g, "~");
}
function MO(A) {
  if (A === void 0)
    return !0;
  if (A) {
    if (Array.isArray(A)) {
      for (var e = 0, t = A.length; e < t; e++)
        if (MO(A[e]))
          return !0;
    } else if (typeof A == "object") {
      for (var i = RO(A), n = i.length, o = 0; o < n; o++)
        if (MO(A[i[o]]))
          return !0;
    }
  }
  return !1;
}
function TQA(A, e) {
  var t = [A];
  for (var i in e) {
    var n = typeof e[i] == "object" ? JSON.stringify(e[i], null, 2) : e[i];
    typeof n < "u" && t.push(i + ": " + n);
  }
  return t.join(`
`);
}
var UMA = (
  /** @class */
  function(A) {
    HJe(e, A);
    function e(t, i, n, o, g) {
      var s = this.constructor, I = A.call(this, TQA(t, { name: i, index: n, operation: o, tree: g })) || this;
      return I.name = i, I.index = n, I.operation = o, I.tree = g, Object.setPrototypeOf(I, s.prototype), I.message = TQA(t, { name: i, index: n, operation: o, tree: g }), I;
    }
    return e;
  }(Error)
), Fn = UMA, ZJe = SI, vb = {
  add: function(A, e, t) {
    return A[e] = this.value, { newDocument: t };
  },
  remove: function(A, e, t) {
    var i = A[e];
    return delete A[e], { newDocument: t, removed: i };
  },
  replace: function(A, e, t) {
    var i = A[e];
    return A[e] = this.value, { newDocument: t, removed: i };
  },
  move: function(A, e, t) {
    var i = ES(t, this.path);
    i && (i = SI(i));
    var n = xm(t, { op: "remove", path: this.from }).removed;
    return xm(t, { op: "add", path: this.path, value: n }), { newDocument: t, removed: i };
  },
  copy: function(A, e, t) {
    var i = ES(t, this.from);
    return xm(t, { op: "add", path: this.path, value: SI(i) }), { newDocument: t };
  },
  test: function(A, e, t) {
    return { newDocument: t, test: _Y(A[e], this.value) };
  },
  _get: function(A, e, t) {
    return this.value = A[e], { newDocument: t };
  }
}, WJe = {
  add: function(A, e, t) {
    return FO(e) ? A.splice(e, 0, this.value) : A[e] = this.value, { newDocument: t, index: e };
  },
  remove: function(A, e, t) {
    var i = A.splice(e, 1);
    return { newDocument: t, removed: i[0] };
  },
  replace: function(A, e, t) {
    var i = A[e];
    return A[e] = this.value, { newDocument: t, removed: i };
  },
  move: vb.move,
  copy: vb.copy,
  test: vb.test,
  _get: vb._get
};
function ES(A, e) {
  if (e == "")
    return A;
  var t = { op: "_get", path: e };
  return xm(A, t), t.value;
}
function xm(A, e, t, i, n, o) {
  if (t === void 0 && (t = !1), i === void 0 && (i = !0), n === void 0 && (n = !0), o === void 0 && (o = 0), t && (typeof t == "function" ? t(e, 0, A, e.path) : uS(e, 0)), e.path === "") {
    var g = { newDocument: A };
    if (e.op === "add")
      return g.newDocument = e.value, g;
    if (e.op === "replace")
      return g.newDocument = e.value, g.removed = A, g;
    if (e.op === "move" || e.op === "copy")
      return g.newDocument = ES(A, e.from), e.op === "move" && (g.removed = A), g;
    if (e.op === "test") {
      if (g.test = _Y(A, e.value), g.test === !1)
        throw new Fn("Test operation failed", "TEST_OPERATION_FAILED", o, e, A);
      return g.newDocument = A, g;
    } else {
      if (e.op === "remove")
        return g.removed = A, g.newDocument = null, g;
      if (e.op === "_get")
        return e.value = A, g;
      if (t)
        throw new Fn("Operation `op` property is not one of operations defined in RFC-6902", "OPERATION_OP_INVALID", o, e, A);
      return g;
    }
  } else {
    i || (A = SI(A));
    var s = e.path || "", I = s.split("/"), r = A, a = 1, C = I.length, B = void 0, l = void 0, Q = void 0;
    for (typeof t == "function" ? Q = t : Q = uS; ; ) {
      if (l = I[a], l && l.indexOf("~") != -1 && (l = KMA(l)), n && (l == "__proto__" || l == "prototype" && a > 0 && I[a - 1] == "constructor"))
        throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");
      if (t && B === void 0 && (r[l] === void 0 ? B = I.slice(0, a).join("/") : a == C - 1 && (B = e.path), B !== void 0 && Q(e, 0, A, B)), a++, Array.isArray(r)) {
        if (l === "-")
          l = r.length;
        else {
          if (t && !FO(l))
            throw new Fn("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", o, e, A);
          FO(l) && (l = ~~l);
        }
        if (a >= C) {
          if (t && e.op === "add" && l > r.length)
            throw new Fn("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", o, e, A);
          var g = WJe[e.op].call(e, r, l, A);
          if (g.test === !1)
            throw new Fn("Test operation failed", "TEST_OPERATION_FAILED", o, e, A);
          return g;
        }
      } else if (a >= C) {
        var g = vb[e.op].call(e, r, l, A);
        if (g.test === !1)
          throw new Fn("Test operation failed", "TEST_OPERATION_FAILED", o, e, A);
        return g;
      }
      if (r = r[l], t && a < C && (!r || typeof r != "object"))
        throw new Fn("Cannot perform operation at the desired path", "OPERATION_PATH_UNRESOLVABLE", o, e, A);
    }
  }
}
function AU(A, e, t, i, n) {
  if (i === void 0 && (i = !0), n === void 0 && (n = !0), t && !Array.isArray(e))
    throw new Fn("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
  i || (A = SI(A));
  for (var o = new Array(e.length), g = 0, s = e.length; g < s; g++)
    o[g] = xm(A, e[g], t, !0, n, g), A = o[g].newDocument;
  return o.newDocument = A, o;
}
function KJe(A, e, t) {
  var i = xm(A, e);
  if (i.test === !1)
    throw new Fn("Test operation failed", "TEST_OPERATION_FAILED", t, e, A);
  return i.newDocument;
}
function uS(A, e, t, i) {
  if (typeof A != "object" || A === null || Array.isArray(A))
    throw new Fn("Operation is not an object", "OPERATION_NOT_AN_OBJECT", e, A, t);
  if (vb[A.op]) {
    if (typeof A.path != "string")
      throw new Fn("Operation `path` property is not a string", "OPERATION_PATH_INVALID", e, A, t);
    if (A.path.indexOf("/") !== 0 && A.path.length > 0)
      throw new Fn('Operation `path` property must start with "/"', "OPERATION_PATH_INVALID", e, A, t);
    if ((A.op === "move" || A.op === "copy") && typeof A.from != "string")
      throw new Fn("Operation `from` property is not present (applicable in `move` and `copy` operations)", "OPERATION_FROM_REQUIRED", e, A, t);
    if ((A.op === "add" || A.op === "replace" || A.op === "test") && A.value === void 0)
      throw new Fn("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_REQUIRED", e, A, t);
    if ((A.op === "add" || A.op === "replace" || A.op === "test") && MO(A.value))
      throw new Fn("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED", e, A, t);
    if (t) {
      if (A.op == "add") {
        var n = A.path.split("/").length, o = i.split("/").length;
        if (n !== o + 1 && n !== o)
          throw new Fn("Cannot perform an `add` operation at the desired path", "OPERATION_PATH_CANNOT_ADD", e, A, t);
      } else if (A.op === "replace" || A.op === "remove" || A.op === "_get") {
        if (A.path !== i)
          throw new Fn("Cannot perform the operation at a path that does not exist", "OPERATION_PATH_UNRESOLVABLE", e, A, t);
      } else if (A.op === "move" || A.op === "copy") {
        var g = { op: "_get", path: A.from, value: void 0 }, s = VMA([g], t);
        if (s && s.name === "OPERATION_PATH_UNRESOLVABLE")
          throw new Fn("Cannot perform the operation from a path that does not exist", "OPERATION_FROM_UNRESOLVABLE", e, A, t);
      }
    }
  } else
    throw new Fn("Operation `op` property is not one of operations defined in RFC-6902", "OPERATION_OP_INVALID", e, A, t);
}
function VMA(A, e, t) {
  try {
    if (!Array.isArray(A))
      throw new Fn("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
    if (e)
      AU(SI(e), SI(A), t || !0);
    else {
      t = t || uS;
      for (var i = 0; i < A.length; i++)
        t(A[i], i, e, void 0);
    }
  } catch (n) {
    if (n instanceof Fn)
      return n;
    throw n;
  }
}
function _Y(A, e) {
  if (A === e)
    return !0;
  if (A && e && typeof A == "object" && typeof e == "object") {
    var t = Array.isArray(A), i = Array.isArray(e), n, o, g;
    if (t && i) {
      if (o = A.length, o != e.length)
        return !1;
      for (n = o; n-- !== 0; )
        if (!_Y(A[n], e[n]))
          return !1;
      return !0;
    }
    if (t != i)
      return !1;
    var s = Object.keys(A);
    if (o = s.length, o !== Object.keys(e).length)
      return !1;
    for (n = o; n-- !== 0; )
      if (!e.hasOwnProperty(s[n]))
        return !1;
    for (n = o; n-- !== 0; )
      if (g = s[n], !_Y(A[g], e[g]))
        return !1;
    return !0;
  }
  return A !== A && e !== e;
}
const UJe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  JsonPatchError: Fn,
  _areEquals: _Y,
  applyOperation: xm,
  applyPatch: AU,
  applyReducer: KJe,
  deepClone: ZJe,
  getValueByPointer: ES,
  validate: VMA,
  validator: uS
}, Symbol.toStringTag, { value: "Module" }));
/*!
 * https://github.com/Starcounter-Jack/JSON-Patch
 * (c) 2017-2021 Joachim Wester
 * MIT license
 */
var reA = /* @__PURE__ */ new WeakMap(), VJe = (
  /** @class */
  function() {
    function A(e) {
      this.observers = /* @__PURE__ */ new Map(), this.obj = e;
    }
    return A;
  }()
), XJe = (
  /** @class */
  function() {
    function A(e, t) {
      this.callback = e, this.observer = t;
    }
    return A;
  }()
);
function zJe(A) {
  return reA.get(A);
}
function TJe(A, e) {
  return A.observers.get(e);
}
function _Je(A, e) {
  A.observers.delete(e.callback);
}
function qJe(A, e) {
  e.unobserve();
}
function OJe(A, e) {
  var t = [], i, n = zJe(A);
  if (!n)
    n = new VJe(A), reA.set(A, n);
  else {
    var o = TJe(n, e);
    i = o && o.observer;
  }
  if (i)
    return i;
  if (i = {}, n.value = SI(A), e) {
    i.callback = e, i.next = null;
    var g = function() {
      xO(i);
    }, s = function() {
      clearTimeout(i.next), i.next = setTimeout(g);
    };
    typeof window < "u" && (window.addEventListener("mouseup", s), window.addEventListener("keyup", s), window.addEventListener("mousedown", s), window.addEventListener("keydown", s), window.addEventListener("change", s));
  }
  return i.patches = t, i.object = A, i.unobserve = function() {
    xO(i), clearTimeout(i.next), _Je(n, i), typeof window < "u" && (window.removeEventListener("mouseup", s), window.removeEventListener("keyup", s), window.removeEventListener("mousedown", s), window.removeEventListener("keydown", s), window.removeEventListener("change", s));
  }, n.observers.set(e, new XJe(e, i)), i;
}
function xO(A, e) {
  e === void 0 && (e = !1);
  var t = reA.get(A.object);
  CeA(t.value, A.object, A.patches, "", e), A.patches.length && AU(t.value, A.patches);
  var i = A.patches;
  return i.length > 0 && (A.patches = [], A.callback && A.callback(i)), i;
}
function CeA(A, e, t, i, n) {
  if (e !== A) {
    typeof e.toJSON == "function" && (e = e.toJSON());
    for (var o = RO(e), g = RO(A), s = !1, I = g.length - 1; I >= 0; I--) {
      var r = g[I], a = A[r];
      if (YO(e, r) && !(e[r] === void 0 && a !== void 0 && Array.isArray(e) === !1)) {
        var C = e[r];
        typeof a == "object" && a != null && typeof C == "object" && C != null && Array.isArray(a) === Array.isArray(C) ? CeA(a, C, t, i + "/" + Xh(r), n) : a !== C && (n && t.push({ op: "test", path: i + "/" + Xh(r), value: SI(a) }), t.push({ op: "replace", path: i + "/" + Xh(r), value: SI(C) }));
      } else
        Array.isArray(A) === Array.isArray(e) ? (n && t.push({ op: "test", path: i + "/" + Xh(r), value: SI(a) }), t.push({ op: "remove", path: i + "/" + Xh(r) }), s = !0) : (n && t.push({ op: "test", path: i, value: A }), t.push({ op: "replace", path: i, value: e }));
    }
    if (!(!s && o.length == g.length))
      for (var I = 0; I < o.length; I++) {
        var r = o[I];
        !YO(A, r) && e[r] !== void 0 && t.push({ op: "add", path: i + "/" + Xh(r), value: SI(e[r]) });
      }
  }
}
function jJe(A, e, t) {
  t === void 0 && (t = !1);
  var i = [];
  return CeA(A, e, i, "", t), i;
}
const PJe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  compare: jJe,
  generate: xO,
  observe: OJe,
  unobserve: qJe
}, Symbol.toStringTag, { value: "Module" }));
Object.assign({}, UJe, PJe, {
  JsonPatchError: UMA,
  deepClone: SI,
  escapePathComponent: Xh,
  unescapePathComponent: KMA
});
var $Je = /("(?:[^\\"]|\\.)*")|[:,]/g, ANe = function(A, e) {
  var t, i, n;
  return e = e || {}, t = JSON.stringify(
    [1],
    void 0,
    e.indent === void 0 ? 2 : e.indent
  ).slice(2, -3), i = t === "" ? 1 / 0 : e.maxLength === void 0 ? 80 : e.maxLength, n = e.replacer, function o(g, s, I) {
    var r, a, C, B, l, Q, E, d, m, y, f, w;
    if (g && typeof g.toJSON == "function" && (g = g.toJSON()), f = JSON.stringify(g, n), f === void 0)
      return f;
    if (E = i - s.length - I, f.length <= E && (m = f.replace(
      $Je,
      function(G, R) {
        return R || G + " ";
      }
    ), m.length <= E))
      return m;
    if (n != null && (g = JSON.parse(f), n = void 0), typeof g == "object" && g !== null) {
      if (d = s + t, C = [], a = 0, Array.isArray(g))
        for (y = "[", r = "]", E = g.length; a < E; a++)
          C.push(
            o(g[a], d, a === E - 1 ? 0 : 1) || "null"
          );
      else
        for (y = "{", r = "}", Q = Object.keys(g), E = Q.length; a < E; a++)
          B = Q[a], l = JSON.stringify(B) + ": ", w = o(
            g[B],
            d,
            l.length + (a === E - 1 ? 0 : 1)
          ), w !== void 0 && C.push(l + w);
      if (C.length > 0)
        return [y, t + C.join(`,
` + d), r].join(
          `
` + s
        );
    }
    return f;
  }(A, "", 0);
};
const Iz = /* @__PURE__ */ Br(ANe);
function oI(A, e, t) {
  return A.fields = e || [], A.fname = t, A;
}
function Sn(A) {
  return A == null ? null : A.fname;
}
function fg(A) {
  return A == null ? null : A.fields;
}
function XMA(A) {
  return A.length === 1 ? eNe(A[0]) : tNe(A);
}
const eNe = (A) => function(e) {
  return e[A];
}, tNe = (A) => {
  const e = A.length;
  return function(t) {
    for (let i = 0; i < e; ++i)
      t = t[A[i]];
    return t;
  };
};
function vA(A) {
  throw Error(A);
}
function fl(A) {
  const e = [], t = A.length;
  let i = null, n = 0, o = "", g, s, I;
  A = A + "";
  function r() {
    e.push(o + A.substring(g, s)), o = "", g = s + 1;
  }
  for (g = s = 0; s < t; ++s)
    if (I = A[s], I === "\\")
      o += A.substring(g, s++), g = s;
    else if (I === i)
      r(), i = null, n = -1;
    else {
      if (i)
        continue;
      g === n && I === '"' || g === n && I === "'" ? (g = s + 1, i = I) : I === "." && !n ? s > g ? r() : g = s + 1 : I === "[" ? (s > g && r(), n = g = s + 1) : I === "]" && (n || vA("Access path missing open bracket: " + A), n > 0 && r(), n = 0, g = s + 1);
    }
  return n && vA("Access path missing closing bracket: " + A), i && vA("Access path missing closing quote: " + A), s > g && (s++, r()), e;
}
function tr(A, e, t) {
  const i = fl(A);
  return A = i.length === 1 ? i[0] : A, oI((t && t.get || XMA)(i), [A], e || A);
}
const IF = tr("id"), Ng = oI((A) => A, [], "identity"), KE = oI(() => 0, [], "zero"), VD = oI(() => 1, [], "one"), ir = oI(() => !0, [], "true"), wE = oI(() => !1, [], "false");
function iNe(A, e, t) {
  const i = [e].concat([].slice.call(t));
  console[A].apply(console, i);
}
const zMA = 0, BeA = 1, leA = 2, TMA = 3, _MA = 4;
function ceA(A, e) {
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : iNe, i = A || zMA;
  return {
    level(n) {
      return arguments.length ? (i = +n, this) : i;
    },
    error() {
      return i >= BeA && t(e || "error", "ERROR", arguments), this;
    },
    warn() {
      return i >= leA && t(e || "warn", "WARN", arguments), this;
    },
    info() {
      return i >= TMA && t(e || "log", "INFO", arguments), this;
    },
    debug() {
      return i >= _MA && t(e || "log", "DEBUG", arguments), this;
    }
  };
}
var ZA = Array.isArray;
function ce(A) {
  return A === Object(A);
}
const _QA = (A) => A !== "__proto__";
function XD() {
  for (var A = arguments.length, e = new Array(A), t = 0; t < A; t++)
    e[t] = arguments[t];
  return e.reduce((i, n) => {
    for (const o in n)
      if (o === "signals")
        i.signals = nNe(i.signals, n.signals);
      else {
        const g = o === "legend" ? {
          layout: 1
        } : o === "style" ? !0 : null;
        zD(i, o, n[o], g);
      }
    return i;
  }, {});
}
function zD(A, e, t, i) {
  if (!_QA(e))
    return;
  let n, o;
  if (ce(t) && !ZA(t)) {
    o = ce(A[e]) ? A[e] : A[e] = {};
    for (n in t)
      i && (i === !0 || i[n]) ? zD(o, n, t[n]) : _QA(n) && (o[n] = t[n]);
  } else
    A[e] = t;
}
function nNe(A, e) {
  if (A == null)
    return e;
  const t = {}, i = [];
  function n(o) {
    t[o.name] || (t[o.name] = 1, i.push(o));
  }
  return e.forEach(n), A.forEach(n), i;
}
function Xt(A) {
  return A[A.length - 1];
}
function yg(A) {
  return A == null || A === "" ? null : +A;
}
const qMA = (A) => (e) => A * Math.exp(e), OMA = (A) => (e) => Math.log(A * e), jMA = (A) => (e) => Math.sign(e) * Math.log1p(Math.abs(e / A)), PMA = (A) => (e) => Math.sign(e) * Math.expm1(Math.abs(e)) * A, dS = (A) => (e) => e < 0 ? -Math.pow(-e, A) : Math.pow(e, A);
function eU(A, e, t, i) {
  const n = t(A[0]), o = t(Xt(A)), g = (o - n) * e;
  return [i(n - g), i(o - g)];
}
function $MA(A, e) {
  return eU(A, e, yg, Ng);
}
function AxA(A, e) {
  var t = Math.sign(A[0]);
  return eU(A, e, OMA(t), qMA(t));
}
function exA(A, e, t) {
  return eU(A, e, dS(t), dS(1 / t));
}
function txA(A, e, t) {
  return eU(A, e, jMA(t), PMA(t));
}
function tU(A, e, t, i, n) {
  const o = i(A[0]), g = i(Xt(A)), s = e != null ? i(e) : (o + g) / 2;
  return [n(s + (o - s) * t), n(s + (g - s) * t)];
}
function QeA(A, e, t) {
  return tU(A, e, t, yg, Ng);
}
function EeA(A, e, t) {
  const i = Math.sign(A[0]);
  return tU(A, e, t, OMA(i), qMA(i));
}
function hS(A, e, t, i) {
  return tU(A, e, t, dS(i), dS(1 / i));
}
function ueA(A, e, t, i) {
  return tU(A, e, t, jMA(i), PMA(i));
}
function ixA(A) {
  return 1 + ~~(new Date(A).getMonth() / 3);
}
function nxA(A) {
  return 1 + ~~(new Date(A).getUTCMonth() / 3);
}
function Ce(A) {
  return A != null ? ZA(A) ? A : [A] : [];
}
function oxA(A, e, t) {
  let i = A[0], n = A[1], o;
  return n < i && (o = n, n = i, i = o), o = n - i, o >= t - e ? [e, t] : [i = Math.min(Math.max(i, e), t - o), i + o];
}
function yt(A) {
  return typeof A == "function";
}
const oNe = "descending";
function deA(A, e, t) {
  t = t || {}, e = Ce(e) || [];
  const i = [], n = [], o = {}, g = t.comparator || gNe;
  return Ce(A).forEach((s, I) => {
    s != null && (i.push(e[I] === oNe ? -1 : 1), n.push(s = yt(s) ? s : tr(s, null, t)), (fg(s) || []).forEach((r) => o[r] = 1));
  }), n.length === 0 ? null : oI(g(n, i), Object.keys(o));
}
const iU = (A, e) => (A < e || A == null) && e != null ? -1 : (A > e || e == null) && A != null ? 1 : (e = e instanceof Date ? +e : e, (A = A instanceof Date ? +A : A) !== A && e === e ? -1 : e !== e && A === A ? 1 : 0), gNe = (A, e) => A.length === 1 ? sNe(A[0], e[0]) : INe(A, e, A.length), sNe = (A, e) => function(t, i) {
  return iU(A(t), A(i)) * e;
}, INe = (A, e, t) => (e.push(0), function(i, n) {
  let o, g = 0, s = -1;
  for (; g === 0 && ++s < t; )
    o = A[s], g = iU(o(i), o(n));
  return g * e[s];
});
function Yg(A) {
  return yt(A) ? A : () => A;
}
function heA(A, e) {
  let t;
  return (i) => {
    t && clearTimeout(t), t = setTimeout(() => (e(i), t = null), A);
  };
}
function pt(A) {
  for (let e, t, i = 1, n = arguments.length; i < n; ++i) {
    e = arguments[i];
    for (t in e)
      A[t] = e[t];
  }
  return A;
}
function sl(A, e) {
  let t = 0, i, n, o, g;
  if (A && (i = A.length))
    if (e == null) {
      for (n = A[t]; t < i && (n == null || n !== n); n = A[++t])
        ;
      for (o = g = n; t < i; ++t)
        n = A[t], n != null && (n < o && (o = n), n > g && (g = n));
    } else {
      for (n = e(A[t]); t < i && (n == null || n !== n); n = e(A[++t]))
        ;
      for (o = g = n; t < i; ++t)
        n = e(A[t]), n != null && (n < o && (o = n), n > g && (g = n));
    }
  return [o, g];
}
function gxA(A, e) {
  const t = A.length;
  let i = -1, n, o, g, s, I;
  if (e == null) {
    for (; ++i < t; )
      if (o = A[i], o != null && o >= o) {
        n = g = o;
        break;
      }
    if (i === t)
      return [-1, -1];
    for (s = I = i; ++i < t; )
      o = A[i], o != null && (n > o && (n = o, s = i), g < o && (g = o, I = i));
  } else {
    for (; ++i < t; )
      if (o = e(A[i], i, A), o != null && o >= o) {
        n = g = o;
        break;
      }
    if (i === t)
      return [-1, -1];
    for (s = I = i; ++i < t; )
      o = e(A[i], i, A), o != null && (n > o && (n = o, s = i), g < o && (g = o, I = i));
  }
  return [s, I];
}
const aNe = Object.prototype.hasOwnProperty;
function Ze(A, e) {
  return aNe.call(A, e);
}
const TM = {};
function TD(A) {
  let e = {}, t;
  function i(o) {
    return Ze(e, o) && e[o] !== TM;
  }
  const n = {
    size: 0,
    empty: 0,
    object: e,
    has: i,
    get(o) {
      return i(o) ? e[o] : void 0;
    },
    set(o, g) {
      return i(o) || (++n.size, e[o] === TM && --n.empty), e[o] = g, this;
    },
    delete(o) {
      return i(o) && (--n.size, ++n.empty, e[o] = TM), this;
    },
    clear() {
      n.size = n.empty = 0, n.object = e = {};
    },
    test(o) {
      return arguments.length ? (t = o, n) : t;
    },
    clean() {
      const o = {};
      let g = 0;
      for (const s in e) {
        const I = e[s];
        I !== TM && (!t || !t(I)) && (o[s] = I, ++g);
      }
      n.size = g, n.empty = 0, n.object = e = o;
    }
  };
  return A && Object.keys(A).forEach((o) => {
    n.set(o, A[o]);
  }), n;
}
function sxA(A, e, t, i, n, o) {
  if (!t && t !== 0)
    return o;
  const g = +t;
  let s = A[0], I = Xt(A), r;
  I < s && (r = s, s = I, I = r), r = Math.abs(e - s);
  const a = Math.abs(I - e);
  return r < a && r <= g ? i : a <= g ? n : o;
}
function Ae(A, e, t) {
  const i = A.prototype = Object.create(e.prototype);
  return Object.defineProperty(i, "constructor", {
    value: A,
    writable: !0,
    enumerable: !0,
    configurable: !0
  }), pt(i, t);
}
function Hb(A, e, t, i) {
  let n = e[0], o = e[e.length - 1], g;
  return n > o && (g = n, n = o, o = g), t = t === void 0 || t, i = i === void 0 || i, (t ? n <= A : n < A) && (i ? A <= o : A < o);
}
function Wd(A) {
  return typeof A == "boolean";
}
function Gu(A) {
  return Object.prototype.toString.call(A) === "[object Date]";
}
function IxA(A) {
  return A && yt(A[Symbol.iterator]);
}
function ti(A) {
  return typeof A == "number";
}
function axA(A) {
  return Object.prototype.toString.call(A) === "[object RegExp]";
}
function Be(A) {
  return typeof A == "string";
}
function meA(A, e, t) {
  A && (A = e ? Ce(A).map((s) => s.replace(/\\(.)/g, "$1")) : Ce(A));
  const i = A && A.length, n = t && t.get || XMA, o = (s) => n(e ? [s] : fl(s));
  let g;
  if (!i)
    g = function() {
      return "";
    };
  else if (i === 1) {
    const s = o(A[0]);
    g = function(I) {
      return "" + s(I);
    };
  } else {
    const s = A.map(o);
    g = function(I) {
      let r = "" + s[0](I), a = 0;
      for (; ++a < i; )
        r += "|" + s[a](I);
      return r;
    };
  }
  return oI(g, A, "key");
}
function rxA(A, e) {
  const t = A[0], i = Xt(A), n = +e;
  return n ? n === 1 ? i : t + n * (i - t) : t;
}
const rNe = 1e4;
function CxA(A) {
  A = +A || rNe;
  let e, t, i;
  const n = () => {
    e = {}, t = {}, i = 0;
  }, o = (g, s) => (++i > A && (t = e, e = {}, i = 1), e[g] = s);
  return n(), {
    clear: n,
    has: (g) => Ze(e, g) || Ze(t, g),
    get: (g) => Ze(e, g) ? e[g] : Ze(t, g) ? o(g, t[g]) : void 0,
    set: (g, s) => Ze(e, g) ? e[g] = s : o(g, s)
  };
}
function BxA(A, e, t, i) {
  const n = e.length, o = t.length;
  if (!o)
    return e;
  if (!n)
    return t;
  const g = i || new e.constructor(n + o);
  let s = 0, I = 0, r = 0;
  for (; s < n && I < o; ++r)
    g[r] = A(e[s], t[I]) > 0 ? t[I++] : e[s++];
  for (; s < n; ++s, ++r)
    g[r] = e[s];
  for (; I < o; ++I, ++r)
    g[r] = t[I];
  return g;
}
function uJ(A, e) {
  let t = "";
  for (; --e >= 0; )
    t += A;
  return t;
}
function lxA(A, e, t, i) {
  const n = t || " ", o = A + "", g = e - o.length;
  return g <= 0 ? o : i === "left" ? uJ(n, g) + o : i === "center" ? uJ(n, ~~(g / 2)) + o + uJ(n, Math.ceil(g / 2)) : o + uJ(n, g);
}
function aF(A) {
  return A && Xt(A) - A[0] || 0;
}
function ie(A) {
  return ZA(A) ? "[" + A.map(ie) + "]" : ce(A) || Be(A) ? (
    // Output valid JSON and JS source strings.
    // See http://timelessrepo.com/json-isnt-a-javascript-subset
    JSON.stringify(A).replace("\u2028", "\\u2028").replace("\u2029", "\\u2029")
  ) : A;
}
function peA(A) {
  return A == null || A === "" ? null : !A || A === "false" || A === "0" ? !1 : !!A;
}
const CNe = (A) => ti(A) || Gu(A) ? A : Date.parse(A);
function yeA(A, e) {
  return e = e || CNe, A == null || A === "" ? null : e(A);
}
function beA(A) {
  return A == null || A === "" ? null : A + "";
}
function mC(A) {
  const e = {}, t = A.length;
  for (let i = 0; i < t; ++i)
    e[A[i]] = !0;
  return e;
}
function cxA(A, e, t, i) {
  const n = i ?? "…", o = A + "", g = o.length, s = Math.max(0, e - n.length);
  return g <= e ? o : t === "left" ? n + o.slice(g - s) : t === "center" ? o.slice(0, Math.ceil(s / 2)) + n + o.slice(g - ~~(s / 2)) : o.slice(0, s) + n;
}
function RE(A, e, t) {
  if (A)
    if (e) {
      const i = A.length;
      for (let n = 0; n < i; ++n) {
        const o = e(A[n]);
        o && t(o, n, A);
      }
    } else
      A.forEach(t);
}
var qQA = {}, az = {}, rz = 34, dk = 10, Cz = 13;
function QxA(A) {
  return new Function("d", "return {" + A.map(function(e, t) {
    return JSON.stringify(e) + ": d[" + t + '] || ""';
  }).join(",") + "}");
}
function BNe(A, e) {
  var t = QxA(A);
  return function(i, n) {
    return e(t(i), n, A);
  };
}
function OQA(A) {
  var e = /* @__PURE__ */ Object.create(null), t = [];
  return A.forEach(function(i) {
    for (var n in i)
      n in e || t.push(e[n] = n);
  }), t;
}
function fs(A, e) {
  var t = A + "", i = t.length;
  return i < e ? new Array(e - i + 1).join(0) + t : t;
}
function lNe(A) {
  return A < 0 ? "-" + fs(-A, 6) : A > 9999 ? "+" + fs(A, 6) : fs(A, 4);
}
function cNe(A) {
  var e = A.getUTCHours(), t = A.getUTCMinutes(), i = A.getUTCSeconds(), n = A.getUTCMilliseconds();
  return isNaN(A) ? "Invalid Date" : lNe(A.getUTCFullYear()) + "-" + fs(A.getUTCMonth() + 1, 2) + "-" + fs(A.getUTCDate(), 2) + (n ? "T" + fs(e, 2) + ":" + fs(t, 2) + ":" + fs(i, 2) + "." + fs(n, 3) + "Z" : i ? "T" + fs(e, 2) + ":" + fs(t, 2) + ":" + fs(i, 2) + "Z" : t || e ? "T" + fs(e, 2) + ":" + fs(t, 2) + "Z" : "");
}
function QNe(A) {
  var e = new RegExp('["' + A + `
\r]`), t = A.charCodeAt(0);
  function i(C, B) {
    var l, Q, E = n(C, function(d, m) {
      if (l)
        return l(d, m - 1);
      Q = d, l = B ? BNe(d, B) : QxA(d);
    });
    return E.columns = Q || [], E;
  }
  function n(C, B) {
    var l = [], Q = C.length, E = 0, d = 0, m, y = Q <= 0, f = !1;
    C.charCodeAt(Q - 1) === dk && --Q, C.charCodeAt(Q - 1) === Cz && --Q;
    function w() {
      if (y)
        return az;
      if (f)
        return f = !1, qQA;
      var R, F = E, Z;
      if (C.charCodeAt(F) === rz) {
        for (; E++ < Q && C.charCodeAt(E) !== rz || C.charCodeAt(++E) === rz; )
          ;
        return (R = E) >= Q ? y = !0 : (Z = C.charCodeAt(E++)) === dk ? f = !0 : Z === Cz && (f = !0, C.charCodeAt(E) === dk && ++E), C.slice(F + 1, R - 1).replace(/""/g, '"');
      }
      for (; E < Q; ) {
        if ((Z = C.charCodeAt(R = E++)) === dk)
          f = !0;
        else if (Z === Cz)
          f = !0, C.charCodeAt(E) === dk && ++E;
        else if (Z !== t)
          continue;
        return C.slice(F, R);
      }
      return y = !0, C.slice(F, Q);
    }
    for (; (m = w()) !== az; ) {
      for (var G = []; m !== qQA && m !== az; )
        G.push(m), m = w();
      B && (G = B(G, d++)) == null || l.push(G);
    }
    return l;
  }
  function o(C, B) {
    return C.map(function(l) {
      return B.map(function(Q) {
        return a(l[Q]);
      }).join(A);
    });
  }
  function g(C, B) {
    return B == null && (B = OQA(C)), [B.map(a).join(A)].concat(o(C, B)).join(`
`);
  }
  function s(C, B) {
    return B == null && (B = OQA(C)), o(C, B).join(`
`);
  }
  function I(C) {
    return C.map(r).join(`
`);
  }
  function r(C) {
    return C.map(a).join(A);
  }
  function a(C) {
    return C == null ? "" : C instanceof Date ? cNe(C) : e.test(C += "") ? '"' + C.replace(/"/g, '""') + '"' : C;
  }
  return {
    parse: i,
    parseRows: n,
    format: g,
    formatBody: s,
    formatRows: I,
    formatRow: r,
    formatValue: a
  };
}
const eg = "year", _s = "quarter", Dg = "month", lo = "week", qs = "date", pg = "day", Il = "dayofyear", Aa = "hours", ea = "minutes", nr = "seconds", pC = "milliseconds", weA = [eg, _s, Dg, lo, qs, pg, Il, Aa, ea, nr, pC], Bz = weA.reduce((A, e, t) => (A[e] = 1 + t, A), {});
function feA(A) {
  const e = Ce(A).slice(), t = {};
  return e.length || vA("Missing time unit."), e.forEach((i) => {
    Ze(Bz, i) ? t[i] = 1 : vA(`Invalid time unit: ${i}.`);
  }), (t[lo] || t[pg] ? 1 : 0) + (t[_s] || t[Dg] || t[qs] ? 1 : 0) + (t[Il] ? 1 : 0) > 1 && vA(`Incompatible time units: ${A}`), e.sort((i, n) => Bz[i] - Bz[n]), e;
}
const ENe = {
  [eg]: "%Y ",
  [_s]: "Q%q ",
  [Dg]: "%b ",
  [qs]: "%d ",
  [lo]: "W%U ",
  [pg]: "%a ",
  [Il]: "%j ",
  [Aa]: "%H:00",
  [ea]: "00:%M",
  [nr]: ":%S",
  [pC]: ".%L",
  [`${eg}-${Dg}`]: "%Y-%m ",
  [`${eg}-${Dg}-${qs}`]: "%Y-%m-%d ",
  [`${Aa}-${ea}`]: "%H:%M"
};
function ExA(A, e) {
  const t = pt({}, ENe, e), i = feA(A), n = i.length;
  let o = "", g = 0, s, I;
  for (g = 0; g < n; )
    for (s = i.length; s > g; --s)
      if (I = i.slice(g, s).join("-"), t[I] != null) {
        o += t[I], g = s;
        break;
      }
  return o.trim();
}
const $h = /* @__PURE__ */ new Date();
function DeA(A) {
  return $h.setFullYear(A), $h.setMonth(0), $h.setDate(1), $h.setHours(0, 0, 0, 0), $h;
}
function uxA(A) {
  return hxA(new Date(A));
}
function dxA(A) {
  return LO(new Date(A));
}
function hxA(A) {
  return qc.count(DeA(A.getFullYear()) - 1, A);
}
function LO(A) {
  return KD.count(DeA(A.getFullYear()) - 1, A);
}
function vO(A) {
  return DeA(A).getDay();
}
function uNe(A, e, t, i, n, o, g) {
  if (0 <= A && A < 100) {
    const s = new Date(-1, e, t, i, n, o, g);
    return s.setFullYear(A), s;
  }
  return new Date(A, e, t, i, n, o, g);
}
function mxA(A) {
  return yxA(new Date(A));
}
function pxA(A) {
  return HO(new Date(A));
}
function yxA(A) {
  const e = Date.UTC(A.getUTCFullYear(), 0, 1);
  return Du.count(e - 1, A);
}
function HO(A) {
  const e = Date.UTC(A.getUTCFullYear(), 0, 1);
  return UD.count(e - 1, A);
}
function SO(A) {
  return $h.setTime(Date.UTC(A, 0, 1)), $h.getUTCDay();
}
function dNe(A, e, t, i, n, o, g) {
  if (0 <= A && A < 100) {
    const s = new Date(Date.UTC(-1, e, t, i, n, o, g));
    return s.setUTCFullYear(t.y), s;
  }
  return new Date(Date.UTC(A, e, t, i, n, o, g));
}
function bxA(A, e, t, i, n) {
  const o = e || 1, g = Xt(A), s = (m, y, f) => (f = f || m, hNe(t[f], i[f], m === g && o, y)), I = /* @__PURE__ */ new Date(), r = mC(A), a = r[eg] ? s(eg) : Yg(2012), C = r[Dg] ? s(Dg) : r[_s] ? s(_s) : KE, B = r[lo] && r[pg] ? s(pg, 1, lo + pg) : r[lo] ? s(lo, 1) : r[pg] ? s(pg, 1) : r[qs] ? s(qs, 1) : r[Il] ? s(Il, 1) : VD, l = r[Aa] ? s(Aa) : KE, Q = r[ea] ? s(ea) : KE, E = r[nr] ? s(nr) : KE, d = r[pC] ? s(pC) : KE;
  return function(m) {
    I.setTime(+m);
    const y = a(I);
    return n(y, C(I), B(I, y), l(I), Q(I), E(I), d(I));
  };
}
function hNe(A, e, t, i) {
  const n = t <= 1 ? A : i ? (o, g) => i + t * Math.floor((A(o, g) - i) / t) : (o, g) => t * Math.floor(A(o, g) / t);
  return e ? (o, g) => e(n(o, g), g) : n;
}
function df(A, e, t) {
  return e + A * 7 - (t + 6) % 7;
}
const mNe = {
  [eg]: (A) => A.getFullYear(),
  [_s]: (A) => Math.floor(A.getMonth() / 3),
  [Dg]: (A) => A.getMonth(),
  [qs]: (A) => A.getDate(),
  [Aa]: (A) => A.getHours(),
  [ea]: (A) => A.getMinutes(),
  [nr]: (A) => A.getSeconds(),
  [pC]: (A) => A.getMilliseconds(),
  [Il]: (A) => hxA(A),
  [lo]: (A) => LO(A),
  [lo + pg]: (A, e) => df(LO(A), A.getDay(), vO(e)),
  [pg]: (A, e) => df(1, A.getDay(), vO(e))
}, pNe = {
  [_s]: (A) => 3 * A,
  [lo]: (A, e) => df(A, 0, vO(e))
};
function wxA(A, e) {
  return bxA(A, e || 1, mNe, pNe, uNe);
}
const yNe = {
  [eg]: (A) => A.getUTCFullYear(),
  [_s]: (A) => Math.floor(A.getUTCMonth() / 3),
  [Dg]: (A) => A.getUTCMonth(),
  [qs]: (A) => A.getUTCDate(),
  [Aa]: (A) => A.getUTCHours(),
  [ea]: (A) => A.getUTCMinutes(),
  [nr]: (A) => A.getUTCSeconds(),
  [pC]: (A) => A.getUTCMilliseconds(),
  [Il]: (A) => yxA(A),
  [lo]: (A) => HO(A),
  [pg]: (A, e) => df(1, A.getUTCDay(), SO(e)),
  [lo + pg]: (A, e) => df(HO(A), A.getUTCDay(), SO(e))
}, bNe = {
  [_s]: (A) => 3 * A,
  [lo]: (A, e) => df(A, 0, SO(e))
};
function fxA(A, e) {
  return bxA(A, e || 1, yNe, bNe, dNe);
}
const wNe = {
  [eg]: ol,
  [_s]: zY.every(3),
  [Dg]: zY,
  [lo]: KD,
  [qs]: qc,
  [pg]: qc,
  [Il]: qc,
  [Aa]: q3,
  [ea]: T3,
  [nr]: Hc,
  [pC]: Qf
}, fNe = {
  [eg]: gl,
  [_s]: TY.every(3),
  [Dg]: TY,
  [lo]: UD,
  [qs]: Du,
  [pg]: Du,
  [Il]: Du,
  [Aa]: O3,
  [ea]: _3,
  [nr]: Hc,
  [pC]: Qf
};
function _D(A) {
  return wNe[A];
}
function qD(A) {
  return fNe[A];
}
function DxA(A, e, t) {
  return A ? A.offset(e, t) : void 0;
}
function GxA(A, e, t) {
  return DxA(_D(A), e, t);
}
function kxA(A, e, t) {
  return DxA(qD(A), e, t);
}
function JxA(A, e, t, i) {
  return A ? A.range(e, t, i) : void 0;
}
function NxA(A, e, t, i) {
  return JxA(_D(A), e, t, i);
}
function YxA(A, e, t, i) {
  return JxA(qD(A), e, t, i);
}
const dJ = 1e3, hJ = dJ * 60, mJ = hJ * 60, nU = mJ * 24, DNe = nU * 7, jQA = nU * 30, ZO = nU * 365, RxA = [eg, Dg, qs, Aa, ea, nr, pC], pJ = RxA.slice(0, -1), yJ = pJ.slice(0, -1), bJ = yJ.slice(0, -1), GNe = bJ.slice(0, -1), kNe = [eg, lo], PQA = [eg, Dg], FxA = [eg], hk = [[pJ, 1, dJ], [pJ, 5, 5 * dJ], [pJ, 15, 15 * dJ], [pJ, 30, 30 * dJ], [yJ, 1, hJ], [yJ, 5, 5 * hJ], [yJ, 15, 15 * hJ], [yJ, 30, 30 * hJ], [bJ, 1, mJ], [bJ, 3, 3 * mJ], [bJ, 6, 6 * mJ], [bJ, 12, 12 * mJ], [GNe, 1, nU], [kNe, 1, DNe], [PQA, 1, jQA], [PQA, 3, 3 * jQA], [FxA, 1, ZO]];
function MxA(A) {
  const e = A.extent, t = A.maxbins || 40, i = Math.abs(aF(e)) / t;
  let n = ZD((s) => s[2]).right(hk, i), o, g;
  return n === hk.length ? (o = FxA, g = _u(e[0] / ZO, e[1] / ZO, t)) : n ? (n = hk[i / hk[n - 1][2] < hk[n][2] / i ? n - 1 : n], o = n[0], g = n[1]) : (o = RxA, g = Math.max(_u(e[0], e[1], t), 1)), {
    units: o,
    step: g
  };
}
function wJ(A) {
  const e = {};
  return (t) => e[t] || (e[t] = A(t));
}
function JNe(A, e) {
  return (t) => {
    const i = A(t), n = i.indexOf(e);
    if (n < 0)
      return i;
    let o = NNe(i, n);
    const g = o < i.length ? i.slice(o) : "";
    for (; --o > n; )
      if (i[o] !== "0") {
        ++o;
        break;
      }
    return i.slice(0, o) + g;
  };
}
function NNe(A, e) {
  let t = A.lastIndexOf("e"), i;
  if (t > 0)
    return t;
  for (t = A.length; --t > e; )
    if (i = A.charCodeAt(t), i >= 48 && i <= 57)
      return t + 1;
}
function xxA(A) {
  const e = wJ(A.format), t = A.formatPrefix;
  return {
    format: e,
    formatPrefix: t,
    formatFloat(i) {
      const n = ap(i || ",");
      if (n.precision == null) {
        switch (n.precision = 12, n.type) {
          case "%":
            n.precision -= 2;
            break;
          case "e":
            n.precision -= 1;
            break;
        }
        return JNe(
          e(n),
          // number format
          e(".1f")(1)[1]
          // decimal point character
        );
      } else
        return e(n);
    },
    formatSpan(i, n, o, g) {
      g = ap(g ?? ",f");
      const s = _u(i, n, o), I = Math.max(Math.abs(i), Math.abs(n));
      let r;
      if (g.precision == null)
        switch (g.type) {
          case "s":
            return isNaN(r = Q1A(s, I)) || (g.precision = r), t(g, I);
          case "":
          case "e":
          case "g":
          case "p":
          case "r": {
            isNaN(r = E1A(s, I)) || (g.precision = r - (g.type === "e"));
            break;
          }
          case "f":
          case "%": {
            isNaN(r = c1A(s)) || (g.precision = r - (g.type === "%") * 2);
            break;
          }
        }
      return e(g);
    }
  };
}
let WO;
LxA();
function LxA() {
  return WO = xxA({
    format: Ld,
    formatPrefix: WAA
  });
}
function vxA(A) {
  return xxA(l1A(A));
}
function mS(A) {
  return arguments.length ? WO = vxA(A) : WO;
}
function $QA(A, e, t) {
  t = t || {}, ce(t) || vA(`Invalid time multi-format specifier: ${t}`);
  const i = e(nr), n = e(ea), o = e(Aa), g = e(qs), s = e(lo), I = e(Dg), r = e(_s), a = e(eg), C = A(t[pC] || ".%L"), B = A(t[nr] || ":%S"), l = A(t[ea] || "%I:%M"), Q = A(t[Aa] || "%I %p"), E = A(t[qs] || t[pg] || "%a %d"), d = A(t[lo] || "%b %d"), m = A(t[Dg] || "%B"), y = A(t[_s] || "%B"), f = A(t[eg] || "%Y");
  return (w) => (i(w) < w ? C : n(w) < w ? B : o(w) < w ? l : g(w) < w ? Q : I(w) < w ? s(w) < w ? E : d : a(w) < w ? r(w) < w ? m : y : f)(w);
}
function HxA(A) {
  const e = wJ(A.format), t = wJ(A.utcFormat);
  return {
    timeFormat: (i) => Be(i) ? e(i) : $QA(e, _D, i),
    utcFormat: (i) => Be(i) ? t(i) : $QA(t, qD, i),
    timeParse: wJ(A.parse),
    utcParse: wJ(A.utcParse)
  };
}
let KO;
SxA();
function SxA() {
  return KO = HxA({
    format: j3,
    parse: wMA,
    utcFormat: neA,
    utcParse: fMA
  });
}
function ZxA(A) {
  return HxA(hMA(A));
}
function qY(A) {
  return arguments.length ? KO = ZxA(A) : KO;
}
const UO = (A, e) => pt({}, A, e);
function WxA(A, e) {
  const t = A ? vxA(A) : mS(), i = e ? ZxA(e) : qY();
  return UO(t, i);
}
function GeA(A, e) {
  const t = arguments.length;
  return t && t !== 2 && vA("defaultLocale expects either zero or two arguments."), t ? UO(mS(A), qY(e)) : UO(mS(), qY());
}
function YNe() {
  return LxA(), SxA(), GeA();
}
const RNe = /^(data:|([A-Za-z]+:)?\/\/)/, FNe = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i, MNe = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g, AEA = "file://";
function xNe(A, e) {
  return (t) => ({
    options: t || {},
    sanitize: vNe,
    load: LNe,
    fileAccess: !!e,
    file: HNe(e),
    http: ZNe(A)
  });
}
async function LNe(A, e) {
  const t = await this.sanitize(A, e), i = t.href;
  return t.localFile ? this.file(i) : this.http(i, e);
}
async function vNe(A, e) {
  e = pt({}, this.options, e);
  const t = this.fileAccess, i = {
    href: null
  };
  let n, o, g;
  const s = FNe.test(A.replace(MNe, ""));
  (A == null || typeof A != "string" || !s) && vA("Sanitize failure, invalid URI: " + ie(A));
  const I = RNe.test(A);
  return (g = e.baseURL) && !I && (!A.startsWith("/") && !g.endsWith("/") && (A = "/" + A), A = g + A), o = (n = A.startsWith(AEA)) || e.mode === "file" || e.mode !== "http" && !I && t, n ? A = A.slice(AEA.length) : A.startsWith("//") && (e.defaultProtocol === "file" ? (A = A.slice(2), o = !0) : A = (e.defaultProtocol || "http") + ":" + A), Object.defineProperty(i, "localFile", {
    value: !!o
  }), i.href = A, e.target && (i.target = e.target + ""), e.rel && (i.rel = e.rel + ""), e.context === "image" && e.crossOrigin && (i.crossOrigin = e.crossOrigin + ""), i;
}
function HNe(A) {
  return A ? (e) => new Promise((t, i) => {
    A.readFile(e, (n, o) => {
      n ? i(n) : t(o);
    });
  }) : SNe;
}
async function SNe() {
  vA("No file system access.");
}
function ZNe(A) {
  return A ? async function(e, t) {
    const i = pt({}, this.options.http, t), n = t && t.response, o = await A(e, i);
    return o.ok ? yt(o[n]) ? o[n]() : o.text() : vA(o.status + "" + o.statusText);
  } : WNe;
}
async function WNe() {
  vA("No HTTP fetch method available.");
}
const KNe = (A) => A != null && A === A, UNe = (A) => A === "true" || A === "false" || A === !0 || A === !1, VNe = (A) => !Number.isNaN(Date.parse(A)), KxA = (A) => !Number.isNaN(+A) && !(A instanceof Date), XNe = (A) => KxA(A) && Number.isInteger(+A), VO = {
  boolean: peA,
  integer: yg,
  number: yg,
  date: yeA,
  string: beA,
  unknown: Ng
}, _M = [UNe, XNe, KxA, VNe], zNe = ["boolean", "integer", "number", "date"];
function UxA(A, e) {
  if (!A || !A.length)
    return "unknown";
  const t = A.length, i = _M.length, n = _M.map((o, g) => g + 1);
  for (let o = 0, g = 0, s, I; o < t; ++o)
    for (I = e ? A[o][e] : A[o], s = 0; s < i; ++s)
      if (n[s] && KNe(I) && !_M[s](I) && (n[s] = 0, ++g, g === _M.length))
        return "string";
  return zNe[n.reduce((o, g) => o === 0 ? g : o, 0) - 1];
}
function VxA(A, e) {
  return e.reduce((t, i) => (t[i] = UxA(A, i), t), {});
}
function eEA(A) {
  const e = function(t, i) {
    const n = {
      delimiter: A
    };
    return keA(t, i ? pt(i, n) : n);
  };
  return e.responseType = "text", e;
}
function keA(A, e) {
  return e.header && (A = e.header.map(ie).join(e.delimiter) + `
` + A), QNe(e.delimiter).parse(A + "");
}
keA.responseType = "text";
function TNe(A) {
  return typeof Buffer == "function" && yt(Buffer.isBuffer) ? Buffer.isBuffer(A) : !1;
}
function JeA(A, e) {
  const t = e && e.property ? tr(e.property) : Ng;
  return ce(A) && !TNe(A) ? _Ne(t(A), e) : t(JSON.parse(A));
}
JeA.responseType = "json";
function _Ne(A, e) {
  return !ZA(A) && IxA(A) && (A = [...A]), e && e.copy ? JSON.parse(JSON.stringify(A)) : A;
}
const qNe = {
  interior: (A, e) => A !== e,
  exterior: (A, e) => A === e
};
function XxA(A, e) {
  let t, i, n, o;
  return A = JeA(A, e), e && e.feature ? (t = r3, n = e.feature) : e && e.mesh ? (t = yle, n = e.mesh, o = qNe[e.filter]) : vA("Missing TopoJSON feature or mesh parameter."), i = (i = A.objects[n]) ? t(A, i, o) : vA("Invalid TopoJSON object: " + n), i && i.features || [i];
}
XxA.responseType = "json";
const WL = {
  dsv: keA,
  csv: eEA(","),
  tsv: eEA("	"),
  json: JeA,
  topojson: XxA
};
function NeA(A, e) {
  return arguments.length > 1 ? (WL[A] = e, this) : Ze(WL, A) ? WL[A] : null;
}
function zxA(A) {
  const e = NeA(A);
  return e && e.responseType || "text";
}
function TxA(A, e, t, i) {
  e = e || {};
  const n = NeA(e.type || "json");
  return n || vA("Unknown data format type: " + e.type), A = n(A, e), e.parse && ONe(A, e.parse, t, i), Ze(A, "columns") && delete A.columns, A;
}
function ONe(A, e, t, i) {
  if (!A.length)
    return;
  const n = qY();
  t = t || n.timeParse, i = i || n.utcParse;
  let o = A.columns || Object.keys(A[0]), g, s, I, r, a, C;
  e === "auto" && (e = VxA(A, o)), o = Object.keys(e);
  const B = o.map((l) => {
    const Q = e[l];
    let E, d;
    if (Q && (Q.startsWith("date:") || Q.startsWith("utc:")))
      return E = Q.split(/:(.+)?/, 2), d = E[1], (d[0] === "'" && d[d.length - 1] === "'" || d[0] === '"' && d[d.length - 1] === '"') && (d = d.slice(1, -1)), (E[0] === "utc" ? i : t)(d);
    if (!VO[Q])
      throw Error("Illegal format pattern: " + l + ":" + Q);
    return VO[Q];
  });
  for (I = 0, a = A.length, C = o.length; I < a; ++I)
    for (g = A[I], r = 0; r < C; ++r)
      s = o[r], g[s] = B[r](g[s]);
}
const oU = xNe(
  typeof fetch < "u" && fetch,
  // use built-in fetch API
  null
  // no file system access
);
function gU(A) {
  const e = A || Ng, t = [], i = {};
  return t.add = (n) => {
    const o = e(n);
    return i[o] || (i[o] = 1, t.push(n)), t;
  }, t.remove = (n) => {
    const o = e(n);
    if (i[o]) {
      i[o] = 0;
      const g = t.indexOf(n);
      g >= 0 && t.splice(g, 1);
    }
    return t;
  }, t;
}
async function KL(A, e) {
  try {
    await e(A);
  } catch (t) {
    A.error(t);
  }
}
const _xA = Symbol("vega_id");
let jNe = 1;
function sU(A) {
  return !!(A && ve(A));
}
function ve(A) {
  return A[_xA];
}
function qxA(A, e) {
  return A[_xA] = e, A;
}
function Qi(A) {
  const e = A === Object(A) ? A : {
    data: A
  };
  return ve(e) ? e : qxA(e, jNe++);
}
function YeA(A) {
  return IU(A, Qi({}));
}
function IU(A, e) {
  for (const t in A)
    e[t] = A[t];
  return e;
}
function OxA(A, e) {
  return qxA(e, ve(A));
}
function s0(A, e) {
  return A ? e ? (t, i) => A(t, i) || ve(e(t)) - ve(e(i)) : (t, i) => A(t, i) || ve(t) - ve(i) : null;
}
function jxA(A) {
  return A && A.constructor === I0;
}
function I0() {
  const A = [], e = [], t = [], i = [], n = [];
  let o = null, g = !1;
  return {
    constructor: I0,
    insert(s) {
      const I = Ce(s), r = I.length;
      for (let a = 0; a < r; ++a)
        A.push(I[a]);
      return this;
    },
    remove(s) {
      const I = yt(s) ? i : e, r = Ce(s), a = r.length;
      for (let C = 0; C < a; ++C)
        I.push(r[C]);
      return this;
    },
    modify(s, I, r) {
      const a = {
        field: I,
        value: Yg(r)
      };
      return yt(s) ? (a.filter = s, n.push(a)) : (a.tuple = s, t.push(a)), this;
    },
    encode(s, I) {
      return yt(s) ? n.push({
        filter: s,
        field: I
      }) : t.push({
        tuple: s,
        field: I
      }), this;
    },
    clean(s) {
      return o = s, this;
    },
    reflow() {
      return g = !0, this;
    },
    pulse(s, I) {
      const r = {}, a = {};
      let C, B, l, Q, E, d;
      for (C = 0, B = I.length; C < B; ++C)
        r[ve(I[C])] = 1;
      for (C = 0, B = e.length; C < B; ++C)
        E = e[C], r[ve(E)] = -1;
      for (C = 0, B = i.length; C < B; ++C)
        Q = i[C], I.forEach((y) => {
          Q(y) && (r[ve(y)] = -1);
        });
      for (C = 0, B = A.length; C < B; ++C)
        E = A[C], d = ve(E), r[d] ? r[d] = 1 : s.add.push(Qi(A[C]));
      for (C = 0, B = I.length; C < B; ++C)
        E = I[C], r[ve(E)] < 0 && s.rem.push(E);
      function m(y, f, w) {
        w ? y[f] = w(y) : s.encode = f, g || (a[ve(y)] = y);
      }
      for (C = 0, B = t.length; C < B; ++C)
        l = t[C], E = l.tuple, Q = l.field, d = r[ve(E)], d > 0 && (m(E, Q, l.value), s.modifies(Q));
      for (C = 0, B = n.length; C < B; ++C)
        l = n[C], Q = l.filter, I.forEach((y) => {
          Q(y) && r[ve(y)] > 0 && m(y, l.field, l.value);
        }), s.modifies(l.field);
      if (g)
        s.mod = e.length || i.length ? I.filter((y) => r[ve(y)] > 0) : I.slice();
      else
        for (d in a)
          s.mod.push(a[d]);
      return (o || o == null && (e.length || i.length)) && s.clean(!0), s;
    }
  };
}
const UL = "_:mod:_";
function aU() {
  Object.defineProperty(this, UL, {
    writable: !0,
    value: {}
  });
}
aU.prototype = {
  /**
   * Set a parameter value. If the parameter value changes, the parameter
   * will be recorded as modified.
   * @param {string} name - The parameter name.
   * @param {number} index - The index into an array-value parameter. Ignored if
   *   the argument is undefined, null or less than zero.
   * @param {*} value - The parameter value to set.
   * @param {boolean} [force=false] - If true, records the parameter as modified
   *   even if the value is unchanged.
   * @return {Parameters} - This parameter object.
   */
  set(A, e, t, i) {
    const n = this, o = n[A], g = n[UL];
    return e != null && e >= 0 ? (o[e] !== t || i) && (o[e] = t, g[e + ":" + A] = -1, g[A] = -1) : (o !== t || i) && (n[A] = t, g[A] = ZA(t) ? 1 + t.length : -1), n;
  },
  /**
   * Tests if one or more parameters has been modified. If invoked with no
   * arguments, returns true if any parameter value has changed. If the first
   * argument is array, returns trues if any parameter name in the array has
   * changed. Otherwise, tests if the given name and optional array index has
   * changed.
   * @param {string} name - The parameter name to test.
   * @param {number} [index=undefined] - The parameter array index to test.
   * @return {boolean} - Returns true if a queried parameter was modified.
   */
  modified(A, e) {
    const t = this[UL];
    if (arguments.length) {
      if (ZA(A)) {
        for (let i = 0; i < A.length; ++i)
          if (t[A[i]])
            return !0;
        return !1;
      }
    } else {
      for (const i in t)
        if (t[i])
          return !0;
      return !1;
    }
    return e != null && e >= 0 ? e + 1 < t[A] || !!t[e + ":" + A] : !!t[A];
  },
  /**
   * Clears the modification records. After calling this method,
   * all parameters are considered unmodified.
   */
  clear() {
    return this[UL] = {}, this;
  }
};
let PNe = 0;
const $Ne = "pulse", AYe = new aU(), eYe = 1, tYe = 2;
function Ui(A, e, t, i) {
  this.id = ++PNe, this.value = A, this.stamp = -1, this.rank = -1, this.qrank = -1, this.flags = 0, e && (this._update = e), t && this.parameters(t, i);
}
function tEA(A) {
  return function(e) {
    const t = this.flags;
    return arguments.length === 0 ? !!(t & A) : (this.flags = e ? t | A : t & ~A, this);
  };
}
Ui.prototype = {
  /**
   * Returns a list of target operators dependent on this operator.
   * If this list does not exist, it is created and then returned.
   * @return {UniqueList}
   */
  targets() {
    return this._targets || (this._targets = gU(IF));
  },
  /**
   * Sets the value of this operator.
   * @param {*} value - the value to set.
   * @return {Number} Returns 1 if the operator value has changed
   *   according to strict equality, returns 0 otherwise.
   */
  set(A) {
    return this.value !== A ? (this.value = A, 1) : 0;
  },
  /**
   * Indicates that operator evaluation should be skipped on the next pulse.
   * This operator will still propagate incoming pulses, but its update function
   * will not be invoked. The skip flag is reset after every pulse, so calling
   * this method will affect processing of the next pulse only.
   */
  skip: tEA(eYe),
  /**
   * Indicates that this operator's value has been modified on its most recent
   * pulse. Normally modification is checked via strict equality; however, in
   * some cases it is more efficient to update the internal state of an object.
   * In those cases, the modified flag can be used to trigger propagation. Once
   * set, the modification flag persists across pulses until unset. The flag can
   * be used with the last timestamp to test if a modification is recent.
   */
  modified: tEA(tYe),
  /**
   * Sets the parameters for this operator. The parameter values are analyzed for
   * operator instances. If found, this operator will be added as a dependency
   * of the parameterizing operator. Operator values are dynamically marshalled
   * from each operator parameter prior to evaluation. If a parameter value is
   * an array, the array will also be searched for Operator instances. However,
   * the search does not recurse into sub-arrays or object properties.
   * @param {object} params - A hash of operator parameters.
   * @param {boolean} [react=true] - A flag indicating if this operator should
   *   automatically update (react) when parameter values change. In other words,
   *   this flag determines if the operator registers itself as a listener on
   *   any upstream operators included in the parameters.
   * @param {boolean} [initonly=false] - A flag indicating if this operator
   *   should calculate an update only upon its initial evaluation, then
   *   deregister dependencies and suppress all future update invocations.
   * @return {Operator[]} - An array of upstream dependencies.
   */
  parameters(A, e, t) {
    e = e !== !1;
    const i = this._argval = this._argval || new aU(), n = this._argops = this._argops || [], o = [];
    let g, s, I, r;
    const a = (C, B, l) => {
      l instanceof Ui ? (l !== this && (e && l.targets().add(this), o.push(l)), n.push({
        op: l,
        name: C,
        index: B
      })) : i.set(C, B, l);
    };
    for (g in A)
      if (s = A[g], g === $Ne)
        Ce(s).forEach((C) => {
          C instanceof Ui ? C !== this && (C.targets().add(this), o.push(C)) : vA("Pulse parameters must be operator instances.");
        }), this.source = s;
      else if (ZA(s))
        for (i.set(g, -1, Array(I = s.length)), r = 0; r < I; ++r)
          a(g, r, s[r]);
      else
        a(g, -1, s);
    return this.marshall().clear(), t && (n.initonly = !0), o;
  },
  /**
   * Internal method for marshalling parameter values.
   * Visits each operator dependency to pull the latest value.
   * @return {Parameters} A Parameters object to pass to the update function.
   */
  marshall(A) {
    const e = this._argval || AYe, t = this._argops;
    let i, n, o, g;
    if (t) {
      const s = t.length;
      for (n = 0; n < s; ++n)
        i = t[n], o = i.op, g = o.modified() && o.stamp === A, e.set(i.name, i.index, o.value, g);
      if (t.initonly) {
        for (n = 0; n < s; ++n)
          i = t[n], i.op.targets().remove(this);
        this._argops = null, this._update = null;
      }
    }
    return e;
  },
  /**
   * Detach this operator from the dataflow.
   * Unregisters listeners on upstream dependencies.
   */
  detach() {
    const A = this._argops;
    let e, t, i, n;
    if (A)
      for (e = 0, t = A.length; e < t; ++e)
        i = A[e], n = i.op, n._targets && n._targets.remove(this);
    this.pulse = null, this.source = null;
  },
  /**
   * Delegate method to perform operator processing.
   * Subclasses can override this method to perform custom processing.
   * By default, it marshalls parameters and calls the update function
   * if that function is defined. If the update function does not
   * change the operator value then StopPropagation is returned.
   * If no update function is defined, this method does nothing.
   * @param {Pulse} pulse - the current dataflow pulse.
   * @return The output pulse or StopPropagation. A falsy return value
   *   (including undefined) will let the input pulse pass through.
   */
  evaluate(A) {
    const e = this._update;
    if (e) {
      const t = this.marshall(A.stamp), i = e.call(this, t, A);
      if (t.clear(), i !== this.value)
        this.value = i;
      else if (!this.modified())
        return A.StopPropagation;
    }
  },
  /**
   * Run this operator for the current pulse. If this operator has already
   * been run at (or after) the pulse timestamp, returns StopPropagation.
   * Internally, this method calls {@link evaluate} to perform processing.
   * If {@link evaluate} returns a falsy value, the input pulse is returned.
   * This method should NOT be overridden, instead overrride {@link evaluate}.
   * @param {Pulse} pulse - the current dataflow pulse.
   * @return the output pulse for this operator (or StopPropagation)
   */
  run(A) {
    if (A.stamp < this.stamp)
      return A.StopPropagation;
    let e;
    return this.skip() ? (this.skip(!1), e = 0) : e = this.evaluate(A), this.pulse = e || A;
  }
};
function iYe(A, e, t, i) {
  let n = 1, o;
  return A instanceof Ui ? o = A : A && A.prototype instanceof Ui ? o = new A() : yt(A) ? o = new Ui(null, A) : (n = 0, o = new Ui(A, e)), this.rank(o), n && (i = t, t = e), t && this.connect(o, o.parameters(t, i)), this.touch(o), o;
}
function nYe(A, e) {
  const t = A.rank, i = e.length;
  for (let n = 0; n < i; ++n)
    if (t < e[n].rank) {
      this.rerank(A);
      return;
    }
}
let oYe = 0;
function rU(A, e, t) {
  this.id = ++oYe, this.value = null, t && (this.receive = t), A && (this._filter = A), e && (this._apply = e);
}
function fE(A, e, t) {
  return new rU(A, e, t);
}
rU.prototype = {
  _filter: ir,
  _apply: Ng,
  targets() {
    return this._targets || (this._targets = gU(IF));
  },
  consume(A) {
    return arguments.length ? (this._consume = !!A, this) : !!this._consume;
  },
  receive(A) {
    if (this._filter(A)) {
      const e = this.value = this._apply(A), t = this._targets, i = t ? t.length : 0;
      for (let n = 0; n < i; ++n)
        t[n].receive(e);
      this._consume && (A.preventDefault(), A.stopPropagation());
    }
  },
  filter(A) {
    const e = fE(A);
    return this.targets().add(e), e;
  },
  apply(A) {
    const e = fE(null, A);
    return this.targets().add(e), e;
  },
  merge() {
    const A = fE();
    this.targets().add(A);
    for (let e = 0, t = arguments.length; e < t; ++e)
      arguments[e].targets().add(A);
    return A;
  },
  throttle(A) {
    let e = -1;
    return this.filter(() => {
      const t = Date.now();
      return t - e > A ? (e = t, 1) : 0;
    });
  },
  debounce(A) {
    const e = fE();
    return this.targets().add(fE(null, null, heA(A, (t) => {
      const i = t.dataflow;
      e.receive(t), i && i.run && i.run();
    }))), e;
  },
  between(A, e) {
    let t = !1;
    return A.targets().add(fE(null, null, () => t = !0)), e.targets().add(fE(null, null, () => t = !1)), this.filter(() => t);
  },
  detach() {
    this._filter = ir, this._targets = null;
  }
};
function gYe(A, e, t, i) {
  const n = this, o = fE(t, i), g = function(r) {
    r.dataflow = n;
    try {
      o.receive(r);
    } catch (a) {
      n.error(a);
    } finally {
      n.run();
    }
  };
  let s;
  typeof A == "string" && typeof document < "u" ? s = document.querySelectorAll(A) : s = Ce(A);
  const I = s.length;
  for (let r = 0; r < I; ++r)
    s[r].addEventListener(e, g);
  return o;
}
function sYe(A, e) {
  const t = this.locale();
  return TxA(A, e, t.timeParse, t.utcParse);
}
function IYe(A, e, t) {
  return e = this.parse(e, t), this.pulse(A, this.changeset().insert(e));
}
async function aYe(A, e) {
  const t = this;
  let i = 0, n;
  try {
    n = await t.loader().load(A, {
      context: "dataflow",
      response: zxA(e && e.type)
    });
    try {
      n = t.parse(n, e);
    } catch (o) {
      i = -2, t.warn("Data ingestion failed", A, o);
    }
  } catch (o) {
    i = -1, t.warn("Loading failed", A, o);
  }
  return {
    data: n,
    status: i
  };
}
async function rYe(A, e, t) {
  const i = this, n = i._pending || CYe(i);
  n.requests += 1;
  const o = await i.request(e, t);
  return i.pulse(A, i.changeset().remove(ir).insert(o.data || [])), n.done(), o;
}
function CYe(A) {
  let e;
  const t = new Promise((i) => e = i);
  return t.requests = 0, t.done = () => {
    --t.requests === 0 && (A._pending = null, e(A));
  }, A._pending = t;
}
const BYe = {
  skip: !0
};
function lYe(A, e, t, i, n) {
  return (A instanceof Ui ? QYe : cYe)(this, A, e, t, i, n), this;
}
function cYe(A, e, t, i, n, o) {
  const g = pt({}, o, BYe);
  let s, I;
  yt(t) || (t = Yg(t)), i === void 0 ? s = (r) => A.touch(t(r)) : yt(i) ? (I = new Ui(null, i, n, !1), s = (r) => {
    I.evaluate(r);
    const a = t(r), C = I.value;
    jxA(C) ? A.pulse(a, C, o) : A.update(a, C, g);
  }) : s = (r) => A.update(t(r), i, g), e.apply(s);
}
function QYe(A, e, t, i, n, o) {
  if (i === void 0)
    e.targets().add(t);
  else {
    const g = o || {}, s = new Ui(null, EYe(t, i), n, !1);
    s.modified(g.force), s.rank = e.rank, e.targets().add(s), t && (s.skip(!0), s.value = t.value, s.targets().add(t), A.connect(t, [s]));
  }
}
function EYe(A, e) {
  return e = yt(e) ? e : Yg(e), A ? function(t, i) {
    const n = e(t, i);
    return A.skip() || (A.skip(n !== this.value).value = n), n;
  } : e;
}
function uYe(A) {
  A.rank = ++this._rank;
}
function dYe(A) {
  const e = [A];
  let t, i, n;
  for (; e.length; )
    if (this.rank(t = e.pop()), i = t._targets)
      for (n = i.length; --n >= 0; )
        e.push(t = i[n]), t === A && vA("Cycle detected in dataflow graph.");
}
const pS = {}, rB = 1, FE = 2, rc = 4, hYe = rB | FE, iEA = rB | rc, Cy = rB | FE | rc, nEA = 8, mk = 16, oEA = 32, gEA = 64;
function ku(A, e, t) {
  this.dataflow = A, this.stamp = e ?? -1, this.add = [], this.rem = [], this.mod = [], this.fields = null, this.encode = t || null;
}
function lz(A, e) {
  const t = [];
  return RE(A, e, (i) => t.push(i)), t;
}
function sEA(A, e) {
  const t = {};
  return A.visit(e, (i) => {
    t[ve(i)] = 1;
  }), (i) => t[ve(i)] ? null : i;
}
function qM(A, e) {
  return A ? (t, i) => A(t, i) && e(t, i) : e;
}
ku.prototype = {
  /**
   * Sentinel value indicating pulse propagation should stop.
   */
  StopPropagation: pS,
  /**
   * Boolean flag indicating ADD (added) tuples.
   */
  ADD: rB,
  /**
   * Boolean flag indicating REM (removed) tuples.
   */
  REM: FE,
  /**
   * Boolean flag indicating MOD (modified) tuples.
   */
  MOD: rc,
  /**
   * Boolean flag indicating ADD (added) and REM (removed) tuples.
   */
  ADD_REM: hYe,
  /**
   * Boolean flag indicating ADD (added) and MOD (modified) tuples.
   */
  ADD_MOD: iEA,
  /**
   * Boolean flag indicating ADD, REM and MOD tuples.
   */
  ALL: Cy,
  /**
   * Boolean flag indicating all tuples in a data source
   * except for the ADD, REM and MOD tuples.
   */
  REFLOW: nEA,
  /**
   * Boolean flag indicating a 'pass-through' to a
   * backing data source, ignoring ADD, REM and MOD tuples.
   */
  SOURCE: mk,
  /**
   * Boolean flag indicating that source data should be
   * suppressed when creating a forked pulse.
   */
  NO_SOURCE: oEA,
  /**
   * Boolean flag indicating that field modifications should be
   * suppressed when creating a forked pulse.
   */
  NO_FIELDS: gEA,
  /**
   * Creates a new pulse based on the values of this pulse.
   * The dataflow, time stamp and field modification values are copied over.
   * By default, new empty ADD, REM and MOD arrays are created.
   * @param {number} flags - Integer of boolean flags indicating which (if any)
   *   tuple arrays should be copied to the new pulse. The supported flag values
   *   are ADD, REM and MOD. Array references are copied directly: new array
   *   instances are not created.
   * @return {Pulse} - The forked pulse instance.
   * @see init
   */
  fork(A) {
    return new ku(this.dataflow).init(this, A);
  },
  /**
   * Creates a copy of this pulse with new materialized array
   * instances for the ADD, REM, MOD, and SOURCE arrays.
   * The dataflow, time stamp and field modification values are copied over.
   * @return {Pulse} - The cloned pulse instance.
   * @see init
   */
  clone() {
    const A = this.fork(Cy);
    return A.add = A.add.slice(), A.rem = A.rem.slice(), A.mod = A.mod.slice(), A.source && (A.source = A.source.slice()), A.materialize(Cy | mk);
  },
  /**
   * Returns a pulse that adds all tuples from a backing source. This is
   * useful for cases where operators are added to a dataflow after an
   * upstream data pipeline has already been processed, ensuring that
   * new operators can observe all tuples within a stream.
   * @return {Pulse} - A pulse instance with all source tuples included
   *   in the add array. If the current pulse already has all source
   *   tuples in its add array, it is returned directly. If the current
   *   pulse does not have a backing source, it is returned directly.
   */
  addAll() {
    let A = this;
    return !A.source || A.add === A.rem || !A.rem.length && A.source.length === A.add.length || (A = new ku(this.dataflow).init(this), A.add = A.source, A.rem = []), A;
  },
  /**
   * Initialize this pulse based on the values of another pulse. This method
   * is used internally by {@link fork} to initialize a new forked tuple.
   * The dataflow, time stamp and field modification values are copied over.
   * By default, new empty ADD, REM and MOD arrays are created.
   * @param {Pulse} src - The source pulse to copy from.
   * @param {number} flags - Integer of boolean flags indicating which (if any)
   *   tuple arrays should be copied to the new pulse. The supported flag values
   *   are ADD, REM and MOD. Array references are copied directly: new array
   *   instances are not created. By default, source data arrays are copied
   *   to the new pulse. Use the NO_SOURCE flag to enforce a null source.
   * @return {Pulse} - Returns this Pulse instance.
   */
  init(A, e) {
    const t = this;
    return t.stamp = A.stamp, t.encode = A.encode, A.fields && !(e & gEA) && (t.fields = A.fields), e & rB ? (t.addF = A.addF, t.add = A.add) : (t.addF = null, t.add = []), e & FE ? (t.remF = A.remF, t.rem = A.rem) : (t.remF = null, t.rem = []), e & rc ? (t.modF = A.modF, t.mod = A.mod) : (t.modF = null, t.mod = []), e & oEA ? (t.srcF = null, t.source = null) : (t.srcF = A.srcF, t.source = A.source, A.cleans && (t.cleans = A.cleans)), t;
  },
  /**
   * Schedules a function to run after pulse propagation completes.
   * @param {function} func - The function to run.
   */
  runAfter(A) {
    this.dataflow.runAfter(A);
  },
  /**
   * Indicates if tuples have been added, removed or modified.
   * @param {number} [flags] - The tuple types (ADD, REM or MOD) to query.
   *   Defaults to ALL, returning true if any tuple type has changed.
   * @return {boolean} - Returns true if one or more queried tuple types have
   *   changed, false otherwise.
   */
  changed(A) {
    const e = A || Cy;
    return e & rB && this.add.length || e & FE && this.rem.length || e & rc && this.mod.length;
  },
  /**
   * Forces a "reflow" of tuple values, such that all tuples in the backing
   * source are added to the MOD set, unless already present in the ADD set.
   * @param {boolean} [fork=false] - If true, returns a forked copy of this
   *   pulse, and invokes reflow on that derived pulse.
   * @return {Pulse} - The reflowed pulse instance.
   */
  reflow(A) {
    if (A)
      return this.fork(Cy).reflow();
    const e = this.add.length, t = this.source && this.source.length;
    return t && t !== e && (this.mod = this.source, e && this.filter(rc, sEA(this, rB))), this;
  },
  /**
   * Get/set metadata to pulse requesting garbage collection
   * to reclaim currently unused resources.
   */
  clean(A) {
    return arguments.length ? (this.cleans = !!A, this) : this.cleans;
  },
  /**
   * Marks one or more data field names as modified to assist dependency
   * tracking and incremental processing by transform operators.
   * @param {string|Array<string>} _ - The field(s) to mark as modified.
   * @return {Pulse} - This pulse instance.
   */
  modifies(A) {
    const e = this.fields || (this.fields = {});
    return ZA(A) ? A.forEach((t) => e[t] = !0) : e[A] = !0, this;
  },
  /**
   * Checks if one or more data fields have been modified during this pulse
   * propagation timestamp.
   * @param {string|Array<string>} _ - The field(s) to check for modified.
   * @param {boolean} nomod - If true, will check the modified flag even if
   *   no mod tuples exist. If false (default), mod tuples must be present.
   * @return {boolean} - Returns true if any of the provided fields has been
   *   marked as modified, false otherwise.
   */
  modified(A, e) {
    const t = this.fields;
    return (e || this.mod.length) && t ? arguments.length ? ZA(A) ? A.some((i) => t[i]) : t[A] : !!t : !1;
  },
  /**
   * Adds a filter function to one more tuple sets. Filters are applied to
   * backing tuple arrays, to determine the actual set of tuples considered
   * added, removed or modified. They can be used to delay materialization of
   * a tuple set in order to avoid expensive array copies. In addition, the
   * filter functions can serve as value transformers: unlike standard predicate
   * function (which return boolean values), Pulse filters should return the
   * actual tuple value to process. If a tuple set is already filtered, the
   * new filter function will be appended into a conjuntive ('and') query.
   * @param {number} flags - Flags indicating the tuple set(s) to filter.
   * @param {function(*):object} filter - Filter function that will be applied
   *   to the tuple set array, and should return a data tuple if the value
   *   should be included in the tuple set, and falsy (or null) otherwise.
   * @return {Pulse} - Returns this pulse instance.
   */
  filter(A, e) {
    const t = this;
    return A & rB && (t.addF = qM(t.addF, e)), A & FE && (t.remF = qM(t.remF, e)), A & rc && (t.modF = qM(t.modF, e)), A & mk && (t.srcF = qM(t.srcF, e)), t;
  },
  /**
   * Materialize one or more tuple sets in this pulse. If the tuple set(s) have
   * a registered filter function, it will be applied and the tuple set(s) will
   * be replaced with materialized tuple arrays.
   * @param {number} flags - Flags indicating the tuple set(s) to materialize.
   * @return {Pulse} - Returns this pulse instance.
   */
  materialize(A) {
    A = A || Cy;
    const e = this;
    return A & rB && e.addF && (e.add = lz(e.add, e.addF), e.addF = null), A & FE && e.remF && (e.rem = lz(e.rem, e.remF), e.remF = null), A & rc && e.modF && (e.mod = lz(e.mod, e.modF), e.modF = null), A & mk && e.srcF && (e.source = e.source.filter(e.srcF), e.srcF = null), e;
  },
  /**
   * Visit one or more tuple sets in this pulse.
   * @param {number} flags - Flags indicating the tuple set(s) to visit.
   *   Legal values are ADD, REM, MOD and SOURCE (if a backing data source
   *   has been set).
   * @param {function(object):*} - Visitor function invoked per-tuple.
   * @return {Pulse} - Returns this pulse instance.
   */
  visit(A, e) {
    const t = this, i = e;
    if (A & mk)
      return RE(t.source, t.srcF, i), t;
    A & rB && RE(t.add, t.addF, i), A & FE && RE(t.rem, t.remF, i), A & rc && RE(t.mod, t.modF, i);
    const n = t.source;
    if (A & nEA && n) {
      const o = t.add.length + t.mod.length;
      o === n.length || (o ? RE(n, sEA(t, iEA), i) : RE(n, t.srcF, i));
    }
    return t;
  }
};
function ReA(A, e, t, i) {
  const n = this;
  let o = 0;
  this.dataflow = A, this.stamp = e, this.fields = null, this.encode = i || null, this.pulses = t;
  for (const g of t)
    if (g.stamp === e) {
      if (g.fields) {
        const s = n.fields || (n.fields = {});
        for (const I in g.fields)
          s[I] = 1;
      }
      g.changed(n.ADD) && (o |= n.ADD), g.changed(n.REM) && (o |= n.REM), g.changed(n.MOD) && (o |= n.MOD);
    }
  this.changes = o;
}
Ae(ReA, ku, {
  /**
   * Creates a new pulse based on the values of this pulse.
   * The dataflow, time stamp and field modification values are copied over.
   * @return {Pulse}
   */
  fork(A) {
    const e = new ku(this.dataflow).init(this, A & this.NO_FIELDS);
    return A !== void 0 && (A & e.ADD && this.visit(e.ADD, (t) => e.add.push(t)), A & e.REM && this.visit(e.REM, (t) => e.rem.push(t)), A & e.MOD && this.visit(e.MOD, (t) => e.mod.push(t))), e;
  },
  changed(A) {
    return this.changes & A;
  },
  modified(A) {
    const e = this, t = e.fields;
    return t && e.changes & e.MOD ? ZA(A) ? A.some((i) => t[i]) : t[A] : 0;
  },
  filter() {
    vA("MultiPulse does not support filtering.");
  },
  materialize() {
    vA("MultiPulse does not support materialization.");
  },
  visit(A, e) {
    const t = this, i = t.pulses, n = i.length;
    let o = 0;
    if (A & t.SOURCE)
      for (; o < n; ++o)
        i[o].visit(A, e);
    else
      for (; o < n; ++o)
        i[o].stamp === t.stamp && i[o].visit(A, e);
    return t;
  }
});
async function mYe(A, e, t) {
  const i = this, n = [];
  if (i._pulse)
    return PxA(i);
  if (i._pending && await i._pending, e && await KL(i, e), !i._touched.length)
    return i.debug("Dataflow invoked, but nothing to do."), i;
  const o = ++i._clock;
  i._pulse = new ku(i, o, A), i._touched.forEach((a) => i._enqueue(a, !0)), i._touched = gU(IF);
  let g = 0, s, I, r;
  try {
    for (; i._heap.size() > 0; ) {
      if (s = i._heap.pop(), s.rank !== s.qrank) {
        i._enqueue(s, !0);
        continue;
      }
      I = s.run(i._getPulse(s, A)), I.then ? I = await I : I.async && (n.push(I.async), I = pS), I !== pS && s._targets && s._targets.forEach((a) => i._enqueue(a)), ++g;
    }
  } catch (a) {
    i._heap.clear(), r = a;
  }
  if (i._input = {}, i._pulse = null, i.debug(`Pulse ${o}: ${g} operators`), r && (i._postrun = [], i.error(r)), i._postrun.length) {
    const a = i._postrun.sort((C, B) => B.priority - C.priority);
    i._postrun = [];
    for (let C = 0; C < a.length; ++C)
      await KL(i, a[C].callback);
  }
  return t && await KL(i, t), n.length && Promise.all(n).then((a) => i.runAsync(null, () => {
    a.forEach((C) => {
      try {
        C(i);
      } catch (B) {
        i.error(B);
      }
    });
  })), i;
}
async function pYe(A, e, t) {
  for (; this._running; )
    await this._running;
  const i = () => this._running = null;
  return (this._running = this.evaluate(A, e, t)).then(i, i), this._running;
}
function yYe(A, e, t) {
  return this._pulse ? PxA(this) : (this.evaluate(A, e, t), this);
}
function bYe(A, e, t) {
  if (this._pulse || e)
    this._postrun.push({
      priority: t || 0,
      callback: A
    });
  else
    try {
      A(this);
    } catch (i) {
      this.error(i);
    }
}
function PxA(A) {
  return A.error("Dataflow already running. Use runAsync() to chain invocations."), A;
}
function wYe(A, e) {
  const t = A.stamp < this._clock;
  t && (A.stamp = this._clock), (t || e) && (A.qrank = A.rank, this._heap.push(A));
}
function fYe(A, e) {
  const t = A.source, i = this._clock;
  return t && ZA(t) ? new ReA(this, i, t.map((n) => n.pulse), e) : this._input[A.id] || DYe(this._pulse, t && t.pulse);
}
function DYe(A, e) {
  return e && e.stamp === A.stamp ? e : (A = A.fork(), e && e !== pS && (A.source = e.source), A);
}
const FeA = {
  skip: !1,
  force: !1
};
function GYe(A, e) {
  const t = e || FeA;
  return this._pulse ? this._enqueue(A) : this._touched.add(A), t.skip && A.skip(!0), this;
}
function kYe(A, e, t) {
  const i = t || FeA;
  return (A.set(e) || i.force) && this.touch(A, i), this;
}
function JYe(A, e, t) {
  this.touch(A, t || FeA);
  const i = new ku(this, this._clock + (this._pulse ? 0 : 1)), n = A.pulse && A.pulse.source || [];
  return i.target = A, this._input[A.id] = e.pulse(i, n), this;
}
function NYe(A) {
  let e = [];
  return {
    clear: () => e = [],
    size: () => e.length,
    peek: () => e[0],
    push: (t) => (e.push(t), $xA(e, 0, e.length - 1, A)),
    pop: () => {
      const t = e.pop();
      let i;
      return e.length ? (i = e[0], e[0] = t, YYe(e, 0, A)) : i = t, i;
    }
  };
}
function $xA(A, e, t, i) {
  let n, o;
  const g = A[t];
  for (; t > e; ) {
    if (o = t - 1 >> 1, n = A[o], i(g, n) < 0) {
      A[t] = n, t = o;
      continue;
    }
    break;
  }
  return A[t] = g;
}
function YYe(A, e, t) {
  const i = e, n = A.length, o = A[e];
  let g = (e << 1) + 1, s;
  for (; g < n; )
    s = g + 1, s < n && t(A[g], A[s]) >= 0 && (g = s), A[e] = A[g], e = g, g = (e << 1) + 1;
  return A[e] = o, $xA(A, i, e, t);
}
function rw() {
  this.logger(ceA()), this.logLevel(BeA), this._clock = 0, this._rank = 0, this._locale = GeA();
  try {
    this._loader = oU();
  } catch {
  }
  this._touched = gU(IF), this._input = {}, this._pulse = null, this._heap = NYe((A, e) => A.qrank - e.qrank), this._postrun = [];
}
function pk(A) {
  return function() {
    return this._log[A].apply(this, arguments);
  };
}
rw.prototype = {
  /**
   * The current timestamp of this dataflow. This value reflects the
   * timestamp of the previous dataflow run. The dataflow is initialized
   * with a stamp value of 0. The initial run of the dataflow will have
   * a timestap of 1, and so on. This value will match the
   * {@link Pulse.stamp} property.
   * @return {number} - The current timestamp value.
   */
  stamp() {
    return this._clock;
  },
  /**
   * Gets or sets the loader instance to use for data file loading. A
   * loader object must provide a "load" method for loading files and a
   * "sanitize" method for checking URL/filename validity. Both methods
   * should accept a URI and options hash as arguments, and return a Promise
   * that resolves to the loaded file contents (load) or a hash containing
   * sanitized URI data with the sanitized url assigned to the "href" property
   * (sanitize).
   * @param {object} _ - The loader instance to use.
   * @return {object|Dataflow} - If no arguments are provided, returns
   *   the current loader instance. Otherwise returns this Dataflow instance.
   */
  loader(A) {
    return arguments.length ? (this._loader = A, this) : this._loader;
  },
  /**
   * Gets or sets the locale instance to use for formatting and parsing
   * string values. The locale object should be provided by the
   * vega-format library, and include methods such as format, timeFormat,
   * utcFormat, timeParse, and utcParse.
   * @param {object} _ - The locale instance to use.
   * @return {object|Dataflow} - If no arguments are provided, returns
   *   the current locale instance. Otherwise returns this Dataflow instance.
   */
  locale(A) {
    return arguments.length ? (this._locale = A, this) : this._locale;
  },
  /**
   * Get or set the logger instance used to log messages. If no arguments are
   * provided, returns the current logger instance. Otherwise, sets the logger
   * and return this Dataflow instance. Provided loggers must support the full
   * API of logger objects generated by the vega-util logger method. Note that
   * by default the log level of the new logger will be used; use the logLevel
   * method to adjust the log level as needed.
   */
  logger(A) {
    return arguments.length ? (this._log = A, this) : this._log;
  },
  /**
   * Logs an error message. By default, logged messages are written to console
   * output. The message will only be logged if the current log level is high
   * enough to permit error messages.
   */
  error: pk("error"),
  /**
   * Logs a warning message. By default, logged messages are written to console
   * output. The message will only be logged if the current log level is high
   * enough to permit warning messages.
   */
  warn: pk("warn"),
  /**
   * Logs a information message. By default, logged messages are written to
   * console output. The message will only be logged if the current log level is
   * high enough to permit information messages.
   */
  info: pk("info"),
  /**
   * Logs a debug message. By default, logged messages are written to console
   * output. The message will only be logged if the current log level is high
   * enough to permit debug messages.
   */
  debug: pk("debug"),
  /**
   * Get or set the current log level. If an argument is provided, it
   * will be used as the new log level.
   * @param {number} [level] - Should be one of None, Warn, Info
   * @return {number} - The current log level.
   */
  logLevel: pk("level"),
  /**
   * Empty entry threshold for garbage cleaning. Map data structures will
   * perform cleaning once the number of empty entries exceeds this value.
   */
  cleanThreshold: 1e4,
  // OPERATOR REGISTRATION
  add: iYe,
  connect: nYe,
  rank: uYe,
  rerank: dYe,
  // OPERATOR UPDATES
  pulse: JYe,
  touch: GYe,
  update: kYe,
  changeset: I0,
  // DATA LOADING
  ingest: IYe,
  parse: sYe,
  preload: rYe,
  request: aYe,
  // EVENT HANDLING
  events: gYe,
  on: lYe,
  // PULSE PROPAGATION
  evaluate: mYe,
  run: yYe,
  runAsync: pYe,
  runAfter: bYe,
  _enqueue: wYe,
  _getPulse: fYe
};
function FA(A, e) {
  Ui.call(this, A, null, e);
}
Ae(FA, Ui, {
  /**
   * Overrides {@link Operator.evaluate} for transform operators.
   * Internally, this method calls {@link evaluate} to perform processing.
   * If {@link evaluate} returns a falsy value, the input pulse is returned.
   * This method should NOT be overridden, instead overrride {@link evaluate}.
   * @param {Pulse} pulse - the current dataflow pulse.
   * @return the output pulse for this operator (or StopPropagation)
   */
  run(A) {
    if (A.stamp < this.stamp)
      return A.StopPropagation;
    let e;
    return this.skip() ? this.skip(!1) : e = this.evaluate(A), e = e || A, e.then ? e = e.then((t) => this.pulse = t) : e !== A.StopPropagation && (this.pulse = e), e;
  },
  /**
   * Overrides {@link Operator.evaluate} for transform operators.
   * Marshalls parameter values and then invokes {@link transform}.
   * @param {Pulse} pulse - the current dataflow pulse.
   * @return {Pulse} The output pulse (or StopPropagation). A falsy return
       value (including undefined) will let the input pulse pass through.
  */
  evaluate(A) {
    const e = this.marshall(A.stamp), t = this.transform(e, A);
    return e.clear(), t;
  },
  /**
   * Process incoming pulses.
   * Subclasses should override this method to implement transforms.
   * @param {Parameters} _ - The operator parameter values.
   * @param {Pulse} pulse - The current dataflow pulse.
   * @return {Pulse} The output pulse (or StopPropagation). A falsy return
   *   value (including undefined) will let the input pulse pass through.
   */
  transform() {
  }
});
const hf = {};
function ALA(A) {
  const e = eLA(A);
  return e && e.Definition || null;
}
function eLA(A) {
  return A = A && A.toLowerCase(), Ze(hf, A) ? hf[A] : null;
}
function* tLA(A, e) {
  if (e == null)
    for (let t of A)
      t != null && t !== "" && (t = +t) >= t && (yield t);
  else {
    let t = -1;
    for (let i of A)
      i = e(i, ++t, A), i != null && i !== "" && (i = +i) >= i && (yield i);
  }
}
function MeA(A, e, t) {
  const i = Float64Array.from(tLA(A, t));
  return i.sort(_c), e.map((n) => Y1A(i, n));
}
function xeA(A, e) {
  return MeA(A, [0.25, 0.5, 0.75], e);
}
function LeA(A, e) {
  const t = A.length, i = KDe(A, e), n = xeA(A, e), o = (n[2] - n[0]) / 1.34;
  return 1.06 * (Math.min(i, o) || i || Math.abs(n[0]) || 1) * Math.pow(t, -0.2);
}
function iLA(A) {
  const e = A.maxbins || 20, t = A.base || 10, i = Math.log(t), n = A.divide || [5, 2];
  let o = A.extent[0], g = A.extent[1], s, I, r, a, C, B;
  const l = A.span || g - o || Math.abs(o) || 1;
  if (A.step)
    s = A.step;
  else if (A.steps) {
    for (a = l / e, C = 0, B = A.steps.length; C < B && A.steps[C] < a; ++C)
      ;
    s = A.steps[Math.max(0, C - 1)];
  } else {
    for (I = Math.ceil(Math.log(e) / i), r = A.minstep || 0, s = Math.max(r, Math.pow(t, Math.round(Math.log(l) / i) - I)); Math.ceil(l / s) > e; )
      s *= t;
    for (C = 0, B = n.length; C < B; ++C)
      a = s / n[C], a >= r && l / a <= e && (s = a);
  }
  a = Math.log(s);
  const Q = a >= 0 ? 0 : ~~(-a / i) + 1, E = Math.pow(t, -Q - 1);
  return (A.nice || A.nice === void 0) && (a = Math.floor(o / s + E) * s, o = o < a ? a - s : a, g = Math.ceil(g / s) * s), {
    start: o,
    stop: g === o ? o + s : g,
    step: s
  };
}
var or = Math.random;
function RYe(A) {
  or = A;
}
function nLA(A, e, t, i) {
  if (!A.length)
    return [void 0, void 0];
  const n = Float64Array.from(tLA(A, i)), o = n.length, g = e;
  let s, I, r, a;
  for (r = 0, a = Array(g); r < g; ++r) {
    for (s = 0, I = 0; I < o; ++I)
      s += n[~~(or() * o)];
    a[r] = s / o;
  }
  return a.sort(_c), [hO(a, t / 2), hO(a, 1 - t / 2)];
}
function oLA(A, e, t, i) {
  i = i || ((B) => B);
  const n = A.length, o = new Float64Array(n);
  let g = 0, s = 1, I = i(A[0]), r = I, a = I + e, C;
  for (; s < n; ++s) {
    if (C = i(A[s]), C >= a) {
      for (r = (I + r) / 2; g < s; ++g)
        o[g] = r;
      a = C + e, I = C;
    }
    r = C;
  }
  for (r = (I + r) / 2; g < s; ++g)
    o[g] = r;
  return t ? FYe(o, e + e / 4) : o;
}
function FYe(A, e) {
  const t = A.length;
  let i = 0, n = 1, o, g;
  for (; A[i] === A[n]; )
    ++n;
  for (; n < t; ) {
    for (o = n + 1; A[n] === A[o]; )
      ++o;
    if (A[n] - A[n - 1] < e) {
      for (g = n + (i + o - n - n >> 1); g < n; )
        A[g++] = A[n];
      for (; g > n; )
        A[g--] = A[i];
    }
    i = n, n = o;
  }
  return A;
}
function MYe(A) {
  return function() {
    return A = (1103515245 * A + 12345) % 2147483647, A / 2147483647;
  };
}
function xYe(A, e) {
  e == null && (e = A, A = 0);
  let t, i, n;
  const o = {
    min(g) {
      return arguments.length ? (t = g || 0, n = i - t, o) : t;
    },
    max(g) {
      return arguments.length ? (i = g || 0, n = i - t, o) : i;
    },
    sample() {
      return t + Math.floor(n * or());
    },
    pdf(g) {
      return g === Math.floor(g) && g >= t && g < i ? 1 / n : 0;
    },
    cdf(g) {
      const s = Math.floor(g);
      return s < t ? 0 : s >= i ? 1 : (s - t + 1) / n;
    },
    icdf(g) {
      return g >= 0 && g <= 1 ? t - 1 + Math.floor(g * n) : NaN;
    }
  };
  return o.min(A).max(e);
}
const gLA = Math.sqrt(2 * Math.PI), LYe = Math.SQRT2;
let yk = NaN;
function CU(A, e) {
  A = A || 0, e = e ?? 1;
  let t = 0, i = 0, n, o;
  if (yk === yk)
    t = yk, yk = NaN;
  else {
    do
      t = or() * 2 - 1, i = or() * 2 - 1, n = t * t + i * i;
    while (n === 0 || n > 1);
    o = Math.sqrt(-2 * Math.log(n) / n), t *= o, yk = i * o;
  }
  return A + t * e;
}
function veA(A, e, t) {
  t = t ?? 1;
  const i = (A - (e || 0)) / t;
  return Math.exp(-0.5 * i * i) / (t * gLA);
}
function BU(A, e, t) {
  e = e || 0, t = t ?? 1;
  const i = (A - e) / t, n = Math.abs(i);
  let o;
  if (n > 37)
    o = 0;
  else {
    const g = Math.exp(-n * n / 2);
    let s;
    n < 7.07106781186547 ? (s = 0.0352624965998911 * n + 0.700383064443688, s = s * n + 6.37396220353165, s = s * n + 33.912866078383, s = s * n + 112.079291497871, s = s * n + 221.213596169931, s = s * n + 220.206867912376, o = g * s, s = 0.0883883476483184 * n + 1.75566716318264, s = s * n + 16.064177579207, s = s * n + 86.7807322029461, s = s * n + 296.564248779674, s = s * n + 637.333633378831, s = s * n + 793.826512519948, s = s * n + 440.413735824752, o = o / s) : (s = n + 0.65, s = n + 4 / s, s = n + 3 / s, s = n + 2 / s, s = n + 1 / s, o = g / s / 2.506628274631);
  }
  return i > 0 ? 1 - o : o;
}
function lU(A, e, t) {
  return A < 0 || A > 1 ? NaN : (e || 0) + (t ?? 1) * LYe * vYe(2 * A - 1);
}
function vYe(A) {
  let e = -Math.log((1 - A) * (1 + A)), t;
  return e < 6.25 ? (e -= 3.125, t = -364441206401782e-35, t = -16850591381820166e-35 + t * e, t = 128584807152564e-32 + t * e, t = 11157877678025181e-33 + t * e, t = -1333171662854621e-31 + t * e, t = 20972767875968562e-33 + t * e, t = 6637638134358324e-30 + t * e, t = -4054566272975207e-29 + t * e, t = -8151934197605472e-29 + t * e, t = 26335093153082323e-28 + t * e, t = -12975133253453532e-27 + t * e, t = -5415412054294628e-26 + t * e, t = 10512122733215323e-25 + t * e, t = -4112633980346984e-24 + t * e, t = -29070369957882005e-24 + t * e, t = 42347877827932404e-23 + t * e, t = -13654692000834679e-22 + t * e, t = -13882523362786469e-21 + t * e, t = 18673420803405714e-20 + t * e, t = -740702534166267e-18 + t * e, t = -0.006033670871430149 + t * e, t = 0.24015818242558962 + t * e, t = 1.6536545626831027 + t * e) : e < 16 ? (e = Math.sqrt(e) - 3.25, t = 22137376921775787e-25, t = 9075656193888539e-23 + t * e, t = -27517406297064545e-23 + t * e, t = 18239629214389228e-24 + t * e, t = 15027403968909828e-22 + t * e, t = -4013867526981546e-21 + t * e, t = 29234449089955446e-22 + t * e, t = 12475304481671779e-21 + t * e, t = -47318229009055734e-21 + t * e, t = 6828485145957318e-20 + t * e, t = 24031110387097894e-21 + t * e, t = -3550375203628475e-19 + t * e, t = 9532893797373805e-19 + t * e, t = -0.0016882755560235047 + t * e, t = 0.002491442096107851 + t * e, t = -0.003751208507569241 + t * e, t = 0.005370914553590064 + t * e, t = 1.0052589676941592 + t * e, t = 3.0838856104922208 + t * e) : Number.isFinite(e) ? (e = Math.sqrt(e) - 5, t = -27109920616438573e-27, t = -2555641816996525e-25 + t * e, t = 15076572693500548e-25 + t * e, t = -3789465440126737e-24 + t * e, t = 761570120807834e-23 + t * e, t = -1496002662714924e-23 + t * e, t = 2914795345090108e-23 + t * e, t = -6771199775845234e-23 + t * e, t = 22900482228026655e-23 + t * e, t = -99298272942317e-20 + t * e, t = 4526062597223154e-21 + t * e, t = -1968177810553167e-20 + t * e, t = 7599527703001776e-20 + t * e, t = -21503011930044477e-20 + t * e, t = -13871931833623122e-20 + t * e, t = 1.0103004648645344 + t * e, t = 4.849906401408584 + t * e) : t = 1 / 0, t * A;
}
function HeA(A, e) {
  let t, i;
  const n = {
    mean(o) {
      return arguments.length ? (t = o || 0, n) : t;
    },
    stdev(o) {
      return arguments.length ? (i = o ?? 1, n) : i;
    },
    sample: () => CU(t, i),
    pdf: (o) => veA(o, t, i),
    cdf: (o) => BU(o, t, i),
    icdf: (o) => lU(o, t, i)
  };
  return n.mean(A).stdev(e);
}
function SeA(A, e) {
  const t = HeA();
  let i = 0;
  const n = {
    data(o) {
      return arguments.length ? (A = o, i = o ? o.length : 0, n.bandwidth(e)) : A;
    },
    bandwidth(o) {
      return arguments.length ? (e = o, !e && A && (e = LeA(A)), n) : e;
    },
    sample() {
      return A[~~(or() * i)] + e * t.sample();
    },
    pdf(o) {
      let g = 0, s = 0;
      for (; s < i; ++s)
        g += t.pdf((o - A[s]) / e);
      return g / e / i;
    },
    cdf(o) {
      let g = 0, s = 0;
      for (; s < i; ++s)
        g += t.cdf((o - A[s]) / e);
      return g / i;
    },
    icdf() {
      throw Error("KDE icdf not supported.");
    }
  };
  return n.data(A);
}
function ZeA(A, e) {
  return A = A || 0, e = e ?? 1, Math.exp(A + CU() * e);
}
function WeA(A, e, t) {
  if (A <= 0)
    return 0;
  e = e || 0, t = t ?? 1;
  const i = (Math.log(A) - e) / t;
  return Math.exp(-0.5 * i * i) / (t * gLA * A);
}
function KeA(A, e, t) {
  return BU(Math.log(A), e, t);
}
function UeA(A, e, t) {
  return Math.exp(lU(A, e, t));
}
function sLA(A, e) {
  let t, i;
  const n = {
    mean(o) {
      return arguments.length ? (t = o || 0, n) : t;
    },
    stdev(o) {
      return arguments.length ? (i = o ?? 1, n) : i;
    },
    sample: () => ZeA(t, i),
    pdf: (o) => WeA(o, t, i),
    cdf: (o) => KeA(o, t, i),
    icdf: (o) => UeA(o, t, i)
  };
  return n.mean(A).stdev(e);
}
function ILA(A, e) {
  let t = 0, i;
  function n(g) {
    const s = [];
    let I = 0, r;
    for (r = 0; r < t; ++r)
      I += s[r] = g[r] == null ? 1 : +g[r];
    for (r = 0; r < t; ++r)
      s[r] /= I;
    return s;
  }
  const o = {
    weights(g) {
      return arguments.length ? (i = n(e = g || []), o) : e;
    },
    distributions(g) {
      return arguments.length ? (g ? (t = g.length, A = g) : (t = 0, A = []), o.weights(e)) : A;
    },
    sample() {
      const g = or();
      let s = A[t - 1], I = i[0], r = 0;
      for (; r < t - 1; I += i[++r])
        if (g < I) {
          s = A[r];
          break;
        }
      return s.sample();
    },
    pdf(g) {
      let s = 0, I = 0;
      for (; I < t; ++I)
        s += i[I] * A[I].pdf(g);
      return s;
    },
    cdf(g) {
      let s = 0, I = 0;
      for (; I < t; ++I)
        s += i[I] * A[I].cdf(g);
      return s;
    },
    icdf() {
      throw Error("Mixture icdf not supported.");
    }
  };
  return o.distributions(A).weights(e);
}
function VeA(A, e) {
  return e == null && (e = A ?? 1, A = 0), A + (e - A) * or();
}
function XeA(A, e, t) {
  return t == null && (t = e ?? 1, e = 0), A >= e && A <= t ? 1 / (t - e) : 0;
}
function zeA(A, e, t) {
  return t == null && (t = e ?? 1, e = 0), A < e ? 0 : A > t ? 1 : (A - e) / (t - e);
}
function TeA(A, e, t) {
  return t == null && (t = e ?? 1, e = 0), A >= 0 && A <= 1 ? e + A * (t - e) : NaN;
}
function aLA(A, e) {
  let t, i;
  const n = {
    min(o) {
      return arguments.length ? (t = o || 0, n) : t;
    },
    max(o) {
      return arguments.length ? (i = o ?? 1, n) : i;
    },
    sample: () => VeA(t, i),
    pdf: (o) => XeA(o, t, i),
    cdf: (o) => zeA(o, t, i),
    icdf: (o) => TeA(o, t, i)
  };
  return e == null && (e = A ?? 1, A = 0), n.min(A).max(e);
}
function _eA(A, e, t) {
  let i = 0, n = 0;
  for (const o of A) {
    const g = t(o);
    e(o) == null || g == null || isNaN(g) || (i += (g - i) / ++n);
  }
  return {
    coef: [i],
    predict: () => i,
    rSquared: 0
  };
}
function rF(A, e, t, i) {
  const n = i - A * A, o = Math.abs(n) < 1e-24 ? 0 : (t - A * e) / n;
  return [e - o * A, o];
}
function cU(A, e, t, i) {
  A = A.filter((l) => {
    let Q = e(l), E = t(l);
    return Q != null && (Q = +Q) >= Q && E != null && (E = +E) >= E;
  }), i && A.sort((l, Q) => e(l) - e(Q));
  const n = A.length, o = new Float64Array(n), g = new Float64Array(n);
  let s = 0, I = 0, r = 0, a, C, B;
  for (B of A)
    o[s] = a = +e(B), g[s] = C = +t(B), ++s, I += (a - I) / s, r += (C - r) / s;
  for (s = 0; s < n; ++s)
    o[s] -= I, g[s] -= r;
  return [o, g, I, r];
}
function CF(A, e, t, i) {
  let n = -1, o, g;
  for (const s of A)
    o = e(s), g = t(s), o != null && (o = +o) >= o && g != null && (g = +g) >= g && i(o, g, ++n);
}
function OD(A, e, t, i, n) {
  let o = 0, g = 0;
  return CF(A, e, t, (s, I) => {
    const r = I - n(s), a = I - i;
    o += r * r, g += a * a;
  }), 1 - o / g;
}
function qeA(A, e, t) {
  let i = 0, n = 0, o = 0, g = 0, s = 0;
  CF(A, e, t, (a, C) => {
    ++s, i += (a - i) / s, n += (C - n) / s, o += (a * C - o) / s, g += (a * a - g) / s;
  });
  const I = rF(i, n, o, g), r = (a) => I[0] + I[1] * a;
  return {
    coef: I,
    predict: r,
    rSquared: OD(A, e, t, n, r)
  };
}
function rLA(A, e, t) {
  let i = 0, n = 0, o = 0, g = 0, s = 0;
  CF(A, e, t, (a, C) => {
    ++s, a = Math.log(a), i += (a - i) / s, n += (C - n) / s, o += (a * C - o) / s, g += (a * a - g) / s;
  });
  const I = rF(i, n, o, g), r = (a) => I[0] + I[1] * Math.log(a);
  return {
    coef: I,
    predict: r,
    rSquared: OD(A, e, t, n, r)
  };
}
function CLA(A, e, t) {
  const [i, n, o, g] = cU(A, e, t);
  let s = 0, I = 0, r = 0, a = 0, C = 0, B, l, Q;
  CF(A, e, t, (y, f) => {
    B = i[C++], l = Math.log(f), Q = B * f, s += (f * l - s) / C, I += (Q - I) / C, r += (Q * l - r) / C, a += (B * Q - a) / C;
  });
  const [E, d] = rF(I / g, s / g, r / g, a / g), m = (y) => Math.exp(E + d * (y - o));
  return {
    coef: [Math.exp(E - d * o), d],
    predict: m,
    rSquared: OD(A, e, t, g, m)
  };
}
function BLA(A, e, t) {
  let i = 0, n = 0, o = 0, g = 0, s = 0, I = 0;
  CF(A, e, t, (C, B) => {
    const l = Math.log(C), Q = Math.log(B);
    ++I, i += (l - i) / I, n += (Q - n) / I, o += (l * Q - o) / I, g += (l * l - g) / I, s += (B - s) / I;
  });
  const r = rF(i, n, o, g), a = (C) => r[0] * Math.pow(C, r[1]);
  return r[0] = Math.exp(r[0]), {
    coef: r,
    predict: a,
    rSquared: OD(A, e, t, s, a)
  };
}
function OeA(A, e, t) {
  const [i, n, o, g] = cU(A, e, t), s = i.length;
  let I = 0, r = 0, a = 0, C = 0, B = 0, l, Q, E, d;
  for (l = 0; l < s; )
    Q = i[l], E = n[l++], d = Q * Q, I += (d - I) / l, r += (d * Q - r) / l, a += (d * d - a) / l, C += (Q * E - C) / l, B += (d * E - B) / l;
  const m = a - I * I, y = I * m - r * r, f = (B * I - C * r) / y, w = (C * m - B * r) / y, G = -f * I, R = (F) => (F = F - o, f * F * F + w * F + G + g);
  return {
    coef: [G - w * o + f * o * o + g, w - 2 * f * o, f],
    predict: R,
    rSquared: OD(A, e, t, g, R)
  };
}
function lLA(A, e, t, i) {
  if (i === 0)
    return _eA(A, e, t);
  if (i === 1)
    return qeA(A, e, t);
  if (i === 2)
    return OeA(A, e, t);
  const [n, o, g, s] = cU(A, e, t), I = n.length, r = [], a = [], C = i + 1;
  let B, l, Q, E, d;
  for (B = 0; B < C; ++B) {
    for (Q = 0, E = 0; Q < I; ++Q)
      E += Math.pow(n[Q], B) * o[Q];
    for (r.push(E), d = new Float64Array(C), l = 0; l < C; ++l) {
      for (Q = 0, E = 0; Q < I; ++Q)
        E += Math.pow(n[Q], B + l);
      d[l] = E;
    }
    a.push(d);
  }
  a.push(r);
  const m = SYe(a), y = (f) => {
    f -= g;
    let w = s + m[0] + m[1] * f + m[2] * f * f;
    for (B = 3; B < C; ++B)
      w += m[B] * Math.pow(f, B);
    return w;
  };
  return {
    coef: HYe(C, m, -g, s),
    predict: y,
    rSquared: OD(A, e, t, s, y)
  };
}
function HYe(A, e, t, i) {
  const n = Array(A);
  let o, g, s, I;
  for (o = 0; o < A; ++o)
    n[o] = 0;
  for (o = A - 1; o >= 0; --o)
    for (s = e[o], I = 1, n[o] += s, g = 1; g <= o; ++g)
      I *= (o + 1 - g) / g, n[o - g] += s * Math.pow(t, g) * I;
  return n[0] += i, n;
}
function SYe(A) {
  const e = A.length - 1, t = [];
  let i, n, o, g, s;
  for (i = 0; i < e; ++i) {
    for (g = i, n = i + 1; n < e; ++n)
      Math.abs(A[i][n]) > Math.abs(A[i][g]) && (g = n);
    for (o = i; o < e + 1; ++o)
      s = A[o][i], A[o][i] = A[o][g], A[o][g] = s;
    for (n = i + 1; n < e; ++n)
      for (o = e; o >= i; o--)
        A[o][n] -= A[o][i] * A[i][n] / A[i][i];
  }
  for (n = e - 1; n >= 0; --n) {
    for (s = 0, o = n + 1; o < e; ++o)
      s += A[o][n] * t[o];
    t[n] = (A[e][n] - s) / A[n][n];
  }
  return t;
}
const IEA = 2, aEA = 1e-12;
function cLA(A, e, t, i) {
  const [n, o, g, s] = cU(A, e, t, !0), I = n.length, r = Math.max(2, ~~(i * I)), a = new Float64Array(I), C = new Float64Array(I), B = new Float64Array(I).fill(1);
  for (let l = -1; ++l <= IEA; ) {
    const Q = [0, r - 1];
    for (let d = 0; d < I; ++d) {
      const m = n[d], y = Q[0], f = Q[1], w = m - n[y] > n[f] - m ? y : f;
      let G = 0, R = 0, F = 0, Z = 0, c = 0;
      const J = 1 / Math.abs(n[w] - m || 1);
      for (let v = y; v <= f; ++v) {
        const K = n[v], U = o[v], j = ZYe(Math.abs(m - K) * J) * B[v], q = K * j;
        G += j, R += q, F += U * j, Z += U * q, c += K * q;
      }
      const [p, N] = rF(R / G, F / G, Z / G, c / G);
      a[d] = p + N * m, C[d] = Math.abs(o[d] - a[d]), WYe(n, d + 1, Q);
    }
    if (l === IEA)
      break;
    const E = R1A(C);
    if (Math.abs(E) < aEA)
      break;
    for (let d = 0, m, y; d < I; ++d)
      m = C[d] / (6 * E), B[d] = m >= 1 ? aEA : (y = 1 - m * m) * y;
  }
  return KYe(n, a, g, s);
}
function ZYe(A) {
  return (A = 1 - A * A * A) * A * A;
}
function WYe(A, e, t) {
  const i = A[e];
  let n = t[0], o = t[1] + 1;
  if (!(o >= A.length))
    for (; e > n && A[o] - i <= i - A[n]; )
      t[0] = ++n, t[1] = o, ++o;
}
function KYe(A, e, t, i) {
  const n = A.length, o = [];
  let g = 0, s = 0, I = [], r;
  for (; g < n; ++g)
    r = A[g] + t, I[0] === r ? I[1] += (e[g] - I[1]) / ++s : (s = 0, I[1] += i, I = [r, e[g]], o.push(I));
  return I[1] += i, o;
}
const UYe = 0.5 * Math.PI / 180;
function QU(A, e, t, i) {
  t = t || 25, i = Math.max(t, i || 200);
  const n = (E) => [E, A(E)], o = e[0], g = e[1], s = g - o, I = s / i, r = [n(o)], a = [];
  if (t === i) {
    for (let E = 1; E < i; ++E)
      r.push(n(o + E / t * s));
    return r.push(n(g)), r;
  } else {
    a.push(n(g));
    for (let E = t; --E > 0; )
      a.push(n(o + E / t * s));
  }
  let C = r[0], B = a[a.length - 1];
  const l = 1 / s, Q = VYe(C[1], a);
  for (; B; ) {
    const E = n((C[0] + B[0]) / 2);
    E[0] - C[0] >= I && XYe(C, E, B, l, Q) > UYe ? a.push(E) : (C = B, r.push(B), a.pop()), B = a[a.length - 1];
  }
  return r;
}
function VYe(A, e) {
  let t = A, i = A;
  const n = e.length;
  for (let o = 0; o < n; ++o) {
    const g = e[o][1];
    g < t && (t = g), g > i && (i = g);
  }
  return 1 / (i - t);
}
function XYe(A, e, t, i, n) {
  const o = Math.atan2(n * (t[1] - A[1]), i * (t[0] - A[0])), g = Math.atan2(n * (e[1] - A[1]), i * (e[0] - A[0]));
  return Math.abs(o - g);
}
function zYe(A) {
  return (e) => {
    const t = A.length;
    let i = 1, n = String(A[0](e));
    for (; i < t; ++i)
      n += "|" + A[i](e);
    return n;
  };
}
function XO(A) {
  return !A || !A.length ? function() {
    return "";
  } : A.length === 1 ? A[0] : zYe(A);
}
function QLA(A, e, t) {
  return t || A + (e ? "_" + e : "");
}
const cz = () => {
}, TYe = {
  init: cz,
  add: cz,
  rem: cz,
  idx: 0
}, OY = {
  values: {
    init: (A) => A.cell.store = !0,
    value: (A) => A.cell.data.values(),
    idx: -1
  },
  count: {
    value: (A) => A.cell.num
  },
  __count__: {
    value: (A) => A.missing + A.valid
  },
  missing: {
    value: (A) => A.missing
  },
  valid: {
    value: (A) => A.valid
  },
  sum: {
    init: (A) => A.sum = 0,
    value: (A) => A.sum,
    add: (A, e) => A.sum += +e,
    rem: (A, e) => A.sum -= e
  },
  product: {
    init: (A) => A.product = 1,
    value: (A) => A.valid ? A.product : void 0,
    add: (A, e) => A.product *= e,
    rem: (A, e) => A.product /= e
  },
  mean: {
    init: (A) => A.mean = 0,
    value: (A) => A.valid ? A.mean : void 0,
    add: (A, e) => (A.mean_d = e - A.mean, A.mean += A.mean_d / A.valid),
    rem: (A, e) => (A.mean_d = e - A.mean, A.mean -= A.valid ? A.mean_d / A.valid : A.mean)
  },
  average: {
    value: (A) => A.valid ? A.mean : void 0,
    req: ["mean"],
    idx: 1
  },
  variance: {
    init: (A) => A.dev = 0,
    value: (A) => A.valid > 1 ? A.dev / (A.valid - 1) : void 0,
    add: (A, e) => A.dev += A.mean_d * (e - A.mean),
    rem: (A, e) => A.dev -= A.mean_d * (e - A.mean),
    req: ["mean"],
    idx: 1
  },
  variancep: {
    value: (A) => A.valid > 1 ? A.dev / A.valid : void 0,
    req: ["variance"],
    idx: 2
  },
  stdev: {
    value: (A) => A.valid > 1 ? Math.sqrt(A.dev / (A.valid - 1)) : void 0,
    req: ["variance"],
    idx: 2
  },
  stdevp: {
    value: (A) => A.valid > 1 ? Math.sqrt(A.dev / A.valid) : void 0,
    req: ["variance"],
    idx: 2
  },
  stderr: {
    value: (A) => A.valid > 1 ? Math.sqrt(A.dev / (A.valid * (A.valid - 1))) : void 0,
    req: ["variance"],
    idx: 2
  },
  distinct: {
    value: (A) => A.cell.data.distinct(A.get),
    req: ["values"],
    idx: 3
  },
  ci0: {
    value: (A) => A.cell.data.ci0(A.get),
    req: ["values"],
    idx: 3
  },
  ci1: {
    value: (A) => A.cell.data.ci1(A.get),
    req: ["values"],
    idx: 3
  },
  median: {
    value: (A) => A.cell.data.q2(A.get),
    req: ["values"],
    idx: 3
  },
  q1: {
    value: (A) => A.cell.data.q1(A.get),
    req: ["values"],
    idx: 3
  },
  q3: {
    value: (A) => A.cell.data.q3(A.get),
    req: ["values"],
    idx: 3
  },
  min: {
    init: (A) => A.min = void 0,
    value: (A) => A.min = Number.isNaN(A.min) ? A.cell.data.min(A.get) : A.min,
    add: (A, e) => {
      (e < A.min || A.min === void 0) && (A.min = e);
    },
    rem: (A, e) => {
      e <= A.min && (A.min = NaN);
    },
    req: ["values"],
    idx: 4
  },
  max: {
    init: (A) => A.max = void 0,
    value: (A) => A.max = Number.isNaN(A.max) ? A.cell.data.max(A.get) : A.max,
    add: (A, e) => {
      (e > A.max || A.max === void 0) && (A.max = e);
    },
    rem: (A, e) => {
      e >= A.max && (A.max = NaN);
    },
    req: ["values"],
    idx: 4
  },
  argmin: {
    init: (A) => A.argmin = void 0,
    value: (A) => A.argmin || A.cell.data.argmin(A.get),
    add: (A, e, t) => {
      e < A.min && (A.argmin = t);
    },
    rem: (A, e) => {
      e <= A.min && (A.argmin = void 0);
    },
    req: ["min", "values"],
    idx: 3
  },
  argmax: {
    init: (A) => A.argmax = void 0,
    value: (A) => A.argmax || A.cell.data.argmax(A.get),
    add: (A, e, t) => {
      e > A.max && (A.argmax = t);
    },
    rem: (A, e) => {
      e >= A.max && (A.argmax = void 0);
    },
    req: ["max", "values"],
    idx: 3
  },
  exponential: {
    init: (A, e) => {
      A.exp = 0, A.exp_r = e;
    },
    value: (A) => A.valid ? A.exp * (1 - A.exp_r) / (1 - A.exp_r ** A.valid) : void 0,
    add: (A, e) => A.exp = A.exp_r * A.exp + e,
    rem: (A, e) => A.exp = (A.exp - e / A.exp_r ** (A.valid - 1)) / A.exp_r
  },
  exponentialb: {
    value: (A) => A.valid ? A.exp * (1 - A.exp_r) : void 0,
    req: ["exponential"],
    idx: 1
  }
}, BF = Object.keys(OY).filter((A) => A !== "__count__");
function _Ye(A, e) {
  return (t, i) => pt({
    name: A,
    aggregate_param: i,
    out: t || A
  }, TYe, e);
}
[...BF, "__count__"].forEach((A) => {
  OY[A] = _Ye(A, OY[A]);
});
function ELA(A, e, t) {
  return OY[A](t, e);
}
function uLA(A, e) {
  return A.idx - e.idx;
}
function qYe(A) {
  const e = {};
  A.forEach((i) => e[i.name] = i);
  const t = (i) => {
    i.req && i.req.forEach((n) => {
      e[n] || t(e[n] = OY[n]());
    });
  };
  return A.forEach(t), Object.values(e).sort(uLA);
}
function OYe() {
  this.valid = 0, this.missing = 0, this._ops.forEach((A) => A.aggregate_param == null ? A.init(this) : A.init(this, A.aggregate_param));
}
function jYe(A, e) {
  if (A == null || A === "") {
    ++this.missing;
    return;
  }
  A === A && (++this.valid, this._ops.forEach((t) => t.add(this, A, e)));
}
function PYe(A, e) {
  if (A == null || A === "") {
    --this.missing;
    return;
  }
  A === A && (--this.valid, this._ops.forEach((t) => t.rem(this, A, e)));
}
function $Ye(A) {
  return this._out.forEach((e) => A[e.out] = e.value(this)), A;
}
function dLA(A, e) {
  const t = e || Ng, i = qYe(A), n = A.slice().sort(uLA);
  function o(g) {
    this._ops = i, this._out = n, this.cell = g, this.init();
  }
  return o.prototype.init = OYe, o.prototype.add = jYe, o.prototype.rem = PYe, o.prototype.set = $Ye, o.prototype.get = t, o.fields = A.map((g) => g.out), o;
}
function jeA(A) {
  this._key = A ? tr(A) : ve, this.reset();
}
const ag = jeA.prototype;
ag.reset = function() {
  this._add = [], this._rem = [], this._ext = null, this._get = null, this._q = null;
};
ag.add = function(A) {
  this._add.push(A);
};
ag.rem = function(A) {
  this._rem.push(A);
};
ag.values = function() {
  if (this._get = null, this._rem.length === 0)
    return this._add;
  const A = this._add, e = this._rem, t = this._key, i = A.length, n = e.length, o = Array(i - n), g = {};
  let s, I, r;
  for (s = 0; s < n; ++s)
    g[t(e[s])] = 1;
  for (s = 0, I = 0; s < i; ++s)
    g[t(r = A[s])] ? g[t(r)] = 0 : o[I++] = r;
  return this._rem = [], this._add = o;
};
ag.distinct = function(A) {
  const e = this.values(), t = {};
  let i = e.length, n = 0, o;
  for (; --i >= 0; )
    o = A(e[i]) + "", Ze(t, o) || (t[o] = 1, ++n);
  return n;
};
ag.extent = function(A) {
  if (this._get !== A || !this._ext) {
    const e = this.values(), t = gxA(e, A);
    this._ext = [e[t[0]], e[t[1]]], this._get = A;
  }
  return this._ext;
};
ag.argmin = function(A) {
  return this.extent(A)[0] || {};
};
ag.argmax = function(A) {
  return this.extent(A)[1] || {};
};
ag.min = function(A) {
  const e = this.extent(A)[0];
  return e != null ? A(e) : void 0;
};
ag.max = function(A) {
  const e = this.extent(A)[1];
  return e != null ? A(e) : void 0;
};
ag.quartile = function(A) {
  return (this._get !== A || !this._q) && (this._q = xeA(this.values(), A), this._get = A), this._q;
};
ag.q1 = function(A) {
  return this.quartile(A)[0];
};
ag.q2 = function(A) {
  return this.quartile(A)[1];
};
ag.q3 = function(A) {
  return this.quartile(A)[2];
};
ag.ci = function(A) {
  return (this._get !== A || !this._ci) && (this._ci = nLA(this.values(), 1e3, 0.05, A), this._get = A), this._ci;
};
ag.ci0 = function(A) {
  return this.ci(A)[0];
};
ag.ci1 = function(A) {
  return this.ci(A)[1];
};
function Ou(A) {
  FA.call(this, null, A), this._adds = [], this._mods = [], this._alen = 0, this._mlen = 0, this._drop = !0, this._cross = !1, this._dims = [], this._dnames = [], this._measures = [], this._countOnly = !1, this._counts = null, this._prev = null, this._inputs = null, this._outputs = null;
}
Ou.Definition = {
  type: "Aggregate",
  metadata: {
    generates: !0,
    changes: !0
  },
  params: [{
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "ops",
    type: "enum",
    array: !0,
    values: BF
  }, {
    name: "aggregate_params",
    type: "field",
    null: !0,
    array: !0,
    default: [null]
  }, {
    name: "fields",
    type: "field",
    null: !0,
    array: !0
  }, {
    name: "as",
    type: "string",
    null: !0,
    array: !0
  }, {
    name: "drop",
    type: "boolean",
    default: !0
  }, {
    name: "cross",
    type: "boolean",
    default: !1
  }, {
    name: "key",
    type: "field"
  }]
};
Ae(Ou, FA, {
  transform(A, e) {
    const t = this, i = e.fork(e.NO_SOURCE | e.NO_FIELDS), n = A.modified();
    return t.stamp = i.stamp, t.value && (n || e.modified(t._inputs, !0)) ? (t._prev = t.value, t.value = n ? t.init(A) : /* @__PURE__ */ Object.create(null), e.visit(e.SOURCE, (o) => t.add(o))) : (t.value = t.value || t.init(A), e.visit(e.REM, (o) => t.rem(o)), e.visit(e.ADD, (o) => t.add(o))), i.modifies(t._outputs), t._drop = A.drop !== !1, A.cross && t._dims.length > 1 && (t._drop = !1, t.cross()), e.clean() && t._drop && i.clean(!0).runAfter(() => this.clean()), t.changes(i);
  },
  cross() {
    const A = this, e = A.value, t = A._dnames, i = t.map(() => ({})), n = t.length;
    function o(s) {
      let I, r, a, C;
      for (I in s)
        for (a = s[I].tuple, r = 0; r < n; ++r)
          i[r][C = a[t[r]]] = C;
    }
    o(A._prev), o(e);
    function g(s, I, r) {
      const a = t[r], C = i[r++];
      for (const B in C) {
        const l = s ? s + "|" + B : B;
        I[a] = C[B], r < n ? g(l, I, r) : e[l] || A.cell(l, I);
      }
    }
    g("", {}, 0);
  },
  init(A) {
    const e = this._inputs = [], t = this._outputs = [], i = {};
    function n(y) {
      const f = Ce(fg(y)), w = f.length;
      let G = 0, R;
      for (; G < w; ++G)
        i[R = f[G]] || (i[R] = 1, e.push(R));
    }
    this._dims = Ce(A.groupby), this._dnames = this._dims.map((y) => {
      const f = Sn(y);
      return n(y), t.push(f), f;
    }), this.cellkey = A.key ? A.key : XO(this._dims), this._countOnly = !0, this._counts = [], this._measures = [];
    const o = A.fields || [null], g = A.ops || ["count"], s = A.aggregate_params || [null], I = A.as || [], r = o.length, a = {};
    let C, B, l, Q, E, d, m;
    for (r !== g.length && vA("Unmatched number of fields and aggregate ops."), m = 0; m < r; ++m) {
      if (C = o[m], B = g[m], l = s[m] || null, C == null && B !== "count" && vA("Null aggregate field specified."), E = Sn(C), d = QLA(B, E, I[m]), t.push(d), B === "count") {
        this._counts.push(d);
        continue;
      }
      Q = a[E], Q || (n(C), Q = a[E] = [], Q.field = C, this._measures.push(Q)), B !== "count" && (this._countOnly = !1), Q.push(ELA(B, l, d));
    }
    return this._measures = this._measures.map((y) => dLA(y, y.field)), /* @__PURE__ */ Object.create(null);
  },
  // -- Cell Management -----
  cellkey: XO(),
  cell(A, e) {
    let t = this.value[A];
    return t ? t.num === 0 && this._drop && t.stamp < this.stamp ? (t.stamp = this.stamp, this._adds[this._alen++] = t) : t.stamp < this.stamp && (t.stamp = this.stamp, this._mods[this._mlen++] = t) : (t = this.value[A] = this.newcell(A, e), this._adds[this._alen++] = t), t;
  },
  newcell(A, e) {
    const t = {
      key: A,
      num: 0,
      agg: null,
      tuple: this.newtuple(e, this._prev && this._prev[A]),
      stamp: this.stamp,
      store: !1
    };
    if (!this._countOnly) {
      const i = this._measures, n = i.length;
      t.agg = Array(n);
      for (let o = 0; o < n; ++o)
        t.agg[o] = new i[o](t);
    }
    return t.store && (t.data = new jeA()), t;
  },
  newtuple(A, e) {
    const t = this._dnames, i = this._dims, n = i.length, o = {};
    for (let g = 0; g < n; ++g)
      o[t[g]] = i[g](A);
    return e ? OxA(e.tuple, o) : Qi(o);
  },
  clean() {
    const A = this.value;
    for (const e in A)
      A[e].num === 0 && delete A[e];
  },
  // -- Process Tuples -----
  add(A) {
    const e = this.cellkey(A), t = this.cell(e, A);
    if (t.num += 1, this._countOnly)
      return;
    t.store && t.data.add(A);
    const i = t.agg;
    for (let n = 0, o = i.length; n < o; ++n)
      i[n].add(i[n].get(A), A);
  },
  rem(A) {
    const e = this.cellkey(A), t = this.cell(e, A);
    if (t.num -= 1, this._countOnly)
      return;
    t.store && t.data.rem(A);
    const i = t.agg;
    for (let n = 0, o = i.length; n < o; ++n)
      i[n].rem(i[n].get(A), A);
  },
  celltuple(A) {
    const e = A.tuple, t = this._counts;
    A.store && A.data.values();
    for (let i = 0, n = t.length; i < n; ++i)
      e[t[i]] = A.num;
    if (!this._countOnly) {
      const i = A.agg;
      for (let n = 0, o = i.length; n < o; ++n)
        i[n].set(e);
    }
    return e;
  },
  changes(A) {
    const e = this._adds, t = this._mods, i = this._prev, n = this._drop, o = A.add, g = A.rem, s = A.mod;
    let I, r, a, C;
    if (i)
      for (r in i)
        I = i[r], (!n || I.num) && g.push(I.tuple);
    for (a = 0, C = this._alen; a < C; ++a)
      o.push(this.celltuple(e[a])), e[a] = null;
    for (a = 0, C = this._mlen; a < C; ++a)
      I = t[a], (I.num === 0 && n ? g : s).push(this.celltuple(I)), t[a] = null;
    return this._alen = this._mlen = 0, this._prev = null, A;
  }
});
const A2e = 1e-14;
function PeA(A) {
  FA.call(this, null, A);
}
PeA.Definition = {
  type: "Bin",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field",
    required: !0
  }, {
    name: "interval",
    type: "boolean",
    default: !0
  }, {
    name: "anchor",
    type: "number"
  }, {
    name: "maxbins",
    type: "number",
    default: 20
  }, {
    name: "base",
    type: "number",
    default: 10
  }, {
    name: "divide",
    type: "number",
    array: !0,
    default: [5, 2]
  }, {
    name: "extent",
    type: "number",
    array: !0,
    length: 2,
    required: !0
  }, {
    name: "span",
    type: "number"
  }, {
    name: "step",
    type: "number"
  }, {
    name: "steps",
    type: "number",
    array: !0
  }, {
    name: "minstep",
    type: "number",
    default: 0
  }, {
    name: "nice",
    type: "boolean",
    default: !0
  }, {
    name: "name",
    type: "string"
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: 2,
    default: ["bin0", "bin1"]
  }]
};
Ae(PeA, FA, {
  transform(A, e) {
    const t = A.interval !== !1, i = this._bins(A), n = i.start, o = i.step, g = A.as || ["bin0", "bin1"], s = g[0], I = g[1];
    let r;
    return A.modified() ? (e = e.reflow(!0), r = e.SOURCE) : r = e.modified(fg(A.field)) ? e.ADD_MOD : e.ADD, e.visit(r, t ? (a) => {
      const C = i(a);
      a[s] = C, a[I] = C == null ? null : n + o * (1 + (C - n) / o);
    } : (a) => a[s] = i(a)), e.modifies(t ? g : s);
  },
  _bins(A) {
    if (this.value && !A.modified())
      return this.value;
    const e = A.field, t = iLA(A), i = t.step;
    let n = t.start, o = n + Math.ceil((t.stop - n) / i) * i, g, s;
    (g = A.anchor) != null && (s = g - (n + i * Math.floor((g - n) / i)), n += s, o += s);
    const I = function(r) {
      let a = yg(e(r));
      return a == null ? null : a < n ? -1 / 0 : a > o ? 1 / 0 : (a = Math.max(n, Math.min(a, o - i)), n + i * Math.floor(A2e + (a - n) / i));
    };
    return I.start = n, I.stop = t.stop, I.step = i, this.value = oI(I, fg(e), A.name || "bin_" + Sn(e));
  }
});
function hLA(A, e, t) {
  const i = A;
  let n = e || [], o = t || [], g = {}, s = 0;
  return {
    add: (I) => o.push(I),
    remove: (I) => g[i(I)] = ++s,
    size: () => n.length,
    data: (I, r) => (s && (n = n.filter((a) => !g[i(a)]), g = {}, s = 0), r && I && n.sort(I), o.length && (n = I ? BxA(I, n, o.sort(I)) : n.concat(o), o = []), n)
  };
}
function $eA(A) {
  FA.call(this, [], A);
}
$eA.Definition = {
  type: "Collect",
  metadata: {
    source: !0
  },
  params: [{
    name: "sort",
    type: "compare"
  }]
};
Ae($eA, FA, {
  transform(A, e) {
    const t = e.fork(e.ALL), i = hLA(ve, this.value, t.materialize(t.ADD).add), n = A.sort, o = e.changed() || n && (A.modified("sort") || e.modified(n.fields));
    return t.visit(t.REM, i.remove), this.modified(o), this.value = t.source = i.data(s0(n), o), e.source && e.source.root && (this.value.root = e.source.root), t;
  }
});
function mLA(A) {
  Ui.call(this, null, e2e, A);
}
Ae(mLA, Ui);
function e2e(A) {
  return this.value && !A.modified() ? this.value : deA(A.fields, A.orders);
}
function AtA(A) {
  FA.call(this, null, A);
}
AtA.Definition = {
  type: "CountPattern",
  metadata: {
    generates: !0,
    changes: !0
  },
  params: [{
    name: "field",
    type: "field",
    required: !0
  }, {
    name: "case",
    type: "enum",
    values: ["upper", "lower", "mixed"],
    default: "mixed"
  }, {
    name: "pattern",
    type: "string",
    default: '[\\w"]+'
  }, {
    name: "stopwords",
    type: "string",
    default: ""
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: 2,
    default: ["text", "count"]
  }]
};
function t2e(A, e, t) {
  switch (e) {
    case "upper":
      A = A.toUpperCase();
      break;
    case "lower":
      A = A.toLowerCase();
      break;
  }
  return A.match(t);
}
Ae(AtA, FA, {
  transform(A, e) {
    const t = (C) => (B) => {
      for (var l = t2e(s(B), A.case, o) || [], Q, E = 0, d = l.length; E < d; ++E)
        g.test(Q = l[E]) || C(Q);
    }, i = this._parameterCheck(A, e), n = this._counts, o = this._match, g = this._stop, s = A.field, I = A.as || ["text", "count"], r = t((C) => n[C] = 1 + (n[C] || 0)), a = t((C) => n[C] -= 1);
    return i ? e.visit(e.SOURCE, r) : (e.visit(e.ADD, r), e.visit(e.REM, a)), this._finish(e, I);
  },
  _parameterCheck(A, e) {
    let t = !1;
    return (A.modified("stopwords") || !this._stop) && (this._stop = new RegExp("^" + (A.stopwords || "") + "$", "i"), t = !0), (A.modified("pattern") || !this._match) && (this._match = new RegExp(A.pattern || "[\\w']+", "g"), t = !0), (A.modified("field") || e.modified(A.field.fields)) && (t = !0), t && (this._counts = {}), t;
  },
  _finish(A, e) {
    const t = this._counts, i = this._tuples || (this._tuples = {}), n = e[0], o = e[1], g = A.fork(A.NO_SOURCE | A.NO_FIELDS);
    let s, I, r;
    for (s in t)
      I = i[s], r = t[s] || 0, !I && r ? (i[s] = I = Qi({}), I[n] = s, I[o] = r, g.add.push(I)) : r === 0 ? (I && g.rem.push(I), t[s] = null, i[s] = null) : I[o] !== r && (I[o] = r, g.mod.push(I));
    return g.modifies(e);
  }
});
function etA(A) {
  FA.call(this, null, A);
}
etA.Definition = {
  type: "Cross",
  metadata: {
    generates: !0
  },
  params: [{
    name: "filter",
    type: "expr"
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: 2,
    default: ["a", "b"]
  }]
};
Ae(etA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE), i = A.as || ["a", "b"], n = i[0], o = i[1], g = !this.value || e.changed(e.ADD_REM) || A.modified("as") || A.modified("filter");
    let s = this.value;
    return g ? (s && (t.rem = s), s = e.materialize(e.SOURCE).source, t.add = this.value = i2e(s, n, o, A.filter || ir)) : t.mod = s, t.source = this.value, t.modifies(i);
  }
});
function i2e(A, e, t, i) {
  for (var n = [], o = {}, g = A.length, s = 0, I, r; s < g; ++s)
    for (o[e] = r = A[s], I = 0; I < g; ++I)
      o[t] = A[I], i(o) && (n.push(Qi(o)), o = {}, o[e] = r);
  return n;
}
const rEA = {
  kde: SeA,
  mixture: ILA,
  normal: HeA,
  lognormal: sLA,
  uniform: aLA
}, n2e = "distributions", CEA = "function", o2e = "field";
function pLA(A, e) {
  const t = A[CEA];
  Ze(rEA, t) || vA("Unknown distribution function: " + t);
  const i = rEA[t]();
  for (const n in A)
    n === o2e ? i.data((A.from || e()).map(A[n])) : n === n2e ? i[n](A[n].map((o) => pLA(o, e))) : typeof i[n] === CEA && i[n](A[n]);
  return i;
}
function ttA(A) {
  FA.call(this, null, A);
}
const yLA = [{
  key: {
    function: "normal"
  },
  params: [{
    name: "mean",
    type: "number",
    default: 0
  }, {
    name: "stdev",
    type: "number",
    default: 1
  }]
}, {
  key: {
    function: "lognormal"
  },
  params: [{
    name: "mean",
    type: "number",
    default: 0
  }, {
    name: "stdev",
    type: "number",
    default: 1
  }]
}, {
  key: {
    function: "uniform"
  },
  params: [{
    name: "min",
    type: "number",
    default: 0
  }, {
    name: "max",
    type: "number",
    default: 1
  }]
}, {
  key: {
    function: "kde"
  },
  params: [{
    name: "field",
    type: "field",
    required: !0
  }, {
    name: "from",
    type: "data"
  }, {
    name: "bandwidth",
    type: "number",
    default: 0
  }]
}], g2e = {
  key: {
    function: "mixture"
  },
  params: [{
    name: "distributions",
    type: "param",
    array: !0,
    params: yLA
  }, {
    name: "weights",
    type: "number",
    array: !0
  }]
};
ttA.Definition = {
  type: "Density",
  metadata: {
    generates: !0
  },
  params: [{
    name: "extent",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "steps",
    type: "number"
  }, {
    name: "minsteps",
    type: "number",
    default: 25
  }, {
    name: "maxsteps",
    type: "number",
    default: 200
  }, {
    name: "method",
    type: "string",
    default: "pdf",
    values: ["pdf", "cdf"]
  }, {
    name: "distribution",
    type: "param",
    params: yLA.concat(g2e)
  }, {
    name: "as",
    type: "string",
    array: !0,
    default: ["value", "density"]
  }]
};
Ae(ttA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE | e.NO_FIELDS);
    if (!this.value || e.changed() || A.modified()) {
      const i = pLA(A.distribution, s2e(e)), n = A.steps || A.minsteps || 25, o = A.steps || A.maxsteps || 200;
      let g = A.method || "pdf";
      g !== "pdf" && g !== "cdf" && vA("Invalid density method: " + g), !A.extent && !i.data && vA("Missing density extent parameter."), g = i[g];
      const s = A.as || ["value", "density"], I = A.extent || sl(i.data()), r = QU(g, I, n, o).map((a) => {
        const C = {};
        return C[s[0]] = a[0], C[s[1]] = a[1], Qi(C);
      });
      this.value && (t.rem = this.value), this.value = t.add = t.source = r;
    }
    return t;
  }
});
function s2e(A) {
  return () => A.materialize(A.SOURCE).source;
}
function bLA(A, e) {
  return A ? A.map((t, i) => e[i] || Sn(t)) : null;
}
function itA(A, e, t) {
  const i = [], n = (C) => C(I);
  let o, g, s, I, r, a;
  if (e == null)
    i.push(A.map(t));
  else
    for (o = {}, g = 0, s = A.length; g < s; ++g)
      I = A[g], r = e.map(n), a = o[r], a || (o[r] = a = [], a.dims = r, i.push(a)), a.push(t(I));
  return i;
}
const wLA = "bin";
function ntA(A) {
  FA.call(this, null, A);
}
ntA.Definition = {
  type: "DotBin",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field",
    required: !0
  }, {
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "step",
    type: "number"
  }, {
    name: "smooth",
    type: "boolean",
    default: !1
  }, {
    name: "as",
    type: "string",
    default: wLA
  }]
};
const I2e = (A, e) => aF(sl(A, e)) / 30;
Ae(ntA, FA, {
  transform(A, e) {
    if (this.value && !(A.modified() || e.changed()))
      return e;
    const t = e.materialize(e.SOURCE).source, i = itA(e.source, A.groupby, Ng), n = A.smooth || !1, o = A.field, g = A.step || I2e(t, o), s = s0((Q, E) => o(Q) - o(E)), I = A.as || wLA, r = i.length;
    let a = 1 / 0, C = -1 / 0, B = 0, l;
    for (; B < r; ++B) {
      const Q = i[B].sort(s);
      l = -1;
      for (const E of oLA(Q, g, n, o))
        E < a && (a = E), E > C && (C = E), Q[++l][I] = E;
    }
    return this.value = {
      start: a,
      stop: C,
      step: g
    }, e.reflow(!0).modifies(I);
  }
});
function fLA(A) {
  Ui.call(this, null, a2e, A), this.modified(!0);
}
Ae(fLA, Ui);
function a2e(A) {
  const e = A.expr;
  return this.value && !A.modified("expr") ? this.value : oI((t) => e(t, A), fg(e), Sn(e));
}
function otA(A) {
  FA.call(this, [void 0, void 0], A);
}
otA.Definition = {
  type: "Extent",
  metadata: {},
  params: [{
    name: "field",
    type: "field",
    required: !0
  }]
};
Ae(otA, FA, {
  transform(A, e) {
    const t = this.value, i = A.field, n = e.changed() || e.modified(i.fields) || A.modified("field");
    let o = t[0], g = t[1];
    if ((n || o == null) && (o = 1 / 0, g = -1 / 0), e.visit(n ? e.SOURCE : e.ADD, (s) => {
      const I = yg(i(s));
      I != null && (I < o && (o = I), I > g && (g = I));
    }), !Number.isFinite(o) || !Number.isFinite(g)) {
      let s = Sn(i);
      s && (s = ` for field "${s}"`), e.dataflow.warn(`Infinite extent${s}: [${o}, ${g}]`), o = g = void 0;
    }
    this.value = [o, g];
  }
});
function gtA(A, e) {
  Ui.call(this, A), this.parent = e, this.count = 0;
}
Ae(gtA, Ui, {
  /**
   * Routes pulses from this subflow to a target transform.
   * @param {Transform} target - A transform that receives the subflow of tuples.
   */
  connect(A) {
    return this.detachSubflow = A.detachSubflow, this.targets().add(A), A.source = this;
  },
  /**
   * Add an 'add' tuple to the subflow pulse.
   * @param {Tuple} t - The tuple being added.
   */
  add(A) {
    this.count += 1, this.value.add.push(A);
  },
  /**
   * Add a 'rem' tuple to the subflow pulse.
   * @param {Tuple} t - The tuple being removed.
   */
  rem(A) {
    this.count -= 1, this.value.rem.push(A);
  },
  /**
   * Add a 'mod' tuple to the subflow pulse.
   * @param {Tuple} t - The tuple being modified.
   */
  mod(A) {
    this.value.mod.push(A);
  },
  /**
   * Re-initialize this operator's pulse value.
   * @param {Pulse} pulse - The pulse to copy from.
   * @see Pulse.init
   */
  init(A) {
    this.value.init(A, A.NO_SOURCE);
  },
  /**
   * Evaluate this operator. This method overrides the
   * default behavior to simply return the contained pulse value.
   * @return {Pulse}
   */
  evaluate() {
    return this.value;
  }
});
function EU(A) {
  FA.call(this, {}, A), this._keys = TD();
  const e = this._targets = [];
  e.active = 0, e.forEach = (t) => {
    for (let i = 0, n = e.active; i < n; ++i)
      t(e[i], i, e);
  };
}
Ae(EU, FA, {
  activate(A) {
    this._targets[this._targets.active++] = A;
  },
  // parent argument provided by PreFacet subclass
  subflow(A, e, t, i) {
    const n = this.value;
    let o = Ze(n, A) && n[A], g, s;
    return o ? o.value.stamp < t.stamp && (o.init(t), this.activate(o)) : (s = i || (s = this._group[A]) && s.tuple, g = t.dataflow, o = new gtA(t.fork(t.NO_SOURCE), this), g.add(o).connect(e(g, A, s)), n[A] = o, this.activate(o)), o;
  },
  clean() {
    const A = this.value;
    let e = 0;
    for (const t in A)
      if (A[t].count === 0) {
        const i = A[t].detachSubflow;
        i && i(), delete A[t], ++e;
      }
    if (e) {
      const t = this._targets.filter((i) => i && i.count > 0);
      this.initTargets(t);
    }
  },
  initTargets(A) {
    const e = this._targets, t = e.length, i = A ? A.length : 0;
    let n = 0;
    for (; n < i; ++n)
      e[n] = A[n];
    for (; n < t && e[n] != null; ++n)
      e[n] = null;
    e.active = i;
  },
  transform(A, e) {
    const t = e.dataflow, i = A.key, n = A.subflow, o = this._keys, g = A.modified("key"), s = (I) => this.subflow(I, n, e);
    return this._group = A.group || {}, this.initTargets(), e.visit(e.REM, (I) => {
      const r = ve(I), a = o.get(r);
      a !== void 0 && (o.delete(r), s(a).rem(I));
    }), e.visit(e.ADD, (I) => {
      const r = i(I);
      o.set(ve(I), r), s(r).add(I);
    }), g || e.modified(i.fields) ? e.visit(e.MOD, (I) => {
      const r = ve(I), a = o.get(r), C = i(I);
      a === C ? s(C).mod(I) : (o.set(r, C), s(a).rem(I), s(C).add(I));
    }) : e.changed(e.MOD) && e.visit(e.MOD, (I) => {
      s(o.get(ve(I))).mod(I);
    }), g && e.visit(e.REFLOW, (I) => {
      const r = ve(I), a = o.get(r), C = i(I);
      a !== C && (o.set(r, C), s(a).rem(I), s(C).add(I));
    }), e.clean() ? t.runAfter(() => {
      this.clean(), o.clean();
    }) : o.empty > t.cleanThreshold && t.runAfter(o.clean), e;
  }
});
function DLA(A) {
  Ui.call(this, null, r2e, A);
}
Ae(DLA, Ui);
function r2e(A) {
  return this.value && !A.modified() ? this.value : ZA(A.name) ? Ce(A.name).map((e) => tr(e)) : tr(A.name, A.as);
}
function stA(A) {
  FA.call(this, TD(), A);
}
stA.Definition = {
  type: "Filter",
  metadata: {
    changes: !0
  },
  params: [{
    name: "expr",
    type: "expr",
    required: !0
  }]
};
Ae(stA, FA, {
  transform(A, e) {
    const t = e.dataflow, i = this.value, n = e.fork(), o = n.add, g = n.rem, s = n.mod, I = A.expr;
    let r = !0;
    e.visit(e.REM, (C) => {
      const B = ve(C);
      i.has(B) ? i.delete(B) : g.push(C);
    }), e.visit(e.ADD, (C) => {
      I(C, A) ? o.push(C) : i.set(ve(C), 1);
    });
    function a(C) {
      const B = ve(C), l = I(C, A), Q = i.get(B);
      l && Q ? (i.delete(B), o.push(C)) : !l && !Q ? (i.set(B, 1), g.push(C)) : r && l && !Q && s.push(C);
    }
    return e.visit(e.MOD, a), A.modified() && (r = !1, e.visit(e.REFLOW, a)), i.empty > t.cleanThreshold && t.runAfter(i.clean), n;
  }
});
function ItA(A) {
  FA.call(this, [], A);
}
ItA.Definition = {
  type: "Flatten",
  metadata: {
    generates: !0
  },
  params: [{
    name: "fields",
    type: "field",
    array: !0,
    required: !0
  }, {
    name: "index",
    type: "string"
  }, {
    name: "as",
    type: "string",
    array: !0
  }]
};
Ae(ItA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE), i = A.fields, n = bLA(i, A.as || []), o = A.index || null, g = n.length;
    return t.rem = this.value, e.visit(e.SOURCE, (s) => {
      const I = i.map((Q) => Q(s)), r = I.reduce((Q, E) => Math.max(Q, E.length), 0);
      let a = 0, C, B, l;
      for (; a < r; ++a) {
        for (B = YeA(s), C = 0; C < g; ++C)
          B[n[C]] = (l = I[C][a]) == null ? null : l;
        o && (B[o] = a), t.add.push(B);
      }
    }), this.value = t.source = t.add, o && t.modifies(o), t.modifies(n);
  }
});
function atA(A) {
  FA.call(this, [], A);
}
atA.Definition = {
  type: "Fold",
  metadata: {
    generates: !0
  },
  params: [{
    name: "fields",
    type: "field",
    array: !0,
    required: !0
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: 2,
    default: ["key", "value"]
  }]
};
Ae(atA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE), i = A.fields, n = i.map(Sn), o = A.as || ["key", "value"], g = o[0], s = o[1], I = i.length;
    return t.rem = this.value, e.visit(e.SOURCE, (r) => {
      for (let a = 0, C; a < I; ++a)
        C = YeA(r), C[g] = n[a], C[s] = i[a](r), t.add.push(C);
    }), this.value = t.source = t.add, t.modifies(o);
  }
});
function rtA(A) {
  FA.call(this, null, A);
}
rtA.Definition = {
  type: "Formula",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "expr",
    type: "expr",
    required: !0
  }, {
    name: "as",
    type: "string",
    required: !0
  }, {
    name: "initonly",
    type: "boolean"
  }]
};
Ae(rtA, FA, {
  transform(A, e) {
    const t = A.expr, i = A.as, n = A.modified(), o = A.initonly ? e.ADD : n ? e.SOURCE : e.modified(t.fields) || e.modified(i) ? e.ADD_MOD : e.ADD;
    return n && (e = e.materialize().reflow(!0)), A.initonly || e.modifies(i), e.visit(o, (g) => g[i] = t(g, A));
  }
});
function GLA(A) {
  FA.call(this, [], A);
}
Ae(GLA, FA, {
  transform(A, e) {
    const t = e.fork(e.ALL), i = A.generator;
    let n = this.value, o = A.size - n.length, g, s, I;
    if (o > 0) {
      for (g = []; --o >= 0; )
        g.push(I = Qi(i(A))), n.push(I);
      t.add = t.add.length ? t.materialize(t.ADD).add.concat(g) : g;
    } else
      s = n.slice(0, -o), t.rem = t.rem.length ? t.materialize(t.REM).rem.concat(s) : s, n = n.slice(-o);
    return t.source = this.value = n, t;
  }
});
const OM = {
  value: "value",
  median: R1A,
  mean: _De,
  min: dO,
  max: Rm
}, C2e = [];
function CtA(A) {
  FA.call(this, [], A);
}
CtA.Definition = {
  type: "Impute",
  metadata: {
    changes: !0
  },
  params: [{
    name: "field",
    type: "field",
    required: !0
  }, {
    name: "key",
    type: "field",
    required: !0
  }, {
    name: "keyvals",
    array: !0
  }, {
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "method",
    type: "enum",
    default: "value",
    values: ["value", "mean", "median", "max", "min"]
  }, {
    name: "value",
    default: 0
  }]
};
function B2e(A) {
  var e = A.method || OM.value, t;
  if (OM[e] == null)
    vA("Unrecognized imputation method: " + e);
  else
    return e === OM.value ? (t = A.value !== void 0 ? A.value : 0, () => t) : OM[e];
}
function l2e(A) {
  const e = A.field;
  return (t) => t ? e(t) : NaN;
}
Ae(CtA, FA, {
  transform(A, e) {
    var t = e.fork(e.ALL), i = B2e(A), n = l2e(A), o = Sn(A.field), g = Sn(A.key), s = (A.groupby || []).map(Sn), I = c2e(e.source, A.groupby, A.key, A.keyvals), r = [], a = this.value, C = I.domain.length, B, l, Q, E, d, m, y, f, w, G;
    for (d = 0, f = I.length; d < f; ++d)
      for (B = I[d], Q = B.values, l = NaN, y = 0; y < C; ++y)
        if (B[y] == null) {
          for (E = I.domain[y], G = {
            _impute: !0
          }, m = 0, w = Q.length; m < w; ++m)
            G[s[m]] = Q[m];
          G[g] = E, G[o] = Number.isNaN(l) ? l = i(B, n) : l, r.push(Qi(G));
        }
    return r.length && (t.add = t.materialize(t.ADD).add.concat(r)), a.length && (t.rem = t.materialize(t.REM).rem.concat(a)), this.value = r, t;
  }
});
function c2e(A, e, t, i) {
  var n = (m) => m(d), o = [], g = i ? i.slice() : [], s = {}, I = {}, r, a, C, B, l, Q, E, d;
  for (g.forEach((m, y) => s[m] = y + 1), B = 0, E = A.length; B < E; ++B)
    d = A[B], Q = t(d), l = s[Q] || (s[Q] = g.push(Q)), a = (r = e ? e.map(n) : C2e) + "", (C = I[a]) || (C = I[a] = [], o.push(C), C.values = r), C[l - 1] = d;
  return o.domain = g, o;
}
function BtA(A) {
  Ou.call(this, A);
}
BtA.Definition = {
  type: "JoinAggregate",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "fields",
    type: "field",
    null: !0,
    array: !0
  }, {
    name: "ops",
    type: "enum",
    array: !0,
    values: BF
  }, {
    name: "as",
    type: "string",
    null: !0,
    array: !0
  }, {
    name: "key",
    type: "field"
  }]
};
Ae(BtA, Ou, {
  transform(A, e) {
    const t = this, i = A.modified();
    let n;
    return t.value && (i || e.modified(t._inputs, !0)) ? (n = t.value = i ? t.init(A) : {}, e.visit(e.SOURCE, (o) => t.add(o))) : (n = t.value = t.value || this.init(A), e.visit(e.REM, (o) => t.rem(o)), e.visit(e.ADD, (o) => t.add(o))), t.changes(), e.visit(e.SOURCE, (o) => {
      pt(o, n[t.cellkey(o)].tuple);
    }), e.reflow(i).modifies(this._outputs);
  },
  changes() {
    const A = this._adds, e = this._mods;
    let t, i;
    for (t = 0, i = this._alen; t < i; ++t)
      this.celltuple(A[t]), A[t] = null;
    for (t = 0, i = this._mlen; t < i; ++t)
      this.celltuple(e[t]), e[t] = null;
    this._alen = this._mlen = 0;
  }
});
function ltA(A) {
  FA.call(this, null, A);
}
ltA.Definition = {
  type: "KDE",
  metadata: {
    generates: !0
  },
  params: [{
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "field",
    type: "field",
    required: !0
  }, {
    name: "cumulative",
    type: "boolean",
    default: !1
  }, {
    name: "counts",
    type: "boolean",
    default: !1
  }, {
    name: "bandwidth",
    type: "number",
    default: 0
  }, {
    name: "extent",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "resolve",
    type: "enum",
    values: ["shared", "independent"],
    default: "independent"
  }, {
    name: "steps",
    type: "number"
  }, {
    name: "minsteps",
    type: "number",
    default: 25
  }, {
    name: "maxsteps",
    type: "number",
    default: 200
  }, {
    name: "as",
    type: "string",
    array: !0,
    default: ["value", "density"]
  }]
};
Ae(ltA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE | e.NO_FIELDS);
    if (!this.value || e.changed() || A.modified()) {
      const i = e.materialize(e.SOURCE).source, n = itA(i, A.groupby, A.field), o = (A.groupby || []).map(Sn), g = A.bandwidth, s = A.cumulative ? "cdf" : "pdf", I = A.as || ["value", "density"], r = [];
      let a = A.extent, C = A.steps || A.minsteps || 25, B = A.steps || A.maxsteps || 200;
      s !== "pdf" && s !== "cdf" && vA("Invalid density method: " + s), A.resolve === "shared" && (a || (a = sl(i, A.field)), C = B = A.steps || B), n.forEach((l) => {
        const Q = SeA(l, g)[s], E = A.counts ? l.length : 1, d = a || sl(l);
        QU(Q, d, C, B).forEach((m) => {
          const y = {};
          for (let f = 0; f < o.length; ++f)
            y[o[f]] = l.dims[f];
          y[I[0]] = m[0], y[I[1]] = m[1] * E, r.push(Qi(y));
        });
      }), this.value && (t.rem = this.value), this.value = t.add = t.source = r;
    }
    return t;
  }
});
function kLA(A) {
  Ui.call(this, null, Q2e, A);
}
Ae(kLA, Ui);
function Q2e(A) {
  return this.value && !A.modified() ? this.value : meA(A.fields, A.flat);
}
function JLA(A) {
  FA.call(this, [], A), this._pending = null;
}
Ae(JLA, FA, {
  transform(A, e) {
    const t = e.dataflow;
    return this._pending ? Qz(this, e, this._pending) : E2e(A) ? e.StopPropagation : A.values ? Qz(this, e, t.parse(A.values, A.format)) : A.async ? {
      async: t.request(A.url, A.format).then((i) => (this._pending = Ce(i.data), (n) => n.touch(this)))
    } : t.request(A.url, A.format).then((i) => Qz(this, e, Ce(i.data)));
  }
});
function E2e(A) {
  return A.modified("async") && !(A.modified("values") || A.modified("url") || A.modified("format"));
}
function Qz(A, e, t) {
  t.forEach(Qi);
  const i = e.fork(e.NO_FIELDS & e.NO_SOURCE);
  return i.rem = A.value, A.value = i.source = i.add = t, A._pending = null, i.rem.length && i.clean(!0), i;
}
function ctA(A) {
  FA.call(this, {}, A);
}
ctA.Definition = {
  type: "Lookup",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "index",
    type: "index",
    params: [{
      name: "from",
      type: "data",
      required: !0
    }, {
      name: "key",
      type: "field",
      required: !0
    }]
  }, {
    name: "values",
    type: "field",
    array: !0
  }, {
    name: "fields",
    type: "field",
    array: !0,
    required: !0
  }, {
    name: "as",
    type: "string",
    array: !0
  }, {
    name: "default",
    default: null
  }]
};
Ae(ctA, FA, {
  transform(A, e) {
    const t = A.fields, i = A.index, n = A.values, o = A.default == null ? null : A.default, g = A.modified(), s = t.length;
    let I = g ? e.SOURCE : e.ADD, r = e, a = A.as, C, B, l;
    return n ? (B = n.length, s > 1 && !a && vA('Multi-field lookup requires explicit "as" parameter.'), a && a.length !== s * B && vA('The "as" parameter has too few output field names.'), a = a || n.map(Sn), C = function(Q) {
      for (var E = 0, d = 0, m, y; E < s; ++E)
        if (y = i.get(t[E](Q)), y == null)
          for (m = 0; m < B; ++m, ++d)
            Q[a[d]] = o;
        else
          for (m = 0; m < B; ++m, ++d)
            Q[a[d]] = n[m](y);
    }) : (a || vA("Missing output field names."), C = function(Q) {
      for (var E = 0, d; E < s; ++E)
        d = i.get(t[E](Q)), Q[a[E]] = d ?? o;
    }), g ? r = e.reflow(!0) : (l = t.some((Q) => e.modified(Q.fields)), I |= l ? e.MOD : 0), e.visit(I, C), r.modifies(a);
  }
});
function NLA(A) {
  Ui.call(this, null, u2e, A);
}
Ae(NLA, Ui);
function u2e(A) {
  if (this.value && !A.modified())
    return this.value;
  const e = A.extents, t = e.length;
  let i = 1 / 0, n = -1 / 0, o, g;
  for (o = 0; o < t; ++o)
    g = e[o], g[0] < i && (i = g[0]), g[1] > n && (n = g[1]);
  return [i, n];
}
function YLA(A) {
  Ui.call(this, null, d2e, A);
}
Ae(YLA, Ui);
function d2e(A) {
  return this.value && !A.modified() ? this.value : A.values.reduce((e, t) => e.concat(t), []);
}
function RLA(A) {
  FA.call(this, null, A);
}
Ae(RLA, FA, {
  transform(A, e) {
    return this.modified(A.modified()), this.value = A, e.fork(e.NO_SOURCE | e.NO_FIELDS);
  }
});
function QtA(A) {
  Ou.call(this, A);
}
QtA.Definition = {
  type: "Pivot",
  metadata: {
    generates: !0,
    changes: !0
  },
  params: [{
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "field",
    type: "field",
    required: !0
  }, {
    name: "value",
    type: "field",
    required: !0
  }, {
    name: "op",
    type: "enum",
    values: BF,
    default: "sum"
  }, {
    name: "limit",
    type: "number",
    default: 0
  }, {
    name: "key",
    type: "field"
  }]
};
Ae(QtA, Ou, {
  _transform: Ou.prototype.transform,
  transform(A, e) {
    return this._transform(h2e(A, e), e);
  }
});
function h2e(A, e) {
  const t = A.field, i = A.value, n = (A.op === "count" ? "__count__" : A.op) || "sum", o = fg(t).concat(fg(i)), g = p2e(t, A.limit || 0, e);
  return e.changed() && A.set("__pivot__", null, null, !0), {
    key: A.key,
    groupby: A.groupby,
    ops: g.map(() => n),
    fields: g.map((s) => m2e(s, t, i, o)),
    as: g.map((s) => s + ""),
    modified: A.modified.bind(A)
  };
}
function m2e(A, e, t, i) {
  return oI((n) => e(n) === A ? t(n) : NaN, i, A + "");
}
function p2e(A, e, t) {
  const i = {}, n = [];
  return t.visit(t.SOURCE, (o) => {
    const g = A(o);
    i[g] || (i[g] = 1, n.push(g));
  }), n.sort(iU), e ? n.slice(0, e) : n;
}
function FLA(A) {
  EU.call(this, A);
}
Ae(FLA, EU, {
  transform(A, e) {
    const t = A.subflow, i = A.field, n = (o) => this.subflow(ve(o), t, e, o);
    return (A.modified("field") || i && e.modified(fg(i))) && vA("PreFacet does not support field modification."), this.initTargets(), i ? (e.visit(e.MOD, (o) => {
      const g = n(o);
      i(o).forEach((s) => g.mod(s));
    }), e.visit(e.ADD, (o) => {
      const g = n(o);
      i(o).forEach((s) => g.add(Qi(s)));
    }), e.visit(e.REM, (o) => {
      const g = n(o);
      i(o).forEach((s) => g.rem(s));
    })) : (e.visit(e.MOD, (o) => n(o).mod(o)), e.visit(e.ADD, (o) => n(o).add(o)), e.visit(e.REM, (o) => n(o).rem(o))), e.clean() && e.runAfter(() => this.clean()), e;
  }
});
function EtA(A) {
  FA.call(this, null, A);
}
EtA.Definition = {
  type: "Project",
  metadata: {
    generates: !0,
    changes: !0
  },
  params: [{
    name: "fields",
    type: "field",
    array: !0
  }, {
    name: "as",
    type: "string",
    null: !0,
    array: !0
  }]
};
Ae(EtA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE), i = A.fields, n = bLA(A.fields, A.as || []), o = i ? (s, I) => y2e(s, I, i, n) : IU;
    let g;
    return this.value ? g = this.value : (e = e.addAll(), g = this.value = {}), e.visit(e.REM, (s) => {
      const I = ve(s);
      t.rem.push(g[I]), g[I] = null;
    }), e.visit(e.ADD, (s) => {
      const I = o(s, Qi({}));
      g[ve(s)] = I, t.add.push(I);
    }), e.visit(e.MOD, (s) => {
      t.mod.push(o(s, g[ve(s)]));
    }), t;
  }
});
function y2e(A, e, t, i) {
  for (let n = 0, o = t.length; n < o; ++n)
    e[i[n]] = t[n](A);
  return e;
}
function MLA(A) {
  FA.call(this, null, A);
}
Ae(MLA, FA, {
  transform(A, e) {
    return this.value = A.value, A.modified("value") ? e.fork(e.NO_SOURCE | e.NO_FIELDS) : e.StopPropagation;
  }
});
function utA(A) {
  FA.call(this, null, A);
}
utA.Definition = {
  type: "Quantile",
  metadata: {
    generates: !0,
    changes: !0
  },
  params: [{
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "field",
    type: "field",
    required: !0
  }, {
    name: "probs",
    type: "number",
    array: !0
  }, {
    name: "step",
    type: "number",
    default: 0.01
  }, {
    name: "as",
    type: "string",
    array: !0,
    default: ["prob", "value"]
  }]
};
const b2e = 1e-14;
Ae(utA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE | e.NO_FIELDS), i = A.as || ["prob", "value"];
    if (this.value && !A.modified() && !e.changed())
      return t.source = this.value, t;
    const n = e.materialize(e.SOURCE).source, o = itA(n, A.groupby, A.field), g = (A.groupby || []).map(Sn), s = [], I = A.step || 0.01, r = A.probs || HI(I / 2, 1 - b2e, I), a = r.length;
    return o.forEach((C) => {
      const B = MeA(C, r);
      for (let l = 0; l < a; ++l) {
        const Q = {};
        for (let E = 0; E < g.length; ++E)
          Q[g[E]] = C.dims[E];
        Q[i[0]] = r[l], Q[i[1]] = B[l], s.push(Qi(Q));
      }
    }), this.value && (t.rem = this.value), this.value = t.add = t.source = s, t;
  }
});
function xLA(A) {
  FA.call(this, null, A);
}
Ae(xLA, FA, {
  transform(A, e) {
    let t, i;
    return this.value ? i = this.value : (t = e = e.addAll(), i = this.value = {}), A.derive && (t = e.fork(e.NO_SOURCE), e.visit(e.REM, (n) => {
      const o = ve(n);
      t.rem.push(i[o]), i[o] = null;
    }), e.visit(e.ADD, (n) => {
      const o = YeA(n);
      i[ve(n)] = o, t.add.push(o);
    }), e.visit(e.MOD, (n) => {
      const o = i[ve(n)];
      for (const g in n)
        o[g] = n[g], t.modifies(g);
      t.mod.push(o);
    })), t;
  }
});
function dtA(A) {
  FA.call(this, [], A), this.count = 0;
}
dtA.Definition = {
  type: "Sample",
  metadata: {},
  params: [{
    name: "size",
    type: "number",
    default: 1e3
  }]
};
Ae(dtA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE), i = A.modified("size"), n = A.size, o = this.value.reduce((a, C) => (a[ve(C)] = 1, a), {});
    let g = this.value, s = this.count, I = 0;
    function r(a) {
      let C, B;
      g.length < n ? g.push(a) : (B = ~~((s + 1) * or()), B < g.length && B >= I && (C = g[B], o[ve(C)] && t.rem.push(C), g[B] = a)), ++s;
    }
    if (e.rem.length && (e.visit(e.REM, (a) => {
      const C = ve(a);
      o[C] && (o[C] = -1, t.rem.push(a)), --s;
    }), g = g.filter((a) => o[ve(a)] !== -1)), (e.rem.length || i) && g.length < n && e.source && (I = s = g.length, e.visit(e.SOURCE, (a) => {
      o[ve(a)] || r(a);
    }), I = -1), i && g.length > n) {
      const a = g.length - n;
      for (let C = 0; C < a; ++C)
        o[ve(g[C])] = -1, t.rem.push(g[C]);
      g = g.slice(a);
    }
    return e.mod.length && e.visit(e.MOD, (a) => {
      o[ve(a)] && t.mod.push(a);
    }), e.add.length && e.visit(e.ADD, r), (e.add.length || I < 0) && (t.add = g.filter((a) => !o[ve(a)])), this.count = s, this.value = t.source = g, t;
  }
});
function htA(A) {
  FA.call(this, null, A);
}
htA.Definition = {
  type: "Sequence",
  metadata: {
    generates: !0,
    changes: !0
  },
  params: [{
    name: "start",
    type: "number",
    required: !0
  }, {
    name: "stop",
    type: "number",
    required: !0
  }, {
    name: "step",
    type: "number",
    default: 1
  }, {
    name: "as",
    type: "string",
    default: "data"
  }]
};
Ae(htA, FA, {
  transform(A, e) {
    if (this.value && !A.modified())
      return;
    const t = e.materialize().fork(e.MOD), i = A.as || "data";
    return t.rem = this.value ? e.rem.concat(this.value) : e.rem, this.value = HI(A.start, A.stop, A.step || 1).map((n) => {
      const o = {};
      return o[i] = n, Qi(o);
    }), t.add = e.add.concat(this.value), t;
  }
});
function LLA(A) {
  FA.call(this, null, A), this.modified(!0);
}
Ae(LLA, FA, {
  transform(A, e) {
    return this.value = e.source, e.changed() ? e.fork(e.NO_SOURCE | e.NO_FIELDS) : e.StopPropagation;
  }
});
function mtA(A) {
  FA.call(this, null, A);
}
const vLA = ["unit0", "unit1"];
mtA.Definition = {
  type: "TimeUnit",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field",
    required: !0
  }, {
    name: "interval",
    type: "boolean",
    default: !0
  }, {
    name: "units",
    type: "enum",
    values: weA,
    array: !0
  }, {
    name: "step",
    type: "number",
    default: 1
  }, {
    name: "maxbins",
    type: "number",
    default: 40
  }, {
    name: "extent",
    type: "date",
    array: !0
  }, {
    name: "timezone",
    type: "enum",
    default: "local",
    values: ["local", "utc"]
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: 2,
    default: vLA
  }]
};
Ae(mtA, FA, {
  transform(A, e) {
    const t = A.field, i = A.interval !== !1, n = A.timezone === "utc", o = this._floor(A, e), g = (n ? qD : _D)(o.unit).offset, s = A.as || vLA, I = s[0], r = s[1], a = o.step;
    let C = o.start || 1 / 0, B = o.stop || -1 / 0, l = e.ADD;
    return (A.modified() || e.changed(e.REM) || e.modified(fg(t))) && (e = e.reflow(!0), l = e.SOURCE, C = 1 / 0, B = -1 / 0), e.visit(l, (Q) => {
      const E = t(Q);
      let d, m;
      E == null ? (Q[I] = null, i && (Q[r] = null)) : (Q[I] = d = m = o(E), i && (Q[r] = m = g(d, a)), d < C && (C = d), m > B && (B = m));
    }), o.start = C, o.stop = B, e.modifies(i ? s : I);
  },
  _floor(A, e) {
    const t = A.timezone === "utc", {
      units: i,
      step: n
    } = A.units ? {
      units: A.units,
      step: A.step || 1
    } : MxA({
      extent: A.extent || sl(e.materialize(e.SOURCE).source, A.field),
      maxbins: A.maxbins
    }), o = feA(i), g = this.value || {}, s = (t ? fxA : wxA)(o, n);
    return s.unit = Xt(o), s.units = o, s.step = n, s.start = g.start, s.stop = g.stop, this.value = s;
  }
});
function HLA(A) {
  FA.call(this, TD(), A);
}
Ae(HLA, FA, {
  transform(A, e) {
    const t = e.dataflow, i = A.field, n = this.value, o = (s) => n.set(i(s), s);
    let g = !0;
    return A.modified("field") || e.modified(i.fields) ? (n.clear(), e.visit(e.SOURCE, o)) : e.changed() ? (e.visit(e.REM, (s) => n.delete(i(s))), e.visit(e.ADD, o)) : g = !1, this.modified(g), n.empty > t.cleanThreshold && t.runAfter(n.clean), e.fork();
  }
});
function SLA(A) {
  FA.call(this, null, A);
}
Ae(SLA, FA, {
  transform(A, e) {
    (!this.value || A.modified("field") || A.modified("sort") || e.changed() || A.sort && e.modified(A.sort.fields)) && (this.value = (A.sort ? e.source.slice().sort(s0(A.sort)) : e.source).map(A.field));
  }
});
function w2e(A, e, t, i) {
  const n = jY[A](e, t);
  return {
    init: n.init || KE,
    update: function(o, g) {
      g[i] = n.next(o);
    }
  };
}
const jY = {
  row_number: function() {
    return {
      next: (A) => A.index + 1
    };
  },
  rank: function() {
    let A;
    return {
      init: () => A = 1,
      next: (e) => {
        const t = e.index, i = e.data;
        return t && e.compare(i[t - 1], i[t]) ? A = t + 1 : A;
      }
    };
  },
  dense_rank: function() {
    let A;
    return {
      init: () => A = 1,
      next: (e) => {
        const t = e.index, i = e.data;
        return t && e.compare(i[t - 1], i[t]) ? ++A : A;
      }
    };
  },
  percent_rank: function() {
    const A = jY.rank(), e = A.next;
    return {
      init: A.init,
      next: (t) => (e(t) - 1) / (t.data.length - 1)
    };
  },
  cume_dist: function() {
    let A;
    return {
      init: () => A = 0,
      next: (e) => {
        const t = e.data, i = e.compare;
        let n = e.index;
        if (A < n) {
          for (; n + 1 < t.length && !i(t[n], t[n + 1]); )
            ++n;
          A = n;
        }
        return (1 + A) / t.length;
      }
    };
  },
  ntile: function(A, e) {
    e = +e, e > 0 || vA("ntile num must be greater than zero.");
    const t = jY.cume_dist(), i = t.next;
    return {
      init: t.init,
      next: (n) => Math.ceil(e * i(n))
    };
  },
  lag: function(A, e) {
    return e = +e || 1, {
      next: (t) => {
        const i = t.index - e;
        return i >= 0 ? A(t.data[i]) : null;
      }
    };
  },
  lead: function(A, e) {
    return e = +e || 1, {
      next: (t) => {
        const i = t.index + e, n = t.data;
        return i < n.length ? A(n[i]) : null;
      }
    };
  },
  first_value: function(A) {
    return {
      next: (e) => A(e.data[e.i0])
    };
  },
  last_value: function(A) {
    return {
      next: (e) => A(e.data[e.i1 - 1])
    };
  },
  nth_value: function(A, e) {
    return e = +e, e > 0 || vA("nth_value nth must be greater than zero."), {
      next: (t) => {
        const i = t.i0 + (e - 1);
        return i < t.i1 ? A(t.data[i]) : null;
      }
    };
  },
  prev_value: function(A) {
    let e;
    return {
      init: () => e = null,
      next: (t) => {
        const i = A(t.data[t.index]);
        return i != null ? e = i : e;
      }
    };
  },
  next_value: function(A) {
    let e, t;
    return {
      init: () => (e = null, t = -1),
      next: (i) => {
        const n = i.data;
        return i.index <= t ? e : (t = f2e(A, n, i.index)) < 0 ? (t = n.length, e = null) : e = A(n[t]);
      }
    };
  }
};
function f2e(A, e, t) {
  for (let i = e.length; t < i; ++t)
    if (A(e[t]) != null)
      return t;
  return -1;
}
const D2e = Object.keys(jY);
function ZLA(A) {
  const e = Ce(A.ops), t = Ce(A.fields), i = Ce(A.params), n = Ce(A.aggregate_params), o = Ce(A.as), g = this.outputs = [], s = this.windows = [], I = {}, r = {}, a = [], C = [];
  let B = !0;
  function l(Q) {
    Ce(fg(Q)).forEach((E) => I[E] = 1);
  }
  l(A.sort), e.forEach((Q, E) => {
    const d = t[E], m = i[E], y = n[E] || null, f = Sn(d), w = QLA(Q, f, o[E]);
    if (l(d), g.push(w), Ze(jY, Q))
      s.push(w2e(Q, d, m, w));
    else {
      if (d == null && Q !== "count" && vA("Null aggregate field specified."), Q === "count") {
        a.push(w);
        return;
      }
      B = !1;
      let G = r[f];
      G || (G = r[f] = [], G.field = d, C.push(G)), G.push(ELA(Q, y, w));
    }
  }), (a.length || C.length) && (this.cell = G2e(C, a, B)), this.inputs = Object.keys(I);
}
const WLA = ZLA.prototype;
WLA.init = function() {
  this.windows.forEach((A) => A.init()), this.cell && this.cell.init();
};
WLA.update = function(A, e) {
  const t = this.cell, i = this.windows, n = A.data, o = i && i.length;
  let g;
  if (t) {
    for (g = A.p0; g < A.i0; ++g)
      t.rem(n[g]);
    for (g = A.p1; g < A.i1; ++g)
      t.add(n[g]);
    t.set(e);
  }
  for (g = 0; g < o; ++g)
    i[g].update(A, e);
};
function G2e(A, e, t) {
  A = A.map((I) => dLA(I, I.field));
  const i = {
    num: 0,
    agg: null,
    store: !1,
    count: e
  };
  if (!t)
    for (var n = A.length, o = i.agg = Array(n), g = 0; g < n; ++g)
      o[g] = new A[g](i);
  if (i.store)
    var s = i.data = new jeA();
  return i.add = function(I) {
    if (i.num += 1, !t) {
      s && s.add(I);
      for (let r = 0; r < n; ++r)
        o[r].add(o[r].get(I), I);
    }
  }, i.rem = function(I) {
    if (i.num -= 1, !t) {
      s && s.rem(I);
      for (let r = 0; r < n; ++r)
        o[r].rem(o[r].get(I), I);
    }
  }, i.set = function(I) {
    let r, a;
    for (s && s.values(), r = 0, a = e.length; r < a; ++r)
      I[e[r]] = i.num;
    if (!t)
      for (r = 0, a = o.length; r < a; ++r)
        o[r].set(I);
  }, i.init = function() {
    i.num = 0, s && s.reset();
    for (let I = 0; I < n; ++I)
      o[I].init();
  }, i;
}
function ptA(A) {
  FA.call(this, {}, A), this._mlen = 0, this._mods = [];
}
ptA.Definition = {
  type: "Window",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "sort",
    type: "compare"
  }, {
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "ops",
    type: "enum",
    array: !0,
    values: D2e.concat(BF)
  }, {
    name: "params",
    type: "number",
    null: !0,
    array: !0
  }, {
    name: "aggregate_params",
    type: "field",
    null: !0,
    array: !0,
    default: [null]
  }, {
    name: "fields",
    type: "field",
    null: !0,
    array: !0
  }, {
    name: "as",
    type: "string",
    null: !0,
    array: !0
  }, {
    name: "frame",
    type: "number",
    null: !0,
    array: !0,
    length: 2,
    default: [null, 0]
  }, {
    name: "ignorePeers",
    type: "boolean",
    default: !1
  }]
};
Ae(ptA, FA, {
  transform(A, e) {
    this.stamp = e.stamp;
    const t = A.modified(), i = s0(A.sort), n = XO(A.groupby), o = (s) => this.group(n(s));
    let g = this.state;
    (!g || t) && (g = this.state = new ZLA(A)), t || e.modified(g.inputs) ? (this.value = {}, e.visit(e.SOURCE, (s) => o(s).add(s))) : (e.visit(e.REM, (s) => o(s).remove(s)), e.visit(e.ADD, (s) => o(s).add(s)));
    for (let s = 0, I = this._mlen; s < I; ++s)
      k2e(this._mods[s], g, i, A);
    return this._mlen = 0, this._mods = [], e.reflow(t).modifies(g.outputs);
  },
  group(A) {
    let e = this.value[A];
    return e || (e = this.value[A] = hLA(ve), e.stamp = -1), e.stamp < this.stamp && (e.stamp = this.stamp, this._mods[this._mlen++] = e), e;
  }
});
function k2e(A, e, t, i) {
  const n = i.sort, o = n && !i.ignorePeers, g = i.frame || [null, 0], s = A.data(t), I = s.length, r = o ? ZD(n) : null, a = {
    i0: 0,
    i1: 0,
    p0: 0,
    p1: 0,
    index: 0,
    data: s,
    compare: n || Yg(-1)
  };
  e.init();
  for (let C = 0; C < I; ++C)
    J2e(a, g, C, I), o && N2e(a, r), e.update(a, s[C]);
}
function J2e(A, e, t, i) {
  A.p0 = A.i0, A.p1 = A.i1, A.i0 = e[0] == null ? 0 : Math.max(0, t - Math.abs(e[0])), A.i1 = e[1] == null ? i : Math.min(i, t + Math.abs(e[1]) + 1), A.index = t;
}
function N2e(A, e) {
  const t = A.i0, i = A.i1 - 1, n = A.compare, o = A.data, g = o.length - 1;
  t > 0 && !n(o[t], o[t - 1]) && (A.i0 = e.left(o, o[t])), i < g && !n(o[i], o[i + 1]) && (A.i1 = e.right(o, o[i]));
}
const Y2e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  aggregate: Ou,
  bin: PeA,
  collect: $eA,
  compare: mLA,
  countpattern: AtA,
  cross: etA,
  density: ttA,
  dotbin: ntA,
  expression: fLA,
  extent: otA,
  facet: EU,
  field: DLA,
  filter: stA,
  flatten: ItA,
  fold: atA,
  formula: rtA,
  generate: GLA,
  impute: CtA,
  joinaggregate: BtA,
  kde: ltA,
  key: kLA,
  load: JLA,
  lookup: ctA,
  multiextent: NLA,
  multivalues: YLA,
  params: RLA,
  pivot: QtA,
  prefacet: FLA,
  project: EtA,
  proxy: MLA,
  quantile: utA,
  relay: xLA,
  sample: dtA,
  sequence: htA,
  sieve: LLA,
  subflow: gtA,
  timeunit: mtA,
  tupleindex: HLA,
  values: SLA,
  window: ptA
}, Symbol.toStringTag, { value: "Module" }));
function Gi(A) {
  return function() {
    return A;
  };
}
const BEA = Math.abs, lg = Math.atan2, fh = Math.cos, R2e = Math.max, Ez = Math.min, OC = Math.sin, lm = Math.sqrt, Qg = 1e-12, mf = Math.PI, yS = mf / 2, KLA = 2 * mf;
function F2e(A) {
  return A > 1 ? 0 : A < -1 ? mf : Math.acos(A);
}
function lEA(A) {
  return A >= 1 ? yS : A <= -1 ? -yS : Math.asin(A);
}
const zO = Math.PI, TO = 2 * zO, zh = 1e-6, M2e = TO - zh;
function ULA(A) {
  this._ += A[0];
  for (let e = 1, t = A.length; e < t; ++e)
    this._ += arguments[e] + A[e];
}
function x2e(A) {
  let e = Math.floor(A);
  if (!(e >= 0))
    throw new Error(`invalid digits: ${A}`);
  if (e > 15)
    return ULA;
  const t = 10 ** e;
  return function(i) {
    this._ += i[0];
    for (let n = 1, o = i.length; n < o; ++n)
      this._ += Math.round(arguments[n] * t) / t + i[n];
  };
}
let ytA = class {
  constructor(A) {
    this._x0 = this._y0 = // start of current subpath
    this._x1 = this._y1 = null, this._ = "", this._append = A == null ? ULA : x2e(A);
  }
  moveTo(A, e) {
    this._append`M${this._x0 = this._x1 = +A},${this._y0 = this._y1 = +e}`;
  }
  closePath() {
    this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
  }
  lineTo(A, e) {
    this._append`L${this._x1 = +A},${this._y1 = +e}`;
  }
  quadraticCurveTo(A, e, t, i) {
    this._append`Q${+A},${+e},${this._x1 = +t},${this._y1 = +i}`;
  }
  bezierCurveTo(A, e, t, i, n, o) {
    this._append`C${+A},${+e},${+t},${+i},${this._x1 = +n},${this._y1 = +o}`;
  }
  arcTo(A, e, t, i, n) {
    if (A = +A, e = +e, t = +t, i = +i, n = +n, n < 0)
      throw new Error(`negative radius: ${n}`);
    let o = this._x1, g = this._y1, s = t - A, I = i - e, r = o - A, a = g - e, C = r * r + a * a;
    if (this._x1 === null)
      this._append`M${this._x1 = A},${this._y1 = e}`;
    else if (C > zh)
      if (!(Math.abs(a * s - I * r) > zh) || !n)
        this._append`L${this._x1 = A},${this._y1 = e}`;
      else {
        let B = t - o, l = i - g, Q = s * s + I * I, E = B * B + l * l, d = Math.sqrt(Q), m = Math.sqrt(C), y = n * Math.tan((zO - Math.acos((Q + C - E) / (2 * d * m))) / 2), f = y / m, w = y / d;
        Math.abs(f - 1) > zh && this._append`L${A + f * r},${e + f * a}`, this._append`A${n},${n},0,0,${+(a * B > r * l)},${this._x1 = A + w * s},${this._y1 = e + w * I}`;
      }
  }
  arc(A, e, t, i, n, o) {
    if (A = +A, e = +e, t = +t, o = !!o, t < 0)
      throw new Error(`negative radius: ${t}`);
    let g = t * Math.cos(i), s = t * Math.sin(i), I = A + g, r = e + s, a = 1 ^ o, C = o ? i - n : n - i;
    this._x1 === null ? this._append`M${I},${r}` : (Math.abs(this._x1 - I) > zh || Math.abs(this._y1 - r) > zh) && this._append`L${I},${r}`, t && (C < 0 && (C = C % TO + TO), C > M2e ? this._append`A${t},${t},0,1,${a},${A - g},${e - s}A${t},${t},0,1,${a},${this._x1 = I},${this._y1 = r}` : C > zh && this._append`A${t},${t},0,${+(C >= zO)},${a},${this._x1 = A + t * Math.cos(n)},${this._y1 = e + t * Math.sin(n)}`);
  }
  rect(A, e, t, i) {
    this._append`M${this._x0 = this._x1 = +A},${this._y0 = this._y1 = +e}h${t = +t}v${+i}h${-t}Z`;
  }
  toString() {
    return this._;
  }
};
function uU() {
  return new ytA();
}
uU.prototype = ytA.prototype;
function dU(A) {
  let e = 3;
  return A.digits = function(t) {
    if (!arguments.length)
      return e;
    if (t == null)
      e = null;
    else {
      const i = Math.floor(t);
      if (!(i >= 0))
        throw new RangeError(`invalid digits: ${t}`);
      e = i;
    }
    return A;
  }, () => new ytA(e);
}
function L2e(A) {
  return A.innerRadius;
}
function v2e(A) {
  return A.outerRadius;
}
function H2e(A) {
  return A.startAngle;
}
function S2e(A) {
  return A.endAngle;
}
function Z2e(A) {
  return A && A.padAngle;
}
function W2e(A, e, t, i, n, o, g, s) {
  var I = t - A, r = i - e, a = g - n, C = s - o, B = C * I - a * r;
  if (!(B * B < Qg))
    return B = (a * (e - o) - C * (A - n)) / B, [A + B * I, e + B * r];
}
function jM(A, e, t, i, n, o, g) {
  var s = A - t, I = e - i, r = (g ? o : -o) / lm(s * s + I * I), a = r * I, C = -r * s, B = A + a, l = e + C, Q = t + a, E = i + C, d = (B + Q) / 2, m = (l + E) / 2, y = Q - B, f = E - l, w = y * y + f * f, G = n - o, R = B * E - Q * l, F = (f < 0 ? -1 : 1) * lm(R2e(0, G * G * w - R * R)), Z = (R * f - y * F) / w, c = (-R * y - f * F) / w, J = (R * f + y * F) / w, p = (-R * y + f * F) / w, N = Z - d, v = c - m, K = J - d, U = p - m;
  return N * N + v * v > K * K + U * U && (Z = J, c = p), {
    cx: Z,
    cy: c,
    x01: -a,
    y01: -C,
    x11: Z * (n / G - 1),
    y11: c * (n / G - 1)
  };
}
function VLA() {
  var A = L2e, e = v2e, t = Gi(0), i = null, n = H2e, o = S2e, g = Z2e, s = null, I = dU(r);
  function r() {
    var a, C, B = +A.apply(this, arguments), l = +e.apply(this, arguments), Q = n.apply(this, arguments) - yS, E = o.apply(this, arguments) - yS, d = BEA(E - Q), m = E > Q;
    if (s || (s = a = I()), l < B && (C = l, l = B, B = C), !(l > Qg))
      s.moveTo(0, 0);
    else if (d > KLA - Qg)
      s.moveTo(l * fh(Q), l * OC(Q)), s.arc(0, 0, l, Q, E, !m), B > Qg && (s.moveTo(B * fh(E), B * OC(E)), s.arc(0, 0, B, E, Q, m));
    else {
      var y = Q, f = E, w = Q, G = E, R = d, F = d, Z = g.apply(this, arguments) / 2, c = Z > Qg && (i ? +i.apply(this, arguments) : lm(B * B + l * l)), J = Ez(BEA(l - B) / 2, +t.apply(this, arguments)), p = J, N = J, v, K;
      if (c > Qg) {
        var U = lEA(c / B * OC(Z)), j = lEA(c / l * OC(Z));
        (R -= U * 2) > Qg ? (U *= m ? 1 : -1, w += U, G -= U) : (R = 0, w = G = (Q + E) / 2), (F -= j * 2) > Qg ? (j *= m ? 1 : -1, y += j, f -= j) : (F = 0, y = f = (Q + E) / 2);
      }
      var q = l * fh(y), O = l * OC(y), $ = B * fh(G), _ = B * OC(G);
      if (J > Qg) {
        var tA = l * fh(f), nA = l * OC(f), AA = B * fh(w), gA = B * OC(w), rA;
        if (d < mf)
          if (rA = W2e(q, O, AA, gA, tA, nA, $, _)) {
            var sA = q - rA[0], lA = O - rA[1], cA = tA - rA[0], aA = nA - rA[1], QA = 1 / OC(F2e((sA * cA + lA * aA) / (lm(sA * sA + lA * lA) * lm(cA * cA + aA * aA))) / 2), hA = lm(rA[0] * rA[0] + rA[1] * rA[1]);
            p = Ez(J, (B - hA) / (QA - 1)), N = Ez(J, (l - hA) / (QA + 1));
          } else
            p = N = 0;
      }
      F > Qg ? N > Qg ? (v = jM(AA, gA, q, O, l, N, m), K = jM(tA, nA, $, _, l, N, m), s.moveTo(v.cx + v.x01, v.cy + v.y01), N < J ? s.arc(v.cx, v.cy, N, lg(v.y01, v.x01), lg(K.y01, K.x01), !m) : (s.arc(v.cx, v.cy, N, lg(v.y01, v.x01), lg(v.y11, v.x11), !m), s.arc(0, 0, l, lg(v.cy + v.y11, v.cx + v.x11), lg(K.cy + K.y11, K.cx + K.x11), !m), s.arc(K.cx, K.cy, N, lg(K.y11, K.x11), lg(K.y01, K.x01), !m))) : (s.moveTo(q, O), s.arc(0, 0, l, y, f, !m)) : s.moveTo(q, O), !(B > Qg) || !(R > Qg) ? s.lineTo($, _) : p > Qg ? (v = jM($, _, tA, nA, B, -p, m), K = jM(q, O, AA, gA, B, -p, m), s.lineTo(v.cx + v.x01, v.cy + v.y01), p < J ? s.arc(v.cx, v.cy, p, lg(v.y01, v.x01), lg(K.y01, K.x01), !m) : (s.arc(v.cx, v.cy, p, lg(v.y01, v.x01), lg(v.y11, v.x11), !m), s.arc(0, 0, B, lg(v.cy + v.y11, v.cx + v.x11), lg(K.cy + K.y11, K.cx + K.x11), m), s.arc(K.cx, K.cy, p, lg(K.y11, K.x11), lg(K.y01, K.x01), !m))) : s.arc(0, 0, B, G, w, m);
    }
    if (s.closePath(), a)
      return s = null, a + "" || null;
  }
  return r.centroid = function() {
    var a = (+A.apply(this, arguments) + +e.apply(this, arguments)) / 2, C = (+n.apply(this, arguments) + +o.apply(this, arguments)) / 2 - mf / 2;
    return [fh(C) * a, OC(C) * a];
  }, r.innerRadius = function(a) {
    return arguments.length ? (A = typeof a == "function" ? a : Gi(+a), r) : A;
  }, r.outerRadius = function(a) {
    return arguments.length ? (e = typeof a == "function" ? a : Gi(+a), r) : e;
  }, r.cornerRadius = function(a) {
    return arguments.length ? (t = typeof a == "function" ? a : Gi(+a), r) : t;
  }, r.padRadius = function(a) {
    return arguments.length ? (i = a == null ? null : typeof a == "function" ? a : Gi(+a), r) : i;
  }, r.startAngle = function(a) {
    return arguments.length ? (n = typeof a == "function" ? a : Gi(+a), r) : n;
  }, r.endAngle = function(a) {
    return arguments.length ? (o = typeof a == "function" ? a : Gi(+a), r) : o;
  }, r.padAngle = function(a) {
    return arguments.length ? (g = typeof a == "function" ? a : Gi(+a), r) : g;
  }, r.context = function(a) {
    return arguments.length ? (s = a ?? null, r) : s;
  }, r;
}
function XLA(A) {
  return typeof A == "object" && "length" in A ? A : Array.from(A);
}
function zLA(A) {
  this._context = A;
}
zLA.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(A, e) {
    switch (A = +A, e = +e, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(A, e) : this._context.moveTo(A, e);
        break;
      case 1:
        this._point = 2;
      default:
        this._context.lineTo(A, e);
        break;
    }
  }
};
function btA(A) {
  return new zLA(A);
}
function TLA(A) {
  return A[0];
}
function _LA(A) {
  return A[1];
}
function wtA(A, e) {
  var t = Gi(!0), i = null, n = btA, o = null, g = dU(s);
  A = typeof A == "function" ? A : A === void 0 ? TLA : Gi(A), e = typeof e == "function" ? e : e === void 0 ? _LA : Gi(e);
  function s(I) {
    var r, a = (I = XLA(I)).length, C, B = !1, l;
    for (i == null && (o = n(l = g())), r = 0; r <= a; ++r)
      !(r < a && t(C = I[r], r, I)) === B && ((B = !B) ? o.lineStart() : o.lineEnd()), B && o.point(+A(C, r, I), +e(C, r, I));
    if (l)
      return o = null, l + "" || null;
  }
  return s.x = function(I) {
    return arguments.length ? (A = typeof I == "function" ? I : Gi(+I), s) : A;
  }, s.y = function(I) {
    return arguments.length ? (e = typeof I == "function" ? I : Gi(+I), s) : e;
  }, s.defined = function(I) {
    return arguments.length ? (t = typeof I == "function" ? I : Gi(!!I), s) : t;
  }, s.curve = function(I) {
    return arguments.length ? (n = I, i != null && (o = n(i)), s) : n;
  }, s.context = function(I) {
    return arguments.length ? (I == null ? i = o = null : o = n(i = I), s) : i;
  }, s;
}
function hU(A, e, t) {
  var i = null, n = Gi(!0), o = null, g = btA, s = null, I = dU(r);
  A = typeof A == "function" ? A : A === void 0 ? TLA : Gi(+A), e = typeof e == "function" ? e : Gi(e === void 0 ? 0 : +e), t = typeof t == "function" ? t : t === void 0 ? _LA : Gi(+t);
  function r(C) {
    var B, l, Q, E = (C = XLA(C)).length, d, m = !1, y, f = new Array(E), w = new Array(E);
    for (o == null && (s = g(y = I())), B = 0; B <= E; ++B) {
      if (!(B < E && n(d = C[B], B, C)) === m)
        if (m = !m)
          l = B, s.areaStart(), s.lineStart();
        else {
          for (s.lineEnd(), s.lineStart(), Q = B - 1; Q >= l; --Q)
            s.point(f[Q], w[Q]);
          s.lineEnd(), s.areaEnd();
        }
      m && (f[B] = +A(d, B, C), w[B] = +e(d, B, C), s.point(i ? +i(d, B, C) : f[B], t ? +t(d, B, C) : w[B]));
    }
    if (y)
      return s = null, y + "" || null;
  }
  function a() {
    return wtA().defined(n).curve(g).context(o);
  }
  return r.x = function(C) {
    return arguments.length ? (A = typeof C == "function" ? C : Gi(+C), i = null, r) : A;
  }, r.x0 = function(C) {
    return arguments.length ? (A = typeof C == "function" ? C : Gi(+C), r) : A;
  }, r.x1 = function(C) {
    return arguments.length ? (i = C == null ? null : typeof C == "function" ? C : Gi(+C), r) : i;
  }, r.y = function(C) {
    return arguments.length ? (e = typeof C == "function" ? C : Gi(+C), t = null, r) : e;
  }, r.y0 = function(C) {
    return arguments.length ? (e = typeof C == "function" ? C : Gi(+C), r) : e;
  }, r.y1 = function(C) {
    return arguments.length ? (t = C == null ? null : typeof C == "function" ? C : Gi(+C), r) : t;
  }, r.lineX0 = r.lineY0 = function() {
    return a().x(A).y(e);
  }, r.lineY1 = function() {
    return a().x(A).y(t);
  }, r.lineX1 = function() {
    return a().x(i).y(e);
  }, r.defined = function(C) {
    return arguments.length ? (n = typeof C == "function" ? C : Gi(!!C), r) : n;
  }, r.curve = function(C) {
    return arguments.length ? (g = C, o != null && (s = g(o)), r) : g;
  }, r.context = function(C) {
    return arguments.length ? (C == null ? o = s = null : s = g(o = C), r) : o;
  }, r;
}
const K2e = {
  draw(A, e) {
    const t = lm(e / mf);
    A.moveTo(t, 0), A.arc(0, 0, t, 0, KLA);
  }
};
function qLA(A, e) {
  let t = null, i = dU(n);
  A = typeof A == "function" ? A : Gi(A || K2e), e = typeof e == "function" ? e : Gi(e === void 0 ? 64 : +e);
  function n() {
    let o;
    if (t || (t = o = i()), A.apply(this, arguments).draw(t, +e.apply(this, arguments)), o)
      return t = null, o + "" || null;
  }
  return n.type = function(o) {
    return arguments.length ? (A = typeof o == "function" ? o : Gi(o), n) : A;
  }, n.size = function(o) {
    return arguments.length ? (e = typeof o == "function" ? o : Gi(+o), n) : e;
  }, n.context = function(o) {
    return arguments.length ? (t = o ?? null, n) : t;
  }, n;
}
function ju() {
}
function bS(A, e, t) {
  A._context.bezierCurveTo(
    (2 * A._x0 + A._x1) / 3,
    (2 * A._y0 + A._y1) / 3,
    (A._x0 + 2 * A._x1) / 3,
    (A._y0 + 2 * A._y1) / 3,
    (A._x0 + 4 * A._x1 + e) / 6,
    (A._y0 + 4 * A._y1 + t) / 6
  );
}
function mU(A) {
  this._context = A;
}
mU.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 3:
        bS(this, this._x1, this._y1);
      case 2:
        this._context.lineTo(this._x1, this._y1);
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(A, e) {
    switch (A = +A, e = +e, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(A, e) : this._context.moveTo(A, e);
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3, this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
      default:
        bS(this, A, e);
        break;
    }
    this._x0 = this._x1, this._x1 = A, this._y0 = this._y1, this._y1 = e;
  }
};
function U2e(A) {
  return new mU(A);
}
function OLA(A) {
  this._context = A;
}
OLA.prototype = {
  areaStart: ju,
  areaEnd: ju,
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 1: {
        this._context.moveTo(this._x2, this._y2), this._context.closePath();
        break;
      }
      case 2: {
        this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3), this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3), this._context.closePath();
        break;
      }
      case 3: {
        this.point(this._x2, this._y2), this.point(this._x3, this._y3), this.point(this._x4, this._y4);
        break;
      }
    }
  },
  point: function(A, e) {
    switch (A = +A, e = +e, this._point) {
      case 0:
        this._point = 1, this._x2 = A, this._y2 = e;
        break;
      case 1:
        this._point = 2, this._x3 = A, this._y3 = e;
        break;
      case 2:
        this._point = 3, this._x4 = A, this._y4 = e, this._context.moveTo((this._x0 + 4 * this._x1 + A) / 6, (this._y0 + 4 * this._y1 + e) / 6);
        break;
      default:
        bS(this, A, e);
        break;
    }
    this._x0 = this._x1, this._x1 = A, this._y0 = this._y1, this._y1 = e;
  }
};
function V2e(A) {
  return new OLA(A);
}
function jLA(A) {
  this._context = A;
}
jLA.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(A, e) {
    switch (A = +A, e = +e, this._point) {
      case 0:
        this._point = 1;
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3;
        var t = (this._x0 + 4 * this._x1 + A) / 6, i = (this._y0 + 4 * this._y1 + e) / 6;
        this._line ? this._context.lineTo(t, i) : this._context.moveTo(t, i);
        break;
      case 3:
        this._point = 4;
      default:
        bS(this, A, e);
        break;
    }
    this._x0 = this._x1, this._x1 = A, this._y0 = this._y1, this._y1 = e;
  }
};
function X2e(A) {
  return new jLA(A);
}
function PLA(A, e) {
  this._basis = new mU(A), this._beta = e;
}
PLA.prototype = {
  lineStart: function() {
    this._x = [], this._y = [], this._basis.lineStart();
  },
  lineEnd: function() {
    var A = this._x, e = this._y, t = A.length - 1;
    if (t > 0)
      for (var i = A[0], n = e[0], o = A[t] - i, g = e[t] - n, s = -1, I; ++s <= t; )
        I = s / t, this._basis.point(
          this._beta * A[s] + (1 - this._beta) * (i + I * o),
          this._beta * e[s] + (1 - this._beta) * (n + I * g)
        );
    this._x = this._y = null, this._basis.lineEnd();
  },
  point: function(A, e) {
    this._x.push(+A), this._y.push(+e);
  }
};
const z2e = function A(e) {
  function t(i) {
    return e === 1 ? new mU(i) : new PLA(i, e);
  }
  return t.beta = function(i) {
    return A(+i);
  }, t;
}(0.85);
function wS(A, e, t) {
  A._context.bezierCurveTo(
    A._x1 + A._k * (A._x2 - A._x0),
    A._y1 + A._k * (A._y2 - A._y0),
    A._x2 + A._k * (A._x1 - e),
    A._y2 + A._k * (A._y1 - t),
    A._x2,
    A._y2
  );
}
function ftA(A, e) {
  this._context = A, this._k = (1 - e) / 6;
}
ftA.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 2:
        this._context.lineTo(this._x2, this._y2);
        break;
      case 3:
        wS(this, this._x1, this._y1);
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(A, e) {
    switch (A = +A, e = +e, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(A, e) : this._context.moveTo(A, e);
        break;
      case 1:
        this._point = 2, this._x1 = A, this._y1 = e;
        break;
      case 2:
        this._point = 3;
      default:
        wS(this, A, e);
        break;
    }
    this._x0 = this._x1, this._x1 = this._x2, this._x2 = A, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const T2e = function A(e) {
  function t(i) {
    return new ftA(i, e);
  }
  return t.tension = function(i) {
    return A(+i);
  }, t;
}(0);
function DtA(A, e) {
  this._context = A, this._k = (1 - e) / 6;
}
DtA.prototype = {
  areaStart: ju,
  areaEnd: ju,
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 1: {
        this._context.moveTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 2: {
        this._context.lineTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 3: {
        this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
        break;
      }
    }
  },
  point: function(A, e) {
    switch (A = +A, e = +e, this._point) {
      case 0:
        this._point = 1, this._x3 = A, this._y3 = e;
        break;
      case 1:
        this._point = 2, this._context.moveTo(this._x4 = A, this._y4 = e);
        break;
      case 2:
        this._point = 3, this._x5 = A, this._y5 = e;
        break;
      default:
        wS(this, A, e);
        break;
    }
    this._x0 = this._x1, this._x1 = this._x2, this._x2 = A, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const _2e = function A(e) {
  function t(i) {
    return new DtA(i, e);
  }
  return t.tension = function(i) {
    return A(+i);
  }, t;
}(0);
function GtA(A, e) {
  this._context = A, this._k = (1 - e) / 6;
}
GtA.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(A, e) {
    switch (A = +A, e = +e, this._point) {
      case 0:
        this._point = 1;
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
        break;
      case 3:
        this._point = 4;
      default:
        wS(this, A, e);
        break;
    }
    this._x0 = this._x1, this._x1 = this._x2, this._x2 = A, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const q2e = function A(e) {
  function t(i) {
    return new GtA(i, e);
  }
  return t.tension = function(i) {
    return A(+i);
  }, t;
}(0);
function ktA(A, e, t) {
  var i = A._x1, n = A._y1, o = A._x2, g = A._y2;
  if (A._l01_a > Qg) {
    var s = 2 * A._l01_2a + 3 * A._l01_a * A._l12_a + A._l12_2a, I = 3 * A._l01_a * (A._l01_a + A._l12_a);
    i = (i * s - A._x0 * A._l12_2a + A._x2 * A._l01_2a) / I, n = (n * s - A._y0 * A._l12_2a + A._y2 * A._l01_2a) / I;
  }
  if (A._l23_a > Qg) {
    var r = 2 * A._l23_2a + 3 * A._l23_a * A._l12_a + A._l12_2a, a = 3 * A._l23_a * (A._l23_a + A._l12_a);
    o = (o * r + A._x1 * A._l23_2a - e * A._l12_2a) / a, g = (g * r + A._y1 * A._l23_2a - t * A._l12_2a) / a;
  }
  A._context.bezierCurveTo(i, n, o, g, A._x2, A._y2);
}
function $LA(A, e) {
  this._context = A, this._alpha = e;
}
$LA.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 2:
        this._context.lineTo(this._x2, this._y2);
        break;
      case 3:
        this.point(this._x2, this._y2);
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(A, e) {
    if (A = +A, e = +e, this._point) {
      var t = this._x2 - A, i = this._y2 - e;
      this._l23_a = Math.sqrt(this._l23_2a = Math.pow(t * t + i * i, this._alpha));
    }
    switch (this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(A, e) : this._context.moveTo(A, e);
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3;
      default:
        ktA(this, A, e);
        break;
    }
    this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = A, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const O2e = function A(e) {
  function t(i) {
    return e ? new $LA(i, e) : new ftA(i, 0);
  }
  return t.alpha = function(i) {
    return A(+i);
  }, t;
}(0.5);
function AvA(A, e) {
  this._context = A, this._alpha = e;
}
AvA.prototype = {
  areaStart: ju,
  areaEnd: ju,
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 1: {
        this._context.moveTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 2: {
        this._context.lineTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 3: {
        this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
        break;
      }
    }
  },
  point: function(A, e) {
    if (A = +A, e = +e, this._point) {
      var t = this._x2 - A, i = this._y2 - e;
      this._l23_a = Math.sqrt(this._l23_2a = Math.pow(t * t + i * i, this._alpha));
    }
    switch (this._point) {
      case 0:
        this._point = 1, this._x3 = A, this._y3 = e;
        break;
      case 1:
        this._point = 2, this._context.moveTo(this._x4 = A, this._y4 = e);
        break;
      case 2:
        this._point = 3, this._x5 = A, this._y5 = e;
        break;
      default:
        ktA(this, A, e);
        break;
    }
    this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = A, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const j2e = function A(e) {
  function t(i) {
    return e ? new AvA(i, e) : new DtA(i, 0);
  }
  return t.alpha = function(i) {
    return A(+i);
  }, t;
}(0.5);
function evA(A, e) {
  this._context = A, this._alpha = e;
}
evA.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(A, e) {
    if (A = +A, e = +e, this._point) {
      var t = this._x2 - A, i = this._y2 - e;
      this._l23_a = Math.sqrt(this._l23_2a = Math.pow(t * t + i * i, this._alpha));
    }
    switch (this._point) {
      case 0:
        this._point = 1;
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
        break;
      case 3:
        this._point = 4;
      default:
        ktA(this, A, e);
        break;
    }
    this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = A, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const P2e = function A(e) {
  function t(i) {
    return e ? new evA(i, e) : new GtA(i, 0);
  }
  return t.alpha = function(i) {
    return A(+i);
  }, t;
}(0.5);
function tvA(A) {
  this._context = A;
}
tvA.prototype = {
  areaStart: ju,
  areaEnd: ju,
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    this._point && this._context.closePath();
  },
  point: function(A, e) {
    A = +A, e = +e, this._point ? this._context.lineTo(A, e) : (this._point = 1, this._context.moveTo(A, e));
  }
};
function $2e(A) {
  return new tvA(A);
}
function cEA(A) {
  return A < 0 ? -1 : 1;
}
function QEA(A, e, t) {
  var i = A._x1 - A._x0, n = e - A._x1, o = (A._y1 - A._y0) / (i || n < 0 && -0), g = (t - A._y1) / (n || i < 0 && -0), s = (o * n + g * i) / (i + n);
  return (cEA(o) + cEA(g)) * Math.min(Math.abs(o), Math.abs(g), 0.5 * Math.abs(s)) || 0;
}
function EEA(A, e) {
  var t = A._x1 - A._x0;
  return t ? (3 * (A._y1 - A._y0) / t - e) / 2 : e;
}
function uz(A, e, t) {
  var i = A._x0, n = A._y0, o = A._x1, g = A._y1, s = (o - i) / 3;
  A._context.bezierCurveTo(i + s, n + s * e, o - s, g - s * t, o, g);
}
function fS(A) {
  this._context = A;
}
fS.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 2:
        this._context.lineTo(this._x1, this._y1);
        break;
      case 3:
        uz(this, this._t0, EEA(this, this._t0));
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(A, e) {
    var t = NaN;
    if (A = +A, e = +e, !(A === this._x1 && e === this._y1)) {
      switch (this._point) {
        case 0:
          this._point = 1, this._line ? this._context.lineTo(A, e) : this._context.moveTo(A, e);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3, uz(this, EEA(this, t = QEA(this, A, e)), t);
          break;
        default:
          uz(this, this._t0, t = QEA(this, A, e));
          break;
      }
      this._x0 = this._x1, this._x1 = A, this._y0 = this._y1, this._y1 = e, this._t0 = t;
    }
  }
};
function ivA(A) {
  this._context = new nvA(A);
}
(ivA.prototype = Object.create(fS.prototype)).point = function(A, e) {
  fS.prototype.point.call(this, e, A);
};
function nvA(A) {
  this._context = A;
}
nvA.prototype = {
  moveTo: function(A, e) {
    this._context.moveTo(e, A);
  },
  closePath: function() {
    this._context.closePath();
  },
  lineTo: function(A, e) {
    this._context.lineTo(e, A);
  },
  bezierCurveTo: function(A, e, t, i, n, o) {
    this._context.bezierCurveTo(e, A, i, t, o, n);
  }
};
function ARe(A) {
  return new fS(A);
}
function eRe(A) {
  return new ivA(A);
}
function ovA(A) {
  this._context = A;
}
ovA.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = [], this._y = [];
  },
  lineEnd: function() {
    var A = this._x, e = this._y, t = A.length;
    if (t)
      if (this._line ? this._context.lineTo(A[0], e[0]) : this._context.moveTo(A[0], e[0]), t === 2)
        this._context.lineTo(A[1], e[1]);
      else
        for (var i = uEA(A), n = uEA(e), o = 0, g = 1; g < t; ++o, ++g)
          this._context.bezierCurveTo(i[0][o], n[0][o], i[1][o], n[1][o], A[g], e[g]);
    (this._line || this._line !== 0 && t === 1) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null;
  },
  point: function(A, e) {
    this._x.push(+A), this._y.push(+e);
  }
};
function uEA(A) {
  var e, t = A.length - 1, i, n = new Array(t), o = new Array(t), g = new Array(t);
  for (n[0] = 0, o[0] = 2, g[0] = A[0] + 2 * A[1], e = 1; e < t - 1; ++e)
    n[e] = 1, o[e] = 4, g[e] = 4 * A[e] + 2 * A[e + 1];
  for (n[t - 1] = 2, o[t - 1] = 7, g[t - 1] = 8 * A[t - 1] + A[t], e = 1; e < t; ++e)
    i = n[e] / o[e - 1], o[e] -= i, g[e] -= i * g[e - 1];
  for (n[t - 1] = g[t - 1] / o[t - 1], e = t - 2; e >= 0; --e)
    n[e] = (g[e] - n[e + 1]) / o[e];
  for (o[t - 1] = (A[t] + n[t - 1]) / 2, e = 0; e < t - 1; ++e)
    o[e] = 2 * A[e + 1] - n[e + 1];
  return [n, o];
}
function tRe(A) {
  return new ovA(A);
}
function pU(A, e) {
  this._context = A, this._t = e;
}
pU.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = this._y = NaN, this._point = 0;
  },
  lineEnd: function() {
    0 < this._t && this._t < 1 && this._point === 2 && this._context.lineTo(this._x, this._y), (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line >= 0 && (this._t = 1 - this._t, this._line = 1 - this._line);
  },
  point: function(A, e) {
    switch (A = +A, e = +e, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(A, e) : this._context.moveTo(A, e);
        break;
      case 1:
        this._point = 2;
      default: {
        if (this._t <= 0)
          this._context.lineTo(this._x, e), this._context.lineTo(A, e);
        else {
          var t = this._x * (1 - this._t) + A * this._t;
          this._context.lineTo(t, this._y), this._context.lineTo(t, e);
        }
        break;
      }
    }
    this._x = A, this._y = e;
  }
};
function iRe(A) {
  return new pU(A, 0.5);
}
function nRe(A) {
  return new pU(A, 0);
}
function oRe(A) {
  return new pU(A, 1);
}
function Ju(A, e) {
  if (typeof document < "u" && document.createElement) {
    const t = document.createElement("canvas");
    if (t && t.getContext)
      return t.width = A, t.height = e, t;
  }
  return null;
}
const gRe = () => typeof Image < "u" ? Image : null;
function JtA(A, e, t) {
  const i = A - e + t * 2;
  return A ? i > 0 ? i : 1 : 0;
}
const sRe = "identity", pf = "linear", uQ = "log", lF = "pow", cF = "sqrt", yU = "symlog", Cp = "time", Bp = "utc", qB = "sequential", jD = "diverging", yf = "quantile", bU = "quantize", wU = "threshold", NtA = "ordinal", _O = "point", gvA = "band", YtA = "bin-ordinal", mo = "continuous", QF = "discrete", EF = "discretizing", lr = "interpolating", RtA = "temporal";
function IRe(A) {
  return function(e) {
    let t = e[0], i = e[1], n;
    return i < t && (n = t, t = i, i = n), [A.invert(t), A.invert(i)];
  };
}
function aRe(A) {
  return function(e) {
    const t = A.range();
    let i = e[0], n = e[1], o = -1, g, s, I, r;
    for (n < i && (s = i, i = n, n = s), I = 0, r = t.length; I < r; ++I)
      t[I] >= i && t[I] <= n && (o < 0 && (o = I), g = I);
    if (!(o < 0))
      return i = A.invertExtent(t[o]), n = A.invertExtent(t[g]), [i[0] === void 0 ? i[1] : i[0], n[1] === void 0 ? n[0] : n[1]];
  };
}
function FtA() {
  const A = K3().unknown(void 0), e = A.domain, t = A.range;
  let i = [0, 1], n, o, g = !1, s = 0, I = 0, r = 0.5;
  delete A.unknown;
  function a() {
    const C = e().length, B = i[1] < i[0], l = i[1 - B], Q = JtA(C, s, I);
    let E = i[B - 0];
    n = (l - E) / (Q || 1), g && (n = Math.floor(n)), E += (l - E - n * (C - s)) * r, o = n * (1 - s), g && (E = Math.round(E), o = Math.round(o));
    const d = HI(C).map((m) => E + n * m);
    return t(B ? d.reverse() : d);
  }
  return A.domain = function(C) {
    return arguments.length ? (e(C), a()) : e();
  }, A.range = function(C) {
    return arguments.length ? (i = [+C[0], +C[1]], a()) : i.slice();
  }, A.rangeRound = function(C) {
    return i = [+C[0], +C[1]], g = !0, a();
  }, A.bandwidth = function() {
    return o;
  }, A.step = function() {
    return n;
  }, A.round = function(C) {
    return arguments.length ? (g = !!C, a()) : g;
  }, A.padding = function(C) {
    return arguments.length ? (I = Math.max(0, Math.min(1, C)), s = I, a()) : s;
  }, A.paddingInner = function(C) {
    return arguments.length ? (s = Math.max(0, Math.min(1, C)), a()) : s;
  }, A.paddingOuter = function(C) {
    return arguments.length ? (I = Math.max(0, Math.min(1, C)), a()) : I;
  }, A.align = function(C) {
    return arguments.length ? (r = Math.max(0, Math.min(1, C)), a()) : r;
  }, A.invertRange = function(C) {
    if (C[0] == null || C[1] == null)
      return;
    const B = i[1] < i[0], l = B ? t().reverse() : t(), Q = l.length - 1;
    let E = +C[0], d = +C[1], m, y, f;
    if (!(E !== E || d !== d) && (d < E && (f = E, E = d, d = f), !(d < l[0] || E > i[1 - B])))
      return m = Math.max(0, iS(l, E) - 1), y = E === d ? m : iS(l, d) - 1, E - l[m] > o + 1e-10 && ++m, B && (f = m, m = Q - y, y = Q - f), m > y ? void 0 : e().slice(m, y + 1);
  }, A.invert = function(C) {
    const B = A.invertRange([C, C]);
    return B && B[0];
  }, A.copy = function() {
    return FtA().domain(e()).range(i).round(g).paddingInner(s).paddingOuter(I).align(r);
  }, a();
}
function svA(A) {
  const e = A.copy;
  return A.padding = A.paddingOuter, delete A.paddingInner, A.copy = function() {
    return svA(e());
  }, A;
}
function rRe() {
  return svA(FtA().paddingInner(1));
}
var CRe = Array.prototype.map;
function BRe(A) {
  return CRe.call(A, yg);
}
const lRe = Array.prototype.slice;
function IvA() {
  let A = [], e = [];
  function t(i) {
    return i == null || i !== i ? void 0 : e[(nF(A, i) - 1) % e.length];
  }
  return t.domain = function(i) {
    return arguments.length ? (A = BRe(i), t) : A.slice();
  }, t.range = function(i) {
    return arguments.length ? (e = lRe.call(i), t) : e.slice();
  }, t.tickFormat = function(i, n) {
    return aMA(A[0], Xt(A), i ?? 10, n);
  }, t.copy = function() {
    return IvA().domain(t.domain()).range(t.range());
  }, t;
}
const DS = /* @__PURE__ */ new Map(), avA = Symbol("vega_scale");
function rvA(A) {
  return A[avA] = !0, A;
}
function cRe(A) {
  return A && A[avA] === !0;
}
function QRe(A, e, t) {
  const i = function() {
    const n = e();
    return n.invertRange || (n.invertRange = n.invert ? IRe(n) : n.invertExtent ? aRe(n) : void 0), n.type = A, rvA(n);
  };
  return i.metadata = mC(Ce(t)), i;
}
function ri(A, e, t) {
  return arguments.length > 1 ? (DS.set(A, QRe(A, e, t)), this) : CvA(A) ? DS.get(A) : void 0;
}
ri(sRe, rMA);
ri(pf, PAA, mo);
ri(uQ, BMA, [mo, uQ]);
ri(lF, teA, mo);
ri(cF, qGe, mo);
ri(yU, lMA, mo);
ri(Cp, rJe, [mo, RtA]);
ri(Bp, CJe, [mo, RtA]);
ri(qB, geA, [mo, lr]);
ri(`${qB}-${pf}`, geA, [mo, lr]);
ri(`${qB}-${uQ}`, DMA, [mo, lr, uQ]);
ri(`${qB}-${lF}`, seA, [mo, lr]);
ri(`${qB}-${cF}`, BJe, [mo, lr]);
ri(`${qB}-${yU}`, GMA, [mo, lr]);
ri(`${jD}-${pf}`, kMA, [mo, lr]);
ri(`${jD}-${uQ}`, JMA, [mo, lr, uQ]);
ri(`${jD}-${lF}`, IeA, [mo, lr]);
ri(`${jD}-${cF}`, lJe, [mo, lr]);
ri(`${jD}-${yU}`, NMA, [mo, lr]);
ri(yf, cMA, [EF, yf]);
ri(bU, QMA, EF);
ri(wU, EMA, EF);
ri(YtA, IvA, [QF, EF]);
ri(NtA, K3, QF);
ri(gvA, FtA, QF);
ri(_O, rRe, QF);
function CvA(A) {
  return DS.has(A);
}
function a0(A, e) {
  const t = DS.get(A);
  return t && t.metadata[e];
}
function MtA(A) {
  return a0(A, mo);
}
function bf(A) {
  return a0(A, QF);
}
function qO(A) {
  return a0(A, EF);
}
function BvA(A) {
  return a0(A, uQ);
}
function ERe(A) {
  return a0(A, RtA);
}
function lvA(A) {
  return a0(A, lr);
}
function cvA(A) {
  return a0(A, yf);
}
const uRe = ["clamp", "base", "constant", "exponent"];
function QvA(A, e) {
  const t = e[0], i = Xt(e) - t;
  return function(n) {
    return A(t + n * i);
  };
}
function fU(A, e, t) {
  return jAA(xtA(e || "rgb", t), A);
}
function EvA(A, e) {
  const t = new Array(e), i = e + 1;
  for (let n = 0; n < e; )
    t[n] = A(++n / i);
  return t;
}
function uvA(A, e, t) {
  const i = t - e;
  let n, o, g;
  return !i || !Number.isFinite(i) ? Yg(0.5) : (n = (o = A.type).indexOf("-"), o = n < 0 ? o : o.slice(n + 1), g = ri(o)().domain([e, t]).range([0, 1]), uRe.forEach((s) => A[s] ? g[s](A[s]()) : 0), g);
}
function xtA(A, e) {
  const t = vGe[dRe(A)];
  return e != null && t && t.gamma ? t.gamma(e) : t;
}
function dRe(A) {
  return "interpolate" + A.toLowerCase().split("-").map((e) => e[0].toUpperCase() + e.slice(1)).join("");
}
const hRe = {
  blues: "cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",
  greens: "d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",
  greys: "e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",
  oranges: "fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",
  purples: "e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",
  reds: "fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",
  blueGreen: "d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",
  bluePurple: "ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",
  greenBlue: "d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",
  orangeRed: "fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",
  purpleBlue: "dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",
  purpleBlueGreen: "dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",
  purpleRed: "dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",
  redPurple: "fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",
  yellowGreen: "e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",
  yellowOrangeBrown: "feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",
  yellowOrangeRed: "fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",
  blueOrange: "134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",
  brownBlueGreen: "704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",
  purpleGreen: "5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",
  purpleOrange: "4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",
  redBlue: "8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",
  redGrey: "8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",
  yellowGreenBlue: "eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",
  redYellowBlue: "a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",
  redYellowGreen: "a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",
  pinkYellowGreen: "8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",
  spectral: "9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",
  viridis: "440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",
  magma: "0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",
  inferno: "0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",
  plasma: "0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",
  cividis: "00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",
  rainbow: "6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",
  sinebow: "ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",
  turbo: "23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",
  browns: "eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",
  tealBlues: "bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",
  teals: "bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",
  warmGreys: "dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",
  goldGreen: "f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",
  goldOrange: "f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",
  goldRed: "f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",
  lightGreyRed: "efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",
  lightGreyTeal: "e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",
  lightMulti: "e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",
  lightOrange: "f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",
  lightTealBlue: "e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",
  darkBlue: "3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",
  darkGold: "3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",
  darkGreen: "3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",
  darkMulti: "3737371f5287197d8c29a86995ce3fffe800ffffff",
  darkRed: "3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"
}, mRe = {
  category10: "1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",
  category20: "1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",
  category20b: "393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",
  category20c: "3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",
  tableau10: "4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",
  tableau20: "4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",
  accent: "7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",
  dark2: "1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",
  paired: "a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",
  pastel1: "fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",
  pastel2: "b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",
  set1: "e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",
  set2: "66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",
  set3: "8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"
};
function dvA(A) {
  const e = A.length / 6 | 0, t = new Array(e);
  for (let i = 0; i < e; )
    t[i] = "#" + A.slice(i * 6, ++i * 6);
  return t;
}
function hvA(A, e) {
  for (const t in A)
    LtA(t, e(A[t]));
}
const dEA = {};
hvA(mRe, dvA);
hvA(hRe, (A) => fU(dvA(A)));
function LtA(A, e) {
  return A = A && A.toLowerCase(), arguments.length > 1 ? (dEA[A] = e, this) : dEA[A];
}
const VL = "symbol", pRe = "discrete", yRe = "gradient", bRe = (A) => ZA(A) ? A.map((e) => String(e)) : String(A), wRe = (A, e) => A[1] - e[1], fRe = (A, e) => e[1] - A[1];
function vtA(A, e, t) {
  let i;
  return ti(e) && (A.bins && (e = Math.max(e, A.bins.length)), t != null && (e = Math.min(e, Math.floor(aF(A.domain()) / t || 1) + 1))), ce(e) && (i = e.step, e = e.interval), Be(e) && (e = A.type === Cp ? _D(e) : A.type == Bp ? qD(e) : vA("Only time and utc scales accept interval strings."), i && (e = e.every(i))), e;
}
function mvA(A, e, t) {
  let i = A.range(), n = i[0], o = Xt(i), g = wRe;
  if (n > o && (i = o, o = n, n = i, g = fRe), n = Math.floor(n), o = Math.ceil(o), e = e.map((s) => [s, A(s)]).filter((s) => n <= s[1] && s[1] <= o).sort(g).map((s) => s[0]), t > 0 && e.length > 1) {
    const s = [e[0], Xt(e)];
    for (; e.length > t && e.length >= 3; )
      e = e.filter((I, r) => !(r % 2));
    e.length < 3 && (e = s);
  }
  return e;
}
function HtA(A, e) {
  return A.bins ? mvA(A, A.bins) : A.ticks ? A.ticks(e) : A.domain();
}
function pvA(A, e, t, i, n, o) {
  const g = e.type;
  let s = bRe;
  if (g === Cp || n === Cp)
    s = A.timeFormat(i);
  else if (g === Bp || n === Bp)
    s = A.utcFormat(i);
  else if (BvA(g)) {
    const I = A.formatFloat(i);
    if (o || e.bins)
      s = I;
    else {
      const r = yvA(e, t, !1);
      s = (a) => r(a) ? I(a) : "";
    }
  } else if (e.tickFormat) {
    const I = e.domain();
    s = A.formatSpan(I[0], I[I.length - 1], t, i);
  } else
    i && (s = A.format(i));
  return s;
}
function yvA(A, e, t) {
  const i = HtA(A, e), n = A.base(), o = Math.log(n), g = Math.max(1, n * e / i.length), s = (I) => {
    let r = I / Math.pow(n, Math.round(Math.log(I) / o));
    return r * n < n - 0.5 && (r *= n), r <= g;
  };
  return t ? i.filter(s) : s;
}
const OO = {
  [yf]: "quantiles",
  [bU]: "thresholds",
  [wU]: "domain"
}, bvA = {
  [yf]: "quantiles",
  [bU]: "domain"
};
function wvA(A, e) {
  return A.bins ? kRe(A.bins) : A.type === uQ ? yvA(A, e, !0) : OO[A.type] ? GRe(A[OO[A.type]]()) : HtA(A, e);
}
function DRe(A, e, t) {
  const i = e[bvA[e.type]](), n = i.length;
  let o = n > 1 ? i[1] - i[0] : i[0], g;
  for (g = 1; g < n; ++g)
    o = Math.min(o, i[g] - i[g - 1]);
  return A.formatSpan(0, o, 3 * 10, t);
}
function GRe(A) {
  const e = [-1 / 0].concat(A);
  return e.max = 1 / 0, e;
}
function kRe(A) {
  const e = A.slice(0, -1);
  return e.max = Xt(A), e;
}
const JRe = (A) => OO[A.type] || A.bins;
function fvA(A, e, t, i, n, o, g) {
  const s = bvA[e.type] && o !== Cp && o !== Bp ? DRe(A, e, n) : pvA(A, e, t, n, o, g);
  return i === VL && JRe(e) ? NRe(s) : i === pRe ? YRe(s) : RRe(s);
}
const NRe = (A) => (e, t, i) => {
  const n = hEA(i[t + 1], hEA(i.max, 1 / 0)), o = mEA(e, A), g = mEA(n, A);
  return o && g ? o + " – " + g : g ? "< " + g : "≥ " + o;
}, hEA = (A, e) => A ?? e, YRe = (A) => (e, t) => t ? A(e) : null, RRe = (A) => (e) => A(e), mEA = (A, e) => Number.isFinite(A) ? e(A) : null;
function FRe(A) {
  const e = A.domain(), t = e.length - 1;
  let i = +e[0], n = +Xt(e), o = n - i;
  if (A.type === wU) {
    const g = t ? o / t : 0.1;
    i -= g, n += g, o = n - i;
  }
  return (g) => (g - i) / o;
}
function MRe(A, e, t, i) {
  const n = i || e.type;
  return Be(t) && ERe(n) && (t = t.replace(/%a/g, "%A").replace(/%b/g, "%B")), !t && n === Cp ? A.timeFormat("%A, %d %B %Y, %X") : !t && n === Bp ? A.utcFormat("%A, %d %B %Y, %X UTC") : fvA(A, e, 5, null, t, i, !0);
}
function DvA(A, e, t) {
  t = t || {};
  const i = Math.max(3, t.maxlen || 7), n = MRe(A, e, t.format, t.formatType);
  if (qO(e.type)) {
    const o = wvA(e).slice(1).map(n), g = o.length;
    return `${g} boundar${g === 1 ? "y" : "ies"}: ${o.join(", ")}`;
  } else if (bf(e.type)) {
    const o = e.domain(), g = o.length, s = g > i ? o.slice(0, i - 2).map(n).join(", ") + ", ending with " + o.slice(-1).map(n) : o.map(n).join(", ");
    return `${g} value${g === 1 ? "" : "s"}: ${s}`;
  } else {
    const o = e.domain();
    return `values from ${n(o[0])} to ${n(Xt(o))}`;
  }
}
let GvA = 0;
function xRe() {
  GvA = 0;
}
const GS = "p_";
function StA(A) {
  return A && A.gradient;
}
function kvA(A, e, t) {
  const i = A.gradient;
  let n = A.id, o = i === "radial" ? GS : "";
  return n || (n = A.id = "gradient_" + GvA++, i === "radial" ? (A.x1 = jC(A.x1, 0.5), A.y1 = jC(A.y1, 0.5), A.r1 = jC(A.r1, 0), A.x2 = jC(A.x2, 0.5), A.y2 = jC(A.y2, 0.5), A.r2 = jC(A.r2, 0.5), o = GS) : (A.x1 = jC(A.x1, 0), A.y1 = jC(A.y1, 0), A.x2 = jC(A.x2, 1), A.y2 = jC(A.y2, 0))), e[n] = A, "url(" + (t || "") + "#" + o + n + ")";
}
function jC(A, e) {
  return A ?? e;
}
function JvA(A, e) {
  var t = [], i;
  return i = {
    gradient: "linear",
    x1: A ? A[0] : 0,
    y1: A ? A[1] : 0,
    x2: e ? e[0] : 1,
    y2: e ? e[1] : 0,
    stops: t,
    stop: function(n, o) {
      return t.push({
        offset: n,
        color: o
      }), i;
    }
  };
}
const pEA = {
  basis: {
    curve: U2e
  },
  "basis-closed": {
    curve: V2e
  },
  "basis-open": {
    curve: X2e
  },
  bundle: {
    curve: z2e,
    tension: "beta",
    value: 0.85
  },
  cardinal: {
    curve: T2e,
    tension: "tension",
    value: 0
  },
  "cardinal-open": {
    curve: q2e,
    tension: "tension",
    value: 0
  },
  "cardinal-closed": {
    curve: _2e,
    tension: "tension",
    value: 0
  },
  "catmull-rom": {
    curve: O2e,
    tension: "alpha",
    value: 0.5
  },
  "catmull-rom-closed": {
    curve: j2e,
    tension: "alpha",
    value: 0.5
  },
  "catmull-rom-open": {
    curve: P2e,
    tension: "alpha",
    value: 0.5
  },
  linear: {
    curve: btA
  },
  "linear-closed": {
    curve: $2e
  },
  monotone: {
    horizontal: eRe,
    vertical: ARe
  },
  natural: {
    curve: tRe
  },
  step: {
    curve: iRe
  },
  "step-after": {
    curve: oRe
  },
  "step-before": {
    curve: nRe
  }
};
function uF(A, e, t) {
  var i = Ze(pEA, A) && pEA[A], n = null;
  return i && (n = i.curve || i[e || "vertical"], i.tension && t != null && (n = n[i.tension](t))), n;
}
const LRe = {
  m: 2,
  l: 2,
  h: 1,
  v: 1,
  z: 0,
  c: 6,
  s: 4,
  q: 4,
  t: 2,
  a: 7
}, vRe = /[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi, HRe = /^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/, SRe = /^((\s+,?\s*)|(,\s*))/, ZRe = /^[01]/;
function wf(A) {
  const e = [];
  return (A.match(vRe) || []).forEach((t) => {
    let i = t[0];
    const n = i.toLowerCase(), o = LRe[n], g = WRe(n, o, t.slice(1).trim()), s = g.length;
    if (s < o || s && s % o !== 0)
      throw Error("Invalid SVG path, incorrect parameter count");
    if (e.push([i, ...g.slice(0, o)]), s !== o) {
      n === "m" && (i = i === "M" ? "L" : "l");
      for (let I = o; I < s; I += o)
        e.push([i, ...g.slice(I, I + o)]);
    }
  }), e;
}
function WRe(A, e, t) {
  const i = [];
  for (let n = 0; e && n < t.length; )
    for (let o = 0; o < e; ++o) {
      const g = A === "a" && (o === 3 || o === 4) ? ZRe : HRe, s = t.slice(n).match(g);
      if (s === null)
        throw Error("Invalid SVG path, incorrect parameter type");
      n += s[0].length, i.push(+s[0]);
      const I = t.slice(n).match(SRe);
      I !== null && (n += I[0].length);
    }
  return i;
}
const Pu = Math.PI / 180, KRe = 1e-14, Am = Math.PI / 2, EB = Math.PI * 2, By = Math.sqrt(3) / 2;
var dz = {}, hz = {}, NvA = [].join;
function URe(A, e, t, i, n, o, g, s, I) {
  const r = NvA.call(arguments);
  if (dz[r])
    return dz[r];
  const a = g * Pu, C = Math.sin(a), B = Math.cos(a);
  t = Math.abs(t), i = Math.abs(i);
  const l = B * (s - A) * 0.5 + C * (I - e) * 0.5, Q = B * (I - e) * 0.5 - C * (s - A) * 0.5;
  let E = l * l / (t * t) + Q * Q / (i * i);
  E > 1 && (E = Math.sqrt(E), t *= E, i *= E);
  const d = B / t, m = C / t, y = -C / i, f = B / i, w = d * s + m * I, G = y * s + f * I, R = d * A + m * e, F = y * A + f * e;
  let Z = 1 / ((R - w) * (R - w) + (F - G) * (F - G)) - 0.25;
  Z < 0 && (Z = 0);
  let c = Math.sqrt(Z);
  o == n && (c = -c);
  const J = 0.5 * (w + R) - c * (F - G), p = 0.5 * (G + F) + c * (R - w), N = Math.atan2(G - p, w - J);
  let v = Math.atan2(F - p, R - J) - N;
  v < 0 && o === 1 ? v += EB : v > 0 && o === 0 && (v -= EB);
  const K = Math.ceil(Math.abs(v / (Am + 1e-3))), U = [];
  for (let j = 0; j < K; ++j) {
    const q = N + j * v / K, O = N + (j + 1) * v / K;
    U[j] = [J, p, q, O, t, i, C, B];
  }
  return dz[r] = U;
}
function VRe(A) {
  const e = NvA.call(A);
  if (hz[e])
    return hz[e];
  var t = A[0], i = A[1], n = A[2], o = A[3], g = A[4], s = A[5], I = A[6], r = A[7];
  const a = r * g, C = -I * s, B = I * g, l = r * s, Q = Math.cos(n), E = Math.sin(n), d = Math.cos(o), m = Math.sin(o), y = 0.5 * (o - n), f = Math.sin(y * 0.5), w = 8 / 3 * f * f / Math.sin(y), G = t + Q - w * E, R = i + E + w * Q, F = t + d, Z = i + m, c = F + w * m, J = Z - w * d;
  return hz[e] = [a * G + C * R, B * G + l * R, a * c + C * J, B * c + l * J, a * F + C * Z, B * F + l * Z];
}
const pa = ["l", 0, 0, 0, 0, 0, 0, 0];
function XRe(A, e, t) {
  const i = pa[0] = A[0];
  if (i === "a" || i === "A")
    pa[1] = e * A[1], pa[2] = t * A[2], pa[3] = A[3], pa[4] = A[4], pa[5] = A[5], pa[6] = e * A[6], pa[7] = t * A[7];
  else if (i === "h" || i === "H")
    pa[1] = e * A[1];
  else if (i === "v" || i === "V")
    pa[1] = t * A[1];
  else
    for (var n = 1, o = A.length; n < o; ++n)
      pa[n] = (n % 2 == 1 ? e : t) * A[n];
  return pa;
}
function PY(A, e, t, i, n, o) {
  var g, s = null, I = 0, r = 0, a = 0, C = 0, B, l, Q, E, d = 0, m = 0;
  t == null && (t = 0), i == null && (i = 0), n == null && (n = 1), o == null && (o = n), A.beginPath && A.beginPath();
  for (var y = 0, f = e.length; y < f; ++y) {
    switch (g = e[y], (n !== 1 || o !== 1) && (g = XRe(g, n, o)), g[0]) {
      case "l":
        I += g[1], r += g[2], A.lineTo(I + t, r + i);
        break;
      case "L":
        I = g[1], r = g[2], A.lineTo(I + t, r + i);
        break;
      case "h":
        I += g[1], A.lineTo(I + t, r + i);
        break;
      case "H":
        I = g[1], A.lineTo(I + t, r + i);
        break;
      case "v":
        r += g[1], A.lineTo(I + t, r + i);
        break;
      case "V":
        r = g[1], A.lineTo(I + t, r + i);
        break;
      case "m":
        I += g[1], r += g[2], d = I, m = r, A.moveTo(I + t, r + i);
        break;
      case "M":
        I = g[1], r = g[2], d = I, m = r, A.moveTo(I + t, r + i);
        break;
      case "c":
        B = I + g[5], l = r + g[6], a = I + g[3], C = r + g[4], A.bezierCurveTo(
          I + g[1] + t,
          // x1
          r + g[2] + i,
          // y1
          a + t,
          // x2
          C + i,
          // y2
          B + t,
          l + i
        ), I = B, r = l;
        break;
      case "C":
        I = g[5], r = g[6], a = g[3], C = g[4], A.bezierCurveTo(g[1] + t, g[2] + i, a + t, C + i, I + t, r + i);
        break;
      case "s":
        B = I + g[3], l = r + g[4], a = 2 * I - a, C = 2 * r - C, A.bezierCurveTo(a + t, C + i, I + g[1] + t, r + g[2] + i, B + t, l + i), a = I + g[1], C = r + g[2], I = B, r = l;
        break;
      case "S":
        B = g[3], l = g[4], a = 2 * I - a, C = 2 * r - C, A.bezierCurveTo(a + t, C + i, g[1] + t, g[2] + i, B + t, l + i), I = B, r = l, a = g[1], C = g[2];
        break;
      case "q":
        B = I + g[3], l = r + g[4], a = I + g[1], C = r + g[2], A.quadraticCurveTo(a + t, C + i, B + t, l + i), I = B, r = l;
        break;
      case "Q":
        B = g[3], l = g[4], A.quadraticCurveTo(g[1] + t, g[2] + i, B + t, l + i), I = B, r = l, a = g[1], C = g[2];
        break;
      case "t":
        B = I + g[1], l = r + g[2], s[0].match(/[QqTt]/) === null ? (a = I, C = r) : s[0] === "t" ? (a = 2 * I - Q, C = 2 * r - E) : s[0] === "q" && (a = 2 * I - a, C = 2 * r - C), Q = a, E = C, A.quadraticCurveTo(a + t, C + i, B + t, l + i), I = B, r = l, a = I + g[1], C = r + g[2];
        break;
      case "T":
        B = g[1], l = g[2], a = 2 * I - a, C = 2 * r - C, A.quadraticCurveTo(a + t, C + i, B + t, l + i), I = B, r = l;
        break;
      case "a":
        yEA(A, I + t, r + i, [g[1], g[2], g[3], g[4], g[5], g[6] + I + t, g[7] + r + i]), I += g[6], r += g[7];
        break;
      case "A":
        yEA(A, I + t, r + i, [g[1], g[2], g[3], g[4], g[5], g[6] + t, g[7] + i]), I = g[6], r = g[7];
        break;
      case "z":
      case "Z":
        I = d, r = m, A.closePath();
        break;
    }
    s = g;
  }
}
function yEA(A, e, t, i) {
  const n = URe(
    i[5],
    // end x
    i[6],
    // end y
    i[0],
    // radius x
    i[1],
    // radius y
    i[3],
    // large flag
    i[4],
    // sweep flag
    i[2],
    // rotation
    e,
    t
  );
  for (let o = 0; o < n.length; ++o) {
    const g = VRe(n[o]);
    A.bezierCurveTo(g[0], g[1], g[2], g[3], g[4], g[5]);
  }
}
const bEA = 0.5773502691896257, wEA = {
  circle: {
    draw: function(A, e) {
      const t = Math.sqrt(e) / 2;
      A.moveTo(t, 0), A.arc(0, 0, t, 0, EB);
    }
  },
  cross: {
    draw: function(A, e) {
      var t = Math.sqrt(e) / 2, i = t / 2.5;
      A.moveTo(-t, -i), A.lineTo(-t, i), A.lineTo(-i, i), A.lineTo(-i, t), A.lineTo(i, t), A.lineTo(i, i), A.lineTo(t, i), A.lineTo(t, -i), A.lineTo(i, -i), A.lineTo(i, -t), A.lineTo(-i, -t), A.lineTo(-i, -i), A.closePath();
    }
  },
  diamond: {
    draw: function(A, e) {
      const t = Math.sqrt(e) / 2;
      A.moveTo(-t, 0), A.lineTo(0, -t), A.lineTo(t, 0), A.lineTo(0, t), A.closePath();
    }
  },
  square: {
    draw: function(A, e) {
      var t = Math.sqrt(e), i = -t / 2;
      A.rect(i, i, t, t);
    }
  },
  arrow: {
    draw: function(A, e) {
      var t = Math.sqrt(e) / 2, i = t / 7, n = t / 2.5, o = t / 8;
      A.moveTo(-i, t), A.lineTo(i, t), A.lineTo(i, -o), A.lineTo(n, -o), A.lineTo(0, -t), A.lineTo(-n, -o), A.lineTo(-i, -o), A.closePath();
    }
  },
  wedge: {
    draw: function(A, e) {
      var t = Math.sqrt(e) / 2, i = By * t, n = i - t * bEA, o = t / 4;
      A.moveTo(0, -i - n), A.lineTo(-o, i - n), A.lineTo(o, i - n), A.closePath();
    }
  },
  triangle: {
    draw: function(A, e) {
      var t = Math.sqrt(e) / 2, i = By * t, n = i - t * bEA;
      A.moveTo(0, -i - n), A.lineTo(-t, i - n), A.lineTo(t, i - n), A.closePath();
    }
  },
  "triangle-up": {
    draw: function(A, e) {
      var t = Math.sqrt(e) / 2, i = By * t;
      A.moveTo(0, -i), A.lineTo(-t, i), A.lineTo(t, i), A.closePath();
    }
  },
  "triangle-down": {
    draw: function(A, e) {
      var t = Math.sqrt(e) / 2, i = By * t;
      A.moveTo(0, i), A.lineTo(-t, -i), A.lineTo(t, -i), A.closePath();
    }
  },
  "triangle-right": {
    draw: function(A, e) {
      var t = Math.sqrt(e) / 2, i = By * t;
      A.moveTo(i, 0), A.lineTo(-i, -t), A.lineTo(-i, t), A.closePath();
    }
  },
  "triangle-left": {
    draw: function(A, e) {
      var t = Math.sqrt(e) / 2, i = By * t;
      A.moveTo(-i, 0), A.lineTo(i, -t), A.lineTo(i, t), A.closePath();
    }
  },
  stroke: {
    draw: function(A, e) {
      const t = Math.sqrt(e) / 2;
      A.moveTo(-t, 0), A.lineTo(t, 0);
    }
  }
};
function ZtA(A) {
  return Ze(wEA, A) ? wEA[A] : zRe(A);
}
var mz = {};
function zRe(A) {
  if (!Ze(mz, A)) {
    const e = wf(A);
    mz[A] = {
      draw: function(t, i) {
        PY(t, e, 0, 0, Math.sqrt(i) / 2);
      }
    };
  }
  return mz[A];
}
const EE = 0.448084975506;
function TRe(A) {
  return A.x;
}
function _Re(A) {
  return A.y;
}
function qRe(A) {
  return A.width;
}
function ORe(A) {
  return A.height;
}
function ic(A) {
  return typeof A == "function" ? A : () => +A;
}
function PM(A, e, t) {
  return Math.max(e, Math.min(A, t));
}
function DU() {
  var A = TRe, e = _Re, t = qRe, i = ORe, n = ic(0), o = n, g = n, s = n, I = null;
  function r(a, C, B) {
    var l, Q = C ?? +A.call(this, a), E = B ?? +e.call(this, a), d = +t.call(this, a), m = +i.call(this, a), y = Math.min(d, m) / 2, f = PM(+n.call(this, a), 0, y), w = PM(+o.call(this, a), 0, y), G = PM(+g.call(this, a), 0, y), R = PM(+s.call(this, a), 0, y);
    if (I || (I = l = uU()), f <= 0 && w <= 0 && G <= 0 && R <= 0)
      I.rect(Q, E, d, m);
    else {
      var F = Q + d, Z = E + m;
      I.moveTo(Q + f, E), I.lineTo(F - w, E), I.bezierCurveTo(F - EE * w, E, F, E + EE * w, F, E + w), I.lineTo(F, Z - R), I.bezierCurveTo(F, Z - EE * R, F - EE * R, Z, F - R, Z), I.lineTo(Q + G, Z), I.bezierCurveTo(Q + EE * G, Z, Q, Z - EE * G, Q, Z - G), I.lineTo(Q, E + f), I.bezierCurveTo(Q, E + EE * f, Q + EE * f, E, Q + f, E), I.closePath();
    }
    if (l)
      return I = null, l + "" || null;
  }
  return r.x = function(a) {
    return arguments.length ? (A = ic(a), r) : A;
  }, r.y = function(a) {
    return arguments.length ? (e = ic(a), r) : e;
  }, r.width = function(a) {
    return arguments.length ? (t = ic(a), r) : t;
  }, r.height = function(a) {
    return arguments.length ? (i = ic(a), r) : i;
  }, r.cornerRadius = function(a, C, B, l) {
    return arguments.length ? (n = ic(a), o = C != null ? ic(C) : n, s = B != null ? ic(B) : n, g = l != null ? ic(l) : o, r) : n;
  }, r.context = function(a) {
    return arguments.length ? (I = a ?? null, r) : I;
  }, r;
}
function WtA() {
  var A, e, t, i, n = null, o, g, s, I;
  function r(C, B, l) {
    const Q = l / 2;
    if (o) {
      var E = s - B, d = C - g;
      if (E || d) {
        var m = Math.hypot(E, d), y = (E /= m) * I, f = (d /= m) * I, w = Math.atan2(d, E);
        n.moveTo(g - y, s - f), n.lineTo(C - E * Q, B - d * Q), n.arc(C, B, Q, w - Math.PI, w), n.lineTo(g + y, s + f), n.arc(g, s, I, w, w + Math.PI);
      } else
        n.arc(C, B, Q, 0, EB);
      n.closePath();
    } else
      o = 1;
    g = C, s = B, I = Q;
  }
  function a(C) {
    var B, l = C.length, Q, E = !1, d;
    for (n == null && (n = d = uU()), B = 0; B <= l; ++B)
      !(B < l && i(Q = C[B], B, C)) === E && (E = !E) && (o = 0), E && r(+A(Q, B, C), +e(Q, B, C), +t(Q, B, C));
    if (d)
      return n = null, d + "" || null;
  }
  return a.x = function(C) {
    return arguments.length ? (A = C, a) : A;
  }, a.y = function(C) {
    return arguments.length ? (e = C, a) : e;
  }, a.size = function(C) {
    return arguments.length ? (t = C, a) : t;
  }, a.defined = function(C) {
    return arguments.length ? (i = C, a) : i;
  }, a.context = function(C) {
    return arguments.length ? (C == null ? n = null : n = C, a) : n;
  }, a;
}
function dF(A, e) {
  return A ?? e;
}
const hF = (A) => A.x || 0, mF = (A) => A.y || 0, jRe = (A) => A.width || 0, PRe = (A) => A.height || 0, $Re = (A) => (A.x || 0) + (A.width || 0), AFe = (A) => (A.y || 0) + (A.height || 0), eFe = (A) => A.startAngle || 0, tFe = (A) => A.endAngle || 0, iFe = (A) => A.padAngle || 0, nFe = (A) => A.innerRadius || 0, oFe = (A) => A.outerRadius || 0, gFe = (A) => A.cornerRadius || 0, sFe = (A) => dF(A.cornerRadiusTopLeft, A.cornerRadius) || 0, IFe = (A) => dF(A.cornerRadiusTopRight, A.cornerRadius) || 0, aFe = (A) => dF(A.cornerRadiusBottomRight, A.cornerRadius) || 0, rFe = (A) => dF(A.cornerRadiusBottomLeft, A.cornerRadius) || 0, CFe = (A) => dF(A.size, 64), BFe = (A) => A.size || 1, GU = (A) => A.defined !== !1, lFe = (A) => ZtA(A.shape || "circle"), cFe = VLA().startAngle(eFe).endAngle(tFe).padAngle(iFe).innerRadius(nFe).outerRadius(oFe).cornerRadius(gFe), QFe = hU().x(hF).y1(mF).y0(AFe).defined(GU), EFe = hU().y(mF).x1(hF).x0($Re).defined(GU), uFe = wtA().x(hF).y(mF).defined(GU), dFe = DU().x(hF).y(mF).width(jRe).height(PRe).cornerRadius(sFe, IFe, aFe, rFe), hFe = qLA().type(lFe).size(CFe), mFe = WtA().x(hF).y(mF).defined(GU).size(BFe);
function KtA(A) {
  return A.cornerRadius || A.cornerRadiusTopLeft || A.cornerRadiusTopRight || A.cornerRadiusBottomRight || A.cornerRadiusBottomLeft;
}
function pFe(A, e) {
  return cFe.context(A)(e);
}
function yFe(A, e) {
  const t = e[0], i = t.interpolate || "linear";
  return (t.orient === "horizontal" ? EFe : QFe).curve(uF(i, t.orient, t.tension)).context(A)(e);
}
function bFe(A, e) {
  const t = e[0], i = t.interpolate || "linear";
  return uFe.curve(uF(i, t.orient, t.tension)).context(A)(e);
}
function PD(A, e, t, i) {
  return dFe.context(A)(e, t, i);
}
function wFe(A, e) {
  return (e.mark.shape || e.shape).context(A)(e);
}
function fFe(A, e) {
  return hFe.context(A)(e);
}
function DFe(A, e) {
  return mFe.context(A)(e);
}
var YvA = 1;
function RvA() {
  YvA = 1;
}
function UtA(A, e, t) {
  var i = e.clip, n = A._defs, o = e.clip_id || (e.clip_id = "clip" + YvA++), g = n.clipping[o] || (n.clipping[o] = {
    id: o
  });
  return yt(i) ? g.path = i(null) : KtA(t) ? g.path = PD(null, t, 0, 0) : (g.width = t.width || 0, g.height = t.height || 0), "url(#" + o + ")";
}
function no(A) {
  this.clear(), A && this.union(A);
}
no.prototype = {
  clone() {
    return new no(this);
  },
  clear() {
    return this.x1 = +Number.MAX_VALUE, this.y1 = +Number.MAX_VALUE, this.x2 = -Number.MAX_VALUE, this.y2 = -Number.MAX_VALUE, this;
  },
  empty() {
    return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
  },
  equals(A) {
    return this.x1 === A.x1 && this.y1 === A.y1 && this.x2 === A.x2 && this.y2 === A.y2;
  },
  set(A, e, t, i) {
    return t < A ? (this.x2 = A, this.x1 = t) : (this.x1 = A, this.x2 = t), i < e ? (this.y2 = e, this.y1 = i) : (this.y1 = e, this.y2 = i), this;
  },
  add(A, e) {
    return A < this.x1 && (this.x1 = A), e < this.y1 && (this.y1 = e), A > this.x2 && (this.x2 = A), e > this.y2 && (this.y2 = e), this;
  },
  expand(A) {
    return this.x1 -= A, this.y1 -= A, this.x2 += A, this.y2 += A, this;
  },
  round() {
    return this.x1 = Math.floor(this.x1), this.y1 = Math.floor(this.y1), this.x2 = Math.ceil(this.x2), this.y2 = Math.ceil(this.y2), this;
  },
  scale(A) {
    return this.x1 *= A, this.y1 *= A, this.x2 *= A, this.y2 *= A, this;
  },
  translate(A, e) {
    return this.x1 += A, this.x2 += A, this.y1 += e, this.y2 += e, this;
  },
  rotate(A, e, t) {
    const i = this.rotatedPoints(A, e, t);
    return this.clear().add(i[0], i[1]).add(i[2], i[3]).add(i[4], i[5]).add(i[6], i[7]);
  },
  rotatedPoints(A, e, t) {
    var {
      x1: i,
      y1: n,
      x2: o,
      y2: g
    } = this, s = Math.cos(A), I = Math.sin(A), r = e - e * s + t * I, a = t - e * I - t * s;
    return [s * i - I * n + r, I * i + s * n + a, s * i - I * g + r, I * i + s * g + a, s * o - I * n + r, I * o + s * n + a, s * o - I * g + r, I * o + s * g + a];
  },
  union(A) {
    return A.x1 < this.x1 && (this.x1 = A.x1), A.y1 < this.y1 && (this.y1 = A.y1), A.x2 > this.x2 && (this.x2 = A.x2), A.y2 > this.y2 && (this.y2 = A.y2), this;
  },
  intersect(A) {
    return A.x1 > this.x1 && (this.x1 = A.x1), A.y1 > this.y1 && (this.y1 = A.y1), A.x2 < this.x2 && (this.x2 = A.x2), A.y2 < this.y2 && (this.y2 = A.y2), this;
  },
  encloses(A) {
    return A && this.x1 <= A.x1 && this.x2 >= A.x2 && this.y1 <= A.y1 && this.y2 >= A.y2;
  },
  alignsWith(A) {
    return A && (this.x1 == A.x1 || this.x2 == A.x2 || this.y1 == A.y1 || this.y2 == A.y2);
  },
  intersects(A) {
    return A && !(this.x2 < A.x1 || this.x1 > A.x2 || this.y2 < A.y1 || this.y1 > A.y2);
  },
  contains(A, e) {
    return !(A < this.x1 || A > this.x2 || e < this.y1 || e > this.y2);
  },
  width() {
    return this.x2 - this.x1;
  },
  height() {
    return this.y2 - this.y1;
  }
};
function kU(A) {
  this.mark = A, this.bounds = this.bounds || new no();
}
function JU(A) {
  kU.call(this, A), this.items = this.items || [];
}
Ae(JU, kU);
function VtA(A) {
  this._pending = 0, this._loader = A || oU();
}
function fEA(A) {
  A._pending += 1;
}
function bk(A) {
  A._pending -= 1;
}
VtA.prototype = {
  pending() {
    return this._pending;
  },
  sanitizeURL(A) {
    const e = this;
    return fEA(e), e._loader.sanitize(A, {
      context: "href"
    }).then((t) => (bk(e), t)).catch(() => (bk(e), null));
  },
  loadImage(A) {
    const e = this, t = gRe();
    return fEA(e), e._loader.sanitize(A, {
      context: "image"
    }).then((i) => {
      const n = i.href;
      if (!n || !t)
        throw {
          url: n
        };
      const o = new t(), g = Ze(i, "crossOrigin") ? i.crossOrigin : "anonymous";
      return g != null && (o.crossOrigin = g), o.onload = () => bk(e), o.onerror = () => bk(e), o.src = n, o;
    }).catch((i) => (bk(e), {
      complete: !1,
      width: 0,
      height: 0,
      src: i && i.url || ""
    }));
  },
  ready() {
    const A = this;
    return new Promise((e) => {
      function t(i) {
        A.pending() ? setTimeout(() => {
          t(!0);
        }, 10) : e(i);
      }
      t(!1);
    });
  }
};
function LQ(A, e, t) {
  if (e.stroke && e.opacity !== 0 && e.strokeOpacity !== 0) {
    const i = e.strokeWidth != null ? +e.strokeWidth : 1;
    A.expand(i + (t ? GFe(e, i) : 0));
  }
  return A;
}
function GFe(A, e) {
  return A.strokeJoin && A.strokeJoin !== "miter" ? 0 : e;
}
const kFe = EB - 1e-8;
let NU, XL, zL, cm, jO, TL, PO, $O;
const jE = (A, e) => NU.add(A, e), _L = (A, e) => jE(XL = A, zL = e), DEA = (A) => jE(A, NU.y1), GEA = (A) => jE(NU.x1, A), em = (A, e) => jO * A + PO * e, tm = (A, e) => TL * A + $O * e, pz = (A, e) => jE(em(A, e), tm(A, e)), yz = (A, e) => _L(em(A, e), tm(A, e));
function pF(A, e) {
  return NU = A, e ? (cm = e * Pu, jO = $O = Math.cos(cm), TL = Math.sin(cm), PO = -TL) : (jO = $O = 1, cm = TL = PO = 0), JFe;
}
const JFe = {
  beginPath() {
  },
  closePath() {
  },
  moveTo: yz,
  lineTo: yz,
  rect(A, e, t, i) {
    cm ? (pz(A + t, e), pz(A + t, e + i), pz(A, e + i), yz(A, e)) : (jE(A + t, e + i), _L(A, e));
  },
  quadraticCurveTo(A, e, t, i) {
    const n = em(A, e), o = tm(A, e), g = em(t, i), s = tm(t, i);
    kEA(XL, n, g, DEA), kEA(zL, o, s, GEA), _L(g, s);
  },
  bezierCurveTo(A, e, t, i, n, o) {
    const g = em(A, e), s = tm(A, e), I = em(t, i), r = tm(t, i), a = em(n, o), C = tm(n, o);
    JEA(XL, g, I, a, DEA), JEA(zL, s, r, C, GEA), _L(a, C);
  },
  arc(A, e, t, i, n, o) {
    if (i += cm, n += cm, XL = t * Math.cos(n) + A, zL = t * Math.sin(n) + e, Math.abs(n - i) > kFe)
      jE(A - t, e - t), jE(A + t, e + t);
    else {
      const g = (r) => jE(t * Math.cos(r) + A, t * Math.sin(r) + e);
      let s, I;
      if (g(i), g(n), n !== i)
        if (i = i % EB, i < 0 && (i += EB), n = n % EB, n < 0 && (n += EB), n < i && (o = !o, s = i, i = n, n = s), o)
          for (n -= EB, s = i - i % Am, I = 0; I < 4 && s > n; ++I, s -= Am)
            g(s);
        else
          for (s = i - i % Am + Am, I = 0; I < 4 && s < n; ++I, s = s + Am)
            g(s);
    }
  }
};
function kEA(A, e, t, i) {
  const n = (A - e) / (A + t - 2 * e);
  0 < n && n < 1 && i(A + (e - A) * n);
}
function JEA(A, e, t, i, n) {
  const o = i - A + 3 * e - 3 * t, g = A + t - 2 * e, s = A - e;
  let I = 0, r = 0, a;
  Math.abs(o) > KRe ? (a = g * g + s * o, a >= 0 && (a = Math.sqrt(a), I = (-g + a) / o, r = (-g - a) / o)) : I = 0.5 * s / g, 0 < I && I < 1 && n(NEA(I, A, e, t, i)), 0 < r && r < 1 && n(NEA(r, A, e, t, i));
}
function NEA(A, e, t, i, n) {
  const o = 1 - A, g = o * o, s = A * A;
  return g * o * e + 3 * g * A * t + 3 * o * s * i + s * A * n;
}
var Nu = (Nu = Ju(1, 1)) ? Nu.getContext("2d") : null;
const Aj = new no();
function XtA(A) {
  return function(e, t) {
    if (!Nu)
      return !0;
    A(Nu, e), Aj.clear().union(e.bounds).intersect(t).round();
    const {
      x1: i,
      y1: n,
      x2: o,
      y2: g
    } = Aj;
    for (let s = n; s <= g; ++s)
      for (let I = i; I <= o; ++I)
        if (Nu.isPointInPath(I, s))
          return !0;
    return !1;
  };
}
function ztA(A, e) {
  return e.contains(A.x || 0, A.y || 0);
}
function FvA(A, e) {
  const t = A.x || 0, i = A.y || 0, n = A.width || 0, o = A.height || 0;
  return e.intersects(Aj.set(t, i, t + n, i + o));
}
function MvA(A, e) {
  const t = A.x || 0, i = A.y || 0, n = A.x2 != null ? A.x2 : t, o = A.y2 != null ? A.y2 : i;
  return Sb(e, t, i, n, o);
}
function Sb(A, e, t, i, n) {
  const {
    x1: o,
    y1: g,
    x2: s,
    y2: I
  } = A, r = i - e, a = n - t;
  let C = 0, B = 1, l, Q, E, d;
  for (d = 0; d < 4; ++d) {
    if (d === 0 && (l = -r, Q = -(o - e)), d === 1 && (l = r, Q = s - e), d === 2 && (l = -a, Q = -(g - t)), d === 3 && (l = a, Q = I - t), Math.abs(l) < 1e-10 && Q < 0)
      return !1;
    if (E = Q / l, l < 0) {
      if (E > B)
        return !1;
      E > C && (C = E);
    } else if (l > 0) {
      if (E < C)
        return !1;
      E < B && (B = E);
    }
  }
  return !0;
}
function ff(A, e) {
  A.globalCompositeOperation = e.blend || "source-over";
}
function kr(A, e) {
  return A ?? e;
}
function YEA(A, e) {
  const t = e.length;
  for (let i = 0; i < t; ++i)
    A.addColorStop(e[i].offset, e[i].color);
  return A;
}
function NFe(A, e, t) {
  const i = t.width(), n = t.height();
  let o;
  if (e.gradient === "radial")
    o = A.createRadialGradient(t.x1 + kr(e.x1, 0.5) * i, t.y1 + kr(e.y1, 0.5) * n, Math.max(i, n) * kr(e.r1, 0), t.x1 + kr(e.x2, 0.5) * i, t.y1 + kr(e.y2, 0.5) * n, Math.max(i, n) * kr(e.r2, 0.5));
  else {
    const g = kr(e.x1, 0), s = kr(e.y1, 0), I = kr(e.x2, 1), r = kr(e.y2, 0);
    if (g === I || s === r || i === n)
      o = A.createLinearGradient(t.x1 + g * i, t.y1 + s * n, t.x1 + I * i, t.y1 + r * n);
    else {
      const a = Ju(Math.ceil(i), Math.ceil(n)), C = a.getContext("2d");
      return C.scale(i, n), C.fillStyle = YEA(C.createLinearGradient(g, s, I, r), e.stops), C.fillRect(0, 0, i, n), A.createPattern(a, "no-repeat");
    }
  }
  return YEA(o, e.stops);
}
function xvA(A, e, t) {
  return StA(t) ? NFe(A, t, e.bounds) : t;
}
function kS(A, e, t) {
  return t *= e.fillOpacity == null ? 1 : e.fillOpacity, t > 0 ? (A.globalAlpha = t, A.fillStyle = xvA(A, e, e.fill), !0) : !1;
}
var YFe = [];
function Df(A, e, t) {
  var i = (i = e.strokeWidth) != null ? i : 1;
  return i <= 0 ? !1 : (t *= e.strokeOpacity == null ? 1 : e.strokeOpacity, t > 0 ? (A.globalAlpha = t, A.strokeStyle = xvA(A, e, e.stroke), A.lineWidth = i, A.lineCap = e.strokeCap || "butt", A.lineJoin = e.strokeJoin || "miter", A.miterLimit = e.strokeMiterLimit || 10, A.setLineDash && (A.setLineDash(e.strokeDash || YFe), A.lineDashOffset = e.strokeDashOffset || 0), !0) : !1);
}
function RFe(A, e) {
  return A.zindex - e.zindex || A.index - e.index;
}
function TtA(A) {
  if (!A.zdirty)
    return A.zitems;
  var e = A.items, t = [], i, n, o;
  for (n = 0, o = e.length; n < o; ++n)
    i = e[n], i.index = n, i.zindex && t.push(i);
  return A.zdirty = !1, A.zitems = t.sort(RFe);
}
function Nn(A, e) {
  var t = A.items, i, n;
  if (!t || !t.length)
    return;
  const o = TtA(A);
  if (o && o.length) {
    for (i = 0, n = t.length; i < n; ++i)
      t[i].zindex || e(t[i]);
    t = o;
  }
  for (i = 0, n = t.length; i < n; ++i)
    e(t[i]);
}
function JS(A, e) {
  var t = A.items, i, n;
  if (!t || !t.length)
    return null;
  const o = TtA(A);
  for (o && o.length && (t = o), n = t.length; --n >= 0; )
    if (i = e(t[n]))
      return i;
  if (t === o) {
    for (t = A.items, n = t.length; --n >= 0; )
      if (!t[n].zindex && (i = e(t[n])))
        return i;
  }
  return null;
}
function _tA(A) {
  return function(e, t, i) {
    Nn(t, (n) => {
      (!i || i.intersects(n.bounds)) && LvA(A, e, n, n);
    });
  };
}
function FFe(A) {
  return function(e, t, i) {
    t.items.length && (!i || i.intersects(t.bounds)) && LvA(A, e, t.items[0], t.items);
  };
}
function LvA(A, e, t, i) {
  var n = t.opacity == null ? 1 : t.opacity;
  n !== 0 && (A(e, i) || (ff(e, t), t.fill && kS(e, t, n) && e.fill(), t.stroke && Df(e, t, n) && e.stroke()));
}
function YU(A) {
  return A = A || ir, function(e, t, i, n, o, g) {
    return i *= e.pixelRatio, n *= e.pixelRatio, JS(t, (s) => {
      const I = s.bounds;
      if (!(I && !I.contains(o, g) || !I) && A(e, s, i, n, o, g))
        return s;
    });
  };
}
function yF(A, e) {
  return function(t, i, n, o) {
    var g = Array.isArray(i) ? i[0] : i, s = e ?? g.fill, I = g.stroke && t.isPointInStroke, r, a;
    return I && (r = g.strokeWidth, a = g.strokeCap, t.lineWidth = r ?? 1, t.lineCap = a ?? "butt"), A(t, i) ? !1 : s && t.isPointInPath(n, o) || I && t.isPointInStroke(n, o);
  };
}
function qtA(A) {
  return YU(yF(A));
}
function Lm(A, e) {
  return "translate(" + A + "," + e + ")";
}
function OtA(A) {
  return "rotate(" + A + ")";
}
function MFe(A, e) {
  return "scale(" + A + "," + e + ")";
}
function vvA(A) {
  return Lm(A.x || 0, A.y || 0);
}
function xFe(A) {
  return Lm(A.x || 0, A.y || 0) + (A.angle ? " " + OtA(A.angle) : "");
}
function LFe(A) {
  return Lm(A.x || 0, A.y || 0) + (A.angle ? " " + OtA(A.angle) : "") + (A.scaleX || A.scaleY ? " " + MFe(A.scaleX || 1, A.scaleY || 1) : "");
}
function jtA(A, e, t) {
  function i(g, s) {
    g("transform", xFe(s)), g("d", e(null, s));
  }
  function n(g, s) {
    return e(pF(g, s.angle), s), LQ(g, s).translate(s.x || 0, s.y || 0);
  }
  function o(g, s) {
    var I = s.x || 0, r = s.y || 0, a = s.angle || 0;
    g.translate(I, r), a && g.rotate(a *= Pu), g.beginPath(), e(g, s), a && g.rotate(-a), g.translate(-I, -r);
  }
  return {
    type: A,
    tag: "path",
    nested: !1,
    attr: i,
    bound: n,
    draw: _tA(o),
    pick: qtA(o),
    isect: t || XtA(o)
  };
}
var vFe = jtA("arc", pFe);
function HFe(A, e) {
  for (var t = A[0].orient === "horizontal" ? e[1] : e[0], i = A[0].orient === "horizontal" ? "y" : "x", n = A.length, o = 1 / 0, g, s; --n >= 0; )
    A[n].defined !== !1 && (s = Math.abs(A[n][i] - t), s < o && (o = s, g = A[n]));
  return g;
}
function SFe(A, e) {
  for (var t = Math.pow(A[0].strokeWidth || 1, 2), i = A.length, n, o, g; --i >= 0; )
    if (A[i].defined !== !1 && (n = A[i].x - e[0], o = A[i].y - e[1], g = n * n + o * o, g < t))
      return A[i];
  return null;
}
function ZFe(A, e) {
  for (var t = A.length, i, n, o; --t >= 0; )
    if (A[t].defined !== !1 && (i = A[t].x - e[0], n = A[t].y - e[1], o = i * i + n * n, i = A[t].size || 1, o < i * i))
      return A[t];
  return null;
}
function PtA(A, e, t) {
  function i(I, r) {
    var a = r.mark.items;
    a.length && I("d", e(null, a));
  }
  function n(I, r) {
    var a = r.items;
    return a.length === 0 ? I : (e(pF(I), a), LQ(I, a[0]));
  }
  function o(I, r) {
    I.beginPath(), e(I, r);
  }
  const g = yF(o);
  function s(I, r, a, C, B, l) {
    var Q = r.items, E = r.bounds;
    return !Q || !Q.length || E && !E.contains(B, l) ? null : (a *= I.pixelRatio, C *= I.pixelRatio, g(I, Q, a, C) ? Q[0] : null);
  }
  return {
    type: A,
    tag: "path",
    nested: !0,
    attr: i,
    bound: n,
    draw: FFe(o),
    pick: s,
    isect: ztA,
    tip: t
  };
}
var WFe = PtA("area", yFe, HFe);
function KFe(A, e) {
  var t = e.clip;
  A.save(), yt(t) ? (A.beginPath(), t(A), A.clip()) : HvA(A, e.group);
}
function HvA(A, e) {
  A.beginPath(), KtA(e) ? PD(A, e, 0, 0) : A.rect(0, 0, e.width || 0, e.height || 0), A.clip();
}
function SvA(A) {
  const e = kr(A.strokeWidth, 1);
  return A.strokeOffset != null ? A.strokeOffset : A.stroke && e > 0.5 && e < 1.5 ? 0.5 - Math.abs(e - 1) : 0;
}
function UFe(A, e) {
  A("transform", vvA(e));
}
function ZvA(A, e) {
  const t = SvA(e);
  A("d", PD(null, e, t, t));
}
function VFe(A, e) {
  A("class", "background"), A("aria-hidden", !0), ZvA(A, e);
}
function XFe(A, e) {
  A("class", "foreground"), A("aria-hidden", !0), e.strokeForeground ? ZvA(A, e) : A("d", "");
}
function zFe(A, e, t) {
  const i = e.clip ? UtA(t, e, e) : null;
  A("clip-path", i);
}
function TFe(A, e) {
  if (!e.clip && e.items) {
    const t = e.items, i = t.length;
    for (let n = 0; n < i; ++n)
      A.union(t[n].bounds);
  }
  return (e.clip || e.width || e.height) && !e.noBound && A.add(0, 0).add(e.width || 0, e.height || 0), LQ(A, e), A.translate(e.x || 0, e.y || 0);
}
function $Y(A, e, t, i) {
  const n = SvA(e);
  A.beginPath(), PD(A, e, (t || 0) + n, (i || 0) + n);
}
const _Fe = yF($Y), qFe = yF($Y, !1), OFe = yF($Y, !0);
function jFe(A, e, t, i) {
  Nn(e, (n) => {
    const o = n.x || 0, g = n.y || 0, s = n.strokeForeground, I = n.opacity == null ? 1 : n.opacity;
    (n.stroke || n.fill) && I && ($Y(A, n, o, g), ff(A, n), n.fill && kS(A, n, I) && A.fill(), n.stroke && !s && Df(A, n, I) && A.stroke()), A.save(), A.translate(o, g), n.clip && HvA(A, n), t && t.translate(-o, -g), Nn(n, (r) => {
      (r.marktype === "group" || i == null || i.includes(r.marktype)) && this.draw(A, r, t, i);
    }), t && t.translate(o, g), A.restore(), s && n.stroke && I && ($Y(A, n, o, g), ff(A, n), Df(A, n, I) && A.stroke());
  });
}
function PFe(A, e, t, i, n, o) {
  if (e.bounds && !e.bounds.contains(n, o) || !e.items)
    return null;
  const g = t * A.pixelRatio, s = i * A.pixelRatio;
  return JS(e, (I) => {
    let r, a, C;
    const B = I.bounds;
    if (B && !B.contains(n, o))
      return;
    a = I.x || 0, C = I.y || 0;
    const l = a + (I.width || 0), Q = C + (I.height || 0), E = I.clip;
    if (E && (n < a || n > l || o < C || o > Q))
      return;
    if (A.save(), A.translate(a, C), a = n - a, C = o - C, E && KtA(I) && !OFe(A, I, g, s))
      return A.restore(), null;
    const d = I.strokeForeground, m = e.interactive !== !1;
    return m && d && I.stroke && qFe(A, I, g, s) ? (A.restore(), I) : (r = JS(I, (y) => $Fe(y, a, C) ? this.pick(y, t, i, a, C) : null), !r && m && (I.fill || !d && I.stroke) && _Fe(A, I, g, s) && (r = I), A.restore(), r || null);
  });
}
function $Fe(A, e, t) {
  return (A.interactive !== !1 || A.marktype === "group") && A.bounds && A.bounds.contains(e, t);
}
var A1e = {
  type: "group",
  tag: "g",
  nested: !1,
  attr: UFe,
  bound: TFe,
  draw: jFe,
  pick: PFe,
  isect: FvA,
  content: zFe,
  background: VFe,
  foreground: XFe
}, A2 = {
  xmlns: "http://www.w3.org/2000/svg",
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
  version: "1.1"
};
function $tA(A, e) {
  var t = A.image;
  return (!t || A.url && A.url !== t.url) && (t = {
    complete: !1,
    width: 0,
    height: 0
  }, e.loadImage(A.url).then((i) => {
    A.image = i, A.image.url = A.url;
  })), t;
}
function AiA(A, e) {
  return A.width != null ? A.width : !e || !e.width ? 0 : A.aspect !== !1 && A.height ? A.height * e.width / e.height : e.width;
}
function eiA(A, e) {
  return A.height != null ? A.height : !e || !e.height ? 0 : A.aspect !== !1 && A.width ? A.width * e.height / e.width : e.height;
}
function RU(A, e) {
  return A === "center" ? e / 2 : A === "right" ? e : 0;
}
function FU(A, e) {
  return A === "middle" ? e / 2 : A === "bottom" ? e : 0;
}
function e1e(A, e, t) {
  const i = $tA(e, t), n = AiA(e, i), o = eiA(e, i), g = (e.x || 0) - RU(e.align, n), s = (e.y || 0) - FU(e.baseline, o), I = !i.src && i.toDataURL ? i.toDataURL() : i.src || "";
  A("href", I, A2["xmlns:xlink"], "xlink:href"), A("transform", Lm(g, s)), A("width", n), A("height", o), A("preserveAspectRatio", e.aspect === !1 ? "none" : "xMidYMid");
}
function t1e(A, e) {
  const t = e.image, i = AiA(e, t), n = eiA(e, t), o = (e.x || 0) - RU(e.align, i), g = (e.y || 0) - FU(e.baseline, n);
  return A.set(o, g, o + i, g + n);
}
function i1e(A, e, t) {
  Nn(e, (i) => {
    if (t && !t.intersects(i.bounds))
      return;
    const n = $tA(i, this);
    let o = AiA(i, n), g = eiA(i, n);
    if (o === 0 || g === 0)
      return;
    let s = (i.x || 0) - RU(i.align, o), I = (i.y || 0) - FU(i.baseline, g), r, a, C, B;
    i.aspect !== !1 && (a = n.width / n.height, C = i.width / i.height, a === a && C === C && a !== C && (C < a ? (B = o / a, I += (g - B) / 2, g = B) : (B = g * a, s += (o - B) / 2, o = B))), (n.complete || n.toDataURL) && (ff(A, i), A.globalAlpha = (r = i.opacity) != null ? r : 1, A.imageSmoothingEnabled = i.smooth !== !1, A.drawImage(n, s, I, o, g));
  });
}
var n1e = {
  type: "image",
  tag: "image",
  nested: !1,
  attr: e1e,
  bound: t1e,
  draw: i1e,
  pick: YU(),
  isect: ir,
  // bounds check is sufficient
  get: $tA,
  xOffset: RU,
  yOffset: FU
}, o1e = PtA("line", bFe, SFe);
function g1e(A, e) {
  var t = e.scaleX || 1, i = e.scaleY || 1;
  (t !== 1 || i !== 1) && A("vector-effect", "non-scaling-stroke"), A("transform", LFe(e)), A("d", e.path);
}
function qL(A, e) {
  var t = e.path;
  if (t == null)
    return !0;
  var i = e.x || 0, n = e.y || 0, o = e.scaleX || 1, g = e.scaleY || 1, s = (e.angle || 0) * Pu, I = e.pathCache;
  (!I || I.path !== t) && ((e.pathCache = I = wf(t)).path = t), s && A.rotate && A.translate ? (A.translate(i, n), A.rotate(s), PY(A, I, 0, 0, o, g), A.rotate(-s), A.translate(-i, -n)) : PY(A, I, i, n, o, g);
}
function s1e(A, e) {
  return qL(pF(A, e.angle), e) ? A.set(0, 0, 0, 0) : LQ(A, e, !0);
}
var I1e = {
  type: "path",
  tag: "path",
  nested: !1,
  attr: g1e,
  bound: s1e,
  draw: _tA(qL),
  pick: qtA(qL),
  isect: XtA(qL)
};
function a1e(A, e) {
  A("d", PD(null, e));
}
function r1e(A, e) {
  var t, i;
  return LQ(A.set(t = e.x || 0, i = e.y || 0, t + e.width || 0, i + e.height || 0), e);
}
function REA(A, e) {
  A.beginPath(), PD(A, e);
}
var C1e = {
  type: "rect",
  tag: "path",
  nested: !1,
  attr: a1e,
  bound: r1e,
  draw: _tA(REA),
  pick: qtA(REA),
  isect: FvA
};
function B1e(A, e) {
  A("transform", vvA(e)), A("x2", e.x2 != null ? e.x2 - (e.x || 0) : 0), A("y2", e.y2 != null ? e.y2 - (e.y || 0) : 0);
}
function l1e(A, e) {
  var t, i;
  return LQ(A.set(t = e.x || 0, i = e.y || 0, e.x2 != null ? e.x2 : t, e.y2 != null ? e.y2 : i), e);
}
function WvA(A, e, t) {
  var i, n, o, g;
  return e.stroke && Df(A, e, t) ? (i = e.x || 0, n = e.y || 0, o = e.x2 != null ? e.x2 : i, g = e.y2 != null ? e.y2 : n, A.beginPath(), A.moveTo(i, n), A.lineTo(o, g), !0) : !1;
}
function c1e(A, e, t) {
  Nn(e, (i) => {
    if (!(t && !t.intersects(i.bounds))) {
      var n = i.opacity == null ? 1 : i.opacity;
      n && WvA(A, i, n) && (ff(A, i), A.stroke());
    }
  });
}
function Q1e(A, e, t, i) {
  return A.isPointInStroke ? WvA(A, e, 1) && A.isPointInStroke(t, i) : !1;
}
var E1e = {
  type: "rule",
  tag: "line",
  nested: !1,
  attr: B1e,
  bound: l1e,
  draw: c1e,
  pick: YU(Q1e),
  isect: MvA
}, u1e = jtA("shape", wFe), d1e = jtA("symbol", fFe, ztA);
const FEA = CxA();
var zI = {
  height: Dl,
  measureWidth: tiA,
  estimateWidth: NS,
  width: NS,
  canvas: KvA
};
KvA(!0);
function KvA(A) {
  zI.width = A && Nu ? tiA : NS;
}
function NS(A, e) {
  return UvA(Ad(A, e), Dl(A));
}
function UvA(A, e) {
  return ~~(0.8 * A.length * e);
}
function tiA(A, e) {
  return Dl(A) <= 0 || !(e = Ad(A, e)) ? 0 : VvA(e, MU(A));
}
function VvA(A, e) {
  const t = `(${e}) ${A}`;
  let i = FEA.get(t);
  return i === void 0 && (Nu.font = e, i = Nu.measureText(A).width, FEA.set(t, i)), i;
}
function Dl(A) {
  return A.fontSize != null ? +A.fontSize || 0 : 11;
}
function $u(A) {
  return A.lineHeight != null ? A.lineHeight : Dl(A) + 2;
}
function h1e(A) {
  return ZA(A) ? A.length > 1 ? A : A[0] : A;
}
function bF(A) {
  return h1e(A.lineBreak && A.text && !ZA(A.text) ? A.text.split(A.lineBreak) : A.text);
}
function iiA(A) {
  const e = bF(A);
  return (ZA(e) ? e.length - 1 : 0) * $u(A);
}
function Ad(A, e) {
  const t = e == null ? "" : (e + "").trim();
  return A.limit > 0 && t.length ? p1e(A, t) : t;
}
function m1e(A) {
  if (zI.width === tiA) {
    const e = MU(A);
    return (t) => VvA(t, e);
  } else if (zI.width === NS) {
    const e = Dl(A);
    return (t) => UvA(t, e);
  } else
    return (e) => zI.width(A, e);
}
function p1e(A, e) {
  var t = +A.limit, i = m1e(A);
  if (i(e) < t)
    return e;
  var n = A.ellipsis || "…", o = A.dir === "rtl", g = 0, s = e.length, I;
  if (t -= i(n), o) {
    for (; g < s; )
      I = g + s >>> 1, i(e.slice(I)) > t ? g = I + 1 : s = I;
    return n + e.slice(g);
  } else {
    for (; g < s; )
      I = 1 + (g + s >>> 1), i(e.slice(0, I)) < t ? g = I : s = I - 1;
    return e.slice(0, g) + n;
  }
}
function wF(A, e) {
  var t = A.font;
  return (e && t ? String(t).replace(/"/g, "'") : t) || "sans-serif";
}
function MU(A, e) {
  return (A.fontStyle ? A.fontStyle + " " : "") + (A.fontVariant ? A.fontVariant + " " : "") + (A.fontWeight ? A.fontWeight + " " : "") + Dl(A) + "px " + wF(A, e);
}
function niA(A) {
  var e = A.baseline, t = Dl(A);
  return Math.round(e === "top" ? 0.79 * t : e === "middle" ? 0.3 * t : e === "bottom" ? -0.21 * t : e === "line-top" ? 0.29 * t + 0.5 * $u(A) : e === "line-bottom" ? 0.29 * t - 0.5 * $u(A) : 0);
}
const y1e = {
  left: "start",
  center: "middle",
  right: "end"
}, mN = new no();
function xU(A) {
  var e = A.x || 0, t = A.y || 0, i = A.radius || 0, n;
  return i && (n = (A.theta || 0) - Am, e += i * Math.cos(n), t += i * Math.sin(n)), mN.x1 = e, mN.y1 = t, mN;
}
function b1e(A, e) {
  var t = e.dx || 0, i = (e.dy || 0) + niA(e), n = xU(e), o = n.x1, g = n.y1, s = e.angle || 0, I;
  A("text-anchor", y1e[e.align] || "start"), s ? (I = Lm(o, g) + " " + OtA(s), (t || i) && (I += " " + Lm(t, i))) : I = Lm(o + t, g + i), A("transform", I);
}
function oiA(A, e, t) {
  var i = zI.height(e), n = e.align, o = xU(e), g = o.x1, s = o.y1, I = e.dx || 0, r = (e.dy || 0) + niA(e) - Math.round(0.8 * i), a = bF(e), C;
  if (ZA(a) ? (i += $u(e) * (a.length - 1), C = a.reduce((B, l) => Math.max(B, zI.width(e, l)), 0)) : C = zI.width(e, a), n === "center" ? I -= C / 2 : n === "right" && (I -= C), A.set(I += g, r += s, I + C, r + i), e.angle && !t)
    A.rotate(e.angle * Pu, g, s);
  else if (t === 2)
    return A.rotatedPoints(e.angle * Pu, g, s);
  return A;
}
function w1e(A, e, t) {
  Nn(e, (i) => {
    var n = i.opacity == null ? 1 : i.opacity, o, g, s, I, r, a, C;
    if (!(t && !t.intersects(i.bounds) || // bounds check
    n === 0 || i.fontSize <= 0 || i.text == null || i.text.length === 0)) {
      if (A.font = MU(i), A.textAlign = i.align || "left", o = xU(i), g = o.x1, s = o.y1, i.angle && (A.save(), A.translate(g, s), A.rotate(i.angle * Pu), g = s = 0), g += i.dx || 0, s += (i.dy || 0) + niA(i), a = bF(i), ff(A, i), ZA(a))
        for (r = $u(i), I = 0; I < a.length; ++I)
          C = Ad(i, a[I]), i.fill && kS(A, i, n) && A.fillText(C, g, s), i.stroke && Df(A, i, n) && A.strokeText(C, g, s), s += r;
      else
        C = Ad(i, a), i.fill && kS(A, i, n) && A.fillText(C, g, s), i.stroke && Df(A, i, n) && A.strokeText(C, g, s);
      i.angle && A.restore();
    }
  });
}
function f1e(A, e, t, i, n, o) {
  if (e.fontSize <= 0)
    return !1;
  if (!e.angle)
    return !0;
  var g = xU(e), s = g.x1, I = g.y1, r = oiA(mN, e, 1), a = -e.angle * Pu, C = Math.cos(a), B = Math.sin(a), l = C * n - B * o + (s - C * s + B * I), Q = B * n + C * o + (I - B * s - C * I);
  return r.contains(l, Q);
}
function D1e(A, e) {
  const t = oiA(mN, A, 2);
  return Sb(e, t[0], t[1], t[2], t[3]) || Sb(e, t[0], t[1], t[4], t[5]) || Sb(e, t[4], t[5], t[6], t[7]) || Sb(e, t[2], t[3], t[6], t[7]);
}
var G1e = {
  type: "text",
  tag: "text",
  nested: !1,
  attr: b1e,
  bound: oiA,
  draw: w1e,
  pick: YU(f1e),
  isect: D1e
}, k1e = PtA("trail", DFe, ZFe), Rg = {
  arc: vFe,
  area: WFe,
  group: A1e,
  image: n1e,
  line: o1e,
  path: I1e,
  rect: C1e,
  rule: E1e,
  shape: u1e,
  symbol: d1e,
  text: G1e,
  trail: k1e
};
function ej(A, e, t) {
  var i = Rg[A.mark.marktype], n = e || i.bound;
  return i.nested && (A = A.mark), n(A.bounds || (A.bounds = new no()), A, t);
}
var MEA = {
  mark: null
};
function XvA(A, e, t) {
  var i = Rg[A.marktype], n = i.bound, o = A.items, g = o && o.length, s, I, r, a;
  if (i.nested)
    return g ? r = o[0] : (MEA.mark = A, r = MEA), a = ej(r, n, t), e = e && e.union(a) || a, e;
  if (e = e || A.bounds && A.bounds.clear() || new no(), g)
    for (s = 0, I = o.length; s < I; ++s)
      e.union(ej(o[s], n, t));
  return A.bounds = e;
}
const J1e = [
  "marktype",
  "name",
  "role",
  "interactive",
  "clip",
  "items",
  "zindex",
  "x",
  "y",
  "width",
  "height",
  "align",
  "baseline",
  // layout
  "fill",
  "fillOpacity",
  "opacity",
  "blend",
  // fill
  "stroke",
  "strokeOpacity",
  "strokeWidth",
  "strokeCap",
  // stroke
  "strokeDash",
  "strokeDashOffset",
  // stroke dash
  "strokeForeground",
  "strokeOffset",
  // group
  "startAngle",
  "endAngle",
  "innerRadius",
  "outerRadius",
  // arc
  "cornerRadius",
  "padAngle",
  // arc, rect
  "cornerRadiusTopLeft",
  "cornerRadiusTopRight",
  // rect, group
  "cornerRadiusBottomLeft",
  "cornerRadiusBottomRight",
  "interpolate",
  "tension",
  "orient",
  "defined",
  // area, line
  "url",
  "aspect",
  "smooth",
  // image
  "path",
  "scaleX",
  "scaleY",
  // path
  "x2",
  "y2",
  // rule
  "size",
  "shape",
  // symbol
  "text",
  "angle",
  "theta",
  "radius",
  "dir",
  "dx",
  "dy",
  // text
  "ellipsis",
  "limit",
  "lineBreak",
  "lineHeight",
  "font",
  "fontSize",
  "fontWeight",
  "fontStyle",
  "fontVariant",
  // font
  "description",
  "aria",
  "ariaRole",
  "ariaRoleDescription"
  // aria
];
function zvA(A, e) {
  return JSON.stringify(A, J1e, e);
}
function TvA(A) {
  const e = typeof A == "string" ? JSON.parse(A) : A;
  return _vA(e);
}
function _vA(A) {
  var e = A.marktype, t = A.items, i, n, o;
  if (t)
    for (n = 0, o = t.length; n < o; ++n)
      i = e ? "mark" : "group", t[n][i] = A, t[n].zindex && (t[n][i].zdirty = !0), (e || i) === "group" && _vA(t[n]);
  return e && XvA(A), A;
}
function giA(A) {
  arguments.length ? this.root = TvA(A) : (this.root = qvA({
    marktype: "group",
    name: "root",
    role: "frame"
  }), this.root.items = [new JU(this.root)]);
}
giA.prototype = {
  toJSON(A) {
    return zvA(this.root, A || 0);
  },
  mark(A, e, t) {
    e = e || this.root.items[0];
    const i = qvA(A, e);
    return e.items[t] = i, i.zindex && (i.group.zdirty = !0), i;
  }
};
function qvA(A, e) {
  const t = {
    bounds: new no(),
    clip: !!A.clip,
    group: e,
    interactive: A.interactive !== !1,
    items: [],
    marktype: A.marktype,
    name: A.name || void 0,
    role: A.role || void 0,
    zindex: A.zindex || 0
  };
  return A.aria != null && (t.aria = A.aria), A.description && (t.description = A.description), t;
}
function PE(A, e, t) {
  return !A && typeof document < "u" && document.createElement && (A = document), A ? t ? A.createElementNS(t, e) : A.createElement(e) : null;
}
function siA(A, e) {
  e = e.toLowerCase();
  for (var t = A.childNodes, i = 0, n = t.length; i < n; ++i)
    if (t[i].tagName.toLowerCase() === e)
      return t[i];
}
function Co(A, e, t, i) {
  var n = A.childNodes[e], o;
  return (!n || n.tagName.toLowerCase() !== t.toLowerCase()) && (o = n || null, n = PE(A.ownerDocument, t, i), A.insertBefore(n, o)), n;
}
function GI(A, e) {
  for (var t = A.childNodes, i = t.length; i > e; )
    A.removeChild(t[--i]);
  return A;
}
function OvA(A) {
  return "mark-" + A.marktype + (A.role ? " role-" + A.role : "") + (A.name ? " " + A.name : "");
}
function LU(A, e) {
  const t = e.getBoundingClientRect();
  return [A.clientX - t.left - (e.clientLeft || 0), A.clientY - t.top - (e.clientTop || 0)];
}
function N1e(A, e, t, i) {
  var n = A && A.mark, o, g;
  if (n && (o = Rg[n.marktype]).tip) {
    for (g = LU(e, t), g[0] -= i[0], g[1] -= i[1]; A = A.mark.group; )
      g[0] -= A.x || 0, g[1] -= A.y || 0;
    A = o.tip(n.items, g);
  }
  return A;
}
function ed(A, e) {
  this._active = null, this._handlers = {}, this._loader = A || oU(), this._tooltip = e || Y1e;
}
function Y1e(A, e, t, i) {
  A.element().setAttribute("title", i || "");
}
ed.prototype = {
  /**
   * Initialize a new Handler instance.
   * @param {DOMElement} el - The containing DOM element for the display.
   * @param {Array<number>} origin - The origin of the display, in pixels.
   *   The coordinate system will be translated to this point.
   * @param {object} [obj] - Optional context object that should serve as
   *   the "this" context for event callbacks.
   * @return {Handler} - This handler instance.
   */
  initialize(A, e, t) {
    return this._el = A, this._obj = t || null, this.origin(e);
  },
  /**
   * Returns the parent container element for a visualization.
   * @return {DOMElement} - The containing DOM element.
   */
  element() {
    return this._el;
  },
  /**
   * Returns the scene element (e.g., canvas or SVG) of the visualization
   * Subclasses must override if the first child is not the scene element.
   * @return {DOMElement} - The scene (e.g., canvas or SVG) element.
   */
  canvas() {
    return this._el && this._el.firstChild;
  },
  /**
   * Get / set the origin coordinates of the visualization.
   */
  origin(A) {
    return arguments.length ? (this._origin = A || [0, 0], this) : this._origin.slice();
  },
  /**
   * Get / set the scenegraph root.
   */
  scene(A) {
    return arguments.length ? (this._scene = A, this) : this._scene;
  },
  /**
   * Add an event handler. Subclasses should override this method.
   */
  on() {
  },
  /**
   * Remove an event handler. Subclasses should override this method.
   */
  off() {
  },
  /**
   * Utility method for finding the array index of an event handler.
   * @param {Array} h - An array of registered event handlers.
   * @param {string} type - The event type.
   * @param {function} handler - The event handler instance to find.
   * @return {number} - The handler's array index or -1 if not registered.
   */
  _handlerIndex(A, e, t) {
    for (let i = A ? A.length : 0; --i >= 0; )
      if (A[i].type === e && (!t || A[i].handler === t))
        return i;
    return -1;
  },
  /**
   * Returns an array with registered event handlers.
   * @param {string} [type] - The event type to query. Any annotations
   *   are ignored; for example, for the argument "click.foo", ".foo" will
   *   be ignored and the method returns all "click" handlers. If type is
   *   null or unspecified, this method returns handlers for all types.
   * @return {Array} - A new array containing all registered event handlers.
   */
  handlers(A) {
    const e = this._handlers, t = [];
    if (A)
      t.push(...e[this.eventName(A)]);
    else
      for (const i in e)
        t.push(...e[i]);
    return t;
  },
  /**
   * Parses an event name string to return the specific event type.
   * For example, given "click.foo" returns "click"
   * @param {string} name - The input event type string.
   * @return {string} - A string with the event type only.
   */
  eventName(A) {
    const e = A.indexOf(".");
    return e < 0 ? A : A.slice(0, e);
  },
  /**
   * Handle hyperlink navigation in response to an item.href value.
   * @param {Event} event - The event triggering hyperlink navigation.
   * @param {Item} item - The scenegraph item.
   * @param {string} href - The URL to navigate to.
   */
  handleHref(A, e, t) {
    this._loader.sanitize(t, {
      context: "href"
    }).then((i) => {
      const n = new MouseEvent(A.type, A), o = PE(null, "a");
      for (const g in i)
        o.setAttribute(g, i[g]);
      o.dispatchEvent(n);
    }).catch(() => {
    });
  },
  /**
   * Handle tooltip display in response to an item.tooltip value.
   * @param {Event} event - The event triggering tooltip display.
   * @param {Item} item - The scenegraph item.
   * @param {boolean} show - A boolean flag indicating whether
   *   to show or hide a tooltip for the given item.
   */
  handleTooltip(A, e, t) {
    if (e && e.tooltip != null) {
      e = N1e(e, A, this.canvas(), this._origin);
      const i = t && e && e.tooltip || null;
      this._tooltip.call(this._obj, this, A, e, i);
    }
  },
  /**
   * Returns the size of a scenegraph item and its position relative
   * to the viewport.
   * @param {Item} item - The scenegraph item.
   * @return {object} - A bounding box object (compatible with the
   *   DOMRect type) consisting of x, y, width, heigh, top, left,
   *   right, and bottom properties.
   */
  getItemBoundingClientRect(A) {
    const e = this.canvas();
    if (!e)
      return;
    const t = e.getBoundingClientRect(), i = this._origin, n = A.bounds, o = n.width(), g = n.height();
    let s = n.x1 + i[0] + t.left, I = n.y1 + i[1] + t.top;
    for (; A.mark && (A = A.mark.group); )
      s += A.x || 0, I += A.y || 0;
    return {
      x: s,
      y: I,
      width: o,
      height: g,
      left: s,
      top: I,
      right: s + o,
      bottom: I + g
    };
  }
};
function Fg(A) {
  this._el = null, this._bgcolor = null, this._loader = new VtA(A);
}
Fg.prototype = {
  /**
   * Initialize a new Renderer instance.
   * @param {DOMElement} el - The containing DOM element for the display.
   * @param {number} width - The coordinate width of the display, in pixels.
   * @param {number} height - The coordinate height of the display, in pixels.
   * @param {Array<number>} origin - The origin of the display, in pixels.
   *   The coordinate system will be translated to this point.
   * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
   *   the width and height to determine the final pixel size.
   * @return {Renderer} - This renderer instance.
   */
  initialize(A, e, t, i, n) {
    return this._el = A, this.resize(e, t, i, n);
  },
  /**
   * Returns the parent container element for a visualization.
   * @return {DOMElement} - The containing DOM element.
   */
  element() {
    return this._el;
  },
  /**
   * Returns the scene element (e.g., canvas or SVG) of the visualization
   * Subclasses must override if the first child is not the scene element.
   * @return {DOMElement} - The scene (e.g., canvas or SVG) element.
   */
  canvas() {
    return this._el && this._el.firstChild;
  },
  /**
   * Get / set the background color.
   */
  background(A) {
    return arguments.length === 0 ? this._bgcolor : (this._bgcolor = A, this);
  },
  /**
   * Resize the display.
   * @param {number} width - The new coordinate width of the display, in pixels.
   * @param {number} height - The new coordinate height of the display, in pixels.
   * @param {Array<number>} origin - The new origin of the display, in pixels.
   *   The coordinate system will be translated to this point.
   * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
   *   the width and height to determine the final pixel size.
   * @return {Renderer} - This renderer instance;
   */
  resize(A, e, t, i) {
    return this._width = A, this._height = e, this._origin = t || [0, 0], this._scale = i || 1, this;
  },
  /**
   * Report a dirty item whose bounds should be redrawn.
   * This base class method does nothing. Subclasses that perform
   * incremental should implement this method.
   * @param {Item} item - The dirty item whose bounds should be redrawn.
   */
  dirty() {
  },
  /**
   * Render an input scenegraph, potentially with a set of dirty items.
   * This method will perform an immediate rendering with available resources.
   * The renderer may also need to perform image loading to perform a complete
   * render. This process can lead to asynchronous re-rendering of the scene
   * after this method returns. To receive notification when rendering is
   * complete, use the renderAsync method instead.
   * @param {object} scene - The root mark of a scenegraph to render.
   * @param {Array} markTypes - Array of the mark types to render.
   *                            If undefined, render all mark types
   * @return {Renderer} - This renderer instance.
   */
  render(A, e) {
    const t = this;
    return t._call = function() {
      t._render(A, e);
    }, t._call(), t._call = null, t;
  },
  /**
   * Internal rendering method. Renderer subclasses should override this
   * method to actually perform rendering.
   * @param {object} scene - The root mark of a scenegraph to render.
   * @param {Array} markTypes - Array of the mark types to render.
   *                            If undefined, render all mark types
   */
  _render() {
  },
  /**
   * Asynchronous rendering method. Similar to render, but returns a Promise
   * that resolves when all rendering is completed. Sometimes a renderer must
   * perform image loading to get a complete rendering. The returned
   * Promise will not resolve until this process completes.
   * @param {object} scene - The root mark of a scenegraph to render.
   * @param {Array} markTypes - Array of the mark types to render.
   *                            If undefined, render all mark types
   * @return {Promise} - A Promise that resolves when rendering is complete.
   */
  renderAsync(A, e) {
    const t = this.render(A, e);
    return this._ready ? this._ready.then(() => t) : Promise.resolve(t);
  },
  /**
   * Internal method for asynchronous resource loading.
   * Proxies method calls to the ImageLoader, and tracks loading
   * progress to invoke a re-render once complete.
   * @param {string} method - The method name to invoke on the ImageLoader.
   * @param {string} uri - The URI for the requested resource.
   * @return {Promise} - A Promise that resolves to the requested resource.
   */
  _load(A, e) {
    var t = this, i = t._loader[A](e);
    if (!t._ready) {
      const n = t._call;
      t._ready = t._loader.ready().then((o) => {
        o && n(), t._ready = null;
      });
    }
    return i;
  },
  /**
   * Sanitize a URL to include as a hyperlink in the rendered scene.
   * This method proxies a call to ImageLoader.sanitizeURL, but also tracks
   * image loading progress and invokes a re-render once complete.
   * @param {string} uri - The URI string to sanitize.
   * @return {Promise} - A Promise that resolves to the sanitized URL.
   */
  sanitizeURL(A) {
    return this._load("sanitizeURL", A);
  },
  /**
   * Requests an image to include in the rendered scene.
   * This method proxies a call to ImageLoader.loadImage, but also tracks
   * image loading progress and invokes a re-render once complete.
   * @param {string} uri - The URI string of the image.
   * @return {Promise} - A Promise that resolves to the loaded Image.
   */
  loadImage(A) {
    return this._load("loadImage", A);
  }
};
const R1e = "keydown", F1e = "keypress", M1e = "keyup", jvA = "dragenter", OL = "dragleave", PvA = "dragover", tj = "pointerdown", x1e = "pointerup", YS = "pointermove", pN = "pointerout", $vA = "pointerover", ij = "mousedown", L1e = "mouseup", AHA = "mousemove", nj = "mouseout", eHA = "mouseover", RS = "click", v1e = "dblclick", H1e = "wheel", tHA = "mousewheel", FS = "touchstart", MS = "touchmove", xS = "touchend", S1e = [R1e, F1e, M1e, jvA, OL, PvA, tj, x1e, YS, pN, $vA, ij, L1e, AHA, nj, eHA, RS, v1e, H1e, tHA, FS, MS, xS], oj = YS, e2 = pN, gj = RS;
function gr(A, e) {
  ed.call(this, A, e), this._down = null, this._touch = null, this._first = !0, this._events = {};
}
const Z1e = (A) => A === FS || A === MS || A === xS ? [FS, MS, xS] : [A];
function xEA(A, e) {
  Z1e(e).forEach((t) => W1e(A, t));
}
function W1e(A, e) {
  const t = A.canvas();
  t && !A._events[e] && (A._events[e] = 1, t.addEventListener(e, A[e] ? (i) => A[e](i) : (i) => A.fire(e, i)));
}
function fJ(A, e, t) {
  e.forEach((i) => A.fire(i, t));
}
function LEA(A, e, t) {
  return function(i) {
    const n = this._active, o = this.pickEvent(i);
    o === n ? fJ(this, A, i) : ((!n || !n.exit) && fJ(this, t, i), this._active = o, fJ(this, e, i), fJ(this, A, i));
  };
}
function vEA(A) {
  return function(e) {
    fJ(this, A, e), this._active = null;
  };
}
Ae(gr, ed, {
  initialize(A, e, t) {
    return this._canvas = A && siA(A, "canvas"), [RS, ij, tj, YS, pN, OL].forEach((i) => xEA(this, i)), ed.prototype.initialize.call(this, A, e, t);
  },
  // return the backing canvas instance
  canvas() {
    return this._canvas;
  },
  // retrieve the current canvas context
  context() {
    return this._canvas.getContext("2d");
  },
  // supported events
  events: S1e,
  // to keep old versions of firefox happy
  DOMMouseScroll(A) {
    this.fire(tHA, A);
  },
  pointermove: LEA([YS, AHA], [$vA, eHA], [pN, nj]),
  dragover: LEA([PvA], [jvA], [OL]),
  pointerout: vEA([pN, nj]),
  dragleave: vEA([OL]),
  pointerdown(A) {
    this._down = this._active, this.fire(tj, A);
  },
  mousedown(A) {
    this._down = this._active, this.fire(ij, A);
  },
  click(A) {
    this._down === this._active && (this.fire(RS, A), this._down = null);
  },
  touchstart(A) {
    this._touch = this.pickEvent(A.changedTouches[0]), this._first && (this._active = this._touch, this._first = !1), this.fire(FS, A, !0);
  },
  touchmove(A) {
    this.fire(MS, A, !0);
  },
  touchend(A) {
    this.fire(xS, A, !0), this._touch = null;
  },
  // fire an event
  fire(A, e, t) {
    const i = t ? this._touch : this._active, n = this._handlers[A];
    if (e.vegaType = A, A === gj && i && i.href ? this.handleHref(e, i, i.href) : (A === oj || A === e2) && this.handleTooltip(e, i, A !== e2), n)
      for (let o = 0, g = n.length; o < g; ++o)
        n[o].handler.call(this._obj, e, i);
  },
  // add an event handler
  on(A, e) {
    const t = this.eventName(A), i = this._handlers;
    return this._handlerIndex(i[t], A, e) < 0 && (xEA(this, A), (i[t] || (i[t] = [])).push({
      type: A,
      handler: e
    })), this;
  },
  // remove an event handler
  off(A, e) {
    const t = this.eventName(A), i = this._handlers[t], n = this._handlerIndex(i, A, e);
    return n >= 0 && i.splice(n, 1), this;
  },
  pickEvent(A) {
    const e = LU(A, this._canvas), t = this._origin;
    return this.pick(this._scene, e[0], e[1], e[0] - t[0], e[1] - t[1]);
  },
  // find the scenegraph item at the current pointer position
  // x, y -- the absolute x, y pointer coordinates on the canvas element
  // gx, gy -- the relative coordinates within the current group
  pick(A, e, t, i, n) {
    const o = this.context();
    return Rg[A.marktype].pick.call(this, o, A, e, t, i, n);
  }
});
function K1e() {
  return typeof window < "u" && window.devicePixelRatio || 1;
}
var U1e = K1e();
function V1e(A, e, t, i, n, o) {
  const g = typeof HTMLElement < "u" && A instanceof HTMLElement && A.parentNode != null, s = A.getContext("2d"), I = g ? U1e : n;
  A.width = e * I, A.height = t * I;
  for (const r in o)
    s[r] = o[r];
  return g && I !== 1 && (A.style.width = e + "px", A.style.height = t + "px"), s.pixelRatio = I, s.setTransform(I, 0, 0, I, I * i[0], I * i[1]), A;
}
function t2(A) {
  Fg.call(this, A), this._options = {}, this._redraw = !1, this._dirty = new no(), this._tempb = new no();
}
const HEA = Fg.prototype, X1e = (A, e, t) => new no().set(0, 0, e, t).translate(-A[0], -A[1]);
function z1e(A, e, t) {
  return e.expand(1).round(), A.pixelRatio % 1 && e.scale(A.pixelRatio).round().scale(1 / A.pixelRatio), e.translate(-(t[0] % 1), -(t[1] % 1)), A.beginPath(), A.rect(e.x1, e.y1, e.width(), e.height()), A.clip(), e;
}
Ae(t2, Fg, {
  initialize(A, e, t, i, n, o) {
    return this._options = o || {}, this._canvas = this._options.externalContext ? null : Ju(1, 1, this._options.type), A && this._canvas && (GI(A, 0).appendChild(this._canvas), this._canvas.setAttribute("class", "marks")), HEA.initialize.call(this, A, e, t, i, n);
  },
  resize(A, e, t, i) {
    if (HEA.resize.call(this, A, e, t, i), this._canvas)
      V1e(this._canvas, this._width, this._height, this._origin, this._scale, this._options.context);
    else {
      const n = this._options.externalContext;
      n || vA("CanvasRenderer is missing a valid canvas or context"), n.scale(this._scale, this._scale), n.translate(this._origin[0], this._origin[1]);
    }
    return this._redraw = !0, this;
  },
  canvas() {
    return this._canvas;
  },
  context() {
    return this._options.externalContext || (this._canvas ? this._canvas.getContext("2d") : null);
  },
  dirty(A) {
    const e = this._tempb.clear().union(A.bounds);
    let t = A.mark.group;
    for (; t; )
      e.translate(t.x || 0, t.y || 0), t = t.mark.group;
    this._dirty.union(e);
  },
  _render(A, e) {
    const t = this.context(), i = this._origin, n = this._width, o = this._height, g = this._dirty, s = X1e(i, n, o);
    t.save();
    const I = this._redraw || g.empty() ? (this._redraw = !1, s.expand(1)) : z1e(t, s.intersect(g), i);
    return this.clear(-i[0], -i[1], n, o), this.draw(t, A, I, e), t.restore(), g.clear(), this;
  },
  draw(A, e, t, i) {
    if (e.marktype !== "group" && i != null && !i.includes(e.marktype))
      return;
    const n = Rg[e.marktype];
    e.clip && KFe(A, e), n.draw.call(this, A, e, t, i), e.clip && A.restore();
  },
  clear(A, e, t, i) {
    const n = this._options, o = this.context();
    n.type !== "pdf" && !n.externalContext && o.clearRect(A, e, t, i), this._bgcolor != null && (o.fillStyle = this._bgcolor, o.fillRect(A, e, t, i));
  }
});
function IiA(A, e) {
  ed.call(this, A, e);
  const t = this;
  t._hrefHandler = sj(t, (i, n) => {
    n && n.href && t.handleHref(i, n, n.href);
  }), t._tooltipHandler = sj(t, (i, n) => {
    t.handleTooltip(i, n, i.type !== e2);
  });
}
const sj = (A, e) => (t) => {
  let i = t.target.__data__;
  i = Array.isArray(i) ? i[0] : i, t.vegaType = t.type, e.call(A._obj, t, i);
};
Ae(IiA, ed, {
  initialize(A, e, t) {
    let i = this._svg;
    return i && (i.removeEventListener(gj, this._hrefHandler), i.removeEventListener(oj, this._tooltipHandler), i.removeEventListener(e2, this._tooltipHandler)), this._svg = i = A && siA(A, "svg"), i && (i.addEventListener(gj, this._hrefHandler), i.addEventListener(oj, this._tooltipHandler), i.addEventListener(e2, this._tooltipHandler)), ed.prototype.initialize.call(this, A, e, t);
  },
  canvas() {
    return this._svg;
  },
  // add an event handler
  on(A, e) {
    const t = this.eventName(A), i = this._handlers;
    if (this._handlerIndex(i[t], A, e) < 0) {
      const n = {
        type: A,
        handler: e,
        listener: sj(this, e)
      };
      (i[t] || (i[t] = [])).push(n), this._svg && this._svg.addEventListener(t, n.listener);
    }
    return this;
  },
  // remove an event handler
  off(A, e) {
    const t = this.eventName(A), i = this._handlers[t], n = this._handlerIndex(i, A, e);
    return n >= 0 && (this._svg && this._svg.removeEventListener(t, i[n].listener), i.splice(n, 1)), this;
  }
});
const iHA = "aria-hidden", aiA = "aria-label", riA = "role", CiA = "aria-roledescription", nHA = "graphics-object", BiA = "graphics-symbol", oHA = (A, e, t) => ({
  [riA]: A,
  [CiA]: e,
  [aiA]: t || void 0
}), T1e = mC(["axis-domain", "axis-grid", "axis-label", "axis-tick", "axis-title", "legend-band", "legend-entry", "legend-gradient", "legend-label", "legend-title", "legend-symbol", "title"]), SEA = {
  axis: {
    desc: "axis",
    caption: O1e
  },
  legend: {
    desc: "legend",
    caption: j1e
  },
  "title-text": {
    desc: "title",
    caption: (A) => `Title text '${WEA(A)}'`
  },
  "title-subtitle": {
    desc: "subtitle",
    caption: (A) => `Subtitle text '${WEA(A)}'`
  }
}, ZEA = {
  ariaRole: riA,
  ariaRoleDescription: CiA,
  description: aiA
};
function gHA(A, e) {
  const t = e.aria === !1;
  if (A(iHA, t || void 0), t || e.description == null)
    for (const i in ZEA)
      A(ZEA[i], void 0);
  else {
    const i = e.mark.marktype;
    A(aiA, e.description), A(riA, e.ariaRole || (i === "group" ? nHA : BiA)), A(CiA, e.ariaRoleDescription || `${i} mark`);
  }
}
function sHA(A) {
  return A.aria === !1 ? {
    [iHA]: !0
  } : T1e[A.role] ? null : SEA[A.role] ? q1e(A, SEA[A.role]) : _1e(A);
}
function _1e(A) {
  const e = A.marktype, t = e === "group" || e === "text" || A.items.some((i) => i.description != null && i.aria !== !1);
  return oHA(t ? nHA : BiA, `${e} mark container`, A.description);
}
function q1e(A, e) {
  try {
    const t = A.items[0], i = e.caption || (() => "");
    return oHA(e.role || BiA, e.desc, t.description || i(t));
  } catch {
    return null;
  }
}
function WEA(A) {
  return Ce(A.text).join(" ");
}
function O1e(A) {
  const e = A.datum, t = A.orient, i = e.title ? IHA(A) : null, n = A.context, o = n.scales[e.scale].value, g = n.dataflow.locale(), s = o.type;
  return `${t === "left" || t === "right" ? "Y" : "X"}-axis` + (i ? ` titled '${i}'` : "") + ` for a ${bf(s) ? "discrete" : s} scale with ${DvA(g, o, A)}`;
}
function j1e(A) {
  const e = A.datum, t = e.title ? IHA(A) : null, i = `${e.type || ""} legend`.trim(), n = e.scales, o = Object.keys(n), g = A.context, s = g.scales[n[o[0]]].value, I = g.dataflow.locale();
  return $1e(i) + (t ? ` titled '${t}'` : "") + ` for ${P1e(o)} with ${DvA(I, s, A)}`;
}
function IHA(A) {
  try {
    return Ce(Xt(A.items).items[0].text).join(" ");
  } catch {
    return null;
  }
}
function P1e(A) {
  return A = A.map((e) => e + (e === "fill" || e === "stroke" ? " color" : "")), A.length < 2 ? A[0] : A.slice(0, -1).join(", ") + " and " + Xt(A);
}
function $1e(A) {
  return A.length ? A[0].toUpperCase() + A.slice(1) : A;
}
const aHA = (A) => (A + "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), AMe = (A) => aHA(A).replace(/"/g, "&quot;").replace(/\t/g, "&#x9;").replace(/\n/g, "&#xA;").replace(/\r/g, "&#xD;");
function liA() {
  let A = "", e = "", t = "";
  const i = [], n = () => e = t = "", o = (I) => {
    e && (A += `${e}>${t}`, n()), i.push(I);
  }, g = (I, r) => (r != null && (e += ` ${I}="${AMe(r)}"`), s), s = {
    open(I) {
      o(I), e = "<" + I;
      for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), C = 1; C < r; C++)
        a[C - 1] = arguments[C];
      for (const B of a)
        for (const l in B)
          g(l, B[l]);
      return s;
    },
    close() {
      const I = i.pop();
      return e ? A += e + (t ? `>${t}</${I}>` : "/>") : A += `</${I}>`, n(), s;
    },
    attr: g,
    text: (I) => (t += aHA(I), s),
    toString: () => A
  };
  return s;
}
const rHA = (A) => CHA(liA(), A) + "";
function CHA(A, e) {
  if (A.open(e.tagName), e.hasAttributes()) {
    const t = e.attributes, i = t.length;
    for (let n = 0; n < i; ++n)
      A.attr(t[n].name, t[n].value);
  }
  if (e.hasChildNodes()) {
    const t = e.childNodes;
    for (const i of t)
      i.nodeType === 3 ? A.text(i.nodeValue) : CHA(A, i);
  }
  return A.close();
}
const LS = {
  fill: "fill",
  fillOpacity: "fill-opacity",
  stroke: "stroke",
  strokeOpacity: "stroke-opacity",
  strokeWidth: "stroke-width",
  strokeCap: "stroke-linecap",
  strokeJoin: "stroke-linejoin",
  strokeDash: "stroke-dasharray",
  strokeDashOffset: "stroke-dashoffset",
  strokeMiterLimit: "stroke-miterlimit",
  opacity: "opacity"
}, vS = {
  blend: "mix-blend-mode"
}, BHA = {
  fill: "none",
  "stroke-miterlimit": 10
}, wk = 0, KEA = "http://www.w3.org/2000/xmlns/", ao = A2.xmlns;
function vU(A) {
  Fg.call(this, A), this._dirtyID = 0, this._dirty = [], this._svg = null, this._root = null, this._defs = null;
}
const bz = Fg.prototype;
Ae(vU, Fg, {
  /**
   * Initialize a new SVGRenderer instance.
   * @param {DOMElement} el - The containing DOM element for the display.
   * @param {number} width - The coordinate width of the display, in pixels.
   * @param {number} height - The coordinate height of the display, in pixels.
   * @param {Array<number>} origin - The origin of the display, in pixels.
   *   The coordinate system will be translated to this point.
   * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
   *   the width and height to determine the final pixel size.
   * @return {SVGRenderer} - This renderer instance.
   */
  initialize(A, e, t, i, n) {
    return this._defs = {}, this._clearDefs(), A && (this._svg = Co(A, 0, "svg", ao), this._svg.setAttributeNS(KEA, "xmlns", ao), this._svg.setAttributeNS(KEA, "xmlns:xlink", A2["xmlns:xlink"]), this._svg.setAttribute("version", A2.version), this._svg.setAttribute("class", "marks"), GI(A, 1), this._root = Co(this._svg, wk, "g", ao), $E(this._root, BHA), GI(this._svg, wk + 1)), this.background(this._bgcolor), bz.initialize.call(this, A, e, t, i, n);
  },
  /**
   * Get / set the background color.
   */
  background(A) {
    return arguments.length && this._svg && this._svg.style.setProperty("background-color", A), bz.background.apply(this, arguments);
  },
  /**
   * Resize the display.
   * @param {number} width - The new coordinate width of the display, in pixels.
   * @param {number} height - The new coordinate height of the display, in pixels.
   * @param {Array<number>} origin - The new origin of the display, in pixels.
   *   The coordinate system will be translated to this point.
   * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
   *   the width and height to determine the final pixel size.
   * @return {SVGRenderer} - This renderer instance;
   */
  resize(A, e, t, i) {
    return bz.resize.call(this, A, e, t, i), this._svg && ($E(this._svg, {
      width: this._width * this._scale,
      height: this._height * this._scale,
      viewBox: `0 0 ${this._width} ${this._height}`
    }), this._root.setAttribute("transform", `translate(${this._origin})`)), this._dirty = [], this;
  },
  /**
   * Returns the SVG element of the visualization.
   * @return {DOMElement} - The SVG element.
   */
  canvas() {
    return this._svg;
  },
  /**
   * Returns an SVG text string for the rendered content,
   * or null if this renderer is currently headless.
   */
  svg() {
    const A = this._svg, e = this._bgcolor;
    if (!A)
      return null;
    let t;
    e && (A.removeAttribute("style"), t = Co(A, wk, "rect", ao), $E(t, {
      width: this._width,
      height: this._height,
      fill: e
    }));
    const i = rHA(A);
    return e && (A.removeChild(t), this._svg.style.setProperty("background-color", e)), i;
  },
  /**
   * Internal rendering method.
   * @param {object} scene - The root mark of a scenegraph to render.
   * @param {Array} markTypes - Array of the mark types to render.
   *                            If undefined, render all mark types
   */
  _render(A, e) {
    return this._dirtyCheck() && (this._dirtyAll && this._clearDefs(), this.mark(this._root, A, void 0, e), GI(this._root, 1)), this.defs(), this._dirty = [], ++this._dirtyID, this;
  },
  // -- Manage rendering of items marked as dirty --
  /**
   * Flag a mark item as dirty.
   * @param {Item} item - The mark item.
   */
  dirty(A) {
    A.dirty !== this._dirtyID && (A.dirty = this._dirtyID, this._dirty.push(A));
  },
  /**
   * Check if a mark item is considered dirty.
   * @param {Item} item - The mark item.
   */
  isDirty(A) {
    return this._dirtyAll || !A._svg || !A._svg.ownerSVGElement || A.dirty === this._dirtyID;
  },
  /**
   * Internal method to check dirty status and, if possible,
   * make targetted updates without a full rendering pass.
   */
  _dirtyCheck() {
    this._dirtyAll = !0;
    const A = this._dirty;
    if (!A.length || !this._dirtyID)
      return !0;
    const e = ++this._dirtyID;
    let t, i, n, o, g, s, I;
    for (g = 0, s = A.length; g < s; ++g)
      if (t = A[g], i = t.mark, i.marktype !== n && (n = i.marktype, o = Rg[n]), i.zdirty && i.dirty !== e && (this._dirtyAll = !1, UEA(t, e), i.items.forEach((r) => {
        r.dirty = e;
      })), !i.zdirty) {
        if (t.exit) {
          o.nested && i.items.length ? (I = i.items[0], I._svg && this._update(o, I._svg, I)) : t._svg && (I = t._svg.parentNode, I && I.removeChild(t._svg)), t._svg = null;
          continue;
        }
        t = o.nested ? i.items[0] : t, t._update !== e && (!t._svg || !t._svg.ownerSVGElement ? (this._dirtyAll = !1, UEA(t, e)) : this._update(o, t._svg, t), t._update = e);
      }
    return !this._dirtyAll;
  },
  // -- Construct & maintain scenegraph to SVG mapping ---
  /**
   * Render a set of mark items.
   * @param {SVGElement} el - The parent element in the SVG tree.
   * @param {object} scene - The mark parent to render.
   * @param {SVGElement} prev - The previous sibling in the SVG tree.
   * @param {Array} markTypes - Array of the mark types to render.
   *                            If undefined, render all mark types
   */
  mark(A, e, t, i) {
    if (!this.isDirty(e))
      return e._svg;
    const n = this._svg, o = e.marktype, g = Rg[o], s = e.interactive === !1 ? "none" : null, I = g.tag === "g", r = VEA(e, A, t, "g", n);
    if (o !== "group" && i != null && !i.includes(o))
      return GI(r, 0), e._svg;
    r.setAttribute("class", OvA(e));
    const a = sHA(e);
    for (const Q in a)
      Tg(r, Q, a[Q]);
    I || Tg(r, "pointer-events", s), Tg(r, "clip-path", e.clip ? UtA(this, e, e.group) : null);
    let C = null, B = 0;
    const l = (Q) => {
      const E = this.isDirty(Q), d = VEA(Q, r, C, g.tag, n);
      E && (this._update(g, d, Q), I && iMe(this, d, Q, i)), C = d, ++B;
    };
    return g.nested ? e.items.length && l(e.items[0]) : Nn(e, l), GI(r, B), r;
  },
  /**
   * Update the attributes of an SVG element for a mark item.
   * @param {object} mdef - The mark definition object
   * @param {SVGElement} el - The SVG element.
   * @param {Item} item - The mark item.
   */
  _update(A, e, t) {
    Sc = e, dg = e.__values__, gHA(yN, t), A.attr(yN, t, this);
    const i = oMe[A.type];
    i && i.call(this, A, e, t), Sc && this.style(Sc, t);
  },
  /**
   * Update the presentation attributes of an SVG element for a mark item.
   * @param {SVGElement} el - The SVG element.
   * @param {Item} item - The mark item.
   */
  style(A, e) {
    if (e != null) {
      for (const t in LS) {
        let i = t === "font" ? wF(e) : e[t];
        if (i === dg[t])
          continue;
        const n = LS[t];
        i == null ? A.removeAttribute(n) : (StA(i) && (i = kvA(i, this._defs.gradient, lHA())), A.setAttribute(n, i + "")), dg[t] = i;
      }
      for (const t in vS)
        jL(A, vS[t], e[t]);
    }
  },
  /**
   * Render SVG defs, as needed.
   * Must be called *after* marks have been processed to ensure the
   * collected state is current and accurate.
   */
  defs() {
    const A = this._svg, e = this._defs;
    let t = e.el, i = 0;
    for (const n in e.gradient)
      t || (e.el = t = Co(A, wk + 1, "defs", ao)), i = eMe(t, e.gradient[n], i);
    for (const n in e.clipping)
      t || (e.el = t = Co(A, wk + 1, "defs", ao)), i = tMe(t, e.clipping[n], i);
    t && (i === 0 ? (A.removeChild(t), e.el = null) : GI(t, i));
  },
  /**
   * Clear defs caches.
   */
  _clearDefs() {
    const A = this._defs;
    A.gradient = {}, A.clipping = {};
  }
});
function UEA(A, e) {
  for (; A && A.dirty !== e; A = A.mark.group)
    if (A.dirty = e, A.mark && A.mark.dirty !== e)
      A.mark.dirty = e;
    else
      return;
}
function eMe(A, e, t) {
  let i, n, o;
  if (e.gradient === "radial") {
    let g = Co(A, t++, "pattern", ao);
    $E(g, {
      id: GS + e.id,
      viewBox: "0,0,1,1",
      width: "100%",
      height: "100%",
      preserveAspectRatio: "xMidYMid slice"
    }), g = Co(g, 0, "rect", ao), $E(g, {
      width: 1,
      height: 1,
      fill: `url(${lHA()}#${e.id})`
    }), A = Co(A, t++, "radialGradient", ao), $E(A, {
      id: e.id,
      fx: e.x1,
      fy: e.y1,
      fr: e.r1,
      cx: e.x2,
      cy: e.y2,
      r: e.r2
    });
  } else
    A = Co(A, t++, "linearGradient", ao), $E(A, {
      id: e.id,
      x1: e.x1,
      x2: e.x2,
      y1: e.y1,
      y2: e.y2
    });
  for (i = 0, n = e.stops.length; i < n; ++i)
    o = Co(A, i, "stop", ao), o.setAttribute("offset", e.stops[i].offset), o.setAttribute("stop-color", e.stops[i].color);
  return GI(A, i), t;
}
function tMe(A, e, t) {
  let i;
  return A = Co(A, t, "clipPath", ao), A.setAttribute("id", e.id), e.path ? (i = Co(A, 0, "path", ao), i.setAttribute("d", e.path)) : (i = Co(A, 0, "rect", ao), $E(i, {
    x: 0,
    y: 0,
    width: e.width,
    height: e.height
  })), GI(A, 1), t + 1;
}
function iMe(A, e, t, i) {
  e = e.lastChild.previousSibling;
  let n, o = 0;
  Nn(t, (g) => {
    n = A.mark(e, g, n, i), ++o;
  }), GI(e, 1 + o);
}
function VEA(A, e, t, i, n) {
  let o = A._svg, g;
  if (!o && (g = e.ownerDocument, o = PE(g, i, ao), A._svg = o, A.mark && (o.__data__ = A, o.__values__ = {
    fill: "default"
  }, i === "g"))) {
    const s = PE(g, "path", ao);
    o.appendChild(s), s.__data__ = A;
    const I = PE(g, "g", ao);
    o.appendChild(I), I.__data__ = A;
    const r = PE(g, "path", ao);
    o.appendChild(r), r.__data__ = A, r.__values__ = {
      fill: "default"
    };
  }
  return (o.ownerSVGElement !== n || nMe(o, t)) && e.insertBefore(o, t ? t.nextSibling : e.firstChild), o;
}
function nMe(A, e) {
  return A.parentNode && A.parentNode.childNodes.length > 1 && A.previousSibling != e;
}
let Sc = null, dg = null;
const oMe = {
  group(A, e, t) {
    const i = Sc = e.childNodes[2];
    dg = i.__values__, A.foreground(yN, t, this), dg = e.__values__, Sc = e.childNodes[1], A.content(yN, t, this);
    const n = Sc = e.childNodes[0];
    A.background(yN, t, this);
    const o = t.mark.interactive === !1 ? "none" : null;
    if (o !== dg.events && (Tg(i, "pointer-events", o), Tg(n, "pointer-events", o), dg.events = o), t.strokeForeground && t.stroke) {
      const g = t.fill;
      Tg(i, "display", null), this.style(n, t), Tg(n, "stroke", null), g && (t.fill = null), dg = i.__values__, this.style(i, t), g && (t.fill = g), Sc = null;
    } else
      Tg(i, "display", "none");
  },
  image(A, e, t) {
    t.smooth === !1 ? (jL(e, "image-rendering", "optimizeSpeed"), jL(e, "image-rendering", "pixelated")) : jL(e, "image-rendering", null);
  },
  text(A, e, t) {
    const i = bF(t);
    let n, o, g, s;
    ZA(i) ? (o = i.map((I) => Ad(t, I)), n = o.join(`
`), n !== dg.text && (GI(e, 0), g = e.ownerDocument, s = $u(t), o.forEach((I, r) => {
      const a = PE(g, "tspan", ao);
      a.__data__ = t, a.textContent = I, r && (a.setAttribute("x", 0), a.setAttribute("dy", s)), e.appendChild(a);
    }), dg.text = n)) : (o = Ad(t, i), o !== dg.text && (e.textContent = o, dg.text = o)), Tg(e, "font-family", wF(t)), Tg(e, "font-size", Dl(t) + "px"), Tg(e, "font-style", t.fontStyle), Tg(e, "font-variant", t.fontVariant), Tg(e, "font-weight", t.fontWeight);
  }
};
function yN(A, e, t) {
  e !== dg[A] && (t ? gMe(Sc, A, e, t) : Tg(Sc, A, e), dg[A] = e);
}
function jL(A, e, t) {
  t !== dg[e] && (t == null ? A.style.removeProperty(e) : A.style.setProperty(e, t + ""), dg[e] = t);
}
function $E(A, e) {
  for (const t in e)
    Tg(A, t, e[t]);
}
function Tg(A, e, t) {
  t != null ? A.setAttribute(e, t) : A.removeAttribute(e);
}
function gMe(A, e, t, i) {
  t != null ? A.setAttributeNS(i, e, t) : A.removeAttributeNS(i, e);
}
function lHA() {
  let A;
  return typeof window > "u" ? "" : (A = window.location).hash ? A.href.slice(0, -A.hash.length) : A.href;
}
function ciA(A) {
  Fg.call(this, A), this._text = null, this._defs = {
    gradient: {},
    clipping: {}
  };
}
Ae(ciA, Fg, {
  /**
   * Returns the rendered SVG text string,
   * or null if rendering has not yet occurred.
   */
  svg() {
    return this._text;
  },
  /**
   * Internal rendering method.
   * @param {object} scene - The root mark of a scenegraph to render.
   */
  _render(A) {
    const e = liA();
    e.open("svg", pt({}, A2, {
      class: "marks",
      width: this._width * this._scale,
      height: this._height * this._scale,
      viewBox: `0 0 ${this._width} ${this._height}`
    }));
    const t = this._bgcolor;
    return t && t !== "transparent" && t !== "none" && e.open("rect", {
      width: this._width,
      height: this._height,
      fill: t
    }).close(), e.open("g", BHA, {
      transform: "translate(" + this._origin + ")"
    }), this.mark(e, A), e.close(), this.defs(e), this._text = e.close() + "", this;
  },
  /**
   * Render a set of mark items.
   * @param {object} m - The markup context.
   * @param {object} scene - The mark parent to render.
   */
  mark(A, e) {
    const t = Rg[e.marktype], i = t.tag, n = [gHA, t.attr];
    A.open("g", {
      class: OvA(e),
      "clip-path": e.clip ? UtA(this, e, e.group) : null
    }, sHA(e), {
      "pointer-events": i !== "g" && e.interactive === !1 ? "none" : null
    });
    const o = (g) => {
      const s = this.href(g);
      if (s && A.open("a", s), A.open(i, this.attr(e, g, n, i !== "g" ? i : null)), i === "text") {
        const I = bF(g);
        if (ZA(I)) {
          const r = {
            x: 0,
            dy: $u(g)
          };
          for (let a = 0; a < I.length; ++a)
            A.open("tspan", a ? r : null).text(Ad(g, I[a])).close();
        } else
          A.text(Ad(g, I));
      } else if (i === "g") {
        const I = g.strokeForeground, r = g.fill, a = g.stroke;
        I && a && (g.stroke = null), A.open("path", this.attr(e, g, t.background, "bgrect")).close(), A.open("g", this.attr(e, g, t.content)), Nn(g, (C) => this.mark(A, C)), A.close(), I && a ? (r && (g.fill = null), g.stroke = a, A.open("path", this.attr(e, g, t.foreground, "bgrect")).close(), r && (g.fill = r)) : A.open("path", this.attr(e, g, t.foreground, "bgfore")).close();
      }
      A.close(), s && A.close();
    };
    return t.nested ? e.items && e.items.length && o(e.items[0]) : Nn(e, o), A.close();
  },
  /**
   * Get href attributes for a hyperlinked mark item.
   * @param {Item} item - The mark item.
   */
  href(A) {
    const e = A.href;
    let t;
    if (e) {
      if (t = this._hrefs && this._hrefs[e])
        return t;
      this.sanitizeURL(e).then((i) => {
        i["xlink:href"] = i.href, i.href = null, (this._hrefs || (this._hrefs = {}))[e] = i;
      });
    }
    return null;
  },
  /**
   * Get an object of SVG attributes for a mark item.
   * @param {object} scene - The mark parent.
   * @param {Item} item - The mark item.
   * @param {array|function} attrs - One or more attribute emitters.
   * @param {string} tag - The tag being rendered.
   */
  attr(A, e, t, i) {
    const n = {}, o = (g, s, I, r) => {
      n[r || g] = s;
    };
    return Array.isArray(t) ? t.forEach((g) => g(o, e, this)) : t(o, e, this), i && sMe(n, e, A, i, this._defs), n;
  },
  /**
   * Render SVG defs, as needed.
   * Must be called *after* marks have been processed to ensure the
   * collected state is current and accurate.
   * @param {object} m - The markup context.
   */
  defs(A) {
    const e = this._defs.gradient, t = this._defs.clipping;
    if (Object.keys(e).length + Object.keys(t).length !== 0) {
      A.open("defs");
      for (const i in e) {
        const n = e[i], o = n.stops;
        n.gradient === "radial" ? (A.open("pattern", {
          id: GS + i,
          viewBox: "0,0,1,1",
          width: "100%",
          height: "100%",
          preserveAspectRatio: "xMidYMid slice"
        }), A.open("rect", {
          width: "1",
          height: "1",
          fill: "url(#" + i + ")"
        }).close(), A.close(), A.open("radialGradient", {
          id: i,
          fx: n.x1,
          fy: n.y1,
          fr: n.r1,
          cx: n.x2,
          cy: n.y2,
          r: n.r2
        })) : A.open("linearGradient", {
          id: i,
          x1: n.x1,
          x2: n.x2,
          y1: n.y1,
          y2: n.y2
        });
        for (let g = 0; g < o.length; ++g)
          A.open("stop", {
            offset: o[g].offset,
            "stop-color": o[g].color
          }).close();
        A.close();
      }
      for (const i in t) {
        const n = t[i];
        A.open("clipPath", {
          id: i
        }), n.path ? A.open("path", {
          d: n.path
        }).close() : A.open("rect", {
          x: 0,
          y: 0,
          width: n.width,
          height: n.height
        }).close(), A.close();
      }
      A.close();
    }
  }
});
function sMe(A, e, t, i, n) {
  let o;
  if (e == null || (i === "bgrect" && t.interactive === !1 && (A["pointer-events"] = "none"), i === "bgfore" && (t.interactive === !1 && (A["pointer-events"] = "none"), A.display = "none", e.fill !== null)))
    return A;
  i === "image" && e.smooth === !1 && (o = ["image-rendering: optimizeSpeed;", "image-rendering: pixelated;"]), i === "text" && (A["font-family"] = wF(e), A["font-size"] = Dl(e) + "px", A["font-style"] = e.fontStyle, A["font-variant"] = e.fontVariant, A["font-weight"] = e.fontWeight);
  for (const g in LS) {
    let s = e[g];
    const I = LS[g];
    s === "transparent" && (I === "fill" || I === "stroke") || s != null && (StA(s) && (s = kvA(s, n.gradient, "")), A[I] = s);
  }
  for (const g in vS) {
    const s = e[g];
    s != null && (o = o || [], o.push(`${vS[g]}: ${s};`));
  }
  return o && (A.style = o.join(" ")), A;
}
const Lr = {
  svgMarkTypes: ["text"],
  svgOnTop: !0,
  debug: !1
};
function IMe(A) {
  Lr.svgMarkTypes = A.svgMarkTypes ?? ["text"], Lr.svgOnTop = A.svgOnTop ?? !0, Lr.debug = A.debug ?? !1;
}
function HS(A) {
  Fg.call(this, A), this._svgRenderer = new vU(A), this._canvasRenderer = new t2(A);
}
const XEA = Fg.prototype;
Ae(HS, Fg, {
  /**
   * Initialize a new HybridRenderer instance.
   * @param {DOMElement} el - The containing DOM element for the display.
   * @param {number} width - The coordinate width of the display, in pixels.
   * @param {number} height - The coordinate height of the display, in pixels.
   * @param {Array<number>} origin - The origin of the display, in pixels.
   *   The coordinate system will be translated to this point.
   * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
   *   the width and height to determine the final pixel size.
   * @return {HybridRenderer} - This renderer instance.
   */
  initialize(A, e, t, i, n) {
    this._root_el = Co(A, 0, "div");
    const o = Co(this._root_el, 0, "div"), g = Co(this._root_el, 1, "div");
    return this._root_el.style.position = "relative", Lr.debug || (o.style.height = "100%", g.style.position = "absolute", g.style.top = "0", g.style.left = "0", g.style.height = "100%", g.style.width = "100%"), this._svgEl = Lr.svgOnTop ? g : o, this._canvasEl = Lr.svgOnTop ? o : g, this._svgEl.style.pointerEvents = "none", this._canvasRenderer.initialize(this._canvasEl, e, t, i, n), this._svgRenderer.initialize(this._svgEl, e, t, i, n), XEA.initialize.call(this, A, e, t, i, n);
  },
  /**
   * Flag a mark item as dirty.
   * @param {Item} item - The mark item.
   */
  dirty(A) {
    return Lr.svgMarkTypes.includes(A.mark.marktype) ? this._svgRenderer.dirty(A) : this._canvasRenderer.dirty(A), this;
  },
  /**
   * Internal rendering method.
   * @param {object} scene - The root mark of a scenegraph to render.
   * @param {Array} markTypes - Array of the mark types to render.
   *                            If undefined, render all mark types
   */
  _render(A, e) {
    const t = (e ?? ["arc", "area", "image", "line", "path", "rect", "rule", "shape", "symbol", "text", "trail"]).filter((i) => !Lr.svgMarkTypes.includes(i));
    this._svgRenderer.render(A, Lr.svgMarkTypes), this._canvasRenderer.render(A, t);
  },
  /**
   * Resize the display.
   * @param {number} width - The new coordinate width of the display, in pixels.
   * @param {number} height - The new coordinate height of the display, in pixels.
   * @param {Array<number>} origin - The new origin of the display, in pixels.
   *   The coordinate system will be translated to this point.
   * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
   *   the width and height to determine the final pixel size.
   * @return {SVGRenderer} - This renderer instance;
   */
  resize(A, e, t, i) {
    return XEA.resize.call(this, A, e, t, i), this._svgRenderer.resize(A, e, t, i), this._canvasRenderer.resize(A, e, t, i), this;
  },
  background(A) {
    return Lr.svgOnTop ? this._canvasRenderer.background(A) : this._svgRenderer.background(A), this;
  }
});
function QiA(A, e) {
  gr.call(this, A, e);
}
Ae(QiA, gr, {
  initialize(A, e, t) {
    const i = Co(Co(A, 0, "div"), Lr.svgOnTop ? 0 : 1, "div");
    return gr.prototype.initialize.call(this, i, e, t);
  }
});
const cHA = "canvas", QHA = "hybrid", EHA = "png", uHA = "svg", dHA = "none", Au = {
  Canvas: cHA,
  PNG: EHA,
  SVG: uHA,
  Hybrid: QHA,
  None: dHA
}, lp = {};
lp[cHA] = lp[EHA] = {
  renderer: t2,
  headless: t2,
  handler: gr
};
lp[uHA] = {
  renderer: vU,
  headless: ciA,
  handler: IiA
};
lp[QHA] = {
  renderer: HS,
  headless: HS,
  handler: QiA
};
lp[dHA] = {};
function $D(A, e) {
  return A = String(A || "").toLowerCase(), arguments.length > 1 ? (lp[A] = e, this) : lp[A];
}
function hHA(A, e, t) {
  const i = [], n = new no().union(e), o = A.marktype;
  return o ? mHA(A, n, t, i) : o === "group" ? pHA(A, n, t, i) : vA("Intersect scene must be mark node or group item.");
}
function mHA(A, e, t, i) {
  if (aMe(A, e, t)) {
    const n = A.items, o = A.marktype, g = n.length;
    let s = 0;
    if (o === "group")
      for (; s < g; ++s)
        pHA(n[s], e, t, i);
    else
      for (const I = Rg[o].isect; s < g; ++s) {
        const r = n[s];
        yHA(r, e, I) && i.push(r);
      }
  }
  return i;
}
function aMe(A, e, t) {
  return A.bounds && e.intersects(A.bounds) && (A.marktype === "group" || A.interactive !== !1 && (!t || t(A)));
}
function pHA(A, e, t, i) {
  t && t(A.mark) && yHA(A, e, Rg.group.isect) && i.push(A);
  const n = A.items, o = n && n.length;
  if (o) {
    const g = A.x || 0, s = A.y || 0;
    e.translate(-g, -s);
    for (let I = 0; I < o; ++I)
      mHA(n[I], e, t, i);
    e.translate(g, s);
  }
  return i;
}
function yHA(A, e, t) {
  const i = A.bounds;
  return e.encloses(i) || e.intersects(i) && t(A, e);
}
const wz = new no();
function bHA(A) {
  const e = A.clip;
  if (yt(e))
    e(pF(wz.clear()));
  else if (e)
    wz.set(0, 0, A.group.width, A.group.height);
  else
    return;
  A.bounds.intersect(wz);
}
const rMe = 1e-9;
function EiA(A, e, t) {
  return A === e ? !0 : t === "path" ? wHA(A, e) : A instanceof Date && e instanceof Date ? +A == +e : ti(A) && ti(e) ? Math.abs(A - e) <= rMe : !A || !e || !ce(A) && !ce(e) ? A == e : CMe(A, e);
}
function wHA(A, e) {
  return EiA(wf(A), wf(e));
}
function CMe(A, e) {
  var t = Object.keys(A), i = Object.keys(e), n, o;
  if (t.length !== i.length)
    return !1;
  for (t.sort(), i.sort(), o = t.length - 1; o >= 0; o--)
    if (t[o] != i[o])
      return !1;
  for (o = t.length - 1; o >= 0; o--)
    if (n = t[o], !EiA(A[n], e[n], n))
      return !1;
  return typeof A == typeof e;
}
function BMe() {
  RvA(), xRe();
}
const Gf = "top", Vr = "left", _r = "right", td = "bottom", lMe = "top-left", cMe = "top-right", QMe = "bottom-left", EMe = "bottom-right", uiA = "start", Ij = "middle", qg = "end", uMe = "x", dMe = "y", HU = "group", diA = "axis", hiA = "title", hMe = "frame", mMe = "scope", miA = "legend", fHA = "row-header", DHA = "row-footer", GHA = "row-title", kHA = "column-header", JHA = "column-footer", NHA = "column-title", pMe = "padding", yMe = "symbol", YHA = "fit", RHA = "fit-x", FHA = "fit-y", bMe = "pad", piA = "none", $M = "all", aj = "each", yiA = "flush", eu = "column", tu = "row";
function MHA(A) {
  FA.call(this, null, A);
}
Ae(MHA, FA, {
  transform(A, e) {
    const t = e.dataflow, i = A.mark, n = i.marktype, o = Rg[n], g = o.bound;
    let s = i.bounds, I;
    if (o.nested)
      i.items.length && t.dirty(i.items[0]), s = Ax(i, g), i.items.forEach((r) => {
        r.bounds.clear().union(s);
      });
    else if (n === HU || A.modified())
      switch (e.visit(e.MOD, (r) => t.dirty(r)), s.clear(), i.items.forEach((r) => s.union(Ax(r, g))), i.role) {
        case diA:
        case miA:
        case hiA:
          e.reflow();
      }
    else
      I = e.changed(e.REM), e.visit(e.ADD, (r) => {
        s.union(Ax(r, g));
      }), e.visit(e.MOD, (r) => {
        I = I || s.alignsWith(r.bounds), t.dirty(r), s.union(Ax(r, g));
      }), I && (s.clear(), i.items.forEach((r) => s.union(r.bounds)));
    return bHA(i), e.modifies("bounds");
  }
});
function Ax(A, e, t) {
  return e(A.bounds.clear(), A, t);
}
const zEA = ":vega_identifier:";
function biA(A) {
  FA.call(this, 0, A);
}
biA.Definition = {
  type: "Identifier",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "as",
    type: "string",
    required: !0
  }]
};
Ae(biA, FA, {
  transform(A, e) {
    const t = wMe(e.dataflow), i = A.as;
    let n = t.value;
    return e.visit(e.ADD, (o) => o[i] = o[i] || ++n), t.set(this.value = n), e;
  }
});
function wMe(A) {
  return A._signals[zEA] || (A._signals[zEA] = A.add(0));
}
function xHA(A) {
  FA.call(this, null, A);
}
Ae(xHA, FA, {
  transform(A, e) {
    let t = this.value;
    t || (t = e.dataflow.scenegraph().mark(A.markdef, fMe(A), A.index), t.group.context = A.context, A.context.group || (A.context.group = t.group), t.source = this.source, t.clip = A.clip, t.interactive = A.interactive, this.value = t);
    const i = t.marktype === HU ? JU : kU;
    return e.visit(e.ADD, (n) => i.call(n, t)), (A.modified("clip") || A.modified("interactive")) && (t.clip = A.clip, t.interactive = !!A.interactive, t.zdirty = !0, e.reflow()), t.items = e.source, e;
  }
});
function fMe(A) {
  const e = A.groups, t = A.parent;
  return e && e.size === 1 ? e.get(Object.keys(e.object)[0]) : e && t ? e.lookup(t) : null;
}
function LHA(A) {
  FA.call(this, null, A);
}
const TEA = {
  parity: (A) => A.filter((e, t) => t % 2 ? e.opacity = 0 : 1),
  greedy: (A, e) => {
    let t;
    return A.filter((i, n) => !n || !vHA(t.bounds, i.bounds, e) ? (t = i, 1) : i.opacity = 0);
  }
}, vHA = (A, e, t) => t > Math.max(e.x1 - A.x2, A.x1 - e.x2, e.y1 - A.y2, A.y1 - e.y2), _EA = (A, e) => {
  for (var t = 1, i = A.length, n = A[0].bounds, o; t < i; n = o, ++t)
    if (vHA(n, o = A[t].bounds, e))
      return !0;
}, DMe = (A) => {
  const e = A.bounds;
  return e.width() > 1 && e.height() > 1;
}, GMe = (A, e, t) => {
  var i = A.range(), n = new no();
  return e === Gf || e === td ? n.set(i[0], -1 / 0, i[1], 1 / 0) : n.set(-1 / 0, i[0], 1 / 0, i[1]), n.expand(t || 1), (o) => n.encloses(o.bounds);
}, qEA = (A) => (A.forEach((e) => e.opacity = 1), A), OEA = (A, e) => A.reflow(e.modified()).modifies("opacity");
Ae(LHA, FA, {
  transform(A, e) {
    const t = TEA[A.method] || TEA.parity, i = A.separation || 0;
    let n = e.materialize(e.SOURCE).source, o, g;
    if (!n || !n.length)
      return;
    if (!A.method)
      return A.modified("method") && (qEA(n), e = OEA(e, A)), e;
    if (n = n.filter(DMe), !n.length)
      return;
    if (A.sort && (n = n.slice().sort(A.sort)), o = qEA(n), e = OEA(e, A), o.length >= 3 && _EA(o, i)) {
      do
        o = t(o, i);
      while (o.length >= 3 && _EA(o, i));
      o.length < 3 && !Xt(n).opacity && (o.length > 1 && (Xt(o).opacity = 0), Xt(n).opacity = 1);
    }
    A.boundScale && A.boundTolerance >= 0 && (g = GMe(A.boundScale, A.boundOrient, +A.boundTolerance), n.forEach((I) => {
      g(I) || (I.opacity = 0);
    }));
    const s = o[0].mark.bounds.clear();
    return n.forEach((I) => {
      I.opacity && s.union(I.bounds);
    }), e;
  }
});
function HHA(A) {
  FA.call(this, null, A);
}
Ae(HHA, FA, {
  transform(A, e) {
    const t = e.dataflow;
    if (e.visit(e.ALL, (i) => t.dirty(i)), e.fields && e.fields.zindex) {
      const i = e.source && e.source[0];
      i && (i.mark.zdirty = !0);
    }
  }
});
const Eg = new no();
function Zb(A, e, t) {
  return A[e] === t ? 0 : (A[e] = t, 1);
}
function kMe(A) {
  var e = A.items[0].orient;
  return e === Vr || e === _r;
}
function JMe(A) {
  let e = +A.grid;
  return [
    A.ticks ? e++ : -1,
    // ticks index
    A.labels ? e++ : -1,
    // labels index
    e + +A.domain
    // title index
  ];
}
function NMe(A, e, t, i) {
  var n = e.items[0], o = n.datum, g = n.translate != null ? n.translate : 0.5, s = n.orient, I = JMe(o), r = n.range, a = n.offset, C = n.position, B = n.minExtent, l = n.maxExtent, Q = o.title && n.items[I[2]].items[0], E = n.titlePadding, d = n.bounds, m = Q && iiA(Q), y = 0, f = 0, w, G;
  switch (Eg.clear().union(d), d.clear(), (w = I[0]) > -1 && d.union(n.items[w].bounds), (w = I[1]) > -1 && d.union(n.items[w].bounds), s) {
    case Gf:
      y = C || 0, f = -a, G = Math.max(B, Math.min(l, -d.y1)), d.add(0, -G).add(r, 0), Q && ex(A, Q, G, E, m, 0, -1, d);
      break;
    case Vr:
      y = -a, f = C || 0, G = Math.max(B, Math.min(l, -d.x1)), d.add(-G, 0).add(0, r), Q && ex(A, Q, G, E, m, 1, -1, d);
      break;
    case _r:
      y = t + a, f = C || 0, G = Math.max(B, Math.min(l, d.x2)), d.add(0, 0).add(G, r), Q && ex(A, Q, G, E, m, 1, 1, d);
      break;
    case td:
      y = C || 0, f = i + a, G = Math.max(B, Math.min(l, d.y2)), d.add(0, 0).add(r, G), Q && ex(A, Q, G, E, 0, 0, 1, d);
      break;
    default:
      y = n.x, f = n.y;
  }
  return LQ(d.translate(y, f), n), Zb(n, "x", y + g) | Zb(n, "y", f + g) && (n.bounds = Eg, A.dirty(n), n.bounds = d, A.dirty(n)), n.mark.bounds.clear().union(d);
}
function ex(A, e, t, i, n, o, g, s) {
  const I = e.bounds;
  if (e.auto) {
    const r = g * (t + n + i);
    let a = 0, C = 0;
    A.dirty(e), o ? a = (e.x || 0) - (e.x = r) : C = (e.y || 0) - (e.y = r), e.mark.bounds.clear().union(I.translate(-a, -C)), A.dirty(e);
  }
  s.union(I);
}
const jEA = (A, e) => Math.floor(Math.min(A, e)), PEA = (A, e) => Math.ceil(Math.max(A, e));
function YMe(A) {
  var e = A.items, t = e.length, i = 0, n, o;
  const g = {
    marks: [],
    rowheaders: [],
    rowfooters: [],
    colheaders: [],
    colfooters: [],
    rowtitle: null,
    coltitle: null
  };
  for (; i < t; ++i)
    if (n = e[i], o = n.items, n.marktype === HU)
      switch (n.role) {
        case diA:
        case miA:
        case hiA:
          break;
        case fHA:
          g.rowheaders.push(...o);
          break;
        case DHA:
          g.rowfooters.push(...o);
          break;
        case kHA:
          g.colheaders.push(...o);
          break;
        case JHA:
          g.colfooters.push(...o);
          break;
        case GHA:
          g.rowtitle = o[0];
          break;
        case NHA:
          g.coltitle = o[0];
          break;
        default:
          g.marks.push(...o);
      }
  return g;
}
function RMe(A) {
  return new no().set(0, 0, A.width || 0, A.height || 0);
}
function FMe(A) {
  const e = A.bounds.clone();
  return e.empty() ? e.set(0, 0, 0, 0) : e.translate(-(A.x || 0), -(A.y || 0));
}
function Cn(A, e, t) {
  return (ce(A) ? A[e] : A) ?? (t !== void 0 ? t : 0);
}
function $EA(A) {
  return A < 0 ? Math.ceil(-A) : 0;
}
function SHA(A, e, t) {
  var i = !t.nodirty, n = t.bounds === yiA ? RMe : FMe, o = Eg.set(0, 0, 0, 0), g = Cn(t.align, eu), s = Cn(t.align, tu), I = Cn(t.padding, eu), r = Cn(t.padding, tu), a = t.columns || e.length, C = a <= 0 ? 1 : Math.ceil(e.length / a), B = e.length, l = Array(B), Q = Array(a), E = 0, d = Array(B), m = Array(C), y = 0, f = Array(B), w = Array(B), G = Array(B), R, F, Z, c, J, p, N, v, K, U, j;
  for (F = 0; F < a; ++F)
    Q[F] = 0;
  for (F = 0; F < C; ++F)
    m[F] = 0;
  for (F = 0; F < B; ++F)
    p = e[F], J = G[F] = n(p), p.x = p.x || 0, f[F] = 0, p.y = p.y || 0, w[F] = 0, Z = F % a, c = ~~(F / a), E = Math.max(E, N = Math.ceil(J.x2)), y = Math.max(y, v = Math.ceil(J.y2)), Q[Z] = Math.max(Q[Z], N), m[c] = Math.max(m[c], v), l[F] = I + $EA(J.x1), d[F] = r + $EA(J.y1), i && A.dirty(e[F]);
  for (F = 0; F < B; ++F)
    F % a === 0 && (l[F] = 0), F < a && (d[F] = 0);
  if (g === aj)
    for (Z = 1; Z < a; ++Z) {
      for (j = 0, F = Z; F < B; F += a)
        j < l[F] && (j = l[F]);
      for (F = Z; F < B; F += a)
        l[F] = j + Q[Z - 1];
    }
  else if (g === $M) {
    for (j = 0, F = 0; F < B; ++F)
      F % a && j < l[F] && (j = l[F]);
    for (F = 0; F < B; ++F)
      F % a && (l[F] = j + E);
  } else
    for (g = !1, Z = 1; Z < a; ++Z)
      for (F = Z; F < B; F += a)
        l[F] += Q[Z - 1];
  if (s === aj)
    for (c = 1; c < C; ++c) {
      for (j = 0, F = c * a, R = F + a; F < R; ++F)
        j < d[F] && (j = d[F]);
      for (F = c * a; F < R; ++F)
        d[F] = j + m[c - 1];
    }
  else if (s === $M) {
    for (j = 0, F = a; F < B; ++F)
      j < d[F] && (j = d[F]);
    for (F = a; F < B; ++F)
      d[F] = j + y;
  } else
    for (s = !1, c = 1; c < C; ++c)
      for (F = c * a, R = F + a; F < R; ++F)
        d[F] += m[c - 1];
  for (K = 0, F = 0; F < B; ++F)
    K = l[F] + (F % a ? K : 0), f[F] += K - e[F].x;
  for (Z = 0; Z < a; ++Z)
    for (U = 0, F = Z; F < B; F += a)
      U += d[F], w[F] += U - e[F].y;
  if (g && Cn(t.center, eu) && C > 1)
    for (F = 0; F < B; ++F)
      J = g === $M ? E : Q[F % a], K = J - G[F].x2 - e[F].x - f[F], K > 0 && (f[F] += K / 2);
  if (s && Cn(t.center, tu) && a !== 1)
    for (F = 0; F < B; ++F)
      J = s === $M ? y : m[~~(F / a)], U = J - G[F].y2 - e[F].y - w[F], U > 0 && (w[F] += U / 2);
  for (F = 0; F < B; ++F)
    o.union(G[F].translate(f[F], w[F]));
  switch (K = Cn(t.anchor, uMe), U = Cn(t.anchor, dMe), Cn(t.anchor, eu)) {
    case qg:
      K -= o.width();
      break;
    case Ij:
      K -= o.width() / 2;
  }
  switch (Cn(t.anchor, tu)) {
    case qg:
      U -= o.height();
      break;
    case Ij:
      U -= o.height() / 2;
  }
  for (K = Math.round(K), U = Math.round(U), o.clear(), F = 0; F < B; ++F)
    e[F].mark.bounds.clear();
  for (F = 0; F < B; ++F)
    p = e[F], p.x += f[F] += K, p.y += w[F] += U, o.union(p.mark.bounds.union(p.bounds.translate(f[F], w[F]))), i && A.dirty(p);
  return o;
}
function MMe(A, e, t) {
  var i = YMe(e), n = i.marks, o = t.bounds === yiA ? xMe : LMe, g = t.offset, s = t.columns || n.length, I = s <= 0 ? 1 : Math.ceil(n.length / s), r = I * s, a, C, B, l, Q, E, d;
  const m = SHA(A, n, t);
  m.empty() && m.set(0, 0, 0, 0), i.rowheaders && (E = Cn(t.headerBand, tu, null), a = tx(A, i.rowheaders, n, s, I, -Cn(g, "rowHeader"), jEA, 0, o, "x1", 0, s, 1, E)), i.colheaders && (E = Cn(t.headerBand, eu, null), C = tx(A, i.colheaders, n, s, s, -Cn(g, "columnHeader"), jEA, 1, o, "y1", 0, 1, s, E)), i.rowfooters && (E = Cn(t.footerBand, tu, null), B = tx(A, i.rowfooters, n, s, I, Cn(g, "rowFooter"), PEA, 0, o, "x2", s - 1, s, 1, E)), i.colfooters && (E = Cn(t.footerBand, eu, null), l = tx(A, i.colfooters, n, s, s, Cn(g, "columnFooter"), PEA, 1, o, "y2", r - s, 1, s, E)), i.rowtitle && (Q = Cn(t.titleAnchor, tu), d = Cn(g, "rowTitle"), d = Q === qg ? B + d : a - d, E = Cn(t.titleBand, tu, 0.5), AuA(A, i.rowtitle, d, 0, m, E)), i.coltitle && (Q = Cn(t.titleAnchor, eu), d = Cn(g, "columnTitle"), d = Q === qg ? l + d : C - d, E = Cn(t.titleBand, eu, 0.5), AuA(A, i.coltitle, d, 1, m, E));
}
function xMe(A, e) {
  return e === "x1" ? A.x || 0 : e === "y1" ? A.y || 0 : e === "x2" ? (A.x || 0) + (A.width || 0) : e === "y2" ? (A.y || 0) + (A.height || 0) : void 0;
}
function LMe(A, e) {
  return A.bounds[e];
}
function tx(A, e, t, i, n, o, g, s, I, r, a, C, B, l) {
  var Q = t.length, E = 0, d = 0, m, y, f, w, G, R, F, Z, c;
  if (!Q)
    return E;
  for (m = a; m < Q; m += C)
    t[m] && (E = g(E, I(t[m], r)));
  if (!e.length)
    return E;
  for (e.length > n && (A.warn("Grid headers exceed limit: " + n), e = e.slice(0, n)), E += o, y = 0, w = e.length; y < w; ++y)
    A.dirty(e[y]), e[y].mark.bounds.clear();
  for (m = a, y = 0, w = e.length; y < w; ++y, m += C) {
    for (R = e[y], G = R.mark.bounds, f = m; f >= 0 && (F = t[f]) == null; f -= B)
      ;
    s ? (Z = l == null ? F.x : Math.round(F.bounds.x1 + l * F.bounds.width()), c = E) : (Z = E, c = l == null ? F.y : Math.round(F.bounds.y1 + l * F.bounds.height())), G.union(R.bounds.translate(Z - (R.x || 0), c - (R.y || 0))), R.x = Z, R.y = c, A.dirty(R), d = g(d, G[r]);
  }
  return d;
}
function AuA(A, e, t, i, n, o) {
  if (e) {
    A.dirty(e);
    var g = t, s = t;
    i ? g = Math.round(n.x1 + o * n.width()) : s = Math.round(n.y1 + o * n.height()), e.bounds.translate(g - (e.x || 0), s - (e.y || 0)), e.mark.bounds.clear().union(e.bounds), e.x = g, e.y = s, A.dirty(e);
  }
}
function vMe(A, e) {
  const t = A[e] || {};
  return (i, n) => t[i] != null ? t[i] : A[i] != null ? A[i] : n;
}
function HMe(A, e) {
  let t = -1 / 0;
  return A.forEach((i) => {
    i.offset != null && (t = Math.max(t, i.offset));
  }), t > -1 / 0 ? t : e;
}
function SMe(A, e, t, i, n, o, g) {
  const s = vMe(t, e), I = HMe(A, s("offset", 0)), r = s("anchor", uiA), a = r === qg ? 1 : r === Ij ? 0.5 : 0, C = {
    align: aj,
    bounds: s("bounds", yiA),
    columns: s("direction") === "vertical" ? 1 : A.length,
    padding: s("margin", 8),
    center: s("center"),
    nodirty: !0
  };
  switch (e) {
    case Vr:
      C.anchor = {
        x: Math.floor(i.x1) - I,
        column: qg,
        y: a * (g || i.height() + 2 * i.y1),
        row: r
      };
      break;
    case _r:
      C.anchor = {
        x: Math.ceil(i.x2) + I,
        y: a * (g || i.height() + 2 * i.y1),
        row: r
      };
      break;
    case Gf:
      C.anchor = {
        y: Math.floor(n.y1) - I,
        row: qg,
        x: a * (o || n.width() + 2 * n.x1),
        column: r
      };
      break;
    case td:
      C.anchor = {
        y: Math.ceil(n.y2) + I,
        x: a * (o || n.width() + 2 * n.x1),
        column: r
      };
      break;
    case lMe:
      C.anchor = {
        x: I,
        y: I
      };
      break;
    case cMe:
      C.anchor = {
        x: o - I,
        y: I,
        column: qg
      };
      break;
    case QMe:
      C.anchor = {
        x: I,
        y: g - I,
        row: qg
      };
      break;
    case EMe:
      C.anchor = {
        x: o - I,
        y: g - I,
        column: qg,
        row: qg
      };
      break;
  }
  return C;
}
function ZMe(A, e) {
  var t = e.items[0], i = t.datum, n = t.orient, o = t.bounds, g = t.x, s = t.y, I, r;
  return t._bounds ? t._bounds.clear().union(o) : t._bounds = o.clone(), o.clear(), KMe(A, t, t.items[0].items[0]), o = WMe(t, o), I = 2 * t.padding, r = 2 * t.padding, o.empty() || (I = Math.ceil(o.width() + I), r = Math.ceil(o.height() + r)), i.type === yMe && UMe(t.items[0].items[0].items[0].items), n !== piA && (t.x = g = 0, t.y = s = 0), t.width = I, t.height = r, LQ(o.set(g, s, g + I, s + r), t), t.mark.bounds.clear().union(o), t;
}
function WMe(A, e) {
  return A.items.forEach((t) => e.union(t.bounds)), e.x1 = A.padding, e.y1 = A.padding, e;
}
function KMe(A, e, t) {
  var i = e.padding, n = i - t.x, o = i - t.y;
  if (!e.datum.title)
    (n || o) && fk(A, t, n, o);
  else {
    var g = e.items[1].items[0], s = g.anchor, I = e.titlePadding || 0, r = i - g.x, a = i - g.y;
    switch (g.orient) {
      case Vr:
        n += Math.ceil(g.bounds.width()) + I;
        break;
      case _r:
      case td:
        break;
      default:
        o += g.bounds.height() + I;
    }
    switch ((n || o) && fk(A, t, n, o), g.orient) {
      case Vr:
        a += ly(e, t, g, s, 1, 1);
        break;
      case _r:
        r += ly(e, t, g, qg, 0, 0) + I, a += ly(e, t, g, s, 1, 1);
        break;
      case td:
        r += ly(e, t, g, s, 0, 0), a += ly(e, t, g, qg, -1, 0, 1) + I;
        break;
      default:
        r += ly(e, t, g, s, 0, 0);
    }
    (r || a) && fk(A, g, r, a), (r = Math.round(g.bounds.x1 - i)) < 0 && (fk(A, t, -r, 0), fk(A, g, -r, 0));
  }
}
function ly(A, e, t, i, n, o, g) {
  const s = A.datum.type !== "symbol", I = t.datum.vgrad, r = s && (o || !I) && !g ? e.items[0] : e, a = r.bounds[n ? "y2" : "x2"] - A.padding, C = I && o ? a : 0, B = I && o ? 0 : a, l = n <= 0 ? 0 : iiA(t);
  return Math.round(i === uiA ? C : i === qg ? B - l : 0.5 * (a - l));
}
function fk(A, e, t, i) {
  e.x += t, e.y += i, e.bounds.translate(t, i), e.mark.bounds.translate(t, i), A.dirty(e);
}
function UMe(A) {
  const e = A.reduce((t, i) => (t[i.column] = Math.max(i.bounds.x2 - i.x, t[i.column] || 0), t), {});
  A.forEach((t) => {
    t.width = e[t.column], t.height = t.bounds.y2 - t.y;
  });
}
function VMe(A, e, t, i, n) {
  var o = e.items[0], g = o.frame, s = o.orient, I = o.anchor, r = o.offset, a = o.padding, C = o.items[0].items[0], B = o.items[1] && o.items[1].items[0], l = s === Vr || s === _r ? i : t, Q = 0, E = 0, d = 0, m = 0, y = 0, f;
  if (g !== HU ? s === Vr ? (Q = n.y2, l = n.y1) : s === _r ? (Q = n.y1, l = n.y2) : (Q = n.x1, l = n.x2) : s === Vr && (Q = i, l = 0), f = I === uiA ? Q : I === qg ? l : (Q + l) / 2, B && B.text) {
    switch (s) {
      case Gf:
      case td:
        y = C.bounds.height() + a;
        break;
      case Vr:
        m = C.bounds.width() + a;
        break;
      case _r:
        m = -C.bounds.width() - a;
        break;
    }
    Eg.clear().union(B.bounds), Eg.translate(m - (B.x || 0), y - (B.y || 0)), Zb(B, "x", m) | Zb(B, "y", y) && (A.dirty(B), B.bounds.clear().union(Eg), B.mark.bounds.clear().union(Eg), A.dirty(B)), Eg.clear().union(B.bounds);
  } else
    Eg.clear();
  switch (Eg.union(C.bounds), s) {
    case Gf:
      E = f, d = n.y1 - Eg.height() - r;
      break;
    case Vr:
      E = n.x1 - Eg.width() - r, d = f;
      break;
    case _r:
      E = n.x2 + Eg.width() + r, d = f;
      break;
    case td:
      E = f, d = n.y2 + r;
      break;
    default:
      E = o.x, d = o.y;
  }
  return Zb(o, "x", E) | Zb(o, "y", d) && (Eg.translate(E, d), A.dirty(o), o.bounds.clear().union(Eg), e.bounds.clear().union(Eg), A.dirty(o)), o.bounds;
}
function ZHA(A) {
  FA.call(this, null, A);
}
Ae(ZHA, FA, {
  transform(A, e) {
    const t = e.dataflow;
    return A.mark.items.forEach((i) => {
      A.layout && MMe(t, i, A.layout), zMe(t, i, A);
    }), XMe(A.mark.group) ? e.reflow() : e;
  }
});
function XMe(A) {
  return A && A.mark.role !== "legend-entry";
}
function zMe(A, e, t) {
  var i = e.items, n = Math.max(0, e.width || 0), o = Math.max(0, e.height || 0), g = new no().set(0, 0, n, o), s = g.clone(), I = g.clone(), r = [], a, C, B, l, Q, E;
  for (Q = 0, E = i.length; Q < E; ++Q)
    switch (C = i[Q], C.role) {
      case diA:
        l = kMe(C) ? s : I, l.union(NMe(A, C, n, o));
        break;
      case hiA:
        a = C;
        break;
      case miA:
        r.push(ZMe(A, C));
        break;
      case hMe:
      case mMe:
      case fHA:
      case DHA:
      case GHA:
      case kHA:
      case JHA:
      case NHA:
        s.union(C.bounds), I.union(C.bounds);
        break;
      default:
        g.union(C.bounds);
    }
  if (r.length) {
    const d = {};
    r.forEach((m) => {
      B = m.orient || _r, B !== piA && (d[B] || (d[B] = [])).push(m);
    });
    for (const m in d) {
      const y = d[m];
      SHA(A, y, SMe(y, m, t.legends, s, I, n, o));
    }
    r.forEach((m) => {
      const y = m.bounds;
      if (y.equals(m._bounds) || (m.bounds = m._bounds, A.dirty(m), m.bounds = y, A.dirty(m)), t.autosize && (t.autosize.type === YHA || t.autosize.type === RHA || t.autosize.type === FHA))
        switch (m.orient) {
          case Vr:
          case _r:
            g.add(y.x1, 0).add(y.x2, 0);
            break;
          case Gf:
          case td:
            g.add(0, y.y1).add(0, y.y2);
        }
      else
        g.union(y);
    });
  }
  g.union(s).union(I), a && g.union(VMe(A, a, n, o, g)), e.clip && g.set(0, 0, e.width || 0, e.height || 0), TMe(A, e, g, t);
}
function TMe(A, e, t, i) {
  const n = i.autosize || {}, o = n.type;
  if (A._autosize < 1 || !o)
    return;
  let g = A._width, s = A._height, I = Math.max(0, e.width || 0), r = Math.max(0, Math.ceil(-t.x1)), a = Math.max(0, e.height || 0), C = Math.max(0, Math.ceil(-t.y1));
  const B = Math.max(0, Math.ceil(t.x2 - I)), l = Math.max(0, Math.ceil(t.y2 - a));
  if (n.contains === pMe) {
    const Q = A.padding();
    g -= Q.left + Q.right, s -= Q.top + Q.bottom;
  }
  o === piA ? (r = 0, C = 0, I = g, a = s) : o === YHA ? (I = Math.max(0, g - r - B), a = Math.max(0, s - C - l)) : o === RHA ? (I = Math.max(0, g - r - B), s = a + C + l) : o === FHA ? (g = I + r + B, a = Math.max(0, s - C - l)) : o === bMe && (g = I + r + B, s = a + C + l), A._resizeView(g, s, I, a, [r, C], n.resize);
}
const _Me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  bound: MHA,
  identifier: biA,
  mark: xHA,
  overlap: LHA,
  render: HHA,
  viewlayout: ZHA
}, Symbol.toStringTag, { value: "Module" }));
function WHA(A) {
  FA.call(this, null, A);
}
Ae(WHA, FA, {
  transform(A, e) {
    if (this.value && !A.modified())
      return e.StopPropagation;
    var t = e.dataflow.locale(), i = e.fork(e.NO_SOURCE | e.NO_FIELDS), n = this.value, o = A.scale, g = A.count == null ? A.values ? A.values.length : 10 : A.count, s = vtA(o, g, A.minstep), I = A.format || pvA(t, o, s, A.formatSpecifier, A.formatType, !!A.values), r = A.values ? mvA(o, A.values, s) : HtA(o, s);
    return n && (i.rem = n), n = r.map((a, C) => Qi({
      index: C / (r.length - 1 || 1),
      value: a,
      label: I(a)
    })), A.extra && n.length && n.push(Qi({
      index: -1,
      extra: {
        value: n[0].value
      },
      label: ""
    })), i.source = n, i.add = n, this.value = n, i;
  }
});
function KHA(A) {
  FA.call(this, null, A);
}
function qMe() {
  return Qi({});
}
function OMe(A) {
  const e = TD().test((t) => t.exit);
  return e.lookup = (t) => e.get(A(t)), e;
}
Ae(KHA, FA, {
  transform(A, e) {
    var t = e.dataflow, i = e.fork(e.NO_SOURCE | e.NO_FIELDS), n = A.item || qMe, o = A.key || ve, g = this.value;
    return ZA(i.encode) && (i.encode = null), g && (A.modified("key") || e.modified(o)) && vA("DataJoin does not support modified key function or fields."), g || (e = e.addAll(), this.value = g = OMe(o)), e.visit(e.ADD, (s) => {
      const I = o(s);
      let r = g.get(I);
      r ? r.exit ? (g.empty--, i.add.push(r)) : i.mod.push(r) : (r = n(s), g.set(I, r), i.add.push(r)), r.datum = s, r.exit = !1;
    }), e.visit(e.MOD, (s) => {
      const I = o(s), r = g.get(I);
      r && (r.datum = s, i.mod.push(r));
    }), e.visit(e.REM, (s) => {
      const I = o(s), r = g.get(I);
      s === r.datum && !r.exit && (i.rem.push(r), r.exit = !0, ++g.empty);
    }), e.changed(e.ADD_MOD) && i.modifies("datum"), (e.clean() || A.clean && g.empty > t.cleanThreshold) && t.runAfter(g.clean), i;
  }
});
function UHA(A) {
  FA.call(this, null, A);
}
Ae(UHA, FA, {
  transform(A, e) {
    var t = e.fork(e.ADD_REM), i = A.mod || !1, n = A.encoders, o = e.encode;
    if (ZA(o))
      if (t.changed() || o.every((C) => n[C]))
        o = o[0], t.encode = null;
      else
        return e.StopPropagation;
    var g = o === "enter", s = n.update || wE, I = n.enter || wE, r = n.exit || wE, a = (o && !g ? n[o] : s) || wE;
    if (e.changed(e.ADD) && (e.visit(e.ADD, (C) => {
      I(C, A), s(C, A);
    }), t.modifies(I.output), t.modifies(s.output), a !== wE && a !== s && (e.visit(e.ADD, (C) => {
      a(C, A);
    }), t.modifies(a.output))), e.changed(e.REM) && r !== wE && (e.visit(e.REM, (C) => {
      r(C, A);
    }), t.modifies(r.output)), g || a !== wE) {
      const C = e.MOD | (A.modified() ? e.REFLOW : 0);
      g ? (e.visit(C, (B) => {
        const l = I(B, A) || i;
        (a(B, A) || l) && t.mod.push(B);
      }), t.mod.length && t.modifies(I.output)) : e.visit(C, (B) => {
        (a(B, A) || i) && t.mod.push(B);
      }), t.mod.length && t.modifies(a.output);
    }
    return t.changed() ? t : e.StopPropagation;
  }
});
function VHA(A) {
  FA.call(this, [], A);
}
Ae(VHA, FA, {
  transform(A, e) {
    if (this.value != null && !A.modified())
      return e.StopPropagation;
    var t = e.dataflow.locale(), i = e.fork(e.NO_SOURCE | e.NO_FIELDS), n = this.value, o = A.type || VL, g = A.scale, s = +A.limit, I = vtA(g, A.count == null ? 5 : A.count, A.minstep), r = !!A.values || o === VL, a = A.format || fvA(t, g, I, o, A.formatSpecifier, A.formatType, r), C = A.values || wvA(g, I), B, l, Q, E, d;
    return n && (i.rem = n), o === VL ? (s && C.length > s ? (e.dataflow.warn("Symbol legend count exceeds limit, filtering items."), n = C.slice(0, s - 1), d = !0) : n = C, yt(Q = A.size) ? (!A.values && g(n[0]) === 0 && (n = n.slice(1)), E = n.reduce((m, y) => Math.max(m, Q(y, A)), 0)) : Q = Yg(E = Q || 8), n = n.map((m, y) => Qi({
      index: y,
      label: a(m, y, n),
      value: m,
      offset: E,
      size: Q(m, A)
    })), d && (d = C[n.length], n.push(Qi({
      index: n.length,
      label: `…${C.length - n.length} entries`,
      value: d,
      offset: E,
      size: Q(d, A)
    })))) : o === yRe ? (B = g.domain(), l = uvA(g, B[0], Xt(B)), C.length < 3 && !A.values && B[0] !== Xt(B) && (C = [B[0], Xt(B)]), n = C.map((m, y) => Qi({
      index: y,
      label: a(m, y, C),
      value: m,
      perc: l(m)
    }))) : (Q = C.length - 1, l = FRe(g), n = C.map((m, y) => Qi({
      index: y,
      label: a(m, y, C),
      value: m,
      perc: y ? l(m) : 0,
      perc2: y === Q ? 1 : l(C[y + 1])
    }))), i.source = n, i.add = n, this.value = n, i;
  }
});
const jMe = (A) => A.source.x, PMe = (A) => A.source.y, $Me = (A) => A.target.x, Axe = (A) => A.target.y;
function wiA(A) {
  FA.call(this, {}, A);
}
wiA.Definition = {
  type: "LinkPath",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "sourceX",
    type: "field",
    default: "source.x"
  }, {
    name: "sourceY",
    type: "field",
    default: "source.y"
  }, {
    name: "targetX",
    type: "field",
    default: "target.x"
  }, {
    name: "targetY",
    type: "field",
    default: "target.y"
  }, {
    name: "orient",
    type: "enum",
    default: "vertical",
    values: ["horizontal", "vertical", "radial"]
  }, {
    name: "shape",
    type: "enum",
    default: "line",
    values: ["line", "arc", "curve", "diagonal", "orthogonal"]
  }, {
    name: "require",
    type: "signal"
  }, {
    name: "as",
    type: "string",
    default: "path"
  }]
};
Ae(wiA, FA, {
  transform(A, e) {
    var t = A.sourceX || jMe, i = A.sourceY || PMe, n = A.targetX || $Me, o = A.targetY || Axe, g = A.as || "path", s = A.orient || "vertical", I = A.shape || "line", r = euA.get(I + "-" + s) || euA.get(I);
    return r || vA("LinkPath unsupported type: " + A.shape + (A.orient ? "-" + A.orient : "")), e.visit(e.SOURCE, (a) => {
      a[g] = r(t(a), i(a), n(a), o(a));
    }), e.reflow(A.modified()).modifies(g);
  }
});
const XHA = (A, e, t, i) => "M" + A + "," + e + "L" + t + "," + i, exe = (A, e, t, i) => XHA(e * Math.cos(A), e * Math.sin(A), i * Math.cos(t), i * Math.sin(t)), zHA = (A, e, t, i) => {
  var n = t - A, o = i - e, g = Math.hypot(n, o) / 2, s = 180 * Math.atan2(o, n) / Math.PI;
  return "M" + A + "," + e + "A" + g + "," + g + " " + s + " 0 1 " + t + "," + i;
}, txe = (A, e, t, i) => zHA(e * Math.cos(A), e * Math.sin(A), i * Math.cos(t), i * Math.sin(t)), THA = (A, e, t, i) => {
  const n = t - A, o = i - e, g = 0.2 * (n + o), s = 0.2 * (o - n);
  return "M" + A + "," + e + "C" + (A + g) + "," + (e + s) + " " + (t + s) + "," + (i - g) + " " + t + "," + i;
}, ixe = (A, e, t, i) => THA(e * Math.cos(A), e * Math.sin(A), i * Math.cos(t), i * Math.sin(t)), nxe = (A, e, t, i) => "M" + A + "," + e + "V" + i + "H" + t, oxe = (A, e, t, i) => "M" + A + "," + e + "H" + t + "V" + i, gxe = (A, e, t, i) => {
  const n = Math.cos(A), o = Math.sin(A), g = Math.cos(t), s = Math.sin(t), I = Math.abs(t - A) > Math.PI ? t <= A : t > A;
  return "M" + e * n + "," + e * o + "A" + e + "," + e + " 0 0," + (I ? 1 : 0) + " " + e * g + "," + e * s + "L" + i * g + "," + i * s;
}, sxe = (A, e, t, i) => {
  const n = (A + t) / 2;
  return "M" + A + "," + e + "C" + n + "," + e + " " + n + "," + i + " " + t + "," + i;
}, Ixe = (A, e, t, i) => {
  const n = (e + i) / 2;
  return "M" + A + "," + e + "C" + A + "," + n + " " + t + "," + n + " " + t + "," + i;
}, axe = (A, e, t, i) => {
  const n = Math.cos(A), o = Math.sin(A), g = Math.cos(t), s = Math.sin(t), I = (e + i) / 2;
  return "M" + e * n + "," + e * o + "C" + I * n + "," + I * o + " " + I * g + "," + I * s + " " + i * g + "," + i * s;
}, euA = TD({
  line: XHA,
  "line-radial": exe,
  arc: zHA,
  "arc-radial": txe,
  curve: THA,
  "curve-radial": ixe,
  "orthogonal-horizontal": nxe,
  "orthogonal-vertical": oxe,
  "orthogonal-radial": gxe,
  "diagonal-horizontal": sxe,
  "diagonal-vertical": Ixe,
  "diagonal-radial": axe
});
function fiA(A) {
  FA.call(this, null, A);
}
fiA.Definition = {
  type: "Pie",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field"
  }, {
    name: "startAngle",
    type: "number",
    default: 0
  }, {
    name: "endAngle",
    type: "number",
    default: 6.283185307179586
  }, {
    name: "sort",
    type: "boolean",
    default: !1
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: 2,
    default: ["startAngle", "endAngle"]
  }]
};
Ae(fiA, FA, {
  transform(A, e) {
    var t = A.as || ["startAngle", "endAngle"], i = t[0], n = t[1], o = A.field || VD, g = A.startAngle || 0, s = A.endAngle != null ? A.endAngle : 2 * Math.PI, I = e.source, r = I.map(o), a = r.length, C = g, B = (s - g) / M1A(r), l = HI(a), Q, E, d;
    for (A.sort && l.sort((m, y) => r[m] - r[y]), Q = 0; Q < a; ++Q)
      d = r[l[Q]], E = I[l[Q]], E[i] = C, E[n] = C += d * B;
    return this.value = r, e.reflow(A.modified()).modifies(t);
  }
});
const rxe = 5;
function Cxe(A) {
  const e = A.type;
  return !A.bins && (e === pf || e === lF || e === cF);
}
function _HA(A) {
  return MtA(A) && A !== qB;
}
const Bxe = mC(["set", "modified", "clear", "type", "scheme", "schemeExtent", "schemeCount", "domain", "domainMin", "domainMid", "domainMax", "domainRaw", "domainImplicit", "nice", "zero", "bins", "range", "rangeStep", "round", "reverse", "interpolate", "interpolateGamma"]);
function qHA(A) {
  FA.call(this, null, A), this.modified(!0);
}
Ae(qHA, FA, {
  transform(A, e) {
    var t = e.dataflow, i = this.value, n = lxe(A);
    (!i || n !== i.type) && (this.value = i = ri(n)());
    for (n in A)
      if (!Bxe[n]) {
        if (n === "padding" && _HA(i.type))
          continue;
        yt(i[n]) ? i[n](A[n]) : t.warn("Unsupported scale property: " + n);
      }
    return hxe(i, A, dxe(i, A, Qxe(i, A, t))), e.fork(e.NO_SOURCE | e.NO_FIELDS);
  }
});
function lxe(A) {
  var e = A.type, t = "", i;
  return e === qB ? qB + "-" + pf : (cxe(A) && (i = A.rawDomain ? A.rawDomain.length : A.domain ? A.domain.length + +(A.domainMid != null) : 0, t = i === 2 ? qB + "-" : i === 3 ? jD + "-" : ""), (t + e || pf).toLowerCase());
}
function cxe(A) {
  const e = A.type;
  return MtA(e) && e !== Cp && e !== Bp && (A.scheme || A.range && A.range.length && A.range.every(Be));
}
function Qxe(A, e, t) {
  const i = Exe(A, e.domainRaw, t);
  if (i > -1)
    return i;
  var n = e.domain, o = A.type, g = e.zero || e.zero === void 0 && Cxe(A), s, I;
  if (!n)
    return 0;
  if (_HA(o) && e.padding && n[0] !== Xt(n) && (n = uxe(o, n, e.range, e.padding, e.exponent, e.constant)), (g || e.domainMin != null || e.domainMax != null || e.domainMid != null) && (s = (n = n.slice()).length - 1 || 1, g && (n[0] > 0 && (n[0] = 0), n[s] < 0 && (n[s] = 0)), e.domainMin != null && (n[0] = e.domainMin), e.domainMax != null && (n[s] = e.domainMax), e.domainMid != null)) {
    I = e.domainMid;
    const r = I > n[s] ? s + 1 : I < n[0] ? 0 : s;
    r !== s && t.warn("Scale domainMid exceeds domain min or max.", I), n.splice(r, 0, I);
  }
  return A.domain(OHA(o, n, t)), o === NtA && A.unknown(e.domainImplicit ? mO : void 0), e.nice && A.nice && A.nice(e.nice !== !0 && vtA(A, e.nice) || null), n.length;
}
function Exe(A, e, t) {
  return e ? (A.domain(OHA(A.type, e, t)), e.length) : -1;
}
function uxe(A, e, t, i, n, o) {
  var g = Math.abs(Xt(t) - t[0]), s = g / (g - 2 * i), I = A === uQ ? EeA(e, null, s) : A === cF ? hS(e, null, s, 0.5) : A === lF ? hS(e, null, s, n || 1) : A === yU ? ueA(e, null, s, o || 1) : QeA(e, null, s);
  return e = e.slice(), e[0] = I[0], e[e.length - 1] = I[1], e;
}
function OHA(A, e, t) {
  if (BvA(A)) {
    var i = Math.abs(e.reduce((n, o) => n + (o < 0 ? -1 : o > 0 ? 1 : 0), 0));
    i !== e.length && t.warn("Log scale domain includes zero: " + ie(e));
  }
  return e;
}
function dxe(A, e, t) {
  let i = e.bins;
  if (i && !ZA(i)) {
    const n = A.domain(), o = n[0], g = Xt(n), s = i.step;
    let I = i.start == null ? o : i.start, r = i.stop == null ? g : i.stop;
    s || vA("Scale bins parameter missing step property."), I < o && (I = s * Math.ceil(o / s)), r > g && (r = s * Math.floor(g / s)), i = HI(I, r + s / 2, s);
  }
  return i ? A.bins = i : A.bins && delete A.bins, A.type === YtA && (i ? !e.domain && !e.domainRaw && (A.domain(i), t = i.length) : A.bins = A.domain()), t;
}
function hxe(A, e, t) {
  var i = A.type, n = e.round || !1, o = e.range;
  if (e.rangeStep != null)
    o = mxe(i, e, t);
  else if (e.scheme && (o = pxe(i, e, t), yt(o))) {
    if (A.interpolator)
      return A.interpolator(o);
    vA(`Scale type ${i} does not support interpolating color schemes.`);
  }
  if (o && lvA(i))
    return A.interpolator(fU(rj(o, e.reverse), e.interpolate, e.interpolateGamma));
  o && e.interpolate && A.interpolate ? A.interpolate(xtA(e.interpolate, e.interpolateGamma)) : yt(A.round) ? A.round(n) : yt(A.rangeRound) && A.interpolate(n ? gF : Sd), o && A.range(rj(o, e.reverse));
}
function mxe(A, e, t) {
  A !== gvA && A !== _O && vA("Only band and point scales support rangeStep.");
  var i = (e.paddingOuter != null ? e.paddingOuter : e.padding) || 0, n = A === _O ? 1 : (e.paddingInner != null ? e.paddingInner : e.padding) || 0;
  return [0, e.rangeStep * JtA(t, n, i)];
}
function pxe(A, e, t) {
  var i = e.schemeExtent, n, o;
  return ZA(e.scheme) ? o = fU(e.scheme, e.interpolate, e.interpolateGamma) : (n = e.scheme.toLowerCase(), o = LtA(n), o || vA(`Unrecognized scheme name: ${e.scheme}`)), t = A === wU ? t + 1 : A === YtA ? t - 1 : A === yf || A === bU ? +e.schemeCount || rxe : t, lvA(A) ? tuA(o, i, e.reverse) : yt(o) ? EvA(tuA(o, i), t) : A === NtA ? o : o.slice(0, t);
}
function tuA(A, e, t) {
  return yt(A) && (e || t) ? QvA(A, rj(e || [0, 1], t)) : A;
}
function rj(A, e) {
  return e ? A.slice().reverse() : A;
}
function jHA(A) {
  FA.call(this, null, A);
}
Ae(jHA, FA, {
  transform(A, e) {
    const t = A.modified("sort") || e.changed(e.ADD) || e.modified(A.sort.fields) || e.modified("datum");
    return t && e.source.sort(s0(A.sort)), this.modified(t), e;
  }
});
const iuA = "zero", PHA = "center", $HA = "normalize", ASA = ["y0", "y1"];
function DiA(A) {
  FA.call(this, null, A);
}
DiA.Definition = {
  type: "Stack",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field"
  }, {
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "sort",
    type: "compare"
  }, {
    name: "offset",
    type: "enum",
    default: iuA,
    values: [iuA, PHA, $HA]
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: 2,
    default: ASA
  }]
};
Ae(DiA, FA, {
  transform(A, e) {
    var t = A.as || ASA, i = t[0], n = t[1], o = s0(A.sort), g = A.field || VD, s = A.offset === PHA ? yxe : A.offset === $HA ? bxe : wxe, I, r, a, C;
    for (I = fxe(e.source, A.groupby, o, g), r = 0, a = I.length, C = I.max; r < a; ++r)
      s(I[r], C, g, i, n);
    return e.reflow(A.modified()).modifies(t);
  }
});
function yxe(A, e, t, i, n) {
  for (var o = (e - A.sum) / 2, g = A.length, s = 0, I; s < g; ++s)
    I = A[s], I[i] = o, I[n] = o += Math.abs(t(I));
}
function bxe(A, e, t, i, n) {
  for (var o = 1 / A.sum, g = 0, s = A.length, I = 0, r = 0, a; I < s; ++I)
    a = A[I], a[i] = g, a[n] = g = o * (r += Math.abs(t(a)));
}
function wxe(A, e, t, i, n) {
  for (var o = 0, g = 0, s = A.length, I = 0, r, a; I < s; ++I)
    a = A[I], r = +t(a), r < 0 ? (a[i] = g, a[n] = g += r) : (a[i] = o, a[n] = o += r);
}
function fxe(A, e, t, i) {
  var n = [], o = (E) => E(a), g, s, I, r, a, C, B, l, Q;
  if (e == null)
    n.push(A.slice());
  else
    for (g = {}, s = 0, I = A.length; s < I; ++s)
      a = A[s], C = e.map(o), B = g[C], B || (g[C] = B = [], n.push(B)), B.push(a);
  for (C = 0, Q = 0, r = n.length; C < r; ++C) {
    for (B = n[C], s = 0, l = 0, I = B.length; s < I; ++s)
      l += Math.abs(i(B[s]));
    B.sum = l, l > Q && (Q = l), t && B.sort(t);
  }
  return n.max = Q, n;
}
const Dxe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  axisticks: WHA,
  datajoin: KHA,
  encode: UHA,
  legendentries: VHA,
  linkpath: wiA,
  pie: fiA,
  scale: qHA,
  sortitems: jHA,
  stack: DiA
}, Symbol.toStringTag, { value: "Module" }));
var Ue = 1e-6, SS = 1e-12, Ft = Math.PI, Ln = Ft / 2, ZS = Ft / 4, Cs = Ft * 2, Un = 180 / Ft, Yt = Ft / 180, Vt = Math.abs, AG = Math.atan, sr = Math.atan2, Xe = Math.cos, ix = Math.ceil, eSA = Math.exp, Cj = Math.hypot, WS = Math.log, fz = Math.pow, Se = Math.sin, Wa = Math.sign || function(A) {
  return A > 0 ? 1 : A < 0 ? -1 : 0;
}, Bs = Math.sqrt, GiA = Math.tan;
function tSA(A) {
  return A > 1 ? 0 : A < -1 ? Ft : Math.acos(A);
}
function Os(A) {
  return A > 1 ? Ln : A < -1 ? -Ln : Math.asin(A);
}
function jo() {
}
function KS(A, e) {
  A && ouA.hasOwnProperty(A.type) && ouA[A.type](A, e);
}
var nuA = {
  Feature: function(A, e) {
    KS(A.geometry, e);
  },
  FeatureCollection: function(A, e) {
    for (var t = A.features, i = -1, n = t.length; ++i < n; )
      KS(t[i].geometry, e);
  }
}, ouA = {
  Sphere: function(A, e) {
    e.sphere();
  },
  Point: function(A, e) {
    A = A.coordinates, e.point(A[0], A[1], A[2]);
  },
  MultiPoint: function(A, e) {
    for (var t = A.coordinates, i = -1, n = t.length; ++i < n; )
      A = t[i], e.point(A[0], A[1], A[2]);
  },
  LineString: function(A, e) {
    Bj(A.coordinates, e, 0);
  },
  MultiLineString: function(A, e) {
    for (var t = A.coordinates, i = -1, n = t.length; ++i < n; )
      Bj(t[i], e, 0);
  },
  Polygon: function(A, e) {
    guA(A.coordinates, e);
  },
  MultiPolygon: function(A, e) {
    for (var t = A.coordinates, i = -1, n = t.length; ++i < n; )
      guA(t[i], e);
  },
  GeometryCollection: function(A, e) {
    for (var t = A.geometries, i = -1, n = t.length; ++i < n; )
      KS(t[i], e);
  }
};
function Bj(A, e, t) {
  var i = -1, n = A.length - t, o;
  for (e.lineStart(); ++i < n; )
    o = A[i], e.point(o[0], o[1], o[2]);
  e.lineEnd();
}
function guA(A, e) {
  var t = -1, i = A.length;
  for (e.polygonStart(); ++t < i; )
    Bj(A[t], e, 1);
  e.polygonEnd();
}
function Dc(A, e) {
  A && nuA.hasOwnProperty(A.type) ? nuA[A.type](A, e) : KS(A, e);
}
var US = new gs(), VS = new gs(), iSA, nSA, lj, cj, Qj, al = {
  point: jo,
  lineStart: jo,
  lineEnd: jo,
  polygonStart: function() {
    US = new gs(), al.lineStart = Gxe, al.lineEnd = kxe;
  },
  polygonEnd: function() {
    var A = +US;
    VS.add(A < 0 ? Cs + A : A), this.lineStart = this.lineEnd = this.point = jo;
  },
  sphere: function() {
    VS.add(Cs);
  }
};
function Gxe() {
  al.point = Jxe;
}
function kxe() {
  oSA(iSA, nSA);
}
function Jxe(A, e) {
  al.point = oSA, iSA = A, nSA = e, A *= Yt, e *= Yt, lj = A, cj = Xe(e = e / 2 + ZS), Qj = Se(e);
}
function oSA(A, e) {
  A *= Yt, e *= Yt, e = e / 2 + ZS;
  var t = A - lj, i = t >= 0 ? 1 : -1, n = i * t, o = Xe(e), g = Se(e), s = Qj * g, I = cj * o + s * Xe(n), r = s * i * Se(n);
  US.add(sr(r, I)), lj = A, cj = o, Qj = g;
}
function Nxe(A) {
  return VS = new gs(), Dc(A, al), VS * 2;
}
function XS(A) {
  return [sr(A[1], A[0]), Os(A[2])];
}
function cp(A) {
  var e = A[0], t = A[1], i = Xe(t);
  return [i * Xe(e), i * Se(e), Se(t)];
}
function nx(A, e) {
  return A[0] * e[0] + A[1] * e[1] + A[2] * e[2];
}
function kf(A, e) {
  return [A[1] * e[2] - A[2] * e[1], A[2] * e[0] - A[0] * e[2], A[0] * e[1] - A[1] * e[0]];
}
function Dz(A, e) {
  A[0] += e[0], A[1] += e[1], A[2] += e[2];
}
function ox(A, e) {
  return [A[0] * e, A[1] * e, A[2] * e];
}
function zS(A) {
  var e = Bs(A[0] * A[0] + A[1] * A[1] + A[2] * A[2]);
  A[0] /= e, A[1] /= e, A[2] /= e;
}
var wn, Ns, Yn, kI, Th, gSA, sSA, Cw, bN, ME, dQ, mc = {
  point: Ej,
  lineStart: suA,
  lineEnd: IuA,
  polygonStart: function() {
    mc.point = aSA, mc.lineStart = Yxe, mc.lineEnd = Rxe, bN = new gs(), al.polygonStart();
  },
  polygonEnd: function() {
    al.polygonEnd(), mc.point = Ej, mc.lineStart = suA, mc.lineEnd = IuA, US < 0 ? (wn = -(Yn = 180), Ns = -(kI = 90)) : bN > Ue ? kI = 90 : bN < -Ue && (Ns = -90), dQ[0] = wn, dQ[1] = Yn;
  },
  sphere: function() {
    wn = -(Yn = 180), Ns = -(kI = 90);
  }
};
function Ej(A, e) {
  ME.push(dQ = [wn = A, Yn = A]), e < Ns && (Ns = e), e > kI && (kI = e);
}
function ISA(A, e) {
  var t = cp([A * Yt, e * Yt]);
  if (Cw) {
    var i = kf(Cw, t), n = [i[1], -i[0], 0], o = kf(n, i);
    zS(o), o = XS(o);
    var g = A - Th, s = g > 0 ? 1 : -1, I = o[0] * Un * s, r, a = Vt(g) > 180;
    a ^ (s * Th < I && I < s * A) ? (r = o[1] * Un, r > kI && (kI = r)) : (I = (I + 360) % 360 - 180, a ^ (s * Th < I && I < s * A) ? (r = -o[1] * Un, r < Ns && (Ns = r)) : (e < Ns && (Ns = e), e > kI && (kI = e))), a ? A < Th ? wI(wn, A) > wI(wn, Yn) && (Yn = A) : wI(A, Yn) > wI(wn, Yn) && (wn = A) : Yn >= wn ? (A < wn && (wn = A), A > Yn && (Yn = A)) : A > Th ? wI(wn, A) > wI(wn, Yn) && (Yn = A) : wI(A, Yn) > wI(wn, Yn) && (wn = A);
  } else
    ME.push(dQ = [wn = A, Yn = A]);
  e < Ns && (Ns = e), e > kI && (kI = e), Cw = t, Th = A;
}
function suA() {
  mc.point = ISA;
}
function IuA() {
  dQ[0] = wn, dQ[1] = Yn, mc.point = Ej, Cw = null;
}
function aSA(A, e) {
  if (Cw) {
    var t = A - Th;
    bN.add(Vt(t) > 180 ? t + (t > 0 ? 360 : -360) : t);
  } else
    gSA = A, sSA = e;
  al.point(A, e), ISA(A, e);
}
function Yxe() {
  al.lineStart();
}
function Rxe() {
  aSA(gSA, sSA), al.lineEnd(), Vt(bN) > Ue && (wn = -(Yn = 180)), dQ[0] = wn, dQ[1] = Yn, Cw = null;
}
function wI(A, e) {
  return (e -= A) < 0 ? e + 360 : e;
}
function Fxe(A, e) {
  return A[0] - e[0];
}
function auA(A, e) {
  return A[0] <= A[1] ? A[0] <= e && e <= A[1] : e < A[0] || A[1] < e;
}
function Mxe(A) {
  var e, t, i, n, o, g, s;
  if (kI = Yn = -(wn = Ns = 1 / 0), ME = [], Dc(A, mc), t = ME.length) {
    for (ME.sort(Fxe), e = 1, i = ME[0], o = [i]; e < t; ++e)
      n = ME[e], auA(i, n[0]) || auA(i, n[1]) ? (wI(i[0], n[1]) > wI(i[0], i[1]) && (i[1] = n[1]), wI(n[0], i[1]) > wI(i[0], i[1]) && (i[0] = n[0])) : o.push(i = n);
    for (g = -1 / 0, t = o.length - 1, e = 0, i = o[t]; e <= t; i = n, ++e)
      n = o[e], (s = wI(i[1], n[0])) > g && (g = s, wn = n[0], Yn = i[1]);
  }
  return ME = dQ = null, wn === 1 / 0 || Ns === 1 / 0 ? [[NaN, NaN], [NaN, NaN]] : [[wn, Ns], [Yn, kI]];
}
var DJ, TS, _S, qS, OS, jS, PS, $S, uj, dj, hj, rSA, CSA, Og, jg, Pg, qr = {
  sphere: jo,
  point: kiA,
  lineStart: ruA,
  lineEnd: CuA,
  polygonStart: function() {
    qr.lineStart = vxe, qr.lineEnd = Hxe;
  },
  polygonEnd: function() {
    qr.lineStart = ruA, qr.lineEnd = CuA;
  }
};
function kiA(A, e) {
  A *= Yt, e *= Yt;
  var t = Xe(e);
  fF(t * Xe(A), t * Se(A), Se(e));
}
function fF(A, e, t) {
  ++DJ, _S += (A - _S) / DJ, qS += (e - qS) / DJ, OS += (t - OS) / DJ;
}
function ruA() {
  qr.point = xxe;
}
function xxe(A, e) {
  A *= Yt, e *= Yt;
  var t = Xe(e);
  Og = t * Xe(A), jg = t * Se(A), Pg = Se(e), qr.point = Lxe, fF(Og, jg, Pg);
}
function Lxe(A, e) {
  A *= Yt, e *= Yt;
  var t = Xe(e), i = t * Xe(A), n = t * Se(A), o = Se(e), g = sr(Bs((g = jg * o - Pg * n) * g + (g = Pg * i - Og * o) * g + (g = Og * n - jg * i) * g), Og * i + jg * n + Pg * o);
  TS += g, jS += g * (Og + (Og = i)), PS += g * (jg + (jg = n)), $S += g * (Pg + (Pg = o)), fF(Og, jg, Pg);
}
function CuA() {
  qr.point = kiA;
}
function vxe() {
  qr.point = Sxe;
}
function Hxe() {
  BSA(rSA, CSA), qr.point = kiA;
}
function Sxe(A, e) {
  rSA = A, CSA = e, A *= Yt, e *= Yt, qr.point = BSA;
  var t = Xe(e);
  Og = t * Xe(A), jg = t * Se(A), Pg = Se(e), fF(Og, jg, Pg);
}
function BSA(A, e) {
  A *= Yt, e *= Yt;
  var t = Xe(e), i = t * Xe(A), n = t * Se(A), o = Se(e), g = jg * o - Pg * n, s = Pg * i - Og * o, I = Og * n - jg * i, r = Cj(g, s, I), a = Os(r), C = r && -a / r;
  uj.add(C * g), dj.add(C * s), hj.add(C * I), TS += a, jS += a * (Og + (Og = i)), PS += a * (jg + (jg = n)), $S += a * (Pg + (Pg = o)), fF(Og, jg, Pg);
}
function Zxe(A) {
  DJ = TS = _S = qS = OS = jS = PS = $S = 0, uj = new gs(), dj = new gs(), hj = new gs(), Dc(A, qr);
  var e = +uj, t = +dj, i = +hj, n = Cj(e, t, i);
  return n < SS && (e = jS, t = PS, i = $S, TS < Ue && (e = _S, t = qS, i = OS), n = Cj(e, t, i), n < SS) ? [NaN, NaN] : [sr(t, e) * Un, Os(i / n) * Un];
}
function mj(A, e) {
  function t(i, n) {
    return i = A(i, n), e(i[0], i[1]);
  }
  return A.invert && e.invert && (t.invert = function(i, n) {
    return i = e.invert(i, n), i && A.invert(i[0], i[1]);
  }), t;
}
function pj(A, e) {
  return Vt(A) > Ft && (A -= Math.round(A / Cs) * Cs), [A, e];
}
pj.invert = pj;
function lSA(A, e, t) {
  return (A %= Cs) ? e || t ? mj(luA(A), cuA(e, t)) : luA(A) : e || t ? cuA(e, t) : pj;
}
function BuA(A) {
  return function(e, t) {
    return e += A, Vt(e) > Ft && (e -= Math.round(e / Cs) * Cs), [e, t];
  };
}
function luA(A) {
  var e = BuA(A);
  return e.invert = BuA(-A), e;
}
function cuA(A, e) {
  var t = Xe(A), i = Se(A), n = Xe(e), o = Se(e);
  function g(s, I) {
    var r = Xe(I), a = Xe(s) * r, C = Se(s) * r, B = Se(I), l = B * t + a * i;
    return [
      sr(C * n - l * o, a * t - B * i),
      Os(l * n + C * o)
    ];
  }
  return g.invert = function(s, I) {
    var r = Xe(I), a = Xe(s) * r, C = Se(s) * r, B = Se(I), l = B * n - C * o;
    return [
      sr(C * n + B * o, a * t + l * i),
      Os(l * t - a * i)
    ];
  }, g;
}
function Wxe(A) {
  A = lSA(A[0] * Yt, A[1] * Yt, A.length > 2 ? A[2] * Yt : 0);
  function e(t) {
    return t = A(t[0] * Yt, t[1] * Yt), t[0] *= Un, t[1] *= Un, t;
  }
  return e.invert = function(t) {
    return t = A.invert(t[0] * Yt, t[1] * Yt), t[0] *= Un, t[1] *= Un, t;
  }, e;
}
function Kxe(A, e, t, i, n, o) {
  if (t) {
    var g = Xe(e), s = Se(e), I = i * t;
    n == null ? (n = e + i * Cs, o = e - I / 2) : (n = QuA(g, n), o = QuA(g, o), (i > 0 ? n < o : n > o) && (n += i * Cs));
    for (var r, a = n; i > 0 ? a > o : a < o; a -= I)
      r = XS([g, -s * Xe(a), -s * Se(a)]), A.point(r[0], r[1]);
  }
}
function QuA(A, e) {
  e = cp(e), e[0] -= A, zS(e);
  var t = tSA(-e[1]);
  return ((-e[2] < 0 ? -t : t) + Cs - Ue) % Cs;
}
function cSA() {
  var A = [], e;
  return {
    point: function(t, i, n) {
      e.push([t, i, n]);
    },
    lineStart: function() {
      A.push(e = []);
    },
    lineEnd: jo,
    rejoin: function() {
      A.length > 1 && A.push(A.pop().concat(A.shift()));
    },
    result: function() {
      var t = A;
      return A = [], e = null, t;
    }
  };
}
function PL(A, e) {
  return Vt(A[0] - e[0]) < Ue && Vt(A[1] - e[1]) < Ue;
}
function gx(A, e, t, i) {
  this.x = A, this.z = e, this.o = t, this.e = i, this.v = !1, this.n = this.p = null;
}
function QSA(A, e, t, i, n) {
  var o = [], g = [], s, I;
  if (A.forEach(function(Q) {
    if (!((E = Q.length - 1) <= 0)) {
      var E, d = Q[0], m = Q[E], y;
      if (PL(d, m)) {
        if (!d[2] && !m[2]) {
          for (n.lineStart(), s = 0; s < E; ++s)
            n.point((d = Q[s])[0], d[1]);
          n.lineEnd();
          return;
        }
        m[0] += 2 * Ue;
      }
      o.push(y = new gx(d, Q, null, !0)), g.push(y.o = new gx(d, null, y, !1)), o.push(y = new gx(m, Q, null, !1)), g.push(y.o = new gx(m, null, y, !0));
    }
  }), !!o.length) {
    for (g.sort(e), EuA(o), EuA(g), s = 0, I = g.length; s < I; ++s)
      g[s].e = t = !t;
    for (var r = o[0], a, C; ; ) {
      for (var B = r, l = !0; B.v; )
        if ((B = B.n) === r)
          return;
      a = B.z, n.lineStart();
      do {
        if (B.v = B.o.v = !0, B.e) {
          if (l)
            for (s = 0, I = a.length; s < I; ++s)
              n.point((C = a[s])[0], C[1]);
          else
            i(B.x, B.n.x, 1, n);
          B = B.n;
        } else {
          if (l)
            for (a = B.p.z, s = a.length - 1; s >= 0; --s)
              n.point((C = a[s])[0], C[1]);
          else
            i(B.x, B.p.x, -1, n);
          B = B.p;
        }
        B = B.o, a = B.z, l = !l;
      } while (!B.v);
      n.lineEnd();
    }
  }
}
function EuA(A) {
  if (e = A.length) {
    for (var e, t = 0, i = A[0], n; ++t < e; )
      i.n = n = A[t], n.p = i, i = n;
    i.n = n = A[0], n.p = i;
  }
}
function Gz(A) {
  return Vt(A[0]) <= Ft ? A[0] : Wa(A[0]) * ((Vt(A[0]) + Ft) % Cs - Ft);
}
function Uxe(A, e) {
  var t = Gz(e), i = e[1], n = Se(i), o = [Se(t), -Xe(t), 0], g = 0, s = 0, I = new gs();
  n === 1 ? i = Ln + Ue : n === -1 && (i = -Ln - Ue);
  for (var r = 0, a = A.length; r < a; ++r)
    if (B = (C = A[r]).length)
      for (var C, B, l = C[B - 1], Q = Gz(l), E = l[1] / 2 + ZS, d = Se(E), m = Xe(E), y = 0; y < B; ++y, Q = w, d = R, m = F, l = f) {
        var f = C[y], w = Gz(f), G = f[1] / 2 + ZS, R = Se(G), F = Xe(G), Z = w - Q, c = Z >= 0 ? 1 : -1, J = c * Z, p = J > Ft, N = d * R;
        if (I.add(sr(N * c * Se(J), m * F + N * Xe(J))), g += p ? Z + c * Cs : Z, p ^ Q >= t ^ w >= t) {
          var v = kf(cp(l), cp(f));
          zS(v);
          var K = kf(o, v);
          zS(K);
          var U = (p ^ Z >= 0 ? -1 : 1) * Os(K[2]);
          (i > U || i === U && (v[0] || v[1])) && (s += p ^ Z >= 0 ? 1 : -1);
        }
      }
  return (g < -Ue || g < Ue && I < -SS) ^ s & 1;
}
function ESA(A, e, t, i) {
  return function(n) {
    var o = e(n), g = cSA(), s = e(g), I = !1, r, a, C, B = {
      point: l,
      lineStart: E,
      lineEnd: d,
      polygonStart: function() {
        B.point = m, B.lineStart = y, B.lineEnd = f, a = [], r = [];
      },
      polygonEnd: function() {
        B.point = l, B.lineStart = E, B.lineEnd = d, a = F1A(a);
        var w = Uxe(r, i);
        a.length ? (I || (n.polygonStart(), I = !0), QSA(a, Xxe, w, t, n)) : w && (I || (n.polygonStart(), I = !0), n.lineStart(), t(null, null, 1, n), n.lineEnd()), I && (n.polygonEnd(), I = !1), a = r = null;
      },
      sphere: function() {
        n.polygonStart(), n.lineStart(), t(null, null, 1, n), n.lineEnd(), n.polygonEnd();
      }
    };
    function l(w, G) {
      A(w, G) && n.point(w, G);
    }
    function Q(w, G) {
      o.point(w, G);
    }
    function E() {
      B.point = Q, o.lineStart();
    }
    function d() {
      B.point = l, o.lineEnd();
    }
    function m(w, G) {
      C.push([w, G]), s.point(w, G);
    }
    function y() {
      s.lineStart(), C = [];
    }
    function f() {
      m(C[0][0], C[0][1]), s.lineEnd();
      var w = s.clean(), G = g.result(), R, F = G.length, Z, c, J;
      if (C.pop(), r.push(C), C = null, !!F) {
        if (w & 1) {
          if (c = G[0], (Z = c.length - 1) > 0) {
            for (I || (n.polygonStart(), I = !0), n.lineStart(), R = 0; R < Z; ++R)
              n.point((J = c[R])[0], J[1]);
            n.lineEnd();
          }
          return;
        }
        F > 1 && w & 2 && G.push(G.pop().concat(G.shift())), a.push(G.filter(Vxe));
      }
    }
    return B;
  };
}
function Vxe(A) {
  return A.length > 1;
}
function Xxe(A, e) {
  return ((A = A.x)[0] < 0 ? A[1] - Ln - Ue : Ln - A[1]) - ((e = e.x)[0] < 0 ? e[1] - Ln - Ue : Ln - e[1]);
}
const uuA = ESA(
  function() {
    return !0;
  },
  zxe,
  _xe,
  [-Ft, -Ln]
);
function zxe(A) {
  var e = NaN, t = NaN, i = NaN, n;
  return {
    lineStart: function() {
      A.lineStart(), n = 1;
    },
    point: function(o, g) {
      var s = o > 0 ? Ft : -Ft, I = Vt(o - e);
      Vt(I - Ft) < Ue ? (A.point(e, t = (t + g) / 2 > 0 ? Ln : -Ln), A.point(i, t), A.lineEnd(), A.lineStart(), A.point(s, t), A.point(o, t), n = 0) : i !== s && I >= Ft && (Vt(e - i) < Ue && (e -= i * Ue), Vt(o - s) < Ue && (o -= s * Ue), t = Txe(e, t, o, g), A.point(i, t), A.lineEnd(), A.lineStart(), A.point(s, t), n = 0), A.point(e = o, t = g), i = s;
    },
    lineEnd: function() {
      A.lineEnd(), e = t = NaN;
    },
    clean: function() {
      return 2 - n;
    }
  };
}
function Txe(A, e, t, i) {
  var n, o, g = Se(A - t);
  return Vt(g) > Ue ? AG((Se(e) * (o = Xe(i)) * Se(t) - Se(i) * (n = Xe(e)) * Se(A)) / (n * o * g)) : (e + i) / 2;
}
function _xe(A, e, t, i) {
  var n;
  if (A == null)
    n = t * Ln, i.point(-Ft, n), i.point(0, n), i.point(Ft, n), i.point(Ft, 0), i.point(Ft, -n), i.point(0, -n), i.point(-Ft, -n), i.point(-Ft, 0), i.point(-Ft, n);
  else if (Vt(A[0] - e[0]) > Ue) {
    var o = A[0] < e[0] ? Ft : -Ft;
    n = t * o / 2, i.point(-o, n), i.point(0, n), i.point(o, n);
  } else
    i.point(e[0], e[1]);
}
function qxe(A) {
  var e = Xe(A), t = 6 * Yt, i = e > 0, n = Vt(e) > Ue;
  function o(a, C, B, l) {
    Kxe(l, A, t, B, a, C);
  }
  function g(a, C) {
    return Xe(a) * Xe(C) > e;
  }
  function s(a) {
    var C, B, l, Q, E;
    return {
      lineStart: function() {
        Q = l = !1, E = 1;
      },
      point: function(d, m) {
        var y = [d, m], f, w = g(d, m), G = i ? w ? 0 : r(d, m) : w ? r(d + (d < 0 ? Ft : -Ft), m) : 0;
        if (!C && (Q = l = w) && a.lineStart(), w !== l && (f = I(C, y), (!f || PL(C, f) || PL(y, f)) && (y[2] = 1)), w !== l)
          E = 0, w ? (a.lineStart(), f = I(y, C), a.point(f[0], f[1])) : (f = I(C, y), a.point(f[0], f[1], 2), a.lineEnd()), C = f;
        else if (n && C && i ^ w) {
          var R;
          !(G & B) && (R = I(y, C, !0)) && (E = 0, i ? (a.lineStart(), a.point(R[0][0], R[0][1]), a.point(R[1][0], R[1][1]), a.lineEnd()) : (a.point(R[1][0], R[1][1]), a.lineEnd(), a.lineStart(), a.point(R[0][0], R[0][1], 3)));
        }
        w && (!C || !PL(C, y)) && a.point(y[0], y[1]), C = y, l = w, B = G;
      },
      lineEnd: function() {
        l && a.lineEnd(), C = null;
      },
      // Rejoin first and last segments if there were intersections and the first
      // and last points were visible.
      clean: function() {
        return E | (Q && l) << 1;
      }
    };
  }
  function I(a, C, B) {
    var l = cp(a), Q = cp(C), E = [1, 0, 0], d = kf(l, Q), m = nx(d, d), y = d[0], f = m - y * y;
    if (!f)
      return !B && a;
    var w = e * m / f, G = -e * y / f, R = kf(E, d), F = ox(E, w), Z = ox(d, G);
    Dz(F, Z);
    var c = R, J = nx(F, c), p = nx(c, c), N = J * J - p * (nx(F, F) - 1);
    if (!(N < 0)) {
      var v = Bs(N), K = ox(c, (-J - v) / p);
      if (Dz(K, F), K = XS(K), !B)
        return K;
      var U = a[0], j = C[0], q = a[1], O = C[1], $;
      j < U && ($ = U, U = j, j = $);
      var _ = j - U, tA = Vt(_ - Ft) < Ue, nA = tA || _ < Ue;
      if (!tA && O < q && ($ = q, q = O, O = $), nA ? tA ? q + O > 0 ^ K[1] < (Vt(K[0] - U) < Ue ? q : O) : q <= K[1] && K[1] <= O : _ > Ft ^ (U <= K[0] && K[0] <= j)) {
        var AA = ox(c, (-J + v) / p);
        return Dz(AA, F), [K, XS(AA)];
      }
    }
  }
  function r(a, C) {
    var B = i ? A : Ft - A, l = 0;
    return a < -B ? l |= 1 : a > B && (l |= 2), C < -B ? l |= 4 : C > B && (l |= 8), l;
  }
  return ESA(g, s, o, i ? [0, -A] : [-Ft, A - Ft]);
}
function Oxe(A, e, t, i, n, o) {
  var g = A[0], s = A[1], I = e[0], r = e[1], a = 0, C = 1, B = I - g, l = r - s, Q;
  if (Q = t - g, !(!B && Q > 0)) {
    if (Q /= B, B < 0) {
      if (Q < a)
        return;
      Q < C && (C = Q);
    } else if (B > 0) {
      if (Q > C)
        return;
      Q > a && (a = Q);
    }
    if (Q = n - g, !(!B && Q < 0)) {
      if (Q /= B, B < 0) {
        if (Q > C)
          return;
        Q > a && (a = Q);
      } else if (B > 0) {
        if (Q < a)
          return;
        Q < C && (C = Q);
      }
      if (Q = i - s, !(!l && Q > 0)) {
        if (Q /= l, l < 0) {
          if (Q < a)
            return;
          Q < C && (C = Q);
        } else if (l > 0) {
          if (Q > C)
            return;
          Q > a && (a = Q);
        }
        if (Q = o - s, !(!l && Q < 0)) {
          if (Q /= l, l < 0) {
            if (Q > C)
              return;
            Q > a && (a = Q);
          } else if (l > 0) {
            if (Q < a)
              return;
            Q < C && (C = Q);
          }
          return a > 0 && (A[0] = g + a * B, A[1] = s + a * l), C < 1 && (e[0] = g + C * B, e[1] = s + C * l), !0;
        }
      }
    }
  }
}
var GJ = 1e9, sx = -GJ;
function uSA(A, e, t, i) {
  function n(r, a) {
    return A <= r && r <= t && e <= a && a <= i;
  }
  function o(r, a, C, B) {
    var l = 0, Q = 0;
    if (r == null || (l = g(r, C)) !== (Q = g(a, C)) || I(r, a) < 0 ^ C > 0)
      do
        B.point(l === 0 || l === 3 ? A : t, l > 1 ? i : e);
      while ((l = (l + C + 4) % 4) !== Q);
    else
      B.point(a[0], a[1]);
  }
  function g(r, a) {
    return Vt(r[0] - A) < Ue ? a > 0 ? 0 : 3 : Vt(r[0] - t) < Ue ? a > 0 ? 2 : 1 : Vt(r[1] - e) < Ue ? a > 0 ? 1 : 0 : a > 0 ? 3 : 2;
  }
  function s(r, a) {
    return I(r.x, a.x);
  }
  function I(r, a) {
    var C = g(r, 1), B = g(a, 1);
    return C !== B ? C - B : C === 0 ? a[1] - r[1] : C === 1 ? r[0] - a[0] : C === 2 ? r[1] - a[1] : a[0] - r[0];
  }
  return function(r) {
    var a = r, C = cSA(), B, l, Q, E, d, m, y, f, w, G, R, F = {
      point: Z,
      lineStart: N,
      lineEnd: v,
      polygonStart: J,
      polygonEnd: p
    };
    function Z(U, j) {
      n(U, j) && a.point(U, j);
    }
    function c() {
      for (var U = 0, j = 0, q = l.length; j < q; ++j)
        for (var O = l[j], $ = 1, _ = O.length, tA = O[0], nA, AA, gA = tA[0], rA = tA[1]; $ < _; ++$)
          nA = gA, AA = rA, tA = O[$], gA = tA[0], rA = tA[1], AA <= i ? rA > i && (gA - nA) * (i - AA) > (rA - AA) * (A - nA) && ++U : rA <= i && (gA - nA) * (i - AA) < (rA - AA) * (A - nA) && --U;
      return U;
    }
    function J() {
      a = C, B = [], l = [], R = !0;
    }
    function p() {
      var U = c(), j = R && U, q = (B = F1A(B)).length;
      (j || q) && (r.polygonStart(), j && (r.lineStart(), o(null, null, 1, r), r.lineEnd()), q && QSA(B, s, U, o, r), r.polygonEnd()), a = r, B = l = Q = null;
    }
    function N() {
      F.point = K, l && l.push(Q = []), G = !0, w = !1, y = f = NaN;
    }
    function v() {
      B && (K(E, d), m && w && C.rejoin(), B.push(C.result())), F.point = Z, w && a.lineEnd();
    }
    function K(U, j) {
      var q = n(U, j);
      if (l && Q.push([U, j]), G)
        E = U, d = j, m = q, G = !1, q && (a.lineStart(), a.point(U, j));
      else if (q && w)
        a.point(U, j);
      else {
        var O = [y = Math.max(sx, Math.min(GJ, y)), f = Math.max(sx, Math.min(GJ, f))], $ = [U = Math.max(sx, Math.min(GJ, U)), j = Math.max(sx, Math.min(GJ, j))];
        Oxe(O, $, A, e, t, i) ? (w || (a.lineStart(), a.point(O[0], O[1])), a.point($[0], $[1]), q || a.lineEnd(), R = !1) : q && (a.lineStart(), a.point(U, j), R = !1);
      }
      y = U, f = j, w = q;
    }
    return F;
  };
}
function duA(A, e, t) {
  var i = HI(A, e - Ue, t).concat(e);
  return function(n) {
    return i.map(function(o) {
      return [n, o];
    });
  };
}
function huA(A, e, t) {
  var i = HI(A, e - Ue, t).concat(e);
  return function(n) {
    return i.map(function(o) {
      return [o, n];
    });
  };
}
function jxe() {
  var A, e, t, i, n, o, g, s, I = 10, r = I, a = 90, C = 360, B, l, Q, E, d = 2.5;
  function m() {
    return { type: "MultiLineString", coordinates: y() };
  }
  function y() {
    return HI(ix(i / a) * a, t, a).map(Q).concat(HI(ix(s / C) * C, g, C).map(E)).concat(HI(ix(e / I) * I, A, I).filter(function(f) {
      return Vt(f % a) > Ue;
    }).map(B)).concat(HI(ix(o / r) * r, n, r).filter(function(f) {
      return Vt(f % C) > Ue;
    }).map(l));
  }
  return m.lines = function() {
    return y().map(function(f) {
      return { type: "LineString", coordinates: f };
    });
  }, m.outline = function() {
    return {
      type: "Polygon",
      coordinates: [
        Q(i).concat(
          E(g).slice(1),
          Q(t).reverse().slice(1),
          E(s).reverse().slice(1)
        )
      ]
    };
  }, m.extent = function(f) {
    return arguments.length ? m.extentMajor(f).extentMinor(f) : m.extentMinor();
  }, m.extentMajor = function(f) {
    return arguments.length ? (i = +f[0][0], t = +f[1][0], s = +f[0][1], g = +f[1][1], i > t && (f = i, i = t, t = f), s > g && (f = s, s = g, g = f), m.precision(d)) : [[i, s], [t, g]];
  }, m.extentMinor = function(f) {
    return arguments.length ? (e = +f[0][0], A = +f[1][0], o = +f[0][1], n = +f[1][1], e > A && (f = e, e = A, A = f), o > n && (f = o, o = n, n = f), m.precision(d)) : [[e, o], [A, n]];
  }, m.step = function(f) {
    return arguments.length ? m.stepMajor(f).stepMinor(f) : m.stepMinor();
  }, m.stepMajor = function(f) {
    return arguments.length ? (a = +f[0], C = +f[1], m) : [a, C];
  }, m.stepMinor = function(f) {
    return arguments.length ? (I = +f[0], r = +f[1], m) : [I, r];
  }, m.precision = function(f) {
    return arguments.length ? (d = +f, B = duA(o, n, 90), l = huA(e, A, d), Q = duA(s, g, 90), E = huA(i, t, d), m) : d;
  }, m.extentMajor([[-180, -90 + Ue], [180, 90 - Ue]]).extentMinor([[-180, -80 - Ue], [180, 80 + Ue]]);
}
const i2 = (A) => A;
var kz = new gs(), yj = new gs(), dSA, hSA, bj, wj, UE = {
  point: jo,
  lineStart: jo,
  lineEnd: jo,
  polygonStart: function() {
    UE.lineStart = Pxe, UE.lineEnd = ALe;
  },
  polygonEnd: function() {
    UE.lineStart = UE.lineEnd = UE.point = jo, kz.add(Vt(yj)), yj = new gs();
  },
  result: function() {
    var A = kz / 2;
    return kz = new gs(), A;
  }
};
function Pxe() {
  UE.point = $xe;
}
function $xe(A, e) {
  UE.point = mSA, dSA = bj = A, hSA = wj = e;
}
function mSA(A, e) {
  yj.add(wj * A - bj * e), bj = A, wj = e;
}
function ALe() {
  mSA(dSA, hSA);
}
const muA = UE;
var Jf = 1 / 0, AZ = Jf, n2 = -Jf, eZ = n2, eLe = {
  point: tLe,
  lineStart: jo,
  lineEnd: jo,
  polygonStart: jo,
  polygonEnd: jo,
  result: function() {
    var A = [[Jf, AZ], [n2, eZ]];
    return n2 = eZ = -(AZ = Jf = 1 / 0), A;
  }
};
function tLe(A, e) {
  A < Jf && (Jf = A), A > n2 && (n2 = A), e < AZ && (AZ = e), e > eZ && (eZ = e);
}
const tZ = eLe;
var fj = 0, Dj = 0, kJ = 0, iZ = 0, nZ = 0, Wb = 0, Gj = 0, kj = 0, JJ = 0, pSA, ySA, uB, dB, Xr = {
  point: Qp,
  lineStart: puA,
  lineEnd: yuA,
  polygonStart: function() {
    Xr.lineStart = oLe, Xr.lineEnd = gLe;
  },
  polygonEnd: function() {
    Xr.point = Qp, Xr.lineStart = puA, Xr.lineEnd = yuA;
  },
  result: function() {
    var A = JJ ? [Gj / JJ, kj / JJ] : Wb ? [iZ / Wb, nZ / Wb] : kJ ? [fj / kJ, Dj / kJ] : [NaN, NaN];
    return fj = Dj = kJ = iZ = nZ = Wb = Gj = kj = JJ = 0, A;
  }
};
function Qp(A, e) {
  fj += A, Dj += e, ++kJ;
}
function puA() {
  Xr.point = iLe;
}
function iLe(A, e) {
  Xr.point = nLe, Qp(uB = A, dB = e);
}
function nLe(A, e) {
  var t = A - uB, i = e - dB, n = Bs(t * t + i * i);
  iZ += n * (uB + A) / 2, nZ += n * (dB + e) / 2, Wb += n, Qp(uB = A, dB = e);
}
function yuA() {
  Xr.point = Qp;
}
function oLe() {
  Xr.point = sLe;
}
function gLe() {
  bSA(pSA, ySA);
}
function sLe(A, e) {
  Xr.point = bSA, Qp(pSA = uB = A, ySA = dB = e);
}
function bSA(A, e) {
  var t = A - uB, i = e - dB, n = Bs(t * t + i * i);
  iZ += n * (uB + A) / 2, nZ += n * (dB + e) / 2, Wb += n, n = dB * A - uB * e, Gj += n * (uB + A), kj += n * (dB + e), JJ += n * 3, Qp(uB = A, dB = e);
}
const buA = Xr;
function wSA(A) {
  this._context = A;
}
wSA.prototype = {
  _radius: 4.5,
  pointRadius: function(A) {
    return this._radius = A, this;
  },
  polygonStart: function() {
    this._line = 0;
  },
  polygonEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    this._line === 0 && this._context.closePath(), this._point = NaN;
  },
  point: function(A, e) {
    switch (this._point) {
      case 0: {
        this._context.moveTo(A, e), this._point = 1;
        break;
      }
      case 1: {
        this._context.lineTo(A, e);
        break;
      }
      default: {
        this._context.moveTo(A + this._radius, e), this._context.arc(A, e, this._radius, 0, Cs);
        break;
      }
    }
  },
  result: jo
};
var Jj = new gs(), Jz, fSA, DSA, NJ, YJ, oZ = {
  point: jo,
  lineStart: function() {
    oZ.point = ILe;
  },
  lineEnd: function() {
    Jz && GSA(fSA, DSA), oZ.point = jo;
  },
  polygonStart: function() {
    Jz = !0;
  },
  polygonEnd: function() {
    Jz = null;
  },
  result: function() {
    var A = +Jj;
    return Jj = new gs(), A;
  }
};
function ILe(A, e) {
  oZ.point = GSA, fSA = NJ = A, DSA = YJ = e;
}
function GSA(A, e) {
  NJ -= A, YJ -= e, Jj.add(Bs(NJ * NJ + YJ * YJ)), NJ = A, YJ = e;
}
const wuA = oZ;
let fuA, gZ, DuA, GuA;
class kuA {
  constructor(e) {
    this._append = e == null ? kSA : aLe(e), this._radius = 4.5, this._ = "";
  }
  pointRadius(e) {
    return this._radius = +e, this;
  }
  polygonStart() {
    this._line = 0;
  }
  polygonEnd() {
    this._line = NaN;
  }
  lineStart() {
    this._point = 0;
  }
  lineEnd() {
    this._line === 0 && (this._ += "Z"), this._point = NaN;
  }
  point(e, t) {
    switch (this._point) {
      case 0: {
        this._append`M${e},${t}`, this._point = 1;
        break;
      }
      case 1: {
        this._append`L${e},${t}`;
        break;
      }
      default: {
        if (this._append`M${e},${t}`, this._radius !== DuA || this._append !== gZ) {
          const i = this._radius, n = this._;
          this._ = "", this._append`m0,${i}a${i},${i} 0 1,1 0,${-2 * i}a${i},${i} 0 1,1 0,${2 * i}z`, DuA = i, gZ = this._append, GuA = this._, this._ = n;
        }
        this._ += GuA;
        break;
      }
    }
  }
  result() {
    const e = this._;
    return this._ = "", e.length ? e : null;
  }
}
function kSA(A) {
  let e = 1;
  this._ += A[0];
  for (const t = A.length; e < t; ++e)
    this._ += arguments[e] + A[e];
}
function aLe(A) {
  const e = Math.floor(A);
  if (!(e >= 0))
    throw new RangeError(`invalid digits: ${A}`);
  if (e > 15)
    return kSA;
  if (e !== fuA) {
    const t = 10 ** e;
    fuA = e, gZ = function(i) {
      let n = 1;
      this._ += i[0];
      for (const o = i.length; n < o; ++n)
        this._ += Math.round(arguments[n] * t) / t + i[n];
    };
  }
  return gZ;
}
function JSA(A, e) {
  let t = 3, i = 4.5, n, o;
  function g(s) {
    return s && (typeof i == "function" && o.pointRadius(+i.apply(this, arguments)), Dc(s, n(o))), o.result();
  }
  return g.area = function(s) {
    return Dc(s, n(muA)), muA.result();
  }, g.measure = function(s) {
    return Dc(s, n(wuA)), wuA.result();
  }, g.bounds = function(s) {
    return Dc(s, n(tZ)), tZ.result();
  }, g.centroid = function(s) {
    return Dc(s, n(buA)), buA.result();
  }, g.projection = function(s) {
    return arguments.length ? (n = s == null ? (A = null, i2) : (A = s).stream, g) : A;
  }, g.context = function(s) {
    return arguments.length ? (o = s == null ? (e = null, new kuA(t)) : new wSA(e = s), typeof i != "function" && o.pointRadius(i), g) : e;
  }, g.pointRadius = function(s) {
    return arguments.length ? (i = typeof s == "function" ? s : (o.pointRadius(+s), +s), g) : i;
  }, g.digits = function(s) {
    if (!arguments.length)
      return t;
    if (s == null)
      t = null;
    else {
      const I = Math.floor(s);
      if (!(I >= 0))
        throw new RangeError(`invalid digits: ${s}`);
      t = I;
    }
    return e === null && (o = new kuA(t)), g;
  }, g.projection(A).digits(t).context(e);
}
function SU(A) {
  return function(e) {
    var t = new Nj();
    for (var i in A)
      t[i] = A[i];
    return t.stream = e, t;
  };
}
function Nj() {
}
Nj.prototype = {
  constructor: Nj,
  point: function(A, e) {
    this.stream.point(A, e);
  },
  sphere: function() {
    this.stream.sphere();
  },
  lineStart: function() {
    this.stream.lineStart();
  },
  lineEnd: function() {
    this.stream.lineEnd();
  },
  polygonStart: function() {
    this.stream.polygonStart();
  },
  polygonEnd: function() {
    this.stream.polygonEnd();
  }
};
function JiA(A, e, t) {
  var i = A.clipExtent && A.clipExtent();
  return A.scale(150).translate([0, 0]), i != null && A.clipExtent(null), Dc(t, A.stream(tZ)), e(tZ.result()), i != null && A.clipExtent(i), A;
}
function ZU(A, e, t) {
  return JiA(A, function(i) {
    var n = e[1][0] - e[0][0], o = e[1][1] - e[0][1], g = Math.min(n / (i[1][0] - i[0][0]), o / (i[1][1] - i[0][1])), s = +e[0][0] + (n - g * (i[1][0] + i[0][0])) / 2, I = +e[0][1] + (o - g * (i[1][1] + i[0][1])) / 2;
    A.scale(150 * g).translate([s, I]);
  }, t);
}
function NiA(A, e, t) {
  return ZU(A, [[0, 0], e], t);
}
function YiA(A, e, t) {
  return JiA(A, function(i) {
    var n = +e, o = n / (i[1][0] - i[0][0]), g = (n - o * (i[1][0] + i[0][0])) / 2, s = -o * i[0][1];
    A.scale(150 * o).translate([g, s]);
  }, t);
}
function RiA(A, e, t) {
  return JiA(A, function(i) {
    var n = +e, o = n / (i[1][1] - i[0][1]), g = -o * i[0][0], s = (n - o * (i[1][1] + i[0][1])) / 2;
    A.scale(150 * o).translate([g, s]);
  }, t);
}
var JuA = 16, rLe = Xe(30 * Yt);
function NuA(A, e) {
  return +e ? BLe(A, e) : CLe(A);
}
function CLe(A) {
  return SU({
    point: function(e, t) {
      e = A(e, t), this.stream.point(e[0], e[1]);
    }
  });
}
function BLe(A, e) {
  function t(i, n, o, g, s, I, r, a, C, B, l, Q, E, d) {
    var m = r - i, y = a - n, f = m * m + y * y;
    if (f > 4 * e && E--) {
      var w = g + B, G = s + l, R = I + Q, F = Bs(w * w + G * G + R * R), Z = Os(R /= F), c = Vt(Vt(R) - 1) < Ue || Vt(o - C) < Ue ? (o + C) / 2 : sr(G, w), J = A(c, Z), p = J[0], N = J[1], v = p - i, K = N - n, U = y * v - m * K;
      (U * U / f > e || Vt((m * v + y * K) / f - 0.5) > 0.3 || g * B + s * l + I * Q < rLe) && (t(i, n, o, g, s, I, p, N, c, w /= F, G /= F, R, E, d), d.point(p, N), t(p, N, c, w, G, R, r, a, C, B, l, Q, E, d));
    }
  }
  return function(i) {
    var n, o, g, s, I, r, a, C, B, l, Q, E, d = {
      point: m,
      lineStart: y,
      lineEnd: w,
      polygonStart: function() {
        i.polygonStart(), d.lineStart = G;
      },
      polygonEnd: function() {
        i.polygonEnd(), d.lineStart = y;
      }
    };
    function m(Z, c) {
      Z = A(Z, c), i.point(Z[0], Z[1]);
    }
    function y() {
      C = NaN, d.point = f, i.lineStart();
    }
    function f(Z, c) {
      var J = cp([Z, c]), p = A(Z, c);
      t(C, B, a, l, Q, E, C = p[0], B = p[1], a = Z, l = J[0], Q = J[1], E = J[2], JuA, i), i.point(C, B);
    }
    function w() {
      d.point = m, i.lineEnd();
    }
    function G() {
      y(), d.point = R, d.lineEnd = F;
    }
    function R(Z, c) {
      f(n = Z, c), o = C, g = B, s = l, I = Q, r = E, d.point = f;
    }
    function F() {
      t(C, B, a, l, Q, E, o, g, n, s, I, r, JuA, i), d.lineEnd = w, w();
    }
    return d;
  };
}
var lLe = SU({
  point: function(A, e) {
    this.stream.point(A * Yt, e * Yt);
  }
});
function cLe(A) {
  return SU({
    point: function(e, t) {
      var i = A(e, t);
      return this.stream.point(i[0], i[1]);
    }
  });
}
function QLe(A, e, t, i, n) {
  function o(g, s) {
    return g *= i, s *= n, [e + A * g, t - A * s];
  }
  return o.invert = function(g, s) {
    return [(g - e) / A * i, (t - s) / A * n];
  }, o;
}
function YuA(A, e, t, i, n, o) {
  if (!o)
    return QLe(A, e, t, i, n);
  var g = Xe(o), s = Se(o), I = g * A, r = s * A, a = g / A, C = s / A, B = (s * t - g * e) / A, l = (s * e + g * t) / A;
  function Q(E, d) {
    return E *= i, d *= n, [I * E - r * d + e, t - r * E - I * d];
  }
  return Q.invert = function(E, d) {
    return [i * (a * E - C * d + B), n * (l - C * E - a * d)];
  }, Q;
}
function Gl(A) {
  return NSA(function() {
    return A;
  })();
}
function NSA(A) {
  var e, t = 150, i = 480, n = 250, o = 0, g = 0, s = 0, I = 0, r = 0, a, C = 0, B = 1, l = 1, Q = null, E = uuA, d = null, m, y, f, w = i2, G = 0.5, R, F, Z, c, J;
  function p(U) {
    return Z(U[0] * Yt, U[1] * Yt);
  }
  function N(U) {
    return U = Z.invert(U[0], U[1]), U && [U[0] * Un, U[1] * Un];
  }
  p.stream = function(U) {
    return c && J === U ? c : c = lLe(cLe(a)(E(R(w(J = U)))));
  }, p.preclip = function(U) {
    return arguments.length ? (E = U, Q = void 0, K()) : E;
  }, p.postclip = function(U) {
    return arguments.length ? (w = U, d = m = y = f = null, K()) : w;
  }, p.clipAngle = function(U) {
    return arguments.length ? (E = +U ? qxe(Q = U * Yt) : (Q = null, uuA), K()) : Q * Un;
  }, p.clipExtent = function(U) {
    return arguments.length ? (w = U == null ? (d = m = y = f = null, i2) : uSA(d = +U[0][0], m = +U[0][1], y = +U[1][0], f = +U[1][1]), K()) : d == null ? null : [[d, m], [y, f]];
  }, p.scale = function(U) {
    return arguments.length ? (t = +U, v()) : t;
  }, p.translate = function(U) {
    return arguments.length ? (i = +U[0], n = +U[1], v()) : [i, n];
  }, p.center = function(U) {
    return arguments.length ? (o = U[0] % 360 * Yt, g = U[1] % 360 * Yt, v()) : [o * Un, g * Un];
  }, p.rotate = function(U) {
    return arguments.length ? (s = U[0] % 360 * Yt, I = U[1] % 360 * Yt, r = U.length > 2 ? U[2] % 360 * Yt : 0, v()) : [s * Un, I * Un, r * Un];
  }, p.angle = function(U) {
    return arguments.length ? (C = U % 360 * Yt, v()) : C * Un;
  }, p.reflectX = function(U) {
    return arguments.length ? (B = U ? -1 : 1, v()) : B < 0;
  }, p.reflectY = function(U) {
    return arguments.length ? (l = U ? -1 : 1, v()) : l < 0;
  }, p.precision = function(U) {
    return arguments.length ? (R = NuA(F, G = U * U), K()) : Bs(G);
  }, p.fitExtent = function(U, j) {
    return ZU(p, U, j);
  }, p.fitSize = function(U, j) {
    return NiA(p, U, j);
  }, p.fitWidth = function(U, j) {
    return YiA(p, U, j);
  }, p.fitHeight = function(U, j) {
    return RiA(p, U, j);
  };
  function v() {
    var U = YuA(t, 0, 0, B, l, C).apply(null, e(o, g)), j = YuA(t, i - U[0], n - U[1], B, l, C);
    return a = lSA(s, I, r), F = mj(e, j), Z = mj(a, F), R = NuA(F, G), K();
  }
  function K() {
    return c = J = null, p;
  }
  return function() {
    return e = A.apply(this, arguments), p.invert = e.invert && N, v();
  };
}
function FiA(A) {
  var e = 0, t = Ft / 3, i = NSA(A), n = i(e, t);
  return n.parallels = function(o) {
    return arguments.length ? i(e = o[0] * Yt, t = o[1] * Yt) : [e * Un, t * Un];
  }, n;
}
function ELe(A) {
  var e = Xe(A);
  function t(i, n) {
    return [i * e, Se(n) / e];
  }
  return t.invert = function(i, n) {
    return [i / e, Os(n * e)];
  }, t;
}
function uLe(A, e) {
  var t = Se(A), i = (t + Se(e)) / 2;
  if (Vt(i) < Ue)
    return ELe(A);
  var n = 1 + t * (2 * i - t), o = Bs(n) / i;
  function g(s, I) {
    var r = Bs(n - 2 * i * Se(I)) / i;
    return [r * Se(s *= i), o - r * Xe(s)];
  }
  return g.invert = function(s, I) {
    var r = o - I, a = sr(s, Vt(r)) * Wa(r);
    return r * i < 0 && (a -= Ft * Wa(s) * Wa(r)), [a / i, Os((n - (s * s + r * r) * i * i) / (2 * i))];
  }, g;
}
function sZ() {
  return FiA(uLe).scale(155.424).center([0, 33.6442]);
}
function YSA() {
  return sZ().parallels([29.5, 45.5]).scale(1070).translate([480, 250]).rotate([96, 0]).center([-0.6, 38.7]);
}
function dLe(A) {
  var e = A.length;
  return {
    point: function(t, i) {
      for (var n = -1; ++n < e; )
        A[n].point(t, i);
    },
    sphere: function() {
      for (var t = -1; ++t < e; )
        A[t].sphere();
    },
    lineStart: function() {
      for (var t = -1; ++t < e; )
        A[t].lineStart();
    },
    lineEnd: function() {
      for (var t = -1; ++t < e; )
        A[t].lineEnd();
    },
    polygonStart: function() {
      for (var t = -1; ++t < e; )
        A[t].polygonStart();
    },
    polygonEnd: function() {
      for (var t = -1; ++t < e; )
        A[t].polygonEnd();
    }
  };
}
function hLe() {
  var A, e, t = YSA(), i, n = sZ().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), o, g = sZ().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), s, I, r = { point: function(B, l) {
    I = [B, l];
  } };
  function a(B) {
    var l = B[0], Q = B[1];
    return I = null, i.point(l, Q), I || (o.point(l, Q), I) || (s.point(l, Q), I);
  }
  a.invert = function(B) {
    var l = t.scale(), Q = t.translate(), E = (B[0] - Q[0]) / l, d = (B[1] - Q[1]) / l;
    return (d >= 0.12 && d < 0.234 && E >= -0.425 && E < -0.214 ? n : d >= 0.166 && d < 0.234 && E >= -0.214 && E < -0.115 ? g : t).invert(B);
  }, a.stream = function(B) {
    return A && e === B ? A : A = dLe([t.stream(e = B), n.stream(B), g.stream(B)]);
  }, a.precision = function(B) {
    return arguments.length ? (t.precision(B), n.precision(B), g.precision(B), C()) : t.precision();
  }, a.scale = function(B) {
    return arguments.length ? (t.scale(B), n.scale(B * 0.35), g.scale(B), a.translate(t.translate())) : t.scale();
  }, a.translate = function(B) {
    if (!arguments.length)
      return t.translate();
    var l = t.scale(), Q = +B[0], E = +B[1];
    return i = t.translate(B).clipExtent([[Q - 0.455 * l, E - 0.238 * l], [Q + 0.455 * l, E + 0.238 * l]]).stream(r), o = n.translate([Q - 0.307 * l, E + 0.201 * l]).clipExtent([[Q - 0.425 * l + Ue, E + 0.12 * l + Ue], [Q - 0.214 * l - Ue, E + 0.234 * l - Ue]]).stream(r), s = g.translate([Q - 0.205 * l, E + 0.212 * l]).clipExtent([[Q - 0.214 * l + Ue, E + 0.166 * l + Ue], [Q - 0.115 * l - Ue, E + 0.234 * l - Ue]]).stream(r), C();
  }, a.fitExtent = function(B, l) {
    return ZU(a, B, l);
  }, a.fitSize = function(B, l) {
    return NiA(a, B, l);
  }, a.fitWidth = function(B, l) {
    return YiA(a, B, l);
  }, a.fitHeight = function(B, l) {
    return RiA(a, B, l);
  };
  function C() {
    return A = e = null, a;
  }
  return a.scale(1070);
}
function RSA(A) {
  return function(e, t) {
    var i = Xe(e), n = Xe(t), o = A(i * n);
    return o === 1 / 0 ? [2, 0] : [
      o * n * Se(e),
      o * Se(t)
    ];
  };
}
function DF(A) {
  return function(e, t) {
    var i = Bs(e * e + t * t), n = A(i), o = Se(n), g = Xe(n);
    return [
      sr(e * o, i * g),
      Os(i && t * o / i)
    ];
  };
}
var FSA = RSA(function(A) {
  return Bs(2 / (1 + A));
});
FSA.invert = DF(function(A) {
  return 2 * Os(A / 2);
});
function mLe() {
  return Gl(FSA).scale(124.75).clipAngle(180 - 1e-3);
}
var MSA = RSA(function(A) {
  return (A = tSA(A)) && A / Se(A);
});
MSA.invert = DF(function(A) {
  return A;
});
function pLe() {
  return Gl(MSA).scale(79.4188).clipAngle(180 - 1e-3);
}
function WU(A, e) {
  return [A, WS(GiA((Ln + e) / 2))];
}
WU.invert = function(A, e) {
  return [A, 2 * AG(eSA(e)) - Ln];
};
function yLe() {
  return xSA(WU).scale(961 / Cs);
}
function xSA(A) {
  var e = Gl(A), t = e.center, i = e.scale, n = e.translate, o = e.clipExtent, g = null, s, I, r;
  e.scale = function(C) {
    return arguments.length ? (i(C), a()) : i();
  }, e.translate = function(C) {
    return arguments.length ? (n(C), a()) : n();
  }, e.center = function(C) {
    return arguments.length ? (t(C), a()) : t();
  }, e.clipExtent = function(C) {
    return arguments.length ? (C == null ? g = s = I = r = null : (g = +C[0][0], s = +C[0][1], I = +C[1][0], r = +C[1][1]), a()) : g == null ? null : [[g, s], [I, r]];
  };
  function a() {
    var C = Ft * i(), B = e(Wxe(e.rotate()).invert([0, 0]));
    return o(g == null ? [[B[0] - C, B[1] - C], [B[0] + C, B[1] + C]] : A === WU ? [[Math.max(B[0] - C, g), s], [Math.min(B[0] + C, I), r]] : [[g, Math.max(B[1] - C, s)], [I, Math.min(B[1] + C, r)]]);
  }
  return a();
}
function Ix(A) {
  return GiA((Ln + A) / 2);
}
function bLe(A, e) {
  var t = Xe(A), i = A === e ? Se(A) : WS(t / Xe(e)) / WS(Ix(e) / Ix(A)), n = t * fz(Ix(A), i) / i;
  if (!i)
    return WU;
  function o(g, s) {
    n > 0 ? s < -Ln + Ue && (s = -Ln + Ue) : s > Ln - Ue && (s = Ln - Ue);
    var I = n / fz(Ix(s), i);
    return [I * Se(i * g), n - I * Xe(i * g)];
  }
  return o.invert = function(g, s) {
    var I = n - s, r = Wa(i) * Bs(g * g + I * I), a = sr(g, Vt(I)) * Wa(I);
    return I * i < 0 && (a -= Ft * Wa(g) * Wa(I)), [a / i, 2 * AG(fz(n / r, 1 / i)) - Ln];
  }, o;
}
function wLe() {
  return FiA(bLe).scale(109.5).parallels([30, 30]);
}
function IZ(A, e) {
  return [A, e];
}
IZ.invert = IZ;
function fLe() {
  return Gl(IZ).scale(152.63);
}
function DLe(A, e) {
  var t = Xe(A), i = A === e ? Se(A) : (t - Xe(e)) / (e - A), n = t / i + A;
  if (Vt(i) < Ue)
    return IZ;
  function o(g, s) {
    var I = n - s, r = i * g;
    return [I * Se(r), n - I * Xe(r)];
  }
  return o.invert = function(g, s) {
    var I = n - s, r = sr(g, Vt(I)) * Wa(I);
    return I * i < 0 && (r -= Ft * Wa(g) * Wa(I)), [r / i, n - Wa(i) * Bs(g * g + I * I)];
  }, o;
}
function GLe() {
  return FiA(DLe).scale(131.154).center([0, 13.9389]);
}
var wN = 1.340264, fN = -0.081106, DN = 893e-6, GN = 3796e-6, aZ = Bs(3) / 2, kLe = 12;
function LSA(A, e) {
  var t = Os(aZ * Se(e)), i = t * t, n = i * i * i;
  return [
    A * Xe(t) / (aZ * (wN + 3 * fN * i + n * (7 * DN + 9 * GN * i))),
    t * (wN + fN * i + n * (DN + GN * i))
  ];
}
LSA.invert = function(A, e) {
  for (var t = e, i = t * t, n = i * i * i, o = 0, g, s, I; o < kLe && (s = t * (wN + fN * i + n * (DN + GN * i)) - e, I = wN + 3 * fN * i + n * (7 * DN + 9 * GN * i), t -= g = s / I, i = t * t, n = i * i * i, !(Vt(g) < SS)); ++o)
    ;
  return [
    aZ * A * (wN + 3 * fN * i + n * (7 * DN + 9 * GN * i)) / Xe(t),
    Os(Se(t) / aZ)
  ];
};
function JLe() {
  return Gl(LSA).scale(177.158);
}
function vSA(A, e) {
  var t = Xe(e), i = Xe(A) * t;
  return [t * Se(A) / i, Se(e) / i];
}
vSA.invert = DF(AG);
function NLe() {
  return Gl(vSA).scale(144.049).clipAngle(60);
}
function YLe() {
  var A = 1, e = 0, t = 0, i = 1, n = 1, o = 0, g, s, I = null, r, a, C, B = 1, l = 1, Q = SU({
    point: function(w, G) {
      var R = f([w, G]);
      this.stream.point(R[0], R[1]);
    }
  }), E = i2, d, m;
  function y() {
    return B = A * i, l = A * n, d = m = null, f;
  }
  function f(w) {
    var G = w[0] * B, R = w[1] * l;
    if (o) {
      var F = R * g - G * s;
      G = G * g + R * s, R = F;
    }
    return [G + e, R + t];
  }
  return f.invert = function(w) {
    var G = w[0] - e, R = w[1] - t;
    if (o) {
      var F = R * g + G * s;
      G = G * g - R * s, R = F;
    }
    return [G / B, R / l];
  }, f.stream = function(w) {
    return d && m === w ? d : d = Q(E(m = w));
  }, f.postclip = function(w) {
    return arguments.length ? (E = w, I = r = a = C = null, y()) : E;
  }, f.clipExtent = function(w) {
    return arguments.length ? (E = w == null ? (I = r = a = C = null, i2) : uSA(I = +w[0][0], r = +w[0][1], a = +w[1][0], C = +w[1][1]), y()) : I == null ? null : [[I, r], [a, C]];
  }, f.scale = function(w) {
    return arguments.length ? (A = +w, y()) : A;
  }, f.translate = function(w) {
    return arguments.length ? (e = +w[0], t = +w[1], y()) : [e, t];
  }, f.angle = function(w) {
    return arguments.length ? (o = w % 360 * Yt, s = Se(o), g = Xe(o), y()) : o * Un;
  }, f.reflectX = function(w) {
    return arguments.length ? (i = w ? -1 : 1, y()) : i < 0;
  }, f.reflectY = function(w) {
    return arguments.length ? (n = w ? -1 : 1, y()) : n < 0;
  }, f.fitExtent = function(w, G) {
    return ZU(f, w, G);
  }, f.fitSize = function(w, G) {
    return NiA(f, w, G);
  }, f.fitWidth = function(w, G) {
    return YiA(f, w, G);
  }, f.fitHeight = function(w, G) {
    return RiA(f, w, G);
  }, f;
}
function HSA(A, e) {
  var t = e * e, i = t * t;
  return [
    A * (0.8707 - 0.131979 * t + i * (-0.013791 + i * (3971e-6 * t - 1529e-6 * i))),
    e * (1.007226 + t * (0.015085 + i * (-0.044475 + 0.028874 * t - 5916e-6 * i)))
  ];
}
HSA.invert = function(A, e) {
  var t = e, i = 25, n;
  do {
    var o = t * t, g = o * o;
    t -= n = (t * (1.007226 + o * (0.015085 + g * (-0.044475 + 0.028874 * o - 5916e-6 * g))) - e) / (1.007226 + o * (0.015085 * 3 + g * (-0.044475 * 7 + 0.028874 * 9 * o - 5916e-6 * 11 * g)));
  } while (Vt(n) > Ue && --i > 0);
  return [
    A / (0.8707 + (o = t * t) * (-0.131979 + o * (-0.013791 + o * o * o * (3971e-6 - 1529e-6 * o)))),
    t
  ];
};
function RLe() {
  return Gl(HSA).scale(175.295);
}
function SSA(A, e) {
  return [Xe(e) * Se(A), Se(e)];
}
SSA.invert = DF(Os);
function FLe() {
  return Gl(SSA).scale(249.5).clipAngle(90 + Ue);
}
function ZSA(A, e) {
  var t = Xe(e), i = 1 + Xe(A) * t;
  return [t * Se(A) / i, Se(e) / i];
}
ZSA.invert = DF(function(A) {
  return 2 * AG(A);
});
function MLe() {
  return Gl(ZSA).scale(250).clipAngle(142);
}
function WSA(A, e) {
  return [WS(GiA((Ln + e) / 2)), -A];
}
WSA.invert = function(A, e) {
  return [-e, 2 * AG(eSA(A)) - Ln];
};
function xLe() {
  var A = xSA(WSA), e = A.center, t = A.rotate;
  return A.center = function(i) {
    return arguments.length ? e([-i[1], i[0]]) : (i = e(), [i[1], -i[0]]);
  }, A.rotate = function(i) {
    return arguments.length ? t([i[0], i[1], i.length > 2 ? i[2] + 90 : 90]) : (i = t(), [i[0], i[1], i[2] - 90]);
  }, t([0, 0, 90]).scale(159.155);
}
var LLe = Math.abs, Yj = Math.cos, rZ = Math.sin, vLe = 1e-6, KSA = Math.PI, Rj = KSA / 2, RuA = HLe(2);
function FuA(A) {
  return A > 1 ? Rj : A < -1 ? -Rj : Math.asin(A);
}
function HLe(A) {
  return A > 0 ? Math.sqrt(A) : 0;
}
function SLe(A, e) {
  var t = A * rZ(e), i = 30, n;
  do
    e -= n = (e + rZ(e) - t) / (1 + Yj(e));
  while (LLe(n) > vLe && --i > 0);
  return e / 2;
}
function ZLe(A, e, t) {
  function i(n, o) {
    return [A * n * Yj(o = SLe(t, o)), e * rZ(o)];
  }
  return i.invert = function(n, o) {
    return o = FuA(o / e), [n / (A * Yj(o)), FuA((2 * o + rZ(2 * o)) / t)];
  }, i;
}
var WLe = ZLe(RuA / Rj, RuA, KSA);
function KLe() {
  return Gl(WLe).scale(169.529);
}
const ULe = JSA(), Fj = [
  // standard properties in d3-geo
  "clipAngle",
  "clipExtent",
  "scale",
  "translate",
  "center",
  "rotate",
  "parallels",
  "precision",
  "reflectX",
  "reflectY",
  // extended properties in d3-geo-projections
  "coefficient",
  "distance",
  "fraction",
  "lobes",
  "parallel",
  "radius",
  "ratio",
  "spacing",
  "tilt"
];
function VLe(A, e) {
  return function t() {
    const i = e();
    return i.type = A, i.path = JSA().projection(i), i.copy = i.copy || function() {
      const n = t();
      return Fj.forEach((o) => {
        i[o] && n[o](i[o]());
      }), n.path.pointRadius(i.path.pointRadius()), n;
    }, rvA(i);
  };
}
function MiA(A, e) {
  if (!A || typeof A != "string")
    throw new Error("Projection type must be a name string.");
  return A = A.toLowerCase(), arguments.length > 1 ? (CZ[A] = VLe(A, e), this) : CZ[A] || null;
}
function USA(A) {
  return A && A.path || ULe;
}
const CZ = {
  // base d3-geo projection types
  albers: YSA,
  albersusa: hLe,
  azimuthalequalarea: mLe,
  azimuthalequidistant: pLe,
  conicconformal: wLe,
  conicequalarea: sZ,
  conicequidistant: GLe,
  equalEarth: JLe,
  equirectangular: fLe,
  gnomonic: NLe,
  identity: YLe,
  mercator: yLe,
  mollweide: KLe,
  naturalEarth1: RLe,
  orthographic: FLe,
  stereographic: MLe,
  transversemercator: xLe
};
for (const A in CZ)
  MiA(A, CZ[A]);
function XLe() {
}
const nc = [[], [[[1, 1.5], [0.5, 1]]], [[[1.5, 1], [1, 1.5]]], [[[1.5, 1], [0.5, 1]]], [[[1, 0.5], [1.5, 1]]], [[[1, 1.5], [0.5, 1]], [[1, 0.5], [1.5, 1]]], [[[1, 0.5], [1, 1.5]]], [[[1, 0.5], [0.5, 1]]], [[[0.5, 1], [1, 0.5]]], [[[1, 1.5], [1, 0.5]]], [[[0.5, 1], [1, 0.5]], [[1.5, 1], [1, 1.5]]], [[[1.5, 1], [1, 0.5]]], [[[0.5, 1], [1.5, 1]]], [[[1, 1.5], [1.5, 1]]], [[[0.5, 1], [1, 1.5]]], []];
function VSA() {
  var A = 1, e = 1, t = s;
  function i(I, r) {
    return r.map((a) => n(I, a));
  }
  function n(I, r) {
    var a = [], C = [];
    return o(I, r, (B) => {
      t(B, I, r), zLe(B) > 0 ? a.push([B]) : C.push(B);
    }), C.forEach((B) => {
      for (var l = 0, Q = a.length, E; l < Q; ++l)
        if (TLe((E = a[l])[0], B) !== -1) {
          E.push(B);
          return;
        }
    }), {
      type: "MultiPolygon",
      value: r,
      coordinates: a
    };
  }
  function o(I, r, a) {
    var C = new Array(), B = new Array(), l, Q, E, d, m, y;
    for (l = Q = -1, d = I[0] >= r, nc[d << 1].forEach(f); ++l < A - 1; )
      E = d, d = I[l + 1] >= r, nc[E | d << 1].forEach(f);
    for (nc[d << 0].forEach(f); ++Q < e - 1; ) {
      for (l = -1, d = I[Q * A + A] >= r, m = I[Q * A] >= r, nc[d << 1 | m << 2].forEach(f); ++l < A - 1; )
        E = d, d = I[Q * A + A + l + 1] >= r, y = m, m = I[Q * A + l + 1] >= r, nc[E | d << 1 | m << 2 | y << 3].forEach(f);
      nc[d | m << 3].forEach(f);
    }
    for (l = -1, m = I[Q * A] >= r, nc[m << 2].forEach(f); ++l < A - 1; )
      y = m, m = I[Q * A + l + 1] >= r, nc[m << 2 | y << 3].forEach(f);
    nc[m << 3].forEach(f);
    function f(w) {
      var G = [w[0][0] + l, w[0][1] + Q], R = [w[1][0] + l, w[1][1] + Q], F = g(G), Z = g(R), c, J;
      (c = B[F]) ? (J = C[Z]) ? (delete B[c.end], delete C[J.start], c === J ? (c.ring.push(R), a(c.ring)) : C[c.start] = B[J.end] = {
        start: c.start,
        end: J.end,
        ring: c.ring.concat(J.ring)
      }) : (delete B[c.end], c.ring.push(R), B[c.end = Z] = c) : (c = C[Z]) ? (J = B[F]) ? (delete C[c.start], delete B[J.end], c === J ? (c.ring.push(R), a(c.ring)) : C[J.start] = B[c.end] = {
        start: J.start,
        end: c.end,
        ring: J.ring.concat(c.ring)
      }) : (delete C[c.start], c.ring.unshift(G), C[c.start = F] = c) : C[F] = B[Z] = {
        start: F,
        end: Z,
        ring: [G, R]
      };
    }
  }
  function g(I) {
    return I[0] * 2 + I[1] * (A + 1) * 4;
  }
  function s(I, r, a) {
    I.forEach((C) => {
      var B = C[0], l = C[1], Q = B | 0, E = l | 0, d, m = r[E * A + Q];
      B > 0 && B < A && Q === B && (d = r[E * A + Q - 1], C[0] = B + (a - d) / (m - d) - 0.5), l > 0 && l < e && E === l && (d = r[(E - 1) * A + Q], C[1] = l + (a - d) / (m - d) - 0.5);
    });
  }
  return i.contour = n, i.size = function(I) {
    if (!arguments.length)
      return [A, e];
    var r = Math.floor(I[0]), a = Math.floor(I[1]);
    return r >= 0 && a >= 0 || vA("invalid size"), A = r, e = a, i;
  }, i.smooth = function(I) {
    return arguments.length ? (t = I ? s : XLe, i) : t === s;
  }, i;
}
function zLe(A) {
  for (var e = 0, t = A.length, i = A[t - 1][1] * A[0][0] - A[t - 1][0] * A[0][1]; ++e < t; )
    i += A[e - 1][1] * A[e][0] - A[e - 1][0] * A[e][1];
  return i;
}
function TLe(A, e) {
  for (var t = -1, i = e.length, n; ++t < i; )
    if (n = _Le(A, e[t]))
      return n;
  return 0;
}
function _Le(A, e) {
  for (var t = e[0], i = e[1], n = -1, o = 0, g = A.length, s = g - 1; o < g; s = o++) {
    var I = A[o], r = I[0], a = I[1], C = A[s], B = C[0], l = C[1];
    if (qLe(I, C, e))
      return 0;
    a > i != l > i && t < (B - r) * (i - a) / (l - a) + r && (n = -n);
  }
  return n;
}
function qLe(A, e, t) {
  var i;
  return OLe(A, e, t) && jLe(A[i = +(A[0] === e[0])], t[i], e[i]);
}
function OLe(A, e, t) {
  return (e[0] - A[0]) * (t[1] - A[1]) === (t[0] - A[0]) * (e[1] - A[1]);
}
function jLe(A, e, t) {
  return A <= e && e <= t || t <= e && e <= A;
}
function XSA(A, e, t) {
  return function(i) {
    var n = sl(i), o = t ? Math.min(n[0], 0) : n[0], g = n[1], s = g - o, I = e ? _u(o, g, A) : s / (A + 1);
    return HI(o + I, g, I);
  };
}
function xiA(A) {
  FA.call(this, null, A);
}
xiA.Definition = {
  type: "Isocontour",
  metadata: {
    generates: !0
  },
  params: [{
    name: "field",
    type: "field"
  }, {
    name: "thresholds",
    type: "number",
    array: !0
  }, {
    name: "levels",
    type: "number"
  }, {
    name: "nice",
    type: "boolean",
    default: !1
  }, {
    name: "resolve",
    type: "enum",
    values: ["shared", "independent"],
    default: "independent"
  }, {
    name: "zero",
    type: "boolean",
    default: !0
  }, {
    name: "smooth",
    type: "boolean",
    default: !0
  }, {
    name: "scale",
    type: "number",
    expr: !0
  }, {
    name: "translate",
    type: "number",
    array: !0,
    expr: !0
  }, {
    name: "as",
    type: "string",
    null: !0,
    default: "contour"
  }]
};
Ae(xiA, FA, {
  transform(A, e) {
    if (this.value && !e.changed() && !A.modified())
      return e.StopPropagation;
    var t = e.fork(e.NO_SOURCE | e.NO_FIELDS), i = e.materialize(e.SOURCE).source, n = A.field || Ng, o = VSA().smooth(A.smooth !== !1), g = A.thresholds || PLe(i, n, A), s = A.as === null ? null : A.as || "contour", I = [];
    return i.forEach((r) => {
      const a = n(r), C = o.size([a.width, a.height])(a.values, ZA(g) ? g : g(a.values));
      $Le(C, a, r, A), C.forEach((B) => {
        I.push(IU(r, Qi(s != null ? {
          [s]: B
        } : B)));
      });
    }), this.value && (t.rem = this.value), this.value = t.source = t.add = I, t;
  }
});
function PLe(A, e, t) {
  const i = XSA(t.levels || 10, t.nice, t.zero !== !1);
  return t.resolve !== "shared" ? i : i(A.map((n) => Rm(e(n).values)));
}
function $Le(A, e, t, i) {
  let n = i.scale || e.scale, o = i.translate || e.translate;
  if (yt(n) && (n = n(t, i)), yt(o) && (o = o(t, i)), (n === 1 || n == null) && !o)
    return;
  const g = (ti(n) ? n : n[0]) || 1, s = (ti(n) ? n : n[1]) || 1, I = o && o[0] || 0, r = o && o[1] || 0;
  A.forEach(zSA(e, g, s, I, r));
}
function zSA(A, e, t, i, n) {
  const o = A.x1 || 0, g = A.y1 || 0, s = e * t < 0;
  function I(C) {
    C.forEach(r);
  }
  function r(C) {
    s && C.reverse(), C.forEach(a);
  }
  function a(C) {
    C[0] = (C[0] - o) * e + i, C[1] = (C[1] - g) * t + n;
  }
  return function(C) {
    return C.coordinates.forEach(I), C;
  };
}
function MuA(A, e, t) {
  const i = A >= 0 ? A : LeA(e, t);
  return Math.round((Math.sqrt(4 * i * i + 1) - 1) / 2);
}
function Nz(A) {
  return yt(A) ? A : Yg(+A);
}
function TSA() {
  var A = (I) => I[0], e = (I) => I[1], t = VD, i = [-1, -1], n = 960, o = 500, g = 2;
  function s(I, r) {
    const a = MuA(i[0], I, A) >> g, C = MuA(i[1], I, e) >> g, B = a ? a + 2 : 0, l = C ? C + 2 : 0, Q = 2 * B + (n >> g), E = 2 * l + (o >> g), d = new Float32Array(Q * E), m = new Float32Array(Q * E);
    let y = d;
    I.forEach((w) => {
      const G = B + (+A(w) >> g), R = l + (+e(w) >> g);
      G >= 0 && G < Q && R >= 0 && R < E && (d[G + R * Q] += +t(w));
    }), a > 0 && C > 0 ? (cy(Q, E, d, m, a), Qy(Q, E, m, d, C), cy(Q, E, d, m, a), Qy(Q, E, m, d, C), cy(Q, E, d, m, a), Qy(Q, E, m, d, C)) : a > 0 ? (cy(Q, E, d, m, a), cy(Q, E, m, d, a), cy(Q, E, d, m, a), y = m) : C > 0 && (Qy(Q, E, d, m, C), Qy(Q, E, m, d, C), Qy(Q, E, d, m, C), y = m);
    const f = r ? Math.pow(2, -2 * g) : 1 / M1A(y);
    for (let w = 0, G = Q * E; w < G; ++w)
      y[w] *= f;
    return {
      values: y,
      scale: 1 << g,
      width: Q,
      height: E,
      x1: B,
      y1: l,
      x2: B + (n >> g),
      y2: l + (o >> g)
    };
  }
  return s.x = function(I) {
    return arguments.length ? (A = Nz(I), s) : A;
  }, s.y = function(I) {
    return arguments.length ? (e = Nz(I), s) : e;
  }, s.weight = function(I) {
    return arguments.length ? (t = Nz(I), s) : t;
  }, s.size = function(I) {
    if (!arguments.length)
      return [n, o];
    var r = +I[0], a = +I[1];
    return r >= 0 && a >= 0 || vA("invalid size"), n = r, o = a, s;
  }, s.cellSize = function(I) {
    return arguments.length ? ((I = +I) >= 1 || vA("invalid cell size"), g = Math.floor(Math.log(I) / Math.LN2), s) : 1 << g;
  }, s.bandwidth = function(I) {
    return arguments.length ? (I = Ce(I), I.length === 1 && (I = [+I[0], +I[0]]), I.length !== 2 && vA("invalid bandwidth"), i = I, s) : i;
  }, s;
}
function cy(A, e, t, i, n) {
  const o = (n << 1) + 1;
  for (let g = 0; g < e; ++g)
    for (let s = 0, I = 0; s < A + n; ++s)
      s < A && (I += t[s + g * A]), s >= n && (s >= o && (I -= t[s - o + g * A]), i[s - n + g * A] = I / Math.min(s + 1, A - 1 + o - s, o));
}
function Qy(A, e, t, i, n) {
  const o = (n << 1) + 1;
  for (let g = 0; g < A; ++g)
    for (let s = 0, I = 0; s < e + n; ++s)
      s < e && (I += t[g + s * A]), s >= n && (s >= o && (I -= t[g + (s - o) * A]), i[g + (s - n) * A] = I / Math.min(s + 1, e - 1 + o - s, o));
}
function LiA(A) {
  FA.call(this, null, A);
}
LiA.Definition = {
  type: "KDE2D",
  metadata: {
    generates: !0
  },
  params: [{
    name: "size",
    type: "number",
    array: !0,
    length: 2,
    required: !0
  }, {
    name: "x",
    type: "field",
    required: !0
  }, {
    name: "y",
    type: "field",
    required: !0
  }, {
    name: "weight",
    type: "field"
  }, {
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "cellSize",
    type: "number"
  }, {
    name: "bandwidth",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "counts",
    type: "boolean",
    default: !1
  }, {
    name: "as",
    type: "string",
    default: "grid"
  }]
};
const Ave = ["x", "y", "weight", "size", "cellSize", "bandwidth"];
function _SA(A, e) {
  return Ave.forEach((t) => e[t] != null ? A[t](e[t]) : 0), A;
}
Ae(LiA, FA, {
  transform(A, e) {
    if (this.value && !e.changed() && !A.modified())
      return e.StopPropagation;
    var t = e.fork(e.NO_SOURCE | e.NO_FIELDS), i = e.materialize(e.SOURCE).source, n = eve(i, A.groupby), o = (A.groupby || []).map(Sn), g = _SA(TSA(), A), s = A.as || "grid", I = [];
    function r(a, C) {
      for (let B = 0; B < o.length; ++B)
        a[o[B]] = C[B];
      return a;
    }
    return I = n.map((a) => Qi(r({
      [s]: g(a, A.counts)
    }, a.dims))), this.value && (t.rem = this.value), this.value = t.source = t.add = I, t;
  }
});
function eve(A, e) {
  var t = [], i = (a) => a(s), n, o, g, s, I, r;
  if (e == null)
    t.push(A);
  else
    for (n = {}, o = 0, g = A.length; o < g; ++o)
      s = A[o], I = e.map(i), r = n[I], r || (n[I] = r = [], r.dims = I, t.push(r)), r.push(s);
  return t;
}
function viA(A) {
  FA.call(this, null, A);
}
viA.Definition = {
  type: "Contour",
  metadata: {
    generates: !0
  },
  params: [{
    name: "size",
    type: "number",
    array: !0,
    length: 2,
    required: !0
  }, {
    name: "values",
    type: "number",
    array: !0
  }, {
    name: "x",
    type: "field"
  }, {
    name: "y",
    type: "field"
  }, {
    name: "weight",
    type: "field"
  }, {
    name: "cellSize",
    type: "number"
  }, {
    name: "bandwidth",
    type: "number"
  }, {
    name: "count",
    type: "number"
  }, {
    name: "nice",
    type: "boolean",
    default: !1
  }, {
    name: "thresholds",
    type: "number",
    array: !0
  }, {
    name: "smooth",
    type: "boolean",
    default: !0
  }]
};
Ae(viA, FA, {
  transform(A, e) {
    if (this.value && !e.changed() && !A.modified())
      return e.StopPropagation;
    var t = e.fork(e.NO_SOURCE | e.NO_FIELDS), i = VSA().smooth(A.smooth !== !1), n = A.values, o = A.thresholds || XSA(A.count || 10, A.nice, !!n), g = A.size, s, I;
    return n || (n = e.materialize(e.SOURCE).source, s = _SA(TSA(), A)(n, !0), I = zSA(s, s.scale || 1, s.scale || 1, 0, 0), g = [s.width, s.height], n = s.values), o = ZA(o) ? o : o(n), n = i.size(g)(n, o), I && n.forEach(I), this.value && (t.rem = this.value), this.value = t.source = t.add = (n || []).map(Qi), t;
  }
});
const Mj = "Feature", HiA = "FeatureCollection", tve = "MultiPoint";
function SiA(A) {
  FA.call(this, null, A);
}
SiA.Definition = {
  type: "GeoJSON",
  metadata: {},
  params: [{
    name: "fields",
    type: "field",
    array: !0,
    length: 2
  }, {
    name: "geojson",
    type: "field"
  }]
};
Ae(SiA, FA, {
  transform(A, e) {
    var t = this._features, i = this._points, n = A.fields, o = n && n[0], g = n && n[1], s = A.geojson || !n && Ng, I = e.ADD, r;
    r = A.modified() || e.changed(e.REM) || e.modified(fg(s)) || o && e.modified(fg(o)) || g && e.modified(fg(g)), (!this.value || r) && (I = e.SOURCE, this._features = t = [], this._points = i = []), s && e.visit(I, (a) => t.push(s(a))), o && g && (e.visit(I, (a) => {
      var C = o(a), B = g(a);
      C != null && B != null && (C = +C) === C && (B = +B) === B && i.push([C, B]);
    }), t = t.concat({
      type: Mj,
      geometry: {
        type: tve,
        coordinates: i
      }
    })), this.value = {
      type: HiA,
      features: t
    };
  }
});
function ZiA(A) {
  FA.call(this, null, A);
}
ZiA.Definition = {
  type: "GeoPath",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "projection",
    type: "projection"
  }, {
    name: "field",
    type: "field"
  }, {
    name: "pointRadius",
    type: "number",
    expr: !0
  }, {
    name: "as",
    type: "string",
    default: "path"
  }]
};
Ae(ZiA, FA, {
  transform(A, e) {
    var t = e.fork(e.ALL), i = this.value, n = A.field || Ng, o = A.as || "path", g = t.SOURCE;
    !i || A.modified() ? (this.value = i = USA(A.projection), t.materialize().reflow()) : g = n === Ng || e.modified(n.fields) ? t.ADD_MOD : t.ADD;
    const s = ive(i, A.pointRadius);
    return t.visit(g, (I) => I[o] = i(n(I))), i.pointRadius(s), t.modifies(o);
  }
});
function ive(A, e) {
  const t = A.pointRadius();
  return A.context(null), e != null && A.pointRadius(e), t;
}
function WiA(A) {
  FA.call(this, null, A);
}
WiA.Definition = {
  type: "GeoPoint",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "projection",
    type: "projection",
    required: !0
  }, {
    name: "fields",
    type: "field",
    array: !0,
    required: !0,
    length: 2
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: 2,
    default: ["x", "y"]
  }]
};
Ae(WiA, FA, {
  transform(A, e) {
    var t = A.projection, i = A.fields[0], n = A.fields[1], o = A.as || ["x", "y"], g = o[0], s = o[1], I;
    function r(a) {
      const C = t([i(a), n(a)]);
      C ? (a[g] = C[0], a[s] = C[1]) : (a[g] = void 0, a[s] = void 0);
    }
    return A.modified() ? e = e.materialize().reflow(!0).visit(e.SOURCE, r) : (I = e.modified(i.fields) || e.modified(n.fields), e.visit(I ? e.ADD_MOD : e.ADD, r)), e.modifies(o);
  }
});
function KiA(A) {
  FA.call(this, null, A);
}
KiA.Definition = {
  type: "GeoShape",
  metadata: {
    modifies: !0,
    nomod: !0
  },
  params: [{
    name: "projection",
    type: "projection"
  }, {
    name: "field",
    type: "field",
    default: "datum"
  }, {
    name: "pointRadius",
    type: "number",
    expr: !0
  }, {
    name: "as",
    type: "string",
    default: "shape"
  }]
};
Ae(KiA, FA, {
  transform(A, e) {
    var t = e.fork(e.ALL), i = this.value, n = A.as || "shape", o = t.ADD;
    return (!i || A.modified()) && (this.value = i = nve(USA(A.projection), A.field || tr("datum"), A.pointRadius), t.materialize().reflow(), o = t.SOURCE), t.visit(o, (g) => g[n] = i), t.modifies(n);
  }
});
function nve(A, e, t) {
  const i = t == null ? (n) => A(e(n)) : (n) => {
    var o = A.pointRadius(), g = A.pointRadius(t)(e(n));
    return A.pointRadius(o), g;
  };
  return i.context = (n) => (A.context(n), i), i;
}
function UiA(A) {
  FA.call(this, [], A), this.generator = jxe();
}
UiA.Definition = {
  type: "Graticule",
  metadata: {
    changes: !0,
    generates: !0
  },
  params: [{
    name: "extent",
    type: "array",
    array: !0,
    length: 2,
    content: {
      type: "number",
      array: !0,
      length: 2
    }
  }, {
    name: "extentMajor",
    type: "array",
    array: !0,
    length: 2,
    content: {
      type: "number",
      array: !0,
      length: 2
    }
  }, {
    name: "extentMinor",
    type: "array",
    array: !0,
    length: 2,
    content: {
      type: "number",
      array: !0,
      length: 2
    }
  }, {
    name: "step",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "stepMajor",
    type: "number",
    array: !0,
    length: 2,
    default: [90, 360]
  }, {
    name: "stepMinor",
    type: "number",
    array: !0,
    length: 2,
    default: [10, 10]
  }, {
    name: "precision",
    type: "number",
    default: 2.5
  }]
};
Ae(UiA, FA, {
  transform(A, e) {
    var t = this.value, i = this.generator, n;
    if (!t.length || A.modified())
      for (const o in A)
        yt(i[o]) && i[o](A[o]);
    return n = i(), t.length ? e.mod.push(OxA(t[0], n)) : e.add.push(Qi(n)), t[0] = n, e;
  }
});
function ViA(A) {
  FA.call(this, null, A);
}
ViA.Definition = {
  type: "heatmap",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field"
  }, {
    name: "color",
    type: "string",
    expr: !0
  }, {
    name: "opacity",
    type: "number",
    expr: !0
  }, {
    name: "resolve",
    type: "enum",
    values: ["shared", "independent"],
    default: "independent"
  }, {
    name: "as",
    type: "string",
    default: "image"
  }]
};
Ae(ViA, FA, {
  transform(A, e) {
    if (!e.changed() && !A.modified())
      return e.StopPropagation;
    var t = e.materialize(e.SOURCE).source, i = A.resolve === "shared", n = A.field || Ng, o = gve(A.opacity, A), g = ove(A.color, A), s = A.as || "image", I = {
      $x: 0,
      $y: 0,
      $value: 0,
      $max: i ? Rm(t.map((r) => Rm(n(r).values))) : 0
    };
    return t.forEach((r) => {
      const a = n(r), C = pt({}, r, I);
      i || (C.$max = Rm(a.values || [])), r[s] = sve(a, C, g.dep ? g : Yg(g(C)), o.dep ? o : Yg(o(C)));
    }), e.reflow(!0).modifies(s);
  }
});
function ove(A, e) {
  let t;
  return yt(A) ? (t = (i) => qu(A(i, e)), t.dep = qSA(A)) : t = Yg(qu(A || "#888")), t;
}
function gve(A, e) {
  let t;
  return yt(A) ? (t = (i) => A(i, e), t.dep = qSA(A)) : A ? t = Yg(A) : (t = (i) => i.$value / i.$max || 0, t.dep = !0), t;
}
function qSA(A) {
  if (!yt(A))
    return !1;
  const e = mC(fg(A));
  return e.$x || e.$y || e.$value || e.$max;
}
function sve(A, e, t, i) {
  const n = A.width, o = A.height, g = A.x1 || 0, s = A.y1 || 0, I = A.x2 || n, r = A.y2 || o, a = A.values, C = a ? (d) => a[d] : KE, B = Ju(I - g, r - s), l = B.getContext("2d"), Q = l.getImageData(0, 0, I - g, r - s), E = Q.data;
  for (let d = s, m = 0; d < r; ++d) {
    e.$y = d - s;
    for (let y = g, f = d * n; y < I; ++y, m += 4) {
      e.$x = y - g, e.$value = C(y + f);
      const w = t(e);
      E[m + 0] = w.r, E[m + 1] = w.g, E[m + 2] = w.b, E[m + 3] = ~~(255 * i(e));
    }
  }
  return l.putImageData(Q, 0, 0), B;
}
function OSA(A) {
  FA.call(this, null, A), this.modified(!0);
}
Ae(OSA, FA, {
  transform(A, e) {
    let t = this.value;
    return !t || A.modified("type") ? (this.value = t = ave(A.type), Fj.forEach((i) => {
      A[i] != null && xuA(t, i, A[i]);
    })) : Fj.forEach((i) => {
      A.modified(i) && xuA(t, i, A[i]);
    }), A.pointRadius != null && t.path.pointRadius(A.pointRadius), A.fit && Ive(t, A), e.fork(e.NO_SOURCE | e.NO_FIELDS);
  }
});
function Ive(A, e) {
  const t = rve(e.fit);
  e.extent ? A.fitExtent(e.extent, t) : e.size && A.fitSize(e.size, t);
}
function ave(A) {
  const e = MiA((A || "mercator").toLowerCase());
  return e || vA("Unrecognized projection type: " + A), e();
}
function xuA(A, e, t) {
  yt(A[e]) && A[e](t);
}
function rve(A) {
  return A = Ce(A), A.length === 1 ? A[0] : {
    type: HiA,
    features: A.reduce((e, t) => e.concat(Cve(t)), [])
  };
}
function Cve(A) {
  return A.type === HiA ? A.features : Ce(A).filter((e) => e != null).map((e) => e.type === Mj ? e : {
    type: Mj,
    geometry: e
  });
}
const Bve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  contour: viA,
  geojson: SiA,
  geopath: ZiA,
  geopoint: WiA,
  geoshape: KiA,
  graticule: UiA,
  heatmap: ViA,
  isocontour: xiA,
  kde2d: LiA,
  projection: OSA
}, Symbol.toStringTag, { value: "Module" }));
function lve(A, e) {
  var t, i = 1;
  A == null && (A = 0), e == null && (e = 0);
  function n() {
    var o, g = t.length, s, I = 0, r = 0;
    for (o = 0; o < g; ++o)
      s = t[o], I += s.x, r += s.y;
    for (I = (I / g - A) * i, r = (r / g - e) * i, o = 0; o < g; ++o)
      s = t[o], s.x -= I, s.y -= r;
  }
  return n.initialize = function(o) {
    t = o;
  }, n.x = function(o) {
    return arguments.length ? (A = +o, n) : A;
  }, n.y = function(o) {
    return arguments.length ? (e = +o, n) : e;
  }, n.strength = function(o) {
    return arguments.length ? (i = +o, n) : i;
  }, n;
}
function cve(A) {
  const e = +this._x.call(null, A), t = +this._y.call(null, A);
  return jSA(this.cover(e, t), e, t, A);
}
function jSA(A, e, t, i) {
  if (isNaN(e) || isNaN(t))
    return A;
  var n, o = A._root, g = { data: i }, s = A._x0, I = A._y0, r = A._x1, a = A._y1, C, B, l, Q, E, d, m, y;
  if (!o)
    return A._root = g, A;
  for (; o.length; )
    if ((E = e >= (C = (s + r) / 2)) ? s = C : r = C, (d = t >= (B = (I + a) / 2)) ? I = B : a = B, n = o, !(o = o[m = d << 1 | E]))
      return n[m] = g, A;
  if (l = +A._x.call(null, o.data), Q = +A._y.call(null, o.data), e === l && t === Q)
    return g.next = o, n ? n[m] = g : A._root = g, A;
  do
    n = n ? n[m] = new Array(4) : A._root = new Array(4), (E = e >= (C = (s + r) / 2)) ? s = C : r = C, (d = t >= (B = (I + a) / 2)) ? I = B : a = B;
  while ((m = d << 1 | E) === (y = (Q >= B) << 1 | l >= C));
  return n[y] = o, n[m] = g, A;
}
function Qve(A) {
  var e, t, i = A.length, n, o, g = new Array(i), s = new Array(i), I = 1 / 0, r = 1 / 0, a = -1 / 0, C = -1 / 0;
  for (t = 0; t < i; ++t)
    isNaN(n = +this._x.call(null, e = A[t])) || isNaN(o = +this._y.call(null, e)) || (g[t] = n, s[t] = o, n < I && (I = n), n > a && (a = n), o < r && (r = o), o > C && (C = o));
  if (I > a || r > C)
    return this;
  for (this.cover(I, r).cover(a, C), t = 0; t < i; ++t)
    jSA(this, g[t], s[t], A[t]);
  return this;
}
function Eve(A, e) {
  if (isNaN(A = +A) || isNaN(e = +e))
    return this;
  var t = this._x0, i = this._y0, n = this._x1, o = this._y1;
  if (isNaN(t))
    n = (t = Math.floor(A)) + 1, o = (i = Math.floor(e)) + 1;
  else {
    for (var g = n - t || 1, s = this._root, I, r; t > A || A >= n || i > e || e >= o; )
      switch (r = (e < i) << 1 | A < t, I = new Array(4), I[r] = s, s = I, g *= 2, r) {
        case 0:
          n = t + g, o = i + g;
          break;
        case 1:
          t = n - g, o = i + g;
          break;
        case 2:
          n = t + g, i = o - g;
          break;
        case 3:
          t = n - g, i = o - g;
          break;
      }
    this._root && this._root.length && (this._root = s);
  }
  return this._x0 = t, this._y0 = i, this._x1 = n, this._y1 = o, this;
}
function uve() {
  var A = [];
  return this.visit(function(e) {
    if (!e.length)
      do
        A.push(e.data);
      while (e = e.next);
  }), A;
}
function dve(A) {
  return arguments.length ? this.cover(+A[0][0], +A[0][1]).cover(+A[1][0], +A[1][1]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0], [this._x1, this._y1]];
}
function As(A, e, t, i, n) {
  this.node = A, this.x0 = e, this.y0 = t, this.x1 = i, this.y1 = n;
}
function hve(A, e, t) {
  var i, n = this._x0, o = this._y0, g, s, I, r, a = this._x1, C = this._y1, B = [], l = this._root, Q, E;
  for (l && B.push(new As(l, n, o, a, C)), t == null ? t = 1 / 0 : (n = A - t, o = e - t, a = A + t, C = e + t, t *= t); Q = B.pop(); )
    if (!(!(l = Q.node) || (g = Q.x0) > a || (s = Q.y0) > C || (I = Q.x1) < n || (r = Q.y1) < o))
      if (l.length) {
        var d = (g + I) / 2, m = (s + r) / 2;
        B.push(
          new As(l[3], d, m, I, r),
          new As(l[2], g, m, d, r),
          new As(l[1], d, s, I, m),
          new As(l[0], g, s, d, m)
        ), (E = (e >= m) << 1 | A >= d) && (Q = B[B.length - 1], B[B.length - 1] = B[B.length - 1 - E], B[B.length - 1 - E] = Q);
      } else {
        var y = A - +this._x.call(null, l.data), f = e - +this._y.call(null, l.data), w = y * y + f * f;
        if (w < t) {
          var G = Math.sqrt(t = w);
          n = A - G, o = e - G, a = A + G, C = e + G, i = l.data;
        }
      }
  return i;
}
function mve(A) {
  if (isNaN(a = +this._x.call(null, A)) || isNaN(C = +this._y.call(null, A)))
    return this;
  var e, t = this._root, i, n, o, g = this._x0, s = this._y0, I = this._x1, r = this._y1, a, C, B, l, Q, E, d, m;
  if (!t)
    return this;
  if (t.length)
    for (; ; ) {
      if ((Q = a >= (B = (g + I) / 2)) ? g = B : I = B, (E = C >= (l = (s + r) / 2)) ? s = l : r = l, e = t, !(t = t[d = E << 1 | Q]))
        return this;
      if (!t.length)
        break;
      (e[d + 1 & 3] || e[d + 2 & 3] || e[d + 3 & 3]) && (i = e, m = d);
    }
  for (; t.data !== A; )
    if (n = t, !(t = t.next))
      return this;
  return (o = t.next) && delete t.next, n ? (o ? n.next = o : delete n.next, this) : e ? (o ? e[d] = o : delete e[d], (t = e[0] || e[1] || e[2] || e[3]) && t === (e[3] || e[2] || e[1] || e[0]) && !t.length && (i ? i[m] = t : this._root = t), this) : (this._root = o, this);
}
function pve(A) {
  for (var e = 0, t = A.length; e < t; ++e)
    this.remove(A[e]);
  return this;
}
function yve() {
  return this._root;
}
function bve() {
  var A = 0;
  return this.visit(function(e) {
    if (!e.length)
      do
        ++A;
      while (e = e.next);
  }), A;
}
function wve(A) {
  var e = [], t, i = this._root, n, o, g, s, I;
  for (i && e.push(new As(i, this._x0, this._y0, this._x1, this._y1)); t = e.pop(); )
    if (!A(i = t.node, o = t.x0, g = t.y0, s = t.x1, I = t.y1) && i.length) {
      var r = (o + s) / 2, a = (g + I) / 2;
      (n = i[3]) && e.push(new As(n, r, a, s, I)), (n = i[2]) && e.push(new As(n, o, a, r, I)), (n = i[1]) && e.push(new As(n, r, g, s, a)), (n = i[0]) && e.push(new As(n, o, g, r, a));
    }
  return this;
}
function fve(A) {
  var e = [], t = [], i;
  for (this._root && e.push(new As(this._root, this._x0, this._y0, this._x1, this._y1)); i = e.pop(); ) {
    var n = i.node;
    if (n.length) {
      var o, g = i.x0, s = i.y0, I = i.x1, r = i.y1, a = (g + I) / 2, C = (s + r) / 2;
      (o = n[0]) && e.push(new As(o, g, s, a, C)), (o = n[1]) && e.push(new As(o, a, s, I, C)), (o = n[2]) && e.push(new As(o, g, C, a, r)), (o = n[3]) && e.push(new As(o, a, C, I, r));
    }
    t.push(i);
  }
  for (; i = t.pop(); )
    A(i.node, i.x0, i.y0, i.x1, i.y1);
  return this;
}
function Dve(A) {
  return A[0];
}
function Gve(A) {
  return arguments.length ? (this._x = A, this) : this._x;
}
function kve(A) {
  return A[1];
}
function Jve(A) {
  return arguments.length ? (this._y = A, this) : this._y;
}
function XiA(A, e, t) {
  var i = new ziA(e ?? Dve, t ?? kve, NaN, NaN, NaN, NaN);
  return A == null ? i : i.addAll(A);
}
function ziA(A, e, t, i, n, o) {
  this._x = A, this._y = e, this._x0 = t, this._y0 = i, this._x1 = n, this._y1 = o, this._root = void 0;
}
function LuA(A) {
  for (var e = { data: A.data }, t = e; A = A.next; )
    t = t.next = { data: A.data };
  return e;
}
var us = XiA.prototype = ziA.prototype;
us.copy = function() {
  var A = new ziA(this._x, this._y, this._x0, this._y0, this._x1, this._y1), e = this._root, t, i;
  if (!e)
    return A;
  if (!e.length)
    return A._root = LuA(e), A;
  for (t = [{ source: e, target: A._root = new Array(4) }]; e = t.pop(); )
    for (var n = 0; n < 4; ++n)
      (i = e.source[n]) && (i.length ? t.push({ source: i, target: e.target[n] = new Array(4) }) : e.target[n] = LuA(i));
  return A;
};
us.add = cve;
us.addAll = Qve;
us.cover = Eve;
us.data = uve;
us.extent = dve;
us.find = hve;
us.remove = mve;
us.removeAll = pve;
us.root = yve;
us.size = bve;
us.visit = wve;
us.visitAfter = fve;
us.x = Gve;
us.y = Jve;
function ns(A) {
  return function() {
    return A;
  };
}
function iu(A) {
  return (A() - 0.5) * 1e-6;
}
function Nve(A) {
  return A.x + A.vx;
}
function Yve(A) {
  return A.y + A.vy;
}
function Rve(A) {
  var e, t, i, n = 1, o = 1;
  typeof A != "function" && (A = ns(A == null ? 1 : +A));
  function g() {
    for (var r, a = e.length, C, B, l, Q, E, d, m = 0; m < o; ++m)
      for (C = XiA(e, Nve, Yve).visitAfter(s), r = 0; r < a; ++r)
        B = e[r], E = t[B.index], d = E * E, l = B.x + B.vx, Q = B.y + B.vy, C.visit(y);
    function y(f, w, G, R, F) {
      var Z = f.data, c = f.r, J = E + c;
      if (Z) {
        if (Z.index > B.index) {
          var p = l - Z.x - Z.vx, N = Q - Z.y - Z.vy, v = p * p + N * N;
          v < J * J && (p === 0 && (p = iu(i), v += p * p), N === 0 && (N = iu(i), v += N * N), v = (J - (v = Math.sqrt(v))) / v * n, B.vx += (p *= v) * (J = (c *= c) / (d + c)), B.vy += (N *= v) * J, Z.vx -= p * (J = 1 - J), Z.vy -= N * J);
        }
        return;
      }
      return w > l + J || R < l - J || G > Q + J || F < Q - J;
    }
  }
  function s(r) {
    if (r.data)
      return r.r = t[r.data.index];
    for (var a = r.r = 0; a < 4; ++a)
      r[a] && r[a].r > r.r && (r.r = r[a].r);
  }
  function I() {
    if (e) {
      var r, a = e.length, C;
      for (t = new Array(a), r = 0; r < a; ++r)
        C = e[r], t[C.index] = +A(C, r, e);
    }
  }
  return g.initialize = function(r, a) {
    e = r, i = a, I();
  }, g.iterations = function(r) {
    return arguments.length ? (o = +r, g) : o;
  }, g.strength = function(r) {
    return arguments.length ? (n = +r, g) : n;
  }, g.radius = function(r) {
    return arguments.length ? (A = typeof r == "function" ? r : ns(+r), I(), g) : A;
  }, g;
}
function Fve(A) {
  return A.index;
}
function vuA(A, e) {
  var t = A.get(e);
  if (!t)
    throw new Error("node not found: " + e);
  return t;
}
function Mve(A) {
  var e = Fve, t = C, i, n = ns(30), o, g, s, I, r, a = 1;
  A == null && (A = []);
  function C(d) {
    return 1 / Math.min(s[d.source.index], s[d.target.index]);
  }
  function B(d) {
    for (var m = 0, y = A.length; m < a; ++m)
      for (var f = 0, w, G, R, F, Z, c, J; f < y; ++f)
        w = A[f], G = w.source, R = w.target, F = R.x + R.vx - G.x - G.vx || iu(r), Z = R.y + R.vy - G.y - G.vy || iu(r), c = Math.sqrt(F * F + Z * Z), c = (c - o[f]) / c * d * i[f], F *= c, Z *= c, R.vx -= F * (J = I[f]), R.vy -= Z * J, G.vx += F * (J = 1 - J), G.vy += Z * J;
  }
  function l() {
    if (g) {
      var d, m = g.length, y = A.length, f = new Map(g.map((G, R) => [e(G, R, g), G])), w;
      for (d = 0, s = new Array(m); d < y; ++d)
        w = A[d], w.index = d, typeof w.source != "object" && (w.source = vuA(f, w.source)), typeof w.target != "object" && (w.target = vuA(f, w.target)), s[w.source.index] = (s[w.source.index] || 0) + 1, s[w.target.index] = (s[w.target.index] || 0) + 1;
      for (d = 0, I = new Array(y); d < y; ++d)
        w = A[d], I[d] = s[w.source.index] / (s[w.source.index] + s[w.target.index]);
      i = new Array(y), Q(), o = new Array(y), E();
    }
  }
  function Q() {
    if (g)
      for (var d = 0, m = A.length; d < m; ++d)
        i[d] = +t(A[d], d, A);
  }
  function E() {
    if (g)
      for (var d = 0, m = A.length; d < m; ++d)
        o[d] = +n(A[d], d, A);
  }
  return B.initialize = function(d, m) {
    g = d, r = m, l();
  }, B.links = function(d) {
    return arguments.length ? (A = d, l(), B) : A;
  }, B.id = function(d) {
    return arguments.length ? (e = d, B) : e;
  }, B.iterations = function(d) {
    return arguments.length ? (a = +d, B) : a;
  }, B.strength = function(d) {
    return arguments.length ? (t = typeof d == "function" ? d : ns(+d), Q(), B) : t;
  }, B.distance = function(d) {
    return arguments.length ? (n = typeof d == "function" ? d : ns(+d), E(), B) : n;
  }, B;
}
var xve = { value: () => {
} };
function PSA() {
  for (var A = 0, e = arguments.length, t = {}, i; A < e; ++A) {
    if (!(i = arguments[A] + "") || i in t || /[\s.]/.test(i))
      throw new Error("illegal type: " + i);
    t[i] = [];
  }
  return new $L(t);
}
function $L(A) {
  this._ = A;
}
function Lve(A, e) {
  return A.trim().split(/^|\s+/).map(function(t) {
    var i = "", n = t.indexOf(".");
    if (n >= 0 && (i = t.slice(n + 1), t = t.slice(0, n)), t && !e.hasOwnProperty(t))
      throw new Error("unknown type: " + t);
    return { type: t, name: i };
  });
}
$L.prototype = PSA.prototype = {
  constructor: $L,
  on: function(A, e) {
    var t = this._, i = Lve(A + "", t), n, o = -1, g = i.length;
    if (arguments.length < 2) {
      for (; ++o < g; )
        if ((n = (A = i[o]).type) && (n = vve(t[n], A.name)))
          return n;
      return;
    }
    if (e != null && typeof e != "function")
      throw new Error("invalid callback: " + e);
    for (; ++o < g; )
      if (n = (A = i[o]).type)
        t[n] = HuA(t[n], A.name, e);
      else if (e == null)
        for (n in t)
          t[n] = HuA(t[n], A.name, null);
    return this;
  },
  copy: function() {
    var A = {}, e = this._;
    for (var t in e)
      A[t] = e[t].slice();
    return new $L(A);
  },
  call: function(A, e) {
    if ((n = arguments.length - 2) > 0)
      for (var t = new Array(n), i = 0, n, o; i < n; ++i)
        t[i] = arguments[i + 2];
    if (!this._.hasOwnProperty(A))
      throw new Error("unknown type: " + A);
    for (o = this._[A], i = 0, n = o.length; i < n; ++i)
      o[i].value.apply(e, t);
  },
  apply: function(A, e, t) {
    if (!this._.hasOwnProperty(A))
      throw new Error("unknown type: " + A);
    for (var i = this._[A], n = 0, o = i.length; n < o; ++n)
      i[n].value.apply(e, t);
  }
};
function vve(A, e) {
  for (var t = 0, i = A.length, n; t < i; ++t)
    if ((n = A[t]).name === e)
      return n.value;
}
function HuA(A, e, t) {
  for (var i = 0, n = A.length; i < n; ++i)
    if (A[i].name === e) {
      A[i] = xve, A = A.slice(0, i).concat(A.slice(i + 1));
      break;
    }
  return t != null && A.push({ name: e, value: t }), A;
}
var Nf = 0, RJ = 0, Dk = 0, $SA = 1e3, BZ, FJ, lZ = 0, Ep = 0, KU = 0, o2 = typeof performance == "object" && performance.now ? performance : Date, AZA = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(A) {
  setTimeout(A, 17);
};
function TiA() {
  return Ep || (AZA(Hve), Ep = o2.now() + KU);
}
function Hve() {
  Ep = 0;
}
function cZ() {
  this._call = this._time = this._next = null;
}
cZ.prototype = eZA.prototype = {
  constructor: cZ,
  restart: function(A, e, t) {
    if (typeof A != "function")
      throw new TypeError("callback is not a function");
    t = (t == null ? TiA() : +t) + (e == null ? 0 : +e), !this._next && FJ !== this && (FJ ? FJ._next = this : BZ = this, FJ = this), this._call = A, this._time = t, xj();
  },
  stop: function() {
    this._call && (this._call = null, this._time = 1 / 0, xj());
  }
};
function eZA(A, e, t) {
  var i = new cZ();
  return i.restart(A, e, t), i;
}
function Sve() {
  TiA(), ++Nf;
  for (var A = BZ, e; A; )
    (e = Ep - A._time) >= 0 && A._call.call(void 0, e), A = A._next;
  --Nf;
}
function SuA() {
  Ep = (lZ = o2.now()) + KU, Nf = RJ = 0;
  try {
    Sve();
  } finally {
    Nf = 0, Wve(), Ep = 0;
  }
}
function Zve() {
  var A = o2.now(), e = A - lZ;
  e > $SA && (KU -= e, lZ = A);
}
function Wve() {
  for (var A, e = BZ, t, i = 1 / 0; e; )
    e._call ? (i > e._time && (i = e._time), A = e, e = e._next) : (t = e._next, e._next = null, e = A ? A._next = t : BZ = t);
  FJ = A, xj(i);
}
function xj(A) {
  if (!Nf) {
    RJ && (RJ = clearTimeout(RJ));
    var e = A - Ep;
    e > 24 ? (A < 1 / 0 && (RJ = setTimeout(SuA, A - o2.now() - KU)), Dk && (Dk = clearInterval(Dk))) : (Dk || (lZ = o2.now(), Dk = setInterval(Zve, $SA)), Nf = 1, AZA(SuA));
  }
}
function Kve(A, e, t) {
  var i = new cZ(), n = e;
  return e == null ? (i.restart(A, e, t), i) : (i._restart = i.restart, i.restart = function(o, g, s) {
    g = +g, s = s == null ? TiA() : +s, i._restart(function I(r) {
      r += n, i._restart(I, n += g, s), o(r);
    }, g, s);
  }, i.restart(A, e, t), i);
}
const Uve = 1664525, Vve = 1013904223, ZuA = 4294967296;
function Xve() {
  let A = 1;
  return () => (A = (Uve * A + Vve) % ZuA) / ZuA;
}
function zve(A) {
  return A.x;
}
function Tve(A) {
  return A.y;
}
var _ve = 10, qve = Math.PI * (3 - Math.sqrt(5));
function Ove(A) {
  var e, t = 1, i = 1e-3, n = 1 - Math.pow(i, 1 / 300), o = 0, g = 0.6, s = /* @__PURE__ */ new Map(), I = eZA(C), r = PSA("tick", "end"), a = Xve();
  A == null && (A = []);
  function C() {
    B(), r.call("tick", e), t < i && (I.stop(), r.call("end", e));
  }
  function B(E) {
    var d, m = A.length, y;
    E === void 0 && (E = 1);
    for (var f = 0; f < E; ++f)
      for (t += (o - t) * n, s.forEach(function(w) {
        w(t);
      }), d = 0; d < m; ++d)
        y = A[d], y.fx == null ? y.x += y.vx *= g : (y.x = y.fx, y.vx = 0), y.fy == null ? y.y += y.vy *= g : (y.y = y.fy, y.vy = 0);
    return e;
  }
  function l() {
    for (var E = 0, d = A.length, m; E < d; ++E) {
      if (m = A[E], m.index = E, m.fx != null && (m.x = m.fx), m.fy != null && (m.y = m.fy), isNaN(m.x) || isNaN(m.y)) {
        var y = _ve * Math.sqrt(0.5 + E), f = E * qve;
        m.x = y * Math.cos(f), m.y = y * Math.sin(f);
      }
      (isNaN(m.vx) || isNaN(m.vy)) && (m.vx = m.vy = 0);
    }
  }
  function Q(E) {
    return E.initialize && E.initialize(A, a), E;
  }
  return l(), e = {
    tick: B,
    restart: function() {
      return I.restart(C), e;
    },
    stop: function() {
      return I.stop(), e;
    },
    nodes: function(E) {
      return arguments.length ? (A = E, l(), s.forEach(Q), e) : A;
    },
    alpha: function(E) {
      return arguments.length ? (t = +E, e) : t;
    },
    alphaMin: function(E) {
      return arguments.length ? (i = +E, e) : i;
    },
    alphaDecay: function(E) {
      return arguments.length ? (n = +E, e) : +n;
    },
    alphaTarget: function(E) {
      return arguments.length ? (o = +E, e) : o;
    },
    velocityDecay: function(E) {
      return arguments.length ? (g = 1 - E, e) : 1 - g;
    },
    randomSource: function(E) {
      return arguments.length ? (a = E, s.forEach(Q), e) : a;
    },
    force: function(E, d) {
      return arguments.length > 1 ? (d == null ? s.delete(E) : s.set(E, Q(d)), e) : s.get(E);
    },
    find: function(E, d, m) {
      var y = 0, f = A.length, w, G, R, F, Z;
      for (m == null ? m = 1 / 0 : m *= m, y = 0; y < f; ++y)
        F = A[y], w = E - F.x, G = d - F.y, R = w * w + G * G, R < m && (Z = F, m = R);
      return Z;
    },
    on: function(E, d) {
      return arguments.length > 1 ? (r.on(E, d), e) : r.on(E);
    }
  };
}
function jve() {
  var A, e, t, i, n = ns(-30), o, g = 1, s = 1 / 0, I = 0.81;
  function r(l) {
    var Q, E = A.length, d = XiA(A, zve, Tve).visitAfter(C);
    for (i = l, Q = 0; Q < E; ++Q)
      e = A[Q], d.visit(B);
  }
  function a() {
    if (A) {
      var l, Q = A.length, E;
      for (o = new Array(Q), l = 0; l < Q; ++l)
        E = A[l], o[E.index] = +n(E, l, A);
    }
  }
  function C(l) {
    var Q = 0, E, d, m = 0, y, f, w;
    if (l.length) {
      for (y = f = w = 0; w < 4; ++w)
        (E = l[w]) && (d = Math.abs(E.value)) && (Q += E.value, m += d, y += d * E.x, f += d * E.y);
      l.x = y / m, l.y = f / m;
    } else {
      E = l, E.x = E.data.x, E.y = E.data.y;
      do
        Q += o[E.data.index];
      while (E = E.next);
    }
    l.value = Q;
  }
  function B(l, Q, E, d) {
    if (!l.value)
      return !0;
    var m = l.x - e.x, y = l.y - e.y, f = d - Q, w = m * m + y * y;
    if (f * f / I < w)
      return w < s && (m === 0 && (m = iu(t), w += m * m), y === 0 && (y = iu(t), w += y * y), w < g && (w = Math.sqrt(g * w)), e.vx += m * l.value * i / w, e.vy += y * l.value * i / w), !0;
    if (!(l.length || w >= s)) {
      (l.data !== e || l.next) && (m === 0 && (m = iu(t), w += m * m), y === 0 && (y = iu(t), w += y * y), w < g && (w = Math.sqrt(g * w)));
      do
        l.data !== e && (f = o[l.data.index] * i / w, e.vx += m * f, e.vy += y * f);
      while (l = l.next);
    }
  }
  return r.initialize = function(l, Q) {
    A = l, t = Q, a();
  }, r.strength = function(l) {
    return arguments.length ? (n = typeof l == "function" ? l : ns(+l), a(), r) : n;
  }, r.distanceMin = function(l) {
    return arguments.length ? (g = l * l, r) : Math.sqrt(g);
  }, r.distanceMax = function(l) {
    return arguments.length ? (s = l * l, r) : Math.sqrt(s);
  }, r.theta = function(l) {
    return arguments.length ? (I = l * l, r) : Math.sqrt(I);
  }, r;
}
function Pve(A) {
  var e = ns(0.1), t, i, n;
  typeof A != "function" && (A = ns(A == null ? 0 : +A));
  function o(s) {
    for (var I = 0, r = t.length, a; I < r; ++I)
      a = t[I], a.vx += (n[I] - a.x) * i[I] * s;
  }
  function g() {
    if (t) {
      var s, I = t.length;
      for (i = new Array(I), n = new Array(I), s = 0; s < I; ++s)
        i[s] = isNaN(n[s] = +A(t[s], s, t)) ? 0 : +e(t[s], s, t);
    }
  }
  return o.initialize = function(s) {
    t = s, g();
  }, o.strength = function(s) {
    return arguments.length ? (e = typeof s == "function" ? s : ns(+s), g(), o) : e;
  }, o.x = function(s) {
    return arguments.length ? (A = typeof s == "function" ? s : ns(+s), g(), o) : A;
  }, o;
}
function $ve(A) {
  var e = ns(0.1), t, i, n;
  typeof A != "function" && (A = ns(A == null ? 0 : +A));
  function o(s) {
    for (var I = 0, r = t.length, a; I < r; ++I)
      a = t[I], a.vy += (n[I] - a.y) * i[I] * s;
  }
  function g() {
    if (t) {
      var s, I = t.length;
      for (i = new Array(I), n = new Array(I), s = 0; s < I; ++s)
        i[s] = isNaN(n[s] = +A(t[s], s, t)) ? 0 : +e(t[s], s, t);
    }
  }
  return o.initialize = function(s) {
    t = s, g();
  }, o.strength = function(s) {
    return arguments.length ? (e = typeof s == "function" ? s : ns(+s), g(), o) : e;
  }, o.y = function(s) {
    return arguments.length ? (A = typeof s == "function" ? s : ns(+s), g(), o) : A;
  }, o;
}
const WuA = {
  center: lve,
  collide: Rve,
  nbody: jve,
  link: Mve,
  x: Pve,
  y: $ve
}, MJ = "forces", Lj = ["alpha", "alphaMin", "alphaTarget", "velocityDecay", "forces"], AHe = ["static", "iterations"], tZA = ["x", "y", "vx", "vy"];
function _iA(A) {
  FA.call(this, null, A);
}
_iA.Definition = {
  type: "Force",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "static",
    type: "boolean",
    default: !1
  }, {
    name: "restart",
    type: "boolean",
    default: !1
  }, {
    name: "iterations",
    type: "number",
    default: 300
  }, {
    name: "alpha",
    type: "number",
    default: 1
  }, {
    name: "alphaMin",
    type: "number",
    default: 1e-3
  }, {
    name: "alphaTarget",
    type: "number",
    default: 0
  }, {
    name: "velocityDecay",
    type: "number",
    default: 0.4
  }, {
    name: "forces",
    type: "param",
    array: !0,
    params: [{
      key: {
        force: "center"
      },
      params: [{
        name: "x",
        type: "number",
        default: 0
      }, {
        name: "y",
        type: "number",
        default: 0
      }]
    }, {
      key: {
        force: "collide"
      },
      params: [{
        name: "radius",
        type: "number",
        expr: !0
      }, {
        name: "strength",
        type: "number",
        default: 0.7
      }, {
        name: "iterations",
        type: "number",
        default: 1
      }]
    }, {
      key: {
        force: "nbody"
      },
      params: [{
        name: "strength",
        type: "number",
        default: -30,
        expr: !0
      }, {
        name: "theta",
        type: "number",
        default: 0.9
      }, {
        name: "distanceMin",
        type: "number",
        default: 1
      }, {
        name: "distanceMax",
        type: "number"
      }]
    }, {
      key: {
        force: "link"
      },
      params: [{
        name: "links",
        type: "data"
      }, {
        name: "id",
        type: "field"
      }, {
        name: "distance",
        type: "number",
        default: 30,
        expr: !0
      }, {
        name: "strength",
        type: "number",
        expr: !0
      }, {
        name: "iterations",
        type: "number",
        default: 1
      }]
    }, {
      key: {
        force: "x"
      },
      params: [{
        name: "strength",
        type: "number",
        default: 0.1
      }, {
        name: "x",
        type: "field"
      }]
    }, {
      key: {
        force: "y"
      },
      params: [{
        name: "strength",
        type: "number",
        default: 0.1
      }, {
        name: "y",
        type: "field"
      }]
    }]
  }, {
    name: "as",
    type: "string",
    array: !0,
    modify: !1,
    default: tZA
  }]
};
Ae(_iA, FA, {
  transform(A, e) {
    var t = this.value, i = e.changed(e.ADD_REM), n = A.modified(Lj), o = A.iterations || 300;
    if (t ? (i && (e.modifies("index"), t.nodes(e.source)), (n || e.changed(e.MOD)) && iZA(t, A, 0, e)) : (this.value = t = tHe(e.source, A), t.on("tick", eHe(e.dataflow, this)), A.static || (i = !0, t.tick()), e.modifies("index")), n || i || A.modified(AHe) || e.changed() && A.restart) {
      if (t.alpha(Math.max(t.alpha(), A.alpha || 1)).alphaDecay(1 - Math.pow(t.alphaMin(), 1 / o)), A.static)
        for (t.stop(); --o >= 0; )
          t.tick();
      else if (t.stopped() && t.restart(), !i)
        return e.StopPropagation;
    }
    return this.finish(A, e);
  },
  finish(A, e) {
    const t = e.dataflow;
    for (let s = this._argops, I = 0, r = s.length, a; I < r; ++I)
      if (a = s[I], !(a.name !== MJ || a.op._argval.force !== "link")) {
        for (var i = a.op._argops, n = 0, o = i.length, g; n < o; ++n)
          if (i[n].name === "links" && (g = i[n].op.source)) {
            t.pulse(g, t.changeset().reflow());
            break;
          }
      }
    return e.reflow(A.modified()).modifies(tZA);
  }
});
function eHe(A, e) {
  return () => A.touch(e).run();
}
function tHe(A, e) {
  const t = Ove(A), i = t.stop, n = t.restart;
  let o = !1;
  return t.stopped = () => o, t.restart = () => (o = !1, n()), t.stop = () => (o = !0, i()), iZA(t, e, !0).on("end", () => o = !0);
}
function iZA(A, e, t, i) {
  var n = Ce(e.forces), o, g, s, I;
  for (o = 0, g = Lj.length; o < g; ++o)
    s = Lj[o], s !== MJ && e.modified(s) && A[s](e[s]);
  for (o = 0, g = n.length; o < g; ++o)
    I = MJ + o, s = t || e.modified(MJ, o) ? nHe(n[o]) : i && iHe(n[o], i) ? A.force(I) : null, s && A.force(I, s);
  for (g = A.numForces || 0; o < g; ++o)
    A.force(MJ + o, null);
  return A.numForces = n.length, A;
}
function iHe(A, e) {
  var t, i;
  for (t in A)
    if (yt(i = A[t]) && e.modified(fg(i)))
      return 1;
  return 0;
}
function nHe(A) {
  var e, t;
  Ze(WuA, A.force) || vA("Unrecognized force: " + A.force), e = WuA[A.force]();
  for (t in A)
    yt(e[t]) && oHe(e[t], A[t], A);
  return e;
}
function oHe(A, e, t) {
  A(yt(e) ? (i) => e(i, t) : e);
}
const gHe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  force: _iA
}, Symbol.toStringTag, { value: "Module" }));
function sHe(A, e) {
  return A.parent === e.parent ? 1 : 2;
}
function IHe(A) {
  return A.reduce(aHe, 0) / A.length;
}
function aHe(A, e) {
  return A + e.x;
}
function rHe(A) {
  return 1 + A.reduce(CHe, 0);
}
function CHe(A, e) {
  return Math.max(A, e.y);
}
function BHe(A) {
  for (var e; e = A.children; )
    A = e[0];
  return A;
}
function lHe(A) {
  for (var e; e = A.children; )
    A = e[e.length - 1];
  return A;
}
function cHe() {
  var A = sHe, e = 1, t = 1, i = !1;
  function n(o) {
    var g, s = 0;
    o.eachAfter(function(B) {
      var l = B.children;
      l ? (B.x = IHe(l), B.y = rHe(l)) : (B.x = g ? s += A(B, g) : 0, B.y = 0, g = B);
    });
    var I = BHe(o), r = lHe(o), a = I.x - A(I, r) / 2, C = r.x + A(r, I) / 2;
    return o.eachAfter(i ? function(B) {
      B.x = (B.x - o.x) * e, B.y = (o.y - B.y) * t;
    } : function(B) {
      B.x = (B.x - a) / (C - a) * e, B.y = (1 - (o.y ? B.y / o.y : 1)) * t;
    });
  }
  return n.separation = function(o) {
    return arguments.length ? (A = o, n) : A;
  }, n.size = function(o) {
    return arguments.length ? (i = !1, e = +o[0], t = +o[1], n) : i ? null : [e, t];
  }, n.nodeSize = function(o) {
    return arguments.length ? (i = !0, e = +o[0], t = +o[1], n) : i ? [e, t] : null;
  }, n;
}
function QHe(A) {
  var e = 0, t = A.children, i = t && t.length;
  if (!i)
    e = 1;
  else
    for (; --i >= 0; )
      e += t[i].value;
  A.value = e;
}
function EHe() {
  return this.eachAfter(QHe);
}
function uHe(A, e) {
  let t = -1;
  for (const i of this)
    A.call(e, i, ++t, this);
  return this;
}
function dHe(A, e) {
  for (var t = this, i = [t], n, o, g = -1; t = i.pop(); )
    if (A.call(e, t, ++g, this), n = t.children)
      for (o = n.length - 1; o >= 0; --o)
        i.push(n[o]);
  return this;
}
function hHe(A, e) {
  for (var t = this, i = [t], n = [], o, g, s, I = -1; t = i.pop(); )
    if (n.push(t), o = t.children)
      for (g = 0, s = o.length; g < s; ++g)
        i.push(o[g]);
  for (; t = n.pop(); )
    A.call(e, t, ++I, this);
  return this;
}
function mHe(A, e) {
  let t = -1;
  for (const i of this)
    if (A.call(e, i, ++t, this))
      return i;
}
function pHe(A) {
  return this.eachAfter(function(e) {
    for (var t = +A(e.data) || 0, i = e.children, n = i && i.length; --n >= 0; )
      t += i[n].value;
    e.value = t;
  });
}
function yHe(A) {
  return this.eachBefore(function(e) {
    e.children && e.children.sort(A);
  });
}
function bHe(A) {
  for (var e = this, t = wHe(e, A), i = [e]; e !== t; )
    e = e.parent, i.push(e);
  for (var n = i.length; A !== t; )
    i.splice(n, 0, A), A = A.parent;
  return i;
}
function wHe(A, e) {
  if (A === e)
    return A;
  var t = A.ancestors(), i = e.ancestors(), n = null;
  for (A = t.pop(), e = i.pop(); A === e; )
    n = A, A = t.pop(), e = i.pop();
  return n;
}
function fHe() {
  for (var A = this, e = [A]; A = A.parent; )
    e.push(A);
  return e;
}
function DHe() {
  return Array.from(this);
}
function GHe() {
  var A = [];
  return this.eachBefore(function(e) {
    e.children || A.push(e);
  }), A;
}
function kHe() {
  var A = this, e = [];
  return A.each(function(t) {
    t !== A && e.push({ source: t.parent, target: t });
  }), e;
}
function* JHe() {
  var A = this, e, t = [A], i, n, o;
  do
    for (e = t.reverse(), t = []; A = e.pop(); )
      if (yield A, i = A.children)
        for (n = 0, o = i.length; n < o; ++n)
          t.push(i[n]);
  while (t.length);
}
function qiA(A, e) {
  A instanceof Map ? (A = [void 0, A], e === void 0 && (e = RHe)) : e === void 0 && (e = YHe);
  for (var t = new Yf(A), i, n = [t], o, g, s, I; i = n.pop(); )
    if ((g = e(i.data)) && (I = (g = Array.from(g)).length))
      for (i.children = g, s = I - 1; s >= 0; --s)
        n.push(o = g[s] = new Yf(g[s])), o.parent = i, o.depth = i.depth + 1;
  return t.eachBefore(nZA);
}
function NHe() {
  return qiA(this).eachBefore(FHe);
}
function YHe(A) {
  return A.children;
}
function RHe(A) {
  return Array.isArray(A) ? A[1] : null;
}
function FHe(A) {
  A.data.value !== void 0 && (A.value = A.data.value), A.data = A.data.data;
}
function nZA(A) {
  var e = 0;
  do
    A.height = e;
  while ((A = A.parent) && A.height < ++e);
}
function Yf(A) {
  this.data = A, this.depth = this.height = 0, this.parent = null;
}
Yf.prototype = qiA.prototype = {
  constructor: Yf,
  count: EHe,
  each: uHe,
  eachAfter: hHe,
  eachBefore: dHe,
  find: mHe,
  sum: pHe,
  sort: yHe,
  path: bHe,
  ancestors: fHe,
  descendants: DHe,
  leaves: GHe,
  links: kHe,
  copy: NHe,
  [Symbol.iterator]: JHe
};
function Av(A) {
  return A == null ? null : oZA(A);
}
function oZA(A) {
  if (typeof A != "function")
    throw new Error();
  return A;
}
function im() {
  return 0;
}
function Xy(A) {
  return function() {
    return A;
  };
}
const MHe = 1664525, xHe = 1013904223, KuA = 4294967296;
function LHe() {
  let A = 1;
  return () => (A = (MHe * A + xHe) % KuA) / KuA;
}
function vHe(A) {
  return typeof A == "object" && "length" in A ? A : Array.from(A);
}
function HHe(A, e) {
  let t = A.length, i, n;
  for (; t; )
    n = e() * t-- | 0, i = A[t], A[t] = A[n], A[n] = i;
  return A;
}
function SHe(A, e) {
  for (var t = 0, i = (A = HHe(Array.from(A), e)).length, n = [], o, g; t < i; )
    o = A[t], g && gZA(g, o) ? ++t : (g = WHe(n = ZHe(n, o)), t = 0);
  return g;
}
function ZHe(A, e) {
  var t, i;
  if (Yz(e, A))
    return [e];
  for (t = 0; t < A.length; ++t)
    if (ax(e, A[t]) && Yz(xJ(A[t], e), A))
      return [A[t], e];
  for (t = 0; t < A.length - 1; ++t)
    for (i = t + 1; i < A.length; ++i)
      if (ax(xJ(A[t], A[i]), e) && ax(xJ(A[t], e), A[i]) && ax(xJ(A[i], e), A[t]) && Yz(sZA(A[t], A[i], e), A))
        return [A[t], A[i], e];
  throw new Error();
}
function ax(A, e) {
  var t = A.r - e.r, i = e.x - A.x, n = e.y - A.y;
  return t < 0 || t * t < i * i + n * n;
}
function gZA(A, e) {
  var t = A.r - e.r + Math.max(A.r, e.r, 1) * 1e-9, i = e.x - A.x, n = e.y - A.y;
  return t > 0 && t * t > i * i + n * n;
}
function Yz(A, e) {
  for (var t = 0; t < e.length; ++t)
    if (!gZA(A, e[t]))
      return !1;
  return !0;
}
function WHe(A) {
  switch (A.length) {
    case 1:
      return KHe(A[0]);
    case 2:
      return xJ(A[0], A[1]);
    case 3:
      return sZA(A[0], A[1], A[2]);
  }
}
function KHe(A) {
  return {
    x: A.x,
    y: A.y,
    r: A.r
  };
}
function xJ(A, e) {
  var t = A.x, i = A.y, n = A.r, o = e.x, g = e.y, s = e.r, I = o - t, r = g - i, a = s - n, C = Math.sqrt(I * I + r * r);
  return {
    x: (t + o + I / C * a) / 2,
    y: (i + g + r / C * a) / 2,
    r: (C + n + s) / 2
  };
}
function sZA(A, e, t) {
  var i = A.x, n = A.y, o = A.r, g = e.x, s = e.y, I = e.r, r = t.x, a = t.y, C = t.r, B = i - g, l = i - r, Q = n - s, E = n - a, d = I - o, m = C - o, y = i * i + n * n - o * o, f = y - g * g - s * s + I * I, w = y - r * r - a * a + C * C, G = l * Q - B * E, R = (Q * w - E * f) / (G * 2) - i, F = (E * d - Q * m) / G, Z = (l * f - B * w) / (G * 2) - n, c = (B * m - l * d) / G, J = F * F + c * c - 1, p = 2 * (o + R * F + Z * c), N = R * R + Z * Z - o * o, v = -(Math.abs(J) > 1e-6 ? (p + Math.sqrt(p * p - 4 * J * N)) / (2 * J) : N / p);
  return {
    x: i + R + F * v,
    y: n + Z + c * v,
    r: v
  };
}
function UuA(A, e, t) {
  var i = A.x - e.x, n, o, g = A.y - e.y, s, I, r = i * i + g * g;
  r ? (o = e.r + t.r, o *= o, I = A.r + t.r, I *= I, o > I ? (n = (r + I - o) / (2 * r), s = Math.sqrt(Math.max(0, I / r - n * n)), t.x = A.x - n * i - s * g, t.y = A.y - n * g + s * i) : (n = (r + o - I) / (2 * r), s = Math.sqrt(Math.max(0, o / r - n * n)), t.x = e.x + n * i - s * g, t.y = e.y + n * g + s * i)) : (t.x = e.x + t.r, t.y = e.y);
}
function VuA(A, e) {
  var t = A.r + e.r - 1e-6, i = e.x - A.x, n = e.y - A.y;
  return t > 0 && t * t > i * i + n * n;
}
function XuA(A) {
  var e = A._, t = A.next._, i = e.r + t.r, n = (e.x * t.r + t.x * e.r) / i, o = (e.y * t.r + t.y * e.r) / i;
  return n * n + o * o;
}
function rx(A) {
  this._ = A, this.next = null, this.previous = null;
}
function UHe(A, e) {
  if (!(o = (A = vHe(A)).length))
    return 0;
  var t, i, n, o, g, s, I, r, a, C, B;
  if (t = A[0], t.x = 0, t.y = 0, !(o > 1))
    return t.r;
  if (i = A[1], t.x = -i.r, i.x = t.r, i.y = 0, !(o > 2))
    return t.r + i.r;
  UuA(i, t, n = A[2]), t = new rx(t), i = new rx(i), n = new rx(n), t.next = n.previous = i, i.next = t.previous = n, n.next = i.previous = t;
  A:
    for (I = 3; I < o; ++I) {
      UuA(t._, i._, n = A[I]), n = new rx(n), r = i.next, a = t.previous, C = i._.r, B = t._.r;
      do
        if (C <= B) {
          if (VuA(r._, n._)) {
            i = r, t.next = i, i.previous = t, --I;
            continue A;
          }
          C += r._.r, r = r.next;
        } else {
          if (VuA(a._, n._)) {
            t = a, t.next = i, i.previous = t, --I;
            continue A;
          }
          B += a._.r, a = a.previous;
        }
      while (r !== a.next);
      for (n.previous = t, n.next = i, t.next = i.previous = i = n, g = XuA(t); (n = n.next) !== i; )
        (s = XuA(n)) < g && (t = n, g = s);
      i = t.next;
    }
  for (t = [i._], n = i; (n = n.next) !== i; )
    t.push(n._);
  for (n = SHe(t, e), I = 0; I < o; ++I)
    t = A[I], t.x -= n.x, t.y -= n.y;
  return n.r;
}
function VHe(A) {
  return Math.sqrt(A.value);
}
function XHe() {
  var A = null, e = 1, t = 1, i = im;
  function n(o) {
    const g = LHe();
    return o.x = e / 2, o.y = t / 2, A ? o.eachBefore(zuA(A)).eachAfter(Rz(i, 0.5, g)).eachBefore(TuA(1)) : o.eachBefore(zuA(VHe)).eachAfter(Rz(im, 1, g)).eachAfter(Rz(i, o.r / Math.min(e, t), g)).eachBefore(TuA(Math.min(e, t) / (2 * o.r))), o;
  }
  return n.radius = function(o) {
    return arguments.length ? (A = Av(o), n) : A;
  }, n.size = function(o) {
    return arguments.length ? (e = +o[0], t = +o[1], n) : [e, t];
  }, n.padding = function(o) {
    return arguments.length ? (i = typeof o == "function" ? o : Xy(+o), n) : i;
  }, n;
}
function zuA(A) {
  return function(e) {
    e.children || (e.r = Math.max(0, +A(e) || 0));
  };
}
function Rz(A, e, t) {
  return function(i) {
    if (n = i.children) {
      var n, o, g = n.length, s = A(i) * e || 0, I;
      if (s)
        for (o = 0; o < g; ++o)
          n[o].r += s;
      if (I = UHe(n, t), s)
        for (o = 0; o < g; ++o)
          n[o].r -= s;
      i.r = I + s;
    }
  };
}
function TuA(A) {
  return function(e) {
    var t = e.parent;
    e.r *= A, t && (e.x = t.x + A * e.x, e.y = t.y + A * e.y);
  };
}
function IZA(A) {
  A.x0 = Math.round(A.x0), A.y0 = Math.round(A.y0), A.x1 = Math.round(A.x1), A.y1 = Math.round(A.y1);
}
function GF(A, e, t, i, n) {
  for (var o = A.children, g, s = -1, I = o.length, r = A.value && (i - e) / A.value; ++s < I; )
    g = o[s], g.y0 = t, g.y1 = n, g.x0 = e, g.x1 = e += g.value * r;
}
function zHe() {
  var A = 1, e = 1, t = 0, i = !1;
  function n(g) {
    var s = g.height + 1;
    return g.x0 = g.y0 = t, g.x1 = A, g.y1 = e / s, g.eachBefore(o(e, s)), i && g.eachBefore(IZA), g;
  }
  function o(g, s) {
    return function(I) {
      I.children && GF(I, I.x0, g * (I.depth + 1) / s, I.x1, g * (I.depth + 2) / s);
      var r = I.x0, a = I.y0, C = I.x1 - t, B = I.y1 - t;
      C < r && (r = C = (r + C) / 2), B < a && (a = B = (a + B) / 2), I.x0 = r, I.y0 = a, I.x1 = C, I.y1 = B;
    };
  }
  return n.round = function(g) {
    return arguments.length ? (i = !!g, n) : i;
  }, n.size = function(g) {
    return arguments.length ? (A = +g[0], e = +g[1], n) : [A, e];
  }, n.padding = function(g) {
    return arguments.length ? (t = +g, n) : t;
  }, n;
}
var THe = { depth: -1 }, _uA = {}, Fz = {};
function _He(A) {
  return A.id;
}
function qHe(A) {
  return A.parentId;
}
function quA() {
  var A = _He, e = qHe, t;
  function i(n) {
    var o = Array.from(n), g = A, s = e, I, r, a, C, B, l, Q, E, d = /* @__PURE__ */ new Map();
    if (t != null) {
      const m = o.map((w, G) => OHe(t(w, G, n))), y = m.map(OuA), f = new Set(m).add("");
      for (const w of y)
        f.has(w) || (f.add(w), m.push(w), y.push(OuA(w)), o.push(Fz));
      g = (w, G) => m[G], s = (w, G) => y[G];
    }
    for (a = 0, I = o.length; a < I; ++a)
      r = o[a], l = o[a] = new Yf(r), (Q = g(r, a, n)) != null && (Q += "") && (E = l.id = Q, d.set(E, d.has(E) ? _uA : l)), (Q = s(r, a, n)) != null && (Q += "") && (l.parent = Q);
    for (a = 0; a < I; ++a)
      if (l = o[a], Q = l.parent) {
        if (B = d.get(Q), !B)
          throw new Error("missing: " + Q);
        if (B === _uA)
          throw new Error("ambiguous: " + Q);
        B.children ? B.children.push(l) : B.children = [l], l.parent = B;
      } else {
        if (C)
          throw new Error("multiple roots");
        C = l;
      }
    if (!C)
      throw new Error("no root");
    if (t != null) {
      for (; C.data === Fz && C.children.length === 1; )
        C = C.children[0], --I;
      for (let m = o.length - 1; m >= 0 && (l = o[m], l.data === Fz); --m)
        l.data = null;
    }
    if (C.parent = THe, C.eachBefore(function(m) {
      m.depth = m.parent.depth + 1, --I;
    }).eachBefore(nZA), C.parent = null, I > 0)
      throw new Error("cycle");
    return C;
  }
  return i.id = function(n) {
    return arguments.length ? (A = Av(n), i) : A;
  }, i.parentId = function(n) {
    return arguments.length ? (e = Av(n), i) : e;
  }, i.path = function(n) {
    return arguments.length ? (t = Av(n), i) : t;
  }, i;
}
function OHe(A) {
  A = `${A}`;
  let e = A.length;
  return vj(A, e - 1) && !vj(A, e - 2) && (A = A.slice(0, -1)), A[0] === "/" ? A : `/${A}`;
}
function OuA(A) {
  let e = A.length;
  if (e < 2)
    return "";
  for (; --e > 1 && !vj(A, e); )
    ;
  return A.slice(0, e);
}
function vj(A, e) {
  if (A[e] === "/") {
    let t = 0;
    for (; e > 0 && A[--e] === "\\"; )
      ++t;
    if (!(t & 1))
      return !0;
  }
  return !1;
}
function jHe(A, e) {
  return A.parent === e.parent ? 1 : 2;
}
function Mz(A) {
  var e = A.children;
  return e ? e[0] : A.t;
}
function xz(A) {
  var e = A.children;
  return e ? e[e.length - 1] : A.t;
}
function PHe(A, e, t) {
  var i = t / (e.i - A.i);
  e.c -= i, e.s += t, A.c += i, e.z += t, e.m += t;
}
function $He(A) {
  for (var e = 0, t = 0, i = A.children, n = i.length, o; --n >= 0; )
    o = i[n], o.z += e, o.m += e, e += o.s + (t += o.c);
}
function ASe(A, e, t) {
  return A.a.parent === e.parent ? A.a : t;
}
function ev(A, e) {
  this._ = A, this.parent = null, this.children = null, this.A = null, this.a = this, this.z = 0, this.m = 0, this.c = 0, this.s = 0, this.t = null, this.i = e;
}
ev.prototype = Object.create(Yf.prototype);
function eSe(A) {
  for (var e = new ev(A, 0), t, i = [e], n, o, g, s; t = i.pop(); )
    if (o = t._.children)
      for (t.children = new Array(s = o.length), g = s - 1; g >= 0; --g)
        i.push(n = t.children[g] = new ev(o[g], g)), n.parent = t;
  return (e.parent = new ev(null, 0)).children = [e], e;
}
function tSe() {
  var A = jHe, e = 1, t = 1, i = null;
  function n(r) {
    var a = eSe(r);
    if (a.eachAfter(o), a.parent.m = -a.z, a.eachBefore(g), i)
      r.eachBefore(I);
    else {
      var C = r, B = r, l = r;
      r.eachBefore(function(y) {
        y.x < C.x && (C = y), y.x > B.x && (B = y), y.depth > l.depth && (l = y);
      });
      var Q = C === B ? 1 : A(C, B) / 2, E = Q - C.x, d = e / (B.x + Q + E), m = t / (l.depth || 1);
      r.eachBefore(function(y) {
        y.x = (y.x + E) * d, y.y = y.depth * m;
      });
    }
    return r;
  }
  function o(r) {
    var a = r.children, C = r.parent.children, B = r.i ? C[r.i - 1] : null;
    if (a) {
      $He(r);
      var l = (a[0].z + a[a.length - 1].z) / 2;
      B ? (r.z = B.z + A(r._, B._), r.m = r.z - l) : r.z = l;
    } else
      B && (r.z = B.z + A(r._, B._));
    r.parent.A = s(r, B, r.parent.A || C[0]);
  }
  function g(r) {
    r._.x = r.z + r.parent.m, r.m += r.parent.m;
  }
  function s(r, a, C) {
    if (a) {
      for (var B = r, l = r, Q = a, E = B.parent.children[0], d = B.m, m = l.m, y = Q.m, f = E.m, w; Q = xz(Q), B = Mz(B), Q && B; )
        E = Mz(E), l = xz(l), l.a = r, w = Q.z + y - B.z - d + A(Q._, B._), w > 0 && (PHe(ASe(Q, r, C), r, w), d += w, m += w), y += Q.m, d += B.m, f += E.m, m += l.m;
      Q && !xz(l) && (l.t = Q, l.m += y - m), B && !Mz(E) && (E.t = B, E.m += d - f, C = r);
    }
    return C;
  }
  function I(r) {
    r.x *= e, r.y = r.depth * t;
  }
  return n.separation = function(r) {
    return arguments.length ? (A = r, n) : A;
  }, n.size = function(r) {
    return arguments.length ? (i = !1, e = +r[0], t = +r[1], n) : i ? null : [e, t];
  }, n.nodeSize = function(r) {
    return arguments.length ? (i = !0, e = +r[0], t = +r[1], n) : i ? [e, t] : null;
  }, n;
}
function UU(A, e, t, i, n) {
  for (var o = A.children, g, s = -1, I = o.length, r = A.value && (n - t) / A.value; ++s < I; )
    g = o[s], g.x0 = e, g.x1 = i, g.y0 = t, g.y1 = t += g.value * r;
}
var aZA = (1 + Math.sqrt(5)) / 2;
function rZA(A, e, t, i, n, o) {
  for (var g = [], s = e.children, I, r, a = 0, C = 0, B = s.length, l, Q, E = e.value, d, m, y, f, w, G, R; a < B; ) {
    l = n - t, Q = o - i;
    do
      d = s[C++].value;
    while (!d && C < B);
    for (m = y = d, G = Math.max(Q / l, l / Q) / (E * A), R = d * d * G, w = Math.max(y / R, R / m); C < B; ++C) {
      if (d += r = s[C].value, r < m && (m = r), r > y && (y = r), R = d * d * G, f = Math.max(y / R, R / m), f > w) {
        d -= r;
        break;
      }
      w = f;
    }
    g.push(I = { value: d, dice: l < Q, children: s.slice(a, C) }), I.dice ? GF(I, t, i, n, E ? i += Q * d / E : o) : UU(I, t, i, E ? t += l * d / E : n, o), E -= d, a = C;
  }
  return g;
}
const CZA = function A(e) {
  function t(i, n, o, g, s) {
    rZA(e, i, n, o, g, s);
  }
  return t.ratio = function(i) {
    return A((i = +i) > 1 ? i : 1);
  }, t;
}(aZA);
function iSe() {
  var A = CZA, e = !1, t = 1, i = 1, n = [0], o = im, g = im, s = im, I = im, r = im;
  function a(B) {
    return B.x0 = B.y0 = 0, B.x1 = t, B.y1 = i, B.eachBefore(C), n = [0], e && B.eachBefore(IZA), B;
  }
  function C(B) {
    var l = n[B.depth], Q = B.x0 + l, E = B.y0 + l, d = B.x1 - l, m = B.y1 - l;
    d < Q && (Q = d = (Q + d) / 2), m < E && (E = m = (E + m) / 2), B.x0 = Q, B.y0 = E, B.x1 = d, B.y1 = m, B.children && (l = n[B.depth + 1] = o(B) / 2, Q += r(B) - l, E += g(B) - l, d -= s(B) - l, m -= I(B) - l, d < Q && (Q = d = (Q + d) / 2), m < E && (E = m = (E + m) / 2), A(B, Q, E, d, m));
  }
  return a.round = function(B) {
    return arguments.length ? (e = !!B, a) : e;
  }, a.size = function(B) {
    return arguments.length ? (t = +B[0], i = +B[1], a) : [t, i];
  }, a.tile = function(B) {
    return arguments.length ? (A = oZA(B), a) : A;
  }, a.padding = function(B) {
    return arguments.length ? a.paddingInner(B).paddingOuter(B) : a.paddingInner();
  }, a.paddingInner = function(B) {
    return arguments.length ? (o = typeof B == "function" ? B : Xy(+B), a) : o;
  }, a.paddingOuter = function(B) {
    return arguments.length ? a.paddingTop(B).paddingRight(B).paddingBottom(B).paddingLeft(B) : a.paddingTop();
  }, a.paddingTop = function(B) {
    return arguments.length ? (g = typeof B == "function" ? B : Xy(+B), a) : g;
  }, a.paddingRight = function(B) {
    return arguments.length ? (s = typeof B == "function" ? B : Xy(+B), a) : s;
  }, a.paddingBottom = function(B) {
    return arguments.length ? (I = typeof B == "function" ? B : Xy(+B), a) : I;
  }, a.paddingLeft = function(B) {
    return arguments.length ? (r = typeof B == "function" ? B : Xy(+B), a) : r;
  }, a;
}
function nSe(A, e, t, i, n) {
  var o = A.children, g, s = o.length, I, r = new Array(s + 1);
  for (r[0] = I = g = 0; g < s; ++g)
    r[g + 1] = I += o[g].value;
  a(0, s, A.value, e, t, i, n);
  function a(C, B, l, Q, E, d, m) {
    if (C >= B - 1) {
      var y = o[C];
      y.x0 = Q, y.y0 = E, y.x1 = d, y.y1 = m;
      return;
    }
    for (var f = r[C], w = l / 2 + f, G = C + 1, R = B - 1; G < R; ) {
      var F = G + R >>> 1;
      r[F] < w ? G = F + 1 : R = F;
    }
    w - r[G - 1] < r[G] - w && C + 1 < G && --G;
    var Z = r[G] - f, c = l - Z;
    if (d - Q > m - E) {
      var J = l ? (Q * c + d * Z) / l : d;
      a(C, G, Z, Q, E, J, m), a(G, B, c, J, E, d, m);
    } else {
      var p = l ? (E * c + m * Z) / l : m;
      a(C, G, Z, Q, E, d, p), a(G, B, c, Q, p, d, m);
    }
  }
}
function oSe(A, e, t, i, n) {
  (A.depth & 1 ? UU : GF)(A, e, t, i, n);
}
const gSe = function A(e) {
  function t(i, n, o, g, s) {
    if ((I = i._squarify) && I.ratio === e)
      for (var I, r, a, C, B = -1, l, Q = I.length, E = i.value; ++B < Q; ) {
        for (r = I[B], a = r.children, C = r.value = 0, l = a.length; C < l; ++C)
          r.value += a[C].value;
        r.dice ? GF(r, n, o, g, E ? o += (s - o) * r.value / E : s) : UU(r, n, o, E ? n += (g - n) * r.value / E : g, s), E -= r.value;
      }
    else
      i._squarify = I = rZA(e, i, n, o, g, s), I.ratio = e;
  }
  return t.ratio = function(i) {
    return A((i = +i) > 1 ? i : 1);
  }, t;
}(aZA);
function Hj(A, e, t) {
  const i = {};
  return A.each((n) => {
    const o = n.data;
    t(o) && (i[e(o)] = n);
  }), A.lookup = i, A;
}
function OiA(A) {
  FA.call(this, null, A);
}
OiA.Definition = {
  type: "Nest",
  metadata: {
    treesource: !0,
    changes: !0
  },
  params: [{
    name: "keys",
    type: "field",
    array: !0
  }, {
    name: "generate",
    type: "boolean"
  }]
};
const sSe = (A) => A.values;
Ae(OiA, FA, {
  transform(A, e) {
    e.source || vA("Nest transform requires an upstream data source.");
    var t = A.generate, i = A.modified(), n = e.clone(), o = this.value;
    return (!o || i || e.changed()) && (o && o.each((g) => {
      g.children && sU(g.data) && n.rem.push(g.data);
    }), this.value = o = qiA({
      values: Ce(A.keys).reduce((g, s) => (g.key(s), g), ISe()).entries(n.source)
    }, sSe), t && o.each((g) => {
      g.children && (g = Qi(g.data), n.add.push(g), n.source.push(g));
    }), Hj(o, ve, ve)), n.source.root = o, n;
  }
});
function ISe() {
  const A = [], e = {
    entries: (n) => i(t(n, 0), 0),
    key: (n) => (A.push(n), e)
  };
  function t(n, o) {
    if (o >= A.length)
      return n;
    const g = n.length, s = A[o++], I = {}, r = {};
    let a = -1, C, B, l;
    for (; ++a < g; )
      C = s(B = n[a]) + "", (l = I[C]) ? l.push(B) : I[C] = [B];
    for (C in I)
      r[C] = t(I[C], o);
    return r;
  }
  function i(n, o) {
    if (++o > A.length)
      return n;
    const g = [];
    for (const s in n)
      g.push({
        key: s,
        values: i(n[s], o)
      });
    return g;
  }
  return e;
}
function vQ(A) {
  FA.call(this, null, A);
}
const aSe = (A, e) => A.parent === e.parent ? 1 : 2;
Ae(vQ, FA, {
  transform(A, e) {
    (!e.source || !e.source.root) && vA(this.constructor.name + " transform requires a backing tree data source.");
    const t = this.layout(A.method), i = this.fields, n = e.source.root, o = A.as || i;
    A.field ? n.sum(A.field) : n.count(), A.sort && n.sort(s0(A.sort, (g) => g.data)), rSe(t, this.params, A), t.separation && t.separation(A.separation !== !1 ? aSe : VD);
    try {
      this.value = t(n);
    } catch (g) {
      vA(g);
    }
    return n.each((g) => CSe(g, i, o)), e.reflow(A.modified()).modifies(o).modifies("leaf");
  }
});
function rSe(A, e, t) {
  for (let i, n = 0, o = e.length; n < o; ++n)
    i = e[n], i in t && A[i](t[i]);
}
function CSe(A, e, t) {
  const i = A.data, n = e.length - 1;
  for (let o = 0; o < n; ++o)
    i[t[o]] = A[e[o]];
  i[t[n]] = A.children ? A.children.length : 0;
}
const Sj = ["x", "y", "r", "depth", "children"];
function jiA(A) {
  vQ.call(this, A);
}
jiA.Definition = {
  type: "Pack",
  metadata: {
    tree: !0,
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field"
  }, {
    name: "sort",
    type: "compare"
  }, {
    name: "padding",
    type: "number",
    default: 0
  }, {
    name: "radius",
    type: "field",
    default: null
  }, {
    name: "size",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: Sj.length,
    default: Sj
  }]
};
Ae(jiA, vQ, {
  layout: XHe,
  params: ["radius", "size", "padding"],
  fields: Sj
});
const Zj = ["x0", "y0", "x1", "y1", "depth", "children"];
function PiA(A) {
  vQ.call(this, A);
}
PiA.Definition = {
  type: "Partition",
  metadata: {
    tree: !0,
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field"
  }, {
    name: "sort",
    type: "compare"
  }, {
    name: "padding",
    type: "number",
    default: 0
  }, {
    name: "round",
    type: "boolean",
    default: !1
  }, {
    name: "size",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: Zj.length,
    default: Zj
  }]
};
Ae(PiA, vQ, {
  layout: zHe,
  params: ["size", "round", "padding"],
  fields: Zj
});
function $iA(A) {
  FA.call(this, null, A);
}
$iA.Definition = {
  type: "Stratify",
  metadata: {
    treesource: !0
  },
  params: [{
    name: "key",
    type: "field",
    required: !0
  }, {
    name: "parentKey",
    type: "field",
    required: !0
  }]
};
Ae($iA, FA, {
  transform(A, e) {
    e.source || vA("Stratify transform requires an upstream data source.");
    let t = this.value;
    const i = A.modified(), n = e.fork(e.ALL).materialize(e.SOURCE), o = !t || i || e.changed(e.ADD_REM) || e.modified(A.key.fields) || e.modified(A.parentKey.fields);
    return n.source = n.source.slice(), o && (t = n.source.length ? Hj(quA().id(A.key).parentId(A.parentKey)(n.source), A.key, ir) : Hj(quA()([{}]), A.key, A.key)), n.source.root = this.value = t, n;
  }
});
const juA = {
  tidy: tSe,
  cluster: cHe
}, Wj = ["x", "y", "depth", "children"];
function AnA(A) {
  vQ.call(this, A);
}
AnA.Definition = {
  type: "Tree",
  metadata: {
    tree: !0,
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field"
  }, {
    name: "sort",
    type: "compare"
  }, {
    name: "method",
    type: "enum",
    default: "tidy",
    values: ["tidy", "cluster"]
  }, {
    name: "size",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "nodeSize",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "separation",
    type: "boolean",
    default: !0
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: Wj.length,
    default: Wj
  }]
};
Ae(AnA, vQ, {
  /**
   * Tree layout generator. Supports both 'tidy' and 'cluster' layouts.
   */
  layout(A) {
    const e = A || "tidy";
    if (Ze(juA, e))
      return juA[e]();
    vA("Unrecognized Tree layout method: " + e);
  },
  params: ["size", "nodeSize"],
  fields: Wj
});
function enA(A) {
  FA.call(this, [], A);
}
enA.Definition = {
  type: "TreeLinks",
  metadata: {
    tree: !0,
    generates: !0,
    changes: !0
  },
  params: []
};
Ae(enA, FA, {
  transform(A, e) {
    const t = this.value, i = e.source && e.source.root, n = e.fork(e.NO_SOURCE), o = {};
    return i || vA("TreeLinks transform requires a tree data source."), e.changed(e.ADD_REM) ? (n.rem = t, e.visit(e.SOURCE, (g) => o[ve(g)] = 1), i.each((g) => {
      const s = g.data, I = g.parent && g.parent.data;
      I && o[ve(s)] && o[ve(I)] && n.add.push(Qi({
        source: I,
        target: s
      }));
    }), this.value = n.add) : e.changed(e.MOD) && (e.visit(e.MOD, (g) => o[ve(g)] = 1), t.forEach((g) => {
      (o[ve(g.source)] || o[ve(g.target)]) && n.mod.push(g);
    })), n;
  }
});
const PuA = {
  binary: nSe,
  dice: GF,
  slice: UU,
  slicedice: oSe,
  squarify: CZA,
  resquarify: gSe
}, Kj = ["x0", "y0", "x1", "y1", "depth", "children"];
function tnA(A) {
  vQ.call(this, A);
}
tnA.Definition = {
  type: "Treemap",
  metadata: {
    tree: !0,
    modifies: !0
  },
  params: [{
    name: "field",
    type: "field"
  }, {
    name: "sort",
    type: "compare"
  }, {
    name: "method",
    type: "enum",
    default: "squarify",
    values: ["squarify", "resquarify", "binary", "dice", "slice", "slicedice"]
  }, {
    name: "padding",
    type: "number",
    default: 0
  }, {
    name: "paddingInner",
    type: "number",
    default: 0
  }, {
    name: "paddingOuter",
    type: "number",
    default: 0
  }, {
    name: "paddingTop",
    type: "number",
    default: 0
  }, {
    name: "paddingRight",
    type: "number",
    default: 0
  }, {
    name: "paddingBottom",
    type: "number",
    default: 0
  }, {
    name: "paddingLeft",
    type: "number",
    default: 0
  }, {
    name: "ratio",
    type: "number",
    default: 1.618033988749895
  }, {
    name: "round",
    type: "boolean",
    default: !1
  }, {
    name: "size",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: Kj.length,
    default: Kj
  }]
};
Ae(tnA, vQ, {
  /**
   * Treemap layout generator. Adds 'method' and 'ratio' parameters
   * to configure the underlying tile method.
   */
  layout() {
    const A = iSe();
    return A.ratio = (e) => {
      const t = A.tile();
      t.ratio && A.tile(t.ratio(e));
    }, A.method = (e) => {
      Ze(PuA, e) ? A.tile(PuA[e]) : vA("Unrecognized Treemap layout method: " + e);
    }, A;
  },
  params: ["method", "ratio", "size", "round", "padding", "paddingInner", "paddingOuter", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
  fields: Kj
});
const BSe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  nest: OiA,
  pack: jiA,
  partition: PiA,
  stratify: $iA,
  tree: AnA,
  treelinks: enA,
  treemap: tnA
}, Symbol.toStringTag, { value: "Module" })), Lz = 4278190080;
function lSe(A, e) {
  const t = A.bitmap();
  return (e || []).forEach((i) => t.set(A(i.boundary[0]), A(i.boundary[3]))), [t, void 0];
}
function cSe(A, e, t, i, n) {
  const o = A.width, g = A.height, s = i || n, I = Ju(o, g).getContext("2d"), r = Ju(o, g).getContext("2d"), a = s && Ju(o, g).getContext("2d");
  t.forEach((Z) => tv(I, Z, !1)), tv(r, e, !1), s && tv(a, e, !0);
  const C = vz(I, o, g), B = vz(r, o, g), l = s && vz(a, o, g), Q = A.bitmap(), E = s && A.bitmap();
  let d, m, y, f, w, G, R, F;
  for (m = 0; m < g; ++m)
    for (d = 0; d < o; ++d)
      w = m * o + d, G = C[w] & Lz, F = B[w] & Lz, R = s && l[w] & Lz, (G || R || F) && (y = A(d), f = A(m), !n && (G || F) && Q.set(y, f), s && (G || R) && E.set(y, f));
  return [Q, E];
}
function vz(A, e, t) {
  return new Uint32Array(A.getImageData(0, 0, e, t).data.buffer);
}
function tv(A, e, t) {
  if (!e.length)
    return;
  const i = e[0].mark.marktype;
  i === "group" ? e.forEach((n) => {
    n.items.forEach((o) => tv(A, o.items, t));
  }) : Rg[i].draw(A, {
    items: t ? e.map(QSe) : e
  });
}
function QSe(A) {
  const e = IU(A, {});
  return e.stroke && e.strokeOpacity !== 0 || e.fill && e.fillOpacity !== 0 ? {
    ...e,
    strokeOpacity: 1,
    stroke: "#000",
    fillOpacity: 0
  } : e;
}
const oc = 5, Ug = 31, g2 = 32, xE = new Uint32Array(g2 + 1), Wr = new Uint32Array(g2 + 1);
Wr[0] = 0;
xE[0] = ~Wr[0];
for (let A = 1; A <= g2; ++A)
  Wr[A] = Wr[A - 1] << 1 | 1, xE[A] = ~Wr[A];
function ESe(A, e) {
  const t = new Uint32Array(~~((A * e + g2) / g2));
  function i(o, g) {
    t[o] |= g;
  }
  function n(o, g) {
    t[o] &= g;
  }
  return {
    array: t,
    get: (o, g) => {
      const s = g * A + o;
      return t[s >>> oc] & 1 << (s & Ug);
    },
    set: (o, g) => {
      const s = g * A + o;
      i(s >>> oc, 1 << (s & Ug));
    },
    clear: (o, g) => {
      const s = g * A + o;
      n(s >>> oc, ~(1 << (s & Ug)));
    },
    getRange: (o, g, s, I) => {
      let r = I, a, C, B, l;
      for (; r >= g; --r)
        if (a = r * A + o, C = r * A + s, B = a >>> oc, l = C >>> oc, B === l) {
          if (t[B] & xE[a & Ug] & Wr[(C & Ug) + 1])
            return !0;
        } else {
          if (t[B] & xE[a & Ug] || t[l] & Wr[(C & Ug) + 1])
            return !0;
          for (let Q = B + 1; Q < l; ++Q)
            if (t[Q])
              return !0;
        }
      return !1;
    },
    setRange: (o, g, s, I) => {
      let r, a, C, B, l;
      for (; g <= I; ++g)
        if (r = g * A + o, a = g * A + s, C = r >>> oc, B = a >>> oc, C === B)
          i(C, xE[r & Ug] & Wr[(a & Ug) + 1]);
        else
          for (i(C, xE[r & Ug]), i(B, Wr[(a & Ug) + 1]), l = C + 1; l < B; ++l)
            i(l, 4294967295);
    },
    clearRange: (o, g, s, I) => {
      let r, a, C, B, l;
      for (; g <= I; ++g)
        if (r = g * A + o, a = g * A + s, C = r >>> oc, B = a >>> oc, C === B)
          n(C, Wr[r & Ug] | xE[(a & Ug) + 1]);
        else
          for (n(C, Wr[r & Ug]), n(B, xE[(a & Ug) + 1]), l = C + 1; l < B; ++l)
            n(l, 0);
    },
    outOfBounds: (o, g, s, I) => o < 0 || g < 0 || I >= e || s >= A
  };
}
function uSe(A, e, t) {
  const i = Math.max(1, Math.sqrt(A * e / 1e6)), n = ~~((A + 2 * t + i) / i), o = ~~((e + 2 * t + i) / i), g = (s) => ~~((s + t) / i);
  return g.invert = (s) => s * i - t, g.bitmap = () => ESe(n, o), g.ratio = i, g.padding = t, g.width = A, g.height = e, g;
}
function dSe(A, e, t, i) {
  const n = A.width, o = A.height;
  return function(g) {
    const s = g.datum.datum.items[i].items, I = s.length, r = g.datum.fontSize, a = zI.width(g.datum, g.datum.text);
    let C = 0, B, l, Q, E, d, m, y;
    for (let f = 0; f < I; ++f)
      B = s[f].x, Q = s[f].y, l = s[f].x2 === void 0 ? B : s[f].x2, E = s[f].y2 === void 0 ? Q : s[f].y2, d = (B + l) / 2, m = (Q + E) / 2, y = Math.abs(l - B + E - Q), y >= C && (C = y, g.x = d, g.y = m);
    return d = a / 2, m = r / 2, B = g.x - d, l = g.x + d, Q = g.y - m, E = g.y + m, g.align = "center", B < 0 && l <= n ? g.align = "left" : 0 <= B && n < l && (g.align = "right"), g.baseline = "middle", Q < 0 && E <= o ? g.baseline = "top" : 0 <= Q && o < E && (g.baseline = "bottom"), !0;
  };
}
function QZ(A, e, t, i, n, o) {
  let g = t / 2;
  return A - g < 0 || A + g > n || e - (g = i / 2) < 0 || e + g > o;
}
function nu(A, e, t, i, n, o, g, s) {
  const I = n * o / (i * 2), r = A(e - I), a = A(e + I), C = A(t - (o = o / 2)), B = A(t + o);
  return g.outOfBounds(r, C, a, B) || g.getRange(r, C, a, B) || s && s.getRange(r, C, a, B);
}
function hSe(A, e, t, i) {
  const n = A.width, o = A.height, g = e[0], s = e[1];
  function I(r, a, C, B, l) {
    const Q = A.invert(r), E = A.invert(a);
    let d = C, m = o, y;
    if (!QZ(Q, E, B, l, n, o) && !nu(A, Q, E, l, B, d, g, s) && !nu(A, Q, E, l, B, l, g, null)) {
      for (; m - d >= 1; )
        y = (d + m) / 2, nu(A, Q, E, l, B, y, g, s) ? m = y : d = y;
      if (d > C)
        return [Q, E, d, !0];
    }
  }
  return function(r) {
    const a = r.datum.datum.items[i].items, C = a.length, B = r.datum.fontSize, l = zI.width(r.datum, r.datum.text);
    let Q = t ? B : 0, E = !1, d = !1, m = 0, y, f, w, G, R, F, Z, c, J, p, N, v, K, U, j, q, O;
    for (let $ = 0; $ < C; ++$) {
      for (y = a[$].x, w = a[$].y, f = a[$].x2 === void 0 ? y : a[$].x2, G = a[$].y2 === void 0 ? w : a[$].y2, y > f && (O = y, y = f, f = O), w > G && (O = w, w = G, G = O), J = A(y), N = A(f), p = ~~((J + N) / 2), v = A(w), U = A(G), K = ~~((v + U) / 2), Z = p; Z >= J; --Z)
        for (c = K; c >= v; --c)
          q = I(Z, c, Q, l, B), q && ([r.x, r.y, Q, E] = q);
      for (Z = p; Z <= N; ++Z)
        for (c = K; c <= U; ++c)
          q = I(Z, c, Q, l, B), q && ([r.x, r.y, Q, E] = q);
      !E && !t && (j = Math.abs(f - y + G - w), R = (y + f) / 2, F = (w + G) / 2, j >= m && !QZ(R, F, l, B, n, o) && !nu(A, R, F, B, l, B, g, null) && (m = j, r.x = R, r.y = F, d = !0));
    }
    return E || d ? (R = l / 2, F = B / 2, g.setRange(A(r.x - R), A(r.y - F), A(r.x + R), A(r.y + F)), r.align = "center", r.baseline = "middle", !0) : !1;
  };
}
const mSe = [-1, -1, 1, 1], pSe = [-1, 1, -1, 1];
function ySe(A, e, t, i) {
  const n = A.width, o = A.height, g = e[0], s = e[1], I = A.bitmap();
  return function(r) {
    const a = r.datum.datum.items[i].items, C = a.length, B = r.datum.fontSize, l = zI.width(r.datum, r.datum.text), Q = [];
    let E = t ? B : 0, d = !1, m = !1, y = 0, f, w, G, R, F, Z, c, J, p, N, v, K;
    for (let U = 0; U < C; ++U) {
      for (f = a[U].x, G = a[U].y, w = a[U].x2 === void 0 ? f : a[U].x2, R = a[U].y2 === void 0 ? G : a[U].y2, Q.push([A((f + w) / 2), A((G + R) / 2)]); Q.length; )
        if ([c, J] = Q.pop(), !(g.get(c, J) || s.get(c, J) || I.get(c, J))) {
          I.set(c, J);
          for (let j = 0; j < 4; ++j)
            F = c + mSe[j], Z = J + pSe[j], I.outOfBounds(F, Z, F, Z) || Q.push([F, Z]);
          if (F = A.invert(c), Z = A.invert(J), p = E, N = o, !QZ(F, Z, l, B, n, o) && !nu(A, F, Z, B, l, p, g, s) && !nu(A, F, Z, B, l, B, g, null)) {
            for (; N - p >= 1; )
              v = (p + N) / 2, nu(A, F, Z, B, l, v, g, s) ? N = v : p = v;
            p > E && (r.x = F, r.y = Z, E = p, d = !0);
          }
        }
      !d && !t && (K = Math.abs(w - f + R - G), F = (f + w) / 2, Z = (G + R) / 2, K >= y && !QZ(F, Z, l, B, n, o) && !nu(A, F, Z, B, l, B, g, null) && (y = K, r.x = F, r.y = Z, m = !0));
    }
    return d || m ? (F = l / 2, Z = B / 2, g.setRange(A(r.x - F), A(r.y - Z), A(r.x + F), A(r.y + Z)), r.align = "center", r.baseline = "middle", !0) : !1;
  };
}
const bSe = ["right", "center", "left"], wSe = ["bottom", "middle", "top"];
function fSe(A, e, t, i) {
  const n = A.width, o = A.height, g = e[0], s = e[1], I = i.length;
  return function(r) {
    const a = r.boundary, C = r.datum.fontSize;
    if (a[2] < 0 || a[5] < 0 || a[0] > n || a[3] > o)
      return !1;
    let B = r.textWidth ?? 0, l, Q, E, d, m, y, f, w, G, R, F, Z, c, J, p;
    for (let N = 0; N < I; ++N) {
      if (l = (t[N] & 3) - 1, Q = (t[N] >>> 2 & 3) - 1, E = l === 0 && Q === 0 || i[N] < 0, d = l && Q ? Math.SQRT1_2 : 1, m = i[N] < 0 ? -1 : 1, y = a[1 + l] + i[N] * l * d, F = a[4 + Q] + m * C * Q / 2 + i[N] * Q * d, w = F - C / 2, G = F + C / 2, Z = A(y), J = A(w), p = A(G), !B)
        if ($uA(Z, Z, J, p, g, s, y, y, w, G, a, E))
          B = zI.width(r.datum, r.datum.text);
        else
          continue;
      if (R = y + m * B * l / 2, y = R - B / 2, f = R + B / 2, Z = A(y), c = A(f), $uA(Z, c, J, p, g, s, y, f, w, G, a, E))
        return r.x = l ? l * m < 0 ? f : y : R, r.y = Q ? Q * m < 0 ? G : w : F, r.align = bSe[l * m + 1], r.baseline = wSe[Q * m + 1], g.setRange(Z, J, c, p), !0;
    }
    return !1;
  };
}
function $uA(A, e, t, i, n, o, g, s, I, r, a, C) {
  return !(n.outOfBounds(A, t, e, i) || (C && o || n).getRange(A, t, e, i));
}
const Hz = 0, Sz = 4, Zz = 8, Wz = 0, Kz = 1, Uz = 2, DSe = {
  "top-left": Hz + Wz,
  top: Hz + Kz,
  "top-right": Hz + Uz,
  left: Sz + Wz,
  middle: Sz + Kz,
  right: Sz + Uz,
  "bottom-left": Zz + Wz,
  bottom: Zz + Kz,
  "bottom-right": Zz + Uz
}, GSe = {
  naive: dSe,
  "reduced-search": hSe,
  floodfill: ySe
};
function kSe(A, e, t, i, n, o, g, s, I, r, a) {
  if (!A.length)
    return A;
  const C = Math.max(i.length, n.length), B = JSe(i, C), l = NSe(n, C), Q = YSe(A[0].datum), E = Q === "group" && A[0].datum.items[I].marktype, d = E === "area", m = RSe(Q, E, s, I), y = r === null || r === 1 / 0, f = d && a === "naive";
  let w = -1, G = -1;
  const R = A.map((J) => {
    const p = y ? zI.width(J, J.text) : void 0;
    return w = Math.max(w, p), G = Math.max(G, J.fontSize), {
      datum: J,
      opacity: 0,
      x: void 0,
      y: void 0,
      align: void 0,
      baseline: void 0,
      boundary: m(J),
      textWidth: p
    };
  });
  r = r === null || r === 1 / 0 ? Math.max(w, G) + Math.max(...i) : r;
  const F = uSe(e[0], e[1], r);
  let Z;
  if (!f) {
    t && R.sort((N, v) => t(N.datum, v.datum));
    let J = !1;
    for (let N = 0; N < l.length && !J; ++N)
      J = l[N] === 5 || B[N] < 0;
    const p = (Q && g || d) && A.map((N) => N.datum);
    Z = o.length || p ? cSe(F, p || [], o, J, d) : lSe(F, g && R);
  }
  const c = d ? GSe[a](F, Z, g, I) : fSe(F, Z, l, B);
  return R.forEach((J) => J.opacity = +c(J)), R;
}
function JSe(A, e) {
  const t = new Float64Array(e), i = A.length;
  for (let n = 0; n < i; ++n)
    t[n] = A[n] || 0;
  for (let n = i; n < e; ++n)
    t[n] = t[i - 1];
  return t;
}
function NSe(A, e) {
  const t = new Int8Array(e), i = A.length;
  for (let n = 0; n < i; ++n)
    t[n] |= DSe[A[n]];
  for (let n = i; n < e; ++n)
    t[n] = t[i - 1];
  return t;
}
function YSe(A) {
  return A && A.mark && A.mark.marktype;
}
function RSe(A, e, t, i) {
  const n = (o) => [o.x, o.x, o.x, o.y, o.y, o.y];
  return A ? A === "line" || A === "area" ? (o) => n(o.datum) : e === "line" ? (o) => {
    const g = o.datum.items[i].items;
    return n(g.length ? g[t === "start" ? 0 : g.length - 1] : {
      x: NaN,
      y: NaN
    });
  } : (o) => {
    const g = o.datum.bounds;
    return [g.x1, (g.x1 + g.x2) / 2, g.x2, g.y1, (g.y1 + g.y2) / 2, g.y2];
  } : n;
}
const Uj = ["x", "y", "opacity", "align", "baseline"], BZA = ["top-left", "left", "bottom-left", "top", "bottom", "top-right", "right", "bottom-right"];
function inA(A) {
  FA.call(this, null, A);
}
inA.Definition = {
  type: "Label",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "size",
    type: "number",
    array: !0,
    length: 2,
    required: !0
  }, {
    name: "sort",
    type: "compare"
  }, {
    name: "anchor",
    type: "string",
    array: !0,
    default: BZA
  }, {
    name: "offset",
    type: "number",
    array: !0,
    default: [1]
  }, {
    name: "padding",
    type: "number",
    default: 0,
    null: !0
  }, {
    name: "lineAnchor",
    type: "string",
    values: ["start", "end"],
    default: "end"
  }, {
    name: "markIndex",
    type: "number",
    default: 0
  }, {
    name: "avoidBaseMark",
    type: "boolean",
    default: !0
  }, {
    name: "avoidMarks",
    type: "data",
    array: !0
  }, {
    name: "method",
    type: "string",
    default: "naive"
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: Uj.length,
    default: Uj
  }]
};
Ae(inA, FA, {
  transform(A, e) {
    function t(o) {
      const g = A[o];
      return yt(g) && e.modified(g.fields);
    }
    const i = A.modified();
    if (!(i || e.changed(e.ADD_REM) || t("sort")))
      return;
    (!A.size || A.size.length !== 2) && vA("Size parameter should be specified as a [width, height] array.");
    const n = A.as || Uj;
    return kSe(e.materialize(e.SOURCE).source || [], A.size, A.sort, Ce(A.offset == null ? 1 : A.offset), Ce(A.anchor || BZA), A.avoidMarks || [], A.avoidBaseMark !== !1, A.lineAnchor || "end", A.markIndex || 0, A.padding === void 0 ? 0 : A.padding, A.method || "naive").forEach((o) => {
      const g = o.datum;
      g[n[0]] = o.x, g[n[1]] = o.y, g[n[2]] = o.opacity, g[n[3]] = o.align, g[n[4]] = o.baseline;
    }), e.reflow(i).modifies(n);
  }
});
const FSe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  label: inA
}, Symbol.toStringTag, { value: "Module" }));
function lZA(A, e) {
  var t = [], i = function(a) {
    return a(s);
  }, n, o, g, s, I, r;
  if (e == null)
    t.push(A);
  else
    for (n = {}, o = 0, g = A.length; o < g; ++o)
      s = A[o], I = e.map(i), r = n[I], r || (n[I] = r = [], r.dims = I, t.push(r)), r.push(s);
  return t;
}
function nnA(A) {
  FA.call(this, null, A);
}
nnA.Definition = {
  type: "Loess",
  metadata: {
    generates: !0
  },
  params: [{
    name: "x",
    type: "field",
    required: !0
  }, {
    name: "y",
    type: "field",
    required: !0
  }, {
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "bandwidth",
    type: "number",
    default: 0.3
  }, {
    name: "as",
    type: "string",
    array: !0
  }]
};
Ae(nnA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE | e.NO_FIELDS);
    if (!this.value || e.changed() || A.modified()) {
      const i = e.materialize(e.SOURCE).source, n = lZA(i, A.groupby), o = (A.groupby || []).map(Sn), g = o.length, s = A.as || [Sn(A.x), Sn(A.y)], I = [];
      n.forEach((r) => {
        cLA(r, A.x, A.y, A.bandwidth || 0.3).forEach((a) => {
          const C = {};
          for (let B = 0; B < g; ++B)
            C[o[B]] = r.dims[B];
          C[s[0]] = a[0], C[s[1]] = a[1], I.push(Qi(C));
        });
      }), this.value && (t.rem = this.value), this.value = t.add = t.source = I;
    }
    return t;
  }
});
const Vj = {
  constant: _eA,
  linear: qeA,
  log: rLA,
  exp: CLA,
  pow: BLA,
  quad: OeA,
  poly: lLA
}, MSe = (A, e) => A === "poly" ? e : A === "quad" ? 2 : 1;
function onA(A) {
  FA.call(this, null, A);
}
onA.Definition = {
  type: "Regression",
  metadata: {
    generates: !0
  },
  params: [{
    name: "x",
    type: "field",
    required: !0
  }, {
    name: "y",
    type: "field",
    required: !0
  }, {
    name: "groupby",
    type: "field",
    array: !0
  }, {
    name: "method",
    type: "string",
    default: "linear",
    values: Object.keys(Vj)
  }, {
    name: "order",
    type: "number",
    default: 3
  }, {
    name: "extent",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "params",
    type: "boolean",
    default: !1
  }, {
    name: "as",
    type: "string",
    array: !0
  }]
};
Ae(onA, FA, {
  transform(A, e) {
    const t = e.fork(e.NO_SOURCE | e.NO_FIELDS);
    if (!this.value || e.changed() || A.modified()) {
      const i = e.materialize(e.SOURCE).source, n = lZA(i, A.groupby), o = (A.groupby || []).map(Sn), g = A.method || "linear", s = A.order == null ? 3 : A.order, I = MSe(g, s), r = A.as || [Sn(A.x), Sn(A.y)], a = Vj[g], C = [];
      let B = A.extent;
      Ze(Vj, g) || vA("Invalid regression method: " + g), B != null && g === "log" && B[0] <= 0 && (e.dataflow.warn("Ignoring extent with values <= 0 for log regression."), B = null), n.forEach((l) => {
        if (l.length <= I) {
          e.dataflow.warn("Skipping regression with more parameters than data points.");
          return;
        }
        const Q = a(l, A.x, A.y, s);
        if (A.params) {
          C.push(Qi({
            keys: l.dims,
            coef: Q.coef,
            rSquared: Q.rSquared
          }));
          return;
        }
        const E = B || sl(l, A.x), d = (m) => {
          const y = {};
          for (let f = 0; f < o.length; ++f)
            y[o[f]] = l.dims[f];
          y[r[0]] = m[0], y[r[1]] = m[1], C.push(Qi(y));
        };
        g === "linear" || g === "constant" ? E.forEach((m) => d([m, Q.predict(m)])) : QU(Q.predict, E, 25, 200).forEach(d);
      }), this.value && (t.rem = this.value), this.value = t.add = t.source = C;
    }
    return t;
  }
});
const xSe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  loess: nnA,
  regression: onA
}, Symbol.toStringTag, { value: "Module" })), Oc = 11102230246251565e-32, cg = 134217729, LSe = (3 + 8 * Oc) * Oc;
function Vz(A, e, t, i, n) {
  let o, g, s, I, r = e[0], a = i[0], C = 0, B = 0;
  a > r == a > -r ? (o = r, r = e[++C]) : (o = a, a = i[++B]);
  let l = 0;
  if (C < A && B < t)
    for (a > r == a > -r ? (g = r + o, s = o - (g - r), r = e[++C]) : (g = a + o, s = o - (g - a), a = i[++B]), o = g, s !== 0 && (n[l++] = s); C < A && B < t; )
      a > r == a > -r ? (g = o + r, I = g - o, s = o - (g - I) + (r - I), r = e[++C]) : (g = o + a, I = g - o, s = o - (g - I) + (a - I), a = i[++B]), o = g, s !== 0 && (n[l++] = s);
  for (; C < A; )
    g = o + r, I = g - o, s = o - (g - I) + (r - I), r = e[++C], o = g, s !== 0 && (n[l++] = s);
  for (; B < t; )
    g = o + a, I = g - o, s = o - (g - I) + (a - I), a = i[++B], o = g, s !== 0 && (n[l++] = s);
  return (o !== 0 || l === 0) && (n[l++] = o), l;
}
function vSe(A, e) {
  let t = e[0];
  for (let i = 1; i < A; i++)
    t += e[i];
  return t;
}
function kF(A) {
  return new Float64Array(A);
}
const HSe = (3 + 16 * Oc) * Oc, SSe = (2 + 12 * Oc) * Oc, ZSe = (9 + 64 * Oc) * Oc * Oc, Ey = kF(4), AdA = kF(8), edA = kF(12), tdA = kF(16), Vg = kF(4);
function WSe(A, e, t, i, n, o, g) {
  let s, I, r, a, C, B, l, Q, E, d, m, y, f, w, G, R, F, Z;
  const c = A - n, J = t - n, p = e - o, N = i - o;
  w = c * N, B = cg * c, l = B - (B - c), Q = c - l, B = cg * N, E = B - (B - N), d = N - E, G = Q * d - (w - l * E - Q * E - l * d), R = p * J, B = cg * p, l = B - (B - p), Q = p - l, B = cg * J, E = B - (B - J), d = J - E, F = Q * d - (R - l * E - Q * E - l * d), m = G - F, C = G - m, Ey[0] = G - (m + C) + (C - F), y = w + m, C = y - w, f = w - (y - C) + (m - C), m = f - R, C = f - m, Ey[1] = f - (m + C) + (C - R), Z = y + m, C = Z - y, Ey[2] = y - (Z - C) + (m - C), Ey[3] = Z;
  let v = vSe(4, Ey), K = SSe * g;
  if (v >= K || -v >= K || (C = A - c, s = A - (c + C) + (C - n), C = t - J, r = t - (J + C) + (C - n), C = e - p, I = e - (p + C) + (C - o), C = i - N, a = i - (N + C) + (C - o), s === 0 && I === 0 && r === 0 && a === 0) || (K = ZSe * g + LSe * Math.abs(v), v += c * a + N * s - (p * r + J * I), v >= K || -v >= K))
    return v;
  w = s * N, B = cg * s, l = B - (B - s), Q = s - l, B = cg * N, E = B - (B - N), d = N - E, G = Q * d - (w - l * E - Q * E - l * d), R = I * J, B = cg * I, l = B - (B - I), Q = I - l, B = cg * J, E = B - (B - J), d = J - E, F = Q * d - (R - l * E - Q * E - l * d), m = G - F, C = G - m, Vg[0] = G - (m + C) + (C - F), y = w + m, C = y - w, f = w - (y - C) + (m - C), m = f - R, C = f - m, Vg[1] = f - (m + C) + (C - R), Z = y + m, C = Z - y, Vg[2] = y - (Z - C) + (m - C), Vg[3] = Z;
  const U = Vz(4, Ey, 4, Vg, AdA);
  w = c * a, B = cg * c, l = B - (B - c), Q = c - l, B = cg * a, E = B - (B - a), d = a - E, G = Q * d - (w - l * E - Q * E - l * d), R = p * r, B = cg * p, l = B - (B - p), Q = p - l, B = cg * r, E = B - (B - r), d = r - E, F = Q * d - (R - l * E - Q * E - l * d), m = G - F, C = G - m, Vg[0] = G - (m + C) + (C - F), y = w + m, C = y - w, f = w - (y - C) + (m - C), m = f - R, C = f - m, Vg[1] = f - (m + C) + (C - R), Z = y + m, C = Z - y, Vg[2] = y - (Z - C) + (m - C), Vg[3] = Z;
  const j = Vz(U, AdA, 4, Vg, edA);
  w = s * a, B = cg * s, l = B - (B - s), Q = s - l, B = cg * a, E = B - (B - a), d = a - E, G = Q * d - (w - l * E - Q * E - l * d), R = I * r, B = cg * I, l = B - (B - I), Q = I - l, B = cg * r, E = B - (B - r), d = r - E, F = Q * d - (R - l * E - Q * E - l * d), m = G - F, C = G - m, Vg[0] = G - (m + C) + (C - F), y = w + m, C = y - w, f = w - (y - C) + (m - C), m = f - R, C = f - m, Vg[1] = f - (m + C) + (C - R), Z = y + m, C = Z - y, Vg[2] = y - (Z - C) + (m - C), Vg[3] = Z;
  const q = Vz(j, edA, 4, Vg, tdA);
  return tdA[q - 1];
}
function Cx(A, e, t, i, n, o) {
  const g = (e - o) * (t - n), s = (A - n) * (i - o), I = g - s, r = Math.abs(g + s);
  return Math.abs(I) >= HSe * r ? I : -WSe(A, e, t, i, n, o, r);
}
const idA = Math.pow(2, -52), Bx = new Uint32Array(512);
class EZ {
  static from(e, t = zSe, i = TSe) {
    const n = e.length, o = new Float64Array(n * 2);
    for (let g = 0; g < n; g++) {
      const s = e[g];
      o[2 * g] = t(s), o[2 * g + 1] = i(s);
    }
    return new EZ(o);
  }
  constructor(e) {
    const t = e.length >> 1;
    if (t > 0 && typeof e[0] != "number")
      throw new Error("Expected coords to contain numbers.");
    this.coords = e;
    const i = Math.max(2 * t - 5, 0);
    this._triangles = new Uint32Array(i * 3), this._halfedges = new Int32Array(i * 3), this._hashSize = Math.ceil(Math.sqrt(t)), this._hullPrev = new Uint32Array(t), this._hullNext = new Uint32Array(t), this._hullTri = new Uint32Array(t), this._hullHash = new Int32Array(this._hashSize).fill(-1), this._ids = new Uint32Array(t), this._dists = new Float64Array(t), this.update();
  }
  update() {
    const { coords: e, _hullPrev: t, _hullNext: i, _hullTri: n, _hullHash: o } = this, g = e.length >> 1;
    let s = 1 / 0, I = 1 / 0, r = -1 / 0, a = -1 / 0;
    for (let J = 0; J < g; J++) {
      const p = e[2 * J], N = e[2 * J + 1];
      p < s && (s = p), N < I && (I = N), p > r && (r = p), N > a && (a = N), this._ids[J] = J;
    }
    const C = (s + r) / 2, B = (I + a) / 2;
    let l = 1 / 0, Q, E, d;
    for (let J = 0; J < g; J++) {
      const p = Xz(C, B, e[2 * J], e[2 * J + 1]);
      p < l && (Q = J, l = p);
    }
    const m = e[2 * Q], y = e[2 * Q + 1];
    l = 1 / 0;
    for (let J = 0; J < g; J++) {
      if (J === Q)
        continue;
      const p = Xz(m, y, e[2 * J], e[2 * J + 1]);
      p < l && p > 0 && (E = J, l = p);
    }
    let f = e[2 * E], w = e[2 * E + 1], G = 1 / 0;
    for (let J = 0; J < g; J++) {
      if (J === Q || J === E)
        continue;
      const p = VSe(m, y, f, w, e[2 * J], e[2 * J + 1]);
      p < G && (d = J, G = p);
    }
    let R = e[2 * d], F = e[2 * d + 1];
    if (G === 1 / 0) {
      for (let N = 0; N < g; N++)
        this._dists[N] = e[2 * N] - e[0] || e[2 * N + 1] - e[1];
      Kb(this._ids, this._dists, 0, g - 1);
      const J = new Uint32Array(g);
      let p = 0;
      for (let N = 0, v = -1 / 0; N < g; N++) {
        const K = this._ids[N];
        this._dists[K] > v && (J[p++] = K, v = this._dists[K]);
      }
      this.hull = J.subarray(0, p), this.triangles = new Uint32Array(0), this.halfedges = new Uint32Array(0);
      return;
    }
    if (Cx(m, y, f, w, R, F) < 0) {
      const J = E, p = f, N = w;
      E = d, f = R, w = F, d = J, R = p, F = N;
    }
    const Z = XSe(m, y, f, w, R, F);
    this._cx = Z.x, this._cy = Z.y;
    for (let J = 0; J < g; J++)
      this._dists[J] = Xz(e[2 * J], e[2 * J + 1], Z.x, Z.y);
    Kb(this._ids, this._dists, 0, g - 1), this._hullStart = Q;
    let c = 3;
    i[Q] = t[d] = E, i[E] = t[Q] = d, i[d] = t[E] = Q, n[Q] = 0, n[E] = 1, n[d] = 2, o.fill(-1), o[this._hashKey(m, y)] = Q, o[this._hashKey(f, w)] = E, o[this._hashKey(R, F)] = d, this.trianglesLen = 0, this._addTriangle(Q, E, d, -1, -1, -1);
    for (let J = 0, p, N; J < this._ids.length; J++) {
      const v = this._ids[J], K = e[2 * v], U = e[2 * v + 1];
      if (J > 0 && Math.abs(K - p) <= idA && Math.abs(U - N) <= idA || (p = K, N = U, v === Q || v === E || v === d))
        continue;
      let j = 0;
      for (let tA = 0, nA = this._hashKey(K, U); tA < this._hashSize && (j = o[(nA + tA) % this._hashSize], !(j !== -1 && j !== i[j])); tA++)
        ;
      j = t[j];
      let q = j, O;
      for (; O = i[q], Cx(K, U, e[2 * q], e[2 * q + 1], e[2 * O], e[2 * O + 1]) >= 0; )
        if (q = O, q === j) {
          q = -1;
          break;
        }
      if (q === -1)
        continue;
      let $ = this._addTriangle(q, v, i[q], -1, -1, n[q]);
      n[v] = this._legalize($ + 2), n[q] = $, c++;
      let _ = i[q];
      for (; O = i[_], Cx(K, U, e[2 * _], e[2 * _ + 1], e[2 * O], e[2 * O + 1]) < 0; )
        $ = this._addTriangle(_, v, O, n[v], -1, n[_]), n[v] = this._legalize($ + 2), i[_] = _, c--, _ = O;
      if (q === j)
        for (; O = t[q], Cx(K, U, e[2 * O], e[2 * O + 1], e[2 * q], e[2 * q + 1]) < 0; )
          $ = this._addTriangle(O, v, q, -1, n[q], n[O]), this._legalize($ + 2), n[O] = $, i[q] = q, c--, q = O;
      this._hullStart = t[v] = q, i[q] = t[_] = v, i[v] = _, o[this._hashKey(K, U)] = v, o[this._hashKey(e[2 * q], e[2 * q + 1])] = q;
    }
    this.hull = new Uint32Array(c);
    for (let J = 0, p = this._hullStart; J < c; J++)
      this.hull[J] = p, p = i[p];
    this.triangles = this._triangles.subarray(0, this.trianglesLen), this.halfedges = this._halfedges.subarray(0, this.trianglesLen);
  }
  _hashKey(e, t) {
    return Math.floor(KSe(e - this._cx, t - this._cy) * this._hashSize) % this._hashSize;
  }
  _legalize(e) {
    const { _triangles: t, _halfedges: i, coords: n } = this;
    let o = 0, g = 0;
    for (; ; ) {
      const s = i[e], I = e - e % 3;
      if (g = I + (e + 2) % 3, s === -1) {
        if (o === 0)
          break;
        e = Bx[--o];
        continue;
      }
      const r = s - s % 3, a = I + (e + 1) % 3, C = r + (s + 2) % 3, B = t[g], l = t[e], Q = t[a], E = t[C];
      if (USe(
        n[2 * B],
        n[2 * B + 1],
        n[2 * l],
        n[2 * l + 1],
        n[2 * Q],
        n[2 * Q + 1],
        n[2 * E],
        n[2 * E + 1]
      )) {
        t[e] = E, t[s] = B;
        const d = i[C];
        if (d === -1) {
          let y = this._hullStart;
          do {
            if (this._hullTri[y] === C) {
              this._hullTri[y] = e;
              break;
            }
            y = this._hullPrev[y];
          } while (y !== this._hullStart);
        }
        this._link(e, d), this._link(s, i[g]), this._link(g, C);
        const m = r + (s + 1) % 3;
        o < Bx.length && (Bx[o++] = m);
      } else {
        if (o === 0)
          break;
        e = Bx[--o];
      }
    }
    return g;
  }
  _link(e, t) {
    this._halfedges[e] = t, t !== -1 && (this._halfedges[t] = e);
  }
  // add a new triangle given vertex indices and adjacent half-edge ids
  _addTriangle(e, t, i, n, o, g) {
    const s = this.trianglesLen;
    return this._triangles[s] = e, this._triangles[s + 1] = t, this._triangles[s + 2] = i, this._link(s, n), this._link(s + 1, o), this._link(s + 2, g), this.trianglesLen += 3, s;
  }
}
function KSe(A, e) {
  const t = A / (Math.abs(A) + Math.abs(e));
  return (e > 0 ? 3 - t : 1 + t) / 4;
}
function Xz(A, e, t, i) {
  const n = A - t, o = e - i;
  return n * n + o * o;
}
function USe(A, e, t, i, n, o, g, s) {
  const I = A - g, r = e - s, a = t - g, C = i - s, B = n - g, l = o - s, Q = I * I + r * r, E = a * a + C * C, d = B * B + l * l;
  return I * (C * d - E * l) - r * (a * d - E * B) + Q * (a * l - C * B) < 0;
}
function VSe(A, e, t, i, n, o) {
  const g = t - A, s = i - e, I = n - A, r = o - e, a = g * g + s * s, C = I * I + r * r, B = 0.5 / (g * r - s * I), l = (r * a - s * C) * B, Q = (g * C - I * a) * B;
  return l * l + Q * Q;
}
function XSe(A, e, t, i, n, o) {
  const g = t - A, s = i - e, I = n - A, r = o - e, a = g * g + s * s, C = I * I + r * r, B = 0.5 / (g * r - s * I), l = A + (r * a - s * C) * B, Q = e + (g * C - I * a) * B;
  return { x: l, y: Q };
}
function Kb(A, e, t, i) {
  if (i - t <= 20)
    for (let n = t + 1; n <= i; n++) {
      const o = A[n], g = e[o];
      let s = n - 1;
      for (; s >= t && e[A[s]] > g; )
        A[s + 1] = A[s--];
      A[s + 1] = o;
    }
  else {
    const n = t + i >> 1;
    let o = t + 1, g = i;
    Gk(A, n, o), e[A[t]] > e[A[i]] && Gk(A, t, i), e[A[o]] > e[A[i]] && Gk(A, o, i), e[A[t]] > e[A[o]] && Gk(A, t, o);
    const s = A[o], I = e[s];
    for (; ; ) {
      do
        o++;
      while (e[A[o]] < I);
      do
        g--;
      while (e[A[g]] > I);
      if (g < o)
        break;
      Gk(A, o, g);
    }
    A[t + 1] = A[g], A[g] = s, i - o + 1 >= g - t ? (Kb(A, e, o, i), Kb(A, e, t, g - 1)) : (Kb(A, e, t, g - 1), Kb(A, e, o, i));
  }
}
function Gk(A, e, t) {
  const i = A[e];
  A[e] = A[t], A[t] = i;
}
function zSe(A) {
  return A[0];
}
function TSe(A) {
  return A[1];
}
const ndA = 1e-6;
class Qm {
  constructor() {
    this._x0 = this._y0 = // start of current subpath
    this._x1 = this._y1 = null, this._ = "";
  }
  moveTo(e, t) {
    this._ += `M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}`;
  }
  closePath() {
    this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
  }
  lineTo(e, t) {
    this._ += `L${this._x1 = +e},${this._y1 = +t}`;
  }
  arc(e, t, i) {
    e = +e, t = +t, i = +i;
    const n = e + i, o = t;
    if (i < 0)
      throw new Error("negative radius");
    this._x1 === null ? this._ += `M${n},${o}` : (Math.abs(this._x1 - n) > ndA || Math.abs(this._y1 - o) > ndA) && (this._ += "L" + n + "," + o), i && (this._ += `A${i},${i},0,1,1,${e - i},${t}A${i},${i},0,1,1,${this._x1 = n},${this._y1 = o}`);
  }
  rect(e, t, i, n) {
    this._ += `M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}h${+i}v${+n}h${-i}Z`;
  }
  value() {
    return this._ || null;
  }
}
class Xj {
  constructor() {
    this._ = [];
  }
  moveTo(e, t) {
    this._.push([e, t]);
  }
  closePath() {
    this._.push(this._[0].slice());
  }
  lineTo(e, t) {
    this._.push([e, t]);
  }
  value() {
    return this._.length ? this._ : null;
  }
}
let _Se = class {
  constructor(A, [e, t, i, n] = [0, 0, 960, 500]) {
    if (!((i = +i) >= (e = +e)) || !((n = +n) >= (t = +t)))
      throw new Error("invalid bounds");
    this.delaunay = A, this._circumcenters = new Float64Array(A.points.length * 2), this.vectors = new Float64Array(A.points.length * 2), this.xmax = i, this.xmin = e, this.ymax = n, this.ymin = t, this._init();
  }
  update() {
    return this.delaunay.update(), this._init(), this;
  }
  _init() {
    const { delaunay: { points: A, hull: e, triangles: t }, vectors: i } = this;
    let n, o;
    const g = this.circumcenters = this._circumcenters.subarray(0, t.length / 3 * 2);
    for (let Q = 0, E = 0, d = t.length, m, y; Q < d; Q += 3, E += 2) {
      const f = t[Q] * 2, w = t[Q + 1] * 2, G = t[Q + 2] * 2, R = A[f], F = A[f + 1], Z = A[w], c = A[w + 1], J = A[G], p = A[G + 1], N = Z - R, v = c - F, K = J - R, U = p - F, j = (N * U - v * K) * 2;
      if (Math.abs(j) < 1e-9) {
        if (n === void 0) {
          n = o = 0;
          for (const O of e)
            n += A[O * 2], o += A[O * 2 + 1];
          n /= e.length, o /= e.length;
        }
        const q = 1e9 * Math.sign((n - R) * U - (o - F) * K);
        m = (R + J) / 2 - q * U, y = (F + p) / 2 + q * K;
      } else {
        const q = 1 / j, O = N * N + v * v, $ = K * K + U * U;
        m = R + (U * O - v * $) * q, y = F + (N * $ - K * O) * q;
      }
      g[E] = m, g[E + 1] = y;
    }
    let s = e[e.length - 1], I, r = s * 4, a, C = A[2 * s], B, l = A[2 * s + 1];
    i.fill(0);
    for (let Q = 0; Q < e.length; ++Q)
      s = e[Q], I = r, a = C, B = l, r = s * 4, C = A[2 * s], l = A[2 * s + 1], i[I + 2] = i[r] = B - l, i[I + 3] = i[r + 1] = C - a;
  }
  render(A) {
    const e = A == null ? A = new Qm() : void 0, { delaunay: { halfedges: t, inedges: i, hull: n }, circumcenters: o, vectors: g } = this;
    if (n.length <= 1)
      return null;
    for (let r = 0, a = t.length; r < a; ++r) {
      const C = t[r];
      if (C < r)
        continue;
      const B = Math.floor(r / 3) * 2, l = Math.floor(C / 3) * 2, Q = o[B], E = o[B + 1], d = o[l], m = o[l + 1];
      this._renderSegment(Q, E, d, m, A);
    }
    let s, I = n[n.length - 1];
    for (let r = 0; r < n.length; ++r) {
      s = I, I = n[r];
      const a = Math.floor(i[I] / 3) * 2, C = o[a], B = o[a + 1], l = s * 4, Q = this._project(C, B, g[l + 2], g[l + 3]);
      Q && this._renderSegment(C, B, Q[0], Q[1], A);
    }
    return e && e.value();
  }
  renderBounds(A) {
    const e = A == null ? A = new Qm() : void 0;
    return A.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin), e && e.value();
  }
  renderCell(A, e) {
    const t = e == null ? e = new Qm() : void 0, i = this._clip(A);
    if (i === null || !i.length)
      return;
    e.moveTo(i[0], i[1]);
    let n = i.length;
    for (; i[0] === i[n - 2] && i[1] === i[n - 1] && n > 1; )
      n -= 2;
    for (let o = 2; o < n; o += 2)
      (i[o] !== i[o - 2] || i[o + 1] !== i[o - 1]) && e.lineTo(i[o], i[o + 1]);
    return e.closePath(), t && t.value();
  }
  *cellPolygons() {
    const { delaunay: { points: A } } = this;
    for (let e = 0, t = A.length / 2; e < t; ++e) {
      const i = this.cellPolygon(e);
      i && (i.index = e, yield i);
    }
  }
  cellPolygon(A) {
    const e = new Xj();
    return this.renderCell(A, e), e.value();
  }
  _renderSegment(A, e, t, i, n) {
    let o;
    const g = this._regioncode(A, e), s = this._regioncode(t, i);
    g === 0 && s === 0 ? (n.moveTo(A, e), n.lineTo(t, i)) : (o = this._clipSegment(A, e, t, i, g, s)) && (n.moveTo(o[0], o[1]), n.lineTo(o[2], o[3]));
  }
  contains(A, e, t) {
    return e = +e, e !== e || (t = +t, t !== t) ? !1 : this.delaunay._step(A, e, t) === A;
  }
  *neighbors(A) {
    const e = this._clip(A);
    if (e)
      for (const t of this.delaunay.neighbors(A)) {
        const i = this._clip(t);
        if (i) {
          A:
            for (let n = 0, o = e.length; n < o; n += 2)
              for (let g = 0, s = i.length; g < s; g += 2)
                if (e[n] === i[g] && e[n + 1] === i[g + 1] && e[(n + 2) % o] === i[(g + s - 2) % s] && e[(n + 3) % o] === i[(g + s - 1) % s]) {
                  yield t;
                  break A;
                }
        }
      }
  }
  _cell(A) {
    const { circumcenters: e, delaunay: { inedges: t, halfedges: i, triangles: n } } = this, o = t[A];
    if (o === -1)
      return null;
    const g = [];
    let s = o;
    do {
      const I = Math.floor(s / 3);
      if (g.push(e[I * 2], e[I * 2 + 1]), s = s % 3 === 2 ? s - 2 : s + 1, n[s] !== A)
        break;
      s = i[s];
    } while (s !== o && s !== -1);
    return g;
  }
  _clip(A) {
    if (A === 0 && this.delaunay.hull.length === 1)
      return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];
    const e = this._cell(A);
    if (e === null)
      return null;
    const { vectors: t } = this, i = A * 4;
    return this._simplify(t[i] || t[i + 1] ? this._clipInfinite(A, e, t[i], t[i + 1], t[i + 2], t[i + 3]) : this._clipFinite(A, e));
  }
  _clipFinite(A, e) {
    const t = e.length;
    let i = null, n, o, g = e[t - 2], s = e[t - 1], I, r = this._regioncode(g, s), a, C = 0;
    for (let B = 0; B < t; B += 2)
      if (n = g, o = s, g = e[B], s = e[B + 1], I = r, r = this._regioncode(g, s), I === 0 && r === 0)
        a = C, C = 0, i ? i.push(g, s) : i = [g, s];
      else {
        let l, Q, E, d, m;
        if (I === 0) {
          if ((l = this._clipSegment(n, o, g, s, I, r)) === null)
            continue;
          [Q, E, d, m] = l;
        } else {
          if ((l = this._clipSegment(g, s, n, o, r, I)) === null)
            continue;
          [d, m, Q, E] = l, a = C, C = this._edgecode(Q, E), a && C && this._edge(A, a, C, i, i.length), i ? i.push(Q, E) : i = [Q, E];
        }
        a = C, C = this._edgecode(d, m), a && C && this._edge(A, a, C, i, i.length), i ? i.push(d, m) : i = [d, m];
      }
    if (i)
      a = C, C = this._edgecode(i[0], i[1]), a && C && this._edge(A, a, C, i, i.length);
    else if (this.contains(A, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2))
      return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];
    return i;
  }
  _clipSegment(A, e, t, i, n, o) {
    const g = n < o;
    for (g && ([A, e, t, i, n, o] = [t, i, A, e, o, n]); ; ) {
      if (n === 0 && o === 0)
        return g ? [t, i, A, e] : [A, e, t, i];
      if (n & o)
        return null;
      let s, I, r = n || o;
      r & 8 ? (s = A + (t - A) * (this.ymax - e) / (i - e), I = this.ymax) : r & 4 ? (s = A + (t - A) * (this.ymin - e) / (i - e), I = this.ymin) : r & 2 ? (I = e + (i - e) * (this.xmax - A) / (t - A), s = this.xmax) : (I = e + (i - e) * (this.xmin - A) / (t - A), s = this.xmin), n ? (A = s, e = I, n = this._regioncode(A, e)) : (t = s, i = I, o = this._regioncode(t, i));
    }
  }
  _clipInfinite(A, e, t, i, n, o) {
    let g = Array.from(e), s;
    if ((s = this._project(g[0], g[1], t, i)) && g.unshift(s[0], s[1]), (s = this._project(g[g.length - 2], g[g.length - 1], n, o)) && g.push(s[0], s[1]), g = this._clipFinite(A, g))
      for (let I = 0, r = g.length, a, C = this._edgecode(g[r - 2], g[r - 1]); I < r; I += 2)
        a = C, C = this._edgecode(g[I], g[I + 1]), a && C && (I = this._edge(A, a, C, g, I), r = g.length);
    else
      this.contains(A, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2) && (g = [this.xmin, this.ymin, this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax]);
    return g;
  }
  _edge(A, e, t, i, n) {
    for (; e !== t; ) {
      let o, g;
      switch (e) {
        case 5:
          e = 4;
          continue;
        case 4:
          e = 6, o = this.xmax, g = this.ymin;
          break;
        case 6:
          e = 2;
          continue;
        case 2:
          e = 10, o = this.xmax, g = this.ymax;
          break;
        case 10:
          e = 8;
          continue;
        case 8:
          e = 9, o = this.xmin, g = this.ymax;
          break;
        case 9:
          e = 1;
          continue;
        case 1:
          e = 5, o = this.xmin, g = this.ymin;
          break;
      }
      (i[n] !== o || i[n + 1] !== g) && this.contains(A, o, g) && (i.splice(n, 0, o, g), n += 2);
    }
    return n;
  }
  _project(A, e, t, i) {
    let n = 1 / 0, o, g, s;
    if (i < 0) {
      if (e <= this.ymin)
        return null;
      (o = (this.ymin - e) / i) < n && (s = this.ymin, g = A + (n = o) * t);
    } else if (i > 0) {
      if (e >= this.ymax)
        return null;
      (o = (this.ymax - e) / i) < n && (s = this.ymax, g = A + (n = o) * t);
    }
    if (t > 0) {
      if (A >= this.xmax)
        return null;
      (o = (this.xmax - A) / t) < n && (g = this.xmax, s = e + (n = o) * i);
    } else if (t < 0) {
      if (A <= this.xmin)
        return null;
      (o = (this.xmin - A) / t) < n && (g = this.xmin, s = e + (n = o) * i);
    }
    return [g, s];
  }
  _edgecode(A, e) {
    return (A === this.xmin ? 1 : A === this.xmax ? 2 : 0) | (e === this.ymin ? 4 : e === this.ymax ? 8 : 0);
  }
  _regioncode(A, e) {
    return (A < this.xmin ? 1 : A > this.xmax ? 2 : 0) | (e < this.ymin ? 4 : e > this.ymax ? 8 : 0);
  }
  _simplify(A) {
    if (A && A.length > 4) {
      for (let e = 0; e < A.length; e += 2) {
        const t = (e + 2) % A.length, i = (e + 4) % A.length;
        (A[e] === A[t] && A[t] === A[i] || A[e + 1] === A[t + 1] && A[t + 1] === A[i + 1]) && (A.splice(t, 2), e -= 2);
      }
      A.length || (A = null);
    }
    return A;
  }
};
const qSe = 2 * Math.PI, uy = Math.pow;
function OSe(A) {
  return A[0];
}
function jSe(A) {
  return A[1];
}
function PSe(A) {
  const { triangles: e, coords: t } = A;
  for (let i = 0; i < e.length; i += 3) {
    const n = 2 * e[i], o = 2 * e[i + 1], g = 2 * e[i + 2];
    if ((t[g] - t[n]) * (t[o + 1] - t[n + 1]) - (t[o] - t[n]) * (t[g + 1] - t[n + 1]) > 1e-10)
      return !1;
  }
  return !0;
}
function $Se(A, e, t) {
  return [A + Math.sin(A + e) * t, e + Math.cos(A - e) * t];
}
class gnA {
  static from(e, t = OSe, i = jSe, n) {
    return new gnA("length" in e ? AZe(e, t, i, n) : Float64Array.from(eZe(e, t, i, n)));
  }
  constructor(e) {
    this._delaunator = new EZ(e), this.inedges = new Int32Array(e.length / 2), this._hullIndex = new Int32Array(e.length / 2), this.points = this._delaunator.coords, this._init();
  }
  update() {
    return this._delaunator.update(), this._init(), this;
  }
  _init() {
    const e = this._delaunator, t = this.points;
    if (e.hull && e.hull.length > 2 && PSe(e)) {
      this.collinear = Int32Array.from({ length: t.length / 2 }, (B, l) => l).sort((B, l) => t[2 * B] - t[2 * l] || t[2 * B + 1] - t[2 * l + 1]);
      const I = this.collinear[0], r = this.collinear[this.collinear.length - 1], a = [t[2 * I], t[2 * I + 1], t[2 * r], t[2 * r + 1]], C = 1e-8 * Math.hypot(a[3] - a[1], a[2] - a[0]);
      for (let B = 0, l = t.length / 2; B < l; ++B) {
        const Q = $Se(t[2 * B], t[2 * B + 1], C);
        t[2 * B] = Q[0], t[2 * B + 1] = Q[1];
      }
      this._delaunator = new EZ(t);
    } else
      delete this.collinear;
    const i = this.halfedges = this._delaunator.halfedges, n = this.hull = this._delaunator.hull, o = this.triangles = this._delaunator.triangles, g = this.inedges.fill(-1), s = this._hullIndex.fill(-1);
    for (let I = 0, r = i.length; I < r; ++I) {
      const a = o[I % 3 === 2 ? I - 2 : I + 1];
      (i[I] === -1 || g[a] === -1) && (g[a] = I);
    }
    for (let I = 0, r = n.length; I < r; ++I)
      s[n[I]] = I;
    n.length <= 2 && n.length > 0 && (this.triangles = new Int32Array(3).fill(-1), this.halfedges = new Int32Array(3).fill(-1), this.triangles[0] = n[0], g[n[0]] = 1, n.length === 2 && (g[n[1]] = 0, this.triangles[1] = n[1], this.triangles[2] = n[1]));
  }
  voronoi(e) {
    return new _Se(this, e);
  }
  *neighbors(e) {
    const { inedges: t, hull: i, _hullIndex: n, halfedges: o, triangles: g, collinear: s } = this;
    if (s) {
      const C = s.indexOf(e);
      C > 0 && (yield s[C - 1]), C < s.length - 1 && (yield s[C + 1]);
      return;
    }
    const I = t[e];
    if (I === -1)
      return;
    let r = I, a = -1;
    do {
      if (yield a = g[r], r = r % 3 === 2 ? r - 2 : r + 1, g[r] !== e)
        return;
      if (r = o[r], r === -1) {
        const C = i[(n[e] + 1) % i.length];
        C !== a && (yield C);
        return;
      }
    } while (r !== I);
  }
  find(e, t, i = 0) {
    if (e = +e, e !== e || (t = +t, t !== t))
      return -1;
    const n = i;
    let o;
    for (; (o = this._step(i, e, t)) >= 0 && o !== i && o !== n; )
      i = o;
    return o;
  }
  _step(e, t, i) {
    const { inedges: n, hull: o, _hullIndex: g, halfedges: s, triangles: I, points: r } = this;
    if (n[e] === -1 || !r.length)
      return (e + 1) % (r.length >> 1);
    let a = e, C = uy(t - r[e * 2], 2) + uy(i - r[e * 2 + 1], 2);
    const B = n[e];
    let l = B;
    do {
      let Q = I[l];
      const E = uy(t - r[Q * 2], 2) + uy(i - r[Q * 2 + 1], 2);
      if (E < C && (C = E, a = Q), l = l % 3 === 2 ? l - 2 : l + 1, I[l] !== e)
        break;
      if (l = s[l], l === -1) {
        if (l = o[(g[e] + 1) % o.length], l !== Q && uy(t - r[l * 2], 2) + uy(i - r[l * 2 + 1], 2) < C)
          return l;
        break;
      }
    } while (l !== B);
    return a;
  }
  render(e) {
    const t = e == null ? e = new Qm() : void 0, { points: i, halfedges: n, triangles: o } = this;
    for (let g = 0, s = n.length; g < s; ++g) {
      const I = n[g];
      if (I < g)
        continue;
      const r = o[g] * 2, a = o[I] * 2;
      e.moveTo(i[r], i[r + 1]), e.lineTo(i[a], i[a + 1]);
    }
    return this.renderHull(e), t && t.value();
  }
  renderPoints(e, t) {
    t === void 0 && (!e || typeof e.moveTo != "function") && (t = e, e = null), t = t == null ? 2 : +t;
    const i = e == null ? e = new Qm() : void 0, { points: n } = this;
    for (let o = 0, g = n.length; o < g; o += 2) {
      const s = n[o], I = n[o + 1];
      e.moveTo(s + t, I), e.arc(s, I, t, 0, qSe);
    }
    return i && i.value();
  }
  renderHull(e) {
    const t = e == null ? e = new Qm() : void 0, { hull: i, points: n } = this, o = i[0] * 2, g = i.length;
    e.moveTo(n[o], n[o + 1]);
    for (let s = 1; s < g; ++s) {
      const I = 2 * i[s];
      e.lineTo(n[I], n[I + 1]);
    }
    return e.closePath(), t && t.value();
  }
  hullPolygon() {
    const e = new Xj();
    return this.renderHull(e), e.value();
  }
  renderTriangle(e, t) {
    const i = t == null ? t = new Qm() : void 0, { points: n, triangles: o } = this, g = o[e *= 3] * 2, s = o[e + 1] * 2, I = o[e + 2] * 2;
    return t.moveTo(n[g], n[g + 1]), t.lineTo(n[s], n[s + 1]), t.lineTo(n[I], n[I + 1]), t.closePath(), i && i.value();
  }
  *trianglePolygons() {
    const { triangles: e } = this;
    for (let t = 0, i = e.length / 3; t < i; ++t)
      yield this.trianglePolygon(t);
  }
  trianglePolygon(e) {
    const t = new Xj();
    return this.renderTriangle(e, t), t.value();
  }
}
function AZe(A, e, t, i) {
  const n = A.length, o = new Float64Array(n * 2);
  for (let g = 0; g < n; ++g) {
    const s = A[g];
    o[g * 2] = e.call(i, s, g, A), o[g * 2 + 1] = t.call(i, s, g, A);
  }
  return o;
}
function* eZe(A, e, t, i) {
  let n = 0;
  for (const o of A)
    yield e.call(i, o, n, A), yield t.call(i, o, n, A), ++n;
}
function snA(A) {
  FA.call(this, null, A);
}
snA.Definition = {
  type: "Voronoi",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "x",
    type: "field",
    required: !0
  }, {
    name: "y",
    type: "field",
    required: !0
  }, {
    name: "size",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "extent",
    type: "array",
    array: !0,
    length: 2,
    default: [[-1e5, -1e5], [1e5, 1e5]],
    content: {
      type: "number",
      array: !0,
      length: 2
    }
  }, {
    name: "as",
    type: "string",
    default: "path"
  }]
};
const tZe = [-1e5, -1e5, 1e5, 1e5];
Ae(snA, FA, {
  transform(A, e) {
    const t = A.as || "path", i = e.source;
    if (!i || !i.length)
      return e;
    let n = A.size;
    n = n ? [0, 0, n[0], n[1]] : (n = A.extent) ? [n[0][0], n[0][1], n[1][0], n[1][1]] : tZe;
    const o = this.value = gnA.from(i, A.x, A.y).voronoi(n);
    for (let g = 0, s = i.length; g < s; ++g) {
      const I = o.cellPolygon(g);
      i[g][t] = I && !nZe(I) ? iZe(I) : null;
    }
    return e.reflow(A.modified()).modifies(t);
  }
});
function iZe(A) {
  const e = A[0][0], t = A[0][1];
  let i = A.length - 1;
  for (; A[i][0] === e && A[i][1] === t; --i)
    ;
  return "M" + A.slice(0, i + 1).join("L") + "Z";
}
function nZe(A) {
  return A.length === 2 && A[0][0] === A[1][0] && A[0][1] === A[1][1];
}
const oZe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  voronoi: snA
}, Symbol.toStringTag, { value: "Module" }));
var zz = Math.PI / 180, LJ = 64, iv = 2048;
function gZe() {
  var A = [256, 256], e, t, i, n, o, g, s, I = cZA, r = [], a = Math.random, C = {};
  C.layout = function() {
    for (var Q = B(Ju()), E = BZe((A[0] >> 5) * A[1]), d = null, m = r.length, y = -1, f = [], w = r.map((R) => ({
      text: e(R),
      font: t(R),
      style: n(R),
      weight: o(R),
      rotate: g(R),
      size: ~~(i(R) + 1e-14),
      padding: s(R),
      xoff: 0,
      yoff: 0,
      x1: 0,
      y1: 0,
      x0: 0,
      y0: 0,
      hasText: !1,
      sprite: null,
      datum: R
    })).sort((R, F) => F.size - R.size); ++y < m; ) {
      var G = w[y];
      G.x = A[0] * (a() + 0.5) >> 1, G.y = A[1] * (a() + 0.5) >> 1, sZe(Q, G, w, y), G.hasText && l(E, G, d) && (f.push(G), d ? aZe(d, G) : d = [{
        x: G.x + G.x0,
        y: G.y + G.y0
      }, {
        x: G.x + G.x1,
        y: G.y + G.y1
      }], G.x -= A[0] >> 1, G.y -= A[1] >> 1);
    }
    return f;
  };
  function B(Q) {
    Q.width = Q.height = 1;
    var E = Math.sqrt(Q.getContext("2d").getImageData(0, 0, 1, 1).data.length >> 2);
    Q.width = (LJ << 5) / E, Q.height = iv / E;
    var d = Q.getContext("2d");
    return d.fillStyle = d.strokeStyle = "red", d.textAlign = "center", {
      context: d,
      ratio: E
    };
  }
  function l(Q, E, d) {
    for (var m = E.x, y = E.y, f = Math.sqrt(A[0] * A[0] + A[1] * A[1]), w = I(A), G = a() < 0.5 ? 1 : -1, R = -G, F, Z, c; (F = w(R += G)) && (Z = ~~F[0], c = ~~F[1], !(Math.min(Math.abs(Z), Math.abs(c)) >= f)); )
      if (E.x = m + Z, E.y = y + c, !(E.x + E.x0 < 0 || E.y + E.y0 < 0 || E.x + E.x1 > A[0] || E.y + E.y1 > A[1]) && (!d || !IZe(E, Q, A[0])) && (!d || rZe(E, d))) {
        for (var J = E.sprite, p = E.width >> 5, N = A[0] >> 5, v = E.x - (p << 4), K = v & 127, U = 32 - K, j = E.y1 - E.y0, q = (E.y + E.y0) * N + (v >> 5), O, $ = 0; $ < j; $++) {
          O = 0;
          for (var _ = 0; _ <= p; _++)
            Q[q + _] |= O << U | (_ < p ? (O = J[$ * p + _]) >>> K : 0);
          q += N;
        }
        return E.sprite = null, !0;
      }
    return !1;
  }
  return C.words = function(Q) {
    return arguments.length ? (r = Q, C) : r;
  }, C.size = function(Q) {
    return arguments.length ? (A = [+Q[0], +Q[1]], C) : A;
  }, C.font = function(Q) {
    return arguments.length ? (t = Dh(Q), C) : t;
  }, C.fontStyle = function(Q) {
    return arguments.length ? (n = Dh(Q), C) : n;
  }, C.fontWeight = function(Q) {
    return arguments.length ? (o = Dh(Q), C) : o;
  }, C.rotate = function(Q) {
    return arguments.length ? (g = Dh(Q), C) : g;
  }, C.text = function(Q) {
    return arguments.length ? (e = Dh(Q), C) : e;
  }, C.spiral = function(Q) {
    return arguments.length ? (I = lZe[Q] || Q, C) : I;
  }, C.fontSize = function(Q) {
    return arguments.length ? (i = Dh(Q), C) : i;
  }, C.padding = function(Q) {
    return arguments.length ? (s = Dh(Q), C) : s;
  }, C.random = function(Q) {
    return arguments.length ? (a = Q, C) : a;
  }, C;
}
function sZe(A, e, t, i) {
  if (!e.sprite) {
    var n = A.context, o = A.ratio;
    n.clearRect(0, 0, (LJ << 5) / o, iv / o);
    var g = 0, s = 0, I = 0, r = t.length, a, C, B, l, Q;
    for (--i; ++i < r; ) {
      if (e = t[i], n.save(), n.font = e.style + " " + e.weight + " " + ~~((e.size + 1) / o) + "px " + e.font, a = n.measureText(e.text + "m").width * o, B = e.size << 1, e.rotate) {
        var E = Math.sin(e.rotate * zz), d = Math.cos(e.rotate * zz), m = a * d, y = a * E, f = B * d, w = B * E;
        a = Math.max(Math.abs(m + w), Math.abs(m - w)) + 31 >> 5 << 5, B = ~~Math.max(Math.abs(y + f), Math.abs(y - f));
      } else
        a = a + 31 >> 5 << 5;
      if (B > I && (I = B), g + a >= LJ << 5 && (g = 0, s += I, I = 0), s + B >= iv)
        break;
      n.translate((g + (a >> 1)) / o, (s + (B >> 1)) / o), e.rotate && n.rotate(e.rotate * zz), n.fillText(e.text, 0, 0), e.padding && (n.lineWidth = 2 * e.padding, n.strokeText(e.text, 0, 0)), n.restore(), e.width = a, e.height = B, e.xoff = g, e.yoff = s, e.x1 = a >> 1, e.y1 = B >> 1, e.x0 = -e.x1, e.y0 = -e.y1, e.hasText = !0, g += a;
    }
    for (var G = n.getImageData(0, 0, (LJ << 5) / o, iv / o).data, R = []; --i >= 0; )
      if (e = t[i], !!e.hasText) {
        for (a = e.width, C = a >> 5, B = e.y1 - e.y0, l = 0; l < B * C; l++)
          R[l] = 0;
        if (g = e.xoff, g == null)
          return;
        s = e.yoff;
        var F = 0, Z = -1;
        for (Q = 0; Q < B; Q++) {
          for (l = 0; l < a; l++) {
            var c = C * Q + (l >> 5), J = G[(s + Q) * (LJ << 5) + (g + l) << 2] ? 1 << 31 - l % 32 : 0;
            R[c] |= J, F |= J;
          }
          F ? Z = Q : (e.y0++, B--, Q--, s++);
        }
        e.y1 = e.y0 + Z, e.sprite = R.slice(0, (e.y1 - e.y0) * C);
      }
  }
}
function IZe(A, e, t) {
  t >>= 5;
  for (var i = A.sprite, n = A.width >> 5, o = A.x - (n << 4), g = o & 127, s = 32 - g, I = A.y1 - A.y0, r = (A.y + A.y0) * t + (o >> 5), a, C = 0; C < I; C++) {
    a = 0;
    for (var B = 0; B <= n; B++)
      if ((a << s | (B < n ? (a = i[C * n + B]) >>> g : 0)) & e[r + B])
        return !0;
    r += t;
  }
  return !1;
}
function aZe(A, e) {
  var t = A[0], i = A[1];
  e.x + e.x0 < t.x && (t.x = e.x + e.x0), e.y + e.y0 < t.y && (t.y = e.y + e.y0), e.x + e.x1 > i.x && (i.x = e.x + e.x1), e.y + e.y1 > i.y && (i.y = e.y + e.y1);
}
function rZe(A, e) {
  return A.x + A.x1 > e[0].x && A.x + A.x0 < e[1].x && A.y + A.y1 > e[0].y && A.y + A.y0 < e[1].y;
}
function cZA(A) {
  var e = A[0] / A[1];
  return function(t) {
    return [e * (t *= 0.1) * Math.cos(t), t * Math.sin(t)];
  };
}
function CZe(A) {
  var e = 4, t = e * A[0] / A[1], i = 0, n = 0;
  return function(o) {
    var g = o < 0 ? -1 : 1;
    switch (Math.sqrt(1 + 4 * g * o) - g & 3) {
      case 0:
        i += t;
        break;
      case 1:
        n += e;
        break;
      case 2:
        i -= t;
        break;
      default:
        n -= e;
        break;
    }
    return [i, n];
  };
}
function BZe(A) {
  for (var e = [], t = -1; ++t < A; )
    e[t] = 0;
  return e;
}
function Dh(A) {
  return typeof A == "function" ? A : function() {
    return A;
  };
}
var lZe = {
  archimedean: cZA,
  rectangular: CZe
};
const QZA = ["x", "y", "font", "fontSize", "fontStyle", "fontWeight", "angle"], cZe = ["text", "font", "rotate", "fontSize", "fontStyle", "fontWeight"];
function InA(A) {
  FA.call(this, gZe(), A);
}
InA.Definition = {
  type: "Wordcloud",
  metadata: {
    modifies: !0
  },
  params: [{
    name: "size",
    type: "number",
    array: !0,
    length: 2
  }, {
    name: "font",
    type: "string",
    expr: !0,
    default: "sans-serif"
  }, {
    name: "fontStyle",
    type: "string",
    expr: !0,
    default: "normal"
  }, {
    name: "fontWeight",
    type: "string",
    expr: !0,
    default: "normal"
  }, {
    name: "fontSize",
    type: "number",
    expr: !0,
    default: 14
  }, {
    name: "fontSizeRange",
    type: "number",
    array: "nullable",
    default: [10, 50]
  }, {
    name: "rotate",
    type: "number",
    expr: !0,
    default: 0
  }, {
    name: "text",
    type: "field"
  }, {
    name: "spiral",
    type: "string",
    values: ["archimedean", "rectangular"]
  }, {
    name: "padding",
    type: "number",
    expr: !0
  }, {
    name: "as",
    type: "string",
    array: !0,
    length: 7,
    default: QZA
  }]
};
Ae(InA, FA, {
  transform(A, e) {
    A.size && !(A.size[0] && A.size[1]) && vA("Wordcloud size dimensions must be non-zero.");
    function t(Q) {
      const E = A[Q];
      return yt(E) && e.modified(E.fields);
    }
    const i = A.modified();
    if (!(i || e.changed(e.ADD_REM) || cZe.some(t)))
      return;
    const n = e.materialize(e.SOURCE).source, o = this.value, g = A.as || QZA;
    let s = A.fontSize || 14, I;
    if (yt(s) ? I = A.fontSizeRange : s = Yg(s), I) {
      const Q = s, E = ri("sqrt")().domain(sl(n, Q)).range(I);
      s = (d) => E(Q(d));
    }
    n.forEach((Q) => {
      Q[g[0]] = NaN, Q[g[1]] = NaN, Q[g[3]] = 0;
    });
    const r = o.words(n).text(A.text).size(A.size || [500, 500]).padding(A.padding || 1).spiral(A.spiral || "archimedean").rotate(A.rotate || 0).font(A.font || "sans-serif").fontStyle(A.fontStyle || "normal").fontWeight(A.fontWeight || "normal").fontSize(s).random(or).layout(), a = o.size(), C = a[0] >> 1, B = a[1] >> 1, l = r.length;
    for (let Q = 0, E, d; Q < l; ++Q)
      E = r[Q], d = E.datum, d[g[0]] = E.x + C, d[g[1]] = E.y + B, d[g[2]] = E.font, d[g[3]] = E.size, d[g[4]] = E.style, d[g[5]] = E.weight, d[g[6]] = E.rotate;
    return e.reflow(i).modifies(g);
  }
});
const QZe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  wordcloud: InA
}, Symbol.toStringTag, { value: "Module" })), EZe = (A) => new Uint8Array(A), uZe = (A) => new Uint16Array(A), kN = (A) => new Uint32Array(A);
function dZe() {
  let A = 8, e = [], t = kN(0), i = lx(0, A), n = lx(0, A);
  return {
    data: () => e,
    seen: () => t = hZe(t, e.length),
    add(o) {
      for (let g = 0, s = e.length, I = o.length, r; g < I; ++g)
        r = o[g], r._index = s++, e.push(r);
    },
    remove(o, g) {
      const s = e.length, I = Array(s - o), r = e;
      let a, C, B;
      for (C = 0; !g[C] && C < s; ++C)
        I[C] = e[C], r[C] = C;
      for (B = C; C < s; ++C)
        a = e[C], g[C] ? r[C] = -1 : (r[C] = B, i[B] = i[C], n[B] = n[C], I[B] = a, a._index = B++), i[C] = 0;
      return e = I, r;
    },
    size: () => e.length,
    curr: () => i,
    prev: () => n,
    reset: (o) => n[o] = i[o],
    all: () => A < 257 ? 255 : A < 65537 ? 65535 : 4294967295,
    set(o, g) {
      i[o] |= g;
    },
    clear(o, g) {
      i[o] &= ~g;
    },
    resize(o, g) {
      const s = i.length;
      (o > s || g > A) && (A = Math.max(g, A), i = lx(o, A, i), n = lx(o, A));
    }
  };
}
function hZe(A, e, t) {
  return A.length >= e ? A : (t = t || new A.constructor(e), t.set(A), t);
}
function lx(A, e, t) {
  const i = (e < 257 ? EZe : e < 65537 ? uZe : kN)(A);
  return t && i.set(t), i;
}
function odA(A, e, t) {
  const i = 1 << e;
  return {
    one: i,
    zero: ~i,
    range: t.slice(),
    bisect: A.bisect,
    index: A.index,
    size: A.size,
    onAdd(n, o) {
      const g = this, s = g.bisect(g.range, n.value), I = n.index, r = s[0], a = s[1], C = I.length;
      let B;
      for (B = 0; B < r; ++B)
        o[I[B]] |= i;
      for (B = a; B < C; ++B)
        o[I[B]] |= i;
      return g;
    }
  };
}
function gdA() {
  let A = kN(0), e = [], t = 0;
  function i(s, I, r) {
    if (!I.length)
      return [];
    const a = t, C = I.length, B = kN(C);
    let l = Array(C), Q, E, d;
    for (d = 0; d < C; ++d)
      l[d] = s(I[d]), B[d] = d;
    if (l = mZe(l, B), a)
      Q = e, E = A, e = Array(a + C), A = kN(a + C), pZe(r, Q, E, a, l, B, C, e, A);
    else {
      if (r > 0)
        for (d = 0; d < C; ++d)
          B[d] += r;
      e = l, A = B;
    }
    return t = a + C, {
      index: B,
      value: l
    };
  }
  function n(s, I) {
    const r = t;
    let a, C, B;
    for (C = 0; !I[A[C]] && C < r; ++C)
      ;
    for (B = C; C < r; ++C)
      I[a = A[C]] || (A[B] = a, e[B] = e[C], ++B);
    t = r - s;
  }
  function o(s) {
    for (let I = 0, r = t; I < r; ++I)
      A[I] = s[A[I]];
  }
  function g(s, I) {
    let r;
    return I ? r = I.length : (I = e, r = t), [ZDe(I, s[0], 0, r), iS(I, s[1], 0, r)];
  }
  return {
    insert: i,
    remove: n,
    bisect: g,
    reindex: o,
    index: () => A,
    size: () => t
  };
}
function mZe(A, e) {
  return A.sort.call(e, (t, i) => {
    const n = A[t], o = A[i];
    return n < o ? -1 : n > o ? 1 : 0;
  }), UDe(A, e);
}
function pZe(A, e, t, i, n, o, g, s, I) {
  let r = 0, a = 0, C;
  for (C = 0; r < i && a < g; ++C)
    e[r] < n[a] ? (s[C] = e[r], I[C] = t[r++]) : (s[C] = n[a], I[C] = o[a++] + A);
  for (; r < i; ++r, ++C)
    s[C] = e[r], I[C] = t[r];
  for (; a < g; ++a, ++C)
    s[C] = n[a], I[C] = o[a] + A;
}
function anA(A) {
  FA.call(this, dZe(), A), this._indices = null, this._dims = null;
}
anA.Definition = {
  type: "CrossFilter",
  metadata: {},
  params: [{
    name: "fields",
    type: "field",
    array: !0,
    required: !0
  }, {
    name: "query",
    type: "array",
    array: !0,
    required: !0,
    content: {
      type: "number",
      array: !0,
      length: 2
    }
  }]
};
Ae(anA, FA, {
  transform(A, e) {
    if (this._dims) {
      var t = A.modified("fields") || A.fields.some((i) => e.modified(i.fields));
      return t ? this.reinit(A, e) : this.eval(A, e);
    } else
      return this.init(A, e);
  },
  init(A, e) {
    const t = A.fields, i = A.query, n = this._indices = {}, o = this._dims = [], g = i.length;
    let s = 0, I, r;
    for (; s < g; ++s)
      I = t[s].fname, r = n[I] || (n[I] = gdA()), o.push(odA(r, s, i[s]));
    return this.eval(A, e);
  },
  reinit(A, e) {
    const t = e.materialize().fork(), i = A.fields, n = A.query, o = this._indices, g = this._dims, s = this.value, I = s.curr(), r = s.prev(), a = s.all(), C = t.rem = t.add, B = t.mod, l = n.length, Q = {};
    let E, d, m, y, f, w, G, R, F;
    if (r.set(I), e.rem.length && (f = this.remove(A, e, t)), e.add.length && s.add(e.add), e.mod.length)
      for (w = {}, y = e.mod, G = 0, R = y.length; G < R; ++G)
        w[y[G]._index] = 1;
    for (G = 0; G < l; ++G)
      F = i[G], (!g[G] || A.modified("fields", G) || e.modified(F.fields)) && (m = F.fname, (E = Q[m]) || (o[m] = d = gdA(), Q[m] = E = d.insert(F, e.source, 0)), g[G] = odA(d, G, n[G]).onAdd(E, I));
    for (G = 0, R = s.data().length; G < R; ++G)
      f[G] || (r[G] !== I[G] ? C.push(G) : w[G] && I[G] !== a && B.push(G));
    return s.mask = (1 << l) - 1, t;
  },
  eval(A, e) {
    const t = e.materialize().fork(), i = this._dims.length;
    let n = 0;
    return e.rem.length && (this.remove(A, e, t), n |= (1 << i) - 1), A.modified("query") && !A.modified("fields") && (n |= this.update(A, e, t)), e.add.length && (this.insert(A, e, t), n |= (1 << i) - 1), e.mod.length && (this.modify(e, t), n |= (1 << i) - 1), this.value.mask = n, t;
  },
  insert(A, e, t) {
    const i = e.add, n = this.value, o = this._dims, g = this._indices, s = A.fields, I = {}, r = t.add, a = n.size() + i.length, C = o.length;
    let B = n.size(), l, Q, E;
    n.resize(a, C), n.add(i);
    const d = n.curr(), m = n.prev(), y = n.all();
    for (l = 0; l < C; ++l)
      Q = s[l].fname, E = I[Q] || (I[Q] = g[Q].insert(s[l], i, B)), o[l].onAdd(E, d);
    for (; B < a; ++B)
      m[B] = y, d[B] !== y && r.push(B);
  },
  modify(A, e) {
    const t = e.mod, i = this.value, n = i.curr(), o = i.all(), g = A.mod;
    let s, I, r;
    for (s = 0, I = g.length; s < I; ++s)
      r = g[s]._index, n[r] !== o && t.push(r);
  },
  remove(A, e, t) {
    const i = this._indices, n = this.value, o = n.curr(), g = n.prev(), s = n.all(), I = {}, r = t.rem, a = e.rem;
    let C, B, l, Q;
    for (C = 0, B = a.length; C < B; ++C)
      l = a[C]._index, I[l] = 1, g[l] = Q = o[l], o[l] = s, Q !== s && r.push(l);
    for (l in i)
      i[l].remove(B, I);
    return this.reindex(e, B, I), I;
  },
  // reindex filters and indices after propagation completes
  reindex(A, e, t) {
    const i = this._indices, n = this.value;
    A.runAfter(() => {
      const o = n.remove(e, t);
      for (const g in i)
        i[g].reindex(o);
    });
  },
  update(A, e, t) {
    const i = this._dims, n = A.query, o = e.stamp, g = i.length;
    let s = 0, I, r;
    for (t.filters = 0, r = 0; r < g; ++r)
      A.modified("query", r) && (I = r, ++s);
    if (s === 1)
      s = i[I].one, this.incrementOne(i[I], n[I], t.add, t.rem);
    else
      for (r = 0, s = 0; r < g; ++r)
        A.modified("query", r) && (s |= i[r].one, this.incrementAll(i[r], n[r], o, t.add), t.rem = t.add);
    return s;
  },
  incrementAll(A, e, t, i) {
    const n = this.value, o = n.seen(), g = n.curr(), s = n.prev(), I = A.index(), r = A.bisect(A.range), a = A.bisect(e), C = a[0], B = a[1], l = r[0], Q = r[1], E = A.one;
    let d, m, y;
    if (C < l)
      for (d = C, m = Math.min(l, B); d < m; ++d)
        y = I[d], o[y] !== t && (s[y] = g[y], o[y] = t, i.push(y)), g[y] ^= E;
    else if (C > l)
      for (d = l, m = Math.min(C, Q); d < m; ++d)
        y = I[d], o[y] !== t && (s[y] = g[y], o[y] = t, i.push(y)), g[y] ^= E;
    if (B > Q)
      for (d = Math.max(C, Q), m = B; d < m; ++d)
        y = I[d], o[y] !== t && (s[y] = g[y], o[y] = t, i.push(y)), g[y] ^= E;
    else if (B < Q)
      for (d = Math.max(l, B), m = Q; d < m; ++d)
        y = I[d], o[y] !== t && (s[y] = g[y], o[y] = t, i.push(y)), g[y] ^= E;
    A.range = e.slice();
  },
  incrementOne(A, e, t, i) {
    const n = this.value, o = n.curr(), g = A.index(), s = A.bisect(A.range), I = A.bisect(e), r = I[0], a = I[1], C = s[0], B = s[1], l = A.one;
    let Q, E, d;
    if (r < C)
      for (Q = r, E = Math.min(C, a); Q < E; ++Q)
        d = g[Q], o[d] ^= l, t.push(d);
    else if (r > C)
      for (Q = C, E = Math.min(r, B); Q < E; ++Q)
        d = g[Q], o[d] ^= l, i.push(d);
    if (a > B)
      for (Q = Math.max(r, B), E = a; Q < E; ++Q)
        d = g[Q], o[d] ^= l, t.push(d);
    else if (a < B)
      for (Q = Math.max(C, a), E = B; Q < E; ++Q)
        d = g[Q], o[d] ^= l, i.push(d);
    A.range = e.slice();
  }
});
function rnA(A) {
  FA.call(this, null, A);
}
rnA.Definition = {
  type: "ResolveFilter",
  metadata: {},
  params: [{
    name: "ignore",
    type: "number",
    required: !0,
    description: "A bit mask indicating which filters to ignore."
  }, {
    name: "filter",
    type: "object",
    required: !0,
    description: "Per-tuple filter bitmaps from a CrossFilter transform."
  }]
};
Ae(rnA, FA, {
  transform(A, e) {
    const t = ~(A.ignore || 0), i = A.filter, n = i.mask;
    if (!(n & t))
      return e.StopPropagation;
    const o = e.fork(e.ALL), g = i.data(), s = i.curr(), I = i.prev(), r = (a) => s[a] & t ? null : g[a];
    return o.filter(o.MOD, r), n & n - 1 ? (o.filter(o.ADD, (a) => {
      const C = s[a] & t;
      return !C && C ^ I[a] & t ? g[a] : null;
    }), o.filter(o.REM, (a) => {
      const C = s[a] & t;
      return C && !(C ^ (C ^ I[a] & t)) ? g[a] : null;
    })) : (o.filter(o.ADD, r), o.filter(o.REM, (a) => (s[a] & t) === n ? g[a] : null)), o.filter(o.SOURCE, (a) => r(a._index));
  }
});
const yZe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  crossfilter: anA,
  resolvefilter: rnA
}, Symbol.toStringTag, { value: "Module" })), bZe = "RawCode", up = "Literal", wZe = "Property", fZe = "Identifier", DZe = "ArrayExpression", GZe = "BinaryExpression", EZA = "CallExpression", kZe = "ConditionalExpression", JZe = "LogicalExpression", NZe = "MemberExpression", YZe = "ObjectExpression", RZe = "UnaryExpression";
function kC(A) {
  this.type = A;
}
kC.prototype.visit = function(A) {
  let e, t, i;
  if (A(this))
    return 1;
  for (e = FZe(this), t = 0, i = e.length; t < i; ++t)
    if (e[t].visit(A))
      return 1;
};
function FZe(A) {
  switch (A.type) {
    case DZe:
      return A.elements;
    case GZe:
    case JZe:
      return [A.left, A.right];
    case EZA:
      return [A.callee].concat(A.arguments);
    case kZe:
      return [A.test, A.consequent, A.alternate];
    case NZe:
      return [A.object, A.property];
    case YZe:
      return A.properties;
    case wZe:
      return [A.key, A.value];
    case RZe:
      return [A.argument];
    case fZe:
    case up:
    case bZe:
    default:
      return [];
  }
}
var kl, fe, LA, Gg, ki, VU = 1, JF = 2, dp = 3, Kd = 4, XU = 5, r0 = 6, Gs = 7, NF = 8, MZe = 9;
kl = {};
kl[VU] = "Boolean";
kl[JF] = "<end>";
kl[dp] = "Identifier";
kl[Kd] = "Keyword";
kl[XU] = "Null";
kl[r0] = "Numeric";
kl[Gs] = "Punctuator";
kl[NF] = "String";
kl[MZe] = "RegularExpression";
var xZe = "ArrayExpression", LZe = "BinaryExpression", vZe = "CallExpression", HZe = "ConditionalExpression", uZA = "Identifier", SZe = "Literal", ZZe = "LogicalExpression", WZe = "MemberExpression", KZe = "ObjectExpression", UZe = "Property", VZe = "UnaryExpression", Ro = "Unexpected token %0", XZe = "Unexpected number", zZe = "Unexpected string", TZe = "Unexpected identifier", _Ze = "Unexpected reserved word", qZe = "Unexpected end of input", zj = "Invalid regular expression", Tz = "Invalid regular expression: missing /", dZA = "Octal literals are not allowed in strict mode.", OZe = "Duplicate data property in object literal not allowed in strict mode", Po = "ILLEGAL", s2 = "Disabled.", jZe = new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), PZe = new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");
function zU(A, e) {
  if (!A)
    throw new Error("ASSERT: " + e);
}
function pc(A) {
  return A >= 48 && A <= 57;
}
function CnA(A) {
  return "0123456789abcdefABCDEF".indexOf(A) >= 0;
}
function JN(A) {
  return "01234567".indexOf(A) >= 0;
}
function $Ze(A) {
  return A === 32 || A === 9 || A === 11 || A === 12 || A === 160 || A >= 5760 && [5760, 6158, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].indexOf(A) >= 0;
}
function I2(A) {
  return A === 10 || A === 13 || A === 8232 || A === 8233;
}
function YF(A) {
  return A === 36 || A === 95 || // $ (dollar) and _ (underscore)
  A >= 65 && A <= 90 || // A..Z
  A >= 97 && A <= 122 || // a..z
  A === 92 || // \ (backslash)
  A >= 128 && jZe.test(String.fromCharCode(A));
}
function uZ(A) {
  return A === 36 || A === 95 || // $ (dollar) and _ (underscore)
  A >= 65 && A <= 90 || // A..Z
  A >= 97 && A <= 122 || // a..z
  A >= 48 && A <= 57 || // 0..9
  A === 92 || // \ (backslash)
  A >= 128 && PZe.test(String.fromCharCode(A));
}
const AWe = {
  if: 1,
  in: 1,
  do: 1,
  var: 1,
  for: 1,
  new: 1,
  try: 1,
  let: 1,
  this: 1,
  else: 1,
  case: 1,
  void: 1,
  with: 1,
  enum: 1,
  while: 1,
  break: 1,
  catch: 1,
  throw: 1,
  const: 1,
  yield: 1,
  class: 1,
  super: 1,
  return: 1,
  typeof: 1,
  delete: 1,
  switch: 1,
  export: 1,
  import: 1,
  public: 1,
  static: 1,
  default: 1,
  finally: 1,
  extends: 1,
  package: 1,
  private: 1,
  function: 1,
  continue: 1,
  debugger: 1,
  interface: 1,
  protected: 1,
  instanceof: 1,
  implements: 1
};
function hZA() {
  for (; LA < Gg; ) {
    const A = fe.charCodeAt(LA);
    if ($Ze(A) || I2(A))
      ++LA;
    else
      break;
  }
}
function Tj(A) {
  var e, t, i, n = 0;
  for (t = A === "u" ? 4 : 2, e = 0; e < t; ++e)
    LA < Gg && CnA(fe[LA]) ? (i = fe[LA++], n = n * 16 + "0123456789abcdef".indexOf(i.toLowerCase())) : Ii({}, Ro, Po);
  return String.fromCharCode(n);
}
function eWe() {
  var A, e, t, i;
  for (A = fe[LA], e = 0, A === "}" && Ii({}, Ro, Po); LA < Gg && (A = fe[LA++], !!CnA(A)); )
    e = e * 16 + "0123456789abcdef".indexOf(A.toLowerCase());
  return (e > 1114111 || A !== "}") && Ii({}, Ro, Po), e <= 65535 ? String.fromCharCode(e) : (t = (e - 65536 >> 10) + 55296, i = (e - 65536 & 1023) + 56320, String.fromCharCode(t, i));
}
function mZA() {
  var A, e;
  for (A = fe.charCodeAt(LA++), e = String.fromCharCode(A), A === 92 && (fe.charCodeAt(LA) !== 117 && Ii({}, Ro, Po), ++LA, A = Tj("u"), (!A || A === "\\" || !YF(A.charCodeAt(0))) && Ii({}, Ro, Po), e = A); LA < Gg && (A = fe.charCodeAt(LA), !!uZ(A)); )
    ++LA, e += String.fromCharCode(A), A === 92 && (e = e.substr(0, e.length - 1), fe.charCodeAt(LA) !== 117 && Ii({}, Ro, Po), ++LA, A = Tj("u"), (!A || A === "\\" || !uZ(A.charCodeAt(0))) && Ii({}, Ro, Po), e += A);
  return e;
}
function tWe() {
  var A, e;
  for (A = LA++; LA < Gg; ) {
    if (e = fe.charCodeAt(LA), e === 92)
      return LA = A, mZA();
    if (uZ(e))
      ++LA;
    else
      break;
  }
  return fe.slice(A, LA);
}
function iWe() {
  var A, e, t;
  return A = LA, e = fe.charCodeAt(LA) === 92 ? mZA() : tWe(), e.length === 1 ? t = dp : AWe.hasOwnProperty(e) ? t = Kd : e === "null" ? t = XU : e === "true" || e === "false" ? t = VU : t = dp, {
    type: t,
    value: e,
    start: A,
    end: LA
  };
}
function _z() {
  var A = LA, e = fe.charCodeAt(LA), t, i = fe[LA], n, o, g;
  switch (e) {
    case 46:
    case 40:
    case 41:
    case 59:
    case 44:
    case 123:
    case 125:
    case 91:
    case 93:
    case 58:
    case 63:
    case 126:
      return ++LA, {
        type: Gs,
        value: String.fromCharCode(e),
        start: A,
        end: LA
      };
    default:
      if (t = fe.charCodeAt(LA + 1), t === 61)
        switch (e) {
          case 43:
          case 45:
          case 47:
          case 60:
          case 62:
          case 94:
          case 124:
          case 37:
          case 38:
          case 42:
            return LA += 2, {
              type: Gs,
              value: String.fromCharCode(e) + String.fromCharCode(t),
              start: A,
              end: LA
            };
          case 33:
          case 61:
            return LA += 2, fe.charCodeAt(LA) === 61 && ++LA, {
              type: Gs,
              value: fe.slice(A, LA),
              start: A,
              end: LA
            };
        }
  }
  if (g = fe.substr(LA, 4), g === ">>>=")
    return LA += 4, {
      type: Gs,
      value: g,
      start: A,
      end: LA
    };
  if (o = g.substr(0, 3), o === ">>>" || o === "<<=" || o === ">>=")
    return LA += 3, {
      type: Gs,
      value: o,
      start: A,
      end: LA
    };
  if (n = o.substr(0, 2), i === n[1] && "+-<>&|".indexOf(i) >= 0 || n === "=>")
    return LA += 2, {
      type: Gs,
      value: n,
      start: A,
      end: LA
    };
  if (n === "//" && Ii({}, Ro, Po), "<>=!+-*%&|^/".indexOf(i) >= 0)
    return ++LA, {
      type: Gs,
      value: i,
      start: A,
      end: LA
    };
  Ii({}, Ro, Po);
}
function nWe(A) {
  let e = "";
  for (; LA < Gg && CnA(fe[LA]); )
    e += fe[LA++];
  return e.length === 0 && Ii({}, Ro, Po), YF(fe.charCodeAt(LA)) && Ii({}, Ro, Po), {
    type: r0,
    value: parseInt("0x" + e, 16),
    start: A,
    end: LA
  };
}
function oWe(A) {
  let e = "0" + fe[LA++];
  for (; LA < Gg && JN(fe[LA]); )
    e += fe[LA++];
  return (YF(fe.charCodeAt(LA)) || pc(fe.charCodeAt(LA))) && Ii({}, Ro, Po), {
    type: r0,
    value: parseInt(e, 8),
    octal: !0,
    start: A,
    end: LA
  };
}
function sdA() {
  var A, e, t;
  if (t = fe[LA], zU(pc(t.charCodeAt(0)) || t === ".", "Numeric literal must start with a decimal digit or a decimal point"), e = LA, A = "", t !== ".") {
    if (A = fe[LA++], t = fe[LA], A === "0") {
      if (t === "x" || t === "X")
        return ++LA, nWe(e);
      if (JN(t))
        return oWe(e);
      t && pc(t.charCodeAt(0)) && Ii({}, Ro, Po);
    }
    for (; pc(fe.charCodeAt(LA)); )
      A += fe[LA++];
    t = fe[LA];
  }
  if (t === ".") {
    for (A += fe[LA++]; pc(fe.charCodeAt(LA)); )
      A += fe[LA++];
    t = fe[LA];
  }
  if (t === "e" || t === "E")
    if (A += fe[LA++], t = fe[LA], (t === "+" || t === "-") && (A += fe[LA++]), pc(fe.charCodeAt(LA)))
      for (; pc(fe.charCodeAt(LA)); )
        A += fe[LA++];
    else
      Ii({}, Ro, Po);
  return YF(fe.charCodeAt(LA)) && Ii({}, Ro, Po), {
    type: r0,
    value: parseFloat(A),
    start: e,
    end: LA
  };
}
function gWe() {
  var A = "", e, t, i, n, o = !1;
  for (e = fe[LA], zU(e === "'" || e === '"', "String literal must starts with a quote"), t = LA, ++LA; LA < Gg; )
    if (i = fe[LA++], i === e) {
      e = "";
      break;
    } else if (i === "\\")
      if (i = fe[LA++], !i || !I2(i.charCodeAt(0)))
        switch (i) {
          case "u":
          case "x":
            fe[LA] === "{" ? (++LA, A += eWe()) : A += Tj(i);
            break;
          case "n":
            A += `
`;
            break;
          case "r":
            A += "\r";
            break;
          case "t":
            A += "	";
            break;
          case "b":
            A += "\b";
            break;
          case "f":
            A += "\f";
            break;
          case "v":
            A += "\v";
            break;
          default:
            JN(i) ? (n = "01234567".indexOf(i), n !== 0 && (o = !0), LA < Gg && JN(fe[LA]) && (o = !0, n = n * 8 + "01234567".indexOf(fe[LA++]), "0123".indexOf(i) >= 0 && LA < Gg && JN(fe[LA]) && (n = n * 8 + "01234567".indexOf(fe[LA++]))), A += String.fromCharCode(n)) : A += i;
            break;
        }
      else
        i === "\r" && fe[LA] === `
` && ++LA;
    else {
      if (I2(i.charCodeAt(0)))
        break;
      A += i;
    }
  return e !== "" && Ii({}, Ro, Po), {
    type: NF,
    value: A,
    octal: o,
    start: t,
    end: LA
  };
}
function sWe(A, e) {
  let t = A;
  e.indexOf("u") >= 0 && (t = t.replace(/\\u\{([0-9a-fA-F]+)\}/g, (i, n) => {
    if (parseInt(n, 16) <= 1114111)
      return "x";
    Ii({}, zj);
  }).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x"));
  try {
    new RegExp(t);
  } catch {
    Ii({}, zj);
  }
  try {
    return new RegExp(A, e);
  } catch {
    return null;
  }
}
function IWe() {
  var A, e, t, i, n;
  for (A = fe[LA], zU(A === "/", "Regular expression literal must start with a slash"), e = fe[LA++], t = !1, i = !1; LA < Gg; )
    if (A = fe[LA++], e += A, A === "\\")
      A = fe[LA++], I2(A.charCodeAt(0)) && Ii({}, Tz), e += A;
    else if (I2(A.charCodeAt(0)))
      Ii({}, Tz);
    else if (t)
      A === "]" && (t = !1);
    else if (A === "/") {
      i = !0;
      break;
    } else
      A === "[" && (t = !0);
  return i || Ii({}, Tz), n = e.substr(1, e.length - 2), {
    value: n,
    literal: e
  };
}
function aWe() {
  var A, e, t;
  for (e = "", t = ""; LA < Gg && (A = fe[LA], !!uZ(A.charCodeAt(0))); )
    ++LA, A === "\\" && LA < Gg ? Ii({}, Ro, Po) : (t += A, e += A);
  return t.search(/[^gimuy]/g) >= 0 && Ii({}, zj, t), {
    value: t,
    literal: e
  };
}
function rWe() {
  var A, e, t, i;
  return ki = null, hZA(), A = LA, e = IWe(), t = aWe(), i = sWe(e.value, t.value), {
    literal: e.literal + t.literal,
    value: i,
    regex: {
      pattern: e.value,
      flags: t.value
    },
    start: A,
    end: LA
  };
}
function CWe(A) {
  return A.type === dp || A.type === Kd || A.type === VU || A.type === XU;
}
function pZA() {
  if (hZA(), LA >= Gg)
    return {
      type: JF,
      start: LA,
      end: LA
    };
  const A = fe.charCodeAt(LA);
  return YF(A) ? iWe() : A === 40 || A === 41 || A === 59 ? _z() : A === 39 || A === 34 ? gWe() : A === 46 ? pc(fe.charCodeAt(LA + 1)) ? sdA() : _z() : pc(A) ? sdA() : _z();
}
function xs() {
  const A = ki;
  return LA = A.end, ki = pZA(), LA = A.end, A;
}
function yZA() {
  const A = LA;
  ki = pZA(), LA = A;
}
function BWe(A) {
  const e = new kC(xZe);
  return e.elements = A, e;
}
function IdA(A, e, t) {
  const i = new kC(A === "||" || A === "&&" ? ZZe : LZe);
  return i.operator = A, i.left = e, i.right = t, i;
}
function lWe(A, e) {
  const t = new kC(vZe);
  return t.callee = A, t.arguments = e, t;
}
function cWe(A, e, t) {
  const i = new kC(HZe);
  return i.test = A, i.consequent = e, i.alternate = t, i;
}
function BnA(A) {
  const e = new kC(uZA);
  return e.name = A, e;
}
function vJ(A) {
  const e = new kC(SZe);
  return e.value = A.value, e.raw = fe.slice(A.start, A.end), A.regex && (e.raw === "//" && (e.raw = "/(?:)/"), e.regex = A.regex), e;
}
function adA(A, e, t) {
  const i = new kC(WZe);
  return i.computed = A === "[", i.object = e, i.property = t, i.computed || (t.member = !0), i;
}
function QWe(A) {
  const e = new kC(KZe);
  return e.properties = A, e;
}
function rdA(A, e, t) {
  const i = new kC(UZe);
  return i.key = e, i.value = t, i.kind = A, i;
}
function EWe(A, e) {
  const t = new kC(VZe);
  return t.operator = A, t.argument = e, t.prefix = !0, t;
}
function Ii(A, e) {
  var t, i = Array.prototype.slice.call(arguments, 2), n = e.replace(/%(\d)/g, (o, g) => (zU(g < i.length, "Message reference must be in range"), i[g]));
  throw t = new Error(n), t.index = LA, t.description = n, t;
}
function TU(A) {
  A.type === JF && Ii(A, qZe), A.type === r0 && Ii(A, XZe), A.type === NF && Ii(A, zZe), A.type === dp && Ii(A, TZe), A.type === Kd && Ii(A, _Ze), Ii(A, Ro, A.value);
}
function kg(A) {
  const e = xs();
  (e.type !== Gs || e.value !== A) && TU(e);
}
function gn(A) {
  return ki.type === Gs && ki.value === A;
}
function qz(A) {
  return ki.type === Kd && ki.value === A;
}
function uWe() {
  const A = [];
  for (LA = ki.start, kg("["); !gn("]"); )
    gn(",") ? (xs(), A.push(null)) : (A.push(hp()), gn("]") || kg(","));
  return xs(), BWe(A);
}
function CdA() {
  LA = ki.start;
  const A = xs();
  return A.type === NF || A.type === r0 ? (A.octal && Ii(A, dZA), vJ(A)) : BnA(A.value);
}
function dWe() {
  var A, e, t, i;
  if (LA = ki.start, A = ki, A.type === dp)
    return t = CdA(), kg(":"), i = hp(), rdA("init", t, i);
  if (A.type === JF || A.type === Gs)
    TU(A);
  else
    return e = CdA(), kg(":"), i = hp(), rdA("init", e, i);
}
function hWe() {
  var A = [], e, t, i, n = {}, o = String;
  for (LA = ki.start, kg("{"); !gn("}"); )
    e = dWe(), e.key.type === uZA ? t = e.key.name : t = o(e.key.value), i = "$" + t, Object.prototype.hasOwnProperty.call(n, i) ? Ii({}, OZe) : n[i] = !0, A.push(e), gn("}") || kg(",");
  return kg("}"), QWe(A);
}
function mWe() {
  kg("(");
  const A = lnA();
  return kg(")"), A;
}
const pWe = {
  if: 1
};
function yWe() {
  var A, e, t;
  if (gn("("))
    return mWe();
  if (gn("["))
    return uWe();
  if (gn("{"))
    return hWe();
  if (A = ki.type, LA = ki.start, A === dp || pWe[ki.value])
    t = BnA(xs().value);
  else if (A === NF || A === r0)
    ki.octal && Ii(ki, dZA), t = vJ(xs());
  else {
    if (A === Kd)
      throw new Error(s2);
    A === VU ? (e = xs(), e.value = e.value === "true", t = vJ(e)) : A === XU ? (e = xs(), e.value = null, t = vJ(e)) : gn("/") || gn("/=") ? (t = vJ(rWe()), yZA()) : TU(xs());
  }
  return t;
}
function bWe() {
  const A = [];
  if (kg("("), !gn(")"))
    for (; LA < Gg && (A.push(hp()), !gn(")")); )
      kg(",");
  return kg(")"), A;
}
function wWe() {
  LA = ki.start;
  const A = xs();
  return CWe(A) || TU(A), BnA(A.value);
}
function fWe() {
  return kg("."), wWe();
}
function DWe() {
  kg("[");
  const A = lnA();
  return kg("]"), A;
}
function GWe() {
  var A, e, t;
  for (A = yWe(); ; )
    if (gn("."))
      t = fWe(), A = adA(".", A, t);
    else if (gn("("))
      e = bWe(), A = lWe(A, e);
    else if (gn("["))
      t = DWe(), A = adA("[", A, t);
    else
      break;
  return A;
}
function BdA() {
  const A = GWe();
  if (ki.type === Gs && (gn("++") || gn("--")))
    throw new Error(s2);
  return A;
}
function nv() {
  var A, e;
  if (ki.type !== Gs && ki.type !== Kd)
    e = BdA();
  else {
    if (gn("++") || gn("--"))
      throw new Error(s2);
    if (gn("+") || gn("-") || gn("~") || gn("!"))
      A = xs(), e = nv(), e = EWe(A.value, e);
    else {
      if (qz("delete") || qz("void") || qz("typeof"))
        throw new Error(s2);
      e = BdA();
    }
  }
  return e;
}
function ldA(A) {
  let e = 0;
  if (A.type !== Gs && A.type !== Kd)
    return 0;
  switch (A.value) {
    case "||":
      e = 1;
      break;
    case "&&":
      e = 2;
      break;
    case "|":
      e = 3;
      break;
    case "^":
      e = 4;
      break;
    case "&":
      e = 5;
      break;
    case "==":
    case "!=":
    case "===":
    case "!==":
      e = 6;
      break;
    case "<":
    case ">":
    case "<=":
    case ">=":
    case "instanceof":
    case "in":
      e = 7;
      break;
    case "<<":
    case ">>":
    case ">>>":
      e = 8;
      break;
    case "+":
    case "-":
      e = 9;
      break;
    case "*":
    case "/":
    case "%":
      e = 11;
      break;
  }
  return e;
}
function kWe() {
  var A, e, t, i, n, o, g, s, I, r;
  if (A = ki, I = nv(), i = ki, n = ldA(i), n === 0)
    return I;
  for (i.prec = n, xs(), e = [A, ki], g = nv(), o = [I, i, g]; (n = ldA(ki)) > 0; ) {
    for (; o.length > 2 && n <= o[o.length - 2].prec; )
      g = o.pop(), s = o.pop().value, I = o.pop(), e.pop(), t = IdA(s, I, g), o.push(t);
    i = xs(), i.prec = n, o.push(i), e.push(ki), t = nv(), o.push(t);
  }
  for (r = o.length - 1, t = o[r], e.pop(); r > 1; )
    e.pop(), t = IdA(o[r - 1].value, o[r - 2], t), r -= 2;
  return t;
}
function hp() {
  var A, e, t;
  return A = kWe(), gn("?") && (xs(), e = hp(), kg(":"), t = hp(), A = cWe(A, e, t)), A;
}
function lnA() {
  const A = hp();
  if (gn(","))
    throw new Error(s2);
  return A;
}
function cnA(A) {
  fe = A, LA = 0, Gg = fe.length, ki = null, yZA();
  const e = lnA();
  if (ki.type !== JF)
    throw new Error("Unexpect token after expression.");
  return e;
}
var bZA = {
  NaN: "NaN",
  E: "Math.E",
  LN2: "Math.LN2",
  LN10: "Math.LN10",
  LOG2E: "Math.LOG2E",
  LOG10E: "Math.LOG10E",
  PI: "Math.PI",
  SQRT1_2: "Math.SQRT1_2",
  SQRT2: "Math.SQRT2",
  MIN_VALUE: "Number.MIN_VALUE",
  MAX_VALUE: "Number.MAX_VALUE"
};
function wZA(A) {
  function e(g, s, I, r) {
    let a = A(s[0]);
    return I && (a = I + "(" + a + ")", I.lastIndexOf("new ", 0) === 0 && (a = "(" + a + ")")), a + "." + g + (r < 0 ? "" : r === 0 ? "()" : "(" + s.slice(1).map(A).join(",") + ")");
  }
  function t(g, s, I) {
    return (r) => e(g, r, s, I);
  }
  const i = "new Date", n = "String", o = "RegExp";
  return {
    // MATH functions
    isNaN: "Number.isNaN",
    isFinite: "Number.isFinite",
    abs: "Math.abs",
    acos: "Math.acos",
    asin: "Math.asin",
    atan: "Math.atan",
    atan2: "Math.atan2",
    ceil: "Math.ceil",
    cos: "Math.cos",
    exp: "Math.exp",
    floor: "Math.floor",
    hypot: "Math.hypot",
    log: "Math.log",
    max: "Math.max",
    min: "Math.min",
    pow: "Math.pow",
    random: "Math.random",
    round: "Math.round",
    sin: "Math.sin",
    sqrt: "Math.sqrt",
    tan: "Math.tan",
    clamp: function(g) {
      g.length < 3 && vA("Missing arguments to clamp function."), g.length > 3 && vA("Too many arguments to clamp function.");
      const s = g.map(A);
      return "Math.max(" + s[1] + ", Math.min(" + s[2] + "," + s[0] + "))";
    },
    // DATE functions
    now: "Date.now",
    utc: "Date.UTC",
    datetime: i,
    date: t("getDate", i, 0),
    day: t("getDay", i, 0),
    year: t("getFullYear", i, 0),
    month: t("getMonth", i, 0),
    hours: t("getHours", i, 0),
    minutes: t("getMinutes", i, 0),
    seconds: t("getSeconds", i, 0),
    milliseconds: t("getMilliseconds", i, 0),
    time: t("getTime", i, 0),
    timezoneoffset: t("getTimezoneOffset", i, 0),
    utcdate: t("getUTCDate", i, 0),
    utcday: t("getUTCDay", i, 0),
    utcyear: t("getUTCFullYear", i, 0),
    utcmonth: t("getUTCMonth", i, 0),
    utchours: t("getUTCHours", i, 0),
    utcminutes: t("getUTCMinutes", i, 0),
    utcseconds: t("getUTCSeconds", i, 0),
    utcmilliseconds: t("getUTCMilliseconds", i, 0),
    // sequence functions
    length: t("length", null, -1),
    // STRING functions
    parseFloat: "parseFloat",
    parseInt: "parseInt",
    upper: t("toUpperCase", n, 0),
    lower: t("toLowerCase", n, 0),
    substring: t("substring", n),
    split: t("split", n),
    trim: t("trim", n, 0),
    // REGEXP functions
    regexp: o,
    test: t("test", o),
    // Control Flow functions
    if: function(g) {
      g.length < 3 && vA("Missing arguments to if function."), g.length > 3 && vA("Too many arguments to if function.");
      const s = g.map(A);
      return "(" + s[0] + "?" + s[1] + ":" + s[2] + ")";
    }
  };
}
function JWe(A) {
  const e = A && A.length - 1;
  return e && (A[0] === '"' && A[e] === '"' || A[0] === "'" && A[e] === "'") ? A.slice(1, -1) : A;
}
function fZA(A) {
  A = A || {};
  const e = A.allowed ? mC(A.allowed) : {}, t = A.forbidden ? mC(A.forbidden) : {}, i = A.constants || bZA, n = (A.functions || wZA)(C), o = A.globalvar, g = A.fieldvar, s = yt(o) ? o : (Q) => `${o}["${Q}"]`;
  let I = {}, r = {}, a = 0;
  function C(Q) {
    if (Be(Q))
      return Q;
    const E = B[Q.type];
    return E == null && vA("Unsupported type: " + Q.type), E(Q);
  }
  const B = {
    Literal: (Q) => Q.raw,
    Identifier: (Q) => {
      const E = Q.name;
      return a > 0 ? E : Ze(t, E) ? vA("Illegal identifier: " + E) : Ze(i, E) ? i[E] : Ze(e, E) ? E : (I[E] = 1, s(E));
    },
    MemberExpression: (Q) => {
      const E = !Q.computed, d = C(Q.object);
      E && (a += 1);
      const m = C(Q.property);
      return d === g && (r[JWe(m)] = 1), E && (a -= 1), d + (E ? "." + m : "[" + m + "]");
    },
    CallExpression: (Q) => {
      Q.callee.type !== "Identifier" && vA("Illegal callee type: " + Q.callee.type);
      const E = Q.callee.name, d = Q.arguments, m = Ze(n, E) && n[E];
      return m || vA("Unrecognized function: " + E), yt(m) ? m(d) : m + "(" + d.map(C).join(",") + ")";
    },
    ArrayExpression: (Q) => "[" + Q.elements.map(C).join(",") + "]",
    BinaryExpression: (Q) => "(" + C(Q.left) + " " + Q.operator + " " + C(Q.right) + ")",
    UnaryExpression: (Q) => "(" + Q.operator + C(Q.argument) + ")",
    ConditionalExpression: (Q) => "(" + C(Q.test) + "?" + C(Q.consequent) + ":" + C(Q.alternate) + ")",
    LogicalExpression: (Q) => "(" + C(Q.left) + Q.operator + C(Q.right) + ")",
    ObjectExpression: (Q) => "{" + Q.properties.map(C).join(",") + "}",
    Property: (Q) => {
      a += 1;
      const E = C(Q.key);
      return a -= 1, E + ":" + C(Q.value);
    }
  };
  function l(Q) {
    const E = {
      code: C(Q),
      globals: Object.keys(I),
      fields: Object.keys(r)
    };
    return I = {}, r = {}, E;
  }
  return l.functions = n, l.constants = i, l;
}
const cdA = Symbol("vega_selection_getter");
function DZA(A) {
  return (!A.getter || !A.getter[cdA]) && (A.getter = tr(A.field), A.getter[cdA] = !0), A.getter;
}
const QnA = "intersect", QdA = "union", NWe = "vlMulti", YWe = "vlPoint", EdA = "or", RWe = "and", BB = "_vgsid_", a2 = tr(BB), FWe = "E", MWe = "R", xWe = "R-E", LWe = "R-LE", vWe = "R-RE", dZ = "index:unit";
function udA(A, e) {
  for (var t = e.fields, i = e.values, n = t.length, o = 0, g, s; o < n; ++o)
    if (s = t[o], g = DZA(s)(A), Gu(g) && (g = yg(g)), Gu(i[o]) && (i[o] = yg(i[o])), ZA(i[o]) && Gu(i[o][0]) && (i[o] = i[o].map(yg)), s.type === FWe) {
      if (ZA(i[o]) ? i[o].indexOf(g) < 0 : g !== i[o])
        return !1;
    } else if (s.type === MWe) {
      if (!Hb(g, i[o]))
        return !1;
    } else if (s.type === vWe) {
      if (!Hb(g, i[o], !0, !1))
        return !1;
    } else if (s.type === xWe) {
      if (!Hb(g, i[o], !1, !1))
        return !1;
    } else if (s.type === LWe && !Hb(g, i[o], !1, !0))
      return !1;
  return !0;
}
function HWe(A, e, t) {
  for (var i = this.context.data[A], n = i ? i.values.value : [], o = i ? i[dZ] && i[dZ].value : void 0, g = t === QnA, s = n.length, I = 0, r, a, C, B, l; I < s; ++I)
    if (r = n[I], o && g) {
      if (a = a || {}, C = a[B = r.unit] || 0, C === -1)
        continue;
      if (l = udA(e, r), a[B] = l ? -1 : ++C, l && o.size === 1)
        return !0;
      if (!l && C === o.get(B).count)
        return !1;
    } else if (l = udA(e, r), g ^ l)
      return l;
  return s && g;
}
const GZA = ZD(a2), SWe = GZA.left, ZWe = GZA.right;
function WWe(A, e, t) {
  const i = this.context.data[A], n = i ? i.values.value : [], o = i ? i[dZ] && i[dZ].value : void 0, g = t === QnA, s = a2(e), I = SWe(n, s);
  if (I === n.length || a2(n[I]) !== s)
    return !1;
  if (o && g) {
    if (o.size === 1)
      return !0;
    if (ZWe(n, s) - I < o.size)
      return !1;
  }
  return !0;
}
function KWe(A, e) {
  return A.map((t) => pt(e.fields ? {
    values: e.fields.map((i) => DZA(i)(t.datum))
  } : {
    [BB]: a2(t.datum)
  }, e));
}
function UWe(A, e, t, i) {
  for (var n = this.context.data[A], o = n ? n.values.value : [], g = {}, s = {}, I = {}, r, a, C, B, l, Q, E, d, m, y, f = o.length, w = 0, G, R; w < f; ++w)
    if (r = o[w], B = r.unit, a = r.fields, C = r.values, a && C) {
      for (G = 0, R = a.length; G < R; ++G)
        l = a[G], E = g[l.field] || (g[l.field] = {}), d = E[B] || (E[B] = []), I[l.field] = m = l.type.charAt(0), y = Oz[`${m}_union`], E[B] = y(d, Ce(C[G]));
      t && (d = s[B] || (s[B] = []), d.push(Ce(C).reduce((F, Z, c) => (F[a[c].field] = Z, F), {})));
    } else
      l = BB, Q = a2(r), E = g[l] || (g[l] = {}), d = E[B] || (E[B] = []), d.push(Q), t && (d = s[B] || (s[B] = []), d.push({
        [BB]: Q
      }));
  if (e = e || QdA, g[BB] ? g[BB] = Oz[`${BB}_${e}`](...Object.values(g[BB])) : Object.keys(g).forEach((F) => {
    g[F] = Object.keys(g[F]).map((Z) => g[F][Z]).reduce((Z, c) => Z === void 0 ? c : Oz[`${I[F]}_${e}`](Z, c));
  }), o = Object.keys(s), t && o.length) {
    const F = i ? YWe : NWe;
    g[F] = e === QdA ? {
      [EdA]: o.reduce((Z, c) => (Z.push(...s[c]), Z), [])
    } : {
      [RWe]: o.map((Z) => ({
        [EdA]: s[Z]
      }))
    };
  }
  return g;
}
var Oz = {
  [`${BB}_union`]: PDe,
  [`${BB}_intersect`]: ODe,
  E_union: function(A, e) {
    if (!A.length)
      return e;
    for (var t = 0, i = e.length; t < i; ++t)
      A.indexOf(e[t]) < 0 && A.push(e[t]);
    return A;
  },
  E_intersect: function(A, e) {
    return A.length ? A.filter((t) => e.indexOf(t) >= 0) : e;
  },
  R_union: function(A, e) {
    var t = yg(e[0]), i = yg(e[1]);
    return t > i && (t = e[1], i = e[0]), A.length ? (A[0] > t && (A[0] = t), A[1] < i && (A[1] = i), A) : [t, i];
  },
  R_intersect: function(A, e) {
    var t = yg(e[0]), i = yg(e[1]);
    return t > i && (t = e[1], i = e[0]), A.length ? i < A[0] || A[1] < t ? [] : (A[0] < t && (A[0] = t), A[1] > i && (A[1] = i), A) : [t, i];
  }
};
const VWe = ":", XWe = "@";
function EnA(A, e, t, i) {
  e[0].type !== up && vA("First argument to selection functions must be a string literal.");
  const n = e[0].value, o = e.length >= 2 && Xt(e).value, g = "unit", s = XWe + g, I = VWe + n;
  o === QnA && !Ze(i, s) && (i[s] = t.getData(n).indataRef(t, g)), Ze(i, I) || (i[I] = t.getData(n).tuplesRef());
}
function kZA(A) {
  const e = this.context.data[A];
  return e ? e.values.value : [];
}
function zWe(A, e, t) {
  const i = this.context.data[A]["index:" + e], n = i ? i.value.get(t) : void 0;
  return n && n.count;
}
function TWe(A, e) {
  const t = this.context.dataflow, i = this.context.data[A], n = i.input;
  return t.pulse(n, t.changeset().remove(ir).insert(e)), 1;
}
function _We(A, e, t) {
  if (A) {
    const i = this.context.dataflow, n = A.mark.source;
    i.pulse(n, i.changeset().encode(A, e));
  }
  return t !== void 0 ? t : A;
}
const RF = (A) => function(e, t) {
  return this.context.dataflow.locale()[A](t)(e);
}, qWe = RF("format"), JZA = RF("timeFormat"), OWe = RF("utcFormat"), jWe = RF("timeParse"), PWe = RF("utcParse"), cx = new Date(2e3, 0, 1);
function _U(A, e, t) {
  return !Number.isInteger(A) || !Number.isInteger(e) ? "" : (cx.setYear(2e3), cx.setMonth(A), cx.setDate(e), JZA.call(this, cx, t));
}
function $We(A) {
  return _U.call(this, A, 1, "%B");
}
function AKe(A) {
  return _U.call(this, A, 1, "%b");
}
function eKe(A) {
  return _U.call(this, 0, 2 + A, "%A");
}
function tKe(A) {
  return _U.call(this, 0, 2 + A, "%a");
}
const iKe = ":", nKe = "@", _j = "%", NZA = "$";
function unA(A, e, t, i) {
  e[0].type !== up && vA("First argument to data functions must be a string literal.");
  const n = e[0].value, o = iKe + n;
  if (!Ze(o, i))
    try {
      i[o] = t.getData(n).tuplesRef();
    } catch {
    }
}
function oKe(A, e, t, i) {
  e[0].type !== up && vA("First argument to indata must be a string literal."), e[1].type !== up && vA("Second argument to indata must be a string literal.");
  const n = e[0].value, o = e[1].value, g = nKe + o;
  Ze(g, i) || (i[g] = t.getData(n).indataRef(t, o));
}
function ss(A, e, t, i) {
  if (e[0].type === up)
    ddA(t, i, e[0].value);
  else
    for (A in t.scales)
      ddA(t, i, A);
}
function ddA(A, e, t) {
  const i = _j + t;
  if (!Ze(e, i))
    try {
      e[i] = A.scaleRef(t);
    } catch {
    }
}
function Jl(A, e) {
  if (yt(A))
    return A;
  if (Be(A)) {
    const t = e.scales[A];
    return t && cRe(t.value) ? t.value : void 0;
  }
}
function gKe(A, e, t) {
  e.__bandwidth = (n) => n && n.bandwidth ? n.bandwidth() : 0, t._bandwidth = ss, t._range = ss, t._scale = ss;
  const i = (n) => "_[" + (n.type === up ? ie(_j + n.value) : ie(_j) + "+" + A(n)) + "]";
  return {
    _bandwidth: (n) => `this.__bandwidth(${i(n[0])})`,
    _range: (n) => `${i(n[0])}.range()`,
    _scale: (n) => `${i(n[0])}(${A(n[1])})`
  };
}
function dnA(A, e) {
  return function(t, i, n) {
    if (t) {
      const o = Jl(t, (n || this).context);
      return o && o.path[A](i);
    } else
      return e(i);
  };
}
const sKe = dnA("area", Nxe), IKe = dnA("bounds", Mxe), aKe = dnA("centroid", Zxe);
function rKe(A, e) {
  const t = Jl(A, (e || this).context);
  return t && t.scale();
}
function CKe(A) {
  const e = this.context.group;
  let t = !1;
  if (e)
    for (; A; ) {
      if (A === e) {
        t = !0;
        break;
      }
      A = A.mark.group;
    }
  return t;
}
function hnA(A, e, t) {
  try {
    A[e].apply(A, ["EXPRESSION"].concat([].slice.call(t)));
  } catch (i) {
    A.warn(i);
  }
  return t[t.length - 1];
}
function BKe() {
  return hnA(this.context.dataflow, "warn", arguments);
}
function lKe() {
  return hnA(this.context.dataflow, "info", arguments);
}
function cKe() {
  return hnA(this.context.dataflow, "debug", arguments);
}
function jz(A) {
  const e = A / 255;
  return e <= 0.03928 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
}
function qj(A) {
  const e = qu(A), t = jz(e.r), i = jz(e.g), n = jz(e.b);
  return 0.2126 * t + 0.7152 * i + 0.0722 * n;
}
function QKe(A, e) {
  const t = qj(A), i = qj(e), n = Math.max(t, i), o = Math.min(t, i);
  return (n + 0.05) / (o + 0.05);
}
function EKe() {
  const A = [].slice.call(arguments);
  return A.unshift({}), pt(...A);
}
function YZA(A, e) {
  return A === e || A !== A && e !== e ? !0 : ZA(A) ? ZA(e) && A.length === e.length ? uKe(A, e) : !1 : ce(A) && ce(e) ? RZA(A, e) : !1;
}
function uKe(A, e) {
  for (let t = 0, i = A.length; t < i; ++t)
    if (!YZA(A[t], e[t]))
      return !1;
  return !0;
}
function RZA(A, e) {
  for (const t in A)
    if (!YZA(A[t], e[t]))
      return !1;
  return !0;
}
function hdA(A) {
  return (e) => RZA(A, e);
}
function dKe(A, e, t, i, n, o) {
  const g = this.context.dataflow, s = this.context.data[A], I = s.input, r = g.stamp();
  let a = s.changes, C, B;
  if (g._trigger === !1 || !(I.value.length || e || i))
    return 0;
  if ((!a || a.stamp < r) && (s.changes = a = g.changeset(), a.stamp = r, g.runAfter(() => {
    s.modified = !0, g.pulse(I, a).run();
  }, !0, 1)), t && (C = t === !0 ? ir : ZA(t) || sU(t) ? t : hdA(t), a.remove(C)), e && a.insert(e), i && (C = hdA(i), I.value.some(C) ? a.remove(C) : a.insert(i)), n)
    for (B in o)
      a.modify(n, B, o[B]);
  return 1;
}
function hKe(A) {
  const e = A.touches, t = e[0].clientX - e[1].clientX, i = e[0].clientY - e[1].clientY;
  return Math.hypot(t, i);
}
function mKe(A) {
  const e = A.touches;
  return Math.atan2(e[0].clientY - e[1].clientY, e[0].clientX - e[1].clientX);
}
const mdA = {};
function pKe(A, e) {
  const t = mdA[e] || (mdA[e] = tr(e));
  return ZA(A) ? A.map(t) : t(A);
}
function mnA(A) {
  return ZA(A) || ArrayBuffer.isView(A) ? A : null;
}
function pnA(A) {
  return mnA(A) || (Be(A) ? A : null);
}
function yKe(A) {
  for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  return mnA(A).join(...t);
}
function bKe(A) {
  for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  return pnA(A).indexOf(...t);
}
function wKe(A) {
  for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  return pnA(A).lastIndexOf(...t);
}
function fKe(A) {
  for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  return pnA(A).slice(...t);
}
function DKe(A, e, t) {
  return yt(t) && vA("Function argument passed to replace."), String(A).replace(e, t);
}
function GKe(A) {
  return mnA(A).slice().reverse();
}
function kKe(A, e, t) {
  return JtA(A || 0, e || 0, t || 0);
}
function JKe(A, e) {
  const t = Jl(A, (e || this).context);
  return t && t.bandwidth ? t.bandwidth() : 0;
}
function NKe(A, e) {
  const t = Jl(A, (e || this).context);
  return t ? t.copy() : void 0;
}
function YKe(A, e) {
  const t = Jl(A, (e || this).context);
  return t ? t.domain() : [];
}
function RKe(A, e, t) {
  const i = Jl(A, (t || this).context);
  return i ? ZA(e) ? (i.invertRange || i.invert)(e) : (i.invert || i.invertExtent)(e) : void 0;
}
function FKe(A, e) {
  const t = Jl(A, (e || this).context);
  return t && t.range ? t.range() : [];
}
function MKe(A, e, t) {
  const i = Jl(A, (t || this).context);
  return i ? i(e) : void 0;
}
function xKe(A, e, t, i, n) {
  A = Jl(A, (n || this).context);
  const o = JvA(e, t);
  let g = A.domain(), s = g[0], I = Xt(g), r = Ng;
  return I - s ? r = uvA(A, s, I) : A = (A.interpolator ? ri("sequential")().interpolator(A.interpolator()) : ri("linear")().interpolate(A.interpolate()).range(A.range())).domain([s = 0, I = 1]), A.ticks && (g = A.ticks(+i || 15), s !== g[0] && g.unshift(s), I !== Xt(g) && g.push(I)), g.forEach((a) => o.stop(r(a), A(a))), o;
}
function LKe(A, e, t) {
  const i = Jl(A, (t || this).context);
  return function(n) {
    return i ? i.path.context(n)(e) : "";
  };
}
function vKe(A) {
  let e = null;
  return function(t) {
    return t ? PY(t, e = e || wf(A)) : A;
  };
}
const FZA = (A) => A.data;
function MZA(A, e) {
  const t = kZA.call(e, A);
  return t.root && t.root.lookup || {};
}
function HKe(A, e, t) {
  const i = MZA(A, this), n = i[e], o = i[t];
  return n && o ? n.path(o).map(FZA) : void 0;
}
function SKe(A, e) {
  const t = MZA(A, this)[e];
  return t ? t.ancestors().map(FZA) : void 0;
}
const xZA = () => typeof window < "u" && window || null;
function ZKe() {
  const A = xZA();
  return A ? A.screen : {};
}
function WKe() {
  const A = xZA();
  return A ? [A.innerWidth, A.innerHeight] : [void 0, void 0];
}
function KKe() {
  const A = this.context.dataflow, e = A.container && A.container();
  return e ? [e.clientWidth, e.clientHeight] : [void 0, void 0];
}
function LZA(A, e, t) {
  if (!A)
    return [];
  const [i, n] = A, o = new no().set(i[0], i[1], n[0], n[1]), g = t || this.context.dataflow.scenegraph().root;
  return hHA(g, o, UKe(e));
}
function UKe(A) {
  let e = null;
  if (A) {
    const t = Ce(A.marktype), i = Ce(A.markname);
    e = (n) => (!t.length || t.some((o) => n.marktype === o)) && (!i.length || i.some((o) => n.name === o));
  }
  return e;
}
function VKe(A, e, t) {
  let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 5;
  A = Ce(A);
  const n = A[A.length - 1];
  return n === void 0 || Math.hypot(n[0] - e, n[1] - t) > i ? [...A, [e, t]] : A;
}
function XKe(A) {
  return Ce(A).reduce((e, t, i) => {
    let [n, o] = t;
    return e += i == 0 ? `M ${n},${o} ` : i === A.length - 1 ? " Z" : `L ${n},${o} `;
  }, "");
}
function zKe(A, e, t) {
  const {
    x: i,
    y: n,
    mark: o
  } = t, g = new no().set(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
  for (const [s, I] of e)
    s < g.x1 && (g.x1 = s), s > g.x2 && (g.x2 = s), I < g.y1 && (g.y1 = I), I > g.y2 && (g.y2 = I);
  return g.translate(i, n), LZA([[g.x1, g.y1], [g.x2, g.y2]], A, o).filter((s) => TKe(s.x, s.y, e));
}
function TKe(A, e, t) {
  let i = 0;
  for (let n = 0, o = t.length - 1; n < t.length; o = n++) {
    const [g, s] = t[o], [I, r] = t[n];
    r > e != s > e && A < (g - I) * (e - r) / (s - r) + I && i++;
  }
  return i & 1;
}
const r2 = {
  random() {
    return or();
  },
  // override default
  cumulativeNormal: BU,
  cumulativeLogNormal: KeA,
  cumulativeUniform: zeA,
  densityNormal: veA,
  densityLogNormal: WeA,
  densityUniform: XeA,
  quantileNormal: lU,
  quantileLogNormal: UeA,
  quantileUniform: TeA,
  sampleNormal: CU,
  sampleLogNormal: ZeA,
  sampleUniform: VeA,
  isArray: ZA,
  isBoolean: Wd,
  isDate: Gu,
  isDefined(A) {
    return A !== void 0;
  },
  isNumber: ti,
  isObject: ce,
  isRegExp: axA,
  isString: Be,
  isTuple: sU,
  isValid(A) {
    return A != null && A === A;
  },
  toBoolean: peA,
  toDate(A) {
    return yeA(A);
  },
  // suppress extra arguments
  toNumber: yg,
  toString: beA,
  indexof: bKe,
  join: yKe,
  lastindexof: wKe,
  replace: DKe,
  reverse: GKe,
  slice: fKe,
  flush: sxA,
  lerp: rxA,
  merge: EKe,
  pad: lxA,
  peek: Xt,
  pluck: pKe,
  span: aF,
  inrange: Hb,
  truncate: cxA,
  rgb: qu,
  lab: aS,
  hcl: rS,
  hsl: sS,
  luminance: qj,
  contrast: QKe,
  sequence: HI,
  format: qWe,
  utcFormat: OWe,
  utcParse: PWe,
  utcOffset: kxA,
  utcSequence: YxA,
  timeFormat: JZA,
  timeParse: jWe,
  timeOffset: GxA,
  timeSequence: NxA,
  timeUnitSpecifier: ExA,
  monthFormat: $We,
  monthAbbrevFormat: AKe,
  dayFormat: eKe,
  dayAbbrevFormat: tKe,
  quarter: ixA,
  utcquarter: nxA,
  week: dxA,
  utcweek: pxA,
  dayofyear: uxA,
  utcdayofyear: mxA,
  warn: BKe,
  info: lKe,
  debug: cKe,
  extent(A) {
    return sl(A);
  },
  // suppress extra arguments
  inScope: CKe,
  intersect: LZA,
  clampRange: oxA,
  pinchDistance: hKe,
  pinchAngle: mKe,
  screen: ZKe,
  containerSize: KKe,
  windowSize: WKe,
  bandspace: kKe,
  setdata: TWe,
  pathShape: vKe,
  panLinear: $MA,
  panLog: AxA,
  panPow: exA,
  panSymlog: txA,
  zoomLinear: QeA,
  zoomLog: EeA,
  zoomPow: hS,
  zoomSymlog: ueA,
  encode: _We,
  modify: dKe,
  lassoAppend: VKe,
  lassoPath: XKe,
  intersectLasso: zKe
}, _Ke = ["view", "item", "group", "xy", "x", "y"], qKe = "event.vega.", vZA = "this.", ynA = {}, HZA = {
  forbidden: ["_"],
  allowed: ["datum", "event", "item"],
  fieldvar: "datum",
  globalvar: (A) => `_[${ie(NZA + A)}]`,
  functions: OKe,
  constants: bZA,
  visitors: ynA
}, Oj = fZA(HZA);
function OKe(A) {
  const e = wZA(A);
  _Ke.forEach((t) => e[t] = qKe + t);
  for (const t in r2)
    e[t] = vZA + t;
  return pt(e, gKe(A, r2, ynA)), e;
}
function Wn(A, e, t) {
  return arguments.length === 1 ? r2[A] : (r2[A] = e, t && (ynA[A] = t), Oj && (Oj.functions[A] = vZA + A), this);
}
Wn("bandwidth", JKe, ss);
Wn("copy", NKe, ss);
Wn("domain", YKe, ss);
Wn("range", FKe, ss);
Wn("invert", RKe, ss);
Wn("scale", MKe, ss);
Wn("gradient", xKe, ss);
Wn("geoArea", sKe, ss);
Wn("geoBounds", IKe, ss);
Wn("geoCentroid", aKe, ss);
Wn("geoShape", LKe, ss);
Wn("geoScale", rKe, ss);
Wn("indata", zWe, oKe);
Wn("data", kZA, unA);
Wn("treePath", HKe, unA);
Wn("treeAncestors", SKe, unA);
Wn("vlSelectionTest", HWe, EnA);
Wn("vlSelectionIdTest", WWe, EnA);
Wn("vlSelectionResolve", UWe, EnA);
Wn("vlSelectionTuples", KWe);
function rl(A, e) {
  const t = {};
  let i;
  try {
    A = Be(A) ? A : ie(A) + "", i = cnA(A);
  } catch {
    vA("Expression parse error: " + A);
  }
  i.visit((o) => {
    if (o.type !== EZA)
      return;
    const g = o.callee.name, s = HZA.visitors[g];
    s && s(g, o.arguments, e, t);
  });
  const n = Oj(i);
  return n.globals.forEach((o) => {
    const g = NZA + o;
    !Ze(t, g) && e.getSignal(o) && (t[g] = e.signalRef(o));
  }), {
    $expr: pt({
      code: n.code
    }, e.options.ast ? {
      ast: i
    } : null),
    $fields: n.fields,
    $params: t
  };
}
function jKe(A) {
  const e = this, t = A.operators || [];
  return A.background && (e.background = A.background), A.eventConfig && (e.eventConfig = A.eventConfig), A.locale && (e.locale = A.locale), t.forEach((i) => e.parseOperator(i)), t.forEach((i) => e.parseOperatorParameters(i)), (A.streams || []).forEach((i) => e.parseStream(i)), (A.updates || []).forEach((i) => e.parseUpdate(i)), e.resolve();
}
const PKe = mC(["rule"]), pdA = mC(["group", "image", "rect"]);
function $Ke(A, e) {
  let t = "";
  return PKe[e] || (A.x2 && (A.x ? (pdA[e] && (t += "if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"), t += "o.width=o.x2-o.x;") : t += "o.x=o.x2-(o.width||0);"), A.xc && (t += "o.x=o.xc-(o.width||0)/2;"), A.y2 && (A.y ? (pdA[e] && (t += "if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"), t += "o.height=o.y2-o.y;") : t += "o.y=o.y2-(o.height||0);"), A.yc && (t += "o.y=o.yc-(o.height||0)/2;")), t;
}
function bnA(A) {
  return (A + "").toLowerCase();
}
function A3e(A) {
  return bnA(A) === "operator";
}
function e3e(A) {
  return bnA(A) === "collect";
}
function kk(A, e, t) {
  t.endsWith(";") || (t = "return(" + t + ");");
  const i = Function(...e.concat(t));
  return A && A.functions ? i.bind(A.functions) : i;
}
function t3e(A, e, t, i) {
  return `((u = ${A}) < (v = ${e}) || u == null) && v != null ? ${t}
  : (u > v || v == null) && u != null ? ${i}
  : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${t}
  : v !== v && u === u ? ${i} : `;
}
var i3e = {
  /**
   * Parse an expression used to update an operator value.
   */
  operator: (A, e) => kk(A, ["_"], e.code),
  /**
   * Parse an expression provided as an operator parameter value.
   */
  parameter: (A, e) => kk(A, ["datum", "_"], e.code),
  /**
   * Parse an expression applied to an event stream.
   */
  event: (A, e) => kk(A, ["event"], e.code),
  /**
   * Parse an expression used to handle an event-driven operator update.
   */
  handler: (A, e) => {
    const t = `var datum=event.item&&event.item.datum;return ${e.code};`;
    return kk(A, ["_", "event"], t);
  },
  /**
   * Parse an expression that performs visual encoding.
   */
  encode: (A, e) => {
    const {
      marktype: t,
      channels: i
    } = e;
    let n = "var o=item,datum=o.datum,m=0,$;";
    for (const o in i) {
      const g = "o[" + ie(o) + "]";
      n += `$=${i[o].code};if(${g}!==$)${g}=$,m=1;`;
    }
    return n += $Ke(i, t), n += "return m;", kk(A, ["item", "_"], n);
  },
  /**
   * Optimized code generators for access and comparison.
   */
  codegen: {
    get(A) {
      const e = `[${A.map(ie).join("][")}]`, t = Function("_", `return _${e};`);
      return t.path = e, t;
    },
    comparator(A, e) {
      let t;
      const i = (o, g) => {
        const s = e[g];
        let I, r;
        return o.path ? (I = `a${o.path}`, r = `b${o.path}`) : ((t = t || {})["f" + g] = o, I = `this.f${g}(a)`, r = `this.f${g}(b)`), t3e(I, r, -s, s);
      }, n = Function("a", "b", "var u, v; return " + A.map(i).join("") + "0;");
      return t ? n.bind(t) : n;
    }
  }
};
function n3e(A) {
  const e = this;
  A3e(A.type) || !A.type ? e.operator(A, A.update ? e.operatorExpression(A.update) : null) : e.transform(A, A.type);
}
function o3e(A) {
  const e = this;
  if (A.params) {
    const t = e.get(A.id);
    t || vA("Invalid operator id: " + A.id), e.dataflow.connect(t, t.parameters(e.parseParameters(A.params), A.react, A.initonly));
  }
}
function g3e(A, e) {
  e = e || {};
  const t = this;
  for (const i in A) {
    const n = A[i];
    e[i] = ZA(n) ? n.map((o) => ydA(o, t, e)) : ydA(n, t, e);
  }
  return e;
}
function ydA(A, e, t) {
  if (!A || !ce(A))
    return A;
  for (let i = 0, n = bdA.length, o; i < n; ++i)
    if (o = bdA[i], Ze(A, o.key))
      return o.parse(A, e, t);
  return A;
}
var bdA = [{
  key: "$ref",
  parse: s3e
}, {
  key: "$key",
  parse: a3e
}, {
  key: "$expr",
  parse: I3e
}, {
  key: "$field",
  parse: r3e
}, {
  key: "$encode",
  parse: B3e
}, {
  key: "$compare",
  parse: C3e
}, {
  key: "$context",
  parse: l3e
}, {
  key: "$subflow",
  parse: c3e
}, {
  key: "$tupleid",
  parse: Q3e
}];
function s3e(A, e) {
  return e.get(A.$ref) || vA("Operator not defined: " + A.$ref);
}
function I3e(A, e, t) {
  A.$params && e.parseParameters(A.$params, t);
  const i = "e:" + A.$expr.code;
  return e.fn[i] || (e.fn[i] = oI(e.parameterExpression(A.$expr), A.$fields));
}
function a3e(A, e) {
  const t = "k:" + A.$key + "_" + !!A.$flat;
  return e.fn[t] || (e.fn[t] = meA(A.$key, A.$flat, e.expr.codegen));
}
function r3e(A, e) {
  if (!A.$field)
    return null;
  const t = "f:" + A.$field + "_" + A.$name;
  return e.fn[t] || (e.fn[t] = tr(A.$field, A.$name, e.expr.codegen));
}
function C3e(A, e) {
  const t = "c:" + A.$compare + "_" + A.$order, i = Ce(A.$compare).map((n) => n && n.$tupleid ? ve : n);
  return e.fn[t] || (e.fn[t] = deA(i, A.$order, e.expr.codegen));
}
function B3e(A, e) {
  const t = A.$encode, i = {};
  for (const n in t) {
    const o = t[n];
    i[n] = oI(e.encodeExpression(o.$expr), o.$fields), i[n].output = o.$output;
  }
  return i;
}
function l3e(A, e) {
  return e;
}
function c3e(A, e) {
  const t = A.$subflow;
  return function(i, n, o) {
    const g = e.fork().parse(t), s = g.get(t.operators[0].id), I = g.signals.parent;
    return I && I.set(o), s.detachSubflow = () => e.detach(g), s;
  };
}
function Q3e() {
  return ve;
}
function E3e(A) {
  var e = this, t = A.filter != null ? e.eventExpression(A.filter) : void 0, i = A.stream != null ? e.get(A.stream) : void 0, n;
  A.source ? i = e.events(A.source, A.type, t) : A.merge && (n = A.merge.map((o) => e.get(o)), i = n[0].merge.apply(n[0], n.slice(1))), A.between && (n = A.between.map((o) => e.get(o)), i = i.between(n[0], n[1])), A.filter && (i = i.filter(t)), A.throttle != null && (i = i.throttle(+A.throttle)), A.debounce != null && (i = i.debounce(+A.debounce)), i == null && vA("Invalid stream definition: " + JSON.stringify(A)), A.consume && i.consume(!0), e.stream(A, i);
}
function u3e(A) {
  var e = this, t = ce(t = A.source) ? t.$ref : t, i = e.get(t), n = null, o = A.update, g = void 0;
  i || vA("Source not defined: " + A.source), n = A.target && A.target.$expr ? e.eventExpression(A.target.$expr) : e.get(A.target), o && o.$expr && (o.$params && (g = e.parseParameters(o.$params)), o = e.handlerExpression(o.$expr)), e.update(A, i, n, o, g);
}
const d3e = {
  skip: !0
};
function h3e(A) {
  var e = this, t = {};
  if (A.signals) {
    var i = t.signals = {};
    Object.keys(e.signals).forEach((o) => {
      const g = e.signals[o];
      A.signals(o, g) && (i[o] = g.value);
    });
  }
  if (A.data) {
    var n = t.data = {};
    Object.keys(e.data).forEach((o) => {
      const g = e.data[o];
      A.data(o, g) && (n[o] = g.input.value);
    });
  }
  return e.subcontext && A.recurse !== !1 && (t.subcontext = e.subcontext.map((o) => o.getState(A))), t;
}
function m3e(A) {
  var e = this, t = e.dataflow, i = A.data, n = A.signals;
  Object.keys(n || {}).forEach((o) => {
    t.update(e.signals[o], n[o], d3e);
  }), Object.keys(i || {}).forEach((o) => {
    t.pulse(e.data[o].input, t.changeset().remove(ir).insert(i[o]));
  }), (A.subcontext || []).forEach((o, g) => {
    const s = e.subcontext[g];
    s && s.setState(o);
  });
}
function SZA(A, e, t, i) {
  return new ZZA(A, e, t, i);
}
function ZZA(A, e, t, i) {
  this.dataflow = A, this.transforms = e, this.events = A.events.bind(A), this.expr = i || i3e, this.signals = {}, this.scales = {}, this.nodes = {}, this.data = {}, this.fn = {}, t && (this.functions = Object.create(t), this.functions.context = this);
}
function wdA(A) {
  this.dataflow = A.dataflow, this.transforms = A.transforms, this.events = A.events, this.expr = A.expr, this.signals = Object.create(A.signals), this.scales = Object.create(A.scales), this.nodes = Object.create(A.nodes), this.data = Object.create(A.data), this.fn = Object.create(A.fn), A.functions && (this.functions = Object.create(A.functions), this.functions.context = this);
}
ZZA.prototype = wdA.prototype = {
  fork() {
    const A = new wdA(this);
    return (this.subcontext || (this.subcontext = [])).push(A), A;
  },
  detach(A) {
    this.subcontext = this.subcontext.filter((t) => t !== A);
    const e = Object.keys(A.nodes);
    for (const t of e)
      A.nodes[t]._targets = null;
    for (const t of e)
      A.nodes[t].detach();
    A.nodes = null;
  },
  get(A) {
    return this.nodes[A];
  },
  set(A, e) {
    return this.nodes[A] = e;
  },
  add(A, e) {
    const t = this, i = t.dataflow, n = A.value;
    if (t.set(A.id, e), e3e(A.type) && n && (n.$ingest ? i.ingest(e, n.$ingest, n.$format) : n.$request ? i.preload(e, n.$request, n.$format) : i.pulse(e, i.changeset().insert(n))), A.root && (t.root = e), A.parent) {
      let o = t.get(A.parent.$ref);
      o ? (i.connect(o, [e]), e.targets().add(o)) : (t.unresolved = t.unresolved || []).push(() => {
        o = t.get(A.parent.$ref), i.connect(o, [e]), e.targets().add(o);
      });
    }
    if (A.signal && (t.signals[A.signal] = e), A.scale && (t.scales[A.scale] = e), A.data)
      for (const o in A.data) {
        const g = t.data[o] || (t.data[o] = {});
        A.data[o].forEach((s) => g[s] = e);
      }
  },
  resolve() {
    return (this.unresolved || []).forEach((A) => A()), delete this.unresolved, this;
  },
  operator(A, e) {
    this.add(A, this.dataflow.add(A.value, e));
  },
  transform(A, e) {
    this.add(A, this.dataflow.add(this.transforms[bnA(e)]));
  },
  stream(A, e) {
    this.set(A.id, e);
  },
  update(A, e, t, i, n) {
    this.dataflow.on(e, t, i, n, A.options);
  },
  // expression parsing
  operatorExpression(A) {
    return this.expr.operator(this, A);
  },
  parameterExpression(A) {
    return this.expr.parameter(this, A);
  },
  eventExpression(A) {
    return this.expr.event(this, A);
  },
  handlerExpression(A) {
    return this.expr.handler(this, A);
  },
  encodeExpression(A) {
    return this.expr.encode(this, A);
  },
  // parse methods
  parse: jKe,
  parseOperator: n3e,
  parseOperatorParameters: o3e,
  parseParameters: g3e,
  parseStream: E3e,
  parseUpdate: u3e,
  // state methods
  getState: h3e,
  setState: m3e
};
function p3e(A) {
  const e = A.container();
  e && (e.setAttribute("role", "graphics-document"), e.setAttribute("aria-roleDescription", "visualization"), WZA(e, A.description()));
}
function WZA(A, e) {
  A && (e == null ? A.removeAttribute("aria-label") : A.setAttribute("aria-label", e));
}
function y3e(A) {
  A.add(null, (e) => (A._background = e.bg, A._resize = 1, e.bg), {
    bg: A._signals.background
  });
}
const Pz = "default";
function b3e(A) {
  const e = A._signals.cursor || (A._signals.cursor = A.add({
    user: Pz,
    item: null
  }));
  A.on(A.events("view", "mousemove"), e, (t, i) => {
    const n = e.value, o = n ? Be(n) ? n : n.user : Pz, g = i.item && i.item.cursor || null;
    return n && o === n.user && g == n.item ? n : {
      user: o,
      item: g
    };
  }), A.add(null, function(t) {
    let i = t.cursor, n = this.value;
    return Be(i) || (n = i.item, i = i.user), jj(A, i && i !== Pz ? i : n || i), n;
  }, {
    cursor: e
  });
}
function jj(A, e) {
  const t = A.globalCursor() ? typeof document < "u" && document.body : A.container();
  if (t)
    return e == null ? t.style.removeProperty("cursor") : t.style.cursor = e;
}
function hZ(A, e) {
  var t = A._runtime.data;
  return Ze(t, e) || vA("Unrecognized data set: " + e), t[e];
}
function w3e(A, e) {
  return arguments.length < 2 ? hZ(this, A).values.value : qU.call(this, A, I0().remove(ir).insert(e));
}
function qU(A, e) {
  jxA(e) || vA("Second argument to changes must be a changeset.");
  const t = hZ(this, A);
  return t.modified = !0, this.pulse(t.input, e);
}
function f3e(A, e) {
  return qU.call(this, A, I0().insert(e));
}
function D3e(A, e) {
  return qU.call(this, A, I0().remove(e));
}
function KZA(A) {
  var e = A.padding();
  return Math.max(0, A._viewWidth + e.left + e.right);
}
function UZA(A) {
  var e = A.padding();
  return Math.max(0, A._viewHeight + e.top + e.bottom);
}
function OU(A) {
  var e = A.padding(), t = A._origin;
  return [e.left + t[0], e.top + t[1]];
}
function G3e(A) {
  var e = OU(A), t = KZA(A), i = UZA(A);
  A._renderer.background(A.background()), A._renderer.resize(t, i, e), A._handler.origin(e), A._resizeListeners.forEach((n) => {
    try {
      n(t, i);
    } catch (o) {
      A.error(o);
    }
  });
}
function k3e(A, e, t) {
  var i = A._renderer, n = i && i.canvas(), o, g, s;
  return n && (s = OU(A), g = e.changedTouches ? e.changedTouches[0] : e, o = LU(g, n), o[0] -= s[0], o[1] -= s[1]), e.dataflow = A, e.item = t, e.vega = J3e(A, t, o), e;
}
function J3e(A, e, t) {
  const i = e ? e.mark.marktype === "group" ? e : e.mark.group : null;
  function n(g) {
    var s = i, I;
    if (g) {
      for (I = e; I; I = I.mark.group)
        if (I.mark.name === g) {
          s = I;
          break;
        }
    }
    return s && s.mark && s.mark.interactive ? s : {};
  }
  function o(g) {
    if (!g)
      return t;
    Be(g) && (g = n(g));
    const s = t.slice();
    for (; g; )
      s[0] -= g.x || 0, s[1] -= g.y || 0, g = g.mark && g.mark.group;
    return s;
  }
  return {
    view: Yg(A),
    item: Yg(e || {}),
    group: n,
    xy: o,
    x: (g) => o(g)[0],
    y: (g) => o(g)[1]
  };
}
const fdA = "view", N3e = "timer", Y3e = "window", R3e = {
  trap: !1
};
function F3e(A) {
  const e = pt({
    defaults: {}
  }, A), t = (i, n) => {
    n.forEach((o) => {
      ZA(i[o]) && (i[o] = mC(i[o]));
    });
  };
  return t(e.defaults, ["prevent", "allow"]), t(e, ["view", "window", "selector"]), e;
}
function VZA(A, e, t, i) {
  A._eventListeners.push({
    type: t,
    sources: Ce(e),
    handler: i
  });
}
function M3e(A, e) {
  var t = A._eventConfig.defaults, i = t.prevent, n = t.allow;
  return i === !1 || n === !0 ? !1 : i === !0 || n === !1 ? !0 : i ? i[e] : n ? !n[e] : A.preventDefault();
}
function Qx(A, e, t) {
  const i = A._eventConfig && A._eventConfig[e];
  return i === !1 || ce(i) && !i[t] ? (A.warn(`Blocked ${e} ${t} event listener.`), !1) : !0;
}
function x3e(A, e, t) {
  var i = this, n = new rU(t), o = function(r, a) {
    i.runAsync(null, () => {
      A === fdA && M3e(i, e) && r.preventDefault(), n.receive(k3e(i, r, a));
    });
  }, g;
  if (A === N3e)
    Qx(i, "timer", e) && i.timer(o, e);
  else if (A === fdA)
    Qx(i, "view", e) && i.addEventListener(e, o, R3e);
  else if (A === Y3e ? Qx(i, "window", e) && typeof window < "u" && (g = [window]) : typeof document < "u" && Qx(i, "selector", e) && (g = Array.from(document.querySelectorAll(A))), !g)
    i.warn("Can not resolve event source: " + A);
  else {
    for (var s = 0, I = g.length; s < I; ++s)
      g[s].addEventListener(e, o);
    VZA(i, g, e, o);
  }
  return n;
}
function DdA(A) {
  return A.item;
}
function GdA(A) {
  return A.item.mark.source;
}
function kdA(A) {
  return function(e, t) {
    return t.vega.view().changeset().encode(t.item, A);
  };
}
function L3e(A, e) {
  return A = [A || "hover"], e = [e || "update", A[0]], this.on(this.events("view", "mouseover", DdA), GdA, kdA(A)), this.on(this.events("view", "mouseout", DdA), GdA, kdA(e)), this;
}
function v3e() {
  var A = this._tooltip, e = this._timers, t = this._eventListeners, i, n, o;
  for (i = e.length; --i >= 0; )
    e[i].stop();
  for (i = t.length; --i >= 0; )
    for (o = t[i], n = o.sources.length; --n >= 0; )
      o.sources[n].removeEventListener(o.type, o.handler);
  return A && A.call(this, this._handler, null, null, null), this;
}
function TI(A, e, t) {
  const i = document.createElement(A);
  for (const n in e)
    i.setAttribute(n, e[n]);
  return t != null && (i.textContent = t), i;
}
const H3e = "vega-bind", S3e = "vega-bind-name", Z3e = "vega-bind-radio";
function W3e(A, e, t) {
  if (!e)
    return;
  const i = t.param;
  let n = t.state;
  return n || (n = t.state = {
    elements: null,
    active: !1,
    set: null,
    update: (o) => {
      o != A.signal(i.signal) && A.runAsync(null, () => {
        n.source = !0, A.signal(i.signal, o);
      });
    }
  }, i.debounce && (n.update = heA(i.debounce, n.update))), (i.input == null && i.element ? K3e : V3e)(n, e, i, A), n.active || (A.on(A._signals[i.signal], null, () => {
    n.source ? n.source = !1 : n.set(A.signal(i.signal));
  }), n.active = !0), n;
}
function K3e(A, e, t, i) {
  const n = t.event || "input", o = () => A.update(e.value);
  i.signal(t.signal, e.value), e.addEventListener(n, o), VZA(i, e, n, o), A.set = (g) => {
    e.value = g, e.dispatchEvent(U3e(n));
  };
}
function U3e(A) {
  return typeof Event < "u" ? new Event(A) : {
    type: A
  };
}
function V3e(A, e, t, i) {
  const n = i.signal(t.signal), o = TI("div", {
    class: H3e
  }), g = t.input === "radio" ? o : o.appendChild(TI("label"));
  g.appendChild(TI("span", {
    class: S3e
  }, t.name || t.signal)), e.appendChild(o);
  let s = X3e;
  switch (t.input) {
    case "checkbox":
      s = z3e;
      break;
    case "select":
      s = T3e;
      break;
    case "radio":
      s = _3e;
      break;
    case "range":
      s = q3e;
      break;
  }
  s(A, g, t, n);
}
function X3e(A, e, t, i) {
  const n = TI("input");
  for (const o in t)
    o !== "signal" && o !== "element" && n.setAttribute(o === "input" ? "type" : o, t[o]);
  n.setAttribute("name", t.signal), n.value = i, e.appendChild(n), n.addEventListener("input", () => A.update(n.value)), A.elements = [n], A.set = (o) => n.value = o;
}
function z3e(A, e, t, i) {
  const n = {
    type: "checkbox",
    name: t.signal
  };
  i && (n.checked = !0);
  const o = TI("input", n);
  e.appendChild(o), o.addEventListener("change", () => A.update(o.checked)), A.elements = [o], A.set = (g) => o.checked = !!g || null;
}
function T3e(A, e, t, i) {
  const n = TI("select", {
    name: t.signal
  }), o = t.labels || [];
  t.options.forEach((g, s) => {
    const I = {
      value: g
    };
    mZ(g, i) && (I.selected = !0), n.appendChild(TI("option", I, (o[s] || g) + ""));
  }), e.appendChild(n), n.addEventListener("change", () => {
    A.update(t.options[n.selectedIndex]);
  }), A.elements = [n], A.set = (g) => {
    for (let s = 0, I = t.options.length; s < I; ++s)
      if (mZ(t.options[s], g)) {
        n.selectedIndex = s;
        return;
      }
  };
}
function _3e(A, e, t, i) {
  const n = TI("span", {
    class: Z3e
  }), o = t.labels || [];
  e.appendChild(n), A.elements = t.options.map((g, s) => {
    const I = {
      type: "radio",
      name: t.signal,
      value: g
    };
    mZ(g, i) && (I.checked = !0);
    const r = TI("input", I);
    r.addEventListener("change", () => A.update(g));
    const a = TI("label", {}, (o[s] || g) + "");
    return a.prepend(r), n.appendChild(a), r;
  }), A.set = (g) => {
    const s = A.elements, I = s.length;
    for (let r = 0; r < I; ++r)
      mZ(s[r].value, g) && (s[r].checked = !0);
  };
}
function q3e(A, e, t, i) {
  i = i !== void 0 ? i : (+t.max + +t.min) / 2;
  const n = t.max != null ? t.max : Math.max(100, +i) || 100, o = t.min || Math.min(0, n, +i) || 0, g = t.step || _u(o, n, 100), s = TI("input", {
    type: "range",
    name: t.signal,
    min: o,
    max: n,
    step: g
  });
  s.value = i;
  const I = TI("span", {}, +i);
  e.appendChild(s), e.appendChild(I);
  const r = () => {
    I.textContent = s.value, A.update(+s.value);
  };
  s.addEventListener("input", r), s.addEventListener("change", r), A.elements = [s], A.set = (a) => {
    s.value = a, I.textContent = a;
  };
}
function mZ(A, e) {
  return A === e || A + "" == e + "";
}
function XZA(A, e, t, i, n, o) {
  return e = e || new i(A.loader()), e.initialize(t, KZA(A), UZA(A), OU(A), n, o).background(A.background());
}
function wnA(A, e) {
  return e ? function() {
    try {
      e.apply(this, arguments);
    } catch (t) {
      A.error(t);
    }
  } : null;
}
function O3e(A, e, t, i) {
  const n = new i(A.loader(), wnA(A, A.tooltip())).scene(A.scenegraph().root).initialize(t, OU(A), A);
  return e && e.handlers().forEach((o) => {
    n.on(o.type, o.handler);
  }), n;
}
function j3e(A, e) {
  const t = this, i = t._renderType, n = t._eventConfig.bind, o = $D(i);
  A = t._el = A ? $z(t, A, !0) : null, p3e(t), o || t.error("Unrecognized renderer type: " + i);
  const g = o.handler || gr, s = A ? o.renderer : o.headless;
  return t._renderer = s ? XZA(t, t._renderer, A, s) : null, t._handler = O3e(t, t._handler, A, g), t._redraw = !0, A && n !== "none" && (e = e ? t._elBind = $z(t, e, !0) : A.appendChild(TI("form", {
    class: "vega-bindings"
  })), t._bind.forEach((I) => {
    I.param.element && n !== "container" && (I.element = $z(t, I.param.element, !!I.param.input));
  }), t._bind.forEach((I) => {
    W3e(t, I.element || e, I);
  })), t;
}
function $z(A, e, t) {
  if (typeof e == "string")
    if (typeof document < "u") {
      if (e = document.querySelector(e), !e)
        return A.error("Signal bind element not found: " + e), null;
    } else
      return A.error("DOM document instance not found."), null;
  if (e && t)
    try {
      e.textContent = "";
    } catch (i) {
      e = null, A.error(i);
    }
  return e;
}
const Jk = (A) => +A || 0, P3e = (A) => ({
  top: A,
  bottom: A,
  left: A,
  right: A
});
function JdA(A) {
  return ce(A) ? {
    top: Jk(A.top),
    bottom: Jk(A.bottom),
    left: Jk(A.left),
    right: Jk(A.right)
  } : P3e(Jk(A));
}
async function fnA(A, e, t, i) {
  const n = $D(e), o = n && n.headless;
  return o || vA("Unrecognized renderer type: " + e), await A.runAsync(), XZA(A, null, null, o, t, i).renderAsync(A._scenegraph.root);
}
async function $3e(A, e) {
  A !== Au.Canvas && A !== Au.SVG && A !== Au.PNG && vA("Unrecognized image type: " + A);
  const t = await fnA(this, A, e);
  return A === Au.SVG ? AUe(t.svg(), "image/svg+xml") : t.canvas().toDataURL("image/png");
}
function AUe(A, e) {
  const t = new Blob([A], {
    type: e
  });
  return window.URL.createObjectURL(t);
}
async function eUe(A, e) {
  return (await fnA(this, Au.Canvas, A, e)).canvas();
}
async function tUe(A) {
  return (await fnA(this, Au.SVG, A)).svg();
}
function iUe(A, e, t) {
  return SZA(A, hf, r2, t).parse(e);
}
function nUe(A) {
  var e = this._runtime.scales;
  return Ze(e, A) || vA("Unrecognized scale or projection: " + A), e[A].value;
}
var zZA = "width", TZA = "height", DnA = "padding", NdA = {
  skip: !0
};
function _ZA(A, e) {
  var t = A.autosize(), i = A.padding();
  return e - (t && t.contains === DnA ? i.left + i.right : 0);
}
function qZA(A, e) {
  var t = A.autosize(), i = A.padding();
  return e - (t && t.contains === DnA ? i.top + i.bottom : 0);
}
function oUe(A) {
  var e = A._signals, t = e[zZA], i = e[TZA], n = e[DnA];
  function o() {
    A._autosize = A._resize = 1;
  }
  A._resizeWidth = A.add(null, (s) => {
    A._width = s.size, A._viewWidth = _ZA(A, s.size), o();
  }, {
    size: t
  }), A._resizeHeight = A.add(null, (s) => {
    A._height = s.size, A._viewHeight = qZA(A, s.size), o();
  }, {
    size: i
  });
  const g = A.add(null, o, {
    pad: n
  });
  A._resizeWidth.rank = t.rank + 1, A._resizeHeight.rank = i.rank + 1, g.rank = n.rank + 1;
}
function gUe(A, e, t, i, n, o) {
  this.runAfter((g) => {
    let s = 0;
    g._autosize = 0, g.width() !== t && (s = 1, g.signal(zZA, t, NdA), g._resizeWidth.skip(!0)), g.height() !== i && (s = 1, g.signal(TZA, i, NdA), g._resizeHeight.skip(!0)), g._viewWidth !== A && (g._resize = 1, g._viewWidth = A), g._viewHeight !== e && (g._resize = 1, g._viewHeight = e), (g._origin[0] !== n[0] || g._origin[1] !== n[1]) && (g._resize = 1, g._origin = n), s && g.run("enter"), o && g.runAfter((I) => I.resize());
  }, !1, 1);
}
function sUe(A) {
  return this._runtime.getState(A || {
    data: IUe,
    signals: aUe,
    recurse: !0
  });
}
function IUe(A, e) {
  return e.modified && ZA(e.input.value) && A.indexOf("_:vega:_");
}
function aUe(A, e) {
  return !(A === "parent" || e instanceof hf.proxy);
}
function rUe(A) {
  return this.runAsync(null, (e) => {
    e._trigger = !1, e._runtime.setState(A);
  }, (e) => {
    e._trigger = !0;
  }), this;
}
function CUe(A, e) {
  function t(i) {
    A({
      timestamp: Date.now(),
      elapsed: i
    });
  }
  this._timers.push(Kve(t, e));
}
function BUe(A, e, t, i) {
  const n = A.element();
  n && n.setAttribute("title", lUe(i));
}
function lUe(A) {
  return A == null ? "" : ZA(A) ? OZA(A) : ce(A) && !Gu(A) ? cUe(A) : A + "";
}
function cUe(A) {
  return Object.keys(A).map((e) => {
    const t = A[e];
    return e + ": " + (ZA(t) ? OZA(t) : jZA(t));
  }).join(`
`);
}
function OZA(A) {
  return "[" + A.map(jZA).join(", ") + "]";
}
function jZA(A) {
  return ZA(A) ? "[…]" : ce(A) && !Gu(A) ? "{…}" : A;
}
function PZA(A, e) {
  const t = this;
  if (e = e || {}, rw.call(t), e.loader && t.loader(e.loader), e.logger && t.logger(e.logger), e.logLevel != null && t.logLevel(e.logLevel), e.locale || A.locale) {
    const o = pt({}, A.locale, e.locale);
    t.locale(WxA(o.number, o.time));
  }
  t._el = null, t._elBind = null, t._renderType = e.renderer || Au.Canvas, t._scenegraph = new giA();
  const i = t._scenegraph.root;
  t._renderer = null, t._tooltip = e.tooltip || BUe, t._redraw = !0, t._handler = new gr().scene(i), t._globalCursor = !1, t._preventDefault = !1, t._timers = [], t._eventListeners = [], t._resizeListeners = [], t._eventConfig = F3e(A.eventConfig), t.globalCursor(t._eventConfig.globalCursor);
  const n = iUe(t, A, e.expr);
  t._runtime = n, t._signals = n.signals, t._bind = (A.bindings || []).map((o) => ({
    state: null,
    param: pt({}, o)
  })), n.root && n.root.set(i), i.source = n.data.root.input, t.pulse(n.data.root.input, t.changeset().insert(i.items)), t._width = t.width(), t._height = t.height(), t._viewWidth = _ZA(t, t._width), t._viewHeight = qZA(t, t._height), t._origin = [0, 0], t._resize = 0, t._autosize = 1, oUe(t), y3e(t), b3e(t), t.description(A.description), e.hover && t.hover(), e.container && t.initialize(e.container, e.bind);
}
function Ex(A, e) {
  return Ze(A._signals, e) ? A._signals[e] : vA("Unrecognized signal name: " + ie(e));
}
function $ZA(A, e) {
  const t = (A._targets || []).filter((i) => i._update && i._update.handler === e);
  return t.length ? t[0] : null;
}
function YdA(A, e, t, i) {
  let n = $ZA(t, i);
  return n || (n = wnA(A, () => i(e, t.value)), n.handler = i, A.on(t, null, n)), A;
}
function RdA(A, e, t) {
  const i = $ZA(e, t);
  return i && e._targets.remove(i), A;
}
Ae(PZA, rw, {
  // -- DATAFLOW / RENDERING ----
  async evaluate(A, e, t) {
    if (await rw.prototype.evaluate.call(this, A, e), this._redraw || this._resize)
      try {
        this._renderer && (this._resize && (this._resize = 0, G3e(this)), await this._renderer.renderAsync(this._scenegraph.root)), this._redraw = !1;
      } catch (i) {
        this.error(i);
      }
    return t && KL(this, t), this;
  },
  dirty(A) {
    this._redraw = !0, this._renderer && this._renderer.dirty(A);
  },
  // -- GET / SET ----
  description(A) {
    if (arguments.length) {
      const e = A != null ? A + "" : null;
      return e !== this._desc && WZA(this._el, this._desc = e), this;
    }
    return this._desc;
  },
  container() {
    return this._el;
  },
  scenegraph() {
    return this._scenegraph;
  },
  origin() {
    return this._origin.slice();
  },
  signal(A, e, t) {
    const i = Ex(this, A);
    return arguments.length === 1 ? i.value : this.update(i, e, t);
  },
  width(A) {
    return arguments.length ? this.signal("width", A) : this.signal("width");
  },
  height(A) {
    return arguments.length ? this.signal("height", A) : this.signal("height");
  },
  padding(A) {
    return arguments.length ? this.signal("padding", JdA(A)) : JdA(this.signal("padding"));
  },
  autosize(A) {
    return arguments.length ? this.signal("autosize", A) : this.signal("autosize");
  },
  background(A) {
    return arguments.length ? this.signal("background", A) : this.signal("background");
  },
  renderer(A) {
    return arguments.length ? ($D(A) || vA("Unrecognized renderer type: " + A), A !== this._renderType && (this._renderType = A, this._resetRenderer()), this) : this._renderType;
  },
  tooltip(A) {
    return arguments.length ? (A !== this._tooltip && (this._tooltip = A, this._resetRenderer()), this) : this._tooltip;
  },
  loader(A) {
    return arguments.length ? (A !== this._loader && (rw.prototype.loader.call(this, A), this._resetRenderer()), this) : this._loader;
  },
  resize() {
    return this._autosize = 1, this.touch(Ex(this, "autosize"));
  },
  _resetRenderer() {
    this._renderer && (this._renderer = null, this.initialize(this._el, this._elBind));
  },
  // -- SIZING ----
  _resizeView: gUe,
  // -- EVENT HANDLING ----
  addEventListener(A, e, t) {
    let i = e;
    return t && t.trap === !1 || (i = wnA(this, e), i.raw = e), this._handler.on(A, i), this;
  },
  removeEventListener(A, e) {
    for (var t = this._handler.handlers(A), i = t.length, n, o; --i >= 0; )
      if (o = t[i].type, n = t[i].handler, A === o && (e === n || e === n.raw)) {
        this._handler.off(o, n);
        break;
      }
    return this;
  },
  addResizeListener(A) {
    const e = this._resizeListeners;
    return e.indexOf(A) < 0 && e.push(A), this;
  },
  removeResizeListener(A) {
    var e = this._resizeListeners, t = e.indexOf(A);
    return t >= 0 && e.splice(t, 1), this;
  },
  addSignalListener(A, e) {
    return YdA(this, A, Ex(this, A), e);
  },
  removeSignalListener(A, e) {
    return RdA(this, Ex(this, A), e);
  },
  addDataListener(A, e) {
    return YdA(this, A, hZ(this, A).values, e);
  },
  removeDataListener(A, e) {
    return RdA(this, hZ(this, A).values, e);
  },
  globalCursor(A) {
    if (arguments.length) {
      if (this._globalCursor !== !!A) {
        const e = jj(this, null);
        this._globalCursor = !!A, e && jj(this, e);
      }
      return this;
    } else
      return this._globalCursor;
  },
  preventDefault(A) {
    return arguments.length ? (this._preventDefault = A, this) : this._preventDefault;
  },
  timer: CUe,
  events: x3e,
  finalize: v3e,
  hover: L3e,
  // -- DATA ----
  data: w3e,
  change: qU,
  insert: f3e,
  remove: D3e,
  // -- SCALES --
  scale: nUe,
  // -- INITIALIZATION ----
  initialize: j3e,
  // -- HEADLESS RENDERING ----
  toImageURL: $3e,
  toCanvas: eUe,
  toSVG: tUe,
  // -- SAVE / RESTORE STATE ----
  getState: sUe,
  setState: rUe
});
const QUe = "view", pZ = "[", yZ = "]", AWA = "{", eWA = "}", EUe = ":", tWA = ",", uUe = "@", dUe = ">", hUe = /[[\]{}]/, mUe = {
  "*": 1,
  arc: 1,
  area: 1,
  group: 1,
  image: 1,
  line: 1,
  path: 1,
  rect: 1,
  rule: 1,
  shape: 1,
  symbol: 1,
  text: 1,
  trail: 1
};
let iWA, nWA;
function Ud(A, e, t) {
  return iWA = e || QUe, nWA = t || mUe, oWA(A.trim()).map(Pj);
}
function pUe(A) {
  return nWA[A];
}
function NN(A, e, t, i, n) {
  const o = A.length;
  let g = 0, s;
  for (; e < o; ++e) {
    if (s = A[e], !g && s === t)
      return e;
    n && n.indexOf(s) >= 0 ? --g : i && i.indexOf(s) >= 0 && ++g;
  }
  return e;
}
function oWA(A) {
  const e = [], t = A.length;
  let i = 0, n = 0;
  for (; n < t; )
    n = NN(A, n, tWA, pZ + AWA, yZ + eWA), e.push(A.substring(i, n).trim()), i = ++n;
  if (e.length === 0)
    throw "Empty event selector: " + A;
  return e;
}
function Pj(A) {
  return A[0] === "[" ? yUe(A) : bUe(A);
}
function yUe(A) {
  const e = A.length;
  let t = 1, i;
  if (t = NN(A, t, yZ, pZ, yZ), t === e)
    throw "Empty between selector: " + A;
  if (i = oWA(A.substring(1, t)), i.length !== 2)
    throw "Between selector must have two elements: " + A;
  if (A = A.slice(t + 1).trim(), A[0] !== dUe)
    throw "Expected '>' after between selector: " + A;
  i = i.map(Pj);
  const n = Pj(A.slice(1).trim());
  return n.between ? {
    between: i,
    stream: n
  } : (n.between = i, n);
}
function bUe(A) {
  const e = {
    source: iWA
  }, t = [];
  let i = [0, 0], n = 0, o = 0, g = A.length, s = 0, I, r;
  if (A[g - 1] === eWA) {
    if (s = A.lastIndexOf(AWA), s >= 0) {
      try {
        i = wUe(A.substring(s + 1, g - 1));
      } catch {
        throw "Invalid throttle specification: " + A;
      }
      A = A.slice(0, s).trim(), g = A.length;
    } else
      throw "Unmatched right brace: " + A;
    s = 0;
  }
  if (!g)
    throw A;
  if (A[0] === uUe && (n = ++s), I = NN(A, s, EUe), I < g && (t.push(A.substring(o, I).trim()), o = s = ++I), s = NN(A, s, pZ), s === g)
    t.push(A.substring(o, g).trim());
  else if (t.push(A.substring(o, s).trim()), r = [], o = ++s, o === g)
    throw "Unmatched left bracket: " + A;
  for (; s < g; ) {
    if (s = NN(A, s, yZ), s === g)
      throw "Unmatched left bracket: " + A;
    if (r.push(A.substring(o, s).trim()), s < g - 1 && A[++s] !== pZ)
      throw "Expected left bracket: " + A;
    o = ++s;
  }
  if (!(g = t.length) || hUe.test(t[g - 1]))
    throw "Invalid event selector: " + A;
  return g > 1 ? (e.type = t[1], n ? e.markname = t[0].slice(1) : pUe(t[0]) ? e.marktype = t[0] : e.source = t[0]) : e.type = t[0], e.type.slice(-1) === "!" && (e.consume = !0, e.type = e.type.slice(0, -1)), r != null && (e.filter = r), i[0] && (e.throttle = i[0]), i[1] && (e.debounce = i[1]), e;
}
function wUe(A) {
  const e = A.split(tWA);
  if (!A.length || e.length > 2)
    throw A;
  return e.map((t) => {
    const i = +t;
    if (i !== i)
      throw A;
    return i;
  });
}
function fUe(A) {
  return ce(A) ? A : {
    type: A || "pad"
  };
}
const Nk = (A) => +A || 0, DUe = (A) => ({
  top: A,
  bottom: A,
  left: A,
  right: A
});
function GUe(A) {
  return ce(A) ? A.signal ? A : {
    top: Nk(A.top),
    bottom: Nk(A.bottom),
    left: Nk(A.left),
    right: Nk(A.right)
  } : DUe(Nk(A));
}
const Fo = (A) => ce(A) && !ZA(A) ? pt({}, A) : {
  value: A
};
function FdA(A, e, t, i) {
  return t != null ? (ce(t) && !ZA(t) || ZA(t) && t.length && ce(t[0]) ? A.update[e] = t : A[i || "enter"][e] = {
    value: t
  }, 1) : 0;
}
function og(A, e, t) {
  for (const i in e)
    FdA(A, i, e[i]);
  for (const i in t)
    FdA(A, i, t[i], "update");
}
function eG(A, e, t) {
  for (const i in e)
    t && Ze(t, i) || (A[i] = pt(A[i] || {}, e[i]));
  return A;
}
function zy(A, e) {
  return e && (e.enter && e.enter[A] || e.update && e.update[A]);
}
const GnA = "mark", knA = "frame", JnA = "scope", kUe = "axis", JUe = "axis-domain", NUe = "axis-grid", YUe = "axis-label", RUe = "axis-tick", FUe = "axis-title", MUe = "legend", xUe = "legend-band", LUe = "legend-entry", vUe = "legend-gradient", gWA = "legend-label", HUe = "legend-symbol", SUe = "legend-title", ZUe = "title", WUe = "title-text", KUe = "title-subtitle";
function UUe(A, e, t, i, n) {
  const o = {}, g = {};
  let s, I, r, a;
  I = "lineBreak", e === "text" && n[I] != null && !zy(I, A) && AT(o, I, n[I]), (t == "legend" || String(t).startsWith("axis")) && (t = null), a = t === knA ? n.group : t === GnA ? pt({}, n.mark, n[e]) : null;
  for (I in a)
    r = zy(I, A) || (I === "fill" || I === "stroke") && (zy("fill", A) || zy("stroke", A)), r || AT(o, I, a[I]);
  Ce(i).forEach((C) => {
    const B = n.style && n.style[C];
    for (const l in B)
      zy(l, A) || AT(o, l, B[l]);
  }), A = pt({}, A);
  for (I in o)
    a = o[I], a.signal ? (s = s || {})[I] = a : g[I] = a;
  return A.enter = pt(g, A.enter), s && (A.update = pt(s, A.update)), A;
}
function AT(A, e, t) {
  A[e] = t && t.signal ? {
    signal: t.signal
  } : {
    value: t
  };
}
const sWA = (A) => Be(A) ? ie(A) : A.signal ? `(${A.signal})` : IWA(A);
function jU(A) {
  if (A.gradient != null)
    return XUe(A);
  let e = A.signal ? `(${A.signal})` : A.color ? VUe(A.color) : A.field != null ? IWA(A.field) : A.value !== void 0 ? ie(A.value) : void 0;
  return A.scale != null && (e = zUe(A, e)), e === void 0 && (e = null), A.exponent != null && (e = `pow(${e},${ov(A.exponent)})`), A.mult != null && (e += `*${ov(A.mult)}`), A.offset != null && (e += `+${ov(A.offset)}`), A.round && (e = `round(${e})`), e;
}
const ux = (A, e, t, i) => `(${A}(${[e, t, i].map(jU).join(",")})+'')`;
function VUe(A) {
  return A.c ? ux("hcl", A.h, A.c, A.l) : A.h || A.s ? ux("hsl", A.h, A.s, A.l) : A.l || A.a ? ux("lab", A.l, A.a, A.b) : A.r || A.g || A.b ? ux("rgb", A.r, A.g, A.b) : null;
}
function XUe(A) {
  const e = [A.start, A.stop, A.count].map((t) => t == null ? null : ie(t));
  for (; e.length && Xt(e) == null; )
    e.pop();
  return e.unshift(sWA(A.gradient)), `gradient(${e.join(",")})`;
}
function ov(A) {
  return ce(A) ? "(" + jU(A) + ")" : A;
}
function IWA(A) {
  return aWA(ce(A) ? A : {
    datum: A
  });
}
function aWA(A) {
  let e, t, i;
  if (A.signal)
    e = "datum", i = A.signal;
  else if (A.group || A.parent) {
    for (t = Math.max(1, A.level || 1), e = "item"; t-- > 0; )
      e += ".mark.group";
    A.parent ? (i = A.parent, e += ".datum") : i = A.group;
  } else
    A.datum ? (e = "datum", i = A.datum) : vA("Invalid field reference: " + ie(A));
  return A.signal || (i = Be(i) ? fl(i).map(ie).join("][") : aWA(i)), e + "[" + i + "]";
}
function zUe(A, e) {
  const t = sWA(A.scale);
  return A.range != null ? e = `lerp(_range(${t}), ${+A.range})` : (e !== void 0 && (e = `_scale(${t}, ${e})`), A.band && (e = (e ? e + "+" : "") + `_bandwidth(${t})` + (+A.band == 1 ? "" : "*" + ov(A.band)), A.extra && (e = `(datum.extra ? _scale(${t}, datum.extra.value) : ${e})`)), e == null && (e = "0")), e;
}
function TUe(A) {
  let e = "";
  return A.forEach((t) => {
    const i = jU(t);
    e += t.test ? `(${t.test})?${i}:` : i;
  }), Xt(e) === ":" && (e += "null"), e;
}
function rWA(A, e, t, i, n, o) {
  const g = {};
  o = o || {}, o.encoders = {
    $encode: g
  }, A = UUe(A, e, t, i, n.config);
  for (const s in A)
    g[s] = _Ue(A[s], e, o, n);
  return o;
}
function _Ue(A, e, t, i) {
  const n = {}, o = {};
  for (const g in A)
    A[g] != null && (n[g] = OUe(qUe(A[g]), i, t, o));
  return {
    $expr: {
      marktype: e,
      channels: n
    },
    $fields: Object.keys(o),
    $output: Object.keys(A)
  };
}
function qUe(A) {
  return ZA(A) ? TUe(A) : jU(A);
}
function OUe(A, e, t, i) {
  const n = rl(A, e);
  return n.$fields.forEach((o) => i[o] = 1), pt(t, n.$params), n.$expr;
}
const jUe = "outer", PUe = ["value", "update", "init", "react", "bind"];
function MdA(A, e) {
  vA(A + ' for "outer" push: ' + ie(e));
}
function CWA(A, e) {
  const t = A.name;
  if (A.push === jUe)
    e.signals[t] || MdA("No prior signal definition", t), PUe.forEach((i) => {
      A[i] !== void 0 && MdA("Invalid property ", i);
    });
  else {
    const i = e.addSignal(t, A.value);
    A.react === !1 && (i.react = !1), A.bind && e.addBinding(t, A.bind);
  }
}
function $j(A, e, t, i) {
  this.id = -1, this.type = A, this.value = e, this.params = t, i && (this.parent = i);
}
function PU(A, e, t, i) {
  return new $j(A, e, t, i);
}
function bZ(A, e) {
  return PU("operator", A, e);
}
function Le(A) {
  const e = {
    $ref: A.id
  };
  return A.id < 0 && (A.refs = A.refs || []).push(e), e;
}
function C2(A, e) {
  return e ? {
    $field: A,
    $name: e
  } : {
    $field: A
  };
}
const AP = C2("key");
function xdA(A, e) {
  return {
    $compare: A,
    $order: e
  };
}
function $Ue(A, e) {
  const t = {
    $key: A
  };
  return e && (t.$flat = !0), t;
}
const AVe = "ascending", eVe = "descending";
function tVe(A) {
  return ce(A) ? (A.order === eVe ? "-" : "+") + $U(A.op, A.field) : "";
}
function $U(A, e) {
  return (A && A.signal ? "$" + A.signal : A || "") + (A && e ? "_" : "") + (e && e.signal ? "$" + e.signal : e || "");
}
const NnA = "scope", eP = "view";
function Qo(A) {
  return A && A.signal;
}
function iVe(A) {
  return A && A.expr;
}
function gv(A) {
  if (Qo(A))
    return !0;
  if (ce(A)) {
    for (const e in A)
      if (gv(A[e]))
        return !0;
  }
  return !1;
}
function vr(A, e) {
  return A ?? e;
}
function vm(A) {
  return A && A.signal || A;
}
const LdA = "timer";
function B2(A, e) {
  return (A.merge ? oVe : A.stream ? gVe : A.type ? sVe : vA("Invalid stream specification: " + ie(A)))(A, e);
}
function nVe(A) {
  return A === NnA ? eP : A || eP;
}
function oVe(A, e) {
  const t = A.merge.map((n) => B2(n, e)), i = YnA({
    merge: t
  }, A, e);
  return e.addStream(i).id;
}
function gVe(A, e) {
  const t = B2(A.stream, e), i = YnA({
    stream: t
  }, A, e);
  return e.addStream(i).id;
}
function sVe(A, e) {
  let t;
  A.type === LdA ? (t = e.event(LdA, A.throttle), A = {
    between: A.between,
    filter: A.filter
  }) : t = e.event(nVe(A.source), A.type);
  const i = YnA({
    stream: t
  }, A, e);
  return Object.keys(i).length === 1 ? t : e.addStream(i).id;
}
function YnA(A, e, t) {
  let i = e.between;
  return i && (i.length !== 2 && vA('Stream "between" parameter must have 2 entries: ' + ie(e)), A.between = [B2(i[0], t), B2(i[1], t)]), i = e.filter ? [].concat(e.filter) : [], (e.marktype || e.markname || e.markrole) && i.push(IVe(e.marktype, e.markname, e.markrole)), e.source === NnA && i.push("inScope(event.item)"), i.length && (A.filter = rl("(" + i.join(")&&(") + ")", t).$expr), (i = e.throttle) != null && (A.throttle = +i), (i = e.debounce) != null && (A.debounce = +i), e.consume && (A.consume = !0), A;
}
function IVe(A, e, t) {
  const i = "event.item";
  return i + (A && A !== "*" ? "&&" + i + ".mark.marktype==='" + A + "'" : "") + (t ? "&&" + i + ".mark.role==='" + t + "'" : "") + (e ? "&&" + i + ".mark.name==='" + e + "'" : "");
}
const aVe = {
  code: "_.$value",
  ast: {
    type: "Identifier",
    value: "value"
  }
};
function rVe(A, e, t) {
  const i = A.encode, n = {
    target: t
  };
  let o = A.events, g = A.update, s = [];
  o || vA("Signal update missing events specification."), Be(o) && (o = Ud(o, e.isSubscope() ? NnA : eP)), o = Ce(o).filter((I) => I.signal || I.scale ? (s.push(I), 0) : 1), s.length > 1 && (s = [BVe(s)]), o.length && s.push(o.length > 1 ? {
    merge: o
  } : o[0]), i != null && (g && vA("Signal encode and update are mutually exclusive."), g = "encode(item()," + ie(i) + ")"), n.update = Be(g) ? rl(g, e) : g.expr != null ? rl(g.expr, e) : g.value != null ? g.value : g.signal != null ? {
    $expr: aVe,
    $params: {
      $value: e.signalRef(g.signal)
    }
  } : vA("Invalid signal update specification."), A.force && (n.options = {
    force: !0
  }), s.forEach((I) => e.addUpdate(pt(CVe(I, e), n)));
}
function CVe(A, e) {
  return {
    source: A.signal ? e.signalRef(A.signal) : A.scale ? e.scaleRef(A.scale) : B2(A, e)
  };
}
function BVe(A) {
  return {
    signal: "[" + A.map((e) => e.scale ? 'scale("' + e.scale + '")' : e.signal) + "]"
  };
}
function lVe(A, e) {
  const t = e.getSignal(A.name);
  let i = A.update;
  A.init && (i ? vA("Signals can not include both init and update expressions.") : (i = A.init, t.initonly = !0)), i && (i = rl(i, e), t.update = i.$expr, t.params = i.$params), A.on && A.on.forEach((n) => rVe(n, e, t.id));
}
const xi = (A) => (e, t, i) => PU(A, t, e || void 0, i), BWA = xi("aggregate"), cVe = xi("axisticks"), lWA = xi("bound"), JC = xi("collect"), vdA = xi("compare"), QVe = xi("datajoin"), cWA = xi("encode"), EVe = xi("expression"), uVe = xi("facet"), dVe = xi("field"), hVe = xi("key"), mVe = xi("legendentries"), pVe = xi("load"), yVe = xi("mark"), bVe = xi("multiextent"), wVe = xi("multivalues"), fVe = xi("overlap"), DVe = xi("params"), QWA = xi("prefacet"), GVe = xi("projection"), kVe = xi("proxy"), JVe = xi("relay"), EWA = xi("render"), NVe = xi("scale"), C0 = xi("sieve"), YVe = xi("sortitems"), uWA = xi("viewlayout"), RVe = xi("values");
let FVe = 0;
const dWA = {
  min: "min",
  max: "max",
  count: "sum"
};
function MVe(A, e) {
  const t = A.type || "linear";
  CvA(t) || vA("Unrecognized scale type: " + ie(t)), e.addScale(A.name, {
    type: t,
    domain: void 0
  });
}
function xVe(A, e) {
  const t = e.getScale(A.name).params;
  let i;
  t.domain = hWA(A.domain, A, e), A.range != null && (t.range = pWA(A, e, t)), A.interpolate != null && XVe(A.interpolate, t), A.nice != null && (t.nice = VVe(A.nice)), A.bins != null && (t.bins = UVe(A.bins, e));
  for (i in A)
    Ze(t, i) || i === "name" || (t[i] = Ka(A[i], e));
}
function Ka(A, e) {
  return ce(A) ? A.signal ? e.signalRef(A.signal) : vA("Unsupported object: " + ie(A)) : A;
}
function sv(A, e) {
  return A.signal ? e.signalRef(A.signal) : A.map((t) => Ka(t, e));
}
function AV(A) {
  vA("Can not find data set: " + ie(A));
}
function hWA(A, e, t) {
  if (!A) {
    (e.domainMin != null || e.domainMax != null) && vA("No scale domain defined for domainMin/domainMax to override.");
    return;
  }
  return A.signal ? t.signalRef(A.signal) : (ZA(A) ? LVe : A.fields ? HVe : vVe)(A, e, t);
}
function LVe(A, e, t) {
  return A.map((i) => Ka(i, t));
}
function vVe(A, e, t) {
  const i = t.getData(A.data);
  return i || AV(A.data), bf(e.type) ? i.valuesRef(t, A.field, mWA(A.sort, !1)) : cvA(e.type) ? i.domainRef(t, A.field) : i.extentRef(t, A.field);
}
function HVe(A, e, t) {
  const i = A.data, n = A.fields.reduce((o, g) => (g = Be(g) ? {
    data: i,
    field: g
  } : ZA(g) || g.signal ? SVe(g, t) : g, o.push(g), o), []);
  return (bf(e.type) ? ZVe : cvA(e.type) ? WVe : KVe)(A, t, n);
}
function SVe(A, e) {
  const t = "_:vega:_" + FVe++, i = JC({});
  if (ZA(A))
    i.value = {
      $ingest: A
    };
  else if (A.signal) {
    const n = "setdata(" + ie(t) + "," + A.signal + ")";
    i.params.input = e.signalRef(n);
  }
  return e.addDataPipeline(t, [i, C0({})]), {
    data: t,
    field: "data"
  };
}
function ZVe(A, e, t) {
  const i = mWA(A.sort, !0);
  let n, o;
  const g = t.map((r) => {
    const a = e.getData(r.data);
    return a || AV(r.data), a.countsRef(e, r.field, i);
  }), s = {
    groupby: AP,
    pulse: g
  };
  i && (n = i.op || "count", o = i.field ? $U(n, i.field) : "count", s.ops = [dWA[n]], s.fields = [e.fieldRef(o)], s.as = [o]), n = e.add(BWA(s));
  const I = e.add(JC({
    pulse: Le(n)
  }));
  return o = e.add(RVe({
    field: AP,
    sort: e.sortRef(i),
    pulse: Le(I)
  })), Le(o);
}
function mWA(A, e) {
  return A && (!A.field && !A.op ? ce(A) ? A.field = "key" : A = {
    field: "key"
  } : !A.field && A.op !== "count" ? vA("No field provided for sort aggregate op: " + A.op) : e && A.field && A.op && !dWA[A.op] && vA("Multiple domain scales can not be sorted using " + A.op)), A;
}
function WVe(A, e, t) {
  const i = t.map((n) => {
    const o = e.getData(n.data);
    return o || AV(n.data), o.domainRef(e, n.field);
  });
  return Le(e.add(wVe({
    values: i
  })));
}
function KVe(A, e, t) {
  const i = t.map((n) => {
    const o = e.getData(n.data);
    return o || AV(n.data), o.extentRef(e, n.field);
  });
  return Le(e.add(bVe({
    extents: i
  })));
}
function UVe(A, e) {
  return A.signal || ZA(A) ? sv(A, e) : e.objectProperty(A);
}
function VVe(A) {
  return ce(A) ? {
    interval: Ka(A.interval),
    step: Ka(A.step)
  } : Ka(A);
}
function XVe(A, e) {
  e.interpolate = Ka(A.type || A), A.gamma != null && (e.interpolateGamma = Ka(A.gamma));
}
function pWA(A, e, t) {
  const i = e.config.range;
  let n = A.range;
  if (n.signal)
    return e.signalRef(n.signal);
  if (Be(n)) {
    if (i && Ze(i, n))
      return A = pt({}, A, {
        range: i[n]
      }), pWA(A, e, t);
    n === "width" ? n = [0, {
      signal: "width"
    }] : n === "height" ? n = bf(A.type) ? [0, {
      signal: "height"
    }] : [{
      signal: "height"
    }, 0] : vA("Unrecognized scale range value: " + ie(n));
  } else if (n.scheme) {
    t.scheme = ZA(n.scheme) ? sv(n.scheme, e) : Ka(n.scheme, e), n.extent && (t.schemeExtent = sv(n.extent, e)), n.count && (t.schemeCount = Ka(n.count, e));
    return;
  } else if (n.step) {
    t.rangeStep = Ka(n.step, e);
    return;
  } else {
    if (bf(A.type) && !ZA(n))
      return hWA(n, A, e);
    ZA(n) || vA("Unsupported range type: " + ie(n));
  }
  return n.map((o) => (ZA(o) ? sv : Ka)(o, e));
}
function zVe(A, e) {
  const t = e.config.projection || {}, i = {};
  for (const n in A)
    n !== "name" && (i[n] = tP(A[n], n, e));
  for (const n in t)
    i[n] == null && (i[n] = tP(t[n], n, e));
  e.addProjection(A.name, i);
}
function tP(A, e, t) {
  return ZA(A) ? A.map((i) => tP(i, e, t)) : ce(A) ? A.signal ? t.signalRef(A.signal) : e === "fit" ? A : vA("Unsupported parameter object: " + ie(A)) : A;
}
const NC = "top", tG = "left", iG = "right", id = "bottom", yWA = "center", TVe = "vertical", _Ve = "start", qVe = "middle", OVe = "end", iP = "index", RnA = "label", jVe = "offset", Rf = "perc", PVe = "perc2", Ta = "value", FF = "guide-label", FnA = "guide-title", $Ve = "group-title", AXe = "group-subtitle", HdA = "symbol", Iv = "gradient", nP = "discrete", oP = "size", eXe = "shape", tXe = "fill", iXe = "stroke", nXe = "strokeWidth", oXe = "strokeDash", gXe = "opacity", MnA = [oP, eXe, tXe, iXe, nXe, oXe, gXe], MF = {
  name: 1,
  style: 1,
  interactive: 1
}, _t = {
  value: 0
}, _a = {
  value: 1
}, eV = "group", bWA = "rect", xnA = "rule", sXe = "symbol", B0 = "text";
function l2(A) {
  return A.type = eV, A.interactive = A.interactive || !1, A;
}
function gI(A, e) {
  const t = (i, n) => vr(A[i], vr(e[i], n));
  return t.isVertical = (i) => TVe === vr(A.direction, e.direction || (i ? e.symbolDirection : e.gradientDirection)), t.gradientLength = () => vr(A.gradientLength, e.gradientLength || e.gradientWidth), t.gradientThickness = () => vr(A.gradientThickness, e.gradientThickness || e.gradientHeight), t.entryColumns = () => vr(A.columns, vr(e.columns, +t.isVertical(!0))), t;
}
function wWA(A, e) {
  const t = e && (e.update && e.update[A] || e.enter && e.enter[A]);
  return t && t.signal ? t : t ? t.value : null;
}
function IXe(A, e, t) {
  const i = e.config.style[t];
  return i && i[A];
}
function tV(A, e, t) {
  return `item.anchor === '${_Ve}' ? ${A} : item.anchor === '${OVe}' ? ${e} : ${t}`;
}
const LnA = tV(ie(tG), ie(iG), ie(yWA));
function aXe(A) {
  const e = A("tickBand");
  let t = A("tickOffset"), i, n;
  return e ? e.signal ? (i = {
    signal: `(${e.signal}) === 'extent' ? 1 : 0.5`
  }, n = {
    signal: `(${e.signal}) === 'extent'`
  }, ce(t) || (t = {
    signal: `(${e.signal}) === 'extent' ? 0 : ${t}`
  })) : e === "extent" ? (i = 1, n = !0, t = 0) : (i = 0.5, n = !1) : (i = A("bandPosition"), n = A("tickExtra")), {
    extra: n,
    band: i,
    offset: t
  };
}
function fWA(A, e) {
  return e ? A ? ce(A) ? Object.assign({}, A, {
    offset: fWA(A.offset, e)
  }) : {
    value: A,
    offset: e
  } : e : A;
}
function ta(A, e) {
  return e ? (A.name = e.name, A.style = e.style || A.style, A.interactive = !!e.interactive, A.encode = eG(A.encode, e, MF)) : A.interactive = !1, A;
}
function rXe(A, e, t, i) {
  const n = gI(A, t), o = n.isVertical(), g = n.gradientThickness(), s = n.gradientLength();
  let I, r, a, C, B;
  o ? (r = [0, 1], a = [0, 0], C = g, B = s) : (r = [0, 0], a = [1, 0], C = s, B = g);
  const l = {
    enter: I = {
      opacity: _t,
      x: _t,
      y: _t,
      width: Fo(C),
      height: Fo(B)
    },
    update: pt({}, I, {
      opacity: _a,
      fill: {
        gradient: e,
        start: r,
        stop: a
      }
    }),
    exit: {
      opacity: _t
    }
  };
  return og(l, {
    stroke: n("gradientStrokeColor"),
    strokeWidth: n("gradientStrokeWidth")
  }, {
    // update
    opacity: n("gradientOpacity")
  }), ta({
    type: bWA,
    role: vUe,
    encode: l
  }, i);
}
function CXe(A, e, t, i, n) {
  const o = gI(A, t), g = o.isVertical(), s = o.gradientThickness(), I = o.gradientLength();
  let r, a, C, B, l = "";
  g ? (r = "y", C = "y2", a = "x", B = "width", l = "1-") : (r = "x", C = "x2", a = "y", B = "height");
  const Q = {
    opacity: _t,
    fill: {
      scale: e,
      field: Ta
    }
  };
  Q[r] = {
    signal: l + "datum." + Rf,
    mult: I
  }, Q[a] = _t, Q[C] = {
    signal: l + "datum." + PVe,
    mult: I
  }, Q[B] = Fo(s);
  const E = {
    enter: Q,
    update: pt({}, Q, {
      opacity: _a
    }),
    exit: {
      opacity: _t
    }
  };
  return og(E, {
    stroke: o("gradientStrokeColor"),
    strokeWidth: o("gradientStrokeWidth")
  }, {
    // update
    opacity: o("gradientOpacity")
  }), ta({
    type: bWA,
    role: xUe,
    key: Ta,
    from: n,
    encode: E
  }, i);
}
const BXe = `datum.${Rf}<=0?"${tG}":datum.${Rf}>=1?"${iG}":"${yWA}"`, lXe = `datum.${Rf}<=0?"${id}":datum.${Rf}>=1?"${NC}":"${qVe}"`;
function SdA(A, e, t, i) {
  const n = gI(A, e), o = n.isVertical(), g = Fo(n.gradientThickness()), s = n.gradientLength();
  let I = n("labelOverlap"), r, a, C, B, l = "";
  const Q = {
    enter: r = {
      opacity: _t
    },
    update: a = {
      opacity: _a,
      text: {
        field: RnA
      }
    },
    exit: {
      opacity: _t
    }
  };
  return og(Q, {
    fill: n("labelColor"),
    fillOpacity: n("labelOpacity"),
    font: n("labelFont"),
    fontSize: n("labelFontSize"),
    fontStyle: n("labelFontStyle"),
    fontWeight: n("labelFontWeight"),
    limit: vr(A.labelLimit, e.gradientLabelLimit)
  }), o ? (r.align = {
    value: "left"
  }, r.baseline = a.baseline = {
    signal: lXe
  }, C = "y", B = "x", l = "1-") : (r.align = a.align = {
    signal: BXe
  }, r.baseline = {
    value: "top"
  }, C = "x", B = "y"), r[C] = a[C] = {
    signal: l + "datum." + Rf,
    mult: s
  }, r[B] = a[B] = g, g.offset = vr(A.labelOffset, e.gradientLabelOffset) || 0, I = I ? {
    separation: n("labelSeparation"),
    method: I,
    order: "datum." + iP
  } : void 0, ta({
    type: B0,
    role: gWA,
    style: FF,
    key: Ta,
    from: i,
    encode: Q,
    overlap: I
  }, t);
}
function cXe(A, e, t, i, n) {
  const o = gI(A, e), g = t.entries, s = !!(g && g.interactive), I = g ? g.name : void 0, r = o("clipHeight"), a = o("symbolOffset"), C = {
    data: "value"
  }, B = `(${n}) ? datum.${jVe} : datum.${oP}`, l = r ? Fo(r) : {
    field: oP
  }, Q = `datum.${iP}`, E = `max(1, ${n})`;
  let d, m, y, f, w;
  l.mult = 0.5, d = {
    enter: m = {
      opacity: _t,
      x: {
        signal: B,
        mult: 0.5,
        offset: a
      },
      y: l
    },
    update: y = {
      opacity: _a,
      x: m.x,
      y: m.y
    },
    exit: {
      opacity: _t
    }
  };
  let G = null, R = null;
  A.fill || (G = e.symbolBaseFillColor, R = e.symbolBaseStrokeColor), og(d, {
    fill: o("symbolFillColor", G),
    shape: o("symbolType"),
    size: o("symbolSize"),
    stroke: o("symbolStrokeColor", R),
    strokeDash: o("symbolDash"),
    strokeDashOffset: o("symbolDashOffset"),
    strokeWidth: o("symbolStrokeWidth")
  }, {
    // update
    opacity: o("symbolOpacity")
  }), MnA.forEach((J) => {
    A[J] && (y[J] = m[J] = {
      scale: A[J],
      field: Ta
    });
  });
  const F = ta({
    type: sXe,
    role: HUe,
    key: Ta,
    from: C,
    clip: r ? !0 : void 0,
    encode: d
  }, t.symbols), Z = Fo(a);
  Z.offset = o("labelOffset"), d = {
    enter: m = {
      opacity: _t,
      x: {
        signal: B,
        offset: Z
      },
      y: l
    },
    update: y = {
      opacity: _a,
      text: {
        field: RnA
      },
      x: m.x,
      y: m.y
    },
    exit: {
      opacity: _t
    }
  }, og(d, {
    align: o("labelAlign"),
    baseline: o("labelBaseline"),
    fill: o("labelColor"),
    fillOpacity: o("labelOpacity"),
    font: o("labelFont"),
    fontSize: o("labelFontSize"),
    fontStyle: o("labelFontStyle"),
    fontWeight: o("labelFontWeight"),
    limit: o("labelLimit")
  });
  const c = ta({
    type: B0,
    role: gWA,
    style: FF,
    key: Ta,
    from: C,
    encode: d
  }, t.labels);
  return d = {
    enter: {
      noBound: {
        value: !r
      },
      // ignore width/height in bounds calc
      width: _t,
      height: r ? Fo(r) : _t,
      opacity: _t
    },
    exit: {
      opacity: _t
    },
    update: y = {
      opacity: _a,
      row: {
        signal: null
      },
      column: {
        signal: null
      }
    }
  }, o.isVertical(!0) ? (f = `ceil(item.mark.items.length / ${E})`, y.row.signal = `${Q}%${f}`, y.column.signal = `floor(${Q} / ${f})`, w = {
    field: ["row", Q]
  }) : (y.row.signal = `floor(${Q} / ${E})`, y.column.signal = `${Q} % ${E}`, w = {
    field: Q
  }), y.column.signal = `(${n})?${y.column.signal}:${Q}`, i = {
    facet: {
      data: i,
      name: "value",
      groupby: iP
    }
  }, l2({
    role: JnA,
    from: i,
    encode: eG(d, g, MF),
    marks: [F, c],
    name: I,
    interactive: s,
    sort: w
  });
}
function QXe(A, e) {
  const t = gI(A, e);
  return {
    align: t("gridAlign"),
    columns: t.entryColumns(),
    center: {
      row: !0,
      column: !1
    },
    padding: {
      row: t("rowPadding"),
      column: t("columnPadding")
    }
  };
}
const vnA = 'item.orient === "left"', HnA = 'item.orient === "right"', iV = `(${vnA} || ${HnA})`, EXe = `datum.vgrad && ${iV}`, uXe = tV('"top"', '"bottom"', '"middle"'), dXe = tV('"right"', '"left"', '"center"'), hXe = `datum.vgrad && ${HnA} ? (${dXe}) : (${iV} && !(datum.vgrad && ${vnA})) ? "left" : ${LnA}`, mXe = `item._anchor || (${iV} ? "middle" : "start")`, pXe = `${EXe} ? (${vnA} ? -90 : 90) : 0`, yXe = `${iV} ? (datum.vgrad ? (${HnA} ? "bottom" : "top") : ${uXe}) : "top"`;
function bXe(A, e, t, i) {
  const n = gI(A, e), o = {
    enter: {
      opacity: _t
    },
    update: {
      opacity: _a,
      x: {
        field: {
          group: "padding"
        }
      },
      y: {
        field: {
          group: "padding"
        }
      }
    },
    exit: {
      opacity: _t
    }
  };
  return og(o, {
    orient: n("titleOrient"),
    _anchor: n("titleAnchor"),
    anchor: {
      signal: mXe
    },
    angle: {
      signal: pXe
    },
    align: {
      signal: hXe
    },
    baseline: {
      signal: yXe
    },
    text: A.title,
    fill: n("titleColor"),
    fillOpacity: n("titleOpacity"),
    font: n("titleFont"),
    fontSize: n("titleFontSize"),
    fontStyle: n("titleFontStyle"),
    fontWeight: n("titleFontWeight"),
    limit: n("titleLimit"),
    lineHeight: n("titleLineHeight")
  }, {
    // require update
    align: n("titleAlign"),
    baseline: n("titleBaseline")
  }), ta({
    type: B0,
    role: SUe,
    style: FnA,
    from: i,
    encode: o
  }, t);
}
function wXe(A, e) {
  let t;
  return ce(A) && (A.signal ? t = A.signal : A.path ? t = "pathShape(" + ZdA(A.path) + ")" : A.sphere && (t = "geoShape(" + ZdA(A.sphere) + ', {type: "Sphere"})')), t ? e.signalRef(t) : !!A;
}
function ZdA(A) {
  return ce(A) && A.signal ? A.signal : ie(A);
}
function DWA(A) {
  const e = A.role || "";
  return !e.indexOf("axis") || !e.indexOf("legend") || !e.indexOf("title") ? e : A.type === eV ? JnA : e || GnA;
}
function fXe(A) {
  return {
    marktype: A.type,
    name: A.name || void 0,
    role: A.role || DWA(A),
    zindex: +A.zindex || void 0,
    aria: A.aria,
    description: A.description
  };
}
function DXe(A, e) {
  return A && A.signal ? e.signalRef(A.signal) : A !== !1;
}
function SnA(A, e) {
  const t = ALA(A.type);
  t || vA("Unrecognized transform type: " + ie(A.type));
  const i = PU(t.type.toLowerCase(), null, GWA(t, A, e));
  return A.signal && e.addSignal(A.signal, e.proxy(i)), i.metadata = t.metadata || {}, i;
}
function GWA(A, e, t) {
  const i = {}, n = A.params.length;
  for (let o = 0; o < n; ++o) {
    const g = A.params[o];
    i[g.name] = GXe(g, e, t);
  }
  return i;
}
function GXe(A, e, t) {
  const i = A.type, n = e[A.name];
  if (i === "index")
    return kXe(A, e, t);
  if (n === void 0) {
    A.required && vA("Missing required " + ie(e.type) + " parameter: " + ie(A.name));
    return;
  } else {
    if (i === "param")
      return JXe(A, e, t);
    if (i === "projection")
      return t.projectionRef(e[A.name]);
  }
  return A.array && !Qo(n) ? n.map((o) => WdA(A, o, t)) : WdA(A, n, t);
}
function WdA(A, e, t) {
  const i = A.type;
  if (Qo(e))
    return UdA(i) ? vA("Expression references can not be signals.") : eT(i) ? t.fieldRef(e) : VdA(i) ? t.compareRef(e) : t.signalRef(e.signal);
  {
    const n = A.expr || eT(i);
    return n && NXe(e) ? t.exprRef(e.expr, e.as) : n && YXe(e) ? C2(e.field, e.as) : UdA(i) ? rl(e, t) : RXe(i) ? Le(t.getData(e).values) : eT(i) ? C2(e) : VdA(i) ? t.compareRef(e) : e;
  }
}
function kXe(A, e, t) {
  return Be(e.from) || vA('Lookup "from" parameter must be a string literal.'), t.getData(e.from).lookupRef(t, e.key);
}
function JXe(A, e, t) {
  const i = e[A.name];
  return A.array ? (ZA(i) || vA("Expected an array of sub-parameters. Instead: " + ie(i)), i.map((n) => KdA(A, n, t))) : KdA(A, i, t);
}
function KdA(A, e, t) {
  const i = A.params.length;
  let n;
  for (let g = 0; g < i; ++g) {
    n = A.params[g];
    for (const s in n.key)
      if (n.key[s] !== e[s]) {
        n = null;
        break;
      }
    if (n)
      break;
  }
  n || vA("Unsupported parameter: " + ie(e));
  const o = pt(GWA(n, e, t), n.key);
  return Le(t.add(DVe(o)));
}
const NXe = (A) => A && A.expr, YXe = (A) => A && A.field, RXe = (A) => A === "data", UdA = (A) => A === "expr", eT = (A) => A === "field", VdA = (A) => A === "compare";
function FXe(A, e, t) {
  let i, n, o, g, s;
  return A ? (i = A.facet) && (e || vA("Only group marks can be faceted."), i.field != null ? g = s = av(i, t) : (A.data ? s = Le(t.getData(A.data).aggregate) : (o = SnA(pt({
    type: "aggregate",
    groupby: Ce(i.groupby)
  }, i.aggregate), t), o.params.key = t.keyRef(i.groupby), o.params.pulse = av(i, t), g = s = Le(t.add(o))), n = t.keyRef(i.groupby, !0))) : g = Le(t.add(JC(null, [{}]))), g || (g = av(A, t)), {
    key: n,
    pulse: g,
    parent: s
  };
}
function av(A, e) {
  return A.$ref ? A : A.data && A.data.$ref ? A.data : Le(e.getData(A.data).output);
}
function mp(A, e, t, i, n) {
  this.scope = A, this.input = e, this.output = t, this.values = i, this.aggregate = n, this.index = {};
}
mp.fromEntries = function(A, e) {
  const t = e.length, i = e[t - 1], n = e[t - 2];
  let o = e[0], g = null, s = 1;
  for (o && o.type === "load" && (o = e[1]), A.add(e[0]); s < t; ++s)
    e[s].params.pulse = Le(e[s - 1]), A.add(e[s]), e[s].type === "aggregate" && (g = e[s]);
  return new mp(A, o, n, i, g);
};
function kWA(A) {
  return Be(A) ? A : null;
}
function XdA(A, e, t) {
  const i = $U(t.op, t.field);
  let n;
  if (e.ops) {
    for (let o = 0, g = e.as.length; o < g; ++o)
      if (e.as[o] === i)
        return;
  } else
    e.ops = ["count"], e.fields = [null], e.as = ["count"];
  t.op && (e.ops.push((n = t.op.signal) ? A.signalRef(n) : t.op), e.fields.push(A.fieldRef(t.field)), e.as.push(i));
}
function Yk(A, e, t, i, n, o, g) {
  const s = e[t] || (e[t] = {}), I = tVe(o);
  let r = kWA(n), a, C;
  if (r != null && (A = e.scope, r = r + (I ? "|" + I : ""), a = s[r]), !a) {
    const B = o ? {
      field: AP,
      pulse: e.countsRef(A, n, o)
    } : {
      field: A.fieldRef(n),
      pulse: Le(e.output)
    };
    I && (B.sort = A.sortRef(o)), C = A.add(PU(i, void 0, B)), g && (e.index[n] = C), a = Le(C), r != null && (s[r] = a);
  }
  return a;
}
mp.prototype = {
  countsRef(A, e, t) {
    const i = this, n = i.counts || (i.counts = {}), o = kWA(e);
    let g, s, I;
    return o != null && (A = i.scope, g = n[o]), g ? t && t.field && XdA(A, g.agg.params, t) : (I = {
      groupby: A.fieldRef(e, "key"),
      pulse: Le(i.output)
    }, t && t.field && XdA(A, I, t), s = A.add(BWA(I)), g = A.add(JC({
      pulse: Le(s)
    })), g = {
      agg: s,
      ref: Le(g)
    }, o != null && (n[o] = g)), g.ref;
  },
  tuplesRef() {
    return Le(this.values);
  },
  extentRef(A, e) {
    return Yk(A, this, "extent", "extent", e, !1);
  },
  domainRef(A, e) {
    return Yk(A, this, "domain", "values", e, !1);
  },
  valuesRef(A, e, t) {
    return Yk(A, this, "vals", "values", e, t || !0);
  },
  lookupRef(A, e) {
    return Yk(A, this, "lookup", "tupleindex", e, !1);
  },
  indataRef(A, e) {
    return Yk(A, this, "indata", "tupleindex", e, !0, !0);
  }
};
function MXe(A, e, t) {
  const i = A.from.facet, n = i.name, o = av(i, e);
  let g;
  i.name || vA("Facet must have a name: " + ie(i)), i.data || vA("Facet must reference a data set: " + ie(i)), i.field ? g = e.add(QWA({
    field: e.fieldRef(i.field),
    pulse: o
  })) : i.groupby ? g = e.add(uVe({
    key: e.keyRef(i.groupby),
    group: Le(e.proxy(t.parent)),
    pulse: o
  })) : vA("Facet must specify groupby or field: " + ie(i));
  const s = e.fork(), I = s.add(JC()), r = s.add(C0({
    pulse: Le(I)
  }));
  s.addData(n, new mp(s, I, I, r)), s.addSignal("parent", null), g.params.subflow = {
    $subflow: s.parse(A).toRuntime()
  };
}
function xXe(A, e, t) {
  const i = e.add(QWA({
    pulse: t.pulse
  })), n = e.fork();
  n.add(C0()), n.addSignal("parent", null), i.params.subflow = {
    $subflow: n.parse(A).toRuntime()
  };
}
function JWA(A, e, t) {
  const i = A.remove, n = A.insert, o = A.toggle, g = A.modify, s = A.values, I = e.add(bZ()), r = "if(" + A.trigger + ',modify("' + t + '",' + [n, i, o, g, s].map((C) => C ?? "null").join(",") + "),0)", a = rl(r, e);
  I.update = a.$expr, I.params = a.$params;
}
function nV(A, e) {
  const t = DWA(A), i = A.type === eV, n = A.from && A.from.facet, o = A.overlap;
  let g = A.layout || t === JnA || t === knA, s, I, r, a, C, B, l;
  const Q = t === GnA || g || n, E = FXe(A.from, i, e);
  I = e.add(QVe({
    key: E.key || (A.key ? C2(A.key) : void 0),
    pulse: E.pulse,
    clean: !i
  }));
  const d = Le(I);
  I = r = e.add(JC({
    pulse: d
  })), I = e.add(yVe({
    markdef: fXe(A),
    interactive: DXe(A.interactive, e),
    clip: wXe(A.clip, e),
    context: {
      $context: !0
    },
    groups: e.lookup(),
    parent: e.signals.parent ? e.signalRef("parent") : null,
    index: e.markpath(),
    pulse: Le(I)
  }));
  const m = Le(I);
  I = a = e.add(cWA(rWA(A.encode, A.type, t, A.style, e, {
    mod: !1,
    pulse: m
  }))), I.params.parent = e.encode(), A.transform && A.transform.forEach((R) => {
    const F = SnA(R, e), Z = F.metadata;
    (Z.generates || Z.changes) && vA("Mark transforms should not generate new data."), Z.nomod || (a.params.mod = !0), F.params.pulse = Le(I), e.add(I = F);
  }), A.sort && (I = e.add(YVe({
    sort: e.compareRef(A.sort),
    pulse: Le(I)
  })));
  const y = Le(I);
  (n || g) && (g = e.add(uWA({
    layout: e.objectProperty(A.layout),
    legends: e.legends,
    mark: m,
    pulse: y
  })), B = Le(g));
  const f = e.add(lWA({
    mark: m,
    pulse: B || y
  }));
  l = Le(f), i && (Q && (s = e.operators, s.pop(), g && s.pop()), e.pushState(y, B || l, d), n ? MXe(A, e, E) : Q ? xXe(A, e, E) : e.parse(A), e.popState(), Q && (g && s.push(g), s.push(f))), o && (l = LXe(o, l, e));
  const w = e.add(EWA({
    pulse: l
  })), G = e.add(C0({
    pulse: Le(w)
  }, void 0, e.parent()));
  A.name != null && (C = A.name, e.addData(C, new mp(e, r, w, G)), A.on && A.on.forEach((R) => {
    (R.insert || R.remove || R.toggle) && vA("Marks only support modify triggers."), JWA(R, e, C);
  }));
}
function LXe(A, e, t) {
  const i = A.method, n = A.bound, o = A.separation, g = {
    separation: Qo(o) ? t.signalRef(o.signal) : o,
    method: Qo(i) ? t.signalRef(i.signal) : i,
    pulse: e
  };
  if (A.order && (g.sort = t.compareRef({
    field: A.order
  })), n) {
    const s = n.tolerance;
    g.boundTolerance = Qo(s) ? t.signalRef(s.signal) : +s, g.boundScale = t.scaleRef(n.scale), g.boundOrient = n.orient;
  }
  return Le(t.add(fVe(g)));
}
function vXe(A, e) {
  const t = e.config.legend, i = A.encode || {}, n = gI(A, t), o = i.legend || {}, g = o.name || void 0, s = o.interactive, I = o.style, r = {};
  let a = 0, C, B, l;
  MnA.forEach((f) => A[f] ? (r[f] = A[f], a = a || A[f]) : 0), a || vA("Missing valid scale for legend.");
  const Q = HXe(A, e.scaleType(a)), E = {
    title: A.title != null,
    scales: r,
    type: Q,
    vgrad: Q !== "symbol" && n.isVertical()
  }, d = Le(e.add(JC(null, [E]))), m = {
    enter: {
      x: {
        value: 0
      },
      y: {
        value: 0
      }
    }
  }, y = Le(e.add(mVe(B = {
    type: Q,
    scale: e.scaleRef(a),
    count: e.objectProperty(n("tickCount")),
    limit: e.property(n("symbolLimit")),
    values: e.objectProperty(A.values),
    minstep: e.property(A.tickMinStep),
    formatType: e.property(A.formatType),
    formatSpecifier: e.property(A.format)
  })));
  return Q === Iv ? (l = [rXe(A, a, t, i.gradient), SdA(A, t, i.labels, y)], B.count = B.count || e.signalRef(`max(2,2*floor((${vm(n.gradientLength())})/100))`)) : Q === nP ? l = [CXe(A, a, t, i.gradient, y), SdA(A, t, i.labels, y)] : (C = QXe(A, t), l = [cXe(A, t, i, y, vm(C.columns))], B.size = WXe(A, e, l[0].marks)), l = [l2({
    role: LUe,
    from: d,
    encode: m,
    marks: l,
    layout: C,
    interactive: s
  })], E.title && l.push(bXe(A, t, i.title, d)), nV(l2({
    role: MUe,
    from: d,
    encode: eG(ZXe(n, A, t), o, MF),
    marks: l,
    aria: n("aria"),
    description: n("description"),
    zindex: n("zindex"),
    name: g,
    interactive: s,
    style: I
  }), e);
}
function HXe(A, e) {
  let t = A.type || HdA;
  return !A.type && SXe(A) === 1 && (A.fill || A.stroke) && (t = MtA(e) ? Iv : qO(e) ? nP : HdA), t !== Iv ? t : qO(e) ? nP : Iv;
}
function SXe(A) {
  return MnA.reduce((e, t) => e + (A[t] ? 1 : 0), 0);
}
function ZXe(A, e, t) {
  const i = {
    enter: {},
    update: {}
  };
  return og(i, {
    orient: A("orient"),
    offset: A("offset"),
    padding: A("padding"),
    titlePadding: A("titlePadding"),
    cornerRadius: A("cornerRadius"),
    fill: A("fillColor"),
    stroke: A("strokeColor"),
    strokeWidth: t.strokeWidth,
    strokeDash: t.strokeDash,
    x: A("legendX"),
    y: A("legendY"),
    // accessibility support
    format: e.format,
    formatType: e.formatType
  }), i;
}
function WXe(A, e, t) {
  const i = vm(zdA("size", A, t)), n = vm(zdA("strokeWidth", A, t)), o = vm(KXe(t[1].encode, e, FF));
  return rl(`max(ceil(sqrt(${i})+${n}),${o})`, e);
}
function zdA(A, e, t) {
  return e[A] ? `scale("${e[A]}",datum)` : wWA(A, t[0].encode);
}
function KXe(A, e, t) {
  return wWA("fontSize", A) || IXe("fontSize", e, t);
}
const UXe = `item.orient==="${tG}"?-90:item.orient==="${iG}"?90:0`;
function VXe(A, e) {
  A = Be(A) ? {
    text: A
  } : A;
  const t = gI(A, e.config.title), i = A.encode || {}, n = i.group || {}, o = n.name || void 0, g = n.interactive, s = n.style, I = [], r = {}, a = Le(e.add(JC(null, [r])));
  return I.push(TXe(A, t, XXe(A), a)), A.subtitle && I.push(_Xe(A, t, i.subtitle, a)), nV(l2({
    role: ZUe,
    from: a,
    encode: zXe(t, n),
    marks: I,
    aria: t("aria"),
    description: t("description"),
    zindex: t("zindex"),
    name: o,
    interactive: g,
    style: s
  }), e);
}
function XXe(A) {
  const e = A.encode;
  return e && e.title || pt({
    name: A.name,
    interactive: A.interactive,
    style: A.style
  }, e);
}
function zXe(A, e) {
  const t = {
    enter: {},
    update: {}
  };
  return og(t, {
    orient: A("orient"),
    anchor: A("anchor"),
    align: {
      signal: LnA
    },
    angle: {
      signal: UXe
    },
    limit: A("limit"),
    frame: A("frame"),
    offset: A("offset") || 0,
    padding: A("subtitlePadding")
  }), eG(t, e, MF);
}
function TXe(A, e, t, i) {
  const n = {
    value: 0
  }, o = A.text, g = {
    enter: {
      opacity: n
    },
    update: {
      opacity: {
        value: 1
      }
    },
    exit: {
      opacity: n
    }
  };
  return og(g, {
    text: o,
    align: {
      signal: "item.mark.group.align"
    },
    angle: {
      signal: "item.mark.group.angle"
    },
    limit: {
      signal: "item.mark.group.limit"
    },
    baseline: "top",
    dx: e("dx"),
    dy: e("dy"),
    fill: e("color"),
    font: e("font"),
    fontSize: e("fontSize"),
    fontStyle: e("fontStyle"),
    fontWeight: e("fontWeight"),
    lineHeight: e("lineHeight")
  }, {
    // update
    align: e("align"),
    angle: e("angle"),
    baseline: e("baseline")
  }), ta({
    type: B0,
    role: WUe,
    style: $Ve,
    from: i,
    encode: g
  }, t);
}
function _Xe(A, e, t, i) {
  const n = {
    value: 0
  }, o = A.subtitle, g = {
    enter: {
      opacity: n
    },
    update: {
      opacity: {
        value: 1
      }
    },
    exit: {
      opacity: n
    }
  };
  return og(g, {
    text: o,
    align: {
      signal: "item.mark.group.align"
    },
    angle: {
      signal: "item.mark.group.angle"
    },
    limit: {
      signal: "item.mark.group.limit"
    },
    baseline: "top",
    dx: e("dx"),
    dy: e("dy"),
    fill: e("subtitleColor"),
    font: e("subtitleFont"),
    fontSize: e("subtitleFontSize"),
    fontStyle: e("subtitleFontStyle"),
    fontWeight: e("subtitleFontWeight"),
    lineHeight: e("subtitleLineHeight")
  }, {
    // update
    align: e("align"),
    angle: e("angle"),
    baseline: e("baseline")
  }), ta({
    type: B0,
    role: KUe,
    style: AXe,
    from: i,
    encode: g
  }, t);
}
function qXe(A, e) {
  const t = [];
  A.transform && A.transform.forEach((i) => {
    t.push(SnA(i, e));
  }), A.on && A.on.forEach((i) => {
    JWA(i, e, A.name);
  }), e.addDataPipeline(A.name, OXe(A, e, t));
}
function OXe(A, e, t) {
  const i = [];
  let n = null, o = !1, g = !1, s, I, r, a, C;
  for (A.values ? Qo(A.values) || gv(A.format) ? (i.push(TdA(e, A)), i.push(n = Gh())) : i.push(n = Gh({
    $ingest: A.values,
    $format: A.format
  })) : A.url ? gv(A.url) || gv(A.format) ? (i.push(TdA(e, A)), i.push(n = Gh())) : i.push(n = Gh({
    $request: A.url,
    $format: A.format
  })) : A.source && (n = s = Ce(A.source).map((B) => Le(e.getData(B).output)), i.push(null)), I = 0, r = t.length; I < r; ++I)
    a = t[I], C = a.metadata, !n && !C.source && i.push(n = Gh()), i.push(a), C.generates && (g = !0), C.modifies && !g && (o = !0), C.source ? n = a : C.changes && (n = null);
  return s && (r = s.length - 1, i[0] = JVe({
    derive: o,
    pulse: r ? s : s[0]
  }), (o || r) && i.splice(1, 0, Gh())), n || i.push(Gh()), i.push(C0({})), i;
}
function Gh(A) {
  const e = JC({}, A);
  return e.metadata = {
    source: !0
  }, e;
}
function TdA(A, e) {
  return pVe({
    url: e.url ? A.property(e.url) : void 0,
    async: e.async ? A.property(e.async) : void 0,
    values: e.values ? A.property(e.values) : void 0,
    format: A.objectProperty(e.format)
  });
}
const NWA = (A) => A === id || A === NC, oV = (A, e, t) => Qo(A) ? A9e(A.signal, e, t) : A === tG || A === NC ? e : t, Mo = (A, e, t) => Qo(A) ? PXe(A.signal, e, t) : NWA(A) ? e : t, IC = (A, e, t) => Qo(A) ? $Xe(A.signal, e, t) : NWA(A) ? t : e, YWA = (A, e, t) => Qo(A) ? e9e(A.signal, e, t) : A === NC ? {
  value: e
} : {
  value: t
}, jXe = (A, e, t) => Qo(A) ? t9e(A.signal, e, t) : A === iG ? {
  value: e
} : {
  value: t
}, PXe = (A, e, t) => RWA(`${A} === '${NC}' || ${A} === '${id}'`, e, t), $Xe = (A, e, t) => RWA(`${A} !== '${NC}' && ${A} !== '${id}'`, e, t), A9e = (A, e, t) => ZnA(`${A} === '${tG}' || ${A} === '${NC}'`, e, t), e9e = (A, e, t) => ZnA(`${A} === '${NC}'`, e, t), t9e = (A, e, t) => ZnA(`${A} === '${iG}'`, e, t), RWA = (A, e, t) => (e = e != null ? Fo(e) : e, t = t != null ? Fo(t) : t, _dA(e) && _dA(t) ? (e = e ? e.signal || ie(e.value) : null, t = t ? t.signal || ie(t.value) : null, {
  signal: `${A} ? (${e}) : (${t})`
}) : [pt({
  test: A
}, e)].concat(t || [])), _dA = (A) => A == null || Object.keys(A).length === 1, ZnA = (A, e, t) => ({
  signal: `${A} ? (${Ub(e)}) : (${Ub(t)})`
}), i9e = (A, e, t, i, n) => ({
  signal: (i != null ? `${A} === '${tG}' ? (${Ub(i)}) : ` : "") + (t != null ? `${A} === '${id}' ? (${Ub(t)}) : ` : "") + (n != null ? `${A} === '${iG}' ? (${Ub(n)}) : ` : "") + (e != null ? `${A} === '${NC}' ? (${Ub(e)}) : ` : "") + "(null)"
}), Ub = (A) => Qo(A) ? A.signal : A == null ? null : ie(A), n9e = (A, e) => e === 0 ? 0 : Qo(A) ? {
  signal: `(${A.signal}) * ${e}`
} : {
  value: A * e
}, Bw = (A, e) => {
  const t = A.signal;
  return t && t.endsWith("(null)") ? {
    signal: t.slice(0, -6) + e.signal
  } : A;
};
function dy(A, e, t, i) {
  let n;
  if (e && Ze(e, A))
    return e[A];
  if (Ze(t, A))
    return t[A];
  if (A.startsWith("title")) {
    switch (A) {
      case "titleColor":
        n = "fill";
        break;
      case "titleFont":
      case "titleFontSize":
      case "titleFontWeight":
        n = A[5].toLowerCase() + A.slice(6);
    }
    return i[FnA][n];
  } else if (A.startsWith("label")) {
    switch (A) {
      case "labelColor":
        n = "fill";
        break;
      case "labelFont":
      case "labelFontSize":
        n = A[5].toLowerCase() + A.slice(6);
    }
    return i[FF][n];
  }
  return null;
}
function qdA(A) {
  const e = {};
  for (const t of A)
    if (t)
      for (const i in t)
        e[i] = 1;
  return Object.keys(e);
}
function o9e(A, e) {
  var t = e.config, i = t.style, n = t.axis, o = e.scaleType(A.scale) === "band" && t.axisBand, g = A.orient, s, I, r;
  if (Qo(g)) {
    const a = qdA([t.axisX, t.axisY]), C = qdA([t.axisTop, t.axisBottom, t.axisLeft, t.axisRight]);
    s = {};
    for (r of a)
      s[r] = Mo(g, dy(r, t.axisX, n, i), dy(r, t.axisY, n, i));
    I = {};
    for (r of C)
      I[r] = i9e(g.signal, dy(r, t.axisTop, n, i), dy(r, t.axisBottom, n, i), dy(r, t.axisLeft, n, i), dy(r, t.axisRight, n, i));
  } else
    s = g === NC || g === id ? t.axisX : t.axisY, I = t["axis" + g[0].toUpperCase() + g.slice(1)];
  return s || I || o ? pt({}, n, s, I, o) : n;
}
function g9e(A, e, t, i) {
  const n = gI(A, e), o = A.orient;
  let g, s;
  const I = {
    enter: g = {
      opacity: _t
    },
    update: s = {
      opacity: _a
    },
    exit: {
      opacity: _t
    }
  };
  og(I, {
    stroke: n("domainColor"),
    strokeCap: n("domainCap"),
    strokeDash: n("domainDash"),
    strokeDashOffset: n("domainDashOffset"),
    strokeWidth: n("domainWidth"),
    strokeOpacity: n("domainOpacity")
  });
  const r = OdA(A, 0), a = OdA(A, 1);
  return g.x = s.x = Mo(o, r, _t), g.x2 = s.x2 = Mo(o, a), g.y = s.y = IC(o, r, _t), g.y2 = s.y2 = IC(o, a), ta({
    type: xnA,
    role: JUe,
    from: i,
    encode: I
  }, t);
}
function OdA(A, e) {
  return {
    scale: A.scale,
    range: e
  };
}
function s9e(A, e, t, i, n) {
  const o = gI(A, e), g = A.orient, s = A.gridScale, I = oV(g, 1, -1), r = I9e(A.offset, I);
  let a, C, B;
  const l = {
    enter: a = {
      opacity: _t
    },
    update: B = {
      opacity: _a
    },
    exit: C = {
      opacity: _t
    }
  };
  og(l, {
    stroke: o("gridColor"),
    strokeCap: o("gridCap"),
    strokeDash: o("gridDash"),
    strokeDashOffset: o("gridDashOffset"),
    strokeOpacity: o("gridOpacity"),
    strokeWidth: o("gridWidth")
  });
  const Q = {
    scale: A.scale,
    field: Ta,
    band: n.band,
    extra: n.extra,
    offset: n.offset,
    round: o("tickRound")
  }, E = Mo(g, {
    signal: "height"
  }, {
    signal: "width"
  }), d = s ? {
    scale: s,
    range: 0,
    mult: I,
    offset: r
  } : {
    value: 0,
    offset: r
  }, m = s ? {
    scale: s,
    range: 1,
    mult: I,
    offset: r
  } : pt(E, {
    mult: I,
    offset: r
  });
  return a.x = B.x = Mo(g, Q, d), a.y = B.y = IC(g, Q, d), a.x2 = B.x2 = IC(g, m), a.y2 = B.y2 = Mo(g, m), C.x = Mo(g, Q), C.y = IC(g, Q), ta({
    type: xnA,
    role: NUe,
    key: Ta,
    from: i,
    encode: l
  }, t);
}
function I9e(A, e) {
  if (e !== 1)
    if (!ce(A))
      A = Qo(e) ? {
        signal: `(${e.signal}) * (${A || 0})`
      } : e * (A || 0);
    else {
      let t = A = pt({}, A);
      for (; t.mult != null; )
        if (ce(t.mult))
          t = t.mult = pt({}, t.mult);
        else
          return t.mult = Qo(e) ? {
            signal: `(${t.mult}) * (${e.signal})`
          } : t.mult * e, A;
      t.mult = e;
    }
  return A;
}
function a9e(A, e, t, i, n, o) {
  const g = gI(A, e), s = A.orient, I = oV(s, -1, 1);
  let r, a, C;
  const B = {
    enter: r = {
      opacity: _t
    },
    update: C = {
      opacity: _a
    },
    exit: a = {
      opacity: _t
    }
  };
  og(B, {
    stroke: g("tickColor"),
    strokeCap: g("tickCap"),
    strokeDash: g("tickDash"),
    strokeDashOffset: g("tickDashOffset"),
    strokeOpacity: g("tickOpacity"),
    strokeWidth: g("tickWidth")
  });
  const l = Fo(n);
  l.mult = I;
  const Q = {
    scale: A.scale,
    field: Ta,
    band: o.band,
    extra: o.extra,
    offset: o.offset,
    round: g("tickRound")
  };
  return C.y = r.y = Mo(s, _t, Q), C.y2 = r.y2 = Mo(s, l), a.x = Mo(s, Q), C.x = r.x = IC(s, _t, Q), C.x2 = r.x2 = IC(s, l), a.y = IC(s, Q), ta({
    type: xnA,
    role: RUe,
    key: Ta,
    from: i,
    encode: B
  }, t);
}
function tT(A, e, t, i, n) {
  return {
    signal: 'flush(range("' + A + '"), scale("' + A + '", datum.value), ' + e + "," + t + "," + i + "," + n + ")"
  };
}
function r9e(A, e, t, i, n, o) {
  const g = gI(A, e), s = A.orient, I = A.scale, r = oV(s, -1, 1), a = vm(g("labelFlush")), C = vm(g("labelFlushOffset")), B = g("labelAlign"), l = g("labelBaseline");
  let Q = a === 0 || !!a, E;
  const d = Fo(n);
  d.mult = r, d.offset = Fo(g("labelPadding") || 0), d.offset.mult = r;
  const m = {
    scale: I,
    field: Ta,
    band: 0.5,
    offset: fWA(o.offset, g("labelOffset"))
  }, y = Mo(s, Q ? tT(I, a, '"left"', '"right"', '"center"') : {
    value: "center"
  }, jXe(s, "left", "right")), f = Mo(s, YWA(s, "bottom", "top"), Q ? tT(I, a, '"top"', '"bottom"', '"middle"') : {
    value: "middle"
  }), w = tT(I, a, `-(${C})`, C, 0);
  Q = Q && C;
  const G = {
    opacity: _t,
    x: Mo(s, m, d),
    y: IC(s, m, d)
  }, R = {
    enter: G,
    update: E = {
      opacity: _a,
      text: {
        field: RnA
      },
      x: G.x,
      y: G.y,
      align: y,
      baseline: f
    },
    exit: {
      opacity: _t,
      x: G.x,
      y: G.y
    }
  };
  og(R, {
    dx: !B && Q ? Mo(s, w) : null,
    dy: !l && Q ? IC(s, w) : null
  }), og(R, {
    angle: g("labelAngle"),
    fill: g("labelColor"),
    fillOpacity: g("labelOpacity"),
    font: g("labelFont"),
    fontSize: g("labelFontSize"),
    fontWeight: g("labelFontWeight"),
    fontStyle: g("labelFontStyle"),
    limit: g("labelLimit"),
    lineHeight: g("labelLineHeight")
  }, {
    align: B,
    baseline: l
  });
  const F = g("labelBound");
  let Z = g("labelOverlap");
  return Z = Z || F ? {
    separation: g("labelSeparation"),
    method: Z,
    order: "datum.index",
    bound: F ? {
      scale: I,
      orient: s,
      tolerance: F
    } : null
  } : void 0, E.align !== y && (E.align = Bw(E.align, y)), E.baseline !== f && (E.baseline = Bw(E.baseline, f)), ta({
    type: B0,
    role: YUe,
    style: FF,
    key: Ta,
    from: i,
    encode: R,
    overlap: Z
  }, t);
}
function C9e(A, e, t, i) {
  const n = gI(A, e), o = A.orient, g = oV(o, -1, 1);
  let s, I;
  const r = {
    enter: s = {
      opacity: _t,
      anchor: Fo(n("titleAnchor", null)),
      align: {
        signal: LnA
      }
    },
    update: I = pt({}, s, {
      opacity: _a,
      text: Fo(A.title)
    }),
    exit: {
      opacity: _t
    }
  }, a = {
    signal: `lerp(range("${A.scale}"), ${tV(0, 1, 0.5)})`
  };
  return I.x = Mo(o, a), I.y = IC(o, a), s.angle = Mo(o, _t, n9e(g, 90)), s.baseline = Mo(o, YWA(o, id, NC), {
    value: id
  }), I.angle = s.angle, I.baseline = s.baseline, og(r, {
    fill: n("titleColor"),
    fillOpacity: n("titleOpacity"),
    font: n("titleFont"),
    fontSize: n("titleFontSize"),
    fontStyle: n("titleFontStyle"),
    fontWeight: n("titleFontWeight"),
    limit: n("titleLimit"),
    lineHeight: n("titleLineHeight")
  }, {
    // require update
    align: n("titleAlign"),
    angle: n("titleAngle"),
    baseline: n("titleBaseline")
  }), B9e(n, o, r, t), r.update.align = Bw(r.update.align, s.align), r.update.angle = Bw(r.update.angle, s.angle), r.update.baseline = Bw(r.update.baseline, s.baseline), ta({
    type: B0,
    role: FUe,
    style: FnA,
    from: i,
    encode: r
  }, t);
}
function B9e(A, e, t, i) {
  const n = (s, I) => s != null ? (t.update[I] = Bw(Fo(s), t.update[I]), !1) : !zy(I, i), o = n(A("titleX"), "x"), g = n(A("titleY"), "y");
  t.enter.auto = g === o ? Fo(g) : Mo(e, Fo(g), Fo(o));
}
function l9e(A, e) {
  const t = o9e(A, e), i = A.encode || {}, n = i.axis || {}, o = n.name || void 0, g = n.interactive, s = n.style, I = gI(A, t), r = aXe(I), a = {
    scale: A.scale,
    ticks: !!I("ticks"),
    labels: !!I("labels"),
    grid: !!I("grid"),
    domain: !!I("domain"),
    title: A.title != null
  }, C = Le(e.add(JC({}, [a]))), B = Le(e.add(cVe({
    scale: e.scaleRef(A.scale),
    extra: e.property(r.extra),
    count: e.objectProperty(A.tickCount),
    values: e.objectProperty(A.values),
    minstep: e.property(A.tickMinStep),
    formatType: e.property(A.formatType),
    formatSpecifier: e.property(A.format)
  }))), l = [];
  let Q;
  return a.grid && l.push(s9e(A, t, i.grid, B, r)), a.ticks && (Q = I("tickSize"), l.push(a9e(A, t, i.ticks, B, Q, r))), a.labels && (Q = a.ticks ? Q : 0, l.push(r9e(A, t, i.labels, B, Q, r))), a.domain && l.push(g9e(A, t, i.domain, C)), a.title && l.push(C9e(A, t, i.title, C)), nV(l2({
    role: kUe,
    from: C,
    encode: eG(c9e(I, A), n, MF),
    marks: l,
    aria: I("aria"),
    description: I("description"),
    zindex: I("zindex"),
    name: o,
    interactive: g,
    style: s
  }), e);
}
function c9e(A, e) {
  const t = {
    enter: {},
    update: {}
  };
  return og(t, {
    orient: A("orient"),
    offset: A("offset") || 0,
    position: vr(e.position, 0),
    titlePadding: A("titlePadding"),
    minExtent: A("minExtent"),
    maxExtent: A("maxExtent"),
    range: {
      signal: `abs(span(range("${e.scale}")))`
    },
    translate: A("translate"),
    // accessibility support
    format: e.format,
    formatType: e.formatType
  }), t;
}
function FWA(A, e, t) {
  const i = Ce(A.signals), n = Ce(A.scales);
  return t || i.forEach((o) => CWA(o, e)), Ce(A.projections).forEach((o) => zVe(o, e)), n.forEach((o) => MVe(o, e)), Ce(A.data).forEach((o) => qXe(o, e)), n.forEach((o) => xVe(o, e)), (t || i).forEach((o) => lVe(o, e)), Ce(A.axes).forEach((o) => l9e(o, e)), Ce(A.marks).forEach((o) => nV(o, e)), Ce(A.legends).forEach((o) => vXe(o, e)), A.title && VXe(A.title, e), e.parseLambdas(), e;
}
const Q9e = (A) => eG({
  enter: {
    x: {
      value: 0
    },
    y: {
      value: 0
    }
  },
  update: {
    width: {
      signal: "width"
    },
    height: {
      signal: "height"
    }
  }
}, A);
function E9e(A, e) {
  const t = e.config, i = Le(e.root = e.add(bZ())), n = u9e(A, t);
  n.forEach((r) => CWA(r, e)), e.description = A.description || t.description, e.eventConfig = t.events, e.legends = e.objectProperty(t.legend && t.legend.layout), e.locale = t.locale;
  const o = e.add(JC()), g = e.add(cWA(rWA(Q9e(A.encode), eV, knA, A.style, e, {
    pulse: Le(o)
  }))), s = e.add(uWA({
    layout: e.objectProperty(A.layout),
    legends: e.legends,
    autosize: e.signalRef("autosize"),
    mark: i,
    pulse: Le(g)
  }));
  e.operators.pop(), e.pushState(Le(g), Le(s), null), FWA(A, e, n), e.operators.push(s);
  let I = e.add(lWA({
    mark: i,
    pulse: Le(s)
  }));
  return I = e.add(EWA({
    pulse: Le(I)
  })), I = e.add(C0({
    pulse: Le(I)
  })), e.addData("root", new mp(e, o, o, I)), e;
}
function Rk(A, e) {
  return e && e.signal ? {
    name: A,
    update: e.signal
  } : {
    name: A,
    value: e
  };
}
function u9e(A, e) {
  const t = (g) => vr(A[g], e[g]), i = [Rk("background", t("background")), Rk("autosize", fUe(t("autosize"))), Rk("padding", GUe(t("padding"))), Rk("width", t("width") || 0), Rk("height", t("height") || 0)], n = i.reduce((g, s) => (g[s.name] = s, g), {}), o = {};
  return Ce(A.signals).forEach((g) => {
    Ze(n, g.name) ? g = pt(n[g.name], g) : i.push(g), o[g.name] = g;
  }), Ce(e.signals).forEach((g) => {
    !Ze(o, g.name) && !Ze(n, g.name) && i.push(g);
  }), i;
}
function MWA(A, e) {
  this.config = A || {}, this.options = e || {}, this.bindings = [], this.field = {}, this.signals = {}, this.lambdas = {}, this.scales = {}, this.events = {}, this.data = {}, this.streams = [], this.updates = [], this.operators = [], this.eventConfig = null, this.locale = null, this._id = 0, this._subid = 0, this._nextsub = [0], this._parent = [], this._encode = [], this._lookup = [], this._markpath = [];
}
function jdA(A) {
  this.config = A.config, this.options = A.options, this.legends = A.legends, this.field = Object.create(A.field), this.signals = Object.create(A.signals), this.lambdas = Object.create(A.lambdas), this.scales = Object.create(A.scales), this.events = Object.create(A.events), this.data = Object.create(A.data), this.streams = [], this.updates = [], this.operators = [], this._id = 0, this._subid = ++A._nextsub[0], this._nextsub = A._nextsub, this._parent = A._parent.slice(), this._encode = A._encode.slice(), this._lookup = A._lookup.slice(), this._markpath = A._markpath;
}
MWA.prototype = jdA.prototype = {
  parse(A) {
    return FWA(A, this);
  },
  fork() {
    return new jdA(this);
  },
  isSubscope() {
    return this._subid > 0;
  },
  toRuntime() {
    return this.finish(), {
      description: this.description,
      operators: this.operators,
      streams: this.streams,
      updates: this.updates,
      bindings: this.bindings,
      eventConfig: this.eventConfig,
      locale: this.locale
    };
  },
  id() {
    return (this._subid ? this._subid + ":" : 0) + this._id++;
  },
  add(A) {
    return this.operators.push(A), A.id = this.id(), A.refs && (A.refs.forEach((e) => {
      e.$ref = A.id;
    }), A.refs = null), A;
  },
  proxy(A) {
    const e = A instanceof $j ? Le(A) : A;
    return this.add(kVe({
      value: e
    }));
  },
  addStream(A) {
    return this.streams.push(A), A.id = this.id(), A;
  },
  addUpdate(A) {
    return this.updates.push(A), A;
  },
  // Apply metadata
  finish() {
    let A, e;
    this.root && (this.root.root = !0);
    for (A in this.signals)
      this.signals[A].signal = A;
    for (A in this.scales)
      this.scales[A].scale = A;
    function t(i, n, o) {
      let g, s;
      i && (g = i.data || (i.data = {}), s = g[n] || (g[n] = []), s.push(o));
    }
    for (A in this.data) {
      e = this.data[A], t(e.input, A, "input"), t(e.output, A, "output"), t(e.values, A, "values");
      for (const i in e.index)
        t(e.index[i], A, "index:" + i);
    }
    return this;
  },
  // ----
  pushState(A, e, t) {
    this._encode.push(Le(this.add(C0({
      pulse: A
    })))), this._parent.push(e), this._lookup.push(t ? Le(this.proxy(t)) : null), this._markpath.push(-1);
  },
  popState() {
    this._encode.pop(), this._parent.pop(), this._lookup.pop(), this._markpath.pop();
  },
  parent() {
    return Xt(this._parent);
  },
  encode() {
    return Xt(this._encode);
  },
  lookup() {
    return Xt(this._lookup);
  },
  markpath() {
    const A = this._markpath;
    return ++A[A.length - 1];
  },
  // ----
  fieldRef(A, e) {
    if (Be(A))
      return C2(A, e);
    A.signal || vA("Unsupported field reference: " + ie(A));
    const t = A.signal;
    let i = this.field[t];
    if (!i) {
      const n = {
        name: this.signalRef(t)
      };
      e && (n.as = e), this.field[t] = i = Le(this.add(dVe(n)));
    }
    return i;
  },
  compareRef(A) {
    let e = !1;
    const t = (o) => Qo(o) ? (e = !0, this.signalRef(o.signal)) : iVe(o) ? (e = !0, this.exprRef(o.expr)) : o, i = Ce(A.field).map(t), n = Ce(A.order).map(t);
    return e ? Le(this.add(vdA({
      fields: i,
      orders: n
    }))) : xdA(i, n);
  },
  keyRef(A, e) {
    let t = !1;
    const i = (o) => Qo(o) ? (t = !0, Le(n[o.signal])) : o, n = this.signals;
    return A = Ce(A).map(i), t ? Le(this.add(hVe({
      fields: A,
      flat: e
    }))) : $Ue(A, e);
  },
  sortRef(A) {
    if (!A)
      return A;
    const e = $U(A.op, A.field), t = A.order || AVe;
    return t.signal ? Le(this.add(vdA({
      fields: e,
      orders: this.signalRef(t.signal)
    }))) : xdA(e, t);
  },
  // ----
  event(A, e) {
    const t = A + ":" + e;
    if (!this.events[t]) {
      const i = this.id();
      this.streams.push({
        id: i,
        source: A,
        type: e
      }), this.events[t] = i;
    }
    return this.events[t];
  },
  // ----
  hasOwnSignal(A) {
    return Ze(this.signals, A);
  },
  addSignal(A, e) {
    this.hasOwnSignal(A) && vA("Duplicate signal name: " + ie(A));
    const t = e instanceof $j ? e : this.add(bZ(e));
    return this.signals[A] = t;
  },
  getSignal(A) {
    return this.signals[A] || vA("Unrecognized signal name: " + ie(A)), this.signals[A];
  },
  signalRef(A) {
    return this.signals[A] ? Le(this.signals[A]) : (Ze(this.lambdas, A) || (this.lambdas[A] = this.add(bZ(null))), Le(this.lambdas[A]));
  },
  parseLambdas() {
    const A = Object.keys(this.lambdas);
    for (let e = 0, t = A.length; e < t; ++e) {
      const i = A[e], n = rl(i, this), o = this.lambdas[i];
      o.params = n.$params, o.update = n.$expr;
    }
  },
  property(A) {
    return A && A.signal ? this.signalRef(A.signal) : A;
  },
  objectProperty(A) {
    return !A || !ce(A) ? A : this.signalRef(A.signal || WnA(A));
  },
  exprRef(A, e) {
    const t = {
      expr: rl(A, this)
    };
    return e && (t.expr.$name = e), Le(this.add(EVe(t)));
  },
  addBinding(A, e) {
    this.bindings || vA("Nested signals do not support binding: " + ie(A)), this.bindings.push(pt({
      signal: A
    }, e));
  },
  // ----
  addScaleProj(A, e) {
    Ze(this.scales, A) && vA("Duplicate scale or projection name: " + ie(A)), this.scales[A] = this.add(e);
  },
  addScale(A, e) {
    this.addScaleProj(A, NVe(e));
  },
  addProjection(A, e) {
    this.addScaleProj(A, GVe(e));
  },
  getScale(A) {
    return this.scales[A] || vA("Unrecognized scale name: " + ie(A)), this.scales[A];
  },
  scaleRef(A) {
    return Le(this.getScale(A));
  },
  scaleType(A) {
    return this.getScale(A).params.type;
  },
  projectionRef(A) {
    return this.scaleRef(A);
  },
  projectionType(A) {
    return this.scaleType(A);
  },
  // ----
  addData(A, e) {
    return Ze(this.data, A) && vA("Duplicate data set name: " + ie(A)), this.data[A] = e;
  },
  getData(A) {
    return this.data[A] || vA("Undefined data set name: " + ie(A)), this.data[A];
  },
  addDataPipeline(A, e) {
    return Ze(this.data, A) && vA("Duplicate data set name: " + ie(A)), this.addData(A, mp.fromEntries(this, e));
  }
};
function WnA(A) {
  return (ZA(A) ? d9e : h9e)(A);
}
function d9e(A) {
  const e = A.length;
  let t = "[";
  for (let i = 0; i < e; ++i) {
    const n = A[i];
    t += (i > 0 ? "," : "") + (ce(n) ? n.signal || WnA(n) : ie(n));
  }
  return t + "]";
}
function h9e(A) {
  let e = "{", t = 0, i, n;
  for (i in A)
    n = A[i], e += (++t > 1 ? "," : "") + ie(i) + ":" + (ce(n) ? n.signal || WnA(n) : ie(n));
  return e + "}";
}
function m9e() {
  const A = "sans-serif", e = "#4c78a8", t = "#000", i = "#888", n = "#ddd";
  return {
    // default visualization description
    description: "Vega visualization",
    // default padding around visualization
    padding: 0,
    // default for automatic sizing; options: 'none', 'pad', 'fit'
    // or provide an object (e.g., {'type': 'pad', 'resize': true})
    autosize: "pad",
    // default view background color
    // covers the entire view component
    background: null,
    // default event handling configuration
    // preventDefault for view-sourced event types except 'wheel'
    events: {
      defaults: {
        allow: ["wheel"]
      }
    },
    // defaults for top-level group marks
    // accepts mark properties (fill, stroke, etc)
    // covers the data rectangle within group width/height
    group: null,
    // defaults for basic mark types
    // each subset accepts mark properties (fill, stroke, etc)
    mark: null,
    arc: {
      fill: e
    },
    area: {
      fill: e
    },
    image: null,
    line: {
      stroke: e,
      strokeWidth: 2
    },
    path: {
      stroke: e
    },
    rect: {
      fill: e
    },
    rule: {
      stroke: t
    },
    shape: {
      stroke: e
    },
    symbol: {
      fill: e,
      size: 64
    },
    text: {
      fill: t,
      font: A,
      fontSize: 11
    },
    trail: {
      fill: e,
      size: 2
    },
    // style definitions
    style: {
      // axis & legend labels
      "guide-label": {
        fill: t,
        font: A,
        fontSize: 10
      },
      // axis & legend titles
      "guide-title": {
        fill: t,
        font: A,
        fontSize: 11,
        fontWeight: "bold"
      },
      // headers, including chart title
      "group-title": {
        fill: t,
        font: A,
        fontSize: 13,
        fontWeight: "bold"
      },
      // chart subtitle
      "group-subtitle": {
        fill: t,
        font: A,
        fontSize: 12
      },
      // defaults for styled point marks in Vega-Lite
      point: {
        size: 30,
        strokeWidth: 2,
        shape: "circle"
      },
      circle: {
        size: 30,
        strokeWidth: 2
      },
      square: {
        size: 30,
        strokeWidth: 2,
        shape: "square"
      },
      // defaults for styled group marks in Vega-Lite
      cell: {
        fill: "transparent",
        stroke: n
      },
      view: {
        fill: "transparent"
      }
    },
    // defaults for title
    title: {
      orient: "top",
      anchor: "middle",
      offset: 4,
      subtitlePadding: 3
    },
    // defaults for axes
    axis: {
      minExtent: 0,
      maxExtent: 200,
      bandPosition: 0.5,
      domain: !0,
      domainWidth: 1,
      domainColor: i,
      grid: !1,
      gridWidth: 1,
      gridColor: n,
      labels: !0,
      labelAngle: 0,
      labelLimit: 180,
      labelOffset: 0,
      labelPadding: 2,
      ticks: !0,
      tickColor: i,
      tickOffset: 0,
      tickRound: !0,
      tickSize: 5,
      tickWidth: 1,
      titlePadding: 4
    },
    // correction for centering bias
    axisBand: {
      tickOffset: -0.5
    },
    // defaults for cartographic projection
    projection: {
      type: "mercator"
    },
    // defaults for legends
    legend: {
      orient: "right",
      padding: 0,
      gridAlign: "each",
      columnPadding: 10,
      rowPadding: 2,
      symbolDirection: "vertical",
      gradientDirection: "vertical",
      gradientLength: 200,
      gradientThickness: 16,
      gradientStrokeColor: n,
      gradientStrokeWidth: 0,
      gradientLabelOffset: 2,
      labelAlign: "left",
      labelBaseline: "middle",
      labelLimit: 160,
      labelOffset: 4,
      labelOverlap: !0,
      symbolLimit: 30,
      symbolType: "circle",
      symbolSize: 100,
      symbolOffset: 0,
      symbolStrokeWidth: 1.5,
      symbolBaseFillColor: "transparent",
      symbolBaseStrokeColor: i,
      titleLimit: 180,
      titleOrient: "top",
      titlePadding: 5,
      layout: {
        offset: 18,
        direction: "horizontal",
        left: {
          direction: "vertical"
        },
        right: {
          direction: "vertical"
        }
      }
    },
    // defaults for scale ranges
    range: {
      category: {
        scheme: "tableau10"
      },
      ordinal: {
        scheme: "blues"
      },
      heatmap: {
        scheme: "yellowgreenblue"
      },
      ramp: {
        scheme: "blues"
      },
      diverging: {
        scheme: "blueorange",
        extent: [1, 0]
      },
      symbol: ["circle", "square", "triangle-up", "cross", "diamond", "triangle-right", "triangle-down", "triangle-left"]
    }
  };
}
function p9e(A, e, t) {
  return ce(A) || vA("Input Vega specification must be an object."), e = XD(m9e(), e, A.config), E9e(A, new MWA(e, t)).toRuntime();
}
var y9e = "5.26.1";
pt(hf, Y2e, _Me, Dxe, Bve, gHe, FSe, BSe, xSe, oZe, QZe, yZe);
const b9e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Bounds: no,
  CanvasHandler: gr,
  CanvasRenderer: t2,
  DATE: qs,
  DAY: pg,
  DAYOFYEAR: Il,
  Dataflow: rw,
  Debug: _MA,
  Error: BeA,
  EventStream: rU,
  Gradient: JvA,
  GroupItem: JU,
  HOURS: Aa,
  Handler: ed,
  HybridHandler: QiA,
  HybridRenderer: HS,
  Info: TMA,
  Item: kU,
  MILLISECONDS: pC,
  MINUTES: ea,
  MONTH: Dg,
  Marks: Rg,
  MultiPulse: ReA,
  None: zMA,
  Operator: Ui,
  Parameters: aU,
  Pulse: ku,
  QUARTER: _s,
  RenderType: Au,
  Renderer: Fg,
  ResourceLoader: VtA,
  SECONDS: nr,
  SVGHandler: IiA,
  SVGRenderer: vU,
  SVGStringRenderer: ciA,
  Scenegraph: giA,
  TIME_UNITS: weA,
  Transform: FA,
  View: PZA,
  WEEK: lo,
  Warn: leA,
  YEAR: eg,
  accessor: oI,
  accessorFields: fg,
  accessorName: Sn,
  array: Ce,
  ascending: iU,
  bandwidthNRD: LeA,
  bin: iLA,
  bootstrapCI: nLA,
  boundClip: bHA,
  boundContext: pF,
  boundItem: ej,
  boundMark: XvA,
  boundStroke: LQ,
  changeset: I0,
  clampRange: oxA,
  codegenExpression: fZA,
  compare: deA,
  constant: Yg,
  cumulativeLogNormal: KeA,
  cumulativeNormal: BU,
  cumulativeUniform: zeA,
  dayofyear: uxA,
  debounce: heA,
  defaultLocale: GeA,
  definition: ALA,
  densityLogNormal: WeA,
  densityNormal: veA,
  densityUniform: XeA,
  domChild: Co,
  domClear: GI,
  domCreate: PE,
  domFind: siA,
  dotbin: oLA,
  error: vA,
  expressionFunction: Wn,
  extend: pt,
  extent: sl,
  extentIndex: gxA,
  falsy: wE,
  fastmap: TD,
  field: tr,
  flush: sxA,
  font: MU,
  fontFamily: wF,
  fontSize: Dl,
  format: WL,
  formatLocale: mS,
  formats: NeA,
  hasOwnProperty: Ze,
  id: IF,
  identity: Ng,
  inferType: UxA,
  inferTypes: VxA,
  ingest: Qi,
  inherits: Ae,
  inrange: Hb,
  interpolate: xtA,
  interpolateColors: fU,
  interpolateRange: QvA,
  intersect: hHA,
  intersectBoxLine: Sb,
  intersectPath: XtA,
  intersectPoint: ztA,
  intersectRule: MvA,
  isArray: ZA,
  isBoolean: Wd,
  isDate: Gu,
  isFunction: yt,
  isIterable: IxA,
  isNumber: ti,
  isObject: ce,
  isRegExp: axA,
  isString: Be,
  isTuple: sU,
  key: meA,
  lerp: rxA,
  lineHeight: $u,
  loader: oU,
  locale: WxA,
  logger: ceA,
  lruCache: CxA,
  markup: liA,
  merge: BxA,
  mergeConfig: XD,
  multiLineOffset: iiA,
  one: VD,
  pad: lxA,
  panLinear: $MA,
  panLog: AxA,
  panPow: exA,
  panSymlog: txA,
  parse: p9e,
  parseExpression: cnA,
  parseSelector: Ud,
  path: uU,
  pathCurves: uF,
  pathEqual: wHA,
  pathParse: wf,
  pathRectangle: DU,
  pathRender: PY,
  pathSymbols: ZtA,
  pathTrail: WtA,
  peek: Xt,
  point: LU,
  projection: MiA,
  quantileLogNormal: UeA,
  quantileNormal: lU,
  quantileUniform: TeA,
  quantiles: MeA,
  quantizeInterpolator: EvA,
  quarter: ixA,
  quartiles: xeA,
  get random() {
    return or;
  },
  randomInteger: xYe,
  randomKDE: SeA,
  randomLCG: MYe,
  randomLogNormal: sLA,
  randomMixture: ILA,
  randomNormal: HeA,
  randomUniform: aLA,
  read: TxA,
  regressionConstant: _eA,
  regressionExp: CLA,
  regressionLinear: qeA,
  regressionLoess: cLA,
  regressionLog: rLA,
  regressionPoly: lLA,
  regressionPow: BLA,
  regressionQuad: OeA,
  renderModule: $D,
  repeat: uJ,
  resetDefaultLocale: YNe,
  resetSVGClipId: RvA,
  resetSVGDefIds: BMe,
  responseType: zxA,
  runtimeContext: SZA,
  sampleCurve: QU,
  sampleLogNormal: ZeA,
  sampleNormal: CU,
  sampleUniform: VeA,
  scale: ri,
  sceneEqual: EiA,
  sceneFromJSON: TvA,
  scenePickVisit: JS,
  sceneToJSON: zvA,
  sceneVisit: Nn,
  sceneZOrder: TtA,
  scheme: LtA,
  serializeXML: rHA,
  setHybridRendererOptions: IMe,
  setRandom: RYe,
  span: aF,
  splitAccessPath: fl,
  stringValue: ie,
  textMetrics: zI,
  timeBin: MxA,
  timeFloor: wxA,
  timeFormatLocale: qY,
  timeInterval: _D,
  timeOffset: GxA,
  timeSequence: NxA,
  timeUnitSpecifier: ExA,
  timeUnits: feA,
  toBoolean: peA,
  toDate: yeA,
  toNumber: yg,
  toSet: mC,
  toString: beA,
  transform: eLA,
  transforms: hf,
  truncate: cxA,
  truthy: ir,
  tupleid: ve,
  typeParsers: VO,
  utcFloor: fxA,
  utcInterval: qD,
  utcOffset: kxA,
  utcSequence: YxA,
  utcdayofyear: mxA,
  utcquarter: nxA,
  utcweek: pxA,
  version: y9e,
  visitArray: RE,
  week: dxA,
  writeConfig: zD,
  zero: KE,
  zoomLinear: QeA,
  zoomLog: EeA,
  zoomPow: hS,
  zoomSymlog: ueA
}, Symbol.toStringTag, { value: "Module" }));
function w9e(A, e, t) {
  let i;
  e.x2 && (e.x ? (t && A.x > A.x2 && (i = A.x, A.x = A.x2, A.x2 = i), A.width = A.x2 - A.x) : A.x = A.x2 - (A.width || 0)), e.xc && (A.x = A.xc - (A.width || 0) / 2), e.y2 && (e.y ? (t && A.y > A.y2 && (i = A.y, A.y = A.y2, A.y2 = i), A.height = A.y2 - A.y) : A.y = A.y2 - (A.height || 0)), e.yc && (A.y = A.yc - (A.height || 0) / 2);
}
var f9e = {
  NaN: NaN,
  E: Math.E,
  LN2: Math.LN2,
  LN10: Math.LN10,
  LOG2E: Math.LOG2E,
  LOG10E: Math.LOG10E,
  PI: Math.PI,
  SQRT1_2: Math.SQRT1_2,
  SQRT2: Math.SQRT2,
  MIN_VALUE: Number.MIN_VALUE,
  MAX_VALUE: Number.MAX_VALUE
}, D9e = {
  "*": (A, e) => A * e,
  "+": (A, e) => A + e,
  "-": (A, e) => A - e,
  "/": (A, e) => A / e,
  "%": (A, e) => A % e,
  ">": (A, e) => A > e,
  "<": (A, e) => A < e,
  "<=": (A, e) => A <= e,
  ">=": (A, e) => A >= e,
  "==": (A, e) => A == e,
  "!=": (A, e) => A != e,
  "===": (A, e) => A === e,
  "!==": (A, e) => A !== e,
  "&": (A, e) => A & e,
  "|": (A, e) => A | e,
  "^": (A, e) => A ^ e,
  "<<": (A, e) => A << e,
  ">>": (A, e) => A >> e,
  ">>>": (A, e) => A >>> e
}, G9e = {
  "+": (A) => +A,
  "-": (A) => -A,
  "~": (A) => ~A,
  "!": (A) => !A
};
const k9e = Array.prototype.slice, kh = (A, e, t) => {
  const i = t ? t(e[0]) : e[0];
  return i[A].apply(i, k9e.call(e, 1));
}, J9e = (A, e, t, i, n, o, g) => new Date(A, e || 0, t ?? 1, i || 0, n || 0, o || 0, g || 0);
var N9e = {
  // math functions
  isNaN: Number.isNaN,
  isFinite: Number.isFinite,
  abs: Math.abs,
  acos: Math.acos,
  asin: Math.asin,
  atan: Math.atan,
  atan2: Math.atan2,
  ceil: Math.ceil,
  cos: Math.cos,
  exp: Math.exp,
  floor: Math.floor,
  log: Math.log,
  max: Math.max,
  min: Math.min,
  pow: Math.pow,
  random: Math.random,
  round: Math.round,
  sin: Math.sin,
  sqrt: Math.sqrt,
  tan: Math.tan,
  clamp: (A, e, t) => Math.max(e, Math.min(t, A)),
  // date functions
  now: Date.now,
  utc: Date.UTC,
  datetime: J9e,
  date: (A) => new Date(A).getDate(),
  day: (A) => new Date(A).getDay(),
  year: (A) => new Date(A).getFullYear(),
  month: (A) => new Date(A).getMonth(),
  hours: (A) => new Date(A).getHours(),
  minutes: (A) => new Date(A).getMinutes(),
  seconds: (A) => new Date(A).getSeconds(),
  milliseconds: (A) => new Date(A).getMilliseconds(),
  time: (A) => new Date(A).getTime(),
  timezoneoffset: (A) => new Date(A).getTimezoneOffset(),
  utcdate: (A) => new Date(A).getUTCDate(),
  utcday: (A) => new Date(A).getUTCDay(),
  utcyear: (A) => new Date(A).getUTCFullYear(),
  utcmonth: (A) => new Date(A).getUTCMonth(),
  utchours: (A) => new Date(A).getUTCHours(),
  utcminutes: (A) => new Date(A).getUTCMinutes(),
  utcseconds: (A) => new Date(A).getUTCSeconds(),
  utcmilliseconds: (A) => new Date(A).getUTCMilliseconds(),
  // sequence functions
  length: (A) => A.length,
  join: function() {
    return kh("join", arguments);
  },
  indexof: function() {
    return kh("indexOf", arguments);
  },
  lastindexof: function() {
    return kh("lastIndexOf", arguments);
  },
  slice: function() {
    return kh("slice", arguments);
  },
  reverse: (A) => A.slice().reverse(),
  // string functions
  parseFloat,
  parseInt,
  upper: (A) => String(A).toUpperCase(),
  lower: (A) => String(A).toLowerCase(),
  substring: function() {
    return kh("substring", arguments, String);
  },
  split: function() {
    return kh("split", arguments, String);
  },
  replace: function() {
    return kh("replace", arguments, String);
  },
  trim: (A) => String(A).trim(),
  // regexp functions
  regexp: RegExp,
  test: (A, e) => RegExp(A).test(e)
};
const Y9e = ["view", "item", "group", "xy", "x", "y"], gP = /* @__PURE__ */ new Set([Function, eval, setTimeout, setInterval]);
typeof setImmediate == "function" && gP.add(setImmediate);
const R9e = {
  Literal: (A, e) => e.value,
  Identifier: (A, e) => {
    const t = e.name;
    return A.memberDepth > 0 ? t : t === "datum" ? A.datum : t === "event" ? A.event : t === "item" ? A.item : f9e[t] || A.params["$" + t];
  },
  MemberExpression: (A, e) => {
    const t = !e.computed, i = A(e.object);
    t && (A.memberDepth += 1);
    const n = A(e.property);
    if (t && (A.memberDepth -= 1), gP.has(i[n])) {
      console.error(`Prevented interpretation of member "${n}" which could lead to insecure code execution`);
      return;
    }
    return i[n];
  },
  CallExpression: (A, e) => {
    const t = e.arguments;
    let i = e.callee.name;
    return i.startsWith("_") && (i = i.slice(1)), i === "if" ? A(t[0]) ? A(t[1]) : A(t[2]) : (A.fn[i] || N9e[i]).apply(A.fn, t.map(A));
  },
  ArrayExpression: (A, e) => e.elements.map(A),
  BinaryExpression: (A, e) => D9e[e.operator](A(e.left), A(e.right)),
  UnaryExpression: (A, e) => G9e[e.operator](A(e.argument)),
  ConditionalExpression: (A, e) => A(e.test) ? A(e.consequent) : A(e.alternate),
  LogicalExpression: (A, e) => e.operator === "&&" ? A(e.left) && A(e.right) : A(e.left) || A(e.right),
  ObjectExpression: (A, e) => e.properties.reduce((t, i) => {
    A.memberDepth += 1;
    const n = A(i.key);
    return A.memberDepth -= 1, gP.has(A(i.value)) ? console.error(`Prevented interpretation of property "${n}" which could lead to insecure code execution`) : t[n] = A(i.value), t;
  }, {})
};
function Fk(A, e, t, i, n, o) {
  const g = (s) => R9e[s.type](g, s);
  return g.memberDepth = 0, g.fn = Object.create(e), g.params = t, g.datum = i, g.event = n, g.item = o, Y9e.forEach((s) => g.fn[s] = function() {
    return n.vega[s](...arguments);
  }), g(A);
}
var F9e = {
  /**
   * Parse an expression used to update an operator value.
   */
  operator(A, e) {
    const t = e.ast, i = A.functions;
    return (n) => Fk(t, i, n);
  },
  /**
   * Parse an expression provided as an operator parameter value.
   */
  parameter(A, e) {
    const t = e.ast, i = A.functions;
    return (n, o) => Fk(t, i, o, n);
  },
  /**
   * Parse an expression applied to an event stream.
   */
  event(A, e) {
    const t = e.ast, i = A.functions;
    return (n) => Fk(t, i, void 0, void 0, n);
  },
  /**
   * Parse an expression used to handle an event-driven operator update.
   */
  handler(A, e) {
    const t = e.ast, i = A.functions;
    return (n, o) => {
      const g = o.item && o.item.datum;
      return Fk(t, i, n, g, o);
    };
  },
  /**
   * Parse an expression that performs visual encoding.
   */
  encode(A, e) {
    const {
      marktype: t,
      channels: i
    } = e, n = A.functions, o = t === "group" || t === "image" || t === "rect";
    return (g, s) => {
      const I = g.datum;
      let r = 0, a;
      for (const C in i)
        a = Fk(i[C].ast, n, s, I, void 0, g), g[C] !== a && (g[C] = a, r = 1);
      return t !== "rule" && w9e(g, i, o), r;
    };
  }
};
const M9e = "vega-lite", x9e = 'Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer', L9e = "5.16.3", v9e = [
  "Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)",
  "Dominik Moritz (https://www.domoritz.de)",
  "Arvind Satyanarayan (https://arvindsatya.com)",
  "Jeffrey Heer (https://jheer.org)"
], H9e = "https://vega.github.io/vega-lite/", S9e = "Vega-Lite is a concise high-level language for interactive visualization.", Z9e = [
  "vega",
  "chart",
  "visualization"
], W9e = "build/vega-lite.js", K9e = "build/vega-lite.min.js", U9e = "build/vega-lite.min.js", V9e = "build/src/index", X9e = "build/src/index.d.ts", z9e = {
  vl2pdf: "./bin/vl2pdf",
  vl2png: "./bin/vl2png",
  vl2svg: "./bin/vl2svg",
  vl2vg: "./bin/vl2vg"
}, T9e = [
  "bin",
  "build",
  "src",
  "vega-lite*",
  "tsconfig.json"
], _9e = {
  changelog: "conventional-changelog -p angular -r 2",
  prebuild: "yarn clean:build",
  build: "yarn build:only",
  "build:only": "tsc -p tsconfig.build.json && rollup -c",
  "prebuild:examples": "yarn build:only",
  "build:examples": "yarn data && TZ=America/Los_Angeles scripts/build-examples.sh",
  "prebuild:examples-full": "yarn build:only",
  "build:examples-full": "TZ=America/Los_Angeles scripts/build-examples.sh 1",
  "build:example": "TZ=America/Los_Angeles scripts/build-example.sh",
  "build:toc": "yarn build:jekyll && scripts/generate-toc",
  "build:site": "rollup -c site/rollup.config.mjs",
  "build:jekyll": "pushd site && bundle exec jekyll build -q && popd",
  "build:versions": "scripts/update-version.sh",
  clean: "yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete",
  "clean:build": "del-cli 'build/*' !build/vega-lite-schema.json",
  data: "rsync -r node_modules/vega-datasets/data/* site/data",
  schema: "mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",
  renameschema: "scripts/rename-schema.sh",
  presite: "yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",
  site: "yarn site:only",
  "site:only": "pushd site && bundle exec jekyll serve -I -l && popd",
  prettierbase: "prettier '**/*.{md,css,yml}'",
  format: "eslint . --fix && yarn prettierbase --write",
  lint: "eslint . && yarn prettierbase --check",
  jest: "NODE_OPTIONS=--experimental-vm-modules npx jest",
  test: "yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime",
  "test:cover": "yarn jest --collectCoverage test/",
  "test:inspect": "node --inspect-brk --experimental-vm-modules ./node_modules/.bin/jest --runInBand test",
  "test:runtime": "NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json",
  "test:runtime:generate": "yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",
  watch: "tsc -p tsconfig.build.json -w",
  "watch:site": "yarn build:site -w",
  "watch:test": "yarn jest --watch test/",
  "watch:test:runtime": "NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",
  release: "release-it"
}, q9e = {
  type: "git",
  url: "https://github.com/vega/vega-lite.git"
}, O9e = "BSD-3-Clause", j9e = {
  url: "https://github.com/vega/vega-lite/issues"
}, P9e = {
  "@babel/core": "^7.22.10",
  "@babel/plugin-proposal-class-properties": "^7.18.6",
  "@babel/preset-env": "^7.22.10",
  "@babel/preset-typescript": "^7.22.5",
  "@release-it/conventional-changelog": "^7.0.0",
  "@rollup/plugin-alias": "^5.0.0",
  "@rollup/plugin-babel": "^6.0.3",
  "@rollup/plugin-commonjs": "^25.0.4",
  "@rollup/plugin-json": "^6.0.0",
  "@rollup/plugin-node-resolve": "^15.2.1",
  "@rollup/plugin-terser": "^0.4.3",
  "@types/chai": "^4.3.5",
  "@types/d3": "^7.4.0",
  "@types/jest": "^29.5.4",
  "@types/pako": "^2.0.0",
  "@typescript-eslint/eslint-plugin": "^6.4.1",
  "@typescript-eslint/parser": "^6.4.1",
  ajv: "^8.12.0",
  "ajv-formats": "^2.1.1",
  chai: "^4.3.7",
  cheerio: "^1.0.0-rc.12",
  "conventional-changelog-cli": "^4.0.0",
  d3: "^7.8.5",
  "del-cli": "^5.0.0",
  eslint: "^8.47.0",
  "eslint-config-prettier": "^9.0.0",
  "eslint-plugin-jest": "^27.2.3",
  "eslint-plugin-prettier": "^5.0.0",
  "fast-json-stable-stringify": "~2.1.0",
  "highlight.js": "^11.8.0",
  jest: "^29.6.3",
  "jest-dev-server": "^9.0.0",
  mkdirp: "^3.0.1",
  pako: "^2.1.0",
  prettier: "^3.0.2",
  puppeteer: "^15.0.0",
  "release-it": "^16.1.5",
  rollup: "^3.28.1",
  "rollup-plugin-bundle-size": "^1.0.3",
  "rollup-plugin-sourcemaps": "^0.6.3",
  serve: "^14.2.1",
  terser: "^5.19.2",
  "ts-jest": "^29.1.1",
  "ts-json-schema-generator": "^1.3.0",
  typescript: "~5.2.2",
  "vega-cli": "^5.25.0",
  "vega-datasets": "^2.7.0",
  "vega-embed": "^6.22.2",
  "vega-tooltip": "^0.33.0",
  "yaml-front-matter": "^4.1.1"
}, $9e = {
  "json-stringify-pretty-compact": "~3.0.0",
  tslib: "~2.6.2",
  "vega-event-selector": "~3.0.1",
  "vega-expression": "~5.1.0",
  "vega-util": "~1.17.2",
  yargs: "~17.7.2"
}, A5e = {
  vega: "^5.24.0"
}, e5e = {
  node: ">=18"
}, t5e = {
  name: M9e,
  author: x9e,
  version: L9e,
  collaborators: v9e,
  homepage: H9e,
  description: S9e,
  keywords: Z9e,
  main: W9e,
  unpkg: K9e,
  jsdelivr: U9e,
  module: V9e,
  types: X9e,
  bin: z9e,
  files: T9e,
  scripts: _9e,
  repository: q9e,
  license: O9e,
  bugs: j9e,
  devDependencies: P9e,
  dependencies: $9e,
  peerDependencies: A5e,
  engines: e5e
};
function KnA(A) {
  return !!A.or;
}
function UnA(A) {
  return !!A.and;
}
function VnA(A) {
  return !!A.not;
}
function rv(A, e) {
  if (VnA(A))
    rv(A.not, e);
  else if (UnA(A))
    for (const t of A.and)
      rv(t, e);
  else if (KnA(A))
    for (const t of A.or)
      rv(t, e);
  else
    e(A);
}
function lw(A, e) {
  return VnA(A) ? { not: lw(A.not, e) } : UnA(A) ? { and: A.and.map((t) => lw(t, e)) } : KnA(A) ? { or: A.or.map((t) => lw(t, e)) } : e(A);
}
const tt = structuredClone;
function xWA(A) {
  throw new Error(A);
}
function Ff(A, e) {
  const t = {};
  for (const i of e)
    Ze(A, i) && (t[i] = A[i]);
  return t;
}
function Us(A, e) {
  const t = { ...A };
  for (const i of e)
    delete t[i];
  return t;
}
Set.prototype.toJSON = function() {
  return `Set(${[...this].map((A) => Mi(A)).join(",")})`;
};
function vt(A) {
  if (ti(A))
    return A;
  const e = Be(A) ? A : Mi(A);
  if (e.length < 250)
    return e;
  let t = 0;
  for (let i = 0; i < e.length; i++) {
    const n = e.charCodeAt(i);
    t = (t << 5) - t + n, t = t & t;
  }
  return t;
}
function sP(A) {
  return A === !1 || A === null;
}
function Ht(A, e) {
  return A.includes(e);
}
function pp(A, e) {
  let t = 0;
  for (const [i, n] of A.entries())
    if (e(n, i, t++))
      return !0;
  return !1;
}
function XnA(A, e) {
  let t = 0;
  for (const [i, n] of A.entries())
    if (!e(n, i, t++))
      return !1;
  return !0;
}
function LWA(A, ...e) {
  for (const t of e)
    i5e(A, t ?? {});
  return A;
}
function i5e(A, e) {
  for (const t of _A(e))
    zD(A, t, e[t], !0);
}
function YB(A, e) {
  const t = [], i = {};
  let n;
  for (const o of A)
    n = e(o), !(n in i) && (i[n] = 1, t.push(o));
  return t;
}
function n5e(A, e) {
  const t = _A(A), i = _A(e);
  if (t.length !== i.length)
    return !1;
  for (const n of t)
    if (A[n] !== e[n])
      return !1;
  return !0;
}
function vWA(A, e) {
  if (A.size !== e.size)
    return !1;
  for (const t of A)
    if (!e.has(t))
      return !1;
  return !0;
}
function znA(A, e) {
  for (const t of A)
    if (e.has(t))
      return !0;
  return !1;
}
function IP(A) {
  const e = /* @__PURE__ */ new Set();
  for (const t of A) {
    const i = fl(t).map((o, g) => g === 0 ? o : `[${o}]`), n = i.map((o, g) => i.slice(0, g + 1).join(""));
    for (const o of n)
      e.add(o);
  }
  return e;
}
function TnA(A, e) {
  return A === void 0 || e === void 0 ? !0 : znA(IP(A), IP(e));
}
function Fi(A) {
  return _A(A).length === 0;
}
const _A = Object.keys, tg = Object.values, nd = Object.entries;
function c2(A) {
  return A === !0 || A === !1;
}
function En(A) {
  const e = A.replace(/\W/g, "_");
  return (A.match(/^\d+/) ? "_" : "") + e;
}
function YN(A, e) {
  return VnA(A) ? `!(${YN(A.not, e)})` : UnA(A) ? `(${A.and.map((t) => YN(t, e)).join(") && (")})` : KnA(A) ? `(${A.or.map((t) => YN(t, e)).join(") || (")})` : e(A);
}
function wZ(A, e) {
  if (e.length === 0)
    return !0;
  const t = e.shift();
  return t in A && wZ(A[t], e) && delete A[t], Fi(A);
}
function xF(A) {
  return A.charAt(0).toUpperCase() + A.substr(1);
}
function _nA(A, e = "datum") {
  const t = fl(A), i = [];
  for (let n = 1; n <= t.length; n++) {
    const o = `[${t.slice(0, n).map(ie).join("][")}]`;
    i.push(`${e}${o}`);
  }
  return i.join(" && ");
}
function HWA(A, e = "datum") {
  return `${e}[${ie(fl(A).join("."))}]`;
}
function o5e(A) {
  return A.replace(/(\[|\]|\.|'|")/g, "\\$1");
}
function Ir(A) {
  return `${fl(A).map(o5e).join("\\.")}`;
}
function yp(A, e, t) {
  return A.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), "g"), t);
}
function qnA(A) {
  return `${fl(A).join(".")}`;
}
function Mf(A) {
  return A ? fl(A).length : 0;
}
function _n(...A) {
  for (const e of A)
    if (e !== void 0)
      return e;
}
let SWA = 42;
function ZWA(A) {
  const e = ++SWA;
  return A ? String(A) + e : e;
}
function g5e() {
  SWA = 42;
}
function WWA(A) {
  return KWA(A) ? A : `__${A}`;
}
function KWA(A) {
  return A.startsWith("__");
}
function Q2(A) {
  if (A !== void 0)
    return (A % 360 + 360) % 360;
}
function gV(A) {
  return ti(A) ? !0 : !isNaN(A) && !isNaN(parseFloat(A));
}
const PdA = Object.getPrototypeOf(structuredClone({}));
function ZI(A, e) {
  if (A === e)
    return !0;
  if (A && e && typeof A == "object" && typeof e == "object") {
    if (A.constructor.name !== e.constructor.name)
      return !1;
    let t, i;
    if (Array.isArray(A)) {
      if (t = A.length, t != e.length)
        return !1;
      for (i = t; i-- !== 0; )
        if (!ZI(A[i], e[i]))
          return !1;
      return !0;
    }
    if (A instanceof Map && e instanceof Map) {
      if (A.size !== e.size)
        return !1;
      for (i of A.entries())
        if (!e.has(i[0]))
          return !1;
      for (i of A.entries())
        if (!ZI(i[1], e.get(i[0])))
          return !1;
      return !0;
    }
    if (A instanceof Set && e instanceof Set) {
      if (A.size !== e.size)
        return !1;
      for (i of A.entries())
        if (!e.has(i[0]))
          return !1;
      return !0;
    }
    if (ArrayBuffer.isView(A) && ArrayBuffer.isView(e)) {
      if (t = A.length, t != e.length)
        return !1;
      for (i = t; i-- !== 0; )
        if (A[i] !== e[i])
          return !1;
      return !0;
    }
    if (A.constructor === RegExp)
      return A.source === e.source && A.flags === e.flags;
    if (A.valueOf !== Object.prototype.valueOf && A.valueOf !== PdA.valueOf)
      return A.valueOf() === e.valueOf();
    if (A.toString !== Object.prototype.toString && A.toString !== PdA.toString)
      return A.toString() === e.toString();
    const n = Object.keys(A);
    if (t = n.length, t !== Object.keys(e).length)
      return !1;
    for (i = t; i-- !== 0; )
      if (!Object.prototype.hasOwnProperty.call(e, n[i]))
        return !1;
    for (i = t; i-- !== 0; ) {
      const o = n[i];
      if (!ZI(A[o], e[o]))
        return !1;
    }
    return !0;
  }
  return A !== A && e !== e;
}
function Mi(A) {
  const e = [];
  return function t(i) {
    if (i && i.toJSON && typeof i.toJSON == "function" && (i = i.toJSON()), i === void 0)
      return;
    if (typeof i == "number")
      return isFinite(i) ? "" + i : "null";
    if (typeof i != "object")
      return JSON.stringify(i);
    let n, o;
    if (Array.isArray(i)) {
      for (o = "[", n = 0; n < i.length; n++)
        n && (o += ","), o += t(i[n]) || "null";
      return o + "]";
    }
    if (i === null)
      return "null";
    if (e.includes(i))
      throw new TypeError("Converting circular structure to JSON");
    const g = e.push(i) - 1, s = Object.keys(i).sort();
    for (o = "", n = 0; n < s.length; n++) {
      const I = s[n], r = t(i[I]);
      r && (o && (o += ","), o += JSON.stringify(I) + ":" + r);
    }
    return e.splice(g, 1), `{${o}}`;
  }(A);
}
const jc = "row", Pc = "column", sV = "facet", un = "x", Vo = "y", YC = "x2", Nl = "y2", Vd = "xOffset", nG = "yOffset", RC = "radius", HQ = "radius2", cr = "theta", SQ = "theta2", FC = "latitude", MC = "longitude", xC = "latitude2", ar = "longitude2", js = "color", Yl = "fill", Rl = "stroke", Ps = "shape", ZQ = "size", l0 = "angle", WQ = "opacity", Xd = "fillOpacity", zd = "strokeOpacity", Td = "strokeWidth", _d = "strokeDash", LF = "text", xf = "order", vF = "detail", IV = "key", bp = "tooltip", aV = "href", rV = "url", CV = "description", s5e = {
  x: 1,
  y: 1,
  x2: 1,
  y2: 1
}, UWA = {
  theta: 1,
  theta2: 1,
  radius: 1,
  radius2: 1
};
function VWA(A) {
  return A in UWA;
}
const OnA = {
  longitude: 1,
  longitude2: 1,
  latitude: 1,
  latitude2: 1
};
function XWA(A) {
  switch (A) {
    case FC:
      return "y";
    case xC:
      return "y2";
    case MC:
      return "x";
    case ar:
      return "x2";
  }
}
function zWA(A) {
  return A in OnA;
}
const I5e = _A(OnA), jnA = {
  ...s5e,
  ...UWA,
  ...OnA,
  xOffset: 1,
  yOffset: 1,
  // color
  color: 1,
  fill: 1,
  stroke: 1,
  // other non-position with scale
  opacity: 1,
  fillOpacity: 1,
  strokeOpacity: 1,
  strokeWidth: 1,
  strokeDash: 1,
  size: 1,
  angle: 1,
  shape: 1,
  // channels without scales
  order: 1,
  text: 1,
  detail: 1,
  key: 1,
  tooltip: 1,
  href: 1,
  url: 1,
  description: 1
};
function cw(A) {
  return A === js || A === Yl || A === Rl;
}
const TWA = {
  row: 1,
  column: 1,
  facet: 1
}, Ua = _A(TWA), PnA = {
  ...jnA,
  ...TWA
}, a5e = _A(PnA), { order: eXt, detail: tXt, tooltip: iXt, ...r5e } = PnA, { row: nXt, column: oXt, facet: gXt, ...C5e } = r5e;
function B5e(A) {
  return !!C5e[A];
}
function _WA(A) {
  return !!PnA[A];
}
const l5e = [YC, Nl, xC, ar, SQ, HQ];
function qWA(A) {
  return c0(A) !== A;
}
function c0(A) {
  switch (A) {
    case YC:
      return un;
    case Nl:
      return Vo;
    case xC:
      return FC;
    case ar:
      return MC;
    case SQ:
      return cr;
    case HQ:
      return RC;
  }
  return A;
}
function od(A) {
  if (VWA(A))
    switch (A) {
      case cr:
        return "startAngle";
      case SQ:
        return "endAngle";
      case RC:
        return "outerRadius";
      case HQ:
        return "innerRadius";
    }
  return A;
}
function Fl(A) {
  switch (A) {
    case un:
      return YC;
    case Vo:
      return Nl;
    case FC:
      return xC;
    case MC:
      return ar;
    case cr:
      return SQ;
    case RC:
      return HQ;
  }
}
function $s(A) {
  switch (A) {
    case un:
    case YC:
      return "width";
    case Vo:
    case Nl:
      return "height";
  }
}
function OWA(A) {
  switch (A) {
    case un:
      return "xOffset";
    case Vo:
      return "yOffset";
    case YC:
      return "x2Offset";
    case Nl:
      return "y2Offset";
    case cr:
      return "thetaOffset";
    case RC:
      return "radiusOffset";
    case SQ:
      return "theta2Offset";
    case HQ:
      return "radius2Offset";
  }
}
function $nA(A) {
  switch (A) {
    case un:
      return "xOffset";
    case Vo:
      return "yOffset";
  }
}
function c5e(A) {
  switch (A) {
    case "xOffset":
      return "x";
    case "yOffset":
      return "y";
  }
}
const Q5e = _A(jnA), {
  x: sXt,
  y: IXt,
  // x2 and y2 share the same scale as x and y
  x2: aXt,
  y2: rXt,
  //
  xOffset: CXt,
  yOffset: BXt,
  latitude: lXt,
  longitude: cXt,
  latitude2: QXt,
  longitude2: EXt,
  theta: uXt,
  theta2: dXt,
  radius: hXt,
  radius2: mXt,
  // The rest of unit channels then have scale
  ...AoA
} = jnA, E5e = _A(AoA), eoA = {
  x: 1,
  y: 1
}, Ml = _A(eoA);
function qn(A) {
  return A in eoA;
}
const toA = {
  theta: 1,
  radius: 1
}, u5e = _A(toA);
function BV(A) {
  return A === "width" ? un : Vo;
}
const jWA = { xOffset: 1, yOffset: 1 };
function HF(A) {
  return A in jWA;
}
const {
  // x2 and y2 share the same scale as x and y
  // text and tooltip have format instead of scale,
  // href has neither format, nor scale
  text: pXt,
  tooltip: yXt,
  href: bXt,
  url: wXt,
  description: fXt,
  // detail and order have no scale
  detail: DXt,
  key: GXt,
  order: kXt,
  ...PWA
} = AoA, d5e = _A(PWA);
function h5e(A) {
  return !!AoA[A];
}
function m5e(A) {
  switch (A) {
    case js:
    case Yl:
    case Rl:
    case ZQ:
    case Ps:
    case WQ:
    case Td:
    case _d:
      return !0;
    case Xd:
    case zd:
    case l0:
      return !1;
  }
}
const $WA = {
  ...eoA,
  ...toA,
  ...jWA,
  ...PWA
}, lV = _A($WA);
function KQ(A) {
  return !!$WA[A];
}
function p5e(A, e) {
  return b5e(A)[e];
}
const AKA = {
  // all marks
  arc: "always",
  area: "always",
  bar: "always",
  circle: "always",
  geoshape: "always",
  image: "always",
  line: "always",
  rule: "always",
  point: "always",
  rect: "always",
  square: "always",
  trail: "always",
  text: "always",
  tick: "always"
}, { geoshape: JXt, ...y5e } = AKA;
function b5e(A) {
  switch (A) {
    case js:
    case Yl:
    case Rl:
    case CV:
    case vF:
    case IV:
    case bp:
    case aV:
    case xf:
    case WQ:
    case Xd:
    case zd:
    case Td:
    case sV:
    case jc:
    case Pc:
      return AKA;
    case un:
    case Vo:
    case Vd:
    case nG:
    case FC:
    case MC:
      return y5e;
    case YC:
    case Nl:
    case xC:
    case ar:
      return {
        area: "always",
        bar: "always",
        image: "always",
        rect: "always",
        rule: "always",
        circle: "binned",
        point: "binned",
        square: "binned",
        tick: "binned",
        line: "binned",
        trail: "binned"
      };
    case ZQ:
      return {
        point: "always",
        tick: "always",
        rule: "always",
        circle: "always",
        square: "always",
        bar: "always",
        text: "always",
        line: "always",
        trail: "always"
      };
    case _d:
      return {
        line: "always",
        point: "always",
        tick: "always",
        rule: "always",
        circle: "always",
        square: "always",
        bar: "always",
        geoshape: "always"
      };
    case Ps:
      return { point: "always", geoshape: "always" };
    case LF:
      return { text: "always" };
    case l0:
      return { point: "always", square: "always", text: "always" };
    case rV:
      return { image: "always" };
    case cr:
      return { text: "always", arc: "always" };
    case RC:
      return { text: "always", arc: "always" };
    case SQ:
    case HQ:
      return { arc: "always" };
  }
}
function iT(A) {
  switch (A) {
    case un:
    case Vo:
    case cr:
    case RC:
    case Vd:
    case nG:
    case ZQ:
    case l0:
    case Td:
    case WQ:
    case Xd:
    case zd:
    case YC:
    case Nl:
    case SQ:
    case HQ:
      return;
    case sV:
    case jc:
    case Pc:
    case Ps:
    case _d:
    case LF:
    case bp:
    case aV:
    case rV:
    case CV:
      return "discrete";
    case js:
    case Yl:
    case Rl:
      return "flexible";
    case FC:
    case MC:
    case xC:
    case ar:
    case vF:
    case IV:
    case xf:
      return;
  }
}
const w5e = {
  argmax: 1,
  argmin: 1,
  average: 1,
  count: 1,
  distinct: 1,
  product: 1,
  max: 1,
  mean: 1,
  median: 1,
  min: 1,
  missing: 1,
  q1: 1,
  q3: 1,
  ci0: 1,
  ci1: 1,
  stderr: 1,
  stdev: 1,
  stdevp: 1,
  sum: 1,
  valid: 1,
  values: 1,
  variance: 1,
  variancep: 1
}, f5e = {
  count: 1,
  min: 1,
  max: 1
};
function hQ(A) {
  return !!A && !!A.argmin;
}
function qd(A) {
  return !!A && !!A.argmax;
}
function ioA(A) {
  return Be(A) && !!w5e[A];
}
const D5e = /* @__PURE__ */ new Set([
  "count",
  "valid",
  "missing",
  "distinct"
]);
function eKA(A) {
  return Be(A) && D5e.has(A);
}
function G5e(A) {
  return Be(A) && Ht(["min", "max"], A);
}
const k5e = /* @__PURE__ */ new Set([
  "count",
  "sum",
  "distinct",
  "valid",
  "missing"
]), J5e = /* @__PURE__ */ new Set([
  "mean",
  "average",
  "median",
  "q1",
  "q3",
  "min",
  "max"
]);
function tKA(A) {
  return Wd(A) && (A = fV(A, void 0)), "bin" + _A(A).map((e) => cV(A[e]) ? En(`_${e}_${nd(A[e])}`) : En(`_${e}_${A[e]}`)).join("");
}
function Oi(A) {
  return A === !0 || Q0(A) && !A.binned;
}
function qo(A) {
  return A === "binned" || Q0(A) && A.binned === !0;
}
function Q0(A) {
  return ce(A);
}
function cV(A) {
  return A == null ? void 0 : A.param;
}
function $dA(A) {
  switch (A) {
    case jc:
    case Pc:
    case ZQ:
    case js:
    case Yl:
    case Rl:
    case Td:
    case WQ:
    case Xd:
    case zd:
    case Ps:
      return 6;
    case _d:
      return 4;
    default:
      return 10;
  }
}
function SF(A) {
  return !!(A != null && A.expr);
}
function Ys(A) {
  const e = _A(A || {}), t = {};
  for (const i of e)
    t[i] = YI(A[i]);
  return t;
}
function iKA(A) {
  const {
    // These are non-mark title config that need to be hardcoded
    anchor: e,
    frame: t,
    offset: i,
    orient: n,
    angle: o,
    limit: g,
    // color needs to be redirect to fill
    color: s,
    // subtitle properties
    subtitleColor: I,
    subtitleFont: r,
    subtitleFontSize: a,
    subtitleFontStyle: C,
    subtitleFontWeight: B,
    subtitleLineHeight: l,
    subtitlePadding: Q,
    // The rest are mark config.
    ...E
  } = A, d = {
    ...E,
    ...s ? { fill: s } : {}
  }, m = {
    ...e ? { anchor: e } : {},
    ...t ? { frame: t } : {},
    ...i ? { offset: i } : {},
    ...n ? { orient: n } : {},
    ...o !== void 0 ? { angle: o } : {},
    ...g !== void 0 ? { limit: g } : {}
  }, y = {
    ...I ? { subtitleColor: I } : {},
    ...r ? { subtitleFont: r } : {},
    ...a ? { subtitleFontSize: a } : {},
    ...C ? { subtitleFontStyle: C } : {},
    ...B ? { subtitleFontWeight: B } : {},
    ...l ? { subtitleLineHeight: l } : {},
    ...Q ? { subtitlePadding: Q } : {}
  }, f = Ff(A, ["align", "baseline", "dx", "dy", "limit"]);
  return { titleMarkConfig: d, subtitleMarkConfig: f, nonMarkTitleProperties: m, subtitle: y };
}
function LE(A) {
  return Be(A) || ZA(A) && Be(A[0]);
}
function ke(A) {
  return !!(A != null && A.signal);
}
function Od(A) {
  return !!A.step;
}
function N5e(A) {
  return ZA(A) ? !1 : "fields" in A && !("data" in A);
}
function Y5e(A) {
  return ZA(A) ? !1 : "fields" in A && "data" in A;
}
function Zc(A) {
  return ZA(A) ? !1 : "field" in A && "data" in A;
}
const R5e = {
  aria: 1,
  description: 1,
  ariaRole: 1,
  ariaRoleDescription: 1,
  blend: 1,
  opacity: 1,
  fill: 1,
  fillOpacity: 1,
  stroke: 1,
  strokeCap: 1,
  strokeWidth: 1,
  strokeOpacity: 1,
  strokeDash: 1,
  strokeDashOffset: 1,
  strokeJoin: 1,
  strokeOffset: 1,
  strokeMiterLimit: 1,
  startAngle: 1,
  endAngle: 1,
  padAngle: 1,
  innerRadius: 1,
  outerRadius: 1,
  size: 1,
  shape: 1,
  interpolate: 1,
  tension: 1,
  orient: 1,
  align: 1,
  baseline: 1,
  text: 1,
  dir: 1,
  dx: 1,
  dy: 1,
  ellipsis: 1,
  limit: 1,
  radius: 1,
  theta: 1,
  angle: 1,
  font: 1,
  fontSize: 1,
  fontWeight: 1,
  fontStyle: 1,
  lineBreak: 1,
  lineHeight: 1,
  cursor: 1,
  href: 1,
  tooltip: 1,
  cornerRadius: 1,
  cornerRadiusTopLeft: 1,
  cornerRadiusTopRight: 1,
  cornerRadiusBottomLeft: 1,
  cornerRadiusBottomRight: 1,
  aspect: 1,
  width: 1,
  height: 1,
  url: 1,
  smooth: 1
  // commented below are vg channel that do not have mark config.
  // x: 1,
  // y: 1,
  // x2: 1,
  // y2: 1,
  // xc'|'yc'
  // clip: 1,
  // path: 1,
  // url: 1,
}, F5e = _A(R5e), M5e = {
  arc: 1,
  area: 1,
  group: 1,
  image: 1,
  line: 1,
  path: 1,
  rect: 1,
  rule: 1,
  shape: 1,
  symbol: 1,
  text: 1,
  trail: 1
}, aP = [
  "cornerRadius",
  "cornerRadiusTopLeft",
  "cornerRadiusTopRight",
  "cornerRadiusBottomLeft",
  "cornerRadiusBottomRight"
];
function nKA(A) {
  const e = ZA(A.condition) ? A.condition.map(AhA) : AhA(A.condition);
  return {
    ...YI(A),
    condition: e
  };
}
function YI(A) {
  if (SF(A)) {
    const { expr: e, ...t } = A;
    return { signal: e, ...t };
  }
  return A;
}
function AhA(A) {
  if (SF(A)) {
    const { expr: e, ...t } = A;
    return { signal: e, ...t };
  }
  return A;
}
function sn(A) {
  if (SF(A)) {
    const { expr: e, ...t } = A;
    return { signal: e, ...t };
  }
  return ke(A) ? A : A !== void 0 ? { value: A } : void 0;
}
function x5e(A) {
  return ke(A) ? A.signal : ie(A);
}
function ehA(A) {
  return ke(A) ? A.signal : ie(A.value);
}
function Or(A) {
  return ke(A) ? A.signal : A == null ? null : ie(A);
}
function L5e(A, e, t) {
  for (const i of t) {
    const n = mQ(i, e.markDef, e.config);
    n !== void 0 && (A[i] = sn(n));
  }
  return A;
}
function oKA(A) {
  return [].concat(A.type, A.style ?? []);
}
function bi(A, e, t, i = {}) {
  const { vgChannel: n, ignoreVgConfig: o } = i;
  return n && e[n] !== void 0 ? e[n] : e[A] !== void 0 ? e[A] : o && (!n || n === A) ? void 0 : mQ(A, e, t, i);
}
function mQ(A, e, t, { vgChannel: i } = {}) {
  return _n(
    // style config has highest precedence
    i ? fZ(A, e, t.style) : void 0,
    fZ(A, e, t.style),
    // then mark-specific config
    i ? t[e.type][i] : void 0,
    t[e.type][A],
    // Need to cast because MarkDef doesn't perfectly match with AnyMarkConfig, but if the type isn't available, we'll get nothing here, which is fine
    // If there is vgChannel, skip vl channel.
    // For example, vl size for text is vg fontSize, but config.mark.size is only for point size.
    i ? t.mark[i] : t.mark[A]
    // Need to cast for the same reason as above
  );
}
function fZ(A, e, t) {
  return gKA(A, oKA(e), t);
}
function gKA(A, e, t) {
  e = Ce(e);
  let i;
  for (const n of e) {
    const o = t[n];
    o && o[A] !== void 0 && (i = o[A]);
  }
  return i;
}
function sKA(A, e) {
  return Ce(A).reduce((t, i) => (t.field.push(se(i, e)), t.order.push(i.sort ?? "ascending"), t), { field: [], order: [] });
}
function IKA(A, e) {
  const t = [...A];
  return e.forEach((i) => {
    for (const n of t)
      if (ZI(n, i))
        return;
    t.push(i);
  }), t;
}
function aKA(A, e) {
  return ZI(A, e) || !e ? A : A ? [...Ce(A), ...Ce(e)].join(", ") : e;
}
function rKA(A, e) {
  const t = A.value, i = e.value;
  if (t == null || i === null)
    return {
      explicit: A.explicit,
      value: null
    };
  if ((LE(t) || ke(t)) && (LE(i) || ke(i)))
    return {
      explicit: A.explicit,
      value: aKA(t, i)
    };
  if (LE(t) || ke(t))
    return {
      explicit: A.explicit,
      value: t
    };
  if (LE(i) || ke(i))
    return {
      explicit: A.explicit,
      value: i
    };
  if (!LE(t) && !ke(t) && !LE(i) && !ke(i))
    return {
      explicit: A.explicit,
      value: IKA(t, i)
    };
  throw new Error("It should never reach here");
}
function noA(A) {
  return `Invalid specification ${Mi(A)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`;
}
const v5e = 'Autosize "fit" only works for single views and layered views.';
function thA(A) {
  return `${A == "width" ? "Width" : "Height"} "container" only works for single views and layered views.`;
}
function ihA(A) {
  const e = A == "width" ? "Width" : "Height", t = A == "width" ? "x" : "y";
  return `${e} "container" only works well with autosize "fit" or "fit-${t}".`;
}
function nhA(A) {
  return A ? `Dropping "fit-${A}" because spec has discrete ${$s(A)}.` : 'Dropping "fit" because spec has discrete size.';
}
function ooA(A) {
  return `Unknown field for ${A}. Cannot calculate view size.`;
}
function ohA(A) {
  return `Cannot project a selection on encoding channel "${A}", which has no field.`;
}
function H5e(A, e) {
  return `Cannot project a selection on encoding channel "${A}" as it uses an aggregate function ("${e}").`;
}
function S5e(A) {
  return `The "nearest" transform is not supported for ${A} marks.`;
}
function CKA(A) {
  return `Selection not supported for ${A} yet.`;
}
function Z5e(A) {
  return `Cannot find a selection named "${A}".`;
}
const W5e = "Scale bindings are currently only supported for scales with unbinned, continuous domains.", K5e = "Legend bindings are only supported for selections over an individual field or encoding channel.";
function U5e(A) {
  return `Lookups can only be performed on selection parameters. "${A}" is a variable parameter.`;
}
function V5e(A) {
  return `Cannot define and lookup the "${A}" selection in the same view. Try moving the lookup into a second, layered view?`;
}
const X5e = "The same selection must be used to override scale domains in a layered view.", z5e = 'Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';
function T5e(A) {
  return `Unknown repeated value "${A}".`;
}
function ghA(A) {
  return `The "columns" property cannot be used when "${A}" has nested row/column.`;
}
const _5e = "Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";
function q5e(A) {
  return `Unrecognized parse "${A}".`;
}
function shA(A, e, t) {
  return `An ancestor parsed field "${A}" as ${t} but a child wants to parse the field as ${e}.`;
}
const O5e = "Attempt to add the same child twice.";
function j5e(A) {
  return `Ignoring an invalid transform: ${Mi(A)}.`;
}
const P5e = 'If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';
function IhA(A) {
  return `Config.customFormatTypes is not true, thus custom format type and format for channel ${A} are dropped.`;
}
function $5e(A) {
  const { parentProjection: e, projection: t } = A;
  return `Layer's shared projection ${Mi(e)} is overridden by a child projection ${Mi(t)}.`;
}
const Aze = "Arc marks uses theta channel rather than angle, replacing angle with theta.";
function eze(A) {
  return `${A}Offset dropped because ${A} is continuous`;
}
function tze(A, e, t) {
  return `Channel ${A} is a ${e}. Converted to {value: ${Mi(t)}}.`;
}
function BKA(A) {
  return `Invalid field type "${A}".`;
}
function ize(A, e) {
  return `Invalid field type "${A}" for aggregate: "${e}", using "quantitative" instead.`;
}
function nze(A) {
  return `Invalid aggregation operator "${A}".`;
}
function lKA(A, e) {
  const { fill: t, stroke: i } = e;
  return `Dropping color ${A} as the plot also has ${t && i ? "fill and stroke" : t ? "fill" : "stroke"}.`;
}
function oze(A) {
  return `Position range does not support relative band size for ${A}.`;
}
function rP(A, e) {
  return `Dropping ${Mi(A)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`;
}
const gze = "Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";
function QV(A, e, t) {
  return `${A} dropped as it is incompatible with "${e}"${t ? ` when ${t}` : ""}.`;
}
function sze(A) {
  return `${A}-encoding is dropped as ${A} is not a valid encoding channel.`;
}
function Ize(A) {
  return `${A} encoding should be discrete (ordinal / nominal / binned).`;
}
function aze(A) {
  return `${A} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`;
}
function rze(A) {
  return `Facet encoding dropped as ${A.join(" and ")} ${A.length > 1 ? "are" : "is"} also specified.`;
}
function nT(A, e) {
  return `Using discrete channel "${A}" to encode "${e}" field can be misleading as it does not encode ${e === "ordinal" ? "order" : "magnitude"}.`;
}
function Cze(A) {
  return `The ${A} for range marks cannot be an expression`;
}
function Bze(A, e) {
  return `Line mark is for continuous lines and thus cannot be used with ${A && e ? "x2 and y2" : A ? "x2" : "y2"}. We will use the rule mark (line segments) instead.`;
}
function lze(A, e) {
  return `Specified orient "${A}" overridden with "${e}".`;
}
function cze(A) {
  return `Cannot use the scale property "${A}" with non-color channel.`;
}
function Qze(A) {
  return `Cannot use the relative band size with ${A} scale.`;
}
function Eze(A) {
  return `Using unaggregated domain with raw field has no effect (${Mi(A)}).`;
}
function uze(A) {
  return `Unaggregated domain not applicable for "${A}" since it produces values outside the origin domain of the source data.`;
}
function dze(A) {
  return `Unaggregated domain is currently unsupported for log scale (${Mi(A)}).`;
}
function hze(A) {
  return `Cannot apply size to non-oriented mark "${A}".`;
}
function mze(A, e, t) {
  return `Channel "${A}" does not work with "${e}" scale. We are using "${t}" scale instead.`;
}
function pze(A, e) {
  return `FieldDef does not work with "${A}" scale. We are using "${e}" scale instead.`;
}
function cKA(A, e, t) {
  return `${t}-scale's "${e}" is dropped as it does not work with ${A} scale.`;
}
function QKA(A) {
  return `The step for "${A}" is dropped because the ${A === "width" ? "x" : "y"} is continuous.`;
}
function yze(A, e, t, i) {
  return `Conflicting ${e.toString()} property "${A.toString()}" (${Mi(t)} and ${Mi(i)}). Using ${Mi(t)}.`;
}
function bze(A, e, t, i) {
  return `Conflicting ${e.toString()} property "${A.toString()}" (${Mi(t)} and ${Mi(i)}). Using the union of the two domains.`;
}
function wze(A) {
  return `Setting the scale to be independent for "${A}" means we also have to set the guide (axis or legend) to be independent.`;
}
function fze(A) {
  return `Dropping sort property ${Mi(A)} as unioned domains only support boolean or op "count", "min", and "max".`;
}
const ahA = "Domains that should be unioned has conflicting sort properties. Sort will be set to true.", Dze = "Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.", Gze = "Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.", kze = "Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";
function Jze(A) {
  return `Cannot stack "${A}" if there is already "${A}2".`;
}
function Nze(A) {
  return `Cannot stack non-linear scale (${A}).`;
}
function Yze(A) {
  return `Stacking is applied even though the aggregate function is non-summative ("${A}").`;
}
function DZ(A, e) {
  return `Invalid ${A}: ${Mi(e)}.`;
}
function Rze(A) {
  return `Dropping day from datetime ${Mi(A)} as day cannot be combined with other units.`;
}
function Fze(A, e) {
  return `${e ? "extent " : ""}${e && A ? "and " : ""}${A ? "center " : ""}${e && A ? "are " : "is "}not needed when data are aggregated.`;
}
function Mze(A, e, t) {
  return `${A} is not usually used with ${e} for ${t}.`;
}
function xze(A, e) {
  return `Continuous axis should not have customized aggregation function ${A}; ${e} already agregates the axis.`;
}
function rhA(A) {
  return `1D error band does not support ${A}.`;
}
function EKA(A) {
  return `Channel ${A} is required for "binned" bin.`;
}
function Lze(A) {
  return `Channel ${A} should not be used with "binned" bin.`;
}
function vze(A) {
  return `Domain for ${A} is required for threshold scale.`;
}
const uKA = ceA(leA);
let Lf = uKA;
function Hze(A) {
  return Lf = A, Lf;
}
function Sze() {
  return Lf = uKA, Lf;
}
function PA(...A) {
  Lf.warn(...A);
}
function Zze(...A) {
  Lf.debug(...A);
}
function E0(A) {
  if (A && ce(A)) {
    for (const e of soA)
      if (e in A)
        return !0;
  }
  return !1;
}
const dKA = [
  "january",
  "february",
  "march",
  "april",
  "may",
  "june",
  "july",
  "august",
  "september",
  "october",
  "november",
  "december"
], Wze = dKA.map((A) => A.substr(0, 3)), hKA = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"], Kze = hKA.map((A) => A.substr(0, 3));
function Uze(A) {
  if (gV(A) && (A = +A), ti(A))
    return A > 4 && PA(DZ("quarter", A)), A - 1;
  throw new Error(DZ("quarter", A));
}
function Vze(A) {
  if (gV(A) && (A = +A), ti(A))
    return A - 1;
  {
    const e = A.toLowerCase(), t = dKA.indexOf(e);
    if (t !== -1)
      return t;
    const i = e.substr(0, 3), n = Wze.indexOf(i);
    if (n !== -1)
      return n;
    throw new Error(DZ("month", A));
  }
}
function Xze(A) {
  if (gV(A) && (A = +A), ti(A))
    return A % 7;
  {
    const e = A.toLowerCase(), t = hKA.indexOf(e);
    if (t !== -1)
      return t;
    const i = e.substr(0, 3), n = Kze.indexOf(i);
    if (n !== -1)
      return n;
    throw new Error(DZ("day", A));
  }
}
function goA(A, e) {
  const t = [];
  if (e && A.day !== void 0 && _A(A).length > 1 && (PA(Rze(A)), A = tt(A), delete A.day), A.year !== void 0 ? t.push(A.year) : t.push(2012), A.month !== void 0) {
    const i = e ? Vze(A.month) : A.month;
    t.push(i);
  } else if (A.quarter !== void 0) {
    const i = e ? Uze(A.quarter) : A.quarter;
    t.push(ti(i) ? i * 3 : `${i}*3`);
  } else
    t.push(0);
  if (A.date !== void 0)
    t.push(A.date);
  else if (A.day !== void 0) {
    const i = e ? Xze(A.day) : A.day;
    t.push(ti(i) ? i + 1 : `${i}+1`);
  } else
    t.push(1);
  for (const i of ["hours", "minutes", "seconds", "milliseconds"]) {
    const n = A[i];
    t.push(typeof n > "u" ? 0 : n);
  }
  return t;
}
function wp(A) {
  const e = goA(A, !0).join(", ");
  return A.utc ? `utc(${e})` : `datetime(${e})`;
}
function zze(A) {
  const e = goA(A, !1).join(", ");
  return A.utc ? `utc(${e})` : `datetime(${e})`;
}
function Tze(A) {
  const e = goA(A, !0);
  return A.utc ? +new Date(Date.UTC(...e)) : +new Date(...e);
}
const mKA = {
  year: 1,
  quarter: 1,
  month: 1,
  week: 1,
  day: 1,
  dayofyear: 1,
  date: 1,
  hours: 1,
  minutes: 1,
  seconds: 1,
  milliseconds: 1
}, soA = _A(mKA);
function _ze(A) {
  return !!mKA[A];
}
function u0(A) {
  return ce(A) ? A.binned : pKA(A);
}
function pKA(A) {
  return A && A.startsWith("binned");
}
function IoA(A) {
  return A.startsWith("utc");
}
function qze(A) {
  return A.substring(3);
}
const Oze = {
  "year-month": "%b %Y ",
  "year-month-date": "%b %d, %Y "
};
function EV(A) {
  return soA.filter((e) => bKA(A, e));
}
function yKA(A) {
  const e = EV(A);
  return e[e.length - 1];
}
function bKA(A, e) {
  const t = A.indexOf(e);
  return !(t < 0 || t > 0 && e === "seconds" && A.charAt(t - 1) === "i" || A.length > t + 3 && e === "day" && A.charAt(t + 3) === "o" || t > 0 && e === "year" && A.charAt(t - 1) === "f");
}
function jze(A, e, { end: t } = { end: !1 }) {
  const i = _nA(e), n = IoA(A) ? "utc" : "";
  function o(I) {
    return I === "quarter" ? `(${n}quarter(${i})-1)` : `${n}${I}(${i})`;
  }
  let g;
  const s = {};
  for (const I of soA)
    bKA(A, I) && (s[I] = o(I), g = I);
  return t && (s[g] += "+1"), zze(s);
}
function wKA(A) {
  if (!A)
    return;
  const e = EV(A);
  return `timeUnitSpecifier(${Mi(e)}, ${Mi(Oze)})`;
}
function Pze(A, e, t) {
  if (!A)
    return;
  const i = wKA(A);
  return `${t || IoA(A) ? "utc" : "time"}Format(${e}, ${i})`;
}
function vo(A) {
  if (!A)
    return;
  let e;
  return Be(A) ? pKA(A) ? e = {
    unit: A.substring(6),
    binned: !0
  } : e = {
    unit: A
  } : ce(A) && (e = {
    ...A,
    ...A.unit ? { unit: A.unit } : {}
  }), IoA(e.unit) && (e.utc = !0, e.unit = qze(e.unit)), e;
}
function $ze(A) {
  const { utc: e, ...t } = vo(A);
  return t.unit ? (e ? "utc" : "") + _A(t).map((i) => En(`${i === "unit" ? "" : `_${i}_`}${t[i]}`)).join("") : (e ? "utc" : "") + "timeunit" + _A(t).map((i) => En(`_${i}_${t[i]}`)).join("");
}
function fKA(A, e = (t) => t) {
  const t = vo(A), i = yKA(t.unit);
  if (i && i !== "day") {
    const n = {
      year: 2001,
      month: 1,
      date: 1,
      hours: 0,
      minutes: 0,
      seconds: 0,
      milliseconds: 0
    }, { step: o, part: g } = DKA(i, t.step), s = {
      ...n,
      [g]: +n[g] + o
    };
    return `${e(wp(s))} - ${e(wp(n))}`;
  }
}
const ATe = {
  year: 1,
  month: 1,
  date: 1,
  hours: 1,
  minutes: 1,
  seconds: 1,
  milliseconds: 1
};
function eTe(A) {
  return !!ATe[A];
}
function DKA(A, e = 1) {
  if (eTe(A))
    return { part: A, step: e };
  switch (A) {
    case "day":
    case "dayofyear":
      return { part: "date", step: e };
    case "quarter":
      return { part: "month", step: e * 3 };
    case "week":
      return { part: "date", step: e * 7 };
  }
}
function tTe(A) {
  return A == null ? void 0 : A.param;
}
function aoA(A) {
  return !!(A != null && A.field) && A.equal !== void 0;
}
function roA(A) {
  return !!(A != null && A.field) && A.lt !== void 0;
}
function CoA(A) {
  return !!(A != null && A.field) && A.lte !== void 0;
}
function BoA(A) {
  return !!(A != null && A.field) && A.gt !== void 0;
}
function loA(A) {
  return !!(A != null && A.field) && A.gte !== void 0;
}
function coA(A) {
  return !!(A != null && A.field && (ZA(A.range) && A.range.length === 2 || ke(A.range)));
}
function QoA(A) {
  return !!(A != null && A.field) && (ZA(A.oneOf) || ZA(A.in));
}
function iTe(A) {
  return !!(A != null && A.field) && A.valid !== void 0;
}
function GKA(A) {
  return QoA(A) || aoA(A) || coA(A) || roA(A) || BoA(A) || CoA(A) || loA(A);
}
function tB(A, e) {
  return DV(A, { timeUnit: e, wrapTime: !0 });
}
function nTe(A, e) {
  return A.map((t) => tB(t, e));
}
function kKA(A, e = !0) {
  const { field: t } = A, i = vo(A.timeUnit), { unit: n, binned: o } = i || {}, g = se(A, { expr: "datum" }), s = n ? (
    // For timeUnit, cast into integer with time() so we can use ===, inrange, indexOf to compare values directly.
    // TODO: We calculate timeUnit on the fly here. Consider if we would like to consolidate this with timeUnit pipeline
    // TODO: support utc
    `time(${o ? g : jze(n, t)})`
  ) : g;
  if (aoA(A))
    return `${s}===${tB(A.equal, n)}`;
  if (roA(A)) {
    const I = A.lt;
    return `${s}<${tB(I, n)}`;
  } else if (BoA(A)) {
    const I = A.gt;
    return `${s}>${tB(I, n)}`;
  } else if (CoA(A)) {
    const I = A.lte;
    return `${s}<=${tB(I, n)}`;
  } else if (loA(A)) {
    const I = A.gte;
    return `${s}>=${tB(I, n)}`;
  } else {
    if (QoA(A))
      return `indexof([${nTe(A.oneOf, n).join(",")}], ${s}) !== -1`;
    if (iTe(A))
      return EoA(s, A.valid);
    if (coA(A)) {
      const { range: I } = A, r = ke(I) ? { signal: `${I.signal}[0]` } : I[0], a = ke(I) ? { signal: `${I.signal}[1]` } : I[1];
      if (r !== null && a !== null && e)
        return "inrange(" + s + ", [" + tB(r, n) + ", " + tB(a, n) + "])";
      const C = [];
      return r !== null && C.push(`${s} >= ${tB(r, n)}`), a !== null && C.push(`${s} <= ${tB(a, n)}`), C.length > 0 ? C.join(" && ") : "true";
    }
  }
  throw new Error(`Invalid field predicate: ${Mi(A)}`);
}
function EoA(A, e = !0) {
  return e ? `isValid(${A}) && isFinite(+${A})` : `!isValid(${A}) || !isFinite(+${A})`;
}
function oTe(A) {
  return GKA(A) && A.timeUnit ? {
    ...A,
    timeUnit: vo(A.timeUnit)
  } : A;
}
const ZF = {
  quantitative: "quantitative",
  ordinal: "ordinal",
  temporal: "temporal",
  nominal: "nominal",
  geojson: "geojson"
};
function gTe(A) {
  return A === "quantitative" || A === "temporal";
}
function JKA(A) {
  return A === "ordinal" || A === "nominal";
}
const fp = ZF.quantitative, uoA = ZF.ordinal, vf = ZF.temporal, doA = ZF.nominal, oG = ZF.geojson;
function sTe(A) {
  if (A)
    switch (A = A.toLowerCase(), A) {
      case "q":
      case fp:
        return "quantitative";
      case "t":
      case vf:
        return "temporal";
      case "o":
      case uoA:
        return "ordinal";
      case "n":
      case doA:
        return "nominal";
      case oG:
        return "geojson";
    }
}
const Vs = {
  // Continuous - Quantitative
  LINEAR: "linear",
  LOG: "log",
  POW: "pow",
  SQRT: "sqrt",
  SYMLOG: "symlog",
  IDENTITY: "identity",
  SEQUENTIAL: "sequential",
  // Continuous - Time
  TIME: "time",
  UTC: "utc",
  // Discretizing scales
  QUANTILE: "quantile",
  QUANTIZE: "quantize",
  THRESHOLD: "threshold",
  BIN_ORDINAL: "bin-ordinal",
  // Discrete scales
  ORDINAL: "ordinal",
  POINT: "point",
  BAND: "band"
}, CP = {
  linear: "numeric",
  log: "numeric",
  pow: "numeric",
  sqrt: "numeric",
  symlog: "numeric",
  identity: "numeric",
  sequential: "numeric",
  time: "time",
  utc: "time",
  ordinal: "ordinal",
  "bin-ordinal": "bin-ordinal",
  point: "ordinal-position",
  band: "ordinal-position",
  quantile: "discretizing",
  quantize: "discretizing",
  threshold: "discretizing"
};
function ITe(A, e) {
  const t = CP[A], i = CP[e];
  return t === i || t === "ordinal-position" && i === "time" || i === "ordinal-position" && t === "time";
}
const aTe = {
  // numeric
  linear: 0,
  log: 1,
  pow: 1,
  sqrt: 1,
  symlog: 1,
  identity: 1,
  sequential: 1,
  // time
  time: 0,
  utc: 0,
  // ordinal-position -- these have higher precedence than continuous scales as they support more types of data
  point: 10,
  band: 11,
  // non grouped types
  ordinal: 0,
  "bin-ordinal": 0,
  quantile: 0,
  quantize: 0,
  threshold: 0
};
function ChA(A) {
  return aTe[A];
}
const NKA = /* @__PURE__ */ new Set([
  "linear",
  "log",
  "pow",
  "sqrt",
  "symlog"
]), YKA = /* @__PURE__ */ new Set([
  ...NKA,
  "time",
  "utc"
]);
function RKA(A) {
  return NKA.has(A);
}
const FKA = /* @__PURE__ */ new Set([
  "quantile",
  "quantize",
  "threshold"
]), rTe = /* @__PURE__ */ new Set([
  ...YKA,
  ...FKA,
  "sequential",
  "identity"
]), CTe = /* @__PURE__ */ new Set([
  "ordinal",
  "bin-ordinal",
  "point",
  "band"
]);
function Wo(A) {
  return CTe.has(A);
}
function ia(A) {
  return rTe.has(A);
}
function jr(A) {
  return YKA.has(A);
}
function Hf(A) {
  return FKA.has(A);
}
const BTe = {
  pointPadding: 0.5,
  barBandPaddingInner: 0.1,
  rectBandPaddingInner: 0,
  bandWithNestedOffsetPaddingInner: 0.2,
  bandWithNestedOffsetPaddingOuter: 0.2,
  minBandSize: 2,
  minFontSize: 8,
  maxFontSize: 40,
  minOpacity: 0.3,
  maxOpacity: 0.8,
  // FIXME: revise if these *can* become ratios of width/height step
  minSize: 9,
  minStrokeWidth: 1,
  maxStrokeWidth: 4,
  quantileCount: 4,
  quantizeCount: 4,
  zero: !0
};
function lTe(A) {
  return !Be(A) && !!A.name;
}
function MKA(A) {
  return A == null ? void 0 : A.param;
}
function cTe(A) {
  return A == null ? void 0 : A.unionWith;
}
function QTe(A) {
  return ce(A) && "field" in A;
}
const ETe = {
  type: 1,
  domain: 1,
  domainMax: 1,
  domainMin: 1,
  domainMid: 1,
  domainRaw: 1,
  align: 1,
  range: 1,
  rangeMax: 1,
  rangeMin: 1,
  scheme: 1,
  bins: 1,
  // Other properties
  reverse: 1,
  round: 1,
  // quantitative / time
  clamp: 1,
  nice: 1,
  // quantitative
  base: 1,
  exponent: 1,
  constant: 1,
  interpolate: 1,
  zero: 1,
  // band/point
  padding: 1,
  paddingInner: 1,
  paddingOuter: 1
}, { type: NXt, domain: YXt, range: RXt, rangeMax: FXt, rangeMin: MXt, scheme: xXt, ...uTe } = ETe, dTe = _A(uTe);
function BP(A, e) {
  switch (e) {
    case "type":
    case "domain":
    case "reverse":
    case "range":
      return !0;
    case "scheme":
    case "interpolate":
      return !["point", "band", "identity"].includes(A);
    case "bins":
      return !["point", "band", "identity", "ordinal"].includes(A);
    case "round":
      return jr(A) || A === "band" || A === "point";
    case "padding":
    case "rangeMin":
    case "rangeMax":
      return jr(A) || ["point", "band"].includes(A);
    case "paddingOuter":
    case "align":
      return ["point", "band"].includes(A);
    case "paddingInner":
      return A === "band";
    case "domainMax":
    case "domainMid":
    case "domainMin":
    case "domainRaw":
    case "clamp":
      return jr(A);
    case "nice":
      return jr(A) || A === "quantize" || A === "threshold";
    case "exponent":
      return A === "pow";
    case "base":
      return A === "log";
    case "constant":
      return A === "symlog";
    case "zero":
      return ia(A) && !Ht([
        "log",
        "time",
        "utc",
        "threshold",
        "quantile"
        // quantile depends on distribution so zero does not matter
      ], A);
  }
}
function xKA(A, e) {
  switch (e) {
    case "interpolate":
    case "scheme":
    case "domainMid":
      return cw(A) ? void 0 : cze(e);
    case "align":
    case "type":
    case "bins":
    case "domain":
    case "domainMax":
    case "domainMin":
    case "domainRaw":
    case "range":
    case "base":
    case "exponent":
    case "constant":
    case "nice":
    case "padding":
    case "paddingInner":
    case "paddingOuter":
    case "rangeMax":
    case "rangeMin":
    case "reverse":
    case "round":
    case "clamp":
    case "zero":
      return;
  }
}
function hTe(A, e) {
  return Ht([uoA, doA], e) ? A === void 0 || Wo(A) : e === vf ? Ht([Vs.TIME, Vs.UTC, void 0], A) : e === fp ? RKA(A) || Hf(A) || A === void 0 : !0;
}
function mTe(A, e, t = !1) {
  if (!KQ(A))
    return !1;
  switch (A) {
    case un:
    case Vo:
    case Vd:
    case nG:
    case cr:
    case RC:
      return jr(e) || e === "band" ? !0 : e === "point" ? !t : !1;
    case ZQ:
    case Td:
    case WQ:
    case Xd:
    case zd:
    case l0:
      return jr(e) || Hf(e) || Ht(["band", "point", "ordinal"], e);
    case js:
    case Yl:
    case Rl:
      return e !== "band";
    case _d:
    case Ps:
      return e === "ordinal" || Hf(e);
  }
}
const ds = {
  arc: "arc",
  area: "area",
  bar: "bar",
  image: "image",
  line: "line",
  point: "point",
  rect: "rect",
  rule: "rule",
  text: "text",
  tick: "tick",
  trail: "trail",
  circle: "circle",
  square: "square",
  geoshape: "geoshape"
}, LKA = ds.arc, uV = ds.area, dV = ds.bar, pTe = ds.image, hV = ds.line, mV = ds.point, yTe = ds.rect, GZ = ds.rule, vKA = ds.text, hoA = ds.tick, bTe = ds.trail, moA = ds.circle, poA = ds.square, HKA = ds.geoshape;
function jd(A) {
  return ["line", "area", "trail"].includes(A);
}
function E2(A) {
  return [
    "rect",
    "bar",
    "image",
    "arc"
    /* arc is rect/interval in polar coordinate */
  ].includes(A);
}
const wTe = new Set(_A(ds));
function Cl(A) {
  return A.type;
}
const fTe = [
  "stroke",
  "strokeWidth",
  "strokeDash",
  "strokeDashOffset",
  "strokeOpacity",
  "strokeJoin",
  "strokeMiterLimit"
], DTe = ["fill", "fillOpacity"], GTe = [...fTe, ...DTe], kTe = {
  color: 1,
  filled: 1,
  invalid: 1,
  order: 1,
  radius2: 1,
  theta2: 1,
  timeUnitBandSize: 1,
  timeUnitBandPosition: 1
}, BhA = _A(kTe), JTe = {
  area: ["line", "point"],
  bar: ["binSpacing", "continuousBandSize", "discreteBandSize", "minBandSize"],
  rect: ["binSpacing", "continuousBandSize", "discreteBandSize", "minBandSize"],
  line: ["point"],
  tick: ["bandSize", "thickness"]
}, NTe = {
  color: "#4c78a8",
  invalid: "filter",
  timeUnitBandSize: 1
}, YTe = {
  mark: 1,
  arc: 1,
  area: 1,
  bar: 1,
  circle: 1,
  image: 1,
  line: 1,
  point: 1,
  rect: 1,
  rule: 1,
  square: 1,
  text: 1,
  tick: 1,
  trail: 1,
  geoshape: 1
}, SKA = _A(YTe);
function Dp(A) {
  return A && A.band != null;
}
const RTe = {
  horizontal: ["cornerRadiusTopRight", "cornerRadiusBottomRight"],
  vertical: ["cornerRadiusTopLeft", "cornerRadiusTopRight"]
}, ZKA = 5, FTe = {
  binSpacing: 1,
  continuousBandSize: ZKA,
  minBandSize: 0.25,
  timeUnitBandPosition: 0.5
}, MTe = {
  binSpacing: 0,
  continuousBandSize: ZKA,
  minBandSize: 0.25,
  timeUnitBandPosition: 0.5
}, xTe = {
  thickness: 1
};
function LTe(A) {
  return Cl(A) ? A.type : A;
}
function yoA(A) {
  const { channel: e, channelDef: t, markDef: i, scale: n, config: o } = A, g = woA(A);
  return (
    // Only this for field def without counting aggregate (as count wouldn't be null)
    jA(t) && !eKA(t.aggregate) && // and only for continuous scale
    n && jr(n.get("type")) ? vTe({
      fieldDef: t,
      channel: e,
      markDef: i,
      ref: g,
      config: o
    }) : g
  );
}
function vTe({ fieldDef: A, channel: e, markDef: t, ref: i, config: n }) {
  return jd(t.type) ? i : bi("invalid", t, n) === null ? [HTe(A, e), i] : i;
}
function HTe(A, e) {
  const t = boA(A, !0), i = c0(e) === "y" ? { field: { group: "height" } } : (
    // x / angle / radius can all use 0
    { value: 0 }
  );
  return { test: t, ...i };
}
function boA(A, e = !0) {
  return EoA(Be(A) ? A : se(A, { expr: "datum" }), !e);
}
function STe(A) {
  const { datum: e } = A;
  return E0(e) ? wp(e) : `${Mi(e)}`;
}
function Hm(A, e, t, i) {
  const n = {};
  if (e && (n.scale = e), xl(A)) {
    const { datum: o } = A;
    E0(o) ? n.signal = wp(o) : ke(o) ? n.signal = o.signal : SF(o) ? n.signal = o.expr : n.value = o;
  } else
    n.field = se(A, t);
  if (i) {
    const { offset: o, band: g } = i;
    o && (n.offset = o), g && (n.band = g);
  }
  return n;
}
function kZ({ scaleName: A, fieldOrDatumDef: e, fieldOrDatumDef2: t, offset: i, startSuffix: n, endSuffix: o = "end", bandPosition: g = 0.5 }) {
  const s = !ke(g) && 0 < g && g < 1 ? "datum" : void 0, I = se(e, { expr: s, suffix: n }), r = t !== void 0 ? se(t, { expr: s }) : se(e, { suffix: o, expr: s }), a = {};
  if (g === 0 || g === 1) {
    a.scale = A;
    const C = g === 0 ? I : r;
    a.field = C;
  } else {
    const C = ke(g) ? `(1-${g.signal}) * ${I} + ${g.signal} * ${r}` : `${1 - g} * ${I} + ${g} * ${r}`;
    a.signal = `scale("${A}", ${C})`;
  }
  return i && (a.offset = i), a;
}
function ZTe({ scaleName: A, fieldDef: e }) {
  const t = se(e, { expr: "datum" }), i = se(e, { expr: "datum", suffix: "end" });
  return `abs(scale("${A}", ${i}) - scale("${A}", ${t}))`;
}
function woA({ channel: A, channelDef: e, channel2Def: t, markDef: i, config: n, scaleName: o, scale: g, stack: s, offset: I, defaultRef: r, bandPosition: a }) {
  if (e) {
    if (at(e)) {
      const C = g == null ? void 0 : g.get("type");
      if (ls(e)) {
        a ?? (a = gd({
          fieldDef: e,
          fieldDef2: t,
          markDef: i,
          config: n
        }));
        const { bin: B, timeUnit: l, type: Q } = e;
        if (Oi(B) || a && l && Q === vf)
          return s != null && s.impute ? Hm(e, o, { binSuffix: "mid" }, { offset: I }) : a && !Wo(C) ? kZ({ scaleName: o, fieldOrDatumDef: e, bandPosition: a, offset: I }) : Hm(e, o, VF(e, A) ? { binSuffix: "range" } : {}, {
            offset: I
          });
        if (qo(B)) {
          if (jA(t))
            return kZ({
              scaleName: o,
              fieldOrDatumDef: e,
              fieldOrDatumDef2: t,
              bandPosition: a,
              offset: I
            });
          PA(EKA(A === un ? YC : Nl));
        }
      }
      return Hm(
        e,
        o,
        Wo(C) ? { binSuffix: "range" } : {},
        // no need for bin suffix if there is no scale
        {
          offset: I,
          // For band, to get mid point, need to offset by half of the band
          band: C === "band" ? a ?? e.bandPosition ?? 0.5 : void 0
        }
      );
    } else if (yC(e)) {
      const C = e.value, B = I ? { offset: I } : {};
      return { ...RN(A, C), ...B };
    }
  }
  return yt(r) && (r = r()), r && {
    ...r,
    // only include offset when it is non-zero (zero = no offset)
    ...I ? { offset: I } : {}
  };
}
function RN(A, e) {
  return Ht(["x", "x2"], A) && e === "width" ? { field: { group: "width" } } : Ht(["y", "y2"], A) && e === "height" ? { field: { group: "height" } } : sn(e);
}
function Gp(A) {
  return A && A !== "number" && A !== "time";
}
function WKA(A, e, t) {
  return `${A}(${e}${t ? `, ${Mi(t)}` : ""})`;
}
const WTe = " – ";
function foA({ fieldOrDatumDef: A, format: e, formatType: t, expr: i, normalizeStack: n, config: o }) {
  var g, s;
  if (Gp(t))
    return Pr({
      fieldOrDatumDef: A,
      format: e,
      formatType: t,
      expr: i,
      config: o
    });
  const I = KKA(A, i, n), r = Sf(A);
  if (e === void 0 && t === void 0 && o.customFormatTypes) {
    if (r === "quantitative") {
      if (n && o.normalizedNumberFormatType)
        return Pr({
          fieldOrDatumDef: A,
          format: o.normalizedNumberFormat,
          formatType: o.normalizedNumberFormatType,
          expr: i,
          config: o
        });
      if (o.numberFormatType)
        return Pr({
          fieldOrDatumDef: A,
          format: o.numberFormat,
          formatType: o.numberFormatType,
          expr: i,
          config: o
        });
    }
    if (r === "temporal" && o.timeFormatType && jA(A) && A.timeUnit === void 0)
      return Pr({
        fieldOrDatumDef: A,
        format: o.timeFormat,
        formatType: o.timeFormatType,
        expr: i,
        config: o
      });
  }
  if (Wf(A)) {
    const a = UTe({
      field: I,
      timeUnit: jA(A) ? (g = vo(A.timeUnit)) == null ? void 0 : g.unit : void 0,
      format: e,
      formatType: o.timeFormatType,
      rawTimeFormat: o.timeFormat,
      isUTCScale: d0(A) && ((s = A.scale) == null ? void 0 : s.type) === Vs.UTC
    });
    return a ? { signal: a } : void 0;
  }
  if (e = lP({ type: r, specifiedFormat: e, config: o, normalizeStack: n }), jA(A) && Oi(A.bin)) {
    const a = se(A, { expr: i, binSuffix: "end" });
    return {
      signal: WF(I, a, e, t, o)
    };
  } else
    return e || Sf(A) === "quantitative" ? {
      signal: `${XKA(I, e)}`
    } : { signal: `isValid(${I}) ? ${I} : ""+${I}` };
}
function KKA(A, e, t) {
  return jA(A) ? t ? `${se(A, { expr: e, suffix: "end" })}-${se(A, {
    expr: e,
    suffix: "start"
  })}` : se(A, { expr: e }) : STe(A);
}
function Pr({ fieldOrDatumDef: A, format: e, formatType: t, expr: i, normalizeStack: n, config: o, field: g }) {
  if (g ?? (g = KKA(A, i, n)), g !== "datum.value" && // For axis/legend, we can't correctly know the end of the bin from `datum`
  jA(A) && Oi(A.bin)) {
    const s = se(A, { expr: i, binSuffix: "end" });
    return {
      signal: WF(g, s, e, t, o)
    };
  }
  return { signal: WKA(t, g, e) };
}
function UKA(A, e, t, i, n, o) {
  var g;
  if (!(Be(i) && Gp(i)) && !(t === void 0 && i === void 0 && n.customFormatTypes && Sf(A) === "quantitative" && (n.normalizedNumberFormatType && Zf(A) && A.stack === "normalize" || n.numberFormatType))) {
    if (Zf(A) && A.stack === "normalize" && n.normalizedNumberFormat)
      return lP({
        type: "quantitative",
        config: n,
        normalizeStack: !0
      });
    if (Wf(A)) {
      const s = jA(A) ? (g = vo(A.timeUnit)) == null ? void 0 : g.unit : void 0;
      return s === void 0 && n.customFormatTypes && n.timeFormatType ? void 0 : KTe({ specifiedFormat: t, timeUnit: s, config: n, omitTimeFormatConfig: o });
    }
    return lP({ type: e, specifiedFormat: t, config: n });
  }
}
function VKA(A, e, t) {
  var i;
  if (A && (ke(A) || A === "number" || A === "time"))
    return A;
  if (Wf(e) && t !== "time" && t !== "utc")
    return jA(e) && (i = vo(e == null ? void 0 : e.timeUnit)) != null && i.utc ? "utc" : "time";
}
function lP({ type: A, specifiedFormat: e, config: t, normalizeStack: i }) {
  if (Be(e))
    return e;
  if (A === fp)
    return i ? t.normalizedNumberFormat : t.numberFormat;
}
function KTe({ specifiedFormat: A, timeUnit: e, config: t, omitTimeFormatConfig: i }) {
  return A || (e ? {
    signal: wKA(e)
  } : i ? void 0 : t.timeFormat);
}
function XKA(A, e) {
  return `format(${A}, "${e || ""}")`;
}
function lhA(A, e, t, i) {
  return Gp(t) ? WKA(t, A, e) : XKA(A, (Be(e) ? e : void 0) ?? i.numberFormat);
}
function WF(A, e, t, i, n) {
  if (t === void 0 && i === void 0 && n.customFormatTypes && n.numberFormatType)
    return WF(A, e, n.numberFormat, n.numberFormatType, n);
  const o = lhA(A, t, i, n), g = lhA(e, t, i, n);
  return `${EoA(A, !1)} ? "null" : ${o} + "${WTe}" + ${g}`;
}
function UTe({ field: A, timeUnit: e, format: t, formatType: i, rawTimeFormat: n, isUTCScale: o }) {
  return !e || t ? !e && i ? `${i}(${A}, '${t}')` : (t = Be(t) ? t : n, `${o ? "utc" : "time"}Format(${A}, '${t}')`) : Pze(e, A, o);
}
const pV = "min", VTe = {
  x: 1,
  y: 1,
  color: 1,
  fill: 1,
  stroke: 1,
  strokeWidth: 1,
  size: 1,
  shape: 1,
  fillOpacity: 1,
  strokeOpacity: 1,
  opacity: 1,
  text: 1
};
function chA(A) {
  return A in VTe;
}
function zKA(A) {
  return !!(A != null && A.encoding);
}
function OB(A) {
  return A && (A.op === "count" || !!A.field);
}
function TKA(A) {
  return A && ZA(A);
}
function KF(A) {
  return "row" in A || "column" in A;
}
function DoA(A) {
  return !!A && "header" in A;
}
function yV(A) {
  return "facet" in A;
}
function XTe(A) {
  return A.param;
}
function zTe(A) {
  return A && !Be(A) && "repeat" in A;
}
function QhA(A) {
  const { field: e, timeUnit: t, bin: i, aggregate: n } = A;
  return {
    ...t ? { timeUnit: t } : {},
    ...i ? { bin: i } : {},
    ...n ? { aggregate: n } : {},
    field: e
  };
}
function GoA(A) {
  return "sort" in A;
}
function gd({ fieldDef: A, fieldDef2: e, markDef: t, config: i }) {
  if (at(A) && A.bandPosition !== void 0)
    return A.bandPosition;
  if (jA(A)) {
    const { timeUnit: n, bin: o } = A;
    if (n && !e)
      return mQ("timeUnitBandPosition", t, i);
    if (Oi(o))
      return 0.5;
  }
}
function _KA({ channel: A, fieldDef: e, fieldDef2: t, markDef: i, config: n, scaleType: o, useVlSizeChannel: g }) {
  var s, I, r;
  const a = $s(A), C = bi(g ? "size" : a, i, n, {
    vgChannel: a
  });
  if (C !== void 0)
    return C;
  if (jA(e)) {
    const { timeUnit: B, bin: l } = e;
    if (B && !t)
      return { band: mQ("timeUnitBandSize", i, n) };
    if (Oi(l) && !Wo(o))
      return { band: 1 };
  }
  if (E2(i.type))
    return o ? Wo(o) ? ((s = n[i.type]) == null ? void 0 : s.discreteBandSize) || { band: 1 } : (I = n[i.type]) == null ? void 0 : I.continuousBandSize : (r = n[i.type]) == null ? void 0 : r.discreteBandSize;
}
function qKA(A, e, t, i) {
  return Oi(A.bin) || A.timeUnit && ls(A) && A.type === "temporal" ? gd({ fieldDef: A, fieldDef2: e, markDef: t, config: i }) !== void 0 : !1;
}
function OKA(A) {
  return A && !!A.sort && !A.field;
}
function bV(A) {
  return A && "condition" in A;
}
function wV(A) {
  const e = A == null ? void 0 : A.condition;
  return !!e && !ZA(e) && jA(e);
}
function UF(A) {
  const e = A == null ? void 0 : A.condition;
  return !!e && !ZA(e) && at(e);
}
function TTe(A) {
  const e = A == null ? void 0 : A.condition;
  return !!e && (ZA(e) || yC(e));
}
function jA(A) {
  return A && (!!A.field || A.aggregate === "count");
}
function Sf(A) {
  return A == null ? void 0 : A.type;
}
function xl(A) {
  return A && "datum" in A;
}
function ou(A) {
  return ls(A) && !NZ(A) || JZ(A);
}
function EhA(A) {
  return ls(A) && A.type === "quantitative" && !A.bin || JZ(A);
}
function JZ(A) {
  return xl(A) && ti(A.datum);
}
function at(A) {
  return jA(A) || xl(A);
}
function ls(A) {
  return A && ("field" in A || A.aggregate === "count") && "type" in A;
}
function yC(A) {
  return A && "value" in A && "value" in A;
}
function d0(A) {
  return A && ("scale" in A || "sort" in A);
}
function Zf(A) {
  return A && ("axis" in A || "stack" in A || "impute" in A);
}
function jKA(A) {
  return A && "legend" in A;
}
function PKA(A) {
  return A && ("format" in A || "formatType" in A);
}
function _Te(A) {
  return Us(A, ["legend", "axis", "header", "scale"]);
}
function qTe(A) {
  return "op" in A;
}
function se(A, e = {}) {
  let t = A.field;
  const i = e.prefix;
  let n = e.suffix, o = "";
  if (jTe(A))
    t = WWA("count");
  else {
    let g;
    if (!e.nofn)
      if (qTe(A))
        g = A.op;
      else {
        const { bin: s, aggregate: I, timeUnit: r } = A;
        Oi(s) ? (g = tKA(s), n = (e.binSuffix ?? "") + (e.suffix ?? "")) : I ? qd(I) ? (o = `["${t}"]`, t = `argmax_${I.argmax}`) : hQ(I) ? (o = `["${t}"]`, t = `argmin_${I.argmin}`) : g = String(I) : r && !u0(r) && (g = $ze(r), n = (!["range", "mid"].includes(e.binSuffix) && e.binSuffix || "") + (e.suffix ?? ""));
      }
    g && (t = t ? `${g}_${t}` : g);
  }
  return n && (t = `${t}_${n}`), i && (t = `${i}_${t}`), e.forAs ? qnA(t) : e.expr ? HWA(t, e.expr) + o : Ir(t) + o;
}
function NZ(A) {
  switch (A.type) {
    case "nominal":
    case "ordinal":
    case "geojson":
      return !0;
    case "quantitative":
      return jA(A) && !!A.bin;
    case "temporal":
      return !1;
  }
  throw new Error(BKA(A.type));
}
function OTe(A) {
  var e;
  return d0(A) && Hf((e = A.scale) == null ? void 0 : e.type);
}
function jTe(A) {
  return A.aggregate === "count";
}
function PTe(A, e) {
  var t;
  const { field: i, bin: n, timeUnit: o, aggregate: g } = A;
  if (g === "count")
    return e.countTitle;
  if (Oi(n))
    return `${i} (binned)`;
  if (o && !u0(o)) {
    const s = (t = vo(o)) == null ? void 0 : t.unit;
    if (s)
      return `${i} (${EV(s).join("-")})`;
  } else if (g)
    return qd(g) ? `${i} for max ${g.argmax}` : hQ(g) ? `${i} for min ${g.argmin}` : `${xF(g)} of ${i}`;
  return i;
}
function $Te(A) {
  const { aggregate: e, bin: t, timeUnit: i, field: n } = A;
  if (qd(e))
    return `${n} for argmax(${e.argmax})`;
  if (hQ(e))
    return `${n} for argmin(${e.argmin})`;
  const o = i && !u0(i) ? vo(i) : void 0, g = e || (o == null ? void 0 : o.unit) || (o == null ? void 0 : o.maxbins) && "timeunit" || Oi(t) && "bin";
  return g ? `${g.toUpperCase()}(${n})` : n;
}
const $KA = (A, e) => {
  switch (e.fieldTitle) {
    case "plain":
      return A.field;
    case "functional":
      return $Te(A);
    default:
      return PTe(A, e);
  }
};
let A3A = $KA;
function e3A(A) {
  A3A = A;
}
function A_e() {
  e3A($KA);
}
function Qw(A, e, { allowDisabling: t, includeDefault: i = !0 }) {
  var n;
  const o = (n = koA(A)) == null ? void 0 : n.title;
  if (!jA(A))
    return o ?? A.title;
  const g = A, s = i ? JoA(g, e) : void 0;
  return t ? _n(o, g.title, s) : o ?? g.title ?? s;
}
function koA(A) {
  if (Zf(A) && A.axis)
    return A.axis;
  if (jKA(A) && A.legend)
    return A.legend;
  if (DoA(A) && A.header)
    return A.header;
}
function JoA(A, e) {
  return A3A(A, e);
}
function YZ(A) {
  if (PKA(A)) {
    const { format: e, formatType: t } = A;
    return { format: e, formatType: t };
  } else {
    const e = koA(A) ?? {}, { format: t, formatType: i } = e;
    return { format: t, formatType: i };
  }
}
function e_e(A, e) {
  var t;
  switch (e) {
    case "latitude":
    case "longitude":
      return "quantitative";
    case "row":
    case "column":
    case "facet":
    case "shape":
    case "strokeDash":
      return "nominal";
    case "order":
      return "ordinal";
  }
  if (GoA(A) && ZA(A.sort))
    return "ordinal";
  const { aggregate: i, bin: n, timeUnit: o } = A;
  if (o)
    return "temporal";
  if (n || i && !qd(i) && !hQ(i))
    return "quantitative";
  if (d0(A) && (t = A.scale) != null && t.type)
    switch (CP[A.scale.type]) {
      case "numeric":
      case "discretizing":
        return "quantitative";
      case "time":
        return "temporal";
    }
  return "nominal";
}
function Bl(A) {
  if (jA(A))
    return A;
  if (wV(A))
    return A.condition;
}
function co(A) {
  if (at(A))
    return A;
  if (UF(A))
    return A.condition;
}
function t3A(A, e, t, i = {}) {
  if (Be(A) || ti(A) || Wd(A)) {
    const n = Be(A) ? "string" : ti(A) ? "number" : "boolean";
    return PA(tze(e, n, A)), { value: A };
  }
  return at(A) ? RZ(A, e, t, i) : UF(A) ? {
    ...A,
    // Need to cast as normalizeFieldDef normally return FieldDef, but here we know that it is definitely Condition<FieldDef>
    condition: RZ(A.condition, e, t, i)
  } : A;
}
function RZ(A, e, t, i) {
  if (PKA(A)) {
    const { format: n, formatType: o, ...g } = A;
    if (Gp(o) && !t.customFormatTypes)
      return PA(IhA(e)), RZ(g, e, t, i);
  } else {
    const n = Zf(A) ? "axis" : jKA(A) ? "legend" : DoA(A) ? "header" : null;
    if (n && A[n]) {
      const { format: o, formatType: g, ...s } = A[n];
      if (Gp(g) && !t.customFormatTypes)
        return PA(IhA(e)), RZ({ ...A, [n]: s }, e, t, i);
    }
  }
  return jA(A) ? NoA(A, e, i) : t_e(A);
}
function t_e(A) {
  let e = A.type;
  if (e)
    return A;
  const { datum: t } = A;
  return e = ti(t) ? "quantitative" : Be(t) ? "nominal" : E0(t) ? "temporal" : void 0, { ...A, type: e };
}
function NoA(A, e, { compositeMark: t = !1 } = {}) {
  const { aggregate: i, timeUnit: n, bin: o, field: g } = A, s = { ...A };
  if (!t && i && !ioA(i) && !qd(i) && !hQ(i) && (PA(nze(i)), delete s.aggregate), n && (s.timeUnit = vo(n)), g && (s.field = `${g}`), Oi(o) && (s.bin = fV(o, e)), qo(o) && !qn(e) && PA(Lze(e)), ls(s)) {
    const { type: I } = s, r = sTe(I);
    I !== r && (s.type = r), I !== "quantitative" && eKA(i) && (PA(ize(I, i)), s.type = "quantitative");
  } else if (!qWA(e)) {
    const I = e_e(s, e);
    s.type = I;
  }
  if (ls(s)) {
    const { compatible: I, warning: r } = i_e(s, e) || {};
    I === !1 && PA(r);
  }
  if (GoA(s) && Be(s.sort)) {
    const { sort: I } = s;
    if (chA(I))
      return {
        ...s,
        sort: { encoding: I }
      };
    const r = I.substr(1);
    if (I.charAt(0) === "-" && chA(r))
      return {
        ...s,
        sort: { encoding: r, order: "descending" }
      };
  }
  if (DoA(s)) {
    const { header: I } = s;
    if (I) {
      const { orient: r, ...a } = I;
      if (r)
        return {
          ...s,
          header: {
            ...a,
            labelOrient: I.labelOrient || r,
            titleOrient: I.titleOrient || r
          }
        };
    }
  }
  return s;
}
function fV(A, e) {
  return Wd(A) ? { maxbins: $dA(e) } : A === "binned" ? {
    binned: !0
  } : !A.maxbins && !A.step ? { ...A, maxbins: $dA(e) } : A;
}
const hy = { compatible: !0 };
function i_e(A, e) {
  const t = A.type;
  if (t === "geojson" && e !== "shape")
    return {
      compatible: !1,
      warning: `Channel ${e} should not be used with a geojson data.`
    };
  switch (e) {
    case jc:
    case Pc:
    case sV:
      return NZ(A) ? hy : {
        compatible: !1,
        warning: Ize(e)
      };
    case un:
    case Vo:
    case Vd:
    case nG:
    case js:
    case Yl:
    case Rl:
    case LF:
    case vF:
    case IV:
    case bp:
    case aV:
    case rV:
    case l0:
    case cr:
    case RC:
    case CV:
      return hy;
    case MC:
    case ar:
    case FC:
    case xC:
      return t !== fp ? {
        compatible: !1,
        warning: `Channel ${e} should be used with a quantitative field only, not ${A.type} field.`
      } : hy;
    case WQ:
    case Xd:
    case zd:
    case Td:
    case ZQ:
    case SQ:
    case HQ:
    case YC:
    case Nl:
      return t === "nominal" && !A.sort ? {
        compatible: !1,
        warning: `Channel ${e} should not be used with an unsorted discrete field.`
      } : hy;
    case Ps:
    case _d:
      return !NZ(A) && !OTe(A) ? {
        compatible: !1,
        warning: aze(e)
      } : hy;
    case xf:
      return A.type === "nominal" && !("sort" in A) ? {
        compatible: !1,
        warning: "Channel order is inappropriate for nominal field, which has no inherent order."
      } : hy;
  }
}
function Wf(A) {
  const { formatType: e } = YZ(A);
  return e === "time" || !e && n_e(A);
}
function n_e(A) {
  return A && (A.type === "temporal" || jA(A) && !!A.timeUnit);
}
function DV(A, { timeUnit: e, type: t, wrapTime: i, undefinedIfExprNotRequired: n }) {
  var o;
  const g = e && ((o = vo(e)) == null ? void 0 : o.unit);
  let s = g || t === "temporal", I;
  return SF(A) ? I = A.expr : ke(A) ? I = A.signal : E0(A) ? (s = !0, I = wp(A)) : (Be(A) || ti(A)) && s && (I = `datetime(${Mi(A)})`, _ze(g) && (ti(A) && A < 1e4 || Be(A) && isNaN(Date.parse(A))) && (I = wp({ [g]: A }))), I ? i && s ? `time(${I})` : I : n ? void 0 : Mi(A);
}
function i3A(A, e) {
  const { type: t } = A;
  return e.map((i) => {
    const n = jA(A) && !u0(A.timeUnit) ? A.timeUnit : void 0, o = DV(i, {
      timeUnit: n,
      type: t,
      undefinedIfExprNotRequired: !0
    });
    return o !== void 0 ? { signal: o } : i;
  });
}
function VF(A, e) {
  return Oi(A.bin) ? KQ(e) && ["ordinal", "nominal"].includes(A.type) : (console.warn("Only call this method for binned field defs."), !1);
}
const uhA = {
  labelAlign: {
    part: "labels",
    vgProp: "align"
  },
  labelBaseline: {
    part: "labels",
    vgProp: "baseline"
  },
  labelColor: {
    part: "labels",
    vgProp: "fill"
  },
  labelFont: {
    part: "labels",
    vgProp: "font"
  },
  labelFontSize: {
    part: "labels",
    vgProp: "fontSize"
  },
  labelFontStyle: {
    part: "labels",
    vgProp: "fontStyle"
  },
  labelFontWeight: {
    part: "labels",
    vgProp: "fontWeight"
  },
  labelOpacity: {
    part: "labels",
    vgProp: "opacity"
  },
  labelOffset: null,
  labelPadding: null,
  gridColor: {
    part: "grid",
    vgProp: "stroke"
  },
  gridDash: {
    part: "grid",
    vgProp: "strokeDash"
  },
  gridDashOffset: {
    part: "grid",
    vgProp: "strokeDashOffset"
  },
  gridOpacity: {
    part: "grid",
    vgProp: "opacity"
  },
  gridWidth: {
    part: "grid",
    vgProp: "strokeWidth"
  },
  tickColor: {
    part: "ticks",
    vgProp: "stroke"
  },
  tickDash: {
    part: "ticks",
    vgProp: "strokeDash"
  },
  tickDashOffset: {
    part: "ticks",
    vgProp: "strokeDashOffset"
  },
  tickOpacity: {
    part: "ticks",
    vgProp: "opacity"
  },
  tickSize: null,
  tickWidth: {
    part: "ticks",
    vgProp: "strokeWidth"
  }
};
function XF(A) {
  return A == null ? void 0 : A.condition;
}
const n3A = ["domain", "grid", "labels", "ticks", "title"], o_e = {
  grid: "grid",
  gridCap: "grid",
  gridColor: "grid",
  gridDash: "grid",
  gridDashOffset: "grid",
  gridOpacity: "grid",
  gridScale: "grid",
  gridWidth: "grid",
  orient: "main",
  bandPosition: "both",
  aria: "main",
  description: "main",
  domain: "main",
  domainCap: "main",
  domainColor: "main",
  domainDash: "main",
  domainDashOffset: "main",
  domainOpacity: "main",
  domainWidth: "main",
  format: "main",
  formatType: "main",
  labelAlign: "main",
  labelAngle: "main",
  labelBaseline: "main",
  labelBound: "main",
  labelColor: "main",
  labelFlush: "main",
  labelFlushOffset: "main",
  labelFont: "main",
  labelFontSize: "main",
  labelFontStyle: "main",
  labelFontWeight: "main",
  labelLimit: "main",
  labelLineHeight: "main",
  labelOffset: "main",
  labelOpacity: "main",
  labelOverlap: "main",
  labelPadding: "main",
  labels: "main",
  labelSeparation: "main",
  maxExtent: "main",
  minExtent: "main",
  offset: "both",
  position: "main",
  tickCap: "main",
  tickColor: "main",
  tickDash: "main",
  tickDashOffset: "main",
  tickMinStep: "both",
  tickOffset: "both",
  tickOpacity: "main",
  tickRound: "both",
  ticks: "main",
  tickSize: "main",
  tickWidth: "both",
  title: "main",
  titleAlign: "main",
  titleAnchor: "main",
  titleAngle: "main",
  titleBaseline: "main",
  titleColor: "main",
  titleFont: "main",
  titleFontSize: "main",
  titleFontStyle: "main",
  titleFontWeight: "main",
  titleLimit: "main",
  titleLineHeight: "main",
  titleOpacity: "main",
  titlePadding: "main",
  titleX: "main",
  titleY: "main",
  encode: "both",
  scale: "both",
  tickBand: "both",
  tickCount: "both",
  tickExtra: "both",
  translate: "both",
  values: "both",
  zindex: "both"
  // this is actually set afterward, so it doesn't matter
}, o3A = {
  orient: 1,
  aria: 1,
  bandPosition: 1,
  description: 1,
  domain: 1,
  domainCap: 1,
  domainColor: 1,
  domainDash: 1,
  domainDashOffset: 1,
  domainOpacity: 1,
  domainWidth: 1,
  format: 1,
  formatType: 1,
  grid: 1,
  gridCap: 1,
  gridColor: 1,
  gridDash: 1,
  gridDashOffset: 1,
  gridOpacity: 1,
  gridWidth: 1,
  labelAlign: 1,
  labelAngle: 1,
  labelBaseline: 1,
  labelBound: 1,
  labelColor: 1,
  labelFlush: 1,
  labelFlushOffset: 1,
  labelFont: 1,
  labelFontSize: 1,
  labelFontStyle: 1,
  labelFontWeight: 1,
  labelLimit: 1,
  labelLineHeight: 1,
  labelOffset: 1,
  labelOpacity: 1,
  labelOverlap: 1,
  labelPadding: 1,
  labels: 1,
  labelSeparation: 1,
  maxExtent: 1,
  minExtent: 1,
  offset: 1,
  position: 1,
  tickBand: 1,
  tickCap: 1,
  tickColor: 1,
  tickCount: 1,
  tickDash: 1,
  tickDashOffset: 1,
  tickExtra: 1,
  tickMinStep: 1,
  tickOffset: 1,
  tickOpacity: 1,
  tickRound: 1,
  ticks: 1,
  tickSize: 1,
  tickWidth: 1,
  title: 1,
  titleAlign: 1,
  titleAnchor: 1,
  titleAngle: 1,
  titleBaseline: 1,
  titleColor: 1,
  titleFont: 1,
  titleFontSize: 1,
  titleFontStyle: 1,
  titleFontWeight: 1,
  titleLimit: 1,
  titleLineHeight: 1,
  titleOpacity: 1,
  titlePadding: 1,
  titleX: 1,
  titleY: 1,
  translate: 1,
  values: 1,
  zindex: 1
}, g_e = {
  ...o3A,
  style: 1,
  labelExpr: 1,
  encoding: 1
};
function dhA(A) {
  return !!g_e[A];
}
const s_e = {
  axis: 1,
  axisBand: 1,
  axisBottom: 1,
  axisDiscrete: 1,
  axisLeft: 1,
  axisPoint: 1,
  axisQuantitative: 1,
  axisRight: 1,
  axisTemporal: 1,
  axisTop: 1,
  axisX: 1,
  axisXBand: 1,
  axisXDiscrete: 1,
  axisXPoint: 1,
  axisXQuantitative: 1,
  axisXTemporal: 1,
  axisY: 1,
  axisYBand: 1,
  axisYDiscrete: 1,
  axisYPoint: 1,
  axisYQuantitative: 1,
  axisYTemporal: 1
}, g3A = _A(s_e);
function UQ(A) {
  return "mark" in A;
}
class GV {
  constructor(e, t) {
    this.name = e, this.run = t;
  }
  hasMatchingType(e) {
    return UQ(e) ? LTe(e.mark) === this.name : !1;
  }
}
function Sm(A, e) {
  const t = A && A[e];
  return t ? ZA(t) ? pp(t, (i) => !!i.field) : jA(t) || wV(t) : !1;
}
function s3A(A, e) {
  const t = A && A[e];
  return t ? ZA(t) ? pp(t, (i) => !!i.field) : jA(t) || xl(t) || UF(t) : !1;
}
function I3A(A, e) {
  if (qn(e)) {
    const t = A[e];
    if ((jA(t) || xl(t)) && (JKA(t.type) || jA(t) && t.timeUnit)) {
      const i = $nA(e);
      return s3A(A, i);
    }
  }
  return !1;
}
function YoA(A) {
  return pp(a5e, (e) => {
    if (Sm(A, e)) {
      const t = A[e];
      if (ZA(t))
        return pp(t, (i) => !!i.aggregate);
      {
        const i = Bl(t);
        return i && !!i.aggregate;
      }
    }
    return !1;
  });
}
function a3A(A, e) {
  const t = [], i = [], n = [], o = [], g = {};
  return RoA(A, (s, I) => {
    if (jA(s)) {
      const { field: r, aggregate: a, bin: C, timeUnit: B, ...l } = s;
      if (a || B || C) {
        const Q = koA(s), E = Q == null ? void 0 : Q.title;
        let d = se(s, { forAs: !0 });
        const m = {
          // Only add title if it doesn't exist
          ...E ? [] : { title: Qw(s, e, { allowDisabling: !0 }) },
          ...l,
          // Always overwrite field
          field: d
        };
        if (a) {
          let y;
          if (qd(a) ? (y = "argmax", d = se({ op: "argmax", field: a.argmax }, { forAs: !0 }), m.field = `${d}.${r}`) : hQ(a) ? (y = "argmin", d = se({ op: "argmin", field: a.argmin }, { forAs: !0 }), m.field = `${d}.${r}`) : a !== "boxplot" && a !== "errorbar" && a !== "errorband" && (y = a), y) {
            const f = {
              op: y,
              as: d
            };
            r && (f.field = r), o.push(f);
          }
        } else if (t.push(d), ls(s) && Oi(C)) {
          if (i.push({ bin: C, field: r, as: d }), t.push(se(s, { binSuffix: "end" })), VF(s, I) && t.push(se(s, { binSuffix: "range" })), qn(I)) {
            const y = {
              field: `${d}_end`
            };
            g[`${I}2`] = y;
          }
          m.bin = "binned", qWA(I) || (m.type = fp);
        } else if (B && !u0(B)) {
          n.push({
            timeUnit: B,
            field: r,
            as: d
          });
          const y = ls(s) && s.type !== vf && "time";
          y && (I === LF || I === bp ? m.formatType = y : h5e(I) ? m.legend = {
            formatType: y,
            ...m.legend
          } : qn(I) && (m.axis = {
            formatType: y,
            ...m.axis
          }));
        }
        g[I] = m;
      } else
        t.push(r), g[I] = A[I];
    } else
      g[I] = A[I];
  }), {
    bins: i,
    timeUnits: n,
    aggregate: o,
    groupby: t,
    encoding: g
  };
}
function I_e(A, e, t) {
  const i = p5e(e, t);
  if (i) {
    if (i === "binned") {
      const n = A[e === YC ? un : Vo];
      return !!(jA(n) && jA(A[e]) && qo(n.bin));
    }
  } else
    return !1;
  return !0;
}
function a_e(A, e, t, i) {
  const n = {};
  for (const o of _A(A))
    _WA(o) || PA(sze(o));
  for (let o of Q5e) {
    if (!A[o])
      continue;
    const g = A[o];
    if (HF(o)) {
      const s = c5e(o), I = n[s];
      if (jA(I) && gTe(I.type) && jA(g) && !I.timeUnit) {
        PA(eze(s));
        continue;
      }
    }
    if (o === "angle" && e === "arc" && !A.theta && (PA(Aze), o = cr), !I_e(A, o, e)) {
      PA(QV(o, e));
      continue;
    }
    if (o === ZQ && e === "line") {
      const s = Bl(A[o]);
      if (s != null && s.aggregate) {
        PA(gze);
        continue;
      }
    }
    if (o === js && (t ? "fill" in A : "stroke" in A)) {
      PA(lKA("encoding", { fill: "fill" in A, stroke: "stroke" in A }));
      continue;
    }
    if (o === vF || o === xf && !ZA(g) && !yC(g) || o === bp && ZA(g)) {
      if (g) {
        if (o === xf) {
          const s = A[o];
          if (OKA(s)) {
            n[o] = s;
            continue;
          }
        }
        n[o] = Ce(g).reduce((s, I) => (jA(I) ? s.push(NoA(I, o)) : PA(rP(I, o)), s), []);
      }
    } else {
      if (o === bp && g === null)
        n[o] = null;
      else if (!jA(g) && !xl(g) && !yC(g) && !bV(g) && !ke(g)) {
        PA(rP(g, o));
        continue;
      }
      n[o] = t3A(g, o, i);
    }
  }
  return n;
}
function kV(A, e) {
  const t = {};
  for (const i of _A(A)) {
    const n = t3A(A[i], i, e, { compositeMark: !0 });
    t[i] = n;
  }
  return t;
}
function r_e(A) {
  const e = [];
  for (const t of _A(A))
    if (Sm(A, t)) {
      const i = A[t], n = Ce(i);
      for (const o of n)
        jA(o) ? e.push(o) : wV(o) && e.push(o.condition);
    }
  return e;
}
function RoA(A, e, t) {
  if (A)
    for (const i of _A(A)) {
      const n = A[i];
      if (ZA(n))
        for (const o of n)
          e.call(t, o, i);
      else
        e.call(t, n, i);
    }
}
function C_e(A, e, t, i) {
  return A ? _A(A).reduce((n, o) => {
    const g = A[o];
    return ZA(g) ? g.reduce((s, I) => e.call(i, s, I, o), n) : e.call(i, n, g, o);
  }, t) : t;
}
function r3A(A, e) {
  return _A(e).reduce((t, i) => {
    switch (i) {
      case un:
      case Vo:
      case aV:
      case CV:
      case rV:
      case YC:
      case Nl:
      case Vd:
      case nG:
      case cr:
      case SQ:
      case RC:
      case HQ:
      case FC:
      case MC:
      case xC:
      case ar:
      case LF:
      case Ps:
      case l0:
      case bp:
        return t;
      case xf:
        if (A === "line" || A === "trail")
          return t;
      case vF:
      case IV: {
        const n = e[i];
        if (ZA(n) || jA(n))
          for (const o of Ce(n))
            o.aggregate || t.push(se(o, {}));
        return t;
      }
      case ZQ:
        if (A === "trail")
          return t;
      case js:
      case Yl:
      case Rl:
      case WQ:
      case Xd:
      case zd:
      case _d:
      case Td: {
        const n = Bl(e[i]);
        return n && !n.aggregate && t.push(se(n, {})), t;
      }
    }
  }, []);
}
function B_e(A) {
  const { tooltip: e, ...t } = A;
  if (!e)
    return { filteredEncoding: t };
  let i, n;
  if (ZA(e)) {
    for (const o of e)
      o.aggregate ? (i || (i = []), i.push(o)) : (n || (n = []), n.push(o));
    i && (t.tooltip = i);
  } else
    e.aggregate ? t.tooltip = e : n = e;
  return ZA(n) && n.length === 1 && (n = n[0]), { customTooltipWithoutAggregatedField: n, filteredEncoding: t };
}
function cP(A, e, t, i = !0) {
  if ("tooltip" in t)
    return { tooltip: t.tooltip };
  const n = A.map(({ fieldPrefix: g, titlePrefix: s }) => {
    const I = i ? ` of ${FoA(e)}` : "";
    return {
      field: g + e.field,
      type: e.type,
      title: ke(s) ? { signal: `${s}"${escape(I)}"` } : s + I
    };
  }), o = r_e(t).map(_Te);
  return {
    tooltip: [
      ...n,
      // need to cast because TextFieldDef supports fewer types of bin
      ...YB(o, vt)
    ]
  };
}
function FoA(A) {
  const { title: e, field: t } = A;
  return _n(e, t);
}
function MoA(A, e, t, i, n) {
  const { scale: o, axis: g } = t;
  return ({ partName: s, mark: I, positionPrefix: r, endPositionPrefix: a = void 0, extraEncoding: C = {} }) => {
    const B = FoA(t);
    return C3A(A, s, n, {
      mark: I,
      encoding: {
        [e]: {
          field: `${r}_${t.field}`,
          type: t.type,
          ...B !== void 0 ? { title: B } : {},
          ...o !== void 0 ? { scale: o } : {},
          ...g !== void 0 ? { axis: g } : {}
        },
        ...Be(a) ? {
          [`${e}2`]: {
            field: `${a}_${t.field}`
          }
        } : {},
        ...i,
        ...C
      }
    });
  };
}
function C3A(A, e, t, i) {
  const { clip: n, color: o, opacity: g } = A, s = A.type;
  return A[e] || A[e] === void 0 && t[e] ? [
    {
      ...i,
      mark: {
        ...t[e],
        ...n ? { clip: n } : {},
        ...o ? { color: o } : {},
        ...g ? { opacity: g } : {},
        ...Cl(i.mark) ? i.mark : { type: i.mark },
        style: `${s}-${String(e)}`,
        ...Wd(A[e]) ? {} : A[e]
      }
    }
  ] : [];
}
function B3A(A, e, t) {
  const { encoding: i } = A, n = e === "vertical" ? "y" : "x", o = i[n], g = i[`${n}2`], s = i[`${n}Error`], I = i[`${n}Error2`];
  return {
    continuousAxisChannelDef: dx(o, t),
    continuousAxisChannelDef2: dx(g, t),
    continuousAxisChannelDefError: dx(s, t),
    continuousAxisChannelDefError2: dx(I, t),
    continuousAxis: n
  };
}
function dx(A, e) {
  if (A != null && A.aggregate) {
    const { aggregate: t, ...i } = A;
    return t !== e && PA(xze(t, e)), i;
  } else
    return A;
}
function l3A(A, e) {
  const { mark: t, encoding: i } = A, { x: n, y: o } = i;
  if (Cl(t) && t.orient)
    return t.orient;
  if (ou(n)) {
    if (ou(o)) {
      const g = jA(n) && n.aggregate, s = jA(o) && o.aggregate;
      if (!g && s === e)
        return "vertical";
      if (!s && g === e)
        return "horizontal";
      if (g === e && s === e)
        throw new Error("Both x and y cannot have aggregate");
      return Wf(o) && !Wf(n) ? "horizontal" : "vertical";
    }
    return "horizontal";
  } else {
    if (ou(o))
      return "vertical";
    throw new Error(`Need a valid continuous axis for ${e}s`);
  }
}
const FZ = "boxplot", l_e = ["box", "median", "outliers", "rule", "ticks"], c_e = new GV(FZ, Q3A);
function c3A(A) {
  return ti(A) ? "tukey" : A;
}
function Q3A(A, { config: e }) {
  A = {
    ...A,
    encoding: kV(A.encoding, e)
  };
  const { mark: t, encoding: i, params: n, projection: o, ...g } = A, s = Cl(t) ? t : { type: t };
  n && PA(CKA("boxplot"));
  const I = s.extent ?? e.boxplot.extent, r = bi(
    "size",
    s,
    // TODO: https://github.com/vega/vega-lite/issues/6245
    e
  ), a = s.invalid, C = c3A(I), { bins: B, timeUnits: l, transform: Q, continuousAxisChannelDef: E, continuousAxis: d, groupby: m, aggregate: y, encodingWithoutContinuousAxis: f, ticksOrient: w, boxOrient: G, customTooltipWithoutAggregatedField: R } = Q_e(A, I, e), { color: F, size: Z, ...c } = f, J = (ne) => MoA(s, d, E, ne, e.boxplot), p = J(c), N = J(f), v = J({ ...c, ...Z ? { size: Z } : {} }), K = cP([
    { fieldPrefix: C === "min-max" ? "upper_whisker_" : "max_", titlePrefix: "Max" },
    { fieldPrefix: "upper_box_", titlePrefix: "Q3" },
    { fieldPrefix: "mid_box_", titlePrefix: "Median" },
    { fieldPrefix: "lower_box_", titlePrefix: "Q1" },
    { fieldPrefix: C === "min-max" ? "lower_whisker_" : "min_", titlePrefix: "Min" }
  ], E, f), U = { type: "tick", color: "black", opacity: 1, orient: w, invalid: a, aria: !1 }, j = C === "min-max" ? K : (
    // for tukey / k-IQR, just show upper/lower-whisker
    cP([
      { fieldPrefix: "upper_whisker_", titlePrefix: "Upper Whisker" },
      { fieldPrefix: "lower_whisker_", titlePrefix: "Lower Whisker" }
    ], E, f)
  ), q = [
    ...p({
      partName: "rule",
      mark: { type: "rule", invalid: a, aria: !1 },
      positionPrefix: "lower_whisker",
      endPositionPrefix: "lower_box",
      extraEncoding: j
    }),
    ...p({
      partName: "rule",
      mark: { type: "rule", invalid: a, aria: !1 },
      positionPrefix: "upper_box",
      endPositionPrefix: "upper_whisker",
      extraEncoding: j
    }),
    ...p({
      partName: "ticks",
      mark: U,
      positionPrefix: "lower_whisker",
      extraEncoding: j
    }),
    ...p({
      partName: "ticks",
      mark: U,
      positionPrefix: "upper_whisker",
      extraEncoding: j
    })
  ], O = [
    ...C !== "tukey" ? q : [],
    ...N({
      partName: "box",
      mark: {
        type: "bar",
        ...r ? { size: r } : {},
        orient: G,
        invalid: a,
        ariaRoleDescription: "box"
      },
      positionPrefix: "lower_box",
      endPositionPrefix: "upper_box",
      extraEncoding: K
    }),
    ...v({
      partName: "median",
      mark: {
        type: "tick",
        invalid: a,
        ...ce(e.boxplot.median) && e.boxplot.median.color ? { color: e.boxplot.median.color } : {},
        ...r ? { size: r } : {},
        orient: w,
        aria: !1
      },
      positionPrefix: "mid_box",
      extraEncoding: K
    })
  ];
  if (C === "min-max")
    return {
      ...g,
      transform: (g.transform ?? []).concat(Q),
      layer: O
    };
  const $ = `datum["lower_box_${E.field}"]`, _ = `datum["upper_box_${E.field}"]`, tA = `(${_} - ${$})`, nA = `${$} - ${I} * ${tA}`, AA = `${_} + ${I} * ${tA}`, gA = `datum["${E.field}"]`, rA = {
    joinaggregate: E3A(E.field),
    groupby: m
  }, sA = {
    transform: [
      {
        filter: `(${nA} <= ${gA}) && (${gA} <= ${AA})`
      },
      {
        aggregate: [
          {
            op: "min",
            field: E.field,
            as: `lower_whisker_${E.field}`
          },
          {
            op: "max",
            field: E.field,
            as: `upper_whisker_${E.field}`
          },
          // preserve lower_box / upper_box
          {
            op: "min",
            field: `lower_box_${E.field}`,
            as: `lower_box_${E.field}`
          },
          {
            op: "max",
            field: `upper_box_${E.field}`,
            as: `upper_box_${E.field}`
          },
          ...y
        ],
        groupby: m
      }
    ],
    layer: q
  }, { tooltip: lA, ...cA } = c, { scale: aA, axis: QA } = E, hA = FoA(E), EA = Us(QA, ["title"]), RA = C3A(s, "outliers", e.boxplot, {
    transform: [{ filter: `(${gA} < ${nA}) || (${gA} > ${AA})` }],
    mark: "point",
    encoding: {
      [d]: {
        field: E.field,
        type: E.type,
        ...hA !== void 0 ? { title: hA } : {},
        ...aA !== void 0 ? { scale: aA } : {},
        // add axis without title since we already added the title above
        ...Fi(EA) ? {} : { axis: EA }
      },
      ...cA,
      ...F ? { color: F } : {},
      ...R ? { tooltip: R } : {}
    }
  })[0];
  let xA;
  const HA = [...B, ...l, rA];
  return RA ? xA = {
    transform: HA,
    layer: [RA, sA]
  } : (xA = sA, xA.transform.unshift(...HA)), {
    ...g,
    layer: [
      xA,
      {
        // boxplot
        transform: Q,
        layer: O
      }
    ]
  };
}
function E3A(A) {
  return [
    {
      op: "q1",
      field: A,
      as: `lower_box_${A}`
    },
    {
      op: "q3",
      field: A,
      as: `upper_box_${A}`
    }
  ];
}
function Q_e(A, e, t) {
  const i = l3A(A, FZ), { continuousAxisChannelDef: n, continuousAxis: o } = B3A(A, i, FZ), g = n.field, s = c3A(e), I = [
    ...E3A(g),
    {
      op: "median",
      field: g,
      as: `mid_box_${g}`
    },
    {
      op: "min",
      field: g,
      as: (s === "min-max" ? "lower_whisker_" : "min_") + g
    },
    {
      op: "max",
      field: g,
      as: (s === "min-max" ? "upper_whisker_" : "max_") + g
    }
  ], r = s === "min-max" || s === "tukey" ? [] : [
    // This is for the  original k-IQR, which we do not expose
    {
      calculate: `datum["upper_box_${g}"] - datum["lower_box_${g}"]`,
      as: `iqr_${g}`
    },
    {
      calculate: `min(datum["upper_box_${g}"] + datum["iqr_${g}"] * ${e}, datum["max_${g}"])`,
      as: `upper_whisker_${g}`
    },
    {
      calculate: `max(datum["lower_box_${g}"] - datum["iqr_${g}"] * ${e}, datum["min_${g}"])`,
      as: `lower_whisker_${g}`
    }
  ], { [o]: a, ...C } = A.encoding, { customTooltipWithoutAggregatedField: B, filteredEncoding: l } = B_e(C), { bins: Q, timeUnits: E, aggregate: d, groupby: m, encoding: y } = a3A(l, t), f = i === "vertical" ? "horizontal" : "vertical", w = i, G = [
    ...Q,
    ...E,
    {
      aggregate: [...d, ...I],
      groupby: m
    },
    ...r
  ];
  return {
    bins: Q,
    timeUnits: E,
    transform: G,
    groupby: m,
    aggregate: d,
    continuousAxisChannelDef: n,
    continuousAxis: o,
    encodingWithoutContinuousAxis: y,
    ticksOrient: f,
    boxOrient: w,
    customTooltipWithoutAggregatedField: B
  };
}
const xoA = "errorbar", E_e = ["ticks", "rule"], u_e = new GV(xoA, u3A);
function u3A(A, { config: e }) {
  A = {
    ...A,
    encoding: kV(A.encoding, e)
  };
  const { transform: t, continuousAxisChannelDef: i, continuousAxis: n, encodingWithoutContinuousAxis: o, ticksOrient: g, markDef: s, outerSpec: I, tooltipEncoding: r } = d3A(A, xoA, e);
  delete o.size;
  const a = MoA(s, n, i, o, e.errorbar), C = s.thickness, B = s.size, l = {
    type: "tick",
    orient: g,
    aria: !1,
    ...C !== void 0 ? { thickness: C } : {},
    ...B !== void 0 ? { size: B } : {}
  }, Q = [
    ...a({
      partName: "ticks",
      mark: l,
      positionPrefix: "lower",
      extraEncoding: r
    }),
    ...a({
      partName: "ticks",
      mark: l,
      positionPrefix: "upper",
      extraEncoding: r
    }),
    ...a({
      partName: "rule",
      mark: {
        type: "rule",
        ariaRoleDescription: "errorbar",
        ...C !== void 0 ? { size: C } : {}
      },
      positionPrefix: "lower",
      endPositionPrefix: "upper",
      extraEncoding: r
    })
  ];
  return {
    ...I,
    transform: t,
    ...Q.length > 1 ? { layer: Q } : { ...Q[0] }
  };
}
function d_e(A, e) {
  const { encoding: t } = A;
  if (h_e(t))
    return {
      orient: l3A(A, e),
      inputType: "raw"
    };
  const i = m_e(t), n = p_e(t), o = t.x, g = t.y;
  if (i) {
    if (n)
      throw new Error(`${e} cannot be both type aggregated-upper-lower and aggregated-error`);
    const s = t.x2, I = t.y2;
    if (at(s) && at(I))
      throw new Error(`${e} cannot have both x2 and y2`);
    if (at(s)) {
      if (ou(o))
        return { orient: "horizontal", inputType: "aggregated-upper-lower" };
      throw new Error(`Both x and x2 have to be quantitative in ${e}`);
    } else if (at(I)) {
      if (ou(g))
        return { orient: "vertical", inputType: "aggregated-upper-lower" };
      throw new Error(`Both y and y2 have to be quantitative in ${e}`);
    }
    throw new Error("No ranged axis");
  } else {
    const s = t.xError, I = t.xError2, r = t.yError, a = t.yError2;
    if (at(I) && !at(s))
      throw new Error(`${e} cannot have xError2 without xError`);
    if (at(a) && !at(r))
      throw new Error(`${e} cannot have yError2 without yError`);
    if (at(s) && at(r))
      throw new Error(`${e} cannot have both xError and yError with both are quantiative`);
    if (at(s)) {
      if (ou(o))
        return { orient: "horizontal", inputType: "aggregated-error" };
      throw new Error("All x, xError, and xError2 (if exist) have to be quantitative");
    } else if (at(r)) {
      if (ou(g))
        return { orient: "vertical", inputType: "aggregated-error" };
      throw new Error("All y, yError, and yError2 (if exist) have to be quantitative");
    }
    throw new Error("No ranged axis");
  }
}
function h_e(A) {
  return (at(A.x) || at(A.y)) && !at(A.x2) && !at(A.y2) && !at(A.xError) && !at(A.xError2) && !at(A.yError) && !at(A.yError2);
}
function m_e(A) {
  return at(A.x2) || at(A.y2);
}
function p_e(A) {
  return at(A.xError) || at(A.xError2) || at(A.yError) || at(A.yError2);
}
function d3A(A, e, t) {
  const { mark: i, encoding: n, params: o, projection: g, ...s } = A, I = Cl(i) ? i : { type: i };
  o && PA(CKA(e));
  const { orient: r, inputType: a } = d_e(A, e), { continuousAxisChannelDef: C, continuousAxisChannelDef2: B, continuousAxisChannelDefError: l, continuousAxisChannelDefError2: Q, continuousAxis: E } = B3A(A, r, e), { errorBarSpecificAggregate: d, postAggregateCalculates: m, tooltipSummary: y, tooltipTitleWithFieldName: f } = y_e(I, C, B, l, Q, a, e, t), { [E]: w, [E === "x" ? "x2" : "y2"]: G, [E === "x" ? "xError" : "yError"]: R, [E === "x" ? "xError2" : "yError2"]: F, ...Z } = n, { bins: c, timeUnits: J, aggregate: p, groupby: N, encoding: v } = a3A(Z, t), K = [...p, ...d], U = a !== "raw" ? [] : N, j = cP(y, C, v, f);
  return {
    transform: [
      ...s.transform ?? [],
      ...c,
      ...J,
      ...K.length === 0 ? [] : [{ aggregate: K, groupby: U }],
      ...m
    ],
    groupby: U,
    continuousAxisChannelDef: C,
    continuousAxis: E,
    encodingWithoutContinuousAxis: v,
    ticksOrient: r === "vertical" ? "horizontal" : "vertical",
    markDef: I,
    outerSpec: s,
    tooltipEncoding: j
  };
}
function y_e(A, e, t, i, n, o, g, s) {
  let I = [], r = [];
  const a = e.field;
  let C, B = !1;
  if (o === "raw") {
    const l = A.center ? A.center : A.extent ? A.extent === "iqr" ? "median" : "mean" : s.errorbar.center, Q = A.extent ? A.extent : l === "mean" ? "stderr" : "iqr";
    if (l === "median" != (Q === "iqr") && PA(Mze(l, Q, g)), Q === "stderr" || Q === "stdev")
      I = [
        { op: Q, field: a, as: `extent_${a}` },
        { op: l, field: a, as: `center_${a}` }
      ], r = [
        {
          calculate: `datum["center_${a}"] + datum["extent_${a}"]`,
          as: `upper_${a}`
        },
        {
          calculate: `datum["center_${a}"] - datum["extent_${a}"]`,
          as: `lower_${a}`
        }
      ], C = [
        { fieldPrefix: "center_", titlePrefix: xF(l) },
        { fieldPrefix: "upper_", titlePrefix: hhA(l, Q, "+") },
        { fieldPrefix: "lower_", titlePrefix: hhA(l, Q, "-") }
      ], B = !0;
    else {
      let E, d, m;
      Q === "ci" ? (E = "mean", d = "ci0", m = "ci1") : (E = "median", d = "q1", m = "q3"), I = [
        { op: d, field: a, as: `lower_${a}` },
        { op: m, field: a, as: `upper_${a}` },
        { op: E, field: a, as: `center_${a}` }
      ], C = [
        {
          fieldPrefix: "upper_",
          titlePrefix: Qw({ field: a, aggregate: m, type: "quantitative" }, s, {
            allowDisabling: !1
          })
        },
        {
          fieldPrefix: "lower_",
          titlePrefix: Qw({ field: a, aggregate: d, type: "quantitative" }, s, {
            allowDisabling: !1
          })
        },
        {
          fieldPrefix: "center_",
          titlePrefix: Qw({ field: a, aggregate: E, type: "quantitative" }, s, {
            allowDisabling: !1
          })
        }
      ];
    }
  } else {
    (A.center || A.extent) && PA(Fze(A.center, A.extent)), o === "aggregated-upper-lower" ? (C = [], r = [
      { calculate: `datum["${t.field}"]`, as: `upper_${a}` },
      { calculate: `datum["${a}"]`, as: `lower_${a}` }
    ]) : o === "aggregated-error" && (C = [{ fieldPrefix: "", titlePrefix: a }], r = [
      {
        calculate: `datum["${a}"] + datum["${i.field}"]`,
        as: `upper_${a}`
      }
    ], n ? r.push({
      calculate: `datum["${a}"] + datum["${n.field}"]`,
      as: `lower_${a}`
    }) : r.push({
      calculate: `datum["${a}"] - datum["${i.field}"]`,
      as: `lower_${a}`
    }));
    for (const l of r)
      C.push({
        fieldPrefix: l.as.substring(0, 6),
        titlePrefix: yp(yp(l.calculate, 'datum["', ""), '"]', "")
      });
  }
  return { postAggregateCalculates: r, errorBarSpecificAggregate: I, tooltipSummary: C, tooltipTitleWithFieldName: B };
}
function hhA(A, e, t) {
  return `${xF(A)} ${t} ${e}`;
}
const LoA = "errorband", b_e = ["band", "borders"], w_e = new GV(LoA, h3A);
function h3A(A, { config: e }) {
  A = {
    ...A,
    encoding: kV(A.encoding, e)
  };
  const { transform: t, continuousAxisChannelDef: i, continuousAxis: n, encodingWithoutContinuousAxis: o, markDef: g, outerSpec: s, tooltipEncoding: I } = d3A(A, LoA, e), r = g, a = MoA(r, n, i, o, e.errorband), C = A.encoding.x !== void 0 && A.encoding.y !== void 0;
  let B = { type: C ? "area" : "rect" }, l = { type: C ? "line" : "rule" };
  const Q = {
    ...r.interpolate ? { interpolate: r.interpolate } : {},
    ...r.tension && r.interpolate ? { tension: r.tension } : {}
  };
  return C ? (B = {
    ...B,
    ...Q,
    ariaRoleDescription: "errorband"
  }, l = {
    ...l,
    ...Q,
    aria: !1
  }) : r.interpolate ? PA(rhA("interpolate")) : r.tension && PA(rhA("tension")), {
    ...s,
    transform: t,
    layer: [
      ...a({
        partName: "band",
        mark: B,
        positionPrefix: "lower",
        endPositionPrefix: "upper",
        extraEncoding: I
      }),
      ...a({
        partName: "borders",
        mark: l,
        positionPrefix: "lower",
        extraEncoding: I
      }),
      ...a({
        partName: "borders",
        mark: l,
        positionPrefix: "upper",
        extraEncoding: I
      })
    ]
  };
}
const m3A = {};
function voA(A, e, t) {
  const i = new GV(A, e);
  m3A[A] = { normalizer: i, parts: t };
}
function f_e() {
  return _A(m3A);
}
voA(FZ, Q3A, l_e);
voA(xoA, u3A, E_e);
voA(LoA, h3A, b_e);
const D_e = [
  "gradientHorizontalMaxLength",
  "gradientHorizontalMinLength",
  "gradientVerticalMaxLength",
  "gradientVerticalMinLength",
  "unselectedOpacity"
], p3A = {
  titleAlign: "align",
  titleAnchor: "anchor",
  titleAngle: "angle",
  titleBaseline: "baseline",
  titleColor: "color",
  titleFont: "font",
  titleFontSize: "fontSize",
  titleFontStyle: "fontStyle",
  titleFontWeight: "fontWeight",
  titleLimit: "limit",
  titleLineHeight: "lineHeight",
  titleOrient: "orient",
  titlePadding: "offset"
}, y3A = {
  labelAlign: "align",
  labelAnchor: "anchor",
  labelAngle: "angle",
  labelBaseline: "baseline",
  labelColor: "color",
  labelFont: "font",
  labelFontSize: "fontSize",
  labelFontStyle: "fontStyle",
  labelFontWeight: "fontWeight",
  labelLimit: "limit",
  labelLineHeight: "lineHeight",
  labelOrient: "orient",
  labelPadding: "offset"
}, G_e = _A(p3A), k_e = _A(y3A), J_e = {
  header: 1,
  headerRow: 1,
  headerColumn: 1,
  headerFacet: 1
}, b3A = _A(J_e), w3A = [
  "size",
  "shape",
  "fill",
  "stroke",
  "strokeDash",
  "strokeWidth",
  "opacity"
], N_e = {
  gradientHorizontalMaxLength: 200,
  gradientHorizontalMinLength: 100,
  gradientVerticalMaxLength: 200,
  gradientVerticalMinLength: 64,
  unselectedOpacity: 0.35
}, Y_e = {
  aria: 1,
  clipHeight: 1,
  columnPadding: 1,
  columns: 1,
  cornerRadius: 1,
  description: 1,
  direction: 1,
  fillColor: 1,
  format: 1,
  formatType: 1,
  gradientLength: 1,
  gradientOpacity: 1,
  gradientStrokeColor: 1,
  gradientStrokeWidth: 1,
  gradientThickness: 1,
  gridAlign: 1,
  labelAlign: 1,
  labelBaseline: 1,
  labelColor: 1,
  labelFont: 1,
  labelFontSize: 1,
  labelFontStyle: 1,
  labelFontWeight: 1,
  labelLimit: 1,
  labelOffset: 1,
  labelOpacity: 1,
  labelOverlap: 1,
  labelPadding: 1,
  labelSeparation: 1,
  legendX: 1,
  legendY: 1,
  offset: 1,
  orient: 1,
  padding: 1,
  rowPadding: 1,
  strokeColor: 1,
  symbolDash: 1,
  symbolDashOffset: 1,
  symbolFillColor: 1,
  symbolLimit: 1,
  symbolOffset: 1,
  symbolOpacity: 1,
  symbolSize: 1,
  symbolStrokeColor: 1,
  symbolStrokeWidth: 1,
  symbolType: 1,
  tickCount: 1,
  tickMinStep: 1,
  title: 1,
  titleAlign: 1,
  titleAnchor: 1,
  titleBaseline: 1,
  titleColor: 1,
  titleFont: 1,
  titleFontSize: 1,
  titleFontStyle: 1,
  titleFontWeight: 1,
  titleLimit: 1,
  titleLineHeight: 1,
  titleOpacity: 1,
  titleOrient: 1,
  titlePadding: 1,
  type: 1,
  values: 1,
  zindex: 1
}, bC = "_vgsid_", R_e = {
  point: {
    on: "click",
    fields: [bC],
    toggle: "event.shiftKey",
    resolve: "global",
    clear: "dblclick"
  },
  interval: {
    on: "[pointerdown, window:pointerup] > window:pointermove!",
    encodings: ["x", "y"],
    translate: "[pointerdown, window:pointerup] > window:pointermove!",
    zoom: "wheel!",
    mark: { fill: "#333", fillOpacity: 0.125, stroke: "white" },
    resolve: "global",
    clear: "dblclick"
  }
};
function HoA(A) {
  return A === "legend" || !!(A != null && A.legend);
}
function oT(A) {
  return HoA(A) && ce(A);
}
function SoA(A) {
  return !!(A != null && A.select);
}
function f3A(A) {
  const e = [];
  for (const t of A || []) {
    if (SoA(t))
      continue;
    const { expr: i, bind: n, ...o } = t;
    if (n && i) {
      const g = {
        ...o,
        bind: n,
        init: i
      };
      e.push(g);
    } else {
      const g = {
        ...o,
        ...i ? { update: i } : {},
        ...n ? { bind: n } : {}
      };
      e.push(g);
    }
  }
  return e;
}
function F_e(A) {
  return JV(A) || WoA(A) || ZoA(A);
}
function ZoA(A) {
  return "concat" in A;
}
function JV(A) {
  return "vconcat" in A;
}
function WoA(A) {
  return "hconcat" in A;
}
function D3A({ step: A, offsetIsDiscrete: e }) {
  return e ? A.for ?? "offset" : "position";
}
function ll(A) {
  return ce(A) && A.step !== void 0;
}
function mhA(A) {
  return A.view || A.width || A.height;
}
const phA = 20, M_e = {
  align: 1,
  bounds: 1,
  center: 1,
  columns: 1,
  spacing: 1
}, x_e = _A(M_e);
function L_e(A, e, t) {
  const i = t[e], n = {}, { spacing: o, columns: g } = i;
  o !== void 0 && (n.spacing = o), g !== void 0 && (yV(A) && !KF(A.facet) || ZoA(A)) && (n.columns = g), JV(A) && (n.columns = 1);
  for (const s of x_e)
    if (A[s] !== void 0)
      if (s === "spacing") {
        const I = A[s];
        n[s] = ti(I) ? I : {
          row: I.row ?? o,
          column: I.column ?? o
        };
      } else
        n[s] = A[s];
  return n;
}
function QP(A, e) {
  return A[e] ?? A[e === "width" ? "continuousWidth" : "continuousHeight"];
}
function MZ(A, e) {
  const t = xZ(A, e);
  return ll(t) ? t.step : G3A;
}
function xZ(A, e) {
  const t = A[e] ?? A[e === "width" ? "discreteWidth" : "discreteHeight"];
  return _n(t, { step: A.step });
}
const G3A = 20, v_e = {
  continuousWidth: 200,
  continuousHeight: 200,
  step: G3A
}, H_e = {
  background: "white",
  padding: 5,
  timeFormat: "%b %d, %Y",
  countTitle: "Count of Records",
  view: v_e,
  mark: NTe,
  arc: {},
  area: {},
  bar: FTe,
  circle: {},
  geoshape: {},
  image: {},
  line: {},
  point: {},
  rect: MTe,
  rule: { color: "black" },
  square: {},
  text: { color: "black" },
  tick: xTe,
  trail: {},
  boxplot: {
    size: 14,
    extent: 1.5,
    box: {},
    median: { color: "white" },
    outliers: {},
    rule: {},
    ticks: null
  },
  errorbar: {
    center: "mean",
    rule: !0,
    ticks: !1
  },
  errorband: {
    band: {
      opacity: 0.3
    },
    borders: !1
  },
  scale: BTe,
  projection: {},
  legend: N_e,
  header: { titlePadding: 10, labelPadding: 10 },
  headerColumn: {},
  headerRow: {},
  headerFacet: {},
  selection: R_e,
  style: {},
  title: {},
  facet: { spacing: phA },
  concat: { spacing: phA },
  normalizedNumberFormat: ".0%"
}, gc = [
  "#4c78a8",
  "#f58518",
  "#e45756",
  "#72b7b2",
  "#54a24b",
  "#eeca3b",
  "#b279a2",
  "#ff9da6",
  "#9d755d",
  "#bab0ac"
], yhA = {
  text: 11,
  guideLabel: 10,
  guideTitle: 11,
  groupTitle: 13,
  groupSubtitle: 12
}, bhA = {
  blue: gc[0],
  orange: gc[1],
  red: gc[2],
  teal: gc[3],
  green: gc[4],
  yellow: gc[5],
  purple: gc[6],
  pink: gc[7],
  brown: gc[8],
  gray0: "#000",
  gray1: "#111",
  gray2: "#222",
  gray3: "#333",
  gray4: "#444",
  gray5: "#555",
  gray6: "#666",
  gray7: "#777",
  gray8: "#888",
  gray9: "#999",
  gray10: "#aaa",
  gray11: "#bbb",
  gray12: "#ccc",
  gray13: "#ddd",
  gray14: "#eee",
  gray15: "#fff"
};
function S_e(A = {}) {
  return {
    signals: [
      {
        name: "color",
        value: ce(A) ? { ...bhA, ...A } : bhA
      }
    ],
    mark: { color: { signal: "color.blue" } },
    rule: { color: { signal: "color.gray0" } },
    text: {
      color: { signal: "color.gray0" }
    },
    style: {
      "guide-label": {
        fill: { signal: "color.gray0" }
      },
      "guide-title": {
        fill: { signal: "color.gray0" }
      },
      "group-title": {
        fill: { signal: "color.gray0" }
      },
      "group-subtitle": {
        fill: { signal: "color.gray0" }
      },
      cell: {
        stroke: { signal: "color.gray8" }
      }
    },
    axis: {
      domainColor: { signal: "color.gray13" },
      gridColor: { signal: "color.gray8" },
      tickColor: { signal: "color.gray13" }
    },
    range: {
      category: [
        { signal: "color.blue" },
        { signal: "color.orange" },
        { signal: "color.red" },
        { signal: "color.teal" },
        { signal: "color.green" },
        { signal: "color.yellow" },
        { signal: "color.purple" },
        { signal: "color.pink" },
        { signal: "color.brown" },
        { signal: "color.grey8" }
      ]
    }
  };
}
function Z_e(A) {
  return {
    signals: [
      {
        name: "fontSize",
        value: ce(A) ? { ...yhA, ...A } : yhA
      }
    ],
    text: {
      fontSize: { signal: "fontSize.text" }
    },
    style: {
      "guide-label": {
        fontSize: { signal: "fontSize.guideLabel" }
      },
      "guide-title": {
        fontSize: { signal: "fontSize.guideTitle" }
      },
      "group-title": {
        fontSize: { signal: "fontSize.groupTitle" }
      },
      "group-subtitle": {
        fontSize: { signal: "fontSize.groupSubtitle" }
      }
    }
  };
}
function W_e(A) {
  return {
    text: { font: A },
    style: {
      "guide-label": { font: A },
      "guide-title": { font: A },
      "group-title": { font: A },
      "group-subtitle": { font: A }
    }
  };
}
function k3A(A) {
  const e = _A(A || {}), t = {};
  for (const i of e) {
    const n = A[i];
    t[i] = XF(n) ? nKA(n) : YI(n);
  }
  return t;
}
function K_e(A) {
  const e = _A(A), t = {};
  for (const i of e)
    t[i] = k3A(A[i]);
  return t;
}
const U_e = [
  ...SKA,
  ...g3A,
  ...b3A,
  "background",
  "padding",
  "legend",
  "lineBreak",
  "scale",
  "style",
  "title",
  "view"
];
function J3A(A = {}) {
  const { color: e, font: t, fontSize: i, selection: n, ...o } = A, g = XD({}, tt(H_e), t ? W_e(t) : {}, e ? S_e(e) : {}, i ? Z_e(i) : {}, o || {});
  n && zD(g, "selection", n, !0);
  const s = Us(g, U_e);
  for (const I of ["background", "lineBreak", "padding"])
    g[I] && (s[I] = YI(g[I]));
  for (const I of SKA)
    g[I] && (s[I] = Ys(g[I]));
  for (const I of g3A)
    g[I] && (s[I] = k3A(g[I]));
  for (const I of b3A)
    g[I] && (s[I] = Ys(g[I]));
  return g.legend && (s.legend = Ys(g.legend)), g.scale && (s.scale = Ys(g.scale)), g.style && (s.style = K_e(g.style)), g.title && (s.title = Ys(g.title)), g.view && (s.view = Ys(g.view)), s;
}
const V_e = /* @__PURE__ */ new Set(["view", ...wTe]), X_e = [
  "color",
  "fontSize",
  "background",
  "padding",
  "facet",
  "concat",
  "numberFormat",
  "numberFormatType",
  "normalizedNumberFormat",
  "normalizedNumberFormatType",
  "timeFormat",
  "countTitle",
  "header",
  "axisQuantitative",
  "axisTemporal",
  "axisDiscrete",
  "axisPoint",
  "axisXBand",
  "axisXPoint",
  "axisXDiscrete",
  "axisXQuantitative",
  "axisXTemporal",
  "axisYBand",
  "axisYPoint",
  "axisYDiscrete",
  "axisYQuantitative",
  "axisYTemporal",
  "scale",
  "selection",
  "overlay"
  // FIXME: Redesign and unhide this
], z_e = {
  view: ["continuousWidth", "continuousHeight", "discreteWidth", "discreteHeight", "step"],
  ...JTe
};
function T_e(A) {
  A = tt(A);
  for (const e of X_e)
    delete A[e];
  if (A.axis)
    for (const e in A.axis)
      XF(A.axis[e]) && delete A.axis[e];
  if (A.legend)
    for (const e of D_e)
      delete A.legend[e];
  if (A.mark) {
    for (const e of BhA)
      delete A.mark[e];
    A.mark.tooltip && ce(A.mark.tooltip) && delete A.mark.tooltip;
  }
  A.params && (A.signals = (A.signals || []).concat(f3A(A.params)), delete A.params);
  for (const e of V_e) {
    for (const i of BhA)
      delete A[e][i];
    const t = z_e[e];
    if (t)
      for (const i of t)
        delete A[e][i];
    q_e(A, e);
  }
  for (const e of f_e())
    delete A[e];
  __e(A);
  for (const e in A)
    ce(A[e]) && Fi(A[e]) && delete A[e];
  return Fi(A) ? void 0 : A;
}
function __e(A) {
  const { titleMarkConfig: e, subtitleMarkConfig: t, subtitle: i } = iKA(A.title);
  Fi(e) || (A.style["group-title"] = {
    ...A.style["group-title"],
    ...e
    // config.title has higher precedence than config.style.group-title in Vega
  }), Fi(t) || (A.style["group-subtitle"] = {
    ...A.style["group-subtitle"],
    ...t
  }), Fi(i) ? delete A.title : A.title = i;
}
function q_e(A, e, t, i) {
  const n = i ? A[e][i] : A[e];
  e === "view" && (t = "cell");
  const o = {
    ...n,
    ...A.style[t ?? e]
  };
  Fi(o) || (A.style[t ?? e] = o), i || delete A[e];
}
function NV(A) {
  return "layer" in A;
}
function O_e(A) {
  return "repeat" in A;
}
function j_e(A) {
  return !ZA(A.repeat) && A.repeat.layer;
}
class KoA {
  map(e, t) {
    return yV(e) ? this.mapFacet(e, t) : O_e(e) ? this.mapRepeat(e, t) : WoA(e) ? this.mapHConcat(e, t) : JV(e) ? this.mapVConcat(e, t) : ZoA(e) ? this.mapConcat(e, t) : this.mapLayerOrUnit(e, t);
  }
  mapLayerOrUnit(e, t) {
    if (NV(e))
      return this.mapLayer(e, t);
    if (UQ(e))
      return this.mapUnit(e, t);
    throw new Error(noA(e));
  }
  mapLayer(e, t) {
    return {
      ...e,
      layer: e.layer.map((i) => this.mapLayerOrUnit(i, t))
    };
  }
  mapHConcat(e, t) {
    return {
      ...e,
      hconcat: e.hconcat.map((i) => this.map(i, t))
    };
  }
  mapVConcat(e, t) {
    return {
      ...e,
      vconcat: e.vconcat.map((i) => this.map(i, t))
    };
  }
  mapConcat(e, t) {
    const { concat: i, ...n } = e;
    return {
      ...n,
      concat: i.map((o) => this.map(o, t))
    };
  }
  mapFacet(e, t) {
    return {
      // as any is required here since TS cannot infer that FO may only be FieldName or Field, but not RepeatRef
      ...e,
      // TODO: remove "any" once we support all facet listed in https://github.com/vega/vega-lite/issues/2760
      spec: this.map(e.spec, t)
    };
  }
  mapRepeat(e, t) {
    return {
      ...e,
      // as any is required here since TS cannot infer that the output type satisfies the input type
      spec: this.map(e.spec, t)
    };
  }
}
const P_e = {
  zero: 1,
  center: 1,
  normalize: 1
};
function $_e(A) {
  return A in P_e;
}
const A4e = /* @__PURE__ */ new Set([LKA, dV, uV, GZ, mV, moA, poA, hV, vKA, hoA]), e4e = /* @__PURE__ */ new Set([dV, uV, LKA]);
function my(A) {
  return jA(A) && Sf(A) === "quantitative" && !A.bin;
}
function whA(A, e, { orient: t, type: i }) {
  const n = e === "x" ? "y" : "radius", o = e === "x" && ["bar", "area"].includes(i), g = A[e], s = A[n];
  if (jA(g) && jA(s))
    if (my(g) && my(s)) {
      if (g.stack)
        return e;
      if (s.stack)
        return n;
      const I = jA(g) && !!g.aggregate, r = jA(s) && !!s.aggregate;
      if (I !== r)
        return I ? e : n;
      if (o) {
        if (t === "vertical")
          return n;
        if (t === "horizontal")
          return e;
      }
    } else {
      if (my(g))
        return e;
      if (my(s))
        return n;
    }
  else {
    if (my(g))
      return o && t === "vertical" ? void 0 : e;
    if (my(s))
      return o && t === "horizontal" ? void 0 : n;
  }
}
function t4e(A) {
  switch (A) {
    case "x":
      return "y";
    case "y":
      return "x";
    case "theta":
      return "radius";
    case "radius":
      return "theta";
  }
}
function N3A(A, e) {
  var t, i;
  const n = Cl(A) ? A : { type: A }, o = n.type;
  if (!A4e.has(o))
    return null;
  const g = whA(e, "x", n) || whA(e, "theta", n);
  if (!g)
    return null;
  const s = e[g], I = jA(s) ? se(s, {}) : void 0, r = t4e(g), a = [], C = /* @__PURE__ */ new Set();
  if (e[r]) {
    const m = e[r], y = jA(m) ? se(m, {}) : void 0;
    y && y !== I && (a.push(r), C.add(y));
  }
  const B = r === "x" ? "xOffset" : "yOffset", l = e[B], Q = jA(l) ? se(l, {}) : void 0;
  Q && Q !== I && (a.push(B), C.add(Q));
  const E = E5e.reduce((m, y) => {
    if (y !== "tooltip" && Sm(e, y)) {
      const f = e[y];
      for (const w of Ce(f)) {
        const G = Bl(w);
        if (G.aggregate)
          continue;
        const R = se(G, {});
        (!R || // otherwise, the field must be different from the groupBy fields.
        !C.has(R)) && m.push({ channel: y, fieldDef: G });
      }
    }
    return m;
  }, []);
  let d;
  return s.stack !== void 0 ? Wd(s.stack) ? d = s.stack ? "zero" : null : d = s.stack : e4e.has(o) && (d = "zero"), !d || !$_e(d) || YoA(e) && E.length === 0 ? null : (t = s == null ? void 0 : s.scale) != null && t.type && ((i = s == null ? void 0 : s.scale) == null ? void 0 : i.type) !== Vs.LINEAR ? (s != null && s.stack && PA(Nze(s.scale.type)), null) : at(e[Fl(g)]) ? (s.stack !== void 0 && PA(Jze(g)), null) : (jA(s) && s.aggregate && !k5e.has(s.aggregate) && PA(Yze(s.aggregate)), {
    groupbyChannels: a,
    groupbyFields: C,
    fieldChannel: g,
    impute: s.impute === null ? !1 : jd(o),
    stackBy: E,
    offset: d
  });
}
function Y3A(A, e, t) {
  const i = Ys(A), n = bi("orient", i, t);
  if (i.orient = g4e(i.type, e, n), n !== void 0 && n !== i.orient && PA(lze(i.orient, n)), i.type === "bar" && i.orient) {
    const o = bi("cornerRadiusEnd", i, t);
    if (o !== void 0) {
      const g = i.orient === "horizontal" && e.x2 || i.orient === "vertical" && e.y2 ? ["cornerRadius"] : RTe[i.orient];
      for (const s of g)
        i[s] = o;
      i.cornerRadiusEnd !== void 0 && delete i.cornerRadiusEnd;
    }
  }
  return bi("opacity", i, t) === void 0 && (i.opacity = n4e(i.type, e)), bi("cursor", i, t) === void 0 && (i.cursor = i4e(i, e, t)), i;
}
function i4e(A, e, t) {
  return e.href || A.href || bi("href", A, t) ? "pointer" : A.cursor;
}
function n4e(A, e) {
  if (Ht([mV, hoA, moA, poA], A) && !YoA(e))
    return 0.7;
}
function o4e(A, e, { graticule: t }) {
  if (t)
    return !1;
  const i = mQ("filled", A, e), n = A.type;
  return _n(i, n !== mV && n !== hV && n !== GZ);
}
function g4e(A, e, t) {
  switch (A) {
    case mV:
    case moA:
    case poA:
    case vKA:
    case yTe:
    case pTe:
      return;
  }
  const { x: i, y: n, x2: o, y2: g } = e;
  switch (A) {
    case dV:
      if (jA(i) && (qo(i.bin) || jA(n) && n.aggregate && !i.aggregate))
        return "vertical";
      if (jA(n) && (qo(n.bin) || jA(i) && i.aggregate && !n.aggregate))
        return "horizontal";
      if (g || o) {
        if (t)
          return t;
        if (!o)
          return (jA(i) && i.type === fp && !Oi(i.bin) || JZ(i)) && jA(n) && qo(n.bin) ? "horizontal" : "vertical";
        if (!g)
          return (jA(n) && n.type === fp && !Oi(n.bin) || JZ(n)) && jA(i) && qo(i.bin) ? "vertical" : "horizontal";
      }
    case GZ:
      if (o && !(jA(i) && qo(i.bin)) && g && !(jA(n) && qo(n.bin)))
        return;
    case uV:
      if (g)
        return jA(n) && qo(n.bin) ? "horizontal" : "vertical";
      if (o)
        return jA(i) && qo(i.bin) ? "vertical" : "horizontal";
      if (A === GZ) {
        if (i && !n)
          return "vertical";
        if (n && !i)
          return "horizontal";
      }
    case hV:
    case hoA: {
      const s = EhA(i), I = EhA(n);
      if (t)
        return t;
      if (s && !I)
        return A !== "tick" ? "horizontal" : "vertical";
      if (!s && I)
        return A !== "tick" ? "vertical" : "horizontal";
      if (s && I)
        return "vertical";
      {
        const r = ls(i) && i.type === vf, a = ls(n) && n.type === vf;
        if (r && !a)
          return "vertical";
        if (!r && a)
          return "horizontal";
      }
      return;
    }
  }
  return "vertical";
}
function s4e(A) {
  const { point: e, line: t, ...i } = A;
  return _A(i).length > 1 ? i : i.type;
}
function I4e(A) {
  for (const e of ["line", "area", "rule", "trail"])
    A[e] && (A = {
      ...A,
      // TODO: remove as any
      [e]: Us(A[e], ["point", "line"])
    });
  return A;
}
function gT(A, e = {}, t) {
  return A.point === "transparent" ? { opacity: 0 } : A.point ? ce(A.point) ? A.point : {} : A.point !== void 0 ? null : e.point || t.shape ? ce(e.point) ? e.point : {} : void 0;
}
function fhA(A, e = {}) {
  return A.line ? A.line === !0 ? {} : A.line : A.line !== void 0 ? null : e.line ? e.line === !0 ? {} : e.line : void 0;
}
class a4e {
  constructor() {
    this.name = "path-overlay";
  }
  hasMatchingType(e, t) {
    if (UQ(e)) {
      const { mark: i, encoding: n } = e, o = Cl(i) ? i : { type: i };
      switch (o.type) {
        case "line":
        case "rule":
        case "trail":
          return !!gT(o, t[o.type], n);
        case "area":
          return (
            // false / null are also included as we want to remove the properties
            !!gT(o, t[o.type], n) || !!fhA(o, t[o.type])
          );
      }
    }
    return !1;
  }
  run(e, t, i) {
    const { config: n } = t, { params: o, projection: g, mark: s, name: I, encoding: r, ...a } = e, C = kV(r, n), B = Cl(s) ? s : { type: s }, l = gT(B, n[B.type], C), Q = B.type === "area" && fhA(B, n[B.type]), E = [
      {
        name: I,
        ...o ? { params: o } : {},
        mark: s4e({
          // TODO: extract this 0.7 to be shared with default opacity for point/tick/...
          ...B.type === "area" && B.opacity === void 0 && B.fillOpacity === void 0 ? { opacity: 0.7 } : {},
          ...B
        }),
        // drop shape from encoding as this might be used to trigger point overlay
        encoding: Us(C, ["shape"])
      }
    ], d = N3A(Y3A(B, C, n), C);
    let m = C;
    if (d) {
      const { fieldChannel: y, offset: f } = d;
      m = {
        ...C,
        [y]: {
          ...C[y],
          ...f ? { stack: f } : {}
        }
      };
    }
    return m = Us(m, ["y2", "x2"]), Q && E.push({
      ...g ? { projection: g } : {},
      mark: {
        type: "line",
        ...Ff(B, ["clip", "interpolate", "tension", "tooltip"]),
        ...Q
      },
      encoding: m
    }), l && E.push({
      ...g ? { projection: g } : {},
      mark: {
        type: "point",
        opacity: 1,
        filled: !0,
        ...Ff(B, ["clip", "tooltip"]),
        ...l
      },
      encoding: m
    }), i({
      ...a,
      layer: E
    }, {
      ...t,
      config: I4e(n)
    });
  }
}
function r4e(A, e) {
  return e ? KF(A) ? F3A(A, e) : R3A(A, e) : A;
}
function sT(A, e) {
  return e ? F3A(A, e) : A;
}
function EP(A, e, t) {
  const i = e[A];
  if (zTe(i)) {
    if (i.repeat in t)
      return { ...e, [A]: t[i.repeat] };
    PA(T5e(i.repeat));
    return;
  }
  return e;
}
function R3A(A, e) {
  if (A = EP("field", A, e), A !== void 0) {
    if (A === null)
      return null;
    if (GoA(A) && OB(A.sort)) {
      const t = EP("field", A.sort, e);
      A = {
        ...A,
        ...t ? { sort: t } : {}
      };
    }
    return A;
  }
}
function DhA(A, e) {
  if (jA(A))
    return R3A(A, e);
  {
    const t = EP("datum", A, e);
    return t !== A && !t.type && (t.type = "nominal"), t;
  }
}
function GhA(A, e) {
  if (at(A)) {
    const t = DhA(A, e);
    if (t)
      return t;
    if (bV(A))
      return { condition: A.condition };
  } else {
    if (UF(A)) {
      const t = DhA(A.condition, e);
      if (t)
        return {
          ...A,
          condition: t
        };
      {
        const { condition: i, ...n } = A;
        return n;
      }
    }
    return A;
  }
}
function F3A(A, e) {
  const t = {};
  for (const i in A)
    if (Ze(A, i)) {
      const n = A[i];
      if (ZA(n))
        t[i] = n.map((o) => GhA(o, e)).filter((o) => o);
      else {
        const o = GhA(n, e);
        o !== void 0 && (t[i] = o);
      }
    }
  return t;
}
class C4e {
  constructor() {
    this.name = "RuleForRangedLine";
  }
  hasMatchingType(e) {
    if (UQ(e)) {
      const { encoding: t, mark: i } = e;
      if (i === "line" || Cl(i) && i.type === "line")
        for (const n of l5e) {
          const o = c0(n), g = t[o];
          if (t[n] && (jA(g) && !qo(g.bin) || xl(g)))
            return !0;
        }
    }
    return !1;
  }
  run(e, t, i) {
    const { encoding: n, mark: o } = e;
    return PA(Bze(!!n.x2, !!n.y2)), i({
      ...e,
      mark: ce(o) ? { ...o, type: "rule" } : "rule"
    }, t);
  }
}
class B4e extends KoA {
  constructor() {
    super(...arguments), this.nonFacetUnitNormalizers = [
      c_e,
      u_e,
      w_e,
      new a4e(),
      new C4e()
    ];
  }
  map(e, t) {
    if (UQ(e)) {
      const i = Sm(e.encoding, jc), n = Sm(e.encoding, Pc), o = Sm(e.encoding, sV);
      if (i || n || o)
        return this.mapFacetedUnit(e, t);
    }
    return super.map(e, t);
  }
  // This is for normalizing non-facet unit
  mapUnit(e, t) {
    const { parentEncoding: i, parentProjection: n } = t, o = sT(e.encoding, t.repeater), g = {
      ...e,
      ...e.name ? { name: [t.repeaterPrefix, e.name].filter((I) => I).join("_") } : {},
      ...o ? { encoding: o } : {}
    };
    if (i || n)
      return this.mapUnitWithParentEncodingOrProjection(g, t);
    const s = this.mapLayerOrUnit.bind(this);
    for (const I of this.nonFacetUnitNormalizers)
      if (I.hasMatchingType(g, t.config))
        return I.run(g, t, s);
    return g;
  }
  mapRepeat(e, t) {
    return j_e(e) ? this.mapLayerRepeat(e, t) : this.mapNonLayerRepeat(e, t);
  }
  mapLayerRepeat(e, t) {
    const { repeat: i, spec: n, ...o } = e, { row: g, column: s, layer: I } = i, { repeater: r = {}, repeaterPrefix: a = "" } = t;
    return g || s ? this.mapRepeat({
      ...e,
      repeat: {
        ...g ? { row: g } : {},
        ...s ? { column: s } : {}
      },
      spec: {
        repeat: { layer: I },
        spec: n
      }
    }, t) : {
      ...o,
      layer: I.map((C) => {
        const B = {
          ...r,
          layer: C
        }, l = `${(n.name ? `${n.name}_` : "") + a}child__layer_${En(C)}`, Q = this.mapLayerOrUnit(n, { ...t, repeater: B, repeaterPrefix: l });
        return Q.name = l, Q;
      })
    };
  }
  mapNonLayerRepeat(e, t) {
    const { repeat: i, spec: n, data: o, ...g } = e;
    !ZA(i) && e.columns && (e = Us(e, ["columns"]), PA(ghA("repeat")));
    const s = [], { repeater: I = {}, repeaterPrefix: r = "" } = t, a = !ZA(i) && i.row || [I ? I.row : null], C = !ZA(i) && i.column || [I ? I.column : null], B = ZA(i) && i || [I ? I.repeat : null];
    for (const Q of B)
      for (const E of a)
        for (const d of C) {
          const m = {
            repeat: Q,
            row: E,
            column: d,
            layer: I.layer
          }, y = (n.name ? `${n.name}_` : "") + r + "child__" + (ZA(i) ? `${En(Q)}` : (i.row ? `row_${En(E)}` : "") + (i.column ? `column_${En(d)}` : "")), f = this.map(n, { ...t, repeater: m, repeaterPrefix: y });
          f.name = y, s.push(Us(f, ["data"]));
        }
    const l = ZA(i) ? e.columns : i.column ? i.column.length : 1;
    return {
      data: n.data ?? o,
      align: "all",
      ...g,
      columns: l,
      concat: s
    };
  }
  mapFacet(e, t) {
    const { facet: i } = e;
    return KF(i) && e.columns && (e = Us(e, ["columns"]), PA(ghA("facet"))), super.mapFacet(e, t);
  }
  mapUnitWithParentEncodingOrProjection(e, t) {
    const { encoding: i, projection: n } = e, { parentEncoding: o, parentProjection: g, config: s } = t, I = JhA({ parentProjection: g, projection: n }), r = khA({
      parentEncoding: o,
      encoding: sT(i, t.repeater)
    });
    return this.mapUnit({
      ...e,
      ...I ? { projection: I } : {},
      ...r ? { encoding: r } : {}
    }, { config: s });
  }
  mapFacetedUnit(e, t) {
    const { row: i, column: n, facet: o, ...g } = e.encoding, { mark: s, width: I, projection: r, height: a, view: C, params: B, encoding: l, ...Q } = e, { facetMapping: E, layout: d } = this.getFacetMappingAndLayout({ row: i, column: n, facet: o }, t), m = sT(g, t.repeater);
    return this.mapFacet({
      ...Q,
      ...d,
      // row / column has higher precedence than facet
      facet: E,
      spec: {
        ...I ? { width: I } : {},
        ...a ? { height: a } : {},
        ...C ? { view: C } : {},
        ...r ? { projection: r } : {},
        mark: s,
        encoding: m,
        ...B ? { params: B } : {}
      }
    }, t);
  }
  getFacetMappingAndLayout(e, t) {
    const { row: i, column: n, facet: o } = e;
    if (i || n) {
      o && PA(rze([...i ? [jc] : [], ...n ? [Pc] : []]));
      const g = {}, s = {};
      for (const I of [jc, Pc]) {
        const r = e[I];
        if (r) {
          const { align: a, center: C, spacing: B, columns: l, ...Q } = r;
          g[I] = Q;
          for (const E of ["align", "center", "spacing"])
            r[E] !== void 0 && (s[E] ?? (s[E] = {}), s[E][I] = r[E]);
        }
      }
      return { facetMapping: g, layout: s };
    } else {
      const { align: g, center: s, spacing: I, columns: r, ...a } = o;
      return {
        facetMapping: r4e(a, t.repeater),
        layout: {
          ...g ? { align: g } : {},
          ...s ? { center: s } : {},
          ...I ? { spacing: I } : {},
          ...r ? { columns: r } : {}
        }
      };
    }
  }
  mapLayer(e, { parentEncoding: t, parentProjection: i, ...n }) {
    const { encoding: o, projection: g, ...s } = e, I = {
      ...n,
      parentEncoding: khA({ parentEncoding: t, encoding: o, layer: !0 }),
      parentProjection: JhA({ parentProjection: i, projection: g })
    };
    return super.mapLayer({
      ...s,
      ...e.name ? { name: [I.repeaterPrefix, e.name].filter((r) => r).join("_") } : {}
    }, I);
  }
}
function khA({ parentEncoding: A, encoding: e = {}, layer: t }) {
  let i = {};
  if (A) {
    const n = /* @__PURE__ */ new Set([..._A(A), ..._A(e)]);
    for (const o of n) {
      const g = e[o], s = A[o];
      if (at(g)) {
        const I = {
          ...s,
          ...g
        };
        i[o] = I;
      } else
        UF(g) ? i[o] = {
          ...g,
          condition: {
            ...s,
            ...g.condition
          }
        } : g || g === null ? i[o] = g : (t || yC(s) || ke(s) || at(s) || ZA(s)) && (i[o] = s);
    }
  } else
    i = e;
  return !i || Fi(i) ? void 0 : i;
}
function JhA(A) {
  const { parentProjection: e, projection: t } = A;
  return e && t && PA($5e({ parentProjection: e, projection: t })), t ?? e;
}
function UoA(A) {
  return "filter" in A;
}
function l4e(A) {
  return (A == null ? void 0 : A.stop) !== void 0;
}
function M3A(A) {
  return "lookup" in A;
}
function c4e(A) {
  return "data" in A;
}
function Q4e(A) {
  return "param" in A;
}
function E4e(A) {
  return "pivot" in A;
}
function u4e(A) {
  return "density" in A;
}
function d4e(A) {
  return "quantile" in A;
}
function h4e(A) {
  return "regression" in A;
}
function m4e(A) {
  return "loess" in A;
}
function p4e(A) {
  return "sample" in A;
}
function y4e(A) {
  return "window" in A;
}
function b4e(A) {
  return "joinaggregate" in A;
}
function w4e(A) {
  return "flatten" in A;
}
function f4e(A) {
  return "calculate" in A;
}
function x3A(A) {
  return "bin" in A;
}
function D4e(A) {
  return "impute" in A;
}
function G4e(A) {
  return "timeUnit" in A;
}
function k4e(A) {
  return "aggregate" in A;
}
function J4e(A) {
  return "stack" in A;
}
function N4e(A) {
  return "fold" in A;
}
function Y4e(A) {
  return "extent" in A && !("density" in A);
}
function R4e(A) {
  return A.map((e) => UoA(e) ? {
    filter: lw(e.filter, oTe)
  } : e);
}
class F4e extends KoA {
  map(e, t) {
    return t.emptySelections ?? (t.emptySelections = {}), t.selectionPredicates ?? (t.selectionPredicates = {}), e = NhA(e, t), super.map(e, t);
  }
  mapLayerOrUnit(e, t) {
    if (e = NhA(e, t), e.encoding) {
      const i = {};
      for (const [n, o] of nd(e.encoding))
        i[n] = L3A(o, t);
      e = { ...e, encoding: i };
    }
    return super.mapLayerOrUnit(e, t);
  }
  mapUnit(e, t) {
    const { selection: i, ...n } = e;
    return i ? {
      ...n,
      params: nd(i).map(([o, g]) => {
        const { init: s, bind: I, empty: r, ...a } = g;
        a.type === "single" ? (a.type = "point", a.toggle = !1) : a.type === "multi" && (a.type = "point"), t.emptySelections[o] = r !== "none";
        for (const C of tg(t.selectionPredicates[o] ?? {}))
          C.empty = r !== "none";
        return { name: o, value: s, select: a, bind: I };
      })
    } : e;
  }
}
function NhA(A, e) {
  const { transform: t, ...i } = A;
  if (t) {
    const n = t.map((o) => {
      if (UoA(o))
        return { filter: uP(o, e) };
      if (x3A(o) && Q0(o.bin))
        return {
          ...o,
          bin: v3A(o.bin)
        };
      if (M3A(o)) {
        const { selection: g, ...s } = o.from;
        return g ? {
          ...o,
          from: { param: g, ...s }
        } : o;
      }
      return o;
    });
    return { ...i, transform: n };
  }
  return A;
}
function L3A(A, e) {
  var t, i;
  const n = tt(A);
  if (jA(n) && Q0(n.bin) && (n.bin = v3A(n.bin)), d0(n) && (i = (t = n.scale) == null ? void 0 : t.domain) != null && i.selection) {
    const { selection: o, ...g } = n.scale.domain;
    n.scale.domain = { ...g, ...o ? { param: o } : {} };
  }
  if (bV(n))
    if (ZA(n.condition))
      n.condition = n.condition.map((o) => {
        const { selection: g, param: s, test: I, ...r } = o;
        return s ? o : { ...r, test: uP(o, e) };
      });
    else {
      const { selection: o, param: g, test: s, ...I } = L3A(n.condition, e);
      n.condition = g ? n.condition : {
        ...I,
        test: uP(n.condition, e)
      };
    }
  return n;
}
function v3A(A) {
  const e = A.extent;
  if (e != null && e.selection) {
    const { selection: t, ...i } = e;
    return { ...A, extent: { ...i, param: t } };
  }
  return A;
}
function uP(A, e) {
  const t = (i) => lw(i, (n) => {
    var o;
    const g = e.emptySelections[n] ?? !0, s = { param: n, empty: g };
    return (o = e.selectionPredicates)[n] ?? (o[n] = []), e.selectionPredicates[n].push(s), s;
  });
  return A.selection ? t(A.selection) : lw(A.test || A.filter, (i) => i.selection ? t(i.selection) : i);
}
class dP extends KoA {
  map(e, t) {
    const i = t.selections ?? [];
    if (e.params && !UQ(e)) {
      const n = [];
      for (const o of e.params)
        SoA(o) ? i.push(o) : n.push(o);
      e.params = n;
    }
    return t.selections = i, super.map(e, t);
  }
  mapUnit(e, t) {
    const i = t.selections;
    if (!i || !i.length)
      return e;
    const n = (t.path ?? []).concat(e.name), o = [];
    for (const g of i)
      if (!g.views || !g.views.length)
        o.push(g);
      else
        for (const s of g.views)
          (Be(s) && (s === e.name || n.includes(s)) || ZA(s) && // logic for backwards compatibility with view paths before we had unique names
          // @ts-ignore
          s.map((I) => n.indexOf(I)).every((I, r, a) => I !== -1 && (r === 0 || I > a[r - 1]))) && o.push(g);
    return o.length && (e.params = o), e;
  }
}
for (const A of ["mapFacet", "mapRepeat", "mapHConcat", "mapVConcat", "mapLayer"]) {
  const e = dP.prototype[A];
  dP.prototype[A] = function(t, i) {
    return e.call(this, t, M4e(t, i));
  };
}
function M4e(A, e) {
  return A.name ? {
    ...e,
    path: (e.path ?? []).concat(A.name)
  } : e;
}
function H3A(A, e) {
  e === void 0 && (e = J3A(A.config));
  const t = H4e(A, e), { width: i, height: n } = A, o = S4e(t, { width: i, height: n, autosize: A.autosize }, e);
  return {
    ...t,
    ...o ? { autosize: o } : {}
  };
}
const x4e = new B4e(), L4e = new F4e(), v4e = new dP();
function H4e(A, e = {}) {
  const t = { config: e };
  return v4e.map(x4e.map(L4e.map(A, t), t), t);
}
function YhA(A) {
  return Be(A) ? { type: A } : A ?? {};
}
function S4e(A, e, t) {
  let { width: i, height: n } = e;
  const o = UQ(A) || NV(A), g = {};
  o ? i == "container" && n == "container" ? (g.type = "fit", g.contains = "padding") : i == "container" ? (g.type = "fit-x", g.contains = "padding") : n == "container" && (g.type = "fit-y", g.contains = "padding") : (i == "container" && (PA(thA("width")), i = void 0), n == "container" && (PA(thA("height")), n = void 0));
  const s = {
    type: "pad",
    ...g,
    ...t ? YhA(t.autosize) : {},
    ...YhA(A.autosize)
  };
  if (s.type === "fit" && !o && (PA(v5e), s.type = "pad"), i == "container" && !(s.type == "fit" || s.type == "fit-x") && PA(ihA("width")), n == "container" && !(s.type == "fit" || s.type == "fit-y") && PA(ihA("height")), !ZI(s, { type: "pad" }))
    return s;
}
function Z4e(A) {
  return A === "fit" || A === "fit-x" || A === "fit-y";
}
function W4e(A) {
  return A ? `fit-${BV(A)}` : "fit";
}
const K4e = [
  "background",
  "padding"
  // We do not include "autosize" here as it is supported by only unit and layer specs and thus need to be normalized
];
function RhA(A, e) {
  const t = {};
  for (const i of K4e)
    A && A[i] !== void 0 && (t[i] = YI(A[i]));
  return e && (t.params = A.params), t;
}
class VQ {
  constructor(e = {}, t = {}) {
    this.explicit = e, this.implicit = t;
  }
  clone() {
    return new VQ(tt(this.explicit), tt(this.implicit));
  }
  combine() {
    return {
      ...this.explicit,
      ...this.implicit
    };
  }
  get(e) {
    return _n(this.explicit[e], this.implicit[e]);
  }
  getWithExplicit(e) {
    return this.explicit[e] !== void 0 ? { explicit: !0, value: this.explicit[e] } : this.implicit[e] !== void 0 ? { explicit: !1, value: this.implicit[e] } : { explicit: !1, value: void 0 };
  }
  setWithExplicit(e, { value: t, explicit: i }) {
    t !== void 0 && this.set(e, t, i);
  }
  set(e, t, i) {
    return delete this[i ? "implicit" : "explicit"][e], this[i ? "explicit" : "implicit"][e] = t, this;
  }
  copyKeyFromSplit(e, { explicit: t, implicit: i }) {
    t[e] !== void 0 ? this.set(e, t[e], !0) : i[e] !== void 0 && this.set(e, i[e], !1);
  }
  copyKeyFromObject(e, t) {
    t[e] !== void 0 && this.set(e, t[e], !0);
  }
  /**
   * Merge split object into this split object. Properties from the other split
   * overwrite properties from this split.
   */
  copyAll(e) {
    for (const t of _A(e.combine())) {
      const i = e.getWithExplicit(t);
      this.setWithExplicit(t, i);
    }
  }
}
function CB(A) {
  return {
    explicit: !0,
    value: A
  };
}
function Yr(A) {
  return {
    explicit: !1,
    value: A
  };
}
function S3A(A) {
  return (e, t, i, n) => {
    const o = A(e.value, t.value);
    return o > 0 ? e : o < 0 ? t : YV(e, t, i, n);
  };
}
function YV(A, e, t, i) {
  return A.explicit && e.explicit && PA(yze(t, i, A.value, e.value)), A;
}
function sd(A, e, t, i, n = YV) {
  return A === void 0 || A.value === void 0 ? e : A.explicit && !e.explicit ? A : e.explicit && !A.explicit ? e : ZI(A.value, e.value) ? A : n(A, e, t, i);
}
class U4e extends VQ {
  constructor(e = {}, t = {}, i = !1) {
    super(e, t), this.explicit = e, this.implicit = t, this.parseNothing = i;
  }
  clone() {
    const e = super.clone();
    return e.parseNothing = this.parseNothing, e;
  }
}
function Kf(A) {
  return "url" in A;
}
function u2(A) {
  return "values" in A;
}
function Z3A(A) {
  return "name" in A && !Kf(A) && !u2(A) && !Yu(A);
}
function Yu(A) {
  return A && (W3A(A) || K3A(A) || VoA(A));
}
function W3A(A) {
  return "sequence" in A;
}
function K3A(A) {
  return "sphere" in A;
}
function VoA(A) {
  return "graticule" in A;
}
var Ti;
(function(A) {
  A[A.Raw = 0] = "Raw", A[A.Main = 1] = "Main", A[A.Row = 2] = "Row", A[A.Column = 3] = "Column", A[A.Lookup = 4] = "Lookup";
})(Ti || (Ti = {}));
function U3A(A) {
  const { signals: e, hasLegend: t, index: i, ...n } = A;
  return n.field = Ir(n.field), n;
}
function kp(A, e = !0, t = Ng) {
  if (ZA(A)) {
    const i = A.map((n) => kp(n, e, t));
    return e ? `[${i.join(", ")}]` : i;
  } else if (E0(A))
    return t(e ? wp(A) : Tze(A));
  return e ? t(Mi(A)) : A;
}
function V4e(A, e) {
  for (const t of tg(A.component.selection ?? {})) {
    const i = t.name;
    let n = `${i}${ad}, ${t.resolve === "global" ? "true" : `{unit: ${Zm(A)}}`}`;
    for (const o of xV)
      o.defined(t) && (o.signals && (e = o.signals(A, t, e)), o.modifyExpr && (n = o.modifyExpr(A, t, n)));
    e.push({
      name: i + yqe,
      on: [
        {
          events: { signal: t.name + ad },
          update: `modify(${ie(t.name + Jp)}, ${n})`
        }
      ]
    });
  }
  return XoA(e);
}
function X4e(A, e) {
  if (A.component.selection && _A(A.component.selection).length) {
    const t = ie(A.getName("cell"));
    e.unshift({
      name: "facet",
      value: {},
      on: [
        {
          events: Ud("pointermove", "scope"),
          update: `isTuple(facet) ? facet : group(${t}).datum`
        }
      ]
    });
  }
  return XoA(e);
}
function z4e(A, e) {
  let t = !1;
  for (const i of tg(A.component.selection ?? {})) {
    const n = i.name, o = ie(n + Jp);
    if (e.filter((g) => g.name === n).length === 0) {
      const g = i.resolve === "global" ? "union" : i.resolve, s = i.type === "point" ? ", true, true)" : ")";
      e.push({
        name: i.name,
        update: `${sUA}(${o}, ${ie(g)}${s}`
      });
    }
    t = !0;
    for (const g of xV)
      g.defined(i) && g.topLevelSignals && (e = g.topLevelSignals(A, i, e));
  }
  return t && e.filter((i) => i.name === "unit").length === 0 && e.unshift({
    name: "unit",
    value: {},
    on: [{ events: "pointermove", update: "isTuple(group()) ? group() : unit" }]
  }), XoA(e);
}
function T4e(A, e) {
  const t = [...e], i = Zm(A, { escape: !1 });
  for (const n of tg(A.component.selection ?? {})) {
    const o = { name: n.name + Jp };
    if (n.project.hasSelectionId && (o.transform = [{ type: "collect", sort: { field: bC } }]), n.init) {
      const g = n.project.items.map(U3A);
      o.values = n.project.hasSelectionId ? n.init.map((s) => ({ unit: i, [bC]: kp(s, !1)[0] })) : n.init.map((s) => ({ unit: i, fields: g, values: kp(s, !1) }));
    }
    t.filter((g) => g.name === n.name + Jp).length || t.push(o);
  }
  return t;
}
function V3A(A, e) {
  for (const t of tg(A.component.selection ?? {}))
    for (const i of xV)
      i.defined(t) && i.marks && (e = i.marks(A, t, e));
  return e;
}
function _4e(A, e) {
  for (const t of A.children)
    xn(t) && (e = V3A(t, e));
  return e;
}
function q4e(A, e, t, i) {
  const n = BUA(A, e.param, e);
  return {
    signal: ia(t.get("type")) && ZA(i) && i[0] > i[1] ? `isValid(${n}) && reverse(${n})` : n
  };
}
function XoA(A) {
  return A.map((e) => (e.on && !e.on.length && delete e.on, e));
}
class Yi {
  constructor(e, t) {
    this.debugName = t, this._children = [], this._parent = null, e && (this.parent = e);
  }
  /**
   * Clone this node with a deep copy but don't clone links to children or parents.
   */
  clone() {
    throw new Error("Cannot clone node");
  }
  get parent() {
    return this._parent;
  }
  /**
   * Set the parent of the node and also add this node to the parent's children.
   */
  set parent(e) {
    this._parent = e, e && e.addChild(this);
  }
  get children() {
    return this._children;
  }
  numChildren() {
    return this._children.length;
  }
  addChild(e, t) {
    if (this._children.includes(e)) {
      PA(O5e);
      return;
    }
    t !== void 0 ? this._children.splice(t, 0, e) : this._children.push(e);
  }
  removeChild(e) {
    const t = this._children.indexOf(e);
    return this._children.splice(t, 1), t;
  }
  /**
   * Remove node from the dataflow.
   */
  remove() {
    let e = this._parent.removeChild(this);
    for (const t of this._children)
      t._parent = this._parent, this._parent.addChild(t, e++);
  }
  /**
   * Insert another node as a parent of this node.
   */
  insertAsParentOf(e) {
    const t = e.parent;
    t.removeChild(this), this.parent = t, e.parent = this;
  }
  swapWithParent() {
    const e = this._parent, t = e.parent;
    for (const n of this._children)
      n.parent = e;
    this._children = [], e.removeChild(this);
    const i = e.parent.removeChild(e);
    this._parent = t, t.addChild(this, i), e.parent = this;
  }
}
class Is extends Yi {
  clone() {
    const e = new this.constructor();
    return e.debugName = `clone_${this.debugName}`, e._source = this._source, e._name = `clone_${this._name}`, e.type = this.type, e.refCounts = this.refCounts, e.refCounts[e._name] = 0, e;
  }
  /**
   * @param source The name of the source. Will change in assemble.
   * @param type The type of the output node.
   * @param refCounts A global ref counter map.
   */
  constructor(e, t, i, n) {
    super(e, t), this.type = i, this.refCounts = n, this._source = this._name = t, this.refCounts && !(this._name in this.refCounts) && (this.refCounts[this._name] = 0);
  }
  dependentFields() {
    return /* @__PURE__ */ new Set();
  }
  producedFields() {
    return /* @__PURE__ */ new Set();
  }
  hash() {
    return this._hash === void 0 && (this._hash = `Output ${ZWA()}`), this._hash;
  }
  /**
   * Request the datasource name and increase the ref counter.
   *
   * During the parsing phase, this will return the simple name such as 'main' or 'raw'.
   * It is crucial to request the name from an output node to mark it as a required node.
   * If nobody ever requests the name, this datasource will not be instantiated in the assemble phase.
   *
   * In the assemble phase, this will return the correct name.
   */
  getSource() {
    return this.refCounts[this._name]++, this._source;
  }
  isRequired() {
    return !!this.refCounts[this._name];
  }
  setSource(e) {
    this._source = e;
  }
}
function IT(A) {
  return A.as !== void 0;
}
function FhA(A) {
  return `${A}_end`;
}
class jB extends Yi {
  clone() {
    return new jB(null, tt(this.timeUnits));
  }
  constructor(e, t) {
    super(e), this.timeUnits = t;
  }
  static makeFromEncoding(e, t) {
    const i = t.reduceFieldDef((n, o, g) => {
      const { field: s, timeUnit: I } = o;
      if (I) {
        let r;
        if (u0(I)) {
          if (xn(t)) {
            const { mark: a, markDef: C, config: B } = t, l = gd({ fieldDef: o, markDef: C, config: B });
            (E2(a) || l) && (r = {
              timeUnit: vo(I),
              field: s
            });
          }
        } else
          r = {
            as: se(o, { forAs: !0 }),
            field: s,
            timeUnit: I
          };
        if (xn(t)) {
          const { mark: a, markDef: C, config: B } = t, l = gd({ fieldDef: o, markDef: C, config: B });
          E2(a) && qn(g) && l !== 0.5 && (r.rectBandPosition = l);
        }
        r && (n[vt(r)] = r);
      }
      return n;
    }, {});
    return Fi(i) ? null : new jB(e, i);
  }
  static makeFromTransform(e, t) {
    const { timeUnit: i, ...n } = { ...t }, o = vo(i), g = {
      ...n,
      timeUnit: o
    };
    return new jB(e, {
      [vt(g)]: g
    });
  }
  /**
   * Merge together TimeUnitNodes assigning the children of `other` to `this`
   * and removing `other`.
   */
  merge(e) {
    this.timeUnits = { ...this.timeUnits };
    for (const t in e.timeUnits)
      this.timeUnits[t] || (this.timeUnits[t] = e.timeUnits[t]);
    for (const t of e.children)
      e.removeChild(t), t.parent = this;
    e.remove();
  }
  /**
   * Remove time units coming from the other node.
   */
  removeFormulas(e) {
    const t = {};
    for (const [i, n] of nd(this.timeUnits)) {
      const o = IT(n) ? n.as : `${n.field}_end`;
      e.has(o) || (t[i] = n);
    }
    this.timeUnits = t;
  }
  producedFields() {
    return new Set(tg(this.timeUnits).map((e) => IT(e) ? e.as : FhA(e.field)));
  }
  dependentFields() {
    return new Set(tg(this.timeUnits).map((e) => e.field));
  }
  hash() {
    return `TimeUnit ${vt(this.timeUnits)}`;
  }
  assemble() {
    const e = [];
    for (const t of tg(this.timeUnits)) {
      const { rectBandPosition: i } = t, n = vo(t.timeUnit);
      if (IT(t)) {
        const { field: o, as: g } = t, { unit: s, utc: I, ...r } = n, a = [g, `${g}_end`];
        e.push({
          field: Ir(o),
          type: "timeunit",
          ...s ? { units: EV(s) } : {},
          ...I ? { timezone: "utc" } : {},
          ...r,
          as: a
        }), e.push(...MhA(a, i, n));
      } else if (t) {
        const { field: o } = t, g = o.replaceAll("\\.", "."), s = X3A({ timeUnit: n, field: g }), I = FhA(g);
        e.push({
          type: "formula",
          expr: s,
          as: I
        }), e.push(...MhA([g, I], i, n));
      }
    }
    return e;
  }
}
const RV = "offsetted_rect_start", FV = "offsetted_rect_end";
function X3A({ timeUnit: A, field: e, reverse: t }) {
  const { unit: i, utc: n } = A, o = yKA(i), { part: g, step: s } = DKA(o, A.step);
  return `${n ? "utcOffset" : "timeOffset"}('${g}', datum['${e}'], ${t ? -s : s})`;
}
function MhA([A, e], t, i) {
  if (t !== void 0 && t !== 0.5) {
    const n = `datum['${A}']`, o = `datum['${e}']`;
    return [
      {
        type: "formula",
        expr: xhA([
          X3A({
            timeUnit: i,
            field: A,
            reverse: !0
          }),
          n
        ], t + 0.5),
        as: `${A}_${RV}`
      },
      {
        type: "formula",
        expr: xhA([n, o], t + 0.5),
        as: `${A}_${FV}`
      }
    ];
  }
  return [];
}
function xhA([A, e], t) {
  return `${1 - t} * ${A} + ${t} * ${e}`;
}
const zF = "_tuple_fields";
class O4e {
  constructor(...e) {
    this.items = e, this.hasChannel = {}, this.hasField = {}, this.hasSelectionId = !1;
  }
}
const j4e = {
  defined: () => !0,
  parse: (A, e, t) => {
    const i = e.name, n = e.project ?? (e.project = new O4e()), o = {}, g = {}, s = /* @__PURE__ */ new Set(), I = (Q, E) => {
      const d = E === "visual" ? Q.channel : Q.field;
      let m = En(`${i}_${d}`);
      for (let y = 1; s.has(m); y++)
        m = En(`${i}_${d}_${y}`);
      return s.add(m), { [E]: m };
    }, r = e.type, a = A.config.selection[r], C = t.value !== void 0 ? Ce(t.value) : null;
    let { fields: B, encodings: l } = ce(t.select) ? t.select : {};
    if (!B && !l && C) {
      for (const Q of C)
        if (ce(Q))
          for (const E of _A(Q))
            B5e(E) ? (l || (l = [])).push(E) : r === "interval" ? (PA(z5e), l = a.encodings) : (B ?? (B = [])).push(E);
    }
    !B && !l && (l = a.encodings, "fields" in a && (B = a.fields));
    for (const Q of l ?? []) {
      const E = A.fieldDef(Q);
      if (E) {
        let d = E.field;
        if (E.aggregate) {
          PA(H5e(Q, E.aggregate));
          continue;
        } else if (!d) {
          PA(ohA(Q));
          continue;
        }
        if (E.timeUnit && !u0(E.timeUnit)) {
          d = A.vgField(Q);
          const m = {
            timeUnit: E.timeUnit,
            as: d,
            field: E.field
          };
          g[vt(m)] = m;
        }
        if (!o[d]) {
          const m = r === "interval" && KQ(Q) && ia(A.getScaleComponent(Q).get("type")) ? "R" : E.bin ? "R-RE" : "E", y = { field: d, channel: Q, type: m, index: n.items.length };
          y.signals = { ...I(y, "data"), ...I(y, "visual") }, n.items.push(o[d] = y), n.hasField[d] = o[d], n.hasSelectionId = n.hasSelectionId || d === bC, zWA(Q) ? (y.geoChannel = Q, y.channel = XWA(Q), n.hasChannel[y.channel] = o[d]) : n.hasChannel[Q] = o[d];
        }
      } else
        PA(ohA(Q));
    }
    for (const Q of B ?? []) {
      if (n.hasField[Q])
        continue;
      const E = { type: "E", field: Q, index: n.items.length };
      E.signals = { ...I(E, "data") }, n.items.push(E), n.hasField[Q] = E, n.hasSelectionId = n.hasSelectionId || Q === bC;
    }
    C && (e.init = C.map((Q) => n.items.map((E) => ce(Q) ? Q[E.geoChannel || E.channel] !== void 0 ? Q[E.geoChannel || E.channel] : Q[E.field] : Q))), Fi(g) || (n.timeUnit = new jB(null, g));
  },
  signals: (A, e, t) => {
    const i = e.name + zF;
    return t.filter((n) => n.name === i).length > 0 || e.project.hasSelectionId ? t : t.concat({
      name: i,
      value: e.project.items.map(U3A)
    });
  }
}, $c = {
  defined: (A) => A.type === "interval" && A.resolve === "global" && A.bind && A.bind === "scales",
  parse: (A, e) => {
    const t = e.scales = [];
    for (const i of e.project.items) {
      const n = i.channel;
      if (!KQ(n))
        continue;
      const o = A.getScaleComponent(n), g = o ? o.get("type") : void 0;
      if (!o || !ia(g)) {
        PA(W5e);
        continue;
      }
      o.set("selectionExtent", { param: e.name, field: i.field }, !0), t.push(i);
    }
  },
  topLevelSignals: (A, e, t) => {
    const i = e.scales.filter((g) => t.filter((s) => s.name === g.signals.data).length === 0);
    if (!A.parent || LhA(A) || i.length === 0)
      return t;
    const n = t.filter((g) => g.name === e.name)[0];
    let o = n.update;
    if (o.indexOf(sUA) >= 0)
      n.update = `{${i.map((g) => `${ie(Ir(g.field))}: ${g.signals.data}`).join(", ")}}`;
    else {
      for (const g of i) {
        const s = `${ie(Ir(g.field))}: ${g.signals.data}`;
        o.includes(s) || (o = `${o.substring(0, o.length - 1)}, ${s}}`);
      }
      n.update = o;
    }
    return t.concat(i.map((g) => ({ name: g.signals.data })));
  },
  signals: (A, e, t) => {
    if (A.parent && !LhA(A))
      for (const i of e.scales) {
        const n = t.filter((o) => o.name === i.signals.data)[0];
        n.push = "outer", delete n.value, delete n.update;
      }
    return t;
  }
};
function hP(A, e) {
  return `domain(${ie(A.scaleName(e))})`;
}
function LhA(A) {
  return A.parent && rG(A.parent) && !A.parent.parent;
}
const Ew = "_brush", z3A = "_scale_trigger", Mk = "geo_interval_init_tick", T3A = "_init", P4e = "_center", $4e = {
  defined: (A) => A.type === "interval",
  parse: (A, e, t) => {
    var i;
    if (A.hasProjection) {
      const n = { ...ce(t.select) ? t.select : {} };
      n.fields = [bC], n.encodings || (n.encodings = t.value ? _A(t.value) : [MC, FC]), t.select = { type: "interval", ...n };
    }
    if (e.translate && !$c.defined(e)) {
      const n = `!event.item || event.item.mark.name !== ${ie(e.name + Ew)}`;
      for (const o of e.events) {
        if (!o.between) {
          PA(`${o} is not an ordered event stream for interval selections.`);
          continue;
        }
        const g = Ce((i = o.between[0]).filter ?? (i.filter = []));
        g.indexOf(n) < 0 && g.push(n);
      }
    }
  },
  signals: (A, e, t) => {
    const i = e.name, n = i + ad, o = tg(e.project.hasChannel).filter((s) => s.channel === un || s.channel === Vo), g = e.init ? e.init[0] : null;
    if (t.push(...o.reduce((s, I) => s.concat(Aqe(A, e, I, g && g[I.index])), [])), A.hasProjection) {
      const s = ie(A.projectionName()), I = A.projectionName() + P4e, { x: r, y: a } = e.project.hasChannel, C = r && r.signals.visual, B = a && a.signals.visual, l = r ? g && g[r.index] : `${I}[0]`, Q = a ? g && g[a.index] : `${I}[1]`, E = (G) => A.getSizeSignalRef(G).signal, d = `[[${C ? C + "[0]" : "0"}, ${B ? B + "[0]" : "0"}],[${C ? C + "[1]" : E("width")}, ${B ? B + "[1]" : E("height")}]]`;
      g && (t.unshift({
        name: i + T3A,
        init: `[scale(${s}, [${r ? l[0] : l}, ${a ? Q[0] : Q}]), scale(${s}, [${r ? l[1] : l}, ${a ? Q[1] : Q}])]`
      }), (!r || !a) && (t.find((G) => G.name === I) || t.unshift({
        name: I,
        update: `invert(${s}, [${E("width")}/2, ${E("height")}/2])`
      })));
      const m = `intersect(${d}, {markname: ${ie(A.getName("marks"))}}, unit.mark)`, y = `{unit: ${Zm(A)}}`, f = `vlSelectionTuples(${m}, ${y})`, w = o.map((G) => G.signals.visual);
      return t.concat({
        name: n,
        on: [
          {
            events: [
              ...w.length ? [{ signal: w.join(" || ") }] : [],
              ...g ? [{ signal: Mk }] : []
            ],
            update: f
          }
        ]
      });
    } else {
      if (!$c.defined(e)) {
        const r = i + z3A, a = o.map((C) => {
          const B = C.channel, { data: l, visual: Q } = C.signals, E = ie(A.scaleName(B)), d = A.getScaleComponent(B).get("type"), m = ia(d) ? "+" : "";
          return `(!isArray(${l}) || (${m}invert(${E}, ${Q})[0] === ${m}${l}[0] && ${m}invert(${E}, ${Q})[1] === ${m}${l}[1]))`;
        });
        a.length && t.push({
          name: r,
          value: {},
          on: [
            {
              events: o.map((C) => ({ scale: A.scaleName(C.channel) })),
              update: a.join(" && ") + ` ? ${r} : {}`
            }
          ]
        });
      }
      const s = o.map((r) => r.signals.data), I = `unit: ${Zm(A)}, fields: ${i + zF}, values`;
      return t.concat({
        name: n,
        ...g ? { init: `{${I}: ${kp(g)}}` } : {},
        ...s.length ? {
          on: [
            {
              events: [{ signal: s.join(" || ") }],
              update: `${s.join(" && ")} ? {${I}: [${s}]} : null`
            }
          ]
        } : {}
      });
    }
  },
  topLevelSignals: (A, e, t) => (xn(A) && A.hasProjection && e.init && (t.filter((i) => i.name === Mk).length || t.unshift({
    name: Mk,
    value: null,
    on: [
      {
        events: "timer{1}",
        update: `${Mk} === null ? {} : ${Mk}`
      }
    ]
  })), t),
  marks: (A, e, t) => {
    const i = e.name, { x: n, y: o } = e.project.hasChannel, g = n == null ? void 0 : n.signals.visual, s = o == null ? void 0 : o.signals.visual, I = `data(${ie(e.name + Jp)})`;
    if ($c.defined(e) || !n && !o)
      return t;
    const r = {
      x: n !== void 0 ? { signal: `${g}[0]` } : { value: 0 },
      y: o !== void 0 ? { signal: `${s}[0]` } : { value: 0 },
      x2: n !== void 0 ? { signal: `${g}[1]` } : { field: { group: "width" } },
      y2: o !== void 0 ? { signal: `${s}[1]` } : { field: { group: "height" } }
    };
    if (e.resolve === "global")
      for (const E of _A(r))
        r[E] = [
          {
            test: `${I}.length && ${I}[0].unit === ${Zm(A)}`,
            ...r[E]
          },
          { value: 0 }
        ];
    const { fill: a, fillOpacity: C, cursor: B, ...l } = e.mark, Q = _A(l).reduce((E, d) => (E[d] = [
      {
        test: [n !== void 0 && `${g}[0] !== ${g}[1]`, o !== void 0 && `${s}[0] !== ${s}[1]`].filter((m) => m).join(" && "),
        value: l[d]
      },
      { value: null }
    ], E), {});
    return [
      {
        name: `${i + Ew}_bg`,
        type: "rect",
        clip: !0,
        encode: {
          enter: {
            fill: { value: a },
            fillOpacity: { value: C }
          },
          update: r
        }
      },
      ...t,
      {
        name: i + Ew,
        type: "rect",
        clip: !0,
        encode: {
          enter: {
            ...B ? { cursor: { value: B } } : {},
            fill: { value: "transparent" }
          },
          update: { ...r, ...Q }
        }
      }
    ];
  }
};
function Aqe(A, e, t, i) {
  const n = !A.hasProjection, o = t.channel, g = t.signals.visual, s = ie(n ? A.scaleName(o) : A.projectionName()), I = (B) => `scale(${s}, ${B})`, r = A.getSizeSignalRef(o === un ? "width" : "height").signal, a = `${o}(unit)`, C = e.events.reduce((B, l) => [
    ...B,
    { events: l.between[0], update: `[${a}, ${a}]` },
    { events: l, update: `[${g}[0], clamp(${a}, 0, ${r})]` }
    // Brush End
  ], []);
  if (n) {
    const B = t.signals.data, l = $c.defined(e), Q = A.getScaleComponent(o), E = Q ? Q.get("type") : void 0, d = i ? { init: kp(i, !0, I) } : { value: [] };
    return C.push({
      events: { signal: e.name + z3A },
      update: ia(E) ? `[${I(`${B}[0]`)}, ${I(`${B}[1]`)}]` : "[0, 0]"
    }), l ? [{ name: B, on: [] }] : [
      { name: g, ...d, on: C },
      {
        name: B,
        ...i ? { init: kp(i) } : {},
        on: [
          {
            events: { signal: g },
            update: `${g}[0] === ${g}[1] ? null : invert(${s}, ${g})`
          }
        ]
      }
    ];
  } else {
    const B = o === un ? 0 : 1, l = e.name + T3A, Q = i ? { init: `[${l}[0][${B}], ${l}[1][${B}]]` } : { value: [] };
    return [{ name: g, ...Q, on: C }];
  }
}
const eqe = {
  defined: (A) => A.type === "point",
  signals: (A, e, t) => {
    const i = e.name, n = i + zF, o = e.project, g = "(item().isVoronoi ? datum.datum : datum)", s = tg(A.component.selection ?? {}).reduce((C, B) => B.type === "interval" ? C.concat(B.name + Ew) : C, []).map((C) => `indexof(item().mark.name, '${C}') < 0`).join(" && "), I = `datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${s ? ` && ${s}` : ""}`;
    let r = `unit: ${Zm(A)}, `;
    if (e.project.hasSelectionId)
      r += `${bC}: ${g}[${ie(bC)}]`;
    else {
      const C = o.items.map((B) => {
        const l = A.fieldDef(B.channel);
        return l != null && l.bin ? `[${g}[${ie(A.vgField(B.channel, {}))}], ${g}[${ie(A.vgField(B.channel, { binSuffix: "end" }))}]]` : `${g}[${ie(B.field)}]`;
      }).join(", ");
      r += `fields: ${n}, values: [${C}]`;
    }
    const a = e.events;
    return t.concat([
      {
        name: i + ad,
        on: a ? [
          {
            events: a,
            update: `${I} ? {${r}} : null`,
            force: !0
          }
        ] : []
      }
    ]);
  }
};
function gG(A, e, t, i) {
  const n = bV(e) && e.condition, o = i(e);
  if (n) {
    const g = Ce(n).map((s) => {
      const I = i(s);
      if (XTe(s)) {
        const { param: r, empty: a } = s;
        return { test: CUA(A, { param: r, empty: a }), ...I };
      } else
        return { test: HZ(A, s.test), ...I };
    });
    return {
      [t]: [...g, ...o !== void 0 ? [o] : []]
    };
  } else
    return o !== void 0 ? { [t]: o } : {};
}
function zoA(A, e = "text") {
  const t = A.encoding[e];
  return gG(A, t, e, (i) => MV(i, A.config));
}
function MV(A, e, t = "datum") {
  if (A) {
    if (yC(A))
      return sn(A.value);
    if (at(A)) {
      const { format: i, formatType: n } = YZ(A);
      return foA({ fieldOrDatumDef: A, format: i, formatType: n, expr: t, config: e });
    }
  }
}
function _3A(A, e = {}) {
  const { encoding: t, markDef: i, config: n, stack: o } = A, g = t.tooltip;
  if (ZA(g))
    return { tooltip: vhA({ tooltip: g }, o, n, e) };
  {
    const s = e.reactiveGeom ? "datum.datum" : "datum";
    return gG(A, g, "tooltip", (I) => {
      const r = MV(I, n, s);
      if (r)
        return r;
      if (I === null)
        return;
      let a = bi("tooltip", i, n);
      if (a === !0 && (a = { content: "encoding" }), Be(a))
        return { value: a };
      if (ce(a))
        return ke(a) ? a : a.content === "encoding" ? vhA(t, o, n, e) : { signal: s };
    });
  }
}
function q3A(A, e, t, { reactiveGeom: i } = {}) {
  const n = { ...t, ...t.tooltipFormat }, o = {}, g = i ? "datum.datum" : "datum", s = [];
  function I(a, C) {
    const B = c0(C), l = ls(a) ? a : {
      ...a,
      type: A[B].type
      // for secondary field def, copy type from main channel
    }, Q = l.title || JoA(l, n), E = Ce(Q).join(", ").replaceAll(/"/g, '\\"');
    let d;
    if (qn(C)) {
      const m = C === "x" ? "x2" : "y2", y = Bl(A[m]);
      if (qo(l.bin) && y) {
        const f = se(l, { expr: g }), w = se(y, { expr: g }), { format: G, formatType: R } = YZ(l);
        d = WF(f, w, G, R, n), o[m] = !0;
      }
    }
    if ((qn(C) || C === cr || C === RC) && e && e.fieldChannel === C && e.offset === "normalize") {
      const { format: m, formatType: y } = YZ(l);
      d = foA({
        fieldOrDatumDef: l,
        format: m,
        formatType: y,
        expr: g,
        config: n,
        normalizeStack: !0
      }).signal;
    }
    d ?? (d = MV(l, n, g).signal), s.push({ channel: C, key: E, value: d });
  }
  RoA(A, (a, C) => {
    jA(a) ? I(a, C) : wV(a) && I(a.condition, C);
  });
  const r = {};
  for (const { channel: a, key: C, value: B } of s)
    !o[a] && !r[C] && (r[C] = B);
  return r;
}
function vhA(A, e, t, { reactiveGeom: i } = {}) {
  const n = q3A(A, e, t, { reactiveGeom: i }), o = nd(n).map(([g, s]) => `"${g}": ${s}`);
  return o.length > 0 ? { signal: `{${o.join(", ")}}` } : void 0;
}
function tqe(A) {
  const { markDef: e, config: t } = A, i = bi("aria", e, t);
  return i === !1 ? {} : {
    ...i ? { aria: i } : {},
    ...iqe(A),
    ...nqe(A)
  };
}
function iqe(A) {
  const { mark: e, markDef: t, config: i } = A;
  if (i.aria === !1)
    return {};
  const n = bi("ariaRoleDescription", t, i);
  return n != null ? { ariaRoleDescription: { value: n } } : e in M5e ? {} : { ariaRoleDescription: { value: e } };
}
function nqe(A) {
  const { encoding: e, markDef: t, config: i, stack: n } = A, o = e.description;
  if (o)
    return gG(A, o, "description", (I) => MV(I, A.config));
  const g = bi("description", t, i);
  if (g != null)
    return {
      description: sn(g)
    };
  if (i.aria === !1)
    return {};
  const s = q3A(e, n, i);
  if (!Fi(s))
    return {
      description: {
        signal: nd(s).map(([I, r], a) => `"${a > 0 ? "; " : ""}${I}: " + (${r})`).join(" + ")
      }
    };
}
function Jo(A, e, t = {}) {
  const { markDef: i, encoding: n, config: o } = e, { vgChannel: g } = t;
  let { defaultRef: s, defaultValue: I } = t;
  s === void 0 && (I ?? (I = bi(A, i, o, { vgChannel: g, ignoreVgConfig: !0 })), I !== void 0 && (s = sn(I)));
  const r = n[A];
  return gG(e, r, g ?? A, (a) => woA({
    channel: A,
    channelDef: a,
    markDef: i,
    config: o,
    scaleName: e.scaleName(A),
    scale: e.getScaleComponent(A),
    stack: null,
    defaultRef: s
  }));
}
function O3A(A, e = { filled: void 0 }) {
  const { markDef: t, encoding: i, config: n } = A, { type: o } = t, g = e.filled ?? bi("filled", t, n), s = Ht(["bar", "point", "circle", "square", "geoshape"], o) ? "transparent" : void 0, I = bi(g === !0 ? "color" : void 0, t, n, { vgChannel: "fill" }) ?? // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified
  n.mark[g === !0 && "color"] ?? // If there is no fill, always fill symbols, bar, geoshape
  // with transparent fills https://github.com/vega/vega-lite/issues/1316
  s, r = bi(g === !1 ? "color" : void 0, t, n, { vgChannel: "stroke" }) ?? // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified
  n.mark[g === !1 && "color"], a = g ? "fill" : "stroke", C = {
    ...I ? { fill: sn(I) } : {},
    ...r ? { stroke: sn(r) } : {}
  };
  return t.color && (g ? t.fill : t.stroke) && PA(lKA("property", { fill: "fill" in t, stroke: "stroke" in t })), {
    ...C,
    ...Jo("color", A, {
      vgChannel: a,
      defaultValue: g ? I : r
    }),
    ...Jo("fill", A, {
      // if there is encoding.fill, include default fill just in case we have conditional-only fill encoding
      defaultValue: i.fill ? I : void 0
    }),
    ...Jo("stroke", A, {
      // if there is encoding.stroke, include default fill just in case we have conditional-only stroke encoding
      defaultValue: i.stroke ? r : void 0
    })
  };
}
function oqe(A) {
  const { encoding: e, mark: t } = A, i = e.order;
  return !jd(t) && yC(i) ? gG(A, i, "zindex", (n) => sn(n.value)) : {};
}
function Uf({ channel: A, markDef: e, encoding: t = {}, model: i, bandPosition: n }) {
  const o = `${A}Offset`, g = e[o], s = t[o];
  if ((o === "xOffset" || o === "yOffset") && s)
    return { offsetType: "encoding", offset: woA({
      channel: o,
      channelDef: s,
      markDef: e,
      config: i == null ? void 0 : i.config,
      scaleName: i.scaleName(o),
      scale: i.getScaleComponent(o),
      stack: null,
      defaultRef: sn(g),
      bandPosition: n
    }) };
  const I = e[o];
  return I ? { offsetType: "visual", offset: I } : {};
}
function bg(A, e, { defaultPos: t, vgChannel: i }) {
  const { encoding: n, markDef: o, config: g, stack: s } = e, I = n[A], r = n[Fl(A)], a = e.scaleName(A), C = e.getScaleComponent(A), { offset: B, offsetType: l } = Uf({
    channel: A,
    markDef: o,
    encoding: n,
    model: e,
    bandPosition: 0.5
  }), Q = ToA({
    model: e,
    defaultPos: t,
    channel: A,
    scaleName: a,
    scale: C
  }), E = !I && qn(A) && (n.latitude || n.longitude) ? (
    // use geopoint output if there are lat/long and there is no point position overriding lat/long.
    { field: e.getName(A) }
  ) : gqe({
    channel: A,
    channelDef: I,
    channel2Def: r,
    markDef: o,
    config: g,
    scaleName: a,
    scale: C,
    stack: s,
    offset: B,
    defaultRef: Q,
    bandPosition: l === "encoding" ? 0 : void 0
  });
  return E ? { [i || A]: E } : void 0;
}
function gqe(A) {
  const { channel: e, channelDef: t, scaleName: i, stack: n, offset: o, markDef: g } = A;
  if (at(t) && n && e === n.fieldChannel) {
    if (jA(t)) {
      let s = t.bandPosition;
      if (s === void 0 && g.type === "text" && (e === "radius" || e === "theta") && (s = 0.5), s !== void 0)
        return kZ({
          scaleName: i,
          fieldOrDatumDef: t,
          startSuffix: "start",
          bandPosition: s,
          offset: o
        });
    }
    return Hm(t, i, { suffix: "end" }, { offset: o });
  }
  return yoA(A);
}
function ToA({ model: A, defaultPos: e, channel: t, scaleName: i, scale: n }) {
  const { markDef: o, config: g } = A;
  return () => {
    const s = c0(t), I = od(t), r = bi(t, o, g, { vgChannel: I });
    if (r !== void 0)
      return RN(t, r);
    switch (e) {
      case "zeroOrMin":
      case "zeroOrMax":
        if (i) {
          const a = n.get("type");
          if (!Ht([Vs.LOG, Vs.TIME, Vs.UTC], a) && n.domainDefinitelyIncludesZero())
            return {
              scale: i,
              value: 0
            };
        }
        if (e === "zeroOrMin")
          return s === "y" ? { field: { group: "height" } } : { value: 0 };
        switch (s) {
          case "radius":
            return {
              signal: `min(${A.width.signal},${A.height.signal})/2`
            };
          case "theta":
            return { signal: "2*PI" };
          case "x":
            return { field: { group: "width" } };
          case "y":
            return { value: 0 };
        }
        break;
      case "mid":
        return { ...A[$s(t)], mult: 0.5 };
    }
  };
}
const sqe = {
  left: "x",
  center: "xc",
  right: "x2"
}, Iqe = {
  top: "y",
  middle: "yc",
  bottom: "y2"
};
function j3A(A, e, t, i = "middle") {
  if (A === "radius" || A === "theta")
    return od(A);
  const n = A === "x" ? "align" : "baseline", o = bi(n, e, t);
  let g;
  return ke(o) ? (PA(Cze(n)), g = void 0) : g = o, A === "x" ? sqe[g || (i === "top" ? "left" : "center")] : Iqe[g || i];
}
function LZ(A, e, { defaultPos: t, defaultPos2: i, range: n }) {
  return n ? P3A(A, e, { defaultPos: t, defaultPos2: i }) : bg(A, e, { defaultPos: t });
}
function P3A(A, e, { defaultPos: t, defaultPos2: i }) {
  const { markDef: n, config: o } = e, g = Fl(A), s = $s(A), I = aqe(e, i, g), r = I[s] ? (
    // If there is width/height, we need to position the marks based on the alignment.
    j3A(A, n, o)
  ) : (
    // Otherwise, make sure to apply to the right Vg Channel (for arc mark)
    od(A)
  );
  return {
    ...bg(A, e, { defaultPos: t, vgChannel: r }),
    ...I
  };
}
function aqe(A, e, t) {
  const { encoding: i, mark: n, markDef: o, stack: g, config: s } = A, I = c0(t), r = $s(t), a = od(t), C = i[I], B = A.scaleName(I), l = A.getScaleComponent(I), { offset: Q } = t in i || t in o ? Uf({ channel: t, markDef: o, encoding: i, model: A }) : Uf({ channel: I, markDef: o, encoding: i, model: A });
  if (!C && (t === "x2" || t === "y2") && (i.latitude || i.longitude)) {
    const d = $s(t), m = A.markDef[d];
    return m != null ? {
      [d]: { value: m }
    } : {
      [a]: { field: A.getName(t) }
    };
  }
  const E = rqe({
    channel: t,
    channelDef: C,
    channel2Def: i[t],
    markDef: o,
    config: s,
    scaleName: B,
    scale: l,
    stack: g,
    offset: Q,
    defaultRef: void 0
  });
  return E !== void 0 ? { [a]: E } : hx(t, o) || hx(t, {
    [t]: fZ(t, o, s.style),
    [r]: fZ(r, o, s.style)
  }) || hx(t, s[n]) || hx(t, s.mark) || {
    [a]: ToA({
      model: A,
      defaultPos: e,
      channel: t,
      scaleName: B,
      scale: l
    })()
  };
}
function rqe({ channel: A, channelDef: e, channel2Def: t, markDef: i, config: n, scaleName: o, scale: g, stack: s, offset: I, defaultRef: r }) {
  return at(e) && s && // If fieldChannel is X and channel is X2 (or Y and Y2)
  A.charAt(0) === s.fieldChannel.charAt(0) ? Hm(e, o, { suffix: "start" }, { offset: I }) : yoA({
    channel: A,
    channelDef: t,
    scaleName: o,
    scale: g,
    stack: s,
    markDef: i,
    config: n,
    offset: I,
    defaultRef: r
  });
}
function hx(A, e) {
  const t = $s(A), i = od(A);
  if (e[i] !== void 0)
    return { [i]: RN(A, e[i]) };
  if (e[A] !== void 0)
    return { [i]: RN(A, e[A]) };
  if (e[t]) {
    const n = e[t];
    if (Dp(n))
      PA(oze(t));
    else
      return { [t]: RN(A, n) };
  }
}
function Id(A, e) {
  const { config: t, encoding: i, markDef: n } = A, o = n.type, g = Fl(e), s = $s(e), I = i[e], r = i[g], a = A.getScaleComponent(e), C = a ? a.get("type") : void 0, B = n.orient, l = i[s] ?? i.size ?? bi("size", n, t, { vgChannel: s }), Q = OWA(e), E = o === "bar" && (e === "x" ? B === "vertical" : B === "horizontal");
  return jA(I) && (Oi(I.bin) || qo(I.bin) || I.timeUnit && !r) && !(l && !Dp(l)) && !i[Q] && !Wo(C) ? lqe({
    fieldDef: I,
    fieldDef2: r,
    channel: e,
    model: A
  }) : (at(I) && Wo(C) || E) && !r ? Bqe(I, e, A) : P3A(e, A, { defaultPos: "zeroOrMax", defaultPos2: "zeroOrMin" });
}
function Cqe(A, e, t, i, n, o, g) {
  if (Dp(n))
    if (t) {
      const s = t.get("type");
      if (s === "band") {
        let I = `bandwidth('${e}')`;
        n.band !== 1 && (I = `${n.band} * ${I}`);
        const r = mQ("minBandSize", { type: g }, i);
        return { signal: r ? `max(${Or(r)}, ${I})` : I };
      } else
        n.band !== 1 && (PA(Qze(s)), n = void 0);
    } else
      return {
        mult: n.band,
        field: { group: A }
      };
  else {
    if (ke(n))
      return n;
    if (n)
      return { value: n };
  }
  if (t) {
    const s = t.get("range");
    if (Od(s) && ti(s.step))
      return { value: s.step - 2 };
  }
  if (!o) {
    const { bandPaddingInner: s, barBandPaddingInner: I, rectBandPaddingInner: r } = i.scale, a = _n(s, g === "bar" ? I : r);
    if (ke(a))
      return { signal: `(1 - (${a.signal})) * ${A}` };
    if (ti(a))
      return { signal: `${1 - a} * ${A}` };
  }
  return { value: MZ(i.view, A) - 2 };
}
function Bqe(A, e, t) {
  var i, n;
  const { markDef: o, encoding: g, config: s, stack: I } = t, r = o.orient, a = t.scaleName(e), C = t.getScaleComponent(e), B = $s(e), l = Fl(e), Q = OWA(e), E = t.scaleName(Q), d = t.getScaleComponent($nA(e)), m = r === "horizontal" && e === "y" || r === "vertical" && e === "x";
  let y;
  (g.size || o.size) && (m ? y = Jo("size", t, {
    vgChannel: B,
    defaultRef: sn(o.size)
  }) : PA(hze(o.type)));
  const f = !!y, w = _KA({
    channel: e,
    fieldDef: A,
    markDef: o,
    config: s,
    scaleType: (i = C || d) == null ? void 0 : i.get("type"),
    useVlSizeChannel: m
  });
  y = y || {
    [B]: Cqe(B, E || a, d || C, s, w, !!A, o.type)
  };
  const G = ((n = C || d) == null ? void 0 : n.get("type")) === "band" && Dp(w) && !f ? "top" : "middle", R = j3A(e, o, s, G), F = R === "xc" || R === "yc", { offset: Z, offsetType: c } = Uf({ channel: e, markDef: o, encoding: g, model: t, bandPosition: F ? 0.5 : 0 }), J = yoA({
    channel: e,
    channelDef: A,
    markDef: o,
    config: s,
    scaleName: a,
    scale: C,
    stack: I,
    offset: Z,
    defaultRef: ToA({ model: t, defaultPos: "mid", channel: e, scaleName: a, scale: C }),
    bandPosition: F ? c === "encoding" ? 0 : 0.5 : ke(w) ? { signal: `(1-${w})/2` } : Dp(w) ? (1 - w.band) / 2 : 0
  });
  if (B)
    return { [R]: J, ...y };
  {
    const p = od(l), N = y[B], v = Z ? { ...N, offset: Z } : N;
    return {
      [R]: J,
      // posRef might be an array that wraps position invalid test
      [p]: ZA(J) ? [J[0], { ...J[1], offset: v }] : {
        ...J,
        offset: v
      }
    };
  }
}
function HhA(A, e, t, i, n, o, g) {
  if (VWA(A))
    return 0;
  const s = A === "x" || A === "y2", I = s ? -e / 2 : e / 2;
  if (ke(t) || ke(n) || ke(i) || o) {
    const r = Or(t), a = Or(n), C = Or(i), B = Or(o), l = o ? `(${g} < ${B} ? ${s ? "" : "-"}0.5 * (${B} - (${g})) : ${I})` : I, Q = C ? `${C} + ` : "", E = r ? `(${r} ? -1 : 1) * ` : "", d = a ? `(${a} + ${l})` : l;
    return {
      signal: Q + E + d
    };
  } else
    return n = n || 0, i + (t ? -n - I : +n + I);
}
function lqe({ fieldDef: A, fieldDef2: e, channel: t, model: i }) {
  var n;
  const { config: o, markDef: g, encoding: s } = i, I = i.getScaleComponent(t), r = i.scaleName(t), a = I ? I.get("type") : void 0, C = I.get("reverse"), B = _KA({ channel: t, fieldDef: A, markDef: g, config: o, scaleType: a }), l = (n = i.component.axes[t]) == null ? void 0 : n[0], Q = (l == null ? void 0 : l.get("translate")) ?? 0.5, E = qn(t) ? bi("binSpacing", g, o) ?? 0 : 0, d = Fl(t), m = od(t), y = od(d), f = mQ("minBandSize", g, o), { offset: w } = Uf({ channel: t, markDef: g, encoding: s, model: i, bandPosition: 0 }), { offset: G } = Uf({ channel: d, markDef: g, encoding: s, model: i, bandPosition: 0 }), R = ZTe({ fieldDef: A, scaleName: r }), F = HhA(t, E, C, Q, w, f, R), Z = HhA(d, E, C, Q, G ?? w, f, R), c = ke(B) ? { signal: `(1-${B.signal})/2` } : Dp(B) ? (1 - B.band) / 2 : 0.5, J = gd({ fieldDef: A, fieldDef2: e, markDef: g, config: o });
  if (Oi(A.bin) || A.timeUnit) {
    const p = A.timeUnit && J !== 0.5;
    return {
      [y]: ShA({
        fieldDef: A,
        scaleName: r,
        bandPosition: c,
        offset: Z,
        useRectOffsetField: p
      }),
      [m]: ShA({
        fieldDef: A,
        scaleName: r,
        bandPosition: ke(c) ? { signal: `1-${c.signal}` } : 1 - c,
        offset: F,
        useRectOffsetField: p
      })
    };
  } else if (qo(A.bin)) {
    const p = Hm(A, r, {}, { offset: Z });
    if (jA(e))
      return {
        [y]: p,
        [m]: Hm(e, r, {}, { offset: F })
      };
    if (Q0(A.bin) && A.bin.step)
      return {
        [y]: p,
        [m]: {
          signal: `scale("${r}", ${se(A, { expr: "datum" })} + ${A.bin.step})`,
          offset: F
        }
      };
  }
  PA(EKA(d));
}
function ShA({ fieldDef: A, scaleName: e, bandPosition: t, offset: i, useRectOffsetField: n }) {
  return kZ({
    scaleName: e,
    fieldOrDatumDef: A,
    bandPosition: t,
    offset: i,
    ...n ? {
      startSuffix: RV,
      endSuffix: FV
    } : {}
  });
}
const cqe = /* @__PURE__ */ new Set(["aria", "width", "height"]);
function Qr(A, e) {
  const { fill: t = void 0, stroke: i = void 0 } = e.color === "include" ? O3A(A) : {};
  return {
    ...Qqe(A.markDef, e),
    ...ZhA(A, "fill", t),
    ...ZhA(A, "stroke", i),
    ...Jo("opacity", A),
    ...Jo("fillOpacity", A),
    ...Jo("strokeOpacity", A),
    ...Jo("strokeWidth", A),
    ...Jo("strokeDash", A),
    ...oqe(A),
    ..._3A(A),
    ...zoA(A, "href"),
    ...tqe(A)
  };
}
function ZhA(A, e, t) {
  const { config: i, mark: n, markDef: o } = A;
  if (bi("invalid", o, i) === "hide" && t && !jd(n)) {
    const g = Eqe(A, { invalid: !0, channels: lV });
    if (g)
      return {
        [e]: [
          // prepend the invalid case
          // TODO: support custom value
          { test: g, value: null },
          ...Ce(t)
        ]
      };
  }
  return t ? { [e]: t } : {};
}
function Qqe(A, e) {
  return F5e.reduce((t, i) => (!cqe.has(i) && A[i] !== void 0 && e[i] !== "ignore" && (t[i] = sn(A[i])), t), {});
}
function Eqe(A, { invalid: e = !1, channels: t }) {
  const i = t.reduce((o, g) => {
    const s = A.getScaleComponent(g);
    if (s) {
      const I = s.get("type"), r = A.vgField(g, { expr: "datum" });
      r && ia(I) && (o[r] = !0);
    }
    return o;
  }, {}), n = _A(i);
  if (n.length > 0) {
    const o = e ? "||" : "&&";
    return n.map((g) => boA(g, e)).join(` ${o} `);
  }
}
function _oA(A) {
  const { config: e, markDef: t } = A;
  if (bi("invalid", t, e)) {
    const i = uqe(A, { channels: Ml });
    if (i)
      return { defined: { signal: i } };
  }
  return {};
}
function uqe(A, { invalid: e = !1, channels: t }) {
  const i = t.reduce((o, g) => {
    var s;
    const I = A.getScaleComponent(g);
    if (I) {
      const r = I.get("type"), a = A.vgField(g, { expr: "datum", binSuffix: (s = A.stack) != null && s.impute ? "mid" : void 0 });
      a && ia(r) && (o[a] = !0);
    }
    return o;
  }, {}), n = _A(i);
  if (n.length > 0) {
    const o = e ? "||" : "&&";
    return n.map((g) => boA(g, e)).join(` ${o} `);
  }
}
function WhA(A, e) {
  if (e !== void 0)
    return { [A]: sn(e) };
}
const aT = "voronoi", $3A = {
  defined: (A) => A.type === "point" && A.nearest,
  parse: (A, e) => {
    if (e.events)
      for (const t of e.events)
        t.markname = A.getName(aT);
  },
  marks: (A, e, t) => {
    const { x: i, y: n } = e.project.hasChannel, o = A.mark;
    if (jd(o))
      return PA(S5e(o)), t;
    const g = {
      name: A.getName(aT),
      type: "path",
      interactive: !0,
      from: { data: A.getName("marks") },
      encode: {
        update: {
          fill: { value: "transparent" },
          strokeWidth: { value: 0.35 },
          stroke: { value: "transparent" },
          isVoronoi: { value: !0 },
          ..._3A(A, { reactiveGeom: !0 })
        }
      },
      transform: [
        {
          type: "voronoi",
          x: { expr: i || !n ? "datum.datum.x || 0" : "0" },
          y: { expr: n || !i ? "datum.datum.y || 0" : "0" },
          size: [A.getSizeSignalRef("width"), A.getSizeSignalRef("height")]
        }
      ]
    };
    let s = 0, I = !1;
    return t.forEach((r, a) => {
      const C = r.name ?? "";
      C === A.component.mark[0].name ? s = a : C.indexOf(aT) >= 0 && (I = !0);
    }), I || t.splice(s + 1, 0, g), t;
  }
}, AUA = {
  defined: (A) => A.type === "point" && A.resolve === "global" && A.bind && A.bind !== "scales" && !HoA(A.bind),
  parse: (A, e, t) => IUA(e, t),
  topLevelSignals: (A, e, t) => {
    const i = e.name, n = e.project, o = e.bind, g = e.init && e.init[0], s = $3A.defined(e) ? "(item().isVoronoi ? datum.datum : datum)" : "datum";
    return n.items.forEach((I, r) => {
      const a = En(`${i}_${I.field}`);
      t.filter((C) => C.name === a).length || t.unshift({
        name: a,
        ...g ? { init: kp(g[r]) } : { value: null },
        on: e.events ? [
          {
            events: e.events,
            update: `datum && item().mark.marktype !== 'group' ? ${s}[${ie(I.field)}] : null`
          }
        ] : [],
        bind: o[I.field] ?? o[I.channel] ?? o
      });
    }), t;
  },
  signals: (A, e, t) => {
    const i = e.name, n = e.project, o = t.filter((r) => r.name === i + ad)[0], g = i + zF, s = n.items.map((r) => En(`${i}_${r.field}`)), I = s.map((r) => `${r} !== null`).join(" && ");
    return s.length && (o.update = `${I} ? {fields: ${g}, values: [${s.join(", ")}]} : null`), delete o.value, delete o.on, t;
  }
}, vZ = "_toggle", eUA = {
  defined: (A) => A.type === "point" && !!A.toggle,
  signals: (A, e, t) => t.concat({
    name: e.name + vZ,
    value: !1,
    on: [{ events: e.events, update: e.toggle }]
  }),
  modifyExpr: (A, e) => {
    const t = e.name + ad, i = e.name + vZ;
    return `${i} ? null : ${t}, ` + (e.resolve === "global" ? `${i} ? null : true, ` : `${i} ? null : {unit: ${Zm(A)}}, `) + `${i} ? ${t} : null`;
  }
}, dqe = {
  defined: (A) => A.clear !== void 0 && A.clear !== !1,
  parse: (A, e) => {
    e.clear && (e.clear = Be(e.clear) ? Ud(e.clear, "view") : e.clear);
  },
  topLevelSignals: (A, e, t) => {
    if (AUA.defined(e))
      for (const i of e.project.items) {
        const n = t.findIndex((o) => o.name === En(`${e.name}_${i.field}`));
        n !== -1 && t[n].on.push({ events: e.clear, update: "null" });
      }
    return t;
  },
  signals: (A, e, t) => {
    function i(n, o) {
      n !== -1 && t[n].on && t[n].on.push({ events: e.clear, update: o });
    }
    if (e.type === "interval")
      for (const n of e.project.items) {
        const o = t.findIndex((g) => g.name === n.signals.visual);
        if (i(o, "[0, 0]"), o === -1) {
          const g = t.findIndex((s) => s.name === n.signals.data);
          i(g, "null");
        }
      }
    else {
      let n = t.findIndex((o) => o.name === e.name + ad);
      i(n, "null"), eUA.defined(e) && (n = t.findIndex((o) => o.name === e.name + vZ), i(n, "false"));
    }
    return t;
  }
}, tUA = {
  defined: (A) => {
    const e = A.resolve === "global" && A.bind && HoA(A.bind), t = A.project.items.length === 1 && A.project.items[0].field !== bC;
    return e && !t && PA(K5e), e && t;
  },
  parse: (A, e, t) => {
    const i = tt(t);
    if (i.select = Be(i.select) ? { type: i.select, toggle: e.toggle } : { ...i.select, toggle: e.toggle }, IUA(e, i), ce(t.select) && (t.select.on || t.select.clear)) {
      const g = 'event.item && indexof(event.item.mark.role, "legend") < 0';
      for (const s of e.events)
        s.filter = Ce(s.filter ?? []), s.filter.includes(g) || s.filter.push(g);
    }
    const n = oT(e.bind) ? e.bind.legend : "click", o = Be(n) ? Ud(n, "view") : Ce(n);
    e.bind = { legend: { merge: o } };
  },
  topLevelSignals: (A, e, t) => {
    const i = e.name, n = oT(e.bind) && e.bind.legend, o = (g) => (s) => {
      const I = tt(s);
      return I.markname = g, I;
    };
    for (const g of e.project.items) {
      if (!g.hasLegend)
        continue;
      const s = `${En(g.field)}_legend`, I = `${i}_${s}`;
      if (t.filter((r) => r.name === I).length === 0) {
        const r = n.merge.map(o(`${s}_symbols`)).concat(n.merge.map(o(`${s}_labels`))).concat(n.merge.map(o(`${s}_entries`)));
        t.unshift({
          name: I,
          ...e.init ? {} : { value: null },
          on: [
            // Legend entries do not store values, so we need to walk the scenegraph to the symbol datum.
            {
              events: r,
              update: "isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",
              force: !0
            },
            { events: n.merge, update: `!event.item || !datum ? null : ${I}`, force: !0 }
          ]
        });
      }
    }
    return t;
  },
  signals: (A, e, t) => {
    const i = e.name, n = e.project, o = t.find((C) => C.name === i + ad), g = i + zF, s = n.items.filter((C) => C.hasLegend).map((C) => En(`${i}_${En(C.field)}_legend`)), I = `${s.map((C) => `${C} !== null`).join(" && ")} ? {fields: ${g}, values: [${s.join(", ")}]} : null`;
    e.events && s.length > 0 ? o.on.push({
      events: s.map((C) => ({ signal: C })),
      update: I
    }) : s.length > 0 && (o.update = I, delete o.value, delete o.on);
    const r = t.find((C) => C.name === i + vZ), a = oT(e.bind) && e.bind.legend;
    return r && (e.events ? r.on.push({ ...r.on[0], events: a }) : r.on[0].events = a), t;
  }
};
function hqe(A, e, t) {
  var i;
  const n = (i = A.fieldDef(e)) == null ? void 0 : i.field;
  for (const o of tg(A.component.selection ?? {})) {
    const g = o.project.hasField[n] ?? o.project.hasChannel[e];
    if (g && tUA.defined(o)) {
      const s = t.get("selections") ?? [];
      s.push(o.name), t.set("selections", s, !1), g.hasLegend = !0;
    }
  }
}
const iUA = "_translate_anchor", nUA = "_translate_delta", mqe = {
  defined: (A) => A.type === "interval" && A.translate,
  signals: (A, e, t) => {
    const i = e.name, n = $c.defined(e), o = i + iUA, { x: g, y: s } = e.project.hasChannel;
    let I = Ud(e.translate, "scope");
    return n || (I = I.map((r) => (r.between[0].markname = i + Ew, r))), t.push({
      name: o,
      value: {},
      on: [
        {
          events: I.map((r) => r.between[0]),
          update: "{x: x(unit), y: y(unit)" + (g !== void 0 ? `, extent_x: ${n ? hP(A, un) : `slice(${g.signals.visual})`}` : "") + (s !== void 0 ? `, extent_y: ${n ? hP(A, Vo) : `slice(${s.signals.visual})`}` : "") + "}"
        }
      ]
    }, {
      name: i + nUA,
      value: {},
      on: [
        {
          events: I,
          update: `{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`
        }
      ]
    }), g !== void 0 && KhA(A, e, g, "width", t), s !== void 0 && KhA(A, e, s, "height", t), t;
  }
};
function KhA(A, e, t, i, n) {
  const o = e.name, g = o + iUA, s = o + nUA, I = t.channel, r = $c.defined(e), a = n.filter((G) => G.name === t.signals[r ? "data" : "visual"])[0], C = A.getSizeSignalRef(i).signal, B = A.getScaleComponent(I), l = B && B.get("type"), Q = B && B.get("reverse"), E = r ? I === un ? Q ? "" : "-" : Q ? "-" : "" : "", d = `${g}.extent_${I}`, m = `${E}${s}.${I} / ${r ? `${C}` : `span(${d})`}`, y = !r || !B ? "panLinear" : l === "log" ? "panLog" : l === "symlog" ? "panSymlog" : l === "pow" ? "panPow" : "panLinear", f = r ? l === "pow" ? `, ${B.get("exponent") ?? 1}` : l === "symlog" ? `, ${B.get("constant") ?? 1}` : "" : "", w = `${y}(${d}, ${m}${f})`;
  a.on.push({
    events: { signal: s },
    update: r ? w : `clampRange(${w}, 0, ${C})`
  });
}
const oUA = "_zoom_anchor", gUA = "_zoom_delta", pqe = {
  defined: (A) => A.type === "interval" && A.zoom,
  signals: (A, e, t) => {
    const i = e.name, n = $c.defined(e), o = i + gUA, { x: g, y: s } = e.project.hasChannel, I = ie(A.scaleName(un)), r = ie(A.scaleName(Vo));
    let a = Ud(e.zoom, "scope");
    return n || (a = a.map((C) => (C.markname = i + Ew, C))), t.push({
      name: i + oUA,
      on: [
        {
          events: a,
          update: n ? "{" + [I ? `x: invert(${I}, x(unit))` : "", r ? `y: invert(${r}, y(unit))` : ""].filter((C) => C).join(", ") + "}" : "{x: x(unit), y: y(unit)}"
        }
      ]
    }, {
      name: o,
      on: [
        {
          events: a,
          force: !0,
          update: "pow(1.001, event.deltaY * pow(16, event.deltaMode))"
        }
      ]
    }), g !== void 0 && UhA(A, e, g, "width", t), s !== void 0 && UhA(A, e, s, "height", t), t;
  }
};
function UhA(A, e, t, i, n) {
  const o = e.name, g = t.channel, s = $c.defined(e), I = n.filter((y) => y.name === t.signals[s ? "data" : "visual"])[0], r = A.getSizeSignalRef(i).signal, a = A.getScaleComponent(g), C = a && a.get("type"), B = s ? hP(A, g) : I.name, l = o + gUA, Q = `${o}${oUA}.${g}`, E = !s || !a ? "zoomLinear" : C === "log" ? "zoomLog" : C === "symlog" ? "zoomSymlog" : C === "pow" ? "zoomPow" : "zoomLinear", d = s ? C === "pow" ? `, ${a.get("exponent") ?? 1}` : C === "symlog" ? `, ${a.get("constant") ?? 1}` : "" : "", m = `${E}(${B}, ${Q}, ${l}${d})`;
  I.on.push({
    events: { signal: l },
    update: s ? m : `clampRange(${m}, 0, ${r})`
  });
}
const Jp = "_store", ad = "_tuple", yqe = "_modify", sUA = "vlSelectionResolve", xV = [
  eqe,
  $4e,
  j4e,
  eUA,
  // Bindings may disable direct manipulation.
  AUA,
  $c,
  tUA,
  dqe,
  mqe,
  pqe,
  $3A
];
function bqe(A) {
  let e = A.parent;
  for (; e && !rC(e); )
    e = e.parent;
  return e;
}
function Zm(A, { escape: e } = { escape: !0 }) {
  let t = e ? ie(A.name) : A.name;
  const i = bqe(A);
  if (i) {
    const { facet: n } = i;
    for (const o of Ua)
      n[o] && (t += ` + '__facet_${o}_' + (facet[${ie(i.vgField(o))}])`);
  }
  return t;
}
function qoA(A) {
  return tg(A.component.selection ?? {}).reduce((e, t) => e || t.project.hasSelectionId, !1);
}
function IUA(A, e) {
  (Be(e.select) || !e.select.on) && delete A.events, (Be(e.select) || !e.select.clear) && delete A.clear, (Be(e.select) || !e.select.toggle) && delete A.toggle;
}
function mP(A) {
  const e = [];
  return A.type === "Identifier" ? [A.name] : A.type === "Literal" ? [A.value] : (A.type === "MemberExpression" && (e.push(...mP(A.object)), e.push(...mP(A.property))), e);
}
function aUA(A) {
  return A.object.type === "MemberExpression" ? aUA(A.object) : A.object.name === "datum";
}
function rUA(A) {
  const e = cnA(A), t = /* @__PURE__ */ new Set();
  return e.visit((i) => {
    i.type === "MemberExpression" && aUA(i) && t.add(mP(i).slice(1).join("."));
  }), t;
}
class sG extends Yi {
  clone() {
    return new sG(null, this.model, tt(this.filter));
  }
  constructor(e, t, i) {
    super(e), this.model = t, this.filter = i, this.expr = HZ(this.model, this.filter, this), this._dependentFields = rUA(this.expr);
  }
  dependentFields() {
    return this._dependentFields;
  }
  producedFields() {
    return /* @__PURE__ */ new Set();
  }
  assemble() {
    return {
      type: "filter",
      expr: this.expr
    };
  }
  hash() {
    return `Filter ${this.expr}`;
  }
}
function wqe(A, e) {
  const t = {}, i = A.config.selection;
  if (!e || !e.length)
    return t;
  for (const n of e) {
    const o = En(n.name), g = n.select, s = Be(g) ? g : g.type, I = ce(g) ? tt(g) : { type: s }, r = i[s];
    for (const B in r)
      B === "fields" || B === "encodings" || (B === "mark" && (I[B] = { ...r[B], ...I[B] }), (I[B] === void 0 || I[B] === !0) && (I[B] = tt(r[B] ?? I[B])));
    const a = t[o] = {
      ...I,
      name: o,
      type: s,
      init: n.value,
      bind: n.bind,
      events: Be(I.on) ? Ud(I.on, "scope") : Ce(tt(I.on))
    }, C = tt(n);
    for (const B of xV)
      B.defined(a) && B.parse && B.parse(A, a, C);
  }
  return t;
}
function CUA(A, e, t, i = "datum") {
  const n = Be(e) ? e : e.param, o = En(n), g = ie(o + Jp);
  let s;
  try {
    s = A.getSelectionComponent(o, n);
  } catch {
    return `!!${o}`;
  }
  if (s.project.timeUnit) {
    const B = t ?? A.component.data.raw, l = s.project.timeUnit.clone();
    B.parent ? l.insertAsParentOf(B) : B.parent = l;
  }
  const I = s.project.hasSelectionId ? "vlSelectionIdTest(" : "vlSelectionTest(", r = s.resolve === "global" ? ")" : `, ${ie(s.resolve)})`, a = `${I}${g}, ${i}${r}`, C = `length(data(${g}))`;
  return e.empty === !1 ? `${C} && ${a}` : `!${C} || ${a}`;
}
function BUA(A, e, t) {
  const i = En(e), n = t.encoding;
  let o = t.field, g;
  try {
    g = A.getSelectionComponent(i, e);
  } catch {
    return i;
  }
  if (!n && !o)
    o = g.project.items[0].field, g.project.items.length > 1 && PA(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${ie(o)}.`);
  else if (n && !o) {
    const s = g.project.items.filter((I) => I.channel === n);
    !s.length || s.length > 1 ? (o = g.project.items[0].field, PA((s.length ? "Multiple " : "No ") + `matching ${ie(n)} encoding found for selection ${ie(t.param)}. Using "field": ${ie(o)}.`)) : o = s[0].field;
  }
  return `${g.name}[${ie(Ir(o))}]`;
}
function fqe(A, e) {
  for (const [t, i] of nd(A.component.selection ?? {})) {
    const n = A.getName(`lookup_${t}`);
    A.component.data.outputNodes[n] = i.materialized = new Is(new sG(e, A, { param: t }), n, Ti.Lookup, A.component.data.outputNodeRefCounts);
  }
}
function HZ(A, e, t) {
  return YN(e, (i) => Be(i) ? i : tTe(i) ? CUA(A, i, t) : kKA(i));
}
function Dqe(A, e) {
  if (A)
    return ZA(A) && !LE(A) ? A.map((t) => JoA(t, e)).join(", ") : A;
}
function rT(A, e, t, i) {
  var n, o;
  A.encode ?? (A.encode = {}), (n = A.encode)[e] ?? (n[e] = {}), (o = A.encode[e]).update ?? (o.update = {}), A.encode[e].update[t] = i;
}
function HJ(A, e, t, i = { header: !1 }) {
  var n, o;
  const { disable: g, orient: s, scale: I, labelExpr: r, title: a, zindex: C, ...B } = A.combine();
  if (!g) {
    for (const l in B) {
      const Q = o_e[l], E = B[l];
      if (Q && Q !== e && Q !== "both")
        delete B[l];
      else if (XF(E)) {
        const { condition: d, ...m } = E, y = Ce(d), f = uhA[l];
        if (f) {
          const { vgProp: w, part: G } = f, R = [
            ...y.map((F) => {
              const { test: Z, ...c } = F;
              return {
                test: HZ(null, Z),
                ...c
              };
            }),
            m
          ];
          rT(B, G, w, R), delete B[l];
        } else if (f === null) {
          const w = {
            signal: y.map((G) => {
              const { test: R, ...F } = G;
              return `${HZ(null, R)} ? ${ehA(F)} : `;
            }).join("") + ehA(m)
          };
          B[l] = w;
        }
      } else if (ke(E)) {
        const d = uhA[l];
        if (d) {
          const { vgProp: m, part: y } = d;
          rT(B, y, m, E), delete B[l];
        }
      }
      Ht(["labelAlign", "labelBaseline"], l) && B[l] === null && delete B[l];
    }
    if (e === "grid") {
      if (!B.grid)
        return;
      if (B.encode) {
        const { grid: l } = B.encode;
        B.encode = {
          ...l ? { grid: l } : {}
        }, Fi(B.encode) && delete B.encode;
      }
      return {
        scale: I,
        orient: s,
        ...B,
        domain: !1,
        labels: !1,
        aria: !1,
        // Always set min/maxExtent to 0 to ensure that `config.axis*.minExtent` and `config.axis*.maxExtent`
        // would not affect gridAxis
        maxExtent: 0,
        minExtent: 0,
        ticks: !1,
        zindex: _n(C, 0)
        // put grid behind marks by default
      };
    } else {
      if (!i.header && A.mainExtracted)
        return;
      if (r !== void 0) {
        let Q = r;
        (o = (n = B.encode) == null ? void 0 : n.labels) != null && o.update && ke(B.encode.labels.update.text) && (Q = yp(r, "datum.label", B.encode.labels.update.text.signal)), rT(B, "labels", "text", { signal: Q });
      }
      if (B.labelAlign === null && delete B.labelAlign, B.encode) {
        for (const Q of n3A)
          A.hasAxisPart(Q) || delete B.encode[Q];
        Fi(B.encode) && delete B.encode;
      }
      const l = Dqe(a, t);
      return {
        scale: I,
        orient: s,
        grid: !1,
        ...l ? { title: l } : {},
        ...B,
        ...t.aria === !1 ? { aria: !1 } : {},
        zindex: _n(C, 0)
        // put axis line above marks by default
      };
    }
  }
}
function lUA(A) {
  const { axes: e } = A.component, t = [];
  for (const i of Ml)
    if (e[i]) {
      for (const n of e[i])
        if (!n.get("disable") && !n.get("gridScale")) {
          const o = i === "x" ? "height" : "width", g = A.getSizeSignalRef(o).signal;
          o !== g && t.push({
            name: o,
            update: g
          });
        }
    }
  return t;
}
function Gqe(A, e) {
  const { x: t = [], y: i = [] } = A;
  return [
    ...t.map((n) => HJ(n, "grid", e)),
    ...i.map((n) => HJ(n, "grid", e)),
    ...t.map((n) => HJ(n, "main", e)),
    ...i.map((n) => HJ(n, "main", e))
  ].filter((n) => n);
}
function VhA(A, e, t, i) {
  return Object.assign.apply(null, [
    {},
    ...A.map((n) => {
      if (n === "axisOrient") {
        const o = t === "x" ? "bottom" : "left", g = e[t === "x" ? "axisBottom" : "axisLeft"] || {}, s = e[t === "x" ? "axisTop" : "axisRight"] || {}, I = /* @__PURE__ */ new Set([..._A(g), ..._A(s)]), r = {};
        for (const a of I.values())
          r[a] = {
            // orient is surely signal in this case
            signal: `${i.signal} === "${o}" ? ${Or(g[a])} : ${Or(s[a])}`
          };
        return r;
      }
      return e[n];
    })
  ]);
}
function kqe(A, e, t, i) {
  const n = e === "band" ? ["axisDiscrete", "axisBand"] : e === "point" ? ["axisDiscrete", "axisPoint"] : RKA(e) ? ["axisQuantitative"] : e === "time" || e === "utc" ? ["axisTemporal"] : [], o = A === "x" ? "axisX" : "axisY", g = ke(t) ? "axisOrient" : `axis${xF(t)}`, s = [
    // technically Vega does have axisBand, but if we make another separation here,
    // it will further introduce complexity in the code
    ...n,
    ...n.map((r) => o + r.substr(4))
  ], I = ["axis", g, o];
  return {
    vlOnlyAxisConfig: VhA(s, i, A, t),
    vgAxisConfig: VhA(I, i, A, t),
    axisConfigStyle: Jqe([...I, ...s], i)
  };
}
function Jqe(A, e) {
  var t;
  const i = [{}];
  for (const n of A) {
    let o = (t = e[n]) == null ? void 0 : t.style;
    if (o) {
      o = Ce(o);
      for (const g of o)
        i.push(e.style[g]);
    }
  }
  return Object.assign.apply(null, i);
}
function pP(A, e, t, i = {}) {
  var n;
  const o = gKA(A, t, e);
  if (o !== void 0)
    return {
      configFrom: "style",
      configValue: o
    };
  for (const g of ["vlOnlyAxisConfig", "vgAxisConfig", "axisConfigStyle"])
    if (((n = i[g]) == null ? void 0 : n[A]) !== void 0)
      return { configFrom: g, configValue: i[g][A] };
  return {};
}
const XhA = {
  scale: ({ model: A, channel: e }) => A.scaleName(e),
  format: ({ format: A }) => A,
  formatType: ({ formatType: A }) => A,
  grid: ({ fieldOrDatumDef: A, axis: e, scaleType: t }) => e.grid ?? Nqe(t, A),
  gridScale: ({ model: A, channel: e }) => Yqe(A, e),
  labelAlign: ({ axis: A, labelAngle: e, orient: t, channel: i }) => A.labelAlign || QUA(e, t, i),
  labelAngle: ({ labelAngle: A }) => A,
  labelBaseline: ({ axis: A, labelAngle: e, orient: t, channel: i }) => A.labelBaseline || cUA(e, t, i),
  labelFlush: ({ axis: A, fieldOrDatumDef: e, channel: t }) => A.labelFlush ?? Fqe(e.type, t),
  labelOverlap: ({ axis: A, fieldOrDatumDef: e, scaleType: t }) => A.labelOverlap ?? Mqe(e.type, t, jA(e) && !!e.timeUnit, jA(e) ? e.sort : void 0),
  // we already calculate orient in parse
  orient: ({ orient: A }) => A,
  tickCount: ({ channel: A, model: e, axis: t, fieldOrDatumDef: i, scaleType: n }) => {
    const o = A === "x" ? "width" : A === "y" ? "height" : void 0, g = o ? e.getSizeSignalRef(o) : void 0;
    return t.tickCount ?? Lqe({ fieldOrDatumDef: i, scaleType: n, size: g, values: t.values });
  },
  tickMinStep: vqe,
  title: ({ axis: A, model: e, channel: t }) => {
    if (A.title !== void 0)
      return A.title;
    const i = EUA(e, t);
    if (i !== void 0)
      return i;
    const n = e.typedFieldDef(t), o = t === "x" ? "x2" : "y2", g = e.fieldDef(o);
    return IKA(n ? [QhA(n)] : [], jA(g) ? [QhA(g)] : []);
  },
  values: ({ axis: A, fieldOrDatumDef: e }) => Hqe(A, e),
  zindex: ({ axis: A, fieldOrDatumDef: e, mark: t }) => A.zindex ?? Sqe(t, e)
};
function Nqe(A, e) {
  return !Wo(A) && jA(e) && !Oi(e == null ? void 0 : e.bin) && !qo(e == null ? void 0 : e.bin);
}
function Yqe(A, e) {
  const t = e === "x" ? "y" : "x";
  if (A.getScaleComponent(t))
    return A.scaleName(t);
}
function Rqe(A, e, t, i, n) {
  const o = e == null ? void 0 : e.labelAngle;
  if (o !== void 0)
    return ke(o) ? o : Q2(o);
  {
    const { configValue: g } = pP("labelAngle", i, e == null ? void 0 : e.style, n);
    return g !== void 0 ? Q2(g) : t === un && Ht([doA, uoA], A.type) && !(jA(A) && A.timeUnit) ? 270 : void 0;
  }
}
function yP(A) {
  return `(((${A.signal} % 360) + 360) % 360)`;
}
function cUA(A, e, t, i) {
  if (A !== void 0)
    if (t === "x") {
      if (ke(A)) {
        const n = yP(A), o = ke(e) ? `(${e.signal} === "top")` : e === "top";
        return {
          signal: `(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${o} ? "bottom" : "top"`
        };
      }
      if (45 < A && A < 135 || 225 < A && A < 315)
        return "middle";
      if (ke(e)) {
        const n = A <= 45 || 315 <= A ? "===" : "!==";
        return { signal: `${e.signal} ${n} "top" ? "bottom" : "top"` };
      }
      return (A <= 45 || 315 <= A) == (e === "top") ? "bottom" : "top";
    } else {
      if (ke(A)) {
        const n = yP(A), o = ke(e) ? `(${e.signal} === "left")` : e === "left";
        return {
          signal: `${n} <= 45 || 315 <= ${n} || (135 <= ${n} && ${n} <= 225) ? ${i ? '"middle"' : "null"} : (45 <= ${n} && ${n} <= 135) === ${o} ? "top" : "bottom"`
        };
      }
      if (A <= 45 || 315 <= A || 135 <= A && A <= 225)
        return i ? "middle" : null;
      if (ke(e)) {
        const n = 45 <= A && A <= 135 ? "===" : "!==";
        return { signal: `${e.signal} ${n} "left" ? "top" : "bottom"` };
      }
      return (45 <= A && A <= 135) == (e === "left") ? "top" : "bottom";
    }
}
function QUA(A, e, t) {
  if (A === void 0)
    return;
  const i = t === "x", n = i ? 0 : 90, o = i ? "bottom" : "left";
  if (ke(A)) {
    const g = yP(A), s = ke(e) ? `(${e.signal} === "${o}")` : e === o;
    return {
      signal: `(${n ? `(${g} + 90)` : g} % 180 === 0) ? ${i ? null : '"center"'} :(${n} < ${g} && ${g} < ${180 + n}) === ${s} ? "left" : "right"`
    };
  }
  if ((A + n) % 180 === 0)
    return i ? null : "center";
  if (ke(e)) {
    const g = n < A && A < 180 + n ? "===" : "!==";
    return {
      signal: `${`${e.signal} ${g} "${o}"`} ? "left" : "right"`
    };
  }
  return (n < A && A < 180 + n) == (e === o) ? "left" : "right";
}
function Fqe(A, e) {
  if (e === "x" && Ht(["quantitative", "temporal"], A))
    return !0;
}
function Mqe(A, e, t, i) {
  if (t && !ce(i) || A !== "nominal" && A !== "ordinal")
    return e === "log" || e === "symlog" ? "greedy" : !0;
}
function xqe(A) {
  return A === "x" ? "bottom" : "left";
}
function Lqe({ fieldOrDatumDef: A, scaleType: e, size: t, values: i }) {
  var n;
  if (!i && !Wo(e) && e !== "log") {
    if (jA(A)) {
      if (Oi(A.bin))
        return { signal: `ceil(${t.signal}/10)` };
      if (A.timeUnit && Ht(["month", "hours", "day", "quarter"], (n = vo(A.timeUnit)) == null ? void 0 : n.unit))
        return;
    }
    return { signal: `ceil(${t.signal}/40)` };
  }
}
function vqe({ format: A, fieldOrDatumDef: e }) {
  if (A === "d")
    return 1;
  if (jA(e)) {
    const { timeUnit: t } = e;
    if (t) {
      const i = fKA(t);
      if (i)
        return { signal: i };
    }
  }
}
function EUA(A, e) {
  const t = e === "x" ? "x2" : "y2", i = A.fieldDef(e), n = A.fieldDef(t), o = i ? i.title : void 0, g = n ? n.title : void 0;
  if (o && g)
    return aKA(o, g);
  if (o)
    return o;
  if (g)
    return g;
  if (o !== void 0)
    return o;
  if (g !== void 0)
    return g;
}
function Hqe(A, e) {
  const t = A.values;
  if (ZA(t))
    return i3A(e, t);
  if (ke(t))
    return t;
}
function Sqe(A, e) {
  return A === "rect" && NZ(e) ? 1 : 0;
}
class Vf extends Yi {
  clone() {
    return new Vf(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t, this._dependentFields = rUA(this.transform.calculate);
  }
  static parseAllForSortIndex(e, t) {
    return t.forEachFieldDef((i, n) => {
      if (d0(i) && TKA(i.sort)) {
        const { field: o, timeUnit: g } = i, s = i.sort, I = s.map((r, a) => `${kKA({ field: o, timeUnit: g, equal: r })} ? ${a} : `).join("") + s.length;
        e = new Vf(e, {
          calculate: I,
          as: Xf(i, n, { forAs: !0 })
        });
      }
    }), e;
  }
  producedFields() {
    return /* @__PURE__ */ new Set([this.transform.as]);
  }
  dependentFields() {
    return this._dependentFields;
  }
  assemble() {
    return {
      type: "formula",
      expr: this.transform.calculate,
      as: this.transform.as
    };
  }
  hash() {
    return `Calculate ${vt(this.transform)}`;
  }
}
function Xf(A, e, t) {
  return se(A, { prefix: e, suffix: "sort_index", ...t ?? {} });
}
function LV(A, e) {
  return Ht(["top", "bottom"], e) ? "column" : Ht(["left", "right"], e) || A === "row" ? "row" : "column";
}
function zf(A, e, t, i) {
  const n = i === "row" ? t.headerRow : i === "column" ? t.headerColumn : t.headerFacet;
  return _n((e || {})[A], n[A], t.header[A]);
}
function vV(A, e, t, i) {
  const n = {};
  for (const o of A) {
    const g = zf(o, e || {}, t, i);
    g !== void 0 && (n[o] = g);
  }
  return n;
}
const OoA = ["row", "column"], joA = ["header", "footer"];
function Zqe(A, e) {
  const t = A.component.layoutHeaders[e].title, i = A.config ? A.config : void 0, n = A.component.layoutHeaders[e].facetFieldDef ? A.component.layoutHeaders[e].facetFieldDef : void 0, { titleAnchor: o, titleAngle: g, titleOrient: s } = vV(["titleAnchor", "titleAngle", "titleOrient"], n.header, i, e), I = LV(e, s), r = Q2(g);
  return {
    name: `${e}-title`,
    type: "group",
    role: `${I}-title`,
    title: {
      text: t,
      ...e === "row" ? { orient: "left" } : {},
      style: "guide-title",
      ...dUA(r, I),
      ...uUA(I, r, o),
      ...hUA(i, n, e, G_e, p3A)
    }
  };
}
function uUA(A, e, t = "middle") {
  switch (t) {
    case "start":
      return { align: "left" };
    case "end":
      return { align: "right" };
  }
  const i = QUA(e, A === "row" ? "left" : "top", A === "row" ? "y" : "x");
  return i ? { align: i } : {};
}
function dUA(A, e) {
  const t = cUA(A, e === "row" ? "left" : "top", e === "row" ? "y" : "x", !0);
  return t ? { baseline: t } : {};
}
function Wqe(A, e) {
  const t = A.component.layoutHeaders[e], i = [];
  for (const n of joA)
    if (t[n])
      for (const o of t[n]) {
        const g = Uqe(A, e, n, t, o);
        g != null && i.push(g);
      }
  return i;
}
function Kqe(A, e) {
  const { sort: t } = A;
  return OB(t) ? {
    field: se(t, { expr: "datum" }),
    order: t.order ?? "ascending"
  } : ZA(t) ? {
    field: Xf(A, e, { expr: "datum" }),
    order: "ascending"
  } : {
    field: se(A, { expr: "datum" }),
    order: t ?? "ascending"
  };
}
function bP(A, e, t) {
  const { format: i, formatType: n, labelAngle: o, labelAnchor: g, labelOrient: s, labelExpr: I } = vV(["format", "formatType", "labelAngle", "labelAnchor", "labelOrient", "labelExpr"], A.header, t, e), r = foA({
    fieldOrDatumDef: A,
    format: i,
    formatType: n,
    expr: "parent",
    config: t
  }).signal, a = LV(e, s);
  return {
    text: {
      signal: I ? yp(yp(I, "datum.label", r), "datum.value", se(A, { expr: "parent" })) : r
    },
    ...e === "row" ? { orient: "left" } : {},
    style: "guide-label",
    frame: "group",
    ...dUA(o, a),
    ...uUA(a, o, g),
    ...hUA(t, A, e, k_e, y3A)
  };
}
function Uqe(A, e, t, i, n) {
  if (n) {
    let o = null;
    const { facetFieldDef: g } = i, s = A.config ? A.config : void 0;
    if (g && n.labels) {
      const { labelOrient: C } = vV(["labelOrient"], g.header, s, e);
      (e === "row" && !Ht(["top", "bottom"], C) || e === "column" && !Ht(["left", "right"], C)) && (o = bP(g, e, s));
    }
    const I = rC(A) && !KF(A.facet), r = n.axes, a = (r == null ? void 0 : r.length) > 0;
    if (o || a) {
      const C = e === "row" ? "height" : "width";
      return {
        name: A.getName(`${e}_${t}`),
        type: "group",
        role: `${e}-${t}`,
        ...i.facetFieldDef ? {
          from: { data: A.getName(`${e}_domain`) },
          sort: Kqe(g, e)
        } : {},
        ...a && I ? {
          from: { data: A.getName(`facet_domain_${e}`) }
        } : {},
        ...o ? { title: o } : {},
        ...n.sizeSignal ? {
          encode: {
            update: {
              [C]: n.sizeSignal
            }
          }
        } : {},
        ...a ? { axes: r } : {}
      };
    }
  }
  return null;
}
const Vqe = {
  column: {
    start: 0,
    end: 1
  },
  row: {
    start: 1,
    end: 0
  }
};
function Xqe(A, e) {
  return Vqe[e][A];
}
function zqe(A, e) {
  const t = {};
  for (const i of Ua) {
    const n = A[i];
    if (n != null && n.facetFieldDef) {
      const { titleAnchor: o, titleOrient: g } = vV(["titleAnchor", "titleOrient"], n.facetFieldDef.header, e, i), s = LV(i, g), I = Xqe(o, s);
      I !== void 0 && (t[s] = I);
    }
  }
  return Fi(t) ? void 0 : t;
}
function hUA(A, e, t, i, n) {
  const o = {};
  for (const g of i) {
    if (!n[g])
      continue;
    const s = zf(g, e == null ? void 0 : e.header, A, t);
    s !== void 0 && (o[n[g]] = s);
  }
  return o;
}
function PoA(A) {
  return [
    ...mx(A, "width"),
    ...mx(A, "height"),
    ...mx(A, "childWidth"),
    ...mx(A, "childHeight")
  ];
}
function mx(A, e) {
  const t = e === "width" ? "x" : "y", i = A.component.layoutSize.get(e);
  if (!i || i === "merged")
    return [];
  const n = A.getSizeSignalRef(e).signal;
  if (i === "step") {
    const o = A.getScaleComponent(t);
    if (o) {
      const g = o.get("type"), s = o.get("range");
      if (Wo(g) && Od(s)) {
        const I = A.scaleName(t);
        return rC(A.parent) && A.parent.component.resolve.scale[t] === "independent" ? [zhA(I, s)] : [
          zhA(I, s),
          {
            name: n,
            update: mUA(I, o, `domain('${I}').length`)
          }
        ];
      }
    }
    throw new Error("layout size is step although width/height is not step.");
  } else if (i == "container") {
    const o = n.endsWith("width"), g = o ? "containerSize()[0]" : "containerSize()[1]", s = QP(A.config.view, o ? "width" : "height"), I = `isFinite(${g}) ? ${g} : ${s}`;
    return [{ name: n, init: I, on: [{ update: I, events: "window:resize" }] }];
  } else
    return [
      {
        name: n,
        value: i
      }
    ];
}
function zhA(A, e) {
  const t = `${A}_step`;
  return ke(e.step) ? { name: t, update: e.step.signal } : { name: t, value: e.step };
}
function mUA(A, e, t) {
  const i = e.get("type"), n = e.get("padding"), o = _n(e.get("paddingOuter"), n);
  let g = e.get("paddingInner");
  return g = i === "band" ? (
    // only band has real paddingInner
    g !== void 0 ? g : n
  ) : (
    // For point, as calculated in https://github.com/vega/vega-scale/blob/master/src/band.js#L128,
    // it's equivalent to have paddingInner = 1 since there is only n-1 steps between n points.
    1
  ), `bandspace(${t}, ${Or(g)}, ${Or(o)}) * ${A}_step`;
}
function pUA(A) {
  return A === "childWidth" ? "width" : A === "childHeight" ? "height" : A;
}
function yUA(A, e) {
  return _A(A).reduce((t, i) => {
    const n = A[i];
    return {
      ...t,
      ...gG(e, n, i, (o) => sn(o.value))
    };
  }, {});
}
function bUA(A, e) {
  if (rC(e))
    return A === "theta" ? "independent" : "shared";
  if (rG(e))
    return "shared";
  if (ogA(e))
    return qn(A) || A === "theta" || A === "radius" ? "independent" : "shared";
  throw new Error("invalid model type for resolve");
}
function $oA(A, e) {
  const t = A.scale[e], i = qn(e) ? "axis" : "legend";
  return t === "independent" ? (A[i][e] === "shared" && PA(wze(e)), "independent") : A[i][e] || "shared";
}
const Tqe = {
  ...Y_e,
  disable: 1,
  labelExpr: 1,
  selections: 1,
  // channel scales
  opacity: 1,
  shape: 1,
  stroke: 1,
  fill: 1,
  size: 1,
  strokeWidth: 1,
  strokeDash: 1,
  // encode
  encode: 1
}, wUA = _A(Tqe);
class _qe extends VQ {
}
const ThA = {
  symbols: qqe,
  gradient: Oqe,
  labels: jqe,
  entries: Pqe
};
function qqe(A, { fieldOrDatumDef: e, model: t, channel: i, legendCmpt: n, legendType: o }) {
  if (o !== "symbol")
    return;
  const { markDef: g, encoding: s, config: I, mark: r } = t, a = g.filled && r !== "trail";
  let C = {
    ...L5e({}, t, GTe),
    ...O3A(t, { filled: a })
  };
  const B = n.get("symbolOpacity") ?? I.legend.symbolOpacity, l = n.get("symbolFillColor") ?? I.legend.symbolFillColor, Q = n.get("symbolStrokeColor") ?? I.legend.symbolStrokeColor, E = B === void 0 ? fUA(s.opacity) ?? g.opacity : void 0;
  if (C.fill) {
    if (i === "fill" || a && i === js)
      delete C.fill;
    else if (C.fill.field)
      l ? delete C.fill : (C.fill = sn(I.legend.symbolBaseFillColor ?? "black"), C.fillOpacity = sn(E ?? 1));
    else if (ZA(C.fill)) {
      const d = wP(s.fill ?? s.color) ?? g.fill ?? (a && g.color);
      d && (C.fill = sn(d));
    }
  }
  if (C.stroke) {
    if (i === "stroke" || !a && i === js)
      delete C.stroke;
    else if (C.stroke.field || Q)
      delete C.stroke;
    else if (ZA(C.stroke)) {
      const d = _n(wP(s.stroke || s.color), g.stroke, a ? g.color : void 0);
      d && (C.stroke = { value: d });
    }
  }
  if (i !== WQ) {
    const d = jA(e) && GUA(t, n, e);
    d ? C.opacity = [
      { test: d, ...sn(E ?? 1) },
      sn(I.legend.unselectedOpacity)
    ] : E && (C.opacity = sn(E));
  }
  return C = { ...C, ...A }, Fi(C) ? void 0 : C;
}
function Oqe(A, { model: e, legendType: t, legendCmpt: i }) {
  if (t !== "gradient")
    return;
  const { config: n, markDef: o, encoding: g } = e;
  let s = {};
  const I = (i.get("gradientOpacity") ?? n.legend.gradientOpacity) === void 0 ? fUA(g.opacity) || o.opacity : void 0;
  return I && (s.opacity = sn(I)), s = { ...s, ...A }, Fi(s) ? void 0 : s;
}
function jqe(A, { fieldOrDatumDef: e, model: t, channel: i, legendCmpt: n }) {
  const o = t.legend(i) || {}, g = t.config, s = jA(e) ? GUA(t, n, e) : void 0, I = s ? [{ test: s, value: 1 }, { value: g.legend.unselectedOpacity }] : void 0, { format: r, formatType: a } = o;
  let C;
  Gp(a) ? C = Pr({
    fieldOrDatumDef: e,
    field: "datum.value",
    format: r,
    formatType: a,
    config: g
  }) : r === void 0 && a === void 0 && g.customFormatTypes && (e.type === "quantitative" && g.numberFormatType ? C = Pr({
    fieldOrDatumDef: e,
    field: "datum.value",
    format: g.numberFormat,
    formatType: g.numberFormatType,
    config: g
  }) : e.type === "temporal" && g.timeFormatType && jA(e) && e.timeUnit === void 0 && (C = Pr({
    fieldOrDatumDef: e,
    field: "datum.value",
    format: g.timeFormat,
    formatType: g.timeFormatType,
    config: g
  })));
  const B = {
    ...I ? { opacity: I } : {},
    ...C ? { text: C } : {},
    ...A
  };
  return Fi(B) ? void 0 : B;
}
function Pqe(A, { legendCmpt: e }) {
  const t = e.get("selections");
  return t != null && t.length ? { ...A, fill: { value: "transparent" } } : A;
}
function fUA(A) {
  return DUA(A, (e, t) => Math.max(e, t.value));
}
function wP(A) {
  return DUA(A, (e, t) => _n(e, t.value));
}
function DUA(A, e) {
  if (TTe(A))
    return Ce(A.condition).reduce(e, A.value);
  if (yC(A))
    return A.value;
}
function GUA(A, e, t) {
  const i = e.get("selections");
  if (!(i != null && i.length))
    return;
  const n = ie(t.field);
  return i.map((o) => `(!length(data(${ie(En(o) + Jp)})) || (${o}[${n}] && indexof(${o}[${n}], datum.value) >= 0))`).join(" || ");
}
const _hA = {
  direction: ({ direction: A }) => A,
  format: ({ fieldOrDatumDef: A, legend: e, config: t }) => {
    const { format: i, formatType: n } = e;
    return UKA(A, A.type, i, n, t, !1);
  },
  formatType: ({ legend: A, fieldOrDatumDef: e, scaleType: t }) => {
    const { formatType: i } = A;
    return VKA(i, e, t);
  },
  gradientLength: (A) => {
    const { legend: e, legendConfig: t } = A;
    return e.gradientLength ?? t.gradientLength ?? oOe(A);
  },
  labelOverlap: ({ legend: A, legendConfig: e, scaleType: t }) => A.labelOverlap ?? e.labelOverlap ?? gOe(t),
  symbolType: ({ legend: A, markDef: e, channel: t, encoding: i }) => A.symbolType ?? AOe(e.type, t, i.shape, e.shape),
  title: ({ fieldOrDatumDef: A, config: e }) => Qw(A, e, { allowDisabling: !0 }),
  type: ({ legendType: A, scaleType: e, channel: t }) => {
    if (cw(t) && jr(e)) {
      if (A === "gradient")
        return;
    } else if (A === "symbol")
      return;
    return A;
  },
  values: ({ fieldOrDatumDef: A, legend: e }) => $qe(e, A)
};
function $qe(A, e) {
  const t = A.values;
  if (ZA(t))
    return i3A(e, t);
  if (ke(t))
    return t;
}
function AOe(A, e, t, i) {
  if (e !== "shape") {
    const n = wP(t) ?? i;
    if (n)
      return n;
  }
  switch (A) {
    case "bar":
    case "rect":
    case "image":
    case "square":
      return "square";
    case "line":
    case "trail":
    case "rule":
      return "stroke";
    case "arc":
    case "point":
    case "circle":
    case "tick":
    case "geoshape":
    case "area":
    case "text":
      return "circle";
  }
}
function eOe(A) {
  const { legend: e } = A;
  return _n(e.type, tOe(A));
}
function tOe({ channel: A, timeUnit: e, scaleType: t }) {
  if (cw(A)) {
    if (Ht(["quarter", "month", "day"], e))
      return "symbol";
    if (jr(t))
      return "gradient";
  }
  return "symbol";
}
function iOe({ legendConfig: A, legendType: e, orient: t, legend: i }) {
  return i.direction ?? A[e ? "gradientDirection" : "symbolDirection"] ?? nOe(t, e);
}
function nOe(A, e) {
  switch (A) {
    case "top":
    case "bottom":
      return "horizontal";
    case "left":
    case "right":
    case "none":
    case void 0:
      return;
    default:
      return e === "gradient" ? "horizontal" : void 0;
  }
}
function oOe({ legendConfig: A, model: e, direction: t, orient: i, scaleType: n }) {
  const { gradientHorizontalMaxLength: o, gradientHorizontalMinLength: g, gradientVerticalMaxLength: s, gradientVerticalMinLength: I } = A;
  if (jr(n))
    return t === "horizontal" ? i === "top" || i === "bottom" ? qhA(e, "width", g, o) : g : qhA(e, "height", I, s);
}
function qhA(A, e, t, i) {
  return { signal: `clamp(${A.getSizeSignalRef(e).signal}, ${t}, ${i})` };
}
function gOe(A) {
  if (Ht(["quantile", "threshold", "log", "symlog"], A))
    return "greedy";
}
function kUA(A) {
  const e = xn(A) ? sOe(A) : COe(A);
  return A.component.legends = e, e;
}
function sOe(A) {
  const { encoding: e } = A, t = {};
  for (const i of [js, ...w3A]) {
    const n = co(e[i]);
    !n || !A.getScaleComponent(i) || i === Ps && jA(n) && n.type === oG || (t[i] = rOe(A, i));
  }
  return t;
}
function IOe(A, e) {
  const t = A.scaleName(e);
  if (A.mark === "trail") {
    if (e === "color")
      return { stroke: t };
    if (e === "size")
      return { strokeWidth: t };
  }
  return e === "color" ? A.markDef.filled ? { fill: t } : { stroke: t } : { [e]: t };
}
function aOe(A, e, t, i) {
  switch (e) {
    case "disable":
      return t !== void 0;
    case "values":
      return !!(t != null && t.values);
    case "title":
      if (e === "title" && A === (i == null ? void 0 : i.title))
        return !0;
  }
  return A === (t || {})[e];
}
function rOe(A, e) {
  var t;
  let i = A.legend(e);
  const { markDef: n, encoding: o, config: g } = A, s = g.legend, I = new _qe({}, IOe(A, e));
  hqe(A, e, I);
  const r = i !== void 0 ? !i : s.disable;
  if (I.set("disable", r, i !== void 0), r)
    return I;
  i = i || {};
  const a = A.getScaleComponent(e).get("type"), C = co(o[e]), B = jA(C) ? (t = vo(C.timeUnit)) == null ? void 0 : t.unit : void 0, l = i.orient || g.legend.orient || "right", Q = eOe({ legend: i, channel: e, timeUnit: B, scaleType: a }), E = iOe({ legend: i, legendType: Q, orient: l, legendConfig: s }), d = {
    legend: i,
    channel: e,
    model: A,
    markDef: n,
    encoding: o,
    fieldOrDatumDef: C,
    legendConfig: s,
    config: g,
    scaleType: a,
    orient: l,
    legendType: Q,
    direction: E
  };
  for (const G of wUA) {
    if (Q === "gradient" && G.startsWith("symbol") || Q === "symbol" && G.startsWith("gradient"))
      continue;
    const R = G in _hA ? _hA[G](d) : i[G];
    if (R !== void 0) {
      const F = aOe(R, G, i, A.fieldDef(e));
      (F || g.legend[G] === void 0) && I.set(G, R, F);
    }
  }
  const m = (i == null ? void 0 : i.encoding) ?? {}, y = I.get("selections"), f = {}, w = { fieldOrDatumDef: C, model: A, channel: e, legendCmpt: I, legendType: Q };
  for (const G of ["labels", "legend", "title", "symbols", "gradient", "entries"]) {
    const R = yUA(m[G] ?? {}, A), F = G in ThA ? ThA[G](R, w) : R;
    F !== void 0 && !Fi(F) && (f[G] = {
      ...y != null && y.length && jA(C) ? { name: `${En(C.field)}_legend_${G}` } : {},
      ...y != null && y.length ? { interactive: !!y } : {},
      update: F
    });
  }
  return Fi(f) || I.set("encode", f, !!(i != null && i.encoding)), I;
}
function COe(A) {
  const { legends: e, resolve: t } = A.component;
  for (const i of A.children) {
    kUA(i);
    for (const n of _A(i.component.legends))
      t.legend[n] = $oA(A.component.resolve, n), t.legend[n] === "shared" && (e[n] = JUA(e[n], i.component.legends[n]), e[n] || (t.legend[n] = "independent", delete e[n]));
  }
  for (const i of _A(e))
    for (const n of A.children)
      n.component.legends[i] && t.legend[i] === "shared" && delete n.component.legends[i];
  return e;
}
function JUA(A, e) {
  var t, i, n, o;
  if (!A)
    return e.clone();
  const g = A.getWithExplicit("orient"), s = e.getWithExplicit("orient");
  if (g.explicit && s.explicit && g.value !== s.value)
    return;
  let I = !1;
  for (const r of wUA) {
    const a = sd(
      A.getWithExplicit(r),
      e.getWithExplicit(r),
      r,
      "legend",
      // Tie breaker function
      (C, B) => {
        switch (r) {
          case "symbolType":
            return BOe(C, B);
          case "title":
            return rKA(C, B);
          case "type":
            return I = !0, Yr("symbol");
        }
        return YV(C, B, r, "legend");
      }
    );
    A.setWithExplicit(r, a);
  }
  return I && ((i = (t = A.implicit) == null ? void 0 : t.encode) != null && i.gradient && wZ(A.implicit, ["encode", "gradient"]), (o = (n = A.explicit) == null ? void 0 : n.encode) != null && o.gradient && wZ(A.explicit, ["encode", "gradient"])), A;
}
function BOe(A, e) {
  return e.value === "circle" ? e : A;
}
function lOe(A, e, t, i) {
  var n, o;
  A.encode ?? (A.encode = {}), (n = A.encode)[e] ?? (n[e] = {}), (o = A.encode[e]).update ?? (o.update = {}), A.encode[e].update[t] = i;
}
function NUA(A) {
  const e = A.component.legends, t = {};
  for (const i of _A(e)) {
    const n = A.getScaleComponent(i), o = Mi(n.get("domains"));
    if (t[o])
      for (const g of t[o])
        JUA(g, e[i]) || t[o].push(e[i]);
    else
      t[o] = [e[i].clone()];
  }
  return tg(t).flat().map((i) => cOe(i, A.config)).filter((i) => i !== void 0);
}
function cOe(A, e) {
  var t, i, n;
  const { disable: o, labelExpr: g, selections: s, ...I } = A.combine();
  if (!o) {
    if (e.aria === !1 && I.aria == null && (I.aria = !1), (t = I.encode) != null && t.symbols) {
      const r = I.encode.symbols.update;
      r.fill && r.fill.value !== "transparent" && !r.stroke && !I.stroke && (r.stroke = { value: "transparent" });
      for (const a of w3A)
        I[a] && delete r[a];
    }
    if (I.title || delete I.title, g !== void 0) {
      let r = g;
      (n = (i = I.encode) == null ? void 0 : i.labels) != null && n.update && ke(I.encode.labels.update.text) && (r = yp(g, "datum.label", I.encode.labels.update.text.signal)), lOe(I, "labels", "text", { signal: r });
    }
    return I;
  }
}
function QOe(A) {
  return rG(A) || ogA(A) ? EOe(A) : YUA(A);
}
function EOe(A) {
  return A.children.reduce((e, t) => e.concat(t.assembleProjections()), YUA(A));
}
function YUA(A) {
  const e = A.component.projection;
  if (!e || e.merged)
    return [];
  const t = e.combine(), { name: i } = t;
  if (e.data) {
    const n = {
      signal: `[${e.size.map((g) => g.signal).join(", ")}]`
    }, o = e.data.reduce((g, s) => {
      const I = ke(s) ? s.signal : `data('${A.lookupDataSource(s)}')`;
      return Ht(g, I) || g.push(I), g;
    }, []);
    if (o.length <= 0)
      throw new Error("Projection's fit didn't find any data sources");
    return [
      {
        name: i,
        size: n,
        fit: {
          signal: o.length > 1 ? `[${o.join(", ")}]` : o[0]
        },
        ...t
      }
    ];
  } else
    return [
      {
        name: i,
        translate: { signal: "[width / 2, height / 2]" },
        // parameters, overwrite default translate if specified
        ...t
      }
    ];
}
const uOe = [
  "type",
  "clipAngle",
  "clipExtent",
  "center",
  "rotate",
  "precision",
  "reflectX",
  "reflectY",
  "coefficient",
  "distance",
  "fraction",
  "lobes",
  "parallel",
  "radius",
  "ratio",
  "spacing",
  "tilt"
];
class RUA extends VQ {
  constructor(e, t, i, n) {
    super(
      { ...t },
      // all explicit properties of projection
      { name: e }
      // name as initial implicit property
    ), this.specifiedProjection = t, this.size = i, this.data = n, this.merged = !1;
  }
  /**
   * Whether the projection parameters should fit provided data.
   */
  get isFit() {
    return !!this.data;
  }
}
function FUA(A) {
  A.component.projection = xn(A) ? dOe(A) : pOe(A);
}
function dOe(A) {
  if (A.hasProjection) {
    const e = Ys(A.specifiedProjection), t = !(e && (e.scale != null || e.translate != null)), i = t ? [A.getSizeSignalRef("width"), A.getSizeSignalRef("height")] : void 0, n = t ? hOe(A) : void 0, o = new RUA(A.projectionName(!0), {
      ...Ys(A.config.projection) ?? {},
      ...e ?? {}
    }, i, n);
    return o.get("type") || o.set("type", "equalEarth", !1), o;
  }
}
function hOe(A) {
  const e = [], { encoding: t } = A;
  for (const i of [
    [MC, FC],
    [ar, xC]
  ])
    (co(t[i[0]]) || co(t[i[1]])) && e.push({
      signal: A.getName(`geojson_${e.length}`)
    });
  return A.channelHasField(Ps) && A.typedFieldDef(Ps).type === oG && e.push({
    signal: A.getName(`geojson_${e.length}`)
  }), e.length === 0 && e.push(A.requestDataName(Ti.Main)), e;
}
function mOe(A, e) {
  const t = XnA(uOe, (i) => !!(!Ze(A.explicit, i) && !Ze(e.explicit, i) || Ze(A.explicit, i) && Ze(e.explicit, i) && // some properties might be signals or objects and require hashing for comparison
  ZI(A.get(i), e.get(i))));
  if (ZI(A.size, e.size)) {
    if (t)
      return A;
    if (ZI(A.explicit, {}))
      return e;
    if (ZI(e.explicit, {}))
      return A;
  }
  return null;
}
function pOe(A) {
  if (A.children.length === 0)
    return;
  let e;
  for (const i of A.children)
    FUA(i);
  const t = XnA(A.children, (i) => {
    const n = i.component.projection;
    if (n)
      if (e) {
        const o = mOe(e, n);
        return o && (e = o), !!o;
      } else
        return e = n, !0;
    else
      return !0;
  });
  if (e && t) {
    const i = A.projectionName(!0), n = new RUA(i, e.specifiedProjection, e.size, tt(e.data));
    for (const o of A.children) {
      const g = o.component.projection;
      g && (g.isFit && n.data.push(...o.component.projection.data), o.renameProjection(g.get("name"), i), g.merged = !0);
    }
    return n;
  }
}
function yOe(A, e, t, i) {
  if (VF(e, t)) {
    const n = xn(A) ? A.axis(t) ?? A.legend(t) ?? {} : {}, o = se(e, { expr: "datum" }), g = se(e, { expr: "datum", binSuffix: "end" });
    return {
      formulaAs: se(e, { binSuffix: "range", forAs: !0 }),
      formula: WF(o, g, n.format, n.formatType, i)
    };
  }
  return {};
}
function MUA(A, e) {
  return `${tKA(A)}_${e}`;
}
function bOe(A, e) {
  return {
    signal: A.getName(`${e}_bins`),
    extentSignal: A.getName(`${e}_extent`)
  };
}
function AgA(A, e, t) {
  const i = fV(t, void 0) ?? {}, n = MUA(i, e);
  return A.getName(`${n}_bins`);
}
function wOe(A) {
  return "as" in A;
}
function OhA(A, e, t) {
  let i, n;
  wOe(A) ? i = Be(A.as) ? [A.as, `${A.as}_end`] : [A.as[0], A.as[1]] : i = [se(A, { forAs: !0 }), se(A, { binSuffix: "end", forAs: !0 })];
  const o = { ...fV(e, void 0) }, g = MUA(o, A.field), { signal: s, extentSignal: I } = bOe(t, g);
  if (cV(o.extent)) {
    const a = o.extent;
    n = BUA(t, a.param, a), delete o.extent;
  }
  const r = {
    bin: o,
    field: A.field,
    as: [i],
    ...s ? { signal: s } : {},
    ...I ? { extentSignal: I } : {},
    ...n ? { span: n } : {}
  };
  return { key: g, binComponent: r };
}
class PB extends Yi {
  clone() {
    return new PB(null, tt(this.bins));
  }
  constructor(e, t) {
    super(e), this.bins = t;
  }
  static makeFromEncoding(e, t) {
    const i = t.reduceFieldDef((n, o, g) => {
      if (ls(o) && Oi(o.bin)) {
        const { key: s, binComponent: I } = OhA(o, o.bin, t);
        n[s] = {
          ...I,
          ...n[s],
          ...yOe(t, o, g, t.config)
        };
      }
      return n;
    }, {});
    return Fi(i) ? null : new PB(e, i);
  }
  /**
   * Creates a bin node from BinTransform.
   * The optional parameter should provide
   */
  static makeFromTransform(e, t, i) {
    const { key: n, binComponent: o } = OhA(t, t.bin, i);
    return new PB(e, {
      [n]: o
    });
  }
  /**
   * Merge bin nodes. This method either integrates the bin config from the other node
   * or if this node already has a bin config, renames the corresponding signal in the model.
   */
  merge(e, t) {
    for (const i of _A(e.bins))
      i in this.bins ? (t(e.bins[i].signal, this.bins[i].signal), this.bins[i].as = YB([...this.bins[i].as, ...e.bins[i].as], vt)) : this.bins[i] = e.bins[i];
    for (const i of e.children)
      e.removeChild(i), i.parent = this;
    e.remove();
  }
  producedFields() {
    return new Set(tg(this.bins).map((e) => e.as).flat(2));
  }
  dependentFields() {
    return new Set(tg(this.bins).map((e) => e.field));
  }
  hash() {
    return `Bin ${vt(this.bins)}`;
  }
  assemble() {
    return tg(this.bins).flatMap((e) => {
      const t = [], [i, ...n] = e.as, { extent: o, ...g } = e.bin, s = {
        type: "bin",
        field: Ir(e.field),
        as: i,
        signal: e.signal,
        ...cV(o) ? { extent: null } : { extent: o },
        ...e.span ? { span: { signal: `span(${e.span})` } } : {},
        ...g
      };
      !o && e.extentSignal && (t.push({
        type: "extent",
        field: Ir(e.field),
        signal: e.extentSignal
      }), s.extent = { signal: e.extentSignal }), t.push(s);
      for (const I of n)
        for (let r = 0; r < 2; r++)
          t.push({
            type: "formula",
            expr: se({ field: i[r] }, { expr: "datum" }),
            as: I[r]
          });
      return e.formula && t.push({
        type: "formula",
        expr: e.formula,
        as: e.formulaAs
      }), t;
    });
  }
}
function fOe(A, e, t, i) {
  var n;
  const o = xn(i) ? i.encoding[Fl(e)] : void 0;
  if (ls(t) && xn(i) && qKA(t, o, i.markDef, i.config)) {
    A.add(se(t, {})), A.add(se(t, { suffix: "end" }));
    const { mark: g, markDef: s, config: I } = i, r = gd({ fieldDef: t, markDef: s, config: I });
    E2(g) && r !== 0.5 && qn(e) && (A.add(se(t, { suffix: RV })), A.add(se(t, { suffix: FV }))), t.bin && VF(t, e) && A.add(se(t, { binSuffix: "range" }));
  } else if (zWA(e)) {
    const g = XWA(e);
    A.add(i.getName(g));
  } else
    A.add(se(t));
  return d0(t) && QTe((n = t.scale) == null ? void 0 : n.range) && A.add(t.scale.range.field), A;
}
function DOe(A, e) {
  for (const t of _A(e)) {
    const i = e[t];
    for (const n of _A(i))
      t in A ? A[t][n] = /* @__PURE__ */ new Set([...A[t][n] ?? [], ...i[n]]) : A[t] = { [n]: i[n] };
  }
}
class aC extends Yi {
  clone() {
    return new aC(null, new Set(this.dimensions), tt(this.measures));
  }
  /**
   * @param dimensions string set for dimensions
   * @param measures dictionary mapping field name => dict of aggregation functions and names to use
   */
  constructor(e, t, i) {
    super(e), this.dimensions = t, this.measures = i;
  }
  get groupBy() {
    return this.dimensions;
  }
  static makeFromEncoding(e, t) {
    let i = !1;
    t.forEachFieldDef((g) => {
      g.aggregate && (i = !0);
    });
    const n = {}, o = /* @__PURE__ */ new Set();
    return !i || (t.forEachFieldDef((g, s) => {
      const { aggregate: I, field: r } = g;
      if (I)
        if (I === "count")
          n["*"] ?? (n["*"] = {}), n["*"].count = /* @__PURE__ */ new Set([se(g, { forAs: !0 })]);
        else {
          if (hQ(I) || qd(I)) {
            const a = hQ(I) ? "argmin" : "argmax", C = I[a];
            n[C] ?? (n[C] = {}), n[C][a] = /* @__PURE__ */ new Set([se({ op: a, field: C }, { forAs: !0 })]);
          } else
            n[r] ?? (n[r] = {}), n[r][I] = /* @__PURE__ */ new Set([se(g, { forAs: !0 })]);
          KQ(s) && t.scaleDomain(s) === "unaggregated" && (n[r] ?? (n[r] = {}), n[r].min = /* @__PURE__ */ new Set([se({ field: r, aggregate: "min" }, { forAs: !0 })]), n[r].max = /* @__PURE__ */ new Set([se({ field: r, aggregate: "max" }, { forAs: !0 })]));
        }
      else
        fOe(o, s, g, t);
    }), o.size + _A(n).length === 0) ? null : new aC(e, o, n);
  }
  static makeFromTransform(e, t) {
    const i = /* @__PURE__ */ new Set(), n = {};
    for (const o of t.aggregate) {
      const { op: g, field: s, as: I } = o;
      g && (g === "count" ? (n["*"] ?? (n["*"] = {}), n["*"].count = /* @__PURE__ */ new Set([I || se(o, { forAs: !0 })])) : (n[s] ?? (n[s] = {}), n[s][g] = /* @__PURE__ */ new Set([I || se(o, { forAs: !0 })])));
    }
    for (const o of t.groupby ?? [])
      i.add(o);
    return i.size + _A(n).length === 0 ? null : new aC(e, i, n);
  }
  merge(e) {
    return vWA(this.dimensions, e.dimensions) ? (DOe(this.measures, e.measures), !0) : (Zze("different dimensions, cannot merge"), !1);
  }
  addDimensions(e) {
    e.forEach(this.dimensions.add, this.dimensions);
  }
  dependentFields() {
    return /* @__PURE__ */ new Set([...this.dimensions, ..._A(this.measures)]);
  }
  producedFields() {
    const e = /* @__PURE__ */ new Set();
    for (const t of _A(this.measures))
      for (const i of _A(this.measures[t])) {
        const n = this.measures[t][i];
        n.size === 0 ? e.add(`${i}_${t}`) : n.forEach(e.add, e);
      }
    return e;
  }
  hash() {
    return `Aggregate ${vt({ dimensions: this.dimensions, measures: this.measures })}`;
  }
  assemble() {
    const e = [], t = [], i = [];
    for (const n of _A(this.measures))
      for (const o of _A(this.measures[n]))
        for (const g of this.measures[n][o])
          i.push(g), e.push(o), t.push(n === "*" ? null : Ir(n));
    return {
      type: "aggregate",
      groupby: [...this.dimensions].map(Ir),
      ops: e,
      fields: t,
      as: i
    };
  }
}
class IG extends Yi {
  /**
   * @param model The facet model.
   * @param name The name that this facet source will have.
   * @param data The source data for this facet data.
   */
  constructor(e, t, i, n) {
    super(e), this.model = t, this.name = i, this.data = n;
    for (const o of Ua) {
      const g = t.facet[o];
      if (g) {
        const { bin: s, sort: I } = g;
        this[o] = {
          name: t.getName(`${o}_domain`),
          fields: [se(g), ...Oi(s) ? [se(g, { binSuffix: "end" })] : []],
          ...OB(I) ? { sortField: I } : ZA(I) ? { sortIndexField: Xf(g, o) } : {}
        };
      }
    }
    this.childModel = t.child;
  }
  hash() {
    let e = "Facet";
    for (const t of Ua)
      this[t] && (e += ` ${t.charAt(0)}:${vt(this[t])}`);
    return e;
  }
  get fields() {
    var e;
    const t = [];
    for (const i of Ua)
      (e = this[i]) != null && e.fields && t.push(...this[i].fields);
    return t;
  }
  dependentFields() {
    const e = new Set(this.fields);
    for (const t of Ua)
      this[t] && (this[t].sortField && e.add(this[t].sortField.field), this[t].sortIndexField && e.add(this[t].sortIndexField));
    return e;
  }
  producedFields() {
    return /* @__PURE__ */ new Set();
  }
  /**
   * The name to reference this source is its name.
   */
  getSource() {
    return this.name;
  }
  getChildIndependentFieldsWithStep() {
    const e = {};
    for (const t of Ml) {
      const i = this.childModel.component.scales[t];
      if (i && !i.merged) {
        const n = i.get("type"), o = i.get("range");
        if (Wo(n) && Od(o)) {
          const g = HV(this.childModel, t), s = ngA(g);
          s ? e[t] = s : PA(ooA(t));
        }
      }
    }
    return e;
  }
  assembleRowColumnHeaderData(e, t, i) {
    const n = { row: "y", column: "x", facet: void 0 }[e], o = [], g = [], s = [];
    n && i && i[n] && (t ? (o.push(`distinct_${i[n]}`), g.push("max")) : (o.push(i[n]), g.push("distinct")), s.push(`distinct_${i[n]}`));
    const { sortField: I, sortIndexField: r } = this[e];
    if (I) {
      const { op: a = pV, field: C } = I;
      o.push(C), g.push(a), s.push(se(I, { forAs: !0 }));
    } else
      r && (o.push(r), g.push("max"), s.push(r));
    return {
      name: this[e].name,
      // Use data from the crossed one if it exist
      source: t ?? this.data,
      transform: [
        {
          type: "aggregate",
          groupby: this[e].fields,
          ...o.length ? {
            fields: o,
            ops: g,
            as: s
          } : {}
        }
      ]
    };
  }
  assembleFacetHeaderData(e) {
    var t;
    const { columns: i } = this.model.layout, { layoutHeaders: n } = this.model.component, o = [], g = {};
    for (const r of OoA) {
      for (const a of joA) {
        const C = (n[r] && n[r][a]) ?? [];
        for (const B of C)
          if (((t = B.axes) == null ? void 0 : t.length) > 0) {
            g[r] = !0;
            break;
          }
      }
      if (g[r]) {
        const a = `length(data("${this.facet.name}"))`, C = r === "row" ? i ? { signal: `ceil(${a} / ${i})` } : 1 : i ? { signal: `min(${a}, ${i})` } : { signal: a };
        o.push({
          name: `${this.facet.name}_${r}`,
          transform: [
            {
              type: "sequence",
              start: 0,
              stop: C
            }
          ]
        });
      }
    }
    const { row: s, column: I } = g;
    return (s || I) && o.unshift(this.assembleRowColumnHeaderData("facet", null, e)), o;
  }
  assemble() {
    const e = [];
    let t = null;
    const i = this.getChildIndependentFieldsWithStep(), { column: n, row: o, facet: g } = this;
    if (n && o && (i.x || i.y)) {
      t = `cross_${this.column.name}_${this.row.name}`;
      const s = [].concat(i.x ?? [], i.y ?? []), I = s.map(() => "distinct");
      e.push({
        name: t,
        source: this.data,
        transform: [
          {
            type: "aggregate",
            groupby: this.fields,
            fields: s,
            ops: I
          }
        ]
      });
    }
    for (const s of [Pc, jc])
      this[s] && e.push(this.assembleRowColumnHeaderData(s, t, i));
    if (g) {
      const s = this.assembleFacetHeaderData(i);
      s && e.push(...s);
    }
    return e;
  }
}
function jhA(A) {
  return A.startsWith("'") && A.endsWith("'") || A.startsWith('"') && A.endsWith('"') ? A.slice(1, -1) : A;
}
function GOe(A, e) {
  const t = _nA(A);
  if (e === "number")
    return `toNumber(${t})`;
  if (e === "boolean")
    return `toBoolean(${t})`;
  if (e === "string")
    return `toString(${t})`;
  if (e === "date")
    return `toDate(${t})`;
  if (e === "flatten")
    return t;
  if (e.startsWith("date:")) {
    const i = jhA(e.slice(5, e.length));
    return `timeParse(${t},'${i}')`;
  } else if (e.startsWith("utc:")) {
    const i = jhA(e.slice(4, e.length));
    return `utcParse(${t},'${i}')`;
  } else
    return PA(q5e(e)), null;
}
function kOe(A) {
  const e = {};
  return rv(A.filter, (t) => {
    if (GKA(t)) {
      let i = null;
      aoA(t) ? i = YI(t.equal) : CoA(t) ? i = YI(t.lte) : roA(t) ? i = YI(t.lt) : BoA(t) ? i = YI(t.gt) : loA(t) ? i = YI(t.gte) : coA(t) ? i = t.range[0] : QoA(t) && (i = (t.oneOf ?? t.in)[0]), i && (E0(i) ? e[t.field] = "date" : ti(i) ? e[t.field] = "number" : Be(i) && (e[t.field] = "string")), t.timeUnit && (e[t.field] = "date");
    }
  }), e;
}
function JOe(A) {
  const e = {};
  function t(i) {
    Wf(i) ? e[i.field] = "date" : i.type === "quantitative" && G5e(i.aggregate) ? e[i.field] = "number" : Mf(i.field) > 1 ? i.field in e || (e[i.field] = "flatten") : d0(i) && OB(i.sort) && Mf(i.sort.field) > 1 && (i.sort.field in e || (e[i.sort.field] = "flatten"));
  }
  if ((xn(A) || rC(A)) && A.forEachFieldDef((i, n) => {
    if (ls(i))
      t(i);
    else {
      const o = c0(n), g = A.fieldDef(o);
      t({
        ...i,
        type: g.type
      });
    }
  }), xn(A)) {
    const { mark: i, markDef: n, encoding: o } = A;
    if (jd(i) && // No need to sort by dimension if we have a connected scatterplot (order channel is present)
    !A.encoding.order) {
      const g = n.orient === "horizontal" ? "y" : "x", s = o[g];
      jA(s) && s.type === "quantitative" && !(s.field in e) && (e[s.field] = "number");
    }
  }
  return e;
}
function NOe(A) {
  const e = {};
  if (xn(A) && A.component.selection)
    for (const t of _A(A.component.selection)) {
      const i = A.component.selection[t];
      for (const n of i.project.items)
        !n.channel && Mf(n.field) > 1 && (e[n.field] = "flatten");
    }
  return e;
}
class wg extends Yi {
  clone() {
    return new wg(null, tt(this._parse));
  }
  constructor(e, t) {
    super(e), this._parse = t;
  }
  hash() {
    return `Parse ${vt(this._parse)}`;
  }
  /**
   * Creates a parse node from a data.format.parse and updates ancestorParse.
   */
  static makeExplicit(e, t, i) {
    var n;
    let o = {};
    const g = t.data;
    return !Yu(g) && (n = g == null ? void 0 : g.format) != null && n.parse && (o = g.format.parse), this.makeWithAncestors(e, o, {}, i);
  }
  /**
   * Creates a parse node from "explicit" parse and "implicit" parse and updates ancestorParse.
   */
  static makeWithAncestors(e, t, i, n) {
    for (const s of _A(i)) {
      const I = n.getWithExplicit(s);
      I.value !== void 0 && (I.explicit || I.value === i[s] || I.value === "derived" || i[s] === "flatten" ? delete i[s] : PA(shA(s, i[s], I.value)));
    }
    for (const s of _A(t)) {
      const I = n.get(s);
      I !== void 0 && (I === t[s] ? delete t[s] : PA(shA(s, t[s], I)));
    }
    const o = new VQ(t, i);
    n.copyAll(o);
    const g = {};
    for (const s of _A(o.combine())) {
      const I = o.get(s);
      I !== null && (g[s] = I);
    }
    return _A(g).length === 0 || n.parseNothing ? null : new wg(e, g);
  }
  get parse() {
    return this._parse;
  }
  merge(e) {
    this._parse = { ...this._parse, ...e.parse }, e.remove();
  }
  /**
   * Assemble an object for Vega's format.parse property.
   */
  assembleFormatParse() {
    const e = {};
    for (const t of _A(this._parse)) {
      const i = this._parse[t];
      Mf(t) === 1 && (e[t] = i);
    }
    return e;
  }
  // format parse depends and produces all fields in its parse
  producedFields() {
    return new Set(_A(this._parse));
  }
  dependentFields() {
    return new Set(_A(this._parse));
  }
  assembleTransforms(e = !1) {
    return _A(this._parse).filter((t) => e ? Mf(t) > 1 : !0).map((t) => {
      const i = GOe(t, this._parse[t]);
      return i ? {
        type: "formula",
        expr: i,
        as: qnA(t)
        // Vega output is always flattened
      } : null;
    }).filter((t) => t !== null);
  }
}
class rd extends Yi {
  clone() {
    return new rd(null);
  }
  constructor(e) {
    super(e);
  }
  dependentFields() {
    return /* @__PURE__ */ new Set();
  }
  producedFields() {
    return /* @__PURE__ */ new Set([bC]);
  }
  hash() {
    return "Identifier";
  }
  assemble() {
    return { type: "identifier", as: bC };
  }
}
class TF extends Yi {
  clone() {
    return new TF(null, this.params);
  }
  constructor(e, t) {
    super(e), this.params = t;
  }
  dependentFields() {
    return /* @__PURE__ */ new Set();
  }
  producedFields() {
  }
  hash() {
    return `Graticule ${vt(this.params)}`;
  }
  assemble() {
    return {
      type: "graticule",
      ...this.params === !0 ? {} : this.params
    };
  }
}
class _F extends Yi {
  clone() {
    return new _F(null, this.params);
  }
  constructor(e, t) {
    super(e), this.params = t;
  }
  dependentFields() {
    return /* @__PURE__ */ new Set();
  }
  producedFields() {
    return /* @__PURE__ */ new Set([this.params.as ?? "data"]);
  }
  hash() {
    return `Hash ${vt(this.params)}`;
  }
  assemble() {
    return {
      type: "sequence",
      ...this.params
    };
  }
}
class Np extends Yi {
  constructor(e) {
    super(null), e ?? (e = { name: "source" });
    let t;
    if (Yu(e) || (t = e.format ? { ...Us(e.format, ["parse"]) } : {}), u2(e))
      this._data = { values: e.values };
    else if (Kf(e)) {
      if (this._data = { url: e.url }, !t.type) {
        let i = /(?:\.([^.]+))?$/.exec(e.url)[1];
        Ht(["json", "csv", "tsv", "dsv", "topojson"], i) || (i = "json"), t.type = i;
      }
    } else
      K3A(e) ? this._data = { values: [{ type: "Sphere" }] } : (Z3A(e) || Yu(e)) && (this._data = {});
    this._generator = Yu(e), e.name && (this._name = e.name), t && !Fi(t) && (this._data.format = t);
  }
  dependentFields() {
    return /* @__PURE__ */ new Set();
  }
  producedFields() {
  }
  get data() {
    return this._data;
  }
  hasName() {
    return !!this._name;
  }
  get isGenerator() {
    return this._generator;
  }
  get dataName() {
    return this._name;
  }
  set dataName(e) {
    this._name = e;
  }
  set parent(e) {
    throw new Error("Source nodes have to be roots.");
  }
  remove() {
    throw new Error("Source nodes are roots and cannot be removed.");
  }
  hash() {
    throw new Error("Cannot hash sources");
  }
  assemble() {
    return {
      name: this._name,
      ...this._data,
      transform: []
    };
  }
}
var PhA = globalThis && globalThis.__classPrivateFieldSet || function(A, e, t, i, n) {
  if (i === "m")
    throw new TypeError("Private method is not writable");
  if (i === "a" && !n)
    throw new TypeError("Private accessor was defined without a setter");
  if (typeof e == "function" ? A !== e || !n : !e.has(A))
    throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return i === "a" ? n.call(A, t) : n ? n.value = t : e.set(A, t), t;
}, YOe = globalThis && globalThis.__classPrivateFieldGet || function(A, e, t, i) {
  if (t === "a" && !i)
    throw new TypeError("Private accessor was defined without a getter");
  if (typeof e == "function" ? A !== e || !i : !e.has(A))
    throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return t === "m" ? i : t === "a" ? i.call(A) : i ? i.value : e.get(A);
}, SJ;
function egA(A) {
  return A instanceof Np || A instanceof TF || A instanceof _F;
}
class tgA {
  constructor() {
    SJ.set(this, void 0), PhA(this, SJ, !1, "f");
  }
  // Once true, #modified is never set to false
  setModified() {
    PhA(this, SJ, !0, "f");
  }
  get modifiedFlag() {
    return YOe(this, SJ, "f");
  }
}
SJ = /* @__PURE__ */ new WeakMap();
class h0 extends tgA {
  /**
   * Compute a map of node depths that we can use to determine a topological sort order.
   */
  getNodeDepths(e, t, i) {
    i.set(e, t);
    for (const n of e.children)
      this.getNodeDepths(n, t + 1, i);
    return i;
  }
  /**
   * Run the optimizer on all nodes starting from the leaves.
   */
  optimize(e) {
    const t = [...this.getNodeDepths(e, 0, /* @__PURE__ */ new Map()).entries()].sort((i, n) => n[1] - i[1]);
    for (const i of t)
      this.run(i[0]);
    return this.modifiedFlag;
  }
}
class igA extends tgA {
  /**
   * Run the optimizer depth first on all nodes starting from the roots.
   */
  optimize(e) {
    this.run(e);
    for (const t of e.children)
      this.optimize(t);
    return this.modifiedFlag;
  }
}
class ROe extends igA {
  mergeNodes(e, t) {
    const i = t.shift();
    for (const n of t)
      e.removeChild(n), n.parent = i, n.remove();
  }
  run(e) {
    const t = e.children.map((n) => n.hash()), i = {};
    for (let n = 0; n < t.length; n++)
      i[t[n]] === void 0 ? i[t[n]] = [e.children[n]] : i[t[n]].push(e.children[n]);
    for (const n of _A(i))
      i[n].length > 1 && (this.setModified(), this.mergeNodes(e, i[n]));
  }
}
class FOe extends igA {
  constructor(e) {
    super(), this.requiresSelectionId = e && qoA(e);
  }
  run(e) {
    e instanceof rd && (this.requiresSelectionId && (egA(e.parent) || e.parent instanceof aC || e.parent instanceof wg) || (this.setModified(), e.remove()));
  }
}
class MOe extends tgA {
  optimize(e) {
    return this.run(e, /* @__PURE__ */ new Set()), this.modifiedFlag;
  }
  run(e, t) {
    let i = /* @__PURE__ */ new Set();
    e instanceof jB && (i = e.producedFields(), znA(i, t) && (this.setModified(), e.removeFormulas(t), e.producedFields.length === 0 && e.remove()));
    for (const n of e.children)
      this.run(n, /* @__PURE__ */ new Set([...t, ...i]));
  }
}
class xOe extends igA {
  constructor() {
    super();
  }
  run(e) {
    e instanceof Is && !e.isRequired() && (this.setModified(), e.remove());
  }
}
class LOe extends h0 {
  run(e) {
    if (!egA(e) && !(e.numChildren() > 1)) {
      for (const t of e.children)
        if (t instanceof wg)
          if (e instanceof wg)
            this.setModified(), e.merge(t);
          else {
            if (TnA(e.producedFields(), t.dependentFields()))
              continue;
            this.setModified(), t.swapWithParent();
          }
    }
  }
}
class vOe extends h0 {
  run(e) {
    const t = [...e.children], i = e.children.filter((n) => n instanceof wg);
    if (e.numChildren() > 1 && i.length >= 1) {
      const n = {}, o = /* @__PURE__ */ new Set();
      for (const g of i) {
        const s = g.parse;
        for (const I of _A(s))
          I in n ? n[I] !== s[I] && o.add(I) : n[I] = s[I];
      }
      for (const g of o)
        delete n[g];
      if (!Fi(n)) {
        this.setModified();
        const g = new wg(e, n);
        for (const s of t) {
          if (s instanceof wg)
            for (const I of _A(n))
              delete s.parse[I];
          e.removeChild(s), s.parent = g, s instanceof wg && _A(s.parse).length === 0 && s.remove();
        }
      }
    }
  }
}
class HOe extends h0 {
  run(e) {
    e instanceof Is || e.numChildren() > 0 || e instanceof IG || e instanceof Np || (this.setModified(), e.remove());
  }
}
class SOe extends h0 {
  run(e) {
    const t = e.children.filter((n) => n instanceof jB), i = t.pop();
    for (const n of t)
      this.setModified(), i.merge(n);
  }
}
class ZOe extends h0 {
  run(e) {
    const t = e.children.filter((n) => n instanceof aC), i = {};
    for (const n of t) {
      const o = vt(n.groupBy);
      o in i || (i[o] = []), i[o].push(n);
    }
    for (const n of _A(i)) {
      const o = i[n];
      if (o.length > 1) {
        const g = o.pop();
        for (const s of o)
          g.merge(s) && (e.removeChild(s), s.parent = g, s.remove(), this.setModified());
      }
    }
  }
}
class WOe extends h0 {
  constructor(e) {
    super(), this.model = e;
  }
  run(e) {
    const t = !(egA(e) || e instanceof sG || e instanceof wg || e instanceof rd), i = [], n = [];
    for (const o of e.children)
      o instanceof PB && (t && !TnA(e.producedFields(), o.dependentFields()) ? i.push(o) : n.push(o));
    if (i.length > 0) {
      const o = i.pop();
      for (const g of i)
        o.merge(g, this.model.renameSignal.bind(this.model));
      this.setModified(), e instanceof PB ? e.merge(o, this.model.renameSignal.bind(this.model)) : o.swapWithParent();
    }
    if (n.length > 1) {
      const o = n.pop();
      for (const g of n)
        o.merge(g, this.model.renameSignal.bind(this.model));
      this.setModified();
    }
  }
}
class KOe extends h0 {
  run(e) {
    const t = [...e.children];
    if (!pp(t, (o) => o instanceof Is) || e.numChildren() <= 1)
      return;
    const i = [];
    let n;
    for (const o of t)
      if (o instanceof Is) {
        let g = o;
        for (; g.numChildren() === 1; ) {
          const [s] = g.children;
          if (s instanceof Is)
            g = s;
          else
            break;
        }
        i.push(...g.children), n ? (e.removeChild(o), o.parent = n.parent, n.parent.removeChild(n), n.parent = g, this.setModified()) : n = g;
      } else
        i.push(o);
    if (i.length) {
      this.setModified();
      for (const o of i)
        o.parent.removeChild(o), o.parent = n;
    }
  }
}
class m0 extends Yi {
  clone() {
    return new m0(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t;
  }
  addDimensions(e) {
    this.transform.groupby = YB(this.transform.groupby.concat(e), (t) => t);
  }
  dependentFields() {
    const e = /* @__PURE__ */ new Set();
    return this.transform.groupby && this.transform.groupby.forEach(e.add, e), this.transform.joinaggregate.map((t) => t.field).filter((t) => t !== void 0).forEach(e.add, e), e;
  }
  producedFields() {
    return new Set(this.transform.joinaggregate.map(this.getDefaultName));
  }
  getDefaultName(e) {
    return e.as ?? se(e);
  }
  hash() {
    return `JoinAggregateTransform ${vt(this.transform)}`;
  }
  assemble() {
    const e = [], t = [], i = [];
    for (const o of this.transform.joinaggregate)
      t.push(o.op), i.push(this.getDefaultName(o)), e.push(o.field === void 0 ? null : o.field);
    const n = this.transform.groupby;
    return {
      type: "joinaggregate",
      as: i,
      ops: t,
      fields: e,
      ...n !== void 0 ? { groupby: n } : {}
    };
  }
}
function UOe(A) {
  return A.stack.stackBy.reduce((e, t) => {
    const i = t.fieldDef, n = se(i);
    return n && e.push(n), e;
  }, []);
}
function VOe(A) {
  return ZA(A) && A.every((e) => Be(e)) && A.length > 1;
}
class AQ extends Yi {
  clone() {
    return new AQ(null, tt(this._stack));
  }
  constructor(e, t) {
    super(e), this._stack = t;
  }
  static makeFromTransform(e, t) {
    const { stack: i, groupby: n, as: o, offset: g = "zero" } = t, s = [], I = [];
    if (t.sort !== void 0)
      for (const C of t.sort)
        s.push(C.field), I.push(_n(C.order, "ascending"));
    const r = {
      field: s,
      order: I
    };
    let a;
    return VOe(o) ? a = o : Be(o) ? a = [o, `${o}_end`] : a = [`${t.stack}_start`, `${t.stack}_end`], new AQ(e, {
      dimensionFieldDefs: [],
      stackField: i,
      groupby: n,
      offset: g,
      sort: r,
      facetby: [],
      as: a
    });
  }
  static makeFromEncoding(e, t) {
    const i = t.stack, { encoding: n } = t;
    if (!i)
      return null;
    const { groupbyChannels: o, fieldChannel: g, offset: s, impute: I } = i, r = o.map((l) => {
      const Q = n[l];
      return Bl(Q);
    }).filter((l) => !!l), a = UOe(t), C = t.encoding.order;
    let B;
    if (ZA(C) || jA(C))
      B = sKA(C);
    else {
      const l = OKA(C) ? C.sort : g === "y" ? "descending" : "ascending";
      B = a.reduce((Q, E) => (Q.field.push(E), Q.order.push(l), Q), { field: [], order: [] });
    }
    return new AQ(e, {
      dimensionFieldDefs: r,
      stackField: t.vgField(g),
      facetby: [],
      stackby: a,
      sort: B,
      offset: s,
      impute: I,
      as: [
        t.vgField(g, { suffix: "start", forAs: !0 }),
        t.vgField(g, { suffix: "end", forAs: !0 })
      ]
    });
  }
  get stack() {
    return this._stack;
  }
  addDimensions(e) {
    this._stack.facetby.push(...e);
  }
  dependentFields() {
    const e = /* @__PURE__ */ new Set();
    return e.add(this._stack.stackField), this.getGroupbyFields().forEach(e.add, e), this._stack.facetby.forEach(e.add, e), this._stack.sort.field.forEach(e.add, e), e;
  }
  producedFields() {
    return new Set(this._stack.as);
  }
  hash() {
    return `Stack ${vt(this._stack)}`;
  }
  getGroupbyFields() {
    const { dimensionFieldDefs: e, impute: t, groupby: i } = this._stack;
    return e.length > 0 ? e.map((n) => n.bin ? t ? [se(n, { binSuffix: "mid" })] : [
      // For binned group by field without impute, we need both bin (start) and bin_end
      se(n, {}),
      se(n, { binSuffix: "end" })
    ] : [se(n)]).flat() : i ?? [];
  }
  assemble() {
    const e = [], { facetby: t, dimensionFieldDefs: i, stackField: n, stackby: o, sort: g, offset: s, impute: I, as: r } = this._stack;
    if (I)
      for (const a of i) {
        const { bandPosition: C = 0.5, bin: B } = a;
        if (B) {
          const l = se(a, { expr: "datum" }), Q = se(a, { expr: "datum", binSuffix: "end" });
          e.push({
            type: "formula",
            expr: `${C}*${l}+${1 - C}*${Q}`,
            as: se(a, { binSuffix: "mid", forAs: !0 })
          });
        }
        e.push({
          type: "impute",
          field: n,
          groupby: [...o, ...t],
          key: se(a, { binSuffix: "mid" }),
          method: "value",
          value: 0
        });
      }
    return e.push({
      type: "stack",
      groupby: [...this.getGroupbyFields(), ...t],
      field: n,
      sort: g,
      as: r,
      offset: s
    }), e;
  }
}
class aG extends Yi {
  clone() {
    return new aG(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t;
  }
  addDimensions(e) {
    this.transform.groupby = YB(this.transform.groupby.concat(e), (t) => t);
  }
  dependentFields() {
    const e = /* @__PURE__ */ new Set();
    return (this.transform.groupby ?? []).forEach(e.add, e), (this.transform.sort ?? []).forEach((t) => e.add(t.field)), this.transform.window.map((t) => t.field).filter((t) => t !== void 0).forEach(e.add, e), e;
  }
  producedFields() {
    return new Set(this.transform.window.map(this.getDefaultName));
  }
  getDefaultName(e) {
    return e.as ?? se(e);
  }
  hash() {
    return `WindowTransform ${vt(this.transform)}`;
  }
  assemble() {
    const e = [], t = [], i = [], n = [];
    for (const C of this.transform.window)
      t.push(C.op), i.push(this.getDefaultName(C)), n.push(C.param === void 0 ? null : C.param), e.push(C.field === void 0 ? null : C.field);
    const o = this.transform.frame, g = this.transform.groupby;
    if (o && o[0] === null && o[1] === null && t.every((C) => ioA(C)))
      return {
        type: "joinaggregate",
        as: i,
        ops: t,
        fields: e,
        ...g !== void 0 ? { groupby: g } : {}
      };
    const s = [], I = [];
    if (this.transform.sort !== void 0)
      for (const C of this.transform.sort)
        s.push(C.field), I.push(C.order ?? "ascending");
    const r = {
      field: s,
      order: I
    }, a = this.transform.ignorePeers;
    return {
      type: "window",
      params: n,
      as: i,
      ops: t,
      fields: e,
      sort: r,
      ...a !== void 0 ? { ignorePeers: a } : {},
      ...g !== void 0 ? { groupby: g } : {},
      ...o !== void 0 ? { frame: o } : {}
    };
  }
}
function XOe(A) {
  function e(t) {
    if (!(t instanceof IG)) {
      const i = t.clone();
      if (i instanceof Is) {
        const n = DP + i.getSource();
        i.setSource(n), A.model.component.data.outputNodes[n] = i;
      } else
        (i instanceof aC || i instanceof AQ || i instanceof aG || i instanceof m0) && i.addDimensions(A.fields);
      for (const n of t.children.flatMap(e))
        n.parent = i;
      return [i];
    }
    return t.children.flatMap(e);
  }
  return e;
}
function fP(A) {
  if (A instanceof IG)
    if (A.numChildren() === 1 && !(A.children[0] instanceof Is)) {
      const e = A.children[0];
      (e instanceof aC || e instanceof AQ || e instanceof aG || e instanceof m0) && e.addDimensions(A.fields), e.swapWithParent(), fP(A);
    } else {
      const e = A.model.component.data.main;
      xUA(e);
      const t = XOe(A), i = A.children.map(t).flat();
      for (const n of i)
        n.parent = e;
    }
  else
    A.children.map(fP);
}
function xUA(A) {
  if (A instanceof Is && A.type === Ti.Main && A.numChildren() === 1) {
    const e = A.children[0];
    e instanceof IG || (e.swapWithParent(), xUA(A));
  }
}
const DP = "scale_", px = 5;
function GP(A) {
  for (const e of A) {
    for (const t of e.children)
      if (t.parent !== e)
        return !1;
    if (!GP(e.children))
      return !1;
  }
  return !0;
}
function fr(A, e) {
  let t = !1;
  for (const i of e)
    t = A.optimize(i) || t;
  return t;
}
function $hA(A, e, t) {
  let i = A.sources, n = !1;
  return n = fr(new xOe(), i) || n, n = fr(new FOe(e), i) || n, i = i.filter((o) => o.numChildren() > 0), n = fr(new HOe(), i) || n, i = i.filter((o) => o.numChildren() > 0), t || (n = fr(new LOe(), i) || n, n = fr(new WOe(e), i) || n, n = fr(new MOe(), i) || n, n = fr(new vOe(), i) || n, n = fr(new ZOe(), i) || n, n = fr(new SOe(), i) || n, n = fr(new ROe(), i) || n, n = fr(new KOe(), i) || n), A.sources = i, n;
}
function zOe(A, e) {
  GP(A.sources);
  let t = 0, i = 0;
  for (let n = 0; n < px && $hA(A, e, !0); n++)
    t++;
  A.sources.map(fP);
  for (let n = 0; n < px && $hA(A, e, !1); n++)
    i++;
  GP(A.sources), Math.max(t, i) === px && PA(`Maximum optimization runs(${px}) reached.`);
}
class ko {
  constructor(e) {
    Object.defineProperty(this, "signal", {
      enumerable: !0,
      get: e
    });
  }
  static fromName(e, t) {
    return new ko(() => e(t));
  }
}
function LUA(A) {
  xn(A) ? TOe(A) : _Oe(A);
}
function TOe(A) {
  const e = A.component.scales;
  for (const t of _A(e)) {
    const i = OOe(A, t);
    if (e[t].setWithExplicit("domains", i), POe(A, t), A.component.data.isFaceted) {
      let n = A;
      for (; !rC(n) && n.parent; )
        n = n.parent;
      if (n.component.resolve.scale[t] === "shared")
        for (const o of i.value)
          Zc(o) && (o.data = DP + o.data.replace(DP, ""));
    }
  }
}
function _Oe(A) {
  for (const t of A.children)
    LUA(t);
  const e = A.component.scales;
  for (const t of _A(e)) {
    let i, n = null;
    for (const o of A.children) {
      const g = o.component.scales[t];
      if (g) {
        i === void 0 ? i = g.getWithExplicit("domains") : i = sd(i, g.getWithExplicit("domains"), "domains", "scale", kP);
        const s = g.get("selectionExtent");
        n && s && n.param !== s.param && PA(X5e), n = s;
      }
    }
    e[t].setWithExplicit("domains", i), n && e[t].set("selectionExtent", n, !0);
  }
}
function qOe(A, e, t, i) {
  if (A === "unaggregated") {
    const { valid: n, reason: o } = AmA(e, t);
    if (!n) {
      PA(o);
      return;
    }
  } else if (A === void 0 && i.useUnaggregatedDomain) {
    const { valid: n } = AmA(e, t);
    if (n)
      return "unaggregated";
  }
  return A;
}
function OOe(A, e) {
  const t = A.getScaleComponent(e).get("type"), { encoding: i } = A, n = qOe(A.scaleDomain(e), A.typedFieldDef(e), t, A.config.scale);
  return n !== A.scaleDomain(e) && (A.specifiedScales[e] = {
    ...A.specifiedScales[e],
    domain: n
  }), e === "x" && co(i.x2) ? co(i.x) ? sd(DE(t, n, A, "x"), DE(t, n, A, "x2"), "domain", "scale", kP) : DE(t, n, A, "x2") : e === "y" && co(i.y2) ? co(i.y) ? sd(DE(t, n, A, "y"), DE(t, n, A, "y2"), "domain", "scale", kP) : DE(t, n, A, "y2") : DE(t, n, A, e);
}
function jOe(A, e, t) {
  return A.map((i) => ({ signal: `{data: ${DV(i, { timeUnit: t, type: e })}}` }));
}
function CT(A, e, t) {
  var i;
  const n = (i = vo(t)) == null ? void 0 : i.unit;
  return e === "temporal" || n ? jOe(A, e, n) : [A];
}
function DE(A, e, t, i) {
  const { encoding: n, markDef: o, mark: g, config: s, stack: I } = t, r = co(n[i]), { type: a } = r, C = r.timeUnit;
  if (cTe(e)) {
    const Q = DE(A, void 0, t, i), E = CT(e.unionWith, a, C);
    return CB([...E, ...Q.value]);
  } else {
    if (ke(e))
      return CB([e]);
    if (e && e !== "unaggregated" && !MKA(e))
      return CB(CT(e, a, C));
  }
  if (I && i === I.fieldChannel) {
    if (I.offset === "normalize")
      return Yr([[0, 1]]);
    const Q = t.requestDataName(Ti.Main);
    return Yr([
      {
        data: Q,
        field: t.vgField(i, { suffix: "start" })
      },
      {
        data: Q,
        field: t.vgField(i, { suffix: "end" })
      }
    ]);
  }
  const B = KQ(i) && jA(r) ? $Oe(t, i, A) : void 0;
  if (xl(r)) {
    const Q = CT([r.datum], a, C);
    return Yr(Q);
  }
  const l = r;
  if (e === "unaggregated") {
    const Q = t.requestDataName(Ti.Main), { field: E } = r;
    return Yr([
      {
        data: Q,
        field: se({ field: E, aggregate: "min" })
      },
      {
        data: Q,
        field: se({ field: E, aggregate: "max" })
      }
    ]);
  } else if (Oi(l.bin)) {
    if (Wo(A))
      return Yr(A === "bin-ordinal" ? [] : [
        {
          // If sort by aggregation of a specified sort field, we need to use RAW table,
          // so we can aggregate values for the scale independently from the main aggregation.
          data: c2(B) ? t.requestDataName(Ti.Main) : t.requestDataName(Ti.Raw),
          // Use range if we added it and the scale does not support computing a range as a signal.
          field: t.vgField(i, VF(l, i) ? { binSuffix: "range" } : {}),
          // we have to use a sort object if sort = true to make the sort correct by bin start
          sort: B === !0 || !ce(B) ? {
            field: t.vgField(i, {}),
            op: "min"
            // min or max doesn't matter since we sort by the start of the bin range
          } : B
        }
      ]);
    {
      const { bin: Q } = l;
      if (Oi(Q)) {
        const E = AgA(t, l.field, Q);
        return Yr([
          new ko(() => {
            const d = t.getSignalName(E);
            return `[${d}.start, ${d}.stop]`;
          })
        ]);
      } else
        return Yr([
          {
            data: t.requestDataName(Ti.Main),
            field: t.vgField(i, {})
          }
        ]);
    }
  } else if (l.timeUnit && Ht(["time", "utc"], A)) {
    const Q = n[Fl(i)];
    if (qKA(l, Q, o, s)) {
      const E = t.requestDataName(Ti.Main), d = gd({ fieldDef: l, fieldDef2: Q, markDef: o, config: s }), m = E2(g) && d !== 0.5 && qn(i);
      return Yr([
        {
          data: E,
          field: t.vgField(i, m ? { suffix: RV } : {})
        },
        {
          data: E,
          field: t.vgField(i, { suffix: m ? FV : "end" })
        }
      ]);
    }
  }
  return Yr(B ? [
    {
      // If sort by aggregation of a specified sort field, we need to use RAW table,
      // so we can aggregate values for the scale independently from the main aggregation.
      data: c2(B) ? t.requestDataName(Ti.Main) : t.requestDataName(Ti.Raw),
      field: t.vgField(i),
      sort: B
    }
  ] : [
    {
      data: t.requestDataName(Ti.Main),
      field: t.vgField(i)
    }
  ]);
}
function BT(A, e) {
  const { op: t, field: i, order: n } = A;
  return {
    // Apply default op
    op: t ?? (e ? "sum" : pV),
    // flatten nested fields
    ...i ? { field: Ir(i) } : {},
    ...n ? { order: n } : {}
  };
}
function POe(A, e) {
  var t;
  const i = A.component.scales[e], n = A.specifiedScales[e].domain, o = (t = A.fieldDef(e)) == null ? void 0 : t.bin, g = MKA(n) && n, s = Q0(o) && cV(o.extent) && o.extent;
  (g || s) && i.set("selectionExtent", g ?? s, !0);
}
function $Oe(A, e, t) {
  if (!Wo(t))
    return;
  const i = A.fieldDef(e), n = i.sort;
  if (TKA(n))
    return {
      op: "min",
      field: Xf(i, e),
      order: "ascending"
    };
  const { stack: o } = A, g = o ? /* @__PURE__ */ new Set([...o.groupbyFields, ...o.stackBy.map((s) => s.fieldDef.field)]) : void 0;
  if (OB(n)) {
    const s = o && !g.has(n.field);
    return BT(n, s);
  } else if (zKA(n)) {
    const { encoding: s, order: I } = n, r = A.fieldDef(s), { aggregate: a, field: C } = r, B = o && !g.has(C);
    if (hQ(a) || qd(a))
      return BT({
        field: se(r),
        order: I
      }, B);
    if (ioA(a) || !a)
      return BT({
        op: a,
        field: C,
        order: I
      }, B);
  } else {
    if (n === "descending")
      return {
        op: "min",
        field: A.vgField(e),
        order: "descending"
      };
    if (Ht([
      "ascending",
      void 0
      /* default =ascending*/
    ], n))
      return !0;
  }
}
function AmA(A, e) {
  const { aggregate: t, type: i } = A;
  return t ? Be(t) && !J5e.has(t) ? {
    valid: !1,
    reason: uze(t)
  } : i === "quantitative" && e === "log" ? {
    valid: !1,
    reason: dze(A)
  } : { valid: !0 } : {
    valid: !1,
    reason: Eze(A)
  };
}
function kP(A, e, t, i) {
  return A.explicit && e.explicit && PA(bze(t, i, A.value, e.value)), { explicit: A.explicit, value: [...A.value, ...e.value] };
}
function Aje(A) {
  const e = YB(A.map((g) => {
    if (Zc(g)) {
      const { sort: s, ...I } = g;
      return I;
    }
    return g;
  }), vt), t = YB(A.map((g) => {
    if (Zc(g)) {
      const s = g.sort;
      return s !== void 0 && !c2(s) && ("op" in s && s.op === "count" && delete s.field, s.order === "ascending" && delete s.order), s;
    }
  }).filter((g) => g !== void 0), vt);
  if (e.length === 0)
    return;
  if (e.length === 1) {
    const g = A[0];
    if (Zc(g) && t.length > 0) {
      let s = t[0];
      if (t.length > 1) {
        PA(ahA);
        const I = t.filter((r) => ce(r) && "op" in r && r.op !== "min");
        t.every((r) => ce(r) && "op" in r) && I.length === 1 ? s = I[0] : s = !0;
      } else if (ce(s) && "field" in s) {
        const I = s.field;
        g.field === I && (s = s.order ? { order: s.order } : !0);
      }
      return {
        ...g,
        sort: s
      };
    }
    return g;
  }
  const i = YB(t.map((g) => c2(g) || !("op" in g) || Be(g.op) && g.op in f5e ? g : (PA(fze(g)), !0)), vt);
  let n;
  i.length === 1 ? n = i[0] : i.length > 1 && (PA(ahA), n = !0);
  const o = YB(A.map((g) => Zc(g) ? g.data : null), (g) => g);
  return o.length === 1 && o[0] !== null ? {
    data: o[0],
    fields: e.map((g) => g.field),
    ...n ? { sort: n } : {}
  } : { fields: e, ...n ? { sort: n } : {} };
}
function ngA(A) {
  if (Zc(A) && Be(A.field))
    return A.field;
  if (N5e(A)) {
    let e;
    for (const t of A.fields)
      if (Zc(t) && Be(t.field)) {
        if (!e)
          e = t.field;
        else if (e !== t.field)
          return PA(Dze), e;
      }
    return PA(Gze), e;
  } else if (Y5e(A)) {
    PA(kze);
    const e = A.fields[0];
    return Be(e) ? e : void 0;
  }
}
function HV(A, e) {
  const t = A.component.scales[e].get("domains").map((i) => (Zc(i) && (i.data = A.lookupDataSource(i.data)), i));
  return Aje(t);
}
function vUA(A) {
  return rG(A) || ogA(A) ? A.children.reduce((e, t) => e.concat(vUA(t)), emA(A)) : emA(A);
}
function emA(A) {
  return _A(A.component.scales).reduce((e, t) => {
    const i = A.component.scales[t];
    if (i.merged)
      return e;
    const n = i.combine(), { name: o, type: g, selectionExtent: s, domains: I, range: r, reverse: a, ...C } = n, B = eje(n.range, o, t, A), l = HV(A, t), Q = s ? q4e(A, s, i, l) : null;
    return e.push({
      name: o,
      type: g,
      ...l ? { domain: l } : {},
      ...Q ? { domainRaw: Q } : {},
      range: B,
      ...a !== void 0 ? { reverse: a } : {},
      ...C
    }), e;
  }, []);
}
function eje(A, e, t, i) {
  if (qn(t)) {
    if (Od(A))
      return {
        step: { signal: `${e}_step` }
      };
  } else if (ce(A) && Zc(A))
    return {
      ...A,
      data: i.lookupDataSource(A.data)
    };
  return A;
}
class HUA extends VQ {
  constructor(e, t) {
    super(
      {},
      // no initial explicit property
      { name: e }
      // name as initial implicit property
    ), this.merged = !1, this.setWithExplicit("type", t);
  }
  /**
   * Whether the scale definitely includes zero in the domain
   */
  domainDefinitelyIncludesZero() {
    return this.get("zero") !== !1 ? !0 : pp(this.get("domains"), (e) => ZA(e) && e.length === 2 && ti(e[0]) && e[0] <= 0 && ti(e[1]) && e[1] >= 0);
  }
}
const tje = ["range", "scheme"];
function ije(A) {
  const e = A.component.scales;
  for (const t of lV) {
    const i = e[t];
    if (!i)
      continue;
    const n = nje(t, A);
    i.setWithExplicit("range", n);
  }
}
function tmA(A, e) {
  const t = A.fieldDef(e);
  if (t != null && t.bin) {
    const { bin: i, field: n } = t, o = $s(e), g = A.getName(o);
    if (ce(i) && i.binned && i.step !== void 0)
      return new ko(() => {
        const s = A.scaleName(e), I = `(domain("${s}")[1] - domain("${s}")[0]) / ${i.step}`;
        return `${A.getSignalName(g)} / (${I})`;
      });
    if (Oi(i)) {
      const s = AgA(A, n, i);
      return new ko(() => {
        const I = A.getSignalName(s), r = `(${I}.stop - ${I}.start) / ${I}.step`;
        return `${A.getSignalName(g)} / (${r})`;
      });
    }
  }
}
function nje(A, e) {
  const t = e.specifiedScales[A], { size: i } = e, n = e.getScaleComponent(A).get("type");
  for (const a of tje)
    if (t[a] !== void 0) {
      const C = BP(n, a), B = xKA(A, a);
      if (!C)
        PA(cKA(n, a, A));
      else if (B)
        PA(B);
      else
        switch (a) {
          case "range": {
            const l = t.range;
            if (ZA(l)) {
              if (qn(A))
                return CB(l.map((Q) => {
                  if (Q === "width" || Q === "height") {
                    const E = e.getName(Q), d = e.getSignalName.bind(e);
                    return ko.fromName(d, E);
                  }
                  return Q;
                }));
            } else if (ce(l))
              return CB({
                data: e.requestDataName(Ti.Main),
                field: l.field,
                sort: { op: "min", field: e.vgField(A) }
              });
            return CB(l);
          }
          case "scheme":
            return CB(oje(t[a]));
        }
    }
  const o = A === un || A === "xOffset" ? "width" : "height", g = i[o];
  if (ll(g)) {
    if (qn(A))
      if (Wo(n)) {
        const a = ZUA(g, e, A);
        if (a)
          return CB({ step: a });
      } else
        PA(QKA(o));
    else if (HF(A)) {
      const a = A === Vd ? "x" : "y";
      if (e.getScaleComponent(a).get("type") === "band") {
        const C = WUA(g, n);
        if (C)
          return CB(C);
      }
    }
  }
  const { rangeMin: s, rangeMax: I } = t, r = gje(A, e);
  return (s !== void 0 || I !== void 0) && // it's ok to check just rangeMin's compatibility since rangeMin/rangeMax are the same
  BP(n, "rangeMin") && ZA(r) && r.length === 2 ? CB([s ?? r[0], I ?? r[1]]) : Yr(r);
}
function oje(A) {
  return lTe(A) ? {
    scheme: A.name,
    ...Us(A, ["name"])
  } : { scheme: A };
}
function SUA(A, e, t, { center: i } = {}) {
  const n = $s(A), o = e.getName(n), g = e.getSignalName.bind(e);
  return A === Vo && ia(t) ? i ? [
    ko.fromName((s) => `${g(s)}/2`, o),
    ko.fromName((s) => `-${g(s)}/2`, o)
  ] : [ko.fromName(g, o), 0] : i ? [
    ko.fromName((s) => `-${g(s)}/2`, o),
    ko.fromName((s) => `${g(s)}/2`, o)
  ] : [0, ko.fromName(g, o)];
}
function gje(A, e) {
  const { size: t, config: i, mark: n, encoding: o } = e, { type: g } = co(o[A]), s = e.getScaleComponent(A).get("type"), { domain: I, domainMid: r } = e.specifiedScales[A];
  switch (A) {
    case un:
    case Vo: {
      if (Ht(["point", "band"], s)) {
        const a = KUA(A, t, i.view);
        if (ll(a))
          return { step: ZUA(a, e, A) };
      }
      return SUA(A, e, s);
    }
    case Vd:
    case nG:
      return sje(A, e, s);
    case ZQ: {
      const a = e.component.scales[A].get("zero"), C = UUA(n, a, i), B = rje(n, t, e, i);
      return Hf(s) ? aje(C, B, Ije(s, i, I, A)) : [C, B];
    }
    case cr:
      return [0, Math.PI * 2];
    case l0:
      return [0, 360];
    case RC:
      return [
        0,
        new ko(() => {
          const a = e.getSignalName("width"), C = e.getSignalName("height");
          return `min(${a},${C})/2`;
        })
      ];
    case Td:
      return [i.scale.minStrokeWidth, i.scale.maxStrokeWidth];
    case _d:
      return [
        // TODO: add this to Vega's config.range?
        [1, 0],
        [4, 2],
        [2, 1],
        [1, 1],
        [1, 2, 4, 2]
      ];
    case Ps:
      return "symbol";
    case js:
    case Yl:
    case Rl:
      return s === "ordinal" ? g === "nominal" ? "category" : "ordinal" : r !== void 0 ? "diverging" : n === "rect" || n === "geoshape" ? "heatmap" : "ramp";
    case WQ:
    case Xd:
    case zd:
      return [i.scale.minOpacity, i.scale.maxOpacity];
  }
}
function ZUA(A, e, t) {
  const { encoding: i } = e, n = e.getScaleComponent(t), o = $nA(t), g = i[o];
  if (D3A({ step: A, offsetIsDiscrete: at(g) && JKA(g.type) }) === "offset" && s3A(i, o)) {
    const s = e.getScaleComponent(o);
    let I = `domain('${e.scaleName(o)}').length`;
    if (s.get("type") === "band") {
      const a = s.get("paddingInner") ?? s.get("padding") ?? 0, C = s.get("paddingOuter") ?? s.get("padding") ?? 0;
      I = `bandspace(${I}, ${a}, ${C})`;
    }
    const r = n.get("paddingInner") ?? n.get("padding");
    return {
      signal: `${A.step} * ${I} / (1-${x5e(r)})`
    };
  } else
    return A.step;
}
function WUA(A, e) {
  if (D3A({ step: A, offsetIsDiscrete: Wo(e) }) === "offset")
    return { step: A.step };
}
function sje(A, e, t) {
  const i = A === Vd ? "x" : "y", n = e.getScaleComponent(i);
  if (!n)
    return SUA(i, e, t, { center: !0 });
  const o = n.get("type"), g = e.scaleName(i), { markDef: s, config: I } = e;
  if (o === "band") {
    const r = KUA(i, e.size, e.config.view);
    if (ll(r)) {
      const a = WUA(r, t);
      if (a)
        return a;
    }
    return [0, { signal: `bandwidth('${g}')` }];
  } else {
    const r = e.encoding[i];
    if (jA(r) && r.timeUnit) {
      const a = fKA(r.timeUnit, (Q) => `scale('${g}', ${Q})`), C = e.config.scale.bandWithNestedOffsetPaddingInner, B = gd({
        fieldDef: r,
        markDef: s,
        config: I
      }) - 0.5, l = B !== 0 ? ` + ${B}` : "";
      if (C) {
        const Q = ke(C) ? `${C.signal}/2` + l : `${C / 2 + B}`, E = ke(C) ? `(1 - ${C.signal}/2)` + l : `${1 - C / 2 + B}`;
        return [{ signal: `${Q} * (${a})` }, { signal: `${E} * (${a})` }];
      }
      return [0, { signal: a }];
    }
    return xWA(`Cannot use ${A} scale if ${i} scale is not discrete.`);
  }
}
function KUA(A, e, t) {
  const i = A === un ? "width" : "height";
  return e[i] || xZ(t, i);
}
function Ije(A, e, t, i) {
  switch (A) {
    case "quantile":
      return e.scale.quantileCount;
    case "quantize":
      return e.scale.quantizeCount;
    case "threshold":
      return t !== void 0 && ZA(t) ? t.length + 1 : (PA(vze(i)), 3);
  }
}
function aje(A, e, t) {
  const i = () => {
    const n = Or(e), o = Or(A), g = `(${n} - ${o}) / (${t} - 1)`;
    return `sequence(${o}, ${n} + ${g}, ${g})`;
  };
  return ke(e) ? new ko(i) : { signal: i() };
}
function UUA(A, e, t) {
  if (e)
    return ke(e) ? { signal: `${e.signal} ? 0 : ${UUA(A, !1, t)}` } : 0;
  switch (A) {
    case "bar":
    case "tick":
      return t.scale.minBandSize;
    case "line":
    case "trail":
    case "rule":
      return t.scale.minStrokeWidth;
    case "text":
      return t.scale.minFontSize;
    case "point":
    case "square":
    case "circle":
      return t.scale.minSize;
  }
  throw new Error(QV("size", A));
}
const imA = 0.95;
function rje(A, e, t, i) {
  const n = {
    x: tmA(t, "x"),
    y: tmA(t, "y")
  };
  switch (A) {
    case "bar":
    case "tick": {
      if (i.scale.maxBandSize !== void 0)
        return i.scale.maxBandSize;
      const o = nmA(e, n, i.view);
      return ti(o) ? o - 1 : new ko(() => `${o.signal} - 1`);
    }
    case "line":
    case "trail":
    case "rule":
      return i.scale.maxStrokeWidth;
    case "text":
      return i.scale.maxFontSize;
    case "point":
    case "square":
    case "circle": {
      if (i.scale.maxSize)
        return i.scale.maxSize;
      const o = nmA(e, n, i.view);
      return ti(o) ? Math.pow(imA * o, 2) : new ko(() => `pow(${imA} * ${o.signal}, 2)`);
    }
  }
  throw new Error(QV("size", A));
}
function nmA(A, e, t) {
  const i = ll(A.width) ? A.width.step : MZ(t, "width"), n = ll(A.height) ? A.height.step : MZ(t, "height");
  return e.x || e.y ? new ko(() => `min(${[
    e.x ? e.x.signal : i,
    e.y ? e.y.signal : n
  ].join(", ")})`) : Math.min(i, n);
}
function VUA(A, e) {
  xn(A) ? Cje(A, e) : zUA(A, e);
}
function Cje(A, e) {
  const t = A.component.scales, { config: i, encoding: n, markDef: o, specifiedScales: g } = A;
  for (const s of _A(t)) {
    const I = g[s], r = t[s], a = A.getScaleComponent(s), C = co(n[s]), B = I[e], l = a.get("type"), Q = a.get("padding"), E = a.get("paddingInner"), d = BP(l, e), m = xKA(s, e);
    if (B !== void 0 && (d ? m && PA(m) : PA(cKA(l, e, s))), d && m === void 0)
      if (B !== void 0) {
        const y = C.timeUnit, f = C.type;
        switch (e) {
          case "domainMax":
          case "domainMin":
            E0(I[e]) || f === "temporal" || y ? r.set(e, { signal: DV(I[e], { type: f, timeUnit: y }) }, !0) : r.set(e, I[e], !0);
            break;
          default:
            r.copyKeyFromObject(e, I);
        }
      } else {
        const y = e in omA ? omA[e]({
          model: A,
          channel: s,
          fieldOrDatumDef: C,
          scaleType: l,
          scalePadding: Q,
          scalePaddingInner: E,
          domain: I.domain,
          domainMin: I.domainMin,
          domainMax: I.domainMax,
          markDef: o,
          config: i,
          hasNestedOffsetScale: I3A(n, s),
          hasSecondaryRangeChannel: !!n[Fl(s)]
        }) : i.scale[e];
        y !== void 0 && r.set(e, y, !1);
      }
  }
}
const omA = {
  bins: ({ model: A, fieldOrDatumDef: e }) => jA(e) ? Bje(A, e) : void 0,
  interpolate: ({ channel: A, fieldOrDatumDef: e }) => lje(A, e.type),
  nice: ({ scaleType: A, channel: e, domain: t, domainMin: i, domainMax: n, fieldOrDatumDef: o }) => cje(A, e, t, i, n, o),
  padding: ({ channel: A, scaleType: e, fieldOrDatumDef: t, markDef: i, config: n }) => Qje(A, e, n.scale, t, i, n.bar),
  paddingInner: ({ scalePadding: A, channel: e, markDef: t, scaleType: i, config: n, hasNestedOffsetScale: o }) => Eje(A, e, t.type, i, n.scale, o),
  paddingOuter: ({ scalePadding: A, channel: e, scaleType: t, scalePaddingInner: i, config: n, hasNestedOffsetScale: o }) => uje(A, e, t, i, n.scale, o),
  reverse: ({ fieldOrDatumDef: A, scaleType: e, channel: t, config: i }) => {
    const n = jA(A) ? A.sort : void 0;
    return dje(e, n, t, i.scale);
  },
  zero: ({ channel: A, fieldOrDatumDef: e, domain: t, markDef: i, scaleType: n, config: o, hasSecondaryRangeChannel: g }) => hje(A, e, t, i, n, o.scale, g)
};
function XUA(A) {
  xn(A) ? ije(A) : zUA(A, "range");
}
function zUA(A, e) {
  const t = A.component.scales;
  for (const i of A.children)
    e === "range" ? XUA(i) : VUA(i, e);
  for (const i of _A(t)) {
    let n;
    for (const o of A.children) {
      const g = o.component.scales[i];
      if (g) {
        const s = g.getWithExplicit(e);
        n = sd(n, s, e, "scale", S3A((I, r) => {
          switch (e) {
            case "range":
              return I.step && r.step ? I.step - r.step : 0;
          }
          return 0;
        }));
      }
    }
    t[i].setWithExplicit(e, n);
  }
}
function Bje(A, e) {
  const t = e.bin;
  if (Oi(t)) {
    const i = AgA(A, e.field, t);
    return new ko(() => A.getSignalName(i));
  } else if (qo(t) && Q0(t) && t.step !== void 0)
    return {
      step: t.step
    };
}
function lje(A, e) {
  if (Ht([js, Yl, Rl], A) && e !== "nominal")
    return "hcl";
}
function cje(A, e, t, i, n, o) {
  var g;
  if (!((g = Bl(o)) != null && g.bin || ZA(t) || n != null || i != null || Ht([Vs.TIME, Vs.UTC], A)))
    return qn(e) ? !0 : void 0;
}
function Qje(A, e, t, i, n, o) {
  if (qn(A)) {
    if (jr(e)) {
      if (t.continuousPadding !== void 0)
        return t.continuousPadding;
      const { type: g, orient: s } = n;
      if (g === "bar" && !(jA(i) && (i.bin || i.timeUnit)) && (s === "vertical" && A === "x" || s === "horizontal" && A === "y"))
        return o.continuousBandSize;
    }
    if (e === Vs.POINT)
      return t.pointPadding;
  }
}
function Eje(A, e, t, i, n, o = !1) {
  if (A === void 0) {
    if (qn(e)) {
      const { bandPaddingInner: g, barBandPaddingInner: s, rectBandPaddingInner: I, bandWithNestedOffsetPaddingInner: r } = n;
      return o ? r : _n(g, t === "bar" ? s : I);
    } else if (HF(e) && i === Vs.BAND)
      return n.offsetBandPaddingInner;
  }
}
function uje(A, e, t, i, n, o = !1) {
  if (A === void 0) {
    if (qn(e)) {
      const { bandPaddingOuter: g, bandWithNestedOffsetPaddingOuter: s } = n;
      if (o)
        return s;
      if (t === Vs.BAND)
        return _n(
          g,
          /* By default, paddingOuter is paddingInner / 2. The reason is that
            size (width/height) = step * (cardinality - paddingInner + 2 * paddingOuter).
            and we want the width/height to be integer by default.
            Note that step (by default) and cardinality are integers.) */
          ke(i) ? { signal: `${i.signal}/2` } : i / 2
        );
    } else if (HF(e)) {
      if (t === Vs.POINT)
        return 0.5;
      if (t === Vs.BAND)
        return n.offsetBandPaddingOuter;
    }
  }
}
function dje(A, e, t, i) {
  if (t === "x" && i.xReverse !== void 0)
    return ia(A) && e === "descending" ? ke(i.xReverse) ? { signal: `!${i.xReverse.signal}` } : !i.xReverse : i.xReverse;
  if (ia(A) && e === "descending")
    return !0;
}
function hje(A, e, t, i, n, o, g) {
  if (t && t !== "unaggregated" && ia(n)) {
    if (ZA(t)) {
      const s = t[0], I = t[t.length - 1];
      if (ti(s) && s <= 0 && ti(I) && I >= 0)
        return !0;
    }
    return !1;
  }
  if (A === "size" && e.type === "quantitative" && !Hf(n))
    return !0;
  if (!(jA(e) && e.bin) && Ht([...Ml, ...u5e], A)) {
    const { orient: s, type: I } = i;
    return Ht(["bar", "area", "line", "trail"], I) && (s === "horizontal" && A === "y" || s === "vertical" && A === "x") ? !1 : Ht(["bar", "area"], I) && !g ? !0 : o == null ? void 0 : o.zero;
  }
  return !1;
}
function mje(A, e, t, i, n = !1) {
  const o = pje(e, t, i, n), { type: g } = A;
  return KQ(e) ? g !== void 0 ? mTe(e, g) ? jA(t) && !hTe(g, t.type) ? (PA(pze(g, o)), o) : g : (PA(mze(e, g, o)), o) : o : null;
}
function pje(A, e, t, i) {
  var n;
  switch (e.type) {
    case "nominal":
    case "ordinal": {
      if (cw(A) || iT(A) === "discrete")
        return A === "shape" && e.type === "ordinal" && PA(nT(A, "ordinal")), "ordinal";
      if (qn(A) || HF(A)) {
        if (Ht(["rect", "bar", "image", "rule"], t.type) || i)
          return "band";
      } else if (t.type === "arc" && A in toA)
        return "band";
      const o = t[$s(A)];
      return Dp(o) || Zf(e) && (n = e.axis) != null && n.tickBand ? "band" : "point";
    }
    case "temporal":
      return cw(A) ? "time" : iT(A) === "discrete" ? (PA(nT(A, "temporal")), "ordinal") : jA(e) && e.timeUnit && vo(e.timeUnit).utc ? "utc" : "time";
    case "quantitative":
      return cw(A) ? jA(e) && Oi(e.bin) ? "bin-ordinal" : "linear" : iT(A) === "discrete" ? (PA(nT(A, "quantitative")), "ordinal") : "linear";
    case "geojson":
      return;
  }
  throw new Error(BKA(e.type));
}
function yje(A, { ignoreRange: e } = {}) {
  TUA(A), LUA(A);
  for (const t of dTe)
    VUA(A, t);
  e || XUA(A);
}
function TUA(A) {
  xn(A) ? A.component.scales = bje(A) : A.component.scales = fje(A);
}
function bje(A) {
  const { encoding: e, mark: t, markDef: i } = A, n = {};
  for (const o of lV) {
    const g = co(e[o]);
    if (g && t === HKA && o === Ps && g.type === oG)
      continue;
    let s = g && g.scale;
    if (g && s !== null && s !== !1) {
      s ?? (s = {});
      const I = I3A(e, o), r = mje(s, o, g, i, I);
      n[o] = new HUA(A.scaleName(`${o}`, !0), {
        value: r,
        explicit: s.type === r
      });
    }
  }
  return n;
}
const wje = S3A((A, e) => ChA(A) - ChA(e));
function fje(A) {
  var e;
  const t = A.component.scales = {}, i = {}, n = A.component.resolve;
  for (const o of A.children) {
    TUA(o);
    for (const g of _A(o.component.scales))
      if ((e = n.scale)[g] ?? (e[g] = bUA(g, A)), n.scale[g] === "shared") {
        const s = i[g], I = o.component.scales[g].getWithExplicit("type");
        s ? ITe(s.value, I.value) ? i[g] = sd(s, I, "type", "scale", wje) : (n.scale[g] = "independent", delete i[g]) : i[g] = I;
      }
  }
  for (const o of _A(i)) {
    const g = A.scaleName(o, !0), s = i[o];
    t[o] = new HUA(g, s);
    for (const I of A.children) {
      const r = I.component.scales[o];
      r && (I.renameScale(r.get("name"), g), r.merged = !0);
    }
  }
  return t;
}
class lT {
  constructor() {
    this.nameMap = {};
  }
  rename(e, t) {
    this.nameMap[e] = t;
  }
  has(e) {
    return this.nameMap[e] !== void 0;
  }
  get(e) {
    for (; this.nameMap[e] && e !== this.nameMap[e]; )
      e = this.nameMap[e];
    return e;
  }
}
function xn(A) {
  return (A == null ? void 0 : A.type) === "unit";
}
function rC(A) {
  return (A == null ? void 0 : A.type) === "facet";
}
function ogA(A) {
  return (A == null ? void 0 : A.type) === "concat";
}
function rG(A) {
  return (A == null ? void 0 : A.type) === "layer";
}
class ggA {
  constructor(e, t, i, n, o, g, s) {
    this.type = t, this.parent = i, this.config = o, this.correctDataNames = (I) => {
      var r, a, C;
      return (r = I.from) != null && r.data && (I.from.data = this.lookupDataSource(I.from.data)), (C = (a = I.from) == null ? void 0 : a.facet) != null && C.data && (I.from.facet.data = this.lookupDataSource(I.from.facet.data)), I;
    }, this.parent = i, this.config = o, this.view = Ys(s), this.name = e.name ?? n, this.title = LE(e.title) ? { text: e.title } : e.title ? Ys(e.title) : void 0, this.scaleNameMap = i ? i.scaleNameMap : new lT(), this.projectionNameMap = i ? i.projectionNameMap : new lT(), this.signalNameMap = i ? i.signalNameMap : new lT(), this.data = e.data, this.description = e.description, this.transforms = R4e(e.transform ?? []), this.layout = t === "layer" || t === "unit" ? {} : L_e(e, t, o), this.component = {
      data: {
        sources: i ? i.component.data.sources : [],
        outputNodes: i ? i.component.data.outputNodes : {},
        outputNodeRefCounts: i ? i.component.data.outputNodeRefCounts : {},
        // data is faceted if the spec is a facet spec or the parent has faceted data and data is undefined
        isFaceted: yV(e) || (i == null ? void 0 : i.component.data.isFaceted) && e.data === void 0
      },
      layoutSize: new VQ(),
      layoutHeaders: { row: {}, column: {}, facet: {} },
      mark: null,
      resolve: {
        scale: {},
        axis: {},
        legend: {},
        ...g ? tt(g) : {}
      },
      selection: null,
      scales: null,
      projection: null,
      axes: {},
      legends: {}
    };
  }
  get width() {
    return this.getSizeSignalRef("width");
  }
  get height() {
    return this.getSizeSignalRef("height");
  }
  parse() {
    this.parseScale(), this.parseLayoutSize(), this.renameTopLevelLayoutSizeSignal(), this.parseSelections(), this.parseProjection(), this.parseData(), this.parseAxesAndHeaders(), this.parseLegends(), this.parseMarkGroup();
  }
  parseScale() {
    yje(this);
  }
  parseProjection() {
    FUA(this);
  }
  /**
   * Rename top-level spec's size to be just width / height, ignoring model name.
   * This essentially merges the top-level spec's width/height signals with the width/height signals
   * to help us reduce redundant signals declaration.
   */
  renameTopLevelLayoutSizeSignal() {
    this.getName("width") !== "width" && this.renameSignal(this.getName("width"), "width"), this.getName("height") !== "height" && this.renameSignal(this.getName("height"), "height");
  }
  parseLegends() {
    kUA(this);
  }
  assembleEncodeFromView(e) {
    const { style: t, ...i } = e, n = {};
    for (const o of _A(i)) {
      const g = i[o];
      g !== void 0 && (n[o] = sn(g));
    }
    return n;
  }
  assembleGroupEncodeEntry(e) {
    let t = {};
    return this.view && (t = this.assembleEncodeFromView(this.view)), !e && (this.description && (t.description = sn(this.description)), this.type === "unit" || this.type === "layer") ? {
      width: this.getSizeSignalRef("width"),
      height: this.getSizeSignalRef("height"),
      ...t ?? {}
    } : Fi(t) ? void 0 : t;
  }
  assembleLayout() {
    if (!this.layout)
      return;
    const { spacing: e, ...t } = this.layout, { component: i, config: n } = this, o = zqe(i.layoutHeaders, n);
    return {
      padding: e,
      ...this.assembleDefaultLayout(),
      ...t,
      ...o ? { titleBand: o } : {}
    };
  }
  assembleDefaultLayout() {
    return {};
  }
  assembleHeaderMarks() {
    const { layoutHeaders: e } = this.component;
    let t = [];
    for (const i of Ua)
      e[i].title && t.push(Zqe(this, i));
    for (const i of OoA)
      t = t.concat(Wqe(this, i));
    return t;
  }
  assembleAxes() {
    return Gqe(this.component.axes, this.config);
  }
  assembleLegends() {
    return NUA(this);
  }
  assembleProjections() {
    return QOe(this);
  }
  assembleTitle() {
    const { encoding: e, ...t } = this.title ?? {}, i = {
      ...iKA(this.config.title).nonMarkTitleProperties,
      ...t,
      ...e ? { encode: { update: e } } : {}
    };
    if (i.text)
      return Ht(["unit", "layer"], this.type) ? Ht(["middle", void 0], i.anchor) && (i.frame ?? (i.frame = "group")) : i.anchor ?? (i.anchor = "start"), Fi(i) ? void 0 : i;
  }
  /**
   * Assemble the mark group for this model. We accept optional `signals` so that we can include concat top-level signals with the top-level model's local signals.
   */
  assembleGroup(e = []) {
    const t = {};
    e = e.concat(this.assembleSignals()), e.length > 0 && (t.signals = e);
    const i = this.assembleLayout();
    i && (t.layout = i), t.marks = [].concat(this.assembleHeaderMarks(), this.assembleMarks());
    const n = !this.parent || rC(this.parent) ? vUA(this) : [];
    n.length > 0 && (t.scales = n);
    const o = this.assembleAxes();
    o.length > 0 && (t.axes = o);
    const g = this.assembleLegends();
    return g.length > 0 && (t.legends = g), t;
  }
  getName(e) {
    return En((this.name ? `${this.name}_` : "") + e);
  }
  getDataName(e) {
    return this.getName(Ti[e].toLowerCase());
  }
  /**
   * Request a data source name for the given data source type and mark that data source as required.
   * This method should be called in parse, so that all used data source can be correctly instantiated in assembleData().
   * You can lookup the correct dataset name in assemble with `lookupDataSource`.
   */
  requestDataName(e) {
    const t = this.getDataName(e), i = this.component.data.outputNodeRefCounts;
    return i[t] = (i[t] || 0) + 1, t;
  }
  getSizeSignalRef(e) {
    if (rC(this.parent)) {
      const t = pUA(e), i = BV(t), n = this.component.scales[i];
      if (n && !n.merged) {
        const o = n.get("type"), g = n.get("range");
        if (Wo(o) && Od(g)) {
          const s = n.get("name"), I = HV(this, i), r = ngA(I);
          if (r) {
            const a = se({ aggregate: "distinct", field: r }, { expr: "datum" });
            return {
              signal: mUA(s, n, a)
            };
          } else
            return PA(ooA(i)), null;
        }
      }
    }
    return {
      signal: this.signalNameMap.get(this.getName(e))
    };
  }
  /**
   * Lookup the name of the datasource for an output node. You probably want to call this in assemble.
   */
  lookupDataSource(e) {
    const t = this.component.data.outputNodes[e];
    return t ? t.getSource() : e;
  }
  getSignalName(e) {
    return this.signalNameMap.get(e);
  }
  renameSignal(e, t) {
    this.signalNameMap.rename(e, t);
  }
  renameScale(e, t) {
    this.scaleNameMap.rename(e, t);
  }
  renameProjection(e, t) {
    this.projectionNameMap.rename(e, t);
  }
  /**
   * @return scale name for a given channel after the scale has been parsed and named.
   */
  scaleName(e, t) {
    if (t)
      return this.getName(e);
    if (
      // If there is a scale for the channel, there should be a local scale component for it
      _WA(e) && KQ(e) && this.component.scales[e] || // in the scale name map (the scale get merged by its parent)
      this.scaleNameMap.has(this.getName(e))
    )
      return this.scaleNameMap.get(this.getName(e));
  }
  /**
   * @return projection name after the projection has been parsed and named.
   */
  projectionName(e) {
    if (e)
      return this.getName("projection");
    if (this.component.projection && !this.component.projection.merged || this.projectionNameMap.has(this.getName("projection")))
      return this.projectionNameMap.get(this.getName("projection"));
  }
  /**
   * Traverse a model's hierarchy to get the scale component for a particular channel.
   */
  getScaleComponent(e) {
    if (!this.component.scales)
      throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");
    const t = this.component.scales[e];
    return t && !t.merged ? t : this.parent ? this.parent.getScaleComponent(e) : void 0;
  }
  /**
   * Traverse a model's hierarchy to get a particular selection component.
   */
  getSelectionComponent(e, t) {
    let i = this.component.selection[e];
    if (!i && this.parent && (i = this.parent.getSelectionComponent(e, t)), !i)
      throw new Error(Z5e(t));
    return i;
  }
  /**
   * Returns true if the model has a signalRef for an axis orient.
   */
  hasAxisOrientSignalRef() {
    var e, t;
    return ((e = this.component.axes.x) == null ? void 0 : e.some((i) => i.hasOrientSignalRef())) || ((t = this.component.axes.y) == null ? void 0 : t.some((i) => i.hasOrientSignalRef()));
  }
}
class _UA extends ggA {
  /** Get "field" reference for Vega */
  vgField(e, t = {}) {
    const i = this.fieldDef(e);
    if (i)
      return se(i, t);
  }
  reduceFieldDef(e, t) {
    return C_e(this.getMapping(), (i, n, o) => {
      const g = Bl(n);
      return g ? e(i, g, o) : i;
    }, t);
  }
  forEachFieldDef(e, t) {
    RoA(this.getMapping(), (i, n) => {
      const o = Bl(i);
      o && e(o, n);
    }, t);
  }
}
class SV extends Yi {
  clone() {
    return new SV(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t, this.transform = tt(t);
    const i = this.transform.as ?? [void 0, void 0];
    this.transform.as = [i[0] ?? "value", i[1] ?? "density"];
  }
  dependentFields() {
    return /* @__PURE__ */ new Set([this.transform.density, ...this.transform.groupby ?? []]);
  }
  producedFields() {
    return new Set(this.transform.as);
  }
  hash() {
    return `DensityTransform ${vt(this.transform)}`;
  }
  assemble() {
    const { density: e, ...t } = this.transform, i = {
      type: "kde",
      field: e,
      ...t
    };
    return this.transform.groupby && (i.resolve = "shared"), i;
  }
}
class ZV extends Yi {
  clone() {
    return new ZV(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t, this.transform = tt(t);
  }
  dependentFields() {
    return /* @__PURE__ */ new Set([this.transform.extent]);
  }
  producedFields() {
    return /* @__PURE__ */ new Set([]);
  }
  hash() {
    return `ExtentTransform ${vt(this.transform)}`;
  }
  assemble() {
    const { extent: e, param: t } = this.transform;
    return {
      type: "extent",
      field: e,
      signal: t
    };
  }
}
class d2 extends Yi {
  clone() {
    return new d2(null, { ...this.filter });
  }
  constructor(e, t) {
    super(e), this.filter = t;
  }
  static make(e, t) {
    const { config: i, mark: n, markDef: o } = t;
    if (bi("invalid", o, i) !== "filter")
      return null;
    const g = t.reduceFieldDef((s, I, r) => {
      const a = KQ(r) && t.getScaleComponent(r);
      if (a) {
        const C = a.get("type");
        ia(C) && I.aggregate !== "count" && !jd(n) && (s[I.field] = I);
      }
      return s;
    }, {});
    return _A(g).length ? new d2(e, g) : null;
  }
  dependentFields() {
    return new Set(_A(this.filter));
  }
  producedFields() {
    return /* @__PURE__ */ new Set();
  }
  hash() {
    return `FilterInvalid ${vt(this.filter)}`;
  }
  /**
   * Create the VgTransforms for each of the filtered fields.
   */
  assemble() {
    const e = _A(this.filter).reduce((t, i) => {
      const n = this.filter[i], o = se(n, { expr: "datum" });
      return n !== null && (n.type === "temporal" ? t.push(`(isDate(${o}) || (isValid(${o}) && isFinite(+${o})))`) : n.type === "quantitative" && (t.push(`isValid(${o})`), t.push(`isFinite(+${o})`))), t;
    }, []);
    return e.length > 0 ? {
      type: "filter",
      expr: e.join(" && ")
    } : null;
  }
}
class WV extends Yi {
  clone() {
    return new WV(this.parent, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t, this.transform = tt(t);
    const { flatten: i, as: n = [] } = this.transform;
    this.transform.as = i.map((o, g) => n[g] ?? o);
  }
  dependentFields() {
    return new Set(this.transform.flatten);
  }
  producedFields() {
    return new Set(this.transform.as);
  }
  hash() {
    return `FlattenTransform ${vt(this.transform)}`;
  }
  assemble() {
    const { flatten: e, as: t } = this.transform;
    return {
      type: "flatten",
      fields: e,
      as: t
    };
  }
}
class KV extends Yi {
  clone() {
    return new KV(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t, this.transform = tt(t);
    const i = this.transform.as ?? [void 0, void 0];
    this.transform.as = [i[0] ?? "key", i[1] ?? "value"];
  }
  dependentFields() {
    return new Set(this.transform.fold);
  }
  producedFields() {
    return new Set(this.transform.as);
  }
  hash() {
    return `FoldTransform ${vt(this.transform)}`;
  }
  assemble() {
    const { fold: e, as: t } = this.transform;
    return {
      type: "fold",
      fields: e,
      as: t
    };
  }
}
class uw extends Yi {
  clone() {
    return new uw(null, tt(this.fields), this.geojson, this.signal);
  }
  static parseAll(e, t) {
    if (t.component.projection && !t.component.projection.isFit)
      return e;
    let i = 0;
    for (const n of [
      [MC, FC],
      [ar, xC]
    ]) {
      const o = n.map((g) => {
        const s = co(t.encoding[g]);
        return jA(s) ? s.field : xl(s) ? { expr: `${s.datum}` } : yC(s) ? { expr: `${s.value}` } : void 0;
      });
      (o[0] || o[1]) && (e = new uw(e, o, null, t.getName(`geojson_${i++}`)));
    }
    if (t.channelHasField(Ps)) {
      const n = t.typedFieldDef(Ps);
      n.type === oG && (e = new uw(e, null, n.field, t.getName(`geojson_${i++}`)));
    }
    return e;
  }
  constructor(e, t, i, n) {
    super(e), this.fields = t, this.geojson = i, this.signal = n;
  }
  dependentFields() {
    const e = (this.fields ?? []).filter(Be);
    return /* @__PURE__ */ new Set([...this.geojson ? [this.geojson] : [], ...e]);
  }
  producedFields() {
    return /* @__PURE__ */ new Set();
  }
  hash() {
    return `GeoJSON ${this.geojson} ${this.signal} ${vt(this.fields)}`;
  }
  assemble() {
    return [
      ...this.geojson ? [
        {
          type: "filter",
          expr: `isValid(datum["${this.geojson}"])`
        }
      ] : [],
      {
        type: "geojson",
        ...this.fields ? { fields: this.fields } : {},
        ...this.geojson ? { geojson: this.geojson } : {},
        signal: this.signal
      }
    ];
  }
}
class h2 extends Yi {
  clone() {
    return new h2(null, this.projection, tt(this.fields), tt(this.as));
  }
  constructor(e, t, i, n) {
    super(e), this.projection = t, this.fields = i, this.as = n;
  }
  static parseAll(e, t) {
    if (!t.projectionName())
      return e;
    for (const i of [
      [MC, FC],
      [ar, xC]
    ]) {
      const n = i.map((g) => {
        const s = co(t.encoding[g]);
        return jA(s) ? s.field : xl(s) ? { expr: `${s.datum}` } : yC(s) ? { expr: `${s.value}` } : void 0;
      }), o = i[0] === ar ? "2" : "";
      (n[0] || n[1]) && (e = new h2(e, t.projectionName(), n, [
        t.getName(`x${o}`),
        t.getName(`y${o}`)
      ]));
    }
    return e;
  }
  dependentFields() {
    return new Set(this.fields.filter(Be));
  }
  producedFields() {
    return new Set(this.as);
  }
  hash() {
    return `Geopoint ${this.projection} ${vt(this.fields)} ${vt(this.as)}`;
  }
  assemble() {
    return {
      type: "geopoint",
      projection: this.projection,
      fields: this.fields,
      as: this.as
    };
  }
}
class Wm extends Yi {
  clone() {
    return new Wm(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t;
  }
  dependentFields() {
    return /* @__PURE__ */ new Set([this.transform.impute, this.transform.key, ...this.transform.groupby ?? []]);
  }
  producedFields() {
    return /* @__PURE__ */ new Set([this.transform.impute]);
  }
  processSequence(e) {
    const { start: t = 0, stop: i, step: n } = e;
    return { signal: `sequence(${[t, i, ...n ? [n] : []].join(",")})` };
  }
  static makeFromTransform(e, t) {
    return new Wm(e, t);
  }
  static makeFromEncoding(e, t) {
    const i = t.encoding, n = i.x, o = i.y;
    if (jA(n) && jA(o)) {
      const g = n.impute ? n : o.impute ? o : void 0;
      if (g === void 0)
        return;
      const s = n.impute ? o : o.impute ? n : void 0, { method: I, value: r, frame: a, keyvals: C } = g.impute, B = r3A(t.mark, i);
      return new Wm(e, {
        impute: g.field,
        key: s.field,
        ...I ? { method: I } : {},
        ...r !== void 0 ? { value: r } : {},
        ...a ? { frame: a } : {},
        ...C !== void 0 ? { keyvals: C } : {},
        ...B.length ? { groupby: B } : {}
      });
    }
    return null;
  }
  hash() {
    return `Impute ${vt(this.transform)}`;
  }
  assemble() {
    const { impute: e, key: t, keyvals: i, method: n, groupby: o, value: g, frame: s = [null, null] } = this.transform, I = {
      type: "impute",
      field: e,
      key: t,
      ...i ? { keyvals: l4e(i) ? this.processSequence(i) : i } : {},
      method: "value",
      ...o ? { groupby: o } : {},
      value: !n || n === "value" ? g : null
    };
    if (n && n !== "value") {
      const r = {
        type: "window",
        as: [`imputed_${e}_value`],
        ops: [n],
        fields: [e],
        frame: s,
        ignorePeers: !1,
        ...o ? { groupby: o } : {}
      }, a = {
        type: "formula",
        expr: `datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,
        as: e
      };
      return [I, r, a];
    } else
      return [I];
  }
}
class UV extends Yi {
  clone() {
    return new UV(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t, this.transform = tt(t);
    const i = this.transform.as ?? [void 0, void 0];
    this.transform.as = [i[0] ?? t.on, i[1] ?? t.loess];
  }
  dependentFields() {
    return /* @__PURE__ */ new Set([this.transform.loess, this.transform.on, ...this.transform.groupby ?? []]);
  }
  producedFields() {
    return new Set(this.transform.as);
  }
  hash() {
    return `LoessTransform ${vt(this.transform)}`;
  }
  assemble() {
    const { loess: e, on: t, ...i } = this.transform;
    return {
      type: "loess",
      x: t,
      y: e,
      ...i
    };
  }
}
class m2 extends Yi {
  clone() {
    return new m2(null, tt(this.transform), this.secondary);
  }
  constructor(e, t, i) {
    super(e), this.transform = t, this.secondary = i;
  }
  static make(e, t, i, n) {
    const o = t.component.data.sources, { from: g } = i;
    let s = null;
    if (c4e(g)) {
      let I = jUA(g.data, o);
      I || (I = new Np(g.data), o.push(I));
      const r = t.getName(`lookup_${n}`);
      s = new Is(I, r, Ti.Lookup, t.component.data.outputNodeRefCounts), t.component.data.outputNodes[r] = s;
    } else if (Q4e(g)) {
      const I = g.param;
      i = { as: I, ...i };
      let r;
      try {
        r = t.getSelectionComponent(En(I), I);
      } catch {
        throw new Error(U5e(I));
      }
      if (s = r.materialized, !s)
        throw new Error(V5e(I));
    }
    return new m2(e, i, s.getSource());
  }
  dependentFields() {
    return /* @__PURE__ */ new Set([this.transform.lookup]);
  }
  producedFields() {
    return new Set(this.transform.as ? Ce(this.transform.as) : this.transform.from.fields);
  }
  hash() {
    return `Lookup ${vt({ transform: this.transform, secondary: this.secondary })}`;
  }
  assemble() {
    let e;
    if (this.transform.from.fields)
      e = {
        values: this.transform.from.fields,
        ...this.transform.as ? { as: Ce(this.transform.as) } : {}
      };
    else {
      let t = this.transform.as;
      Be(t) || (PA(P5e), t = "_lookup"), e = {
        as: [t]
      };
    }
    return {
      type: "lookup",
      from: this.secondary,
      key: this.transform.from.key,
      fields: [this.transform.lookup],
      ...e,
      ...this.transform.default ? { default: this.transform.default } : {}
    };
  }
}
class VV extends Yi {
  clone() {
    return new VV(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t, this.transform = tt(t);
    const i = this.transform.as ?? [void 0, void 0];
    this.transform.as = [i[0] ?? "prob", i[1] ?? "value"];
  }
  dependentFields() {
    return /* @__PURE__ */ new Set([this.transform.quantile, ...this.transform.groupby ?? []]);
  }
  producedFields() {
    return new Set(this.transform.as);
  }
  hash() {
    return `QuantileTransform ${vt(this.transform)}`;
  }
  assemble() {
    const { quantile: e, ...t } = this.transform;
    return {
      type: "quantile",
      field: e,
      ...t
    };
  }
}
class XV extends Yi {
  clone() {
    return new XV(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t, this.transform = tt(t);
    const i = this.transform.as ?? [void 0, void 0];
    this.transform.as = [i[0] ?? t.on, i[1] ?? t.regression];
  }
  dependentFields() {
    return /* @__PURE__ */ new Set([this.transform.regression, this.transform.on, ...this.transform.groupby ?? []]);
  }
  producedFields() {
    return new Set(this.transform.as);
  }
  hash() {
    return `RegressionTransform ${vt(this.transform)}`;
  }
  assemble() {
    const { regression: e, on: t, ...i } = this.transform;
    return {
      type: "regression",
      x: t,
      y: e,
      ...i
    };
  }
}
class zV extends Yi {
  clone() {
    return new zV(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t;
  }
  addDimensions(e) {
    this.transform.groupby = YB((this.transform.groupby ?? []).concat(e), (t) => t);
  }
  producedFields() {
  }
  dependentFields() {
    return /* @__PURE__ */ new Set([this.transform.pivot, this.transform.value, ...this.transform.groupby ?? []]);
  }
  hash() {
    return `PivotTransform ${vt(this.transform)}`;
  }
  assemble() {
    const { pivot: e, value: t, groupby: i, limit: n, op: o } = this.transform;
    return {
      type: "pivot",
      field: e,
      value: t,
      ...n !== void 0 ? { limit: n } : {},
      ...o !== void 0 ? { op: o } : {},
      ...i !== void 0 ? { groupby: i } : {}
    };
  }
}
class TV extends Yi {
  clone() {
    return new TV(null, tt(this.transform));
  }
  constructor(e, t) {
    super(e), this.transform = t;
  }
  dependentFields() {
    return /* @__PURE__ */ new Set();
  }
  producedFields() {
    return /* @__PURE__ */ new Set();
  }
  hash() {
    return `SampleTransform ${vt(this.transform)}`;
  }
  assemble() {
    return {
      type: "sample",
      size: this.transform.sample
    };
  }
}
function qUA(A) {
  let e = 0;
  function t(i, n) {
    if (i instanceof Np && !i.isGenerator && !Kf(i.data) && (A.push(n), n = {
      name: null,
      source: n.name,
      transform: []
    }), i instanceof wg && (i.parent instanceof Np && !n.source ? (n.format = {
      ...n.format ?? {},
      parse: i.assembleFormatParse()
    }, n.transform.push(...i.assembleTransforms(!0))) : n.transform.push(...i.assembleTransforms())), i instanceof IG) {
      n.name || (n.name = `data_${e++}`), !n.source || n.transform.length > 0 ? (A.push(n), i.data = n.name) : i.data = n.source, A.push(...i.assemble());
      return;
    }
    switch ((i instanceof TF || i instanceof _F || i instanceof d2 || i instanceof sG || i instanceof Vf || i instanceof h2 || i instanceof aC || i instanceof m2 || i instanceof aG || i instanceof m0 || i instanceof KV || i instanceof WV || i instanceof SV || i instanceof UV || i instanceof VV || i instanceof XV || i instanceof rd || i instanceof TV || i instanceof zV || i instanceof ZV) && n.transform.push(i.assemble()), (i instanceof PB || i instanceof jB || i instanceof Wm || i instanceof AQ || i instanceof uw) && n.transform.push(...i.assemble()), i instanceof Is && (n.source && n.transform.length === 0 ? i.setSource(n.source) : i.parent instanceof Is ? i.setSource(n.name) : (n.name || (n.name = `data_${e++}`), i.setSource(n.name), i.numChildren() === 1 && (A.push(n), n = {
      name: null,
      source: n.name,
      transform: []
    }))), i.numChildren()) {
      case 0:
        i instanceof Is && (!n.source || n.transform.length > 0) && A.push(n);
        break;
      case 1:
        t(i.children[0], n);
        break;
      default: {
        n.name || (n.name = `data_${e++}`);
        let o = n.name;
        !n.source || n.transform.length > 0 ? A.push(n) : o = n.source;
        for (const g of i.children)
          t(g, {
            name: null,
            source: o,
            transform: []
          });
        break;
      }
    }
  }
  return t;
}
function Dje(A) {
  const e = [], t = qUA(e);
  for (const i of A.children)
    t(i, {
      source: A.name,
      name: null,
      transform: []
    });
  return e;
}
function Gje(A, e) {
  const t = [], i = qUA(t);
  let n = 0;
  for (const g of A.sources) {
    g.hasName() || (g.dataName = `source_${n++}`);
    const s = g.assemble();
    i(g, s);
  }
  for (const g of t)
    g.transform.length === 0 && delete g.transform;
  let o = 0;
  for (const [g, s] of t.entries())
    (s.transform ?? []).length === 0 && !s.source && t.splice(o++, 0, t.splice(g, 1)[0]);
  for (const g of t)
    for (const s of g.transform ?? [])
      s.type === "lookup" && (s.from = A.outputNodes[s.from].getSource());
  for (const g of t)
    g.name in e && (g.values = e[g.name]);
  return t;
}
function kje(A) {
  return A === "top" || A === "left" || ke(A) ? "header" : "footer";
}
function Jje(A) {
  for (const e of Ua)
    Nje(A, e);
  gmA(A, "x"), gmA(A, "y");
}
function Nje(A, e) {
  var t;
  const { facet: i, config: n, child: o, component: g } = A;
  if (A.channelHasField(e)) {
    const s = i[e], I = zf("title", null, n, e);
    let r = Qw(s, n, {
      allowDisabling: !0,
      includeDefault: I === void 0 || !!I
    });
    o.component.layoutHeaders[e].title && (r = ZA(r) ? r.join(", ") : r, r += ` / ${o.component.layoutHeaders[e].title}`, o.component.layoutHeaders[e].title = null);
    const a = zf("labelOrient", s.header, n, e), C = s.header !== null ? _n((t = s.header) == null ? void 0 : t.labels, n.header.labels, !0) : !1, B = Ht(["bottom", "right"], a) ? "footer" : "header";
    g.layoutHeaders[e] = {
      title: s.header !== null ? r : null,
      facetFieldDef: s,
      [B]: e === "facet" ? [] : [OUA(A, e, C)]
    };
  }
}
function OUA(A, e, t) {
  const i = e === "row" ? "height" : "width";
  return {
    labels: t,
    sizeSignal: A.child.component.layoutSize.get(i) ? A.child.getSizeSignalRef(i) : void 0,
    axes: []
  };
}
function gmA(A, e) {
  const { child: t } = A;
  if (t.component.axes[e]) {
    const { layoutHeaders: i, resolve: n } = A.component;
    if (n.axis[e] = $oA(n, e), n.axis[e] === "shared") {
      const o = e === "x" ? "column" : "row", g = i[o];
      for (const s of t.component.axes[e]) {
        const I = kje(s.get("orient"));
        g[I] ?? (g[I] = [OUA(A, o, !1)]);
        const r = HJ(s, "main", A.config, { header: !0 });
        r && g[I][0].axes.push(r), s.mainExtracted = !0;
      }
    }
  }
}
function Yje(A) {
  sgA(A), SZ(A, "width"), SZ(A, "height");
}
function Rje(A) {
  sgA(A);
  const e = A.layout.columns === 1 ? "width" : "childWidth", t = A.layout.columns === void 0 ? "height" : "childHeight";
  SZ(A, e), SZ(A, t);
}
function sgA(A) {
  for (const e of A.children)
    e.parseLayoutSize();
}
function SZ(A, e) {
  const t = pUA(e), i = BV(t), n = A.component.resolve, o = A.component.layoutSize;
  let g;
  for (const s of A.children) {
    const I = s.component.layoutSize.getWithExplicit(t), r = n.scale[i] ?? bUA(i, A);
    if (r === "independent" && I.value === "step") {
      g = void 0;
      break;
    }
    if (g) {
      if (r === "independent" && g.value !== I.value) {
        g = void 0;
        break;
      }
      g = sd(g, I, t, "");
    } else
      g = I;
  }
  if (g) {
    for (const s of A.children)
      A.renameSignal(s.getName(t), A.getName(e)), s.component.layoutSize.set(t, "merged", !1);
    o.setWithExplicit(e, g);
  } else
    o.setWithExplicit(e, {
      explicit: !1,
      value: void 0
    });
}
function Fje(A) {
  const { size: e, component: t } = A;
  for (const i of Ml) {
    const n = $s(i);
    if (e[n]) {
      const o = e[n];
      t.layoutSize.set(n, ll(o) ? "step" : o, !0);
    } else {
      const o = Mje(A, n);
      t.layoutSize.set(n, o, !1);
    }
  }
}
function Mje(A, e) {
  const t = e === "width" ? "x" : "y", i = A.config, n = A.getScaleComponent(t);
  if (n) {
    const o = n.get("type"), g = n.get("range");
    if (Wo(o)) {
      const s = xZ(i.view, e);
      return Od(g) || ll(s) ? "step" : s;
    } else
      return QP(i.view, e);
  } else {
    if (A.hasProjection || A.mark === "arc")
      return QP(i.view, e);
    {
      const o = xZ(i.view, e);
      return ll(o) ? o.step : o;
    }
  }
}
function JP(A, e, t) {
  return se(e, { suffix: `by_${se(A)}`, ...t ?? {} });
}
class FN extends _UA {
  constructor(e, t, i, n) {
    super(e, "facet", t, i, n, e.resolve), this.child = BgA(e.spec, this, this.getName("child"), void 0, n), this.children = [this.child], this.facet = this.initFacet(e.facet);
  }
  initFacet(e) {
    if (!KF(e))
      return { facet: this.initFacetFieldDef(e, "facet") };
    const t = _A(e), i = {};
    for (const n of t) {
      if (![jc, Pc].includes(n)) {
        PA(QV(n, "facet"));
        break;
      }
      const o = e[n];
      if (o.field === void 0) {
        PA(rP(o, n));
        break;
      }
      i[n] = this.initFacetFieldDef(o, n);
    }
    return i;
  }
  initFacetFieldDef(e, t) {
    const i = NoA(e, t);
    return i.header ? i.header = Ys(i.header) : i.header === null && (i.header = null), i;
  }
  channelHasField(e) {
    return !!this.facet[e];
  }
  fieldDef(e) {
    return this.facet[e];
  }
  parseData() {
    this.component.data = _V(this), this.child.parseData();
  }
  parseLayoutSize() {
    sgA(this);
  }
  parseSelections() {
    this.child.parseSelections(), this.component.selection = this.child.component.selection;
  }
  parseMarkGroup() {
    this.child.parseMarkGroup();
  }
  parseAxesAndHeaders() {
    this.child.parseAxesAndHeaders(), Jje(this);
  }
  assembleSelectionTopLevelSignals(e) {
    return this.child.assembleSelectionTopLevelSignals(e);
  }
  assembleSignals() {
    return this.child.assembleSignals(), [];
  }
  assembleSelectionData(e) {
    return this.child.assembleSelectionData(e);
  }
  getHeaderLayoutMixins() {
    const e = {};
    for (const t of Ua)
      for (const i of joA) {
        const n = this.component.layoutHeaders[t], o = n[i], { facetFieldDef: g } = n;
        if (g) {
          const s = zf("titleOrient", g.header, this.config, t);
          if (["right", "bottom"].includes(s)) {
            const I = LV(t, s);
            e.titleAnchor ?? (e.titleAnchor = {}), e.titleAnchor[I] = "end";
          }
        }
        if (o != null && o[0]) {
          const s = t === "row" ? "height" : "width", I = i === "header" ? "headerBand" : "footerBand";
          t !== "facet" && !this.child.component.layoutSize.get(s) && (e[I] ?? (e[I] = {}), e[I][t] = 0.5), n.title && (e.offset ?? (e.offset = {}), e.offset[t === "row" ? "rowTitle" : "columnTitle"] = 10);
        }
      }
    return e;
  }
  assembleDefaultLayout() {
    const { column: e, row: t } = this.facet, i = e ? this.columnDistinctSignal() : t ? 1 : void 0;
    let n = "all";
    return (!t && this.component.resolve.scale.x === "independent" || !e && this.component.resolve.scale.y === "independent") && (n = "none"), {
      ...this.getHeaderLayoutMixins(),
      ...i ? { columns: i } : {},
      bounds: "full",
      align: n
    };
  }
  assembleLayoutSignals() {
    return this.child.assembleLayoutSignals();
  }
  columnDistinctSignal() {
    if (!(this.parent && this.parent instanceof FN))
      return { signal: `length(data('${this.getName("column_domain")}'))` };
  }
  assembleGroupStyle() {
  }
  assembleGroup(e) {
    return this.parent && this.parent instanceof FN ? {
      ...this.channelHasField("column") ? {
        encode: {
          update: {
            // TODO(https://github.com/vega/vega-lite/issues/2759):
            // Correct the signal for facet of concat of facet_column
            columns: { field: se(this.facet.column, { prefix: "distinct" }) }
          }
        }
      } : {},
      ...super.assembleGroup(e)
    } : super.assembleGroup(e);
  }
  /**
   * Aggregate cardinality for calculating size
   */
  getCardinalityAggregateForChild() {
    const e = [], t = [], i = [];
    if (this.child instanceof FN) {
      if (this.child.channelHasField("column")) {
        const n = se(this.child.facet.column);
        e.push(n), t.push("distinct"), i.push(`distinct_${n}`);
      }
    } else
      for (const n of Ml) {
        const o = this.child.component.scales[n];
        if (o && !o.merged) {
          const g = o.get("type"), s = o.get("range");
          if (Wo(g) && Od(s)) {
            const I = HV(this.child, n), r = ngA(I);
            r ? (e.push(r), t.push("distinct"), i.push(`distinct_${r}`)) : PA(ooA(n));
          }
        }
      }
    return { fields: e, ops: t, as: i };
  }
  assembleFacet() {
    const { name: e, data: t } = this.component.data.facetRoot, { row: i, column: n } = this.facet, { fields: o, ops: g, as: s } = this.getCardinalityAggregateForChild(), I = [];
    for (const a of Ua) {
      const C = this.facet[a];
      if (C) {
        I.push(se(C));
        const { bin: B, sort: l } = C;
        if (Oi(B) && I.push(se(C, { binSuffix: "end" })), OB(l)) {
          const { field: Q, op: E = pV } = l, d = JP(C, l);
          i && n ? (o.push(d), g.push("max"), s.push(d)) : (o.push(Q), g.push(E), s.push(d));
        } else if (ZA(l)) {
          const Q = Xf(C, a);
          o.push(Q), g.push("max"), s.push(Q);
        }
      }
    }
    const r = !!i && !!n;
    return {
      name: e,
      data: t,
      groupby: I,
      ...r || o.length > 0 ? {
        aggregate: {
          ...r ? { cross: r } : {},
          ...o.length ? { fields: o, ops: g, as: s } : {}
        }
      } : {}
    };
  }
  facetSortFields(e) {
    const { facet: t } = this, i = t[e];
    return i ? OB(i.sort) ? [JP(i, i.sort, { expr: "datum" })] : ZA(i.sort) ? [Xf(i, e, { expr: "datum" })] : [se(i, { expr: "datum" })] : [];
  }
  facetSortOrder(e) {
    const { facet: t } = this, i = t[e];
    if (i) {
      const { sort: n } = i;
      return [(OB(n) ? n.order : !ZA(n) && n) || "ascending"];
    }
    return [];
  }
  assembleLabelTitle() {
    var e;
    const { facet: t, config: i } = this;
    if (t.facet)
      return bP(t.facet, "facet", i);
    const n = {
      row: ["top", "bottom"],
      column: ["left", "right"]
    };
    for (const o of OoA)
      if (t[o]) {
        const g = zf("labelOrient", (e = t[o]) == null ? void 0 : e.header, i, o);
        if (n[o].includes(g))
          return bP(t[o], o, i);
      }
  }
  assembleMarks() {
    const { child: e } = this, t = this.component.data.facetRoot, i = Dje(t), n = e.assembleGroupEncodeEntry(!1), o = this.assembleLabelTitle() || e.assembleTitle(), g = e.assembleGroupStyle();
    return [{
      name: this.getName("cell"),
      type: "group",
      ...o ? { title: o } : {},
      ...g ? { style: g } : {},
      from: {
        facet: this.assembleFacet()
      },
      // TODO: move this to after data
      sort: {
        field: Ua.map((s) => this.facetSortFields(s)).flat(),
        order: Ua.map((s) => this.facetSortOrder(s)).flat()
      },
      ...i.length > 0 ? { data: i } : {},
      ...n ? { encode: { update: n } } : {},
      ...e.assembleGroup(X4e(this, []))
    }];
  }
  getMapping() {
    return this.facet;
  }
}
function xje(A, e) {
  const { row: t, column: i } = e;
  if (t && i) {
    let n = null;
    for (const o of [t, i])
      if (OB(o.sort)) {
        const { field: g, op: s = pV } = o.sort;
        A = n = new m0(A, {
          joinaggregate: [
            {
              op: s,
              field: g,
              as: JP(o, o.sort, { forAs: !0 })
            }
          ],
          groupby: [se(o)]
        });
      }
    return n;
  }
  return null;
}
function jUA(A, e) {
  var t, i, n, o;
  for (const g of e) {
    const s = g.data;
    if (A.name && g.hasName() && A.name !== g.dataName)
      continue;
    const I = (t = A.format) == null ? void 0 : t.mesh, r = (i = s.format) == null ? void 0 : i.feature;
    if (I && r)
      continue;
    const a = (n = A.format) == null ? void 0 : n.feature;
    if ((a || r) && a !== r)
      continue;
    const C = (o = s.format) == null ? void 0 : o.mesh;
    if (!((I || C) && I !== C)) {
      if (u2(A) && u2(s)) {
        if (ZI(A.values, s.values))
          return g;
      } else if (Kf(A) && Kf(s)) {
        if (A.url === s.url)
          return g;
      } else if (Z3A(A) && A.name === g.dataName)
        return g;
    }
  }
  return null;
}
function Lje(A, e) {
  if (A.data || !A.parent) {
    if (A.data === null) {
      const i = new Np({ values: [] });
      return e.push(i), i;
    }
    const t = jUA(A.data, e);
    if (t)
      return Yu(A.data) || (t.data.format = LWA({}, A.data.format, t.data.format)), !t.hasName() && A.data.name && (t.dataName = A.data.name), t;
    {
      const i = new Np(A.data);
      return e.push(i), i;
    }
  } else
    return A.parent.component.data.facetRoot ? A.parent.component.data.facetRoot : A.parent.component.data.main;
}
function vje(A, e, t) {
  let i = 0;
  for (const n of e.transforms) {
    let o, g;
    if (f4e(n))
      g = A = new Vf(A, n), o = "derived";
    else if (UoA(n)) {
      const s = kOe(n);
      g = A = wg.makeWithAncestors(A, {}, s, t) ?? A, A = new sG(A, e, n.filter);
    } else if (x3A(n))
      g = A = PB.makeFromTransform(A, n, e), o = "number";
    else if (G4e(n))
      o = "date", t.getWithExplicit(n.field).value === void 0 && (A = new wg(A, { [n.field]: o }), t.set(n.field, o, !1)), g = A = jB.makeFromTransform(A, n);
    else if (k4e(n))
      g = A = aC.makeFromTransform(A, n), o = "number", qoA(e) && (A = new rd(A));
    else if (M3A(n))
      g = A = m2.make(A, e, n, i++), o = "derived";
    else if (y4e(n))
      g = A = new aG(A, n), o = "number";
    else if (b4e(n))
      g = A = new m0(A, n), o = "number";
    else if (J4e(n))
      g = A = AQ.makeFromTransform(A, n), o = "derived";
    else if (N4e(n))
      g = A = new KV(A, n), o = "derived";
    else if (Y4e(n))
      g = A = new ZV(A, n), o = "derived";
    else if (w4e(n))
      g = A = new WV(A, n), o = "derived";
    else if (E4e(n))
      g = A = new zV(A, n), o = "derived";
    else if (p4e(n))
      A = new TV(A, n);
    else if (D4e(n))
      g = A = Wm.makeFromTransform(A, n), o = "derived";
    else if (u4e(n))
      g = A = new SV(A, n), o = "derived";
    else if (d4e(n))
      g = A = new VV(A, n), o = "derived";
    else if (h4e(n))
      g = A = new XV(A, n), o = "derived";
    else if (m4e(n))
      g = A = new UV(A, n), o = "derived";
    else {
      PA(j5e(n));
      continue;
    }
    if (g && o !== void 0)
      for (const s of g.producedFields() ?? [])
        t.set(s, o, !1);
  }
  return A;
}
function _V(A) {
  var e;
  let t = Lje(A, A.component.data.sources);
  const { outputNodes: i, outputNodeRefCounts: n } = A.component.data, o = A.data, g = !(o && (Yu(o) || Kf(o) || u2(o))) && A.parent ? A.parent.component.data.ancestorParse.clone() : new U4e();
  Yu(o) ? (W3A(o) ? t = new _F(t, o.sequence) : VoA(o) && (t = new TF(t, o.graticule)), g.parseNothing = !0) : ((e = o == null ? void 0 : o.format) == null ? void 0 : e.parse) === null && (g.parseNothing = !0), t = wg.makeExplicit(t, A, g) ?? t, t = new rd(t);
  const s = A.parent && rG(A.parent);
  (xn(A) || rC(A)) && s && (t = PB.makeFromEncoding(t, A) ?? t), A.transforms.length > 0 && (t = vje(t, A, g));
  const I = NOe(A), r = JOe(A);
  t = wg.makeWithAncestors(t, {}, { ...I, ...r }, g) ?? t, xn(A) && (t = uw.parseAll(t, A), t = h2.parseAll(t, A)), (xn(A) || rC(A)) && (s || (t = PB.makeFromEncoding(t, A) ?? t), t = jB.makeFromEncoding(t, A) ?? t, t = Vf.parseAllForSortIndex(t, A));
  const a = A.getDataName(Ti.Raw), C = new Is(t, a, Ti.Raw, n);
  if (i[a] = C, t = C, xn(A)) {
    const E = aC.makeFromEncoding(t, A);
    E && (t = E, qoA(A) && (t = new rd(t))), t = Wm.makeFromEncoding(t, A) ?? t, t = AQ.makeFromEncoding(t, A) ?? t;
  }
  xn(A) && (t = d2.make(t, A) ?? t);
  const B = A.getDataName(Ti.Main), l = new Is(t, B, Ti.Main, n);
  i[B] = l, t = l, xn(A) && fqe(A, l);
  let Q = null;
  if (rC(A)) {
    const E = A.getName("facet");
    t = xje(t, A.facet) ?? t, Q = new IG(t, A, E, l.getSource()), i[E] = Q;
  }
  return {
    ...A.component.data,
    outputNodes: i,
    outputNodeRefCounts: n,
    raw: C,
    main: l,
    facetRoot: Q,
    ancestorParse: g
  };
}
class Hje extends ggA {
  constructor(e, t, i, n) {
    var o, g, s, I;
    super(e, "concat", t, i, n, e.resolve), (((g = (o = e.resolve) == null ? void 0 : o.axis) == null ? void 0 : g.x) === "shared" || ((I = (s = e.resolve) == null ? void 0 : s.axis) == null ? void 0 : I.y) === "shared") && PA(_5e), this.children = this.getChildren(e).map((r, a) => BgA(r, this, this.getName(`concat_${a}`), void 0, n));
  }
  parseData() {
    this.component.data = _V(this);
    for (const e of this.children)
      e.parseData();
  }
  parseSelections() {
    this.component.selection = {};
    for (const e of this.children) {
      e.parseSelections();
      for (const t of _A(e.component.selection))
        this.component.selection[t] = e.component.selection[t];
    }
  }
  parseMarkGroup() {
    for (const e of this.children)
      e.parseMarkGroup();
  }
  parseAxesAndHeaders() {
    for (const e of this.children)
      e.parseAxesAndHeaders();
  }
  getChildren(e) {
    return JV(e) ? e.vconcat : WoA(e) ? e.hconcat : e.concat;
  }
  parseLayoutSize() {
    Rje(this);
  }
  parseAxisGroup() {
    return null;
  }
  assembleSelectionTopLevelSignals(e) {
    return this.children.reduce((t, i) => i.assembleSelectionTopLevelSignals(t), e);
  }
  assembleSignals() {
    return this.children.forEach((e) => e.assembleSignals()), [];
  }
  assembleLayoutSignals() {
    const e = PoA(this);
    for (const t of this.children)
      e.push(...t.assembleLayoutSignals());
    return e;
  }
  assembleSelectionData(e) {
    return this.children.reduce((t, i) => i.assembleSelectionData(t), e);
  }
  assembleMarks() {
    return this.children.map((e) => {
      const t = e.assembleTitle(), i = e.assembleGroupStyle(), n = e.assembleGroupEncodeEntry(!1);
      return {
        type: "group",
        name: e.getName("group"),
        ...t ? { title: t } : {},
        ...i ? { style: i } : {},
        ...n ? { encode: { update: n } } : {},
        ...e.assembleGroup()
      };
    });
  }
  assembleGroupStyle() {
  }
  assembleDefaultLayout() {
    const e = this.layout.columns;
    return {
      ...e != null ? { columns: e } : {},
      bounds: "full",
      // Use align each so it can work with multiple plots with different size
      align: "each"
    };
  }
}
function Sje(A) {
  return A === !1 || A === null;
}
const Zje = {
  disable: 1,
  gridScale: 1,
  scale: 1,
  ...o3A,
  labelExpr: 1,
  encode: 1
}, PUA = _A(Zje);
class IgA extends VQ {
  constructor(e = {}, t = {}, i = !1) {
    super(), this.explicit = e, this.implicit = t, this.mainExtracted = i;
  }
  clone() {
    return new IgA(tt(this.explicit), tt(this.implicit), this.mainExtracted);
  }
  hasAxisPart(e) {
    return e === "axis" ? !0 : e === "grid" || e === "title" ? !!this.get(e) : !Sje(this.get(e));
  }
  hasOrientSignalRef() {
    return ke(this.explicit.orient);
  }
}
function Wje(A, e, t) {
  const { encoding: i, config: n } = A, o = co(i[e]) ?? co(i[Fl(e)]), g = A.axis(e) || {}, { format: s, formatType: I } = g;
  if (Gp(I))
    return {
      text: Pr({
        fieldOrDatumDef: o,
        field: "datum.value",
        format: s,
        formatType: I,
        config: n
      }),
      ...t
    };
  if (s === void 0 && I === void 0 && n.customFormatTypes) {
    if (Sf(o) === "quantitative") {
      if (Zf(o) && o.stack === "normalize" && n.normalizedNumberFormatType)
        return {
          text: Pr({
            fieldOrDatumDef: o,
            field: "datum.value",
            format: n.normalizedNumberFormat,
            formatType: n.normalizedNumberFormatType,
            config: n
          }),
          ...t
        };
      if (n.numberFormatType)
        return {
          text: Pr({
            fieldOrDatumDef: o,
            field: "datum.value",
            format: n.numberFormat,
            formatType: n.numberFormatType,
            config: n
          }),
          ...t
        };
    }
    if (Sf(o) === "temporal" && n.timeFormatType && jA(o) && !o.timeUnit)
      return {
        text: Pr({
          fieldOrDatumDef: o,
          field: "datum.value",
          format: n.timeFormat,
          formatType: n.timeFormatType,
          config: n
        }),
        ...t
      };
  }
  return t;
}
function Kje(A) {
  return Ml.reduce((e, t) => (A.component.scales[t] && (e[t] = [qje(t, A)]), e), {});
}
const Uje = {
  bottom: "top",
  top: "bottom",
  left: "right",
  right: "left"
};
function Vje(A) {
  const { axes: e, resolve: t } = A.component, i = { top: 0, bottom: 0, right: 0, left: 0 };
  for (const n of A.children) {
    n.parseAxesAndHeaders();
    for (const o of _A(n.component.axes))
      t.axis[o] = $oA(A.component.resolve, o), t.axis[o] === "shared" && (e[o] = Xje(e[o], n.component.axes[o]), e[o] || (t.axis[o] = "independent", delete e[o]));
  }
  for (const n of Ml) {
    for (const o of A.children)
      if (o.component.axes[n]) {
        if (t.axis[n] === "independent") {
          e[n] = (e[n] ?? []).concat(o.component.axes[n]);
          for (const g of o.component.axes[n]) {
            const { value: s, explicit: I } = g.getWithExplicit("orient");
            if (!ke(s)) {
              if (i[s] > 0 && !I) {
                const r = Uje[s];
                i[s] > i[r] && g.set("orient", r, !1);
              }
              i[s]++;
            }
          }
        }
        delete o.component.axes[n];
      }
    if (t.axis[n] === "independent" && e[n] && e[n].length > 1)
      for (const [o, g] of (e[n] || []).entries())
        o > 0 && g.get("grid") && !g.explicit.grid && (g.implicit.grid = !1);
  }
}
function Xje(A, e) {
  if (A) {
    if (A.length !== e.length)
      return;
    const t = A.length;
    for (let i = 0; i < t; i++) {
      const n = A[i], o = e[i];
      if (!!n != !!o)
        return;
      if (n && o) {
        const g = n.getWithExplicit("orient"), s = o.getWithExplicit("orient");
        if (g.explicit && s.explicit && g.value !== s.value)
          return;
        A[i] = zje(n, o);
      }
    }
  } else
    return e.map((t) => t.clone());
  return A;
}
function zje(A, e) {
  for (const t of PUA) {
    const i = sd(
      A.getWithExplicit(t),
      e.getWithExplicit(t),
      t,
      "axis",
      // Tie breaker function
      (n, o) => {
        switch (t) {
          case "title":
            return rKA(n, o);
          case "gridScale":
            return {
              explicit: n.explicit,
              value: _n(n.value, o.value)
            };
        }
        return YV(n, o, t, "axis");
      }
    );
    A.setWithExplicit(t, i);
  }
  return A;
}
function Tje(A, e, t, i, n) {
  if (e === "disable")
    return t !== void 0;
  switch (t = t || {}, e) {
    case "titleAngle":
    case "labelAngle":
      return A === (ke(t.labelAngle) ? t.labelAngle : Q2(t.labelAngle));
    case "values":
      return !!t.values;
    case "encode":
      return !!t.encoding || !!t.labelAngle;
    case "title":
      if (A === EUA(i, n))
        return !0;
  }
  return A === t[e];
}
const _je = /* @__PURE__ */ new Set([
  "grid",
  "translate",
  // the rest are not axis configs in Vega, but are in VL, so we need to set too.
  "format",
  "formatType",
  "orient",
  "labelExpr",
  "tickCount",
  "position",
  "tickMinStep"
]);
function qje(A, e) {
  var t, i;
  let n = e.axis(A);
  const o = new IgA(), g = co(e.encoding[A]), { mark: s, config: I } = e, r = (n == null ? void 0 : n.orient) || ((t = I[A === "x" ? "axisX" : "axisY"]) == null ? void 0 : t.orient) || ((i = I.axis) == null ? void 0 : i.orient) || xqe(A), a = e.getScaleComponent(A).get("type"), C = kqe(A, a, r, e.config), B = n !== void 0 ? !n : pP("disable", I.style, n == null ? void 0 : n.style, C).configValue;
  if (o.set("disable", B, n !== void 0), B)
    return o;
  n = n || {};
  const l = Rqe(g, n, A, I.style, C), Q = VKA(n.formatType, g, a), E = UKA(g, g.type, n.format, n.formatType, I, !0), d = {
    fieldOrDatumDef: g,
    axis: n,
    channel: A,
    model: e,
    scaleType: a,
    orient: r,
    labelAngle: l,
    format: E,
    formatType: Q,
    mark: s,
    config: I
  };
  for (const f of PUA) {
    const w = f in XhA ? XhA[f](d) : dhA(f) ? n[f] : void 0, G = w !== void 0, R = Tje(w, f, n, e, A);
    if (G && R)
      o.set(f, w, R);
    else {
      const { configValue: F = void 0, configFrom: Z = void 0 } = dhA(f) && f !== "values" ? pP(f, I.style, n.style, C) : {}, c = F !== void 0;
      G && !c ? o.set(f, w, R) : (
        // Cases need implicit values
        // 1. Axis config that aren't available in Vega
        (Z !== "vgAxisConfig" || // 2. Certain properties are always included (see `propsToAlwaysIncludeConfig`'s declaration for more details)
        _je.has(f) && c || // 3. Conditional axis values and signals
        XF(F) || ke(F)) && o.set(f, F, !1)
      );
    }
  }
  const m = n.encoding ?? {}, y = n3A.reduce((f, w) => {
    if (!o.hasAxisPart(w))
      return f;
    const G = yUA(m[w] ?? {}, e), R = w === "labels" ? Wje(e, A, G) : G;
    return R !== void 0 && !Fi(R) && (f[w] = { update: R }), f;
  }, {});
  return Fi(y) || o.set("encode", y, !!n.encoding || n.labelAngle !== void 0), o;
}
function Oje({ encoding: A, size: e }) {
  for (const t of Ml) {
    const i = $s(t);
    ll(e[i]) && ou(A[t]) && (delete e[i], PA(QKA(i)));
  }
  return e;
}
const jje = {
  vgMark: "arc",
  encodeEntry: (A) => ({
    ...Qr(A, {
      align: "ignore",
      baseline: "ignore",
      color: "include",
      size: "ignore",
      orient: "ignore",
      theta: "ignore"
    }),
    ...bg("x", A, { defaultPos: "mid" }),
    ...bg("y", A, { defaultPos: "mid" }),
    // arcs are rectangles in polar coordinates
    ...Id(A, "radius"),
    ...Id(A, "theta")
  })
}, Pje = {
  vgMark: "area",
  encodeEntry: (A) => ({
    ...Qr(A, {
      align: "ignore",
      baseline: "ignore",
      color: "include",
      orient: "include",
      size: "ignore",
      theta: "ignore"
    }),
    ...LZ("x", A, {
      defaultPos: "zeroOrMin",
      defaultPos2: "zeroOrMin",
      range: A.markDef.orient === "horizontal"
    }),
    ...LZ("y", A, {
      defaultPos: "zeroOrMin",
      defaultPos2: "zeroOrMin",
      range: A.markDef.orient === "vertical"
    }),
    ..._oA(A)
  })
}, $je = {
  vgMark: "rect",
  encodeEntry: (A) => ({
    ...Qr(A, {
      align: "ignore",
      baseline: "ignore",
      color: "include",
      orient: "ignore",
      size: "ignore",
      theta: "ignore"
    }),
    ...Id(A, "x"),
    ...Id(A, "y")
  })
}, APe = {
  vgMark: "shape",
  encodeEntry: (A) => ({
    ...Qr(A, {
      align: "ignore",
      baseline: "ignore",
      color: "include",
      size: "ignore",
      orient: "ignore",
      theta: "ignore"
    })
  }),
  postEncodingTransform: (A) => {
    const { encoding: e } = A, t = e.shape;
    return [{
      type: "geoshape",
      projection: A.projectionName(),
      // as: 'shape',
      ...t && jA(t) && t.type === oG ? { field: se(t, { expr: "datum" }) } : {}
    }];
  }
}, ePe = {
  vgMark: "image",
  encodeEntry: (A) => ({
    ...Qr(A, {
      align: "ignore",
      baseline: "ignore",
      color: "ignore",
      orient: "ignore",
      size: "ignore",
      theta: "ignore"
    }),
    ...Id(A, "x"),
    ...Id(A, "y"),
    ...zoA(A, "url")
  })
}, tPe = {
  vgMark: "line",
  encodeEntry: (A) => ({
    ...Qr(A, {
      align: "ignore",
      baseline: "ignore",
      color: "include",
      size: "ignore",
      orient: "ignore",
      theta: "ignore"
    }),
    ...bg("x", A, { defaultPos: "mid" }),
    ...bg("y", A, { defaultPos: "mid" }),
    ...Jo("size", A, {
      vgChannel: "strokeWidth"
      // VL's line size is strokeWidth
    }),
    ..._oA(A)
  })
}, iPe = {
  vgMark: "trail",
  encodeEntry: (A) => ({
    ...Qr(A, {
      align: "ignore",
      baseline: "ignore",
      color: "include",
      size: "include",
      orient: "ignore",
      theta: "ignore"
    }),
    ...bg("x", A, { defaultPos: "mid" }),
    ...bg("y", A, { defaultPos: "mid" }),
    ...Jo("size", A),
    ..._oA(A)
  })
};
function agA(A, e) {
  const { config: t } = A;
  return {
    ...Qr(A, {
      align: "ignore",
      baseline: "ignore",
      color: "include",
      size: "include",
      orient: "ignore",
      theta: "ignore"
    }),
    ...bg("x", A, { defaultPos: "mid" }),
    ...bg("y", A, { defaultPos: "mid" }),
    ...Jo("size", A),
    ...Jo("angle", A),
    ...nPe(A, t, e)
  };
}
function nPe(A, e, t) {
  return t ? { shape: { value: t } } : Jo("shape", A);
}
const oPe = {
  vgMark: "symbol",
  encodeEntry: (A) => agA(A)
}, gPe = {
  vgMark: "symbol",
  encodeEntry: (A) => agA(A, "circle")
}, sPe = {
  vgMark: "symbol",
  encodeEntry: (A) => agA(A, "square")
}, IPe = {
  vgMark: "rect",
  encodeEntry: (A) => ({
    ...Qr(A, {
      align: "ignore",
      baseline: "ignore",
      color: "include",
      orient: "ignore",
      size: "ignore",
      theta: "ignore"
    }),
    ...Id(A, "x"),
    ...Id(A, "y")
  })
}, aPe = {
  vgMark: "rule",
  encodeEntry: (A) => {
    const { markDef: e } = A, t = e.orient;
    return !A.encoding.x && !A.encoding.y && !A.encoding.latitude && !A.encoding.longitude ? {} : {
      ...Qr(A, {
        align: "ignore",
        baseline: "ignore",
        color: "include",
        orient: "ignore",
        size: "ignore",
        theta: "ignore"
      }),
      ...LZ("x", A, {
        defaultPos: t === "horizontal" ? "zeroOrMax" : "mid",
        defaultPos2: "zeroOrMin",
        range: t !== "vertical"
        // include x2 for horizontal or line segment rule
      }),
      ...LZ("y", A, {
        defaultPos: t === "vertical" ? "zeroOrMax" : "mid",
        defaultPos2: "zeroOrMin",
        range: t !== "horizontal"
        // include y2 for vertical or line segment rule
      }),
      ...Jo("size", A, {
        vgChannel: "strokeWidth"
        // VL's rule size is strokeWidth
      })
    };
  }
}, rPe = {
  vgMark: "text",
  encodeEntry: (A) => {
    const { config: e, encoding: t } = A;
    return {
      ...Qr(A, {
        align: "include",
        baseline: "include",
        color: "include",
        size: "ignore",
        orient: "ignore",
        theta: "include"
      }),
      ...bg("x", A, { defaultPos: "mid" }),
      ...bg("y", A, { defaultPos: "mid" }),
      ...zoA(A),
      ...Jo("size", A, {
        vgChannel: "fontSize"
        // VL's text size is fontSize
      }),
      ...Jo("angle", A),
      ...WhA("align", CPe(A.markDef, t, e)),
      ...WhA("baseline", BPe(A.markDef, t, e)),
      ...bg("radius", A, { defaultPos: null }),
      ...bg("theta", A, { defaultPos: null })
    };
  }
};
function CPe(A, e, t) {
  if (bi("align", A, t) === void 0)
    return "center";
}
function BPe(A, e, t) {
  if (bi("baseline", A, t) === void 0)
    return "middle";
}
const lPe = {
  vgMark: "rect",
  encodeEntry: (A) => {
    const { config: e, markDef: t } = A, i = t.orient, n = i === "horizontal" ? "width" : "height", o = i === "horizontal" ? "height" : "width";
    return {
      ...Qr(A, {
        align: "ignore",
        baseline: "ignore",
        color: "include",
        orient: "ignore",
        size: "ignore",
        theta: "ignore"
      }),
      ...bg("x", A, { defaultPos: "mid", vgChannel: "xc" }),
      ...bg("y", A, { defaultPos: "mid", vgChannel: "yc" }),
      // size / thickness => width / height
      ...Jo("size", A, {
        defaultValue: cPe(A),
        vgChannel: n
      }),
      [o]: sn(bi("thickness", t, e))
    };
  }
};
function cPe(A) {
  const { config: e, markDef: t } = A, { orient: i } = t, n = i === "horizontal" ? "width" : "height", o = A.getScaleComponent(i === "horizontal" ? "x" : "y"), g = bi("size", t, e, { vgChannel: n }) ?? e.tick.bandSize;
  if (g !== void 0)
    return g;
  {
    const s = o ? o.get("range") : void 0;
    return s && Od(s) && ti(s.step) ? s.step * 3 / 4 : MZ(e.view, n) * 3 / 4;
  }
}
const yx = {
  arc: jje,
  area: Pje,
  bar: $je,
  circle: gPe,
  geoshape: APe,
  image: ePe,
  line: tPe,
  point: oPe,
  rect: IPe,
  rule: aPe,
  square: sPe,
  text: rPe,
  tick: lPe,
  trail: iPe
};
function QPe(A) {
  if (Ht([hV, uV, bTe], A.mark)) {
    const e = r3A(A.mark, A.encoding);
    if (e.length > 0)
      return EPe(A, e);
  } else if (A.mark === dV) {
    const e = aP.some((t) => bi(t, A.markDef, A.config));
    if (A.stack && !A.fieldDef("size") && e)
      return uPe(A);
  }
  return rgA(A);
}
const smA = "faceted_path_";
function EPe(A, e) {
  return [
    {
      name: A.getName("pathgroup"),
      type: "group",
      from: {
        facet: {
          name: smA + A.requestDataName(Ti.Main),
          data: A.requestDataName(Ti.Main),
          groupby: e
        }
      },
      encode: {
        update: {
          width: { field: { group: "width" } },
          height: { field: { group: "height" } }
        }
      },
      // With subfacet for line/area group, need to use faceted data from above.
      marks: rgA(A, { fromPrefix: smA })
    }
  ];
}
const ImA = "stack_group_";
function uPe(A) {
  var e;
  const [t] = rgA(A, { fromPrefix: ImA }), i = A.scaleName(A.stack.fieldChannel), n = (r = {}) => A.vgField(A.stack.fieldChannel, r), o = (r, a) => {
    const C = [
      n({ prefix: "min", suffix: "start", expr: a }),
      n({ prefix: "max", suffix: "start", expr: a }),
      n({ prefix: "min", suffix: "end", expr: a }),
      n({ prefix: "max", suffix: "end", expr: a })
    ];
    return `${r}(${C.map((B) => `scale('${i}',${B})`).join(",")})`;
  };
  let g, s;
  A.stack.fieldChannel === "x" ? (g = {
    ...Ff(t.encode.update, ["y", "yc", "y2", "height", ...aP]),
    x: { signal: o("min", "datum") },
    x2: { signal: o("max", "datum") },
    clip: { value: !0 }
  }, s = {
    x: { field: { group: "x" }, mult: -1 },
    height: { field: { group: "height" } }
  }, t.encode.update = {
    ...Us(t.encode.update, ["y", "yc", "y2"]),
    height: { field: { group: "height" } }
  }) : (g = {
    ...Ff(t.encode.update, ["x", "xc", "x2", "width"]),
    y: { signal: o("min", "datum") },
    y2: { signal: o("max", "datum") },
    clip: { value: !0 }
  }, s = {
    y: { field: { group: "y" }, mult: -1 },
    width: { field: { group: "width" } }
  }, t.encode.update = {
    ...Us(t.encode.update, ["x", "xc", "x2"]),
    width: { field: { group: "width" } }
  });
  for (const r of aP) {
    const a = mQ(r, A.markDef, A.config);
    t.encode.update[r] ? (g[r] = t.encode.update[r], delete t.encode.update[r]) : a && (g[r] = sn(a)), a && (t.encode.update[r] = { value: 0 });
  }
  const I = [];
  if (((e = A.stack.groupbyChannels) == null ? void 0 : e.length) > 0)
    for (const r of A.stack.groupbyChannels) {
      const a = A.fieldDef(r), C = se(a);
      C && I.push(C), (a != null && a.bin || a != null && a.timeUnit) && I.push(se(a, { binSuffix: "end" }));
    }
  return g = [
    "stroke",
    "strokeWidth",
    "strokeJoin",
    "strokeCap",
    "strokeDash",
    "strokeDashOffset",
    "strokeMiterLimit",
    "strokeOpacity"
  ].reduce((r, a) => {
    if (t.encode.update[a])
      return { ...r, [a]: t.encode.update[a] };
    {
      const C = mQ(a, A.markDef, A.config);
      return C !== void 0 ? { ...r, [a]: sn(C) } : r;
    }
  }, g), g.stroke && (g.strokeForeground = { value: !0 }, g.strokeOffset = { value: 0 }), [
    {
      type: "group",
      from: {
        facet: {
          data: A.requestDataName(Ti.Main),
          name: ImA + A.requestDataName(Ti.Main),
          groupby: I,
          aggregate: {
            fields: [
              n({ suffix: "start" }),
              n({ suffix: "start" }),
              n({ suffix: "end" }),
              n({ suffix: "end" })
            ],
            ops: ["min", "max", "min", "max"]
          }
        }
      },
      encode: {
        update: g
      },
      marks: [
        {
          type: "group",
          encode: { update: s },
          marks: [t]
        }
      ]
    }
  ];
}
function dPe(A) {
  var e;
  const { encoding: t, stack: i, mark: n, markDef: o, config: g } = A, s = t.order;
  if (!(!ZA(s) && yC(s) && sP(s.value) || !s && sP(bi("order", o, g)))) {
    if ((ZA(s) || jA(s)) && !i)
      return sKA(s, { expr: "datum" });
    if (jd(n)) {
      const I = o.orient === "horizontal" ? "y" : "x", r = t[I];
      if (jA(r)) {
        const a = r.sort;
        if (ZA(a))
          return {
            field: se(r, { prefix: I, suffix: "sort_index", expr: "datum" })
          };
        if (OB(a))
          return {
            field: se({
              // FIXME: this op might not already exist?
              // FIXME: what if dimensionChannel (x or y) contains custom domain?
              aggregate: YoA(A.encoding) ? a.op : void 0,
              field: a.field
            }, { expr: "datum" })
          };
        if (zKA(a)) {
          const C = A.fieldDef(a.encoding);
          return {
            field: se(C, { expr: "datum" }),
            order: a.order
          };
        } else
          return a === null ? void 0 : {
            field: se(r, {
              // For stack with imputation, we only have bin_mid
              binSuffix: (e = A.stack) != null && e.impute ? "mid" : void 0,
              expr: "datum"
            })
          };
      }
      return;
    }
  }
}
function rgA(A, e = { fromPrefix: "" }) {
  const { mark: t, markDef: i, encoding: n, config: o } = A, g = _n(i.clip, hPe(A), mPe(A)), s = oKA(i), I = n.key, r = dPe(A), a = pPe(A), C = bi("aria", i, o), B = yx[t].postEncodingTransform ? yx[t].postEncodingTransform(A) : null;
  return [
    {
      name: A.getName("marks"),
      type: yx[t].vgMark,
      ...g ? { clip: !0 } : {},
      ...s ? { style: s } : {},
      ...I ? { key: I.field } : {},
      ...r ? { sort: r } : {},
      ...a || {},
      ...C === !1 ? { aria: C } : {},
      from: { data: e.fromPrefix + A.requestDataName(Ti.Main) },
      encode: {
        update: yx[t].encodeEntry(A)
      },
      ...B ? {
        transform: B
      } : {}
    }
  ];
}
function hPe(A) {
  const e = A.getScaleComponent("x"), t = A.getScaleComponent("y");
  return e != null && e.get("selectionExtent") || t != null && t.get("selectionExtent") ? !0 : void 0;
}
function mPe(A) {
  const e = A.component.projection;
  return e && !e.isFit ? !0 : void 0;
}
function pPe(A) {
  if (!A.component.selection)
    return null;
  const e = _A(A.component.selection).length;
  let t = e, i = A.parent;
  for (; i && t === 0; )
    t = _A(i.component.selection).length, i = i.parent;
  return t ? {
    interactive: e > 0 || A.mark === "geoshape" || !!A.encoding.tooltip
  } : null;
}
class $UA extends _UA {
  constructor(e, t, i, n = {}, o) {
    super(e, "unit", t, i, o, void 0, mhA(e) ? e.view : void 0), this.specifiedScales = {}, this.specifiedAxes = {}, this.specifiedLegends = {}, this.specifiedProjection = {}, this.selection = [], this.children = [];
    const g = Cl(e.mark) ? { ...e.mark } : { type: e.mark }, s = g.type;
    g.filled === void 0 && (g.filled = o4e(g, o, {
      graticule: e.data && VoA(e.data)
    }));
    const I = this.encoding = a_e(e.encoding || {}, s, g.filled, o);
    this.markDef = Y3A(g, I, o), this.size = Oje({
      encoding: I,
      size: mhA(e) ? {
        ...n,
        ...e.width ? { width: e.width } : {},
        ...e.height ? { height: e.height } : {}
      } : n
    }), this.stack = N3A(this.markDef, I), this.specifiedScales = this.initScales(s, I), this.specifiedAxes = this.initAxes(I), this.specifiedLegends = this.initLegends(I), this.specifiedProjection = e.projection, this.selection = (e.params ?? []).filter((r) => SoA(r));
  }
  get hasProjection() {
    const { encoding: e } = this, t = this.mark === HKA, i = e && I5e.some((n) => at(e[n]));
    return t || i;
  }
  /**
   * Return specified Vega-Lite scale domain for a particular channel
   * @param channel
   */
  scaleDomain(e) {
    const t = this.specifiedScales[e];
    return t ? t.domain : void 0;
  }
  axis(e) {
    return this.specifiedAxes[e];
  }
  legend(e) {
    return this.specifiedLegends[e];
  }
  initScales(e, t) {
    return lV.reduce((i, n) => {
      const o = co(t[n]);
      return o && (i[n] = this.initScale(o.scale ?? {})), i;
    }, {});
  }
  initScale(e) {
    const { domain: t, range: i } = e, n = Ys(e);
    return ZA(t) && (n.domain = t.map(YI)), ZA(i) && (n.range = i.map(YI)), n;
  }
  initAxes(e) {
    return Ml.reduce((t, i) => {
      const n = e[i];
      if (at(n) || i === un && at(e.x2) || i === Vo && at(e.y2)) {
        const o = at(n) ? n.axis : void 0;
        t[i] = o && this.initAxis({ ...o });
      }
      return t;
    }, {});
  }
  initAxis(e) {
    const t = _A(e), i = {};
    for (const n of t) {
      const o = e[n];
      i[n] = XF(o) ? nKA(o) : YI(o);
    }
    return i;
  }
  initLegends(e) {
    return d5e.reduce((t, i) => {
      const n = co(e[i]);
      if (n && m5e(i)) {
        const o = n.legend;
        t[i] = o && Ys(o);
      }
      return t;
    }, {});
  }
  parseData() {
    this.component.data = _V(this);
  }
  parseLayoutSize() {
    Fje(this);
  }
  parseSelections() {
    this.component.selection = wqe(this, this.selection);
  }
  parseMarkGroup() {
    this.component.mark = QPe(this);
  }
  parseAxesAndHeaders() {
    this.component.axes = Kje(this);
  }
  assembleSelectionTopLevelSignals(e) {
    return z4e(this, e);
  }
  assembleSignals() {
    return [...lUA(this), ...V4e(this, [])];
  }
  assembleSelectionData(e) {
    return T4e(this, e);
  }
  assembleLayout() {
    return null;
  }
  assembleLayoutSignals() {
    return PoA(this);
  }
  assembleMarks() {
    let e = this.component.mark ?? [];
    return (!this.parent || !rG(this.parent)) && (e = V3A(this, e)), e.map(this.correctDataNames);
  }
  assembleGroupStyle() {
    const { style: e } = this.view || {};
    return e !== void 0 ? e : this.encoding.x || this.encoding.y ? "cell" : "view";
  }
  getMapping() {
    return this.encoding;
  }
  get mark() {
    return this.markDef.type;
  }
  channelHasField(e) {
    return Sm(this.encoding, e);
  }
  fieldDef(e) {
    const t = this.encoding[e];
    return Bl(t);
  }
  typedFieldDef(e) {
    const t = this.fieldDef(e);
    return ls(t) ? t : null;
  }
}
class CgA extends ggA {
  constructor(e, t, i, n, o) {
    super(e, "layer", t, i, o, e.resolve, e.view);
    const g = {
      ...n,
      ...e.width ? { width: e.width } : {},
      ...e.height ? { height: e.height } : {}
    };
    this.children = e.layer.map((s, I) => {
      if (NV(s))
        return new CgA(s, this, this.getName(`layer_${I}`), g, o);
      if (UQ(s))
        return new $UA(s, this, this.getName(`layer_${I}`), g, o);
      throw new Error(noA(s));
    });
  }
  parseData() {
    this.component.data = _V(this);
    for (const e of this.children)
      e.parseData();
  }
  parseLayoutSize() {
    Yje(this);
  }
  parseSelections() {
    this.component.selection = {};
    for (const e of this.children) {
      e.parseSelections();
      for (const t of _A(e.component.selection))
        this.component.selection[t] = e.component.selection[t];
    }
  }
  parseMarkGroup() {
    for (const e of this.children)
      e.parseMarkGroup();
  }
  parseAxesAndHeaders() {
    Vje(this);
  }
  assembleSelectionTopLevelSignals(e) {
    return this.children.reduce((t, i) => i.assembleSelectionTopLevelSignals(t), e);
  }
  // TODO: Support same named selections across children.
  assembleSignals() {
    return this.children.reduce((e, t) => e.concat(t.assembleSignals()), lUA(this));
  }
  assembleLayoutSignals() {
    return this.children.reduce((e, t) => e.concat(t.assembleLayoutSignals()), PoA(this));
  }
  assembleSelectionData(e) {
    return this.children.reduce((t, i) => i.assembleSelectionData(t), e);
  }
  assembleGroupStyle() {
    const e = /* @__PURE__ */ new Set();
    for (const i of this.children)
      for (const n of Ce(i.assembleGroupStyle()))
        e.add(n);
    const t = Array.from(e);
    return t.length > 1 ? t : t.length === 1 ? t[0] : void 0;
  }
  assembleTitle() {
    let e = super.assembleTitle();
    if (e)
      return e;
    for (const t of this.children)
      if (e = t.assembleTitle(), e)
        return e;
  }
  assembleLayout() {
    return null;
  }
  assembleMarks() {
    return _4e(this, this.children.flatMap((e) => e.assembleMarks()));
  }
  assembleLegends() {
    return this.children.reduce((e, t) => e.concat(t.assembleLegends()), NUA(this));
  }
}
function BgA(A, e, t, i, n) {
  if (yV(A))
    return new FN(A, e, t, n);
  if (NV(A))
    return new CgA(A, e, t, i, n);
  if (UQ(A))
    return new $UA(A, e, t, i, n);
  if (F_e(A))
    return new Hje(A, e, t, n);
  throw new Error(noA(A));
}
function yPe(A, e = {}) {
  e.logger && Hze(e.logger), e.fieldTitle && e3A(e.fieldTitle);
  try {
    const t = J3A(XD(e.config, A.config)), i = H3A(A, t), n = BgA(i, null, "", void 0, t);
    return n.parse(), zOe(n.component.data, n), {
      spec: wPe(n, bPe(A, i.autosize, t, n), A.datasets, A.usermeta),
      normalized: i
    };
  } finally {
    e.logger && Sze(), e.fieldTitle && A_e();
  }
}
function bPe(A, e, t, i) {
  const n = i.component.layoutSize.get("width"), o = i.component.layoutSize.get("height");
  if (e === void 0 ? (e = { type: "pad" }, i.hasAxisOrientSignalRef() && (e.resize = !0)) : Be(e) && (e = { type: e }), n && o && Z4e(e.type)) {
    if (n === "step" && o === "step")
      PA(nhA()), e.type = "pad";
    else if (n === "step" || o === "step") {
      const g = n === "step" ? "width" : "height";
      PA(nhA(BV(g)));
      const s = g === "width" ? "height" : "width";
      e.type = W4e(s);
    }
  }
  return {
    ..._A(e).length === 1 && e.type ? e.type === "pad" ? {} : { autosize: e.type } : { autosize: e },
    ...RhA(t, !1),
    ...RhA(A, !0)
  };
}
function wPe(A, e, t = {}, i) {
  const n = A.config ? T_e(A.config) : void 0, o = [].concat(
    A.assembleSelectionData([]),
    // only assemble data in the root
    Gje(A.component.data, t)
  ), g = A.assembleProjections(), s = A.assembleTitle(), I = A.assembleGroupStyle(), r = A.assembleGroupEncodeEntry(!0);
  let a = A.assembleLayoutSignals();
  a = a.filter((l) => (l.name === "width" || l.name === "height") && l.value !== void 0 ? (e[l.name] = +l.value, !1) : !0);
  const { params: C, ...B } = e;
  return {
    $schema: "https://vega.github.io/schema/vega/v5.json",
    ...A.description ? { description: A.description } : {},
    ...B,
    ...s ? { title: s } : {},
    ...I ? { style: I } : {},
    ...r ? { encode: { update: r } } : {},
    data: o,
    ...g.length > 0 ? { projections: g } : {},
    ...A.assembleGroup([
      ...a,
      ...A.assembleSelectionTopLevelSignals([]),
      ...f3A(C)
    ]),
    ...n ? { config: n } : {},
    ...i ? { usermeta: i } : {}
  };
}
const fPe = t5e.version, DPe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  accessPathDepth: Mf,
  accessPathWithDatum: _nA,
  compile: yPe,
  contains: Ht,
  deepEqual: ZI,
  deleteNestedProperty: wZ,
  duplicate: tt,
  entries: nd,
  every: XnA,
  fieldIntersection: TnA,
  flatAccessWithDatum: HWA,
  getFirstDefined: _n,
  hasIntersection: znA,
  hash: vt,
  internalField: WWA,
  isBoolean: c2,
  isEmpty: Fi,
  isEqual: n5e,
  isInternalField: KWA,
  isNullOrFalse: sP,
  isNumeric: gV,
  keys: _A,
  logicalExpr: YN,
  mergeDeep: LWA,
  never: xWA,
  normalize: H3A,
  normalizeAngle: Q2,
  omit: Us,
  pick: Ff,
  prefixGenerator: IP,
  removePathFromField: qnA,
  replaceAll: yp,
  replacePathInField: Ir,
  resetIdCounter: g5e,
  setEqual: vWA,
  some: pp,
  stringify: Mi,
  titleCase: xF,
  unique: YB,
  uniqueId: ZWA,
  vals: tg,
  varName: En,
  version: fPe
}, Symbol.toStringTag, { value: "Module" }));
function AVA(A) {
  const [e, t] = /schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(A).slice(1, 3);
  return { library: e, version: t };
}
var GPe = "vega-themes", kPe = "2.14.0", JPe = "Themes for stylized Vega and Vega-Lite visualizations.", NPe = ["vega", "vega-lite", "themes", "style"], YPe = "BSD-3-Clause", RPe = {
  name: "UW Interactive Data Lab",
  url: "https://idl.cs.washington.edu"
}, FPe = [{
  name: "Emily Gu",
  url: "https://github.com/emilygu"
}, {
  name: "Arvind Satyanarayan",
  url: "http://arvindsatya.com"
}, {
  name: "Jeffrey Heer",
  url: "https://idl.cs.washington.edu"
}, {
  name: "Dominik Moritz",
  url: "https://www.domoritz.de"
}], MPe = "build/vega-themes.js", xPe = "build/vega-themes.module.js", LPe = "build/vega-themes.min.js", vPe = "build/vega-themes.min.js", HPe = "build/vega-themes.module.d.ts", SPe = {
  type: "git",
  url: "https://github.com/vega/vega-themes.git"
}, ZPe = ["src", "build"], WPe = {
  prebuild: "yarn clean",
  build: "rollup -c",
  clean: "rimraf build && rimraf examples/build",
  "copy:data": "rsync -r node_modules/vega-datasets/data/* examples/data",
  "copy:build": "rsync -r build/* examples/build",
  "deploy:gh": "yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",
  preversion: "yarn lint",
  serve: "browser-sync start -s -f build examples --serveStatic examples",
  start: "yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",
  format: "eslint . --fix",
  lint: "eslint .",
  release: "release-it"
}, KPe = {
  "@babel/core": "^7.22.9",
  "@babel/plugin-proposal-async-generator-functions": "^7.20.7",
  "@babel/plugin-proposal-json-strings": "^7.18.6",
  "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
  "@babel/plugin-proposal-optional-catch-binding": "^7.18.6",
  "@babel/plugin-transform-runtime": "^7.22.9",
  "@babel/preset-env": "^7.22.9",
  "@babel/preset-typescript": "^7.22.5",
  "@release-it/conventional-changelog": "^7.0.0",
  "@rollup/plugin-json": "^6.0.0",
  "@rollup/plugin-node-resolve": "^15.1.0",
  "@rollup/plugin-terser": "^0.4.3",
  "@typescript-eslint/eslint-plugin": "^6.0.0",
  "@typescript-eslint/parser": "^6.0.0",
  "browser-sync": "^2.29.3",
  concurrently: "^8.2.0",
  eslint: "^8.45.0",
  "eslint-config-prettier": "^8.8.0",
  "eslint-plugin-prettier": "^5.0.0",
  "gh-pages": "^5.0.0",
  prettier: "^3.0.0",
  "release-it": "^16.1.0",
  rollup: "^3.26.2",
  "rollup-plugin-bundle-size": "^1.0.3",
  "rollup-plugin-ts": "^3.2.0",
  typescript: "^5.1.6",
  vega: "^5.25.0",
  "vega-lite": "^5.9.3"
}, UPe = {
  vega: "*",
  "vega-lite": "*"
}, VPe = {}, XPe = {
  name: GPe,
  version: kPe,
  description: JPe,
  keywords: NPe,
  license: YPe,
  author: RPe,
  contributors: FPe,
  main: MPe,
  module: xPe,
  unpkg: LPe,
  jsdelivr: vPe,
  types: HPe,
  repository: SPe,
  files: ZPe,
  scripts: WPe,
  devDependencies: KPe,
  peerDependencies: UPe,
  dependencies: VPe
};
const py = "#fff", amA = "#888", zPe = {
  background: "#333",
  view: {
    stroke: amA
  },
  title: {
    color: py,
    subtitleColor: py
  },
  style: {
    "guide-label": {
      fill: py
    },
    "guide-title": {
      fill: py
    }
  },
  axis: {
    domainColor: py,
    gridColor: amA,
    tickColor: py
  }
}, Jh = "#4572a7", TPe = {
  background: "#fff",
  arc: {
    fill: Jh
  },
  area: {
    fill: Jh
  },
  line: {
    stroke: Jh,
    strokeWidth: 2
  },
  path: {
    stroke: Jh
  },
  rect: {
    fill: Jh
  },
  shape: {
    stroke: Jh
  },
  symbol: {
    fill: Jh,
    strokeWidth: 1.5,
    size: 50
  },
  axis: {
    bandPosition: 0.5,
    grid: !0,
    gridColor: "#000000",
    gridOpacity: 1,
    gridWidth: 0.5,
    labelPadding: 10,
    tickSize: 5,
    tickWidth: 0.5
  },
  axisBand: {
    grid: !1,
    tickExtra: !0
  },
  legend: {
    labelBaseline: "middle",
    labelFontSize: 11,
    symbolSize: 50,
    symbolType: "square"
  },
  range: {
    category: ["#4572a7", "#aa4643", "#8aa453", "#71598e", "#4598ae", "#d98445", "#94aace", "#d09393", "#b9cc98", "#a99cbc"]
  }
}, Nh = "#30a2da", cT = "#cbcbcb", _Pe = "#999", qPe = "#333", rmA = "#f0f0f0", CmA = "#333", OPe = {
  arc: {
    fill: Nh
  },
  area: {
    fill: Nh
  },
  axis: {
    domainColor: cT,
    grid: !0,
    gridColor: cT,
    gridWidth: 1,
    labelColor: _Pe,
    labelFontSize: 10,
    titleColor: qPe,
    tickColor: cT,
    tickSize: 10,
    titleFontSize: 14,
    titlePadding: 10,
    labelPadding: 4
  },
  axisBand: {
    grid: !1
  },
  background: rmA,
  group: {
    fill: rmA
  },
  legend: {
    labelColor: CmA,
    labelFontSize: 11,
    padding: 1,
    symbolSize: 30,
    symbolType: "square",
    titleColor: CmA,
    titleFontSize: 14,
    titlePadding: 10
  },
  line: {
    stroke: Nh,
    strokeWidth: 2
  },
  path: {
    stroke: Nh,
    strokeWidth: 0.5
  },
  rect: {
    fill: Nh
  },
  range: {
    category: ["#30a2da", "#fc4f30", "#e5ae38", "#6d904f", "#8b8b8b", "#b96db8", "#ff9e27", "#56cc60", "#52d2ca", "#52689e", "#545454", "#9fe4f8"],
    diverging: ["#cc0020", "#e77866", "#f6e7e1", "#d6e8ed", "#91bfd9", "#1d78b5"],
    heatmap: ["#d6e8ed", "#cee0e5", "#91bfd9", "#549cc6", "#1d78b5"]
  },
  point: {
    filled: !0,
    shape: "circle"
  },
  shape: {
    stroke: Nh
  },
  bar: {
    binSpacing: 2,
    fill: Nh,
    stroke: null
  },
  title: {
    anchor: "start",
    fontSize: 24,
    fontWeight: 600,
    offset: 20
  }
}, Yh = "#000", jPe = {
  group: {
    fill: "#e5e5e5"
  },
  arc: {
    fill: Yh
  },
  area: {
    fill: Yh
  },
  line: {
    stroke: Yh
  },
  path: {
    stroke: Yh
  },
  rect: {
    fill: Yh
  },
  shape: {
    stroke: Yh
  },
  symbol: {
    fill: Yh,
    size: 40
  },
  axis: {
    domain: !1,
    grid: !0,
    gridColor: "#FFFFFF",
    gridOpacity: 1,
    labelColor: "#7F7F7F",
    labelPadding: 4,
    tickColor: "#7F7F7F",
    tickSize: 5.67,
    titleFontSize: 16,
    titleFontWeight: "normal"
  },
  legend: {
    labelBaseline: "middle",
    labelFontSize: 11,
    symbolSize: 40
  },
  range: {
    category: ["#000000", "#7F7F7F", "#1A1A1A", "#999999", "#333333", "#B0B0B0", "#4D4D4D", "#C9C9C9", "#666666", "#DCDCDC"]
  }
}, PPe = 22, $Pe = "normal", BmA = "Benton Gothic, sans-serif", lmA = 11.5, A6e = "normal", Rh = "#82c6df", QT = "Benton Gothic Bold, sans-serif", cmA = "normal", QmA = 13, xk = {
  "category-6": ["#ec8431", "#829eb1", "#c89d29", "#3580b1", "#adc839", "#ab7fb4"],
  "fire-7": ["#fbf2c7", "#f9e39c", "#f8d36e", "#f4bb6a", "#e68a4f", "#d15a40", "#ab4232"],
  "fireandice-6": ["#e68a4f", "#f4bb6a", "#f9e39c", "#dadfe2", "#a6b7c6", "#849eae"],
  "ice-7": ["#edefee", "#dadfe2", "#c4ccd2", "#a6b7c6", "#849eae", "#607785", "#47525d"]
}, e6e = {
  background: "#ffffff",
  title: {
    anchor: "start",
    color: "#000000",
    font: QT,
    fontSize: PPe,
    fontWeight: $Pe
  },
  arc: {
    fill: Rh
  },
  area: {
    fill: Rh
  },
  line: {
    stroke: Rh,
    strokeWidth: 2
  },
  path: {
    stroke: Rh
  },
  rect: {
    fill: Rh
  },
  shape: {
    stroke: Rh
  },
  symbol: {
    fill: Rh,
    size: 30
  },
  axis: {
    labelFont: BmA,
    labelFontSize: lmA,
    labelFontWeight: A6e,
    titleFont: QT,
    titleFontSize: QmA,
    titleFontWeight: cmA
  },
  axisX: {
    labelAngle: 0,
    labelPadding: 4,
    tickSize: 3
  },
  axisY: {
    labelBaseline: "middle",
    maxExtent: 45,
    minExtent: 45,
    tickSize: 2,
    titleAlign: "left",
    titleAngle: 0,
    titleX: -45,
    titleY: -11
  },
  legend: {
    labelFont: BmA,
    labelFontSize: lmA,
    symbolType: "square",
    titleFont: QT,
    titleFontSize: QmA,
    titleFontWeight: cmA
  },
  range: {
    category: xk["category-6"],
    diverging: xk["fireandice-6"],
    heatmap: xk["fire-7"],
    ordinal: xk["fire-7"],
    ramp: xk["fire-7"]
  }
}, Fh = "#ab5787", bx = "#979797", t6e = {
  background: "#f9f9f9",
  arc: {
    fill: Fh
  },
  area: {
    fill: Fh
  },
  line: {
    stroke: Fh
  },
  path: {
    stroke: Fh
  },
  rect: {
    fill: Fh
  },
  shape: {
    stroke: Fh
  },
  symbol: {
    fill: Fh,
    size: 30
  },
  axis: {
    domainColor: bx,
    domainWidth: 0.5,
    gridWidth: 0.2,
    labelColor: bx,
    tickColor: bx,
    tickWidth: 0.2,
    titleColor: bx
  },
  axisBand: {
    grid: !1
  },
  axisX: {
    grid: !0,
    tickSize: 10
  },
  axisY: {
    domain: !1,
    grid: !0,
    tickSize: 0
  },
  legend: {
    labelFontSize: 11,
    padding: 1,
    symbolSize: 30,
    symbolType: "square"
  },
  range: {
    category: ["#ab5787", "#51b2e5", "#703c5c", "#168dd9", "#d190b6", "#00609f", "#d365ba", "#154866", "#666666", "#c4c4c4"]
  }
}, Mh = "#3e5c69", i6e = {
  background: "#fff",
  arc: {
    fill: Mh
  },
  area: {
    fill: Mh
  },
  line: {
    stroke: Mh
  },
  path: {
    stroke: Mh
  },
  rect: {
    fill: Mh
  },
  shape: {
    stroke: Mh
  },
  symbol: {
    fill: Mh
  },
  axis: {
    domainWidth: 0.5,
    grid: !0,
    labelPadding: 2,
    tickSize: 5,
    tickWidth: 0.5,
    titleFontWeight: "normal"
  },
  axisBand: {
    grid: !1
  },
  axisX: {
    gridWidth: 0.2
  },
  axisY: {
    gridDash: [3],
    gridWidth: 0.4
  },
  legend: {
    labelFontSize: 11,
    padding: 1,
    symbolType: "square"
  },
  range: {
    category: ["#3e5c69", "#6793a6", "#182429", "#0570b0", "#3690c0", "#74a9cf", "#a6bddb", "#e2ddf2"]
  }
}, ya = "#1696d2", EmA = "#000000", n6e = "#FFFFFF", wx = "Lato", ET = "Lato", o6e = "Lato", g6e = "#DEDDDD", s6e = 18, Lk = {
  "main-colors": ["#1696d2", "#d2d2d2", "#000000", "#fdbf11", "#ec008b", "#55b748", "#5c5859", "#db2b27"],
  "shades-blue": ["#CFE8F3", "#A2D4EC", "#73BFE2", "#46ABDB", "#1696D2", "#12719E", "#0A4C6A", "#062635"],
  "shades-gray": ["#F5F5F5", "#ECECEC", "#E3E3E3", "#DCDBDB", "#D2D2D2", "#9D9D9D", "#696969", "#353535"],
  "shades-yellow": ["#FFF2CF", "#FCE39E", "#FDD870", "#FCCB41", "#FDBF11", "#E88E2D", "#CA5800", "#843215"],
  "shades-magenta": ["#F5CBDF", "#EB99C2", "#E46AA7", "#E54096", "#EC008B", "#AF1F6B", "#761548", "#351123"],
  "shades-green": ["#DCEDD9", "#BCDEB4", "#98CF90", "#78C26D", "#55B748", "#408941", "#2C5C2D", "#1A2E19"],
  "shades-black": ["#D5D5D4", "#ADABAC", "#848081", "#5C5859", "#332D2F", "#262223", "#1A1717", "#0E0C0D"],
  "shades-red": ["#F8D5D4", "#F1AAA9", "#E9807D", "#E25552", "#DB2B27", "#A4201D", "#6E1614", "#370B0A"],
  "one-group": ["#1696d2", "#000000"],
  "two-groups-cat-1": ["#1696d2", "#000000"],
  "two-groups-cat-2": ["#1696d2", "#fdbf11"],
  "two-groups-cat-3": ["#1696d2", "#db2b27"],
  "two-groups-seq": ["#a2d4ec", "#1696d2"],
  "three-groups-cat": ["#1696d2", "#fdbf11", "#000000"],
  "three-groups-seq": ["#a2d4ec", "#1696d2", "#0a4c6a"],
  "four-groups-cat-1": ["#000000", "#d2d2d2", "#fdbf11", "#1696d2"],
  "four-groups-cat-2": ["#1696d2", "#ec0008b", "#fdbf11", "#5c5859"],
  "four-groups-seq": ["#cfe8f3", "#73bf42", "#1696d2", "#0a4c6a"],
  "five-groups-cat-1": ["#1696d2", "#fdbf11", "#d2d2d2", "#ec008b", "#000000"],
  "five-groups-cat-2": ["#1696d2", "#0a4c6a", "#d2d2d2", "#fdbf11", "#332d2f"],
  "five-groups-seq": ["#cfe8f3", "#73bf42", "#1696d2", "#0a4c6a", "#000000"],
  "six-groups-cat-1": ["#1696d2", "#ec008b", "#fdbf11", "#000000", "#d2d2d2", "#55b748"],
  "six-groups-cat-2": ["#1696d2", "#d2d2d2", "#ec008b", "#fdbf11", "#332d2f", "#0a4c6a"],
  "six-groups-seq": ["#cfe8f3", "#a2d4ec", "#73bfe2", "#46abdb", "#1696d2", "#12719e"],
  "diverging-colors": ["#ca5800", "#fdbf11", "#fdd870", "#fff2cf", "#cfe8f3", "#73bfe2", "#1696d2", "#0a4c6a"]
}, I6e = {
  background: n6e,
  title: {
    anchor: "start",
    fontSize: s6e,
    font: wx
  },
  axisX: {
    domain: !0,
    domainColor: EmA,
    domainWidth: 1,
    grid: !1,
    labelFontSize: 12,
    labelFont: ET,
    labelAngle: 0,
    tickColor: EmA,
    tickSize: 5,
    titleFontSize: 12,
    titlePadding: 10,
    titleFont: wx
  },
  axisY: {
    domain: !1,
    domainWidth: 1,
    grid: !0,
    gridColor: g6e,
    gridWidth: 1,
    labelFontSize: 12,
    labelFont: ET,
    labelPadding: 8,
    ticks: !1,
    titleFontSize: 12,
    titlePadding: 10,
    titleFont: wx,
    titleAngle: 0,
    titleY: -10,
    titleX: 18
  },
  legend: {
    labelFontSize: 12,
    labelFont: ET,
    symbolSize: 100,
    titleFontSize: 12,
    titlePadding: 10,
    titleFont: wx,
    orient: "right",
    offset: 10
  },
  view: {
    stroke: "transparent"
  },
  range: {
    category: Lk["six-groups-cat-1"],
    diverging: Lk["diverging-colors"],
    heatmap: Lk["diverging-colors"],
    ordinal: Lk["six-groups-seq"],
    ramp: Lk["shades-blue"]
  },
  area: {
    fill: ya
  },
  rect: {
    fill: ya
  },
  line: {
    color: ya,
    stroke: ya,
    strokeWidth: 5
  },
  trail: {
    color: ya,
    stroke: ya,
    strokeWidth: 0,
    size: 1
  },
  path: {
    stroke: ya,
    strokeWidth: 0.5
  },
  point: {
    filled: !0
  },
  text: {
    font: o6e,
    color: ya,
    fontSize: 11,
    align: "center",
    fontWeight: 400,
    size: 11
  },
  style: {
    bar: {
      fill: ya,
      stroke: null
    }
  },
  arc: {
    fill: ya
  },
  shape: {
    stroke: ya
  },
  symbol: {
    fill: ya,
    size: 30
  }
}, xh = "#3366CC", umA = "#ccc", fx = "Arial, sans-serif", a6e = {
  arc: {
    fill: xh
  },
  area: {
    fill: xh
  },
  path: {
    stroke: xh
  },
  rect: {
    fill: xh
  },
  shape: {
    stroke: xh
  },
  symbol: {
    stroke: xh
  },
  circle: {
    fill: xh
  },
  background: "#fff",
  padding: {
    top: 10,
    right: 10,
    bottom: 10,
    left: 10
  },
  style: {
    "guide-label": {
      font: fx,
      fontSize: 12
    },
    "guide-title": {
      font: fx,
      fontSize: 12
    },
    "group-title": {
      font: fx,
      fontSize: 12
    }
  },
  title: {
    font: fx,
    fontSize: 14,
    fontWeight: "bold",
    dy: -3,
    anchor: "start"
  },
  axis: {
    gridColor: umA,
    tickColor: umA,
    domain: !1,
    grid: !0
  },
  range: {
    category: ["#4285F4", "#DB4437", "#F4B400", "#0F9D58", "#AB47BC", "#00ACC1", "#FF7043", "#9E9D24", "#5C6BC0", "#F06292", "#00796B", "#C2185B"],
    heatmap: ["#c6dafc", "#5e97f6", "#2a56c6"]
  }
}, lgA = (A) => A * (1 / 3 + 1), dmA = lgA(9), hmA = lgA(10), mmA = lgA(12), vk = "Segoe UI", pmA = "wf_standard-font, helvetica, arial, sans-serif", ymA = "#252423", Hk = "#605E5C", bmA = "transparent", r6e = "#C8C6C4", Jr = "#118DFF", C6e = "#12239E", B6e = "#E66C37", l6e = "#6B007B", c6e = "#E044A7", Q6e = "#744EC2", E6e = "#D9B300", u6e = "#D64550", eVA = Jr, tVA = "#DEEFFF", wmA = [tVA, eVA], d6e = [tVA, "#c7e4ff", "#b0d9ff", "#9aceff", "#83c3ff", "#6cb9ff", "#55aeff", "#3fa3ff", "#2898ff", eVA], h6e = {
  view: {
    stroke: bmA
  },
  background: bmA,
  font: vk,
  header: {
    titleFont: pmA,
    titleFontSize: mmA,
    titleColor: ymA,
    labelFont: vk,
    labelFontSize: hmA,
    labelColor: Hk
  },
  axis: {
    ticks: !1,
    grid: !1,
    domain: !1,
    labelColor: Hk,
    labelFontSize: dmA,
    titleFont: pmA,
    titleColor: ymA,
    titleFontSize: mmA,
    titleFontWeight: "normal"
  },
  axisQuantitative: {
    tickCount: 3,
    grid: !0,
    gridColor: r6e,
    gridDash: [1, 5],
    labelFlush: !1
  },
  axisBand: {
    tickExtra: !0
  },
  axisX: {
    labelPadding: 5
  },
  axisY: {
    labelPadding: 10
  },
  bar: {
    fill: Jr
  },
  line: {
    stroke: Jr,
    strokeWidth: 3,
    strokeCap: "round",
    strokeJoin: "round"
  },
  text: {
    font: vk,
    fontSize: dmA,
    fill: Hk
  },
  arc: {
    fill: Jr
  },
  area: {
    fill: Jr,
    line: !0,
    opacity: 0.6
  },
  path: {
    stroke: Jr
  },
  rect: {
    fill: Jr
  },
  point: {
    fill: Jr,
    filled: !0,
    size: 75
  },
  shape: {
    stroke: Jr
  },
  symbol: {
    fill: Jr,
    strokeWidth: 1.5,
    size: 50
  },
  legend: {
    titleFont: vk,
    titleFontWeight: "bold",
    titleColor: Hk,
    labelFont: vk,
    labelFontSize: hmA,
    labelColor: Hk,
    symbolType: "circle",
    symbolSize: 75
  },
  range: {
    category: [Jr, C6e, B6e, l6e, c6e, Q6e, E6e, u6e],
    diverging: wmA,
    heatmap: wmA,
    ordinal: d6e
  }
}, uT = 'IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif', fmA = 400, m6e = ["#8a3ffc", "#33b1ff", "#007d79", "#ff7eb6", "#fa4d56", "#fff1f1", "#6fdc8c", "#4589ff", "#d12771", "#d2a106", "#08bdba", "#bae6ff", "#ba4e00", "#d4bbff"], p6e = ["#6929c4", "#1192e8", "#005d5d", "#9f1853", "#fa4d56", "#570408", "#198038", "#002d9c", "#ee538b", "#b28600", "#009d9a", "#012749", "#8a3800", "#a56eff"];
function qV({
  type: A,
  background: e
}) {
  const t = A === "dark" ? "#161616" : "#ffffff", i = A === "dark" ? "#f4f4f4" : "#161616", n = A === "dark" ? m6e : p6e, o = A === "dark" ? "#d4bbff" : "#6929c4";
  return {
    background: e,
    arc: {
      fill: o
    },
    area: {
      fill: o
    },
    path: {
      stroke: o
    },
    rect: {
      fill: o
    },
    shape: {
      stroke: o
    },
    symbol: {
      stroke: o
    },
    circle: {
      fill: o
    },
    view: {
      fill: t,
      stroke: t
    },
    group: {
      fill: t
    },
    title: {
      color: i,
      anchor: "start",
      dy: -15,
      fontSize: 16,
      font: uT,
      fontWeight: 600
    },
    axis: {
      labelColor: i,
      labelFontSize: 12,
      grid: !0,
      gridColor: "#525252",
      titleColor: i,
      labelAngle: 0
    },
    style: {
      "guide-label": {
        font: uT,
        fill: i,
        fontWeight: fmA
      },
      "guide-title": {
        font: uT,
        fill: i,
        fontWeight: fmA
      }
    },
    range: {
      category: n,
      diverging: ["#750e13", "#a2191f", "#da1e28", "#fa4d56", "#ff8389", "#ffb3b8", "#ffd7d9", "#fff1f1", "#e5f6ff", "#bae6ff", "#82cfff", "#33b1ff", "#1192e8", "#0072c3", "#00539a", "#003a6d"],
      heatmap: ["#f6f2ff", "#e8daff", "#d4bbff", "#be95ff", "#a56eff", "#8a3ffc", "#6929c4", "#491d8b", "#31135e", "#1c0f30"]
    }
  };
}
const y6e = qV({
  type: "light",
  background: "#ffffff"
}), b6e = qV({
  type: "light",
  background: "#f4f4f4"
}), w6e = qV({
  type: "dark",
  background: "#262626"
}), f6e = qV({
  type: "dark",
  background: "#161616"
}), D6e = XPe.version, G6e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  carbong10: b6e,
  carbong100: f6e,
  carbong90: w6e,
  carbonwhite: y6e,
  dark: zPe,
  excel: TPe,
  fivethirtyeight: OPe,
  ggplot2: jPe,
  googlecharts: a6e,
  latimes: e6e,
  powerbi: h6e,
  quartz: t6e,
  urbaninstitute: I6e,
  version: D6e,
  vox: i6e
}, Symbol.toStringTag, { value: "Module" }));
function k6e(A, e, t) {
  if (ZA(A))
    return `[${A.map((i) => e(Be(i) ? i : DmA(i, t))).join(", ")}]`;
  if (ce(A)) {
    let i = "";
    const {
      title: n,
      image: o,
      ...g
    } = A;
    n && (i += `<h2>${e(n)}</h2>`), o && (i += `<img src="${e(o)}">`);
    const s = Object.keys(g);
    if (s.length > 0) {
      i += "<table>";
      for (const I of s) {
        let r = g[I];
        r !== void 0 && (ce(r) && (r = DmA(r, t)), i += `<tr><td class="key">${e(I)}</td><td class="value">${e(r)}</td></tr>`);
      }
      i += "</table>";
    }
    return i || "{}";
  }
  return e(A);
}
function J6e(A) {
  const e = [];
  return function(t, i) {
    if (typeof i != "object" || i === null)
      return i;
    const n = e.indexOf(this) + 1;
    return e.length = n, e.length > A ? "[Object]" : e.indexOf(i) >= 0 ? "[Circular]" : (e.push(i), i);
  };
}
function DmA(A, e) {
  return JSON.stringify(A, J6e(e));
}
var N6e = `#vg-tooltip-element {
  visibility: hidden;
  padding: 8px;
  position: fixed;
  z-index: 1000;
  font-family: sans-serif;
  font-size: 11px;
  border-radius: 3px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  /* The default theme is the light theme. */
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #d9d9d9;
  color: black;
}
#vg-tooltip-element.visible {
  visibility: visible;
}
#vg-tooltip-element h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 13px;
}
#vg-tooltip-element table {
  border-spacing: 0;
}
#vg-tooltip-element table tr {
  border: none;
}
#vg-tooltip-element table tr td {
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 2px;
  padding-bottom: 2px;
}
#vg-tooltip-element table tr td.key {
  color: #808080;
  max-width: 150px;
  text-align: right;
  padding-right: 4px;
}
#vg-tooltip-element table tr td.value {
  display: block;
  max-width: 300px;
  max-height: 7em;
  text-align: left;
}
#vg-tooltip-element.dark-theme {
  background-color: rgba(32, 32, 32, 0.9);
  border: 1px solid #f5f5f5;
  color: white;
}
#vg-tooltip-element.dark-theme td.key {
  color: #bfbfbf;
}
`;
const iVA = "vg-tooltip-element", Y6e = {
  /**
   * X offset.
   */
  offsetX: 10,
  /**
   * Y offset.
   */
  offsetY: 10,
  /**
   * ID of the tooltip element.
   */
  id: iVA,
  /**
   * ID of the tooltip CSS style.
   */
  styleId: "vega-tooltip-style",
  /**
   * The name of the theme. You can use the CSS class called [THEME]-theme to style the tooltips.
   *
   * There are two predefined themes: "light" (default) and "dark".
   */
  theme: "light",
  /**
   * Do not use the default styles provided by Vega Tooltip. If you enable this option, you need to use your own styles. It is not necessary to disable the default style when using a custom theme.
   */
  disableDefaultStyle: !1,
  /**
   * HTML sanitizer function that removes dangerous HTML to prevent XSS.
   *
   * This should be a function from string to string. You may replace it with a formatter such as a markdown formatter.
   */
  sanitize: R6e,
  /**
   * The maximum recursion depth when printing objects in the tooltip.
   */
  maxDepth: 2,
  /**
   * A function to customize the rendered HTML of the tooltip.
   * @param value A value string, or object of value strings keyed by field
   * @param sanitize The `sanitize` function from `options.sanitize`
   * @returns {string} The returned string will become the `innerHTML` of the tooltip element
   */
  formatTooltip: k6e
};
function R6e(A) {
  return String(A).replace(/&/g, "&amp;").replace(/</g, "&lt;");
}
function F6e(A) {
  if (!/^[A-Za-z]+[-:.\w]*$/.test(A))
    throw new Error("Invalid HTML ID");
  return N6e.toString().replace(iVA, A);
}
function M6e(A, e, t, i) {
  let n = A.clientX + t;
  n + e.width > window.innerWidth && (n = +A.clientX - t - e.width);
  let o = A.clientY + i;
  return o + e.height > window.innerHeight && (o = +A.clientY - i - e.height), {
    x: n,
    y: o
  };
}
class x6e {
  /**
   * The handler function. We bind this to this function in the constructor.
   */
  /**
   * Complete tooltip options.
   */
  /**
   * The tooltip html element.
   */
  /**
   * Create the tooltip handler and initialize the element and style.
   *
   * @param options Tooltip Options
   */
  constructor(e) {
    this.options = {
      ...Y6e,
      ...e
    };
    const t = this.options.id;
    if (this.el = null, this.call = this.tooltipHandler.bind(this), !this.options.disableDefaultStyle && !document.getElementById(this.options.styleId)) {
      const i = document.createElement("style");
      i.setAttribute("id", this.options.styleId), i.innerHTML = F6e(t);
      const n = document.head;
      n.childNodes.length > 0 ? n.insertBefore(i, n.childNodes[0]) : n.appendChild(i);
    }
  }
  /**
   * The tooltip handler function.
   */
  tooltipHandler(e, t, i, n) {
    if (this.el = document.getElementById(this.options.id), this.el || (this.el = document.createElement("div"), this.el.setAttribute("id", this.options.id), this.el.classList.add("vg-tooltip"), (document.fullscreenElement ?? document.body).appendChild(this.el)), n == null || n === "") {
      this.el.classList.remove("visible", `${this.options.theme}-theme`);
      return;
    }
    this.el.innerHTML = this.options.formatTooltip(n, this.options.sanitize, this.options.maxDepth), this.el.classList.add("visible", `${this.options.theme}-theme`);
    const {
      x: o,
      y: g
    } = M6e(t, this.el.getBoundingClientRect(), this.options.offsetX, this.options.offsetY);
    this.el.style.top = `${g}px`, this.el.style.left = `${o}px`;
  }
}
function p2(A) {
  return p2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, p2(A);
}
function L6e(A, e) {
  if (p2(A) !== "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (p2(i) !== "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function v6e(A) {
  var e = L6e(A, "string");
  return p2(e) === "symbol" ? e : String(e);
}
function H6e(A, e, t) {
  return e = v6e(e), e in A ? Object.defineProperty(A, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : A[e] = t, A;
}
function S6e(A) {
  return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
}
var GmA, kmA;
function Z6e() {
  return kmA || (kmA = 1, GmA = function(A) {
    A.prototype[Symbol.iterator] = function* () {
      for (let e = this.head; e; e = e.next)
        yield e.value;
    };
  }), GmA;
}
var W6e = Ci;
Ci.Node = Yp;
Ci.create = Ci;
function Ci(A) {
  var e = this;
  if (e instanceof Ci || (e = new Ci()), e.tail = null, e.head = null, e.length = 0, A && typeof A.forEach == "function")
    A.forEach(function(n) {
      e.push(n);
    });
  else if (arguments.length > 0)
    for (var t = 0, i = arguments.length; t < i; t++)
      e.push(arguments[t]);
  return e;
}
Ci.prototype.removeNode = function(A) {
  if (A.list !== this)
    throw new Error("removing node which does not belong to this list");
  var e = A.next, t = A.prev;
  return e && (e.prev = t), t && (t.next = e), A === this.head && (this.head = e), A === this.tail && (this.tail = t), A.list.length--, A.next = null, A.prev = null, A.list = null, e;
};
Ci.prototype.unshiftNode = function(A) {
  if (A !== this.head) {
    A.list && A.list.removeNode(A);
    var e = this.head;
    A.list = this, A.next = e, e && (e.prev = A), this.head = A, this.tail || (this.tail = A), this.length++;
  }
};
Ci.prototype.pushNode = function(A) {
  if (A !== this.tail) {
    A.list && A.list.removeNode(A);
    var e = this.tail;
    A.list = this, A.prev = e, e && (e.next = A), this.tail = A, this.head || (this.head = A), this.length++;
  }
};
Ci.prototype.push = function() {
  for (var A = 0, e = arguments.length; A < e; A++)
    U6e(this, arguments[A]);
  return this.length;
};
Ci.prototype.unshift = function() {
  for (var A = 0, e = arguments.length; A < e; A++)
    V6e(this, arguments[A]);
  return this.length;
};
Ci.prototype.pop = function() {
  if (this.tail) {
    var A = this.tail.value;
    return this.tail = this.tail.prev, this.tail ? this.tail.next = null : this.head = null, this.length--, A;
  }
};
Ci.prototype.shift = function() {
  if (this.head) {
    var A = this.head.value;
    return this.head = this.head.next, this.head ? this.head.prev = null : this.tail = null, this.length--, A;
  }
};
Ci.prototype.forEach = function(A, e) {
  e = e || this;
  for (var t = this.head, i = 0; t !== null; i++)
    A.call(e, t.value, i, this), t = t.next;
};
Ci.prototype.forEachReverse = function(A, e) {
  e = e || this;
  for (var t = this.tail, i = this.length - 1; t !== null; i--)
    A.call(e, t.value, i, this), t = t.prev;
};
Ci.prototype.get = function(A) {
  for (var e = 0, t = this.head; t !== null && e < A; e++)
    t = t.next;
  if (e === A && t !== null)
    return t.value;
};
Ci.prototype.getReverse = function(A) {
  for (var e = 0, t = this.tail; t !== null && e < A; e++)
    t = t.prev;
  if (e === A && t !== null)
    return t.value;
};
Ci.prototype.map = function(A, e) {
  e = e || this;
  for (var t = new Ci(), i = this.head; i !== null; )
    t.push(A.call(e, i.value, this)), i = i.next;
  return t;
};
Ci.prototype.mapReverse = function(A, e) {
  e = e || this;
  for (var t = new Ci(), i = this.tail; i !== null; )
    t.push(A.call(e, i.value, this)), i = i.prev;
  return t;
};
Ci.prototype.reduce = function(A, e) {
  var t, i = this.head;
  if (arguments.length > 1)
    t = e;
  else if (this.head)
    i = this.head.next, t = this.head.value;
  else
    throw new TypeError("Reduce of empty list with no initial value");
  for (var n = 0; i !== null; n++)
    t = A(t, i.value, n), i = i.next;
  return t;
};
Ci.prototype.reduceReverse = function(A, e) {
  var t, i = this.tail;
  if (arguments.length > 1)
    t = e;
  else if (this.tail)
    i = this.tail.prev, t = this.tail.value;
  else
    throw new TypeError("Reduce of empty list with no initial value");
  for (var n = this.length - 1; i !== null; n--)
    t = A(t, i.value, n), i = i.prev;
  return t;
};
Ci.prototype.toArray = function() {
  for (var A = new Array(this.length), e = 0, t = this.head; t !== null; e++)
    A[e] = t.value, t = t.next;
  return A;
};
Ci.prototype.toArrayReverse = function() {
  for (var A = new Array(this.length), e = 0, t = this.tail; t !== null; e++)
    A[e] = t.value, t = t.prev;
  return A;
};
Ci.prototype.slice = function(A, e) {
  e = e || this.length, e < 0 && (e += this.length), A = A || 0, A < 0 && (A += this.length);
  var t = new Ci();
  if (e < A || e < 0)
    return t;
  A < 0 && (A = 0), e > this.length && (e = this.length);
  for (var i = 0, n = this.head; n !== null && i < A; i++)
    n = n.next;
  for (; n !== null && i < e; i++, n = n.next)
    t.push(n.value);
  return t;
};
Ci.prototype.sliceReverse = function(A, e) {
  e = e || this.length, e < 0 && (e += this.length), A = A || 0, A < 0 && (A += this.length);
  var t = new Ci();
  if (e < A || e < 0)
    return t;
  A < 0 && (A = 0), e > this.length && (e = this.length);
  for (var i = this.length, n = this.tail; n !== null && i > e; i--)
    n = n.prev;
  for (; n !== null && i > A; i--, n = n.prev)
    t.push(n.value);
  return t;
};
Ci.prototype.splice = function(A, e, ...t) {
  A > this.length && (A = this.length - 1), A < 0 && (A = this.length + A);
  for (var i = 0, n = this.head; n !== null && i < A; i++)
    n = n.next;
  for (var o = [], i = 0; n && i < e; i++)
    o.push(n.value), n = this.removeNode(n);
  n === null && (n = this.tail), n !== this.head && n !== this.tail && (n = n.prev);
  for (var i = 0; i < t.length; i++)
    n = K6e(this, n, t[i]);
  return o;
};
Ci.prototype.reverse = function() {
  for (var A = this.head, e = this.tail, t = A; t !== null; t = t.prev) {
    var i = t.prev;
    t.prev = t.next, t.next = i;
  }
  return this.head = e, this.tail = A, this;
};
function K6e(A, e, t) {
  var i = e === A.head ? new Yp(t, null, e, A) : new Yp(t, e, e.next, A);
  return i.next === null && (A.tail = i), i.prev === null && (A.head = i), A.length++, i;
}
function U6e(A, e) {
  A.tail = new Yp(e, A.tail, null, A), A.head || (A.head = A.tail), A.length++;
}
function V6e(A, e) {
  A.head = new Yp(e, null, A.head, A), A.tail || (A.tail = A.head), A.length++;
}
function Yp(A, e, t, i) {
  if (!(this instanceof Yp))
    return new Yp(A, e, t, i);
  this.list = i, this.value = A, e ? (e.next = this, this.prev = e) : this.prev = null, t ? (t.prev = this, this.next = t) : this.next = null;
}
try {
  Z6e()(Ci);
} catch {
}
const X6e = W6e, nm = Symbol("max"), yc = Symbol("length"), yy = Symbol("lengthCalculator"), MN = Symbol("allowStale"), Em = Symbol("maxAge"), Cc = Symbol("dispose"), JmA = Symbol("noDisposeOnSet"), Do = Symbol("lruList"), Rr = Symbol("cache"), nVA = Symbol("updateAgeOnGet"), dT = () => 1;
class z6e {
  constructor(e) {
    if (typeof e == "number" && (e = {
      max: e
    }), e || (e = {}), e.max && (typeof e.max != "number" || e.max < 0))
      throw new TypeError("max must be a non-negative number");
    this[nm] = e.max || 1 / 0;
    const t = e.length || dT;
    if (this[yy] = typeof t != "function" ? dT : t, this[MN] = e.stale || !1, e.maxAge && typeof e.maxAge != "number")
      throw new TypeError("maxAge must be a number");
    this[Em] = e.maxAge || 0, this[Cc] = e.dispose, this[JmA] = e.noDisposeOnSet || !1, this[nVA] = e.updateAgeOnGet || !1, this.reset();
  }
  // resize the cache when the max changes.
  set max(e) {
    if (typeof e != "number" || e < 0)
      throw new TypeError("max must be a non-negative number");
    this[nm] = e || 1 / 0, Sk(this);
  }
  get max() {
    return this[nm];
  }
  set allowStale(e) {
    this[MN] = !!e;
  }
  get allowStale() {
    return this[MN];
  }
  set maxAge(e) {
    if (typeof e != "number")
      throw new TypeError("maxAge must be a non-negative number");
    this[Em] = e, Sk(this);
  }
  get maxAge() {
    return this[Em];
  }
  // resize the cache when the lengthCalculator changes.
  set lengthCalculator(e) {
    typeof e != "function" && (e = dT), e !== this[yy] && (this[yy] = e, this[yc] = 0, this[Do].forEach((t) => {
      t.length = this[yy](t.value, t.key), this[yc] += t.length;
    })), Sk(this);
  }
  get lengthCalculator() {
    return this[yy];
  }
  get length() {
    return this[yc];
  }
  get itemCount() {
    return this[Do].length;
  }
  rforEach(e, t) {
    t = t || this;
    for (let i = this[Do].tail; i !== null; ) {
      const n = i.prev;
      NmA(this, e, i, t), i = n;
    }
  }
  forEach(e, t) {
    t = t || this;
    for (let i = this[Do].head; i !== null; ) {
      const n = i.next;
      NmA(this, e, i, t), i = n;
    }
  }
  keys() {
    return this[Do].toArray().map((e) => e.key);
  }
  values() {
    return this[Do].toArray().map((e) => e.value);
  }
  reset() {
    this[Cc] && this[Do] && this[Do].length && this[Do].forEach((e) => this[Cc](e.key, e.value)), this[Rr] = /* @__PURE__ */ new Map(), this[Do] = new X6e(), this[yc] = 0;
  }
  dump() {
    return this[Do].map((e) => ZZ(this, e) ? !1 : {
      k: e.key,
      v: e.value,
      e: e.now + (e.maxAge || 0)
    }).toArray().filter((e) => e);
  }
  dumpLru() {
    return this[Do];
  }
  set(e, t, i) {
    if (i = i || this[Em], i && typeof i != "number")
      throw new TypeError("maxAge must be a number");
    const n = i ? Date.now() : 0, o = this[yy](t, e);
    if (this[Rr].has(e)) {
      if (o > this[nm])
        return dw(this, this[Rr].get(e)), !1;
      const s = this[Rr].get(e).value;
      return this[Cc] && (this[JmA] || this[Cc](e, s.value)), s.now = n, s.maxAge = i, s.value = t, this[yc] += o - s.length, s.length = o, this.get(e), Sk(this), !0;
    }
    const g = new T6e(e, t, o, n, i);
    return g.length > this[nm] ? (this[Cc] && this[Cc](e, t), !1) : (this[yc] += g.length, this[Do].unshift(g), this[Rr].set(e, this[Do].head), Sk(this), !0);
  }
  has(e) {
    if (!this[Rr].has(e))
      return !1;
    const t = this[Rr].get(e).value;
    return !ZZ(this, t);
  }
  get(e) {
    return hT(this, e, !0);
  }
  peek(e) {
    return hT(this, e, !1);
  }
  pop() {
    const e = this[Do].tail;
    return e ? (dw(this, e), e.value) : null;
  }
  del(e) {
    dw(this, this[Rr].get(e));
  }
  load(e) {
    this.reset();
    const t = Date.now();
    for (let i = e.length - 1; i >= 0; i--) {
      const n = e[i], o = n.e || 0;
      if (o === 0)
        this.set(n.k, n.v);
      else {
        const g = o - t;
        g > 0 && this.set(n.k, n.v, g);
      }
    }
  }
  prune() {
    this[Rr].forEach((e, t) => hT(this, t, !1));
  }
}
const hT = (A, e, t) => {
  const i = A[Rr].get(e);
  if (i) {
    const n = i.value;
    if (ZZ(A, n)) {
      if (dw(A, i), !A[MN])
        return;
    } else
      t && (A[nVA] && (i.value.now = Date.now()), A[Do].unshiftNode(i));
    return n.value;
  }
}, ZZ = (A, e) => {
  if (!e || !e.maxAge && !A[Em])
    return !1;
  const t = Date.now() - e.now;
  return e.maxAge ? t > e.maxAge : A[Em] && t > A[Em];
}, Sk = (A) => {
  if (A[yc] > A[nm])
    for (let e = A[Do].tail; A[yc] > A[nm] && e !== null; ) {
      const t = e.prev;
      dw(A, e), e = t;
    }
}, dw = (A, e) => {
  if (e) {
    const t = e.value;
    A[Cc] && A[Cc](t.key, t.value), A[yc] -= t.length, A[Rr].delete(t.key), A[Do].removeNode(e);
  }
};
class T6e {
  constructor(e, t, i, n, o) {
    this.key = e, this.value = t, this.length = i, this.now = n, this.maxAge = o || 0;
  }
}
const NmA = (A, e, t, i) => {
  let n = t.value;
  ZZ(A, n) && (dw(A, t), A[MN] || (n = void 0)), n && e.call(i, n.value, n.key, A);
};
var _6e = z6e;
const q6e = Object.freeze({
  loose: !0
}), O6e = Object.freeze({}), j6e = (A) => A ? typeof A != "object" ? q6e : A : O6e;
var cgA = j6e, NP = { exports: {} };
const P6e = "2.0.0", oVA = 256, $6e = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
9007199254740991, A8e = 16, e8e = oVA - 6, t8e = ["major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease"];
var QgA = {
  MAX_LENGTH: oVA,
  MAX_SAFE_COMPONENT_LENGTH: A8e,
  MAX_SAFE_BUILD_LENGTH: e8e,
  MAX_SAFE_INTEGER: $6e,
  RELEASE_TYPES: t8e,
  SEMVER_SPEC_VERSION: P6e,
  FLAG_INCLUDE_PRERELEASE: 1,
  FLAG_LOOSE: 2
};
const i8e = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...A) => console.error("SEMVER", ...A) : () => {
};
var OV = i8e;
(function(A, e) {
  const {
    MAX_SAFE_COMPONENT_LENGTH: t,
    MAX_SAFE_BUILD_LENGTH: i,
    MAX_LENGTH: n
  } = QgA, o = OV;
  e = A.exports = {};
  const g = e.re = [], s = e.safeRe = [], I = e.src = [], r = e.t = {};
  let a = 0;
  const C = "[a-zA-Z0-9-]", B = [["\\s", 1], ["\\d", n], [C, i]], l = (E) => {
    for (const [d, m] of B)
      E = E.split(`${d}*`).join(`${d}{0,${m}}`).split(`${d}+`).join(`${d}{1,${m}}`);
    return E;
  }, Q = (E, d, m) => {
    const y = l(d), f = a++;
    o(E, f, d), r[E] = f, I[f] = d, g[f] = new RegExp(d, m ? "g" : void 0), s[f] = new RegExp(y, m ? "g" : void 0);
  };
  Q("NUMERICIDENTIFIER", "0|[1-9]\\d*"), Q("NUMERICIDENTIFIERLOOSE", "\\d+"), Q("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${C}*`), Q("MAINVERSION", `(${I[r.NUMERICIDENTIFIER]})\\.(${I[r.NUMERICIDENTIFIER]})\\.(${I[r.NUMERICIDENTIFIER]})`), Q("MAINVERSIONLOOSE", `(${I[r.NUMERICIDENTIFIERLOOSE]})\\.(${I[r.NUMERICIDENTIFIERLOOSE]})\\.(${I[r.NUMERICIDENTIFIERLOOSE]})`), Q("PRERELEASEIDENTIFIER", `(?:${I[r.NUMERICIDENTIFIER]}|${I[r.NONNUMERICIDENTIFIER]})`), Q("PRERELEASEIDENTIFIERLOOSE", `(?:${I[r.NUMERICIDENTIFIERLOOSE]}|${I[r.NONNUMERICIDENTIFIER]})`), Q("PRERELEASE", `(?:-(${I[r.PRERELEASEIDENTIFIER]}(?:\\.${I[r.PRERELEASEIDENTIFIER]})*))`), Q("PRERELEASELOOSE", `(?:-?(${I[r.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${I[r.PRERELEASEIDENTIFIERLOOSE]})*))`), Q("BUILDIDENTIFIER", `${C}+`), Q("BUILD", `(?:\\+(${I[r.BUILDIDENTIFIER]}(?:\\.${I[r.BUILDIDENTIFIER]})*))`), Q("FULLPLAIN", `v?${I[r.MAINVERSION]}${I[r.PRERELEASE]}?${I[r.BUILD]}?`), Q("FULL", `^${I[r.FULLPLAIN]}$`), Q("LOOSEPLAIN", `[v=\\s]*${I[r.MAINVERSIONLOOSE]}${I[r.PRERELEASELOOSE]}?${I[r.BUILD]}?`), Q("LOOSE", `^${I[r.LOOSEPLAIN]}$`), Q("GTLT", "((?:<|>)?=?)"), Q("XRANGEIDENTIFIERLOOSE", `${I[r.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), Q("XRANGEIDENTIFIER", `${I[r.NUMERICIDENTIFIER]}|x|X|\\*`), Q("XRANGEPLAIN", `[v=\\s]*(${I[r.XRANGEIDENTIFIER]})(?:\\.(${I[r.XRANGEIDENTIFIER]})(?:\\.(${I[r.XRANGEIDENTIFIER]})(?:${I[r.PRERELEASE]})?${I[r.BUILD]}?)?)?`), Q("XRANGEPLAINLOOSE", `[v=\\s]*(${I[r.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[r.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[r.XRANGEIDENTIFIERLOOSE]})(?:${I[r.PRERELEASELOOSE]})?${I[r.BUILD]}?)?)?`), Q("XRANGE", `^${I[r.GTLT]}\\s*${I[r.XRANGEPLAIN]}$`), Q("XRANGELOOSE", `^${I[r.GTLT]}\\s*${I[r.XRANGEPLAINLOOSE]}$`), Q("COERCE", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?(?:$|[^\\d])`), Q("COERCERTL", I[r.COERCE], !0), Q("LONETILDE", "(?:~>?)"), Q("TILDETRIM", `(\\s*)${I[r.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", Q("TILDE", `^${I[r.LONETILDE]}${I[r.XRANGEPLAIN]}$`), Q("TILDELOOSE", `^${I[r.LONETILDE]}${I[r.XRANGEPLAINLOOSE]}$`), Q("LONECARET", "(?:\\^)"), Q("CARETTRIM", `(\\s*)${I[r.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", Q("CARET", `^${I[r.LONECARET]}${I[r.XRANGEPLAIN]}$`), Q("CARETLOOSE", `^${I[r.LONECARET]}${I[r.XRANGEPLAINLOOSE]}$`), Q("COMPARATORLOOSE", `^${I[r.GTLT]}\\s*(${I[r.LOOSEPLAIN]})$|^$`), Q("COMPARATOR", `^${I[r.GTLT]}\\s*(${I[r.FULLPLAIN]})$|^$`), Q("COMPARATORTRIM", `(\\s*)${I[r.GTLT]}\\s*(${I[r.LOOSEPLAIN]}|${I[r.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", Q("HYPHENRANGE", `^\\s*(${I[r.XRANGEPLAIN]})\\s+-\\s+(${I[r.XRANGEPLAIN]})\\s*$`), Q("HYPHENRANGELOOSE", `^\\s*(${I[r.XRANGEPLAINLOOSE]})\\s+-\\s+(${I[r.XRANGEPLAINLOOSE]})\\s*$`), Q("STAR", "(<|>)?=?\\s*\\*"), Q("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), Q("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
})(NP, NP.exports);
var EgA = NP.exports;
const YmA = /^[0-9]+$/, gVA = (A, e) => {
  const t = YmA.test(A), i = YmA.test(e);
  return t && i && (A = +A, e = +e), A === e ? 0 : t && !i ? -1 : i && !t ? 1 : A < e ? -1 : 1;
}, n8e = (A, e) => gVA(e, A);
var o8e = {
  compareIdentifiers: gVA,
  rcompareIdentifiers: n8e
};
const Dx = OV, {
  MAX_LENGTH: RmA,
  MAX_SAFE_INTEGER: Gx
} = QgA, {
  safeRe: FmA,
  t: MmA
} = EgA, g8e = cgA, {
  compareIdentifiers: by
} = o8e;
let s8e = class iB {
  constructor(e, t) {
    if (t = g8e(t), e instanceof iB) {
      if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
        return e;
      e = e.version;
    } else if (typeof e != "string")
      throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
    if (e.length > RmA)
      throw new TypeError(`version is longer than ${RmA} characters`);
    Dx("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
    const i = e.trim().match(t.loose ? FmA[MmA.LOOSE] : FmA[MmA.FULL]);
    if (!i)
      throw new TypeError(`Invalid Version: ${e}`);
    if (this.raw = e, this.major = +i[1], this.minor = +i[2], this.patch = +i[3], this.major > Gx || this.major < 0)
      throw new TypeError("Invalid major version");
    if (this.minor > Gx || this.minor < 0)
      throw new TypeError("Invalid minor version");
    if (this.patch > Gx || this.patch < 0)
      throw new TypeError("Invalid patch version");
    i[4] ? this.prerelease = i[4].split(".").map((n) => {
      if (/^[0-9]+$/.test(n)) {
        const o = +n;
        if (o >= 0 && o < Gx)
          return o;
      }
      return n;
    }) : this.prerelease = [], this.build = i[5] ? i[5].split(".") : [], this.format();
  }
  format() {
    return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
  }
  toString() {
    return this.version;
  }
  compare(e) {
    if (Dx("SemVer.compare", this.version, this.options, e), !(e instanceof iB)) {
      if (typeof e == "string" && e === this.version)
        return 0;
      e = new iB(e, this.options);
    }
    return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
  }
  compareMain(e) {
    return e instanceof iB || (e = new iB(e, this.options)), by(this.major, e.major) || by(this.minor, e.minor) || by(this.patch, e.patch);
  }
  comparePre(e) {
    if (e instanceof iB || (e = new iB(e, this.options)), this.prerelease.length && !e.prerelease.length)
      return -1;
    if (!this.prerelease.length && e.prerelease.length)
      return 1;
    if (!this.prerelease.length && !e.prerelease.length)
      return 0;
    let t = 0;
    do {
      const i = this.prerelease[t], n = e.prerelease[t];
      if (Dx("prerelease compare", t, i, n), i === void 0 && n === void 0)
        return 0;
      if (n === void 0)
        return 1;
      if (i === void 0)
        return -1;
      if (i !== n)
        return by(i, n);
    } while (++t);
  }
  compareBuild(e) {
    e instanceof iB || (e = new iB(e, this.options));
    let t = 0;
    do {
      const i = this.build[t], n = e.build[t];
      if (Dx("prerelease compare", t, i, n), i === void 0 && n === void 0)
        return 0;
      if (n === void 0)
        return 1;
      if (i === void 0)
        return -1;
      if (i !== n)
        return by(i, n);
    } while (++t);
  }
  // preminor will bump the version up to the next minor release, and immediately
  // down to pre-release. premajor and prepatch work the same way.
  inc(e, t, i) {
    switch (e) {
      case "premajor":
        this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, i);
        break;
      case "preminor":
        this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t, i);
        break;
      case "prepatch":
        this.prerelease.length = 0, this.inc("patch", t, i), this.inc("pre", t, i);
        break;
      case "prerelease":
        this.prerelease.length === 0 && this.inc("patch", t, i), this.inc("pre", t, i);
        break;
      case "major":
        (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
        break;
      case "minor":
        (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
        break;
      case "patch":
        this.prerelease.length === 0 && this.patch++, this.prerelease = [];
        break;
      case "pre": {
        const n = Number(i) ? 1 : 0;
        if (!t && i === !1)
          throw new Error("invalid increment argument: identifier is empty");
        if (this.prerelease.length === 0)
          this.prerelease = [n];
        else {
          let o = this.prerelease.length;
          for (; --o >= 0; )
            typeof this.prerelease[o] == "number" && (this.prerelease[o]++, o = -2);
          if (o === -1) {
            if (t === this.prerelease.join(".") && i === !1)
              throw new Error("invalid increment argument: identifier already exists");
            this.prerelease.push(n);
          }
        }
        if (t) {
          let o = [t, n];
          i === !1 && (o = [t]), by(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = o) : this.prerelease = o;
        }
        break;
      }
      default:
        throw new Error(`invalid increment argument: ${e}`);
    }
    return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
  }
};
var ugA = s8e;
const xmA = ugA, I8e = (A, e, t) => new xmA(A, t).compare(new xmA(e, t));
var CG = I8e;
const a8e = CG, r8e = (A, e, t) => a8e(A, e, t) === 0;
var C8e = r8e;
const B8e = CG, l8e = (A, e, t) => B8e(A, e, t) !== 0;
var c8e = l8e;
const Q8e = CG, E8e = (A, e, t) => Q8e(A, e, t) > 0;
var u8e = E8e;
const d8e = CG, h8e = (A, e, t) => d8e(A, e, t) >= 0;
var m8e = h8e;
const p8e = CG, y8e = (A, e, t) => p8e(A, e, t) < 0;
var b8e = y8e;
const w8e = CG, f8e = (A, e, t) => w8e(A, e, t) <= 0;
var D8e = f8e;
const G8e = C8e, k8e = c8e, J8e = u8e, N8e = m8e, Y8e = b8e, R8e = D8e, F8e = (A, e, t, i) => {
  switch (e) {
    case "===":
      return typeof A == "object" && (A = A.version), typeof t == "object" && (t = t.version), A === t;
    case "!==":
      return typeof A == "object" && (A = A.version), typeof t == "object" && (t = t.version), A !== t;
    case "":
    case "=":
    case "==":
      return G8e(A, t, i);
    case "!=":
      return k8e(A, t, i);
    case ">":
      return J8e(A, t, i);
    case ">=":
      return N8e(A, t, i);
    case "<":
      return Y8e(A, t, i);
    case "<=":
      return R8e(A, t, i);
    default:
      throw new TypeError(`Invalid operator: ${e}`);
  }
};
var M8e = F8e, mT, LmA;
function x8e() {
  if (LmA)
    return mT;
  LmA = 1;
  const A = Symbol("SemVer ANY");
  class e {
    static get ANY() {
      return A;
    }
    constructor(a, C) {
      if (C = t(C), a instanceof e) {
        if (a.loose === !!C.loose)
          return a;
        a = a.value;
      }
      a = a.trim().split(/\s+/).join(" "), g("comparator", a, C), this.options = C, this.loose = !!C.loose, this.parse(a), this.semver === A ? this.value = "" : this.value = this.operator + this.semver.version, g("comp", this);
    }
    parse(a) {
      const C = this.options.loose ? i[n.COMPARATORLOOSE] : i[n.COMPARATOR], B = a.match(C);
      if (!B)
        throw new TypeError(`Invalid comparator: ${a}`);
      this.operator = B[1] !== void 0 ? B[1] : "", this.operator === "=" && (this.operator = ""), B[2] ? this.semver = new s(B[2], this.options.loose) : this.semver = A;
    }
    toString() {
      return this.value;
    }
    test(a) {
      if (g("Comparator.test", a, this.options.loose), this.semver === A || a === A)
        return !0;
      if (typeof a == "string")
        try {
          a = new s(a, this.options);
        } catch {
          return !1;
        }
      return o(a, this.operator, this.semver, this.options);
    }
    intersects(a, C) {
      if (!(a instanceof e))
        throw new TypeError("a Comparator is required");
      return this.operator === "" ? this.value === "" ? !0 : new I(a.value, C).test(this.value) : a.operator === "" ? a.value === "" ? !0 : new I(this.value, C).test(a.semver) : (C = t(C), C.includePrerelease && (this.value === "<0.0.0-0" || a.value === "<0.0.0-0") || !C.includePrerelease && (this.value.startsWith("<0.0.0") || a.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && a.operator.startsWith(">") || this.operator.startsWith("<") && a.operator.startsWith("<") || this.semver.version === a.semver.version && this.operator.includes("=") && a.operator.includes("=") || o(this.semver, "<", a.semver, C) && this.operator.startsWith(">") && a.operator.startsWith("<") || o(this.semver, ">", a.semver, C) && this.operator.startsWith("<") && a.operator.startsWith(">")));
    }
  }
  mT = e;
  const t = cgA, {
    safeRe: i,
    t: n
  } = EgA, o = M8e, g = OV, s = ugA, I = sVA();
  return mT;
}
var pT, vmA;
function sVA() {
  if (vmA)
    return pT;
  vmA = 1;
  class A {
    constructor(K, U) {
      if (U = i(U), K instanceof A)
        return K.loose === !!U.loose && K.includePrerelease === !!U.includePrerelease ? K : new A(K.raw, U);
      if (K instanceof n)
        return this.raw = K.value, this.set = [[K]], this.format(), this;
      if (this.options = U, this.loose = !!U.loose, this.includePrerelease = !!U.includePrerelease, this.raw = K.trim().split(/\s+/).join(" "), this.set = this.raw.split("||").map((j) => this.parseRange(j.trim())).filter((j) => j.length), !this.set.length)
        throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
      if (this.set.length > 1) {
        const j = this.set[0];
        if (this.set = this.set.filter((q) => !Q(q[0])), this.set.length === 0)
          this.set = [j];
        else if (this.set.length > 1) {
          for (const q of this.set)
            if (q.length === 1 && E(q[0])) {
              this.set = [q];
              break;
            }
        }
      }
      this.format();
    }
    format() {
      return this.range = this.set.map((K) => K.join(" ").trim()).join("||").trim(), this.range;
    }
    toString() {
      return this.range;
    }
    parseRange(K) {
      const U = ((this.options.includePrerelease && B) | (this.options.loose && l)) + ":" + K, j = t.get(U);
      if (j)
        return j;
      const q = this.options.loose, O = q ? s[I.HYPHENRANGELOOSE] : s[I.HYPHENRANGE];
      K = K.replace(O, p(this.options.includePrerelease)), o("hyphen replace", K), K = K.replace(s[I.COMPARATORTRIM], r), o("comparator trim", K), K = K.replace(s[I.TILDETRIM], a), o("tilde trim", K), K = K.replace(s[I.CARETTRIM], C), o("caret trim", K);
      let $ = K.split(" ").map((AA) => m(AA, this.options)).join(" ").split(/\s+/).map((AA) => J(AA, this.options));
      q && ($ = $.filter((AA) => (o("loose invalid filter", AA, this.options), !!AA.match(s[I.COMPARATORLOOSE])))), o("range list", $);
      const _ = /* @__PURE__ */ new Map(), tA = $.map((AA) => new n(AA, this.options));
      for (const AA of tA) {
        if (Q(AA))
          return [AA];
        _.set(AA.value, AA);
      }
      _.size > 1 && _.has("") && _.delete("");
      const nA = [..._.values()];
      return t.set(U, nA), nA;
    }
    intersects(K, U) {
      if (!(K instanceof A))
        throw new TypeError("a Range is required");
      return this.set.some((j) => d(j, U) && K.set.some((q) => d(q, U) && j.every((O) => q.every(($) => O.intersects($, U)))));
    }
    // if ANY of the sets match ALL of its comparators, then pass
    test(K) {
      if (!K)
        return !1;
      if (typeof K == "string")
        try {
          K = new g(K, this.options);
        } catch {
          return !1;
        }
      for (let U = 0; U < this.set.length; U++)
        if (N(this.set[U], K, this.options))
          return !0;
      return !1;
    }
  }
  pT = A;
  const e = _6e, t = new e({
    max: 1e3
  }), i = cgA, n = x8e(), o = OV, g = ugA, {
    safeRe: s,
    t: I,
    comparatorTrimReplace: r,
    tildeTrimReplace: a,
    caretTrimReplace: C
  } = EgA, {
    FLAG_INCLUDE_PRERELEASE: B,
    FLAG_LOOSE: l
  } = QgA, Q = (v) => v.value === "<0.0.0-0", E = (v) => v.value === "", d = (v, K) => {
    let U = !0;
    const j = v.slice();
    let q = j.pop();
    for (; U && j.length; )
      U = j.every((O) => q.intersects(O, K)), q = j.pop();
    return U;
  }, m = (v, K) => (o("comp", v, K), v = G(v, K), o("caret", v), v = f(v, K), o("tildes", v), v = F(v, K), o("xrange", v), v = c(v, K), o("stars", v), v), y = (v) => !v || v.toLowerCase() === "x" || v === "*", f = (v, K) => v.trim().split(/\s+/).map((U) => w(U, K)).join(" "), w = (v, K) => {
    const U = K.loose ? s[I.TILDELOOSE] : s[I.TILDE];
    return v.replace(U, (j, q, O, $, _) => {
      o("tilde", v, j, q, O, $, _);
      let tA;
      return y(q) ? tA = "" : y(O) ? tA = `>=${q}.0.0 <${+q + 1}.0.0-0` : y($) ? tA = `>=${q}.${O}.0 <${q}.${+O + 1}.0-0` : _ ? (o("replaceTilde pr", _), tA = `>=${q}.${O}.${$}-${_} <${q}.${+O + 1}.0-0`) : tA = `>=${q}.${O}.${$} <${q}.${+O + 1}.0-0`, o("tilde return", tA), tA;
    });
  }, G = (v, K) => v.trim().split(/\s+/).map((U) => R(U, K)).join(" "), R = (v, K) => {
    o("caret", v, K);
    const U = K.loose ? s[I.CARETLOOSE] : s[I.CARET], j = K.includePrerelease ? "-0" : "";
    return v.replace(U, (q, O, $, _, tA) => {
      o("caret", v, q, O, $, _, tA);
      let nA;
      return y(O) ? nA = "" : y($) ? nA = `>=${O}.0.0${j} <${+O + 1}.0.0-0` : y(_) ? O === "0" ? nA = `>=${O}.${$}.0${j} <${O}.${+$ + 1}.0-0` : nA = `>=${O}.${$}.0${j} <${+O + 1}.0.0-0` : tA ? (o("replaceCaret pr", tA), O === "0" ? $ === "0" ? nA = `>=${O}.${$}.${_}-${tA} <${O}.${$}.${+_ + 1}-0` : nA = `>=${O}.${$}.${_}-${tA} <${O}.${+$ + 1}.0-0` : nA = `>=${O}.${$}.${_}-${tA} <${+O + 1}.0.0-0`) : (o("no pr"), O === "0" ? $ === "0" ? nA = `>=${O}.${$}.${_}${j} <${O}.${$}.${+_ + 1}-0` : nA = `>=${O}.${$}.${_}${j} <${O}.${+$ + 1}.0-0` : nA = `>=${O}.${$}.${_} <${+O + 1}.0.0-0`), o("caret return", nA), nA;
    });
  }, F = (v, K) => (o("replaceXRanges", v, K), v.split(/\s+/).map((U) => Z(U, K)).join(" ")), Z = (v, K) => {
    v = v.trim();
    const U = K.loose ? s[I.XRANGELOOSE] : s[I.XRANGE];
    return v.replace(U, (j, q, O, $, _, tA) => {
      o("xRange", v, j, q, O, $, _, tA);
      const nA = y(O), AA = nA || y($), gA = AA || y(_), rA = gA;
      return q === "=" && rA && (q = ""), tA = K.includePrerelease ? "-0" : "", nA ? q === ">" || q === "<" ? j = "<0.0.0-0" : j = "*" : q && rA ? (AA && ($ = 0), _ = 0, q === ">" ? (q = ">=", AA ? (O = +O + 1, $ = 0, _ = 0) : ($ = +$ + 1, _ = 0)) : q === "<=" && (q = "<", AA ? O = +O + 1 : $ = +$ + 1), q === "<" && (tA = "-0"), j = `${q + O}.${$}.${_}${tA}`) : AA ? j = `>=${O}.0.0${tA} <${+O + 1}.0.0-0` : gA && (j = `>=${O}.${$}.0${tA} <${O}.${+$ + 1}.0-0`), o("xRange return", j), j;
    });
  }, c = (v, K) => (o("replaceStars", v, K), v.trim().replace(s[I.STAR], "")), J = (v, K) => (o("replaceGTE0", v, K), v.trim().replace(s[K.includePrerelease ? I.GTE0PRE : I.GTE0], "")), p = (v) => (K, U, j, q, O, $, _, tA, nA, AA, gA, rA, sA) => (y(j) ? U = "" : y(q) ? U = `>=${j}.0.0${v ? "-0" : ""}` : y(O) ? U = `>=${j}.${q}.0${v ? "-0" : ""}` : $ ? U = `>=${U}` : U = `>=${U}${v ? "-0" : ""}`, y(nA) ? tA = "" : y(AA) ? tA = `<${+nA + 1}.0.0-0` : y(gA) ? tA = `<${nA}.${+AA + 1}.0-0` : rA ? tA = `<=${nA}.${AA}.${gA}-${rA}` : v ? tA = `<${nA}.${AA}.${+gA + 1}-0` : tA = `<=${tA}`, `${U} ${tA}`.trim()), N = (v, K, U) => {
    for (let j = 0; j < v.length; j++)
      if (!v[j].test(K))
        return !1;
    if (K.prerelease.length && !U.includePrerelease) {
      for (let j = 0; j < v.length; j++)
        if (o(v[j].semver), v[j].semver !== n.ANY && v[j].semver.prerelease.length > 0) {
          const q = v[j].semver;
          if (q.major === K.major && q.minor === K.minor && q.patch === K.patch)
            return !0;
        }
      return !1;
    }
    return !0;
  };
  return pT;
}
const L8e = sVA(), v8e = (A, e, t) => {
  try {
    e = new L8e(e, t);
  } catch {
    return !1;
  }
  return e.test(A);
};
var H8e = v8e, IVA = /* @__PURE__ */ S6e(H8e);
function S8e(A, e, t) {
  const i = A.open(e), n = 1e4, o = 250, {
    origin: g
  } = new URL(e);
  let s = ~~(n / o);
  function I(a) {
    a.source === i && (s = 0, A.removeEventListener("message", I, !1));
  }
  A.addEventListener("message", I, !1);
  function r() {
    s <= 0 || (i.postMessage(t, g), setTimeout(r, o), s -= 1);
  }
  setTimeout(r, o);
}
var Z8e = `.vega-embed {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
}
.vega-embed.has-actions {
  padding-right: 38px;
}
.vega-embed details:not([open]) > :not(summary) {
  display: none !important;
}
.vega-embed summary {
  list-style: none;
  position: absolute;
  top: 0;
  right: 0;
  padding: 6px;
  z-index: 1000;
  background: white;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  color: #1b1e23;
  border: 1px solid #aaa;
  border-radius: 999px;
  opacity: 0.2;
  transition: opacity 0.4s ease-in;
  cursor: pointer;
  line-height: 0px;
}
.vega-embed summary::-webkit-details-marker {
  display: none;
}
.vega-embed summary:active {
  box-shadow: #aaa 0px 0px 0px 1px inset;
}
.vega-embed summary svg {
  width: 14px;
  height: 14px;
}
.vega-embed details[open] summary {
  opacity: 0.7;
}
.vega-embed:hover summary, .vega-embed:focus-within summary {
  opacity: 1 !important;
  transition: opacity 0.2s ease;
}
.vega-embed .vega-actions {
  position: absolute;
  z-index: 1001;
  top: 35px;
  right: -9px;
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
  padding-top: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid #d9d9d9;
  background: white;
  animation-duration: 0.15s;
  animation-name: scale-in;
  animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
  text-align: left;
}
.vega-embed .vega-actions a {
  padding: 8px 16px;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: #434a56;
  text-decoration: none;
}
.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
  background-color: #f7f7f9;
  color: black;
}
.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
  content: "";
  display: inline-block;
  position: absolute;
}
.vega-embed .vega-actions::before {
  left: auto;
  right: 14px;
  top: -16px;
  border: 8px solid rgba(0, 0, 0, 0);
  border-bottom-color: #d9d9d9;
}
.vega-embed .vega-actions::after {
  left: auto;
  right: 15px;
  top: -14px;
  border: 7px solid rgba(0, 0, 0, 0);
  border-bottom-color: #fff;
}
.vega-embed .chart-wrapper.fit-x {
  width: 100%;
}
.vega-embed .chart-wrapper.fit-y {
  height: 100%;
}

.vega-embed-wrapper {
  max-width: 100%;
  overflow: auto;
  padding-right: 14px;
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
`;
function aVA(A, ...e) {
  for (const t of e)
    W8e(A, t);
  return A;
}
function W8e(A, e) {
  for (const t of Object.keys(e))
    zD(A, t, e[t], !0);
}
function HmA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function Ru(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? HmA(Object(t), !0).forEach(function(i) {
      H6e(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : HmA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
const sB = b9e;
let y2 = DPe;
const yT = typeof window < "u" ? window : void 0;
var SmA;
y2 === void 0 && (SmA = yT == null ? void 0 : yT.vl) != null && SmA.compile && (y2 = yT.vl);
const K8e = {
  export: {
    svg: !0,
    png: !0
  },
  source: !0,
  compiled: !0,
  editor: !0
}, U8e = {
  CLICK_TO_VIEW_ACTIONS: "Click to view actions",
  COMPILED_ACTION: "View Compiled Vega",
  EDITOR_ACTION: "Open in Vega Editor",
  PNG_ACTION: "Save as PNG",
  SOURCE_ACTION: "View Source",
  SVG_ACTION: "Save as SVG"
}, ZJ = {
  vega: "Vega",
  "vega-lite": "Vega-Lite"
}, WZ = {
  vega: sB.version,
  "vega-lite": y2 ? y2.version : "not available"
}, V8e = {
  vega: (A) => A,
  "vega-lite": (A, e) => y2.compile(A, {
    config: e
  }).spec
}, X8e = `
<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
  <circle r="2" cy="8" cx="2"></circle>
  <circle r="2" cy="8" cx="8"></circle>
  <circle r="2" cy="8" cx="14"></circle>
</svg>`, z8e = "chart-wrapper";
function T8e(A) {
  return typeof A == "function";
}
function ZmA(A, e, t, i) {
  const n = `<html><head>${e}</head><body><pre><code class="json">`, o = `</code></pre>${t}</body></html>`, g = window.open("");
  g.document.write(n + A + o), g.document.title = `${ZJ[i]} JSON Source`;
}
function _8e(A, e) {
  if (A.$schema) {
    const t = AVA(A.$schema);
    e && e !== t.library && console.warn(`The given visualization spec is written in ${ZJ[t.library]}, but mode argument sets ${ZJ[e] ?? e}.`);
    const i = t.library;
    return IVA(WZ[i], `^${t.version.slice(1)}`) || console.warn(`The input spec uses ${ZJ[i]} ${t.version}, but the current version of ${ZJ[i]} is v${WZ[i]}.`), i;
  }
  return "mark" in A || "encoding" in A || "layer" in A || "hconcat" in A || "vconcat" in A || "facet" in A || "repeat" in A ? "vega-lite" : "marks" in A || "signals" in A || "scales" in A || "axes" in A ? "vega" : e ?? "vega";
}
function q8e(A) {
  return !!(A && "load" in A);
}
function WmA(A) {
  return q8e(A) ? A : sB.loader(A);
}
function O8e(A) {
  var e;
  const t = ((e = A.usermeta) == null ? void 0 : e.embedOptions) ?? {};
  return Be(t.defaultStyle) && (t.defaultStyle = !1), t;
}
async function Tf(A, e, t = {}) {
  let i, n;
  Be(e) ? (n = WmA(t.loader), i = JSON.parse(await n.load(e))) : i = e;
  const o = O8e(i), g = o.loader;
  (!n || g) && (n = WmA(t.loader ?? g));
  const s = await KmA(o, n), I = await KmA(t, n), r = Ru(Ru({}, aVA(I, s)), {}, {
    config: XD(I.config ?? {}, s.config ?? {})
  });
  return await P8e(A, i, r, n);
}
async function KmA(A, e) {
  const t = Be(A.config) ? JSON.parse(await e.load(A.config)) : A.config ?? {}, i = Be(A.patch) ? JSON.parse(await e.load(A.patch)) : A.patch;
  return Ru(Ru(Ru({}, A), i ? {
    patch: i
  } : {}), t ? {
    config: t
  } : {});
}
function j8e(A) {
  const e = A.getRootNode ? A.getRootNode() : document;
  return e instanceof ShadowRoot ? {
    root: e,
    rootContainer: e
  } : {
    root: document,
    rootContainer: document.head ?? document.body
  };
}
async function P8e(A, e, t = {}, i) {
  const n = t.theme ? XD(G6e[t.theme], t.config ?? {}) : t.config, o = Wd(t.actions) ? t.actions : aVA({}, K8e, t.actions ?? {}), g = Ru(Ru({}, U8e), t.i18n), s = t.renderer ?? "canvas", I = t.logLevel ?? sB.Warn, r = t.downloadFileName ?? "visualization", a = typeof A == "string" ? document.querySelector(A) : A;
  if (!a)
    throw new Error(`${A} does not exist`);
  if (t.defaultStyle !== !1) {
    const G = "vega-embed-style", {
      root: R,
      rootContainer: F
    } = j8e(a);
    if (!R.getElementById(G)) {
      const Z = document.createElement("style");
      Z.id = G, Z.innerHTML = t.defaultStyle === void 0 || t.defaultStyle === !0 ? Z8e.toString() : t.defaultStyle, F.appendChild(Z);
    }
  }
  const C = _8e(e, t.mode);
  let B = V8e[C](e, n);
  if (C === "vega-lite" && B.$schema) {
    const G = AVA(B.$schema);
    IVA(WZ.vega, `^${G.version.slice(1)}`) || console.warn(`The compiled spec uses Vega ${G.version}, but current version is v${WZ.vega}.`);
  }
  a.classList.add("vega-embed"), o && a.classList.add("has-actions"), a.innerHTML = "";
  let l = a;
  if (o) {
    const G = document.createElement("div");
    G.classList.add(z8e), a.appendChild(G), l = G;
  }
  const Q = t.patch;
  if (Q && (B = Q instanceof Function ? Q(B) : AU(B, Q, !0, !1).newDocument), t.formatLocale && sB.formatLocale(t.formatLocale), t.timeFormatLocale && sB.timeFormatLocale(t.timeFormatLocale), t.expressionFunctions)
    for (const G in t.expressionFunctions) {
      const R = t.expressionFunctions[G];
      "fn" in R ? sB.expressionFunction(G, R.fn, R.visitor) : R instanceof Function && sB.expressionFunction(G, R);
    }
  const {
    ast: E
  } = t, d = sB.parse(B, C === "vega-lite" ? {} : n, {
    ast: E
  }), m = new (t.viewClass || sB.View)(d, Ru({
    loader: i,
    logLevel: I,
    renderer: s
  }, E ? {
    expr: sB.expressionInterpreter ?? t.expr ?? F9e
  } : {}));
  if (m.addSignalListener("autosize", (G, R) => {
    const {
      type: F
    } = R;
    F == "fit-x" ? (l.classList.add("fit-x"), l.classList.remove("fit-y")) : F == "fit-y" ? (l.classList.remove("fit-x"), l.classList.add("fit-y")) : F == "fit" ? l.classList.add("fit-x", "fit-y") : l.classList.remove("fit-x", "fit-y");
  }), t.tooltip !== !1) {
    const G = T8e(t.tooltip) ? t.tooltip : (
      // user provided boolean true or tooltip options
      new x6e(t.tooltip === !0 ? {} : t.tooltip).call
    );
    m.tooltip(G);
  }
  let {
    hover: y
  } = t;
  if (y === void 0 && (y = C === "vega"), y) {
    const {
      hoverSet: G,
      updateSet: R
    } = typeof y == "boolean" ? {} : y;
    m.hover(G, R);
  }
  t && (t.width != null && m.width(t.width), t.height != null && m.height(t.height), t.padding != null && m.padding(t.padding)), await m.initialize(l, t.bind).runAsync();
  let f;
  if (o !== !1) {
    let G = a;
    if (t.defaultStyle !== !1 || t.forceActionsMenu) {
      const F = document.createElement("details");
      F.title = g.CLICK_TO_VIEW_ACTIONS, a.append(F), G = F;
      const Z = document.createElement("summary");
      Z.innerHTML = X8e, F.append(Z), f = (c) => {
        F.contains(c.target) || F.removeAttribute("open");
      }, document.addEventListener("click", f);
    }
    const R = document.createElement("div");
    if (G.append(R), R.classList.add("vega-actions"), o === !0 || o.export !== !1) {
      for (const F of ["svg", "png"])
        if (o === !0 || o.export === !0 || o.export[F]) {
          const Z = g[`${F.toUpperCase()}_ACTION`], c = document.createElement("a"), J = ce(t.scaleFactor) ? t.scaleFactor[F] : t.scaleFactor;
          c.text = Z, c.href = "#", c.target = "_blank", c.download = `${r}.${F}`, c.addEventListener("mousedown", async function(p) {
            p.preventDefault();
            const N = await m.toImageURL(F, J);
            this.href = N;
          }), R.append(c);
        }
    }
    if (o === !0 || o.source !== !1) {
      const F = document.createElement("a");
      F.text = g.SOURCE_ACTION, F.href = "#", F.addEventListener("click", function(Z) {
        ZmA(Iz(e), t.sourceHeader ?? "", t.sourceFooter ?? "", C), Z.preventDefault();
      }), R.append(F);
    }
    if (C === "vega-lite" && (o === !0 || o.compiled !== !1)) {
      const F = document.createElement("a");
      F.text = g.COMPILED_ACTION, F.href = "#", F.addEventListener("click", function(Z) {
        ZmA(Iz(B), t.sourceHeader ?? "", t.sourceFooter ?? "", "vega"), Z.preventDefault();
      }), R.append(F);
    }
    if (o === !0 || o.editor !== !1) {
      const F = t.editorUrl ?? "https://vega.github.io/editor/", Z = document.createElement("a");
      Z.text = g.EDITOR_ACTION, Z.href = "#", Z.addEventListener("click", function(c) {
        S8e(window, F, {
          config: n,
          mode: C,
          renderer: s,
          spec: Iz(e)
        }), c.preventDefault();
      }), R.append(Z);
    }
  }
  function w() {
    f && document.removeEventListener("click", f), m.finalize();
  }
  return {
    view: m,
    spec: e,
    vgSpec: B,
    finalize: w,
    embedOptions: t
  };
}
var YP = function(A, e) {
  return YP = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
    t.__proto__ = i;
  } || function(t, i) {
    for (var n in i)
      Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
  }, YP(A, e);
};
function Pd(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
  YP(A, e);
  function t() {
    this.constructor = A;
  }
  A.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
}
function $8e(A, e, t, i) {
  function n(o) {
    return o instanceof t ? o : new t(function(g) {
      g(o);
    });
  }
  return new (t || (t = Promise))(function(o, g) {
    function s(a) {
      try {
        r(i.next(a));
      } catch (C) {
        g(C);
      }
    }
    function I(a) {
      try {
        r(i.throw(a));
      } catch (C) {
        g(C);
      }
    }
    function r(a) {
      a.done ? o(a.value) : n(a.value).then(s, I);
    }
    r((i = i.apply(A, e || [])).next());
  });
}
function rVA(A, e) {
  var t = { label: 0, sent: function() {
    if (o[0] & 1)
      throw o[1];
    return o[1];
  }, trys: [], ops: [] }, i, n, o, g;
  return g = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
    return this;
  }), g;
  function s(r) {
    return function(a) {
      return I([r, a]);
    };
  }
  function I(r) {
    if (i)
      throw new TypeError("Generator is already executing.");
    for (; g && (g = 0, r[0] && (t = 0)), t; )
      try {
        if (i = 1, n && (o = r[0] & 2 ? n.return : r[0] ? n.throw || ((o = n.return) && o.call(n), 0) : n.next) && !(o = o.call(n, r[1])).done)
          return o;
        switch (n = 0, o && (r = [r[0] & 2, o.value]), r[0]) {
          case 0:
          case 1:
            o = r;
            break;
          case 4:
            return t.label++, { value: r[1], done: !1 };
          case 5:
            t.label++, n = r[1], r = [0];
            continue;
          case 7:
            r = t.ops.pop(), t.trys.pop();
            continue;
          default:
            if (o = t.trys, !(o = o.length > 0 && o[o.length - 1]) && (r[0] === 6 || r[0] === 2)) {
              t = 0;
              continue;
            }
            if (r[0] === 3 && (!o || r[1] > o[0] && r[1] < o[3])) {
              t.label = r[1];
              break;
            }
            if (r[0] === 6 && t.label < o[1]) {
              t.label = o[1], o = r;
              break;
            }
            if (o && t.label < o[2]) {
              t.label = o[2], t.ops.push(r);
              break;
            }
            o[2] && t.ops.pop(), t.trys.pop();
            continue;
        }
        r = e.call(A, t);
      } catch (a) {
        r = [6, a], n = 0;
      } finally {
        i = o = 0;
      }
    if (r[0] & 5)
      throw r[1];
    return { value: r[0] ? r[1] : void 0, done: !0 };
  }
}
function _f(A) {
  var e = typeof Symbol == "function" && Symbol.iterator, t = e && A[e], i = 0;
  if (t)
    return t.call(A);
  if (A && typeof A.length == "number")
    return {
      next: function() {
        return A && i >= A.length && (A = void 0), { value: A && A[i++], done: !A };
      }
    };
  throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function Rp(A, e) {
  var t = typeof Symbol == "function" && A[Symbol.iterator];
  if (!t)
    return A;
  var i = t.call(A), n, o = [], g;
  try {
    for (; (e === void 0 || e-- > 0) && !(n = i.next()).done; )
      o.push(n.value);
  } catch (s) {
    g = { error: s };
  } finally {
    try {
      n && !n.done && (t = i.return) && t.call(i);
    } finally {
      if (g)
        throw g.error;
    }
  }
  return o;
}
function Fp(A, e, t) {
  if (t || arguments.length === 2)
    for (var i = 0, n = e.length, o; i < n; i++)
      (o || !(i in e)) && (o || (o = Array.prototype.slice.call(e, 0, i)), o[i] = e[i]);
  return A.concat(o || Array.prototype.slice.call(e));
}
function hw(A) {
  return this instanceof hw ? (this.v = A, this) : new hw(A);
}
function A$e(A, e, t) {
  if (!Symbol.asyncIterator)
    throw new TypeError("Symbol.asyncIterator is not defined.");
  var i = t.apply(A, e || []), n, o = [];
  return n = {}, g("next"), g("throw"), g("return"), n[Symbol.asyncIterator] = function() {
    return this;
  }, n;
  function g(B) {
    i[B] && (n[B] = function(l) {
      return new Promise(function(Q, E) {
        o.push([B, l, Q, E]) > 1 || s(B, l);
      });
    });
  }
  function s(B, l) {
    try {
      I(i[B](l));
    } catch (Q) {
      C(o[0][3], Q);
    }
  }
  function I(B) {
    B.value instanceof hw ? Promise.resolve(B.value.v).then(r, a) : C(o[0][2], B);
  }
  function r(B) {
    s("next", B);
  }
  function a(B) {
    s("throw", B);
  }
  function C(B, l) {
    B(l), o.shift(), o.length && s(o[0][0], o[0][1]);
  }
}
function e$e(A) {
  if (!Symbol.asyncIterator)
    throw new TypeError("Symbol.asyncIterator is not defined.");
  var e = A[Symbol.asyncIterator], t;
  return e ? e.call(A) : (A = typeof _f == "function" ? _f(A) : A[Symbol.iterator](), t = {}, i("next"), i("throw"), i("return"), t[Symbol.asyncIterator] = function() {
    return this;
  }, t);
  function i(o) {
    t[o] = A[o] && function(g) {
      return new Promise(function(s, I) {
        g = A[o](g), n(s, I, g.done, g.value);
      });
    };
  }
  function n(o, g, s, I) {
    Promise.resolve(I).then(function(r) {
      o({ value: r, done: s });
    }, g);
  }
}
function Ho(A) {
  return typeof A == "function";
}
function CVA(A) {
  var e = function(i) {
    Error.call(i), i.stack = new Error().stack;
  }, t = A(e);
  return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
}
var bT = CVA(function(A) {
  return function(e) {
    A(this), this.message = e ? e.length + ` errors occurred during unsubscription:
` + e.map(function(t, i) {
      return i + 1 + ") " + t.toString();
    }).join(`
  `) : "", this.name = "UnsubscriptionError", this.errors = e;
  };
});
function KZ(A, e) {
  if (A) {
    var t = A.indexOf(e);
    0 <= t && A.splice(t, 1);
  }
}
var qF = function() {
  function A(e) {
    this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
  }
  return A.prototype.unsubscribe = function() {
    var e, t, i, n, o;
    if (!this.closed) {
      this.closed = !0;
      var g = this._parentage;
      if (g)
        if (this._parentage = null, Array.isArray(g))
          try {
            for (var s = _f(g), I = s.next(); !I.done; I = s.next()) {
              var r = I.value;
              r.remove(this);
            }
          } catch (E) {
            e = { error: E };
          } finally {
            try {
              I && !I.done && (t = s.return) && t.call(s);
            } finally {
              if (e)
                throw e.error;
            }
          }
        else
          g.remove(this);
      var a = this.initialTeardown;
      if (Ho(a))
        try {
          a();
        } catch (E) {
          o = E instanceof bT ? E.errors : [E];
        }
      var C = this._finalizers;
      if (C) {
        this._finalizers = null;
        try {
          for (var B = _f(C), l = B.next(); !l.done; l = B.next()) {
            var Q = l.value;
            try {
              UmA(Q);
            } catch (E) {
              o = o ?? [], E instanceof bT ? o = Fp(Fp([], Rp(o)), Rp(E.errors)) : o.push(E);
            }
          }
        } catch (E) {
          i = { error: E };
        } finally {
          try {
            l && !l.done && (n = B.return) && n.call(B);
          } finally {
            if (i)
              throw i.error;
          }
        }
      }
      if (o)
        throw new bT(o);
    }
  }, A.prototype.add = function(e) {
    var t;
    if (e && e !== this)
      if (this.closed)
        UmA(e);
      else {
        if (e instanceof A) {
          if (e.closed || e._hasParent(this))
            return;
          e._addParent(this);
        }
        (this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(e);
      }
  }, A.prototype._hasParent = function(e) {
    var t = this._parentage;
    return t === e || Array.isArray(t) && t.includes(e);
  }, A.prototype._addParent = function(e) {
    var t = this._parentage;
    this._parentage = Array.isArray(t) ? (t.push(e), t) : t ? [t, e] : e;
  }, A.prototype._removeParent = function(e) {
    var t = this._parentage;
    t === e ? this._parentage = null : Array.isArray(t) && KZ(t, e);
  }, A.prototype.remove = function(e) {
    var t = this._finalizers;
    t && KZ(t, e), e instanceof A && e._removeParent(this);
  }, A.EMPTY = function() {
    var e = new A();
    return e.closed = !0, e;
  }(), A;
}(), BVA = qF.EMPTY;
function lVA(A) {
  return A instanceof qF || A && "closed" in A && Ho(A.remove) && Ho(A.add) && Ho(A.unsubscribe);
}
function UmA(A) {
  Ho(A) ? A() : A.unsubscribe();
}
var cVA = {
  onUnhandledError: null,
  onStoppedNotification: null,
  Promise: void 0,
  useDeprecatedSynchronousErrorHandling: !1,
  useDeprecatedNextContext: !1
}, t$e = {
  setTimeout: function(A, e) {
    for (var t = [], i = 2; i < arguments.length; i++)
      t[i - 2] = arguments[i];
    return setTimeout.apply(void 0, Fp([A, e], Rp(t)));
  },
  clearTimeout: function(A) {
    return clearTimeout(A);
  },
  delegate: void 0
};
function QVA(A) {
  t$e.setTimeout(function() {
    throw A;
  });
}
function RP() {
}
function Cv(A) {
  A();
}
var dgA = function(A) {
  Pd(e, A);
  function e(t) {
    var i = A.call(this) || this;
    return i.isStopped = !1, t ? (i.destination = t, lVA(t) && t.add(i)) : i.destination = g$e, i;
  }
  return e.create = function(t, i, n) {
    return new FP(t, i, n);
  }, e.prototype.next = function(t) {
    this.isStopped || this._next(t);
  }, e.prototype.error = function(t) {
    this.isStopped || (this.isStopped = !0, this._error(t));
  }, e.prototype.complete = function() {
    this.isStopped || (this.isStopped = !0, this._complete());
  }, e.prototype.unsubscribe = function() {
    this.closed || (this.isStopped = !0, A.prototype.unsubscribe.call(this), this.destination = null);
  }, e.prototype._next = function(t) {
    this.destination.next(t);
  }, e.prototype._error = function(t) {
    try {
      this.destination.error(t);
    } finally {
      this.unsubscribe();
    }
  }, e.prototype._complete = function() {
    try {
      this.destination.complete();
    } finally {
      this.unsubscribe();
    }
  }, e;
}(qF), i$e = Function.prototype.bind;
function wT(A, e) {
  return i$e.call(A, e);
}
var n$e = function() {
  function A(e) {
    this.partialObserver = e;
  }
  return A.prototype.next = function(e) {
    var t = this.partialObserver;
    if (t.next)
      try {
        t.next(e);
      } catch (i) {
        kx(i);
      }
  }, A.prototype.error = function(e) {
    var t = this.partialObserver;
    if (t.error)
      try {
        t.error(e);
      } catch (i) {
        kx(i);
      }
    else
      kx(e);
  }, A.prototype.complete = function() {
    var e = this.partialObserver;
    if (e.complete)
      try {
        e.complete();
      } catch (t) {
        kx(t);
      }
  }, A;
}(), FP = function(A) {
  Pd(e, A);
  function e(t, i, n) {
    var o = A.call(this) || this, g;
    if (Ho(t) || !t)
      g = {
        next: t ?? void 0,
        error: i ?? void 0,
        complete: n ?? void 0
      };
    else {
      var s;
      o && cVA.useDeprecatedNextContext ? (s = Object.create(t), s.unsubscribe = function() {
        return o.unsubscribe();
      }, g = {
        next: t.next && wT(t.next, s),
        error: t.error && wT(t.error, s),
        complete: t.complete && wT(t.complete, s)
      }) : g = t;
    }
    return o.destination = new n$e(g), o;
  }
  return e;
}(dgA);
function kx(A) {
  QVA(A);
}
function o$e(A) {
  throw A;
}
var g$e = {
  closed: !0,
  next: RP,
  error: o$e,
  complete: RP
}, hgA = function() {
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
}();
function EVA(A) {
  return A;
}
function s$e(A) {
  return A.length === 0 ? EVA : A.length === 1 ? A[0] : function(e) {
    return A.reduce(function(t, i) {
      return i(t);
    }, e);
  };
}
var pQ = function() {
  function A(e) {
    e && (this._subscribe = e);
  }
  return A.prototype.lift = function(e) {
    var t = new A();
    return t.source = this, t.operator = e, t;
  }, A.prototype.subscribe = function(e, t, i) {
    var n = this, o = a$e(e) ? e : new FP(e, t, i);
    return Cv(function() {
      var g = n, s = g.operator, I = g.source;
      o.add(s ? s.call(o, I) : I ? n._subscribe(o) : n._trySubscribe(o));
    }), o;
  }, A.prototype._trySubscribe = function(e) {
    try {
      return this._subscribe(e);
    } catch (t) {
      e.error(t);
    }
  }, A.prototype.forEach = function(e, t) {
    var i = this;
    return t = VmA(t), new t(function(n, o) {
      var g = new FP({
        next: function(s) {
          try {
            e(s);
          } catch (I) {
            o(I), g.unsubscribe();
          }
        },
        error: o,
        complete: n
      });
      i.subscribe(g);
    });
  }, A.prototype._subscribe = function(e) {
    var t;
    return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
  }, A.prototype[hgA] = function() {
    return this;
  }, A.prototype.pipe = function() {
    for (var e = [], t = 0; t < arguments.length; t++)
      e[t] = arguments[t];
    return s$e(e)(this);
  }, A.prototype.toPromise = function(e) {
    var t = this;
    return e = VmA(e), new e(function(i, n) {
      var o;
      t.subscribe(function(g) {
        return o = g;
      }, function(g) {
        return n(g);
      }, function() {
        return i(o);
      });
    });
  }, A.create = function(e) {
    return new A(e);
  }, A;
}();
function VmA(A) {
  var e;
  return (e = A ?? cVA.Promise) !== null && e !== void 0 ? e : Promise;
}
function I$e(A) {
  return A && Ho(A.next) && Ho(A.error) && Ho(A.complete);
}
function a$e(A) {
  return A && A instanceof dgA || I$e(A) && lVA(A);
}
function r$e(A) {
  return Ho(A == null ? void 0 : A.lift);
}
function mgA(A) {
  return function(e) {
    if (r$e(e))
      return e.lift(function(t) {
        try {
          return A(t, this);
        } catch (i) {
          this.error(i);
        }
      });
    throw new TypeError("Unable to lift unknown Observable type");
  };
}
function b2(A, e, t, i, n) {
  return new C$e(A, e, t, i, n);
}
var C$e = function(A) {
  Pd(e, A);
  function e(t, i, n, o, g, s) {
    var I = A.call(this, t) || this;
    return I.onFinalize = g, I.shouldUnsubscribe = s, I._next = i ? function(r) {
      try {
        i(r);
      } catch (a) {
        t.error(a);
      }
    } : A.prototype._next, I._error = o ? function(r) {
      try {
        o(r);
      } catch (a) {
        t.error(a);
      } finally {
        this.unsubscribe();
      }
    } : A.prototype._error, I._complete = n ? function() {
      try {
        n();
      } catch (r) {
        t.error(r);
      } finally {
        this.unsubscribe();
      }
    } : A.prototype._complete, I;
  }
  return e.prototype.unsubscribe = function() {
    var t;
    if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
      var i = this.closed;
      A.prototype.unsubscribe.call(this), !i && ((t = this.onFinalize) === null || t === void 0 || t.call(this));
    }
  }, e;
}(dgA), B$e = CVA(function(A) {
  return function() {
    A(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
  };
}), jV = function(A) {
  Pd(e, A);
  function e() {
    var t = A.call(this) || this;
    return t.closed = !1, t.currentObservers = null, t.observers = [], t.isStopped = !1, t.hasError = !1, t.thrownError = null, t;
  }
  return e.prototype.lift = function(t) {
    var i = new XmA(this, this);
    return i.operator = t, i;
  }, e.prototype._throwIfClosed = function() {
    if (this.closed)
      throw new B$e();
  }, e.prototype.next = function(t) {
    var i = this;
    Cv(function() {
      var n, o;
      if (i._throwIfClosed(), !i.isStopped) {
        i.currentObservers || (i.currentObservers = Array.from(i.observers));
        try {
          for (var g = _f(i.currentObservers), s = g.next(); !s.done; s = g.next()) {
            var I = s.value;
            I.next(t);
          }
        } catch (r) {
          n = { error: r };
        } finally {
          try {
            s && !s.done && (o = g.return) && o.call(g);
          } finally {
            if (n)
              throw n.error;
          }
        }
      }
    });
  }, e.prototype.error = function(t) {
    var i = this;
    Cv(function() {
      if (i._throwIfClosed(), !i.isStopped) {
        i.hasError = i.isStopped = !0, i.thrownError = t;
        for (var n = i.observers; n.length; )
          n.shift().error(t);
      }
    });
  }, e.prototype.complete = function() {
    var t = this;
    Cv(function() {
      if (t._throwIfClosed(), !t.isStopped) {
        t.isStopped = !0;
        for (var i = t.observers; i.length; )
          i.shift().complete();
      }
    });
  }, e.prototype.unsubscribe = function() {
    this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
  }, Object.defineProperty(e.prototype, "observed", {
    get: function() {
      var t;
      return ((t = this.observers) === null || t === void 0 ? void 0 : t.length) > 0;
    },
    enumerable: !1,
    configurable: !0
  }), e.prototype._trySubscribe = function(t) {
    return this._throwIfClosed(), A.prototype._trySubscribe.call(this, t);
  }, e.prototype._subscribe = function(t) {
    return this._throwIfClosed(), this._checkFinalizedStatuses(t), this._innerSubscribe(t);
  }, e.prototype._innerSubscribe = function(t) {
    var i = this, n = this, o = n.hasError, g = n.isStopped, s = n.observers;
    return o || g ? BVA : (this.currentObservers = null, s.push(t), new qF(function() {
      i.currentObservers = null, KZ(s, t);
    }));
  }, e.prototype._checkFinalizedStatuses = function(t) {
    var i = this, n = i.hasError, o = i.thrownError, g = i.isStopped;
    n ? t.error(o) : g && t.complete();
  }, e.prototype.asObservable = function() {
    var t = new pQ();
    return t.source = this, t;
  }, e.create = function(t, i) {
    return new XmA(t, i);
  }, e;
}(pQ), XmA = function(A) {
  Pd(e, A);
  function e(t, i) {
    var n = A.call(this) || this;
    return n.destination = t, n.source = i, n;
  }
  return e.prototype.next = function(t) {
    var i, n;
    (n = (i = this.destination) === null || i === void 0 ? void 0 : i.next) === null || n === void 0 || n.call(i, t);
  }, e.prototype.error = function(t) {
    var i, n;
    (n = (i = this.destination) === null || i === void 0 ? void 0 : i.error) === null || n === void 0 || n.call(i, t);
  }, e.prototype.complete = function() {
    var t, i;
    (i = (t = this.destination) === null || t === void 0 ? void 0 : t.complete) === null || i === void 0 || i.call(t);
  }, e.prototype._subscribe = function(t) {
    var i, n;
    return (n = (i = this.source) === null || i === void 0 ? void 0 : i.subscribe(t)) !== null && n !== void 0 ? n : BVA;
  }, e;
}(jV), l$e = {
  now: function() {
    return Date.now();
  },
  delegate: void 0
}, c$e = function(A) {
  Pd(e, A);
  function e(t, i) {
    return A.call(this) || this;
  }
  return e.prototype.schedule = function(t, i) {
    return this;
  }, e;
}(qF), MP = {
  setInterval: function(A, e) {
    for (var t = [], i = 2; i < arguments.length; i++)
      t[i - 2] = arguments[i];
    var n = MP.delegate;
    return n != null && n.setInterval ? n.setInterval.apply(n, Fp([A, e], Rp(t))) : setInterval.apply(void 0, Fp([A, e], Rp(t)));
  },
  clearInterval: function(A) {
    return clearInterval(A);
  },
  delegate: void 0
}, Q$e = function(A) {
  Pd(e, A);
  function e(t, i) {
    var n = A.call(this, t, i) || this;
    return n.scheduler = t, n.work = i, n.pending = !1, n;
  }
  return e.prototype.schedule = function(t, i) {
    var n;
    if (i === void 0 && (i = 0), this.closed)
      return this;
    this.state = t;
    var o = this.id, g = this.scheduler;
    return o != null && (this.id = this.recycleAsyncId(g, o, i)), this.pending = !0, this.delay = i, this.id = (n = this.id) !== null && n !== void 0 ? n : this.requestAsyncId(g, this.id, i), this;
  }, e.prototype.requestAsyncId = function(t, i, n) {
    return n === void 0 && (n = 0), MP.setInterval(t.flush.bind(t, this), n);
  }, e.prototype.recycleAsyncId = function(t, i, n) {
    if (n === void 0 && (n = 0), n != null && this.delay === n && this.pending === !1)
      return i;
    i != null && MP.clearInterval(i);
  }, e.prototype.execute = function(t, i) {
    if (this.closed)
      return new Error("executing a cancelled action");
    this.pending = !1;
    var n = this._execute(t, i);
    if (n)
      return n;
    this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
  }, e.prototype._execute = function(t, i) {
    var n = !1, o;
    try {
      this.work(t);
    } catch (g) {
      n = !0, o = g || new Error("Scheduled action threw falsy error");
    }
    if (n)
      return this.unsubscribe(), o;
  }, e.prototype.unsubscribe = function() {
    if (!this.closed) {
      var t = this, i = t.id, n = t.scheduler, o = n.actions;
      this.work = this.state = this.scheduler = null, this.pending = !1, KZ(o, this), i != null && (this.id = this.recycleAsyncId(n, i, null)), this.delay = null, A.prototype.unsubscribe.call(this);
    }
  }, e;
}(c$e), zmA = function() {
  function A(e, t) {
    t === void 0 && (t = A.now), this.schedulerActionCtor = e, this.now = t;
  }
  return A.prototype.schedule = function(e, t, i) {
    return t === void 0 && (t = 0), new this.schedulerActionCtor(this, e).schedule(i, t);
  }, A.now = l$e.now, A;
}(), E$e = function(A) {
  Pd(e, A);
  function e(t, i) {
    i === void 0 && (i = zmA.now);
    var n = A.call(this, t, i) || this;
    return n.actions = [], n._active = !1, n;
  }
  return e.prototype.flush = function(t) {
    var i = this.actions;
    if (this._active) {
      i.push(t);
      return;
    }
    var n;
    this._active = !0;
    do
      if (n = t.execute(t.state, t.delay))
        break;
    while (t = i.shift());
    if (this._active = !1, n) {
      for (; t = i.shift(); )
        t.unsubscribe();
      throw n;
    }
  }, e;
}(zmA), uVA = new E$e(Q$e), u$e = uVA;
function d$e(A) {
  return A && Ho(A.schedule);
}
function h$e(A) {
  return A[A.length - 1];
}
function m$e(A) {
  return Ho(h$e(A)) ? A.pop() : void 0;
}
var p$e = function(A) {
  return A && typeof A.length == "number" && typeof A != "function";
};
function y$e(A) {
  return Ho(A == null ? void 0 : A.then);
}
function b$e(A) {
  return Ho(A[hgA]);
}
function w$e(A) {
  return Symbol.asyncIterator && Ho(A == null ? void 0 : A[Symbol.asyncIterator]);
}
function f$e(A) {
  return new TypeError("You provided " + (A !== null && typeof A == "object" ? "an invalid object" : "'" + A + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
}
function D$e() {
  return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
}
var G$e = D$e();
function k$e(A) {
  return Ho(A == null ? void 0 : A[G$e]);
}
function J$e(A) {
  return A$e(this, arguments, function() {
    var e, t, i, n;
    return rVA(this, function(o) {
      switch (o.label) {
        case 0:
          e = A.getReader(), o.label = 1;
        case 1:
          o.trys.push([1, , 9, 10]), o.label = 2;
        case 2:
          return [4, hw(e.read())];
        case 3:
          return t = o.sent(), i = t.value, n = t.done, n ? [4, hw(void 0)] : [3, 5];
        case 4:
          return [2, o.sent()];
        case 5:
          return [4, hw(i)];
        case 6:
          return [4, o.sent()];
        case 7:
          return o.sent(), [3, 2];
        case 8:
          return [3, 10];
        case 9:
          return e.releaseLock(), [7];
        case 10:
          return [2];
      }
    });
  });
}
function N$e(A) {
  return Ho(A == null ? void 0 : A.getReader);
}
function dVA(A) {
  if (A instanceof pQ)
    return A;
  if (A != null) {
    if (b$e(A))
      return Y$e(A);
    if (p$e(A))
      return R$e(A);
    if (y$e(A))
      return F$e(A);
    if (w$e(A))
      return hVA(A);
    if (k$e(A))
      return M$e(A);
    if (N$e(A))
      return x$e(A);
  }
  throw f$e(A);
}
function Y$e(A) {
  return new pQ(function(e) {
    var t = A[hgA]();
    if (Ho(t.subscribe))
      return t.subscribe(e);
    throw new TypeError("Provided object does not correctly implement Symbol.observable");
  });
}
function R$e(A) {
  return new pQ(function(e) {
    for (var t = 0; t < A.length && !e.closed; t++)
      e.next(A[t]);
    e.complete();
  });
}
function F$e(A) {
  return new pQ(function(e) {
    A.then(function(t) {
      e.closed || (e.next(t), e.complete());
    }, function(t) {
      return e.error(t);
    }).then(null, QVA);
  });
}
function M$e(A) {
  return new pQ(function(e) {
    var t, i;
    try {
      for (var n = _f(A), o = n.next(); !o.done; o = n.next()) {
        var g = o.value;
        if (e.next(g), e.closed)
          return;
      }
    } catch (s) {
      t = { error: s };
    } finally {
      try {
        o && !o.done && (i = n.return) && i.call(n);
      } finally {
        if (t)
          throw t.error;
      }
    }
    e.complete();
  });
}
function hVA(A) {
  return new pQ(function(e) {
    L$e(A, e).catch(function(t) {
      return e.error(t);
    });
  });
}
function x$e(A) {
  return hVA(J$e(A));
}
function L$e(A, e) {
  var t, i, n, o;
  return $8e(this, void 0, void 0, function() {
    var g, s;
    return rVA(this, function(I) {
      switch (I.label) {
        case 0:
          I.trys.push([0, 5, 6, 11]), t = e$e(A), I.label = 1;
        case 1:
          return [4, t.next()];
        case 2:
          if (i = I.sent(), !!i.done)
            return [3, 4];
          if (g = i.value, e.next(g), e.closed)
            return [2];
          I.label = 3;
        case 3:
          return [3, 1];
        case 4:
          return [3, 11];
        case 5:
          return s = I.sent(), n = { error: s }, [3, 11];
        case 6:
          return I.trys.push([6, , 9, 10]), i && !i.done && (o = t.return) ? [4, o.call(t)] : [3, 8];
        case 7:
          I.sent(), I.label = 8;
        case 8:
          return [3, 10];
        case 9:
          if (n)
            throw n.error;
          return [7];
        case 10:
          return [7];
        case 11:
          return e.complete(), [2];
      }
    });
  });
}
function v$e(A) {
  return A instanceof Date && !isNaN(A);
}
function H$e(A, e, t) {
  A === void 0 && (A = 0), t === void 0 && (t = u$e);
  var i = -1;
  return e != null && (d$e(e) ? t = e : i = e), new pQ(function(n) {
    var o = v$e(A) ? +A - t.now() : A;
    o < 0 && (o = 0);
    var g = 0;
    return t.schedule(function() {
      n.closed || (n.next(g++), 0 <= i ? this.schedule(void 0, i) : n.complete());
    }, o);
  });
}
function S$e(A, e) {
  return mgA(function(t, i) {
    var n = 0;
    t.subscribe(b2(i, function(o) {
      return A.call(e, o, n++) && i.next(o);
    }));
  });
}
function Z$e(A, e) {
  return mgA(function(t, i) {
    var n = e ?? {}, o = n.leading, g = o === void 0 ? !0 : o, s = n.trailing, I = s === void 0 ? !1 : s, r = !1, a = null, C = null, B = !1, l = function() {
      C == null || C.unsubscribe(), C = null, I && (d(), B && i.complete());
    }, Q = function() {
      C = null, B && i.complete();
    }, E = function(m) {
      return C = dVA(A(m)).subscribe(b2(i, l, Q));
    }, d = function() {
      if (r) {
        r = !1;
        var m = a;
        a = null, i.next(m), !B && E(m);
      }
    };
    t.subscribe(b2(i, function(m) {
      r = !0, a = m, !(C && !C.closed) && (g ? d() : E(m));
    }, function() {
      B = !0, !(I && r && C && !C.closed) && i.complete();
    }));
  });
}
function W$e(A, e, t) {
  e === void 0 && (e = uVA);
  var i = H$e(A, e);
  return Z$e(function() {
    return i;
  }, t);
}
function K$e() {
  for (var A = [], e = 0; e < arguments.length; e++)
    A[e] = arguments[e];
  var t = m$e(A);
  return mgA(function(i, n) {
    for (var o = A.length, g = new Array(o), s = A.map(function() {
      return !1;
    }), I = !1, r = function(C) {
      dVA(A[C]).subscribe(b2(n, function(B) {
        g[C] = B, !I && !s[C] && (s[C] = !0, (I = s.every(EVA)) && (s = null));
      }, RP));
    }, a = 0; a < o; a++)
      r(a);
    i.subscribe(b2(n, function(C) {
      if (I) {
        var B = Fp([C], Rp(g));
        n.next(t ? t.apply(void 0, Fp([], Rp(B))) : B);
      }
    }));
  });
}
const U$e = (A, e, t, i, n) => {
  const o = {
    getSVGData() {
      return Promise.all(e.current.map((s) => s.view.toSVG()));
    },
    async getCanvasData() {
      return (await Promise.all(e.current.map((s) => s.view.toCanvas(2)))).map((s) => s.toDataURL("image/png", 1));
    },
    async downloadSVG(s = `gw chart ${Date.now() % 1e6}`.padStart(6, "0")) {
      const I = await Promise.all(e.current.map((a) => a.view.toSVG())), r = [];
      for (let a = 0; a < I.length; a += 1) {
        const C = I[a], B = new File([C], `${s}${I.length > 1 ? `_${a + 1}` : ""}.svg`), l = URL.createObjectURL(B), Q = document.createElement("a");
        Q.download = B.name, Q.href = l, Q.click(), requestAnimationFrame(() => {
          URL.revokeObjectURL(l);
        });
      }
      return r;
    },
    async downloadPNG(s = `gw chart ${Date.now() % 1e6}`.padStart(6, "0")) {
      const I = (await Promise.all(e.current.map((a) => a.view.toCanvas(2)))).map((a) => a.toDataURL("image/png", 1)), r = [];
      for (let a = 0; a < I.length; a += 1) {
        const C = I[a], B = document.createElement("a");
        B.download = `${s}${I.length > 1 ? `_${a + 1}` : ""}.png`, B.href = C.replace(/^data:image\/[^;]/, "data:application/octet-stream"), B.click();
      }
      return r;
    }
  };
  u.useImperativeHandle(t, () => o);
  const g = SD();
  u.useEffect(() => {
    const s = g.current;
    s && (Promise.all(i.current).then(() => {
      if (g.current) {
        const I = g.current;
        if (I.renderStatus !== "rendering")
          return;
        setTimeout(() => {
          I.renderStatus === "rendering" && I.updateRenderStatus("idle");
        }, 0);
      }
    }).catch(() => {
      if (g.current) {
        if (g.current.renderStatus !== "rendering")
          return;
        g.current.updateRenderStatus("error");
      }
    }), s.exportChart = async (I = "svg") => {
      if (s.renderStatus === "error")
        return console.error("exportChart failed because error occurred when rendering chart."), {
          mode: I,
          title: "",
          nCols: 0,
          nRows: 0,
          charts: [],
          chartType: "vega"
        };
      if (s.renderStatus !== "idle") {
        let a = null;
        const C = new Promise((B, l) => {
          a = s.onRenderStatusChange((Q) => {
            Q === "error" ? l(new Error("Error occurred when rendering chart")) : Q === "idle" && B();
          }), setTimeout(() => l(new Error("Timeout")), 1e4);
        });
        try {
          await C;
        } catch (B) {
          return console.error("exportChart failed:", `${B}`), {
            mode: I,
            title: "",
            nCols: 0,
            nRows: 0,
            charts: [],
            chartType: "vega"
          };
        } finally {
          a == null || a();
        }
      }
      const r = {
        mode: I,
        title: A || "untitled",
        nCols: e.current.map((a) => a.x).reduce((a, C) => Math.max(a, C), 0) + 1,
        nRows: e.current.map((a) => a.y).reduce((a, C) => Math.max(a, C), 0) + 1,
        charts: e.current.map((a) => ({
          rowIndex: a.y,
          colIndex: a.x,
          width: a.w,
          height: a.h,
          canvasWidth: a.innerWidth,
          canvasHeight: a.innerHeight,
          data: "",
          canvas() {
            return a.canvas;
          }
        })),
        container() {
          return n.current;
        },
        chartType: "vega"
      };
      if (I === "data-url") {
        const a = await o.getCanvasData();
        if (a)
          for (let C = 0; C < a.length; C += 1)
            r.charts[C].data = a[C];
      } else if (I === "svg") {
        const a = await o.getSVGData();
        if (a)
          for (let C = 0; C < a.length; C += 1)
            r.charts[C].data = a[C];
      }
      return r;
    }, s.exportChartList = async function* (I = "svg") {
      const r = s.chartCount, a = new Array(r).fill(0).map((B, l) => l), C = s.chartIndex;
      for await (const B of a) {
        s.openChart(B), await new Promise((Q) => setTimeout(Q, 0));
        const l = await s.exportChart(I);
        yield {
          mode: I,
          total: r,
          index: B,
          data: l,
          hasNext: B < r - 1
        };
      }
      s.openChart(C);
    });
  }), u.useEffect(() => () => {
    g.current && (g.current.updateRenderStatus("idle"), g.current.exportChart = async (s = "svg") => ({
      mode: s,
      title: "",
      nCols: 0,
      nRows: 0,
      charts: [],
      container() {
        return null;
      }
    }), g.current.exportChartList = async function* (s = "svg") {
      yield {
        mode: s,
        total: 1,
        completed: 0,
        index: 0,
        data: {
          mode: s,
          title: "",
          nCols: 0,
          nRows: 0,
          charts: [],
          container() {
            return null;
          }
        },
        hasNext: !1
      };
    });
  }, []);
};
function TmA(A) {
  switch (A) {
    case "zh-CN":
      return {
        dateTime: "%x %A %X",
        date: "%Y年%-m月%-d日",
        time: "%H:%M:%S",
        periods: ["上午", "下午"],
        days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
        shortDays: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
        months: [
          "一月",
          "二月",
          "三月",
          "四月",
          "五月",
          "六月",
          "七月",
          "八月",
          "九月",
          "十月",
          "十一月",
          "十二月"
        ],
        shortMonths: [
          "一月",
          "二月",
          "三月",
          "四月",
          "五月",
          "六月",
          "七月",
          "八月",
          "九月",
          "十月",
          "十一月",
          "十二月"
        ]
      };
    case "en-US":
    default:
      return {
        dateTime: "%x, %X",
        date: "%-m/%-d/%Y",
        time: "%-I:%M:%S %p",
        periods: ["AM", "PM"],
        days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
        shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
        months: [
          "January",
          "February",
          "March",
          "April",
          "May",
          "June",
          "July",
          "August",
          "September",
          "October",
          "November",
          "December"
        ],
        shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
      };
  }
}
/*!
 * canvas-size
 * v1.2.6
 * https://github.com/jhildenbiddle/canvas-size
 * (c) 2015-2023 John Hildenbiddle <http://hildenbiddle.com>
 * MIT license
 */
function V$e(A, e) {
  var t = A == null ? null : typeof Symbol < "u" && A[Symbol.iterator] || A["@@iterator"];
  if (t != null) {
    var i, n, o, g, s = [], I = !0, r = !1;
    try {
      if (o = (t = t.call(A)).next, e === 0) {
        if (Object(t) !== t)
          return;
        I = !1;
      } else
        for (; !(I = (i = o.call(t)).done) && (s.push(i.value), s.length !== e); I = !0)
          ;
    } catch (a) {
      r = !0, n = a;
    } finally {
      try {
        if (!I && t.return != null && (g = t.return(), Object(g) !== g))
          return;
      } finally {
        if (r)
          throw n;
      }
    }
    return s;
  }
}
function _mA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function mI(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? _mA(Object(t), !0).forEach(function(i) {
      X$e(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : _mA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function X$e(A, e, t) {
  return e = A7e(e), e in A ? Object.defineProperty(A, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : A[e] = t, A;
}
function z$e(A, e) {
  if (A == null)
    return {};
  var t = {}, i = Object.keys(A), n, o;
  for (o = 0; o < i.length; o++)
    n = i[o], !(e.indexOf(n) >= 0) && (t[n] = A[n]);
  return t;
}
function T$e(A, e) {
  if (A == null)
    return {};
  var t = z$e(A, e), i, n;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(A);
    for (n = 0; n < o.length; n++)
      i = o[n], !(e.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(A, i) && (t[i] = A[i]);
  }
  return t;
}
function qmA(A, e) {
  return q$e(A) || V$e(A, e) || mVA(A, e) || P$e();
}
function Jx(A) {
  return _$e(A) || O$e(A) || mVA(A) || j$e();
}
function _$e(A) {
  if (Array.isArray(A))
    return xP(A);
}
function q$e(A) {
  if (Array.isArray(A))
    return A;
}
function O$e(A) {
  if (typeof Symbol < "u" && A[Symbol.iterator] != null || A["@@iterator"] != null)
    return Array.from(A);
}
function mVA(A, e) {
  if (A) {
    if (typeof A == "string")
      return xP(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    if (t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set")
      return Array.from(A);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return xP(A, e);
  }
}
function xP(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}
function j$e() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function P$e() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function $$e(A, e) {
  if (typeof A != "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (typeof i != "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function A7e(A) {
  var e = $$e(A, "string");
  return typeof e == "symbol" ? e : String(e);
}
function xN(A) {
  var e = A.sizes.shift(), t = Math.max(Math.ceil(e[0]), 1), i = Math.max(Math.ceil(e[1]), 1), n = [t - 1, i - 1, 1, 1], o = Date.now(), g = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope, s, I;
  g ? (s = new OffscreenCanvas(1, 1), I = new OffscreenCanvas(t, i)) : (s = document.createElement("canvas"), s.width = 1, s.height = 1, I = document.createElement("canvas"), I.width = t, I.height = i);
  var r = s.getContext("2d"), a = I.getContext("2d");
  a && (a.fillRect.apply(a, n), r.drawImage(I, t - 1, i - 1, 1, 1, 0, 0, 1, 1));
  var C = r && r.getImageData(0, 0, 1, 1).data[3] !== 0, B = Date.now() - o;
  return [s, I].forEach(function(l) {
    l.height = 0, l.width = 0;
  }), g ? (postMessage({
    width: t,
    height: i,
    benchmark: B,
    isTestPass: C
  }), !C && A.sizes.length && xN(A)) : C ? A.onSuccess(t, i, B) : (A.onError(t, i, B), A.sizes.length && xN(A)), C;
}
var fT = {
  area: [16384, 14188, 11402, 11180, 10836, 8192, 4096, 1],
  height: [8388607, 65535, 32767, 16384, 8192, 4096, 1],
  width: [4194303, 65535, 32767, 16384, 8192, 4096, 1]
}, e7e = ["onError", "onSuccess"], Vb = {
  max: null,
  min: 1,
  sizes: [],
  step: 1024,
  usePromise: !1,
  useWorker: !1,
  onError: Function.prototype,
  onSuccess: Function.prototype
}, Zk = {};
function DT(A) {
  var e = A.width === A.height, t = A.height === 1, i = A.width === 1, n = [];
  if (!A.width || !A.height)
    A.sizes.forEach(function(a) {
      var C = e || t ? a : 1, B = e || i ? a : 1;
      n.push([C, B]);
    });
  else
    for (var o = A.min || Vb.min, g = A.step || Vb.step, s = Math.max(A.width, A.height); s >= o; ) {
      var I = e || t ? s : 1, r = e || i ? s : 1;
      n.push([I, r]), s -= g;
    }
  return n;
}
function Nx(A) {
  var e = window && "HTMLCanvasElement" in window, t = window && "OffscreenCanvas" in window, i = Date.now(), n = A.onError, o = A.onSuccess, g = T$e(A, e7e), s = null;
  if (!e)
    return !1;
  if (A.useWorker && t) {
    var I = `
            var canvasTest = `.concat(xN.toString(), `;
            onmessage = function(e) {
                canvasTest(e.data);
            };
        `), r = new Blob([I], {
      type: "application/javascript"
    }), a = URL.createObjectURL(r);
    s = new Worker(a), URL.revokeObjectURL(a), s.onmessage = function(C) {
      var B = C.data, l = B.width, Q = B.height, E = B.benchmark, d = B.isTestPass;
      d ? (Zk[i].onSuccess(l, Q, E), delete Zk[i]) : Zk[i].onError(l, Q, E);
    };
  }
  if (A.usePromise)
    return new Promise(function(C, B) {
      var l = mI(mI({}, A), {}, {
        onError: function(d, m, y) {
          var f;
          if (A.sizes.length === 0)
            f = !0;
          else {
            var w = A.sizes.slice(-1), G = qmA(w, 1), R = qmA(G[0], 2), F = R[0], Z = R[1];
            f = d === F && m === Z;
          }
          n(d, m, y), f && B({
            width: d,
            height: m,
            benchmark: y
          });
        },
        onSuccess: function(d, m, y) {
          o(d, m, y), C({
            width: d,
            height: m,
            benchmark: y
          });
        }
      });
      if (s) {
        var Q = l.onError, E = l.onSuccess;
        Zk[i] = {
          onError: Q,
          onSuccess: E
        }, s.postMessage(g);
      } else
        xN(l);
    });
  if (s)
    Zk[i] = {
      onError: n,
      onSuccess: o
    }, s.postMessage(g);
  else
    return xN(A);
}
var OmA = {
  maxArea: function() {
    var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = DT({
      width: A.max,
      height: A.max,
      min: A.min,
      step: A.step,
      sizes: Jx(fT.area)
    }), t = mI(mI(mI({}, Vb), A), {}, {
      sizes: e
    });
    return Nx(t);
  },
  maxHeight: function() {
    var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = DT({
      width: 1,
      height: A.max,
      min: A.min,
      step: A.step,
      sizes: Jx(fT.height)
    }), t = mI(mI(mI({}, Vb), A), {}, {
      sizes: e
    });
    return Nx(t);
  },
  maxWidth: function() {
    var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = DT({
      width: A.max,
      height: 1,
      min: A.min,
      step: A.step,
      sizes: Jx(fT.width)
    }), t = mI(mI(mI({}, Vb), A), {}, {
      sizes: e
    });
    return Nx(t);
  },
  test: function() {
    var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = mI(mI({}, Vb), A);
    return e.sizes = Jx(e.sizes), e.width && e.height && (e.sizes = [[e.width, e.height]]), Nx(e);
  }
};
const jmA = {
  canvasExceedSize: 500,
  computationError: 501,
  askVizError: 502
}, pVA = b.createContext({
  reportError: () => {
  }
}), pgA = () => b.useContext(pVA), ygA = pVA.Provider;
function t7e(A) {
  var e = typeof A;
  return A != null && (e == "object" || e == "function");
}
var XQ = t7e, i7e = typeof qE == "object" && qE && qE.Object === Object && qE, yVA = i7e, n7e = yVA, o7e = typeof self == "object" && self && self.Object === Object && self, g7e = n7e || o7e || Function("return this")(), LC = g7e, s7e = LC, I7e = function() {
  return s7e.Date.now();
}, a7e = I7e, r7e = /\s/;
function C7e(A) {
  for (var e = A.length; e-- && r7e.test(A.charAt(e)); )
    ;
  return e;
}
var B7e = C7e, l7e = B7e, c7e = /^\s+/;
function Q7e(A) {
  return A && A.slice(0, l7e(A) + 1).replace(c7e, "");
}
var E7e = Q7e, u7e = LC, d7e = u7e.Symbol, OF = d7e, PmA = OF, bVA = Object.prototype, h7e = bVA.hasOwnProperty, m7e = bVA.toString, Wk = PmA ? PmA.toStringTag : void 0;
function p7e(A) {
  var e = h7e.call(A, Wk), t = A[Wk];
  try {
    A[Wk] = void 0;
    var i = !0;
  } catch {
  }
  var n = m7e.call(A);
  return i && (e ? A[Wk] = t : delete A[Wk]), n;
}
var y7e = p7e, b7e = Object.prototype, w7e = b7e.toString;
function f7e(A) {
  return w7e.call(A);
}
var D7e = f7e, $mA = OF, G7e = y7e, k7e = D7e, J7e = "[object Null]", N7e = "[object Undefined]", ApA = $mA ? $mA.toStringTag : void 0;
function Y7e(A) {
  return A == null ? A === void 0 ? N7e : J7e : ApA && ApA in Object(A) ? G7e(A) : k7e(A);
}
var p0 = Y7e;
function R7e(A) {
  return A != null && typeof A == "object";
}
var zQ = R7e, F7e = p0, M7e = zQ, x7e = "[object Symbol]";
function L7e(A) {
  return typeof A == "symbol" || M7e(A) && F7e(A) == x7e;
}
var PV = L7e, v7e = E7e, epA = XQ, H7e = PV, tpA = 0 / 0, S7e = /^[-+]0x[0-9a-f]+$/i, Z7e = /^0b[01]+$/i, W7e = /^0o[0-7]+$/i, K7e = parseInt;
function U7e(A) {
  if (typeof A == "number")
    return A;
  if (H7e(A))
    return tpA;
  if (epA(A)) {
    var e = typeof A.valueOf == "function" ? A.valueOf() : A;
    A = epA(e) ? e + "" : e;
  }
  if (typeof A != "string")
    return A === 0 ? A : +A;
  A = v7e(A);
  var t = Z7e.test(A);
  return t || W7e.test(A) ? K7e(A.slice(2), t ? 2 : 8) : S7e.test(A) ? tpA : +A;
}
var V7e = U7e, X7e = XQ, GT = a7e, ipA = V7e, z7e = "Expected a function", T7e = Math.max, _7e = Math.min;
function q7e(A, e, t) {
  var i, n, o, g, s, I, r = 0, a = !1, C = !1, B = !0;
  if (typeof A != "function")
    throw new TypeError(z7e);
  e = ipA(e) || 0, X7e(t) && (a = !!t.leading, C = "maxWait" in t, o = C ? T7e(ipA(t.maxWait) || 0, e) : o, B = "trailing" in t ? !!t.trailing : B);
  function l(R) {
    var F = i, Z = n;
    return i = n = void 0, r = R, g = A.apply(Z, F), g;
  }
  function Q(R) {
    return r = R, s = setTimeout(m, e), a ? l(R) : g;
  }
  function E(R) {
    var F = R - I, Z = R - r, c = e - F;
    return C ? _7e(c, o - Z) : c;
  }
  function d(R) {
    var F = R - I, Z = R - r;
    return I === void 0 || F >= e || F < 0 || C && Z >= o;
  }
  function m() {
    var R = GT();
    if (d(R))
      return y(R);
    s = setTimeout(m, E(R));
  }
  function y(R) {
    return s = void 0, B && i ? l(R) : (i = n = void 0, g);
  }
  function f() {
    s !== void 0 && clearTimeout(s), r = 0, i = I = n = s = void 0;
  }
  function w() {
    return s === void 0 ? g : y(GT());
  }
  function G() {
    var R = GT(), F = d(R);
    if (i = arguments, n = this, I = R, F) {
      if (s === void 0)
        return Q(I);
      if (C)
        return clearTimeout(s), s = setTimeout(m, e), l(I);
    }
    return s === void 0 && (s = setTimeout(m, e)), g;
  }
  return G.cancel = f, G.flush = w, G;
}
var wVA = q7e;
const O7e = /* @__PURE__ */ Br(wVA);
var j7e = wVA, P7e = XQ, $7e = "Expected a function";
function AAt(A, e, t) {
  var i = !0, n = !0;
  if (typeof A != "function")
    throw new TypeError($7e);
  return P7e(t) && (i = "leading" in t ? !!t.leading : i, n = "trailing" in t ? !!t.trailing : n), j7e(A, e, {
    leading: i,
    maxWait: e,
    trailing: n
  });
}
var eAt = AAt;
const tAt = /* @__PURE__ */ Br(eAt);
var LP = function(A, e) {
  return LP = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
    t.__proto__ = i;
  } || function(t, i) {
    for (var n in i)
      Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
  }, LP(A, e);
};
function iAt(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
  LP(A, e);
  function t() {
    this.constructor = A;
  }
  A.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
}
var vP = function() {
  return vP = Object.assign || function(A) {
    for (var e, t = 1, i = arguments.length; t < i; t++) {
      e = arguments[t];
      for (var n in e)
        Object.prototype.hasOwnProperty.call(e, n) && (A[n] = e[n]);
    }
    return A;
  }, vP.apply(this, arguments);
};
function nAt(A, e) {
  var t = {};
  for (var i in A)
    Object.prototype.hasOwnProperty.call(A, i) && e.indexOf(i) < 0 && (t[i] = A[i]);
  if (A != null && typeof Object.getOwnPropertySymbols == "function")
    for (var n = 0, i = Object.getOwnPropertySymbols(A); n < i.length; n++)
      e.indexOf(i[n]) < 0 && Object.prototype.propertyIsEnumerable.call(A, i[n]) && (t[i[n]] = A[i[n]]);
  return t;
}
var fVA = function(A, e, t, i) {
  switch (e) {
    case "debounce":
      return O7e(A, t, i);
    case "throttle":
      return tAt(A, t, i);
    default:
      return A;
  }
}, npA = function(A) {
  return typeof A == "function";
}, Kk = function() {
  return typeof window > "u";
}, opA = function(A) {
  return A instanceof Element || A instanceof HTMLDocument;
};
(function(A) {
  iAt(e, A);
  function e(t) {
    var i = A.call(this, t) || this;
    i.cancelHandler = function() {
      i.resizeHandler && i.resizeHandler.cancel && (i.resizeHandler.cancel(), i.resizeHandler = null);
    }, i.attachObserver = function() {
      var r = i.props, a = r.targetRef, C = r.observerOptions;
      if (!Kk()) {
        a && a.current && (i.targetRef.current = a.current);
        var B = i.getElement();
        B && (i.observableElement && i.observableElement === B || (i.observableElement = B, i.resizeObserver.observe(B, C)));
      }
    }, i.getElement = function() {
      var r = i.props, a = r.querySelector, C = r.targetDomEl;
      if (Kk())
        return null;
      if (a)
        return document.querySelector(a);
      if (C && opA(C))
        return C;
      if (i.targetRef && opA(i.targetRef.current))
        return i.targetRef.current;
      var B = Jt.findDOMNode(i);
      if (!B)
        return null;
      var l = i.getRenderType();
      switch (l) {
        case "renderProp":
          return B;
        case "childFunction":
          return B;
        case "child":
          return B;
        case "childArray":
          return B;
        default:
          return B.parentElement;
      }
    }, i.createResizeHandler = function(r) {
      var a = i.props, C = a.handleWidth, B = C === void 0 ? !0 : C, l = a.handleHeight, Q = l === void 0 ? !0 : l, E = a.onResize;
      if (!(!B && !Q)) {
        var d = function(m) {
          var y = m.width, f = m.height;
          i.state.width === y && i.state.height === f || i.state.width === y && !Q || i.state.height === f && !B || (E == null || E(y, f), i.setState({ width: y, height: f }));
        };
        r.forEach(function(m) {
          var y = m && m.contentRect || {}, f = y.width, w = y.height, G = !i.skipOnMount && !Kk();
          G && d({ width: f, height: w }), i.skipOnMount = !1;
        });
      }
    }, i.getRenderType = function() {
      var r = i.props, a = r.render, C = r.children;
      return npA(a) ? "renderProp" : npA(C) ? "childFunction" : u.isValidElement(C) ? "child" : Array.isArray(C) ? "childArray" : "parent";
    };
    var n = t.skipOnMount, o = t.refreshMode, g = t.refreshRate, s = g === void 0 ? 1e3 : g, I = t.refreshOptions;
    return i.state = {
      width: void 0,
      height: void 0
    }, i.sizeRef = {
      current: i.state
    }, i.skipOnMount = n, i.targetRef = u.createRef(), i.observableElement = null, Kk() || (i.resizeHandler = fVA(i.createResizeHandler, o, s, I), i.resizeObserver = new window.ResizeObserver(i.resizeHandler)), i;
  }
  return e.prototype.componentDidMount = function() {
    this.attachObserver();
  }, e.prototype.componentDidUpdate = function() {
    this.attachObserver(), this.sizeRef.current = this.state;
  }, e.prototype.componentWillUnmount = function() {
    Kk() || (this.observableElement = null, this.resizeObserver.disconnect(), this.cancelHandler());
  }, e.prototype.render = function() {
    var t = this.props, i = t.render, n = t.children, o = t.nodeType, g = o === void 0 ? "div" : o, s = this.state, I = s.width, r = s.height, a = { width: I, height: r, targetRef: this.targetRef }, C = this.getRenderType();
    switch (C) {
      case "renderProp":
        return i == null ? void 0 : i(a);
      case "childFunction": {
        var B = n;
        return B == null ? void 0 : B(a);
      }
      case "child": {
        var l = n;
        if (l.type && typeof l.type == "string") {
          a.targetRef;
          var Q = nAt(a, ["targetRef"]);
          return u.cloneElement(l, Q);
        }
        return u.cloneElement(l, a);
      }
      case "childArray": {
        var E = n;
        return E.map(function(d) {
          return !!d && u.cloneElement(d, a);
        });
      }
      default:
        return b.createElement(g, null);
    }
  }, e;
})(u.PureComponent);
function DVA(A) {
  var e = A === void 0 ? {} : A, t = e.skipOnMount, i = t === void 0 ? !1 : t, n = e.refreshMode, o = e.refreshRate, g = o === void 0 ? 1e3 : o, s = e.refreshOptions, I = e.handleWidth, r = I === void 0 ? !0 : I, a = e.handleHeight, C = a === void 0 ? !0 : a, B = e.targetRef, l = e.observerOptions, Q = e.onResize, E = u.useRef(i), d = u.useState({
    width: void 0,
    height: void 0
  }), m = d[0], y = d[1], f = u.useState((B == null ? void 0 : B.current) || null), w = f[0], G = f[1];
  B && setTimeout(function() {
    B.current !== w && G(B.current);
  }, 0);
  var R = u.useCallback(function(J) {
    J !== w && G(J);
  }, [w]);
  R.current = w;
  var F = u.useCallback(function(J, p) {
    return !(J.width === p.width && J.height === p.height || J.width === p.width && !C || J.height === p.height && !r);
  }, [r, C]), Z = u.useCallback(function(J) {
    if (!(!r && !C)) {
      if (E.current) {
        E.current = !1;
        return;
      }
      J.forEach(function(p) {
        var N = (p == null ? void 0 : p.contentRect) || {}, v = N.width, K = N.height;
        y(function(U) {
          return F(U, { width: v, height: K }) ? { width: v, height: K } : U;
        });
      });
    }
  }, [r, C, E, F]), c = u.useCallback(fVA(Z, n, g, s), [
    Z,
    n,
    g,
    s
  ]);
  return u.useEffect(function() {
    var J;
    return w ? (J = new window.ResizeObserver(c), J.observe(w, l)) : (m.width || m.height) && y({ width: void 0, height: void 0 }), function() {
      var p, N, v;
      (p = J == null ? void 0 : J.disconnect) === null || p === void 0 || p.call(J), (v = (N = c).cancel) === null || v === void 0 || v.call(N);
    };
  }, [c, w]), u.useEffect(function() {
    Q == null || Q(m.width, m.height);
  }, [m]), vP({ ref: R }, m);
}
Wn("formatBin", (A, e) => {
  const t = e ? Ld(e) : (s) => s;
  if (!Array.isArray(A))
    return t(A);
  const [i, n] = A, o = n - i;
  if (o === 0)
    return `[${t(i)},${t(n)}]`;
  const g = Math.max(-Math.round(Math.log10(o)) + 2, 0);
  return `[${t(Number(i.toFixed(g)))},${t(Number(n.toFixed(g)))}]`;
});
const oAt = ji.div`
    display: grid;
    grid-template-columns: repeat(${(A) => A.colSize}, auto);
    grid-template-rows: repeat(${(A) => A.rowSize}, 1fr);
`;
function gpA(A) {
  if (A instanceof HTMLCanvasElement)
    return {
      width: parseInt(A.style.width || `${A.width}`),
      height: parseInt(A.style.height || `${A.height}`),
      renderWidth: A.width,
      renderHeight: A.height
    };
  if (A instanceof SVGSVGElement) {
    const e = A.width.baseVal.value, t = A.height.baseVal.value;
    return {
      width: e,
      height: t,
      renderWidth: 0,
      renderHeight: 0
    };
  }
}
const spA = "geom", HP = new jV(), SP = new jV(), gAt = SP.pipe(K$e(HP), S$e(([A, e]) => Object.keys(A).length > 0)), IpA = "__gw_brush__", apA = "__gw_point__", wy = (A) => Math.max(A, 1), sAt = u.forwardRef(function(A, e) {
  const {
    name: t,
    dataSource: i = [],
    rows: n = [],
    columns: o = [],
    defaultAggregate: g = !0,
    stack: s = "stack",
    geomType: I,
    color: r,
    opacity: a,
    size: C,
    theta: B,
    radius: l,
    shape: Q,
    text: E,
    onGeomClick: d,
    showActions: m,
    interactiveScale: y,
    layoutMode: f,
    width: w,
    height: G,
    details: R = [],
    // themeKey = 'vega',
    vegaConfig: F,
    // format
    locale: Z = "en-US",
    useSvg: c,
    scales: J,
    scale: p,
    displayOffset: N
  } = A, [v, K] = u.useState([]), U = u.useContext(FQ), j = u.useMemo(() => {
    const VA = J ?? {};
    return p != null && p.opacity && (VA.opacity = {
      ...VA.opacity ?? {},
      ...p.opacity
    }), p != null && p.size && (VA.size = {
      ...VA.size ?? {},
      ...p.size
    }), VA;
  }, [J, p]);
  u.useEffect(() => {
    const VA = gAt.subscribe(([le, we]) => {
      d && d(le, we);
    });
    return () => {
      VA.unsubscribe();
    };
  }, [d]);
  const q = u.useMemo(() => n.filter((VA) => g || VA.aggName !== "expr"), [n, g]), O = u.useMemo(() => o.filter((VA) => g || VA.aggName !== "expr"), [o, g]), $ = u.useMemo(() => q.filter((VA) => VA.analyticType === "dimension"), [q]), _ = u.useMemo(() => O.filter((VA) => VA.analyticType === "dimension"), [O]), tA = u.useMemo(() => q.filter((VA) => VA.analyticType === "measure"), [q]), nA = u.useMemo(() => O.filter((VA) => VA.analyticType === "measure"), [O]), AA = u.useMemo(() => tA.length === 0 ? $.slice(-1) : tA, [$, tA]), gA = u.useMemo(() => nA.length === 0 ? _.slice(-1) : nA, [_, nA]), { reportError: rA } = pgA(), [sA, lA] = u.useState(-1);
  u.useEffect(() => {
    lA(-1), K((VA) => {
      const le = Math.max(1, wy(AA.length) * wy(gA.length));
      return le === VA.length ? VA : new Array(le).fill(null).map((we, De) => VA[De] || b.createRef());
    });
  }, [AA, gA]);
  const cA = u.useRef([]), aA = u.useRef([]), { width: QA, height: hA, ref: EA } = DVA(), RA = f === "auto" ? 0 : QA || w, xA = f === "auto" ? 0 : hA || G, HA = u.useMemo(() => Sle({
    columns: O,
    dataSource: i,
    defaultAggregated: g,
    geomType: I,
    height: xA,
    interactiveScale: y,
    layoutMode: f,
    mediaTheme: U,
    rows: q,
    stack: s,
    width: RA,
    scales: j,
    color: r,
    details: R,
    opacity: a,
    radius: l,
    shape: Q,
    size: C,
    text: E,
    theta: B,
    vegaConfig: F,
    displayOffset: N
  }), [
    O,
    i,
    g,
    I,
    y,
    f,
    U,
    q,
    s,
    j,
    r,
    R,
    a,
    l,
    Q,
    C,
    E,
    B,
    N,
    RA,
    xA
  ]);
  u.useEffect(() => {
    var VA;
    if ((VA = A.onReportSpec) == null || VA.call(A, JSON.stringify(HA.map((le) => ({
      ...le,
      data: void 0
    })), void 0, 4)), cA.current = [], aA.current = [], AA.length <= 1 && gA.length <= 1) {
      if (v.length > 0 && v[0].current) {
        const le = Tf(v[0].current, HA[0], {
          renderer: c ? "svg" : "canvas",
          mode: "vega-lite",
          actions: m,
          timeFormatLocale: TmA(Z),
          config: F,
          tooltip: {
            theme: U
          }
        }).then((we) => {
          const De = we.view.container(), Ke = (De == null ? void 0 : De.querySelector("canvas")) ?? (De == null ? void 0 : De.querySelector("svg")) ?? null, ee = Ke ? gpA(Ke) : null;
          if (llA(() => {
            f !== "auto" || c || ee && OmA.test({ width: ee.renderWidth || 1, height: ee.renderHeight || 1 }) || rA(Ke ? "canvas exceed max size" : "canvas not found", jmA.canvasExceedSize);
          }), f !== "auto" && ee) {
            const re = {
              width: Math.max(ee.width - (QA || w), 0),
              height: Math.max(ee.height - (hA || G), 0)
            };
            if (we.view.width() === 0)
              try {
                we.view.signal("child_width", HA[0].width - re.width / Math.round((QA || w) / HA[0].width)), we.view.signal("child_height", HA[0].height - re.height / Math.round((hA || G) / HA[0].height));
              } catch {
              }
            else
              we.view.width(HA[0].width - re.width), we.view.height(HA[0].height - re.height);
            we.view.runAsync();
          }
          cA.current = [
            {
              w: (De == null ? void 0 : De.clientWidth) ?? we.view.width(),
              h: (De == null ? void 0 : De.clientHeight) ?? we.view.height(),
              innerWidth: (Ke == null ? void 0 : Ke.clientWidth) ?? we.view.width(),
              innerHeight: (Ke == null ? void 0 : Ke.clientHeight) ?? we.view.height(),
              x: 0,
              y: 0,
              view: we.view,
              canvas: Ke
            }
          ];
          try {
            we.view.addEventListener("click", (re) => {
              HP.next(re);
            }), we.view.addSignalListener(spA, (re, wA) => {
              SP.next(wA);
            });
          } catch (re) {
            console.warn(re);
          }
        });
        aA.current = [le];
      }
    } else {
      let le = 0;
      cA.current = new Array(AA.length * gA.length);
      const we = new jV(), De = we.pipe(W$e(i.length / 64 * AA.length * gA.length, void 0, { leading: !1, trailing: !0 })), Ke = [], ee = (re) => {
        Ke.push(De.subscribe(re));
      };
      for (let re = 0; re < wy(AA.length); re++)
        for (let wA = 0; wA < wy(gA.length); wA++, le++) {
          const WA = le, Pe = re * wy(gA.length) + wA < v.length ? v[re * wy(gA.length) + wA].current : null, je = HA[le];
          if (Pe) {
            const it = le, Li = Tf(Pe, je, {
              renderer: c ? "svg" : "canvas",
              mode: "vega-lite",
              actions: m,
              timeFormatLocale: TmA(Z),
              config: F,
              tooltip: {
                theme: U
              }
            }).then((zA) => {
              var Qe;
              const de = zA.view.container(), xe = (de == null ? void 0 : de.querySelector("canvas")) ?? (de == null ? void 0 : de.querySelector("svg")) ?? null, $e = xe ? gpA(xe) : null;
              if (llA(() => {
                f !== "auto" || c || $e && OmA.test({ width: $e.renderWidth || 1, height: $e.renderHeight || 1 }) || rA(xe ? "canvas exceed max size" : "canvas not found", jmA.canvasExceedSize);
              }), f !== "auto" && $e) {
                const Zt = {
                  width: Math.max($e.width - (QA || w) / gA.length, 0),
                  height: Math.max($e.height - (hA || G) / AA.length, 0)
                };
                zA.view.width() === 0 ? zA.view.signal("child_width") !== void 0 && (zA.view.signal("child_width", HA[0].width - Zt.width / Math.round((QA || w) / gA.length / HA[0].width)), zA.view.signal("child_height", HA[0].height - Zt.height / Math.round((hA || G) / AA.length / HA[0].height))) : (zA.view.width(HA[0].width - Zt.width), zA.view.height(HA[0].height - Zt.height)), zA.view.runAsync();
              }
              cA.current[it] = {
                w: (de == null ? void 0 : de.clientWidth) ?? zA.view.width(),
                h: (de == null ? void 0 : de.clientHeight) ?? zA.view.height(),
                innerWidth: (xe == null ? void 0 : xe.clientWidth) ?? zA.view.width(),
                innerHeight: (xe == null ? void 0 : xe.clientHeight) ?? zA.view.height(),
                x: wA,
                y: re,
                view: zA.view,
                canvas: xe
              };
              const Pn = (((Qe = zA.vgSpec.data) == null ? void 0 : Qe.map((Zt) => Zt.name)) ?? []).filter((Zt) => [IpA, apA].map((Kn) => `${Kn}_store`).includes(Zt)).map((Zt) => Zt.replace(/_store$/, ""));
              try {
                for (const Zt of Pn) {
                  let Kn = !1;
                  zA.view.addSignalListener(Zt, (po) => {
                    var go;
                    if (Kn) {
                      Kn = !1;
                      return;
                    }
                    if ([IpA, apA].includes(po)) {
                      const CI = (go = zA.view.getState().data) == null ? void 0 : go[`${po}_store`];
                      (!CI || Array.isArray(CI) && CI.length === 0) && lA(-1), we.next({
                        signal: po,
                        source: WA,
                        data: CI ?? null
                      });
                    }
                  }), ee((po) => {
                    po.source === WA || !po.data || (Kn = !0, zA.view.setState({
                      data: {
                        [`${po.signal}_store`]: po.data
                      }
                    }));
                  });
                }
              } catch (Zt) {
                console.warn("Crossing filter failed", Zt);
              }
              try {
                zA.view.addEventListener("mouseover", () => {
                  WA !== sA && lA(WA);
                }), zA.view.addEventListener("click", (Zt) => {
                  HP.next(Zt);
                }), zA.view.addSignalListener(spA, (Zt, Kn) => {
                  SP.next(Kn);
                });
              } catch (Zt) {
                console.warn(Zt);
              }
            });
            aA.current.push(Li);
          }
        }
      return () => {
        var re;
        Ke.forEach((wA) => wA.unsubscribe()), (re = A.onReportSpec) == null || re.call(A, "");
      };
    }
    return () => {
      var le;
      cA.current = [], aA.current = [], (le = A.onReportSpec) == null || le.call(A, "");
    };
  }, [HA, v, m, F, c, Z]);
  const ne = u.useRef(null);
  return U$e(t, cA, e, aA, ne), b.createElement(
    "div",
    { className: f === "auto" ? "w-fit h-fit relative" : "w-full h-full relative", style: { overflow: f === "auto" ? "visible" : "hidden" } },
    b.createElement("div", { ref: EA, className: "inset-0 absolute" }),
    b.createElement(oAt, { style: {
      ...f === "auto" ? {} : { width: "100%", height: "100%" }
    }, rowSize: Math.max(AA.length, 1), colSize: Math.max(gA.length, 1), ref: ne }, v.map((VA, le) => b.createElement("div", { key: le, ref: VA, className: f === "auto" ? "" : "overflow-hidden" })))
  );
}), IAt = sAt, aAt = u.forwardRef(function({ name: A, layout: e, data: t, draggableFieldState: i, visualConfig: n, onGeomClick: o, onChartResize: g, locale: s, onReportSpec: I, vizThemeConfig: r, scales: a, disableCollapse: C }, B) {
  const { geoms: l, defaultAggregated: Q, coordSystem: E, timezoneDisplayOffset: d } = n, { interactiveScale: m, stack: y, showActions: f, size: w, format: G, background: R, zeroScale: F, resolve: Z, useSvg: c, primaryColor: J, colorPalette: p, scale: N } = e, v = i.rows, K = i.columns, U = i.color, j = i.opacity, q = i.shape, O = i.theta, $ = i.radius, _ = i.size, tA = i.details, nA = i.text, AA = G, gA = l[0] === "table", rA = w.mode === "fixed" && !!g, sA = u.useContext(FQ), lA = u.useContext(_7), cA = FMA({
    vizThemeConfig: r,
    mediaTheme: sA,
    primaryColor: J,
    colorPalette: p
  }), aA = u.useMemo(() => {
    const hA = {
      ...cA,
      background: QRA(lA[sA].background),
      customFormatTypes: !0
    };
    return AA.normalizedNumberFormat && AA.normalizedNumberFormat.length > 0 && (hA.normalizedNumberFormat = AA.normalizedNumberFormat), AA.numberFormat && AA.numberFormat.length > 0 && (hA.numberFormat = AA.numberFormat), AA.timeFormat && AA.timeFormat.length > 0 && (hA.timeFormat = AA.timeFormat), hA.scale || (hA.scale = {}), hA.scale.zero = !!F, hA.resolve = Z, R && (hA.background = R), hA;
  }, [cA, sA, F, Z, R, AA.normalizedNumberFormat, AA.numberFormat, AA.timeFormat]);
  if (gA)
    return b.createElement(mDe, { data: t, draggableFieldState: i, visualConfig: n, layout: e, vizThemeConfig: r, disableCollapse: C });
  const QA = E === "geographic";
  return b.createElement(
    _fe,
    { className: rA ? "border-primary border-2 max-h-screen max-w-[100vw]" : "max-h-screen max-w-[100vw]", style: { padding: "12px" }, onResizeStop: (hA, EA, RA, xA) => {
      g == null || g(w.width + xA.width, w.height + xA.height);
    }, enable: rA ? void 0 : {
      top: !1,
      right: !1,
      bottom: !1,
      left: !1,
      topRight: !1,
      bottomRight: !1,
      bottomLeft: !1,
      topLeft: !1
    }, size: (
      // ensure PureRenderer with Auto size is correct
      w.mode === "fixed" ? {
        width: w.width + "px",
        height: w.height + "px"
      } : w.mode === "full" ? {
        width: "100%",
        height: "100%"
      } : QA ? {
        width: NO + "px",
        height: QS + "px"
      } : { width: "auto", height: "auto" }
    ) },
    QA && b.createElement(WMA, { name: A, data: t, draggableFieldState: i, visualConfig: n, visualLayout: e, vegaConfig: aA, scales: a, scale: N }),
    QA || b.createElement(IAt, {
      name: A,
      vegaConfig: aA,
      // format={format}
      layoutMode: w.mode,
      interactiveScale: m,
      geomType: l[0],
      defaultAggregate: Q,
      stack: y,
      dataSource: t,
      rows: v,
      columns: K,
      color: U[0],
      theta: O[0],
      radius: $[0],
      shape: q[0],
      opacity: j[0],
      size: _[0],
      details: tA,
      text: nA[0],
      showActions: f,
      width: w.width - 12 * 4,
      height: w.height - 12 * 4,
      ref: B,
      onGeomClick: o,
      locale: s,
      useSvg: c,
      scales: a,
      scale: N,
      onReportSpec: I,
      displayOffset: d
    })
  );
}), bgA = aAt, jF = (A) => {
  const { allFields: e, viewDimensions: t, viewMeasures: i, filters: n, defaultAggregated: o, sort: g, limit: s, computationFunction: I, folds: r, timezoneDisplayOffset: a } = A, [C, B] = u.useState(!1), l = u.useRef(0), Q = u.useMemo(() => Vu(n, e, t, i, o, g, r, s > 0 ? s : void 0, a), [n, e, t, i, o, g, r, s]), [E, d] = u.useState([]), [m, y] = u.useState([]), f = SD();
  u.useEffect(() => {
    var G;
    const R = ++l.current;
    (G = f.current) == null || G.updateRenderStatus("computing"), B(!0), AS(I, Q, s > 0 ? s : void 0).then((F) => Q2A(F, o, e, i, t, r)).then((F) => {
      var Z;
      R === l.current && ((Z = f.current) == null || Z.updateRenderStatus("rendering"), Jt.unstable_batchedUpdates(() => {
        B(!1), d(F), y(Q);
      }));
    }).catch((F) => {
      var Z;
      R === l.current && ((Z = f.current) == null || Z.updateRenderStatus("error"), console.error(F), Jt.unstable_batchedUpdates(() => {
        B(!1), d([]), y([]);
      }));
    });
  }, [I, Q]);
  const w = u.useMemo(() => ({
    workflow: m
  }), [m]);
  return u.useMemo(() => ({
    viewData: E,
    loading: C,
    parsed: w
  }), [E, C]);
}, rAt = (A) => {
  const e = SD();
  u.useEffect(() => {
    e.current && (e.current.chartCount = A.count, e.current.chartIndex = A.index, e.current.openChart = function(t) {
      t !== this.chartIndex && (Number.isInteger(t) && t >= 0 && t < this.chartCount ? A.onChange(t) : console.warn(`Invalid chart index: ${t}`));
    });
  }), u.useEffect(() => () => {
    e.current && (e.current.chartCount = 1, e.current.chartIndex = 0, e.current.openChart = () => {
    });
  }, []);
}, CAt = u.forwardRef(function(A, e) {
  const { computationFunction: t, vizThemeConfig: i, csvRef: n, overrideSize: o } = A, g = xt(), { allFields: s, viewFilters: I, viewDimensions: r, viewMeasures: a, config: C, layout: B, currentVis: l, visIndex: Q, visLength: E, sort: d, limit: m } = g, y = u.useMemo(() => ({
    ...B,
    ...o ? { size: o } : {}
  }), [B, o]), f = l.encodings, { i18n: w } = qe(), [G, R] = u.useState(Zq), [F, Z] = u.useState(y7), [c, J] = u.useState([]), { viewData: p, loading: N } = jF({
    allFields: s,
    viewDimensions: r,
    viewMeasures: a,
    filters: I,
    defaultAggregated: C.defaultAggregated,
    sort: d,
    limit: m,
    folds: C.folds,
    computationFunction: t,
    timezoneDisplayOffset: C.timezoneDisplayOffset
  });
  u.useEffect(() => {
    n && (n.current = {
      download() {
        const O = r.concat(a).map((_) => _.fid === Hn ? {
          name: "Count",
          fid: Hn
        } : G.defaultAggregated && _.analyticType === "measure" ? {
          fid: io(_.fid, _.aggName),
          name: op(_.name, _.aggName)
        } : { fid: _.fid, name: _.name }), $ = `${O.map((_) => _.name).join(",")}
${p.map((_) => O.map((tA) => _[tA.fid]).join(",")).join(`
`)}`;
        FBe($, `${l.name}.csv`, "text/plain");
      }
    });
  }, [l.name, n, p, r, a, G.defaultAggregated]);
  const v = u.useRef({
    data: p,
    draggableFieldState: f,
    visualConfig: C
  });
  v.current = {
    data: p,
    draggableFieldState: f,
    visualConfig: C
  }, u.useEffect(() => {
    N === !1 && Jt.unstable_batchedUpdates(() => {
      J(v.current.data), Z(v.current.draggableFieldState), R(v.current.visualConfig);
    });
  }, [N, p, g]), rAt({
    count: E,
    index: Q,
    onChange: (O) => g.selectVisualization(O)
  });
  const K = u.useCallback((O, $) => {
    if ($.stopPropagation(), We.EMBEDED_MENU_LIST.length > 0) {
      ONA(() => {
        g.showEmbededMenu([$.clientX, $.clientY]), g.setFilters(O);
      });
      const { vlPoint: _, ...tA } = O, nA = Object.fromEntries(Object.entries(tA).map(([rA, sA]) => [rA, sA instanceof Array ? sA[0] : void 0])), AA = LR(C.geoms[0]).flatMap((rA) => F[rA]), gA = Object.keys(nA).map((rA) => AA.find((sA) => sA.fid === rA)).filter((rA) => !!rA && rA.semanticType === "temporal");
      if (gA.length > 0) {
        const rA = C.timezoneDisplayOffset ?? (/* @__PURE__ */ new Date()).getTimezoneOffset();
        gA.forEach((sA) => {
          const lA = sA.offset ?? (/* @__PURE__ */ new Date()).getTimezoneOffset(), cA = new Set(c.map((aA) => aA[sA.fid]));
          nA[sA.fid] = Array.from(cA).find((aA) => {
            const QA = YY(aA);
            let hA = rA * -6e4;
            return QA !== "timestamp" && (hA += lA * 6e4, $YA.includes(QA) || (hA -= (/* @__PURE__ */ new Date()).getTimezoneOffset() * 6e4)), new Date(aA).getTime() + hA === nA[sA.fid];
          });
        });
      }
      if ($.item.mark.marktype === "line") {
        const rA = new Set(Object.keys($.item.mark.group.datum ?? {}));
        g.updateSelectedMarkObject(Object.fromEntries(Object.entries(nA).filter(([sA]) => rA.has(sA))));
      } else
        g.updateSelectedMarkObject(nA);
    }
  }, [g, c, F, C]), U = u.useCallback((O, $) => {
    g.setVisualLayout("size", {
      mode: "fixed",
      width: O,
      height: $
    });
  }, [g]), j = G.coordSystem === "geographic", q = u.useRef(y.size);
  return q.current = y.size, u.useEffect(() => {
    if (j) {
      const O = q.current;
      if (q.current.width < NO || q.current.height < QS)
        return g.setVisualLayout("size", {
          mode: q.current.mode,
          width: Math.max(O.width, NO),
          height: Math.max(O.height, QS)
        }), () => {
          g.setVisualLayout("size", O);
        };
    }
  }, [j, g]), b.createElement(
    "div",
    { className: "w-full h-full" },
    N && b.createElement(Ts, null),
    b.createElement(
      "div",
      { className: "overflow-auto w-full h-full" },
      b.createElement(bgA, { name: l == null ? void 0 : l.name, data: c, ref: e, vizThemeConfig: i, locale: w.language, draggableFieldState: F, visualConfig: G, onGeomClick: K, onChartResize: U, layout: y, scales: A.scales, onReportSpec: (O) => {
        g.updateLastSpec(O);
      } })
    )
  );
}), GVA = gt(CAt), kVA = "Dialog", [JVA, LXt] = gg(kVA), [BAt, Ll] = JVA(kVA), lAt = (A) => {
  const { __scopeDialog: e, children: t, open: i, defaultOpen: n, onOpenChange: o, modal: g = !0 } = A, s = u.useRef(null), I = u.useRef(null), [r = !1, a] = as({
    prop: i,
    defaultProp: n,
    onChange: o
  });
  return /* @__PURE__ */ u.createElement(BAt, {
    scope: e,
    triggerRef: s,
    contentRef: I,
    contentId: za(),
    titleId: za(),
    descriptionId: za(),
    open: r,
    onOpenChange: a,
    onOpenToggle: u.useCallback(
      () => a(
        (C) => !C
      ),
      [
        a
      ]
    ),
    modal: g
  }, t);
}, NVA = "DialogPortal", [cAt, YVA] = JVA(NVA, {
  forceMount: void 0
}), QAt = (A) => {
  const { __scopeDialog: e, forceMount: t, children: i, container: n } = A, o = Ll(NVA, e);
  return /* @__PURE__ */ u.createElement(cAt, {
    scope: e,
    forceMount: t
  }, u.Children.map(
    i,
    (g) => /* @__PURE__ */ u.createElement(Ig, {
      present: t || o.open
    }, /* @__PURE__ */ u.createElement(UR, {
      asChild: !0,
      container: n
    }, g))
  ));
}, ZP = "DialogOverlay", EAt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = YVA(ZP, A.__scopeDialog), { forceMount: i = t.forceMount, ...n } = A, o = Ll(ZP, A.__scopeDialog);
  return o.modal ? /* @__PURE__ */ u.createElement(Ig, {
    present: i || o.open
  }, /* @__PURE__ */ u.createElement(uAt, NA({}, n, {
    ref: e
  }))) : null;
}), uAt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, ...i } = A, n = Ll(ZP, t);
  return (
    // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
    // ie. when `Overlay` and `Content` are siblings
    /* @__PURE__ */ u.createElement(d3, {
      as: rQ,
      allowPinchZoom: !0,
      shards: [
        n.contentRef
      ]
    }, /* @__PURE__ */ u.createElement(ze.div, NA({
      "data-state": FVA(n.open)
    }, i, {
      ref: e,
      style: {
        pointerEvents: "auto",
        ...i.style
      }
    })))
  );
}), w2 = "DialogContent", dAt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = YVA(w2, A.__scopeDialog), { forceMount: i = t.forceMount, ...n } = A, o = Ll(w2, A.__scopeDialog);
  return /* @__PURE__ */ u.createElement(Ig, {
    present: i || o.open
  }, o.modal ? /* @__PURE__ */ u.createElement(hAt, NA({}, n, {
    ref: e
  })) : /* @__PURE__ */ u.createElement(mAt, NA({}, n, {
    ref: e
  })));
}), hAt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = Ll(w2, A.__scopeDialog), i = u.useRef(null), n = Dt(e, t.contentRef, i);
  return u.useEffect(() => {
    const o = i.current;
    if (o)
      return VR(o);
  }, []), /* @__PURE__ */ u.createElement(RVA, NA({}, A, {
    ref: n,
    trapFocus: t.open,
    disableOutsidePointerEvents: !0,
    onCloseAutoFocus: ge(A.onCloseAutoFocus, (o) => {
      var g;
      o.preventDefault(), (g = t.triggerRef.current) === null || g === void 0 || g.focus();
    }),
    onPointerDownOutside: ge(A.onPointerDownOutside, (o) => {
      const g = o.detail.originalEvent, s = g.button === 0 && g.ctrlKey === !0;
      (g.button === 2 || s) && o.preventDefault();
    }),
    onFocusOutside: ge(
      A.onFocusOutside,
      (o) => o.preventDefault()
    )
  }));
}), mAt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = Ll(w2, A.__scopeDialog), i = u.useRef(!1), n = u.useRef(!1);
  return /* @__PURE__ */ u.createElement(RVA, NA({}, A, {
    ref: e,
    trapFocus: !1,
    disableOutsidePointerEvents: !1,
    onCloseAutoFocus: (o) => {
      var g;
      if ((g = A.onCloseAutoFocus) === null || g === void 0 || g.call(A, o), !o.defaultPrevented) {
        var s;
        i.current || (s = t.triggerRef.current) === null || s === void 0 || s.focus(), o.preventDefault();
      }
      i.current = !1, n.current = !1;
    },
    onInteractOutside: (o) => {
      var g, s;
      (g = A.onInteractOutside) === null || g === void 0 || g.call(A, o), o.defaultPrevented || (i.current = !0, o.detail.originalEvent.type === "pointerdown" && (n.current = !0));
      const I = o.target;
      !((s = t.triggerRef.current) === null || s === void 0) && s.contains(I) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && n.current && o.preventDefault();
    }
  }));
}), RVA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, trapFocus: i, onOpenAutoFocus: n, onCloseAutoFocus: o, ...g } = A, s = Ll(w2, t), I = u.useRef(null), r = Dt(e, I);
  return l3(), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(c3, {
    asChild: !0,
    loop: !0,
    trapped: i,
    onMountAutoFocus: n,
    onUnmountAutoFocus: o
  }, /* @__PURE__ */ u.createElement(JD, NA({
    role: "dialog",
    id: s.contentId,
    "aria-describedby": s.descriptionId,
    "aria-labelledby": s.titleId,
    "data-state": FVA(s.open)
  }, g, {
    ref: r,
    onDismiss: () => s.onOpenChange(!1)
  }))), !1);
}), pAt = "DialogTitle", yAt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, ...i } = A, n = Ll(pAt, t);
  return /* @__PURE__ */ u.createElement(ze.h2, NA({
    id: n.titleId
  }, i, {
    ref: e
  }));
}), bAt = "DialogDescription", wAt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, ...i } = A, n = Ll(bAt, t);
  return /* @__PURE__ */ u.createElement(ze.p, NA({
    id: n.descriptionId
  }, i, {
    ref: e
  }));
}), fAt = "DialogClose", DAt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, ...i } = A, n = Ll(fAt, t);
  return /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button"
  }, i, {
    ref: e,
    onClick: ge(
      A.onClick,
      () => n.onOpenChange(!1)
    )
  }));
});
function FVA(A) {
  return A ? "open" : "closed";
}
const GAt = lAt, kAt = QAt, JAt = EAt, MVA = dAt, xVA = yAt, LVA = wAt, NAt = DAt, vVA = u.forwardRef(({ className: A, children: e, ...t }, i) => u.createElement("div", { ref: i, className: me("relative overflow-auto dark:[color-scheme:dark]", A), ...t }, e)), ig = GAt, YAt = kAt, HVA = u.forwardRef(({ className: A, ...e }, t) => u.createElement("div", { ref: t, className: me("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", A), ...e }));
HVA.displayName = JAt.displayName;
const So = u.forwardRef(({ className: A, children: e, ...t }, i) => u.createElement(
  YAt,
  { container: u.useContext(xD) },
  u.createElement(HVA, null),
  u.createElement(
    MVA,
    { ref: i, className: me("fixed left-[50%] top-[50%] z-50 grid w-[98%] sm:w-[80%] lg:w-[880px] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg overflow-hidden", A), ...t },
    u.createElement(vVA, { className: "overscroll-none max-h-[calc(min(800px,90vh))] w-full relative p-6" }, e),
    u.createElement(
      NAt,
      { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground" },
      u.createElement(Lde, { className: "h-4 w-4" }),
      u.createElement("span", { className: "sr-only" }, "Close")
    )
  )
));
So.displayName = MVA.displayName;
const PF = ({ className: A, ...e }) => u.createElement("div", { className: me("flex flex-col space-y-1.5 text-center sm:text-left", A), ...e });
PF.displayName = "DialogHeader";
const vl = ({ className: A, ...e }) => u.createElement("div", { className: me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", A), ...e });
vl.displayName = "DialogFooter";
const wgA = u.forwardRef(({ className: A, ...e }, t) => u.createElement(xVA, { ref: t, className: me("text-lg font-semibold leading-none tracking-tight", A), ...e }));
wgA.displayName = xVA.displayName;
const RAt = u.forwardRef(({ className: A, ...e }, t) => u.createElement(LVA, { ref: t, className: me("text-sm text-muted-foreground", A), ...e }));
RAt.displayName = LVA.displayName;
const FAt = gt(function() {
  const { t: A } = qe(), e = xt();
  return b.createElement(
    ig,
    { onOpenChange: () => e.closeRemoveConfirmModal(), open: e.removeConfirmIdx !== null },
    b.createElement(
      So,
      null,
      b.createElement(PF, null, A("main.tablist.remove_confirm")),
      b.createElement(
        vl,
        { className: "mt-4" },
        b.createElement(Re, { variant: "outline", onClick: () => {
          e.closeRemoveConfirmModal();
        } }, A("actions.cancel")),
        b.createElement(Re, { variant: "destructive", onClick: () => {
          e.removeVisualization(e.removeConfirmIdx), e.closeRemoveConfirmModal();
        } }, A("actions.confirm"))
      )
    )
  );
}), MAt = FAt;
function xAt(...A) {
  return A.filter(Boolean).join(" ");
}
const LAt = (A) => {
  const [e, t] = u.useState(0), i = u.useRef(), n = u.useRef(), o = u.useRef(), g = u.useCallback((r) => {
    var a, C, B;
    r.preventDefault(), r.stopPropagation();
    const l = (a = i.current) == null ? void 0 : a.getBoundingClientRect().width, Q = (B = (C = i.current) == null ? void 0 : C.children[0]) == null ? void 0 : B.getBoundingClientRect().width;
    return l && Q && t((E) => Math.min(Math.max(0, Q - l), Math.max(0, E + r.deltaY + r.deltaX))), !1;
  }, []), s = u.useCallback((r) => {
    var a;
    if ((a = n.current) == null || a.call(n), r == null)
      return;
    const C = new ResizeObserver((B) => {
      var l, Q;
      for (const E of B) {
        const d = E.contentRect.width, m = (Q = (l = i.current) == null ? void 0 : l.children[0]) == null ? void 0 : Q.getBoundingClientRect().width;
        d && m && t((y) => Math.min(Math.max(0, m - d), y));
      }
    });
    C.observe(r), i.current = r, r.addEventListener("wheel", g, { passive: !1 }), n.current = () => {
      var B;
      C.disconnect(), (B = i.current) == null || B.removeEventListener("wheel", g);
    };
  }, [g]), I = u.useCallback((r) => {
    var a;
    if ((a = o.current) == null || a.call(o), r === null)
      return;
    const C = new ResizeObserver((B) => {
      var l;
      for (const Q of B) {
        const E = (l = i.current) == null ? void 0 : l.getBoundingClientRect().width, d = Q.contentRect.width;
        E && d && t((m) => Math.min(Math.max(0, d - E), m));
      }
    });
    o.current = () => {
      C.disconnect();
    }, C.observe(r);
  }, []);
  return b.createElement(
    "div",
    { style: { overflowX: "clip" }, ref: s, onWheel: (r) => (r.preventDefault(), r.stopPropagation(), r.nativeEvent.preventDefault(), t((a) => Math.max(0, a + r.deltaY)), !1), className: A.className },
    b.createElement("div", { ref: I, style: { left: `-${e}px`, width: "min-content", position: "relative" } }, A.children)
  );
};
function vAt(A) {
  const { tabs: e, selectedKey: t, onSelected: i, onEditLabel: n, onRemove: o, onDuplicate: g, showRemove: s } = A, [I, r] = u.useState(-1), [a, C] = u.useState(""), { t: B } = qe();
  return b.createElement(
    "div",
    { className: "overflow-y-visible" },
    b.createElement(MAt, null),
    b.createElement(
      ig,
      { open: I > -1, onOpenChange: () => {
        r(-1);
      } },
      b.createElement(
        So,
        null,
        b.createElement(PF, null, B("main.tablist.chart_name")),
        b.createElement(
          "div",
          { className: "py-4" },
          b.createElement(on, { value: a, onChange: (l) => {
            C(l.target.value);
          } })
        ),
        b.createElement(
          vl,
          null,
          b.createElement(Re, { variant: "outline", onClick: () => {
            Jt.unstable_batchedUpdates(() => {
              r(-1), C("");
            });
          } }, B("actions.cancel")),
          b.createElement(Re, { onClick: () => {
            Jt.unstable_batchedUpdates(() => {
              n && n(a, I), r(-1), C("");
            });
          } }, B("actions.confirm"))
        )
      )
    ),
    b.createElement(
      LAt,
      null,
      b.createElement("nav", { className: "-mb-px flex h-8", role: "tablist", "aria-label": "Tabs" }, e.map((l, Q) => b.createElement(
        "span",
        {
          role: "tab",
          tabIndex: 0,
          // dangerouslySetInnerHTML={{
          //     __html: tab.label
          // }}
          onClick: () => {
            i(l.key, Q);
          },
          key: l.key,
          className: xAt(l.key === t ? "border" : "text-muted-foreground hover:text-accent-foreground hover:bg-accent", "flex whitespace-nowrap rounded-t group py-1 px-2 pr-2 text-sm cursor-default")
        },
        l.label,
        l.key === t && l.editable && b.createElement(
          rAA,
          null,
          b.createElement(
            CAA,
            null,
            b.createElement(fY, { className: "h-4 w-4", "aria-hidden": "true" })
          ),
          b.createElement(
            b3,
            { align: "start" },
            b.createElement(dN, { className: "text-xs", onClick: (E) => {
              E.stopPropagation(), Jt.unstable_batchedUpdates(() => {
                r(Q), C(l.label);
              });
            } }, "Edit"),
            b.createElement(dN, { className: "text-xs", onClick: (E) => {
              E.stopPropagation(), g == null || g(Q);
            } }, "Duplicate"),
            s && b.createElement(dN, { className: "text-xs text-destructive", onClick: (E) => {
              E.stopPropagation(), o == null || o(Q);
            } }, "Remove")
          )
        )
      )))
    )
  );
}
const rpA = "_add", HAt = (A) => {
  const e = xt(), { currentVis: t, visLength: i, vizList: n } = e, { t: o } = qe(), g = n.map((C) => ({
    key: C.visId,
    label: C.name ?? "vis",
    editable: !0
  }));
  g.push({
    key: rpA,
    label: o("main.tablist.new")
  });
  const s = u.useCallback((C, B) => {
    C === rpA ? e.addVisualization((l) => o("main.tablist.auto_title", { idx: l })) : e.selectVisualization(B);
  }, [e, i]), I = u.useCallback((C, B) => {
    e.setVisName(B, C);
  }, [e]), r = u.useCallback((C) => {
    e.openRemoveConfirmModal(C);
  }, [e]), a = u.useCallback((C) => {
    e.duplicateVisualization(C);
  }, [e]);
  return b.createElement(vAt, { selectedKey: t.visId, tabs: g, onEditLabel: I, onSelected: s, onDuplicate: a, onRemove: r, showRemove: i > 1 });
}, SAt = gt(HAt);
function ZAt(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function f2(A) {
  return f2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, f2(A);
}
function WAt(A, e) {
  if (f2(A) !== "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (f2(i) !== "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function KAt(A) {
  var e = WAt(A, "string");
  return f2(e) === "symbol" ? e : String(e);
}
function CpA(A, e) {
  for (var t = 0; t < e.length; t++) {
    var i = e[t];
    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(A, KAt(i.key), i);
  }
}
function UAt(A, e, t) {
  return e && CpA(A.prototype, e), t && CpA(A, t), Object.defineProperty(A, "prototype", {
    writable: !1
  }), A;
}
var SVA = [], VAt = SVA.forEach, XAt = SVA.slice;
function zAt(A) {
  return VAt.call(XAt.call(arguments, 1), function(e) {
    if (e)
      for (var t in e)
        A[t] === void 0 && (A[t] = e[t]);
  }), A;
}
var BpA = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, TAt = function(A, e, t) {
  var i = t || {};
  i.path = i.path || "/";
  var n = encodeURIComponent(e), o = "".concat(A, "=").concat(n);
  if (i.maxAge > 0) {
    var g = i.maxAge - 0;
    if (Number.isNaN(g))
      throw new Error("maxAge should be a Number");
    o += "; Max-Age=".concat(Math.floor(g));
  }
  if (i.domain) {
    if (!BpA.test(i.domain))
      throw new TypeError("option domain is invalid");
    o += "; Domain=".concat(i.domain);
  }
  if (i.path) {
    if (!BpA.test(i.path))
      throw new TypeError("option path is invalid");
    o += "; Path=".concat(i.path);
  }
  if (i.expires) {
    if (typeof i.expires.toUTCString != "function")
      throw new TypeError("option expires is invalid");
    o += "; Expires=".concat(i.expires.toUTCString());
  }
  if (i.httpOnly && (o += "; HttpOnly"), i.secure && (o += "; Secure"), i.sameSite) {
    var s = typeof i.sameSite == "string" ? i.sameSite.toLowerCase() : i.sameSite;
    switch (s) {
      case !0:
        o += "; SameSite=Strict";
        break;
      case "lax":
        o += "; SameSite=Lax";
        break;
      case "strict":
        o += "; SameSite=Strict";
        break;
      case "none":
        o += "; SameSite=None";
        break;
      default:
        throw new TypeError("option sameSite is invalid");
    }
  }
  return o;
}, lpA = {
  create: function(A, e, t, i) {
    var n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
      path: "/",
      sameSite: "strict"
    };
    t && (n.expires = /* @__PURE__ */ new Date(), n.expires.setTime(n.expires.getTime() + t * 60 * 1e3)), i && (n.domain = i), document.cookie = TAt(A, encodeURIComponent(e), n);
  },
  read: function(A) {
    for (var e = "".concat(A, "="), t = document.cookie.split(";"), i = 0; i < t.length; i++) {
      for (var n = t[i]; n.charAt(0) === " "; )
        n = n.substring(1, n.length);
      if (n.indexOf(e) === 0)
        return n.substring(e.length, n.length);
    }
    return null;
  },
  remove: function(A) {
    this.create(A, "", -1);
  }
}, _At = {
  name: "cookie",
  lookup: function(A) {
    var e;
    if (A.lookupCookie && typeof document < "u") {
      var t = lpA.read(A.lookupCookie);
      t && (e = t);
    }
    return e;
  },
  cacheUserLanguage: function(A, e) {
    e.lookupCookie && typeof document < "u" && lpA.create(e.lookupCookie, A, e.cookieMinutes, e.cookieDomain, e.cookieOptions);
  }
}, qAt = {
  name: "querystring",
  lookup: function(A) {
    var e;
    if (typeof window < "u") {
      var t = window.location.search;
      !window.location.search && window.location.hash && window.location.hash.indexOf("?") > -1 && (t = window.location.hash.substring(window.location.hash.indexOf("?")));
      for (var i = t.substring(1), n = i.split("&"), o = 0; o < n.length; o++) {
        var g = n[o].indexOf("=");
        if (g > 0) {
          var s = n[o].substring(0, g);
          s === A.lookupQuerystring && (e = n[o].substring(g + 1));
        }
      }
    }
    return e;
  }
}, Uk = null, cpA = function() {
  if (Uk !== null)
    return Uk;
  try {
    Uk = window !== "undefined" && window.localStorage !== null;
    var A = "i18next.translate.boo";
    window.localStorage.setItem(A, "foo"), window.localStorage.removeItem(A);
  } catch {
    Uk = !1;
  }
  return Uk;
}, OAt = {
  name: "localStorage",
  lookup: function(A) {
    var e;
    if (A.lookupLocalStorage && cpA()) {
      var t = window.localStorage.getItem(A.lookupLocalStorage);
      t && (e = t);
    }
    return e;
  },
  cacheUserLanguage: function(A, e) {
    e.lookupLocalStorage && cpA() && window.localStorage.setItem(e.lookupLocalStorage, A);
  }
}, Vk = null, QpA = function() {
  if (Vk !== null)
    return Vk;
  try {
    Vk = window !== "undefined" && window.sessionStorage !== null;
    var A = "i18next.translate.boo";
    window.sessionStorage.setItem(A, "foo"), window.sessionStorage.removeItem(A);
  } catch {
    Vk = !1;
  }
  return Vk;
}, jAt = {
  name: "sessionStorage",
  lookup: function(A) {
    var e;
    if (A.lookupSessionStorage && QpA()) {
      var t = window.sessionStorage.getItem(A.lookupSessionStorage);
      t && (e = t);
    }
    return e;
  },
  cacheUserLanguage: function(A, e) {
    e.lookupSessionStorage && QpA() && window.sessionStorage.setItem(e.lookupSessionStorage, A);
  }
}, PAt = {
  name: "navigator",
  lookup: function(A) {
    var e = [];
    if (typeof navigator < "u") {
      if (navigator.languages)
        for (var t = 0; t < navigator.languages.length; t++)
          e.push(navigator.languages[t]);
      navigator.userLanguage && e.push(navigator.userLanguage), navigator.language && e.push(navigator.language);
    }
    return e.length > 0 ? e : void 0;
  }
}, $At = {
  name: "htmlTag",
  lookup: function(A) {
    var e, t = A.htmlTag || (typeof document < "u" ? document.documentElement : null);
    return t && typeof t.getAttribute == "function" && (e = t.getAttribute("lang")), e;
  }
}, Aet = {
  name: "path",
  lookup: function(A) {
    var e;
    if (typeof window < "u") {
      var t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
      if (t instanceof Array)
        if (typeof A.lookupFromPathIndex == "number") {
          if (typeof t[A.lookupFromPathIndex] != "string")
            return;
          e = t[A.lookupFromPathIndex].replace("/", "");
        } else
          e = t[0].replace("/", "");
    }
    return e;
  }
}, eet = {
  name: "subdomain",
  lookup: function(A) {
    var e = typeof A.lookupFromSubdomainIndex == "number" ? A.lookupFromSubdomainIndex + 1 : 1, t = typeof window < "u" && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
    if (t)
      return t[e];
  }
};
function tet() {
  return {
    order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"],
    lookupQuerystring: "lng",
    lookupCookie: "i18next",
    lookupLocalStorage: "i18nextLng",
    lookupSessionStorage: "i18nextLng",
    // cache user language
    caches: ["localStorage"],
    excludeCacheFor: ["cimode"]
    // cookieMinutes: 10,
    // cookieDomain: 'myDomain'
  };
}
var ZVA = /* @__PURE__ */ function() {
  function A(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    ZAt(this, A), this.type = "languageDetector", this.detectors = {}, this.init(e, t);
  }
  return UAt(A, [{
    key: "init",
    value: function(e) {
      var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      this.services = e, this.options = zAt(t, this.options || {}, tet()), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = i, this.addDetector(_At), this.addDetector(qAt), this.addDetector(OAt), this.addDetector(jAt), this.addDetector(PAt), this.addDetector($At), this.addDetector(Aet), this.addDetector(eet);
    }
  }, {
    key: "addDetector",
    value: function(e) {
      this.detectors[e.name] = e;
    }
  }, {
    key: "detect",
    value: function(e) {
      var t = this;
      e || (e = this.options.order);
      var i = [];
      return e.forEach(function(n) {
        if (t.detectors[n]) {
          var o = t.detectors[n].lookup(t.options);
          o && typeof o == "string" && (o = [o]), o && (i = i.concat(o));
        }
      }), this.services.languageUtils.getBestMatchFromCodes ? i : i.length > 0 ? i[0] : null;
    }
  }, {
    key: "cacheUserLanguage",
    value: function(e, t) {
      var i = this;
      t || (t = this.options.caches), t && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1 || t.forEach(function(n) {
        i.detectors[n] && i.detectors[n].cacheUserLanguage(e, i.options);
      }));
    }
  }]), A;
}();
ZVA.type = "languageDetector";
const iet = {
  scheme: "Scheme",
  primary_color: "Primary Color",
  color_palette: "Color Palette",
  opacity: "Opacity",
  default_color_palette: "Default",
  size: "Size",
  min_domain: "Domain Min",
  max_domain: "Domain Max",
  range: "Range",
  format: "Format",
  numberFormat: "Number format",
  timeFormat: "Time format",
  normalizedNumberFormat: "Normalized number format",
  background: "Background",
  color: "Color",
  independence: "Independence",
  x: "x-Axis",
  y: "y-Axis",
  zeroScale: "Zero Scale",
  misc: "Misc",
  formatGuidesDocs: "Format guides docs",
  readHere: "read here",
  svg: "Use SVG",
  customTile: "Use a Custom Tile for map",
  customOffset: "Use a Specific timezone"
}, net = {
  row_count: "Row count",
  mea_key: "Measure names",
  mea_val: "Measure values",
  paint_key: "Paint Field",
  analytic_type: {
    dimension: "dimension",
    measure: "measure"
  },
  semantic_type: {
    nominal: "nominal",
    ordinal: "ordinal",
    temporal: "temporal",
    quantitative: "quantitative"
  },
  mark_type: {
    __enum__: "Mark Type",
    auto: "Auto",
    bar: "Bar",
    line: "Line",
    area: "Area",
    trail: "Trail",
    point: "Scatter",
    circle: "Circle",
    tick: "Tick",
    rect: "Rectangle",
    arc: "Arc",
    boxplot: "Box (Box Plot)",
    table: "Table",
    text: "Text",
    poi: "POI",
    choropleth: "Choropleth"
  },
  coord_system: {
    __enum__: "Coordinate System",
    generic: "Generic",
    geographic: "Geographic"
  },
  stack_mode: {
    __enum__: "Stack Mode",
    none: "None",
    stack: "Stack",
    normalize: "Normalize",
    center: "Center"
  },
  layout_type: {
    __enum__: "Layout Mode",
    auto: "Auto",
    fixed: "Fixed",
    full: "Container"
  },
  exploration_mode: {
    __enum__: "Exploration Mode",
    none: "Off",
    brush: "Brush",
    point: "Point"
  },
  brush_mode: {
    __enum__: "Brush Direction",
    default: "Both",
    x: "X-Only",
    y: "Y-Only"
  },
  draggable_key: {
    fields: "Fields",
    columns: "X-Axis",
    rows: "Y-Axis",
    color: "Color",
    opacity: "Opacity",
    size: "Size",
    shape: "Shape",
    theta: "Angle",
    radius: "Radius",
    filters: "Filters",
    details: "Details",
    text: "Text",
    longitude: "Longitude",
    latitude: "Latitude",
    geoId: "Geometry ID"
  },
  aggregator: {
    sum: "Sum",
    mean: "Mean",
    count: "Count",
    median: "Median",
    min: "Min",
    max: "Max",
    q1: "Q1",
    q3: "Q3",
    stdev: "Standard Deviation",
    variance: "Variance"
  },
  filter_type: {
    one_of: "Value set",
    one_of_desc: "Select values specified",
    range: "Range",
    range_desc: "Select values in a range [start, end]",
    temporal_range: "Date Range",
    temporal_range_desc: "Select values in a date range [start, end]"
  }
}, oet = {
  labels: {
    data_interpretation: "Interpret Data",
    data_view: "View Data"
  },
  segments: {
    vis: "Visualization",
    data: "Data",
    chat: "Chat"
  },
  feedback: {
    vote: "Is the result of Askviz good?",
    voteup: "Yes",
    votedown: "No",
    report: "Please help us improving Askviz with correct Chart",
    report_button: "Report correct chart"
  }
}, get = {
  labels: {
    cur_dataset: "Current Dataset"
  },
  buttons: {
    create_dataset: "Create Dataset",
    export_as_file: "Save As File",
    import_file: "Import Graphic Walker File"
  },
  dialog: {
    create_data_source: "New Data Source",
    data_types: "DataSource Type",
    text_file_data: "Local Files",
    public_data: "Public Datasets",
    data_source_type: "Data Source Type: {{sourceType}}",
    file: {
      open: "Open...",
      submit: "Submit",
      dataset_name: "Dataset Name",
      choose_file: "Choose a Data File",
      get_start_desc: "Get started by creating a dataset."
    },
    public: {
      submit: "Submit"
    }
  }
}, set = {
  tablist: {
    new: "+ New",
    auto_title: "Chart {{idx}}",
    chart_name: "Chart Name",
    remove_confirm: "Are you sure you want to remove this chart?"
  },
  tabpanel: {
    menubar: {
      undo: "Undo",
      redo: "Redo"
    },
    askviz: {
      placeholder: "What visualization your want to draw from the dataset"
    },
    settings: {
      toggle: {
        aggregation: "Aggregation",
        stack: "Stack",
        axes_resize: "Axes Resizing",
        debug: "debugging"
      },
      sort: "Sorting Order",
      button: {
        ascending: "Sort in Ascending Order",
        descending: "Sort in Descending Order",
        transpose: "Transpose",
        config: "Config",
        export_chart: "Export",
        export_chart_as: "Export as {{type}}",
        export_code: "Export Code",
        geojson: "Geography Configuration",
        painter: "Open Painter",
        disabled_painter: {
          aggergation: "disable aggregation to create a paint",
          temporal: "painter doesn't support temporal fields now",
          count: "drag single field on x and y to create a paint"
        }
      },
      paint: {
        palette: "Palette",
        eraser: "Eraser",
        color: "Brush Color",
        label: "Brush Label",
        brush_size: "Brush Size",
        save_paint: "Save Painting",
        reset_paint: "Reset Painting",
        cancel: "Cancel",
        delete_paint: "Delete Painting"
      },
      limit: "enable query limit (rows)",
      size: "Resize",
      size_setting: {
        width: "Width",
        height: "Height"
      },
      table: {
        summary: "Show summary"
      },
      geography: "Geography Configuration",
      geography_settings: {
        geoKey: "Feature ID",
        format: "Format",
        geojson: "GeoJSON",
        topojson: "TopoJSON",
        objectKey: "Extract Feature Key",
        jsonInputPlaceholder: "Drop {{format}} file here",
        href: "{{format}} URL",
        hrefPlaceholder: "Enter {{format}} URL",
        load: "Load",
        loading: "Loading Geographic Data..."
      }
    },
    DatasetFields: {
      field_list: "Field List"
    }
  }
}, Iet = {
  to_edit: "Edit This Rule",
  empty_rule: "! (empty rule)",
  editing: "Filter Rule Settings",
  form: {
    name: "Field",
    aggregation: "Aggregation",
    rule: "Rule"
  },
  header: {
    visibility: "Visible",
    value: "Label",
    count: "Count"
  },
  selected_keys: "{{ count }} items selected",
  btn: {
    select_all: "Select All",
    unselect_all: "Unselect All",
    reverse: "Reverse Selection",
    confirm: "Confirm",
    cancel: "Cancel"
  },
  range: {
    start_value: "Start Value",
    end_value: "End Value"
  }
}, aet = {
  lg_than: "greater than",
  sm_than: "less than",
  expection: "expectation",
  unrecognized: "Unrecognized",
  score: "score",
  contains: "contains",
  reason: {
    selection_dim_distribution: "dimensions' clues",
    selection_mea_distribution: "measures' clues",
    children_major_factor: "major factor",
    children_outlier: "outlier"
  }
}, ret = {
  prev: "Previous",
  next: "Next",
  drop_field: "Drop Field Here",
  confirm: "Confirm",
  cancel: "Cancel"
}, Cet = {
  to_dim: "Move to dimensions",
  to_mea: "Move to measures",
  semantic_type: {
    name: "Change Semantic Type",
    types: {
      nominal: "Nominal",
      ordinal: "Ordinal",
      quantitative: "Quantitative",
      temporal: "Temporal"
    }
  },
  new_calc: "New calculation",
  bin: "Bin",
  binCount: "Bin Count",
  log: "Log{{ base }}",
  binCustom: "Bin(customize)",
  logCustom: "Log(customize)",
  drill: {
    name: "Time Unit",
    feature_name: "Time feature",
    levels: {
      year: "Year",
      quarter: "Quarter",
      month: "Month",
      week: "Week",
      weekday: "Weekday",
      day: "Day",
      hour: "Hour",
      minute: "Minute",
      second: "Second",
      iso_year: "ISO Year",
      iso_week: "ISO Week",
      iso_weekday: "ISO Weekday"
    }
  }
}, Bet = {
  bin_panel_title: "Bins",
  bin_panel_desc: "Set bin config for field",
  bin_panel_option_widths: "Bin with equal widths",
  bin_panel_option_counts: "Bin with equal counts",
  bin_panel_number: "Bin number",
  log_panel_title: "Logarithm Transformation",
  log_panel_desc: "Set log config for field",
  log_panel_number: "Logarithmic base"
}, EpA = {
  config: iet,
  constant: net,
  App: oet,
  DataSource: get,
  main: set,
  filters: Iet,
  explain: aet,
  actions: ret,
  field_menu: Cet,
  calc: Bet
}, cet = {
  scheme: "スキーム",
  primary_color: "プライマリカラー",
  color_palette: "カラーパレット",
  opacity: "不透明度",
  default_color_palette: "デフォルト",
  size: "サイズ",
  min_domain: "最小ドメイン",
  max_domain: "最大ドメイン",
  range: "範囲",
  format: "フォーマット",
  numberFormat: "数字",
  timeFormat: "日付",
  normalizedNumberFormat: "正規化された数字",
  background: "背景",
  color: "色",
  independence: "独立したスケーリング",
  x: "x軸",
  y: "y軸",
  zeroScale: "０を含む",
  misc: "その他",
  formatGuidesDocs: "フォーマットガイド",
  readHere: "ここを読む",
  svg: "SVGを使う",
  customTile: "地図タイルをカスタマイズ",
  customOffset: "タイムゾーンをカスタマイズ"
}, Qet = {
  row_count: "行数",
  mea_key: "名",
  mea_val: "値",
  paint_key: "キャンバスでのフィールド",
  analytic_type: {
    dimension: "ディメンション",
    measure: "メジャー"
  },
  semantic_type: {
    nominal: "名義尺度",
    ordinal: "順序尺度",
    temporal: "時間尺度",
    quantitative: "数量尺度"
  },
  mark_type: {
    __enum__: "マークタイプ",
    auto: "自動",
    bar: "バー",
    line: "ライン",
    area: "エリア",
    trail: "トレイル",
    point: "散布図",
    circle: "円",
    tick: "棒線図",
    rect: "長方形",
    arc: "アーク",
    boxplot: "ボックスプロット",
    table: "テーブル",
    text: "文字",
    poi: "POI",
    choropleth: "コロプレス"
  },
  stack_mode: {
    __enum__: "スタックモード",
    none: "なし",
    stack: "スタック",
    normalize: "正規化",
    center: "中央"
  },
  layout_type: {
    __enum__: "レイアウトタイプ",
    auto: "自動",
    fixed: "固定",
    full: "コンテナー"
  },
  exploration_mode: {
    __enum__: "探索モード",
    none: "オフ",
    brush: "ブラシ",
    point: "ポイント"
  },
  brush_mode: {
    __enum__: "ブラシの方向",
    default: "両方",
    x: "X軸のみ",
    y: "Y軸のみ"
  },
  draggable_key: {
    fields: "フィールド",
    columns: "X軸",
    rows: "Y軸",
    color: "色",
    opacity: "不透明度",
    size: "大きさ",
    shape: "形状",
    theta: "角度",
    radius: "半径",
    filters: "フィルター",
    text: "テキスト",
    longitude: "経度",
    latitude: "緯度",
    geoId: "地理ID"
  },
  aggregator: {
    sum: "合計",
    mean: "平均",
    count: "件数",
    median: "中央値",
    min: "最小値",
    max: "最大値",
    q1: "第一四分位数",
    q3: "第三四分位数",
    stdev: "標準偏差",
    variance: "分散"
  },
  filter_type: {
    one_of: "値のセット",
    one_of_desc: "指定された値を選択します",
    range: "範囲",
    range_desc: "範囲 [開始, 終了] 内の値を選択します",
    temporal_range: "日付範囲",
    temporal_range_desc: "日付範囲 [開始, 終了] 内の値を選択します"
  }
}, Eet = {
  labels: {
    data_interpretation: "データ解釈",
    data_view: "データ一覧"
  },
  segments: {
    vis: "可視化",
    data: "データ",
    chat: "会話"
  },
  feedback: {
    vote: "Askvizの結果はどうですか？",
    voteup: "いいね",
    votedown: "ダメかも",
    report: "Askvizを改善することに手伝って、正しいチャットを教えてもよろしいですか？",
    report_button: "フィードバック"
  }
}, uet = {
  labels: {
    cur_dataset: "現在のデータセット"
  },
  buttons: {
    create_dataset: "データセットを作成",
    export_as_file: "ファイルとして保存",
    import_file: "Graphic Walkerファイルをインポート"
  },
  dialog: {
    create_data_source: "新しいデータソース",
    data_types: "データソースの種類",
    text_file_data: "ローカルファイル",
    public_data: "公開データセット",
    data_source_type: "データソースの種類：{{sourceType}}",
    file: {
      open: "開く...",
      submit: "提出する",
      dataset_name: "データセット名",
      choose_file: "データファイルを選択してください",
      get_start_desc: "データセットの作成を始めましょう。"
    },
    public: {
      submit: "提出する"
    }
  }
}, det = {
  tablist: {
    new: "+ 新規作成",
    auto_title: "グラフ {{idx}}",
    chart_name: "グラフ名",
    remove_confirm: "このグラフを削除してもよろしいですか？"
  },
  askviz: {
    placeholder: "データセットから描画したい視覚化は何ですか？"
  },
  tabpanel: {
    menubar: {
      undo: "元に戻す",
      redo: "やり直し"
    },
    settings: {
      toggle: {
        aggregation: "集計",
        stack: "スタック",
        axes_resize: "軸のサイズ変更",
        debug: "デバッグ"
      },
      sort: "並べ替えの順序",
      button: {
        ascending: "昇順に並べ替える",
        descending: "降順に並べ替える",
        transpose: "転置",
        config: "設定",
        export_chart: "エクスポート",
        export_chart_as: "{{type}}としてエクスポート",
        export_code: "コードをエクスポート",
        geojson: "地理情報設定",
        painter: "データキャンバスを開く",
        disabled_painter: {
          aggergation: "データキャンバスを作るには集計をオフにするが必要",
          temporal: "時間的フィールドはまたデータキャンバスで使うことができない",
          count: "データキャンバスを作るにはフィールドをXY軸に設置してください"
        }
      },
      paint: {
        palette: "パレット",
        eraser: "消しゴム",
        color: "色",
        label: "ラベル",
        brush_size: "ブラシサイズ",
        save_paint: "キャンバスを保存",
        reset_paint: "キャンバスをリセット",
        cancel: "キャンセル",
        delete_paint: "キャンバスを削除"
      },
      limit: "クエリ制限 (行数) を有効にする",
      size: "サイズ変更",
      size_setting: {
        width: "幅",
        height: "高さ"
      },
      table: {
        summary: "サマリを表示"
      },
      geography: "地理情報設定",
      geography_settings: {
        geoKey: "フィーチャーID",
        format: "データ形式",
        geojson: "GeoJSON",
        topojson: "TopoJSON",
        objectKey: "Feature のキー",
        jsonInputPlaceholder: "{{format}}ファイルをここに",
        href: "{{format}} URL",
        hrefPlaceholder: "{{format}} URLを入力",
        load: "ロード",
        loading: "地理データを読み込んでいます..."
      }
    },
    DatasetFields: {
      field_list: "フィールド一覧"
    }
  }
}, het = {
  to_edit: "このルールを編集",
  empty_rule: "! (未設定)",
  editing: "フィルターの設定",
  form: {
    name: "フィールド",
    aggregation: "集計",
    rule: "ルール"
  },
  header: {
    visibility: "表示",
    value: "ラベル",
    count: "件数"
  },
  selected_keys: "{{ count }}件が選択されました",
  btn: {
    select_all: "すべて選択",
    unselect_all: "すべての選択を解除",
    reverse: "選択を反転する",
    confirm: "確認",
    cancel: "キャンセル"
  },
  range: {
    start_value: "最小",
    end_value: "最大"
  }
}, met = {
  lg_than: "より大きい",
  sm_than: "より小さい",
  expection: "期待値",
  unrecognized: "未認識",
  score: "スコア",
  contains: "を含む",
  reason: {
    selection_dim_distribution: "次元のヒント",
    selection_mea_distribution: "尺度のヒント",
    children_major_factor: "主要要因",
    children_outlier: "外れ値"
  }
}, pet = {
  prev: "前へ",
  next: "次へ",
  drop_field: "ここにフィールドをドロップ",
  confirm: "確認",
  cancel: "キャンセル"
}, yet = {
  to_dim: "ディメンションに変更",
  to_mea: "メジャーに変更",
  new_calc: "計算フィールドを作成",
  bin: "ビン",
  binCount: "ビンカウント",
  log: "対数({{ base }})",
  binCustom: "ビン（カスタム）",
  logCustom: "対数（カスタム）",
  semantic_type: {
    name: "セマンティックタイプの変更",
    types: {
      nominal: "名義",
      ordinal: "序数",
      quantitative: "量的",
      temporal: "時間的"
    }
  },
  drill: {
    name: "時間単位",
    feature_name: "時間特性",
    levels: {
      year: "年",
      quarter: "四半期",
      month: "月",
      week: "週",
      weekday: "曜日",
      day: "日",
      hour: "時",
      minute: "分",
      second: "秒",
      iso_year: "ISO年",
      iso_week: "ISO週",
      iso_weekday: "ISO曜日"
    }
  }
}, bet = {
  bin_panel_title: "ビン",
  bin_panel_desc: "フィールドのビン構成を設定する",
  bin_panel_option_widths: "等しい幅のビン",
  bin_panel_option_counts: "等しい数のビン",
  bin_panel_number: "ビンの数",
  log_panel_title: "対数変換",
  log_panel_desc: "フィールドの対数設定を設定する",
  log_panel_number: "対数の底"
}, upA = {
  config: cet,
  constant: Qet,
  App: Eet,
  DataSource: uet,
  main: det,
  filters: het,
  explain: met,
  actions: pet,
  field_menu: yet,
  calc: bet
}, wet = {
  scheme: "方案",
  primary_color: "主要颜色",
  color_palette: "调色板",
  opacity: "不透明度",
  default_color_palette: "默认",
  size: "尺寸",
  min_domain: "最小域值",
  max_domain: "最大域值",
  range: "范围",
  format: "格式",
  numberFormat: "数字格式",
  timeFormat: "时间格式",
  normalizedNumberFormat: "标准化数字格式",
  background: "背景",
  color: "颜色",
  independence: "独立性",
  x: "x轴",
  y: "y轴",
  zeroScale: "零刻度",
  misc: "其他",
  formatGuidesDocs: "格式指南",
  readHere: "阅读此处",
  svg: "使用SVG",
  customTile: "使用自定义的地图区块",
  customOffset: "使用自定义的时区"
}, fet = {
  row_count: "行数",
  mea_key: "度量名称",
  mea_val: "度量值",
  paint_key: "绘制字段",
  analytic_type: {
    dimension: "维度",
    measure: "度量"
  },
  semantic_type: {
    nominal: "类别类型",
    ordinal: "有序类型",
    temporal: "时间类型",
    quantitative: "数值类型"
  },
  mark_type: {
    __enum__: "标记类型",
    auto: "自动",
    bar: "条形",
    line: "折线",
    area: "面积",
    trail: "痕迹",
    point: "散点",
    circle: "圆",
    tick: "标记",
    rect: "矩形",
    arc: "弧形",
    boxplot: "统计箱",
    table: "表格",
    text: "文本",
    poi: "兴趣点",
    choropleth: "区域图"
  },
  coord_system: {
    __enum__: "坐标系统",
    generic: "通用",
    geographic: "地理"
  },
  layout_type: {
    __enum__: "尺寸模式",
    auto: "自动",
    fixed: "固定",
    full: "容器"
  },
  exploration_mode: {
    __enum__: "探索交互",
    none: "关",
    brush: "范围",
    point: "目标"
  },
  brush_mode: {
    __enum__: "框选方向",
    default: "所有",
    x: "仅 X 轴",
    y: "仅 Y 轴"
  },
  stack_mode: {
    __enum__: "堆叠模式",
    none: "关闭",
    stack: "堆叠",
    normalize: "归一化",
    center: "中央"
  },
  draggable_key: {
    fields: "字段",
    columns: "列",
    rows: "行",
    color: "颜色",
    opacity: "透明度",
    size: "大小",
    shape: "形状",
    theta: "角度",
    radius: "半径",
    filters: "筛选器",
    details: "信息",
    text: "文本",
    longitude: "经度",
    latitude: "纬度",
    geoId: "地理 ID"
  },
  aggregator: {
    sum: "求和",
    mean: "平均值",
    count: "计数",
    median: "中位数",
    min: "最小值",
    max: "最大值",
    q1: "Q1",
    q3: "Q3",
    stdev: "标准差",
    variance: "方差"
  },
  filter_type: {
    one_of: "按值筛选",
    one_of_desc: "选择指定的值",
    range: "按范围筛选",
    range_desc: "选择范围内的值 [开始, 结束]",
    temporal_range: "按日期范围筛选",
    temporal_range_desc: "选择日期范围内的值 [开始, 结束]"
  }
}, Det = {
  labels: {
    data_interpretation: "数据解读",
    data_view: "查看数据"
  },
  segments: {
    vis: "可视化",
    data: "数据",
    chat: "会话"
  },
  feedback: {
    vote: "对Askviz的结果满意吗？",
    voteup: "满意",
    votedown: "不满意",
    report: "为了改进AskViz，请将正确的图表反馈给我们",
    report_button: "反馈"
  }
}, Get = {
  labels: {
    cur_dataset: "当前数据集"
  },
  buttons: {
    create_dataset: "创建数据集",
    export_as_file: "保存到文件",
    import_file: "导入文件"
  },
  dialog: {
    create_data_source: "创建数据源",
    data_types: "选择类型",
    text_file_data: "导入文件",
    public_data: "公共数据集",
    data_source_type: "数据源类型：{{sourceType}}",
    file: {
      open: "打开文件...",
      submit: "确认",
      dataset_name: "数据集名称",
      choose_file: "选择文件",
      get_start_desc: "创建一个数据集以开始分析"
    },
    public: {
      submit: "确认"
    }
  }
}, ket = {
  tablist: {
    new: "+ 新建",
    auto_title: "图表 {{idx}}",
    chart_name: "图表名称",
    remove_confirm: "你确定要删除这个图表吗？"
  },
  askviz: {
    placeholder: "想从数据集中绘制哪种可视化呢?"
  },
  tabpanel: {
    menubar: {
      undo: "撤销",
      redo: "重做"
    },
    settings: {
      toggle: {
        aggregation: "聚合度量",
        stack: "开启堆叠",
        axes_resize: "坐标系缩放",
        debug: "图表调试"
      },
      sort: "排序",
      button: {
        ascending: "升序排序",
        descending: "降序排序",
        transpose: "转置",
        config: "配置",
        export_chart: "导出",
        export_chart_as: "导出 {{type}}",
        export_code: "导出代码",
        geojson: "地理信息配置",
        painter: "打开数据绘板",
        disabled_painter: {
          aggergation: "创建绘制字段需要关闭聚合",
          temporal: "绘制字段暂不支持时间字段",
          count: "在x和y轴上分别放置一个字段来创建绘制字段"
        }
      },
      paint: {
        palette: "色板",
        eraser: "橡皮",
        color: "颜色",
        label: "标签",
        brush_size: "笔刷大小",
        save_paint: "保存画板",
        reset_paint: "重置画板",
        cancel: "取消改动",
        delete_paint: "删除画板"
      },
      limit: "启用查询限制（行）",
      size: "调整尺寸",
      size_setting: {
        width: "宽度",
        height: "高度"
      },
      table: {
        summary: "显示摘要"
      },
      geography: "地理信息配置",
      geography_settings: {
        geoKey: "地理 ID",
        format: "数据格式",
        geojson: "GeoJSON",
        topojson: "TopoJSON",
        objectKey: "提取要素键",
        jsonInputPlaceholder: "拖动{{format}}文件到此",
        href: "{{format}} URL",
        hrefPlaceholder: "输入在线资源地址",
        load: "加载",
        loading: "加载地理数据中..."
      }
    },
    DatasetFields: {
      field_list: "字段列表"
    }
  }
}, Jet = {
  to_edit: "编辑这条规则",
  empty_rule: "! (空的规则)",
  editing: "筛选器规则设定",
  form: {
    name: "字段",
    aggregation: "聚合",
    rule: "规则"
  },
  header: {
    visibility: "可见",
    value: "标签",
    count: "计数"
  },
  selected_keys: "{{ count }} 个标签已选择",
  btn: {
    select_all: "全部选中",
    unselect_all: "全部取消",
    reverse: "选择反向",
    confirm: "确认",
    cancel: "取消"
  },
  range: {
    start_value: "起始值",
    end_value: "终止值"
  }
}, Net = {
  lg_than: "大于",
  sm_than: "小于",
  expection: "期望值",
  unrecognized: "未识别",
  score: "得分",
  contains: "包含",
  reason: {
    selection_dim_distribution: "维度线索",
    selection_mea_distribution: "度量线索",
    children_major_factor: "子节点主要因素",
    children_outlier: "子节点异常"
  }
}, Yet = {
  prev: "向前",
  next: "向后",
  drop_field: "拖拽字段至此",
  confirm: "确认",
  cancel: "取消"
}, Ret = {
  to_dim: "移动到维度",
  to_mea: "移动到度量",
  new_calc: "新的计算字段",
  bin: "分箱",
  binCount: "计数分箱",
  log: "对数（{{ base }}）",
  binCustom: "自定义分箱",
  logCustom: "自定义对数",
  semantic_type: {
    name: "更改语义类型",
    types: {
      nominal: "名义",
      ordinal: "序数",
      quantitative: "计量",
      temporal: "时间"
    }
  },
  drill: {
    name: "时间粒度",
    feature_name: "时间特征",
    levels: {
      year: "年",
      quarter: "季度",
      month: "月",
      week: "周",
      weekdat: "星期几",
      day: "日",
      hour: "时",
      minute: "分",
      second: "秒",
      iso_year: "ISO年",
      iso_week: "ISO周",
      iso_weekday: "ISO星期几"
    }
  }
}, Fet = {
  bin_panel_title: "分箱",
  bin_panel_desc: "设置字段的箱体配置",
  bin_panel_option_widths: "等宽箱体",
  bin_panel_option_counts: "等量箱体",
  bin_panel_number: "箱体数量",
  log_panel_title: "对数变换",
  log_panel_desc: "设置字段的对数配置",
  log_panel_number: "对数底数"
}, dpA = {
  config: wet,
  constant: fet,
  App: Det,
  DataSource: Get,
  main: ket,
  filters: Jet,
  explain: Net,
  actions: Yet,
  field_menu: Ret,
  calc: Fet
}, Met = {
  en: {
    translation: EpA
  },
  "en-US": {
    translation: EpA
  },
  zh: {
    translation: dpA
  },
  "zh-CN": {
    translation: dpA
  },
  ja: {
    translation: upA
  },
  "ja-JP": {
    translation: upA
  }
};
of.use(Gse).use(ZVA).init({
  fallbackLng: "en-US",
  interpolation: {
    escapeValue: !1
    // not needed for react as it escapes by default
  },
  resources: Met
});
const hpA = [], fgA = (A) => {
  for (const e in A)
    if (Object.prototype.hasOwnProperty.call(A, e)) {
      if (hpA.includes(e))
        continue;
      hpA.push(e);
      const t = A[e];
      of.addResourceBundle(e, "translation", t, !1, !0);
    }
}, DgA = (A) => of.changeLanguage(A), xet = ji.div`
    user-select: none;
    align-items: stretch;
    border-style: solid;
    border-width: 1px;
    box-sizing: border-box;
    cursor: default;
    display: flex;
    flex-direction: column;
    font-size: 12px;
    min-width: 150px;
    overflow-y: hidden;
    padding: 0;

    > * {
        flex-grow: 1;
        padding-block: 0.2em;
        padding-inline: 0.5em;
    }

    > header {
        height: 20px;
        border-bottom-width: 1px;
    }

    > div.output {
        min-height: 20px;

        > span {
            overflow-y: hidden;
            max-height: 4em;
        }

        .icon {
            display: none;

            &:hover {
                display: unset;
            }
        }
    }
`, Let = gt((A) => {
  const { provided: e, fIndex: t } = A, i = xt(), { viewFilters: n, config: o } = i, { timezoneDisplayOffset: g } = o, s = n[t], { t: I } = qe("translation", { keyPrefix: "filters" }), r = s.enableAgg ? `${s.aggName}(${s.name})` : s.name;
  return b.createElement(
    xet,
    { className: "text-foreground touch-none", ref: er(e.innerRef), ...e.draggableProps, ...e.dragHandleProps },
    b.createElement("header", { className: "bg-secondary" }, r),
    b.createElement(
      "div",
      { className: "bg-background  text-muted-foreground hover:bg-accent flex flex-row output", onClick: () => i.setFilterEditing(t), style: { cursor: "pointer" }, title: I("to_edit") },
      s.rule ? b.createElement(
        "span",
        { className: "flex-1" },
        s.rule.type === "one of" && b.createElement(
          b.Fragment,
          null,
          "oneOf: [",
          [...s.rule.value].map((a) => JSON.stringify(a)).join(", "),
          "]"
        ),
        s.rule.type === "range" && b.createElement(
          b.Fragment,
          null,
          "range: [",
          s.rule.value[0],
          ", ",
          s.rule.value[1],
          "]"
        ),
        s.rule.type === "not in" && b.createElement(
          b.Fragment,
          null,
          "notIn: [",
          [...s.rule.value].map((a) => JSON.stringify(a)).join(", "),
          "]"
        ),
        s.rule.type === "temporal range" && b.createElement(
          b.Fragment,
          null,
          "range: [",
          s.rule.value[0] ? CQ(Uu(g, s.rule.offset)(s.rule.value[0])) : "",
          ", ",
          s.rule.value[1] ? CQ(Uu(g, s.rule.offset)(s.rule.value[1])) : "",
          "]"
        )
      ) : b.createElement("span", { className: "text-muted-foreground flex-1" }, I("empty_rule")),
      b.createElement(yEe, { className: "icon flex-grow-0 flex-shrink-0 pointer-events-none text-muted-foreground", role: "presentation", "aria-hidden": !0, width: "1.4em", height: "1.4em" })
    )
  );
}), vet = Let, $V = u.forwardRef(({ className: A, ...e }, t) => u.createElement(
  o3,
  { ref: t, minStepsBetweenThumbs: 1, className: me("relative flex w-full touch-none select-none items-center", A), ...e },
  u.createElement(
    LYA,
    { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20" },
    u.createElement(vYA, { className: "absolute h-full bg-primary" })
  ),
  u.createElement(vq, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" }),
  u.createElement(vq, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" })
));
$V.displayName = o3.displayName;
const Het = ji.div`
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding-block: 1em;

    > .output {
        display: flex;
        justify-content: space-between;
        margin-top: 1em;

        > output {
            width: 100%;
        }

        > output:first-child {
            margin-right: 0.5em;
        }

        > output:last-child {
            margin-left: 0.5em;
        }
    }
`, mpA = (A) => {
  const { min: e, max: t, value: i, step: n, resetValue: o, onChange: g } = A, [s, I] = u.useState(`${i ?? o}`), r = () => {
    const a = Number(s);
    !isNaN(a) && a <= t && a >= e ? g(a) : (g(o), I(`${o}`));
  };
  return u.useEffect(() => {
    I(`${i ?? o}`);
  }, [i]), b.createElement(on, { type: "number", min: e, max: t, step: n, value: s, onChange: (a) => I(a.target.value), onBlur: r, onKeyDown: (a) => {
    a.key === "Enter" && r();
  } });
}, Zet = b.memo(function({ min: A, max: e, value: t, onChange: i }) {
  const { t: n } = qe(), o = 10 ** Math.floor(Math.log10((e - A) / 100));
  return b.createElement(
    Het,
    null,
    b.createElement($V, { value: [t[0] ?? A, t[1] ?? e], min: A, max: e, step: o, onValueChange: ([g, s]) => i([g, s]) }),
    b.createElement(
      "div",
      { className: "output" },
      b.createElement(
        "output",
        { htmlFor: "slider:min" },
        b.createElement("div", { className: "my-1" }, n("filters.range.start_value")),
        b.createElement(mpA, { min: A, max: t[1] ?? e, value: t[0] ?? A, step: o, resetValue: A, onChange: (g) => i([g, t[1] ?? e]) })
      ),
      b.createElement(
        "output",
        { htmlFor: "slider:max" },
        b.createElement("div", { className: "my-1" }, n("filters.range.end_value")),
        b.createElement(mpA, { min: t[0] ?? A, max: e, value: t[1] ?? e, step: o, resetValue: e, onChange: (g) => i([t[0] ?? A, g]) })
      )
    )
  );
}), Wet = Zet;
/**
 * react-virtual
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */
function UZ() {
  return UZ = Object.assign ? Object.assign.bind() : function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, UZ.apply(this, arguments);
}
/**
 * virtual-core
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */
function VZ() {
  return VZ = Object.assign ? Object.assign.bind() : function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, VZ.apply(this, arguments);
}
/**
 * virtual-core
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */
function fy(A, e, t) {
  var i, n = (i = t.initialDeps) != null ? i : [], o;
  return function() {
    var g;
    t.key && t.debug != null && t.debug() && (g = Date.now());
    var s = A(), I = s.length !== n.length || s.some(function(Q, E) {
      return n[E] !== Q;
    });
    if (!I)
      return o;
    n = s;
    var r;
    if (t.key && t.debug != null && t.debug() && (r = Date.now()), o = e.apply(void 0, s), t.key && t.debug != null && t.debug()) {
      var a = Math.round((Date.now() - g) * 100) / 100, C = Math.round((Date.now() - r) * 100) / 100, B = C / 16, l = function(Q, E) {
        for (Q = String(Q); Q.length < E; )
          Q = " " + Q;
        return Q;
      };
      console.info("%c⏱ " + l(C, 5) + " /" + l(a, 5) + " ms", `
            font-size: .6rem;
            font-weight: bold;
            color: hsl(` + Math.max(0, Math.min(120 - 120 * B, 120)) + "deg 100% 31%);", t == null ? void 0 : t.key);
    }
    return t == null || t.onChange == null || t.onChange(o), o;
  };
}
function kT(A, e) {
  if (A === void 0)
    throw new Error("Unexpected undefined" + (e ? ": " + e : ""));
  return A;
}
var Ket = function(A, e) {
  return Math.abs(A - e) < 1;
};
/**
 * virtual-core
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */
var Uet = function(A) {
  return A;
}, Vet = function(A) {
  for (var e = Math.max(A.startIndex - A.overscan, 0), t = Math.min(A.endIndex + A.overscan, A.count - 1), i = [], n = e; n <= t; n++)
    i.push(n);
  return i;
}, Xet = function(A, e) {
  var t = A.scrollElement;
  if (t) {
    var i = function(o) {
      var g = o.width, s = o.height;
      e({
        width: Math.round(g),
        height: Math.round(s)
      });
    };
    i(t.getBoundingClientRect());
    var n = new ResizeObserver(function(o) {
      var g = o[0];
      if (g != null && g.borderBoxSize) {
        var s = g.borderBoxSize[0];
        if (s) {
          i({
            width: s.inlineSize,
            height: s.blockSize
          });
          return;
        }
      }
      i(t.getBoundingClientRect());
    });
    return n.observe(t, {
      box: "border-box"
    }), function() {
      n.unobserve(t);
    };
  }
}, zet = function(A, e) {
  var t = A.scrollElement;
  if (t) {
    var i = function() {
      e(t[A.options.horizontal ? "scrollLeft" : "scrollTop"]);
    };
    return i(), t.addEventListener("scroll", i, {
      passive: !0
    }), function() {
      t.removeEventListener("scroll", i);
    };
  }
}, Tet = function(A, e, t) {
  if (e != null && e.borderBoxSize) {
    var i = e.borderBoxSize[0];
    if (i) {
      var n = Math.round(i[t.options.horizontal ? "inlineSize" : "blockSize"]);
      return n;
    }
  }
  return Math.round(A.getBoundingClientRect()[t.options.horizontal ? "width" : "height"]);
}, _et = function(A, e, t) {
  var i, n, o = e.adjustments, g = o === void 0 ? 0 : o, s = e.behavior, I = A + g;
  (i = t.scrollElement) == null || i.scrollTo == null || i.scrollTo((n = {}, n[t.options.horizontal ? "left" : "top"] = I, n.behavior = s, n));
}, qet = function(A) {
  var e = this;
  this.unsubs = [], this.scrollElement = null, this.isScrolling = !1, this.isScrollingTimeoutId = null, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollDirection = null, this.scrollAdjustments = 0, this.measureElementCache = /* @__PURE__ */ new Map(), this.observer = function() {
    var t = null, i = function() {
      return t || (typeof ResizeObserver < "u" ? t = new ResizeObserver(function(n) {
        n.forEach(function(o) {
          e._measureElement(o.target, o);
        });
      }) : null);
    };
    return {
      disconnect: function() {
        var n;
        return (n = i()) == null ? void 0 : n.disconnect();
      },
      observe: function(n) {
        var o;
        return (o = i()) == null ? void 0 : o.observe(n, {
          box: "border-box"
        });
      },
      unobserve: function(n) {
        var o;
        return (o = i()) == null ? void 0 : o.unobserve(n);
      }
    };
  }(), this.range = null, this.setOptions = function(t) {
    Object.entries(t).forEach(function(i) {
      var n = i[0], o = i[1];
      typeof o > "u" && delete t[n];
    }), e.options = VZ({
      debug: !1,
      initialOffset: 0,
      overscan: 1,
      paddingStart: 0,
      paddingEnd: 0,
      scrollPaddingStart: 0,
      scrollPaddingEnd: 0,
      horizontal: !1,
      getItemKey: Uet,
      rangeExtractor: Vet,
      onChange: function() {
      },
      measureElement: Tet,
      initialRect: {
        width: 0,
        height: 0
      },
      scrollMargin: 0,
      scrollingDelay: 150,
      indexAttribute: "data-index",
      initialMeasurementsCache: [],
      lanes: 1
    }, t);
  }, this.notify = function(t) {
    e.options.onChange == null || e.options.onChange(e, t);
  }, this.maybeNotify = fy(function() {
    return e.calculateRange(), [e.isScrolling, e.range ? e.range.startIndex : null, e.range ? e.range.endIndex : null];
  }, function(t) {
    e.notify(t);
  }, {
    key: !1,
    debug: function() {
      return e.options.debug;
    },
    initialDeps: [this.isScrolling, this.range ? this.range.startIndex : null, this.range ? this.range.endIndex : null]
  }), this.cleanup = function() {
    e.unsubs.filter(Boolean).forEach(function(t) {
      return t();
    }), e.unsubs = [], e.scrollElement = null;
  }, this._didMount = function() {
    return e.measureElementCache.forEach(e.observer.observe), function() {
      e.observer.disconnect(), e.cleanup();
    };
  }, this._willUpdate = function() {
    var t = e.options.getScrollElement();
    e.scrollElement !== t && (e.cleanup(), e.scrollElement = t, e._scrollToOffset(e.scrollOffset, {
      adjustments: void 0,
      behavior: void 0
    }), e.unsubs.push(e.options.observeElementRect(e, function(i) {
      e.scrollRect = i, e.maybeNotify();
    })), e.unsubs.push(e.options.observeElementOffset(e, function(i) {
      e.scrollAdjustments = 0, e.scrollOffset !== i && (e.isScrollingTimeoutId !== null && (clearTimeout(e.isScrollingTimeoutId), e.isScrollingTimeoutId = null), e.isScrolling = !0, e.scrollDirection = e.scrollOffset < i ? "forward" : "backward", e.scrollOffset = i, e.maybeNotify(), e.isScrollingTimeoutId = setTimeout(function() {
        e.isScrollingTimeoutId = null, e.isScrolling = !1, e.scrollDirection = null, e.maybeNotify();
      }, e.options.scrollingDelay));
    })));
  }, this.getSize = function() {
    return e.scrollRect[e.options.horizontal ? "width" : "height"];
  }, this.memoOptions = fy(function() {
    return [e.options.count, e.options.paddingStart, e.options.scrollMargin, e.options.getItemKey];
  }, function(t, i, n, o) {
    return e.pendingMeasuredCacheIndexes = [], {
      count: t,
      paddingStart: i,
      scrollMargin: n,
      getItemKey: o
    };
  }, {
    key: !1
  }), this.getFurthestMeasurement = function(t, i) {
    for (var n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), g = i - 1; g >= 0; g--) {
      var s = t[g];
      if (!n.has(s.lane)) {
        var I = o.get(s.lane);
        if (I == null || s.end > I.end ? o.set(s.lane, s) : s.end < I.end && n.set(s.lane, !0), n.size === e.options.lanes)
          break;
      }
    }
    return o.size === e.options.lanes ? Array.from(o.values()).sort(function(r, a) {
      return r.end - a.end;
    })[0] : void 0;
  }, this.getMeasurements = fy(function() {
    return [e.memoOptions(), e.itemSizeCache];
  }, function(t, i) {
    var n = t.count, o = t.paddingStart, g = t.scrollMargin, s = t.getItemKey, I = e.pendingMeasuredCacheIndexes.length > 0 ? Math.min.apply(Math, e.pendingMeasuredCacheIndexes) : 0;
    e.pendingMeasuredCacheIndexes = [];
    for (var r = e.measurementsCache.slice(0, I), a = I; a < n; a++) {
      var C = s(a), B = e.options.lanes === 1 ? r[a - 1] : e.getFurthestMeasurement(r, a), l = B ? B.end : o + g, Q = i.get(C), E = typeof Q == "number" ? Q : e.options.estimateSize(a), d = l + E, m = B ? B.lane : a % e.options.lanes;
      r[a] = {
        index: a,
        start: l,
        size: E,
        end: d,
        key: C,
        lane: m
      };
    }
    return e.measurementsCache = r, r;
  }, {
    key: !1,
    debug: function() {
      return e.options.debug;
    }
  }), this.calculateRange = fy(function() {
    return [e.getMeasurements(), e.getSize(), e.scrollOffset];
  }, function(t, i, n) {
    return e.range = t.length > 0 && i > 0 ? Oet({
      measurements: t,
      outerSize: i,
      scrollOffset: n
    }) : null;
  }, {
    key: !1,
    debug: function() {
      return e.options.debug;
    }
  }), this.getIndexes = fy(function() {
    return [e.options.rangeExtractor, e.calculateRange(), e.options.overscan, e.options.count];
  }, function(t, i, n, o) {
    return i === null ? [] : t(VZ({}, i, {
      overscan: n,
      count: o
    }));
  }, {
    key: !1,
    debug: function() {
      return e.options.debug;
    }
  }), this.indexFromElement = function(t) {
    var i = e.options.indexAttribute, n = t.getAttribute(i);
    return n ? parseInt(n, 10) : (console.warn("Missing attribute name '" + i + "={index}' on measured element."), -1);
  }, this._measureElement = function(t, i) {
    var n = e.measurementsCache[e.indexFromElement(t)];
    if (!n || !t.isConnected) {
      e.measureElementCache.forEach(function(s, I) {
        s === t && (e.observer.unobserve(t), e.measureElementCache.delete(I));
      });
      return;
    }
    var o = e.measureElementCache.get(n.key);
    o !== t && (o && e.observer.unobserve(o), e.observer.observe(t), e.measureElementCache.set(n.key, t));
    var g = e.options.measureElement(t, i, e);
    e.resizeItem(n, g);
  }, this.resizeItem = function(t, i) {
    var n, o = (n = e.itemSizeCache.get(t.key)) != null ? n : t.size, g = i - o;
    g !== 0 && (t.start < e.scrollOffset && e._scrollToOffset(e.scrollOffset, {
      adjustments: e.scrollAdjustments += g,
      behavior: void 0
    }), e.pendingMeasuredCacheIndexes.push(t.index), e.itemSizeCache = new Map(e.itemSizeCache.set(t.key, i)), e.notify(!1));
  }, this.measureElement = function(t) {
    t && e._measureElement(t, void 0);
  }, this.getVirtualItems = fy(function() {
    return [e.getIndexes(), e.getMeasurements()];
  }, function(t, i) {
    for (var n = [], o = 0, g = t.length; o < g; o++) {
      var s = t[o], I = i[s];
      n.push(I);
    }
    return n;
  }, {
    key: !1,
    debug: function() {
      return e.options.debug;
    }
  }), this.getVirtualItemForOffset = function(t) {
    var i = e.getMeasurements();
    return kT(i[WVA(0, i.length - 1, function(n) {
      return kT(i[n]).start;
    }, t)]);
  }, this.getOffsetForAlignment = function(t, i) {
    var n = e.getSize();
    i === "auto" && (t <= e.scrollOffset ? i = "start" : t >= e.scrollOffset + n ? i = "end" : i = "start"), i === "start" ? t = t : i === "end" ? t = t - n : i === "center" && (t = t - n / 2);
    var o = e.options.horizontal ? "scrollWidth" : "scrollHeight", g = e.scrollElement ? "document" in e.scrollElement ? e.scrollElement.document.documentElement[o] : e.scrollElement[o] : 0, s = g - e.getSize();
    return Math.max(Math.min(s, t), 0);
  }, this.getOffsetForIndex = function(t, i) {
    i === void 0 && (i = "auto"), t = Math.max(0, Math.min(t, e.options.count - 1));
    var n = kT(e.getMeasurements()[t]);
    if (i === "auto")
      if (n.end >= e.scrollOffset + e.getSize() - e.options.scrollPaddingEnd)
        i = "end";
      else if (n.start <= e.scrollOffset + e.options.scrollPaddingStart)
        i = "start";
      else
        return [e.scrollOffset, i];
    var o = i === "end" ? n.end + e.options.scrollPaddingEnd : n.start - e.options.scrollPaddingStart;
    return [e.getOffsetForAlignment(o, i), i];
  }, this.isDynamicMode = function() {
    return e.measureElementCache.size > 0;
  }, this.cancelScrollToIndex = function() {
    e.scrollToIndexTimeoutId !== null && (clearTimeout(e.scrollToIndexTimeoutId), e.scrollToIndexTimeoutId = null);
  }, this.scrollToOffset = function(t, i) {
    var n = i === void 0 ? {} : i, o = n.align, g = o === void 0 ? "start" : o, s = n.behavior;
    e.cancelScrollToIndex(), s === "smooth" && e.isDynamicMode() && console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."), e._scrollToOffset(e.getOffsetForAlignment(t, g), {
      adjustments: void 0,
      behavior: s
    });
  }, this.scrollToIndex = function(t, i) {
    var n = i === void 0 ? {} : i, o = n.align, g = o === void 0 ? "auto" : o, s = n.behavior;
    t = Math.max(0, Math.min(t, e.options.count - 1)), e.cancelScrollToIndex(), s === "smooth" && e.isDynamicMode() && console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");
    var I = e.getOffsetForIndex(t, g), r = I[0], a = I[1];
    e._scrollToOffset(r, {
      adjustments: void 0,
      behavior: s
    }), s !== "smooth" && e.isDynamicMode() && (e.scrollToIndexTimeoutId = setTimeout(function() {
      e.scrollToIndexTimeoutId = null;
      var C = e.measureElementCache.has(e.options.getItemKey(t));
      if (C) {
        var B = e.getOffsetForIndex(t, a), l = B[0];
        Ket(l, e.scrollOffset) || e.scrollToIndex(t, {
          align: a,
          behavior: s
        });
      } else
        e.scrollToIndex(t, {
          align: a,
          behavior: s
        });
    }));
  }, this.scrollBy = function(t, i) {
    var n = i === void 0 ? {} : i, o = n.behavior;
    e.cancelScrollToIndex(), o === "smooth" && e.isDynamicMode() && console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."), e._scrollToOffset(e.scrollOffset + t, {
      adjustments: void 0,
      behavior: o
    });
  }, this.getTotalSize = function() {
    var t;
    return (((t = e.getMeasurements()[e.options.count - 1]) == null ? void 0 : t.end) || e.options.paddingStart) - e.options.scrollMargin + e.options.paddingEnd;
  }, this._scrollToOffset = function(t, i) {
    var n = i.adjustments, o = i.behavior;
    e.options.scrollToFn(t, {
      behavior: o,
      adjustments: n
    }, e);
  }, this.measure = function() {
    e.itemSizeCache = /* @__PURE__ */ new Map(), e.notify(!1);
  }, this.setOptions(A), this.scrollRect = this.options.initialRect, this.scrollOffset = this.options.initialOffset, this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach(function(t) {
    e.itemSizeCache.set(t.key, t.size);
  }), this.maybeNotify();
}, WVA = function(A, e, t, i) {
  for (; A <= e; ) {
    var n = (A + e) / 2 | 0, o = t(n);
    if (o < i)
      A = n + 1;
    else if (o > i)
      e = n - 1;
    else
      return n;
  }
  return A > 0 ? A - 1 : 0;
};
function Oet(A) {
  for (var e = A.measurements, t = A.outerSize, i = A.scrollOffset, n = e.length - 1, o = function(I) {
    return e[I].start;
  }, g = WVA(0, n, o, i), s = g; s < n && e[s].end < i + t; )
    s++;
  return {
    startIndex: g,
    endIndex: s
  };
}
/**
 * react-virtual
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */
var jet = typeof document < "u" ? u.useLayoutEffect : u.useEffect;
function Pet(A) {
  var e = u.useReducer(function() {
    return {};
  }, {})[1], t = UZ({}, A, {
    onChange: function(o, g) {
      g ? Jt.flushSync(e) : e(), A.onChange == null || A.onChange(o, g);
    }
  }), i = u.useState(function() {
    return new qet(t);
  }), n = i[0];
  return n.setOptions(t), u.useEffect(function() {
    return n._didMount();
  }, []), jet(function() {
    return n._willUpdate();
  }), n;
}
function KVA(A) {
  return Pet(UZ({
    observeElementRect: Xet,
    observeElementOffset: zet,
    scrollToFn: _et
  }, A));
}
const UVA = "Radio", [$et, VVA] = gg(UVA), [Att, ett] = $et(UVA), ttt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeRadio: t, name: i, checked: n = !1, required: o, disabled: g, value: s = "on", onCheck: I, ...r } = A, [a, C] = u.useState(null), B = Dt(
    e,
    (E) => C(E)
  ), l = u.useRef(!1), Q = a ? !!a.closest("form") : !0;
  return /* @__PURE__ */ u.createElement(Att, {
    scope: t,
    checked: n,
    disabled: g
  }, /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button",
    role: "radio",
    "aria-checked": n,
    "data-state": XVA(n),
    "data-disabled": g ? "" : void 0,
    disabled: g,
    value: s
  }, r, {
    ref: B,
    onClick: ge(A.onClick, (E) => {
      n || I == null || I(), Q && (l.current = E.isPropagationStopped(), l.current || E.stopPropagation());
    })
  })), Q && /* @__PURE__ */ u.createElement(ott, {
    control: a,
    bubbles: !l.current,
    name: i,
    value: s,
    checked: n,
    required: o,
    disabled: g,
    style: {
      transform: "translateX(-100%)"
    }
  }));
}), itt = "RadioIndicator", ntt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeRadio: t, forceMount: i, ...n } = A, o = ett(itt, t);
  return /* @__PURE__ */ u.createElement(Ig, {
    present: i || o.checked
  }, /* @__PURE__ */ u.createElement(ze.span, NA({
    "data-state": XVA(o.checked),
    "data-disabled": o.disabled ? "" : void 0
  }, n, {
    ref: e
  })));
}), ott = (A) => {
  const { control: e, checked: t, bubbles: i = !0, ...n } = A, o = u.useRef(null), g = YR(t), s = RR(e);
  return u.useEffect(() => {
    const I = o.current, r = window.HTMLInputElement.prototype, a = Object.getOwnPropertyDescriptor(r, "checked").set;
    if (g !== t && a) {
      const C = new Event("click", {
        bubbles: i
      });
      a.call(I, t), I.dispatchEvent(C);
    }
  }, [
    g,
    t,
    i
  ]), /* @__PURE__ */ u.createElement("input", NA({
    type: "radio",
    "aria-hidden": !0,
    defaultChecked: t
  }, n, {
    tabIndex: -1,
    ref: o,
    style: {
      ...A.style,
      ...s,
      position: "absolute",
      pointerEvents: "none",
      opacity: 0,
      margin: 0
    }
  }));
};
function XVA(A) {
  return A ? "checked" : "unchecked";
}
const gtt = [
  "ArrowUp",
  "ArrowDown",
  "ArrowLeft",
  "ArrowRight"
], zVA = "RadioGroup", [stt, vXt] = gg(zVA, [
  LD,
  VVA
]), TVA = LD(), _VA = VVA(), [Itt, att] = stt(zVA), rtt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeRadioGroup: t, name: i, defaultValue: n, value: o, required: g = !1, disabled: s = !1, orientation: I, dir: r, loop: a = !0, onValueChange: C, ...B } = A, l = TVA(t), Q = fD(r), [E, d] = as({
    prop: o,
    defaultProp: n,
    onChange: C
  });
  return /* @__PURE__ */ u.createElement(Itt, {
    scope: t,
    name: i,
    required: g,
    disabled: s,
    value: E,
    onValueChange: d
  }, /* @__PURE__ */ u.createElement(iAA, NA({
    asChild: !0
  }, l, {
    orientation: I,
    dir: Q,
    loop: a
  }), /* @__PURE__ */ u.createElement(ze.div, NA({
    role: "radiogroup",
    "aria-required": g,
    "aria-orientation": I,
    "data-disabled": s ? "" : void 0,
    dir: Q
  }, B, {
    ref: e
  }))));
}), Ctt = "RadioGroupItem", Btt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeRadioGroup: t, disabled: i, ...n } = A, o = att(Ctt, t), g = o.disabled || i, s = TVA(t), I = _VA(t), r = u.useRef(null), a = Dt(e, r), C = o.value === n.value, B = u.useRef(!1);
  return u.useEffect(() => {
    const l = (E) => {
      gtt.includes(E.key) && (B.current = !0);
    }, Q = () => B.current = !1;
    return document.addEventListener("keydown", l), document.addEventListener("keyup", Q), () => {
      document.removeEventListener("keydown", l), document.removeEventListener("keyup", Q);
    };
  }, []), /* @__PURE__ */ u.createElement(nAA, NA({
    asChild: !0
  }, s, {
    focusable: !g,
    active: C
  }), /* @__PURE__ */ u.createElement(ttt, NA({
    disabled: g,
    required: o.required,
    checked: C
  }, I, n, {
    name: o.name,
    ref: a,
    onCheck: () => o.onValueChange(n.value),
    onKeyDown: ge((l) => {
      l.key === "Enter" && l.preventDefault();
    }),
    onFocus: ge(n.onFocus, () => {
      var l;
      B.current && ((l = r.current) === null || l === void 0 || l.click());
    })
  })));
}), ltt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeRadioGroup: t, ...i } = A, n = _VA(t);
  return /* @__PURE__ */ u.createElement(ntt, NA({}, n, i, {
    ref: e
  }));
}), qVA = rtt, OVA = Btt, ctt = ltt, AX = u.forwardRef(({ className: A, ...e }, t) => u.createElement(qVA, { className: me("grid gap-2", A), ...e, ref: t }));
AX.displayName = qVA.displayName;
const D2 = u.forwardRef(({ className: A, ...e }, t) => u.createElement(
  OVA,
  { ref: t, className: me("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", A), ...e },
  u.createElement(
    ctt,
    { className: "flex items-center justify-center" },
    u.createElement(_R, { className: "h-3.5 w-3.5 fill-primary" })
  )
));
D2.displayName = OVA.displayName;
const Qtt = /* @__PURE__ */ u.forwardRef((A, e) => /* @__PURE__ */ u.createElement(ze.label, NA({}, A, {
  ref: e,
  onMouseDown: (t) => {
    var i;
    (i = A.onMouseDown) === null || i === void 0 || i.call(A, t), !t.defaultPrevented && t.detail > 1 && t.preventDefault();
  }
}))), jVA = Qtt, Ett = B3("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"), mw = u.forwardRef(({ className: A, ...e }, t) => u.createElement(jVA, { ref: t, className: me(Ett(), A), ...e }));
mw.displayName = jVA.displayName;
function Dy({ className: A, ...e }) {
  return u.createElement("div", { className: me("animate-pulse rounded-md bg-primary/10", A), ...e });
}
function PVA({ content: A, children: e, ...t }) {
  return b.createElement(
    mRA,
    { ...t },
    b.createElement(
      pRA,
      null,
      b.createElement(yRA, { asChild: !0 }, e),
      b.createElement(AAA, null, A)
    )
  );
}
const GgA = ji.div`
    margin-block: 1em;

    > .btn-grp {
        display: flex;
        flex-direction: row;
        margin-block: 1em;

        > * {
            margin-inline-start: 0.6em;

            &:first-child {
                margin-inline-start: 0;
            }
        }
    }
`, JT = ji.div`
    display: flex;
    flex-direction: column;
    max-height: 30vh;
    overflow-y: scroll;
`, Xk = ji.div`
    display: flex;
    & > input,
    & > *[for] {
        cursor: pointer;
    }
    & > * {
        padding-block: 0.6em;
        padding-inline: 0.2em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        user-select: none;
        border-bottom: 0.8px solid hsl(var(--border));
        flex-shink: 0;
    }
    & > *:first-child {
        width: 4em;
    }
    & > *:last-child {
        width: max-content;
    }
    & > *:first-child + * {
        flex: 1;
    }
`, utt = ji.div`
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
`, dtt = ji.div`
    display: flex;
    padding-block: 1em;
    width: 100%;

    > .calendar-input {
        width: 100%;
    }

    > .calendar-input:first-child {
        margin-right: 0.5em;
    }

    > .calendar-input:last-child {
        margin-left: 0.5em;
    }
`, htt = ji.div``, mtt = ji.div``, ptt = (A) => {
  const { currentNum: e, totalNum: t, onChange: i } = A;
  let n;
  return e === t ? n = !0 : e < t && e > 0 ? n = "indeterminate" : n = !1, b.createElement(Ym, { checked: n, disabled: A.disabled, onCheckedChange: () => i() });
}, XZ = (A, e, t, i, n) => {
  const { values: o, range: g, valuesMeta: s, selectedCount: I, displayOffset: r, keyword: a } = e, [C, B] = b.useState(!0), [l, Q] = b.useState(null), E = rm(A);
  return b.useEffect(() => {
    B(!0);
    let d = !1;
    return eS(i, A, { values: o, range: g, valuesMeta: s, sortBy: t, selectedCount: I, timezoneDisplayOffset: r, keyword: a }, n).then((m) => {
      d || (Q(m), B(!1));
    }).catch((m) => {
      console.warn(m), !d && (Q(null), B(!1));
    }), () => {
      d = !0;
    };
  }, [E, i, o, g, s, t, I, a, r]), [C ? null : l, l];
}, Yx = 20, NT = [];
function ytt(A, e, t, i) {
  const n = (s) => s.map((I, r) => {
    const a = r - t;
    return a >= 0 && a < e.length ? e[a] : I;
  }), o = e.length + t;
  if (A.length >= o)
    return n(A);
  const g = A.concat(new Array(o - A.length).fill(i));
  return n(g);
}
const $VA = (A, e, t, i, n, o) => {
  var g, s, I, r;
  const a = u.useMemo(() => {
    var v, K;
    return ((v = A.rule) == null ? void 0 : v.type) === "not in" || ((K = A.rule) == null ? void 0 : K.type) === "one of" ? A.rule.value : [];
  }, [A.fid, t]), [C] = XZ(A, { values: !1, range: !1, selectedCount: a, valuesMeta: !0, displayOffset: o.displayOffset }, "none", t, n), [B, l] = XZ(A, { values: !1, range: !1, valuesMeta: !0, keyword: o.keyword }, "none", t, n), [Q, E] = u.useState(0);
  u.useEffect(() => {
    C && E(C.selectedCount);
  }, [C]);
  const [d, m] = u.useState(NT), y = u.useRef(d), f = u.useCallback((v) => {
    typeof v == "function" ? y.current = v(y.current) : y.current = v, m(y.current);
  }, []), w = u.useRef({}), G = u.useCallback((v) => {
    const K = Math.floor(v / Yx);
    if ((y.current.length <= v || y.current[v] === null) && w.current[K] === void 0) {
      const U = eS(t, A, {
        range: !1,
        values: !0,
        valuesMeta: !1,
        sortBy: e,
        valuesLimit: Yx,
        valuesOffset: Yx * K,
        timezoneDisplayOffset: o.displayOffset,
        keyword: o.keyword
      }, n);
      w.current[K] = U, U.then((j) => {
        if (w.current[K] === U) {
          const { values: q } = j;
          f((O) => ytt(O, q, K * Yx, null));
        }
      });
    }
  }, [t, A.fid, e, n, o.displayOffset, o.keyword]);
  u.useEffect(() => {
    w.current = {}, f(NT), G(0);
  }, [G]);
  const R = d === NT || !B, F = u.useMemo(() => B != null && B.valuesMeta.distinctTotal ? d.concat(new Array(Math.max(B.valuesMeta.distinctTotal - d.length, 0)).fill(null)) : [], [d, B == null ? void 0 : B.valuesMeta.distinctTotal]), Z = ((g = A.rule) == null ? void 0 : g.type) === "one of" ? A.rule.value.length : C && ((s = A.rule) == null ? void 0 : s.type) === "not in" ? C.valuesMeta.distinctTotal - A.rule.value.length : 0, c = ((I = A.rule) == null ? void 0 : I.type) === "one of" ? Q : C && ((r = A.rule) == null ? void 0 : r.type) === "not in" ? C.valuesMeta.total - Q : 0, J = u.useCallback(() => {
    !A.rule || A.rule.type !== "one of" && A.rule.type !== "not in" || !C || (E(0), i({
      type: Z === C.valuesMeta.distinctTotal ? "one of" : "not in",
      value: []
    }));
  }, [A.rule, i, C]), p = u.useCallback(() => {
    !A.rule || A.rule.type !== "one of" && A.rule.type !== "not in" || !C || i({
      type: A.rule.type === "one of" ? "not in" : "one of",
      value: A.rule.value
    });
  }, [A.rule, i, C]), N = u.useCallback((v, K, U) => {
    if (!A.rule || A.rule.type !== "one of" && A.rule.type !== "not in")
      return;
    const j = new Set(A.rule.value);
    K === (A.rule.type === "one of") ? (E((q) => q + U), j.add(v)) : (E((q) => q - U), j.delete(v)), i({
      type: A.rule.type,
      value: Array.from(j)
    });
  }, [A.rule, i]);
  return {
    total: C == null ? void 0 : C.valuesMeta.total,
    distinctTotal: C == null ? void 0 : C.valuesMeta.distinctTotal,
    currentRows: l == null ? void 0 : l.valuesMeta.distinctTotal,
    currentCount: Z,
    currentSum: c,
    handleToggleFullOrEmptySet: J,
    handleToggleReverseSet: p,
    handleSelect: N,
    data: F,
    loadData: G,
    loading: !C,
    loadingPageData: R
  };
}, btt = (A) => (u.useEffect(() => {
  A.effect();
}, [A.effectId]), null);
function RT(A) {
  return b.createElement(
    PVA,
    { content: A.label },
    b.createElement("div", { onClick: () => {
      var e;
      (e = A.onChange) == null || e.call(A, !A.value);
    }, className: $a(A.value ? "bg-primary text-primary-foreground" : "hover:bg-accent", "rounded cursor-pointer p-1 w-6 h-6 flex items-center justify-center") }, A.children)
  );
}
const ppA = ({ config: { key: A, ascending: e }, currentKey: t, setSortConfig: i, id: n }) => {
  const o = A === t;
  return b.createElement(Re, { id: n, variant: o ? "secondary" : "ghost", size: "icon-xs", className: $a("ml-2"), onClick: (g) => {
    g.preventDefault(), i({ key: t, ascending: o ? !e : !0 });
  } }, o && !e ? b.createElement(dIe, { className: "h-4 w-4" }) : b.createElement(DIe, { className: "h-4 w-4" }));
}, ypA = ({ active: A, field: e, onChange: t, allFields: i, displayOffset: n }) => {
  var o, g;
  const [s, I] = u.useState({
    key: "count",
    ascending: !0
  }), { t: r } = qe("translation"), a = sg();
  b.useEffect(() => {
    var AA, gA;
    A && ((AA = e.rule) == null ? void 0 : AA.type) !== "one of" && ((gA = e.rule) == null ? void 0 : gA.type) !== "not in" && t({
      type: "not in",
      value: []
    });
  }, [A, t, e]);
  const [C, B] = u.useState(""), [l, Q] = u.useState(!1), [E, d] = u.useState(!1), [m, y] = u.useState(!1), f = u.useMemo(() => C ? {
    value: C,
    caseSenstive: l,
    word: E,
    regexp: m
  } : void 0, [C, l, E, m]), w = u.useMemo(() => {
    const { timeout: AA, ...gA } = We.KEYWORD_DEBOUNCE_SETTING;
    return function(rA) {
      return wD(rA, AA, gA);
    };
  }, []), G = d7(w)(f), R = e.semanticType === "nominal", F = R ? G : void 0, { currentCount: Z, currentSum: c, distinctTotal: J, data: p, currentRows: N, handleSelect: v, handleToggleFullOrEmptySet: K, handleToggleReverseSet: U, loadData: j, loading: q, loadingPageData: O } = $VA(e, `${s.key}${s.ascending ? "" : "_dsc"}`, a, t, i, {
    displayOffset: n,
    keyword: F
  }), $ = O || f !== G, _ = b.useRef(null), tA = KVA({
    count: N ?? 0,
    getScrollElement: () => _.current,
    estimateSize: () => 32,
    overscan: 10
  }), nA = u.useMemo(() => {
    var AA;
    return e.rule && (e.rule.type === "not in" || ((AA = e.rule) == null ? void 0 : AA.type) === "one of") ? new Set(e.rule.value.map((gA) => nw(gA))) : null;
  }, [e]);
  return ((o = e.rule) == null ? void 0 : o.type) === "one of" || ((g = e.rule) == null ? void 0 : g.type) === "not in" ? b.createElement(
    GgA,
    null,
    b.createElement("div", null, r("constant.filter_type.one_of")),
    b.createElement("div", { className: "text-muted-foreground" }, r("constant.filter_type.one_of_desc")),
    b.createElement(
      "div",
      { className: "btn-grp" },
      b.createElement(Re, { variant: "outline", size: "sm", onClick: () => K() }, r(Z === J ? "filters.btn.unselect_all" : "filters.btn.select_all")),
      b.createElement(Re, { variant: "outline", size: "sm", onClick: () => U() }, r("filters.btn.reverse"))
    ),
    R && b.createElement(
      "div",
      { className: "relative" },
      b.createElement(on, { className: "mb-2 pr-[88px]", type: "search", value: C, placeholder: "Search Value...", onChange: (AA) => {
        B(AA.target.value);
      } }),
      b.createElement(
        "div",
        { className: "absolute flex space-x-1 items-center inset-y-0 right-2" },
        b.createElement(
          RT,
          { label: "Match Case", value: l, onChange: Q },
          b.createElement(
            "svg",
            { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" },
            b.createElement("path", { fill: "currentColor", d: "M8.854 11.702h-1l-.816-2.159H3.772l-.768 2.16H2L4.954 4h.935zm-2.111-2.97L5.534 5.45a3.142 3.142 0 0 1-.118-.515h-.021c-.036.218-.077.39-.124.515L4.073 8.732zm7.013 2.97h-.88v-.86h-.022c-.383.66-.947.99-1.692.99c-.548 0-.978-.146-1.29-.436c-.307-.29-.461-.675-.461-1.155c0-1.027.605-1.625 1.815-1.794l1.65-.23c0-.935-.379-1.403-1.134-1.403c-.663 0-1.26.226-1.794.677V6.59c.54-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782l-1.327.183c-.409.057-.717.159-.924.306c-.208.143-.312.399-.312.768c0 .268.095.489.285.66c.193.169.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165z" })
          )
        ),
        b.createElement(
          RT,
          { label: "Match Whole Word", value: E, onChange: d },
          b.createElement(
            "svg",
            { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" },
            b.createElement(
              "g",
              { fill: "currentColor" },
              b.createElement("path", { fillRule: "evenodd", d: "M0 11h1v2h14v-2h1v3H0z", clipRule: "evenodd" }),
              b.createElement("path", { d: "M6.84 11h-.88v-.86h-.022c-.383.66-.947.989-1.692.989c-.548 0-.977-.145-1.289-.435c-.308-.29-.462-.675-.462-1.155c0-1.028.605-1.626 1.816-1.794l1.649-.23c0-.935-.378-1.403-1.134-1.403c-.662 0-1.26.226-1.794.677v-.902c.541-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782L4.633 8.4c-.408.058-.716.16-.924.307c-.208.143-.311.399-.311.768c0 .268.095.488.284.66c.194.168.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165zm3.388 1.987h-.022V11h-.88V2.857h.88v3.61h.021c.434-.73 1.068-1.096 1.902-1.096c.705 0 1.257.247 1.654.741c.401.49.602 1.15.602 1.977c0 .92-.224 1.658-.672 2.213c-.447.551-1.06.827-1.837.827c-.726 0-1.276-.308-1.649-.924m-.022-2.218v.768c0 .455.147.841.44 1.16c.298.315.674.473 1.128.473c.534 0 .951-.204 1.252-.613c.304-.408.456-.975.456-1.702c0-.613-.141-1.092-.424-1.44c-.283-.347-.666-.52-1.15-.52c-.511 0-.923.178-1.235.536c-.311.355-.467.8-.467 1.338" })
            )
          )
        ),
        b.createElement(
          RT,
          { label: "Use Regular Expression", value: m, onChange: y },
          b.createElement(
            "svg",
            { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" },
            b.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M10.012 2h.976v3.113l2.56-1.557l.486.885L11.47 6l2.564 1.559l-.485.885l-2.561-1.557V10h-.976V6.887l-2.56 1.557l-.486-.885L9.53 6L6.966 4.441l.485-.885l2.561 1.557zM2 10h4v4H2z", clipRule: "evenodd" })
          )
        )
      )
    ),
    b.createElement(
      "div",
      { className: "relative" },
      b.createElement(
        JT,
        null,
        b.createElement(
          Xk,
          null,
          b.createElement(
            "div",
            { className: "flex justify-center items-center" },
            b.createElement(ptt, { disabled: !!F, currentNum: Z, totalNum: J ?? 0, onChange: K })
          ),
          b.createElement(
            "div",
            { className: "header text-muted-foreground flex items-center" },
            b.createElement("label", { htmlFor: "value_sort" }, r("filters.header.value")),
            b.createElement(ppA, { id: "value_sort", currentKey: "value", setSortConfig: I, config: s })
          ),
          b.createElement(
            "div",
            { className: "header text-muted-foreground flex items-center" },
            b.createElement("label", { htmlFor: "count_sort" }, r("filters.header.count")),
            b.createElement(ppA, { id: "count_sort", currentKey: "count", setSortConfig: I, config: s })
          )
        )
      ),
      q && b.createElement(
        "div",
        { className: "h-24 w-full relative" },
        b.createElement(Ts, null)
      ),
      !q && b.createElement(
        JT,
        { ref: _ },
        $ && tA.getTotalSize() === 0 && b.createElement(Ts, null),
        $ && b.createElement("div", { style: {
          paddingBottom: `${tA.getTotalSize()}px`,
          width: "100%",
          position: "relative"
        } }, tA.getVirtualItems().map((AA) => b.createElement(
          Xk,
          { key: AA.index, className: "animate-pulse", style: {
            height: `${AA.size}px`,
            transform: `translateY(${AA.start}px)`,
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%"
          } },
          b.createElement(
            "div",
            { className: "flex justify-center items-center" },
            b.createElement(Dy, { className: "h-4 w-4" })
          ),
          b.createElement(
            "div",
            { className: "flex justify-left items-center" },
            b.createElement(Dy, { className: "h-3 w-20" })
          ),
          b.createElement(
            "div",
            { className: "flex justify-right items-center" },
            b.createElement(Dy, { className: "h-3 w-6" })
          )
        ))),
        !$ && b.createElement("div", { style: {
          paddingBottom: `${tA.getTotalSize()}px`,
          width: "100%",
          position: "relative"
        } }, tA.getVirtualItems().map((AA) => {
          var gA, rA;
          const sA = AA.index, lA = p == null ? void 0 : p[sA];
          if (!lA)
            return b.createElement(
              Xk,
              { key: sA, className: "animate-pulse", style: {
                height: `${AA.size}px`,
                transform: `translateY(${AA.start}px)`,
                position: "absolute",
                top: 0,
                left: 0,
                width: "100%"
              } },
              b.createElement(
                "div",
                { className: "flex justify-center items-center" },
                b.createElement(Dy, { className: "h-4 w-4" })
              ),
              b.createElement(
                "div",
                { className: "flex justify-left items-center" },
                b.createElement(Dy, { className: "h-3 w-20" })
              ),
              b.createElement(
                "div",
                { className: "flex justify-right items-center" },
                b.createElement(Dy, { className: "h-3 w-6" })
              ),
              b.createElement(btt, { effect: () => j(sA), effectId: `${e.fid}_${s.key}${s.ascending ? "" : "_dsc"}_${sA}` })
            );
          const { value: cA, count: aA } = lA, QA = `rule_checkbox_${sA}`, hA = !!nA && ((gA = e.rule) == null ? void 0 : gA.type) === "one of" && nA.has(nw(cA)) || !!nA && ((rA = e.rule) == null ? void 0 : rA.type) === "not in" && !nA.has(nw(cA)), EA = e.semanticType === "temporal" ? CQ(Uu(n, e.offset)(cA)) : `${cA}`;
          return b.createElement(
            Xk,
            { key: sA, style: {
              height: `${AA.size}px`,
              transform: `translateY(${AA.start}px)`,
              position: "absolute",
              top: 0,
              left: 0,
              width: "100%"
            } },
            b.createElement(
              "div",
              { className: "flex justify-center items-center" },
              b.createElement(Ym, { className: "h-4 w-4", checked: hA, id: QA, "aria-describedby": `${QA}_label`, title: EA, onCheckedChange: (RA) => v(cA, !!RA, aA) })
            ),
            b.createElement("label", { id: `${QA}_label`, htmlFor: QA, title: EA }, EA),
            b.createElement("label", { htmlFor: QA }, aA)
          );
        }))
      ),
      an(J) && b.createElement(
        JT,
        { className: "text-muted-foreground" },
        b.createElement(
          Xk,
          null,
          b.createElement("label", null),
          b.createElement("label", null, r("filters.selected_keys", { count: Z })),
          b.createElement("label", null, c)
        )
      )
    )
  ) : null;
}, zZ = (A) => {
  const { min: e, max: t, value: i, onChange: n, displayOffset: o } = A, g = (I) => {
    const r = GY(o)(I);
    return Number.isNaN(r.getTime()) ? "" : CQ(r);
  }, s = (I) => {
    const r = GY(o)(I).getTime();
    r <= t && r >= e && n(r);
  };
  return b.createElement("input", { className: $a("dark:[color-scheme:dark] flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", A.className ?? ""), type: "datetime-local", min: g(e), max: g(t), defaultValue: g(i), onChange: (I) => s(I.target.value) });
}, wtt = ({ active: A, field: e, allFields: t, onChange: i, displayOffset: n }) => {
  var o;
  const { t: g } = qe("translation"), s = sg(), [I, r] = u.useState(() => [0, 0, "", !1]);
  b.useEffect(() => {
    $FA(e, t, s, { timezoneDisplayOffset: n })((d) => A1A(d, e.fid, e.offset)).then(([d, m, y]) => r([d, m, y, !0]));
  }, [e.fid]);
  const [a, C, B, l] = I, Q = e.offset ?? (/* @__PURE__ */ new Date()).getTimezoneOffset();
  b.useEffect(() => {
    var d;
    A && ((d = e.rule) == null ? void 0 : d.type) !== "temporal range" && l && i({
      type: "temporal range",
      value: [a, C],
      format: B,
      offset: Q
    });
  }, [i, e, a, C, B, Q, A]);
  const E = b.useCallback((d) => {
    i({
      type: "temporal range",
      value: d,
      format: B,
      offset: Q
    });
  }, [B, Q]);
  return l ? ((o = e.rule) == null ? void 0 : o.type) === "temporal range" ? b.createElement(
    GgA,
    { className: "overflow-visible" },
    b.createElement("div", null, g("constant.filter_type.temporal_range")),
    b.createElement("div", { className: "text-muted-foreground" }, g("constant.filter_type.temporal_range_desc")),
    b.createElement(
      dtt,
      null,
      b.createElement(
        "div",
        { className: "calendar-input" },
        b.createElement("div", { className: "my-1" }, g("filters.range.start_value")),
        b.createElement(zZ, { displayOffset: n, min: a, max: e.rule.value[1] ?? C, value: e.rule.value[0] ?? a, onChange: (d) => {
          var m;
          return E([d, (m = e.rule) == null ? void 0 : m.value[1]]);
        } })
      ),
      b.createElement(
        "div",
        { className: "calendar-input" },
        b.createElement("div", { className: "my-1" }, g("filters.range.end_value")),
        b.createElement(zZ, { displayOffset: n, min: e.rule.value[0] ?? a, max: C, value: e.rule.value[1] ?? C, onChange: (d) => {
          var m;
          return E([(m = e.rule) == null ? void 0 : m.value[0], d]);
        } })
      )
    )
  ) : null : b.createElement(
    "div",
    { className: "h-24 w-full relative" },
    b.createElement(Ts, null)
  );
}, ftt = ({ active: A, field: e, onChange: t, allFields: i, displayOffset: n }) => {
  var o;
  const { t: g } = qe("translation", { keyPrefix: "constant.filter_type" }), s = sg(), [I] = XZ(e, { values: !1, range: !0, valuesMeta: !1, displayOffset: n }, "none", s, i), r = I == null ? void 0 : I.range;
  b.useEffect(() => {
    var C;
    r && A && ((C = e.rule) == null ? void 0 : C.type) !== "range" && t({
      type: "range",
      value: r
    });
  }, [t, e, r, A]);
  const a = b.useCallback((C) => {
    t({
      type: "range",
      value: C
    });
  }, []);
  return r ? ((o = e.rule) == null ? void 0 : o.type) === "range" ? b.createElement(
    GgA,
    null,
    b.createElement("div", null, g("range")),
    b.createElement("div", { className: "text-muted-foreground" }, g("range_desc")),
    b.createElement(Wet, { min: r[0], max: r[1], value: e.rule.value, onChange: a })
  ) : null : b.createElement(
    "div",
    { className: "h-24 w-full relative" },
    b.createElement(Ts, null)
  );
}, Dtt = {
  "one of": ypA,
  "not in": ypA,
  range: ftt,
  "temporal range": wtt
}, Rx = {
  "one of": {
    key: "one_of",
    descKey: "one_of_desc"
  },
  range: {
    key: "range",
    descKey: "range_desc"
  },
  "temporal range": {
    key: "temporal_range",
    descKey: "temporal_range_desc"
  }
}, Gtt = (A) => A === "not in" ? "one of" : A, eX = ({ allFields: A, field: e, onChange: t, tabs: i, displayOffset: n }) => {
  var o;
  const { t: g } = qe("translation", { keyPrefix: "constant.filter_type" }), [s, I] = b.useState(Gtt((o = e.rule) == null ? void 0 : o.type) ?? i[0]);
  return b.useEffect(() => {
    i.includes(s) || I(i[0]);
  }, [i]), b.createElement(
    utt,
    null,
    b.createElement(AX, { value: s, onValueChange: (r) => I(r) }, i.map((r) => b.createElement(
      "div",
      { className: "flex my-2", key: r },
      b.createElement(
        "div",
        { className: "align-top" },
        b.createElement(D2, { id: r, value: r })
      ),
      b.createElement(
        "div",
        { className: "ml-3" },
        b.createElement(mw, { htmlFor: r }, g(Rx[r].key)),
        b.createElement("div", { className: "text-muted-foreground" }, g(Rx[r].descKey))
      )
    ))),
    b.createElement("hr", { className: "my-0.5" }),
    b.createElement(htt, null, i.map((r, a) => {
      const C = Dtt[r];
      return C ? b.createElement(
        mtt,
        { key: a, id: `filter-panel-${Rx[r]}`, "aria-labelledby": `filter-tab-${Rx[r]}`, role: "tabpanel", hidden: s !== r, tabIndex: 0 },
        b.createElement(C, { displayOffset: n, field: e, onChange: t, active: s === r, allFields: A })
      ) : null;
    }))
  );
}, ktt = [
  " ",
  "Enter",
  "ArrowUp",
  "ArrowDown"
], Jtt = [
  " ",
  "Enter"
], tX = "Select", [iX, nX, Ntt] = i3(tX), [BG, HXt] = gg(tX, [
  Ntt,
  yl
]), kgA = yl(), [Ytt, y0] = BG(tX), [Rtt, Ftt] = BG(tX), Mtt = (A) => {
  const { __scopeSelect: e, children: t, open: i, defaultOpen: n, onOpenChange: o, value: g, defaultValue: s, onValueChange: I, dir: r, name: a, autoComplete: C, disabled: B, required: l } = A, Q = kgA(e), [E, d] = u.useState(null), [m, y] = u.useState(null), [f, w] = u.useState(!1), G = fD(r), [R = !1, F] = as({
    prop: i,
    defaultProp: n,
    onChange: o
  }), [Z, c] = as({
    prop: g,
    defaultProp: s,
    onChange: I
  }), J = u.useRef(null), p = E ? !!E.closest("form") : !0, [N, v] = u.useState(/* @__PURE__ */ new Set()), K = Array.from(N).map(
    (U) => U.props.value
  ).join(";");
  return /* @__PURE__ */ u.createElement(ZR, Q, /* @__PURE__ */ u.createElement(Ytt, {
    required: l,
    scope: e,
    trigger: E,
    onTriggerChange: d,
    valueNode: m,
    onValueNodeChange: y,
    valueNodeHasChildren: f,
    onValueNodeHasChildrenChange: w,
    contentId: za(),
    value: Z,
    onValueChange: c,
    open: R,
    onOpenChange: F,
    dir: G,
    triggerPointerDownPosRef: J,
    disabled: B
  }, /* @__PURE__ */ u.createElement(iX.Provider, {
    scope: e
  }, /* @__PURE__ */ u.createElement(Rtt, {
    scope: A.__scopeSelect,
    onNativeOptionAdd: u.useCallback((U) => {
      v(
        (j) => new Set(j).add(U)
      );
    }, []),
    onNativeOptionRemove: u.useCallback((U) => {
      v((j) => {
        const q = new Set(j);
        return q.delete(U), q;
      });
    }, [])
  }, t)), p ? /* @__PURE__ */ u.createElement(nXA, {
    key: K,
    "aria-hidden": !0,
    required: l,
    tabIndex: -1,
    name: a,
    autoComplete: C,
    value: Z,
    onChange: (U) => c(U.target.value),
    disabled: B
  }, Z === void 0 ? /* @__PURE__ */ u.createElement("option", {
    value: ""
  }) : null, Array.from(N)) : null));
}, xtt = "SelectTrigger", Ltt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, disabled: i = !1, ...n } = A, o = kgA(t), g = y0(xtt, t), s = g.disabled || i, I = Dt(e, g.onTriggerChange), r = nX(t), [a, C, B] = oXA((Q) => {
    const E = r().filter(
      (y) => !y.disabled
    ), d = E.find(
      (y) => y.value === g.value
    ), m = gXA(E, Q, d);
    m !== void 0 && g.onValueChange(m.value);
  }), l = () => {
    s || (g.onOpenChange(!0), B());
  };
  return /* @__PURE__ */ u.createElement(WR, NA({
    asChild: !0
  }, o), /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button",
    role: "combobox",
    "aria-controls": g.contentId,
    "aria-expanded": g.open,
    "aria-required": g.required,
    "aria-autocomplete": "none",
    dir: g.dir,
    "data-state": g.open ? "open" : "closed",
    disabled: s,
    "data-disabled": s ? "" : void 0,
    "data-placeholder": iXA(g.value) ? "" : void 0
  }, n, {
    ref: I,
    onClick: ge(n.onClick, (Q) => {
      Q.currentTarget.focus();
    }),
    onPointerDown: ge(n.onPointerDown, (Q) => {
      const E = Q.target;
      E.hasPointerCapture(Q.pointerId) && E.releasePointerCapture(Q.pointerId), Q.button === 0 && Q.ctrlKey === !1 && (l(), g.triggerPointerDownPosRef.current = {
        x: Math.round(Q.pageX),
        y: Math.round(Q.pageY)
      }, Q.preventDefault());
    }),
    onKeyDown: ge(n.onKeyDown, (Q) => {
      const E = a.current !== "";
      !(Q.ctrlKey || Q.altKey || Q.metaKey) && Q.key.length === 1 && C(Q.key), !(E && Q.key === " ") && ktt.includes(Q.key) && (l(), Q.preventDefault());
    })
  })));
}), vtt = "SelectValue", Htt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, className: i, style: n, children: o, placeholder: g = "", ...s } = A, I = y0(vtt, t), { onValueNodeHasChildrenChange: r } = I, a = o !== void 0, C = Dt(e, I.onValueNodeChange);
  return rs(() => {
    r(a);
  }, [
    r,
    a
  ]), /* @__PURE__ */ u.createElement(ze.span, NA({}, s, {
    ref: C,
    style: {
      pointerEvents: "none"
    }
  }), iXA(I.value) ? /* @__PURE__ */ u.createElement(u.Fragment, null, g) : o);
}), Stt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, children: i, ...n } = A;
  return /* @__PURE__ */ u.createElement(ze.span, NA({
    "aria-hidden": !0
  }, n, {
    ref: e
  }), i || "▼");
}), Ztt = (A) => /* @__PURE__ */ u.createElement(UR, NA({
  asChild: !0
}, A)), qf = "SelectContent", Wtt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = y0(qf, A.__scopeSelect), [i, n] = u.useState();
  if (rs(() => {
    n(new DocumentFragment());
  }, []), !t.open) {
    const o = i;
    return o ? /* @__PURE__ */ Jt.createPortal(/* @__PURE__ */ u.createElement(AXA, {
      scope: A.__scopeSelect
    }, /* @__PURE__ */ u.createElement(iX.Slot, {
      scope: A.__scopeSelect
    }, /* @__PURE__ */ u.createElement("div", null, A.children))), o) : null;
  }
  return /* @__PURE__ */ u.createElement(Ktt, NA({}, A, {
    ref: e
  }));
}), Bc = 10, [AXA, b0] = BG(qf), Ktt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const {
    __scopeSelect: t,
    position: i = "item-aligned",
    onCloseAutoFocus: n,
    onEscapeKeyDown: o,
    onPointerDownOutside: g,
    side: s,
    sideOffset: I,
    align: r,
    alignOffset: a,
    arrowPadding: C,
    collisionBoundary: B,
    collisionPadding: l,
    sticky: Q,
    hideWhenDetached: E,
    avoidCollisions: d,
    //
    ...m
  } = A, y = y0(qf, t), [f, w] = u.useState(null), [G, R] = u.useState(null), F = Dt(
    e,
    (lA) => w(lA)
  ), [Z, c] = u.useState(null), [J, p] = u.useState(null), N = nX(t), [v, K] = u.useState(!1), U = u.useRef(!1);
  u.useEffect(() => {
    if (f)
      return VR(f);
  }, [
    f
  ]), l3();
  const j = u.useCallback((lA) => {
    const [cA, ...aA] = N().map(
      (EA) => EA.ref.current
    ), [QA] = aA.slice(-1), hA = document.activeElement;
    for (const EA of lA)
      if (EA === hA || (EA == null || EA.scrollIntoView({
        block: "nearest"
      }), EA === cA && G && (G.scrollTop = 0), EA === QA && G && (G.scrollTop = G.scrollHeight), EA == null || EA.focus(), document.activeElement !== hA))
        return;
  }, [
    N,
    G
  ]), q = u.useCallback(
    () => j([
      Z,
      f
    ]),
    [
      j,
      Z,
      f
    ]
  );
  u.useEffect(() => {
    v && q();
  }, [
    v,
    q
  ]);
  const { onOpenChange: O, triggerPointerDownPosRef: $ } = y;
  u.useEffect(() => {
    if (f) {
      let lA = {
        x: 0,
        y: 0
      };
      const cA = (QA) => {
        var hA, EA, RA, xA;
        lA = {
          x: Math.abs(Math.round(QA.pageX) - ((hA = (EA = $.current) === null || EA === void 0 ? void 0 : EA.x) !== null && hA !== void 0 ? hA : 0)),
          y: Math.abs(Math.round(QA.pageY) - ((RA = (xA = $.current) === null || xA === void 0 ? void 0 : xA.y) !== null && RA !== void 0 ? RA : 0))
        };
      }, aA = (QA) => {
        lA.x <= 10 && lA.y <= 10 ? QA.preventDefault() : f.contains(QA.target) || O(!1), document.removeEventListener("pointermove", cA), $.current = null;
      };
      return $.current !== null && (document.addEventListener("pointermove", cA), document.addEventListener("pointerup", aA, {
        capture: !0,
        once: !0
      })), () => {
        document.removeEventListener("pointermove", cA), document.removeEventListener("pointerup", aA, {
          capture: !0
        });
      };
    }
  }, [
    f,
    O,
    $
  ]), u.useEffect(() => {
    const lA = () => O(!1);
    return window.addEventListener("blur", lA), window.addEventListener("resize", lA), () => {
      window.removeEventListener("blur", lA), window.removeEventListener("resize", lA);
    };
  }, [
    O
  ]);
  const [_, tA] = oXA((lA) => {
    const cA = N().filter(
      (hA) => !hA.disabled
    ), aA = cA.find(
      (hA) => hA.ref.current === document.activeElement
    ), QA = gXA(cA, lA, aA);
    QA && setTimeout(
      () => QA.ref.current.focus()
    );
  }), nA = u.useCallback((lA, cA, aA) => {
    const QA = !U.current && !aA;
    (y.value !== void 0 && y.value === cA || QA) && (c(lA), QA && (U.current = !0));
  }, [
    y.value
  ]), AA = u.useCallback(
    () => f == null ? void 0 : f.focus(),
    [
      f
    ]
  ), gA = u.useCallback((lA, cA, aA) => {
    const QA = !U.current && !aA;
    (y.value !== void 0 && y.value === cA || QA) && p(lA);
  }, [
    y.value
  ]), rA = i === "popper" ? bpA : Utt, sA = rA === bpA ? {
    side: s,
    sideOffset: I,
    align: r,
    alignOffset: a,
    arrowPadding: C,
    collisionBoundary: B,
    collisionPadding: l,
    sticky: Q,
    hideWhenDetached: E,
    avoidCollisions: d
  } : {};
  return /* @__PURE__ */ u.createElement(AXA, {
    scope: t,
    content: f,
    viewport: G,
    onViewportChange: R,
    itemRefCallback: nA,
    selectedItem: Z,
    onItemLeave: AA,
    itemTextRefCallback: gA,
    focusSelectedItem: q,
    selectedItemText: J,
    position: i,
    isPositioned: v,
    searchRef: _
  }, /* @__PURE__ */ u.createElement(d3, {
    as: rQ,
    allowPinchZoom: !0
  }, /* @__PURE__ */ u.createElement(c3, {
    asChild: !0,
    trapped: y.open,
    onMountAutoFocus: (lA) => {
      lA.preventDefault();
    },
    onUnmountAutoFocus: ge(n, (lA) => {
      var cA;
      (cA = y.trigger) === null || cA === void 0 || cA.focus({
        preventScroll: !0
      }), lA.preventDefault();
    })
  }, /* @__PURE__ */ u.createElement(JD, {
    asChild: !0,
    disableOutsidePointerEvents: !0,
    onEscapeKeyDown: o,
    onPointerDownOutside: g,
    onFocusOutside: (lA) => lA.preventDefault(),
    onDismiss: () => y.onOpenChange(!1)
  }, /* @__PURE__ */ u.createElement(rA, NA({
    role: "listbox",
    id: y.contentId,
    "data-state": y.open ? "open" : "closed",
    dir: y.dir,
    onContextMenu: (lA) => lA.preventDefault()
  }, m, sA, {
    onPlaced: () => K(!0),
    ref: F,
    style: {
      // flex layout so we can place the scroll buttons properly
      display: "flex",
      flexDirection: "column",
      // reset the outline by default as the content MAY get focused
      outline: "none",
      ...m.style
    },
    onKeyDown: ge(m.onKeyDown, (lA) => {
      const cA = lA.ctrlKey || lA.altKey || lA.metaKey;
      if (lA.key === "Tab" && lA.preventDefault(), !cA && lA.key.length === 1 && tA(lA.key), [
        "ArrowUp",
        "ArrowDown",
        "Home",
        "End"
      ].includes(lA.key)) {
        let aA = N().filter(
          (QA) => !QA.disabled
        ).map(
          (QA) => QA.ref.current
        );
        if ([
          "ArrowUp",
          "End"
        ].includes(lA.key) && (aA = aA.slice().reverse()), [
          "ArrowUp",
          "ArrowDown"
        ].includes(lA.key)) {
          const QA = lA.target, hA = aA.indexOf(QA);
          aA = aA.slice(hA + 1);
        }
        setTimeout(
          () => j(aA)
        ), lA.preventDefault();
      }
    })
  }))))));
}), Utt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, onPlaced: i, ...n } = A, o = y0(qf, t), g = b0(qf, t), [s, I] = u.useState(null), [r, a] = u.useState(null), C = Dt(
    e,
    (F) => a(F)
  ), B = nX(t), l = u.useRef(!1), Q = u.useRef(!0), { viewport: E, selectedItem: d, selectedItemText: m, focusSelectedItem: y } = g, f = u.useCallback(() => {
    if (o.trigger && o.valueNode && s && r && E && d && m) {
      const F = o.trigger.getBoundingClientRect(), Z = r.getBoundingClientRect(), c = o.valueNode.getBoundingClientRect(), J = m.getBoundingClientRect();
      if (o.dir !== "rtl") {
        const QA = J.left - Z.left, hA = c.left - QA, EA = F.left - hA, RA = F.width + EA, xA = Math.max(RA, Z.width), HA = window.innerWidth - Bc, ne = RH(hA, [
          Bc,
          HA - xA
        ]);
        s.style.minWidth = RA + "px", s.style.left = ne + "px";
      } else {
        const QA = Z.right - J.right, hA = window.innerWidth - c.right - QA, EA = window.innerWidth - F.right - hA, RA = F.width + EA, xA = Math.max(RA, Z.width), HA = window.innerWidth - Bc, ne = RH(hA, [
          Bc,
          HA - xA
        ]);
        s.style.minWidth = RA + "px", s.style.right = ne + "px";
      }
      const p = B(), N = window.innerHeight - Bc * 2, v = E.scrollHeight, K = window.getComputedStyle(r), U = parseInt(K.borderTopWidth, 10), j = parseInt(K.paddingTop, 10), q = parseInt(K.borderBottomWidth, 10), O = parseInt(K.paddingBottom, 10), $ = U + j + v + O + q, _ = Math.min(d.offsetHeight * 5, $), tA = window.getComputedStyle(E), nA = parseInt(tA.paddingTop, 10), AA = parseInt(tA.paddingBottom, 10), gA = F.top + F.height / 2 - Bc, rA = N - gA, sA = d.offsetHeight / 2, lA = d.offsetTop + sA, cA = U + j + lA, aA = $ - cA;
      if (cA <= gA) {
        const QA = d === p[p.length - 1].ref.current;
        s.style.bottom = "0px";
        const hA = r.clientHeight - E.offsetTop - E.offsetHeight, EA = Math.max(rA, sA + (QA ? AA : 0) + hA + q), RA = cA + EA;
        s.style.height = RA + "px";
      } else {
        const QA = d === p[0].ref.current;
        s.style.top = "0px";
        const hA = Math.max(gA, U + E.offsetTop + (QA ? nA : 0) + sA) + aA;
        s.style.height = hA + "px", E.scrollTop = cA - gA + E.offsetTop;
      }
      s.style.margin = `${Bc}px 0`, s.style.minHeight = _ + "px", s.style.maxHeight = N + "px", i == null || i(), requestAnimationFrame(
        () => l.current = !0
      );
    }
  }, [
    B,
    o.trigger,
    o.valueNode,
    s,
    r,
    E,
    d,
    m,
    o.dir,
    i
  ]);
  rs(
    () => f(),
    [
      f
    ]
  );
  const [w, G] = u.useState();
  rs(() => {
    r && G(window.getComputedStyle(r).zIndex);
  }, [
    r
  ]);
  const R = u.useCallback((F) => {
    F && Q.current === !0 && (f(), y == null || y(), Q.current = !1);
  }, [
    f,
    y
  ]);
  return /* @__PURE__ */ u.createElement(Vtt, {
    scope: t,
    contentWrapper: s,
    shouldExpandOnScrollRef: l,
    onScrollButtonChange: R
  }, /* @__PURE__ */ u.createElement("div", {
    ref: I,
    style: {
      display: "flex",
      flexDirection: "column",
      position: "fixed",
      zIndex: w
    }
  }, /* @__PURE__ */ u.createElement(ze.div, NA({}, n, {
    ref: C,
    style: {
      // When we get the height of the content, it includes borders. If we were to set
      // the height without having `boxSizing: 'border-box'` it would be too big.
      boxSizing: "border-box",
      // We need to ensure the content doesn't get taller than the wrapper
      maxHeight: "100%",
      ...n.style
    }
  }))));
}), bpA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, align: i = "start", collisionPadding: n = Bc, ...o } = A, g = kgA(t);
  return /* @__PURE__ */ u.createElement(KR, NA({}, g, o, {
    ref: e,
    align: i,
    collisionPadding: n,
    style: {
      // Ensure border-box for floating-ui calculations
      boxSizing: "border-box",
      ...o.style,
      "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-select-content-available-width": "var(--radix-popper-available-width)",
      "--radix-select-content-available-height": "var(--radix-popper-available-height)",
      "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
    }
  }));
}), [Vtt, JgA] = BG(qf, {}), wpA = "SelectViewport", Xtt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, ...i } = A, n = b0(wpA, t), o = JgA(wpA, t), g = Dt(e, n.onViewportChange), s = u.useRef(0);
  return /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("style", {
    dangerouslySetInnerHTML: {
      __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
    }
  }), /* @__PURE__ */ u.createElement(iX.Slot, {
    scope: t
  }, /* @__PURE__ */ u.createElement(ze.div, NA({
    "data-radix-select-viewport": "",
    role: "presentation"
  }, i, {
    ref: g,
    style: {
      // we use position: 'relative' here on the `viewport` so that when we call
      // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
      // (independent of the scrollUpButton).
      position: "relative",
      flex: 1,
      overflow: "auto",
      ...i.style
    },
    onScroll: ge(i.onScroll, (I) => {
      const r = I.currentTarget, { contentWrapper: a, shouldExpandOnScrollRef: C } = o;
      if (C != null && C.current && a) {
        const B = Math.abs(s.current - r.scrollTop);
        if (B > 0) {
          const l = window.innerHeight - Bc * 2, Q = parseFloat(a.style.minHeight), E = parseFloat(a.style.height), d = Math.max(Q, E);
          if (d < l) {
            const m = d + B, y = Math.min(l, m), f = m - y;
            a.style.height = y + "px", a.style.bottom === "0px" && (r.scrollTop = f > 0 ? f : 0, a.style.justifyContent = "flex-end");
          }
        }
      }
      s.current = r.scrollTop;
    })
  }))));
}), ztt = "SelectGroup", [SXt, Ttt] = BG(ztt), _tt = "SelectLabel", qtt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, ...i } = A, n = Ttt(_tt, t);
  return /* @__PURE__ */ u.createElement(ze.div, NA({
    id: n.id
  }, i, {
    ref: e
  }));
}), WP = "SelectItem", [Ott, eXA] = BG(WP), jtt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, value: i, disabled: n = !1, textValue: o, ...g } = A, s = y0(WP, t), I = b0(WP, t), r = s.value === i, [a, C] = u.useState(o ?? ""), [B, l] = u.useState(!1), Q = Dt(e, (m) => {
    var y;
    return (y = I.itemRefCallback) === null || y === void 0 ? void 0 : y.call(I, m, i, n);
  }), E = za(), d = () => {
    n || (s.onValueChange(i), s.onOpenChange(!1));
  };
  if (i === "")
    throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
  return /* @__PURE__ */ u.createElement(Ott, {
    scope: t,
    value: i,
    disabled: n,
    textId: E,
    isSelected: r,
    onItemTextChange: u.useCallback((m) => {
      C((y) => {
        var f;
        return y || ((f = m == null ? void 0 : m.textContent) !== null && f !== void 0 ? f : "").trim();
      });
    }, [])
  }, /* @__PURE__ */ u.createElement(iX.ItemSlot, {
    scope: t,
    value: i,
    disabled: n,
    textValue: a
  }, /* @__PURE__ */ u.createElement(ze.div, NA({
    role: "option",
    "aria-labelledby": E,
    "data-highlighted": B ? "" : void 0,
    "aria-selected": r && B,
    "data-state": r ? "checked" : "unchecked",
    "aria-disabled": n || void 0,
    "data-disabled": n ? "" : void 0,
    tabIndex: n ? void 0 : -1
  }, g, {
    ref: Q,
    onFocus: ge(
      g.onFocus,
      () => l(!0)
    ),
    onBlur: ge(
      g.onBlur,
      () => l(!1)
    ),
    onPointerUp: ge(g.onPointerUp, d),
    onPointerMove: ge(g.onPointerMove, (m) => {
      if (n) {
        var y;
        (y = I.onItemLeave) === null || y === void 0 || y.call(I);
      } else
        m.currentTarget.focus({
          preventScroll: !0
        });
    }),
    onPointerLeave: ge(g.onPointerLeave, (m) => {
      if (m.currentTarget === document.activeElement) {
        var y;
        (y = I.onItemLeave) === null || y === void 0 || y.call(I);
      }
    }),
    onKeyDown: ge(g.onKeyDown, (m) => {
      var y;
      ((y = I.searchRef) === null || y === void 0 ? void 0 : y.current) !== "" && m.key === " " || (Jtt.includes(m.key) && d(), m.key === " " && m.preventDefault());
    })
  }))));
}), Fx = "SelectItemText", Ptt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, className: i, style: n, ...o } = A, g = y0(Fx, t), s = b0(Fx, t), I = eXA(Fx, t), r = Ftt(Fx, t), [a, C] = u.useState(null), B = Dt(
    e,
    (m) => C(m),
    I.onItemTextChange,
    (m) => {
      var y;
      return (y = s.itemTextRefCallback) === null || y === void 0 ? void 0 : y.call(s, m, I.value, I.disabled);
    }
  ), l = a == null ? void 0 : a.textContent, Q = u.useMemo(
    () => /* @__PURE__ */ u.createElement("option", {
      key: I.value,
      value: I.value,
      disabled: I.disabled
    }, l),
    [
      I.disabled,
      I.value,
      l
    ]
  ), { onNativeOptionAdd: E, onNativeOptionRemove: d } = r;
  return rs(() => (E(Q), () => d(Q)), [
    E,
    d,
    Q
  ]), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(ze.span, NA({
    id: I.textId
  }, o, {
    ref: B
  })), I.isSelected && g.valueNode && !g.valueNodeHasChildren ? /* @__PURE__ */ Jt.createPortal(o.children, g.valueNode) : null);
}), $tt = "SelectItemIndicator", Ait = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, ...i } = A;
  return eXA($tt, t).isSelected ? /* @__PURE__ */ u.createElement(ze.span, NA({
    "aria-hidden": !0
  }, i, {
    ref: e
  })) : null;
}), fpA = "SelectScrollUpButton", eit = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = b0(fpA, A.__scopeSelect), i = JgA(fpA, A.__scopeSelect), [n, o] = u.useState(!1), g = Dt(e, i.onScrollButtonChange);
  return rs(() => {
    if (t.viewport && t.isPositioned) {
      let s = function() {
        const r = I.scrollTop > 0;
        o(r);
      };
      const I = t.viewport;
      return s(), I.addEventListener("scroll", s), () => I.removeEventListener("scroll", s);
    }
  }, [
    t.viewport,
    t.isPositioned
  ]), n ? /* @__PURE__ */ u.createElement(tXA, NA({}, A, {
    ref: g,
    onAutoScroll: () => {
      const { viewport: s, selectedItem: I } = t;
      s && I && (s.scrollTop = s.scrollTop - I.offsetHeight);
    }
  })) : null;
}), DpA = "SelectScrollDownButton", tit = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = b0(DpA, A.__scopeSelect), i = JgA(DpA, A.__scopeSelect), [n, o] = u.useState(!1), g = Dt(e, i.onScrollButtonChange);
  return rs(() => {
    if (t.viewport && t.isPositioned) {
      let s = function() {
        const r = I.scrollHeight - I.clientHeight, a = Math.ceil(I.scrollTop) < r;
        o(a);
      };
      const I = t.viewport;
      return s(), I.addEventListener("scroll", s), () => I.removeEventListener("scroll", s);
    }
  }, [
    t.viewport,
    t.isPositioned
  ]), n ? /* @__PURE__ */ u.createElement(tXA, NA({}, A, {
    ref: g,
    onAutoScroll: () => {
      const { viewport: s, selectedItem: I } = t;
      s && I && (s.scrollTop = s.scrollTop + I.offsetHeight);
    }
  })) : null;
}), tXA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, onAutoScroll: i, ...n } = A, o = b0("SelectScrollButton", t), g = u.useRef(null), s = nX(t), I = u.useCallback(() => {
    g.current !== null && (window.clearInterval(g.current), g.current = null);
  }, []);
  return u.useEffect(() => () => I(), [
    I
  ]), rs(() => {
    var r;
    const a = s().find(
      (C) => C.ref.current === document.activeElement
    );
    a == null || (r = a.ref.current) === null || r === void 0 || r.scrollIntoView({
      block: "nearest"
    });
  }, [
    s
  ]), /* @__PURE__ */ u.createElement(ze.div, NA({
    "aria-hidden": !0
  }, n, {
    ref: e,
    style: {
      flexShrink: 0,
      ...n.style
    },
    onPointerDown: ge(n.onPointerDown, () => {
      g.current === null && (g.current = window.setInterval(i, 50));
    }),
    onPointerMove: ge(n.onPointerMove, () => {
      var r;
      (r = o.onItemLeave) === null || r === void 0 || r.call(o), g.current === null && (g.current = window.setInterval(i, 50));
    }),
    onPointerLeave: ge(n.onPointerLeave, () => {
      I();
    })
  }));
}), iit = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, ...i } = A;
  return /* @__PURE__ */ u.createElement(ze.div, NA({
    "aria-hidden": !0
  }, i, {
    ref: e
  }));
});
function iXA(A) {
  return A === "" || A === void 0;
}
const nXA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { value: t, ...i } = A, n = u.useRef(null), o = Dt(e, n), g = YR(t);
  return u.useEffect(() => {
    const s = n.current, I = window.HTMLSelectElement.prototype, r = Object.getOwnPropertyDescriptor(I, "value").set;
    if (g !== t && r) {
      const a = new Event("change", {
        bubbles: !0
      });
      r.call(s, t), s.dispatchEvent(a);
    }
  }, [
    g,
    t
  ]), /* @__PURE__ */ u.createElement(uRA, {
    asChild: !0
  }, /* @__PURE__ */ u.createElement("select", NA({}, i, {
    ref: o,
    defaultValue: t
  })));
});
nXA.displayName = "BubbleSelect";
function oXA(A) {
  const e = Pa(A), t = u.useRef(""), i = u.useRef(0), n = u.useCallback((g) => {
    const s = t.current + g;
    e(s), function I(r) {
      t.current = r, window.clearTimeout(i.current), r !== "" && (i.current = window.setTimeout(
        () => I(""),
        1e3
      ));
    }(s);
  }, [
    e
  ]), o = u.useCallback(() => {
    t.current = "", window.clearTimeout(i.current);
  }, []);
  return u.useEffect(() => () => window.clearTimeout(i.current), []), [
    t,
    n,
    o
  ];
}
function gXA(A, e, t) {
  const i = e.length > 1 && Array.from(e).every(
    (s) => s === e[0]
  ) ? e[0] : e, n = t ? A.indexOf(t) : -1;
  let o = nit(A, Math.max(n, 0));
  i.length === 1 && (o = o.filter(
    (s) => s !== t
  ));
  const g = o.find(
    (s) => s.textValue.toLowerCase().startsWith(i.toLowerCase())
  );
  return g !== t ? g : void 0;
}
function nit(A, e) {
  return A.map(
    (t, i) => A[(e + i) % A.length]
  );
}
const oit = Mtt, sXA = Ltt, git = Htt, sit = Stt, Iit = Ztt, IXA = Wtt, ait = Xtt, aXA = qtt, rXA = jtt, rit = Ptt, Cit = Ait, CXA = eit, BXA = tit, lXA = iit, Bit = oit, lit = git, cXA = u.forwardRef(({ className: A, children: e, ...t }, i) => u.createElement(
  sXA,
  { ref: i, className: me("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", A), ...t },
  e,
  u.createElement(
    sit,
    { asChild: !0 },
    u.createElement(qRA, { className: "h-4 w-4 opacity-50" })
  )
));
cXA.displayName = sXA.displayName;
const QXA = u.forwardRef(({ className: A, ...e }, t) => u.createElement(
  CXA,
  { ref: t, className: me("flex cursor-default items-center justify-center py-1", A), ...e },
  u.createElement(Mde, null)
));
QXA.displayName = CXA.displayName;
const EXA = u.forwardRef(({ className: A, ...e }, t) => u.createElement(
  BXA,
  { ref: t, className: me("flex cursor-default items-center justify-center py-1", A), ...e },
  u.createElement(Jde, null)
));
EXA.displayName = BXA.displayName;
const uXA = u.forwardRef(({ className: A, children: e, position: t = "popper", ...i }, n) => u.createElement(
  Iit,
  { container: u.useContext(xD) },
  u.createElement(
    IXA,
    { ref: n, className: me("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", t === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", A), position: t, ...i },
    u.createElement(QXA, null),
    u.createElement(ait, { className: me("p-1", t === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]") }, e),
    u.createElement(EXA, null)
  )
));
uXA.displayName = IXA.displayName;
const cit = u.forwardRef(({ className: A, ...e }, t) => u.createElement(aXA, { ref: t, className: me("px-2 py-1.5 text-sm font-semibold", A), ...e }));
cit.displayName = aXA.displayName;
const dXA = u.forwardRef(({ className: A, children: e, ...t }, i) => u.createElement(
  rXA,
  { ref: i, className: me("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", A), ...t },
  u.createElement(
    "span",
    { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center" },
    u.createElement(
      Cit,
      null,
      u.createElement(_R, { className: "h-4 w-4" })
    )
  ),
  u.createElement(rit, null, e)
));
dXA.displayName = rXA.displayName;
const Qit = u.forwardRef(({ className: A, ...e }, t) => u.createElement(lXA, { ref: t, className: me("-mx-1 my-1 h-px bg-muted", A), ...e }));
Qit.displayName = lXA.displayName;
const Eit = (A) => {
  const { options: e = [], disable: t, selectedKey: i, onSelect: n, placeholder: o = "Select an option", className: g } = A;
  return b.createElement(
    Bit,
    { disabled: t, value: i, onValueChange: (s) => {
      s === "_none" ? n == null || n("") : n == null || n(s);
    } },
    b.createElement(
      cXA,
      { className: g },
      b.createElement(lit, { placeholder: o })
    ),
    b.createElement(uXA, null, e.map((s) => b.createElement(dXA, { key: s.value, value: s.value }, s.label)))
  );
}, G2 = Eit, uit = We.AGGREGATOR_LIST.map((A) => ({
  label: A,
  value: A
})).concat([{ label: "-", value: "_none" }]), dit = ({ allFields: A, field: e, onChange: t, displayOffset: i }) => b.createElement(eX, { field: e, onChange: t, tabs: ["range", "one of"], allFields: A, displayOffset: i }), hit = ({ allFields: A, field: e, onChange: t, displayOffset: i }) => b.createElement(eX, { field: e, onChange: t, tabs: ["one of"], allFields: A, displayOffset: i }), mit = ({ allFields: A, field: e, onChange: t, displayOffset: i }) => b.createElement(eX, { field: e, onChange: t, tabs: ["one of"], allFields: A, displayOffset: i }), pit = ({ allFields: A, field: e, onChange: t, displayOffset: i }) => b.createElement(eX, { field: e, onChange: t, tabs: ["temporal range", "one of"], allFields: A, displayOffset: i }), yit = () => b.createElement(b.Fragment, null), hXA = (A) => {
  const { editingFilterIdx: e, viewFilters: t, meta: i, options: n, onSelectFilter: o, onWriteFilter: g, onClose: s, onSelectAgg: I } = A, { t: r } = qe("translation", { keyPrefix: "filters" }), a = b.useMemo(() => e !== null ? t[e] : null, [e, t]), [C, B] = wre(a), l = b.useCallback((d) => {
    e !== null && B((m) => ({
      ...m,
      rule: d
    }));
  }, [e]), Q = b.useCallback(() => {
    e !== null && g(e, (C == null ? void 0 : C.rule) ?? null), s();
  }, [e, C == null ? void 0 : C.rule, g]), E = a ? {
    quantitative: dit,
    nominal: hit,
    ordinal: mit,
    temporal: pit
  }[a.semanticType] : yit;
  return C ? b.createElement(
    ig,
    { open: !!C, onOpenChange: s },
    b.createElement(
      So,
      null,
      b.createElement(
        PF,
        null,
        b.createElement(wgA, null, r("editing"))
      ),
      b.createElement(
        "div",
        { className: "pt-4 text-xs" },
        b.createElement(
          "div",
          { className: "grid grid-cols-2 gap-4" },
          b.createElement(
            "div",
            null,
            b.createElement("div", { className: "py-1" }, r("form.name")),
            b.createElement(G2, { buttonClassName: "w-96", className: "mb-2", options: n, selectedKey: C.fid, onSelect: o })
          ),
          I && e !== null && C.analyticType === "measure" && b.createElement(
            "div",
            null,
            b.createElement("div", { className: "py-1" }, r("form.aggregation")),
            b.createElement(G2, { buttonClassName: "w-96", className: "mb-2", options: uit, selectedKey: C.enableAgg ? C.aggName ?? "" : "", onSelect: (d) => I(e, d === "" ? null : d) })
          )
        ),
        b.createElement(E, { allFields: i, key: rm(C), field: C, onChange: l, displayOffset: A.displayOffset }),
        b.createElement(
          vl,
          null,
          b.createElement(Re, { onClick: Q, children: r("btn.confirm") }),
          b.createElement(Re, { variant: "outline", onClick: s, children: r("btn.cancel") })
        )
      )
    )
  ) : null;
}, bit = gt(() => {
  var A, e;
  const t = xt(), { editingFilterIdx: i, viewFilters: n, dimensions: o, measures: g, meta: s, allFields: I, viewDimensions: r, config: a } = t, { timezoneDisplayOffset: C } = a, B = sg(), l = i !== null && (A = n[i]) != null && A.enableAgg ? I.find((G) => G.fid === n[i].fid) : void 0, Q = i !== null && (e = n[i]) != null && e.enableAgg ? n[i].aggName : void 0, E = u.useMemo(() => {
    if (l && r.length > 0) {
      const G = Vu([], I, r, [{ ...l, aggName: Q }], !0, "none", [], void 0, C).map((R) => R.type === "view" ? {
        ...R,
        query: R.query.map((F) => F.op === "aggregate" ? { ...F, measures: F.measures.map((Z) => ({ ...Z, asFieldKey: Z.field })) } : F)
      } : R);
      return (R) => B({
        ...R,
        workflow: G.concat(R.workflow.filter((F) => F.type !== "transform"))
      });
    } else
      return B;
  }, [B, r, l, Q]), d = b.useCallback(() => t.closeFilterEditing(), [t]), m = b.useCallback((G, R) => {
    G !== null && t.writeFilter(G, R ?? null);
  }, [t]), y = (G) => {
    const R = n.findIndex((F) => F.fid === G);
    if (R >= 0)
      t.setFilterEditing(R);
    else {
      const F = o.find((c) => c.fid === G) ? "dimensions" : "measures", Z = F === "dimensions" ? o.findIndex((c) => c.fid === G) : g.findIndex((c) => c.fid === G);
      i !== null && t.modFilter(i, F, Z);
    }
  }, f = b.useMemo(() => I.filter((G) => ![Hn, Zi, Wi].includes(G.fid)).map((G) => ({
    label: G.name,
    value: G.fid
  })), [I]), w = (G, R) => {
    t.setFilterAggregator(G, R ?? "");
  };
  return b.createElement(
    vR.Provider,
    { value: E },
    b.createElement(hXA, { options: f, editingFilterIdx: i, displayOffset: C, meta: s, onClose: d, onSelectFilter: y, onWriteFilter: m, viewFilters: n, onSelectAgg: w })
  );
}), wit = bit, fit = gt(({ provided: A }) => {
  const e = xt(), { viewFilters: t } = e;
  return b.createElement(
    fhe,
    { className: "touch-none", ...A.droppableProps, ref: er(A.innerRef) },
    t.map((i, n) => b.createElement(mD, { key: `filters_${n}_${OI(i)}`, draggableId: `filters_${n}_${OI(i)}`, index: n }, (o, g) => b.createElement(vet, { fIndex: n, provided: o }))),
    A.placeholder,
    b.createElement(wit, null)
  );
}), Dit = () => b.createElement(
  "div",
  null,
  b.createElement(
    bhe,
    null,
    b.createElement(ep, { droppableId: "filters", direction: "vertical" }, (A, e) => b.createElement(fit, { provided: A }))
  )
), Git = Dit, mXA = ({ className: A, ...e }) => u.createElement("nav", { role: "navigation", "aria-label": "pagination", className: me("mx-auto flex w-full justify-center", A), ...e });
mXA.displayName = "Pagination";
const pXA = u.forwardRef(({ className: A, ...e }, t) => u.createElement("ul", { ref: t, className: me("flex flex-row items-center gap-1", A), ...e }));
pXA.displayName = "PaginationContent";
const Ty = u.forwardRef(({ className: A, ...e }, t) => u.createElement("li", { ref: t, className: me("cursor-pointer", A), ...e }));
Ty.displayName = "PaginationItem";
const oX = ({ className: A, isActive: e, size: t = "icon", ...i }) => u.createElement("a", { "aria-current": e ? "page" : void 0, className: me(HR({
  variant: e ? "outline" : "ghost",
  size: t
}), A), ...i });
oX.displayName = "PaginationLink";
const yXA = ({ className: A, children: e, ...t }) => u.createElement(
  oX,
  { "aria-label": "Go to previous page", size: "default", className: me("gap-1 pl-2.5", A), ...t },
  u.createElement(Yde, { className: "h-4 w-4" }),
  u.createElement("span", null, e)
);
yXA.displayName = "PaginationPrevious";
const bXA = ({ className: A, children: e, ...t }) => u.createElement(
  oX,
  { "aria-label": "Go to next page", size: "default", className: me("gap-1 pr-2.5", A), ...t },
  u.createElement("span", null, e),
  u.createElement(ORA, { className: "h-4 w-4" })
);
bXA.displayName = "PaginationNext";
const KP = ({ className: A, ...e }) => u.createElement(
  "span",
  { "aria-hidden": !0, className: me("flex h-9 w-9 items-center justify-center", A), ...e },
  u.createElement(Zde, { className: "h-4 w-4" }),
  u.createElement("span", { className: "sr-only" }, "More pages")
);
KP.displayName = "PaginationEllipsis";
function kit(A) {
  const { total: e, onNext: t, onPrev: i, pageIndex: n, onPageChange: o, pageSize: g = 100, extendPageNumber: s = 1 } = A, { t: I } = qe(), r = u.useMemo(() => {
    const C = Math.ceil(e / (g ?? 1)), B = [
      {
        index: 0,
        disabled: !1,
        type: "page"
      },
      ...new Array(1 + s * 2).fill(0).map((E, d) => ({
        index: n - (s - d),
        disabled: !1,
        type: "page"
      })),
      {
        index: C - 1,
        disabled: !1,
        type: "page"
      }
    ].filter((E) => E.index >= 0 && E.index < C), l = [], Q = /* @__PURE__ */ new Set();
    for (let E of B)
      Q.has(E.index) || (l.push(E), Q.add(E.index));
    return l;
  }, [n, g, s, e, n]), a = (C) => b.createElement(
    Ty,
    { key: C },
    b.createElement(oX, { isActive: C === n, onClick: () => {
      o && o(C);
    } }, C + 1)
  );
  return r.length > 0 ? b.createElement(
    mXA,
    null,
    b.createElement(
      pXA,
      null,
      b.createElement(
        Ty,
        null,
        b.createElement(yXA, { onClick: () => {
          i();
        } }, I("actions.prev"))
      ),
      a(r[0].index),
      r.length > 2 && r[1].index > r[0].index + 1 && b.createElement(
        Ty,
        null,
        b.createElement(KP, null)
      ),
      r.slice(1, r.length > 2 ? -1 : void 0).map((C) => a(C.index)),
      r.length > 2 && r[r.length - 1].index > r[r.length - 2].index + 1 && b.createElement(
        Ty,
        null,
        b.createElement(KP, null)
      ),
      r.length > 2 && a(r[r.length - 1].index),
      b.createElement(
        Ty,
        null,
        b.createElement(bXA, { onClick: () => {
          t();
        } }, I("actions.next"))
      )
    )
  ) : null;
}
function GpA({ computation: A, field: e, valueRenderer: t = (i) => `${i}` }) {
  const [i, n] = u.useState();
  if (u.useEffect(() => {
    Nfe(e1A(A, "profiling"), e).then(n);
  }, [A, e]), !an(i))
    return b.createElement("div", { className: "h-24 flex items-center justify-center" }, "Loading...");
  const o = (r) => t(r) || b.createElement("span", { className: "text-destructive" }, "(Empty)"), [g, s] = i, I = g.distinctTotal < 10 || s[0].count > 1.3 * g.total / g.distinctTotal && s[0].count > g.total / 100;
  return g.distinctTotal === 1 ? b.createElement(
    "div",
    { className: "h-24 flex items-center justify-center text-xl" },
    "= ",
    o(s[0].value)
  ) : b.createElement(
    "div",
    { className: "h-24 flex items-center justify-center flex-col gap-2 text-xs" },
    I && b.createElement(
      b.Fragment,
      null,
      s.map(({ count: r, value: a }, C) => {
        const B = o(a);
        return b.createElement(
          PVA,
          { key: C, content: B },
          b.createElement(
            "div",
            { className: "w-full rounded-md px-2 py-1 hover:bg-accent flex justify-between space-x-2" },
            b.createElement("div", { className: "min-w-[0px] flex-shrink truncate max-w-[180px]" }, B),
            b.createElement(
              "div",
              { className: "flex-shrink-0" },
              Math.floor(100 * r / g.total),
              "%"
            )
          )
        );
      }),
      g.distinctTotal > s.length && b.createElement(
        "div",
        { className: "w-full rounded-md px-2 py-1 text-muted-foreground hover:bg-accent flex justify-between space-x-2" },
        b.createElement(
          "div",
          { className: "min-w-[0px] flex-shrink whitespace-nowrap text-ellipsis overflow-hidden" },
          "Other (",
          g.distinctTotal - s.length,
          ")"
        ),
        b.createElement(
          "div",
          { className: "flex-shrink-0" },
          100 - s.reduce((r, { count: a }) => r + Math.floor(100 * a / g.total), 0),
          "%"
        )
      )
    ),
    !I && b.createElement(
      b.Fragment,
      null,
      b.createElement("div", { className: "text-lg" }, g.distinctTotal),
      b.createElement("div", null, "unique values")
    )
  );
}
const TZ = Ld("~s");
function Jit({ computation: A, field: e }) {
  const [t, i] = u.useState();
  return u.useEffect(() => {
    Yfe(e1A(A, "profiling"), e).then(i);
  }, [A, e]), an(t) ? t.min === t.max ? b.createElement(
    "div",
    { className: "h-24 flex items-center justify-center text-xl" },
    "= ",
    t.min
  ) : b.createElement(
    "div",
    { className: "h-24 w-full flex flex-col space-y-1" },
    b.createElement(Nit, { data: t }),
    b.createElement(
      "div",
      { className: "flex justify-between w-full text-xs font-medium leading-none" },
      b.createElement("div", null, TZ(t.min)),
      b.createElement("div", null, TZ(t.max))
    )
  ) : b.createElement("div", { className: "h-24 flex items-center justify-center" }, "Loading...");
}
function Nit({ data: A }) {
  const e = u.useContext(FQ), { vizThemeConfig: t } = u.useContext(T7), i = FMA({
    mediaTheme: e,
    vizThemeConfig: t
  }), n = u.useMemo(() => ({
    ...i,
    background: "transparent"
  }), [i]), o = u.useCallback((g) => {
    if (!g)
      return;
    const { width: s } = g.getBoundingClientRect(), I = {
      width: s - 10,
      height: 70,
      autosize: "fit",
      data: {
        values: A.binValues.map(({ from: r, to: a, count: C }) => ({
          value: `${TZ(r)} - ${TZ(a)}`,
          sort: r,
          count: C
        }))
      },
      mark: { type: "bar", opacity: 0.96, tooltip: { content: "data" } },
      encoding: {
        x: {
          field: "value",
          type: "ordinal",
          sort: { op: "sum", field: "sort" },
          axis: !1
        },
        y: {
          field: "count",
          type: "quantitative",
          axis: !1
        },
        tooltip: [
          { field: "value", type: "ordinal", title: "Value" },
          { field: "count", type: "quantitative", title: "Count" }
        ]
      },
      config: { view: { stroke: null } }
    };
    Tf(g, I, {
      renderer: "canvas",
      mode: "vega-lite",
      actions: !1,
      config: n,
      tooltip: {
        theme: e
      }
    });
  }, [A, n]);
  return b.createElement("div", { ref: o });
}
function Yit(A) {
  return function(e) {
    const [t, i] = u.useState(!1), n = u.useRef(), o = u.useCallback((g) => {
      var s;
      if ((s = n.current) == null || s.disconnect(), g) {
        const I = new IntersectionObserver((r) => {
          r.forEach((a) => {
            a.isIntersecting && (i(!0), I.disconnect());
          });
        });
        I.observe(g), n.current = I;
      }
    }, []);
    return b.createElement(
      b.Fragment,
      null,
      t && b.createElement(A, { ...e }),
      b.createElement("div", { className: "w-0 h-0", ref: o })
    );
  };
}
function Rit(A) {
  const { semanticType: e, displayOffset: t, offset: i, ...n } = A;
  switch (e) {
    case "nominal":
    case "ordinal":
      return b.createElement(GpA, { ...n });
    case "temporal": {
      const o = (g) => CQ(Uu(t, i)(g));
      return b.createElement(GpA, { ...n, valueRenderer: o });
    }
    case "quantitative":
      return b.createElement(Jit, { ...n });
  }
}
const Fit = Yit(Rit), Mit = B3("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
  variants: {
    variant: {
      default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
      secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
      destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
      outline: "text-foreground"
    }
  },
  defaultVariants: {
    variant: "default"
  }
});
function xit({ className: A, variant: e, ...t }) {
  return u.createElement("div", { className: me(Mit({ variant: e }), A), ...t });
}
let FT;
const wXA = "HoverCard", [fXA, ZXt] = gg(wXA, [
  yl
]), NgA = yl(), [Lit, gX] = fXA(wXA), vit = (A) => {
  const { __scopeHoverCard: e, children: t, open: i, defaultOpen: n, onOpenChange: o, openDelay: g = 700, closeDelay: s = 300 } = A, I = NgA(e), r = u.useRef(0), a = u.useRef(0), C = u.useRef(!1), B = u.useRef(!1), [l = !1, Q] = as({
    prop: i,
    defaultProp: n,
    onChange: o
  }), E = u.useCallback(() => {
    clearTimeout(a.current), r.current = window.setTimeout(
      () => Q(!0),
      g
    );
  }, [
    g,
    Q
  ]), d = u.useCallback(() => {
    clearTimeout(r.current), !C.current && !B.current && (a.current = window.setTimeout(
      () => Q(!1),
      s
    ));
  }, [
    s,
    Q
  ]), m = u.useCallback(
    () => Q(!1),
    [
      Q
    ]
  );
  return u.useEffect(() => () => {
    clearTimeout(r.current), clearTimeout(a.current);
  }, []), /* @__PURE__ */ u.createElement(Lit, {
    scope: e,
    open: l,
    onOpenChange: Q,
    onOpen: E,
    onClose: d,
    onDismiss: m,
    hasSelectionRef: C,
    isPointerDownOnContentRef: B
  }, /* @__PURE__ */ u.createElement(ZR, I, t));
}, Hit = "HoverCardTrigger", Sit = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeHoverCard: t, ...i } = A, n = gX(Hit, t), o = NgA(t);
  return /* @__PURE__ */ u.createElement(WR, NA({
    asChild: !0
  }, o), /* @__PURE__ */ u.createElement(ze.a, NA({
    "data-state": n.open ? "open" : "closed"
  }, i, {
    ref: e,
    onPointerEnter: ge(A.onPointerEnter, _Z(n.onOpen)),
    onPointerLeave: ge(A.onPointerLeave, _Z(n.onClose)),
    onFocus: ge(A.onFocus, n.onOpen),
    onBlur: ge(A.onBlur, n.onClose),
    onTouchStart: ge(
      A.onTouchStart,
      (g) => g.preventDefault()
    )
  })));
}), DXA = "HoverCardPortal", [Zit, Wit] = fXA(DXA, {
  forceMount: void 0
}), Kit = (A) => {
  const { __scopeHoverCard: e, forceMount: t, children: i, container: n } = A, o = gX(DXA, e);
  return /* @__PURE__ */ u.createElement(Zit, {
    scope: e,
    forceMount: t
  }, /* @__PURE__ */ u.createElement(Ig, {
    present: t || o.open
  }, /* @__PURE__ */ u.createElement(UR, {
    asChild: !0,
    container: n
  }, i)));
}, UP = "HoverCardContent", Uit = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = Wit(UP, A.__scopeHoverCard), { forceMount: i = t.forceMount, ...n } = A, o = gX(UP, A.__scopeHoverCard);
  return /* @__PURE__ */ u.createElement(Ig, {
    present: i || o.open
  }, /* @__PURE__ */ u.createElement(Vit, NA({
    "data-state": o.open ? "open" : "closed"
  }, n, {
    onPointerEnter: ge(A.onPointerEnter, _Z(o.onOpen)),
    onPointerLeave: ge(A.onPointerLeave, _Z(o.onClose)),
    ref: e
  })));
}), Vit = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeHoverCard: t, onEscapeKeyDown: i, onPointerDownOutside: n, onFocusOutside: o, onInteractOutside: g, ...s } = A, I = gX(UP, t), r = NgA(t), a = u.useRef(null), C = Dt(e, a), [B, l] = u.useState(!1);
  return u.useEffect(() => {
    if (B) {
      const Q = document.body;
      return FT = Q.style.userSelect || Q.style.webkitUserSelect, Q.style.userSelect = "none", Q.style.webkitUserSelect = "none", () => {
        Q.style.userSelect = FT, Q.style.webkitUserSelect = FT;
      };
    }
  }, [
    B
  ]), u.useEffect(() => {
    if (a.current) {
      const Q = () => {
        l(!1), I.isPointerDownOnContentRef.current = !1, setTimeout(() => {
          var E;
          ((E = document.getSelection()) === null || E === void 0 ? void 0 : E.toString()) !== "" && (I.hasSelectionRef.current = !0);
        });
      };
      return document.addEventListener("pointerup", Q), () => {
        document.removeEventListener("pointerup", Q), I.hasSelectionRef.current = !1, I.isPointerDownOnContentRef.current = !1;
      };
    }
  }, [
    I.isPointerDownOnContentRef,
    I.hasSelectionRef
  ]), u.useEffect(() => {
    a.current && Xit(a.current).forEach(
      (Q) => Q.setAttribute("tabindex", "-1")
    );
  }), /* @__PURE__ */ u.createElement(JD, {
    asChild: !0,
    disableOutsidePointerEvents: !1,
    onInteractOutside: g,
    onEscapeKeyDown: i,
    onPointerDownOutside: n,
    onFocusOutside: ge(o, (Q) => {
      Q.preventDefault();
    }),
    onDismiss: I.onDismiss
  }, /* @__PURE__ */ u.createElement(KR, NA({}, r, s, {
    onPointerDown: ge(s.onPointerDown, (Q) => {
      Q.currentTarget.contains(Q.target) && l(!0), I.hasSelectionRef.current = !1, I.isPointerDownOnContentRef.current = !0;
    }),
    ref: C,
    style: {
      ...s.style,
      userSelect: B ? "text" : void 0,
      // Safari requires prefix
      WebkitUserSelect: B ? "text" : void 0,
      "--radix-hover-card-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-hover-card-content-available-width": "var(--radix-popper-available-width)",
      "--radix-hover-card-content-available-height": "var(--radix-popper-available-height)",
      "--radix-hover-card-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-hover-card-trigger-height": "var(--radix-popper-anchor-height)"
    }
  })));
});
function _Z(A) {
  return (e) => e.pointerType === "touch" ? void 0 : A();
}
function Xit(A) {
  const e = [], t = document.createTreeWalker(A, NodeFilter.SHOW_ELEMENT, {
    acceptNode: (i) => i.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
  });
  for (; t.nextNode(); )
    e.push(t.currentNode);
  return e;
}
const zit = vit, Tit = Sit, _it = Kit, GXA = Uit, qit = zit, Oit = Tit, kXA = u.forwardRef(({ className: A, align: e = "center", sideOffset: t = 4, ...i }, n) => u.createElement(
  _it,
  { container: u.useContext(xD) },
  u.createElement(GXA, { ref: n, align: e, sideOffset: t, className: me("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", A), ...i })
));
kXA.displayName = GXA.displayName;
const jit = ji.div`
    overflow-x: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    table {
        box-sizing: content-box;
        border-collapse: collapse;
        font-size: 12px;
        tbody {
            td {
            }
            td.number {
                text-align: right;
            }
            td.text {
                text-align: left;
            }
        }
    }
`, Pit = ["nominal", "ordinal", "quantitative", "temporal"];
function kpA(A) {
  return A.analyticType === "dimension" ? "text" : "number";
}
function $it(A) {
  return A.analyticType === "dimension" ? "border-t-2 border-dimension" : "border-t-2 border-measure";
}
function JpA(A) {
  switch (A.semanticType) {
    case "nominal":
      return "border border-transparent bg-sky-100 text-sky-800 dark:bg-sky-900 dark:text-sky-100 dark:border-sky-600";
    case "ordinal":
      return "border border-transparent bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-100 dark:border-indigo-600";
    case "quantitative":
      return "border border-transparent bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-100 dark:border-purple-600";
    case "temporal":
      return "border border-transparent bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100 dark:border-yellow-600";
    default:
      return "border border-transparent bg-gray-400";
  }
}
const Ant = (A) => {
  const e = A.map((n) => {
    var o;
    return ((o = n.path) == null ? void 0 : o.length) ?? 1;
  }).reduce((n, o) => Math.max(n, o), 0), t = [...Array(e)].map(() => []);
  let i = 1;
  return A.forEach((n, o) => {
    const g = n.path ?? [n.name ?? n.fid];
    if (g.length > i)
      for (let s = i - 1; s < g.length - 1; s++)
        t[s].push({
          colSpan: 0,
          rowSpan: 1,
          type: "name",
          value: g[s]
        });
    i = g.length;
    for (let s = 0; s < g.length - 1; s++)
      t[s][t[s].length - 1].colSpan++;
    t[g.length - 1].push({
      type: "field",
      value: n,
      colSpan: 1,
      rowSpan: e - g.length + 1,
      fIndex: o
    });
  }), t;
}, NpA = (A) => A.type === "name" ? A.value : A.value.name ?? A.value.fid;
function ent(A) {
  const [e, t] = u.useState([]), [i, n] = u.useState(null), o = u.useMemo(() => A.map((a) => ({ label: a.name ?? a.fid, value: a.fid })), [A]), g = u.useCallback((a) => {
    const C = e.findIndex((B) => B.fid === a);
    if (C > -1)
      n(C);
    else {
      const B = A.find((Q) => Q.fid === a);
      if (!B)
        return;
      const l = {
        fid: a,
        rule: null,
        analyticType: B.analyticType,
        name: B.name ?? B.fid,
        semanticType: B.semanticType
      };
      i === null || !e[i] ? (t(e.concat(l)), n(e.length)) : t(e.map((Q, E) => E === i ? l : Q));
    }
  }, [A, e, i]), s = u.useCallback((a, C) => {
    t((B) => B.map((l, Q) => Q === a ? { ...l, rule: C } : l));
  }, []), I = u.useCallback((a) => {
    t((C) => C.filter((B, l) => l !== a));
  }, []), r = u.useCallback(() => {
    n(null);
  }, []);
  return { filters: e, options: o, editingFilterIdx: i, onSelectFilter: g, onDeleteFilter: I, onWriteFilter: s, onClose: r };
}
function tnt(A) {
  const { field: e, item: t } = A;
  return e.semanticType === "temporal" ? CQ(Uu(A.displayOffset, e.offset)(t[e.fid])) : `${t[e.fid]}`;
}
function nnt(A) {
  const [e, t] = u.useState(!1);
  return u.useEffect(() => {
    if (e) {
      const i = setTimeout(() => {
        t(!1);
      }, 2e3);
      return () => {
        clearTimeout(i);
      };
    }
  }, [e]), b.createElement(Re, { variant: "secondary", className: "h-6 px-2 text-xs w-14", size: "sm", onClick: () => {
    try {
      navigator.clipboard.writeText(A.value), t(!0);
    } catch (i) {
      console.error(i);
    }
  }, disabled: e }, e ? "Copied" : "Copy");
}
function ont(A) {
  const e = u.useRef(null), [t, i] = u.useState(!1), [n, o] = u.useState(!1);
  return u.useEffect(() => {
    e.current && i(e.current.offsetWidth < e.current.scrollWidth);
  }, [e.current]), b.createElement(
    qit,
    { open: n && t, onOpenChange: o },
    b.createElement(Oit, { ref: e, className: "truncate block" }, A.value),
    b.createElement(
      kXA,
      { className: "flex space-x-2 items-center w-fit py-2 px-3" },
      b.createElement("p", { className: "text-xs max-w-[360px] line-clamp-4 break-all" }, A.value),
      b.createElement(nnt, { value: A.value })
    )
  );
}
const gnt = u.forwardRef((A, e) => {
  const { size: t = 10, onMetaChange: i, metas: n, computation: o, disableFilter: g, displayOffset: s, hidePaginationAtOnepage: I, hideProfiling: r } = A, [a, C] = u.useState(0), { t: B } = qe(), l = o, Q = u.useMemo(() => Pit.map((lA) => ({
    value: lA,
    label: B(`constant.semantic_type.${lA}`)
  })), []), [E, d] = u.useState([]), [m, y] = u.useState(!1), f = u.useRef(0), [w, G] = u.useState(), { filters: R, editingFilterIdx: F, onClose: Z, onDeleteFilter: c, onSelectFilter: J, onWriteFilter: p, options: N } = ent(n), v = u.useRef(R);
  v.current = R, u.useImperativeHandle(e, () => ({
    getFilters: () => v.current.filter((lA) => lA.rule)
  }));
  const [K, U] = u.useState(0), [j, q] = u.useState(!1);
  u.useEffect(() => {
    const lA = R.filter((cA) => cA.rule).map((cA) => ({ ...cA, rule: cA.rule }));
    q(!0), o({
      workflow: [
        ...!g && lA && lA.length > 0 ? [
          {
            type: "filter",
            filters: lA
          }
        ] : [],
        {
          type: "view",
          query: [
            {
              op: "aggregate",
              groupBy: [],
              measures: [
                {
                  field: "*",
                  agg: "count",
                  asFieldKey: "count"
                }
              ]
            }
          ]
        }
      ]
    }).then((cA) => {
      var aA;
      U(((aA = cA[0]) == null ? void 0 : aA.count) ?? 0), q(!1);
    });
  }, [g, R, o]);
  const O = a * t, $ = Math.min((a + 1) * t - 1, K - 1);
  u.useEffect(() => {
    O > K && C(0);
  }, [O, K]), u.useEffect(() => {
    y(!0);
    const lA = ++f.current;
    return Gfe(l, t, a, {
      sorting: w,
      filters: R.filter((cA) => cA.rule).map((cA) => ({ ...cA, rule: cA.rule }))
    }).then((cA) => {
      lA === f.current && (y(!1), d(cA));
    }).catch((cA) => {
      lA === f.current && (console.error(cA), y(!1), d([]));
    }), () => {
      f.current++;
    };
  }, [l, a, t, w, R]);
  const _ = u.useMemo(() => {
    const lA = R.filter((cA) => cA.rule).map(u2A);
    return (cA) => o(d2A(cA, lA));
  }, [o, R]), tA = j || m, nA = u.useMemo(() => Ant(n), [n]), [AA, gA] = u.useState(!1), rA = u.useRef(), sA = u.useCallback((lA) => {
    var cA;
    if ((cA = rA.current) == null || cA.disconnect(), lA) {
      const aA = new IntersectionObserver((QA) => {
        QA.forEach((hA) => {
          gA(!hA.isIntersecting);
        });
      });
      aA.observe(lA), rA.current = aA;
    }
  }, []);
  return b.createElement(
    jit,
    { className: "relative" },
    !g && R.length > 0 && b.createElement(
      "div",
      { className: "flex items-center p-2 space-x-2" },
      b.createElement("span", null, "Filters: "),
      R.map((lA, cA) => b.createElement(snt, { key: lA.fid, name: lA.name, onClick: () => J(lA.fid), onRemove: () => c(cA) }))
    ),
    !(I && K <= t) && b.createElement(
      "nav",
      { className: "flex items-center justify-end space-x-2 p-2", "aria-label": "Pagination" },
      b.createElement(
        "div",
        { className: "hidden sm:block flex-1" },
        b.createElement(
          "p",
          { className: "text-sm text-muted-foreground" },
          "Showing ",
          b.createElement("span", { className: "font-medium" }, O + 1),
          " to ",
          b.createElement("span", { className: "font-medium" }, $ + 1),
          " of",
          " ",
          b.createElement("span", { className: "font-medium" }, K),
          " results"
        )
      ),
      b.createElement(
        "div",
        { className: "space-x-2" },
        b.createElement(kit, { total: K, pageSize: t, pageIndex: a, onNext: () => {
          C(Math.min(Math.ceil(K / t) - 1, a + 1));
        }, onPrev: () => {
          C(Math.max(0, a - 1));
        }, onPageChange: (lA) => {
          C(Math.max(0, Math.min(Math.ceil(K / t) - 1, lA)));
        } })
      )
    ),
    b.createElement(
      "div",
      { className: "overflow-y-auto h-full", style: { maxHeight: "600px" } },
      b.createElement("div", { className: "h-0 w-full", ref: sA }),
      b.createElement(
        "table",
        { className: "min-w-full relative border-x" },
        b.createElement(
          "thead",
          { className: `sticky top-0 bg-background ${AA ? "shadow-md" : ""}` },
          nA.map((lA) => b.createElement("tr", { className: "divide-x divide-border", key: `row_${NpA(lA[0])}` }, lA.map((cA, aA) => b.createElement(
            "th",
            { colSpan: cA.colSpan, rowSpan: cA.rowSpan, key: NpA(cA), className: "align-top p-0 border-b bg-background", style: { zIndex: lA.length - aA } },
            cA.type === "name" && b.createElement(
              "div",
              { className: "inset-x-0 border-t-4 border-yellow-400 whitespace-nowrap py-3.5 text-left text-xs font-medium text-foreground" },
              b.createElement("b", { className: "sticky inset-x-0 w-fit px-4 sm:pl-6" }, cA.value)
            ),
            cA.type === "field" && b.createElement(
              "div",
              { className: $it(cA.value) + " whitespace-nowrap py-3.5 px-4 text-left text-xs font-medium text-foreground flex items-center gap-1 group" },
              b.createElement(
                "div",
                { className: "font-normal block" },
                !i && b.createElement(
                  "span",
                  { className: "inline-flex p-0.5 text-xs mt-1 rounded " + JpA(cA.value) },
                  b.createElement(Bf, { dataType: cA.value.semanticType, analyticType: cA.value.analyticType })
                ),
                i && b.createElement(
                  f3,
                  { options: Q, onSelect: (QA) => {
                    i(cA.value.fid, cA.fIndex, {
                      semanticType: QA
                    });
                  } },
                  b.createElement(
                    "span",
                    { className: "cursor-pointer inline-flex p-0.5 text-xs mt-1 rounded hover:scale-125 " + JpA(cA.value) },
                    b.createElement(Bf, { dataType: cA.value.semanticType, analyticType: cA.value.analyticType })
                  )
                )
              ),
              b.createElement("b", { className: "inline-block", onClick: () => G((QA) => (QA == null ? void 0 : QA.fid) === cA.value.fid && QA.sort === "descending" ? {
                fid: cA.value.fid,
                sort: "ascending"
              } : {
                fid: cA.value.fid,
                sort: "descending"
              }) }, cA.value.basename || cA.value.name || cA.value.fid),
              (w == null ? void 0 : w.fid) === cA.value.fid && b.createElement(
                "div",
                { className: "mx-1" },
                w.sort === "ascending" && b.createElement(u7, { className: "w-3" }),
                w.sort === "descending" && b.createElement(E7, { className: "w-3" })
              ),
              !g && b.createElement(
                "div",
                { className: HR({
                  variant: "ghost",
                  className: "cursor-pointer invisible group-hover:visible",
                  size: "icon-sm"
                }), onClick: () => J(cA.value.fid) },
                b.createElement(_Ie, { className: "w-4 inline-block" })
              )
            )
          )))),
          !A.hideProfiling && b.createElement("tr", { className: "divide-x divide-border border-b" }, n.map((lA) => b.createElement(
            "th",
            { key: lA.fid, className: kpA(lA) + " whitespace-nowrap py-2 px-3 text-xs text-muted-foreground" },
            b.createElement(Fit, { field: lA.fid, semanticType: lA.semanticType, computation: _, displayOffset: s, offset: lA.offset })
          )))
        ),
        b.createElement("tbody", { className: "divide-y divide-border bg-background font-mono" }, E.map((lA, cA) => b.createElement("tr", { className: "divide-x divide-border", key: cA }, n.map((aA) => {
          const QA = tnt({ field: aA, item: lA, displayOffset: s });
          return b.createElement(
            "td",
            { key: aA.fid + cA, className: kpA(aA) + " whitespace-nowrap py-2 px-4 text-xs text-muted-foreground max-w-[240px]" },
            b.createElement(ont, { value: QA })
          );
        }))))
      )
    ),
    tA && b.createElement(Ts, null),
    !g && b.createElement(
      vR.Provider,
      { value: o },
      b.createElement(
        "div",
        { className: "text-xs" },
        b.createElement(hXA, { editingFilterIdx: F, meta: n, onClose: Z, onSelectFilter: J, onWriteFilter: p, options: N, viewFilters: R, displayOffset: s })
      )
    )
  );
}), sX = gnt, snt = (A) => b.createElement(
  xit,
  { onClick: A.onClick, className: "gap-x-0.5" },
  A.name,
  b.createElement(
    Re,
    { onClick: (e) => {
      var t;
      e.stopPropagation(), (t = A.onRemove) == null || t.call(A);
    }, variant: "ghost", size: "none", className: "relative -mr-1 h-3.5 w-3.5 rounded-sm" },
    b.createElement("span", { className: "sr-only" }, "Remove"),
    b.createElement(
      "svg",
      { viewBox: "0 0 14 14", className: "h-3.5 w-3.5 stroke-current" },
      b.createElement("path", { d: "M4 4l6 6m0-6l-6 6" })
    ),
    b.createElement("span", { className: "absolute -inset-1" })
  )
), Int = () => {
  const A = xt(), e = sg(), t = $K(A.meta);
  return b.createElement(
    "div",
    { className: "relative" },
    b.createElement(sX, { size: 100, metas: t, computation: e, displayOffset: A.config.timezoneDisplayOffset, onMetaChange: (i, n, o) => {
      A.updateCurrentDatasetMetas(i, o);
    } })
  );
}, ant = gt(Int), JXA = "Tabs", [rnt, WXt] = gg(JXA, [
  LD
]), NXA = LD(), [Cnt, YgA] = rnt(JXA), Bnt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTabs: t, value: i, onValueChange: n, defaultValue: o, orientation: g = "horizontal", dir: s, activationMode: I = "automatic", ...r } = A, a = fD(s), [C, B] = as({
    prop: i,
    onChange: n,
    defaultProp: o
  });
  return /* @__PURE__ */ u.createElement(Cnt, {
    scope: t,
    baseId: za(),
    value: C,
    onValueChange: B,
    orientation: g,
    dir: a,
    activationMode: I
  }, /* @__PURE__ */ u.createElement(ze.div, NA({
    dir: a,
    "data-orientation": g
  }, r, {
    ref: e
  })));
}), lnt = "TabsList", cnt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTabs: t, loop: i = !0, ...n } = A, o = YgA(lnt, t), g = NXA(t);
  return /* @__PURE__ */ u.createElement(iAA, NA({
    asChild: !0
  }, g, {
    orientation: o.orientation,
    dir: o.dir,
    loop: i
  }), /* @__PURE__ */ u.createElement(ze.div, NA({
    role: "tablist",
    "aria-orientation": o.orientation
  }, n, {
    ref: e
  })));
}), Qnt = "TabsTrigger", Ent = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTabs: t, value: i, disabled: n = !1, ...o } = A, g = YgA(Qnt, t), s = NXA(t), I = YXA(g.baseId, i), r = RXA(g.baseId, i), a = i === g.value;
  return /* @__PURE__ */ u.createElement(nAA, NA({
    asChild: !0
  }, s, {
    focusable: !n,
    active: a
  }), /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button",
    role: "tab",
    "aria-selected": a,
    "aria-controls": r,
    "data-state": a ? "active" : "inactive",
    "data-disabled": n ? "" : void 0,
    disabled: n,
    id: I
  }, o, {
    ref: e,
    onMouseDown: ge(A.onMouseDown, (C) => {
      !n && C.button === 0 && C.ctrlKey === !1 ? g.onValueChange(i) : C.preventDefault();
    }),
    onKeyDown: ge(A.onKeyDown, (C) => {
      [
        " ",
        "Enter"
      ].includes(C.key) && g.onValueChange(i);
    }),
    onFocus: ge(A.onFocus, () => {
      const C = g.activationMode !== "manual";
      !a && !n && C && g.onValueChange(i);
    })
  })));
}), unt = "TabsContent", Bv = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTabs: t, value: i, forceMount: n, children: o, ...g } = A, s = YgA(unt, t), I = YXA(s.baseId, i), r = RXA(s.baseId, i), a = i === s.value, C = u.useRef(a);
  return u.useEffect(() => {
    const B = requestAnimationFrame(
      () => C.current = !1
    );
    return () => cancelAnimationFrame(B);
  }, []), /* @__PURE__ */ u.createElement(
    Ig,
    {
      present: n || a
    },
    ({ present: B }) => /* @__PURE__ */ u.createElement(ze.div, NA({
      "data-state": a ? "active" : "inactive",
      "data-orientation": s.orientation,
      role: "tabpanel",
      "aria-labelledby": I,
      hidden: !B,
      id: r,
      tabIndex: 0
    }, g, {
      ref: e,
      style: {
        ...A.style,
        animationDuration: C.current ? "0s" : void 0
      }
    }), B && o)
  );
});
function YXA(A, e) {
  return `${A}-trigger-${e}`;
}
function RXA(A, e) {
  return `${A}-content-${e}`;
}
const dnt = Bnt, FXA = cnt, MXA = Ent, xXA = Bv, $F = u.forwardRef(({ ...A }, e) => u.createElement(dnt, { ref: e, activationMode: "manual", ...A })), lG = u.forwardRef(({ className: A, ...e }, t) => u.createElement(FXA, { ref: t, className: me("border-b flex h-9 space-x-8 items-center justify-start py-1", A), ...e }));
lG.displayName = FXA.displayName;
const CC = u.forwardRef(({ className: A, ...e }, t) => u.createElement(MXA, { ref: t, className: me("inline-flex items-center justify-center whitespace-nowrap text-muted-foreground border-b-2 border-transparent hover:text-accent-foreground hover:border-accent-foreground px-1 py-2 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-primary data-[state=active]:border-primary", A), ...e }));
CC.displayName = MXA.displayName;
const k2 = u.forwardRef(({ className: A, ...e }, t) => u.createElement(xXA, { ref: t, className: me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", A), ...e }));
k2.displayName = xXA.displayName;
const hnt = (A) => (typeof A != "string" && (A = JSON.stringify(A, void 0, 4)), A = A.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\n/g, "<br>").replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\s/g, "&nbsp;"), A.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function(e) {
  var t = "text-sky-500";
  return /^"/.test(e) ? /:$/.test(e) ? t = "text-purple-500" : t = "text-emerald-500" : /true|false/.test(e) ? t = "text-blue-500" : /null/.test(e) && (t = "text-sky-500"), '<span class="' + t + '">' + e + "</span>";
})), mnt = gt((A) => {
  const e = xt(), { showCodeExportPanel: t } = e, { t: i } = qe(), [n, o] = u.useState("graphic-walker"), [g, s] = u.useState(""), I = [
    {
      key: "graphic-walker",
      label: "Graphic-Walker"
    },
    {
      key: "vega-lite",
      label: "Vega-Lite"
    },
    ...e.layout.showActions ? [
      {
        key: "workflow",
        label: "Workflow"
      }
    ] : []
  ];
  return u.useEffect(() => {
    if (t)
      if (n === "graphic-walker") {
        const r = e.exportCode();
        s(r);
      } else if (n === "vega-lite")
        s(e.lastSpec);
      else if (n === "workflow") {
        const r = e.workflow;
        s(r);
      } else
        console.error("unknown tabKey");
  }, [n, t, e]), b.createElement(
    ig,
    { open: t, onOpenChange: () => {
      e.setShowCodeExportPanel(!1);
    } },
    b.createElement(
      So,
      null,
      b.createElement("h1", null, "Code Export"),
      b.createElement(
        $F,
        { value: n, onValueChange: o },
        b.createElement(lG, { className: "my-1" }, I.map((r) => b.createElement(CC, { key: r.key, value: r.key }, r.label))),
        b.createElement(
          "div",
          { className: "border rounded-md overflow-hidden" },
          b.createElement(
            "div",
            { className: "text-sm px-6 max-h-96 overflow-auto " },
            b.createElement("code", { dangerouslySetInnerHTML: { __html: hnt(g) } })
          )
        )
      ),
      b.createElement(
        vl,
        { className: "mt-2" },
        b.createElement(Re, { children: "Copy to Clipboard", onClick: () => {
          navigator.clipboard.writeText(JSON.stringify(g)), e.setShowCodeExportPanel(!1);
        } }),
        b.createElement(Re, { variant: "outline", children: i("actions.cancel"), onClick: () => {
          e.setShowCodeExportPanel(!1);
        } })
      )
    )
  );
}), pnt = mnt, LXA = "Switch", [ynt, KXt] = gg(LXA), [bnt, wnt] = ynt(LXA), fnt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSwitch: t, name: i, checked: n, defaultChecked: o, required: g, disabled: s, value: I = "on", onCheckedChange: r, ...a } = A, [C, B] = u.useState(null), l = Dt(
    e,
    (y) => B(y)
  ), Q = u.useRef(!1), E = C ? !!C.closest("form") : !0, [d = !1, m] = as({
    prop: n,
    defaultProp: o,
    onChange: r
  });
  return /* @__PURE__ */ u.createElement(bnt, {
    scope: t,
    checked: d,
    disabled: s
  }, /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button",
    role: "switch",
    "aria-checked": d,
    "aria-required": g,
    "data-state": vXA(d),
    "data-disabled": s ? "" : void 0,
    disabled: s,
    value: I
  }, a, {
    ref: l,
    onClick: ge(A.onClick, (y) => {
      m(
        (f) => !f
      ), E && (Q.current = y.isPropagationStopped(), Q.current || y.stopPropagation());
    })
  })), E && /* @__PURE__ */ u.createElement(knt, {
    control: C,
    bubbles: !Q.current,
    name: i,
    value: I,
    checked: d,
    required: g,
    disabled: s,
    style: {
      transform: "translateX(-100%)"
    }
  }));
}), Dnt = "SwitchThumb", Gnt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSwitch: t, ...i } = A, n = wnt(Dnt, t);
  return /* @__PURE__ */ u.createElement(ze.span, NA({
    "data-state": vXA(n.checked),
    "data-disabled": n.disabled ? "" : void 0
  }, i, {
    ref: e
  }));
}), knt = (A) => {
  const { control: e, checked: t, bubbles: i = !0, ...n } = A, o = u.useRef(null), g = YR(t), s = RR(e);
  return u.useEffect(() => {
    const I = o.current, r = window.HTMLInputElement.prototype, a = Object.getOwnPropertyDescriptor(r, "checked").set;
    if (g !== t && a) {
      const C = new Event("click", {
        bubbles: i
      });
      a.call(I, t), I.dispatchEvent(C);
    }
  }, [
    g,
    t,
    i
  ]), /* @__PURE__ */ u.createElement("input", NA({
    type: "checkbox",
    "aria-hidden": !0,
    defaultChecked: t
  }, n, {
    tabIndex: -1,
    ref: o,
    style: {
      ...A.style,
      ...s,
      position: "absolute",
      pointerEvents: "none",
      opacity: 0,
      margin: 0
    }
  }));
};
function vXA(A) {
  return A ? "checked" : "unchecked";
}
const HXA = fnt, Jnt = Gnt, SXA = u.forwardRef(({ className: A, ...e }, t) => u.createElement(
  HXA,
  { className: me("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", A), ...e, ref: t },
  u.createElement(Jnt, { className: me("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") })
));
SXA.displayName = HXA.displayName;
function uE(A) {
  const { enabled: e, onChange: t, label: i } = A;
  return b.createElement(
    "div",
    { className: "flex items-center space-x-2" },
    b.createElement(SXA, { id: i, checked: e, onCheckedChange: t }),
    b.createElement(mw, { htmlFor: i }, i)
  );
}
function YpA(A) {
  const { t: e } = qe();
  return b.createElement(
    "div",
    { className: "flex space-x-6 my-2" },
    b.createElement(
      "div",
      { className: "flex flex-col space-y-2 items-start" },
      b.createElement(
        "div",
        { className: "flex items-center space-x-2" },
        b.createElement(Ym, { id: `min_domain_${A.text}`, checked: A.enableMinDomain, onCheckedChange: A.setEnableMinDomain }),
        b.createElement(mw, { htmlFor: `min_domain_${A.text}` }, e("config.min_domain"))
      ),
      b.createElement(on, { value: A.domainMin, onChange: (t) => {
        const i = Number(t.target.value);
        isNaN(i) || A.setDomainMin(i);
      }, type: "number", disabled: !A.enableMinDomain })
    ),
    b.createElement(
      "div",
      { className: "flex flex-col space-y-2 items-start" },
      b.createElement(
        "div",
        { className: "flex items-center space-x-2" },
        b.createElement(Ym, { id: `max_domain_${A.text}`, checked: A.enableMaxDomain, onCheckedChange: A.setEnableMaxDomain }),
        b.createElement(mw, { htmlFor: `max_domain_${A.text}` }, e("config.max_domain"))
      ),
      b.createElement(on, { value: A.domainMax, onChange: (t) => {
        const i = Number(t.target.value);
        isNaN(i) || A.setDomainMax(i);
      }, type: "number", disabled: !A.enableMaxDomain })
    ),
    b.createElement(
      "div",
      { className: "flex flex-col items-start w-48 space-y-2" },
      b.createElement(
        "div",
        { className: "flex items-center space-x-2" },
        b.createElement(Ym, { id: `range_${A.text}`, checked: A.enableRange, onCheckedChange: A.setEnableRange }),
        b.createElement(mw, { htmlFor: `range_${A.text}` }, e("config.range"))
      ),
      b.createElement(
        "div",
        { className: "flex w-full flex-col space-y-2 pt-2" },
        b.createElement($V, { max: A.maxRange, min: A.minRange, value: [A.rangeMin, A.rangeMax], onValueChange: ([t, i]) => {
          A.setRangeMin(t), A.setRangeMax(i);
        }, step: A.maxRange < 2 ? 0.01 : 1 }),
        b.createElement(
          "div",
          { className: "relative w-full h-4" },
          b.createElement("div", { className: "text-xs absolute left-0 text-foreground inset-y-0" }, A.rangeMin),
          b.createElement("div", { className: "text-xs absolute right-0 text-foreground inset-y-0" }, A.rangeMax)
        )
      )
    )
  );
}
function zk(A) {
  return b.createElement("div", { className: "border p-4 m-4 rounded-lg" }, A.children);
}
function Tk(A) {
  return b.createElement("div", { className: "border-t mt-4 pt-4" }, A.children);
}
function _k(A) {
  return b.createElement("div", { className: "text-xs text-muted-foreground font-medium" }, A.children);
}
function qk(A) {
  return b.createElement("h2", { className: "text-xl text-foreground font-medium" }, A.children);
}
const Nnt = [
  { value: 720, name: "(UTC-12:00) Dateline Standard Time" },
  { value: 660, name: "(UTC-11:00) Niue Time, Samoa Standard Time" },
  { value: 600, name: "(UTC-10:00) Cook Is. Time, Hawaii Standard Time, Tahiti Time" },
  { value: 570, name: "(UTC-09:30) Marquesas Time" },
  { value: 540, name: "(UTC-09:00) Gambier Time, Hawaii Daylight Time" },
  { value: 480, name: "(UTC-08:00) Alaska Daylight Time, Pacific Standard Time, Pitcairn Standard Time" },
  { value: 420, name: "(UTC-07:00) Mountain Standard Time, Pacific Daylight Time" },
  { value: 360, name: "(UTC-06:00) Central Standard Time, Galapagos Time, Mountain Daylight Time" },
  { value: 300, name: "(UTC-05:00) Acre Time, Central Daylight Time, Colombia Time, Easter Is. Time, Eastern Standard Time, Ecuador Time, Peru Time" },
  { value: 270, name: "(UTC-04:30) Venezuela Time" },
  {
    value: 240,
    name: "(UTC-04:00) Amazon Time, Atlantic Standard Time, Bolivia Time, Cuba Daylight Time, Eastern Daylight Time, Guyana Time, Paraguay Time"
  },
  {
    value: 180,
    name: "(UTC-03:00) Argentine Time, Atlantic Daylight Time, Brasilia Time, Chile Time, Falkland Is. Time, French Guiana Time, Rothera Time, Suriname Time, Uruguay Time"
  },
  { value: 150, name: "(UTC-02:30) Newfoundland Daylight Time" },
  {
    value: 120,
    name: "(UTC-02:00) Fernando de Noronha Time, Pierre & Miquelon Daylight Time, South Georgia Standard Time, Western Greenland Summer Time"
  },
  { value: 60, name: "(UTC-01:00) Cape Verde Time" },
  { value: 0, name: "(UTC) Azores Summer Time, Coordinated Universal Time, Eastern Greenland Summer Time, Ghana Mean Time, Greenwich Mean Time" },
  { value: -60, name: "(UTC+01:00) British Summer Time, Central European Time, Irish Summer Time, Western African Time, Western European Summer Time" },
  {
    value: -120,
    name: "(UTC+02:00) Central African Time, Central European Summer Time, Eastern European Time, Middle Europe Summer Time, South Africa Standard Time"
  },
  {
    value: -180,
    name: "(UTC+03:00) Arabia Standard Time, Eastern African Time, Eastern European Summer Time, Israel Daylight Time, Moscow Standard Time, Syowa Time"
  },
  { value: -240, name: "(UTC+04:00) Armenia Time, Georgia Time, Gulf Standard Time, Mauritius Time, Reunion Time, Samara Time, Seychelles Time" },
  { value: -270, name: "(UTC+04:30) Afghanistan Time, Iran Daylight Time" },
  {
    value: -300,
    name: "(UTC+05:00) Aqtau Time, Aqtobe Time, Azerbaijan Summer Time, French Southern & Antarctic Lands Time, Maldives Time, Mawson Time, Oral Time, Pakistan Time, Tajikistan Time, Turkmenistan Time, Uzbekistan Time, Yekaterinburg Time"
  },
  { value: -330, name: "(UTC+05:30) India Standard Time" },
  { value: -345, name: "(UTC+05:45) Nepal Time" },
  {
    value: -360,
    name: "(UTC+06:00) Alma-Ata Time, Bangladesh Time, Bhutan Time, Indian Ocean Territory Time, Kirgizstan Time, Novosibirsk Time, Omsk Time, Qyzylorda Time, Vostok Time, Xinjiang Standard Time"
  },
  { value: -390, name: "(UTC+06:30) Cocos Islands Time, Myanmar Time" },
  { value: -420, name: "(UTC+07:00) Christmas Island Time, Davis Time, Indochina Time, Krasnoyarsk Time, West Indonesia Time" },
  {
    value: -480,
    name: "(UTC+08:00) Australian Western Standard Time, Brunei Time, Central Indonesia Time, China Standard Time, Hong Kong Time, Hovd Summer Time, Irkutsk Time, Malaysia Time, Philippines Time, Singapore Time"
  },
  { value: -525, name: "(UTC+08:45) Australian Central Western Standard Time" },
  {
    value: -540,
    name: "(UTC+09:00) Choibalsan Summer Time, East Indonesia Time, Japan Standard Time, Khandyga Time, Korea Standard Time, Palau Time, Timor-Leste Time, Ulaanbaatar Summer Time, Yakutsk Time"
  },
  {
    value: -570,
    name: "(UTC+09:30) Australian Central Standard Time (Northern Territory), Australian Central Standard Time (South Australia), Australian Central Standard Time (South Australia/New South Wales)"
  },
  {
    value: -600,
    name: "(UTC+10:00) Australian Eastern Standard Time (New South Wales), Australian Eastern Standard Time (Queensland), Australian Eastern Standard Time (Tasmania), Australian Eastern Standard Time (Victoria), Chamorro Standard Time, Chuuk Time, Dumont-d'Urville Time, Magadan Time, Papua New Guinea Time, Sakhalin Time, Ust-Nera Time, Vladivostok Time"
  },
  { value: -630, name: "(UTC+10:30) Lord Howe Standard Time" },
  {
    value: -660,
    name: "(UTC+11:00) Bougainville Standard Time, Kosrae Time, Macquarie Island Standard Time, New Caledonia Time, Pohnpei Time, Solomon Is. Time, Srednekolymsk Time, Vanuatu Time"
  },
  { value: -690, name: "(UTC+11:30) Norfolk Time" },
  {
    value: -720,
    name: "(UTC+12:00) Anadyr Time, Fiji Time, Gilbert Is. Time, Marshall Islands Time, Nauru Time, New Zealand Standard Time, Petropavlovsk-Kamchatski Time, Tuvalu Time, Wake Time, Wallis & Futuna Time"
  },
  { value: -765, name: "(UTC+12:45) Chatham Standard Time" },
  { value: -780, name: "(UTC+13:00) Phoenix Is. Time, Tokelau Time, Tonga Time, West Samoa Standard Time" },
  { value: -840, name: "(UTC+14:00) Line Is. Time" }
];
var RpA = 1, Ynt = 0.9, Rnt = 0.8, Fnt = 0.17, MT = 0.1, xT = 0.999, Mnt = 0.9999, xnt = 0.99, Lnt = /[\\\/_+.#"@\[\(\{&]/, vnt = /[\\\/_+.#"@\[\(\{&]/g, Hnt = /[\s-]/, ZXA = /[\s-]/g;
function VP(A, e, t, i, n, o, g) {
  if (o === e.length)
    return n === A.length ? RpA : xnt;
  var s = `${n},${o}`;
  if (g[s] !== void 0)
    return g[s];
  for (var I = i.charAt(o), r = t.indexOf(I, n), a = 0, C, B, l, Q; r >= 0; )
    C = VP(A, e, t, i, r + 1, o + 1, g), C > a && (r === n ? C *= RpA : Lnt.test(A.charAt(r - 1)) ? (C *= Rnt, l = A.slice(n, r - 1).match(vnt), l && n > 0 && (C *= Math.pow(xT, l.length))) : Hnt.test(A.charAt(r - 1)) ? (C *= Ynt, Q = A.slice(n, r - 1).match(ZXA), Q && n > 0 && (C *= Math.pow(xT, Q.length))) : (C *= Fnt, n > 0 && (C *= Math.pow(xT, r - n))), A.charAt(r) !== e.charAt(o) && (C *= Mnt)), (C < MT && t.charAt(r - 1) === i.charAt(o + 1) || i.charAt(o + 1) === i.charAt(o) && t.charAt(r - 1) !== i.charAt(o)) && (B = VP(A, e, t, i, r + 1, o + 2, g), B * MT > C && (C = B * MT)), C > a && (a = C), r = t.indexOf(I, r + 1);
  return g[s] = a, a;
}
function FpA(A) {
  return A.toLowerCase().replace(ZXA, " ");
}
function Snt(A, e) {
  return VP(A, e, FpA(A), FpA(e), 0, 0, {});
}
function pw(A, e, { checkForDefaultPrevented: t = !0 } = {}) {
  return function(i) {
    if (A == null || A(i), t === !1 || !i.defaultPrevented)
      return e == null ? void 0 : e(i);
  };
}
function Znt(A, e) {
  typeof A == "function" ? A(e) : A != null && (A.current = e);
}
function WXA(...A) {
  return (e) => A.forEach(
    (t) => Znt(t, e)
  );
}
function A1(...A) {
  return u.useCallback(WXA(...A), A);
}
function Wnt(A, e = []) {
  let t = [];
  function i(o, g) {
    const s = /* @__PURE__ */ u.createContext(g), I = t.length;
    t = [
      ...t,
      g
    ];
    function r(C) {
      const { scope: B, children: l, ...Q } = C, E = (B == null ? void 0 : B[A][I]) || s, d = u.useMemo(
        () => Q,
        Object.values(Q)
      );
      return /* @__PURE__ */ u.createElement(E.Provider, {
        value: d
      }, l);
    }
    function a(C, B) {
      const l = (B == null ? void 0 : B[A][I]) || s, Q = u.useContext(l);
      if (Q)
        return Q;
      if (g !== void 0)
        return g;
      throw new Error(`\`${C}\` must be used within \`${o}\``);
    }
    return r.displayName = o + "Provider", [
      r,
      a
    ];
  }
  const n = () => {
    const o = t.map((g) => /* @__PURE__ */ u.createContext(g));
    return function(g) {
      const s = (g == null ? void 0 : g[A]) || o;
      return u.useMemo(
        () => ({
          [`__scope${A}`]: {
            ...g,
            [A]: s
          }
        }),
        [
          g,
          s
        ]
      );
    };
  };
  return n.scopeName = A, [
    i,
    Knt(n, ...e)
  ];
}
function Knt(...A) {
  const e = A[0];
  if (A.length === 1)
    return e;
  const t = () => {
    const i = A.map(
      (n) => ({
        useScope: n(),
        scopeName: n.scopeName
      })
    );
    return function(n) {
      const o = i.reduce((g, { useScope: s, scopeName: I }) => {
        const r = s(n)[`__scope${I}`];
        return {
          ...g,
          ...r
        };
      }, {});
      return u.useMemo(
        () => ({
          [`__scope${e.scopeName}`]: o
        }),
        [
          o
        ]
      );
    };
  };
  return t.scopeName = e.scopeName, t;
}
const XP = globalThis != null && globalThis.document ? u.useLayoutEffect : () => {
}, Unt = y8["useId".toString()] || (() => {
});
let Vnt = 0;
function LT(A) {
  const [e, t] = u.useState(Unt());
  return XP(() => {
    A || t(
      (i) => i ?? String(Vnt++)
    );
  }, [
    A
  ]), A || (e ? `radix-${e}` : "");
}
function Mp(A) {
  const e = u.useRef(A);
  return u.useEffect(() => {
    e.current = A;
  }), u.useMemo(
    () => (...t) => {
      var i;
      return (i = e.current) === null || i === void 0 ? void 0 : i.call(e, ...t);
    },
    []
  );
}
function Xnt({ prop: A, defaultProp: e, onChange: t = () => {
} }) {
  const [i, n] = znt({
    defaultProp: e,
    onChange: t
  }), o = A !== void 0, g = o ? A : i, s = Mp(t), I = u.useCallback((r) => {
    if (o) {
      const a = typeof r == "function" ? r(A) : r;
      a !== A && s(a);
    } else
      n(r);
  }, [
    o,
    A,
    n,
    s
  ]);
  return [
    g,
    I
  ];
}
function znt({ defaultProp: A, onChange: e }) {
  const t = u.useState(A), [i] = t, n = u.useRef(i), o = Mp(e);
  return u.useEffect(() => {
    n.current !== i && (o(i), n.current = i);
  }, [
    i,
    n,
    o
  ]), t;
}
const RgA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { children: t, ...i } = A, n = u.Children.toArray(t), o = n.find(_nt);
  if (o) {
    const g = o.props.children, s = n.map((I) => I === o ? u.Children.count(g) > 1 ? u.Children.only(null) : /* @__PURE__ */ u.isValidElement(g) ? g.props.children : null : I);
    return /* @__PURE__ */ u.createElement(zP, NA({}, i, {
      ref: e
    }), /* @__PURE__ */ u.isValidElement(g) ? /* @__PURE__ */ u.cloneElement(g, void 0, s) : null);
  }
  return /* @__PURE__ */ u.createElement(zP, NA({}, i, {
    ref: e
  }), t);
});
RgA.displayName = "Slot";
const zP = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { children: t, ...i } = A;
  return /* @__PURE__ */ u.isValidElement(t) ? /* @__PURE__ */ u.cloneElement(t, {
    ...qnt(i, t.props),
    ref: WXA(e, t.ref)
  }) : u.Children.count(t) > 1 ? u.Children.only(null) : null;
});
zP.displayName = "SlotClone";
const Tnt = ({ children: A }) => /* @__PURE__ */ u.createElement(u.Fragment, null, A);
function _nt(A) {
  return /* @__PURE__ */ u.isValidElement(A) && A.type === Tnt;
}
function qnt(A, e) {
  const t = {
    ...e
  };
  for (const i in e) {
    const n = A[i], o = e[i];
    /^on[A-Z]/.test(i) ? t[i] = (...g) => {
      o == null || o(...g), n == null || n(...g);
    } : i === "style" ? t[i] = {
      ...n,
      ...o
    } : i === "className" && (t[i] = [
      n,
      o
    ].filter(Boolean).join(" "));
  }
  return {
    ...A,
    ...t
  };
}
const Ont = [
  "a",
  "button",
  "div",
  "h2",
  "h3",
  "img",
  "li",
  "nav",
  "ol",
  "p",
  "span",
  "svg",
  "ul"
], IX = Ont.reduce((A, e) => {
  const t = /* @__PURE__ */ u.forwardRef((i, n) => {
    const { asChild: o, ...g } = i, s = o ? RgA : e;
    return u.useEffect(() => {
      window[Symbol.for("radix-ui")] = !0;
    }, []), /* @__PURE__ */ u.createElement(s, NA({}, g, {
      ref: n
    }));
  });
  return t.displayName = `Primitive.${e}`, {
    ...A,
    [e]: t
  };
}, {});
function jnt(A, e) {
  A && Jt.flushSync(
    () => A.dispatchEvent(e)
  );
}
function Pnt(A) {
  const e = Mp(A);
  u.useEffect(() => {
    const t = (i) => {
      i.key === "Escape" && e(i);
    };
    return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
  }, [
    e
  ]);
}
const TP = "dismissableLayer.update", $nt = "dismissableLayer.pointerDownOutside", Aot = "dismissableLayer.focusOutside";
let MpA;
const eot = /* @__PURE__ */ u.createContext({
  layers: /* @__PURE__ */ new Set(),
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
  branches: /* @__PURE__ */ new Set()
}), tot = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { disableOutsidePointerEvents: t = !1, onEscapeKeyDown: i, onPointerDownOutside: n, onFocusOutside: o, onInteractOutside: g, onDismiss: s, ...I } = A, r = u.useContext(eot), [a, C] = u.useState(null), [, B] = u.useState({}), l = A1(
    e,
    (R) => C(R)
  ), Q = Array.from(r.layers), [E] = [
    ...r.layersWithOutsidePointerEventsDisabled
  ].slice(-1), d = Q.indexOf(E), m = a ? Q.indexOf(a) : -1, y = r.layersWithOutsidePointerEventsDisabled.size > 0, f = m >= d, w = iot((R) => {
    const F = R.target, Z = [
      ...r.branches
    ].some(
      (c) => c.contains(F)
    );
    !f || Z || (n == null || n(R), g == null || g(R), R.defaultPrevented || s == null || s());
  }), G = not((R) => {
    const F = R.target;
    [
      ...r.branches
    ].some(
      (Z) => Z.contains(F)
    ) || (o == null || o(R), g == null || g(R), R.defaultPrevented || s == null || s());
  });
  return Pnt((R) => {
    m === r.layers.size - 1 && (i == null || i(R), !R.defaultPrevented && s && (R.preventDefault(), s()));
  }), u.useEffect(() => {
    if (a)
      return t && (r.layersWithOutsidePointerEventsDisabled.size === 0 && (MpA = document.body.style.pointerEvents, document.body.style.pointerEvents = "none"), r.layersWithOutsidePointerEventsDisabled.add(a)), r.layers.add(a), xpA(), () => {
        t && r.layersWithOutsidePointerEventsDisabled.size === 1 && (document.body.style.pointerEvents = MpA);
      };
  }, [
    a,
    t,
    r
  ]), u.useEffect(() => () => {
    a && (r.layers.delete(a), r.layersWithOutsidePointerEventsDisabled.delete(a), xpA());
  }, [
    a,
    r
  ]), u.useEffect(() => {
    const R = () => B({});
    return document.addEventListener(TP, R), () => document.removeEventListener(TP, R);
  }, []), /* @__PURE__ */ u.createElement(IX.div, NA({}, I, {
    ref: l,
    style: {
      pointerEvents: y ? f ? "auto" : "none" : void 0,
      ...A.style
    },
    onFocusCapture: pw(A.onFocusCapture, G.onFocusCapture),
    onBlurCapture: pw(A.onBlurCapture, G.onBlurCapture),
    onPointerDownCapture: pw(A.onPointerDownCapture, w.onPointerDownCapture)
  }));
});
function iot(A) {
  const e = Mp(A), t = u.useRef(!1), i = u.useRef(() => {
  });
  return u.useEffect(() => {
    const n = (g) => {
      if (g.target && !t.current) {
        let s = function() {
          KXA($nt, e, I, {
            discrete: !0
          });
        };
        const I = {
          originalEvent: g
        };
        g.pointerType === "touch" ? (document.removeEventListener("click", i.current), i.current = s, document.addEventListener("click", i.current, {
          once: !0
        })) : s();
      }
      t.current = !1;
    }, o = window.setTimeout(() => {
      document.addEventListener("pointerdown", n);
    }, 0);
    return () => {
      window.clearTimeout(o), document.removeEventListener("pointerdown", n), document.removeEventListener("click", i.current);
    };
  }, [
    e
  ]), {
    // ensures we check React component tree (not just DOM tree)
    onPointerDownCapture: () => t.current = !0
  };
}
function not(A) {
  const e = Mp(A), t = u.useRef(!1);
  return u.useEffect(() => {
    const i = (n) => {
      n.target && !t.current && KXA(Aot, e, {
        originalEvent: n
      }, {
        discrete: !1
      });
    };
    return document.addEventListener("focusin", i), () => document.removeEventListener("focusin", i);
  }, [
    e
  ]), {
    onFocusCapture: () => t.current = !0,
    onBlurCapture: () => t.current = !1
  };
}
function xpA() {
  const A = new CustomEvent(TP);
  document.dispatchEvent(A);
}
function KXA(A, e, t, { discrete: i }) {
  const n = t.originalEvent.target, o = new CustomEvent(A, {
    bubbles: !1,
    cancelable: !0,
    detail: t
  });
  e && n.addEventListener(A, e, {
    once: !0
  }), i ? jnt(n, o) : n.dispatchEvent(o);
}
const vT = "focusScope.autoFocusOnMount", HT = "focusScope.autoFocusOnUnmount", LpA = {
  bubbles: !1,
  cancelable: !0
}, oot = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { loop: t = !1, trapped: i = !1, onMountAutoFocus: n, onUnmountAutoFocus: o, ...g } = A, [s, I] = u.useState(null), r = Mp(n), a = Mp(o), C = u.useRef(null), B = A1(
    e,
    (E) => I(E)
  ), l = u.useRef({
    paused: !1,
    pause() {
      this.paused = !0;
    },
    resume() {
      this.paused = !1;
    }
  }).current;
  u.useEffect(() => {
    if (i) {
      let E = function(m) {
        if (l.paused || !s)
          return;
        const y = m.target;
        s.contains(y) ? C.current = y : _h(C.current, {
          select: !0
        });
      }, d = function(m) {
        l.paused || !s || s.contains(m.relatedTarget) || _h(C.current, {
          select: !0
        });
      };
      return document.addEventListener("focusin", E), document.addEventListener("focusout", d), () => {
        document.removeEventListener("focusin", E), document.removeEventListener("focusout", d);
      };
    }
  }, [
    i,
    s,
    l.paused
  ]), u.useEffect(() => {
    if (s) {
      HpA.add(l);
      const E = document.activeElement;
      if (!s.contains(E)) {
        const d = new CustomEvent(vT, LpA);
        s.addEventListener(vT, r), s.dispatchEvent(d), d.defaultPrevented || (got(Cot(UXA(s)), {
          select: !0
        }), document.activeElement === E && _h(s));
      }
      return () => {
        s.removeEventListener(vT, r), setTimeout(() => {
          const d = new CustomEvent(HT, LpA);
          s.addEventListener(HT, a), s.dispatchEvent(d), d.defaultPrevented || _h(E ?? document.body, {
            select: !0
          }), s.removeEventListener(HT, a), HpA.remove(l);
        }, 0);
      };
    }
  }, [
    s,
    r,
    a,
    l
  ]);
  const Q = u.useCallback((E) => {
    if (!t && !i || l.paused)
      return;
    const d = E.key === "Tab" && !E.altKey && !E.ctrlKey && !E.metaKey, m = document.activeElement;
    if (d && m) {
      const y = E.currentTarget, [f, w] = sot(y);
      f && w ? !E.shiftKey && m === w ? (E.preventDefault(), t && _h(f, {
        select: !0
      })) : E.shiftKey && m === f && (E.preventDefault(), t && _h(w, {
        select: !0
      })) : m === y && E.preventDefault();
    }
  }, [
    t,
    i,
    l.paused
  ]);
  return /* @__PURE__ */ u.createElement(IX.div, NA({
    tabIndex: -1
  }, g, {
    ref: B,
    onKeyDown: Q
  }));
});
function got(A, { select: e = !1 } = {}) {
  const t = document.activeElement;
  for (const i of A)
    if (_h(i, {
      select: e
    }), document.activeElement !== t)
      return;
}
function sot(A) {
  const e = UXA(A), t = vpA(e, A), i = vpA(e.reverse(), A);
  return [
    t,
    i
  ];
}
function UXA(A) {
  const e = [], t = document.createTreeWalker(A, NodeFilter.SHOW_ELEMENT, {
    acceptNode: (i) => {
      const n = i.tagName === "INPUT" && i.type === "hidden";
      return i.disabled || i.hidden || n ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
    }
  });
  for (; t.nextNode(); )
    e.push(t.currentNode);
  return e;
}
function vpA(A, e) {
  for (const t of A)
    if (!Iot(t, {
      upTo: e
    }))
      return t;
}
function Iot(A, { upTo: e }) {
  if (getComputedStyle(A).visibility === "hidden")
    return !0;
  for (; A; ) {
    if (e !== void 0 && A === e)
      return !1;
    if (getComputedStyle(A).display === "none")
      return !0;
    A = A.parentElement;
  }
  return !1;
}
function aot(A) {
  return A instanceof HTMLInputElement && "select" in A;
}
function _h(A, { select: e = !1 } = {}) {
  if (A && A.focus) {
    const t = document.activeElement;
    A.focus({
      preventScroll: !0
    }), A !== t && aot(A) && e && A.select();
  }
}
const HpA = rot();
function rot() {
  let A = [];
  return {
    add(e) {
      const t = A[0];
      e !== t && (t == null || t.pause()), A = SpA(A, e), A.unshift(e);
    },
    remove(e) {
      var t;
      A = SpA(A, e), (t = A[0]) === null || t === void 0 || t.resume();
    }
  };
}
function SpA(A, e) {
  const t = [
    ...A
  ], i = t.indexOf(e);
  return i !== -1 && t.splice(i, 1), t;
}
function Cot(A) {
  return A.filter(
    (e) => e.tagName !== "A"
  );
}
const Bot = /* @__PURE__ */ u.forwardRef((A, e) => {
  var t;
  const { container: i = globalThis == null || (t = globalThis.document) === null || t === void 0 ? void 0 : t.body, ...n } = A;
  return i ? /* @__PURE__ */ kd.createPortal(/* @__PURE__ */ u.createElement(IX.div, NA({}, n, {
    ref: e
  })), i) : null;
});
function lot(A, e) {
  return u.useReducer((t, i) => e[t][i] ?? t, A);
}
const aX = (A) => {
  const { present: e, children: t } = A, i = cot(e), n = typeof t == "function" ? t({
    present: i.isPresent
  }) : u.Children.only(t), o = A1(i.ref, n.ref);
  return typeof t == "function" || i.isPresent ? /* @__PURE__ */ u.cloneElement(n, {
    ref: o
  }) : null;
};
aX.displayName = "Presence";
function cot(A) {
  const [e, t] = u.useState(), i = u.useRef({}), n = u.useRef(A), o = u.useRef("none"), g = A ? "mounted" : "unmounted", [s, I] = lot(g, {
    mounted: {
      UNMOUNT: "unmounted",
      ANIMATION_OUT: "unmountSuspended"
    },
    unmountSuspended: {
      MOUNT: "mounted",
      ANIMATION_END: "unmounted"
    },
    unmounted: {
      MOUNT: "mounted"
    }
  });
  return u.useEffect(() => {
    const r = Mx(i.current);
    o.current = s === "mounted" ? r : "none";
  }, [
    s
  ]), XP(() => {
    const r = i.current, a = n.current;
    if (a !== A) {
      const C = o.current, B = Mx(r);
      A ? I("MOUNT") : B === "none" || (r == null ? void 0 : r.display) === "none" ? I("UNMOUNT") : I(a && C !== B ? "ANIMATION_OUT" : "UNMOUNT"), n.current = A;
    }
  }, [
    A,
    I
  ]), XP(() => {
    if (e) {
      const r = (C) => {
        const B = Mx(i.current).includes(C.animationName);
        C.target === e && B && Jt.flushSync(
          () => I("ANIMATION_END")
        );
      }, a = (C) => {
        C.target === e && (o.current = Mx(i.current));
      };
      return e.addEventListener("animationstart", a), e.addEventListener("animationcancel", r), e.addEventListener("animationend", r), () => {
        e.removeEventListener("animationstart", a), e.removeEventListener("animationcancel", r), e.removeEventListener("animationend", r);
      };
    } else
      I("ANIMATION_END");
  }, [
    e,
    I
  ]), {
    isPresent: [
      "mounted",
      "unmountSuspended"
    ].includes(s),
    ref: u.useCallback((r) => {
      r && (i.current = getComputedStyle(r)), t(r);
    }, [])
  };
}
function Mx(A) {
  return (A == null ? void 0 : A.animationName) || "none";
}
let ST = 0;
function Qot() {
  u.useEffect(() => {
    var A, e;
    const t = document.querySelectorAll("[data-radix-focus-guard]");
    return document.body.insertAdjacentElement("afterbegin", (A = t[0]) !== null && A !== void 0 ? A : ZpA()), document.body.insertAdjacentElement("beforeend", (e = t[1]) !== null && e !== void 0 ? e : ZpA()), ST++, () => {
      ST === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach(
        (i) => i.remove()
      ), ST--;
    };
  }, []);
}
function ZpA() {
  const A = document.createElement("span");
  return A.setAttribute("data-radix-focus-guard", ""), A.tabIndex = 0, A.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", A;
}
var VE = function() {
  return VE = Object.assign || function(A) {
    for (var e, t = 1, i = arguments.length; t < i; t++) {
      e = arguments[t];
      for (var n in e)
        Object.prototype.hasOwnProperty.call(e, n) && (A[n] = e[n]);
    }
    return A;
  }, VE.apply(this, arguments);
};
function Eot(A, e) {
  var t = {};
  for (var i in A)
    Object.prototype.hasOwnProperty.call(A, i) && e.indexOf(i) < 0 && (t[i] = A[i]);
  if (A != null && typeof Object.getOwnPropertySymbols == "function")
    for (var n = 0, i = Object.getOwnPropertySymbols(A); n < i.length; n++)
      e.indexOf(i[n]) < 0 && Object.prototype.propertyIsEnumerable.call(A, i[n]) && (t[i[n]] = A[i[n]]);
  return t;
}
function uot(A, e, t) {
  if (t || arguments.length === 2)
    for (var i = 0, n = e.length, o; i < n; i++)
      (o || !(i in e)) && (o || (o = Array.prototype.slice.call(e, 0, i)), o[i] = e[i]);
  return A.concat(o || Array.prototype.slice.call(e));
}
var VXA = X2A(), ZT = function() {
}, rX = u.forwardRef(function(A, e) {
  var t = u.useRef(null), i = u.useState({
    onScrollCapture: ZT,
    onWheelCapture: ZT,
    onTouchMoveCapture: ZT
  }), n = i[0], o = i[1], g = A.forwardProps, s = A.children, I = A.className, r = A.removeScrollBar, a = A.enabled, C = A.shards, B = A.sideCar, l = A.noIsolation, Q = A.inert, E = A.allowPinchZoom, d = A.as, m = d === void 0 ? "div" : d, y = Eot(A, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), f = B, w = V2A([t, e]), G = VE(VE({}, y), n);
  return u.createElement(
    u.Fragment,
    null,
    a && u.createElement(f, { sideCar: VXA, removeScrollBar: r, shards: C, noIsolation: l, inert: Q, setCallbacks: o, allowPinchZoom: !!E, lockRef: t }),
    g ? u.cloneElement(u.Children.only(s), VE(VE({}, G), { ref: w })) : u.createElement(m, VE({}, G, { className: I, ref: w }), s)
  );
});
rX.defaultProps = {
  enabled: !0,
  removeScrollBar: !0,
  inert: !1
};
rX.classNames = {
  fullWidth: EN,
  zeroRight: QN
};
var _P = !1;
if (typeof window < "u")
  try {
    var xx = Object.defineProperty({}, "passive", {
      get: function() {
        return _P = !0, !0;
      }
    });
    window.addEventListener("test", xx, xx), window.removeEventListener("test", xx, xx);
  } catch {
    _P = !1;
  }
var Gy = _P ? { passive: !1 } : !1, hot = function(A) {
  var e = window.getComputedStyle(A);
  return e.overflowY !== "hidden" && // not-not-scrollable
  !(e.overflowY === e.overflowX && e.overflowY === "visible");
}, mot = function(A) {
  var e = window.getComputedStyle(A);
  return e.overflowX !== "hidden" && // not-not-scrollable
  !(e.overflowY === e.overflowX && e.overflowX === "visible");
}, WpA = function(A, e) {
  var t = e;
  do {
    typeof ShadowRoot < "u" && t instanceof ShadowRoot && (t = t.host);
    var i = XXA(A, t);
    if (i) {
      var n = zXA(A, t), o = n[1], g = n[2];
      if (o > g)
        return !0;
    }
    t = t.parentNode;
  } while (t && t !== document.body);
  return !1;
}, pot = function(A) {
  var e = A.scrollTop, t = A.scrollHeight, i = A.clientHeight;
  return [
    e,
    t,
    i
  ];
}, yot = function(A) {
  var e = A.scrollLeft, t = A.scrollWidth, i = A.clientWidth;
  return [
    e,
    t,
    i
  ];
}, XXA = function(A, e) {
  return A === "v" ? hot(e) : mot(e);
}, zXA = function(A, e) {
  return A === "v" ? pot(e) : yot(e);
}, bot = function(A, e) {
  return A === "h" && e === "rtl" ? -1 : 1;
}, wot = function(A, e, t, i, n) {
  var o = bot(A, window.getComputedStyle(e).direction), g = o * i, s = t.target, I = e.contains(s), r = !1, a = g > 0, C = 0, B = 0;
  do {
    var l = zXA(A, s), Q = l[0], E = l[1], d = l[2], m = E - d - o * Q;
    (Q || m) && XXA(A, s) && (C += m, B += Q), s = s.parentNode;
  } while (
    // portaled content
    !I && s !== document.body || // self content
    I && (e.contains(s) || e === s)
  );
  return (a && (n && C === 0 || !n && g > C) || !a && (n && B === 0 || !n && -g > B)) && (r = !0), r;
}, Lx = function(A) {
  return "changedTouches" in A ? [A.changedTouches[0].clientX, A.changedTouches[0].clientY] : [0, 0];
}, KpA = function(A) {
  return [A.deltaX, A.deltaY];
}, UpA = function(A) {
  return A && "current" in A ? A.current : A;
}, fot = function(A, e) {
  return A[0] === e[0] && A[1] === e[1];
}, Dot = function(A) {
  return `
  .block-interactivity-`.concat(A, ` {pointer-events: none;}
  .allow-interactivity-`).concat(A, ` {pointer-events: all;}
`);
}, Got = 0, ky = [];
function kot(A) {
  var e = u.useRef([]), t = u.useRef([0, 0]), i = u.useRef(), n = u.useState(Got++)[0], o = u.useState(function() {
    return U7();
  })[0], g = u.useRef(A);
  u.useEffect(function() {
    g.current = A;
  }, [A]), u.useEffect(function() {
    if (A.inert) {
      document.body.classList.add("block-interactivity-".concat(n));
      var E = uot([A.lockRef.current], (A.shards || []).map(UpA), !0).filter(Boolean);
      return E.forEach(function(d) {
        return d.classList.add("allow-interactivity-".concat(n));
      }), function() {
        document.body.classList.remove("block-interactivity-".concat(n)), E.forEach(function(d) {
          return d.classList.remove("allow-interactivity-".concat(n));
        });
      };
    }
  }, [A.inert, A.lockRef.current, A.shards]);
  var s = u.useCallback(function(E, d) {
    if ("touches" in E && E.touches.length === 2)
      return !g.current.allowPinchZoom;
    var m = Lx(E), y = t.current, f = "deltaX" in E ? E.deltaX : y[0] - m[0], w = "deltaY" in E ? E.deltaY : y[1] - m[1], G, R = E.target, F = Math.abs(f) > Math.abs(w) ? "h" : "v";
    if ("touches" in E && F === "h" && R.type === "range")
      return !1;
    var Z = WpA(F, R);
    if (!Z)
      return !0;
    if (Z ? G = F : (G = F === "v" ? "h" : "v", Z = WpA(F, R)), !Z)
      return !1;
    if (!i.current && "changedTouches" in E && (f || w) && (i.current = G), !G)
      return !0;
    var c = i.current || G;
    return wot(c, d, E, c === "h" ? f : w, !0);
  }, []), I = u.useCallback(function(E) {
    var d = E;
    if (!(!ky.length || ky[ky.length - 1] !== o)) {
      var m = "deltaY" in d ? KpA(d) : Lx(d), y = e.current.filter(function(G) {
        return G.name === d.type && G.target === d.target && fot(G.delta, m);
      })[0];
      if (y && y.should) {
        d.preventDefault();
        return;
      }
      if (!y) {
        var f = (g.current.shards || []).map(UpA).filter(Boolean).filter(function(G) {
          return G.contains(d.target);
        }), w = f.length > 0 ? s(d, f[0]) : !g.current.noIsolation;
        w && d.preventDefault();
      }
    }
  }, []), r = u.useCallback(function(E, d, m, y) {
    var f = { name: E, delta: d, target: m, should: y };
    e.current.push(f), setTimeout(function() {
      e.current = e.current.filter(function(w) {
        return w !== f;
      });
    }, 1);
  }, []), a = u.useCallback(function(E) {
    t.current = Lx(E), i.current = void 0;
  }, []), C = u.useCallback(function(E) {
    r(E.type, KpA(E), E.target, s(E, A.lockRef.current));
  }, []), B = u.useCallback(function(E) {
    r(E.type, Lx(E), E.target, s(E, A.lockRef.current));
  }, []);
  u.useEffect(function() {
    return ky.push(o), A.setCallbacks({
      onScrollCapture: C,
      onWheelCapture: C,
      onTouchMoveCapture: B
    }), document.addEventListener("wheel", I, Gy), document.addEventListener("touchmove", I, Gy), document.addEventListener("touchstart", a, Gy), function() {
      ky = ky.filter(function(E) {
        return E !== o;
      }), document.removeEventListener("wheel", I, Gy), document.removeEventListener("touchmove", I, Gy), document.removeEventListener("touchstart", a, Gy);
    };
  }, []);
  var l = A.removeScrollBar, Q = A.inert;
  return u.createElement(
    u.Fragment,
    null,
    Q ? u.createElement(o, { styles: Dot(n) }) : null,
    l ? u.createElement(q2A, { gapMode: "margin" }) : null
  );
}
const Jot = T2A(VXA, kot);
var TXA = u.forwardRef(function(A, e) {
  return u.createElement(rX, VE({}, A, { ref: e, sideCar: Jot }));
});
TXA.classNames = rX.classNames;
const Not = TXA, _XA = "Dialog", [qXA, UXt] = Wnt(_XA), [Yot, w0] = qXA(_XA), Rot = (A) => {
  const { __scopeDialog: e, children: t, open: i, defaultOpen: n, onOpenChange: o, modal: g = !0 } = A, s = u.useRef(null), I = u.useRef(null), [r = !1, a] = Xnt({
    prop: i,
    defaultProp: n,
    onChange: o
  });
  return /* @__PURE__ */ u.createElement(Yot, {
    scope: e,
    triggerRef: s,
    contentRef: I,
    contentId: LT(),
    titleId: LT(),
    descriptionId: LT(),
    open: r,
    onOpenChange: a,
    onOpenToggle: u.useCallback(
      () => a(
        (C) => !C
      ),
      [
        a
      ]
    ),
    modal: g
  }, t);
}, OXA = "DialogPortal", [Fot, jXA] = qXA(OXA, {
  forceMount: void 0
}), Mot = (A) => {
  const { __scopeDialog: e, forceMount: t, children: i, container: n } = A, o = w0(OXA, e);
  return /* @__PURE__ */ u.createElement(Fot, {
    scope: e,
    forceMount: t
  }, u.Children.map(
    i,
    (g) => /* @__PURE__ */ u.createElement(aX, {
      present: t || o.open
    }, /* @__PURE__ */ u.createElement(Bot, {
      asChild: !0,
      container: n
    }, g))
  ));
}, qP = "DialogOverlay", xot = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = jXA(qP, A.__scopeDialog), { forceMount: i = t.forceMount, ...n } = A, o = w0(qP, A.__scopeDialog);
  return o.modal ? /* @__PURE__ */ u.createElement(aX, {
    present: i || o.open
  }, /* @__PURE__ */ u.createElement(Lot, NA({}, n, {
    ref: e
  }))) : null;
}), Lot = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, ...i } = A, n = w0(qP, t);
  return (
    // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
    // ie. when `Overlay` and `Content` are siblings
    /* @__PURE__ */ u.createElement(Not, {
      as: RgA,
      allowPinchZoom: !0,
      shards: [
        n.contentRef
      ]
    }, /* @__PURE__ */ u.createElement(IX.div, NA({
      "data-state": $XA(n.open)
    }, i, {
      ref: e,
      style: {
        pointerEvents: "auto",
        ...i.style
      }
    })))
  );
}), J2 = "DialogContent", vot = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = jXA(J2, A.__scopeDialog), { forceMount: i = t.forceMount, ...n } = A, o = w0(J2, A.__scopeDialog);
  return /* @__PURE__ */ u.createElement(aX, {
    present: i || o.open
  }, o.modal ? /* @__PURE__ */ u.createElement(Hot, NA({}, n, {
    ref: e
  })) : /* @__PURE__ */ u.createElement(Sot, NA({}, n, {
    ref: e
  })));
}), Hot = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = w0(J2, A.__scopeDialog), i = u.useRef(null), n = A1(e, t.contentRef, i);
  return u.useEffect(() => {
    const o = i.current;
    if (o)
      return VR(o);
  }, []), /* @__PURE__ */ u.createElement(PXA, NA({}, A, {
    ref: n,
    trapFocus: t.open,
    disableOutsidePointerEvents: !0,
    onCloseAutoFocus: pw(A.onCloseAutoFocus, (o) => {
      var g;
      o.preventDefault(), (g = t.triggerRef.current) === null || g === void 0 || g.focus();
    }),
    onPointerDownOutside: pw(A.onPointerDownOutside, (o) => {
      const g = o.detail.originalEvent, s = g.button === 0 && g.ctrlKey === !0;
      (g.button === 2 || s) && o.preventDefault();
    }),
    onFocusOutside: pw(
      A.onFocusOutside,
      (o) => o.preventDefault()
    )
  }));
}), Sot = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = w0(J2, A.__scopeDialog), i = u.useRef(!1);
  return /* @__PURE__ */ u.createElement(PXA, NA({}, A, {
    ref: e,
    trapFocus: !1,
    disableOutsidePointerEvents: !1,
    onCloseAutoFocus: (n) => {
      var o;
      if ((o = A.onCloseAutoFocus) === null || o === void 0 || o.call(A, n), !n.defaultPrevented) {
        var g;
        i.current || (g = t.triggerRef.current) === null || g === void 0 || g.focus(), n.preventDefault();
      }
      i.current = !1;
    },
    onInteractOutside: (n) => {
      var o, g;
      (o = A.onInteractOutside) === null || o === void 0 || o.call(A, n), n.defaultPrevented || (i.current = !0);
      const s = n.target;
      !((g = t.triggerRef.current) === null || g === void 0) && g.contains(s) && n.preventDefault();
    }
  }));
}), PXA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, trapFocus: i, onOpenAutoFocus: n, onCloseAutoFocus: o, ...g } = A, s = w0(J2, t), I = u.useRef(null), r = A1(e, I);
  return Qot(), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(oot, {
    asChild: !0,
    loop: !0,
    trapped: i,
    onMountAutoFocus: n,
    onUnmountAutoFocus: o
  }, /* @__PURE__ */ u.createElement(tot, NA({
    role: "dialog",
    id: s.contentId,
    "aria-describedby": s.descriptionId,
    "aria-labelledby": s.titleId,
    "data-state": $XA(s.open)
  }, g, {
    ref: r,
    onDismiss: () => s.onOpenChange(!1)
  }))), !1);
});
function $XA(A) {
  return A ? "open" : "closed";
}
const Zot = Rot, Wot = Mot, Kot = xot, Uot = vot;
var Vot = '[cmdk-list-sizer=""]', Ok = '[cmdk-group=""]', WT = '[cmdk-group-items=""]', Xot = '[cmdk-group-heading=""]', FgA = '[cmdk-item=""]', VpA = `${FgA}:not([aria-disabled="true"])`, OP = "cmdk-item-select", lc = "data-value", zot = (A, e) => Snt(A, e), A9A = u.createContext(void 0), e1 = () => u.useContext(A9A), e9A = u.createContext(void 0), MgA = () => u.useContext(e9A), t9A = u.createContext(void 0), i9A = u.forwardRef((A, e) => {
  let t = u.useRef(null), i = _y(() => {
    var _, tA, nA;
    return { search: "", value: (nA = (tA = A.value) != null ? tA : (_ = A.defaultValue) == null ? void 0 : _.toLowerCase()) != null ? nA : "", filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
  }), n = _y(() => /* @__PURE__ */ new Set()), o = _y(() => /* @__PURE__ */ new Map()), g = _y(() => /* @__PURE__ */ new Map()), s = _y(() => /* @__PURE__ */ new Set()), I = n9A(A), { label: r, children: a, value: C, onValueChange: B, filter: l, shouldFilter: Q, vimBindings: E = !0, ...d } = A, m = u.useId(), y = u.useId(), f = u.useId(), w = igt();
  cG(() => {
    if (C !== void 0) {
      let _ = C.trim().toLowerCase();
      i.current.value = _, w(6, p), G.emit();
    }
  }, [C]);
  let G = u.useMemo(() => ({ subscribe: (_) => (s.current.add(_), () => s.current.delete(_)), snapshot: () => i.current, setState: (_, tA, nA) => {
    var AA, gA, rA;
    if (!Object.is(i.current[_], tA)) {
      if (i.current[_] = tA, _ === "search")
        J(), Z(), w(1, c);
      else if (_ === "value")
        if (((AA = I.current) == null ? void 0 : AA.value) !== void 0) {
          let sA = tA ?? "";
          (rA = (gA = I.current).onValueChange) == null || rA.call(gA, sA);
          return;
        } else
          nA || w(5, p);
      G.emit();
    }
  }, emit: () => {
    s.current.forEach((_) => _());
  } }), []), R = u.useMemo(() => ({ value: (_, tA) => {
    tA !== g.current.get(_) && (g.current.set(_, tA), i.current.filtered.items.set(_, F(tA)), w(2, () => {
      Z(), G.emit();
    }));
  }, item: (_, tA) => (n.current.add(_), tA && (o.current.has(tA) ? o.current.get(tA).add(_) : o.current.set(tA, /* @__PURE__ */ new Set([_]))), w(3, () => {
    J(), Z(), i.current.value || c(), G.emit();
  }), () => {
    g.current.delete(_), n.current.delete(_), i.current.filtered.items.delete(_);
    let nA = N();
    w(4, () => {
      J(), (nA == null ? void 0 : nA.getAttribute("id")) === _ && c(), G.emit();
    });
  }), group: (_) => (o.current.has(_) || o.current.set(_, /* @__PURE__ */ new Set()), () => {
    g.current.delete(_), o.current.delete(_);
  }), filter: () => I.current.shouldFilter, label: r || A["aria-label"], commandRef: t, listId: m, inputId: f, labelId: y }), []);
  function F(_) {
    var tA, nA;
    let AA = (nA = (tA = I.current) == null ? void 0 : tA.filter) != null ? nA : zot;
    return _ ? AA(_, i.current.search) : 0;
  }
  function Z() {
    if (!t.current || !i.current.search || I.current.shouldFilter === !1)
      return;
    let _ = i.current.filtered.items, tA = [];
    i.current.filtered.groups.forEach((AA) => {
      let gA = o.current.get(AA), rA = 0;
      gA.forEach((sA) => {
        let lA = _.get(sA);
        rA = Math.max(lA, rA);
      }), tA.push([AA, rA]);
    });
    let nA = t.current.querySelector(Vot);
    v().sort((AA, gA) => {
      var rA, sA;
      let lA = AA.getAttribute(lc), cA = gA.getAttribute(lc);
      return ((rA = _.get(cA)) != null ? rA : 0) - ((sA = _.get(lA)) != null ? sA : 0);
    }).forEach((AA) => {
      let gA = AA.closest(WT);
      gA ? gA.appendChild(AA.parentElement === gA ? AA : AA.closest(`${WT} > *`)) : nA.appendChild(AA.parentElement === nA ? AA : AA.closest(`${WT} > *`));
    }), tA.sort((AA, gA) => gA[1] - AA[1]).forEach((AA) => {
      let gA = t.current.querySelector(`${Ok}[${lc}="${AA[0]}"]`);
      gA == null || gA.parentElement.appendChild(gA);
    });
  }
  function c() {
    let _ = v().find((nA) => !nA.ariaDisabled), tA = _ == null ? void 0 : _.getAttribute(lc);
    G.setState("value", tA || void 0);
  }
  function J() {
    if (!i.current.search || I.current.shouldFilter === !1) {
      i.current.filtered.count = n.current.size;
      return;
    }
    i.current.filtered.groups = /* @__PURE__ */ new Set();
    let _ = 0;
    for (let tA of n.current) {
      let nA = g.current.get(tA), AA = F(nA);
      i.current.filtered.items.set(tA, AA), AA > 0 && _++;
    }
    for (let [tA, nA] of o.current)
      for (let AA of nA)
        if (i.current.filtered.items.get(AA) > 0) {
          i.current.filtered.groups.add(tA);
          break;
        }
    i.current.filtered.count = _;
  }
  function p() {
    var _, tA, nA;
    let AA = N();
    AA && (((_ = AA.parentElement) == null ? void 0 : _.firstChild) === AA && ((nA = (tA = AA.closest(Ok)) == null ? void 0 : tA.querySelector(Xot)) == null || nA.scrollIntoView({ block: "nearest" })), AA.scrollIntoView({ block: "nearest" }));
  }
  function N() {
    var _;
    return (_ = t.current) == null ? void 0 : _.querySelector(`${FgA}[aria-selected="true"]`);
  }
  function v() {
    return Array.from(t.current.querySelectorAll(VpA));
  }
  function K(_) {
    let tA = v()[_];
    tA && G.setState("value", tA.getAttribute(lc));
  }
  function U(_) {
    var tA;
    let nA = N(), AA = v(), gA = AA.findIndex((sA) => sA === nA), rA = AA[gA + _];
    (tA = I.current) != null && tA.loop && (rA = gA + _ < 0 ? AA[AA.length - 1] : gA + _ === AA.length ? AA[0] : AA[gA + _]), rA && G.setState("value", rA.getAttribute(lc));
  }
  function j(_) {
    let tA = N(), nA = tA == null ? void 0 : tA.closest(Ok), AA;
    for (; nA && !AA; )
      nA = _ > 0 ? egt(nA, Ok) : tgt(nA, Ok), AA = nA == null ? void 0 : nA.querySelector(VpA);
    AA ? G.setState("value", AA.getAttribute(lc)) : U(_);
  }
  let q = () => K(v().length - 1), O = (_) => {
    _.preventDefault(), _.metaKey ? q() : _.altKey ? j(1) : U(1);
  }, $ = (_) => {
    _.preventDefault(), _.metaKey ? K(0) : _.altKey ? j(-1) : U(-1);
  };
  return u.createElement("div", { ref: t1([t, e]), ...d, "cmdk-root": "", onKeyDown: (_) => {
    var tA;
    if ((tA = d.onKeyDown) == null || tA.call(d, _), !_.defaultPrevented)
      switch (_.key) {
        case "n":
        case "j": {
          E && _.ctrlKey && O(_);
          break;
        }
        case "ArrowDown": {
          O(_);
          break;
        }
        case "p":
        case "k": {
          E && _.ctrlKey && $(_);
          break;
        }
        case "ArrowUp": {
          $(_);
          break;
        }
        case "Home": {
          _.preventDefault(), K(0);
          break;
        }
        case "End": {
          _.preventDefault(), q();
          break;
        }
        case "Enter":
          if (!_.nativeEvent.isComposing) {
            _.preventDefault();
            let nA = N();
            if (nA) {
              let AA = new Event(OP);
              nA.dispatchEvent(AA);
            }
          }
      }
  } }, u.createElement("label", { "cmdk-label": "", htmlFor: R.inputId, id: R.labelId, style: ngt }, r), u.createElement(e9A.Provider, { value: G }, u.createElement(A9A.Provider, { value: R }, a)));
}), Tot = u.forwardRef((A, e) => {
  var t, i;
  let n = u.useId(), o = u.useRef(null), g = u.useContext(t9A), s = e1(), I = n9A(A), r = (i = (t = I.current) == null ? void 0 : t.forceMount) != null ? i : g == null ? void 0 : g.forceMount;
  cG(() => s.item(n, g == null ? void 0 : g.id), []);
  let a = o9A(n, o, [A.value, A.children, o]), C = MgA(), B = xp((G) => G.value && G.value === a.current), l = xp((G) => r || s.filter() === !1 ? !0 : G.search ? G.filtered.items.get(n) > 0 : !0);
  u.useEffect(() => {
    let G = o.current;
    if (!(!G || A.disabled))
      return G.addEventListener(OP, Q), () => G.removeEventListener(OP, Q);
  }, [l, A.onSelect, A.disabled]);
  function Q() {
    var G, R;
    E(), (R = (G = I.current).onSelect) == null || R.call(G, a.current);
  }
  function E() {
    C.setState("value", a.current, !0);
  }
  if (!l)
    return null;
  let { disabled: d, value: m, onSelect: y, forceMount: f, ...w } = A;
  return u.createElement("div", { ref: t1([o, e]), ...w, id: n, "cmdk-item": "", role: "option", "aria-disabled": d || void 0, "aria-selected": B || void 0, "data-disabled": d || void 0, "data-selected": B || void 0, onPointerMove: d ? void 0 : E, onClick: d ? void 0 : Q }, A.children);
}), _ot = u.forwardRef((A, e) => {
  let { heading: t, children: i, forceMount: n, ...o } = A, g = u.useId(), s = u.useRef(null), I = u.useRef(null), r = u.useId(), a = e1(), C = xp((Q) => n || a.filter() === !1 ? !0 : Q.search ? Q.filtered.groups.has(g) : !0);
  cG(() => a.group(g), []), o9A(g, s, [A.value, A.heading, I]);
  let B = u.useMemo(() => ({ id: g, forceMount: n }), [n]), l = u.createElement(t9A.Provider, { value: B }, i);
  return u.createElement("div", { ref: t1([s, e]), ...o, "cmdk-group": "", role: "presentation", hidden: C ? void 0 : !0 }, t && u.createElement("div", { ref: I, "cmdk-group-heading": "", "aria-hidden": !0, id: r }, t), u.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? r : void 0 }, l));
}), qot = u.forwardRef((A, e) => {
  let { alwaysRender: t, ...i } = A, n = u.useRef(null), o = xp((g) => !g.search);
  return !t && !o ? null : u.createElement("div", { ref: t1([n, e]), ...i, "cmdk-separator": "", role: "separator" });
}), Oot = u.forwardRef((A, e) => {
  let { onValueChange: t, ...i } = A, n = A.value != null, o = MgA(), g = xp((a) => a.search), s = xp((a) => a.value), I = e1(), r = u.useMemo(() => {
    var a;
    let C = (a = I.commandRef.current) == null ? void 0 : a.querySelector(`${FgA}[${lc}="${s}"]`);
    return C == null ? void 0 : C.getAttribute("id");
  }, [s, I.commandRef]);
  return u.useEffect(() => {
    A.value != null && o.setState("search", A.value);
  }, [A.value]), u.createElement("input", { ref: e, ...i, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": I.listId, "aria-labelledby": I.labelId, "aria-activedescendant": r, id: I.inputId, type: "text", value: n ? A.value : g, onChange: (a) => {
    n || o.setState("search", a.target.value), t == null || t(a.target.value);
  } });
}), jot = u.forwardRef((A, e) => {
  let { children: t, ...i } = A, n = u.useRef(null), o = u.useRef(null), g = e1();
  return u.useEffect(() => {
    if (o.current && n.current) {
      let s = o.current, I = n.current, r, a = new ResizeObserver(() => {
        r = requestAnimationFrame(() => {
          let C = s.offsetHeight;
          I.style.setProperty("--cmdk-list-height", C.toFixed(1) + "px");
        });
      });
      return a.observe(s), () => {
        cancelAnimationFrame(r), a.unobserve(s);
      };
    }
  }, []), u.createElement("div", { ref: t1([n, e]), ...i, "cmdk-list": "", role: "listbox", "aria-label": "Suggestions", id: g.listId, "aria-labelledby": g.inputId }, u.createElement("div", { ref: o, "cmdk-list-sizer": "" }, t));
}), Pot = u.forwardRef((A, e) => {
  let { open: t, onOpenChange: i, overlayClassName: n, contentClassName: o, container: g, ...s } = A;
  return u.createElement(Zot, { open: t, onOpenChange: i }, u.createElement(Wot, { container: g }, u.createElement(Kot, { "cmdk-overlay": "", className: n }), u.createElement(Uot, { "aria-label": A.label, "cmdk-dialog": "", className: o }, u.createElement(i9A, { ref: e, ...s }))));
}), $ot = u.forwardRef((A, e) => {
  let t = u.useRef(!0), i = xp((n) => n.filtered.count === 0);
  return u.useEffect(() => {
    t.current = !1;
  }, []), t.current || !i ? null : u.createElement("div", { ref: e, ...A, "cmdk-empty": "", role: "presentation" });
}), Agt = u.forwardRef((A, e) => {
  let { progress: t, children: i, ...n } = A;
  return u.createElement("div", { ref: e, ...n, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": "Loading..." }, u.createElement("div", { "aria-hidden": !0 }, i));
}), sI = Object.assign(i9A, { List: jot, Item: Tot, Input: Oot, Group: _ot, Separator: qot, Dialog: Pot, Empty: $ot, Loading: Agt });
function egt(A, e) {
  let t = A.nextElementSibling;
  for (; t; ) {
    if (t.matches(e))
      return t;
    t = t.nextElementSibling;
  }
}
function tgt(A, e) {
  let t = A.previousElementSibling;
  for (; t; ) {
    if (t.matches(e))
      return t;
    t = t.previousElementSibling;
  }
}
function n9A(A) {
  let e = u.useRef(A);
  return cG(() => {
    e.current = A;
  }), e;
}
var cG = typeof window > "u" ? u.useEffect : u.useLayoutEffect;
function _y(A) {
  let e = u.useRef();
  return e.current === void 0 && (e.current = A()), e;
}
function t1(A) {
  return (e) => {
    A.forEach((t) => {
      typeof t == "function" ? t(e) : t != null && (t.current = e);
    });
  };
}
function xp(A) {
  let e = MgA(), t = () => A(e.snapshot());
  return u.useSyncExternalStore(e.subscribe, t, t);
}
function o9A(A, e, t) {
  let i = u.useRef(), n = e1();
  return cG(() => {
    var o;
    let g = (() => {
      var s;
      for (let I of t) {
        if (typeof I == "string")
          return I.trim().toLowerCase();
        if (typeof I == "object" && "current" in I)
          return I.current ? (s = I.current.textContent) == null ? void 0 : s.trim().toLowerCase() : i.current;
      }
    })();
    n.value(A, g), (o = e.current) == null || o.setAttribute(lc, g), i.current = g;
  }), i;
}
var igt = () => {
  let [A, e] = u.useState(), t = _y(() => /* @__PURE__ */ new Map());
  return cG(() => {
    t.current.forEach((i) => i()), t.current = /* @__PURE__ */ new Map();
  }, [A]), (i, n) => {
    t.current.set(i, n), e({});
  };
}, ngt = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
const g9A = u.forwardRef(({ className: A, ...e }, t) => u.createElement(sI, { ref: t, className: me("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", A), ...e }));
g9A.displayName = sI.displayName;
const s9A = u.forwardRef(({ className: A, ...e }, t) => u.createElement(
  "div",
  { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "" },
  u.createElement(Kde, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
  u.createElement(sI.Input, { ref: t, className: me("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", A), ...e })
));
s9A.displayName = sI.Input.displayName;
const ogt = u.forwardRef(({ className: A, ...e }, t) => u.createElement(sI.List, { ref: t, className: me("max-h-[300px] overflow-y-auto overflow-x-hidden", A), ...e }));
ogt.displayName = sI.List.displayName;
const I9A = u.forwardRef((A, e) => u.createElement(sI.Empty, { ref: e, className: "py-6 text-center text-sm", ...A }));
I9A.displayName = sI.Empty.displayName;
const a9A = u.forwardRef(({ className: A, ...e }, t) => u.createElement(sI.Group, { ref: t, className: me("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", A), ...e }));
a9A.displayName = sI.Group.displayName;
const ggt = u.forwardRef(({ className: A, ...e }, t) => u.createElement(sI.Separator, { ref: t, className: me("-mx-1 h-px bg-border", A), ...e }));
ggt.displayName = sI.Separator.displayName;
const r9A = u.forwardRef(({ className: A, ...e }, t) => u.createElement(sI.Item, { ref: t, className: me("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", A), ...e }));
r9A.displayName = sI.Item.displayName;
function XpA({ options: A = [], selectedKey: e, onSelect: t, className: i, popClassName: n, placeholder: o = "Select A Value" }) {
  var g;
  const [s, I] = u.useState(!1), r = e || "_none";
  return b.createElement(
    q7,
    { open: s, onOpenChange: I },
    b.createElement(
      O7,
      { asChild: !0 },
      b.createElement(
        Re,
        { variant: "outline", role: "combobox", "aria-expanded": s, className: me("flex justify-between", i) },
        b.createElement("div", { className: "shrink min-w-[0px] overflow-hidden text-ellipsis whitespace-nowrap" }, ((g = A.find((a) => a.value === r)) == null ? void 0 : g.label) ?? o),
        b.createElement(qRA, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
      )
    ),
    b.createElement(
      h3,
      { className: me("p-0", n) },
      b.createElement(
        g9A,
        null,
        b.createElement(s9A, { placeholder: "Search...", className: "h-9" }),
        b.createElement(I9A, null, "No options found."),
        b.createElement(
          vVA,
          { className: "h-min max-h-48" },
          b.createElement(a9A, null, A.map((a) => b.createElement(
            r9A,
            { key: a.value, value: a.value, onSelect: () => {
              a.value === "_none" ? t == null || t("") : t == null || t(a.value === r ? "" : a.value), I(!1);
            } },
            a.label,
            b.createElement(_R, { className: me("ml-auto h-4 w-4", r === a.value ? "opacity-100" : "opacity-0") })
          )))
        )
      )
    )
  );
}
var xa = {}, i1 = {}, sgt = Array.isArray, vC = sgt, Igt = p0, agt = vC, rgt = zQ, Cgt = "[object String]";
function Bgt(A) {
  return typeof A == "string" || !agt(A) && rgt(A) && Igt(A) == Cgt;
}
var lgt = Bgt;
function cgt(A) {
  return function(e, t, i) {
    for (var n = -1, o = Object(e), g = i(e), s = g.length; s--; ) {
      var I = g[A ? s : ++n];
      if (t(o[I], I, o) === !1)
        break;
    }
    return e;
  };
}
var Qgt = cgt, Egt = Qgt, ugt = Egt(), dgt = ugt;
function hgt(A, e) {
  for (var t = -1, i = Array(A); ++t < A; )
    i[t] = e(t);
  return i;
}
var mgt = hgt, pgt = p0, ygt = zQ, bgt = "[object Arguments]";
function wgt(A) {
  return ygt(A) && pgt(A) == bgt;
}
var fgt = wgt, zpA = fgt, Dgt = zQ, C9A = Object.prototype, Ggt = C9A.hasOwnProperty, kgt = C9A.propertyIsEnumerable, Jgt = zpA(function() {
  return arguments;
}()) ? zpA : function(A) {
  return Dgt(A) && Ggt.call(A, "callee") && !kgt.call(A, "callee");
}, B9A = Jgt, qZ = { exports: {} };
function Ngt() {
  return !1;
}
var Ygt = Ngt;
qZ.exports;
(function(A, e) {
  var t = LC, i = Ygt, n = e && !e.nodeType && e, o = n && !0 && A && !A.nodeType && A, g = o && o.exports === n, s = g ? t.Buffer : void 0, I = s ? s.isBuffer : void 0, r = I || i;
  A.exports = r;
})(qZ, qZ.exports);
var xgA = qZ.exports, Rgt = 9007199254740991, Fgt = /^(?:0|[1-9]\d*)$/;
function Mgt(A, e) {
  var t = typeof A;
  return e = e ?? Rgt, !!e && (t == "number" || t != "symbol" && Fgt.test(A)) && A > -1 && A % 1 == 0 && A < e;
}
var l9A = Mgt, xgt = 9007199254740991;
function Lgt(A) {
  return typeof A == "number" && A > -1 && A % 1 == 0 && A <= xgt;
}
var LgA = Lgt, vgt = p0, Hgt = LgA, Sgt = zQ, Zgt = "[object Arguments]", Wgt = "[object Array]", Kgt = "[object Boolean]", Ugt = "[object Date]", Vgt = "[object Error]", Xgt = "[object Function]", zgt = "[object Map]", Tgt = "[object Number]", _gt = "[object Object]", qgt = "[object RegExp]", Ogt = "[object Set]", jgt = "[object String]", Pgt = "[object WeakMap]", $gt = "[object ArrayBuffer]", Ast = "[object DataView]", est = "[object Float32Array]", tst = "[object Float64Array]", ist = "[object Int8Array]", nst = "[object Int16Array]", ost = "[object Int32Array]", gst = "[object Uint8Array]", sst = "[object Uint8ClampedArray]", Ist = "[object Uint16Array]", ast = "[object Uint32Array]", nn = {};
nn[est] = nn[tst] = nn[ist] = nn[nst] = nn[ost] = nn[gst] = nn[sst] = nn[Ist] = nn[ast] = !0;
nn[Zgt] = nn[Wgt] = nn[$gt] = nn[Kgt] = nn[Ast] = nn[Ugt] = nn[Vgt] = nn[Xgt] = nn[zgt] = nn[Tgt] = nn[_gt] = nn[qgt] = nn[Ogt] = nn[jgt] = nn[Pgt] = !1;
function rst(A) {
  return Sgt(A) && Hgt(A.length) && !!nn[vgt(A)];
}
var Cst = rst;
function Bst(A) {
  return function(e) {
    return A(e);
  };
}
var vgA = Bst, OZ = { exports: {} };
OZ.exports;
(function(A, e) {
  var t = yVA, i = e && !e.nodeType && e, n = i && !0 && A && !A.nodeType && A, o = n && n.exports === i, g = o && t.process, s = function() {
    try {
      var I = n && n.require && n.require("util").types;
      return I || g && g.binding && g.binding("util");
    } catch {
    }
  }();
  A.exports = s;
})(OZ, OZ.exports);
var HgA = OZ.exports, lst = Cst, cst = vgA, TpA = HgA, _pA = TpA && TpA.isTypedArray, Qst = _pA ? cst(_pA) : lst, c9A = Qst, Est = mgt, ust = B9A, dst = vC, hst = xgA, mst = l9A, pst = c9A, yst = Object.prototype, bst = yst.hasOwnProperty;
function wst(A, e) {
  var t = dst(A), i = !t && ust(A), n = !t && !i && hst(A), o = !t && !i && !n && pst(A), g = t || i || n || o, s = g ? Est(A.length, String) : [], I = s.length;
  for (var r in A)
    (e || bst.call(A, r)) && !(g && // Safari 9 has enumerable `arguments.length` in strict mode.
    (r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    n && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    o && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
    mst(r, I))) && s.push(r);
  return s;
}
var Q9A = wst, fst = Object.prototype;
function Dst(A) {
  var e = A && A.constructor, t = typeof e == "function" && e.prototype || fst;
  return A === t;
}
var SgA = Dst;
function Gst(A, e) {
  return function(t) {
    return A(e(t));
  };
}
var E9A = Gst, kst = E9A, Jst = kst(Object.keys, Object), Nst = Jst, Yst = SgA, Rst = Nst, Fst = Object.prototype, Mst = Fst.hasOwnProperty;
function xst(A) {
  if (!Yst(A))
    return Rst(A);
  var e = [];
  for (var t in Object(A))
    Mst.call(A, t) && t != "constructor" && e.push(t);
  return e;
}
var Lst = xst, vst = p0, Hst = XQ, Sst = "[object AsyncFunction]", Zst = "[object Function]", Wst = "[object GeneratorFunction]", Kst = "[object Proxy]";
function Ust(A) {
  if (!Hst(A))
    return !1;
  var e = vst(A);
  return e == Zst || e == Wst || e == Sst || e == Kst;
}
var u9A = Ust, Vst = u9A, Xst = LgA;
function zst(A) {
  return A != null && Xst(A.length) && !Vst(A);
}
var CX = zst, Tst = Q9A, _st = Lst, qst = CX;
function Ost(A) {
  return qst(A) ? Tst(A) : _st(A);
}
var n1 = Ost, jst = dgt, Pst = n1;
function $st(A, e) {
  return A && jst(A, e, Pst);
}
var d9A = $st;
function AIt(A) {
  return A;
}
var h9A = AIt, eIt = h9A;
function tIt(A) {
  return typeof A == "function" ? A : eIt;
}
var iIt = tIt, nIt = d9A, oIt = iIt;
function gIt(A, e) {
  return A && nIt(A, oIt(e));
}
var ZgA = gIt, sIt = E9A, IIt = sIt(Object.getPrototypeOf, Object), WgA = IIt, aIt = p0, rIt = WgA, CIt = zQ, BIt = "[object Object]", lIt = Function.prototype, cIt = Object.prototype, m9A = lIt.toString, QIt = cIt.hasOwnProperty, EIt = m9A.call(Object);
function uIt(A) {
  if (!CIt(A) || aIt(A) != BIt)
    return !1;
  var e = rIt(A);
  if (e === null)
    return !0;
  var t = QIt.call(e, "constructor") && e.constructor;
  return typeof t == "function" && t instanceof t && m9A.call(t) == EIt;
}
var dIt = uIt;
function hIt(A, e) {
  for (var t = -1, i = A == null ? 0 : A.length, n = Array(i); ++t < i; )
    n[t] = e(A[t], t, A);
  return n;
}
var p9A = hIt;
function mIt() {
  this.__data__ = [], this.size = 0;
}
var pIt = mIt;
function yIt(A, e) {
  return A === e || A !== A && e !== e;
}
var KgA = yIt, bIt = KgA;
function wIt(A, e) {
  for (var t = A.length; t--; )
    if (bIt(A[t][0], e))
      return t;
  return -1;
}
var BX = wIt, fIt = BX, DIt = Array.prototype, GIt = DIt.splice;
function kIt(A) {
  var e = this.__data__, t = fIt(e, A);
  if (t < 0)
    return !1;
  var i = e.length - 1;
  return t == i ? e.pop() : GIt.call(e, t, 1), --this.size, !0;
}
var JIt = kIt, NIt = BX;
function YIt(A) {
  var e = this.__data__, t = NIt(e, A);
  return t < 0 ? void 0 : e[t][1];
}
var RIt = YIt, FIt = BX;
function MIt(A) {
  return FIt(this.__data__, A) > -1;
}
var xIt = MIt, LIt = BX;
function vIt(A, e) {
  var t = this.__data__, i = LIt(t, A);
  return i < 0 ? (++this.size, t.push([A, e])) : t[i][1] = e, this;
}
var HIt = vIt, SIt = pIt, ZIt = JIt, WIt = RIt, KIt = xIt, UIt = HIt;
function QG(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.clear(); ++e < t; ) {
    var i = A[e];
    this.set(i[0], i[1]);
  }
}
QG.prototype.clear = SIt;
QG.prototype.delete = ZIt;
QG.prototype.get = WIt;
QG.prototype.has = KIt;
QG.prototype.set = UIt;
var lX = QG, VIt = lX;
function XIt() {
  this.__data__ = new VIt(), this.size = 0;
}
var zIt = XIt;
function TIt(A) {
  var e = this.__data__, t = e.delete(A);
  return this.size = e.size, t;
}
var _It = TIt;
function qIt(A) {
  return this.__data__.get(A);
}
var OIt = qIt;
function jIt(A) {
  return this.__data__.has(A);
}
var PIt = jIt, $It = LC, Aat = $It["__core-js_shared__"], eat = Aat, KT = eat, qpA = function() {
  var A = /[^.]+$/.exec(KT && KT.keys && KT.keys.IE_PROTO || "");
  return A ? "Symbol(src)_1." + A : "";
}();
function tat(A) {
  return !!qpA && qpA in A;
}
var iat = tat, nat = Function.prototype, oat = nat.toString;
function gat(A) {
  if (A != null) {
    try {
      return oat.call(A);
    } catch {
    }
    try {
      return A + "";
    } catch {
    }
  }
  return "";
}
var y9A = gat, sat = u9A, Iat = iat, aat = XQ, rat = y9A, Cat = /[\\^$.*+?()[\]{}|]/g, Bat = /^\[object .+?Constructor\]$/, lat = Function.prototype, cat = Object.prototype, Qat = lat.toString, Eat = cat.hasOwnProperty, uat = RegExp(
  "^" + Qat.call(Eat).replace(Cat, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function dat(A) {
  if (!aat(A) || Iat(A))
    return !1;
  var e = sat(A) ? uat : Bat;
  return e.test(rat(A));
}
var hat = dat;
function mat(A, e) {
  return A == null ? void 0 : A[e];
}
var pat = mat, yat = hat, bat = pat;
function wat(A, e) {
  var t = bat(A, e);
  return yat(t) ? t : void 0;
}
var f0 = wat, fat = f0, Dat = LC, Gat = fat(Dat, "Map"), UgA = Gat, kat = f0, Jat = kat(Object, "create"), cX = Jat, OpA = cX;
function Nat() {
  this.__data__ = OpA ? OpA(null) : {}, this.size = 0;
}
var Yat = Nat;
function Rat(A) {
  var e = this.has(A) && delete this.__data__[A];
  return this.size -= e ? 1 : 0, e;
}
var Fat = Rat, Mat = cX, xat = "__lodash_hash_undefined__", Lat = Object.prototype, vat = Lat.hasOwnProperty;
function Hat(A) {
  var e = this.__data__;
  if (Mat) {
    var t = e[A];
    return t === xat ? void 0 : t;
  }
  return vat.call(e, A) ? e[A] : void 0;
}
var Sat = Hat, Zat = cX, Wat = Object.prototype, Kat = Wat.hasOwnProperty;
function Uat(A) {
  var e = this.__data__;
  return Zat ? e[A] !== void 0 : Kat.call(e, A);
}
var Vat = Uat, Xat = cX, zat = "__lodash_hash_undefined__";
function Tat(A, e) {
  var t = this.__data__;
  return this.size += this.has(A) ? 0 : 1, t[A] = Xat && e === void 0 ? zat : e, this;
}
var _at = Tat, qat = Yat, Oat = Fat, jat = Sat, Pat = Vat, $at = _at;
function EG(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.clear(); ++e < t; ) {
    var i = A[e];
    this.set(i[0], i[1]);
  }
}
EG.prototype.clear = qat;
EG.prototype.delete = Oat;
EG.prototype.get = jat;
EG.prototype.has = Pat;
EG.prototype.set = $at;
var Art = EG, jpA = Art, ert = lX, trt = UgA;
function irt() {
  this.size = 0, this.__data__ = {
    hash: new jpA(),
    map: new (trt || ert)(),
    string: new jpA()
  };
}
var nrt = irt;
function ort(A) {
  var e = typeof A;
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? A !== "__proto__" : A === null;
}
var grt = ort, srt = grt;
function Irt(A, e) {
  var t = A.__data__;
  return srt(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
}
var QX = Irt, art = QX;
function rrt(A) {
  var e = art(this, A).delete(A);
  return this.size -= e ? 1 : 0, e;
}
var Crt = rrt, Brt = QX;
function lrt(A) {
  return Brt(this, A).get(A);
}
var crt = lrt, Qrt = QX;
function Ert(A) {
  return Qrt(this, A).has(A);
}
var urt = Ert, drt = QX;
function hrt(A, e) {
  var t = drt(this, A), i = t.size;
  return t.set(A, e), this.size += t.size == i ? 0 : 1, this;
}
var mrt = hrt, prt = nrt, yrt = Crt, brt = crt, wrt = urt, frt = mrt;
function uG(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.clear(); ++e < t; ) {
    var i = A[e];
    this.set(i[0], i[1]);
  }
}
uG.prototype.clear = prt;
uG.prototype.delete = yrt;
uG.prototype.get = brt;
uG.prototype.has = wrt;
uG.prototype.set = frt;
var VgA = uG, Drt = lX, Grt = UgA, krt = VgA, Jrt = 200;
function Nrt(A, e) {
  var t = this.__data__;
  if (t instanceof Drt) {
    var i = t.__data__;
    if (!Grt || i.length < Jrt - 1)
      return i.push([A, e]), this.size = ++t.size, this;
    t = this.__data__ = new krt(i);
  }
  return t.set(A, e), this.size = t.size, this;
}
var Yrt = Nrt, Rrt = lX, Frt = zIt, Mrt = _It, xrt = OIt, Lrt = PIt, vrt = Yrt;
function dG(A) {
  var e = this.__data__ = new Rrt(A);
  this.size = e.size;
}
dG.prototype.clear = Frt;
dG.prototype.delete = Mrt;
dG.prototype.get = xrt;
dG.prototype.has = Lrt;
dG.prototype.set = vrt;
var XgA = dG, Hrt = "__lodash_hash_undefined__";
function Srt(A) {
  return this.__data__.set(A, Hrt), this;
}
var Zrt = Srt;
function Wrt(A) {
  return this.__data__.has(A);
}
var Krt = Wrt, Urt = VgA, Vrt = Zrt, Xrt = Krt;
function jZ(A) {
  var e = -1, t = A == null ? 0 : A.length;
  for (this.__data__ = new Urt(); ++e < t; )
    this.add(A[e]);
}
jZ.prototype.add = jZ.prototype.push = Vrt;
jZ.prototype.has = Xrt;
var zrt = jZ;
function Trt(A, e) {
  for (var t = -1, i = A == null ? 0 : A.length; ++t < i; )
    if (e(A[t], t, A))
      return !0;
  return !1;
}
var _rt = Trt;
function qrt(A, e) {
  return A.has(e);
}
var Ort = qrt, jrt = zrt, Prt = _rt, $rt = Ort, ACt = 1, eCt = 2;
function tCt(A, e, t, i, n, o) {
  var g = t & ACt, s = A.length, I = e.length;
  if (s != I && !(g && I > s))
    return !1;
  var r = o.get(A), a = o.get(e);
  if (r && a)
    return r == e && a == A;
  var C = -1, B = !0, l = t & eCt ? new jrt() : void 0;
  for (o.set(A, e), o.set(e, A); ++C < s; ) {
    var Q = A[C], E = e[C];
    if (i)
      var d = g ? i(E, Q, C, e, A, o) : i(Q, E, C, A, e, o);
    if (d !== void 0) {
      if (d)
        continue;
      B = !1;
      break;
    }
    if (l) {
      if (!Prt(e, function(m, y) {
        if (!$rt(l, y) && (Q === m || n(Q, m, t, i, o)))
          return l.push(y);
      })) {
        B = !1;
        break;
      }
    } else if (!(Q === E || n(Q, E, t, i, o))) {
      B = !1;
      break;
    }
  }
  return o.delete(A), o.delete(e), B;
}
var b9A = tCt, iCt = LC, nCt = iCt.Uint8Array, w9A = nCt;
function oCt(A) {
  var e = -1, t = Array(A.size);
  return A.forEach(function(i, n) {
    t[++e] = [n, i];
  }), t;
}
var gCt = oCt;
function sCt(A) {
  var e = -1, t = Array(A.size);
  return A.forEach(function(i) {
    t[++e] = i;
  }), t;
}
var ICt = sCt, PpA = OF, $pA = w9A, aCt = KgA, rCt = b9A, CCt = gCt, BCt = ICt, lCt = 1, cCt = 2, QCt = "[object Boolean]", ECt = "[object Date]", uCt = "[object Error]", dCt = "[object Map]", hCt = "[object Number]", mCt = "[object RegExp]", pCt = "[object Set]", yCt = "[object String]", bCt = "[object Symbol]", wCt = "[object ArrayBuffer]", fCt = "[object DataView]", A0A = PpA ? PpA.prototype : void 0, UT = A0A ? A0A.valueOf : void 0;
function DCt(A, e, t, i, n, o, g) {
  switch (t) {
    case fCt:
      if (A.byteLength != e.byteLength || A.byteOffset != e.byteOffset)
        return !1;
      A = A.buffer, e = e.buffer;
    case wCt:
      return !(A.byteLength != e.byteLength || !o(new $pA(A), new $pA(e)));
    case QCt:
    case ECt:
    case hCt:
      return aCt(+A, +e);
    case uCt:
      return A.name == e.name && A.message == e.message;
    case mCt:
    case yCt:
      return A == e + "";
    case dCt:
      var s = CCt;
    case pCt:
      var I = i & lCt;
      if (s || (s = BCt), A.size != e.size && !I)
        return !1;
      var r = g.get(A);
      if (r)
        return r == e;
      i |= cCt, g.set(A, e);
      var a = rCt(s(A), s(e), i, n, o, g);
      return g.delete(A), a;
    case bCt:
      if (UT)
        return UT.call(A) == UT.call(e);
  }
  return !1;
}
var GCt = DCt;
function kCt(A, e) {
  for (var t = -1, i = e.length, n = A.length; ++t < i; )
    A[n + t] = e[t];
  return A;
}
var f9A = kCt, JCt = f9A, NCt = vC;
function YCt(A, e, t) {
  var i = e(A);
  return NCt(A) ? i : JCt(i, t(A));
}
var D9A = YCt;
function RCt(A, e) {
  for (var t = -1, i = A == null ? 0 : A.length, n = 0, o = []; ++t < i; ) {
    var g = A[t];
    e(g, t, A) && (o[n++] = g);
  }
  return o;
}
var FCt = RCt;
function MCt() {
  return [];
}
var G9A = MCt, xCt = FCt, LCt = G9A, vCt = Object.prototype, HCt = vCt.propertyIsEnumerable, e0A = Object.getOwnPropertySymbols, SCt = e0A ? function(A) {
  return A == null ? [] : (A = Object(A), xCt(e0A(A), function(e) {
    return HCt.call(A, e);
  }));
} : LCt, zgA = SCt, ZCt = D9A, WCt = zgA, KCt = n1;
function UCt(A) {
  return ZCt(A, KCt, WCt);
}
var k9A = UCt, t0A = k9A, VCt = 1, XCt = Object.prototype, zCt = XCt.hasOwnProperty;
function TCt(A, e, t, i, n, o) {
  var g = t & VCt, s = t0A(A), I = s.length, r = t0A(e), a = r.length;
  if (I != a && !g)
    return !1;
  for (var C = I; C--; ) {
    var B = s[C];
    if (!(g ? B in e : zCt.call(e, B)))
      return !1;
  }
  var l = o.get(A), Q = o.get(e);
  if (l && Q)
    return l == e && Q == A;
  var E = !0;
  o.set(A, e), o.set(e, A);
  for (var d = g; ++C < I; ) {
    B = s[C];
    var m = A[B], y = e[B];
    if (i)
      var f = g ? i(y, m, B, e, A, o) : i(m, y, B, A, e, o);
    if (!(f === void 0 ? m === y || n(m, y, t, i, o) : f)) {
      E = !1;
      break;
    }
    d || (d = B == "constructor");
  }
  if (E && !d) {
    var w = A.constructor, G = e.constructor;
    w != G && "constructor" in A && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof G == "function" && G instanceof G) && (E = !1);
  }
  return o.delete(A), o.delete(e), E;
}
var _Ct = TCt, qCt = f0, OCt = LC, jCt = qCt(OCt, "DataView"), PCt = jCt, $Ct = f0, ABt = LC, eBt = $Ct(ABt, "Promise"), tBt = eBt, iBt = f0, nBt = LC, oBt = iBt(nBt, "Set"), gBt = oBt, sBt = f0, IBt = LC, aBt = sBt(IBt, "WeakMap"), rBt = aBt, jP = PCt, PP = UgA, $P = tBt, A6 = gBt, e6 = rBt, J9A = p0, hG = y9A, i0A = "[object Map]", CBt = "[object Object]", n0A = "[object Promise]", o0A = "[object Set]", g0A = "[object WeakMap]", s0A = "[object DataView]", BBt = hG(jP), lBt = hG(PP), cBt = hG($P), QBt = hG(A6), EBt = hG(e6), qh = J9A;
(jP && qh(new jP(new ArrayBuffer(1))) != s0A || PP && qh(new PP()) != i0A || $P && qh($P.resolve()) != n0A || A6 && qh(new A6()) != o0A || e6 && qh(new e6()) != g0A) && (qh = function(A) {
  var e = J9A(A), t = e == CBt ? A.constructor : void 0, i = t ? hG(t) : "";
  if (i)
    switch (i) {
      case BBt:
        return s0A;
      case lBt:
        return i0A;
      case cBt:
        return n0A;
      case QBt:
        return o0A;
      case EBt:
        return g0A;
    }
  return e;
});
var EX = qh, VT = XgA, uBt = b9A, dBt = GCt, hBt = _Ct, I0A = EX, a0A = vC, r0A = xgA, mBt = c9A, pBt = 1, C0A = "[object Arguments]", B0A = "[object Array]", vx = "[object Object]", yBt = Object.prototype, l0A = yBt.hasOwnProperty;
function bBt(A, e, t, i, n, o) {
  var g = a0A(A), s = a0A(e), I = g ? B0A : I0A(A), r = s ? B0A : I0A(e);
  I = I == C0A ? vx : I, r = r == C0A ? vx : r;
  var a = I == vx, C = r == vx, B = I == r;
  if (B && r0A(A)) {
    if (!r0A(e))
      return !1;
    g = !0, a = !1;
  }
  if (B && !a)
    return o || (o = new VT()), g || mBt(A) ? uBt(A, e, t, i, n, o) : dBt(A, e, I, t, i, n, o);
  if (!(t & pBt)) {
    var l = a && l0A.call(A, "__wrapped__"), Q = C && l0A.call(e, "__wrapped__");
    if (l || Q) {
      var E = l ? A.value() : A, d = Q ? e.value() : e;
      return o || (o = new VT()), n(E, d, t, i, o);
    }
  }
  return B ? (o || (o = new VT()), hBt(A, e, t, i, n, o)) : !1;
}
var wBt = bBt, fBt = wBt, c0A = zQ;
function N9A(A, e, t, i, n) {
  return A === e ? !0 : A == null || e == null || !c0A(A) && !c0A(e) ? A !== A && e !== e : fBt(A, e, t, i, N9A, n);
}
var Y9A = N9A, DBt = XgA, GBt = Y9A, kBt = 1, JBt = 2;
function NBt(A, e, t, i) {
  var n = t.length, o = n, g = !i;
  if (A == null)
    return !o;
  for (A = Object(A); n--; ) {
    var s = t[n];
    if (g && s[2] ? s[1] !== A[s[0]] : !(s[0] in A))
      return !1;
  }
  for (; ++n < o; ) {
    s = t[n];
    var I = s[0], r = A[I], a = s[1];
    if (g && s[2]) {
      if (r === void 0 && !(I in A))
        return !1;
    } else {
      var C = new DBt();
      if (i)
        var B = i(r, a, I, A, e, C);
      if (!(B === void 0 ? GBt(a, r, kBt | JBt, i, C) : B))
        return !1;
    }
  }
  return !0;
}
var YBt = NBt, RBt = XQ;
function FBt(A) {
  return A === A && !RBt(A);
}
var R9A = FBt, MBt = R9A, xBt = n1;
function LBt(A) {
  for (var e = xBt(A), t = e.length; t--; ) {
    var i = e[t], n = A[i];
    e[t] = [i, n, MBt(n)];
  }
  return e;
}
var vBt = LBt;
function HBt(A, e) {
  return function(t) {
    return t == null ? !1 : t[A] === e && (e !== void 0 || A in Object(t));
  };
}
var F9A = HBt, SBt = YBt, ZBt = vBt, WBt = F9A;
function KBt(A) {
  var e = ZBt(A);
  return e.length == 1 && e[0][2] ? WBt(e[0][0], e[0][1]) : function(t) {
    return t === A || SBt(t, A, e);
  };
}
var UBt = KBt, VBt = vC, XBt = PV, zBt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, TBt = /^\w*$/;
function _Bt(A, e) {
  if (VBt(A))
    return !1;
  var t = typeof A;
  return t == "number" || t == "symbol" || t == "boolean" || A == null || XBt(A) ? !0 : TBt.test(A) || !zBt.test(A) || e != null && A in Object(e);
}
var TgA = _Bt, M9A = VgA, qBt = "Expected a function";
function _gA(A, e) {
  if (typeof A != "function" || e != null && typeof e != "function")
    throw new TypeError(qBt);
  var t = function() {
    var i = arguments, n = e ? e.apply(this, i) : i[0], o = t.cache;
    if (o.has(n))
      return o.get(n);
    var g = A.apply(this, i);
    return t.cache = o.set(n, g) || o, g;
  };
  return t.cache = new (_gA.Cache || M9A)(), t;
}
_gA.Cache = M9A;
var OBt = _gA, jBt = OBt, PBt = 500;
function $Bt(A) {
  var e = jBt(A, function(i) {
    return t.size === PBt && t.clear(), i;
  }), t = e.cache;
  return e;
}
var Alt = $Bt, elt = Alt, tlt = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ilt = /\\(\\)?/g, nlt = elt(function(A) {
  var e = [];
  return A.charCodeAt(0) === 46 && e.push(""), A.replace(tlt, function(t, i, n, o) {
    e.push(n ? o.replace(ilt, "$1") : i || t);
  }), e;
}), olt = nlt, Q0A = OF, glt = p9A, slt = vC, Ilt = PV, alt = 1 / 0, E0A = Q0A ? Q0A.prototype : void 0, u0A = E0A ? E0A.toString : void 0;
function x9A(A) {
  if (typeof A == "string")
    return A;
  if (slt(A))
    return glt(A, x9A) + "";
  if (Ilt(A))
    return u0A ? u0A.call(A) : "";
  var e = A + "";
  return e == "0" && 1 / A == -alt ? "-0" : e;
}
var rlt = x9A, Clt = rlt;
function Blt(A) {
  return A == null ? "" : Clt(A);
}
var llt = Blt, clt = vC, Qlt = TgA, Elt = olt, ult = llt;
function dlt(A, e) {
  return clt(A) ? A : Qlt(A, e) ? [A] : Elt(ult(A));
}
var L9A = dlt, hlt = PV, mlt = 1 / 0;
function plt(A) {
  if (typeof A == "string" || hlt(A))
    return A;
  var e = A + "";
  return e == "0" && 1 / A == -mlt ? "-0" : e;
}
var uX = plt, ylt = L9A, blt = uX;
function wlt(A, e) {
  e = ylt(e, A);
  for (var t = 0, i = e.length; A != null && t < i; )
    A = A[blt(e[t++])];
  return t && t == i ? A : void 0;
}
var v9A = wlt, flt = v9A;
function Dlt(A, e, t) {
  var i = A == null ? void 0 : flt(A, e);
  return i === void 0 ? t : i;
}
var Glt = Dlt;
function klt(A, e) {
  return A != null && e in Object(A);
}
var Jlt = klt, Nlt = L9A, Ylt = B9A, Rlt = vC, Flt = l9A, Mlt = LgA, xlt = uX;
function Llt(A, e, t) {
  e = Nlt(e, A);
  for (var i = -1, n = e.length, o = !1; ++i < n; ) {
    var g = xlt(e[i]);
    if (!(o = A != null && t(A, g)))
      break;
    A = A[g];
  }
  return o || ++i != n ? o : (n = A == null ? 0 : A.length, !!n && Mlt(n) && Flt(g, n) && (Rlt(A) || Ylt(A)));
}
var vlt = Llt, Hlt = Jlt, Slt = vlt;
function Zlt(A, e) {
  return A != null && Slt(A, e, Hlt);
}
var Wlt = Zlt, Klt = Y9A, Ult = Glt, Vlt = Wlt, Xlt = TgA, zlt = R9A, Tlt = F9A, _lt = uX, qlt = 1, Olt = 2;
function jlt(A, e) {
  return Xlt(A) && zlt(e) ? Tlt(_lt(A), e) : function(t) {
    var i = Ult(t, A);
    return i === void 0 && i === e ? Vlt(t, A) : Klt(e, i, qlt | Olt);
  };
}
var Plt = jlt;
function $lt(A) {
  return function(e) {
    return e == null ? void 0 : e[A];
  };
}
var Act = $lt, ect = v9A;
function tct(A) {
  return function(e) {
    return ect(e, A);
  };
}
var ict = tct, nct = Act, oct = ict, gct = TgA, sct = uX;
function Ict(A) {
  return gct(A) ? nct(sct(A)) : oct(A);
}
var act = Ict, rct = UBt, Cct = Plt, Bct = h9A, lct = vC, cct = act;
function Qct(A) {
  return typeof A == "function" ? A : A == null ? Bct : typeof A == "object" ? lct(A) ? Cct(A[0], A[1]) : rct(A) : cct(A);
}
var Ect = Qct, uct = CX;
function dct(A, e) {
  return function(t, i) {
    if (t == null)
      return t;
    if (!uct(t))
      return A(t, i);
    for (var n = t.length, o = e ? n : -1, g = Object(t); (e ? o-- : ++o < n) && i(g[o], o, g) !== !1; )
      ;
    return t;
  };
}
var hct = dct, mct = d9A, pct = hct, yct = pct(mct), bct = yct, wct = bct, fct = CX;
function Dct(A, e) {
  var t = -1, i = fct(A) ? Array(A.length) : [];
  return wct(A, function(n, o, g) {
    i[++t] = e(n, o, g);
  }), i;
}
var Gct = Dct, kct = p9A, Jct = Ect, Nct = Gct, Yct = vC;
function Rct(A, e) {
  var t = Yct(A) ? kct : Nct;
  return t(A, Jct(e));
}
var Fct = Rct;
Object.defineProperty(i1, "__esModule", {
  value: !0
});
i1.flattenNames = void 0;
var Mct = lgt, xct = dX(Mct), Lct = ZgA, vct = dX(Lct), Hct = dIt, Sct = dX(Hct), Zct = Fct, Wct = dX(Zct);
function dX(A) {
  return A && A.__esModule ? A : { default: A };
}
var Kct = i1.flattenNames = function A() {
  var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = [];
  return (0, Wct.default)(e, function(i) {
    Array.isArray(i) ? A(i).map(function(n) {
      return t.push(n);
    }) : (0, Sct.default)(i) ? (0, vct.default)(i, function(n, o) {
      n === !0 && t.push(o), t.push(o + "-" + n);
    }) : (0, xct.default)(i) && t.push(i);
  }), t;
};
i1.default = Kct;
var o1 = {};
function Uct(A, e) {
  for (var t = -1, i = A == null ? 0 : A.length; ++t < i && e(A[t], t, A) !== !1; )
    ;
  return A;
}
var Vct = Uct, Xct = f0, zct = function() {
  try {
    var A = Xct(Object, "defineProperty");
    return A({}, "", {}), A;
  } catch {
  }
}(), Tct = zct, d0A = Tct;
function _ct(A, e, t) {
  e == "__proto__" && d0A ? d0A(A, e, {
    configurable: !0,
    enumerable: !0,
    value: t,
    writable: !0
  }) : A[e] = t;
}
var H9A = _ct, qct = H9A, Oct = KgA, jct = Object.prototype, Pct = jct.hasOwnProperty;
function $ct(A, e, t) {
  var i = A[e];
  (!(Pct.call(A, e) && Oct(i, t)) || t === void 0 && !(e in A)) && qct(A, e, t);
}
var S9A = $ct, AQt = S9A, eQt = H9A;
function tQt(A, e, t, i) {
  var n = !t;
  t || (t = {});
  for (var o = -1, g = e.length; ++o < g; ) {
    var s = e[o], I = i ? i(t[s], A[s], s, t, A) : void 0;
    I === void 0 && (I = A[s]), n ? eQt(t, s, I) : AQt(t, s, I);
  }
  return t;
}
var hX = tQt, iQt = hX, nQt = n1;
function oQt(A, e) {
  return A && iQt(e, nQt(e), A);
}
var gQt = oQt;
function sQt(A) {
  var e = [];
  if (A != null)
    for (var t in Object(A))
      e.push(t);
  return e;
}
var IQt = sQt, aQt = XQ, rQt = SgA, CQt = IQt, BQt = Object.prototype, lQt = BQt.hasOwnProperty;
function cQt(A) {
  if (!aQt(A))
    return CQt(A);
  var e = rQt(A), t = [];
  for (var i in A)
    i == "constructor" && (e || !lQt.call(A, i)) || t.push(i);
  return t;
}
var QQt = cQt, EQt = Q9A, uQt = QQt, dQt = CX;
function hQt(A) {
  return dQt(A) ? EQt(A, !0) : uQt(A);
}
var qgA = hQt, mQt = hX, pQt = qgA;
function yQt(A, e) {
  return A && mQt(e, pQt(e), A);
}
var bQt = yQt, PZ = { exports: {} };
PZ.exports;
(function(A, e) {
  var t = LC, i = e && !e.nodeType && e, n = i && !0 && A && !A.nodeType && A, o = n && n.exports === i, g = o ? t.Buffer : void 0, s = g ? g.allocUnsafe : void 0;
  function I(r, a) {
    if (a)
      return r.slice();
    var C = r.length, B = s ? s(C) : new r.constructor(C);
    return r.copy(B), B;
  }
  A.exports = I;
})(PZ, PZ.exports);
var wQt = PZ.exports;
function fQt(A, e) {
  var t = -1, i = A.length;
  for (e || (e = Array(i)); ++t < i; )
    e[t] = A[t];
  return e;
}
var DQt = fQt, GQt = hX, kQt = zgA;
function JQt(A, e) {
  return GQt(A, kQt(A), e);
}
var NQt = JQt, YQt = f9A, RQt = WgA, FQt = zgA, MQt = G9A, xQt = Object.getOwnPropertySymbols, LQt = xQt ? function(A) {
  for (var e = []; A; )
    YQt(e, FQt(A)), A = RQt(A);
  return e;
} : MQt, Z9A = LQt, vQt = hX, HQt = Z9A;
function SQt(A, e) {
  return vQt(A, HQt(A), e);
}
var ZQt = SQt, WQt = D9A, KQt = Z9A, UQt = qgA;
function VQt(A) {
  return WQt(A, UQt, KQt);
}
var XQt = VQt, zQt = Object.prototype, TQt = zQt.hasOwnProperty;
function _Qt(A) {
  var e = A.length, t = new A.constructor(e);
  return e && typeof A[0] == "string" && TQt.call(A, "index") && (t.index = A.index, t.input = A.input), t;
}
var qQt = _Qt, h0A = w9A;
function OQt(A) {
  var e = new A.constructor(A.byteLength);
  return new h0A(e).set(new h0A(A)), e;
}
var OgA = OQt, jQt = OgA;
function PQt(A, e) {
  var t = e ? jQt(A.buffer) : A.buffer;
  return new A.constructor(t, A.byteOffset, A.byteLength);
}
var $Qt = PQt, AEt = /\w*$/;
function eEt(A) {
  var e = new A.constructor(A.source, AEt.exec(A));
  return e.lastIndex = A.lastIndex, e;
}
var tEt = eEt, m0A = OF, p0A = m0A ? m0A.prototype : void 0, y0A = p0A ? p0A.valueOf : void 0;
function iEt(A) {
  return y0A ? Object(y0A.call(A)) : {};
}
var nEt = iEt, oEt = OgA;
function gEt(A, e) {
  var t = e ? oEt(A.buffer) : A.buffer;
  return new A.constructor(t, A.byteOffset, A.length);
}
var sEt = gEt, IEt = OgA, aEt = $Qt, rEt = tEt, CEt = nEt, BEt = sEt, lEt = "[object Boolean]", cEt = "[object Date]", QEt = "[object Map]", EEt = "[object Number]", uEt = "[object RegExp]", dEt = "[object Set]", hEt = "[object String]", mEt = "[object Symbol]", pEt = "[object ArrayBuffer]", yEt = "[object DataView]", bEt = "[object Float32Array]", wEt = "[object Float64Array]", fEt = "[object Int8Array]", DEt = "[object Int16Array]", GEt = "[object Int32Array]", kEt = "[object Uint8Array]", JEt = "[object Uint8ClampedArray]", NEt = "[object Uint16Array]", YEt = "[object Uint32Array]";
function REt(A, e, t) {
  var i = A.constructor;
  switch (e) {
    case pEt:
      return IEt(A);
    case lEt:
    case cEt:
      return new i(+A);
    case yEt:
      return aEt(A, t);
    case bEt:
    case wEt:
    case fEt:
    case DEt:
    case GEt:
    case kEt:
    case JEt:
    case NEt:
    case YEt:
      return BEt(A, t);
    case QEt:
      return new i();
    case EEt:
    case hEt:
      return new i(A);
    case uEt:
      return rEt(A);
    case dEt:
      return new i();
    case mEt:
      return CEt(A);
  }
}
var FEt = REt, MEt = XQ, b0A = Object.create, xEt = function() {
  function A() {
  }
  return function(e) {
    if (!MEt(e))
      return {};
    if (b0A)
      return b0A(e);
    A.prototype = e;
    var t = new A();
    return A.prototype = void 0, t;
  };
}(), LEt = xEt, vEt = LEt, HEt = WgA, SEt = SgA;
function ZEt(A) {
  return typeof A.constructor == "function" && !SEt(A) ? vEt(HEt(A)) : {};
}
var WEt = ZEt, KEt = EX, UEt = zQ, VEt = "[object Map]";
function XEt(A) {
  return UEt(A) && KEt(A) == VEt;
}
var zEt = XEt, TEt = zEt, _Et = vgA, w0A = HgA, f0A = w0A && w0A.isMap, qEt = f0A ? _Et(f0A) : TEt, OEt = qEt, jEt = EX, PEt = zQ, $Et = "[object Set]";
function Aut(A) {
  return PEt(A) && jEt(A) == $Et;
}
var eut = Aut, tut = eut, iut = vgA, D0A = HgA, G0A = D0A && D0A.isSet, nut = G0A ? iut(G0A) : tut, out = nut, gut = XgA, sut = Vct, Iut = S9A, aut = gQt, rut = bQt, Cut = wQt, But = DQt, lut = NQt, cut = ZQt, Qut = k9A, Eut = XQt, uut = EX, dut = qQt, hut = FEt, mut = WEt, put = vC, yut = xgA, but = OEt, wut = XQ, fut = out, Dut = n1, Gut = qgA, kut = 1, Jut = 2, Nut = 4, W9A = "[object Arguments]", Yut = "[object Array]", Rut = "[object Boolean]", Fut = "[object Date]", Mut = "[object Error]", K9A = "[object Function]", xut = "[object GeneratorFunction]", Lut = "[object Map]", vut = "[object Number]", U9A = "[object Object]", Hut = "[object RegExp]", Sut = "[object Set]", Zut = "[object String]", Wut = "[object Symbol]", Kut = "[object WeakMap]", Uut = "[object ArrayBuffer]", Vut = "[object DataView]", Xut = "[object Float32Array]", zut = "[object Float64Array]", Tut = "[object Int8Array]", _ut = "[object Int16Array]", qut = "[object Int32Array]", Out = "[object Uint8Array]", jut = "[object Uint8ClampedArray]", Put = "[object Uint16Array]", $ut = "[object Uint32Array]", Xi = {};
Xi[W9A] = Xi[Yut] = Xi[Uut] = Xi[Vut] = Xi[Rut] = Xi[Fut] = Xi[Xut] = Xi[zut] = Xi[Tut] = Xi[_ut] = Xi[qut] = Xi[Lut] = Xi[vut] = Xi[U9A] = Xi[Hut] = Xi[Sut] = Xi[Zut] = Xi[Wut] = Xi[Out] = Xi[jut] = Xi[Put] = Xi[$ut] = !0;
Xi[Mut] = Xi[K9A] = Xi[Kut] = !1;
function lv(A, e, t, i, n, o) {
  var g, s = e & kut, I = e & Jut, r = e & Nut;
  if (t && (g = n ? t(A, i, n, o) : t(A)), g !== void 0)
    return g;
  if (!wut(A))
    return A;
  var a = put(A);
  if (a) {
    if (g = dut(A), !s)
      return But(A, g);
  } else {
    var C = uut(A), B = C == K9A || C == xut;
    if (yut(A))
      return Cut(A, s);
    if (C == U9A || C == W9A || B && !n) {
      if (g = I || B ? {} : mut(A), !s)
        return I ? cut(A, rut(g, A)) : lut(A, aut(g, A));
    } else {
      if (!Xi[C])
        return n ? A : {};
      g = hut(A, C, s);
    }
  }
  o || (o = new gut());
  var l = o.get(A);
  if (l)
    return l;
  o.set(A, g), fut(A) ? A.forEach(function(d) {
    g.add(lv(d, e, t, d, A, o));
  }) : but(A) && A.forEach(function(d, m) {
    g.set(m, lv(d, e, t, m, A, o));
  });
  var Q = r ? I ? Eut : Qut : I ? Gut : Dut, E = a ? void 0 : Q(A);
  return sut(E || A, function(d, m) {
    E && (m = d, d = A[m]), Iut(g, m, lv(d, e, t, m, A, o));
  }), g;
}
var Adt = lv, edt = Adt, tdt = 1, idt = 4;
function ndt(A) {
  return edt(A, tdt | idt);
}
var odt = ndt;
Object.defineProperty(o1, "__esModule", {
  value: !0
});
o1.mergeClasses = void 0;
var gdt = ZgA, sdt = V9A(gdt), Idt = odt, adt = V9A(Idt), rdt = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
};
function V9A(A) {
  return A && A.__esModule ? A : { default: A };
}
var Cdt = o1.mergeClasses = function(A) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], t = A.default && (0, adt.default)(A.default) || {};
  return e.map(function(i) {
    var n = A[i];
    return n && (0, sdt.default)(n, function(o, g) {
      t[g] || (t[g] = {}), t[g] = rdt({}, t[g], n[g]);
    }), i;
  }), t;
};
o1.default = Cdt;
var g1 = {};
Object.defineProperty(g1, "__esModule", {
  value: !0
});
g1.autoprefix = void 0;
var Bdt = ZgA, k0A = cdt(Bdt), ldt = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
};
function cdt(A) {
  return A && A.__esModule ? A : { default: A };
}
var Qdt = {
  borderRadius: function(A) {
    return {
      msBorderRadius: A,
      MozBorderRadius: A,
      OBorderRadius: A,
      WebkitBorderRadius: A,
      borderRadius: A
    };
  },
  boxShadow: function(A) {
    return {
      msBoxShadow: A,
      MozBoxShadow: A,
      OBoxShadow: A,
      WebkitBoxShadow: A,
      boxShadow: A
    };
  },
  userSelect: function(A) {
    return {
      WebkitTouchCallout: A,
      KhtmlUserSelect: A,
      MozUserSelect: A,
      msUserSelect: A,
      WebkitUserSelect: A,
      userSelect: A
    };
  },
  flex: function(A) {
    return {
      WebkitBoxFlex: A,
      MozBoxFlex: A,
      WebkitFlex: A,
      msFlex: A,
      flex: A
    };
  },
  flexBasis: function(A) {
    return {
      WebkitFlexBasis: A,
      flexBasis: A
    };
  },
  justifyContent: function(A) {
    return {
      WebkitJustifyContent: A,
      justifyContent: A
    };
  },
  transition: function(A) {
    return {
      msTransition: A,
      MozTransition: A,
      OTransition: A,
      WebkitTransition: A,
      transition: A
    };
  },
  transform: function(A) {
    return {
      msTransform: A,
      MozTransform: A,
      OTransform: A,
      WebkitTransform: A,
      transform: A
    };
  },
  absolute: function(A) {
    var e = A && A.split(" ");
    return {
      position: "absolute",
      top: e && e[0],
      right: e && e[1],
      bottom: e && e[2],
      left: e && e[3]
    };
  },
  extend: function(A, e) {
    var t = e[A];
    return t || {
      extend: A
    };
  }
}, Edt = g1.autoprefix = function(A) {
  var e = {};
  return (0, k0A.default)(A, function(t, i) {
    var n = {};
    (0, k0A.default)(t, function(o, g) {
      var s = Qdt[g];
      s ? n = ldt({}, n, s(o)) : n[g] = o;
    }), e[i] = n;
  }), e;
};
g1.default = Edt;
var s1 = {};
Object.defineProperty(s1, "__esModule", {
  value: !0
});
s1.hover = void 0;
var udt = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, ddt = b, XT = hdt(ddt);
function hdt(A) {
  return A && A.__esModule ? A : { default: A };
}
function mdt(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function J0A(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function pdt(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var ydt = s1.hover = function(A) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "span";
  return function(t) {
    pdt(i, t);
    function i() {
      var n, o, g, s;
      mdt(this, i);
      for (var I = arguments.length, r = Array(I), a = 0; a < I; a++)
        r[a] = arguments[a];
      return s = (o = (g = J0A(this, (n = i.__proto__ || Object.getPrototypeOf(i)).call.apply(n, [this].concat(r))), g), g.state = { hover: !1 }, g.handleMouseOver = function() {
        return g.setState({ hover: !0 });
      }, g.handleMouseOut = function() {
        return g.setState({ hover: !1 });
      }, g.render = function() {
        return XT.default.createElement(
          e,
          { onMouseOver: g.handleMouseOver, onMouseOut: g.handleMouseOut },
          XT.default.createElement(A, udt({}, g.props, g.state))
        );
      }, o), J0A(g, s);
    }
    return i;
  }(XT.default.Component);
};
s1.default = ydt;
var I1 = {};
Object.defineProperty(I1, "__esModule", {
  value: !0
});
I1.active = void 0;
var bdt = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, wdt = b, zT = fdt(wdt);
function fdt(A) {
  return A && A.__esModule ? A : { default: A };
}
function Ddt(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function N0A(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function Gdt(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var kdt = I1.active = function(A) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "span";
  return function(t) {
    Gdt(i, t);
    function i() {
      var n, o, g, s;
      Ddt(this, i);
      for (var I = arguments.length, r = Array(I), a = 0; a < I; a++)
        r[a] = arguments[a];
      return s = (o = (g = N0A(this, (n = i.__proto__ || Object.getPrototypeOf(i)).call.apply(n, [this].concat(r))), g), g.state = { active: !1 }, g.handleMouseDown = function() {
        return g.setState({ active: !0 });
      }, g.handleMouseUp = function() {
        return g.setState({ active: !1 });
      }, g.render = function() {
        return zT.default.createElement(
          e,
          { onMouseDown: g.handleMouseDown, onMouseUp: g.handleMouseUp },
          zT.default.createElement(A, bdt({}, g.props, g.state))
        );
      }, o), N0A(g, s);
    }
    return i;
  }(zT.default.Component);
};
I1.default = kdt;
var jgA = {};
Object.defineProperty(jgA, "__esModule", {
  value: !0
});
var Jdt = function(A, e) {
  var t = {}, i = function(n) {
    var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
    t[n] = o;
  };
  return A === 0 && i("first-child"), A === e - 1 && i("last-child"), (A === 0 || A % 2 === 0) && i("even"), Math.abs(A % 2) === 1 && i("odd"), i("nth-child", A), t;
};
jgA.default = Jdt;
Object.defineProperty(xa, "__esModule", {
  value: !0
});
xa.ReactCSS = xa.loop = xa.handleActive = PgA = xa.handleHover = xa.hover = void 0;
var Ndt = i1, Ydt = mG(Ndt), Rdt = o1, Fdt = mG(Rdt), Mdt = g1, xdt = mG(Mdt), Ldt = s1, X9A = mG(Ldt), vdt = I1, Hdt = mG(vdt), Sdt = jgA, Zdt = mG(Sdt);
function mG(A) {
  return A && A.__esModule ? A : { default: A };
}
xa.hover = X9A.default;
var PgA = xa.handleHover = X9A.default;
xa.handleActive = Hdt.default;
xa.loop = Zdt.default;
var Wdt = xa.ReactCSS = function(A) {
  for (var e = arguments.length, t = Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  var n = (0, Ydt.default)(t), o = (0, Fdt.default)(A, n);
  return (0, xdt.default)(o);
}, st = xa.default = Wdt, Kdt = function(A, e, t, i, n) {
  var o = n.clientWidth, g = n.clientHeight, s = typeof A.pageX == "number" ? A.pageX : A.touches[0].pageX, I = typeof A.pageY == "number" ? A.pageY : A.touches[0].pageY, r = s - (n.getBoundingClientRect().left + window.pageXOffset), a = I - (n.getBoundingClientRect().top + window.pageYOffset);
  if (t === "vertical") {
    var C = void 0;
    if (a < 0 ? C = 0 : a > g ? C = 1 : C = Math.round(a * 100 / g) / 100, e.a !== C)
      return {
        h: e.h,
        s: e.s,
        l: e.l,
        a: C,
        source: "rgb"
      };
  } else {
    var B = void 0;
    if (r < 0 ? B = 0 : r > o ? B = 1 : B = Math.round(r * 100 / o) / 100, i !== B)
      return {
        h: e.h,
        s: e.s,
        l: e.l,
        a: B,
        source: "rgb"
      };
  }
  return null;
}, TT = {}, Udt = function(A, e, t, i) {
  if (typeof document > "u" && !i)
    return null;
  var n = i ? new i() : document.createElement("canvas");
  n.width = t * 2, n.height = t * 2;
  var o = n.getContext("2d");
  return o ? (o.fillStyle = A, o.fillRect(0, 0, n.width, n.height), o.fillStyle = e, o.fillRect(0, 0, t, t), o.translate(t, t), o.fillRect(0, 0, t, t), n.toDataURL()) : null;
}, Vdt = function(A, e, t, i) {
  var n = A + "-" + e + "-" + t + (i ? "-server" : "");
  if (TT[n])
    return TT[n];
  var o = Udt(A, e, t, i);
  return TT[n] = o, o;
}, Y0A = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, pG = function(A) {
  var e = A.white, t = A.grey, i = A.size, n = A.renderers, o = A.borderRadius, g = A.boxShadow, s = A.children, I = st({
    default: {
      grid: {
        borderRadius: o,
        boxShadow: g,
        absolute: "0px 0px 0px 0px",
        background: "url(" + Vdt(e, t, i, n.canvas) + ") center left"
      }
    }
  });
  return u.isValidElement(s) ? b.cloneElement(s, Y0A({}, s.props, { style: Y0A({}, s.props.style, I.grid) })) : b.createElement("div", { style: I.grid });
};
pG.defaultProps = {
  size: 8,
  white: "transparent",
  grey: "rgba(0,0,0,.08)",
  renderers: {}
};
var Xdt = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, zdt = function() {
  function A(e, t) {
    for (var i = 0; i < t.length; i++) {
      var n = t[i];
      n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
    }
  }
  return function(e, t, i) {
    return t && A(e.prototype, t), i && A(e, i), e;
  };
}();
function Tdt(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function R0A(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function _dt(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var $gA = function(A) {
  _dt(e, A);
  function e() {
    var t, i, n, o;
    Tdt(this, e);
    for (var g = arguments.length, s = Array(g), I = 0; I < g; I++)
      s[I] = arguments[I];
    return o = (i = (n = R0A(this, (t = e.__proto__ || Object.getPrototypeOf(e)).call.apply(t, [this].concat(s))), n), n.handleChange = function(r) {
      var a = Kdt(r, n.props.hsl, n.props.direction, n.props.a, n.container);
      a && typeof n.props.onChange == "function" && n.props.onChange(a, r);
    }, n.handleMouseDown = function(r) {
      n.handleChange(r), window.addEventListener("mousemove", n.handleChange), window.addEventListener("mouseup", n.handleMouseUp);
    }, n.handleMouseUp = function() {
      n.unbindEventListeners();
    }, n.unbindEventListeners = function() {
      window.removeEventListener("mousemove", n.handleChange), window.removeEventListener("mouseup", n.handleMouseUp);
    }, i), R0A(n, o);
  }
  return zdt(e, [{
    key: "componentWillUnmount",
    value: function() {
      this.unbindEventListeners();
    }
  }, {
    key: "render",
    value: function() {
      var t = this, i = this.props.rgb, n = st({
        default: {
          alpha: {
            absolute: "0px 0px 0px 0px",
            borderRadius: this.props.radius
          },
          checkboard: {
            absolute: "0px 0px 0px 0px",
            overflow: "hidden",
            borderRadius: this.props.radius
          },
          gradient: {
            absolute: "0px 0px 0px 0px",
            background: "linear-gradient(to right, rgba(" + i.r + "," + i.g + "," + i.b + `, 0) 0%,
           rgba(` + i.r + "," + i.g + "," + i.b + ", 1) 100%)",
            boxShadow: this.props.shadow,
            borderRadius: this.props.radius
          },
          container: {
            position: "relative",
            height: "100%",
            margin: "0 3px"
          },
          pointer: {
            position: "absolute",
            left: i.a * 100 + "%"
          },
          slider: {
            width: "4px",
            borderRadius: "1px",
            height: "8px",
            boxShadow: "0 0 2px rgba(0, 0, 0, .6)",
            background: "#fff",
            marginTop: "1px",
            transform: "translateX(-2px)"
          }
        },
        vertical: {
          gradient: {
            background: "linear-gradient(to bottom, rgba(" + i.r + "," + i.g + "," + i.b + `, 0) 0%,
           rgba(` + i.r + "," + i.g + "," + i.b + ", 1) 100%)"
          },
          pointer: {
            left: 0,
            top: i.a * 100 + "%"
          }
        },
        overwrite: Xdt({}, this.props.style)
      }, {
        vertical: this.props.direction === "vertical",
        overwrite: !0
      });
      return b.createElement(
        "div",
        { style: n.alpha },
        b.createElement(
          "div",
          { style: n.checkboard },
          b.createElement(pG, { renderers: this.props.renderers })
        ),
        b.createElement("div", { style: n.gradient }),
        b.createElement(
          "div",
          {
            style: n.container,
            ref: function(o) {
              return t.container = o;
            },
            onMouseDown: this.handleMouseDown,
            onTouchMove: this.handleChange,
            onTouchStart: this.handleChange
          },
          b.createElement(
            "div",
            { style: n.pointer },
            this.props.pointer ? b.createElement(this.props.pointer, this.props) : b.createElement("div", { style: n.slider })
          )
        )
      );
    }
  }]), e;
}(u.PureComponent || u.Component), qdt = function() {
  function A(e, t) {
    for (var i = 0; i < t.length; i++) {
      var n = t[i];
      n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
    }
  }
  return function(e, t, i) {
    return t && A(e.prototype, t), i && A(e, i), e;
  };
}();
function Odt(A, e, t) {
  return e in A ? Object.defineProperty(A, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : A[e] = t, A;
}
function jdt(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function Pdt(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function $dt(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var Aht = 1, z9A = 38, eht = 40, tht = [z9A, eht], iht = function(A) {
  return tht.indexOf(A) > -1;
}, nht = function(A) {
  return Number(String(A).replace(/%/g, ""));
}, oht = 1, Ut = function(A) {
  $dt(e, A);
  function e(t) {
    jdt(this, e);
    var i = Pdt(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
    return i.handleBlur = function() {
      i.state.blurValue && i.setState({ value: i.state.blurValue, blurValue: null });
    }, i.handleChange = function(n) {
      i.setUpdatedValue(n.target.value, n);
    }, i.handleKeyDown = function(n) {
      var o = nht(n.target.value);
      if (!isNaN(o) && iht(n.keyCode)) {
        var g = i.getArrowOffset(), s = n.keyCode === z9A ? o + g : o - g;
        i.setUpdatedValue(s, n);
      }
    }, i.handleDrag = function(n) {
      if (i.props.dragLabel) {
        var o = Math.round(i.props.value + n.movementX);
        o >= 0 && o <= i.props.dragMax && i.props.onChange && i.props.onChange(i.getValueObjectWithLabel(o), n);
      }
    }, i.handleMouseDown = function(n) {
      i.props.dragLabel && (n.preventDefault(), i.handleDrag(n), window.addEventListener("mousemove", i.handleDrag), window.addEventListener("mouseup", i.handleMouseUp));
    }, i.handleMouseUp = function() {
      i.unbindEventListeners();
    }, i.unbindEventListeners = function() {
      window.removeEventListener("mousemove", i.handleDrag), window.removeEventListener("mouseup", i.handleMouseUp);
    }, i.state = {
      value: String(t.value).toUpperCase(),
      blurValue: String(t.value).toUpperCase()
    }, i.inputId = "rc-editable-input-" + oht++, i;
  }
  return qdt(e, [{
    key: "componentDidUpdate",
    value: function(t, i) {
      this.props.value !== this.state.value && (t.value !== this.props.value || i.value !== this.state.value) && (this.input === document.activeElement ? this.setState({ blurValue: String(this.props.value).toUpperCase() }) : this.setState({ value: String(this.props.value).toUpperCase(), blurValue: !this.state.blurValue && String(this.props.value).toUpperCase() }));
    }
  }, {
    key: "componentWillUnmount",
    value: function() {
      this.unbindEventListeners();
    }
  }, {
    key: "getValueObjectWithLabel",
    value: function(t) {
      return Odt({}, this.props.label, t);
    }
  }, {
    key: "getArrowOffset",
    value: function() {
      return this.props.arrowOffset || Aht;
    }
  }, {
    key: "setUpdatedValue",
    value: function(t, i) {
      var n = this.props.label ? this.getValueObjectWithLabel(t) : t;
      this.props.onChange && this.props.onChange(n, i), this.setState({ value: t });
    }
  }, {
    key: "render",
    value: function() {
      var t = this, i = st({
        default: {
          wrap: {
            position: "relative"
          }
        },
        "user-override": {
          wrap: this.props.style && this.props.style.wrap ? this.props.style.wrap : {},
          input: this.props.style && this.props.style.input ? this.props.style.input : {},
          label: this.props.style && this.props.style.label ? this.props.style.label : {}
        },
        "dragLabel-true": {
          label: {
            cursor: "ew-resize"
          }
        }
      }, {
        "user-override": !0
      }, this.props);
      return b.createElement(
        "div",
        { style: i.wrap },
        b.createElement("input", {
          id: this.inputId,
          style: i.input,
          ref: function(n) {
            return t.input = n;
          },
          value: this.state.value,
          onKeyDown: this.handleKeyDown,
          onChange: this.handleChange,
          onBlur: this.handleBlur,
          placeholder: this.props.placeholder,
          spellCheck: "false"
        }),
        this.props.label && !this.props.hideLabel ? b.createElement(
          "label",
          {
            htmlFor: this.inputId,
            style: i.label,
            onMouseDown: this.handleMouseDown
          },
          this.props.label
        ) : null
      );
    }
  }]), e;
}(u.PureComponent || u.Component), ght = function(A, e, t, i) {
  var n = i.clientWidth, o = i.clientHeight, g = typeof A.pageX == "number" ? A.pageX : A.touches[0].pageX, s = typeof A.pageY == "number" ? A.pageY : A.touches[0].pageY, I = g - (i.getBoundingClientRect().left + window.pageXOffset), r = s - (i.getBoundingClientRect().top + window.pageYOffset);
  if (e === "vertical") {
    var a = void 0;
    if (r < 0)
      a = 359;
    else if (r > o)
      a = 0;
    else {
      var C = -(r * 100 / o) + 100;
      a = 360 * C / 100;
    }
    if (t.h !== a)
      return {
        h: a,
        s: t.s,
        l: t.l,
        a: t.a,
        source: "hsl"
      };
  } else {
    var B = void 0;
    if (I < 0)
      B = 0;
    else if (I > n)
      B = 359;
    else {
      var l = I * 100 / n;
      B = 360 * l / 100;
    }
    if (t.h !== B)
      return {
        h: B,
        s: t.s,
        l: t.l,
        a: t.a,
        source: "hsl"
      };
  }
  return null;
}, sht = function() {
  function A(e, t) {
    for (var i = 0; i < t.length; i++) {
      var n = t[i];
      n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
    }
  }
  return function(e, t, i) {
    return t && A(e.prototype, t), i && A(e, i), e;
  };
}();
function Iht(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function F0A(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function aht(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var yG = function(A) {
  aht(e, A);
  function e() {
    var t, i, n, o;
    Iht(this, e);
    for (var g = arguments.length, s = Array(g), I = 0; I < g; I++)
      s[I] = arguments[I];
    return o = (i = (n = F0A(this, (t = e.__proto__ || Object.getPrototypeOf(e)).call.apply(t, [this].concat(s))), n), n.handleChange = function(r) {
      var a = ght(r, n.props.direction, n.props.hsl, n.container);
      a && typeof n.props.onChange == "function" && n.props.onChange(a, r);
    }, n.handleMouseDown = function(r) {
      n.handleChange(r), window.addEventListener("mousemove", n.handleChange), window.addEventListener("mouseup", n.handleMouseUp);
    }, n.handleMouseUp = function() {
      n.unbindEventListeners();
    }, i), F0A(n, o);
  }
  return sht(e, [{
    key: "componentWillUnmount",
    value: function() {
      this.unbindEventListeners();
    }
  }, {
    key: "unbindEventListeners",
    value: function() {
      window.removeEventListener("mousemove", this.handleChange), window.removeEventListener("mouseup", this.handleMouseUp);
    }
  }, {
    key: "render",
    value: function() {
      var t = this, i = this.props.direction, n = i === void 0 ? "horizontal" : i, o = st({
        default: {
          hue: {
            absolute: "0px 0px 0px 0px",
            borderRadius: this.props.radius,
            boxShadow: this.props.shadow
          },
          container: {
            padding: "0 2px",
            position: "relative",
            height: "100%",
            borderRadius: this.props.radius
          },
          pointer: {
            position: "absolute",
            left: this.props.hsl.h * 100 / 360 + "%"
          },
          slider: {
            marginTop: "1px",
            width: "4px",
            borderRadius: "1px",
            height: "8px",
            boxShadow: "0 0 2px rgba(0, 0, 0, .6)",
            background: "#fff",
            transform: "translateX(-2px)"
          }
        },
        vertical: {
          pointer: {
            left: "0px",
            top: -(this.props.hsl.h * 100 / 360) + 100 + "%"
          }
        }
      }, { vertical: n === "vertical" });
      return b.createElement(
        "div",
        { style: o.hue },
        b.createElement(
          "div",
          {
            className: "hue-" + n,
            style: o.container,
            ref: function(g) {
              return t.container = g;
            },
            onMouseDown: this.handleMouseDown,
            onTouchMove: this.handleChange,
            onTouchStart: this.handleChange
          },
          b.createElement(
            "style",
            null,
            `
            .hue-horizontal {
              background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
                33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
              background: -webkit-linear-gradient(to right, #f00 0%, #ff0
                17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
            }

            .hue-vertical {
              background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,
                #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
              background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,
                #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
            }
          `
          ),
          b.createElement(
            "div",
            { style: o.pointer },
            this.props.pointer ? b.createElement(this.props.pointer, this.props) : b.createElement("div", { style: o.slider })
          )
        )
      );
    }
  }]), e;
}(u.PureComponent || u.Component), T9A = { exports: {} }, _T, M0A;
function rht() {
  if (M0A)
    return _T;
  M0A = 1;
  var A = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
  return _T = A, _T;
}
var qT, x0A;
function Cht() {
  if (x0A)
    return qT;
  x0A = 1;
  var A = rht();
  function e() {
  }
  function t() {
  }
  return t.resetWarningCache = e, qT = function() {
    function i(g, s, I, r, a, C) {
      if (C !== A) {
        var B = new Error(
          "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
        );
        throw B.name = "Invariant Violation", B;
      }
    }
    i.isRequired = i;
    function n() {
      return i;
    }
    var o = {
      array: i,
      bigint: i,
      bool: i,
      func: i,
      number: i,
      object: i,
      string: i,
      symbol: i,
      any: i,
      arrayOf: n,
      element: i,
      elementType: i,
      instanceOf: n,
      node: i,
      objectOf: n,
      oneOf: n,
      oneOfType: n,
      shape: n,
      exact: n,
      checkPropTypes: t,
      resetWarningCache: e
    };
    return o.PropTypes = o, o;
  }, qT;
}
T9A.exports = Cht()();
var Bht = T9A.exports;
const KA = /* @__PURE__ */ Br(Bht);
var a1 = function(A) {
  var e = A.zDepth, t = A.radius, i = A.background, n = A.children, o = A.styles, g = o === void 0 ? {} : o, s = st(nI({
    default: {
      wrap: {
        position: "relative",
        display: "inline-block"
      },
      content: {
        position: "relative"
      },
      bg: {
        absolute: "0px 0px 0px 0px",
        boxShadow: "0 " + e + "px " + e * 4 + "px rgba(0,0,0,.24)",
        borderRadius: t,
        background: i
      }
    },
    "zDepth-0": {
      bg: {
        boxShadow: "none"
      }
    },
    "zDepth-1": {
      bg: {
        boxShadow: "0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"
      }
    },
    "zDepth-2": {
      bg: {
        boxShadow: "0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"
      }
    },
    "zDepth-3": {
      bg: {
        boxShadow: "0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"
      }
    },
    "zDepth-4": {
      bg: {
        boxShadow: "0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"
      }
    },
    "zDepth-5": {
      bg: {
        boxShadow: "0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"
      }
    },
    square: {
      bg: {
        borderRadius: "0"
      }
    },
    circle: {
      bg: {
        borderRadius: "50%"
      }
    }
  }, g), { "zDepth-1": e === 1 });
  return b.createElement(
    "div",
    { style: s.wrap },
    b.createElement("div", { style: s.bg }),
    b.createElement(
      "div",
      { style: s.content },
      n
    )
  );
};
a1.propTypes = {
  background: KA.string,
  zDepth: KA.oneOf([0, 1, 2, 3, 4, 5]),
  radius: KA.number,
  styles: KA.object
};
a1.defaultProps = {
  background: "#fff",
  zDepth: 1,
  radius: 2,
  styles: {}
};
var lht = function(A, e, t) {
  var i = t.getBoundingClientRect(), n = i.width, o = i.height, g = typeof A.pageX == "number" ? A.pageX : A.touches[0].pageX, s = typeof A.pageY == "number" ? A.pageY : A.touches[0].pageY, I = g - (t.getBoundingClientRect().left + window.pageXOffset), r = s - (t.getBoundingClientRect().top + window.pageYOffset);
  I < 0 ? I = 0 : I > n && (I = n), r < 0 ? r = 0 : r > o && (r = o);
  var a = I / n, C = 1 - r / o;
  return {
    h: e.h,
    s: a,
    v: C,
    a: e.a,
    source: "hsv"
  };
}, cht = function() {
  function A(e, t) {
    for (var i = 0; i < t.length; i++) {
      var n = t[i];
      n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
    }
  }
  return function(e, t, i) {
    return t && A(e.prototype, t), i && A(e, i), e;
  };
}();
function Qht(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function Eht(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function uht(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var mX = function(A) {
  uht(e, A);
  function e(t) {
    Qht(this, e);
    var i = Eht(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t));
    return i.handleChange = function(n) {
      typeof i.props.onChange == "function" && i.throttle(i.props.onChange, lht(n, i.props.hsl, i.container), n);
    }, i.handleMouseDown = function(n) {
      i.handleChange(n);
      var o = i.getContainerRenderWindow();
      o.addEventListener("mousemove", i.handleChange), o.addEventListener("mouseup", i.handleMouseUp);
    }, i.handleMouseUp = function() {
      i.unbindEventListeners();
    }, i.throttle = Dfe(function(n, o, g) {
      n(o, g);
    }, 50), i;
  }
  return cht(e, [{
    key: "componentWillUnmount",
    value: function() {
      this.throttle.cancel(), this.unbindEventListeners();
    }
  }, {
    key: "getContainerRenderWindow",
    value: function() {
      for (var t = this.container, i = window; !i.document.contains(t) && i.parent !== i; )
        i = i.parent;
      return i;
    }
  }, {
    key: "unbindEventListeners",
    value: function() {
      var t = this.getContainerRenderWindow();
      t.removeEventListener("mousemove", this.handleChange), t.removeEventListener("mouseup", this.handleMouseUp);
    }
  }, {
    key: "render",
    value: function() {
      var t = this, i = this.props.style || {}, n = i.color, o = i.white, g = i.black, s = i.pointer, I = i.circle, r = st({
        default: {
          color: {
            absolute: "0px 0px 0px 0px",
            background: "hsl(" + this.props.hsl.h + ",100%, 50%)",
            borderRadius: this.props.radius
          },
          white: {
            absolute: "0px 0px 0px 0px",
            borderRadius: this.props.radius
          },
          black: {
            absolute: "0px 0px 0px 0px",
            boxShadow: this.props.shadow,
            borderRadius: this.props.radius
          },
          pointer: {
            position: "absolute",
            top: -(this.props.hsv.v * 100) + 100 + "%",
            left: this.props.hsv.s * 100 + "%",
            cursor: "default"
          },
          circle: {
            width: "4px",
            height: "4px",
            boxShadow: `0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),
            0 0 1px 2px rgba(0,0,0,.4)`,
            borderRadius: "50%",
            cursor: "hand",
            transform: "translate(-2px, -2px)"
          }
        },
        custom: {
          color: n,
          white: o,
          black: g,
          pointer: s,
          circle: I
        }
      }, { custom: !!this.props.style });
      return b.createElement(
        "div",
        {
          style: r.color,
          ref: function(a) {
            return t.container = a;
          },
          onMouseDown: this.handleMouseDown,
          onTouchMove: this.handleChange,
          onTouchStart: this.handleChange
        },
        b.createElement(
          "style",
          null,
          `
          .saturation-white {
            background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
            background: linear-gradient(to right, #fff, rgba(255,255,255,0));
          }
          .saturation-black {
            background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
            background: linear-gradient(to top, #000, rgba(0,0,0,0));
          }
        `
        ),
        b.createElement(
          "div",
          { style: r.white, className: "saturation-white" },
          b.createElement("div", { style: r.black, className: "saturation-black" }),
          b.createElement(
            "div",
            { style: r.pointer },
            this.props.pointer ? b.createElement(this.props.pointer, this.props) : b.createElement("div", { style: r.circle })
          )
        )
      );
    }
  }]), e;
}(u.PureComponent || u.Component);
function $Z(A) {
  return $Z = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, $Z(A);
}
var dht = /^\s+/, hht = /\s+$/;
function Ye(A, e) {
  if (A = A || "", e = e || {}, A instanceof Ye)
    return A;
  if (!(this instanceof Ye))
    return new Ye(A, e);
  var t = mht(A);
  this._originalInput = A, this._r = t.r, this._g = t.g, this._b = t.b, this._a = t.a, this._roundA = Math.round(100 * this._a) / 100, this._format = e.format || t.format, this._gradientType = e.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = t.ok;
}
Ye.prototype = {
  isDark: function() {
    return this.getBrightness() < 128;
  },
  isLight: function() {
    return !this.isDark();
  },
  isValid: function() {
    return this._ok;
  },
  getOriginalInput: function() {
    return this._originalInput;
  },
  getFormat: function() {
    return this._format;
  },
  getAlpha: function() {
    return this._a;
  },
  getBrightness: function() {
    var A = this.toRgb();
    return (A.r * 299 + A.g * 587 + A.b * 114) / 1e3;
  },
  getLuminance: function() {
    var A = this.toRgb(), e, t, i, n, o, g;
    return e = A.r / 255, t = A.g / 255, i = A.b / 255, e <= 0.03928 ? n = e / 12.92 : n = Math.pow((e + 0.055) / 1.055, 2.4), t <= 0.03928 ? o = t / 12.92 : o = Math.pow((t + 0.055) / 1.055, 2.4), i <= 0.03928 ? g = i / 12.92 : g = Math.pow((i + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * o + 0.0722 * g;
  },
  setAlpha: function(A) {
    return this._a = _9A(A), this._roundA = Math.round(100 * this._a) / 100, this;
  },
  toHsv: function() {
    var A = v0A(this._r, this._g, this._b);
    return {
      h: A.h * 360,
      s: A.s,
      v: A.v,
      a: this._a
    };
  },
  toHsvString: function() {
    var A = v0A(this._r, this._g, this._b), e = Math.round(A.h * 360), t = Math.round(A.s * 100), i = Math.round(A.v * 100);
    return this._a == 1 ? "hsv(" + e + ", " + t + "%, " + i + "%)" : "hsva(" + e + ", " + t + "%, " + i + "%, " + this._roundA + ")";
  },
  toHsl: function() {
    var A = L0A(this._r, this._g, this._b);
    return {
      h: A.h * 360,
      s: A.s,
      l: A.l,
      a: this._a
    };
  },
  toHslString: function() {
    var A = L0A(this._r, this._g, this._b), e = Math.round(A.h * 360), t = Math.round(A.s * 100), i = Math.round(A.l * 100);
    return this._a == 1 ? "hsl(" + e + ", " + t + "%, " + i + "%)" : "hsla(" + e + ", " + t + "%, " + i + "%, " + this._roundA + ")";
  },
  toHex: function(A) {
    return H0A(this._r, this._g, this._b, A);
  },
  toHexString: function(A) {
    return "#" + this.toHex(A);
  },
  toHex8: function(A) {
    return wht(this._r, this._g, this._b, this._a, A);
  },
  toHex8String: function(A) {
    return "#" + this.toHex8(A);
  },
  toRgb: function() {
    return {
      r: Math.round(this._r),
      g: Math.round(this._g),
      b: Math.round(this._b),
      a: this._a
    };
  },
  toRgbString: function() {
    return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
  },
  toPercentageRgb: function() {
    return {
      r: Math.round(Bn(this._r, 255) * 100) + "%",
      g: Math.round(Bn(this._g, 255) * 100) + "%",
      b: Math.round(Bn(this._b, 255) * 100) + "%",
      a: this._a
    };
  },
  toPercentageRgbString: function() {
    return this._a == 1 ? "rgb(" + Math.round(Bn(this._r, 255) * 100) + "%, " + Math.round(Bn(this._g, 255) * 100) + "%, " + Math.round(Bn(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(Bn(this._r, 255) * 100) + "%, " + Math.round(Bn(this._g, 255) * 100) + "%, " + Math.round(Bn(this._b, 255) * 100) + "%, " + this._roundA + ")";
  },
  toName: function() {
    return this._a === 0 ? "transparent" : this._a < 1 ? !1 : Lht[H0A(this._r, this._g, this._b, !0)] || !1;
  },
  toFilter: function(A) {
    var e = "#" + S0A(this._r, this._g, this._b, this._a), t = e, i = this._gradientType ? "GradientType = 1, " : "";
    if (A) {
      var n = Ye(A);
      t = "#" + S0A(n._r, n._g, n._b, n._a);
    }
    return "progid:DXImageTransform.Microsoft.gradient(" + i + "startColorstr=" + e + ",endColorstr=" + t + ")";
  },
  toString: function(A) {
    var e = !!A;
    A = A || this._format;
    var t = !1, i = this._a < 1 && this._a >= 0, n = !e && i && (A === "hex" || A === "hex6" || A === "hex3" || A === "hex4" || A === "hex8" || A === "name");
    return n ? A === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (A === "rgb" && (t = this.toRgbString()), A === "prgb" && (t = this.toPercentageRgbString()), (A === "hex" || A === "hex6") && (t = this.toHexString()), A === "hex3" && (t = this.toHexString(!0)), A === "hex4" && (t = this.toHex8String(!0)), A === "hex8" && (t = this.toHex8String()), A === "name" && (t = this.toName()), A === "hsl" && (t = this.toHslString()), A === "hsv" && (t = this.toHsvString()), t || this.toHexString());
  },
  clone: function() {
    return Ye(this.toString());
  },
  _applyModification: function(A, e) {
    var t = A.apply(null, [this].concat([].slice.call(e)));
    return this._r = t._r, this._g = t._g, this._b = t._b, this.setAlpha(t._a), this;
  },
  lighten: function() {
    return this._applyModification(kht, arguments);
  },
  brighten: function() {
    return this._applyModification(Jht, arguments);
  },
  darken: function() {
    return this._applyModification(Nht, arguments);
  },
  desaturate: function() {
    return this._applyModification(fht, arguments);
  },
  saturate: function() {
    return this._applyModification(Dht, arguments);
  },
  greyscale: function() {
    return this._applyModification(Ght, arguments);
  },
  spin: function() {
    return this._applyModification(Yht, arguments);
  },
  _applyCombination: function(A, e) {
    return A.apply(null, [this].concat([].slice.call(e)));
  },
  analogous: function() {
    return this._applyCombination(Mht, arguments);
  },
  complement: function() {
    return this._applyCombination(Rht, arguments);
  },
  monochromatic: function() {
    return this._applyCombination(xht, arguments);
  },
  splitcomplement: function() {
    return this._applyCombination(Fht, arguments);
  },
  // Disabled until https://github.com/bgrins/TinyColor/issues/254
  // polyad: function (number) {
  //   return this._applyCombination(polyad, [number]);
  // },
  triad: function() {
    return this._applyCombination(Z0A, [3]);
  },
  tetrad: function() {
    return this._applyCombination(Z0A, [4]);
  }
};
Ye.fromRatio = function(A, e) {
  if ($Z(A) == "object") {
    var t = {};
    for (var i in A)
      A.hasOwnProperty(i) && (i === "a" ? t[i] = A[i] : t[i] = WJ(A[i]));
    A = t;
  }
  return Ye(A, e);
};
function mht(A) {
  var e = {
    r: 0,
    g: 0,
    b: 0
  }, t = 1, i = null, n = null, o = null, g = !1, s = !1;
  return typeof A == "string" && (A = Zht(A)), $Z(A) == "object" && (sc(A.r) && sc(A.g) && sc(A.b) ? (e = pht(A.r, A.g, A.b), g = !0, s = String(A.r).substr(-1) === "%" ? "prgb" : "rgb") : sc(A.h) && sc(A.s) && sc(A.v) ? (i = WJ(A.s), n = WJ(A.v), e = bht(A.h, i, n), g = !0, s = "hsv") : sc(A.h) && sc(A.s) && sc(A.l) && (i = WJ(A.s), o = WJ(A.l), e = yht(A.h, i, o), g = !0, s = "hsl"), A.hasOwnProperty("a") && (t = A.a)), t = _9A(t), {
    ok: g,
    format: A.format || s,
    r: Math.min(255, Math.max(e.r, 0)),
    g: Math.min(255, Math.max(e.g, 0)),
    b: Math.min(255, Math.max(e.b, 0)),
    a: t
  };
}
function pht(A, e, t) {
  return {
    r: Bn(A, 255) * 255,
    g: Bn(e, 255) * 255,
    b: Bn(t, 255) * 255
  };
}
function L0A(A, e, t) {
  A = Bn(A, 255), e = Bn(e, 255), t = Bn(t, 255);
  var i = Math.max(A, e, t), n = Math.min(A, e, t), o, g, s = (i + n) / 2;
  if (i == n)
    o = g = 0;
  else {
    var I = i - n;
    switch (g = s > 0.5 ? I / (2 - i - n) : I / (i + n), i) {
      case A:
        o = (e - t) / I + (e < t ? 6 : 0);
        break;
      case e:
        o = (t - A) / I + 2;
        break;
      case t:
        o = (A - e) / I + 4;
        break;
    }
    o /= 6;
  }
  return {
    h: o,
    s: g,
    l: s
  };
}
function yht(A, e, t) {
  var i, n, o;
  A = Bn(A, 360), e = Bn(e, 100), t = Bn(t, 100);
  function g(r, a, C) {
    return C < 0 && (C += 1), C > 1 && (C -= 1), C < 1 / 6 ? r + (a - r) * 6 * C : C < 1 / 2 ? a : C < 2 / 3 ? r + (a - r) * (2 / 3 - C) * 6 : r;
  }
  if (e === 0)
    i = n = o = t;
  else {
    var s = t < 0.5 ? t * (1 + e) : t + e - t * e, I = 2 * t - s;
    i = g(I, s, A + 1 / 3), n = g(I, s, A), o = g(I, s, A - 1 / 3);
  }
  return {
    r: i * 255,
    g: n * 255,
    b: o * 255
  };
}
function v0A(A, e, t) {
  A = Bn(A, 255), e = Bn(e, 255), t = Bn(t, 255);
  var i = Math.max(A, e, t), n = Math.min(A, e, t), o, g, s = i, I = i - n;
  if (g = i === 0 ? 0 : I / i, i == n)
    o = 0;
  else {
    switch (i) {
      case A:
        o = (e - t) / I + (e < t ? 6 : 0);
        break;
      case e:
        o = (t - A) / I + 2;
        break;
      case t:
        o = (A - e) / I + 4;
        break;
    }
    o /= 6;
  }
  return {
    h: o,
    s: g,
    v: s
  };
}
function bht(A, e, t) {
  A = Bn(A, 360) * 6, e = Bn(e, 100), t = Bn(t, 100);
  var i = Math.floor(A), n = A - i, o = t * (1 - e), g = t * (1 - n * e), s = t * (1 - (1 - n) * e), I = i % 6, r = [t, g, o, o, s, t][I], a = [s, t, t, g, o, o][I], C = [o, o, s, t, t, g][I];
  return {
    r: r * 255,
    g: a * 255,
    b: C * 255
  };
}
function H0A(A, e, t, i) {
  var n = [$r(Math.round(A).toString(16)), $r(Math.round(e).toString(16)), $r(Math.round(t).toString(16))];
  return i && n[0].charAt(0) == n[0].charAt(1) && n[1].charAt(0) == n[1].charAt(1) && n[2].charAt(0) == n[2].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
}
function wht(A, e, t, i, n) {
  var o = [$r(Math.round(A).toString(16)), $r(Math.round(e).toString(16)), $r(Math.round(t).toString(16)), $r(q9A(i))];
  return n && o[0].charAt(0) == o[0].charAt(1) && o[1].charAt(0) == o[1].charAt(1) && o[2].charAt(0) == o[2].charAt(1) && o[3].charAt(0) == o[3].charAt(1) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join("");
}
function S0A(A, e, t, i) {
  var n = [$r(q9A(i)), $r(Math.round(A).toString(16)), $r(Math.round(e).toString(16)), $r(Math.round(t).toString(16))];
  return n.join("");
}
Ye.equals = function(A, e) {
  return !A || !e ? !1 : Ye(A).toRgbString() == Ye(e).toRgbString();
};
Ye.random = function() {
  return Ye.fromRatio({
    r: Math.random(),
    g: Math.random(),
    b: Math.random()
  });
};
function fht(A, e) {
  e = e === 0 ? 0 : e || 10;
  var t = Ye(A).toHsl();
  return t.s -= e / 100, t.s = pX(t.s), Ye(t);
}
function Dht(A, e) {
  e = e === 0 ? 0 : e || 10;
  var t = Ye(A).toHsl();
  return t.s += e / 100, t.s = pX(t.s), Ye(t);
}
function Ght(A) {
  return Ye(A).desaturate(100);
}
function kht(A, e) {
  e = e === 0 ? 0 : e || 10;
  var t = Ye(A).toHsl();
  return t.l += e / 100, t.l = pX(t.l), Ye(t);
}
function Jht(A, e) {
  e = e === 0 ? 0 : e || 10;
  var t = Ye(A).toRgb();
  return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), Ye(t);
}
function Nht(A, e) {
  e = e === 0 ? 0 : e || 10;
  var t = Ye(A).toHsl();
  return t.l -= e / 100, t.l = pX(t.l), Ye(t);
}
function Yht(A, e) {
  var t = Ye(A).toHsl(), i = (t.h + e) % 360;
  return t.h = i < 0 ? 360 + i : i, Ye(t);
}
function Rht(A) {
  var e = Ye(A).toHsl();
  return e.h = (e.h + 180) % 360, Ye(e);
}
function Z0A(A, e) {
  if (isNaN(e) || e <= 0)
    throw new Error("Argument to polyad must be a positive number");
  for (var t = Ye(A).toHsl(), i = [Ye(A)], n = 360 / e, o = 1; o < e; o++)
    i.push(Ye({
      h: (t.h + o * n) % 360,
      s: t.s,
      l: t.l
    }));
  return i;
}
function Fht(A) {
  var e = Ye(A).toHsl(), t = e.h;
  return [Ye(A), Ye({
    h: (t + 72) % 360,
    s: e.s,
    l: e.l
  }), Ye({
    h: (t + 216) % 360,
    s: e.s,
    l: e.l
  })];
}
function Mht(A, e, t) {
  e = e || 6, t = t || 30;
  var i = Ye(A).toHsl(), n = 360 / t, o = [Ye(A)];
  for (i.h = (i.h - (n * e >> 1) + 720) % 360; --e; )
    i.h = (i.h + n) % 360, o.push(Ye(i));
  return o;
}
function xht(A, e) {
  e = e || 6;
  for (var t = Ye(A).toHsv(), i = t.h, n = t.s, o = t.v, g = [], s = 1 / e; e--; )
    g.push(Ye({
      h: i,
      s: n,
      v: o
    })), o = (o + s) % 1;
  return g;
}
Ye.mix = function(A, e, t) {
  t = t === 0 ? 0 : t || 50;
  var i = Ye(A).toRgb(), n = Ye(e).toRgb(), o = t / 100, g = {
    r: (n.r - i.r) * o + i.r,
    g: (n.g - i.g) * o + i.g,
    b: (n.b - i.b) * o + i.b,
    a: (n.a - i.a) * o + i.a
  };
  return Ye(g);
};
Ye.readability = function(A, e) {
  var t = Ye(A), i = Ye(e);
  return (Math.max(t.getLuminance(), i.getLuminance()) + 0.05) / (Math.min(t.getLuminance(), i.getLuminance()) + 0.05);
};
Ye.isReadable = function(A, e, t) {
  var i = Ye.readability(A, e), n, o;
  switch (o = !1, n = Wht(t), n.level + n.size) {
    case "AAsmall":
    case "AAAlarge":
      o = i >= 4.5;
      break;
    case "AAlarge":
      o = i >= 3;
      break;
    case "AAAsmall":
      o = i >= 7;
      break;
  }
  return o;
};
Ye.mostReadable = function(A, e, t) {
  var i = null, n = 0, o, g, s, I;
  t = t || {}, g = t.includeFallbackColors, s = t.level, I = t.size;
  for (var r = 0; r < e.length; r++)
    o = Ye.readability(A, e[r]), o > n && (n = o, i = Ye(e[r]));
  return Ye.isReadable(A, i, {
    level: s,
    size: I
  }) || !g ? i : (t.includeFallbackColors = !1, Ye.mostReadable(A, ["#fff", "#000"], t));
};
var t6 = Ye.names = {
  aliceblue: "f0f8ff",
  antiquewhite: "faebd7",
  aqua: "0ff",
  aquamarine: "7fffd4",
  azure: "f0ffff",
  beige: "f5f5dc",
  bisque: "ffe4c4",
  black: "000",
  blanchedalmond: "ffebcd",
  blue: "00f",
  blueviolet: "8a2be2",
  brown: "a52a2a",
  burlywood: "deb887",
  burntsienna: "ea7e5d",
  cadetblue: "5f9ea0",
  chartreuse: "7fff00",
  chocolate: "d2691e",
  coral: "ff7f50",
  cornflowerblue: "6495ed",
  cornsilk: "fff8dc",
  crimson: "dc143c",
  cyan: "0ff",
  darkblue: "00008b",
  darkcyan: "008b8b",
  darkgoldenrod: "b8860b",
  darkgray: "a9a9a9",
  darkgreen: "006400",
  darkgrey: "a9a9a9",
  darkkhaki: "bdb76b",
  darkmagenta: "8b008b",
  darkolivegreen: "556b2f",
  darkorange: "ff8c00",
  darkorchid: "9932cc",
  darkred: "8b0000",
  darksalmon: "e9967a",
  darkseagreen: "8fbc8f",
  darkslateblue: "483d8b",
  darkslategray: "2f4f4f",
  darkslategrey: "2f4f4f",
  darkturquoise: "00ced1",
  darkviolet: "9400d3",
  deeppink: "ff1493",
  deepskyblue: "00bfff",
  dimgray: "696969",
  dimgrey: "696969",
  dodgerblue: "1e90ff",
  firebrick: "b22222",
  floralwhite: "fffaf0",
  forestgreen: "228b22",
  fuchsia: "f0f",
  gainsboro: "dcdcdc",
  ghostwhite: "f8f8ff",
  gold: "ffd700",
  goldenrod: "daa520",
  gray: "808080",
  green: "008000",
  greenyellow: "adff2f",
  grey: "808080",
  honeydew: "f0fff0",
  hotpink: "ff69b4",
  indianred: "cd5c5c",
  indigo: "4b0082",
  ivory: "fffff0",
  khaki: "f0e68c",
  lavender: "e6e6fa",
  lavenderblush: "fff0f5",
  lawngreen: "7cfc00",
  lemonchiffon: "fffacd",
  lightblue: "add8e6",
  lightcoral: "f08080",
  lightcyan: "e0ffff",
  lightgoldenrodyellow: "fafad2",
  lightgray: "d3d3d3",
  lightgreen: "90ee90",
  lightgrey: "d3d3d3",
  lightpink: "ffb6c1",
  lightsalmon: "ffa07a",
  lightseagreen: "20b2aa",
  lightskyblue: "87cefa",
  lightslategray: "789",
  lightslategrey: "789",
  lightsteelblue: "b0c4de",
  lightyellow: "ffffe0",
  lime: "0f0",
  limegreen: "32cd32",
  linen: "faf0e6",
  magenta: "f0f",
  maroon: "800000",
  mediumaquamarine: "66cdaa",
  mediumblue: "0000cd",
  mediumorchid: "ba55d3",
  mediumpurple: "9370db",
  mediumseagreen: "3cb371",
  mediumslateblue: "7b68ee",
  mediumspringgreen: "00fa9a",
  mediumturquoise: "48d1cc",
  mediumvioletred: "c71585",
  midnightblue: "191970",
  mintcream: "f5fffa",
  mistyrose: "ffe4e1",
  moccasin: "ffe4b5",
  navajowhite: "ffdead",
  navy: "000080",
  oldlace: "fdf5e6",
  olive: "808000",
  olivedrab: "6b8e23",
  orange: "ffa500",
  orangered: "ff4500",
  orchid: "da70d6",
  palegoldenrod: "eee8aa",
  palegreen: "98fb98",
  paleturquoise: "afeeee",
  palevioletred: "db7093",
  papayawhip: "ffefd5",
  peachpuff: "ffdab9",
  peru: "cd853f",
  pink: "ffc0cb",
  plum: "dda0dd",
  powderblue: "b0e0e6",
  purple: "800080",
  rebeccapurple: "663399",
  red: "f00",
  rosybrown: "bc8f8f",
  royalblue: "4169e1",
  saddlebrown: "8b4513",
  salmon: "fa8072",
  sandybrown: "f4a460",
  seagreen: "2e8b57",
  seashell: "fff5ee",
  sienna: "a0522d",
  silver: "c0c0c0",
  skyblue: "87ceeb",
  slateblue: "6a5acd",
  slategray: "708090",
  slategrey: "708090",
  snow: "fffafa",
  springgreen: "00ff7f",
  steelblue: "4682b4",
  tan: "d2b48c",
  teal: "008080",
  thistle: "d8bfd8",
  tomato: "ff6347",
  turquoise: "40e0d0",
  violet: "ee82ee",
  wheat: "f5deb3",
  white: "fff",
  whitesmoke: "f5f5f5",
  yellow: "ff0",
  yellowgreen: "9acd32"
}, Lht = Ye.hexNames = vht(t6);
function vht(A) {
  var e = {};
  for (var t in A)
    A.hasOwnProperty(t) && (e[A[t]] = t);
  return e;
}
function _9A(A) {
  return A = parseFloat(A), (isNaN(A) || A < 0 || A > 1) && (A = 1), A;
}
function Bn(A, e) {
  Hht(A) && (A = "100%");
  var t = Sht(A);
  return A = Math.min(e, Math.max(0, parseFloat(A))), t && (A = parseInt(A * e, 10) / 100), Math.abs(A - e) < 1e-6 ? 1 : A % e / parseFloat(e);
}
function pX(A) {
  return Math.min(1, Math.max(0, A));
}
function hI(A) {
  return parseInt(A, 16);
}
function Hht(A) {
  return typeof A == "string" && A.indexOf(".") != -1 && parseFloat(A) === 1;
}
function Sht(A) {
  return typeof A == "string" && A.indexOf("%") != -1;
}
function $r(A) {
  return A.length == 1 ? "0" + A : "" + A;
}
function WJ(A) {
  return A <= 1 && (A = A * 100 + "%"), A;
}
function q9A(A) {
  return Math.round(parseFloat(A) * 255).toString(16);
}
function W0A(A) {
  return hI(A) / 255;
}
var Nr = function() {
  var A = "[-\\+]?\\d+%?", e = "[-\\+]?\\d*\\.\\d+%?", t = "(?:" + e + ")|(?:" + A + ")", i = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?", n = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?";
  return {
    CSS_UNIT: new RegExp(t),
    rgb: new RegExp("rgb" + i),
    rgba: new RegExp("rgba" + n),
    hsl: new RegExp("hsl" + i),
    hsla: new RegExp("hsla" + n),
    hsv: new RegExp("hsv" + i),
    hsva: new RegExp("hsva" + n),
    hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
    hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  };
}();
function sc(A) {
  return !!Nr.CSS_UNIT.exec(A);
}
function Zht(A) {
  A = A.replace(dht, "").replace(hht, "").toLowerCase();
  var e = !1;
  if (t6[A])
    A = t6[A], e = !0;
  else if (A == "transparent")
    return {
      r: 0,
      g: 0,
      b: 0,
      a: 0,
      format: "name"
    };
  var t;
  return (t = Nr.rgb.exec(A)) ? {
    r: t[1],
    g: t[2],
    b: t[3]
  } : (t = Nr.rgba.exec(A)) ? {
    r: t[1],
    g: t[2],
    b: t[3],
    a: t[4]
  } : (t = Nr.hsl.exec(A)) ? {
    h: t[1],
    s: t[2],
    l: t[3]
  } : (t = Nr.hsla.exec(A)) ? {
    h: t[1],
    s: t[2],
    l: t[3],
    a: t[4]
  } : (t = Nr.hsv.exec(A)) ? {
    h: t[1],
    s: t[2],
    v: t[3]
  } : (t = Nr.hsva.exec(A)) ? {
    h: t[1],
    s: t[2],
    v: t[3],
    a: t[4]
  } : (t = Nr.hex8.exec(A)) ? {
    r: hI(t[1]),
    g: hI(t[2]),
    b: hI(t[3]),
    a: W0A(t[4]),
    format: e ? "name" : "hex8"
  } : (t = Nr.hex6.exec(A)) ? {
    r: hI(t[1]),
    g: hI(t[2]),
    b: hI(t[3]),
    format: e ? "name" : "hex"
  } : (t = Nr.hex4.exec(A)) ? {
    r: hI(t[1] + "" + t[1]),
    g: hI(t[2] + "" + t[2]),
    b: hI(t[3] + "" + t[3]),
    a: W0A(t[4] + "" + t[4]),
    format: e ? "name" : "hex8"
  } : (t = Nr.hex3.exec(A)) ? {
    r: hI(t[1] + "" + t[1]),
    g: hI(t[2] + "" + t[2]),
    b: hI(t[3] + "" + t[3]),
    format: e ? "name" : "hex"
  } : !1;
}
function Wht(A) {
  var e, t;
  return A = A || {
    level: "AA",
    size: "small"
  }, e = (A.level || "AA").toUpperCase(), t = (A.size || "small").toLowerCase(), e !== "AA" && e !== "AAA" && (e = "AA"), t !== "small" && t !== "large" && (t = "small"), {
    level: e,
    size: t
  };
}
var K0A = function(A) {
  var e = ["r", "g", "b", "a", "h", "s", "l", "v"], t = 0, i = 0;
  return Efe(e, function(n) {
    if (A[n] && (t += 1, isNaN(A[n]) || (i += 1), n === "s" || n === "l")) {
      var o = /^\d+%$/;
      o.test(A[n]) && (i += 1);
    }
  }), t === i ? A : !1;
}, KJ = function(A, e) {
  var t = A.hex ? Ye(A.hex) : Ye(A), i = t.toHsl(), n = t.toHsv(), o = t.toRgb(), g = t.toHex();
  i.s === 0 && (i.h = e || 0, n.h = e || 0);
  var s = g === "000000" && o.a === 0;
  return {
    hsl: i,
    hex: s ? "transparent" : "#" + g,
    rgb: o,
    hsv: n,
    oldHue: A.h || e || i.h,
    source: A.source
  };
}, $d = function(A) {
  if (A === "transparent")
    return !0;
  var e = String(A).charAt(0) === "#" ? 1 : 0;
  return A.length !== 4 + e && A.length < 7 + e && Ye(A).isValid();
}, AsA = function(A) {
  if (!A)
    return "#fff";
  var e = KJ(A);
  if (e.hex === "transparent")
    return "rgba(0,0,0,0.4)";
  var t = (e.rgb.r * 299 + e.rgb.g * 587 + e.rgb.b * 114) / 1e3;
  return t >= 128 ? "#000" : "#fff";
}, OT = function(A, e) {
  var t = A.replace("°", "");
  return Ye(e + " (" + t + ")")._ok;
}, jk = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, Kht = function() {
  function A(e, t) {
    for (var i = 0; i < t.length; i++) {
      var n = t[i];
      n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
    }
  }
  return function(e, t, i) {
    return t && A(e.prototype, t), i && A(e, i), e;
  };
}();
function Uht(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function Vht(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function Xht(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var II = function(A) {
  var e = function(t) {
    Xht(i, t);
    function i(n) {
      Uht(this, i);
      var o = Vht(this, (i.__proto__ || Object.getPrototypeOf(i)).call(this));
      return o.handleChange = function(g, s) {
        var I = K0A(g);
        if (I) {
          var r = KJ(g, g.h || o.state.oldHue);
          o.setState(r), o.props.onChangeComplete && o.debounce(o.props.onChangeComplete, r, s), o.props.onChange && o.props.onChange(r, s);
        }
      }, o.handleSwatchHover = function(g, s) {
        var I = K0A(g);
        if (I) {
          var r = KJ(g, g.h || o.state.oldHue);
          o.props.onSwatchHover && o.props.onSwatchHover(r, s);
        }
      }, o.state = jk({}, KJ(n.color, 0)), o.debounce = wD(function(g, s, I) {
        g(s, I);
      }, 100), o;
    }
    return Kht(i, [{
      key: "render",
      value: function() {
        var n = {};
        return this.props.onSwatchHover && (n.onSwatchHover = this.handleSwatchHover), b.createElement(A, jk({}, this.props, this.state, {
          onChange: this.handleChange
        }, n));
      }
    }], [{
      key: "getDerivedStateFromProps",
      value: function(n, o) {
        return jk({}, KJ(n.color, o.oldHue));
      }
    }]), i;
  }(u.PureComponent || u.Component);
  return e.propTypes = jk({}, A.propTypes), e.defaultProps = jk({}, A.defaultProps, {
    color: {
      h: 250,
      s: 0.5,
      l: 0.2,
      a: 1
    }
  }), e;
}, zht = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, Tht = function() {
  function A(e, t) {
    for (var i = 0; i < t.length; i++) {
      var n = t[i];
      n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
    }
  }
  return function(e, t, i) {
    return t && A(e.prototype, t), i && A(e, i), e;
  };
}();
function _ht(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function U0A(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function qht(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var Oht = function(A) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "span";
  return function(t) {
    qht(i, t);
    function i() {
      var n, o, g, s;
      _ht(this, i);
      for (var I = arguments.length, r = Array(I), a = 0; a < I; a++)
        r[a] = arguments[a];
      return s = (o = (g = U0A(this, (n = i.__proto__ || Object.getPrototypeOf(i)).call.apply(n, [this].concat(r))), g), g.state = { focus: !1 }, g.handleFocus = function() {
        return g.setState({ focus: !0 });
      }, g.handleBlur = function() {
        return g.setState({ focus: !1 });
      }, o), U0A(g, s);
    }
    return Tht(i, [{
      key: "render",
      value: function() {
        return b.createElement(
          e,
          { onFocus: this.handleFocus, onBlur: this.handleBlur },
          b.createElement(A, zht({}, this.props, this.state))
        );
      }
    }]), i;
  }(b.Component);
}, V0A = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, jht = 13, Pht = function(A) {
  var e = A.color, t = A.style, i = A.onClick, n = i === void 0 ? function() {
  } : i, o = A.onHover, g = A.title, s = g === void 0 ? e : g, I = A.children, r = A.focus, a = A.focusStyle, C = a === void 0 ? {} : a, B = e === "transparent", l = st({
    default: {
      swatch: V0A({
        background: e,
        height: "100%",
        width: "100%",
        cursor: "pointer",
        position: "relative",
        outline: "none"
      }, t, r ? C : {})
    }
  }), Q = function(y) {
    return n(e, y);
  }, E = function(y) {
    return y.keyCode === jht && n(e, y);
  }, d = function(y) {
    return o(e, y);
  }, m = {};
  return o && (m.onMouseOver = d), b.createElement(
    "div",
    V0A({
      style: l.swatch,
      onClick: Q,
      title: s,
      tabIndex: 0,
      onKeyDown: E
    }, m),
    I,
    B && b.createElement(pG, {
      borderRadius: l.swatch.borderRadius,
      boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.1)"
    })
  );
};
const D0 = Oht(Pht);
var $ht = function(A) {
  var e = A.direction, t = st({
    default: {
      picker: {
        width: "18px",
        height: "18px",
        borderRadius: "50%",
        transform: "translate(-9px, -1px)",
        backgroundColor: "rgb(248, 248, 248)",
        boxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.37)"
      }
    },
    vertical: {
      picker: {
        transform: "translate(-3px, -9px)"
      }
    }
  }, { vertical: e === "vertical" });
  return b.createElement("div", { style: t.picker });
}, Amt = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, O9A = function(A) {
  var e = A.rgb, t = A.hsl, i = A.width, n = A.height, o = A.onChange, g = A.direction, s = A.style, I = A.renderers, r = A.pointer, a = A.className, C = a === void 0 ? "" : a, B = st({
    default: {
      picker: {
        position: "relative",
        width: i,
        height: n
      },
      alpha: {
        radius: "2px",
        style: s
      }
    }
  });
  return b.createElement(
    "div",
    { style: B.picker, className: "alpha-picker " + C },
    b.createElement($gA, Amt({}, B.alpha, {
      rgb: e,
      hsl: t,
      pointer: r,
      renderers: I,
      onChange: o,
      direction: g
    }))
  );
};
O9A.defaultProps = {
  width: "316px",
  height: "16px",
  direction: "horizontal",
  pointer: $ht
};
II(O9A);
var emt = function(A) {
  var e = A.colors, t = A.onClick, i = A.onSwatchHover, n = st({
    default: {
      swatches: {
        marginRight: "-10px"
      },
      swatch: {
        width: "22px",
        height: "22px",
        float: "left",
        marginRight: "10px",
        marginBottom: "10px",
        borderRadius: "4px"
      },
      clear: {
        clear: "both"
      }
    }
  });
  return b.createElement(
    "div",
    { style: n.swatches },
    t0(e, function(o) {
      return b.createElement(D0, {
        key: o,
        color: o,
        style: n.swatch,
        onClick: t,
        onHover: i,
        focusStyle: {
          boxShadow: "0 0 4px " + o
        }
      });
    }),
    b.createElement("div", { style: n.clear })
  );
}, esA = function(A) {
  var e = A.onChange, t = A.onSwatchHover, i = A.hex, n = A.colors, o = A.width, g = A.triangle, s = A.styles, I = s === void 0 ? {} : s, r = A.className, a = r === void 0 ? "" : r, C = i === "transparent", B = function(Q, E) {
    $d(Q) && e({
      hex: Q,
      source: "hex"
    }, E);
  }, l = st(nI({
    default: {
      card: {
        width: o,
        background: "#fff",
        boxShadow: "0 1px rgba(0,0,0,.1)",
        borderRadius: "6px",
        position: "relative"
      },
      head: {
        height: "110px",
        background: i,
        borderRadius: "6px 6px 0 0",
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        position: "relative"
      },
      body: {
        padding: "10px"
      },
      label: {
        fontSize: "18px",
        color: AsA(i),
        position: "relative"
      },
      triangle: {
        width: "0px",
        height: "0px",
        borderStyle: "solid",
        borderWidth: "0 10px 10px 10px",
        borderColor: "transparent transparent " + i + " transparent",
        position: "absolute",
        top: "-10px",
        left: "50%",
        marginLeft: "-10px"
      },
      input: {
        width: "100%",
        fontSize: "12px",
        color: "#666",
        border: "0px",
        outline: "none",
        height: "22px",
        boxShadow: "inset 0 0 0 1px #ddd",
        borderRadius: "4px",
        padding: "0 7px",
        boxSizing: "border-box"
      }
    },
    "hide-triangle": {
      triangle: {
        display: "none"
      }
    }
  }, I), { "hide-triangle": g === "hide" });
  return b.createElement(
    "div",
    { style: l.card, className: "block-picker " + a },
    b.createElement("div", { style: l.triangle }),
    b.createElement(
      "div",
      { style: l.head },
      C && b.createElement(pG, { borderRadius: "6px 6px 0 0" }),
      b.createElement(
        "div",
        { style: l.label },
        i
      )
    ),
    b.createElement(
      "div",
      { style: l.body },
      b.createElement(emt, { colors: n, onClick: B, onSwatchHover: t }),
      b.createElement(Ut, {
        style: { input: l.input },
        value: i,
        onChange: B
      })
    )
  );
};
esA.propTypes = {
  width: KA.oneOfType([KA.string, KA.number]),
  colors: KA.arrayOf(KA.string),
  triangle: KA.oneOf(["top", "hide"]),
  styles: KA.object
};
esA.defaultProps = {
  width: 170,
  colors: ["#D9E3F0", "#F47373", "#697689", "#37D67A", "#2CCCE4", "#555555", "#dce775", "#ff8a65", "#ba68c8"],
  triangle: "top",
  styles: {}
};
II(esA);
var qy = { 50: "#ffebee", 100: "#ffcdd2", 200: "#ef9a9a", 300: "#e57373", 400: "#ef5350", 500: "#f44336", 600: "#e53935", 700: "#d32f2f", 800: "#c62828", 900: "#b71c1c", a100: "#ff8a80", a200: "#ff5252", a400: "#ff1744", a700: "#d50000" }, Oy = { 50: "#fce4ec", 100: "#f8bbd0", 200: "#f48fb1", 300: "#f06292", 400: "#ec407a", 500: "#e91e63", 600: "#d81b60", 700: "#c2185b", 800: "#ad1457", 900: "#880e4f", a100: "#ff80ab", a200: "#ff4081", a400: "#f50057", a700: "#c51162" }, jy = { 50: "#f3e5f5", 100: "#e1bee7", 200: "#ce93d8", 300: "#ba68c8", 400: "#ab47bc", 500: "#9c27b0", 600: "#8e24aa", 700: "#7b1fa2", 800: "#6a1b9a", 900: "#4a148c", a100: "#ea80fc", a200: "#e040fb", a400: "#d500f9", a700: "#aa00ff" }, Py = { 50: "#ede7f6", 100: "#d1c4e9", 200: "#b39ddb", 300: "#9575cd", 400: "#7e57c2", 500: "#673ab7", 600: "#5e35b1", 700: "#512da8", 800: "#4527a0", 900: "#311b92", a100: "#b388ff", a200: "#7c4dff", a400: "#651fff", a700: "#6200ea" }, $y = { 50: "#e8eaf6", 100: "#c5cae9", 200: "#9fa8da", 300: "#7986cb", 400: "#5c6bc0", 500: "#3f51b5", 600: "#3949ab", 700: "#303f9f", 800: "#283593", 900: "#1a237e", a100: "#8c9eff", a200: "#536dfe", a400: "#3d5afe", a700: "#304ffe" }, Ab = { 50: "#e3f2fd", 100: "#bbdefb", 200: "#90caf9", 300: "#64b5f6", 400: "#42a5f5", 500: "#2196f3", 600: "#1e88e5", 700: "#1976d2", 800: "#1565c0", 900: "#0d47a1", a100: "#82b1ff", a200: "#448aff", a400: "#2979ff", a700: "#2962ff" }, eb = { 50: "#e1f5fe", 100: "#b3e5fc", 200: "#81d4fa", 300: "#4fc3f7", 400: "#29b6f6", 500: "#03a9f4", 600: "#039be5", 700: "#0288d1", 800: "#0277bd", 900: "#01579b", a100: "#80d8ff", a200: "#40c4ff", a400: "#00b0ff", a700: "#0091ea" }, tb = { 50: "#e0f7fa", 100: "#b2ebf2", 200: "#80deea", 300: "#4dd0e1", 400: "#26c6da", 500: "#00bcd4", 600: "#00acc1", 700: "#0097a7", 800: "#00838f", 900: "#006064", a100: "#84ffff", a200: "#18ffff", a400: "#00e5ff", a700: "#00b8d4" }, ib = { 50: "#e0f2f1", 100: "#b2dfdb", 200: "#80cbc4", 300: "#4db6ac", 400: "#26a69a", 500: "#009688", 600: "#00897b", 700: "#00796b", 800: "#00695c", 900: "#004d40", a100: "#a7ffeb", a200: "#64ffda", a400: "#1de9b6", a700: "#00bfa5" }, UJ = { 50: "#e8f5e9", 100: "#c8e6c9", 200: "#a5d6a7", 300: "#81c784", 400: "#66bb6a", 500: "#4caf50", 600: "#43a047", 700: "#388e3c", 800: "#2e7d32", 900: "#1b5e20", a100: "#b9f6ca", a200: "#69f0ae", a400: "#00e676", a700: "#00c853" }, nb = { 50: "#f1f8e9", 100: "#dcedc8", 200: "#c5e1a5", 300: "#aed581", 400: "#9ccc65", 500: "#8bc34a", 600: "#7cb342", 700: "#689f38", 800: "#558b2f", 900: "#33691e", a100: "#ccff90", a200: "#b2ff59", a400: "#76ff03", a700: "#64dd17" }, ob = { 50: "#f9fbe7", 100: "#f0f4c3", 200: "#e6ee9c", 300: "#dce775", 400: "#d4e157", 500: "#cddc39", 600: "#c0ca33", 700: "#afb42b", 800: "#9e9d24", 900: "#827717", a100: "#f4ff81", a200: "#eeff41", a400: "#c6ff00", a700: "#aeea00" }, gb = { 50: "#fffde7", 100: "#fff9c4", 200: "#fff59d", 300: "#fff176", 400: "#ffee58", 500: "#ffeb3b", 600: "#fdd835", 700: "#fbc02d", 800: "#f9a825", 900: "#f57f17", a100: "#ffff8d", a200: "#ffff00", a400: "#ffea00", a700: "#ffd600" }, sb = { 50: "#fff8e1", 100: "#ffecb3", 200: "#ffe082", 300: "#ffd54f", 400: "#ffca28", 500: "#ffc107", 600: "#ffb300", 700: "#ffa000", 800: "#ff8f00", 900: "#ff6f00", a100: "#ffe57f", a200: "#ffd740", a400: "#ffc400", a700: "#ffab00" }, Ib = { 50: "#fff3e0", 100: "#ffe0b2", 200: "#ffcc80", 300: "#ffb74d", 400: "#ffa726", 500: "#ff9800", 600: "#fb8c00", 700: "#f57c00", 800: "#ef6c00", 900: "#e65100", a100: "#ffd180", a200: "#ffab40", a400: "#ff9100", a700: "#ff6d00" }, ab = { 50: "#fbe9e7", 100: "#ffccbc", 200: "#ffab91", 300: "#ff8a65", 400: "#ff7043", 500: "#ff5722", 600: "#f4511e", 700: "#e64a19", 800: "#d84315", 900: "#bf360c", a100: "#ff9e80", a200: "#ff6e40", a400: "#ff3d00", a700: "#dd2c00" }, rb = { 50: "#efebe9", 100: "#d7ccc8", 200: "#bcaaa4", 300: "#a1887f", 400: "#8d6e63", 500: "#795548", 600: "#6d4c41", 700: "#5d4037", 800: "#4e342e", 900: "#3e2723" }, Cb = { 50: "#eceff1", 100: "#cfd8dc", 200: "#b0bec5", 300: "#90a4ae", 400: "#78909c", 500: "#607d8b", 600: "#546e7a", 700: "#455a64", 800: "#37474f", 900: "#263238" }, j9A = function(A) {
  var e = A.color, t = A.onClick, i = A.onSwatchHover, n = A.hover, o = A.active, g = A.circleSize, s = A.circleSpacing, I = st({
    default: {
      swatch: {
        width: g,
        height: g,
        marginRight: s,
        marginBottom: s,
        transform: "scale(1)",
        transition: "100ms transform ease"
      },
      Swatch: {
        borderRadius: "50%",
        background: "transparent",
        boxShadow: "inset 0 0 0 " + (g / 2 + 1) + "px " + e,
        transition: "100ms box-shadow ease"
      }
    },
    hover: {
      swatch: {
        transform: "scale(1.2)"
      }
    },
    active: {
      Swatch: {
        boxShadow: "inset 0 0 0 3px " + e
      }
    }
  }, { hover: n, active: o });
  return b.createElement(
    "div",
    { style: I.swatch },
    b.createElement(D0, {
      style: I.Swatch,
      color: e,
      onClick: t,
      onHover: i,
      focusStyle: { boxShadow: I.Swatch.boxShadow + ", 0 0 5px " + e }
    })
  );
};
j9A.defaultProps = {
  circleSize: 28,
  circleSpacing: 14
};
const tmt = PgA(j9A);
var tsA = function(A) {
  var e = A.width, t = A.onChange, i = A.onSwatchHover, n = A.colors, o = A.hex, g = A.circleSize, s = A.styles, I = s === void 0 ? {} : s, r = A.circleSpacing, a = A.className, C = a === void 0 ? "" : a, B = st(nI({
    default: {
      card: {
        width: e,
        display: "flex",
        flexWrap: "wrap",
        marginRight: -r,
        marginBottom: -r
      }
    }
  }, I)), l = function(Q, E) {
    return t({ hex: Q, source: "hex" }, E);
  };
  return b.createElement(
    "div",
    { style: B.card, className: "circle-picker " + C },
    t0(n, function(Q) {
      return b.createElement(tmt, {
        key: Q,
        color: Q,
        onClick: l,
        onSwatchHover: i,
        active: o === Q.toLowerCase(),
        circleSize: g,
        circleSpacing: r
      });
    })
  );
};
tsA.propTypes = {
  width: KA.oneOfType([KA.string, KA.number]),
  circleSize: KA.number,
  circleSpacing: KA.number,
  styles: KA.object
};
tsA.defaultProps = {
  width: 252,
  circleSize: 28,
  circleSpacing: 14,
  colors: [qy[500], Oy[500], jy[500], Py[500], $y[500], Ab[500], eb[500], tb[500], ib[500], UJ[500], nb[500], ob[500], gb[500], sb[500], Ib[500], ab[500], rb[500], Cb[500]],
  styles: {}
};
II(tsA);
var P9A = {};
Object.defineProperty(P9A, "__esModule", {
  value: !0
});
var X0A = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, imt = b, z0A = nmt(imt);
function nmt(A) {
  return A && A.__esModule ? A : { default: A };
}
function omt(A, e) {
  var t = {};
  for (var i in A)
    e.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(A, i) && (t[i] = A[i]);
  return t;
}
var Hx = 24, gmt = P9A.default = function(A) {
  var e = A.fill, t = e === void 0 ? "currentColor" : e, i = A.width, n = i === void 0 ? Hx : i, o = A.height, g = o === void 0 ? Hx : o, s = A.style, I = s === void 0 ? {} : s, r = omt(A, ["fill", "width", "height", "style"]);
  return z0A.default.createElement(
    "svg",
    X0A({
      viewBox: "0 0 " + Hx + " " + Hx,
      style: X0A({ fill: t, width: n, height: g }, I)
    }, r),
    z0A.default.createElement("path", { d: "M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z" })
  );
}, smt = function() {
  function A(e, t) {
    for (var i = 0; i < t.length; i++) {
      var n = t[i];
      n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
    }
  }
  return function(e, t, i) {
    return t && A(e.prototype, t), i && A(e, i), e;
  };
}();
function Imt(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function amt(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function rmt(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var $9A = function(A) {
  rmt(e, A);
  function e(t) {
    Imt(this, e);
    var i = amt(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
    return i.toggleViews = function() {
      i.state.view === "hex" ? i.setState({ view: "rgb" }) : i.state.view === "rgb" ? i.setState({ view: "hsl" }) : i.state.view === "hsl" && (i.props.hsl.a === 1 ? i.setState({ view: "hex" }) : i.setState({ view: "rgb" }));
    }, i.handleChange = function(n, o) {
      n.hex ? $d(n.hex) && i.props.onChange({
        hex: n.hex,
        source: "hex"
      }, o) : n.r || n.g || n.b ? i.props.onChange({
        r: n.r || i.props.rgb.r,
        g: n.g || i.props.rgb.g,
        b: n.b || i.props.rgb.b,
        source: "rgb"
      }, o) : n.a ? (n.a < 0 ? n.a = 0 : n.a > 1 && (n.a = 1), i.props.onChange({
        h: i.props.hsl.h,
        s: i.props.hsl.s,
        l: i.props.hsl.l,
        a: Math.round(n.a * 100) / 100,
        source: "rgb"
      }, o)) : (n.h || n.s || n.l) && (typeof n.s == "string" && n.s.includes("%") && (n.s = n.s.replace("%", "")), typeof n.l == "string" && n.l.includes("%") && (n.l = n.l.replace("%", "")), n.s == 1 ? n.s = 0.01 : n.l == 1 && (n.l = 0.01), i.props.onChange({
        h: n.h || i.props.hsl.h,
        s: Number(qcA(n.s) ? i.props.hsl.s : n.s),
        l: Number(qcA(n.l) ? i.props.hsl.l : n.l),
        source: "hsl"
      }, o));
    }, i.showHighlight = function(n) {
      n.currentTarget.style.background = "#eee";
    }, i.hideHighlight = function(n) {
      n.currentTarget.style.background = "transparent";
    }, t.hsl.a !== 1 && t.view === "hex" ? i.state = {
      view: "rgb"
    } : i.state = {
      view: t.view
    }, i;
  }
  return smt(e, [{
    key: "render",
    value: function() {
      var t = this, i = st({
        default: {
          wrap: {
            paddingTop: "16px",
            display: "flex"
          },
          fields: {
            flex: "1",
            display: "flex",
            marginLeft: "-6px"
          },
          field: {
            paddingLeft: "6px",
            width: "100%"
          },
          alpha: {
            paddingLeft: "6px",
            width: "100%"
          },
          toggle: {
            width: "32px",
            textAlign: "right",
            position: "relative"
          },
          icon: {
            marginRight: "-4px",
            marginTop: "12px",
            cursor: "pointer",
            position: "relative"
          },
          iconHighlight: {
            position: "absolute",
            width: "24px",
            height: "28px",
            background: "#eee",
            borderRadius: "4px",
            top: "10px",
            left: "12px",
            display: "none"
          },
          input: {
            fontSize: "11px",
            color: "#333",
            width: "100%",
            borderRadius: "2px",
            border: "none",
            boxShadow: "inset 0 0 0 1px #dadada",
            height: "21px",
            textAlign: "center"
          },
          label: {
            textTransform: "uppercase",
            fontSize: "11px",
            lineHeight: "11px",
            color: "#969696",
            textAlign: "center",
            display: "block",
            marginTop: "12px"
          },
          svg: {
            fill: "#333",
            width: "24px",
            height: "24px",
            border: "1px transparent solid",
            borderRadius: "5px"
          }
        },
        disableAlpha: {
          alpha: {
            display: "none"
          }
        }
      }, this.props, this.state), n = void 0;
      return this.state.view === "hex" ? n = b.createElement(
        "div",
        { style: i.fields, className: "flexbox-fix" },
        b.createElement(
          "div",
          { style: i.field },
          b.createElement(Ut, {
            style: { input: i.input, label: i.label },
            label: "hex",
            value: this.props.hex,
            onChange: this.handleChange
          })
        )
      ) : this.state.view === "rgb" ? n = b.createElement(
        "div",
        { style: i.fields, className: "flexbox-fix" },
        b.createElement(
          "div",
          { style: i.field },
          b.createElement(Ut, {
            style: { input: i.input, label: i.label },
            label: "r",
            value: this.props.rgb.r,
            onChange: this.handleChange
          })
        ),
        b.createElement(
          "div",
          { style: i.field },
          b.createElement(Ut, {
            style: { input: i.input, label: i.label },
            label: "g",
            value: this.props.rgb.g,
            onChange: this.handleChange
          })
        ),
        b.createElement(
          "div",
          { style: i.field },
          b.createElement(Ut, {
            style: { input: i.input, label: i.label },
            label: "b",
            value: this.props.rgb.b,
            onChange: this.handleChange
          })
        ),
        b.createElement(
          "div",
          { style: i.alpha },
          b.createElement(Ut, {
            style: { input: i.input, label: i.label },
            label: "a",
            value: this.props.rgb.a,
            arrowOffset: 0.01,
            onChange: this.handleChange
          })
        )
      ) : this.state.view === "hsl" && (n = b.createElement(
        "div",
        { style: i.fields, className: "flexbox-fix" },
        b.createElement(
          "div",
          { style: i.field },
          b.createElement(Ut, {
            style: { input: i.input, label: i.label },
            label: "h",
            value: Math.round(this.props.hsl.h),
            onChange: this.handleChange
          })
        ),
        b.createElement(
          "div",
          { style: i.field },
          b.createElement(Ut, {
            style: { input: i.input, label: i.label },
            label: "s",
            value: Math.round(this.props.hsl.s * 100) + "%",
            onChange: this.handleChange
          })
        ),
        b.createElement(
          "div",
          { style: i.field },
          b.createElement(Ut, {
            style: { input: i.input, label: i.label },
            label: "l",
            value: Math.round(this.props.hsl.l * 100) + "%",
            onChange: this.handleChange
          })
        ),
        b.createElement(
          "div",
          { style: i.alpha },
          b.createElement(Ut, {
            style: { input: i.input, label: i.label },
            label: "a",
            value: this.props.hsl.a,
            arrowOffset: 0.01,
            onChange: this.handleChange
          })
        )
      )), b.createElement(
        "div",
        { style: i.wrap, className: "flexbox-fix" },
        n,
        b.createElement(
          "div",
          { style: i.toggle },
          b.createElement(
            "div",
            { style: i.icon, onClick: this.toggleViews, ref: function(o) {
              return t.icon = o;
            } },
            b.createElement(gmt, {
              style: i.svg,
              onMouseOver: this.showHighlight,
              onMouseEnter: this.showHighlight,
              onMouseOut: this.hideHighlight
            })
          )
        )
      );
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function(t, i) {
      return t.hsl.a !== 1 && i.view === "hex" ? { view: "rgb" } : null;
    }
  }]), e;
}(b.Component);
$9A.defaultProps = {
  view: "hex"
};
var T0A = function() {
  var A = st({
    default: {
      picker: {
        width: "12px",
        height: "12px",
        borderRadius: "6px",
        transform: "translate(-6px, -1px)",
        backgroundColor: "rgb(248, 248, 248)",
        boxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.37)"
      }
    }
  });
  return b.createElement("div", { style: A.picker });
}, Cmt = function() {
  var A = st({
    default: {
      picker: {
        width: "12px",
        height: "12px",
        borderRadius: "6px",
        boxShadow: "inset 0 0 0 1px #fff",
        transform: "translate(-6px, -6px)"
      }
    }
  });
  return b.createElement("div", { style: A.picker });
}, isA = function(A) {
  var e = A.width, t = A.onChange, i = A.disableAlpha, n = A.rgb, o = A.hsl, g = A.hsv, s = A.hex, I = A.renderers, r = A.styles, a = r === void 0 ? {} : r, C = A.className, B = C === void 0 ? "" : C, l = A.defaultView, Q = st(nI({
    default: {
      picker: {
        width: e,
        background: "#fff",
        borderRadius: "2px",
        boxShadow: "0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",
        boxSizing: "initial",
        fontFamily: "Menlo"
      },
      saturation: {
        width: "100%",
        paddingBottom: "55%",
        position: "relative",
        borderRadius: "2px 2px 0 0",
        overflow: "hidden"
      },
      Saturation: {
        radius: "2px 2px 0 0"
      },
      body: {
        padding: "16px 16px 12px"
      },
      controls: {
        display: "flex"
      },
      color: {
        width: "32px"
      },
      swatch: {
        marginTop: "6px",
        width: "16px",
        height: "16px",
        borderRadius: "8px",
        position: "relative",
        overflow: "hidden"
      },
      active: {
        absolute: "0px 0px 0px 0px",
        borderRadius: "8px",
        boxShadow: "inset 0 0 0 1px rgba(0,0,0,.1)",
        background: "rgba(" + n.r + ", " + n.g + ", " + n.b + ", " + n.a + ")",
        zIndex: "2"
      },
      toggles: {
        flex: "1"
      },
      hue: {
        height: "10px",
        position: "relative",
        marginBottom: "8px"
      },
      Hue: {
        radius: "2px"
      },
      alpha: {
        height: "10px",
        position: "relative"
      },
      Alpha: {
        radius: "2px"
      }
    },
    disableAlpha: {
      color: {
        width: "22px"
      },
      alpha: {
        display: "none"
      },
      hue: {
        marginBottom: "0px"
      },
      swatch: {
        width: "10px",
        height: "10px",
        marginTop: "0px"
      }
    }
  }, a), { disableAlpha: i });
  return b.createElement(
    "div",
    { style: Q.picker, className: "chrome-picker " + B },
    b.createElement(
      "div",
      { style: Q.saturation },
      b.createElement(mX, {
        style: Q.Saturation,
        hsl: o,
        hsv: g,
        pointer: Cmt,
        onChange: t
      })
    ),
    b.createElement(
      "div",
      { style: Q.body },
      b.createElement(
        "div",
        { style: Q.controls, className: "flexbox-fix" },
        b.createElement(
          "div",
          { style: Q.color },
          b.createElement(
            "div",
            { style: Q.swatch },
            b.createElement("div", { style: Q.active }),
            b.createElement(pG, { renderers: I })
          )
        ),
        b.createElement(
          "div",
          { style: Q.toggles },
          b.createElement(
            "div",
            { style: Q.hue },
            b.createElement(yG, {
              style: Q.Hue,
              hsl: o,
              pointer: T0A,
              onChange: t
            })
          ),
          b.createElement(
            "div",
            { style: Q.alpha },
            b.createElement($gA, {
              style: Q.Alpha,
              rgb: n,
              hsl: o,
              pointer: T0A,
              renderers: I,
              onChange: t
            })
          )
        )
      ),
      b.createElement($9A, {
        rgb: n,
        hsl: o,
        hex: s,
        view: l,
        onChange: t,
        disableAlpha: i
      })
    )
  );
};
isA.propTypes = {
  width: KA.oneOfType([KA.string, KA.number]),
  disableAlpha: KA.bool,
  styles: KA.object,
  defaultView: KA.oneOf(["hex", "rgb", "hsl"])
};
isA.defaultProps = {
  width: 225,
  disableAlpha: !1,
  styles: {}
};
II(isA);
var Bmt = function(A) {
  var e = A.color, t = A.onClick, i = t === void 0 ? function() {
  } : t, n = A.onSwatchHover, o = A.active, g = st({
    default: {
      color: {
        background: e,
        width: "15px",
        height: "15px",
        float: "left",
        marginRight: "5px",
        marginBottom: "5px",
        position: "relative",
        cursor: "pointer"
      },
      dot: {
        absolute: "5px 5px 5px 5px",
        background: AsA(e),
        borderRadius: "50%",
        opacity: "0"
      }
    },
    active: {
      dot: {
        opacity: "1"
      }
    },
    "color-#FFFFFF": {
      color: {
        boxShadow: "inset 0 0 0 1px #ddd"
      },
      dot: {
        background: "#000"
      }
    },
    transparent: {
      dot: {
        background: "#000"
      }
    }
  }, { active: o, "color-#FFFFFF": e === "#FFFFFF", transparent: e === "transparent" });
  return b.createElement(
    D0,
    {
      style: g.color,
      color: e,
      onClick: i,
      onHover: n,
      focusStyle: { boxShadow: "0 0 4px " + e }
    },
    b.createElement("div", { style: g.dot })
  );
}, lmt = function(A) {
  var e = A.hex, t = A.rgb, i = A.onChange, n = st({
    default: {
      fields: {
        display: "flex",
        paddingBottom: "6px",
        paddingRight: "5px",
        position: "relative"
      },
      active: {
        position: "absolute",
        top: "6px",
        left: "5px",
        height: "9px",
        width: "9px",
        background: e
      },
      HEXwrap: {
        flex: "6",
        position: "relative"
      },
      HEXinput: {
        width: "80%",
        padding: "0px",
        paddingLeft: "20%",
        border: "none",
        outline: "none",
        background: "none",
        fontSize: "12px",
        color: "#333",
        height: "16px"
      },
      HEXlabel: {
        display: "none"
      },
      RGBwrap: {
        flex: "3",
        position: "relative"
      },
      RGBinput: {
        width: "70%",
        padding: "0px",
        paddingLeft: "30%",
        border: "none",
        outline: "none",
        background: "none",
        fontSize: "12px",
        color: "#333",
        height: "16px"
      },
      RGBlabel: {
        position: "absolute",
        top: "3px",
        left: "0px",
        lineHeight: "16px",
        textTransform: "uppercase",
        fontSize: "12px",
        color: "#999"
      }
    }
  }), o = function(g, s) {
    g.r || g.g || g.b ? i({
      r: g.r || t.r,
      g: g.g || t.g,
      b: g.b || t.b,
      source: "rgb"
    }, s) : i({
      hex: g.hex,
      source: "hex"
    }, s);
  };
  return b.createElement(
    "div",
    { style: n.fields, className: "flexbox-fix" },
    b.createElement("div", { style: n.active }),
    b.createElement(Ut, {
      style: { wrap: n.HEXwrap, input: n.HEXinput, label: n.HEXlabel },
      label: "hex",
      value: e,
      onChange: o
    }),
    b.createElement(Ut, {
      style: { wrap: n.RGBwrap, input: n.RGBinput, label: n.RGBlabel },
      label: "r",
      value: t.r,
      onChange: o
    }),
    b.createElement(Ut, {
      style: { wrap: n.RGBwrap, input: n.RGBinput, label: n.RGBlabel },
      label: "g",
      value: t.g,
      onChange: o
    }),
    b.createElement(Ut, {
      style: { wrap: n.RGBwrap, input: n.RGBinput, label: n.RGBlabel },
      label: "b",
      value: t.b,
      onChange: o
    })
  );
}, nsA = function(A) {
  var e = A.onChange, t = A.onSwatchHover, i = A.colors, n = A.hex, o = A.rgb, g = A.styles, s = g === void 0 ? {} : g, I = A.className, r = I === void 0 ? "" : I, a = st(nI({
    default: {
      Compact: {
        background: "#f6f6f6",
        radius: "4px"
      },
      compact: {
        paddingTop: "5px",
        paddingLeft: "5px",
        boxSizing: "initial",
        width: "240px"
      },
      clear: {
        clear: "both"
      }
    }
  }, s)), C = function(B, l) {
    B.hex ? $d(B.hex) && e({
      hex: B.hex,
      source: "hex"
    }, l) : e(B, l);
  };
  return b.createElement(
    a1,
    { style: a.Compact, styles: s },
    b.createElement(
      "div",
      { style: a.compact, className: "compact-picker " + r },
      b.createElement(
        "div",
        null,
        t0(i, function(B) {
          return b.createElement(Bmt, {
            key: B,
            color: B,
            active: B.toLowerCase() === n,
            onClick: C,
            onSwatchHover: t
          });
        }),
        b.createElement("div", { style: a.clear })
      ),
      b.createElement(lmt, { hex: n, rgb: o, onChange: C })
    )
  );
};
nsA.propTypes = {
  colors: KA.arrayOf(KA.string),
  styles: KA.object
};
nsA.defaultProps = {
  colors: ["#4D4D4D", "#999999", "#FFFFFF", "#F44E3B", "#FE9200", "#FCDC00", "#DBDF00", "#A4DD00", "#68CCCA", "#73D8FF", "#AEA1FF", "#FDA1FF", "#333333", "#808080", "#cccccc", "#D33115", "#E27300", "#FCC400", "#B0BC00", "#68BC00", "#16A5A5", "#009CE0", "#7B64FF", "#FA28FF", "#000000", "#666666", "#B3B3B3", "#9F0500", "#C45100", "#FB9E00", "#808900", "#194D33", "#0C797D", "#0062B1", "#653294", "#AB149E"],
  styles: {}
};
II(nsA);
var cmt = function(A) {
  var e = A.hover, t = A.color, i = A.onClick, n = A.onSwatchHover, o = {
    position: "relative",
    zIndex: "2",
    outline: "2px solid #fff",
    boxShadow: "0 0 5px 2px rgba(0,0,0,0.25)"
  }, g = st({
    default: {
      swatch: {
        width: "25px",
        height: "25px",
        fontSize: "0"
      }
    },
    hover: {
      swatch: o
    }
  }, { hover: e });
  return b.createElement(
    "div",
    { style: g.swatch },
    b.createElement(D0, {
      color: t,
      onClick: i,
      onHover: n,
      focusStyle: o
    })
  );
};
const Qmt = PgA(cmt);
var osA = function(A) {
  var e = A.width, t = A.colors, i = A.onChange, n = A.onSwatchHover, o = A.triangle, g = A.styles, s = g === void 0 ? {} : g, I = A.className, r = I === void 0 ? "" : I, a = st(nI({
    default: {
      card: {
        width: e,
        background: "#fff",
        border: "1px solid rgba(0,0,0,0.2)",
        boxShadow: "0 3px 12px rgba(0,0,0,0.15)",
        borderRadius: "4px",
        position: "relative",
        padding: "5px",
        display: "flex",
        flexWrap: "wrap"
      },
      triangle: {
        position: "absolute",
        border: "7px solid transparent",
        borderBottomColor: "#fff"
      },
      triangleShadow: {
        position: "absolute",
        border: "8px solid transparent",
        borderBottomColor: "rgba(0,0,0,0.15)"
      }
    },
    "hide-triangle": {
      triangle: {
        display: "none"
      },
      triangleShadow: {
        display: "none"
      }
    },
    "top-left-triangle": {
      triangle: {
        top: "-14px",
        left: "10px"
      },
      triangleShadow: {
        top: "-16px",
        left: "9px"
      }
    },
    "top-right-triangle": {
      triangle: {
        top: "-14px",
        right: "10px"
      },
      triangleShadow: {
        top: "-16px",
        right: "9px"
      }
    },
    "bottom-left-triangle": {
      triangle: {
        top: "35px",
        left: "10px",
        transform: "rotate(180deg)"
      },
      triangleShadow: {
        top: "37px",
        left: "9px",
        transform: "rotate(180deg)"
      }
    },
    "bottom-right-triangle": {
      triangle: {
        top: "35px",
        right: "10px",
        transform: "rotate(180deg)"
      },
      triangleShadow: {
        top: "37px",
        right: "9px",
        transform: "rotate(180deg)"
      }
    }
  }, s), {
    "hide-triangle": o === "hide",
    "top-left-triangle": o === "top-left",
    "top-right-triangle": o === "top-right",
    "bottom-left-triangle": o === "bottom-left",
    "bottom-right-triangle": o === "bottom-right"
  }), C = function(B, l) {
    return i({ hex: B, source: "hex" }, l);
  };
  return b.createElement(
    "div",
    { style: a.card, className: "github-picker " + r },
    b.createElement("div", { style: a.triangleShadow }),
    b.createElement("div", { style: a.triangle }),
    t0(t, function(B) {
      return b.createElement(Qmt, {
        color: B,
        key: B,
        onClick: C,
        onSwatchHover: n
      });
    })
  );
};
osA.propTypes = {
  width: KA.oneOfType([KA.string, KA.number]),
  colors: KA.arrayOf(KA.string),
  triangle: KA.oneOf(["hide", "top-left", "top-right", "bottom-left", "bottom-right"]),
  styles: KA.object
};
osA.defaultProps = {
  width: 200,
  colors: ["#B80000", "#DB3E00", "#FCCB00", "#008B02", "#006B76", "#1273DE", "#004DCF", "#5300EB", "#EB9694", "#FAD0C3", "#FEF3BD", "#C1E1C5", "#BEDADC", "#C4DEF6", "#BED3F3", "#D4C4FB"],
  triangle: "top-left",
  styles: {}
};
II(osA);
var Emt = function(A) {
  var e = A.direction, t = st({
    default: {
      picker: {
        width: "18px",
        height: "18px",
        borderRadius: "50%",
        transform: "translate(-9px, -1px)",
        backgroundColor: "rgb(248, 248, 248)",
        boxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.37)"
      }
    },
    vertical: {
      picker: {
        transform: "translate(-3px, -9px)"
      }
    }
  }, { vertical: e === "vertical" });
  return b.createElement("div", { style: t.picker });
}, umt = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, gsA = function(A) {
  var e = A.width, t = A.height, i = A.onChange, n = A.hsl, o = A.direction, g = A.pointer, s = A.styles, I = s === void 0 ? {} : s, r = A.className, a = r === void 0 ? "" : r, C = st(nI({
    default: {
      picker: {
        position: "relative",
        width: e,
        height: t
      },
      hue: {
        radius: "2px"
      }
    }
  }, I)), B = function(l) {
    return i({ a: 1, h: l.h, l: 0.5, s: 1 });
  };
  return b.createElement(
    "div",
    { style: C.picker, className: "hue-picker " + a },
    b.createElement(yG, umt({}, C.hue, {
      hsl: n,
      pointer: g,
      onChange: B,
      direction: o
    }))
  );
};
gsA.propTypes = {
  styles: KA.object
};
gsA.defaultProps = {
  width: "316px",
  height: "16px",
  direction: "horizontal",
  pointer: Emt,
  styles: {}
};
II(gsA);
var dmt = function(A) {
  var e = A.onChange, t = A.hex, i = A.rgb, n = A.styles, o = n === void 0 ? {} : n, g = A.className, s = g === void 0 ? "" : g, I = st(nI({
    default: {
      material: {
        width: "98px",
        height: "98px",
        padding: "16px",
        fontFamily: "Roboto"
      },
      HEXwrap: {
        position: "relative"
      },
      HEXinput: {
        width: "100%",
        marginTop: "12px",
        fontSize: "15px",
        color: "#333",
        padding: "0px",
        border: "0px",
        borderBottom: "2px solid " + t,
        outline: "none",
        height: "30px"
      },
      HEXlabel: {
        position: "absolute",
        top: "0px",
        left: "0px",
        fontSize: "11px",
        color: "#999999",
        textTransform: "capitalize"
      },
      Hex: {
        style: {}
      },
      RGBwrap: {
        position: "relative"
      },
      RGBinput: {
        width: "100%",
        marginTop: "12px",
        fontSize: "15px",
        color: "#333",
        padding: "0px",
        border: "0px",
        borderBottom: "1px solid #eee",
        outline: "none",
        height: "30px"
      },
      RGBlabel: {
        position: "absolute",
        top: "0px",
        left: "0px",
        fontSize: "11px",
        color: "#999999",
        textTransform: "capitalize"
      },
      split: {
        display: "flex",
        marginRight: "-10px",
        paddingTop: "11px"
      },
      third: {
        flex: "1",
        paddingRight: "10px"
      }
    }
  }, o)), r = function(a, C) {
    a.hex ? $d(a.hex) && e({
      hex: a.hex,
      source: "hex"
    }, C) : (a.r || a.g || a.b) && e({
      r: a.r || i.r,
      g: a.g || i.g,
      b: a.b || i.b,
      source: "rgb"
    }, C);
  };
  return b.createElement(
    a1,
    { styles: o },
    b.createElement(
      "div",
      { style: I.material, className: "material-picker " + s },
      b.createElement(Ut, {
        style: { wrap: I.HEXwrap, input: I.HEXinput, label: I.HEXlabel },
        label: "hex",
        value: t,
        onChange: r
      }),
      b.createElement(
        "div",
        { style: I.split, className: "flexbox-fix" },
        b.createElement(
          "div",
          { style: I.third },
          b.createElement(Ut, {
            style: { wrap: I.RGBwrap, input: I.RGBinput, label: I.RGBlabel },
            label: "r",
            value: i.r,
            onChange: r
          })
        ),
        b.createElement(
          "div",
          { style: I.third },
          b.createElement(Ut, {
            style: { wrap: I.RGBwrap, input: I.RGBinput, label: I.RGBlabel },
            label: "g",
            value: i.g,
            onChange: r
          })
        ),
        b.createElement(
          "div",
          { style: I.third },
          b.createElement(Ut, {
            style: { wrap: I.RGBwrap, input: I.RGBinput, label: I.RGBlabel },
            label: "b",
            value: i.b,
            onChange: r
          })
        )
      )
    )
  );
};
II(dmt);
var hmt = function(A) {
  var e = A.onChange, t = A.rgb, i = A.hsv, n = A.hex, o = st({
    default: {
      fields: {
        paddingTop: "5px",
        paddingBottom: "9px",
        width: "80px",
        position: "relative"
      },
      divider: {
        height: "5px"
      },
      RGBwrap: {
        position: "relative"
      },
      RGBinput: {
        marginLeft: "40%",
        width: "40%",
        height: "18px",
        border: "1px solid #888888",
        boxShadow: "inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",
        marginBottom: "5px",
        fontSize: "13px",
        paddingLeft: "3px",
        marginRight: "10px"
      },
      RGBlabel: {
        left: "0px",
        top: "0px",
        width: "34px",
        textTransform: "uppercase",
        fontSize: "13px",
        height: "18px",
        lineHeight: "22px",
        position: "absolute"
      },
      HEXwrap: {
        position: "relative"
      },
      HEXinput: {
        marginLeft: "20%",
        width: "80%",
        height: "18px",
        border: "1px solid #888888",
        boxShadow: "inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",
        marginBottom: "6px",
        fontSize: "13px",
        paddingLeft: "3px"
      },
      HEXlabel: {
        position: "absolute",
        top: "0px",
        left: "0px",
        width: "14px",
        textTransform: "uppercase",
        fontSize: "13px",
        height: "18px",
        lineHeight: "22px"
      },
      fieldSymbols: {
        position: "absolute",
        top: "5px",
        right: "-7px",
        fontSize: "13px"
      },
      symbol: {
        height: "20px",
        lineHeight: "22px",
        paddingBottom: "7px"
      }
    }
  }), g = function(s, I) {
    s["#"] ? $d(s["#"]) && e({
      hex: s["#"],
      source: "hex"
    }, I) : s.r || s.g || s.b ? e({
      r: s.r || t.r,
      g: s.g || t.g,
      b: s.b || t.b,
      source: "rgb"
    }, I) : (s.h || s.s || s.v) && e({
      h: s.h || i.h,
      s: s.s || i.s,
      v: s.v || i.v,
      source: "hsv"
    }, I);
  };
  return b.createElement(
    "div",
    { style: o.fields },
    b.createElement(Ut, {
      style: { wrap: o.RGBwrap, input: o.RGBinput, label: o.RGBlabel },
      label: "h",
      value: Math.round(i.h),
      onChange: g
    }),
    b.createElement(Ut, {
      style: { wrap: o.RGBwrap, input: o.RGBinput, label: o.RGBlabel },
      label: "s",
      value: Math.round(i.s * 100),
      onChange: g
    }),
    b.createElement(Ut, {
      style: { wrap: o.RGBwrap, input: o.RGBinput, label: o.RGBlabel },
      label: "v",
      value: Math.round(i.v * 100),
      onChange: g
    }),
    b.createElement("div", { style: o.divider }),
    b.createElement(Ut, {
      style: { wrap: o.RGBwrap, input: o.RGBinput, label: o.RGBlabel },
      label: "r",
      value: t.r,
      onChange: g
    }),
    b.createElement(Ut, {
      style: { wrap: o.RGBwrap, input: o.RGBinput, label: o.RGBlabel },
      label: "g",
      value: t.g,
      onChange: g
    }),
    b.createElement(Ut, {
      style: { wrap: o.RGBwrap, input: o.RGBinput, label: o.RGBlabel },
      label: "b",
      value: t.b,
      onChange: g
    }),
    b.createElement("div", { style: o.divider }),
    b.createElement(Ut, {
      style: { wrap: o.HEXwrap, input: o.HEXinput, label: o.HEXlabel },
      label: "#",
      value: n.replace("#", ""),
      onChange: g
    }),
    b.createElement(
      "div",
      { style: o.fieldSymbols },
      b.createElement(
        "div",
        { style: o.symbol },
        "°"
      ),
      b.createElement(
        "div",
        { style: o.symbol },
        "%"
      ),
      b.createElement(
        "div",
        { style: o.symbol },
        "%"
      )
    )
  );
}, mmt = function(A) {
  var e = A.hsl, t = st({
    default: {
      picker: {
        width: "12px",
        height: "12px",
        borderRadius: "6px",
        boxShadow: "inset 0 0 0 1px #fff",
        transform: "translate(-6px, -6px)"
      }
    },
    "black-outline": {
      picker: {
        boxShadow: "inset 0 0 0 1px #000"
      }
    }
  }, { "black-outline": e.l > 0.5 });
  return b.createElement("div", { style: t.picker });
}, pmt = function() {
  var A = st({
    default: {
      triangle: {
        width: 0,
        height: 0,
        borderStyle: "solid",
        borderWidth: "4px 0 4px 6px",
        borderColor: "transparent transparent transparent #fff",
        position: "absolute",
        top: "1px",
        left: "1px"
      },
      triangleBorder: {
        width: 0,
        height: 0,
        borderStyle: "solid",
        borderWidth: "5px 0 5px 8px",
        borderColor: "transparent transparent transparent #555"
      },
      left: {
        Extend: "triangleBorder",
        transform: "translate(-13px, -4px)"
      },
      leftInside: {
        Extend: "triangle",
        transform: "translate(-8px, -5px)"
      },
      right: {
        Extend: "triangleBorder",
        transform: "translate(20px, -14px) rotate(180deg)"
      },
      rightInside: {
        Extend: "triangle",
        transform: "translate(-8px, -5px)"
      }
    }
  });
  return b.createElement(
    "div",
    { style: A.pointer },
    b.createElement(
      "div",
      { style: A.left },
      b.createElement("div", { style: A.leftInside })
    ),
    b.createElement(
      "div",
      { style: A.right },
      b.createElement("div", { style: A.rightInside })
    )
  );
}, _0A = function(A) {
  var e = A.onClick, t = A.label, i = A.children, n = A.active, o = st({
    default: {
      button: {
        backgroundImage: "linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",
        border: "1px solid #878787",
        borderRadius: "2px",
        height: "20px",
        boxShadow: "0 1px 0 0 #EAEAEA",
        fontSize: "14px",
        color: "#000",
        lineHeight: "20px",
        textAlign: "center",
        marginBottom: "10px",
        cursor: "pointer"
      }
    },
    active: {
      button: {
        boxShadow: "0 0 0 1px #878787"
      }
    }
  }, { active: n });
  return b.createElement(
    "div",
    { style: o.button, onClick: e },
    t || i
  );
}, ymt = function(A) {
  var e = A.rgb, t = A.currentColor, i = st({
    default: {
      swatches: {
        border: "1px solid #B3B3B3",
        borderBottom: "1px solid #F0F0F0",
        marginBottom: "2px",
        marginTop: "1px"
      },
      new: {
        height: "34px",
        background: "rgb(" + e.r + "," + e.g + ", " + e.b + ")",
        boxShadow: "inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"
      },
      current: {
        height: "34px",
        background: t,
        boxShadow: "inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"
      },
      label: {
        fontSize: "14px",
        color: "#000",
        textAlign: "center"
      }
    }
  });
  return b.createElement(
    "div",
    null,
    b.createElement(
      "div",
      { style: i.label },
      "new"
    ),
    b.createElement(
      "div",
      { style: i.swatches },
      b.createElement("div", { style: i.new }),
      b.createElement("div", { style: i.current })
    ),
    b.createElement(
      "div",
      { style: i.label },
      "current"
    )
  );
}, bmt = function() {
  function A(e, t) {
    for (var i = 0; i < t.length; i++) {
      var n = t[i];
      n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
    }
  }
  return function(e, t, i) {
    return t && A(e.prototype, t), i && A(e, i), e;
  };
}();
function wmt(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function fmt(A, e) {
  if (!A)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e && (typeof e == "object" || typeof e == "function") ? e : A;
}
function Dmt(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  A.prototype = Object.create(e && e.prototype, { constructor: { value: A, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(A, e) : A.__proto__ = e);
}
var ssA = function(A) {
  Dmt(e, A);
  function e(t) {
    wmt(this, e);
    var i = fmt(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
    return i.state = {
      currentColor: t.hex
    }, i;
  }
  return bmt(e, [{
    key: "render",
    value: function() {
      var t = this.props, i = t.styles, n = i === void 0 ? {} : i, o = t.className, g = o === void 0 ? "" : o, s = st(nI({
        default: {
          picker: {
            background: "#DCDCDC",
            borderRadius: "4px",
            boxShadow: "0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)",
            boxSizing: "initial",
            width: "513px"
          },
          head: {
            backgroundImage: "linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)",
            borderBottom: "1px solid #B1B1B1",
            boxShadow: "inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)",
            height: "23px",
            lineHeight: "24px",
            borderRadius: "4px 4px 0 0",
            fontSize: "13px",
            color: "#4D4D4D",
            textAlign: "center"
          },
          body: {
            padding: "15px 15px 0",
            display: "flex"
          },
          saturation: {
            width: "256px",
            height: "256px",
            position: "relative",
            border: "2px solid #B3B3B3",
            borderBottom: "2px solid #F0F0F0",
            overflow: "hidden"
          },
          hue: {
            position: "relative",
            height: "256px",
            width: "19px",
            marginLeft: "10px",
            border: "2px solid #B3B3B3",
            borderBottom: "2px solid #F0F0F0"
          },
          controls: {
            width: "180px",
            marginLeft: "10px"
          },
          top: {
            display: "flex"
          },
          previews: {
            width: "60px"
          },
          actions: {
            flex: "1",
            marginLeft: "20px"
          }
        }
      }, n));
      return b.createElement(
        "div",
        { style: s.picker, className: "photoshop-picker " + g },
        b.createElement(
          "div",
          { style: s.head },
          this.props.header
        ),
        b.createElement(
          "div",
          { style: s.body, className: "flexbox-fix" },
          b.createElement(
            "div",
            { style: s.saturation },
            b.createElement(mX, {
              hsl: this.props.hsl,
              hsv: this.props.hsv,
              pointer: mmt,
              onChange: this.props.onChange
            })
          ),
          b.createElement(
            "div",
            { style: s.hue },
            b.createElement(yG, {
              direction: "vertical",
              hsl: this.props.hsl,
              pointer: pmt,
              onChange: this.props.onChange
            })
          ),
          b.createElement(
            "div",
            { style: s.controls },
            b.createElement(
              "div",
              { style: s.top, className: "flexbox-fix" },
              b.createElement(
                "div",
                { style: s.previews },
                b.createElement(ymt, {
                  rgb: this.props.rgb,
                  currentColor: this.state.currentColor
                })
              ),
              b.createElement(
                "div",
                { style: s.actions },
                b.createElement(_0A, { label: "OK", onClick: this.props.onAccept, active: !0 }),
                b.createElement(_0A, { label: "Cancel", onClick: this.props.onCancel }),
                b.createElement(hmt, {
                  onChange: this.props.onChange,
                  rgb: this.props.rgb,
                  hsv: this.props.hsv,
                  hex: this.props.hex
                })
              )
            )
          )
        )
      );
    }
  }]), e;
}(b.Component);
ssA.propTypes = {
  header: KA.string,
  styles: KA.object
};
ssA.defaultProps = {
  header: "Color Picker",
  styles: {}
};
II(ssA);
var Gmt = function(A) {
  var e = A.onChange, t = A.rgb, i = A.hsl, n = A.hex, o = A.disableAlpha, g = st({
    default: {
      fields: {
        display: "flex",
        paddingTop: "4px"
      },
      single: {
        flex: "1",
        paddingLeft: "6px"
      },
      alpha: {
        flex: "1",
        paddingLeft: "6px"
      },
      double: {
        flex: "2"
      },
      input: {
        width: "80%",
        padding: "4px 10% 3px",
        border: "none",
        boxShadow: "inset 0 0 0 1px #ccc",
        fontSize: "11px"
      },
      label: {
        display: "block",
        textAlign: "center",
        fontSize: "11px",
        color: "#222",
        paddingTop: "3px",
        paddingBottom: "4px",
        textTransform: "capitalize"
      }
    },
    disableAlpha: {
      alpha: {
        display: "none"
      }
    }
  }, { disableAlpha: o }), s = function(I, r) {
    I.hex ? $d(I.hex) && e({
      hex: I.hex,
      source: "hex"
    }, r) : I.r || I.g || I.b ? e({
      r: I.r || t.r,
      g: I.g || t.g,
      b: I.b || t.b,
      a: t.a,
      source: "rgb"
    }, r) : I.a && (I.a < 0 ? I.a = 0 : I.a > 100 && (I.a = 100), I.a /= 100, e({
      h: i.h,
      s: i.s,
      l: i.l,
      a: I.a,
      source: "rgb"
    }, r));
  };
  return b.createElement(
    "div",
    { style: g.fields, className: "flexbox-fix" },
    b.createElement(
      "div",
      { style: g.double },
      b.createElement(Ut, {
        style: { input: g.input, label: g.label },
        label: "hex",
        value: n.replace("#", ""),
        onChange: s
      })
    ),
    b.createElement(
      "div",
      { style: g.single },
      b.createElement(Ut, {
        style: { input: g.input, label: g.label },
        label: "r",
        value: t.r,
        onChange: s,
        dragLabel: "true",
        dragMax: "255"
      })
    ),
    b.createElement(
      "div",
      { style: g.single },
      b.createElement(Ut, {
        style: { input: g.input, label: g.label },
        label: "g",
        value: t.g,
        onChange: s,
        dragLabel: "true",
        dragMax: "255"
      })
    ),
    b.createElement(
      "div",
      { style: g.single },
      b.createElement(Ut, {
        style: { input: g.input, label: g.label },
        label: "b",
        value: t.b,
        onChange: s,
        dragLabel: "true",
        dragMax: "255"
      })
    ),
    b.createElement(
      "div",
      { style: g.alpha },
      b.createElement(Ut, {
        style: { input: g.input, label: g.label },
        label: "a",
        value: Math.round(t.a * 100),
        onChange: s,
        dragLabel: "true",
        dragMax: "100"
      })
    )
  );
}, kmt = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, A5A = function(A) {
  var e = A.colors, t = A.onClick, i = t === void 0 ? function() {
  } : t, n = A.onSwatchHover, o = st({
    default: {
      colors: {
        margin: "0 -10px",
        padding: "10px 0 0 10px",
        borderTop: "1px solid #eee",
        display: "flex",
        flexWrap: "wrap",
        position: "relative"
      },
      swatchWrap: {
        width: "16px",
        height: "16px",
        margin: "0 10px 10px 0"
      },
      swatch: {
        borderRadius: "3px",
        boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15)"
      }
    },
    "no-presets": {
      colors: {
        display: "none"
      }
    }
  }, {
    "no-presets": !e || !e.length
  }), g = function(s, I) {
    i({
      hex: s,
      source: "hex"
    }, I);
  };
  return b.createElement(
    "div",
    { style: o.colors, className: "flexbox-fix" },
    e.map(function(s) {
      var I = typeof s == "string" ? { color: s } : s, r = "" + I.color + (I.title || "");
      return b.createElement(
        "div",
        { key: r, style: o.swatchWrap },
        b.createElement(D0, kmt({}, I, {
          style: o.swatch,
          onClick: g,
          onHover: n,
          focusStyle: {
            boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px " + I.color
          }
        }))
      );
    })
  );
};
A5A.propTypes = {
  colors: KA.arrayOf(KA.oneOfType([KA.string, KA.shape({
    color: KA.string,
    title: KA.string
  })])).isRequired
};
var Jmt = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, IsA = function(A) {
  var e = A.width, t = A.rgb, i = A.hex, n = A.hsv, o = A.hsl, g = A.onChange, s = A.onSwatchHover, I = A.disableAlpha, r = A.presetColors, a = A.renderers, C = A.styles, B = C === void 0 ? {} : C, l = A.className, Q = l === void 0 ? "" : l, E = st(nI({
    default: Jmt({
      picker: {
        width: e,
        padding: "10px 10px 0",
        boxSizing: "initial",
        background: "#fff",
        borderRadius: "4px",
        boxShadow: "0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"
      },
      saturation: {
        width: "100%",
        paddingBottom: "75%",
        position: "relative",
        overflow: "hidden"
      },
      Saturation: {
        radius: "3px",
        shadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
      },
      controls: {
        display: "flex"
      },
      sliders: {
        padding: "4px 0",
        flex: "1"
      },
      color: {
        width: "24px",
        height: "24px",
        position: "relative",
        marginTop: "4px",
        marginLeft: "4px",
        borderRadius: "3px"
      },
      activeColor: {
        absolute: "0px 0px 0px 0px",
        borderRadius: "2px",
        background: "rgba(" + t.r + "," + t.g + "," + t.b + "," + t.a + ")",
        boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
      },
      hue: {
        position: "relative",
        height: "10px",
        overflow: "hidden"
      },
      Hue: {
        radius: "2px",
        shadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
      },
      alpha: {
        position: "relative",
        height: "10px",
        marginTop: "4px",
        overflow: "hidden"
      },
      Alpha: {
        radius: "2px",
        shadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
      }
    }, B),
    disableAlpha: {
      color: {
        height: "10px"
      },
      hue: {
        height: "10px"
      },
      alpha: {
        display: "none"
      }
    }
  }, B), { disableAlpha: I });
  return b.createElement(
    "div",
    { style: E.picker, className: "sketch-picker " + Q },
    b.createElement(
      "div",
      { style: E.saturation },
      b.createElement(mX, {
        style: E.Saturation,
        hsl: o,
        hsv: n,
        onChange: g
      })
    ),
    b.createElement(
      "div",
      { style: E.controls, className: "flexbox-fix" },
      b.createElement(
        "div",
        { style: E.sliders },
        b.createElement(
          "div",
          { style: E.hue },
          b.createElement(yG, {
            style: E.Hue,
            hsl: o,
            onChange: g
          })
        ),
        b.createElement(
          "div",
          { style: E.alpha },
          b.createElement($gA, {
            style: E.Alpha,
            rgb: t,
            hsl: o,
            renderers: a,
            onChange: g
          })
        )
      ),
      b.createElement(
        "div",
        { style: E.color },
        b.createElement(pG, null),
        b.createElement("div", { style: E.activeColor })
      )
    ),
    b.createElement(Gmt, {
      rgb: t,
      hsl: o,
      hex: i,
      onChange: g,
      disableAlpha: I
    }),
    b.createElement(A5A, {
      colors: r,
      onClick: g,
      onSwatchHover: s
    })
  );
};
IsA.propTypes = {
  disableAlpha: KA.bool,
  width: KA.oneOfType([KA.string, KA.number]),
  styles: KA.object
};
IsA.defaultProps = {
  disableAlpha: !1,
  width: 200,
  styles: {},
  presetColors: ["#D0021B", "#F5A623", "#F8E71C", "#8B572A", "#7ED321", "#417505", "#BD10E0", "#9013FE", "#4A90E2", "#50E3C2", "#B8E986", "#000000", "#4A4A4A", "#9B9B9B", "#FFFFFF"]
};
const Nmt = II(IsA);
var Pk = function(A) {
  var e = A.hsl, t = A.offset, i = A.onClick, n = i === void 0 ? function() {
  } : i, o = A.active, g = A.first, s = A.last, I = st({
    default: {
      swatch: {
        height: "12px",
        background: "hsl(" + e.h + ", 50%, " + t * 100 + "%)",
        cursor: "pointer"
      }
    },
    first: {
      swatch: {
        borderRadius: "2px 0 0 2px"
      }
    },
    last: {
      swatch: {
        borderRadius: "0 2px 2px 0"
      }
    },
    active: {
      swatch: {
        transform: "scaleY(1.8)",
        borderRadius: "3.6px/2px"
      }
    }
  }, { active: o, first: g, last: s }), r = function(a) {
    return n({
      h: e.h,
      s: 0.5,
      l: t,
      source: "hsl"
    }, a);
  };
  return b.createElement("div", { style: I.swatch, onClick: r });
}, Ymt = function(A) {
  var e = A.onClick, t = A.hsl, i = st({
    default: {
      swatches: {
        marginTop: "20px"
      },
      swatch: {
        boxSizing: "border-box",
        width: "20%",
        paddingRight: "1px",
        float: "left"
      },
      clear: {
        clear: "both"
      }
    }
  }), n = 0.1;
  return b.createElement(
    "div",
    { style: i.swatches },
    b.createElement(
      "div",
      { style: i.swatch },
      b.createElement(Pk, {
        hsl: t,
        offset: ".80",
        active: Math.abs(t.l - 0.8) < n && Math.abs(t.s - 0.5) < n,
        onClick: e,
        first: !0
      })
    ),
    b.createElement(
      "div",
      { style: i.swatch },
      b.createElement(Pk, {
        hsl: t,
        offset: ".65",
        active: Math.abs(t.l - 0.65) < n && Math.abs(t.s - 0.5) < n,
        onClick: e
      })
    ),
    b.createElement(
      "div",
      { style: i.swatch },
      b.createElement(Pk, {
        hsl: t,
        offset: ".50",
        active: Math.abs(t.l - 0.5) < n && Math.abs(t.s - 0.5) < n,
        onClick: e
      })
    ),
    b.createElement(
      "div",
      { style: i.swatch },
      b.createElement(Pk, {
        hsl: t,
        offset: ".35",
        active: Math.abs(t.l - 0.35) < n && Math.abs(t.s - 0.5) < n,
        onClick: e
      })
    ),
    b.createElement(
      "div",
      { style: i.swatch },
      b.createElement(Pk, {
        hsl: t,
        offset: ".20",
        active: Math.abs(t.l - 0.2) < n && Math.abs(t.s - 0.5) < n,
        onClick: e,
        last: !0
      })
    ),
    b.createElement("div", { style: i.clear })
  );
}, Rmt = function() {
  var A = st({
    default: {
      picker: {
        width: "14px",
        height: "14px",
        borderRadius: "6px",
        transform: "translate(-7px, -1px)",
        backgroundColor: "rgb(248, 248, 248)",
        boxShadow: "0 1px 4px 0 rgba(0, 0, 0, 0.37)"
      }
    }
  });
  return b.createElement("div", { style: A.picker });
}, asA = function(A) {
  var e = A.hsl, t = A.onChange, i = A.pointer, n = A.styles, o = n === void 0 ? {} : n, g = A.className, s = g === void 0 ? "" : g, I = st(nI({
    default: {
      hue: {
        height: "12px",
        position: "relative"
      },
      Hue: {
        radius: "2px"
      }
    }
  }, o));
  return b.createElement(
    "div",
    { style: I.wrap || {}, className: "slider-picker " + s },
    b.createElement(
      "div",
      { style: I.hue },
      b.createElement(yG, {
        style: I.Hue,
        hsl: e,
        pointer: i,
        onChange: t
      })
    ),
    b.createElement(
      "div",
      { style: I.swatches },
      b.createElement(Ymt, { hsl: e, onClick: t })
    )
  );
};
asA.propTypes = {
  styles: KA.object
};
asA.defaultProps = {
  pointer: Rmt,
  styles: {}
};
II(asA);
var e5A = {};
Object.defineProperty(e5A, "__esModule", {
  value: !0
});
var q0A = Object.assign || function(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
  }
  return A;
}, Fmt = b, O0A = Mmt(Fmt);
function Mmt(A) {
  return A && A.__esModule ? A : { default: A };
}
function xmt(A, e) {
  var t = {};
  for (var i in A)
    e.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(A, i) && (t[i] = A[i]);
  return t;
}
var Sx = 24, Lmt = e5A.default = function(A) {
  var e = A.fill, t = e === void 0 ? "currentColor" : e, i = A.width, n = i === void 0 ? Sx : i, o = A.height, g = o === void 0 ? Sx : o, s = A.style, I = s === void 0 ? {} : s, r = xmt(A, ["fill", "width", "height", "style"]);
  return O0A.default.createElement(
    "svg",
    q0A({
      viewBox: "0 0 " + Sx + " " + Sx,
      style: q0A({ fill: t, width: n, height: g }, I)
    }, r),
    O0A.default.createElement("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
  );
}, vmt = function(A) {
  var e = A.color, t = A.onClick, i = t === void 0 ? function() {
  } : t, n = A.onSwatchHover, o = A.first, g = A.last, s = A.active, I = st({
    default: {
      color: {
        width: "40px",
        height: "24px",
        cursor: "pointer",
        background: e,
        marginBottom: "1px"
      },
      check: {
        color: AsA(e),
        marginLeft: "8px",
        display: "none"
      }
    },
    first: {
      color: {
        overflow: "hidden",
        borderRadius: "2px 2px 0 0"
      }
    },
    last: {
      color: {
        overflow: "hidden",
        borderRadius: "0 0 2px 2px"
      }
    },
    active: {
      check: {
        display: "block"
      }
    },
    "color-#FFFFFF": {
      color: {
        boxShadow: "inset 0 0 0 1px #ddd"
      },
      check: {
        color: "#333"
      }
    },
    transparent: {
      check: {
        color: "#333"
      }
    }
  }, {
    first: o,
    last: g,
    active: s,
    "color-#FFFFFF": e === "#FFFFFF",
    transparent: e === "transparent"
  });
  return b.createElement(
    D0,
    {
      color: e,
      style: I.color,
      onClick: i,
      onHover: n,
      focusStyle: { boxShadow: "0 0 4px " + e }
    },
    b.createElement(
      "div",
      { style: I.check },
      b.createElement(Lmt, null)
    )
  );
}, Hmt = function(A) {
  var e = A.onClick, t = A.onSwatchHover, i = A.group, n = A.active, o = st({
    default: {
      group: {
        paddingBottom: "10px",
        width: "40px",
        float: "left",
        marginRight: "10px"
      }
    }
  });
  return b.createElement(
    "div",
    { style: o.group },
    t0(i, function(g, s) {
      return b.createElement(vmt, {
        key: g,
        color: g,
        active: g.toLowerCase() === n,
        first: s === 0,
        last: s === i.length - 1,
        onClick: e,
        onSwatchHover: t
      });
    })
  );
}, rsA = function(A) {
  var e = A.width, t = A.height, i = A.onChange, n = A.onSwatchHover, o = A.colors, g = A.hex, s = A.styles, I = s === void 0 ? {} : s, r = A.className, a = r === void 0 ? "" : r, C = st(nI({
    default: {
      picker: {
        width: e,
        height: t
      },
      overflow: {
        height: t,
        overflowY: "scroll"
      },
      body: {
        padding: "16px 0 6px 16px"
      },
      clear: {
        clear: "both"
      }
    }
  }, I)), B = function(l, Q) {
    return i({ hex: l, source: "hex" }, Q);
  };
  return b.createElement(
    "div",
    { style: C.picker, className: "swatches-picker " + a },
    b.createElement(
      a1,
      null,
      b.createElement(
        "div",
        { style: C.overflow },
        b.createElement(
          "div",
          { style: C.body },
          t0(o, function(l) {
            return b.createElement(Hmt, {
              key: l.toString(),
              group: l,
              active: g,
              onClick: B,
              onSwatchHover: n
            });
          }),
          b.createElement("div", { style: C.clear })
        )
      )
    )
  );
};
rsA.propTypes = {
  width: KA.oneOfType([KA.string, KA.number]),
  height: KA.oneOfType([KA.string, KA.number]),
  colors: KA.arrayOf(KA.arrayOf(KA.string)),
  styles: KA.object
  /* eslint-disable max-len */
};
rsA.defaultProps = {
  width: 320,
  height: 240,
  colors: [[qy[900], qy[700], qy[500], qy[300], qy[100]], [Oy[900], Oy[700], Oy[500], Oy[300], Oy[100]], [jy[900], jy[700], jy[500], jy[300], jy[100]], [Py[900], Py[700], Py[500], Py[300], Py[100]], [$y[900], $y[700], $y[500], $y[300], $y[100]], [Ab[900], Ab[700], Ab[500], Ab[300], Ab[100]], [eb[900], eb[700], eb[500], eb[300], eb[100]], [tb[900], tb[700], tb[500], tb[300], tb[100]], [ib[900], ib[700], ib[500], ib[300], ib[100]], ["#194D33", UJ[700], UJ[500], UJ[300], UJ[100]], [nb[900], nb[700], nb[500], nb[300], nb[100]], [ob[900], ob[700], ob[500], ob[300], ob[100]], [gb[900], gb[700], gb[500], gb[300], gb[100]], [sb[900], sb[700], sb[500], sb[300], sb[100]], [Ib[900], Ib[700], Ib[500], Ib[300], Ib[100]], [ab[900], ab[700], ab[500], ab[300], ab[100]], [rb[900], rb[700], rb[500], rb[300], rb[100]], [Cb[900], Cb[700], Cb[500], Cb[300], Cb[100]], ["#000000", "#525252", "#969696", "#D9D9D9", "#FFFFFF"]],
  styles: {}
};
II(rsA);
var CsA = function(A) {
  var e = A.onChange, t = A.onSwatchHover, i = A.hex, n = A.colors, o = A.width, g = A.triangle, s = A.styles, I = s === void 0 ? {} : s, r = A.className, a = r === void 0 ? "" : r, C = st(nI({
    default: {
      card: {
        width: o,
        background: "#fff",
        border: "0 solid rgba(0,0,0,0.25)",
        boxShadow: "0 1px 4px rgba(0,0,0,0.25)",
        borderRadius: "4px",
        position: "relative"
      },
      body: {
        padding: "15px 9px 9px 15px"
      },
      label: {
        fontSize: "18px",
        color: "#fff"
      },
      triangle: {
        width: "0px",
        height: "0px",
        borderStyle: "solid",
        borderWidth: "0 9px 10px 9px",
        borderColor: "transparent transparent #fff transparent",
        position: "absolute"
      },
      triangleShadow: {
        width: "0px",
        height: "0px",
        borderStyle: "solid",
        borderWidth: "0 9px 10px 9px",
        borderColor: "transparent transparent rgba(0,0,0,.1) transparent",
        position: "absolute"
      },
      hash: {
        background: "#F0F0F0",
        height: "30px",
        width: "30px",
        borderRadius: "4px 0 0 4px",
        float: "left",
        color: "#98A1A4",
        display: "flex",
        alignItems: "center",
        justifyContent: "center"
      },
      input: {
        width: "100px",
        fontSize: "14px",
        color: "#666",
        border: "0px",
        outline: "none",
        height: "28px",
        boxShadow: "inset 0 0 0 1px #F0F0F0",
        boxSizing: "content-box",
        borderRadius: "0 4px 4px 0",
        float: "left",
        paddingLeft: "8px"
      },
      swatch: {
        width: "30px",
        height: "30px",
        float: "left",
        borderRadius: "4px",
        margin: "0 6px 6px 0"
      },
      clear: {
        clear: "both"
      }
    },
    "hide-triangle": {
      triangle: {
        display: "none"
      },
      triangleShadow: {
        display: "none"
      }
    },
    "top-left-triangle": {
      triangle: {
        top: "-10px",
        left: "12px"
      },
      triangleShadow: {
        top: "-11px",
        left: "12px"
      }
    },
    "top-right-triangle": {
      triangle: {
        top: "-10px",
        right: "12px"
      },
      triangleShadow: {
        top: "-11px",
        right: "12px"
      }
    }
  }, I), {
    "hide-triangle": g === "hide",
    "top-left-triangle": g === "top-left",
    "top-right-triangle": g === "top-right"
  }), B = function(l, Q) {
    $d(l) && e({
      hex: l,
      source: "hex"
    }, Q);
  };
  return b.createElement(
    "div",
    { style: C.card, className: "twitter-picker " + a },
    b.createElement("div", { style: C.triangleShadow }),
    b.createElement("div", { style: C.triangle }),
    b.createElement(
      "div",
      { style: C.body },
      t0(n, function(l, Q) {
        return b.createElement(D0, {
          key: Q,
          color: l,
          hex: l,
          style: C.swatch,
          onClick: B,
          onHover: t,
          focusStyle: {
            boxShadow: "0 0 4px " + l
          }
        });
      }),
      b.createElement(
        "div",
        { style: C.hash },
        "#"
      ),
      b.createElement(Ut, {
        label: null,
        style: { input: C.input },
        value: i.replace("#", ""),
        onChange: B
      }),
      b.createElement("div", { style: C.clear })
    )
  );
};
CsA.propTypes = {
  width: KA.oneOfType([KA.string, KA.number]),
  triangle: KA.oneOf(["hide", "top-left", "top-right"]),
  colors: KA.arrayOf(KA.string),
  styles: KA.object
};
CsA.defaultProps = {
  width: 276,
  colors: ["#FF6900", "#FCB900", "#7BDCB5", "#00D084", "#8ED1FC", "#0693E3", "#ABB8C3", "#EB144C", "#F78DA7", "#9900EF"],
  triangle: "top-left",
  styles: {}
};
II(CsA);
var BsA = function(A) {
  var e = st({
    default: {
      picker: {
        width: "20px",
        height: "20px",
        borderRadius: "22px",
        border: "2px #fff solid",
        transform: "translate(-12px, -13px)",
        background: "hsl(" + Math.round(A.hsl.h) + ", " + Math.round(A.hsl.s * 100) + "%, " + Math.round(A.hsl.l * 100) + "%)"
      }
    }
  });
  return b.createElement("div", { style: e.picker });
};
BsA.propTypes = {
  hsl: KA.shape({
    h: KA.number,
    s: KA.number,
    l: KA.number,
    a: KA.number
  })
};
BsA.defaultProps = {
  hsl: { a: 1, h: 249.94, l: 0.2, s: 0.5 }
};
var lsA = function(A) {
  var e = st({
    default: {
      picker: {
        width: "20px",
        height: "20px",
        borderRadius: "22px",
        transform: "translate(-10px, -7px)",
        background: "hsl(" + Math.round(A.hsl.h) + ", 100%, 50%)",
        border: "2px white solid"
      }
    }
  });
  return b.createElement("div", { style: e.picker });
};
lsA.propTypes = {
  hsl: KA.shape({
    h: KA.number,
    s: KA.number,
    l: KA.number,
    a: KA.number
  })
};
lsA.defaultProps = {
  hsl: { a: 1, h: 249.94, l: 0.2, s: 0.5 }
};
var Smt = function(A) {
  var e = A.onChange, t = A.rgb, i = A.hsl, n = A.hex, o = A.hsv, g = function(C, B) {
    if (C.hex)
      $d(C.hex) && e({
        hex: C.hex,
        source: "hex"
      }, B);
    else if (C.rgb) {
      var l = C.rgb.split(",");
      OT(C.rgb, "rgb") && e({
        r: l[0],
        g: l[1],
        b: l[2],
        a: 1,
        source: "rgb"
      }, B);
    } else if (C.hsv) {
      var Q = C.hsv.split(",");
      OT(C.hsv, "hsv") && (Q[2] = Q[2].replace("%", ""), Q[1] = Q[1].replace("%", ""), Q[0] = Q[0].replace("°", ""), Q[1] == 1 ? Q[1] = 0.01 : Q[2] == 1 && (Q[2] = 0.01), e({
        h: Number(Q[0]),
        s: Number(Q[1]),
        v: Number(Q[2]),
        source: "hsv"
      }, B));
    } else if (C.hsl) {
      var E = C.hsl.split(",");
      OT(C.hsl, "hsl") && (E[2] = E[2].replace("%", ""), E[1] = E[1].replace("%", ""), E[0] = E[0].replace("°", ""), a[1] == 1 ? a[1] = 0.01 : a[2] == 1 && (a[2] = 0.01), e({
        h: Number(E[0]),
        s: Number(E[1]),
        v: Number(E[2]),
        source: "hsl"
      }, B));
    }
  }, s = st({
    default: {
      wrap: {
        display: "flex",
        height: "100px",
        marginTop: "4px"
      },
      fields: {
        width: "100%"
      },
      column: {
        paddingTop: "10px",
        display: "flex",
        justifyContent: "space-between"
      },
      double: {
        padding: "0px 4.4px",
        boxSizing: "border-box"
      },
      input: {
        width: "100%",
        height: "38px",
        boxSizing: "border-box",
        padding: "4px 10% 3px",
        textAlign: "center",
        border: "1px solid #dadce0",
        fontSize: "11px",
        textTransform: "lowercase",
        borderRadius: "5px",
        outline: "none",
        fontFamily: "Roboto,Arial,sans-serif"
      },
      input2: {
        height: "38px",
        width: "100%",
        border: "1px solid #dadce0",
        boxSizing: "border-box",
        fontSize: "11px",
        textTransform: "lowercase",
        borderRadius: "5px",
        outline: "none",
        paddingLeft: "10px",
        fontFamily: "Roboto,Arial,sans-serif"
      },
      label: {
        textAlign: "center",
        fontSize: "12px",
        background: "#fff",
        position: "absolute",
        textTransform: "uppercase",
        color: "#3c4043",
        width: "35px",
        top: "-6px",
        left: "0",
        right: "0",
        marginLeft: "auto",
        marginRight: "auto",
        fontFamily: "Roboto,Arial,sans-serif"
      },
      label2: {
        left: "10px",
        textAlign: "center",
        fontSize: "12px",
        background: "#fff",
        position: "absolute",
        textTransform: "uppercase",
        color: "#3c4043",
        width: "32px",
        top: "-6px",
        fontFamily: "Roboto,Arial,sans-serif"
      },
      single: {
        flexGrow: "1",
        margin: "0px 4.4px"
      }
    }
  }), I = t.r + ", " + t.g + ", " + t.b, r = Math.round(i.h) + "°, " + Math.round(i.s * 100) + "%, " + Math.round(i.l * 100) + "%", a = Math.round(o.h) + "°, " + Math.round(o.s * 100) + "%, " + Math.round(o.v * 100) + "%";
  return b.createElement(
    "div",
    { style: s.wrap, className: "flexbox-fix" },
    b.createElement(
      "div",
      { style: s.fields },
      b.createElement(
        "div",
        { style: s.double },
        b.createElement(Ut, {
          style: { input: s.input, label: s.label },
          label: "hex",
          value: n,
          onChange: g
        })
      ),
      b.createElement(
        "div",
        { style: s.column },
        b.createElement(
          "div",
          { style: s.single },
          b.createElement(Ut, {
            style: { input: s.input2, label: s.label2 },
            label: "rgb",
            value: I,
            onChange: g
          })
        ),
        b.createElement(
          "div",
          { style: s.single },
          b.createElement(Ut, {
            style: { input: s.input2, label: s.label2 },
            label: "hsv",
            value: a,
            onChange: g
          })
        ),
        b.createElement(
          "div",
          { style: s.single },
          b.createElement(Ut, {
            style: { input: s.input2, label: s.label2 },
            label: "hsl",
            value: r,
            onChange: g
          })
        )
      )
    )
  );
}, csA = function(A) {
  var e = A.width, t = A.onChange, i = A.rgb, n = A.hsl, o = A.hsv, g = A.hex, s = A.header, I = A.styles, r = I === void 0 ? {} : I, a = A.className, C = a === void 0 ? "" : a, B = st(nI({
    default: {
      picker: {
        width: e,
        background: "#fff",
        border: "1px solid #dfe1e5",
        boxSizing: "initial",
        display: "flex",
        flexWrap: "wrap",
        borderRadius: "8px 8px 0px 0px"
      },
      head: {
        height: "57px",
        width: "100%",
        paddingTop: "16px",
        paddingBottom: "16px",
        paddingLeft: "16px",
        fontSize: "20px",
        boxSizing: "border-box",
        fontFamily: "Roboto-Regular,HelveticaNeue,Arial,sans-serif"
      },
      saturation: {
        width: "70%",
        padding: "0px",
        position: "relative",
        overflow: "hidden"
      },
      swatch: {
        width: "30%",
        height: "228px",
        padding: "0px",
        background: "rgba(" + i.r + ", " + i.g + ", " + i.b + ", 1)",
        position: "relative",
        overflow: "hidden"
      },
      body: {
        margin: "auto",
        width: "95%"
      },
      controls: {
        display: "flex",
        boxSizing: "border-box",
        height: "52px",
        paddingTop: "22px"
      },
      color: {
        width: "32px"
      },
      hue: {
        height: "8px",
        position: "relative",
        margin: "0px 16px 0px 16px",
        width: "100%"
      },
      Hue: {
        radius: "2px"
      }
    }
  }, r));
  return b.createElement(
    "div",
    { style: B.picker, className: "google-picker " + C },
    b.createElement(
      "div",
      { style: B.head },
      s
    ),
    b.createElement("div", { style: B.swatch }),
    b.createElement(
      "div",
      { style: B.saturation },
      b.createElement(mX, {
        hsl: n,
        hsv: o,
        pointer: BsA,
        onChange: t
      })
    ),
    b.createElement(
      "div",
      { style: B.body },
      b.createElement(
        "div",
        { style: B.controls, className: "flexbox-fix" },
        b.createElement(
          "div",
          { style: B.hue },
          b.createElement(yG, {
            style: B.Hue,
            hsl: n,
            radius: "4px",
            pointer: lsA,
            onChange: t
          })
        )
      ),
      b.createElement(Smt, {
        rgb: i,
        hsl: n,
        hex: g,
        hsv: o,
        onChange: t
      })
    )
  );
};
csA.propTypes = {
  width: KA.oneOfType([KA.string, KA.number]),
  styles: KA.object,
  header: KA.string
};
csA.defaultProps = {
  width: 652,
  styles: {},
  header: "Color picker"
};
II(csA);
const t5A = ji(Nmt)`
    --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
    box-shadow: ${({ noShadow: A }) => A ? "none" : "var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)"} !important;
    border-color: hsl(var(--border)) !important;
    border-width: ${({ noBorder: A }) => A ? "0" : "1px"} !important;
    background: hsl(var(--popover)) !important;
    color: hsl(var(--popover-foreground)) !important;
    .flexbox-fix {
        border-color: hsl(var(--border)) !important;
    }
    label {
        color: hsl(var(--popover-foreground)) !important;
    }
    input {
        box-shadow: none !important;
        border-radius: calc(var(--radius) - 2px) !important;
        border: 1px solid hsl(var(--input)) !important;
        background-color: transparent !important;
        width: 100% !important;
    }
`, Zmt = u.createContext(null), jT = {
  didCatch: !1,
  error: null
};
class r1 extends u.Component {
  constructor(e) {
    super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = jT;
  }
  static getDerivedStateFromError(e) {
    return {
      didCatch: !0,
      error: e
    };
  }
  resetErrorBoundary() {
    const {
      error: e
    } = this.state;
    if (e !== null) {
      for (var t, i, n = arguments.length, o = new Array(n), g = 0; g < n; g++)
        o[g] = arguments[g];
      (t = (i = this.props).onReset) === null || t === void 0 || t.call(i, {
        args: o,
        reason: "imperative-api"
      }), this.setState(jT);
    }
  }
  componentDidCatch(e, t) {
    var i, n;
    (i = (n = this.props).onError) === null || i === void 0 || i.call(n, e, t);
  }
  componentDidUpdate(e, t) {
    const {
      didCatch: i
    } = this.state, {
      resetKeys: n
    } = this.props;
    if (i && t.error !== null && Wmt(e.resetKeys, n)) {
      var o, g;
      (o = (g = this.props).onReset) === null || o === void 0 || o.call(g, {
        next: n,
        prev: e.resetKeys,
        reason: "keys"
      }), this.setState(jT);
    }
  }
  render() {
    const {
      children: e,
      fallbackRender: t,
      FallbackComponent: i,
      fallback: n
    } = this.props, {
      didCatch: o,
      error: g
    } = this.state;
    let s = e;
    if (o) {
      const I = {
        error: g,
        resetErrorBoundary: this.resetErrorBoundary
      };
      if (u.isValidElement(n))
        s = n;
      else if (typeof t == "function")
        s = t(I);
      else if (i)
        s = u.createElement(i, I);
      else
        throw g;
    }
    return u.createElement(Zmt.Provider, {
      value: {
        didCatch: o,
        error: g,
        resetErrorBoundary: this.resetErrorBoundary
      }
    }, s);
  }
}
function Wmt() {
  let A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
  return A.length !== e.length || A.some((t, i) => !Object.is(t, e[i]));
}
const Kmt = ["#5B8FF9", "#FF6900", "#FCB900", "#7BDCB5", "#00D084", "#8ED1FC", "#0693E3", "#ABB8C3", "#EB144C", "#F78DA7", "#9900EF"];
function j0A(A, e, t, i) {
  const [n, o] = u.useState(!1), [g, s] = u.useState(!1), [I, r] = u.useState(!1), [a, C] = u.useState(0), [B, l] = u.useState(100), [Q, E] = u.useState(t ?? A), [d, m] = u.useState(i ?? e), y = u.useCallback((f) => {
    s(an(f.domainMax)), o(an(f.domainMin)), r(an(f.rangeMax) || an(f.rangeMin)), C(f.domainMin ?? 0), l(f.domainMax ?? 100), m(f.rangeMax ?? i ?? e), E(f.rangeMin ?? t ?? A);
  }, [i, t, e, A]);
  return {
    value: u.useMemo(() => ({
      ...g ? { domainMax: B } : {},
      ...n ? { domainMin: a } : {},
      ...I ? { rangeMax: d, rangeMin: Q } : {}
    }), [g && B, n && a, I && d, I && Q]),
    setValue: y,
    enableMaxDomain: g,
    enableMinDomain: n,
    enableRange: I,
    rangeMax: d,
    rangeMin: Q,
    domainMax: B,
    domainMin: a,
    setEnableMinDomain: o,
    setEnableMaxDomain: s,
    setEnableRange: r,
    setDomainMin: C,
    setDomainMax: l,
    setRangeMin: E,
    setRangeMax: m
  };
}
const Umt = () => {
  const A = xt(), { layout: e, showVisualConfigPanel: t, config: i } = A, { t: n } = qe(), o = ["numberFormat", "timeFormat", "normalizedNumberFormat"], [g, s] = u.useState({
    numberFormat: e.format.numberFormat,
    timeFormat: e.format.timeFormat,
    normalizedNumberFormat: e.format.normalizedNumberFormat
  }), [I, r] = u.useState({
    x: e.resolve.x,
    y: e.resolve.y,
    color: e.resolve.color,
    opacity: e.resolve.opacity,
    shape: e.resolve.shape,
    size: e.resolve.size
  }), [a, C] = u.useState(e.zeroScale), [B, l] = u.useState(e.useSvg ?? !1), [Q, E] = u.useState(e.scaleIncludeUnmatchedChoropleth ?? !1), [d, m] = u.useState(e.showAllGeoshapeInChoropleth ?? !1), [y, f] = u.useState(e.background), [w, G] = u.useState({ r: 91, g: 143, b: 249, a: 1 }), [R, F] = u.useState(!1), [Z, c] = u.useState(!1), [J, p] = u.useState(""), [N, v] = u.useState(void 0), [K, U] = u.useState(void 0), [j, q] = u.useState(!1), O = j0A(0, 1, 0.3, 0.8), $ = j0A(0, 100);
  return u.useEffect(() => {
    var _, tA;
    C(e.zeroScale), l(e.useSvg ?? !1), f(e.background), r(e.resolve), G(mJe(e.primaryColor)), F(!1), E(e.scaleIncludeUnmatchedChoropleth ?? !1), s({
      numberFormat: e.format.numberFormat,
      timeFormat: e.format.timeFormat,
      normalizedNumberFormat: e.format.normalizedNumberFormat
    }), p(e.colorPalette ?? ""), O.setValue(((_ = e.scale) == null ? void 0 : _.opacity) ?? {}), $.setValue(((tA = e.scale) == null ? void 0 : tA.size) ?? {}), v(e.geoMapTileUrl), U(i.timezoneDisplayOffset), q(!1);
  }, [t]), b.createElement(
    ig,
    { open: t, onOpenChange: () => {
      A.setShowVisualConfigPanel(!1);
    } },
    b.createElement(
      So,
      null,
      b.createElement(
        "div",
        { onClick: () => {
          c(!1);
        } },
        b.createElement(
          zk,
          null,
          b.createElement(
            _k,
            null,
            b.createElement(qk, null, "Colors")
          ),
          b.createElement(
            Tk,
            null,
            b.createElement(
              "div",
              { className: "flex space-x-6" },
              b.createElement(
                "div",
                null,
                b.createElement("label", { className: "block text-xs font-medium leading-6" }, n("config.primary_color")),
                b.createElement(
                  r1,
                  { fallback: b.createElement(
                    "div",
                    { className: "flex space-x-2" },
                    b.createElement("div", { className: "w-4 h-4", style: { backgroundColor: `rgba(${w.r},${w.g},${w.b},${w.a})` } }),
                    b.createElement(on, { value: w.r, type: "number", onChange: (_) => {
                      F(!0), G((tA) => ({ ...tA, r: Number(_.target.value) }));
                    } }),
                    b.createElement(on, { value: w.g, type: "number", onChange: (_) => {
                      F(!0), G((tA) => ({ ...tA, g: Number(_.target.value) }));
                    } }),
                    b.createElement(on, { value: w.b, type: "number", onChange: (_) => {
                      F(!0), G((tA) => ({ ...tA, b: Number(_.target.value) }));
                    } })
                  ) },
                  b.createElement(
                    "div",
                    { onClick: (_) => {
                      _.stopPropagation(), _.preventDefault();
                    } },
                    b.createElement("div", { className: "w-8 h-5 border-2", style: { backgroundColor: `rgba(${w.r},${w.g},${w.b},${w.a})` }, onClick: (_) => {
                      _.stopPropagation(), _.preventDefault(), c(!0);
                    } }),
                    b.createElement("div", { className: "absolute left-32 top-22 z-40 shadow-sm" }, Z && b.createElement(t5A, { presetColors: Kmt, color: w, onChange: (_) => {
                      F(!0), G({
                        ..._.rgb,
                        a: _.rgb.a ?? 1
                      });
                    } }))
                  )
                )
              ),
              b.createElement(
                "div",
                null,
                b.createElement("label", { className: "block text-xs font-medium leading-6" }, n("config.color_palette")),
                b.createElement(XpA, { className: "w-48 h-fit", popClassName: "w-48", selectedKey: J, onSelect: p, placeholder: n("config.default_color_palette"), options: hJe.map((_) => ({
                  value: _.name,
                  label: b.createElement(
                    b.Fragment,
                    null,
                    b.createElement(
                      "div",
                      { key: _.name, className: "flex flex-col justify-start items-center w-32" },
                      b.createElement("div", { className: "font-light" }, _.name),
                      b.createElement("div", { className: "flex w-full" }, _.value.map((tA, nA) => b.createElement("div", { key: nA, className: "h-4 flex-1", style: { backgroundColor: `${tA}` } })))
                    )
                  )
                })).concat({
                  value: "_none",
                  label: b.createElement(b.Fragment, null, n("config.default_color_palette"))
                }) })
              ),
              b.createElement(
                "div",
                null,
                b.createElement(
                  "label",
                  { className: "block text-xs font-medium leading-6" },
                  n("config.background"),
                  " ",
                  n("config.color")
                ),
                b.createElement(on, { type: "text", value: y ?? "", onChange: (_) => {
                  f(_.target.value);
                } })
              )
            )
          )
        ),
        b.createElement(
          zk,
          null,
          b.createElement(
            _k,
            null,
            b.createElement(qk, null, "Scale")
          ),
          b.createElement(
            Tk,
            null,
            b.createElement(
              "div",
              null,
              b.createElement("label", { className: "block text-xs font-medium leading-6" }, n("config.opacity")),
              b.createElement(YpA, { ...O, text: "opacity", maxRange: 1, minRange: 0 })
            ),
            b.createElement(
              "div",
              null,
              b.createElement("label", { className: "block text-xs font-medium leading-6" }, n("config.size")),
              b.createElement(YpA, { ...$, text: "size", maxRange: 100, minRange: 0 })
            )
          )
        ),
        b.createElement(
          zk,
          null,
          b.createElement(
            _k,
            null,
            b.createElement(qk, null, n("config.format")),
            b.createElement(
              "p",
              { className: "text-xs" },
              n("config.formatGuidesDocs"),
              ":",
              " ",
              b.createElement("a", { target: "_blank", className: "hover:underline text-primary", href: "https://github.com/d3/d3-format#locale_format" }, n("config.readHere"))
            )
          ),
          b.createElement(
            Tk,
            null,
            b.createElement("div", { className: "flex gap-4" }, o.map((_) => b.createElement(
              "div",
              { className: "my-2", key: _ },
              b.createElement("label", { className: "block text-xs font-medium leading-6" }, n(`config.${_}`)),
              b.createElement(
                "div",
                { className: "mt-1" },
                b.createElement(on, { type: "text", value: g[_] ?? "", onChange: (tA) => {
                  s((nA) => ({
                    ...nA,
                    [_]: tA.target.value
                  }));
                } })
              )
            )))
          )
        ),
        b.createElement(
          zk,
          null,
          b.createElement(
            _k,
            null,
            b.createElement(qk, null, n("config.independence"))
          ),
          b.createElement(
            Tk,
            null,
            b.createElement(
              "div",
              { className: "flex gap-x-6 gap-y-2 flex-wrap" },
              We.POSITION_CHANNEL_CONFIG_LIST.map((_) => b.createElement(uE, { label: n(`config.${_}`), key: _, enabled: I[_] ?? !1, onChange: (tA) => {
                r((nA) => ({
                  ...nA,
                  [_]: tA
                }));
              } })),
              We.NON_POSITION_CHANNEL_CONFIG_LIST.map((_) => b.createElement(uE, { label: n(`constant.draggable_key.${_}`), key: _, enabled: I[_] ?? !1, onChange: (tA) => {
                r((nA) => ({
                  ...nA,
                  [_]: tA
                }));
              } }))
            )
          )
        ),
        b.createElement(
          zk,
          null,
          b.createElement(
            _k,
            null,
            b.createElement(qk, null, n("config.misc"))
          ),
          b.createElement(
            Tk,
            null,
            b.createElement(
              "div",
              { className: "flex flex-col space-y-2" },
              b.createElement(
                "div",
                { className: "flex flex-col space-y-2" },
                b.createElement(uE, { label: n("config.customTile"), enabled: an(N), onChange: (_) => {
                  v(_ ? "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" : void 0);
                } }),
                an(N) && b.createElement(on, { type: "text", value: N, onChange: (_) => {
                  v(_.target.value);
                } })
              ),
              b.createElement(
                "div",
                { className: "flex gap-x-6 gap-y-2 flex-wrap" },
                b.createElement(uE, { label: n("config.zeroScale"), enabled: a, onChange: (_) => {
                  C(_);
                } }),
                b.createElement(uE, { label: n("config.svg"), enabled: B, onChange: (_) => {
                  l(_);
                } }),
                b.createElement(uE, { label: "include unmatched choropleth in scale", enabled: Q, onChange: (_) => {
                  E(_);
                } }),
                b.createElement(uE, { label: "include shapes without data", enabled: d, onChange: (_) => {
                  m(_);
                } })
              ),
              b.createElement(
                "div",
                { className: "flex flex-col space-y-2" },
                b.createElement(uE, { label: n("config.customOffset"), enabled: an(K), onChange: (_) => {
                  q(!0), U(_ ? (/* @__PURE__ */ new Date()).getTimezoneOffset() : void 0);
                } }),
                an(K) && b.createElement(XpA, { className: "w-full", popClassName: "w-[400px]", selectedKey: `${K}`, onSelect: (_) => {
                  q(!0), U(parseInt(_));
                }, options: Nnt.map((_) => ({
                  value: `${_.value}`,
                  label: b.createElement("span", { title: _.name }, _.name)
                })) })
              )
            )
          )
        ),
        b.createElement(
          vl,
          { className: "gap-2" },
          b.createElement(Re, { variant: "outline", onClick: () => {
            A.setShowVisualConfigPanel(!1);
          } }, n("actions.cancel")),
          b.createElement(Re, { onClick: () => {
            ONA(() => {
              A.setVisualLayout(["format", g], ["zeroScale", a], ["scaleIncludeUnmatchedChoropleth", Q], ["showAllGeoshapeInChoropleth", d], ["background", y], ["resolve", I], ["colorPalette", J], ["useSvg", B], ["scale", { opacity: O.value, size: $.value }], ...R ? [
                [
                  "primaryColor",
                  `rgba(${w.r},${w.g},${w.b},${w.a})`
                ]
              ] : [], ["geoMapTileUrl", N]), j && A.setVisualConfig("timezoneDisplayOffset", K), A.setShowVisualConfigPanel(!1);
            });
          } }, n("actions.confirm"))
        )
      )
    )
  );
}, Vmt = gt(Umt);
function Xmt(A, e, t, i) {
  const n = {}, o = {};
  t.forEach((I) => {
    n[I] = 0, o[I] = 0;
  }), e.forEach((I) => {
    t.forEach((r) => {
      n[r] += Math.abs(I[r]);
    });
  }), A.forEach((I) => {
    t.forEach((r) => {
      o[r] += Math.abs(I[r]);
    });
  });
  const g = [];
  e.forEach((I) => {
    const r = { ...I };
    t.forEach((a) => {
      r[a] /= n[a];
    }), g.push(r);
  });
  const s = [];
  return A.forEach((I) => {
    const r = { ...I };
    t.forEach((a) => {
      i ? r[a] /= n[a] : r[a] /= o[a];
    }), s.push(r);
  }), {
    normalizedData: s,
    normalizedParentData: g
  };
}
function zmt(A, e, t, i) {
  let n = 0;
  const o = e.map(() => !1);
  for (let s of A) {
    let I = e.findIndex((r, a) => !o[a] && t.every((C) => r[C] === s[C]));
    if (I > -1) {
      o[I] = !0;
      const r = e[I];
      let a = s[i], C = r[i];
      if (a === 0 || C === 0)
        continue;
      let B = 0.5 * (a + C);
      n += 0.5 * a * Math.log2(a / B) + 0.5 * C * Math.log2(C / B);
    }
  }
  const g = o.filter((s) => s === !0).length / o.length;
  return n * g;
}
function Tmt(A) {
  return A.all.filter((e) => e.analyticType === "dimension").filter((e) => !A.selection.find((t) => t.fid === e.fid));
}
const _mt = 10;
async function qmt(A) {
  const { allFields: e, viewFilters: t, viewMeasures: i, viewDimensions: n, predicates: o, computationFunction: g, timezoneDisplayOffset: s } = A, I = Tmt({
    all: e.filter((a) => a.analyticType === "dimension"),
    selection: n
  }), r = [];
  for (let a of I) {
    let C = a.fid, B = [];
    a.semanticType === "quantitative" && B.push({
      type: "transform",
      transform: [
        {
          key: C,
          expression: {
            op: "bin",
            as: C,
            num: _mt,
            params: [{
              type: "field",
              value: a.fid
            }]
          }
        }
      ]
    });
    for (let l of i) {
      const Q = Vu(t, e, [a], [l], !0, "none", [], void 0, s), E = B ? [...B, ...Q] : Q, d = await AS(g, E), m = Vu(t, e, [...n, a], [l], !0, "none", [], void 0, s), y = B ? [...B, ...m] : m, f = await AS(g, y), w = QBe(f, o);
      let G = Xmt(w, d, [io(l.fid, l.aggName ?? "sum")], !1), R = zmt(G.normalizedData, G.normalizedParentData, [a.fid], io(l.fid, l.aggName ?? "sum"));
      r.push({
        measureField: l,
        targetField: a,
        score: R,
        normalizedData: w,
        normalizedParentData: d
      });
    }
  }
  return r.sort((a, C) => C.score - a.score);
}
const Omt = ji.div`
    height: 50vh;
    overflow-y: hidden;
`, jmt = ji.div`
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    height: 100%;
    overflow-y: scroll;
`, Pmt = ji.div`
    margin-block: 0.2em;
    margin-inline: 0.2em;
    padding: 0.5em;
    border-width: 2px;
    cursor: pointer;
`, P0A = (A, e) => {
  if (e.semanticType === "quantitative") {
    let t = e.fid;
    return `${A[t][0].toFixed(2)}-${A[t][1].toFixed(2)}`;
  } else
    return A[e.fid];
}, $mt = gt(({ themeKey: A }) => {
  const e = xt(), t = u.useContext(FQ), i = sg(), { allFields: n, viewMeasures: o, viewDimensions: g, viewFilters: s, showInsightBoard: I, selectedMarkObject: r, config: a } = e, { timezoneDisplayOffset: C } = a, [B, l] = u.useState([]), [Q, E] = u.useState(0), d = u.useRef(null), m = u.useMemo(() => {
    var f;
    return {
      ...(f = lS[A ?? "vega"]) == null ? void 0 : f[t]
    };
  }, [A, t]);
  qe();
  const y = async (f) => {
    const w = await qmt({
      predicates: f,
      viewFilters: s,
      allFields: n,
      viewMeasures: o,
      viewDimensions: g,
      computationFunction: i,
      timezoneDisplayOffset: C
    });
    l(w);
  };
  return u.useEffect(() => {
    if (!I || Object.keys(r).length === 0)
      return;
    const f = g.map((w) => ({
      key: w.fid,
      type: "discrete",
      range: /* @__PURE__ */ new Set([r[w.fid]])
    }));
    y(f);
  }, [o, g, I, r]), u.useEffect(() => {
    if (d.current && B.length > 0) {
      const { normalizedData: f, normalizedParentData: w, targetField: G, measureField: R } = B[Q], { semanticType: F, name: Z, fid: c } = G, J = [
        ...f.map((v) => ({
          category: P0A(v, G),
          ...v,
          type: "child"
        })),
        ...w.map((v) => ({
          category: P0A(v, G),
          ...v,
          type: "parent"
        }))
      ], p = {
        x: {
          field: "category",
          type: F === "quantitative" ? "ordinal" : F,
          axis: {
            title: `Distribution of Values for ${Z}`
          }
        }
      }, N = {
        data: {
          values: J
        },
        width: 320,
        height: 200,
        encoding: {
          ...p,
          color: {
            legend: {
              orient: "bottom"
            }
          }
        },
        layer: [
          {
            mark: {
              type: "bar",
              width: 15,
              opacity: 0.7
            },
            encoding: {
              y: {
                field: io(R.fid, R.aggName),
                type: "quantitative",
                title: `${R.aggName} ${R.name} for All Marks`
              },
              color: { datum: "All Marks" }
            },
            transform: [{ filter: "datum.type === 'parent'" }]
          },
          {
            mark: {
              type: "bar",
              width: 10,
              opacity: 0.7
            },
            encoding: {
              y: {
                field: io(R.fid, R.aggName),
                type: "quantitative",
                title: `${R.aggName} ${R.name} for Selected Mark`
              },
              color: { datum: "Selected Mark" }
            },
            transform: [{ filter: "datum.type === 'child'" }]
          }
        ],
        resolve: { scale: { y: "independent" } }
      };
      Tf(d.current, N, {
        mode: "vega-lite",
        actions: !1,
        config: m,
        tooltip: {
          theme: t
        }
      });
    }
  }, [B, d.current, Q, m]), b.createElement(
    ig,
    { open: I, onOpenChange: () => {
      e.setShowInsightBoard(!1), E(0);
    } },
    b.createElement(
      So,
      null,
      B.length === 0 && b.createElement(Ts, null),
      b.createElement(
        Omt,
        { className: "grid grid-cols-4" },
        b.createElement(jmt, { className: "col-span-1" }, B.map((f, w) => b.createElement(
          Pmt,
          { key: w, className: `${Q === w ? "border-primary" : ""} text-xs`, onClick: () => E(w) },
          f.targetField.name,
          " ",
          f.score.toFixed(2)
        ))),
        b.createElement(
          "div",
          { className: "col-span-3 text-center overflow-y-scroll" },
          b.createElement("div", { ref: d })
        )
      )
    )
  );
}), Apt = $mt;
var ept = /* @__PURE__ */ new Map([
  // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
  ["aac", "audio/aac"],
  ["abw", "application/x-abiword"],
  ["arc", "application/x-freearc"],
  ["avif", "image/avif"],
  ["avi", "video/x-msvideo"],
  ["azw", "application/vnd.amazon.ebook"],
  ["bin", "application/octet-stream"],
  ["bmp", "image/bmp"],
  ["bz", "application/x-bzip"],
  ["bz2", "application/x-bzip2"],
  ["cda", "application/x-cdf"],
  ["csh", "application/x-csh"],
  ["css", "text/css"],
  ["csv", "text/csv"],
  ["doc", "application/msword"],
  ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
  ["eot", "application/vnd.ms-fontobject"],
  ["epub", "application/epub+zip"],
  ["gz", "application/gzip"],
  ["gif", "image/gif"],
  ["heic", "image/heic"],
  ["heif", "image/heif"],
  ["htm", "text/html"],
  ["html", "text/html"],
  ["ico", "image/vnd.microsoft.icon"],
  ["ics", "text/calendar"],
  ["jar", "application/java-archive"],
  ["jpeg", "image/jpeg"],
  ["jpg", "image/jpeg"],
  ["js", "text/javascript"],
  ["json", "application/json"],
  ["jsonld", "application/ld+json"],
  ["mid", "audio/midi"],
  ["midi", "audio/midi"],
  ["mjs", "text/javascript"],
  ["mp3", "audio/mpeg"],
  ["mp4", "video/mp4"],
  ["mpeg", "video/mpeg"],
  ["mpkg", "application/vnd.apple.installer+xml"],
  ["odp", "application/vnd.oasis.opendocument.presentation"],
  ["ods", "application/vnd.oasis.opendocument.spreadsheet"],
  ["odt", "application/vnd.oasis.opendocument.text"],
  ["oga", "audio/ogg"],
  ["ogv", "video/ogg"],
  ["ogx", "application/ogg"],
  ["opus", "audio/opus"],
  ["otf", "font/otf"],
  ["png", "image/png"],
  ["pdf", "application/pdf"],
  ["php", "application/x-httpd-php"],
  ["ppt", "application/vnd.ms-powerpoint"],
  ["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"],
  ["rar", "application/vnd.rar"],
  ["rtf", "application/rtf"],
  ["sh", "application/x-sh"],
  ["svg", "image/svg+xml"],
  ["swf", "application/x-shockwave-flash"],
  ["tar", "application/x-tar"],
  ["tif", "image/tiff"],
  ["tiff", "image/tiff"],
  ["ts", "video/mp2t"],
  ["ttf", "font/ttf"],
  ["txt", "text/plain"],
  ["vsd", "application/vnd.visio"],
  ["wav", "audio/wav"],
  ["weba", "audio/webm"],
  ["webm", "video/webm"],
  ["webp", "image/webp"],
  ["woff", "font/woff"],
  ["woff2", "font/woff2"],
  ["xhtml", "application/xhtml+xml"],
  ["xls", "application/vnd.ms-excel"],
  ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
  ["xml", "application/xml"],
  ["xul", "application/vnd.mozilla.xul+xml"],
  ["zip", "application/zip"],
  ["7z", "application/x-7z-compressed"],
  // Others
  ["mkv", "video/x-matroska"],
  ["mov", "video/quicktime"],
  ["msg", "application/vnd.ms-outlook"]
]);
function C1(A, e) {
  var t = tpt(A);
  if (typeof t.path != "string") {
    var i = A.webkitRelativePath;
    Object.defineProperty(t, "path", {
      value: typeof e == "string" ? e : typeof i == "string" && i.length > 0 ? i : A.name,
      writable: !1,
      configurable: !1,
      enumerable: !0
    });
  }
  return t;
}
function tpt(A) {
  var e = A.name, t = e && e.lastIndexOf(".") !== -1;
  if (t && !A.type) {
    var i = e.split(".").pop().toLowerCase(), n = ept.get(i);
    n && Object.defineProperty(A, "type", {
      value: n,
      writable: !1,
      configurable: !1,
      enumerable: !0
    });
  }
  return A;
}
var ipt = [
  // Thumbnail cache files for macOS and Windows
  ".DS_Store",
  "Thumbs.db"
  // Windows
];
function npt(A) {
  return RD(this, void 0, void 0, function() {
    return FD(this, function(e) {
      return AW(A) && opt(A.dataTransfer) ? [2, apt(A.dataTransfer, A.type)] : gpt(A) ? [2, spt(A)] : Array.isArray(A) && A.every(function(t) {
        return "getFile" in t && typeof t.getFile == "function";
      }) ? [2, Ipt(A)] : [2, []];
    });
  });
}
function opt(A) {
  return AW(A);
}
function gpt(A) {
  return AW(A) && AW(A.target);
}
function AW(A) {
  return typeof A == "object" && A !== null;
}
function spt(A) {
  return i6(A.target.files).map(function(e) {
    return C1(e);
  });
}
function Ipt(A) {
  return RD(this, void 0, void 0, function() {
    var e;
    return FD(this, function(t) {
      switch (t.label) {
        case 0:
          return [4, Promise.all(A.map(function(i) {
            return i.getFile();
          }))];
        case 1:
          return e = t.sent(), [2, e.map(function(i) {
            return C1(i);
          })];
      }
    });
  });
}
function apt(A, e) {
  return RD(this, void 0, void 0, function() {
    var t, i;
    return FD(this, function(n) {
      switch (n.label) {
        case 0:
          return A.items ? (t = i6(A.items).filter(function(o) {
            return o.kind === "file";
          }), e !== "drop" ? [2, t] : [4, Promise.all(t.map(rpt))]) : [3, 2];
        case 1:
          return i = n.sent(), [2, $0A(i5A(i))];
        case 2:
          return [2, $0A(i6(A.files).map(function(o) {
            return C1(o);
          }))];
      }
    });
  });
}
function $0A(A) {
  return A.filter(function(e) {
    return ipt.indexOf(e.name) === -1;
  });
}
function i6(A) {
  if (A === null)
    return [];
  for (var e = [], t = 0; t < A.length; t++) {
    var i = A[t];
    e.push(i);
  }
  return e;
}
function rpt(A) {
  if (typeof A.webkitGetAsEntry != "function")
    return AyA(A);
  var e = A.webkitGetAsEntry();
  return e && e.isDirectory ? n5A(e) : AyA(A);
}
function i5A(A) {
  return A.reduce(function(e, t) {
    return scA(scA([], gcA(e), !1), gcA(Array.isArray(t) ? i5A(t) : [t]), !1);
  }, []);
}
function AyA(A) {
  var e = A.getAsFile();
  if (!e)
    return Promise.reject("".concat(A, " is not a File"));
  var t = C1(e);
  return Promise.resolve(t);
}
function Cpt(A) {
  return RD(this, void 0, void 0, function() {
    return FD(this, function(e) {
      return [2, A.isDirectory ? n5A(A) : Bpt(A)];
    });
  });
}
function n5A(A) {
  var e = A.createReader();
  return new Promise(function(t, i) {
    var n = [];
    function o() {
      var g = this;
      e.readEntries(function(s) {
        return RD(g, void 0, void 0, function() {
          var I, r, a;
          return FD(this, function(C) {
            switch (C.label) {
              case 0:
                if (s.length)
                  return [3, 5];
                C.label = 1;
              case 1:
                return C.trys.push([1, 3, , 4]), [4, Promise.all(n)];
              case 2:
                return I = C.sent(), t(I), [3, 4];
              case 3:
                return r = C.sent(), i(r), [3, 4];
              case 4:
                return [3, 6];
              case 5:
                a = Promise.all(s.map(Cpt)), n.push(a), o(), C.label = 6;
              case 6:
                return [
                  2
                  /*return*/
                ];
            }
          });
        });
      }, function(s) {
        i(s);
      });
    }
    o();
  });
}
function Bpt(A) {
  return RD(this, void 0, void 0, function() {
    return FD(this, function(e) {
      return [2, new Promise(function(t, i) {
        A.file(function(n) {
          var o = C1(n, A.fullPath);
          t(o);
        }, function(n) {
          i(n);
        });
      })];
    });
  });
}
var lpt = function(A, e) {
  if (A && e) {
    var t = Array.isArray(e) ? e : e.split(","), i = A.name || "", n = (A.type || "").toLowerCase(), o = n.replace(/\/.*$/, "");
    return t.some(function(g) {
      var s = g.trim().toLowerCase();
      return s.charAt(0) === "." ? i.toLowerCase().endsWith(s) : s.endsWith("/*") ? o === s.replace(/\/.*$/, "") : n === s;
    });
  }
  return !0;
};
function eyA(A) {
  return Ept(A) || Qpt(A) || g5A(A) || cpt();
}
function cpt() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Qpt(A) {
  if (typeof Symbol < "u" && A[Symbol.iterator] != null || A["@@iterator"] != null)
    return Array.from(A);
}
function Ept(A) {
  if (Array.isArray(A))
    return n6(A);
}
function tyA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function iyA(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? tyA(Object(t), !0).forEach(function(i) {
      o5A(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : tyA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function o5A(A, e, t) {
  return e in A ? Object.defineProperty(A, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : A[e] = t, A;
}
function N2(A, e) {
  return hpt(A) || dpt(A, e) || g5A(A, e) || upt();
}
function upt() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function g5A(A, e) {
  if (A) {
    if (typeof A == "string")
      return n6(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    if (t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set")
      return Array.from(A);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return n6(A, e);
  }
}
function n6(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}
function dpt(A, e) {
  var t = A == null ? null : typeof Symbol < "u" && A[Symbol.iterator] || A["@@iterator"];
  if (t != null) {
    var i = [], n = !0, o = !1, g, s;
    try {
      for (t = t.call(A); !(n = (g = t.next()).done) && (i.push(g.value), !(e && i.length === e)); n = !0)
        ;
    } catch (I) {
      o = !0, s = I;
    } finally {
      try {
        !n && t.return != null && t.return();
      } finally {
        if (o)
          throw s;
      }
    }
    return i;
  }
}
function hpt(A) {
  if (Array.isArray(A))
    return A;
}
var mpt = "file-invalid-type", ppt = "file-too-large", ypt = "file-too-small", bpt = "too-many-files", wpt = function(A) {
  A = Array.isArray(A) && A.length === 1 ? A[0] : A;
  var e = Array.isArray(A) ? "one of ".concat(A.join(", ")) : A;
  return {
    code: mpt,
    message: "File type must be ".concat(e)
  };
}, nyA = function(A) {
  return {
    code: ppt,
    message: "File is larger than ".concat(A, " ").concat(A === 1 ? "byte" : "bytes")
  };
}, oyA = function(A) {
  return {
    code: ypt,
    message: "File is smaller than ".concat(A, " ").concat(A === 1 ? "byte" : "bytes")
  };
}, fpt = {
  code: bpt,
  message: "Too many files"
};
function s5A(A, e) {
  var t = A.type === "application/x-moz-file" || lpt(A, e);
  return [t, t ? null : wpt(e)];
}
function I5A(A, e, t) {
  if (om(A.size))
    if (om(e) && om(t)) {
      if (A.size > t)
        return [!1, nyA(t)];
      if (A.size < e)
        return [!1, oyA(e)];
    } else {
      if (om(e) && A.size < e)
        return [!1, oyA(e)];
      if (om(t) && A.size > t)
        return [!1, nyA(t)];
    }
  return [!0, null];
}
function om(A) {
  return A != null;
}
function Dpt(A) {
  var e = A.files, t = A.accept, i = A.minSize, n = A.maxSize, o = A.multiple, g = A.maxFiles, s = A.validator;
  return !o && e.length > 1 || o && g >= 1 && e.length > g ? !1 : e.every(function(I) {
    var r = s5A(I, t), a = N2(r, 1), C = a[0], B = I5A(I, i, n), l = N2(B, 1), Q = l[0], E = s ? s(I) : null;
    return C && Q && !E;
  });
}
function eW(A) {
  return typeof A.isPropagationStopped == "function" ? A.isPropagationStopped() : typeof A.cancelBubble < "u" ? A.cancelBubble : !1;
}
function Zx(A) {
  return A.dataTransfer ? Array.prototype.some.call(A.dataTransfer.types, function(e) {
    return e === "Files" || e === "application/x-moz-file";
  }) : !!A.target && !!A.target.files;
}
function gyA(A) {
  A.preventDefault();
}
function Gpt(A) {
  return A.indexOf("MSIE") !== -1 || A.indexOf("Trident/") !== -1;
}
function kpt(A) {
  return A.indexOf("Edge/") !== -1;
}
function Jpt() {
  var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
  return Gpt(A) || kpt(A);
}
function PC() {
  for (var A = arguments.length, e = new Array(A), t = 0; t < A; t++)
    e[t] = arguments[t];
  return function(i) {
    for (var n = arguments.length, o = new Array(n > 1 ? n - 1 : 0), g = 1; g < n; g++)
      o[g - 1] = arguments[g];
    return e.some(function(s) {
      return !eW(i) && s && s.apply(void 0, [i].concat(o)), eW(i);
    });
  };
}
function Npt() {
  return "showOpenFilePicker" in window;
}
function Ypt(A) {
  if (om(A)) {
    var e = Object.entries(A).filter(function(t) {
      var i = N2(t, 2), n = i[0], o = i[1], g = !0;
      return a5A(n) || (console.warn('Skipped "'.concat(n, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')), g = !1), (!Array.isArray(o) || !o.every(r5A)) && (console.warn('Skipped "'.concat(n, '" because an invalid file extension was provided.')), g = !1), g;
    }).reduce(function(t, i) {
      var n = N2(i, 2), o = n[0], g = n[1];
      return iyA(iyA({}, t), {}, o5A({}, o, g));
    }, {});
    return [{
      // description is required due to https://crbug.com/1264708
      description: "Files",
      accept: e
    }];
  }
  return A;
}
function Rpt(A) {
  if (om(A))
    return Object.entries(A).reduce(function(e, t) {
      var i = N2(t, 2), n = i[0], o = i[1];
      return [].concat(eyA(e), [n], eyA(o));
    }, []).filter(function(e) {
      return a5A(e) || r5A(e);
    }).join(",");
}
function Fpt(A) {
  return A instanceof DOMException && (A.name === "AbortError" || A.code === A.ABORT_ERR);
}
function Mpt(A) {
  return A instanceof DOMException && (A.name === "SecurityError" || A.code === A.SECURITY_ERR);
}
function a5A(A) {
  return A === "audio/*" || A === "video/*" || A === "image/*" || A === "text/*" || /\w+\/[-+.\w]+/g.test(A);
}
function r5A(A) {
  return /^.*\.[\w]+$/.test(A);
}
var xpt = ["children"], Lpt = ["open"], vpt = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], Hpt = ["refKey", "onChange", "onClick"];
function Spt(A) {
  return Kpt(A) || Wpt(A) || C5A(A) || Zpt();
}
function Zpt() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Wpt(A) {
  if (typeof Symbol < "u" && A[Symbol.iterator] != null || A["@@iterator"] != null)
    return Array.from(A);
}
function Kpt(A) {
  if (Array.isArray(A))
    return o6(A);
}
function PT(A, e) {
  return Xpt(A) || Vpt(A, e) || C5A(A, e) || Upt();
}
function Upt() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function C5A(A, e) {
  if (A) {
    if (typeof A == "string")
      return o6(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    if (t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set")
      return Array.from(A);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return o6(A, e);
  }
}
function o6(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}
function Vpt(A, e) {
  var t = A == null ? null : typeof Symbol < "u" && A[Symbol.iterator] || A["@@iterator"];
  if (t != null) {
    var i = [], n = !0, o = !1, g, s;
    try {
      for (t = t.call(A); !(n = (g = t.next()).done) && (i.push(g.value), !(e && i.length === e)); n = !0)
        ;
    } catch (I) {
      o = !0, s = I;
    } finally {
      try {
        !n && t.return != null && t.return();
      } finally {
        if (o)
          throw s;
      }
    }
    return i;
  }
}
function Xpt(A) {
  if (Array.isArray(A))
    return A;
}
function syA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function bn(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? syA(Object(t), !0).forEach(function(i) {
      g6(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : syA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function g6(A, e, t) {
  return e in A ? Object.defineProperty(A, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : A[e] = t, A;
}
function tW(A, e) {
  if (A == null)
    return {};
  var t = zpt(A, e), i, n;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(A);
    for (n = 0; n < o.length; n++)
      i = o[n], !(e.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(A, i) && (t[i] = A[i]);
  }
  return t;
}
function zpt(A, e) {
  if (A == null)
    return {};
  var t = {}, i = Object.keys(A), n, o;
  for (o = 0; o < i.length; o++)
    n = i[o], !(e.indexOf(n) >= 0) && (t[n] = A[n]);
  return t;
}
var yX = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.children, i = tW(A, xpt), n = _pt(i), o = n.open, g = tW(n, Lpt);
  return u.useImperativeHandle(e, function() {
    return {
      open: o
    };
  }, [o]), /* @__PURE__ */ b.createElement(u.Fragment, null, t(bn(bn({}, g), {}, {
    open: o
  })));
});
yX.displayName = "Dropzone";
var B5A = {
  disabled: !1,
  getFilesFromEvent: npt,
  maxSize: 1 / 0,
  minSize: 0,
  multiple: !0,
  maxFiles: 0,
  preventDropOnDocument: !0,
  noClick: !1,
  noKeyboard: !1,
  noDrag: !1,
  noDragEventsBubbling: !1,
  validator: null,
  useFsAccessApi: !0,
  autoFocus: !1
};
yX.defaultProps = B5A;
yX.propTypes = {
  /**
   * Render function that exposes the dropzone state and prop getter fns
   *
   * @param {object} params
   * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render
   * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render
   * @param {Function} params.open Open the native file selection dialog
   * @param {boolean} params.isFocused Dropzone area is in focus
   * @param {boolean} params.isFileDialogActive File dialog is opened
   * @param {boolean} params.isDragActive Active drag is in progress
   * @param {boolean} params.isDragAccept Dragged files are accepted
   * @param {boolean} params.isDragReject Some dragged files are rejected
   * @param {File[]} params.acceptedFiles Accepted files
   * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
   */
  children: KA.func,
  /**
   * Set accepted file types.
   * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
   * Keep in mind that mime type determination is not reliable across platforms. CSV files,
   * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
   * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
   */
  accept: KA.objectOf(KA.arrayOf(KA.string)),
  /**
   * Allow drag 'n' drop (or selection from the file dialog) of multiple files
   */
  multiple: KA.bool,
  /**
   * If false, allow dropped items to take over the current browser window
   */
  preventDropOnDocument: KA.bool,
  /**
   * If true, disables click to open the native file selection dialog
   */
  noClick: KA.bool,
  /**
   * If true, disables SPACE/ENTER to open the native file selection dialog.
   * Note that it also stops tracking the focus state.
   */
  noKeyboard: KA.bool,
  /**
   * If true, disables drag 'n' drop
   */
  noDrag: KA.bool,
  /**
   * If true, stops drag event propagation to parents
   */
  noDragEventsBubbling: KA.bool,
  /**
   * Minimum file size (in bytes)
   */
  minSize: KA.number,
  /**
   * Maximum file size (in bytes)
   */
  maxSize: KA.number,
  /**
   * Maximum accepted number of files
   * The default value is 0 which means there is no limitation to how many files are accepted.
   */
  maxFiles: KA.number,
  /**
   * Enable/disable the dropzone
   */
  disabled: KA.bool,
  /**
   * Use this to provide a custom file aggregator
   *
   * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
   */
  getFilesFromEvent: KA.func,
  /**
   * Cb for when closing the file dialog with no selection
   */
  onFileDialogCancel: KA.func,
  /**
   * Cb for when opening the file dialog
   */
  onFileDialogOpen: KA.func,
  /**
   * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
   * to open the file picker instead of using an `<input type="file">` click event.
   */
  useFsAccessApi: KA.bool,
  /**
   * Set to true to focus the root element on render
   */
  autoFocus: KA.bool,
  /**
   * Cb for when the `dragenter` event occurs.
   *
   * @param {DragEvent} event
   */
  onDragEnter: KA.func,
  /**
   * Cb for when the `dragleave` event occurs
   *
   * @param {DragEvent} event
   */
  onDragLeave: KA.func,
  /**
   * Cb for when the `dragover` event occurs
   *
   * @param {DragEvent} event
   */
  onDragOver: KA.func,
  /**
   * Cb for when the `drop` event occurs.
   * Note that this callback is invoked after the `getFilesFromEvent` callback is done.
   *
   * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
   * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.
   * If `multiple` is set to false and additional files are dropped,
   * all files besides the first will be rejected.
   * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
   *
   * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
   * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.
   *
   * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
   * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
   *
   * ```js
   * function onDrop(acceptedFiles) {
   *   const req = request.post('/upload')
   *   acceptedFiles.forEach(file => {
   *     req.attach(file.name, file)
   *   })
   *   req.end(callback)
   * }
   * ```
   *
   * @param {File[]} acceptedFiles
   * @param {FileRejection[]} fileRejections
   * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
   */
  onDrop: KA.func,
  /**
   * Cb for when the `drop` event occurs.
   * Note that if no files are accepted, this callback is not invoked.
   *
   * @param {File[]} files
   * @param {(DragEvent|Event)} event
   */
  onDropAccepted: KA.func,
  /**
   * Cb for when the `drop` event occurs.
   * Note that if no files are rejected, this callback is not invoked.
   *
   * @param {FileRejection[]} fileRejections
   * @param {(DragEvent|Event)} event
   */
  onDropRejected: KA.func,
  /**
   * Cb for when there's some error from any of the promises.
   *
   * @param {Error} error
   */
  onError: KA.func,
  /**
   * Custom validation function. It must return null if there's no errors.
   * @param {File} file
   * @returns {FileError|FileError[]|null}
   */
  validator: KA.func
};
const Tpt = yX;
var s6 = {
  isFocused: !1,
  isFileDialogActive: !1,
  isDragActive: !1,
  isDragAccept: !1,
  isDragReject: !1,
  acceptedFiles: [],
  fileRejections: []
};
function _pt() {
  var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = bn(bn({}, B5A), A), t = e.accept, i = e.disabled, n = e.getFilesFromEvent, o = e.maxSize, g = e.minSize, s = e.multiple, I = e.maxFiles, r = e.onDragEnter, a = e.onDragLeave, C = e.onDragOver, B = e.onDrop, l = e.onDropAccepted, Q = e.onDropRejected, E = e.onFileDialogCancel, d = e.onFileDialogOpen, m = e.useFsAccessApi, y = e.autoFocus, f = e.preventDropOnDocument, w = e.noClick, G = e.noKeyboard, R = e.noDrag, F = e.noDragEventsBubbling, Z = e.onError, c = e.validator, J = u.useMemo(function() {
    return Rpt(t);
  }, [t]), p = u.useMemo(function() {
    return Ypt(t);
  }, [t]), N = u.useMemo(function() {
    return typeof d == "function" ? d : IyA;
  }, [d]), v = u.useMemo(function() {
    return typeof E == "function" ? E : IyA;
  }, [E]), K = u.useRef(null), U = u.useRef(null), j = u.useReducer(qpt, s6), q = PT(j, 2), O = q[0], $ = q[1], _ = O.isFocused, tA = O.isFileDialogActive, nA = u.useRef(typeof window < "u" && window.isSecureContext && m && Npt()), AA = function() {
    !nA.current && tA && setTimeout(function() {
      if (U.current) {
        var wA = U.current.files;
        wA.length || ($({
          type: "closeDialog"
        }), v());
      }
    }, 300);
  };
  u.useEffect(function() {
    return window.addEventListener("focus", AA, !1), function() {
      window.removeEventListener("focus", AA, !1);
    };
  }, [U, tA, v, nA]);
  var gA = u.useRef([]), rA = function(wA) {
    K.current && K.current.contains(wA.target) || (wA.preventDefault(), gA.current = []);
  };
  u.useEffect(function() {
    return f && (document.addEventListener("dragover", gyA, !1), document.addEventListener("drop", rA, !1)), function() {
      f && (document.removeEventListener("dragover", gyA), document.removeEventListener("drop", rA));
    };
  }, [K, f]), u.useEffect(function() {
    return !i && y && K.current && K.current.focus(), function() {
    };
  }, [K, y, i]);
  var sA = u.useCallback(function(wA) {
    Z ? Z(wA) : console.error(wA);
  }, [Z]), lA = u.useCallback(function(wA) {
    wA.preventDefault(), wA.persist(), De(wA), gA.current = [].concat(Spt(gA.current), [wA.target]), Zx(wA) && Promise.resolve(n(wA)).then(function(WA) {
      if (!(eW(wA) && !F)) {
        var Pe = WA.length, je = Pe > 0 && Dpt({
          files: WA,
          accept: J,
          minSize: g,
          maxSize: o,
          multiple: s,
          maxFiles: I,
          validator: c
        }), it = Pe > 0 && !je;
        $({
          isDragAccept: je,
          isDragReject: it,
          isDragActive: !0,
          type: "setDraggedFiles"
        }), r && r(wA);
      }
    }).catch(function(WA) {
      return sA(WA);
    });
  }, [n, r, sA, F, J, g, o, s, I, c]), cA = u.useCallback(function(wA) {
    wA.preventDefault(), wA.persist(), De(wA);
    var WA = Zx(wA);
    if (WA && wA.dataTransfer)
      try {
        wA.dataTransfer.dropEffect = "copy";
      } catch {
      }
    return WA && C && C(wA), !1;
  }, [C, F]), aA = u.useCallback(function(wA) {
    wA.preventDefault(), wA.persist(), De(wA);
    var WA = gA.current.filter(function(je) {
      return K.current && K.current.contains(je);
    }), Pe = WA.indexOf(wA.target);
    Pe !== -1 && WA.splice(Pe, 1), gA.current = WA, !(WA.length > 0) && ($({
      type: "setDraggedFiles",
      isDragActive: !1,
      isDragAccept: !1,
      isDragReject: !1
    }), Zx(wA) && a && a(wA));
  }, [K, a, F]), QA = u.useCallback(function(wA, WA) {
    var Pe = [], je = [];
    wA.forEach(function(it) {
      var Li = s5A(it, J), zA = PT(Li, 2), Qe = zA[0], de = zA[1], xe = I5A(it, g, o), $e = PT(xe, 2), Pn = $e[0], Zt = $e[1], Kn = c ? c(it) : null;
      if (Qe && Pn && !Kn)
        Pe.push(it);
      else {
        var po = [de, Zt];
        Kn && (po = po.concat(Kn)), je.push({
          file: it,
          errors: po.filter(function(go) {
            return go;
          })
        });
      }
    }), (!s && Pe.length > 1 || s && I >= 1 && Pe.length > I) && (Pe.forEach(function(it) {
      je.push({
        file: it,
        errors: [fpt]
      });
    }), Pe.splice(0)), $({
      acceptedFiles: Pe,
      fileRejections: je,
      type: "setFiles"
    }), B && B(Pe, je, WA), je.length > 0 && Q && Q(je, WA), Pe.length > 0 && l && l(Pe, WA);
  }, [$, s, J, g, o, I, B, l, Q, c]), hA = u.useCallback(function(wA) {
    wA.preventDefault(), wA.persist(), De(wA), gA.current = [], Zx(wA) && Promise.resolve(n(wA)).then(function(WA) {
      eW(wA) && !F || QA(WA, wA);
    }).catch(function(WA) {
      return sA(WA);
    }), $({
      type: "reset"
    });
  }, [n, QA, sA, F]), EA = u.useCallback(function() {
    if (nA.current) {
      $({
        type: "openDialog"
      }), N();
      var wA = {
        multiple: s,
        types: p
      };
      window.showOpenFilePicker(wA).then(function(WA) {
        return n(WA);
      }).then(function(WA) {
        QA(WA, null), $({
          type: "closeDialog"
        });
      }).catch(function(WA) {
        Fpt(WA) ? (v(WA), $({
          type: "closeDialog"
        })) : Mpt(WA) ? (nA.current = !1, U.current ? (U.current.value = null, U.current.click()) : sA(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : sA(WA);
      });
      return;
    }
    U.current && ($({
      type: "openDialog"
    }), N(), U.current.value = null, U.current.click());
  }, [$, N, v, m, QA, sA, p, s]), RA = u.useCallback(function(wA) {
    !K.current || !K.current.isEqualNode(wA.target) || (wA.key === " " || wA.key === "Enter" || wA.keyCode === 32 || wA.keyCode === 13) && (wA.preventDefault(), EA());
  }, [K, EA]), xA = u.useCallback(function() {
    $({
      type: "focus"
    });
  }, []), HA = u.useCallback(function() {
    $({
      type: "blur"
    });
  }, []), ne = u.useCallback(function() {
    w || (Jpt() ? setTimeout(EA, 0) : EA());
  }, [w, EA]), VA = function(wA) {
    return i ? null : wA;
  }, le = function(wA) {
    return G ? null : VA(wA);
  }, we = function(wA) {
    return R ? null : VA(wA);
  }, De = function(wA) {
    F && wA.stopPropagation();
  }, Ke = u.useMemo(function() {
    return function() {
      var wA = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, WA = wA.refKey, Pe = WA === void 0 ? "ref" : WA, je = wA.role, it = wA.onKeyDown, Li = wA.onFocus, zA = wA.onBlur, Qe = wA.onClick, de = wA.onDragEnter, xe = wA.onDragOver, $e = wA.onDragLeave, Pn = wA.onDrop, Zt = tW(wA, vpt);
      return bn(bn(g6({
        onKeyDown: le(PC(it, RA)),
        onFocus: le(PC(Li, xA)),
        onBlur: le(PC(zA, HA)),
        onClick: VA(PC(Qe, ne)),
        onDragEnter: we(PC(de, lA)),
        onDragOver: we(PC(xe, cA)),
        onDragLeave: we(PC($e, aA)),
        onDrop: we(PC(Pn, hA)),
        role: typeof je == "string" && je !== "" ? je : "presentation"
      }, Pe, K), !i && !G ? {
        tabIndex: 0
      } : {}), Zt);
    };
  }, [K, RA, xA, HA, ne, lA, cA, aA, hA, G, R, i]), ee = u.useCallback(function(wA) {
    wA.stopPropagation();
  }, []), re = u.useMemo(function() {
    return function() {
      var wA = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, WA = wA.refKey, Pe = WA === void 0 ? "ref" : WA, je = wA.onChange, it = wA.onClick, Li = tW(wA, Hpt), zA = g6({
        accept: J,
        multiple: s,
        type: "file",
        style: {
          display: "none"
        },
        onChange: VA(PC(je, hA)),
        onClick: VA(PC(it, ee)),
        tabIndex: -1
      }, Pe, U);
      return bn(bn({}, zA), Li);
    };
  }, [U, t, s, hA, i]);
  return bn(bn({}, O), {}, {
    isFocused: _ && !i,
    getRootProps: Ke,
    getInputProps: re,
    rootRef: K,
    inputRef: U,
    open: VA(EA)
  });
}
function qpt(A, e) {
  switch (e.type) {
    case "focus":
      return bn(bn({}, A), {}, {
        isFocused: !0
      });
    case "blur":
      return bn(bn({}, A), {}, {
        isFocused: !1
      });
    case "openDialog":
      return bn(bn({}, s6), {}, {
        isFileDialogActive: !0
      });
    case "closeDialog":
      return bn(bn({}, A), {}, {
        isFileDialogActive: !1
      });
    case "setDraggedFiles":
      return bn(bn({}, A), {}, {
        isDragActive: e.isDragActive,
        isDragAccept: e.isDragAccept,
        isDragReject: e.isDragReject
      });
    case "setFiles":
      return bn(bn({}, A), {}, {
        acceptedFiles: e.acceptedFiles,
        fileRejections: e.fileRejections
      });
    case "reset":
      return bn({}, s6);
    default:
      return A;
  }
}
function IyA() {
}
function Opt(A) {
  const e = u.useMemo(() => A.data && A.type ? Ppt(A.data, A.type) : void 0, [A.data, A.type]), t = ZMA(e, A.url), [i, n] = u.useState(0);
  u.useEffect(() => n((g) => g + 1), [t]);
  const { t: o } = qe("translation", { keyPrefix: "main.tabpanel.settings" });
  return !e && !A.url ? null : t ? b.createElement(
    "div",
    { className: "w-full flex-1 relative" },
    b.createElement(jpt, { key: i, data: t })
  ) : b.createElement("div", { className: "w-full flex-1 flex items-center justify-center border-l" }, o("geography_settings.loading"));
}
function jpt(A) {
  return b.createElement(
    zAA,
    { preferCanvas: !0, attributionControl: !1, center: [0, 0], bounds: [
      [-180, -90],
      [180, 90]
    ], renderer: hC.canvas(), zoom: 1, style: { width: "100%", height: "100%", zIndex: 1 } },
    b.createElement(KY, { className: "map-tile", attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" }),
    b.createElement(XAA, { prefix: "Leaflet" }),
    A.data && b.createElement(xDe, { data: A.data })
  );
}
function Ppt(A, e) {
  try {
    const t = JSON.parse(A), i = e === "GeoJSON" ? t : r3(t, Object.keys(t.objects)[0]);
    if (!("features" in i)) {
      console.error("Invalid GeoJSON: GeoJSON must be a FeatureCollection, but got", i);
      return;
    }
    return i;
  } catch (t) {
    console.error(t);
  }
}
const $pt = [], A0t = ({ geoList: A = $pt }) => {
  const e = xt(), { layout: t, showGeoJSONConfigPanel: i } = e, { geoKey: n, geojson: o, geoUrl: g } = t, { t: s } = qe("translation"), { t: I } = qe("translation", { keyPrefix: "main.tabpanel.settings" }), [r, a] = u.useState((g == null ? void 0 : g.type) ?? "GeoJSON"), [C, B] = u.useState(""), [l, Q] = u.useState((g == null ? void 0 : g.url) ?? ""), [E, d] = u.useState(""), [m, y] = u.useState(""), [f, w] = u.useState(""), [G, R] = u.useState(g), [F, Z] = u.useState(!1), c = l || o, [J, p] = u.useState(() => {
    const q = A.findIndex((O) => O.url === (g == null ? void 0 : g.url) && O.type === (g == null ? void 0 : g.type));
    return q === -1 && c ? -2 : q;
  }), N = u.useMemo(() => [{ label: "Select a Geographic Data", value: "-1" }].concat(A.map((q, O) => ({
    label: q.name,
    value: `${O}`
  }))).concat({ label: "Manual Configuration", value: "-2" }), [A]), v = u.useMemo(() => (q) => p(parseInt(q)), []), K = (A ?? []).length === 0 || J === -2, U = u.useMemo(() => {
    try {
      const q = JSON.parse(m);
      return Object.keys(q.objects)[0] || "";
    } catch {
      return "";
    }
  }, [m]);
  u.useEffect(() => {
    B(n || "");
  }, [n]), u.useEffect(() => {
    d(o ? JSON.stringify(o, null, 2) : "");
  }, [o]);
  const j = () => {
    if (!K) {
      const q = A[J];
      q ? e.setVisualLayout("geoUrl", {
        type: q.type,
        url: q.url
      }) : e.clearGeographicData(), e.setShowGeoJSONConfigPanel(!1);
      return;
    }
    try {
      if (!(r === "GeoJSON" ? E : m) && G) {
        e.setShowGeoJSONConfigPanel(!1);
        return;
      }
      const q = JSON.parse(r === "GeoJSON" ? E : m);
      r === "TopoJSON" ? e.setGeographicData({
        type: "TopoJSON",
        data: q,
        objectKey: f || U
      }, C, (G == null ? void 0 : G.type) === "TopoJSON" ? G : void 0) : e.setGeographicData({
        type: "GeoJSON",
        data: q
      }, C, (G == null ? void 0 : G.type) === "GeoJSON" ? G : void 0), e.setShowGeoJSONConfigPanel(!1);
    } catch (q) {
      console.error(q);
    }
  };
  return b.createElement(
    ig,
    { open: i, onOpenChange: () => {
      e.setShowGeoJSONConfigPanel(!1);
    } },
    b.createElement(
      So,
      null,
      b.createElement("h2", { className: "text-lg mb-4" }, I("geography")),
      b.createElement(
        "div",
        null,
        b.createElement(
          "div",
          { className: "my-2" },
          b.createElement("label", { className: "block text-xs font-medium leading-6" }, I("geography_settings.geoKey")),
          b.createElement(
            "div",
            { className: "mt-1" },
            b.createElement(on, { type: "text", value: C, onChange: (q) => B(q.target.value) })
          )
        ),
        A.length > 0 && b.createElement(
          "div",
          { className: "my-2" },
          b.createElement("label", { className: "block text-xs font-medium leading-6" }, "GeoData"),
          b.createElement(G2, { options: N, selectedKey: `${J}`, onSelect: v })
        ),
        K && b.createElement(
          "div",
          { className: "my-2" },
          b.createElement("label", { className: "block text-xs font-medium leading-6" }, I(`geography_settings.${r.toLowerCase()}`)),
          b.createElement(
            "div",
            { className: "mt-1 flex flex-col space-y-2" },
            b.createElement(
              "div",
              { role: "radiogroup" },
              b.createElement(
                AX,
                { value: r, onValueChange: (q) => a(q), className: "flex items-center space-x-2" },
                b.createElement(D2, { value: "GeoJSON", id: "geojson" }),
                b.createElement("label", { htmlFor: "geojson", className: "text-xs whitespace-nowrap" }, I("geography_settings.geojson")),
                b.createElement(D2, { value: "TopoJSON", id: "topojson" }),
                b.createElement("label", { htmlFor: "topojson", className: "text-xs whitespace-nowrap" }, I("geography_settings.topojson"))
              )
            ),
            b.createElement(
              "div",
              { className: "flex items-center space-x-2" },
              b.createElement("label", { className: "text-xs whitespace-nowrap capitalize" }, I("geography_settings.href", { format: r.toLowerCase() })),
              b.createElement(on, { type: "text", value: l, placeholder: I("geography_settings.hrefPlaceholder", { format: r.toLowerCase() }), onChange: (q) => {
                Q(q.target.value);
              } }),
              b.createElement(
                Re,
                { className: "mr-2 flex-shrink-0", disabled: F, onClick: () => {
                  l && (Z(!0), fetch(l).then((q) => q.json()).then((q) => {
                    (r === "GeoJSON" ? d : y)(JSON.stringify(q, null, 2)), R({ type: r, url: l }), Z(!1);
                  }).catch(() => {
                    Z(!1);
                  }));
                } },
                F && b.createElement(KAA, null),
                I("geography_settings.load")
              )
            ),
            b.createElement(Tpt, { onDrop: (q) => {
              const O = q[0];
              if (O) {
                const $ = new FileReader();
                $.addEventListener("load", (_) => {
                  const tA = _.target.result;
                  R(void 0), (r === "GeoJSON" ? d : y)(tA);
                }), $.readAsText(O);
              }
            }, noClick: !0 }, ({ getRootProps: q, getInputProps: O, isDragActive: $, open: _ }) => b.createElement(
              "div",
              { className: "relative justify-center flex w-full h-80 rounded border shadow-sm", ...q() },
              $ && b.createElement("div", { className: "absolute items-center justify-center left-0 right-0 top-0 bottom-0 z-20 bg-accent opacity-80" }),
              b.createElement("input", { ...O() }),
              b.createElement("div", { onClick: _, className: "flex h-full items-center justify-center w-48" }, I("geography_settings.jsonInputPlaceholder", { format: r.toLowerCase() })),
              b.createElement(Opt, { data: r === "GeoJSON" ? E : m, type: r, url: G })
            )),
            r === "TopoJSON" && b.createElement(
              "div",
              { className: "flex items-center space-x-2" },
              b.createElement("label", { className: "text-xs whitespace-nowrap capitalize" }, I("geography_settings.objectKey")),
              b.createElement(on, { type: "text", value: f, placeholder: U, onChange: (q) => {
                w(q.target.value);
              } })
            )
          )
        )
      ),
      b.createElement(
        vl,
        null,
        b.createElement(Re, { children: s("actions.confirm"), onClick: j }),
        b.createElement(Re, { children: s("actions.cancel"), variant: "outline", onClick: () => {
          e.setShowGeoJSONConfigPanel(!1);
        } })
      )
    )
  );
}, e0t = gt(A0t), t0t = "https://api.kanaries.net/vis/text2gw";
async function i0t(A, e, t, i) {
  const n = await (await fetch(A, {
    headers: {
      "Content-Type": "application/json",
      ...i
    },
    credentials: "include",
    method: "POST",
    body: JSON.stringify({
      metas: e,
      messages: [
        {
          role: "user",
          content: t
        }
      ]
    })
  })).json();
  if (n.success)
    return n.data;
  throw new Error(n.message);
}
async function $T(A, e, t) {
  if (typeof A == "function")
    return A(e);
  const i = await (await fetch(A, {
    headers: {
      "Content-Type": "application/json",
      ...t
    },
    credentials: "include",
    method: "POST",
    body: JSON.stringify(e)
  })).json();
  if (!i.success)
    throw new Error(i.message);
}
const n0t = (A) => {
  const { feedbackApi: e } = A, [t, i] = u.useState(""), [n, o] = u.useState(!1), g = xt(), { t: s } = qe(), [I, r] = u.useState("none"), a = g.allFields, { reportError: C } = pgA(), [B, l] = u.useState(null), Q = u.useCallback(() => {
    o(!0), (typeof A.api == "function" ? Promise.resolve(A.api(a, t)) : i0t(A.api || t0t, a, t, A.headers ?? {})).then((d) => {
      g.appendFromCode(d), g.setAskvizFeedback(!0), l({ question: t, data: JSON.stringify(d) }), r("vote");
    }).catch((d) => {
      C(GD(d), 502);
    }).finally(() => {
      o(!1);
    });
  }, [A.api, A.headers, a, t, g]), E = e && B && g.showAskvizFeedbackIndex === g.visIndex;
  return b.createElement(
    "div",
    { className: "right-0 flex relative" },
    b.createElement(on, { type: "text", className: "pr-24", placeholder: s("main.tabpanel.askviz.placeholder"), value: t, onChange: (d) => i(d.target.value), onKeyDown: (d) => {
      d.key === "Enter" && n === !1 && t.length > 0 && Q();
    }, disabled: n || a.length === 0 }),
    b.createElement(
      Re,
      { className: "rounded-l-none w-20 absolute inset-y-0 right-0", disabled: n || t.length === 0 || a.length === 0, onClick: Q, id: "askviz_ask" },
      "Ask",
      !n && b.createElement(fae, { className: "w-4 ml-1" }),
      n && b.createElement(KAA, { className: "w-4 h-4 ml-1" })
    ),
    E && I === "vote" && b.createElement(
      "div",
      { className: "absolute z-10 top-full right-0 flex-col space-y-2 w-56 mt-1 p-4 border rounded bg-popover text-popover-foreground" },
      b.createElement("div", null, s("App.feedback.vote")),
      b.createElement(
        "div",
        { className: "flex space-x-2" },
        b.createElement(
          Re,
          { type: "button", onClick: () => {
            $T(e, { action: "voteup", question: B.question, spec: B.data }, A.headers ?? {}), r("none");
          } },
          b.createElement(gae, { className: "w-4 h-4" }),
          s("App.feedback.voteup")
        ),
        b.createElement(
          Re,
          { type: "button", variant: "outline", onClick: () => {
            $T(e, { action: "votedown", question: B.question, spec: B.data }, A.headers ?? {}), r("report");
          } },
          b.createElement(iae, { className: "w-4 h-4" }),
          s("App.feedback.votedown")
        )
      )
    ),
    E && I === "report" && b.createElement(
      "div",
      { className: "absolute z-10 top-full right-0 flex-col space-y-2 w-56 mt-1 p-4 border rounded bg-popover text-popover-foreground" },
      b.createElement("div", null, s("App.feedback.report")),
      b.createElement(
        "div",
        null,
        b.createElement(Re, { type: "button", variant: "outline", disabled: !g.canUndo, onClick: () => {
          $T(e, { action: "report", question: B.question, spec: JSON.stringify(g.exportCode()[g.visIndex]) }, A.headers ?? {}), r("none");
        } }, s("App.feedback.report_button"))
      )
    )
  );
}, o0t = gt(n0t), g0t = async (A, e, t, i) => {
  let n = A;
  for await (const o of e)
    switch (o.type) {
      case "filter": {
        n = await ADe(n, o.filters.map((g) => ({
          fid: g.fid,
          rule: g.rule
        })).filter(Boolean));
        break;
      }
      case "transform": {
        n = await eDe(n, o.transform);
        break;
      }
      case "view": {
        for await (const g of o.query)
          n = await tDe(n, g);
        break;
      }
      case "sort": {
        n = await nDe(n, o.by, o.sort);
        break;
      }
      default: {
        console.warn(new Error(`Unknown step type: ${o.type}`));
        break;
      }
    }
  return n.slice(t ?? 0, i ? (t ?? 0) + i : void 0);
}, Cd = (A) => (e) => g0t(A, e.workflow, e.offset, e.limit), s0t = (A) => {
  const e = xt(), { showLogSettingPanel: t } = e, [i, n] = u.useState(""), { t: o } = qe();
  return u.useEffect(() => {
    n("");
  }, [t]), b.createElement(
    ig,
    { open: t, onOpenChange: () => {
      e.setShowLogSettingPanel(!1);
    } },
    b.createElement(
      So,
      { className: "!w-fit" },
      b.createElement(
        "div",
        { className: "flex flex-col justify-center items-start text-xs " },
        b.createElement("h2", { className: "text-lg font-medium mb-2" }, o("calc.log_panel_title")),
        b.createElement("p", { className: "font-normal text-muted-foreground" }, o("calc.log_panel_desc")),
        b.createElement(
          "fieldset",
          { className: "mt-2 gap-1 flex flex-col justify-center items-start" },
          b.createElement(
            "div",
            { className: "flex items-center space-x-2" },
            b.createElement("label", { className: "text-ml whitespace-nowrap" }, o("calc.log_panel_number")),
            b.createElement(on, { type: "text", value: i, onChange: (g) => {
              n(g.target.value);
            } })
          )
        )
      ),
      b.createElement(
        vl,
        { className: "mt-2" },
        b.createElement(Re, { children: o("actions.confirm"), onClick: () => {
          const g = e.createField;
          e.createLogField(g.channel, g.index, "log", Number(i)), e.setShowLogSettingPanel(!1);
        } }),
        b.createElement(Re, { variant: "outline", children: o("actions.cancel"), onClick: () => {
          e.setShowLogSettingPanel(!1);
        } })
      )
    )
  );
}, I0t = gt(s0t), a0t = (A) => {
  const e = xt(), { showBinSettingPanel: t, setShowBinSettingPanel: i } = e, { t: n } = qe(), [o, g] = u.useState("widths"), [s, I] = u.useState(""), r = ["widths", "counts"];
  return u.useEffect(() => {
    g("widths"), I("");
  }, [t]), b.createElement(
    ig,
    { open: t, onOpenChange: () => {
      i(!1);
    } },
    b.createElement(
      So,
      { className: "!w-fit" },
      b.createElement(
        "div",
        { className: "flex flex-col justify-center items-start text-xs" },
        b.createElement("h2", { className: "text-lg font-medium mb-2" }, n("calc.bin_panel_title")),
        b.createElement("p", { className: "font-normal text-muted-foreground" }, n("calc.bin_panel_desc")),
        b.createElement(AX, { value: o, onValueChange: (a) => g(a), className: "mt-2 gap-1 flex flex-col justify-center items-start" }, r.map((a, C) => b.createElement(
          "div",
          { key: C },
          b.createElement(
            "div",
            { className: "flex my-1", key: a },
            b.createElement(
              "div",
              { className: "align-top" },
              b.createElement(D2, { id: a, value: a })
            ),
            b.createElement(
              "div",
              { className: "ml-3" },
              b.createElement("label", { htmlFor: a }, n(`calc.bin_panel_option_${a}`))
            )
          ),
          o === a && b.createElement(
            "div",
            { className: "flex items-center space-x-2" },
            b.createElement("label", { className: "text-ml whitespace-nowrap" }, n("calc.bin_panel_number")),
            b.createElement(on, { type: "text", value: s, onChange: (B) => {
              I(B.target.value);
            } })
          )
        )))
      ),
      b.createElement(
        vl,
        { className: "mt-2" },
        b.createElement(Re, { children: n("actions.confirm"), onClick: () => {
          const a = e.createField;
          e.createBinField(a.channel, a.index, o === "widths" ? "bin" : "binCount", Number(s)), e.setShowBinSettingPanel(!1);
        } }),
        b.createElement(Re, { variant: "outline", children: n("actions.cancel"), onClick: () => {
          e.setShowBinSettingPanel(!1);
        } })
      )
    )
  );
}, r0t = gt(a0t), C0t = (A) => {
  const e = xt(), { showRenamePanel: t, createField: i, currentEncodings: n } = e, { t: o } = qe(), [g, s] = u.useState("");
  return u.useEffect(() => {
    var I, r;
    i && s(((r = (I = n[i.channel]) == null ? void 0 : I[i.index]) == null ? void 0 : r.name) ?? "");
  }, [t]), b.createElement(
    ig,
    { open: t, onOpenChange: () => e.setShowRenamePanel(!1) },
    b.createElement(
      So,
      { className: "!w-fit" },
      b.createElement(
        "div",
        { className: "flex flex-col justify-center items-start text-xs" },
        b.createElement("h2", { className: "text-lg font-medium mb-2" }, "Rename Field"),
        b.createElement("p", { className: "font-normal text-muted-foreground" }, "This action will rename this field's name in the chart."),
        b.createElement(
          "div",
          { className: "flex items-center space-x-2 mt-2" },
          b.createElement("label", { className: "text-ml whitespace-nowrap" }, "New Name"),
          b.createElement(on, { type: "text", value: g, onChange: (I) => {
            s(I.target.value);
          } })
        )
      ),
      b.createElement(
        vl,
        { className: "mt-2" },
        b.createElement(Re, { children: o("actions.confirm"), onClick: () => {
          const I = e.createField;
          e.renameFieldInChart(I.channel, I.index, g), e.setShowRenamePanel(!1);
        } }),
        b.createElement(Re, { variant: "outline", children: o("actions.cancel"), onClick: () => {
          e.setShowRenamePanel(!1);
        } })
      )
    )
  );
}, B0t = gt(C0t), QsA = gt(function() {
  const A = xt();
  qe();
  const e = () => {
    A.updateShowErrorResolutionPanel(0);
  };
  switch (A.showErrorResolutionPanel) {
    case 0:
      return null;
    case 500:
      return b.createElement(
        ig,
        { open: !0, onOpenChange: e },
        b.createElement(
          So,
          { className: "!w-fit" },
          b.createElement(
            "div",
            { className: "flex flex-col justify-center items-start" },
            b.createElement("h2", { className: "font-medium text-xl my-2" }, "Oops!"),
            b.createElement("p", { className: "font-normal my-2" }, "The chart is too large to render. You can try options above:"),
            b.createElement(
              "p",
              { className: "font-normal my-2" },
              "1. Set the chart to a fixed size.",
              b.createElement("a", { className: "mx-2 cursor-pointer font-semibold text-primary", onClick: () => {
                A.setVisualLayout("size", { mode: "fixed", width: 800, height: 600 }), e();
              } }, "Set Now")
            ),
            b.createElement(
              "p",
              { className: "font-normal my-2" },
              "2. Change to SVG renderer.",
              b.createElement("a", { className: "mx-2 cursor-pointer font-semibold text-primary", onClick: () => {
                A.setVisualLayout("useSvg", !0), e();
              } }, "Set Now")
            ),
            b.createElement("p", { className: "font-normal my-2" }, "3. Close this modal and edit the chart to reduce chart size."),
            b.createElement(
              "fieldset",
              { className: "mt-2 gap-1 flex flex-col justify-center items-end w-full" },
              b.createElement(
                "div",
                { className: "mt-2" },
                b.createElement(Re, { variant: "outline", children: "Close", className: "mr-2", onClick: e })
              )
            )
          )
        )
      );
    case 501:
      return b.createElement(
        ig,
        { open: !0, onOpenChange: e },
        b.createElement(
          So,
          null,
          b.createElement(
            "div",
            { className: "flex flex-col justify-center items-start" },
            b.createElement("h2", { className: "font-medium text-xl my-2" }, "Oops!"),
            b.createElement("p", { className: "font-normal my-2" }, "There is some error with Computation service. Here is the Error message:"),
            b.createElement("p", { className: "font-normal my-2" }, A.lastErrorMessage),
            b.createElement(
              "fieldset",
              { className: "mt-2 gap-1 flex flex-col justify-center items-end w-full" },
              b.createElement(
                "div",
                { className: "mt-2" },
                b.createElement(Re, { variant: "outline", children: "Close", className: "mr-2", onClick: e })
              )
            )
          )
        )
      );
    case 502:
      return b.createElement(
        ig,
        { open: !0, onOpenChange: e },
        b.createElement(
          So,
          null,
          b.createElement(
            "div",
            { className: "flex flex-col justify-center items-start" },
            b.createElement("h2", { className: "font-medium text-xl my-2" }, "Oops!"),
            b.createElement("p", { className: "font-normal my-2" }, "There is some error with Askviz service. Here is the Error message:"),
            b.createElement("p", { className: "font-normal my-2" }, A.lastErrorMessage),
            b.createElement(
              "fieldset",
              { className: "mt-2 gap-1 flex flex-col justify-center items-end w-full" },
              b.createElement(
                "div",
                { className: "mt-2" },
                b.createElement(Re, { variant: "outline", children: "Close", className: "mr-2", onClick: e })
              )
            )
          )
        )
      );
  }
  return null;
});
function l0t() {
  return window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
}
function bX(A = "media") {
  const [e, t] = u.useState(A === "media" ? l0t() : A);
  return u.useEffect(() => {
    var i;
    if (A === "media") {
      const n = (i = window.matchMedia) == null ? void 0 : i.call(window, "(prefers-color-scheme: dark)"), o = (g) => {
        t(g.matches ? "dark" : "light");
      };
      return n == null || n.addEventListener("change", o), () => {
        n == null || n.removeEventListener("change", o);
      };
    } else
      t(A);
  }, [A]), e;
}
var Lh = {};
/**
 * @license React
 * react-dom-server-legacy.browser.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 ayA;
function c0t() {
  if (ayA)
    return Lh;
  ayA = 1;
  var A = b;
  function e(X) {
    for (var oA = "https://reactjs.org/docs/error-decoder.html?invariant=" + X, BA = 1; BA < arguments.length; BA++)
      oA += "&args[]=" + encodeURIComponent(arguments[BA]);
    return "Minified React error #" + X + "; visit " + oA + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  var t = Object.prototype.hasOwnProperty, i = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, n = {}, o = {};
  function g(X) {
    return t.call(o, X) ? !0 : t.call(n, X) ? !1 : i.test(X) ? o[X] = !0 : (n[X] = !0, !1);
  }
  function s(X, oA, BA, dA, GA, yA, YA) {
    this.acceptsBooleans = oA === 2 || oA === 3 || oA === 4, this.attributeName = dA, this.attributeNamespace = GA, this.mustUseProperty = BA, this.propertyName = X, this.type = oA, this.sanitizeURL = yA, this.removeEmptyString = YA;
  }
  var I = {};
  "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(X) {
    I[X] = new s(X, 0, !1, X, null, !1, !1);
  }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(X) {
    var oA = X[0];
    I[oA] = new s(oA, 1, !1, X[1], null, !1, !1);
  }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(X) {
    I[X] = new s(X, 2, !1, X.toLowerCase(), null, !1, !1);
  }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(X) {
    I[X] = new s(X, 2, !1, X, null, !1, !1);
  }), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(X) {
    I[X] = new s(X, 3, !1, X.toLowerCase(), null, !1, !1);
  }), ["checked", "multiple", "muted", "selected"].forEach(function(X) {
    I[X] = new s(X, 3, !0, X, null, !1, !1);
  }), ["capture", "download"].forEach(function(X) {
    I[X] = new s(X, 4, !1, X, null, !1, !1);
  }), ["cols", "rows", "size", "span"].forEach(function(X) {
    I[X] = new s(X, 6, !1, X, null, !1, !1);
  }), ["rowSpan", "start"].forEach(function(X) {
    I[X] = new s(X, 5, !1, X.toLowerCase(), null, !1, !1);
  });
  var r = /[\-:]([a-z])/g;
  function a(X) {
    return X[1].toUpperCase();
  }
  "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(X) {
    var oA = X.replace(
      r,
      a
    );
    I[oA] = new s(oA, 1, !1, X, null, !1, !1);
  }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(X) {
    var oA = X.replace(r, a);
    I[oA] = new s(oA, 1, !1, X, "http://www.w3.org/1999/xlink", !1, !1);
  }), ["xml:base", "xml:lang", "xml:space"].forEach(function(X) {
    var oA = X.replace(r, a);
    I[oA] = new s(oA, 1, !1, X, "http://www.w3.org/XML/1998/namespace", !1, !1);
  }), ["tabIndex", "crossOrigin"].forEach(function(X) {
    I[X] = new s(X, 1, !1, X.toLowerCase(), null, !1, !1);
  }), I.xlinkHref = new s("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function(X) {
    I[X] = new s(X, 1, !1, X.toLowerCase(), null, !0, !0);
  });
  var C = {
    animationIterationCount: !0,
    aspectRatio: !0,
    borderImageOutset: !0,
    borderImageSlice: !0,
    borderImageWidth: !0,
    boxFlex: !0,
    boxFlexGroup: !0,
    boxOrdinalGroup: !0,
    columnCount: !0,
    columns: !0,
    flex: !0,
    flexGrow: !0,
    flexPositive: !0,
    flexShrink: !0,
    flexNegative: !0,
    flexOrder: !0,
    gridArea: !0,
    gridRow: !0,
    gridRowEnd: !0,
    gridRowSpan: !0,
    gridRowStart: !0,
    gridColumn: !0,
    gridColumnEnd: !0,
    gridColumnSpan: !0,
    gridColumnStart: !0,
    fontWeight: !0,
    lineClamp: !0,
    lineHeight: !0,
    opacity: !0,
    order: !0,
    orphans: !0,
    tabSize: !0,
    widows: !0,
    zIndex: !0,
    zoom: !0,
    fillOpacity: !0,
    floodOpacity: !0,
    stopOpacity: !0,
    strokeDasharray: !0,
    strokeDashoffset: !0,
    strokeMiterlimit: !0,
    strokeOpacity: !0,
    strokeWidth: !0
  }, B = ["Webkit", "ms", "Moz", "O"];
  Object.keys(C).forEach(function(X) {
    B.forEach(function(oA) {
      oA = oA + X.charAt(0).toUpperCase() + X.substring(1), C[oA] = C[X];
    });
  });
  var l = /["'&<>]/;
  function Q(X) {
    if (typeof X == "boolean" || typeof X == "number")
      return "" + X;
    X = "" + X;
    var oA = l.exec(X);
    if (oA) {
      var BA = "", dA, GA = 0;
      for (dA = oA.index; dA < X.length; dA++) {
        switch (X.charCodeAt(dA)) {
          case 34:
            oA = "&quot;";
            break;
          case 38:
            oA = "&amp;";
            break;
          case 39:
            oA = "&#x27;";
            break;
          case 60:
            oA = "&lt;";
            break;
          case 62:
            oA = "&gt;";
            break;
          default:
            continue;
        }
        GA !== dA && (BA += X.substring(GA, dA)), GA = dA + 1, BA += oA;
      }
      X = GA !== dA ? BA + X.substring(GA, dA) : BA;
    }
    return X;
  }
  var E = /([A-Z])/g, d = /^ms-/, m = Array.isArray;
  function y(X, oA) {
    return { insertionMode: X, selectedValue: oA };
  }
  function f(X, oA, BA) {
    switch (oA) {
      case "select":
        return y(1, BA.value != null ? BA.value : BA.defaultValue);
      case "svg":
        return y(2, null);
      case "math":
        return y(3, null);
      case "foreignObject":
        return y(1, null);
      case "table":
        return y(4, null);
      case "thead":
      case "tbody":
      case "tfoot":
        return y(5, null);
      case "colgroup":
        return y(7, null);
      case "tr":
        return y(6, null);
    }
    return 4 <= X.insertionMode || X.insertionMode === 0 ? y(1, null) : X;
  }
  var w = /* @__PURE__ */ new Map();
  function G(X, oA, BA) {
    if (typeof BA != "object")
      throw Error(e(62));
    oA = !0;
    for (var dA in BA)
      if (t.call(BA, dA)) {
        var GA = BA[dA];
        if (GA != null && typeof GA != "boolean" && GA !== "") {
          if (dA.indexOf("--") === 0) {
            var yA = Q(dA);
            GA = Q(("" + GA).trim());
          } else {
            yA = dA;
            var YA = w.get(yA);
            YA !== void 0 || (YA = Q(yA.replace(E, "-$1").toLowerCase().replace(d, "-ms-")), w.set(yA, YA)), yA = YA, GA = typeof GA == "number" ? GA === 0 || t.call(C, dA) ? "" + GA : GA + "px" : Q(("" + GA).trim());
          }
          oA ? (oA = !1, X.push(' style="', yA, ":", GA)) : X.push(";", yA, ":", GA);
        }
      }
    oA || X.push('"');
  }
  function R(X, oA, BA, dA) {
    switch (BA) {
      case "style":
        G(X, oA, dA);
        return;
      case "defaultValue":
      case "defaultChecked":
      case "innerHTML":
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
        return;
    }
    if (!(2 < BA.length) || BA[0] !== "o" && BA[0] !== "O" || BA[1] !== "n" && BA[1] !== "N") {
      if (oA = I.hasOwnProperty(BA) ? I[BA] : null, oA !== null) {
        switch (typeof dA) {
          case "function":
          case "symbol":
            return;
          case "boolean":
            if (!oA.acceptsBooleans)
              return;
        }
        switch (BA = oA.attributeName, oA.type) {
          case 3:
            dA && X.push(" ", BA, '=""');
            break;
          case 4:
            dA === !0 ? X.push(" ", BA, '=""') : dA !== !1 && X.push(" ", BA, '="', Q(dA), '"');
            break;
          case 5:
            isNaN(dA) || X.push(" ", BA, '="', Q(dA), '"');
            break;
          case 6:
            !isNaN(dA) && 1 <= dA && X.push(" ", BA, '="', Q(dA), '"');
            break;
          default:
            oA.sanitizeURL && (dA = "" + dA), X.push(" ", BA, '="', Q(dA), '"');
        }
      } else if (g(BA)) {
        switch (typeof dA) {
          case "function":
          case "symbol":
            return;
          case "boolean":
            if (oA = BA.toLowerCase().slice(0, 5), oA !== "data-" && oA !== "aria-")
              return;
        }
        X.push(" ", BA, '="', Q(dA), '"');
      }
    }
  }
  function F(X, oA, BA) {
    if (oA != null) {
      if (BA != null)
        throw Error(e(60));
      if (typeof oA != "object" || !("__html" in oA))
        throw Error(e(61));
      oA = oA.__html, oA != null && X.push("" + oA);
    }
  }
  function Z(X) {
    var oA = "";
    return A.Children.forEach(X, function(BA) {
      BA != null && (oA += BA);
    }), oA;
  }
  function c(X, oA, BA, dA) {
    X.push(N(BA));
    var GA = BA = null, yA;
    for (yA in oA)
      if (t.call(oA, yA)) {
        var YA = oA[yA];
        if (YA != null)
          switch (yA) {
            case "children":
              BA = YA;
              break;
            case "dangerouslySetInnerHTML":
              GA = YA;
              break;
            default:
              R(X, dA, yA, YA);
          }
      }
    return X.push(">"), F(X, GA, BA), typeof BA == "string" ? (X.push(Q(BA)), null) : BA;
  }
  var J = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/, p = /* @__PURE__ */ new Map();
  function N(X) {
    var oA = p.get(X);
    if (oA === void 0) {
      if (!J.test(X))
        throw Error(e(65, X));
      oA = "<" + X, p.set(X, oA);
    }
    return oA;
  }
  function v(X, oA, BA, dA, GA) {
    switch (oA) {
      case "select":
        X.push(N("select"));
        var yA = null, YA = null;
        for (nt in BA)
          if (t.call(BA, nt)) {
            var OA = BA[nt];
            if (OA != null)
              switch (nt) {
                case "children":
                  yA = OA;
                  break;
                case "dangerouslySetInnerHTML":
                  YA = OA;
                  break;
                case "defaultValue":
                case "value":
                  break;
                default:
                  R(X, dA, nt, OA);
              }
          }
        return X.push(">"), F(X, YA, yA), yA;
      case "option":
        YA = GA.selectedValue, X.push(N("option"));
        var Fe = OA = null, Ve = null, nt = null;
        for (yA in BA)
          if (t.call(BA, yA)) {
            var Ei = BA[yA];
            if (Ei != null)
              switch (yA) {
                case "children":
                  OA = Ei;
                  break;
                case "selected":
                  Ve = Ei;
                  break;
                case "dangerouslySetInnerHTML":
                  nt = Ei;
                  break;
                case "value":
                  Fe = Ei;
                default:
                  R(X, dA, yA, Ei);
              }
          }
        if (YA != null)
          if (BA = Fe !== null ? "" + Fe : Z(OA), m(YA)) {
            for (dA = 0; dA < YA.length; dA++)
              if ("" + YA[dA] === BA) {
                X.push(' selected=""');
                break;
              }
          } else
            "" + YA === BA && X.push(' selected=""');
        else
          Ve && X.push(' selected=""');
        return X.push(">"), F(X, nt, OA), OA;
      case "textarea":
        X.push(N("textarea")), nt = YA = yA = null;
        for (OA in BA)
          if (t.call(BA, OA) && (Fe = BA[OA], Fe != null))
            switch (OA) {
              case "children":
                nt = Fe;
                break;
              case "value":
                yA = Fe;
                break;
              case "defaultValue":
                YA = Fe;
                break;
              case "dangerouslySetInnerHTML":
                throw Error(e(91));
              default:
                R(
                  X,
                  dA,
                  OA,
                  Fe
                );
            }
        if (yA === null && YA !== null && (yA = YA), X.push(">"), nt != null) {
          if (yA != null)
            throw Error(e(92));
          if (m(nt) && 1 < nt.length)
            throw Error(e(93));
          yA = "" + nt;
        }
        return typeof yA == "string" && yA[0] === `
` && X.push(`
`), yA !== null && X.push(Q("" + yA)), null;
      case "input":
        X.push(N("input")), Fe = nt = OA = yA = null;
        for (YA in BA)
          if (t.call(BA, YA) && (Ve = BA[YA], Ve != null))
            switch (YA) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(e(399, "input"));
              case "defaultChecked":
                Fe = Ve;
                break;
              case "defaultValue":
                OA = Ve;
                break;
              case "checked":
                nt = Ve;
                break;
              case "value":
                yA = Ve;
                break;
              default:
                R(X, dA, YA, Ve);
            }
        return nt !== null ? R(X, dA, "checked", nt) : Fe !== null && R(X, dA, "checked", Fe), yA !== null ? R(X, dA, "value", yA) : OA !== null && R(X, dA, "value", OA), X.push("/>"), null;
      case "menuitem":
        X.push(N("menuitem"));
        for (var xg in BA)
          if (t.call(BA, xg) && (yA = BA[xg], yA != null))
            switch (xg) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(e(400));
              default:
                R(X, dA, xg, yA);
            }
        return X.push(">"), null;
      case "title":
        X.push(N("title")), yA = null;
        for (Ei in BA)
          if (t.call(BA, Ei) && (YA = BA[Ei], YA != null))
            switch (Ei) {
              case "children":
                yA = YA;
                break;
              case "dangerouslySetInnerHTML":
                throw Error(e(434));
              default:
                R(X, dA, Ei, YA);
            }
        return X.push(">"), yA;
      case "listing":
      case "pre":
        X.push(N(oA)), YA = yA = null;
        for (Fe in BA)
          if (t.call(BA, Fe) && (OA = BA[Fe], OA != null))
            switch (Fe) {
              case "children":
                yA = OA;
                break;
              case "dangerouslySetInnerHTML":
                YA = OA;
                break;
              default:
                R(X, dA, Fe, OA);
            }
        if (X.push(">"), YA != null) {
          if (yA != null)
            throw Error(e(60));
          if (typeof YA != "object" || !("__html" in YA))
            throw Error(e(61));
          BA = YA.__html, BA != null && (typeof BA == "string" && 0 < BA.length && BA[0] === `
` ? X.push(`
`, BA) : X.push("" + BA));
        }
        return typeof yA == "string" && yA[0] === `
` && X.push(`
`), yA;
      case "area":
      case "base":
      case "br":
      case "col":
      case "embed":
      case "hr":
      case "img":
      case "keygen":
      case "link":
      case "meta":
      case "param":
      case "source":
      case "track":
      case "wbr":
        X.push(N(oA));
        for (var Lg in BA)
          if (t.call(BA, Lg) && (yA = BA[Lg], yA != null))
            switch (Lg) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(e(399, oA));
              default:
                R(X, dA, Lg, yA);
            }
        return X.push("/>"), null;
      case "annotation-xml":
      case "color-profile":
      case "font-face":
      case "font-face-src":
      case "font-face-uri":
      case "font-face-format":
      case "font-face-name":
      case "missing-glyph":
        return c(
          X,
          BA,
          oA,
          dA
        );
      case "html":
        return GA.insertionMode === 0 && X.push("<!DOCTYPE html>"), c(X, BA, oA, dA);
      default:
        if (oA.indexOf("-") === -1 && typeof BA.is != "string")
          return c(X, BA, oA, dA);
        X.push(N(oA)), YA = yA = null;
        for (Ve in BA)
          if (t.call(BA, Ve) && (OA = BA[Ve], OA != null))
            switch (Ve) {
              case "children":
                yA = OA;
                break;
              case "dangerouslySetInnerHTML":
                YA = OA;
                break;
              case "style":
                G(X, dA, OA);
                break;
              case "suppressContentEditableWarning":
              case "suppressHydrationWarning":
                break;
              default:
                g(Ve) && typeof OA != "function" && typeof OA != "symbol" && X.push(" ", Ve, '="', Q(OA), '"');
            }
        return X.push(">"), F(X, YA, yA), yA;
    }
  }
  function K(X, oA, BA) {
    if (X.push('<!--$?--><template id="'), BA === null)
      throw Error(e(395));
    return X.push(BA), X.push('"></template>');
  }
  function U(X, oA, BA, dA) {
    switch (BA.insertionMode) {
      case 0:
      case 1:
        return X.push('<div hidden id="'), X.push(oA.segmentPrefix), oA = dA.toString(16), X.push(oA), X.push('">');
      case 2:
        return X.push('<svg aria-hidden="true" style="display:none" id="'), X.push(oA.segmentPrefix), oA = dA.toString(16), X.push(oA), X.push('">');
      case 3:
        return X.push('<math aria-hidden="true" style="display:none" id="'), X.push(oA.segmentPrefix), oA = dA.toString(16), X.push(oA), X.push('">');
      case 4:
        return X.push('<table hidden id="'), X.push(oA.segmentPrefix), oA = dA.toString(16), X.push(oA), X.push('">');
      case 5:
        return X.push('<table hidden><tbody id="'), X.push(oA.segmentPrefix), oA = dA.toString(16), X.push(oA), X.push('">');
      case 6:
        return X.push('<table hidden><tr id="'), X.push(oA.segmentPrefix), oA = dA.toString(16), X.push(oA), X.push('">');
      case 7:
        return X.push('<table hidden><colgroup id="'), X.push(oA.segmentPrefix), oA = dA.toString(16), X.push(oA), X.push('">');
      default:
        throw Error(e(397));
    }
  }
  function j(X, oA) {
    switch (oA.insertionMode) {
      case 0:
      case 1:
        return X.push("</div>");
      case 2:
        return X.push("</svg>");
      case 3:
        return X.push("</math>");
      case 4:
        return X.push("</table>");
      case 5:
        return X.push("</tbody></table>");
      case 6:
        return X.push("</tr></table>");
      case 7:
        return X.push("</colgroup></table>");
      default:
        throw Error(e(397));
    }
  }
  var q = /[<\u2028\u2029]/g;
  function O(X) {
    return JSON.stringify(X).replace(q, function(oA) {
      switch (oA) {
        case "<":
          return "\\u003c";
        case "\u2028":
          return "\\u2028";
        case "\u2029":
          return "\\u2029";
        default:
          throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React");
      }
    });
  }
  function $(X, oA) {
    return oA = oA === void 0 ? "" : oA, { bootstrapChunks: [], startInlineScript: "<script>", placeholderPrefix: oA + "P:", segmentPrefix: oA + "S:", boundaryPrefix: oA + "B:", idPrefix: oA, nextSuspenseID: 0, sentCompleteSegmentFunction: !1, sentCompleteBoundaryFunction: !1, sentClientRenderFunction: !1, generateStaticMarkup: X };
  }
  function _(X, oA, BA, dA) {
    return BA.generateStaticMarkup ? (X.push(Q(oA)), !1) : (oA === "" ? X = dA : (dA && X.push("<!-- -->"), X.push(Q(oA)), X = !0), X);
  }
  var tA = Object.assign, nA = Symbol.for("react.element"), AA = Symbol.for("react.portal"), gA = Symbol.for("react.fragment"), rA = Symbol.for("react.strict_mode"), sA = Symbol.for("react.profiler"), lA = Symbol.for("react.provider"), cA = Symbol.for("react.context"), aA = Symbol.for("react.forward_ref"), QA = Symbol.for("react.suspense"), hA = Symbol.for("react.suspense_list"), EA = Symbol.for("react.memo"), RA = Symbol.for("react.lazy"), xA = Symbol.for("react.scope"), HA = Symbol.for("react.debug_trace_mode"), ne = Symbol.for("react.legacy_hidden"), VA = Symbol.for("react.default_value"), le = Symbol.iterator;
  function we(X) {
    if (X == null)
      return null;
    if (typeof X == "function")
      return X.displayName || X.name || null;
    if (typeof X == "string")
      return X;
    switch (X) {
      case gA:
        return "Fragment";
      case AA:
        return "Portal";
      case sA:
        return "Profiler";
      case rA:
        return "StrictMode";
      case QA:
        return "Suspense";
      case hA:
        return "SuspenseList";
    }
    if (typeof X == "object")
      switch (X.$$typeof) {
        case cA:
          return (X.displayName || "Context") + ".Consumer";
        case lA:
          return (X._context.displayName || "Context") + ".Provider";
        case aA:
          var oA = X.render;
          return X = X.displayName, X || (X = oA.displayName || oA.name || "", X = X !== "" ? "ForwardRef(" + X + ")" : "ForwardRef"), X;
        case EA:
          return oA = X.displayName || null, oA !== null ? oA : we(X.type) || "Memo";
        case RA:
          oA = X._payload, X = X._init;
          try {
            return we(X(oA));
          } catch {
          }
      }
    return null;
  }
  var De = {};
  function Ke(X, oA) {
    if (X = X.contextTypes, !X)
      return De;
    var BA = {}, dA;
    for (dA in X)
      BA[dA] = oA[dA];
    return BA;
  }
  var ee = null;
  function re(X, oA) {
    if (X !== oA) {
      X.context._currentValue2 = X.parentValue, X = X.parent;
      var BA = oA.parent;
      if (X === null) {
        if (BA !== null)
          throw Error(e(401));
      } else {
        if (BA === null)
          throw Error(e(401));
        re(X, BA);
      }
      oA.context._currentValue2 = oA.value;
    }
  }
  function wA(X) {
    X.context._currentValue2 = X.parentValue, X = X.parent, X !== null && wA(X);
  }
  function WA(X) {
    var oA = X.parent;
    oA !== null && WA(oA), X.context._currentValue2 = X.value;
  }
  function Pe(X, oA) {
    if (X.context._currentValue2 = X.parentValue, X = X.parent, X === null)
      throw Error(e(402));
    X.depth === oA.depth ? re(X, oA) : Pe(X, oA);
  }
  function je(X, oA) {
    var BA = oA.parent;
    if (BA === null)
      throw Error(e(402));
    X.depth === BA.depth ? re(X, BA) : je(X, BA), oA.context._currentValue2 = oA.value;
  }
  function it(X) {
    var oA = ee;
    oA !== X && (oA === null ? WA(X) : X === null ? wA(oA) : oA.depth === X.depth ? re(oA, X) : oA.depth > X.depth ? Pe(oA, X) : je(oA, X), ee = X);
  }
  var Li = { isMounted: function() {
    return !1;
  }, enqueueSetState: function(X, oA) {
    X = X._reactInternals, X.queue !== null && X.queue.push(oA);
  }, enqueueReplaceState: function(X, oA) {
    X = X._reactInternals, X.replace = !0, X.queue = [oA];
  }, enqueueForceUpdate: function() {
  } };
  function zA(X, oA, BA, dA) {
    var GA = X.state !== void 0 ? X.state : null;
    X.updater = Li, X.props = BA, X.state = GA;
    var yA = { queue: [], replace: !1 };
    X._reactInternals = yA;
    var YA = oA.contextType;
    if (X.context = typeof YA == "object" && YA !== null ? YA._currentValue2 : dA, YA = oA.getDerivedStateFromProps, typeof YA == "function" && (YA = YA(BA, GA), GA = YA == null ? GA : tA({}, GA, YA), X.state = GA), typeof oA.getDerivedStateFromProps != "function" && typeof X.getSnapshotBeforeUpdate != "function" && (typeof X.UNSAFE_componentWillMount == "function" || typeof X.componentWillMount == "function"))
      if (oA = X.state, typeof X.componentWillMount == "function" && X.componentWillMount(), typeof X.UNSAFE_componentWillMount == "function" && X.UNSAFE_componentWillMount(), oA !== X.state && Li.enqueueReplaceState(X, X.state, null), yA.queue !== null && 0 < yA.queue.length)
        if (oA = yA.queue, YA = yA.replace, yA.queue = null, yA.replace = !1, YA && oA.length === 1)
          X.state = oA[0];
        else {
          for (yA = YA ? oA[0] : X.state, GA = !0, YA = YA ? 1 : 0; YA < oA.length; YA++) {
            var OA = oA[YA];
            OA = typeof OA == "function" ? OA.call(X, yA, BA, dA) : OA, OA != null && (GA ? (GA = !1, yA = tA({}, yA, OA)) : tA(yA, OA));
          }
          X.state = yA;
        }
      else
        yA.queue = null;
  }
  var Qe = { id: 1, overflow: "" };
  function de(X, oA, BA) {
    var dA = X.id;
    X = X.overflow;
    var GA = 32 - xe(dA) - 1;
    dA &= ~(1 << GA), BA += 1;
    var yA = 32 - xe(oA) + GA;
    if (30 < yA) {
      var YA = GA - GA % 5;
      return yA = (dA & (1 << YA) - 1).toString(32), dA >>= YA, GA -= YA, { id: 1 << 32 - xe(oA) + GA | BA << GA | dA, overflow: yA + X };
    }
    return { id: 1 << yA | BA << GA | dA, overflow: X };
  }
  var xe = Math.clz32 ? Math.clz32 : Zt, $e = Math.log, Pn = Math.LN2;
  function Zt(X) {
    return X >>>= 0, X === 0 ? 32 : 31 - ($e(X) / Pn | 0) | 0;
  }
  function Kn(X, oA) {
    return X === oA && (X !== 0 || 1 / X === 1 / oA) || X !== X && oA !== oA;
  }
  var po = typeof Object.is == "function" ? Object.is : Kn, go = null, CI = null, Vl = null, Bi = null, Xl = !1, jQ = !1, zl = 0, Qa = null, PQ = 0;
  function Er() {
    if (go === null)
      throw Error(e(321));
    return go;
  }
  function $Q() {
    if (0 < PQ)
      throw Error(e(312));
    return { memoizedState: null, queue: null, next: null };
  }
  function sh() {
    return Bi === null ? Vl === null ? (Xl = !1, Vl = Bi = $Q()) : (Xl = !0, Bi = Vl) : Bi.next === null ? (Xl = !1, Bi = Bi.next = $Q()) : (Xl = !0, Bi = Bi.next), Bi;
  }
  function Ih() {
    CI = go = null, jQ = !1, Vl = null, PQ = 0, Bi = Qa = null;
  }
  function M0(X, oA) {
    return typeof oA == "function" ? oA(X) : oA;
  }
  function x0(X, oA, BA) {
    if (go = Er(), Bi = sh(), Xl) {
      var dA = Bi.queue;
      if (oA = dA.dispatch, Qa !== null && (BA = Qa.get(dA), BA !== void 0)) {
        Qa.delete(dA), dA = Bi.memoizedState;
        do
          dA = X(dA, BA.action), BA = BA.next;
        while (BA !== null);
        return Bi.memoizedState = dA, [dA, oA];
      }
      return [Bi.memoizedState, oA];
    }
    return X = X === M0 ? typeof oA == "function" ? oA() : oA : BA !== void 0 ? BA(oA) : oA, Bi.memoizedState = X, X = Bi.queue = { last: null, dispatch: null }, X = X.dispatch = Je.bind(null, go, X), [Bi.memoizedState, X];
  }
  function Mg(X, oA) {
    if (go = Er(), Bi = sh(), oA = oA === void 0 ? null : oA, Bi !== null) {
      var BA = Bi.memoizedState;
      if (BA !== null && oA !== null) {
        var dA = BA[1];
        A:
          if (dA === null)
            dA = !1;
          else {
            for (var GA = 0; GA < dA.length && GA < oA.length; GA++)
              if (!po(oA[GA], dA[GA])) {
                dA = !1;
                break A;
              }
            dA = !0;
          }
        if (dA)
          return BA[0];
      }
    }
    return X = X(), Bi.memoizedState = [X, oA], X;
  }
  function Je(X, oA, BA) {
    if (25 <= PQ)
      throw Error(e(301));
    if (X === go)
      if (jQ = !0, X = { action: BA, next: null }, Qa === null && (Qa = /* @__PURE__ */ new Map()), BA = Qa.get(oA), BA === void 0)
        Qa.set(oA, X);
      else {
        for (oA = BA; oA.next !== null; )
          oA = oA.next;
        oA.next = X;
      }
  }
  function L0() {
    throw Error(e(394));
  }
  function Tl() {
  }
  var ah = { readContext: function(X) {
    return X._currentValue2;
  }, useContext: function(X) {
    return Er(), X._currentValue2;
  }, useMemo: Mg, useReducer: x0, useRef: function(X) {
    go = Er(), Bi = sh();
    var oA = Bi.memoizedState;
    return oA === null ? (X = { current: X }, Bi.memoizedState = X) : oA;
  }, useState: function(X) {
    return x0(M0, X);
  }, useInsertionEffect: Tl, useLayoutEffect: function() {
  }, useCallback: function(X, oA) {
    return Mg(function() {
      return X;
    }, oA);
  }, useImperativeHandle: Tl, useEffect: Tl, useDebugValue: Tl, useDeferredValue: function(X) {
    return Er(), X;
  }, useTransition: function() {
    return Er(), [
      !1,
      L0
    ];
  }, useId: function() {
    var X = CI.treeContext, oA = X.overflow;
    X = X.id, X = (X & ~(1 << 32 - xe(X) - 1)).toString(32) + oA;
    var BA = _l;
    if (BA === null)
      throw Error(e(404));
    return oA = zl++, X = ":" + BA.idPrefix + "R" + X, 0 < oA && (X += "H" + oA.toString(32)), X + ":";
  }, useMutableSource: function(X, oA) {
    return Er(), oA(X._source);
  }, useSyncExternalStore: function(X, oA, BA) {
    if (BA === void 0)
      throw Error(e(407));
    return BA();
  } }, _l = null, ql = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;
  function v0(X) {
    return console.error(X), null;
  }
  function ms() {
  }
  function H0(X, oA, BA, dA, GA, yA, YA, OA, Fe) {
    var Ve = [], nt = /* @__PURE__ */ new Set();
    return oA = { destination: null, responseState: oA, progressiveChunkSize: dA === void 0 ? 12800 : dA, status: 0, fatalError: null, nextSegmentId: 0, allPendingTasks: 0, pendingRootTasks: 0, completedRootSegment: null, abortableTasks: nt, pingedTasks: Ve, clientRenderedBoundaries: [], completedBoundaries: [], partialBoundaries: [], onError: GA === void 0 ? v0 : GA, onAllReady: yA === void 0 ? ms : yA, onShellReady: YA === void 0 ? ms : YA, onShellError: OA === void 0 ? ms : OA, onFatalError: Fe === void 0 ? ms : Fe }, BA = AE(oA, 0, null, BA, !1, !1), BA.parentFlushed = !0, X = rh(oA, X, null, BA, nt, De, null, Qe), Ve.push(X), oA;
  }
  function rh(X, oA, BA, dA, GA, yA, YA, OA) {
    X.allPendingTasks++, BA === null ? X.pendingRootTasks++ : BA.pendingTasks++;
    var Fe = { node: oA, ping: function() {
      var Ve = X.pingedTasks;
      Ve.push(Fe), Ve.length === 1 && Qh(X);
    }, blockedBoundary: BA, blockedSegment: dA, abortSet: GA, legacyContext: yA, context: YA, treeContext: OA };
    return GA.add(Fe), Fe;
  }
  function AE(X, oA, BA, dA, GA, yA) {
    return { status: 0, id: -1, index: oA, parentFlushed: !1, chunks: [], children: [], formatContext: dA, boundary: BA, lastPushedText: GA, textEmbedded: yA };
  }
  function Ol(X, oA) {
    if (X = X.onError(oA), X != null && typeof X != "string")
      throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' + typeof X + '" instead');
    return X;
  }
  function eE(X, oA) {
    var BA = X.onShellError;
    BA(oA), BA = X.onFatalError, BA(oA), X.destination !== null ? (X.status = 2, X.destination.destroy(oA)) : (X.status = 1, X.fatalError = oA);
  }
  function Ch(X, oA, BA, dA, GA) {
    for (go = {}, CI = oA, zl = 0, X = BA(dA, GA); jQ; )
      jQ = !1, zl = 0, PQ += 1, Bi = null, X = BA(dA, GA);
    return Ih(), X;
  }
  function S0(X, oA, BA, dA) {
    var GA = BA.render(), yA = dA.childContextTypes;
    if (yA != null) {
      var YA = oA.legacyContext;
      if (typeof BA.getChildContext != "function")
        dA = YA;
      else {
        BA = BA.getChildContext();
        for (var OA in BA)
          if (!(OA in yA))
            throw Error(e(108, we(dA) || "Unknown", OA));
        dA = tA({}, YA, BA);
      }
      oA.legacyContext = dA, zo(X, oA, GA), oA.legacyContext = YA;
    } else
      zo(X, oA, GA);
  }
  function jl(X, oA) {
    if (X && X.defaultProps) {
      oA = tA({}, oA), X = X.defaultProps;
      for (var BA in X)
        oA[BA] === void 0 && (oA[BA] = X[BA]);
      return oA;
    }
    return oA;
  }
  function Bh(X, oA, BA, dA, GA) {
    if (typeof BA == "function")
      if (BA.prototype && BA.prototype.isReactComponent) {
        GA = Ke(BA, oA.legacyContext);
        var yA = BA.contextType;
        yA = new BA(dA, typeof yA == "object" && yA !== null ? yA._currentValue2 : GA), zA(yA, BA, dA, GA), S0(X, oA, yA, BA);
      } else {
        yA = Ke(BA, oA.legacyContext), GA = Ch(X, oA, BA, dA, yA);
        var YA = zl !== 0;
        if (typeof GA == "object" && GA !== null && typeof GA.render == "function" && GA.$$typeof === void 0)
          zA(GA, BA, dA, yA), S0(X, oA, GA, BA);
        else if (YA) {
          dA = oA.treeContext, oA.treeContext = de(dA, 1, 0);
          try {
            zo(X, oA, GA);
          } finally {
            oA.treeContext = dA;
          }
        } else
          zo(X, oA, GA);
      }
    else if (typeof BA == "string") {
      switch (GA = oA.blockedSegment, yA = v(GA.chunks, BA, dA, X.responseState, GA.formatContext), GA.lastPushedText = !1, YA = GA.formatContext, GA.formatContext = f(YA, BA, dA), lh(X, oA, yA), GA.formatContext = YA, BA) {
        case "area":
        case "base":
        case "br":
        case "col":
        case "embed":
        case "hr":
        case "img":
        case "input":
        case "keygen":
        case "link":
        case "meta":
        case "param":
        case "source":
        case "track":
        case "wbr":
          break;
        default:
          GA.chunks.push("</", BA, ">");
      }
      GA.lastPushedText = !1;
    } else {
      switch (BA) {
        case ne:
        case HA:
        case rA:
        case sA:
        case gA:
          zo(X, oA, dA.children);
          return;
        case hA:
          zo(X, oA, dA.children);
          return;
        case xA:
          throw Error(e(343));
        case QA:
          A: {
            BA = oA.blockedBoundary, GA = oA.blockedSegment, yA = dA.fallback, dA = dA.children, YA = /* @__PURE__ */ new Set();
            var OA = { id: null, rootSegmentID: -1, parentFlushed: !1, pendingTasks: 0, forceClientRender: !1, completedSegments: [], byteSize: 0, fallbackAbortableTasks: YA, errorDigest: null }, Fe = AE(X, GA.chunks.length, OA, GA.formatContext, !1, !1);
            GA.children.push(Fe), GA.lastPushedText = !1;
            var Ve = AE(X, 0, null, GA.formatContext, !1, !1);
            Ve.parentFlushed = !0, oA.blockedBoundary = OA, oA.blockedSegment = Ve;
            try {
              if (lh(
                X,
                oA,
                dA
              ), X.responseState.generateStaticMarkup || Ve.lastPushedText && Ve.textEmbedded && Ve.chunks.push("<!-- -->"), Ve.status = 1, ps(OA, Ve), OA.pendingTasks === 0)
                break A;
            } catch (nt) {
              Ve.status = 4, OA.forceClientRender = !0, OA.errorDigest = Ol(X, nt);
            } finally {
              oA.blockedBoundary = BA, oA.blockedSegment = GA;
            }
            oA = rh(X, yA, BA, Fe, YA, oA.legacyContext, oA.context, oA.treeContext), X.pingedTasks.push(oA);
          }
          return;
      }
      if (typeof BA == "object" && BA !== null)
        switch (BA.$$typeof) {
          case aA:
            if (dA = Ch(X, oA, BA.render, dA, GA), zl !== 0) {
              BA = oA.treeContext, oA.treeContext = de(BA, 1, 0);
              try {
                zo(X, oA, dA);
              } finally {
                oA.treeContext = BA;
              }
            } else
              zo(X, oA, dA);
            return;
          case EA:
            BA = BA.type, dA = jl(BA, dA), Bh(X, oA, BA, dA, GA);
            return;
          case lA:
            if (GA = dA.children, BA = BA._context, dA = dA.value, yA = BA._currentValue2, BA._currentValue2 = dA, YA = ee, ee = dA = { parent: YA, depth: YA === null ? 0 : YA.depth + 1, context: BA, parentValue: yA, value: dA }, oA.context = dA, zo(X, oA, GA), X = ee, X === null)
              throw Error(e(403));
            dA = X.parentValue, X.context._currentValue2 = dA === VA ? X.context._defaultValue : dA, X = ee = X.parent, oA.context = X;
            return;
          case cA:
            dA = dA.children, dA = dA(BA._currentValue2), zo(X, oA, dA);
            return;
          case RA:
            GA = BA._init, BA = GA(BA._payload), dA = jl(BA, dA), Bh(
              X,
              oA,
              BA,
              dA,
              void 0
            );
            return;
        }
      throw Error(e(130, BA == null ? BA : typeof BA, ""));
    }
  }
  function zo(X, oA, BA) {
    if (oA.node = BA, typeof BA == "object" && BA !== null) {
      switch (BA.$$typeof) {
        case nA:
          Bh(X, oA, BA.type, BA.props, BA.ref);
          return;
        case AA:
          throw Error(e(257));
        case RA:
          var dA = BA._init;
          BA = dA(BA._payload), zo(X, oA, BA);
          return;
      }
      if (m(BA)) {
        Z0(X, oA, BA);
        return;
      }
      if (BA === null || typeof BA != "object" ? dA = null : (dA = le && BA[le] || BA["@@iterator"], dA = typeof dA == "function" ? dA : null), dA && (dA = dA.call(BA))) {
        if (BA = dA.next(), !BA.done) {
          var GA = [];
          do
            GA.push(BA.value), BA = dA.next();
          while (!BA.done);
          Z0(X, oA, GA);
        }
        return;
      }
      throw X = Object.prototype.toString.call(BA), Error(e(31, X === "[object Object]" ? "object with keys {" + Object.keys(BA).join(", ") + "}" : X));
    }
    typeof BA == "string" ? (dA = oA.blockedSegment, dA.lastPushedText = _(oA.blockedSegment.chunks, BA, X.responseState, dA.lastPushedText)) : typeof BA == "number" && (dA = oA.blockedSegment, dA.lastPushedText = _(oA.blockedSegment.chunks, "" + BA, X.responseState, dA.lastPushedText));
  }
  function Z0(X, oA, BA) {
    for (var dA = BA.length, GA = 0; GA < dA; GA++) {
      var yA = oA.treeContext;
      oA.treeContext = de(yA, dA, GA);
      try {
        lh(X, oA, BA[GA]);
      } finally {
        oA.treeContext = yA;
      }
    }
  }
  function lh(X, oA, BA) {
    var dA = oA.blockedSegment.formatContext, GA = oA.legacyContext, yA = oA.context;
    try {
      return zo(X, oA, BA);
    } catch (Fe) {
      if (Ih(), typeof Fe == "object" && Fe !== null && typeof Fe.then == "function") {
        BA = Fe;
        var YA = oA.blockedSegment, OA = AE(X, YA.chunks.length, null, YA.formatContext, YA.lastPushedText, !0);
        YA.children.push(OA), YA.lastPushedText = !1, X = rh(X, oA.node, oA.blockedBoundary, OA, oA.abortSet, oA.legacyContext, oA.context, oA.treeContext).ping, BA.then(X, X), oA.blockedSegment.formatContext = dA, oA.legacyContext = GA, oA.context = yA, it(yA);
      } else
        throw oA.blockedSegment.formatContext = dA, oA.legacyContext = GA, oA.context = yA, it(yA), Fe;
    }
  }
  function ch(X) {
    var oA = X.blockedBoundary;
    X = X.blockedSegment, X.status = 3, ur(this, oA, X);
  }
  function tE(X, oA, BA) {
    var dA = X.blockedBoundary;
    X.blockedSegment.status = 3, dA === null ? (oA.allPendingTasks--, oA.status !== 2 && (oA.status = 2, oA.destination !== null && oA.destination.push(null))) : (dA.pendingTasks--, dA.forceClientRender || (dA.forceClientRender = !0, X = BA === void 0 ? Error(e(432)) : BA, dA.errorDigest = oA.onError(X), dA.parentFlushed && oA.clientRenderedBoundaries.push(dA)), dA.fallbackAbortableTasks.forEach(function(GA) {
      return tE(GA, oA, BA);
    }), dA.fallbackAbortableTasks.clear(), oA.allPendingTasks--, oA.allPendingTasks === 0 && (dA = oA.onAllReady, dA()));
  }
  function ps(X, oA) {
    if (oA.chunks.length === 0 && oA.children.length === 1 && oA.children[0].boundary === null) {
      var BA = oA.children[0];
      BA.id = oA.id, BA.parentFlushed = !0, BA.status === 1 && ps(X, BA);
    } else
      X.completedSegments.push(oA);
  }
  function ur(X, oA, BA) {
    if (oA === null) {
      if (BA.parentFlushed) {
        if (X.completedRootSegment !== null)
          throw Error(e(389));
        X.completedRootSegment = BA;
      }
      X.pendingRootTasks--, X.pendingRootTasks === 0 && (X.onShellError = ms, oA = X.onShellReady, oA());
    } else
      oA.pendingTasks--, oA.forceClientRender || (oA.pendingTasks === 0 ? (BA.parentFlushed && BA.status === 1 && ps(oA, BA), oA.parentFlushed && X.completedBoundaries.push(oA), oA.fallbackAbortableTasks.forEach(ch, X), oA.fallbackAbortableTasks.clear()) : BA.parentFlushed && BA.status === 1 && (ps(oA, BA), oA.completedSegments.length === 1 && oA.parentFlushed && X.partialBoundaries.push(oA)));
    X.allPendingTasks--, X.allPendingTasks === 0 && (X = X.onAllReady, X());
  }
  function Qh(X) {
    if (X.status !== 2) {
      var oA = ee, BA = ql.current;
      ql.current = ah;
      var dA = _l;
      _l = X.responseState;
      try {
        var GA = X.pingedTasks, yA;
        for (yA = 0; yA < GA.length; yA++) {
          var YA = GA[yA], OA = X, Fe = YA.blockedSegment;
          if (Fe.status === 0) {
            it(YA.context);
            try {
              zo(OA, YA, YA.node), OA.responseState.generateStaticMarkup || Fe.lastPushedText && Fe.textEmbedded && Fe.chunks.push("<!-- -->"), YA.abortSet.delete(YA), Fe.status = 1, ur(OA, YA.blockedBoundary, Fe);
            } catch (yo) {
              if (Ih(), typeof yo == "object" && yo !== null && typeof yo.then == "function") {
                var Ve = YA.ping;
                yo.then(Ve, Ve);
              } else {
                YA.abortSet.delete(YA), Fe.status = 4;
                var nt = YA.blockedBoundary, Ei = yo, xg = Ol(OA, Ei);
                if (nt === null ? eE(OA, Ei) : (nt.pendingTasks--, nt.forceClientRender || (nt.forceClientRender = !0, nt.errorDigest = xg, nt.parentFlushed && OA.clientRenderedBoundaries.push(nt))), OA.allPendingTasks--, OA.allPendingTasks === 0) {
                  var Lg = OA.onAllReady;
                  Lg();
                }
              }
            } finally {
            }
          }
        }
        GA.splice(0, yA), X.destination !== null && lI(X, X.destination);
      } catch (yo) {
        Ol(X, yo), eE(X, yo);
      } finally {
        _l = dA, ql.current = BA, BA === ah && it(oA);
      }
    }
  }
  function BI(X, oA, BA) {
    switch (BA.parentFlushed = !0, BA.status) {
      case 0:
        var dA = BA.id = X.nextSegmentId++;
        return BA.lastPushedText = !1, BA.textEmbedded = !1, X = X.responseState, oA.push('<template id="'), oA.push(X.placeholderPrefix), X = dA.toString(16), oA.push(X), oA.push('"></template>');
      case 1:
        BA.status = 2;
        var GA = !0;
        dA = BA.chunks;
        var yA = 0;
        BA = BA.children;
        for (var YA = 0; YA < BA.length; YA++) {
          for (GA = BA[YA]; yA < GA.index; yA++)
            oA.push(dA[yA]);
          GA = kt(X, oA, GA);
        }
        for (; yA < dA.length - 1; yA++)
          oA.push(dA[yA]);
        return yA < dA.length && (GA = oA.push(dA[yA])), GA;
      default:
        throw Error(e(390));
    }
  }
  function kt(X, oA, BA) {
    var dA = BA.boundary;
    if (dA === null)
      return BI(X, oA, BA);
    if (dA.parentFlushed = !0, dA.forceClientRender)
      return X.responseState.generateStaticMarkup || (dA = dA.errorDigest, oA.push("<!--$!-->"), oA.push("<template"), dA && (oA.push(' data-dgst="'), dA = Q(dA), oA.push(dA), oA.push('"')), oA.push("></template>")), BI(X, oA, BA), X = X.responseState.generateStaticMarkup ? !0 : oA.push("<!--/$-->"), X;
    if (0 < dA.pendingTasks) {
      dA.rootSegmentID = X.nextSegmentId++, 0 < dA.completedSegments.length && X.partialBoundaries.push(dA);
      var GA = X.responseState, yA = GA.nextSuspenseID++;
      return GA = GA.boundaryPrefix + yA.toString(16), dA = dA.id = GA, K(oA, X.responseState, dA), BI(X, oA, BA), oA.push("<!--/$-->");
    }
    if (dA.byteSize > X.progressiveChunkSize)
      return dA.rootSegmentID = X.nextSegmentId++, X.completedBoundaries.push(dA), K(oA, X.responseState, dA.id), BI(X, oA, BA), oA.push("<!--/$-->");
    if (X.responseState.generateStaticMarkup || oA.push("<!--$-->"), BA = dA.completedSegments, BA.length !== 1)
      throw Error(e(391));
    return kt(X, oA, BA[0]), X = X.responseState.generateStaticMarkup ? !0 : oA.push("<!--/$-->"), X;
  }
  function fi(X, oA, BA) {
    return U(oA, X.responseState, BA.formatContext, BA.id), kt(X, oA, BA), j(oA, BA.formatContext);
  }
  function SC(X, oA, BA) {
    for (var dA = BA.completedSegments, GA = 0; GA < dA.length; GA++)
      Ea(X, oA, BA, dA[GA]);
    if (dA.length = 0, X = X.responseState, dA = BA.id, BA = BA.rootSegmentID, oA.push(X.startInlineScript), X.sentCompleteBoundaryFunction ? oA.push('$RC("') : (X.sentCompleteBoundaryFunction = !0, oA.push('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("')), dA === null)
      throw Error(e(395));
    return BA = BA.toString(16), oA.push(dA), oA.push('","'), oA.push(X.segmentPrefix), oA.push(BA), oA.push('")<\/script>');
  }
  function Ea(X, oA, BA, dA) {
    if (dA.status === 2)
      return !0;
    var GA = dA.id;
    if (GA === -1) {
      if ((dA.id = BA.rootSegmentID) === -1)
        throw Error(e(392));
      return fi(X, oA, dA);
    }
    return fi(X, oA, dA), X = X.responseState, oA.push(X.startInlineScript), X.sentCompleteSegmentFunction ? oA.push('$RS("') : (X.sentCompleteSegmentFunction = !0, oA.push('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("')), oA.push(X.segmentPrefix), GA = GA.toString(16), oA.push(GA), oA.push('","'), oA.push(X.placeholderPrefix), oA.push(GA), oA.push('")<\/script>');
  }
  function lI(X, oA) {
    try {
      var BA = X.completedRootSegment;
      if (BA !== null && X.pendingRootTasks === 0) {
        kt(X, oA, BA), X.completedRootSegment = null;
        var dA = X.responseState.bootstrapChunks;
        for (BA = 0; BA < dA.length - 1; BA++)
          oA.push(dA[BA]);
        BA < dA.length && oA.push(dA[BA]);
      }
      var GA = X.clientRenderedBoundaries, yA;
      for (yA = 0; yA < GA.length; yA++) {
        var YA = GA[yA];
        dA = oA;
        var OA = X.responseState, Fe = YA.id, Ve = YA.errorDigest, nt = YA.errorMessage, Ei = YA.errorComponentStack;
        if (dA.push(OA.startInlineScript), OA.sentClientRenderFunction ? dA.push('$RX("') : (OA.sentClientRenderFunction = !0, dA.push('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("')), Fe === null)
          throw Error(e(395));
        if (dA.push(Fe), dA.push('"'), Ve || nt || Ei) {
          dA.push(",");
          var xg = O(Ve || "");
          dA.push(xg);
        }
        if (nt || Ei) {
          dA.push(",");
          var Lg = O(nt || "");
          dA.push(Lg);
        }
        if (Ei) {
          dA.push(",");
          var yo = O(Ei);
          dA.push(yo);
        }
        if (!dA.push(")<\/script>")) {
          X.destination = null, yA++, GA.splice(0, yA);
          return;
        }
      }
      GA.splice(0, yA);
      var dr = X.completedBoundaries;
      for (yA = 0; yA < dr.length; yA++)
        if (!SC(X, oA, dr[yA])) {
          X.destination = null, yA++, dr.splice(0, yA);
          return;
        }
      dr.splice(0, yA);
      var cI = X.partialBoundaries;
      for (yA = 0; yA < cI.length; yA++) {
        var ZC = cI[yA];
        A: {
          GA = X, YA = oA;
          var WC = ZC.completedSegments;
          for (OA = 0; OA < WC.length; OA++)
            if (!Ea(GA, YA, ZC, WC[OA])) {
              OA++, WC.splice(0, OA);
              var nE = !1;
              break A;
            }
          WC.splice(0, OA), nE = !0;
        }
        if (!nE) {
          X.destination = null, yA++, cI.splice(0, yA);
          return;
        }
      }
      cI.splice(0, yA);
      var KC = X.completedBoundaries;
      for (yA = 0; yA < KC.length; yA++)
        if (!SC(X, oA, KC[yA])) {
          X.destination = null, yA++, KC.splice(0, yA);
          return;
        }
      KC.splice(0, yA);
    } finally {
      X.allPendingTasks === 0 && X.pingedTasks.length === 0 && X.clientRenderedBoundaries.length === 0 && X.completedBoundaries.length === 0 && oA.push(null);
    }
  }
  function iE(X, oA) {
    try {
      var BA = X.abortableTasks;
      BA.forEach(function(dA) {
        return tE(dA, X, oA);
      }), BA.clear(), X.destination !== null && lI(X, X.destination);
    } catch (dA) {
      Ol(X, dA), eE(X, dA);
    }
  }
  function It() {
  }
  function vi(X, oA, BA, dA) {
    var GA = !1, yA = null, YA = "", OA = { push: function(Ve) {
      return Ve !== null && (YA += Ve), !0;
    }, destroy: function(Ve) {
      GA = !0, yA = Ve;
    } }, Fe = !1;
    if (X = H0(X, $(BA, oA ? oA.identifierPrefix : void 0), { insertionMode: 1, selectedValue: null }, 1 / 0, It, void 0, function() {
      Fe = !0;
    }, void 0, void 0), Qh(X), iE(X, dA), X.status === 1)
      X.status = 2, OA.destroy(X.fatalError);
    else if (X.status !== 2 && X.destination === null) {
      X.destination = OA;
      try {
        lI(X, OA);
      } catch (Ve) {
        Ol(X, Ve), eE(X, Ve);
      }
    }
    if (GA)
      throw yA;
    if (!Fe)
      throw Error(e(426));
    return YA;
  }
  return Lh.renderToNodeStream = function() {
    throw Error(e(207));
  }, Lh.renderToStaticMarkup = function(X, oA) {
    return vi(X, oA, !0, 'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server');
  }, Lh.renderToStaticNodeStream = function() {
    throw Error(e(208));
  }, Lh.renderToString = function(X, oA) {
    return vi(X, oA, !1, 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server');
  }, Lh.version = "18.2.0", Lh;
}
var Wx = {};
/**
 * @license React
 * react-dom-server.browser.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 ryA;
function Q0t() {
  if (ryA)
    return Wx;
  ryA = 1;
  var A = b;
  function e(z) {
    for (var iA = "https://reactjs.org/docs/error-decoder.html?invariant=" + z, CA = 1; CA < arguments.length; CA++)
      iA += "&args[]=" + encodeURIComponent(arguments[CA]);
    return "Minified React error #" + z + "; visit " + iA + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  var t = null, i = 0;
  function n(z, iA) {
    if (iA.length !== 0)
      if (512 < iA.length)
        0 < i && (z.enqueue(new Uint8Array(t.buffer, 0, i)), t = new Uint8Array(512), i = 0), z.enqueue(iA);
      else {
        var CA = t.length - i;
        CA < iA.length && (CA === 0 ? z.enqueue(t) : (t.set(iA.subarray(0, CA), i), z.enqueue(t), iA = iA.subarray(CA)), t = new Uint8Array(512), i = 0), t.set(iA, i), i += iA.length;
      }
  }
  function o(z, iA) {
    return n(z, iA), !0;
  }
  function g(z) {
    t && 0 < i && (z.enqueue(new Uint8Array(t.buffer, 0, i)), t = null, i = 0);
  }
  var s = new TextEncoder();
  function I(z) {
    return s.encode(z);
  }
  function r(z) {
    return s.encode(z);
  }
  function a(z, iA) {
    typeof z.error == "function" ? z.error(iA) : z.close();
  }
  var C = Object.prototype.hasOwnProperty, B = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, l = {}, Q = {};
  function E(z) {
    return C.call(Q, z) ? !0 : C.call(l, z) ? !1 : B.test(z) ? Q[z] = !0 : (l[z] = !0, !1);
  }
  function d(z, iA, CA, uA, kA, DA, SA) {
    this.acceptsBooleans = iA === 2 || iA === 3 || iA === 4, this.attributeName = uA, this.attributeNamespace = kA, this.mustUseProperty = CA, this.propertyName = z, this.type = iA, this.sanitizeURL = DA, this.removeEmptyString = SA;
  }
  var m = {};
  "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(z) {
    m[z] = new d(z, 0, !1, z, null, !1, !1);
  }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(z) {
    var iA = z[0];
    m[iA] = new d(iA, 1, !1, z[1], null, !1, !1);
  }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(z) {
    m[z] = new d(z, 2, !1, z.toLowerCase(), null, !1, !1);
  }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(z) {
    m[z] = new d(z, 2, !1, z, null, !1, !1);
  }), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(z) {
    m[z] = new d(z, 3, !1, z.toLowerCase(), null, !1, !1);
  }), ["checked", "multiple", "muted", "selected"].forEach(function(z) {
    m[z] = new d(z, 3, !0, z, null, !1, !1);
  }), ["capture", "download"].forEach(function(z) {
    m[z] = new d(z, 4, !1, z, null, !1, !1);
  }), ["cols", "rows", "size", "span"].forEach(function(z) {
    m[z] = new d(z, 6, !1, z, null, !1, !1);
  }), ["rowSpan", "start"].forEach(function(z) {
    m[z] = new d(z, 5, !1, z.toLowerCase(), null, !1, !1);
  });
  var y = /[\-:]([a-z])/g;
  function f(z) {
    return z[1].toUpperCase();
  }
  "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(z) {
    var iA = z.replace(
      y,
      f
    );
    m[iA] = new d(iA, 1, !1, z, null, !1, !1);
  }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(z) {
    var iA = z.replace(y, f);
    m[iA] = new d(iA, 1, !1, z, "http://www.w3.org/1999/xlink", !1, !1);
  }), ["xml:base", "xml:lang", "xml:space"].forEach(function(z) {
    var iA = z.replace(y, f);
    m[iA] = new d(iA, 1, !1, z, "http://www.w3.org/XML/1998/namespace", !1, !1);
  }), ["tabIndex", "crossOrigin"].forEach(function(z) {
    m[z] = new d(z, 1, !1, z.toLowerCase(), null, !1, !1);
  }), m.xlinkHref = new d("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function(z) {
    m[z] = new d(z, 1, !1, z.toLowerCase(), null, !0, !0);
  });
  var w = {
    animationIterationCount: !0,
    aspectRatio: !0,
    borderImageOutset: !0,
    borderImageSlice: !0,
    borderImageWidth: !0,
    boxFlex: !0,
    boxFlexGroup: !0,
    boxOrdinalGroup: !0,
    columnCount: !0,
    columns: !0,
    flex: !0,
    flexGrow: !0,
    flexPositive: !0,
    flexShrink: !0,
    flexNegative: !0,
    flexOrder: !0,
    gridArea: !0,
    gridRow: !0,
    gridRowEnd: !0,
    gridRowSpan: !0,
    gridRowStart: !0,
    gridColumn: !0,
    gridColumnEnd: !0,
    gridColumnSpan: !0,
    gridColumnStart: !0,
    fontWeight: !0,
    lineClamp: !0,
    lineHeight: !0,
    opacity: !0,
    order: !0,
    orphans: !0,
    tabSize: !0,
    widows: !0,
    zIndex: !0,
    zoom: !0,
    fillOpacity: !0,
    floodOpacity: !0,
    stopOpacity: !0,
    strokeDasharray: !0,
    strokeDashoffset: !0,
    strokeMiterlimit: !0,
    strokeOpacity: !0,
    strokeWidth: !0
  }, G = ["Webkit", "ms", "Moz", "O"];
  Object.keys(w).forEach(function(z) {
    G.forEach(function(iA) {
      iA = iA + z.charAt(0).toUpperCase() + z.substring(1), w[iA] = w[z];
    });
  });
  var R = /["'&<>]/;
  function F(z) {
    if (typeof z == "boolean" || typeof z == "number")
      return "" + z;
    z = "" + z;
    var iA = R.exec(z);
    if (iA) {
      var CA = "", uA, kA = 0;
      for (uA = iA.index; uA < z.length; uA++) {
        switch (z.charCodeAt(uA)) {
          case 34:
            iA = "&quot;";
            break;
          case 38:
            iA = "&amp;";
            break;
          case 39:
            iA = "&#x27;";
            break;
          case 60:
            iA = "&lt;";
            break;
          case 62:
            iA = "&gt;";
            break;
          default:
            continue;
        }
        kA !== uA && (CA += z.substring(kA, uA)), kA = uA + 1, CA += iA;
      }
      z = kA !== uA ? CA + z.substring(kA, uA) : CA;
    }
    return z;
  }
  var Z = /([A-Z])/g, c = /^ms-/, J = Array.isArray, p = r("<script>"), N = r("<\/script>"), v = r('<script src="'), K = r('<script type="module" src="'), U = r('" async=""><\/script>'), j = /(<\/|<)(s)(cript)/gi;
  function q(z, iA, CA, uA) {
    return "" + iA + (CA === "s" ? "\\u0073" : "\\u0053") + uA;
  }
  function O(z, iA, CA, uA, kA) {
    z = z === void 0 ? "" : z, iA = iA === void 0 ? p : r('<script nonce="' + F(iA) + '">');
    var DA = [];
    if (CA !== void 0 && DA.push(iA, I(("" + CA).replace(j, q)), N), uA !== void 0)
      for (CA = 0; CA < uA.length; CA++)
        DA.push(v, I(F(uA[CA])), U);
    if (kA !== void 0)
      for (uA = 0; uA < kA.length; uA++)
        DA.push(K, I(F(kA[uA])), U);
    return { bootstrapChunks: DA, startInlineScript: iA, placeholderPrefix: r(z + "P:"), segmentPrefix: r(z + "S:"), boundaryPrefix: z + "B:", idPrefix: z, nextSuspenseID: 0, sentCompleteSegmentFunction: !1, sentCompleteBoundaryFunction: !1, sentClientRenderFunction: !1 };
  }
  function $(z, iA) {
    return { insertionMode: z, selectedValue: iA };
  }
  function _(z) {
    return $(z === "http://www.w3.org/2000/svg" ? 2 : z === "http://www.w3.org/1998/Math/MathML" ? 3 : 0, null);
  }
  function tA(z, iA, CA) {
    switch (iA) {
      case "select":
        return $(1, CA.value != null ? CA.value : CA.defaultValue);
      case "svg":
        return $(2, null);
      case "math":
        return $(3, null);
      case "foreignObject":
        return $(1, null);
      case "table":
        return $(4, null);
      case "thead":
      case "tbody":
      case "tfoot":
        return $(5, null);
      case "colgroup":
        return $(7, null);
      case "tr":
        return $(6, null);
    }
    return 4 <= z.insertionMode || z.insertionMode === 0 ? $(1, null) : z;
  }
  var nA = r("<!-- -->");
  function AA(z, iA, CA, uA) {
    return iA === "" ? uA : (uA && z.push(nA), z.push(I(F(iA))), !0);
  }
  var gA = /* @__PURE__ */ new Map(), rA = r(' style="'), sA = r(":"), lA = r(";");
  function cA(z, iA, CA) {
    if (typeof CA != "object")
      throw Error(e(62));
    iA = !0;
    for (var uA in CA)
      if (C.call(CA, uA)) {
        var kA = CA[uA];
        if (kA != null && typeof kA != "boolean" && kA !== "") {
          if (uA.indexOf("--") === 0) {
            var DA = I(F(uA));
            kA = I(F(("" + kA).trim()));
          } else {
            DA = uA;
            var SA = gA.get(DA);
            SA !== void 0 || (SA = r(F(DA.replace(Z, "-$1").toLowerCase().replace(c, "-ms-"))), gA.set(DA, SA)), DA = SA, kA = typeof kA == "number" ? kA === 0 || C.call(w, uA) ? I("" + kA) : I(kA + "px") : I(F(("" + kA).trim()));
          }
          iA ? (iA = !1, z.push(rA, DA, sA, kA)) : z.push(lA, DA, sA, kA);
        }
      }
    iA || z.push(hA);
  }
  var aA = r(" "), QA = r('="'), hA = r('"'), EA = r('=""');
  function RA(z, iA, CA, uA) {
    switch (CA) {
      case "style":
        cA(z, iA, uA);
        return;
      case "defaultValue":
      case "defaultChecked":
      case "innerHTML":
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
        return;
    }
    if (!(2 < CA.length) || CA[0] !== "o" && CA[0] !== "O" || CA[1] !== "n" && CA[1] !== "N") {
      if (iA = m.hasOwnProperty(CA) ? m[CA] : null, iA !== null) {
        switch (typeof uA) {
          case "function":
          case "symbol":
            return;
          case "boolean":
            if (!iA.acceptsBooleans)
              return;
        }
        switch (CA = I(iA.attributeName), iA.type) {
          case 3:
            uA && z.push(aA, CA, EA);
            break;
          case 4:
            uA === !0 ? z.push(aA, CA, EA) : uA !== !1 && z.push(aA, CA, QA, I(F(uA)), hA);
            break;
          case 5:
            isNaN(uA) || z.push(aA, CA, QA, I(F(uA)), hA);
            break;
          case 6:
            !isNaN(uA) && 1 <= uA && z.push(aA, CA, QA, I(F(uA)), hA);
            break;
          default:
            iA.sanitizeURL && (uA = "" + uA), z.push(aA, CA, QA, I(F(uA)), hA);
        }
      } else if (E(CA)) {
        switch (typeof uA) {
          case "function":
          case "symbol":
            return;
          case "boolean":
            if (iA = CA.toLowerCase().slice(0, 5), iA !== "data-" && iA !== "aria-")
              return;
        }
        z.push(aA, I(CA), QA, I(F(uA)), hA);
      }
    }
  }
  var xA = r(">"), HA = r("/>");
  function ne(z, iA, CA) {
    if (iA != null) {
      if (CA != null)
        throw Error(e(60));
      if (typeof iA != "object" || !("__html" in iA))
        throw Error(e(61));
      iA = iA.__html, iA != null && z.push(I("" + iA));
    }
  }
  function VA(z) {
    var iA = "";
    return A.Children.forEach(z, function(CA) {
      CA != null && (iA += CA);
    }), iA;
  }
  var le = r(' selected=""');
  function we(z, iA, CA, uA) {
    z.push(re(CA));
    var kA = CA = null, DA;
    for (DA in iA)
      if (C.call(iA, DA)) {
        var SA = iA[DA];
        if (SA != null)
          switch (DA) {
            case "children":
              CA = SA;
              break;
            case "dangerouslySetInnerHTML":
              kA = SA;
              break;
            default:
              RA(z, uA, DA, SA);
          }
      }
    return z.push(xA), ne(z, kA, CA), typeof CA == "string" ? (z.push(I(F(CA))), null) : CA;
  }
  var De = r(`
`), Ke = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/, ee = /* @__PURE__ */ new Map();
  function re(z) {
    var iA = ee.get(z);
    if (iA === void 0) {
      if (!Ke.test(z))
        throw Error(e(65, z));
      iA = r("<" + z), ee.set(z, iA);
    }
    return iA;
  }
  var wA = r("<!DOCTYPE html>");
  function WA(z, iA, CA, uA, kA) {
    switch (iA) {
      case "select":
        z.push(re("select"));
        var DA = null, SA = null;
        for (Et in CA)
          if (C.call(CA, Et)) {
            var te = CA[Et];
            if (te != null)
              switch (Et) {
                case "children":
                  DA = te;
                  break;
                case "dangerouslySetInnerHTML":
                  SA = te;
                  break;
                case "defaultValue":
                case "value":
                  break;
                default:
                  RA(z, uA, Et, te);
              }
          }
        return z.push(xA), ne(z, SA, DA), DA;
      case "option":
        SA = kA.selectedValue, z.push(re("option"));
        var Ge = te = null, ot = null, Et = null;
        for (DA in CA)
          if (C.call(CA, DA)) {
            var Wt = CA[DA];
            if (Wt != null)
              switch (DA) {
                case "children":
                  te = Wt;
                  break;
                case "selected":
                  ot = Wt;
                  break;
                case "dangerouslySetInnerHTML":
                  Et = Wt;
                  break;
                case "value":
                  Ge = Wt;
                default:
                  RA(z, uA, DA, Wt);
              }
          }
        if (SA != null)
          if (CA = Ge !== null ? "" + Ge : VA(te), J(SA)) {
            for (uA = 0; uA < SA.length; uA++)
              if ("" + SA[uA] === CA) {
                z.push(le);
                break;
              }
          } else
            "" + SA === CA && z.push(le);
        else
          ot && z.push(le);
        return z.push(xA), ne(z, Et, te), te;
      case "textarea":
        z.push(re("textarea")), Et = SA = DA = null;
        for (te in CA)
          if (C.call(CA, te) && (Ge = CA[te], Ge != null))
            switch (te) {
              case "children":
                Et = Ge;
                break;
              case "value":
                DA = Ge;
                break;
              case "defaultValue":
                SA = Ge;
                break;
              case "dangerouslySetInnerHTML":
                throw Error(e(91));
              default:
                RA(z, uA, te, Ge);
            }
        if (DA === null && SA !== null && (DA = SA), z.push(xA), Et != null) {
          if (DA != null)
            throw Error(e(92));
          if (J(Et) && 1 < Et.length)
            throw Error(e(93));
          DA = "" + Et;
        }
        return typeof DA == "string" && DA[0] === `
` && z.push(De), DA !== null && z.push(I(F("" + DA))), null;
      case "input":
        z.push(re("input")), Ge = Et = te = DA = null;
        for (SA in CA)
          if (C.call(CA, SA) && (ot = CA[SA], ot != null))
            switch (SA) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(e(399, "input"));
              case "defaultChecked":
                Ge = ot;
                break;
              case "defaultValue":
                te = ot;
                break;
              case "checked":
                Et = ot;
                break;
              case "value":
                DA = ot;
                break;
              default:
                RA(z, uA, SA, ot);
            }
        return Et !== null ? RA(
          z,
          uA,
          "checked",
          Et
        ) : Ge !== null && RA(z, uA, "checked", Ge), DA !== null ? RA(z, uA, "value", DA) : te !== null && RA(z, uA, "value", te), z.push(HA), null;
      case "menuitem":
        z.push(re("menuitem"));
        for (var Sg in CA)
          if (C.call(CA, Sg) && (DA = CA[Sg], DA != null))
            switch (Sg) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(e(400));
              default:
                RA(z, uA, Sg, DA);
            }
        return z.push(xA), null;
      case "title":
        z.push(re("title")), DA = null;
        for (Wt in CA)
          if (C.call(CA, Wt) && (SA = CA[Wt], SA != null))
            switch (Wt) {
              case "children":
                DA = SA;
                break;
              case "dangerouslySetInnerHTML":
                throw Error(e(434));
              default:
                RA(z, uA, Wt, SA);
            }
        return z.push(xA), DA;
      case "listing":
      case "pre":
        z.push(re(iA)), SA = DA = null;
        for (Ge in CA)
          if (C.call(CA, Ge) && (te = CA[Ge], te != null))
            switch (Ge) {
              case "children":
                DA = te;
                break;
              case "dangerouslySetInnerHTML":
                SA = te;
                break;
              default:
                RA(z, uA, Ge, te);
            }
        if (z.push(xA), SA != null) {
          if (DA != null)
            throw Error(e(60));
          if (typeof SA != "object" || !("__html" in SA))
            throw Error(e(61));
          CA = SA.__html, CA != null && (typeof CA == "string" && 0 < CA.length && CA[0] === `
` ? z.push(De, I(CA)) : z.push(I("" + CA)));
        }
        return typeof DA == "string" && DA[0] === `
` && z.push(De), DA;
      case "area":
      case "base":
      case "br":
      case "col":
      case "embed":
      case "hr":
      case "img":
      case "keygen":
      case "link":
      case "meta":
      case "param":
      case "source":
      case "track":
      case "wbr":
        z.push(re(iA));
        for (var bo in CA)
          if (C.call(CA, bo) && (DA = CA[bo], DA != null))
            switch (bo) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(e(399, iA));
              default:
                RA(z, uA, bo, DA);
            }
        return z.push(HA), null;
      case "annotation-xml":
      case "color-profile":
      case "font-face":
      case "font-face-src":
      case "font-face-uri":
      case "font-face-format":
      case "font-face-name":
      case "missing-glyph":
        return we(z, CA, iA, uA);
      case "html":
        return kA.insertionMode === 0 && z.push(wA), we(z, CA, iA, uA);
      default:
        if (iA.indexOf("-") === -1 && typeof CA.is != "string")
          return we(z, CA, iA, uA);
        z.push(re(iA)), SA = DA = null;
        for (ot in CA)
          if (C.call(CA, ot) && (te = CA[ot], te != null))
            switch (ot) {
              case "children":
                DA = te;
                break;
              case "dangerouslySetInnerHTML":
                SA = te;
                break;
              case "style":
                cA(z, uA, te);
                break;
              case "suppressContentEditableWarning":
              case "suppressHydrationWarning":
                break;
              default:
                E(ot) && typeof te != "function" && typeof te != "symbol" && z.push(aA, I(ot), QA, I(F(te)), hA);
            }
        return z.push(xA), ne(z, SA, DA), DA;
    }
  }
  var Pe = r("</"), je = r(">"), it = r('<template id="'), Li = r('"></template>'), zA = r("<!--$-->"), Qe = r('<!--$?--><template id="'), de = r('"></template>'), xe = r("<!--$!-->"), $e = r("<!--/$-->"), Pn = r("<template"), Zt = r('"'), Kn = r(' data-dgst="');
  r(' data-msg="'), r(' data-stck="');
  var po = r("></template>");
  function go(z, iA, CA) {
    if (n(z, Qe), CA === null)
      throw Error(e(395));
    return n(z, CA), o(z, de);
  }
  var CI = r('<div hidden id="'), Vl = r('">'), Bi = r("</div>"), Xl = r('<svg aria-hidden="true" style="display:none" id="'), jQ = r('">'), zl = r("</svg>"), Qa = r('<math aria-hidden="true" style="display:none" id="'), PQ = r('">'), Er = r("</math>"), $Q = r('<table hidden id="'), sh = r('">'), Ih = r("</table>"), M0 = r('<table hidden><tbody id="'), x0 = r('">'), Mg = r("</tbody></table>"), Je = r('<table hidden><tr id="'), L0 = r('">'), Tl = r("</tr></table>"), ah = r('<table hidden><colgroup id="'), _l = r('">'), ql = r("</colgroup></table>");
  function v0(z, iA, CA, uA) {
    switch (CA.insertionMode) {
      case 0:
      case 1:
        return n(z, CI), n(z, iA.segmentPrefix), n(z, I(uA.toString(16))), o(z, Vl);
      case 2:
        return n(z, Xl), n(z, iA.segmentPrefix), n(z, I(uA.toString(16))), o(z, jQ);
      case 3:
        return n(z, Qa), n(z, iA.segmentPrefix), n(z, I(uA.toString(16))), o(z, PQ);
      case 4:
        return n(z, $Q), n(z, iA.segmentPrefix), n(z, I(uA.toString(16))), o(z, sh);
      case 5:
        return n(z, M0), n(z, iA.segmentPrefix), n(z, I(uA.toString(16))), o(z, x0);
      case 6:
        return n(z, Je), n(z, iA.segmentPrefix), n(z, I(uA.toString(16))), o(z, L0);
      case 7:
        return n(
          z,
          ah
        ), n(z, iA.segmentPrefix), n(z, I(uA.toString(16))), o(z, _l);
      default:
        throw Error(e(397));
    }
  }
  function ms(z, iA) {
    switch (iA.insertionMode) {
      case 0:
      case 1:
        return o(z, Bi);
      case 2:
        return o(z, zl);
      case 3:
        return o(z, Er);
      case 4:
        return o(z, Ih);
      case 5:
        return o(z, Mg);
      case 6:
        return o(z, Tl);
      case 7:
        return o(z, ql);
      default:
        throw Error(e(397));
    }
  }
  var H0 = r('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'), rh = r('$RS("'), AE = r('","'), Ol = r('")<\/script>'), eE = r('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'), Ch = r('$RC("'), S0 = r('","'), jl = r('")<\/script>'), Bh = r('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'), zo = r('$RX("'), Z0 = r('"'), lh = r(")<\/script>"), ch = r(","), tE = /[<\u2028\u2029]/g;
  function ps(z) {
    return JSON.stringify(z).replace(tE, function(iA) {
      switch (iA) {
        case "<":
          return "\\u003c";
        case "\u2028":
          return "\\u2028";
        case "\u2029":
          return "\\u2029";
        default:
          throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React");
      }
    });
  }
  var ur = Object.assign, Qh = Symbol.for("react.element"), BI = Symbol.for("react.portal"), kt = Symbol.for("react.fragment"), fi = Symbol.for("react.strict_mode"), SC = Symbol.for("react.profiler"), Ea = Symbol.for("react.provider"), lI = Symbol.for("react.context"), iE = Symbol.for("react.forward_ref"), It = Symbol.for("react.suspense"), vi = Symbol.for("react.suspense_list"), X = Symbol.for("react.memo"), oA = Symbol.for("react.lazy"), BA = Symbol.for("react.scope"), dA = Symbol.for("react.debug_trace_mode"), GA = Symbol.for("react.legacy_hidden"), yA = Symbol.for("react.default_value"), YA = Symbol.iterator;
  function OA(z) {
    if (z == null)
      return null;
    if (typeof z == "function")
      return z.displayName || z.name || null;
    if (typeof z == "string")
      return z;
    switch (z) {
      case kt:
        return "Fragment";
      case BI:
        return "Portal";
      case SC:
        return "Profiler";
      case fi:
        return "StrictMode";
      case It:
        return "Suspense";
      case vi:
        return "SuspenseList";
    }
    if (typeof z == "object")
      switch (z.$$typeof) {
        case lI:
          return (z.displayName || "Context") + ".Consumer";
        case Ea:
          return (z._context.displayName || "Context") + ".Provider";
        case iE:
          var iA = z.render;
          return z = z.displayName, z || (z = iA.displayName || iA.name || "", z = z !== "" ? "ForwardRef(" + z + ")" : "ForwardRef"), z;
        case X:
          return iA = z.displayName || null, iA !== null ? iA : OA(z.type) || "Memo";
        case oA:
          iA = z._payload, z = z._init;
          try {
            return OA(z(iA));
          } catch {
          }
      }
    return null;
  }
  var Fe = {};
  function Ve(z, iA) {
    if (z = z.contextTypes, !z)
      return Fe;
    var CA = {}, uA;
    for (uA in z)
      CA[uA] = iA[uA];
    return CA;
  }
  var nt = null;
  function Ei(z, iA) {
    if (z !== iA) {
      z.context._currentValue = z.parentValue, z = z.parent;
      var CA = iA.parent;
      if (z === null) {
        if (CA !== null)
          throw Error(e(401));
      } else {
        if (CA === null)
          throw Error(e(401));
        Ei(z, CA);
      }
      iA.context._currentValue = iA.value;
    }
  }
  function xg(z) {
    z.context._currentValue = z.parentValue, z = z.parent, z !== null && xg(z);
  }
  function Lg(z) {
    var iA = z.parent;
    iA !== null && Lg(iA), z.context._currentValue = z.value;
  }
  function yo(z, iA) {
    if (z.context._currentValue = z.parentValue, z = z.parent, z === null)
      throw Error(e(402));
    z.depth === iA.depth ? Ei(z, iA) : yo(z, iA);
  }
  function dr(z, iA) {
    var CA = iA.parent;
    if (CA === null)
      throw Error(e(402));
    z.depth === CA.depth ? Ei(z, CA) : dr(z, CA), iA.context._currentValue = iA.value;
  }
  function cI(z) {
    var iA = nt;
    iA !== z && (iA === null ? Lg(z) : z === null ? xg(iA) : iA.depth === z.depth ? Ei(iA, z) : iA.depth > z.depth ? yo(iA, z) : dr(iA, z), nt = z);
  }
  var ZC = { isMounted: function() {
    return !1;
  }, enqueueSetState: function(z, iA) {
    z = z._reactInternals, z.queue !== null && z.queue.push(iA);
  }, enqueueReplaceState: function(z, iA) {
    z = z._reactInternals, z.replace = !0, z.queue = [iA];
  }, enqueueForceUpdate: function() {
  } };
  function WC(z, iA, CA, uA) {
    var kA = z.state !== void 0 ? z.state : null;
    z.updater = ZC, z.props = CA, z.state = kA;
    var DA = { queue: [], replace: !1 };
    z._reactInternals = DA;
    var SA = iA.contextType;
    if (z.context = typeof SA == "object" && SA !== null ? SA._currentValue : uA, SA = iA.getDerivedStateFromProps, typeof SA == "function" && (SA = SA(CA, kA), kA = SA == null ? kA : ur({}, kA, SA), z.state = kA), typeof iA.getDerivedStateFromProps != "function" && typeof z.getSnapshotBeforeUpdate != "function" && (typeof z.UNSAFE_componentWillMount == "function" || typeof z.componentWillMount == "function"))
      if (iA = z.state, typeof z.componentWillMount == "function" && z.componentWillMount(), typeof z.UNSAFE_componentWillMount == "function" && z.UNSAFE_componentWillMount(), iA !== z.state && ZC.enqueueReplaceState(z, z.state, null), DA.queue !== null && 0 < DA.queue.length)
        if (iA = DA.queue, SA = DA.replace, DA.queue = null, DA.replace = !1, SA && iA.length === 1)
          z.state = iA[0];
        else {
          for (DA = SA ? iA[0] : z.state, kA = !0, SA = SA ? 1 : 0; SA < iA.length; SA++) {
            var te = iA[SA];
            te = typeof te == "function" ? te.call(z, DA, CA, uA) : te, te != null && (kA ? (kA = !1, DA = ur({}, DA, te)) : ur(DA, te));
          }
          z.state = DA;
        }
      else
        DA.queue = null;
  }
  var nE = { id: 1, overflow: "" };
  function KC(z, iA, CA) {
    var uA = z.id;
    z = z.overflow;
    var kA = 32 - At(uA) - 1;
    uA &= ~(1 << kA), CA += 1;
    var DA = 32 - At(iA) + kA;
    if (30 < DA) {
      var SA = kA - kA % 5;
      return DA = (uA & (1 << SA) - 1).toString(32), uA >>= SA, kA -= SA, { id: 1 << 32 - At(iA) + kA | CA << kA | uA, overflow: DA + z };
    }
    return { id: 1 << DA | CA << kA | uA, overflow: z };
  }
  var At = Math.clz32 ? Math.clz32 : Y1, ua = Math.log, Ri = Math.LN2;
  function Y1(z) {
    return z >>>= 0, z === 0 ? 32 : 31 - (ua(z) / Ri | 0) | 0;
  }
  function vG(z, iA) {
    return z === iA && (z !== 0 || 1 / z === 1 / iA) || z !== z && iA !== iA;
  }
  var HG = typeof Object.is == "function" ? Object.is : vG, QI = null, hr = null, oE = null, ni = null, pn = !1, da = !1, gE = 0, mr = null, W0 = 0;
  function UC() {
    if (QI === null)
      throw Error(e(321));
    return QI;
  }
  function K0() {
    if (0 < W0)
      throw Error(e(312));
    return { memoizedState: null, queue: null, next: null };
  }
  function SG() {
    return ni === null ? oE === null ? (pn = !1, oE = ni = K0()) : (pn = !0, ni = oE) : ni.next === null ? (pn = !1, ni = ni.next = K0()) : (pn = !0, ni = ni.next), ni;
  }
  function U0() {
    hr = QI = null, da = !1, oE = null, W0 = 0, ni = mr = null;
  }
  function Mt(z, iA) {
    return typeof iA == "function" ? iA(z) : iA;
  }
  function R1(z, iA, CA) {
    if (QI = UC(), ni = SG(), pn) {
      var uA = ni.queue;
      if (iA = uA.dispatch, mr !== null && (CA = mr.get(uA), CA !== void 0)) {
        mr.delete(uA), uA = ni.memoizedState;
        do
          uA = z(uA, CA.action), CA = CA.next;
        while (CA !== null);
        return ni.memoizedState = uA, [uA, iA];
      }
      return [ni.memoizedState, iA];
    }
    return z = z === Mt ? typeof iA == "function" ? iA() : iA : CA !== void 0 ? CA(iA) : iA, ni.memoizedState = z, z = ni.queue = { last: null, dispatch: null }, z = z.dispatch = Eh.bind(null, QI, z), [ni.memoizedState, z];
  }
  function ys(z, iA) {
    if (QI = UC(), ni = SG(), iA = iA === void 0 ? null : iA, ni !== null) {
      var CA = ni.memoizedState;
      if (CA !== null && iA !== null) {
        var uA = CA[1];
        A:
          if (uA === null)
            uA = !1;
          else {
            for (var kA = 0; kA < uA.length && kA < iA.length; kA++)
              if (!HG(iA[kA], uA[kA])) {
                uA = !1;
                break A;
              }
            uA = !0;
          }
        if (uA)
          return CA[0];
      }
    }
    return z = z(), ni.memoizedState = [z, iA], z;
  }
  function Eh(z, iA, CA) {
    if (25 <= W0)
      throw Error(e(301));
    if (z === QI)
      if (da = !0, z = { action: CA, next: null }, mr === null && (mr = /* @__PURE__ */ new Map()), CA = mr.get(iA), CA === void 0)
        mr.set(iA, z);
      else {
        for (iA = CA; iA.next !== null; )
          iA = iA.next;
        iA.next = z;
      }
  }
  function F1() {
    throw Error(e(394));
  }
  function V0() {
  }
  var X0 = { readContext: function(z) {
    return z._currentValue;
  }, useContext: function(z) {
    return UC(), z._currentValue;
  }, useMemo: ys, useReducer: R1, useRef: function(z) {
    QI = UC(), ni = SG();
    var iA = ni.memoizedState;
    return iA === null ? (z = { current: z }, ni.memoizedState = z) : iA;
  }, useState: function(z) {
    return R1(Mt, z);
  }, useInsertionEffect: V0, useLayoutEffect: function() {
  }, useCallback: function(z, iA) {
    return ys(function() {
      return z;
    }, iA);
  }, useImperativeHandle: V0, useEffect: V0, useDebugValue: V0, useDeferredValue: function(z) {
    return UC(), z;
  }, useTransition: function() {
    return UC(), [!1, F1];
  }, useId: function() {
    var z = hr.treeContext, iA = z.overflow;
    z = z.id, z = (z & ~(1 << 32 - At(z) - 1)).toString(32) + iA;
    var CA = z0;
    if (CA === null)
      throw Error(e(404));
    return iA = gE++, z = ":" + CA.idPrefix + "R" + z, 0 < iA && (z += "H" + iA.toString(32)), z + ":";
  }, useMutableSource: function(z, iA) {
    return UC(), iA(z._source);
  }, useSyncExternalStore: function(z, iA, CA) {
    if (CA === void 0)
      throw Error(e(407));
    return CA();
  } }, z0 = null, T0 = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;
  function c9(z) {
    return console.error(z), null;
  }
  function uh() {
  }
  function ZG(z, iA, CA, uA, kA, DA, SA, te, Ge) {
    var ot = [], Et = /* @__PURE__ */ new Set();
    return iA = { destination: null, responseState: iA, progressiveChunkSize: uA === void 0 ? 12800 : uA, status: 0, fatalError: null, nextSegmentId: 0, allPendingTasks: 0, pendingRootTasks: 0, completedRootSegment: null, abortableTasks: Et, pingedTasks: ot, clientRenderedBoundaries: [], completedBoundaries: [], partialBoundaries: [], onError: kA === void 0 ? c9 : kA, onAllReady: DA === void 0 ? uh : DA, onShellReady: SA === void 0 ? uh : SA, onShellError: te === void 0 ? uh : te, onFatalError: Ge === void 0 ? uh : Ge }, CA = vg(iA, 0, null, CA, !1, !1), CA.parentFlushed = !0, z = WG(iA, z, null, CA, Et, Fe, null, nE), ot.push(z), iA;
  }
  function WG(z, iA, CA, uA, kA, DA, SA, te) {
    z.allPendingTasks++, CA === null ? z.pendingRootTasks++ : CA.pendingTasks++;
    var Ge = { node: iA, ping: function() {
      var ot = z.pingedTasks;
      ot.push(Ge), ot.length === 1 && XG(z);
    }, blockedBoundary: CA, blockedSegment: uA, abortSet: kA, legacyContext: DA, context: SA, treeContext: te };
    return kA.add(Ge), Ge;
  }
  function vg(z, iA, CA, uA, kA, DA) {
    return { status: 0, id: -1, index: iA, parentFlushed: !1, chunks: [], children: [], formatContext: uA, boundary: CA, lastPushedText: kA, textEmbedded: DA };
  }
  function dh(z, iA) {
    if (z = z.onError(iA), z != null && typeof z != "string")
      throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' + typeof z + '" instead');
    return z;
  }
  function hh(z, iA) {
    var CA = z.onShellError;
    CA(iA), CA = z.onFatalError, CA(iA), z.destination !== null ? (z.status = 2, a(z.destination, iA)) : (z.status = 1, z.fatalError = iA);
  }
  function pr(z, iA, CA, uA, kA) {
    for (QI = {}, hr = iA, gE = 0, z = CA(uA, kA); da; )
      da = !1, gE = 0, W0 += 1, ni = null, z = CA(uA, kA);
    return U0(), z;
  }
  function KG(z, iA, CA, uA) {
    var kA = CA.render(), DA = uA.childContextTypes;
    if (DA != null) {
      var SA = iA.legacyContext;
      if (typeof CA.getChildContext != "function")
        uA = SA;
      else {
        CA = CA.getChildContext();
        for (var te in CA)
          if (!(te in DA))
            throw Error(e(108, OA(uA) || "Unknown", te));
        uA = ur({}, SA, CA);
      }
      iA.legacyContext = uA, Hg(z, iA, kA), iA.legacyContext = SA;
    } else
      Hg(z, iA, kA);
  }
  function UG(z, iA) {
    if (z && z.defaultProps) {
      iA = ur({}, iA), z = z.defaultProps;
      for (var CA in z)
        iA[CA] === void 0 && (iA[CA] = z[CA]);
      return iA;
    }
    return iA;
  }
  function mh(z, iA, CA, uA, kA) {
    if (typeof CA == "function")
      if (CA.prototype && CA.prototype.isReactComponent) {
        kA = Ve(CA, iA.legacyContext);
        var DA = CA.contextType;
        DA = new CA(uA, typeof DA == "object" && DA !== null ? DA._currentValue : kA), WC(DA, CA, uA, kA), KG(z, iA, DA, CA);
      } else {
        DA = Ve(CA, iA.legacyContext), kA = pr(z, iA, CA, uA, DA);
        var SA = gE !== 0;
        if (typeof kA == "object" && kA !== null && typeof kA.render == "function" && kA.$$typeof === void 0)
          WC(kA, CA, uA, DA), KG(z, iA, kA, CA);
        else if (SA) {
          uA = iA.treeContext, iA.treeContext = KC(uA, 1, 0);
          try {
            Hg(z, iA, kA);
          } finally {
            iA.treeContext = uA;
          }
        } else
          Hg(z, iA, kA);
      }
    else if (typeof CA == "string") {
      switch (kA = iA.blockedSegment, DA = WA(kA.chunks, CA, uA, z.responseState, kA.formatContext), kA.lastPushedText = !1, SA = kA.formatContext, kA.formatContext = tA(SA, CA, uA), _0(z, iA, DA), kA.formatContext = SA, CA) {
        case "area":
        case "base":
        case "br":
        case "col":
        case "embed":
        case "hr":
        case "img":
        case "input":
        case "keygen":
        case "link":
        case "meta":
        case "param":
        case "source":
        case "track":
        case "wbr":
          break;
        default:
          kA.chunks.push(Pe, I(CA), je);
      }
      kA.lastPushedText = !1;
    } else {
      switch (CA) {
        case GA:
        case dA:
        case fi:
        case SC:
        case kt:
          Hg(z, iA, uA.children);
          return;
        case vi:
          Hg(z, iA, uA.children);
          return;
        case BA:
          throw Error(e(343));
        case It:
          A: {
            CA = iA.blockedBoundary, kA = iA.blockedSegment, DA = uA.fallback, uA = uA.children, SA = /* @__PURE__ */ new Set();
            var te = { id: null, rootSegmentID: -1, parentFlushed: !1, pendingTasks: 0, forceClientRender: !1, completedSegments: [], byteSize: 0, fallbackAbortableTasks: SA, errorDigest: null }, Ge = vg(z, kA.chunks.length, te, kA.formatContext, !1, !1);
            kA.children.push(Ge), kA.lastPushedText = !1;
            var ot = vg(z, 0, null, kA.formatContext, !1, !1);
            ot.parentFlushed = !0, iA.blockedBoundary = te, iA.blockedSegment = ot;
            try {
              if (_0(
                z,
                iA,
                uA
              ), ot.lastPushedText && ot.textEmbedded && ot.chunks.push(nA), ot.status = 1, sE(te, ot), te.pendingTasks === 0)
                break A;
            } catch (Et) {
              ot.status = 4, te.forceClientRender = !0, te.errorDigest = dh(z, Et);
            } finally {
              iA.blockedBoundary = CA, iA.blockedSegment = kA;
            }
            iA = WG(z, DA, CA, Ge, SA, iA.legacyContext, iA.context, iA.treeContext), z.pingedTasks.push(iA);
          }
          return;
      }
      if (typeof CA == "object" && CA !== null)
        switch (CA.$$typeof) {
          case iE:
            if (uA = pr(z, iA, CA.render, uA, kA), gE !== 0) {
              CA = iA.treeContext, iA.treeContext = KC(CA, 1, 0);
              try {
                Hg(z, iA, uA);
              } finally {
                iA.treeContext = CA;
              }
            } else
              Hg(z, iA, uA);
            return;
          case X:
            CA = CA.type, uA = UG(CA, uA), mh(z, iA, CA, uA, kA);
            return;
          case Ea:
            if (kA = uA.children, CA = CA._context, uA = uA.value, DA = CA._currentValue, CA._currentValue = uA, SA = nt, nt = uA = { parent: SA, depth: SA === null ? 0 : SA.depth + 1, context: CA, parentValue: DA, value: uA }, iA.context = uA, Hg(z, iA, kA), z = nt, z === null)
              throw Error(e(403));
            uA = z.parentValue, z.context._currentValue = uA === yA ? z.context._defaultValue : uA, z = nt = z.parent, iA.context = z;
            return;
          case lI:
            uA = uA.children, uA = uA(CA._currentValue), Hg(z, iA, uA);
            return;
          case oA:
            kA = CA._init, CA = kA(CA._payload), uA = UG(CA, uA), mh(z, iA, CA, uA, void 0);
            return;
        }
      throw Error(e(
        130,
        CA == null ? CA : typeof CA,
        ""
      ));
    }
  }
  function Hg(z, iA, CA) {
    if (iA.node = CA, typeof CA == "object" && CA !== null) {
      switch (CA.$$typeof) {
        case Qh:
          mh(z, iA, CA.type, CA.props, CA.ref);
          return;
        case BI:
          throw Error(e(257));
        case oA:
          var uA = CA._init;
          CA = uA(CA._payload), Hg(z, iA, CA);
          return;
      }
      if (J(CA)) {
        VG(z, iA, CA);
        return;
      }
      if (CA === null || typeof CA != "object" ? uA = null : (uA = YA && CA[YA] || CA["@@iterator"], uA = typeof uA == "function" ? uA : null), uA && (uA = uA.call(CA))) {
        if (CA = uA.next(), !CA.done) {
          var kA = [];
          do
            kA.push(CA.value), CA = uA.next();
          while (!CA.done);
          VG(z, iA, kA);
        }
        return;
      }
      throw z = Object.prototype.toString.call(CA), Error(e(31, z === "[object Object]" ? "object with keys {" + Object.keys(CA).join(", ") + "}" : z));
    }
    typeof CA == "string" ? (uA = iA.blockedSegment, uA.lastPushedText = AA(iA.blockedSegment.chunks, CA, z.responseState, uA.lastPushedText)) : typeof CA == "number" && (uA = iA.blockedSegment, uA.lastPushedText = AA(iA.blockedSegment.chunks, "" + CA, z.responseState, uA.lastPushedText));
  }
  function VG(z, iA, CA) {
    for (var uA = CA.length, kA = 0; kA < uA; kA++) {
      var DA = iA.treeContext;
      iA.treeContext = KC(DA, uA, kA);
      try {
        _0(z, iA, CA[kA]);
      } finally {
        iA.treeContext = DA;
      }
    }
  }
  function _0(z, iA, CA) {
    var uA = iA.blockedSegment.formatContext, kA = iA.legacyContext, DA = iA.context;
    try {
      return Hg(z, iA, CA);
    } catch (Ge) {
      if (U0(), typeof Ge == "object" && Ge !== null && typeof Ge.then == "function") {
        CA = Ge;
        var SA = iA.blockedSegment, te = vg(z, SA.chunks.length, null, SA.formatContext, SA.lastPushedText, !0);
        SA.children.push(te), SA.lastPushedText = !1, z = WG(z, iA.node, iA.blockedBoundary, te, iA.abortSet, iA.legacyContext, iA.context, iA.treeContext).ping, CA.then(z, z), iA.blockedSegment.formatContext = uA, iA.legacyContext = kA, iA.context = DA, cI(DA);
      } else
        throw iA.blockedSegment.formatContext = uA, iA.legacyContext = kA, iA.context = DA, cI(DA), Ge;
    }
  }
  function Q9(z) {
    var iA = z.blockedBoundary;
    z = z.blockedSegment, z.status = 3, x1(this, iA, z);
  }
  function M1(z, iA, CA) {
    var uA = z.blockedBoundary;
    z.blockedSegment.status = 3, uA === null ? (iA.allPendingTasks--, iA.status !== 2 && (iA.status = 2, iA.destination !== null && iA.destination.close())) : (uA.pendingTasks--, uA.forceClientRender || (uA.forceClientRender = !0, z = CA === void 0 ? Error(e(432)) : CA, uA.errorDigest = iA.onError(z), uA.parentFlushed && iA.clientRenderedBoundaries.push(uA)), uA.fallbackAbortableTasks.forEach(function(kA) {
      return M1(kA, iA, CA);
    }), uA.fallbackAbortableTasks.clear(), iA.allPendingTasks--, iA.allPendingTasks === 0 && (uA = iA.onAllReady, uA()));
  }
  function sE(z, iA) {
    if (iA.chunks.length === 0 && iA.children.length === 1 && iA.children[0].boundary === null) {
      var CA = iA.children[0];
      CA.id = iA.id, CA.parentFlushed = !0, CA.status === 1 && sE(z, CA);
    } else
      z.completedSegments.push(iA);
  }
  function x1(z, iA, CA) {
    if (iA === null) {
      if (CA.parentFlushed) {
        if (z.completedRootSegment !== null)
          throw Error(e(389));
        z.completedRootSegment = CA;
      }
      z.pendingRootTasks--, z.pendingRootTasks === 0 && (z.onShellError = uh, iA = z.onShellReady, iA());
    } else
      iA.pendingTasks--, iA.forceClientRender || (iA.pendingTasks === 0 ? (CA.parentFlushed && CA.status === 1 && sE(iA, CA), iA.parentFlushed && z.completedBoundaries.push(iA), iA.fallbackAbortableTasks.forEach(Q9, z), iA.fallbackAbortableTasks.clear()) : CA.parentFlushed && CA.status === 1 && (sE(iA, CA), iA.completedSegments.length === 1 && iA.parentFlushed && z.partialBoundaries.push(iA)));
    z.allPendingTasks--, z.allPendingTasks === 0 && (z = z.onAllReady, z());
  }
  function XG(z) {
    if (z.status !== 2) {
      var iA = nt, CA = T0.current;
      T0.current = X0;
      var uA = z0;
      z0 = z.responseState;
      try {
        var kA = z.pingedTasks, DA;
        for (DA = 0; DA < kA.length; DA++) {
          var SA = kA[DA], te = z, Ge = SA.blockedSegment;
          if (Ge.status === 0) {
            cI(SA.context);
            try {
              Hg(te, SA, SA.node), Ge.lastPushedText && Ge.textEmbedded && Ge.chunks.push(nA), SA.abortSet.delete(SA), Ge.status = 1, x1(te, SA.blockedBoundary, Ge);
            } catch (EI) {
              if (U0(), typeof EI == "object" && EI !== null && typeof EI.then == "function") {
                var ot = SA.ping;
                EI.then(ot, ot);
              } else {
                SA.abortSet.delete(SA), Ge.status = 4;
                var Et = SA.blockedBoundary, Wt = EI, Sg = dh(te, Wt);
                if (Et === null ? hh(te, Wt) : (Et.pendingTasks--, Et.forceClientRender || (Et.forceClientRender = !0, Et.errorDigest = Sg, Et.parentFlushed && te.clientRenderedBoundaries.push(Et))), te.allPendingTasks--, te.allPendingTasks === 0) {
                  var bo = te.onAllReady;
                  bo();
                }
              }
            } finally {
            }
          }
        }
        kA.splice(0, DA), z.destination !== null && rg(z, z.destination);
      } catch (EI) {
        dh(z, EI), hh(z, EI);
      } finally {
        z0 = uA, T0.current = CA, CA === X0 && cI(iA);
      }
    }
  }
  function ph(z, iA, CA) {
    switch (CA.parentFlushed = !0, CA.status) {
      case 0:
        var uA = CA.id = z.nextSegmentId++;
        return CA.lastPushedText = !1, CA.textEmbedded = !1, z = z.responseState, n(iA, it), n(iA, z.placeholderPrefix), z = I(uA.toString(16)), n(iA, z), o(iA, Li);
      case 1:
        CA.status = 2;
        var kA = !0;
        uA = CA.chunks;
        var DA = 0;
        CA = CA.children;
        for (var SA = 0; SA < CA.length; SA++) {
          for (kA = CA[SA]; DA < kA.index; DA++)
            n(iA, uA[DA]);
          kA = Pl(z, iA, kA);
        }
        for (; DA < uA.length - 1; DA++)
          n(iA, uA[DA]);
        return DA < uA.length && (kA = o(iA, uA[DA])), kA;
      default:
        throw Error(e(390));
    }
  }
  function Pl(z, iA, CA) {
    var uA = CA.boundary;
    if (uA === null)
      return ph(z, iA, CA);
    if (uA.parentFlushed = !0, uA.forceClientRender)
      uA = uA.errorDigest, o(iA, xe), n(iA, Pn), uA && (n(iA, Kn), n(iA, I(F(uA))), n(iA, Zt)), o(iA, po), ph(z, iA, CA);
    else if (0 < uA.pendingTasks) {
      uA.rootSegmentID = z.nextSegmentId++, 0 < uA.completedSegments.length && z.partialBoundaries.push(uA);
      var kA = z.responseState, DA = kA.nextSuspenseID++;
      kA = r(kA.boundaryPrefix + DA.toString(16)), uA = uA.id = kA, go(iA, z.responseState, uA), ph(z, iA, CA);
    } else if (uA.byteSize > z.progressiveChunkSize)
      uA.rootSegmentID = z.nextSegmentId++, z.completedBoundaries.push(uA), go(iA, z.responseState, uA.id), ph(z, iA, CA);
    else {
      if (o(iA, zA), CA = uA.completedSegments, CA.length !== 1)
        throw Error(e(391));
      Pl(z, iA, CA[0]);
    }
    return o(iA, $e);
  }
  function VC(z, iA, CA) {
    return v0(iA, z.responseState, CA.formatContext, CA.id), Pl(z, iA, CA), ms(iA, CA.formatContext);
  }
  function L1(z, iA, CA) {
    for (var uA = CA.completedSegments, kA = 0; kA < uA.length; kA++)
      IE(z, iA, CA, uA[kA]);
    if (uA.length = 0, z = z.responseState, uA = CA.id, CA = CA.rootSegmentID, n(iA, z.startInlineScript), z.sentCompleteBoundaryFunction ? n(iA, Ch) : (z.sentCompleteBoundaryFunction = !0, n(iA, eE)), uA === null)
      throw Error(e(395));
    return CA = I(CA.toString(16)), n(iA, uA), n(iA, S0), n(iA, z.segmentPrefix), n(iA, CA), o(iA, jl);
  }
  function IE(z, iA, CA, uA) {
    if (uA.status === 2)
      return !0;
    var kA = uA.id;
    if (kA === -1) {
      if ((uA.id = CA.rootSegmentID) === -1)
        throw Error(e(392));
      return VC(z, iA, uA);
    }
    return VC(z, iA, uA), z = z.responseState, n(iA, z.startInlineScript), z.sentCompleteSegmentFunction ? n(iA, rh) : (z.sentCompleteSegmentFunction = !0, n(iA, H0)), n(iA, z.segmentPrefix), kA = I(kA.toString(16)), n(iA, kA), n(iA, AE), n(iA, z.placeholderPrefix), n(iA, kA), o(iA, Ol);
  }
  function rg(z, iA) {
    t = new Uint8Array(512), i = 0;
    try {
      var CA = z.completedRootSegment;
      if (CA !== null && z.pendingRootTasks === 0) {
        Pl(z, iA, CA), z.completedRootSegment = null;
        var uA = z.responseState.bootstrapChunks;
        for (CA = 0; CA < uA.length - 1; CA++)
          n(iA, uA[CA]);
        CA < uA.length && o(iA, uA[CA]);
      }
      var kA = z.clientRenderedBoundaries, DA;
      for (DA = 0; DA < kA.length; DA++) {
        var SA = kA[DA];
        uA = iA;
        var te = z.responseState, Ge = SA.id, ot = SA.errorDigest, Et = SA.errorMessage, Wt = SA.errorComponentStack;
        if (n(uA, te.startInlineScript), te.sentClientRenderFunction ? n(uA, zo) : (te.sentClientRenderFunction = !0, n(
          uA,
          Bh
        )), Ge === null)
          throw Error(e(395));
        n(uA, Ge), n(uA, Z0), (ot || Et || Wt) && (n(uA, ch), n(uA, I(ps(ot || "")))), (Et || Wt) && (n(uA, ch), n(uA, I(ps(Et || "")))), Wt && (n(uA, ch), n(uA, I(ps(Wt)))), o(uA, lh);
      }
      kA.splice(0, DA);
      var Sg = z.completedBoundaries;
      for (DA = 0; DA < Sg.length; DA++)
        L1(z, iA, Sg[DA]);
      Sg.splice(0, DA), g(iA), t = new Uint8Array(512), i = 0;
      var bo = z.partialBoundaries;
      for (DA = 0; DA < bo.length; DA++) {
        var EI = bo[DA];
        A: {
          kA = z, SA = iA;
          var XC = EI.completedSegments;
          for (te = 0; te < XC.length; te++)
            if (!IE(
              kA,
              SA,
              EI,
              XC[te]
            )) {
              te++, XC.splice(0, te);
              var TG = !1;
              break A;
            }
          XC.splice(0, te), TG = !0;
        }
        if (!TG) {
          z.destination = null, DA++, bo.splice(0, DA);
          return;
        }
      }
      bo.splice(0, DA);
      var aE = z.completedBoundaries;
      for (DA = 0; DA < aE.length; DA++)
        L1(z, iA, aE[DA]);
      aE.splice(0, DA);
    } finally {
      g(iA), z.allPendingTasks === 0 && z.pingedTasks.length === 0 && z.clientRenderedBoundaries.length === 0 && z.completedBoundaries.length === 0 && iA.close();
    }
  }
  function zG(z, iA) {
    try {
      var CA = z.abortableTasks;
      CA.forEach(function(uA) {
        return M1(uA, z, iA);
      }), CA.clear(), z.destination !== null && rg(z, z.destination);
    } catch (uA) {
      dh(z, uA), hh(z, uA);
    }
  }
  return Wx.renderToReadableStream = function(z, iA) {
    return new Promise(function(CA, uA) {
      var kA, DA, SA = new Promise(function(Et, Wt) {
        DA = Et, kA = Wt;
      }), te = ZG(z, O(iA ? iA.identifierPrefix : void 0, iA ? iA.nonce : void 0, iA ? iA.bootstrapScriptContent : void 0, iA ? iA.bootstrapScripts : void 0, iA ? iA.bootstrapModules : void 0), _(iA ? iA.namespaceURI : void 0), iA ? iA.progressiveChunkSize : void 0, iA ? iA.onError : void 0, DA, function() {
        var Et = new ReadableStream({ type: "bytes", pull: function(Wt) {
          if (te.status === 1)
            te.status = 2, a(Wt, te.fatalError);
          else if (te.status !== 2 && te.destination === null) {
            te.destination = Wt;
            try {
              rg(te, Wt);
            } catch (Sg) {
              dh(te, Sg), hh(te, Sg);
            }
          }
        }, cancel: function() {
          zG(te);
        } }, { highWaterMark: 0 });
        Et.allReady = SA, CA(Et);
      }, function(Et) {
        SA.catch(function() {
        }), uA(Et);
      }, kA);
      if (iA && iA.signal) {
        var Ge = iA.signal, ot = function() {
          zG(te, Ge.reason), Ge.removeEventListener("abort", ot);
        };
        Ge.addEventListener("abort", ot);
      }
      XG(te);
    });
  }, Wx.version = "18.2.0", Wx;
}
var bG, l5A;
bG = c0t(), l5A = Q0t();
bG.version;
var E0t = bG.renderToString;
bG.renderToStaticMarkup;
bG.renderToNodeStream;
bG.renderToStaticNodeStream;
l5A.renderToReadableStream;
var u0t = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function c5A(A, e) {
  return A(e = { exports: {} }, e.exports), e.exports;
}
var d0t = c5A(function(A) {
  (function(e) {
    var t = function(d, m, y) {
      if (!I(m) || a(m) || C(m) || B(m) || s(m))
        return m;
      var f, w = 0, G = 0;
      if (r(m))
        for (f = [], G = m.length; w < G; w++)
          f.push(t(d, m[w], y));
      else
        for (var R in f = {}, m)
          Object.prototype.hasOwnProperty.call(m, R) && (f[d(R, y)] = t(d, m[R], y));
      return f;
    }, i = function(d) {
      return l(d) ? d : (d = d.replace(/[\-_\s]+(.)?/g, function(m, y) {
        return y ? y.toUpperCase() : "";
      })).substr(0, 1).toLowerCase() + d.substr(1);
    }, n = function(d) {
      var m = i(d);
      return m.substr(0, 1).toUpperCase() + m.substr(1);
    }, o = function(d, m) {
      return function(y, f) {
        var w = (f = f || {}).separator || "_", G = f.split || /(?=[A-Z])/;
        return y.split(G).join(w);
      }(d, m).toLowerCase();
    }, g = Object.prototype.toString, s = function(d) {
      return typeof d == "function";
    }, I = function(d) {
      return d === Object(d);
    }, r = function(d) {
      return g.call(d) == "[object Array]";
    }, a = function(d) {
      return g.call(d) == "[object Date]";
    }, C = function(d) {
      return g.call(d) == "[object RegExp]";
    }, B = function(d) {
      return g.call(d) == "[object Boolean]";
    }, l = function(d) {
      return (d -= 0) == d;
    }, Q = function(d, m) {
      var y = m && "process" in m ? m.process : m;
      return typeof y != "function" ? d : function(f, w) {
        return y(f, d, w);
      };
    }, E = { camelize: i, decamelize: o, pascalize: n, depascalize: o, camelizeKeys: function(d, m) {
      return t(Q(i, m), d);
    }, decamelizeKeys: function(d, m) {
      return t(Q(o, m), d, m);
    }, pascalizeKeys: function(d, m) {
      return t(Q(n, m), d);
    }, depascalizeKeys: function() {
      return this.decamelizeKeys.apply(this, arguments);
    } };
    A.exports ? A.exports = E : e.humps = E;
  })(u0t);
}).decamelize, h0t = function(A) {
  if (Array.isArray(A))
    return A;
}, m0t = function(A, e) {
  if (typeof Symbol < "u" && Symbol.iterator in Object(A)) {
    var t = [], i = !0, n = !1, o = void 0;
    try {
      for (var g, s = A[Symbol.iterator](); !(i = (g = s.next()).done) && (t.push(g.value), !e || t.length !== e); i = !0)
        ;
    } catch (I) {
      n = !0, o = I;
    } finally {
      try {
        i || s.return == null || s.return();
      } finally {
        if (n)
          throw o;
      }
    }
    return t;
  }
}, CyA = function(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}, p0t = function(A, e) {
  if (A) {
    if (typeof A == "string")
      return CyA(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    return t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set" ? Array.from(A) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? CyA(A, e) : void 0;
  }
}, y0t = function() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}, b0t = function(A, e) {
  return h0t(A) || m0t(A, e) || p0t(A, e) || y0t();
}, Q5A = c5A(function(A) {
  function e() {
    return A.exports = e = Object.assign || function(t) {
      for (var i = 1; i < arguments.length; i++) {
        var n = arguments[i];
        for (var o in n)
          Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
      }
      return t;
    }, e.apply(this, arguments);
  }
  A.exports = e;
}), w0t = function(A, e) {
  if (A == null)
    return {};
  var t, i, n = {}, o = Object.keys(A);
  for (i = 0; i < o.length; i++)
    t = o[i], e.indexOf(t) >= 0 || (n[t] = A[t]);
  return n;
}, E5A = function(A, e) {
  if (A == null)
    return {};
  var t, i, n = w0t(A, e);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(A);
    for (i = 0; i < o.length; i++)
      t = o[i], e.indexOf(t) >= 0 || Object.prototype.propertyIsEnumerable.call(A, t) && (n[t] = A[t]);
  }
  return n;
}, f0t = u.createContext(null);
function I6(A) {
  var e = A.children, t = E5A(A, ["children"]);
  return typeof e != "string" && (e = E0t(e)), b.createElement("template", Q5A({}, t, { dangerouslySetInnerHTML: { __html: e } }));
}
function a6(A) {
  var e = A.root, t = A.children;
  return Jt.createPortal(t, e);
}
function D0t(A) {
  var e = u.forwardRef(function(t, i) {
    var n, o, g = t.mode, s = t.delegatesFocus, I = t.styleSheets, r = t.ssr, a = t.children, C = E5A(t, ["mode", "delegatesFocus", "styleSheets", "ssr", "children"]), B = (o = u.useRef((n = i) && n.current), u.useEffect(function() {
      n && (n.current = o.current);
    }, [n]), o), l = u.useState(null), Q = b0t(l, 2), E = Q[0], d = Q[1], m = "node_".concat(g).concat(s);
    return u.useLayoutEffect(function() {
      if (B.current)
        try {
          if (typeof i == "function" && i(B.current), r) {
            var y = B.current.shadowRoot;
            return void d(y);
          }
          var f = B.current.attachShadow({ mode: g, delegatesFocus: s });
          I.length > 0 && (f.adoptedStyleSheets = I), d(f);
        } catch (w) {
          (function(G) {
            var R = G.error, F = G.styleSheets, Z = G.root;
            switch (R.name) {
              case "NotSupportedError":
                F.length > 0 && (Z.adoptedStyleSheets = F);
                break;
              default:
                throw R;
            }
          })({ error: w, styleSheets: I, root: E });
        }
    }, [i, B, I]), b.createElement(b.Fragment, null, b.createElement(A.tag, Q5A({ key: m, ref: B }, C), (E || r) && b.createElement(f0t.Provider, { value: E }, r ? b.createElement(I6, { shadowroot: g, shadowrootmode: g }, A.render({ root: E, ssr: r, children: a })) : b.createElement(a6, { root: E }, A.render({ root: E, ssr: r, children: a })))));
  });
  return e.propTypes = { mode: KA.oneOf(["open", "closed"]), delegatesFocus: KA.bool, styleSheets: KA.arrayOf(KA.instanceOf(globalThis.CSSStyleSheet)), ssr: KA.bool, children: KA.node }, e.defaultProps = { mode: "open", delegatesFocus: !1, styleSheets: [], ssr: !1, children: null }, e;
}
I6.propTypes = { children: KA.oneOfType([KA.string, KA.node]) }, I6.defaultProps = { children: "" }, a6.propTypes = { root: KA.object.isRequired, children: KA.node }, a6.defaultProps = { children: null };
var A_ = /* @__PURE__ */ new Map();
function G0t() {
  var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "core", t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(i) {
    return i.children;
  };
  return new Proxy(A, { get: function(i, n) {
    var o = d0t(n, { separator: "-" }), g = "".concat(e, "-").concat(o);
    return A_.has(g) || A_.set(g, D0t({ tag: o, render: t })), A_.get(g);
  } });
}
var k0t = G0t();
const J0t = `*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-inset-1{top:-.25rem;right:-.25rem;bottom:-.25rem;left:-.25rem}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-x-2{left:.5rem;right:.5rem}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-\\[5px\\]{bottom:5px}.left-0{left:0}.left-2{left:.5rem}.left-32{left:8rem}.left-\\[50\\%\\]{left:50%}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-5{right:1.25rem}.right-\\[7px\\]{right:7px}.top-0{top:0}.top-2{top:.5rem}.top-4{top:1rem}.top-5{top:1.25rem}.top-8{top:2rem}.top-\\[50\\%\\]{top:50%}.top-full{top:100%}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.col-span-1{grid-column:span 1 / span 1}.col-span-3{grid-column:span 3 / span 3}.float-right{float:right}.m-0{margin:0}.m-0\\.5{margin:.125rem}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-4{margin:1rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-px{margin-left:-1px;margin-right:-1px}.mx-0{margin-left:0;margin-right:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-top:0;margin-bottom:0}.my-0\\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\\.5{margin-top:.375rem;margin-bottom:.375rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.-mb-px{margin-bottom:-1px}.-mr-1{margin-right:-.25rem}.-mt-px{margin-top:-1px}.mb-1{margin-bottom:.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-0{margin-left:0}.ml-0\\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-0{margin-right:0}.mr-0\\.5{margin-right:.125rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.box-border{box-sizing:border-box}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.\\!h-8{height:2rem!important}.h-0{height:0px}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-5\\/6{height:83.333333%}.h-6{height:1.5rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-\\[11px\\]{height:11px}.h-\\[18px\\]{height:18px}.h-\\[1px\\]{height:1px}.h-\\[30px\\]{height:30px}.h-\\[34px\\]{height:34px}.h-\\[600px\\]{height:600px}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-min{height:min-content}.h-px{height:1px}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\\[300px\\]{max-height:300px}.max-h-\\[380px\\]{max-height:380px}.max-h-\\[calc\\(min\\(800px\\,90vh\\)\\)\\]{max-height:min(800px,90vh)}.max-h-screen{max-height:100vh}.min-h-\\[100px\\]{min-height:100px}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[36px\\]{min-height:36px}.min-h-\\[512px\\]{min-height:512px}.min-h-\\[60px\\]{min-height:60px}.\\!w-fit{width:-moz-fit-content!important;width:fit-content!important}.w-0{width:0px}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\\[11px\\]{width:11px}.w-\\[18px\\]{width:18px}.w-\\[1px\\]{width:1px}.w-\\[400px\\]{width:400px}.w-\\[98\\%\\]{width:98%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-\\[0px\\]{min-width:0px}.min-w-\\[100\\%\\]{min-width:100%}.min-w-\\[600px\\]{min-width:600px}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.max-w-\\[100vw\\]{max-width:100vw}.max-w-\\[160px\\]{max-width:160px}.max-w-\\[16rem\\]{max-width:16rem}.max-w-\\[180px\\]{max-width:180px}.max-w-\\[240px\\]{max-width:240px}.max-w-\\[360px\\]{max-width:360px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.flex-grow-0{flex-grow:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.border-collapse{border-collapse:collapse}.origin-top-left{transform-origin:top left}.-translate-x-1{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-\\[67\\%\\]{--tw-scale-x: 67%;--tw-scale-y: 67%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.\\!cursor-none{cursor:none!important}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-none{cursor:none}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-0{column-gap:0px}.gap-x-0\\.5{column-gap:.125rem}.gap-x-6{column-gap:1.5rem}.gap-y-2{row-gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){border-color:hsl(var(--border))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-visible{overflow-y:visible}.overflow-y-scroll{overflow-y:scroll}.overscroll-none{overscroll-behavior:none}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-tl-none{border-top-left-radius:0}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-x{border-left-width:1px;border-right-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-2{border-top-width:2px}.border-t-4{border-top-width:4px}.\\!border-none{border-style:none!important}.border-border{border-color:hsl(var(--border))}.border-dimension{border-color:hsl(var(--dimension))}.border-input{border-color:hsl(var(--input))}.border-measure{border-color:hsl(var(--measure))}.border-primary{border-color:hsl(var(--primary))}.border-primary\\/50{border-color:hsl(var(--primary) / .5)}.border-transparent{border-color:transparent}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity))}.\\!bg-transparent{background-color:transparent!important}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/10{background-color:#0000001a}.bg-black\\/80{background-color:#000c}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-dimension\\/20{background-color:hsl(var(--dimension) / .2)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity))}.bg-measure\\/20{background-color:hsl(var(--measure) / .2)}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-popover\\/30{background-color:hsl(var(--popover) / .3)}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\\/20{background-color:hsl(var(--primary) / .2)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sky-100{--tw-bg-opacity: 1;background-color:rgb(224 242 254 / var(--tw-bg-opacity))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.fill-primary{fill:hsl(var(--primary))}.stroke-current{stroke:currentColor}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-0{padding-bottom:0}.pb-0\\.5{padding-bottom:.125rem}.pb-12{padding-bottom:3rem}.pb-2{padding-bottom:.5rem}.pl-0{padding-left:0}.pl-10{padding-left:2.5rem}.pl-14{padding-left:3.5rem}.pl-16{padding-left:4rem}.pl-2{padding-left:.5rem}.pl-2\\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\\.5{padding-right:.625rem}.pr-24{padding-right:6rem}.pr-4{padding-right:1rem}.pr-8{padding-right:2rem}.pr-\\[88px\\]{padding-right:88px}.pt-0{padding-top:0}.pt-0\\.5{padding-top:.125rem}.pt-10{padding-top:2.5rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-start{text-align:start}.align-top{vertical-align:top}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:1.5rem}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.text-amber-500\\/0{color:#f59e0b00}.text-amber-500\\/10{color:#f59e0b1a}.text-amber-500\\/100{color:#f59e0b}.text-amber-500\\/20{color:#f59e0b33}.text-amber-500\\/25{color:#f59e0b40}.text-amber-500\\/30{color:#f59e0b4d}.text-amber-500\\/40{color:#f59e0b66}.text-amber-500\\/5{color:#f59e0b0d}.text-amber-500\\/50{color:#f59e0b80}.text-amber-500\\/60{color:#f59e0b99}.text-amber-500\\/70{color:#f59e0bb3}.text-amber-500\\/75{color:#f59e0bbf}.text-amber-500\\/80{color:#f59e0bcc}.text-amber-500\\/90{color:#f59e0be6}.text-amber-500\\/95{color:#f59e0bf2}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-500\\/0{color:#3b82f600}.text-blue-500\\/10{color:#3b82f61a}.text-blue-500\\/100{color:#3b82f6}.text-blue-500\\/20{color:#3b82f633}.text-blue-500\\/25{color:#3b82f640}.text-blue-500\\/30{color:#3b82f64d}.text-blue-500\\/40{color:#3b82f666}.text-blue-500\\/5{color:#3b82f60d}.text-blue-500\\/50{color:#3b82f680}.text-blue-500\\/60{color:#3b82f699}.text-blue-500\\/70{color:#3b82f6b3}.text-blue-500\\/75{color:#3b82f6bf}.text-blue-500\\/80{color:#3b82f6cc}.text-blue-500\\/90{color:#3b82f6e6}.text-blue-500\\/95{color:#3b82f6f2}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-500{--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity))}.text-cyan-500\\/0{color:#06b6d400}.text-cyan-500\\/10{color:#06b6d41a}.text-cyan-500\\/100{color:#06b6d4}.text-cyan-500\\/20{color:#06b6d433}.text-cyan-500\\/25{color:#06b6d440}.text-cyan-500\\/30{color:#06b6d44d}.text-cyan-500\\/40{color:#06b6d466}.text-cyan-500\\/5{color:#06b6d40d}.text-cyan-500\\/50{color:#06b6d480}.text-cyan-500\\/60{color:#06b6d499}.text-cyan-500\\/70{color:#06b6d4b3}.text-cyan-500\\/75{color:#06b6d4bf}.text-cyan-500\\/80{color:#06b6d4cc}.text-cyan-500\\/90{color:#06b6d4e6}.text-cyan-500\\/95{color:#06b6d4f2}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-dimension{color:hsl(var(--dimension))}.text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity))}.text-emerald-500\\/0{color:#10b98100}.text-emerald-500\\/10{color:#10b9811a}.text-emerald-500\\/100{color:#10b981}.text-emerald-500\\/20{color:#10b98133}.text-emerald-500\\/25{color:#10b98140}.text-emerald-500\\/30{color:#10b9814d}.text-emerald-500\\/40{color:#10b98166}.text-emerald-500\\/5{color:#10b9810d}.text-emerald-500\\/50{color:#10b98180}.text-emerald-500\\/60{color:#10b98199}.text-emerald-500\\/70{color:#10b981b3}.text-emerald-500\\/75{color:#10b981bf}.text-emerald-500\\/80{color:#10b981cc}.text-emerald-500\\/90{color:#10b981e6}.text-emerald-500\\/95{color:#10b981f2}.text-foreground{color:hsl(var(--foreground))}.text-fuchsia-500{--tw-text-opacity: 1;color:rgb(217 70 239 / var(--tw-text-opacity))}.text-fuchsia-500\\/0{color:#d946ef00}.text-fuchsia-500\\/10{color:#d946ef1a}.text-fuchsia-500\\/100{color:#d946ef}.text-fuchsia-500\\/20{color:#d946ef33}.text-fuchsia-500\\/25{color:#d946ef40}.text-fuchsia-500\\/30{color:#d946ef4d}.text-fuchsia-500\\/40{color:#d946ef66}.text-fuchsia-500\\/5{color:#d946ef0d}.text-fuchsia-500\\/50{color:#d946ef80}.text-fuchsia-500\\/60{color:#d946ef99}.text-fuchsia-500\\/70{color:#d946efb3}.text-fuchsia-500\\/75{color:#d946efbf}.text-fuchsia-500\\/80{color:#d946efcc}.text-fuchsia-500\\/90{color:#d946efe6}.text-fuchsia-500\\/95{color:#d946eff2}.text-fuchsia-700{--tw-text-opacity: 1;color:rgb(162 28 175 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-500\\/0{color:#6b728000}.text-gray-500\\/10{color:#6b72801a}.text-gray-500\\/100{color:#6b7280}.text-gray-500\\/20{color:#6b728033}.text-gray-500\\/25{color:#6b728040}.text-gray-500\\/30{color:#6b72804d}.text-gray-500\\/40{color:#6b728066}.text-gray-500\\/5{color:#6b72800d}.text-gray-500\\/50{color:#6b728080}.text-gray-500\\/60{color:#6b728099}.text-gray-500\\/70{color:#6b7280b3}.text-gray-500\\/75{color:#6b7280bf}.text-gray-500\\/80{color:#6b7280cc}.text-gray-500\\/90{color:#6b7280e6}.text-gray-500\\/95{color:#6b7280f2}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-green-500\\/0{color:#22c55e00}.text-green-500\\/10{color:#22c55e1a}.text-green-500\\/100{color:#22c55e}.text-green-500\\/20{color:#22c55e33}.text-green-500\\/25{color:#22c55e40}.text-green-500\\/30{color:#22c55e4d}.text-green-500\\/40{color:#22c55e66}.text-green-500\\/5{color:#22c55e0d}.text-green-500\\/50{color:#22c55e80}.text-green-500\\/60{color:#22c55e99}.text-green-500\\/70{color:#22c55eb3}.text-green-500\\/75{color:#22c55ebf}.text-green-500\\/80{color:#22c55ecc}.text-green-500\\/90{color:#22c55ee6}.text-green-500\\/95{color:#22c55ef2}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity))}.text-indigo-500\\/0{color:#6366f100}.text-indigo-500\\/10{color:#6366f11a}.text-indigo-500\\/100{color:#6366f1}.text-indigo-500\\/20{color:#6366f133}.text-indigo-500\\/25{color:#6366f140}.text-indigo-500\\/30{color:#6366f14d}.text-indigo-500\\/40{color:#6366f166}.text-indigo-500\\/5{color:#6366f10d}.text-indigo-500\\/50{color:#6366f180}.text-indigo-500\\/60{color:#6366f199}.text-indigo-500\\/70{color:#6366f1b3}.text-indigo-500\\/75{color:#6366f1bf}.text-indigo-500\\/80{color:#6366f1cc}.text-indigo-500\\/90{color:#6366f1e6}.text-indigo-500\\/95{color:#6366f1f2}.text-indigo-800{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity))}.text-lime-500{--tw-text-opacity: 1;color:rgb(132 204 22 / var(--tw-text-opacity))}.text-lime-500\\/0{color:#84cc1600}.text-lime-500\\/10{color:#84cc161a}.text-lime-500\\/100{color:#84cc16}.text-lime-500\\/20{color:#84cc1633}.text-lime-500\\/25{color:#84cc1640}.text-lime-500\\/30{color:#84cc164d}.text-lime-500\\/40{color:#84cc1666}.text-lime-500\\/5{color:#84cc160d}.text-lime-500\\/50{color:#84cc1680}.text-lime-500\\/60{color:#84cc1699}.text-lime-500\\/70{color:#84cc16b3}.text-lime-500\\/75{color:#84cc16bf}.text-lime-500\\/80{color:#84cc16cc}.text-lime-500\\/90{color:#84cc16e6}.text-lime-500\\/95{color:#84cc16f2}.text-measure{color:hsl(var(--measure))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-neutral-500{--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity))}.text-neutral-500\\/0{color:#73737300}.text-neutral-500\\/10{color:#7373731a}.text-neutral-500\\/100{color:#737373}.text-neutral-500\\/20{color:#73737333}.text-neutral-500\\/25{color:#73737340}.text-neutral-500\\/30{color:#7373734d}.text-neutral-500\\/40{color:#73737366}.text-neutral-500\\/5{color:#7373730d}.text-neutral-500\\/50{color:#73737380}.text-neutral-500\\/60{color:#73737399}.text-neutral-500\\/70{color:#737373b3}.text-neutral-500\\/75{color:#737373bf}.text-neutral-500\\/80{color:#737373cc}.text-neutral-500\\/90{color:#737373e6}.text-neutral-500\\/95{color:#737373f2}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity))}.text-orange-500\\/0{color:#f9731600}.text-orange-500\\/10{color:#f973161a}.text-orange-500\\/100{color:#f97316}.text-orange-500\\/20{color:#f9731633}.text-orange-500\\/25{color:#f9731640}.text-orange-500\\/30{color:#f973164d}.text-orange-500\\/40{color:#f9731666}.text-orange-500\\/5{color:#f973160d}.text-orange-500\\/50{color:#f9731680}.text-orange-500\\/60{color:#f9731699}.text-orange-500\\/70{color:#f97316b3}.text-orange-500\\/75{color:#f97316bf}.text-orange-500\\/80{color:#f97316cc}.text-orange-500\\/90{color:#f97316e6}.text-orange-500\\/95{color:#f97316f2}.text-pink-500{--tw-text-opacity: 1;color:rgb(236 72 153 / var(--tw-text-opacity))}.text-pink-500\\/0{color:#ec489900}.text-pink-500\\/10{color:#ec48991a}.text-pink-500\\/100{color:#ec4899}.text-pink-500\\/20{color:#ec489933}.text-pink-500\\/25{color:#ec489940}.text-pink-500\\/30{color:#ec48994d}.text-pink-500\\/40{color:#ec489966}.text-pink-500\\/5{color:#ec48990d}.text-pink-500\\/50{color:#ec489980}.text-pink-500\\/60{color:#ec489999}.text-pink-500\\/70{color:#ec4899b3}.text-pink-500\\/75{color:#ec4899bf}.text-pink-500\\/80{color:#ec4899cc}.text-pink-500\\/90{color:#ec4899e6}.text-pink-500\\/95{color:#ec4899f2}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity))}.text-purple-500\\/0{color:#a855f700}.text-purple-500\\/10{color:#a855f71a}.text-purple-500\\/100{color:#a855f7}.text-purple-500\\/20{color:#a855f733}.text-purple-500\\/25{color:#a855f740}.text-purple-500\\/30{color:#a855f74d}.text-purple-500\\/40{color:#a855f766}.text-purple-500\\/5{color:#a855f70d}.text-purple-500\\/50{color:#a855f780}.text-purple-500\\/60{color:#a855f799}.text-purple-500\\/70{color:#a855f7b3}.text-purple-500\\/75{color:#a855f7bf}.text-purple-500\\/80{color:#a855f7cc}.text-purple-500\\/90{color:#a855f7e6}.text-purple-500\\/95{color:#a855f7f2}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-red-500\\/0{color:#ef444400}.text-red-500\\/10{color:#ef44441a}.text-red-500\\/100{color:#ef4444}.text-red-500\\/20{color:#ef444433}.text-red-500\\/25{color:#ef444440}.text-red-500\\/30{color:#ef44444d}.text-red-500\\/40{color:#ef444466}.text-red-500\\/5{color:#ef44440d}.text-red-500\\/50{color:#ef444480}.text-red-500\\/60{color:#ef444499}.text-red-500\\/70{color:#ef4444b3}.text-red-500\\/75{color:#ef4444bf}.text-red-500\\/80{color:#ef4444cc}.text-red-500\\/90{color:#ef4444e6}.text-red-500\\/95{color:#ef4444f2}.text-rose-500{--tw-text-opacity: 1;color:rgb(244 63 94 / var(--tw-text-opacity))}.text-rose-500\\/0{color:#f43f5e00}.text-rose-500\\/10{color:#f43f5e1a}.text-rose-500\\/100{color:#f43f5e}.text-rose-500\\/20{color:#f43f5e33}.text-rose-500\\/25{color:#f43f5e40}.text-rose-500\\/30{color:#f43f5e4d}.text-rose-500\\/40{color:#f43f5e66}.text-rose-500\\/5{color:#f43f5e0d}.text-rose-500\\/50{color:#f43f5e80}.text-rose-500\\/60{color:#f43f5e99}.text-rose-500\\/70{color:#f43f5eb3}.text-rose-500\\/75{color:#f43f5ebf}.text-rose-500\\/80{color:#f43f5ecc}.text-rose-500\\/90{color:#f43f5ee6}.text-rose-500\\/95{color:#f43f5ef2}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-500{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity))}.text-sky-500\\/0{color:#0ea5e900}.text-sky-500\\/10{color:#0ea5e91a}.text-sky-500\\/100{color:#0ea5e9}.text-sky-500\\/20{color:#0ea5e933}.text-sky-500\\/25{color:#0ea5e940}.text-sky-500\\/30{color:#0ea5e94d}.text-sky-500\\/40{color:#0ea5e966}.text-sky-500\\/5{color:#0ea5e90d}.text-sky-500\\/50{color:#0ea5e980}.text-sky-500\\/60{color:#0ea5e999}.text-sky-500\\/70{color:#0ea5e9b3}.text-sky-500\\/75{color:#0ea5e9bf}.text-sky-500\\/80{color:#0ea5e9cc}.text-sky-500\\/90{color:#0ea5e9e6}.text-sky-500\\/95{color:#0ea5e9f2}.text-sky-800{--tw-text-opacity: 1;color:rgb(7 89 133 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-500\\/0{color:#64748b00}.text-slate-500\\/10{color:#64748b1a}.text-slate-500\\/100{color:#64748b}.text-slate-500\\/20{color:#64748b33}.text-slate-500\\/25{color:#64748b40}.text-slate-500\\/30{color:#64748b4d}.text-slate-500\\/40{color:#64748b66}.text-slate-500\\/5{color:#64748b0d}.text-slate-500\\/50{color:#64748b80}.text-slate-500\\/60{color:#64748b99}.text-slate-500\\/70{color:#64748bb3}.text-slate-500\\/75{color:#64748bbf}.text-slate-500\\/80{color:#64748bcc}.text-slate-500\\/90{color:#64748be6}.text-slate-500\\/95{color:#64748bf2}.text-stone-500{--tw-text-opacity: 1;color:rgb(120 113 108 / var(--tw-text-opacity))}.text-stone-500\\/0{color:#78716c00}.text-stone-500\\/10{color:#78716c1a}.text-stone-500\\/100{color:#78716c}.text-stone-500\\/20{color:#78716c33}.text-stone-500\\/25{color:#78716c40}.text-stone-500\\/30{color:#78716c4d}.text-stone-500\\/40{color:#78716c66}.text-stone-500\\/5{color:#78716c0d}.text-stone-500\\/50{color:#78716c80}.text-stone-500\\/60{color:#78716c99}.text-stone-500\\/70{color:#78716cb3}.text-stone-500\\/75{color:#78716cbf}.text-stone-500\\/80{color:#78716ccc}.text-stone-500\\/90{color:#78716ce6}.text-stone-500\\/95{color:#78716cf2}.text-teal-500{--tw-text-opacity: 1;color:rgb(20 184 166 / var(--tw-text-opacity))}.text-teal-500\\/0{color:#14b8a600}.text-teal-500\\/10{color:#14b8a61a}.text-teal-500\\/100{color:#14b8a6}.text-teal-500\\/20{color:#14b8a633}.text-teal-500\\/25{color:#14b8a640}.text-teal-500\\/30{color:#14b8a64d}.text-teal-500\\/40{color:#14b8a666}.text-teal-500\\/5{color:#14b8a60d}.text-teal-500\\/50{color:#14b8a680}.text-teal-500\\/60{color:#14b8a699}.text-teal-500\\/70{color:#14b8a6b3}.text-teal-500\\/75{color:#14b8a6bf}.text-teal-500\\/80{color:#14b8a6cc}.text-teal-500\\/90{color:#14b8a6e6}.text-teal-500\\/95{color:#14b8a6f2}.text-transparent{color:transparent}.text-violet-500{--tw-text-opacity: 1;color:rgb(139 92 246 / var(--tw-text-opacity))}.text-violet-500\\/0{color:#8b5cf600}.text-violet-500\\/10{color:#8b5cf61a}.text-violet-500\\/100{color:#8b5cf6}.text-violet-500\\/20{color:#8b5cf633}.text-violet-500\\/25{color:#8b5cf640}.text-violet-500\\/30{color:#8b5cf64d}.text-violet-500\\/40{color:#8b5cf666}.text-violet-500\\/5{color:#8b5cf60d}.text-violet-500\\/50{color:#8b5cf680}.text-violet-500\\/60{color:#8b5cf699}.text-violet-500\\/70{color:#8b5cf6b3}.text-violet-500\\/75{color:#8b5cf6bf}.text-violet-500\\/80{color:#8b5cf6cc}.text-violet-500\\/90{color:#8b5cf6e6}.text-violet-500\\/95{color:#8b5cf6f2}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.text-yellow-500\\/0{color:#eab30800}.text-yellow-500\\/10{color:#eab3081a}.text-yellow-500\\/100{color:#eab308}.text-yellow-500\\/20{color:#eab30833}.text-yellow-500\\/25{color:#eab30840}.text-yellow-500\\/30{color:#eab3084d}.text-yellow-500\\/40{color:#eab30866}.text-yellow-500\\/5{color:#eab3080d}.text-yellow-500\\/50{color:#eab30880}.text-yellow-500\\/60{color:#eab30899}.text-yellow-500\\/70{color:#eab308b3}.text-yellow-500\\/75{color:#eab308bf}.text-yellow-500\\/80{color:#eab308cc}.text-yellow-500\\/90{color:#eab308e6}.text-yellow-500\\/95{color:#eab308f2}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity))}.text-zinc-500{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity))}.text-zinc-500\\/0{color:#71717a00}.text-zinc-500\\/10{color:#71717a1a}.text-zinc-500\\/100{color:#71717a}.text-zinc-500\\/20{color:#71717a33}.text-zinc-500\\/25{color:#71717a40}.text-zinc-500\\/30{color:#71717a4d}.text-zinc-500\\/40{color:#71717a66}.text-zinc-500\\/5{color:#71717a0d}.text-zinc-500\\/50{color:#71717a80}.text-zinc-500\\/60{color:#71717a99}.text-zinc-500\\/70{color:#71717ab3}.text-zinc-500\\/75{color:#71717abf}.text-zinc-500\\/80{color:#71717acc}.text-zinc-500\\/90{color:#71717ae6}.text-zinc-500\\/95{color:#71717af2}.text-opacity-50{--tw-text-opacity: .5}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.caret-foreground{caret-color:hsl(var(--foreground))}.\\!opacity-50{opacity:.5!important}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-ring{--tw-ring-color: hsl(var(--ring))}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-75{transition-duration:75ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-100{animation-duration:.1s}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-75{animation-duration:75ms}.ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:italic::placeholder{font-style:italic}.placeholder\\:text-gray-400::placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\\:left-1\\/2:after{content:var(--tw-content);left:50%}.after\\:w-1:after{content:var(--tw-content);width:.25rem}.after\\:-translate-x-1\\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:border-2:hover{border-width:2px}.hover\\:border-accent-foreground:hover{border-color:hsl(var(--accent-foreground))}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-destructive\\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-dimension\\/20:hover{background-color:hsl(var(--dimension) / .2)}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:bg-measure\\/20:hover{background-color:hsl(var(--measure) / .2)}.hover\\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\\:bg-primary\\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\\:ring-1:active{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.active\\:ring-ring:active{--tw-ring-color: hsl(var(--ring))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\:visible{visibility:visible}.group:hover .group-hover\\:translate-y-\\[40\\%\\]{--tw-translate-y: 40%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:disabled~.peer-disabled\\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\\:opacity-70{opacity:.7}.aria-selected\\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[panel-group-direction\\=vertical\\]\\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\\[panel-group-direction\\=vertical\\]\\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[panel-group-direction\\=vertical\\]\\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\\[state\\=active\\]\\:border-primary[data-state=active]{border-color:hsl(var(--primary))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked],.data-\\[state\\=on\\]\\:bg-primary[data-state=on]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\\[state\\=active\\]\\:text-primary[data-state=active]{color:hsl(var(--primary))}.data-\\[state\\=checked\\]\\:text-primary-foreground[data-state=checked],.data-\\[state\\=on\\]\\:text-primary-foreground[data-state=on]{color:hsl(var(--primary-foreground))}.data-\\[state\\=open\\]\\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\\[state\\=closed\\]\\:slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\\[state\\=closed\\]\\:slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\\[state\\=open\\]\\:slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\\[state\\=open\\]\\:slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y: -48%}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:-translate-y-1\\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:is(.dark .dark\\:border-indigo-600){--tw-border-opacity: 1;border-color:rgb(79 70 229 / var(--tw-border-opacity))}:is(.dark .dark\\:border-purple-600){--tw-border-opacity: 1;border-color:rgb(147 51 234 / var(--tw-border-opacity))}:is(.dark .dark\\:border-sky-600){--tw-border-opacity: 1;border-color:rgb(2 132 199 / var(--tw-border-opacity))}:is(.dark .dark\\:border-yellow-600){--tw-border-opacity: 1;border-color:rgb(202 138 4 / var(--tw-border-opacity))}:is(.dark .dark\\:bg-indigo-900){--tw-bg-opacity: 1;background-color:rgb(49 46 129 / var(--tw-bg-opacity))}:is(.dark .dark\\:bg-purple-900){--tw-bg-opacity: 1;background-color:rgb(88 28 135 / var(--tw-bg-opacity))}:is(.dark .dark\\:bg-sky-900){--tw-bg-opacity: 1;background-color:rgb(12 74 110 / var(--tw-bg-opacity))}:is(.dark .dark\\:bg-yellow-900){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity))}:is(.dark .dark\\:bg-zinc-700){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}:is(.dark .dark\\:text-amber-600){--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity))}:is(.dark .dark\\:text-blue-600){--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}:is(.dark .dark\\:text-fuchsia-600){--tw-text-opacity: 1;color:rgb(192 38 211 / var(--tw-text-opacity))}:is(.dark .dark\\:text-gray-200){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}:is(.dark .dark\\:text-green-600){--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}:is(.dark .dark\\:text-indigo-100){--tw-text-opacity: 1;color:rgb(224 231 255 / var(--tw-text-opacity))}:is(.dark .dark\\:text-purple-100){--tw-text-opacity: 1;color:rgb(243 232 255 / var(--tw-text-opacity))}:is(.dark .dark\\:text-sky-100){--tw-text-opacity: 1;color:rgb(224 242 254 / var(--tw-text-opacity))}:is(.dark .dark\\:text-yellow-100){--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity))}:is(.dark .dark\\:text-yellow-600){--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity))}:is(.dark .dark\\:\\[color-scheme\\:dark\\]){color-scheme:dark}:is(.dark .dark\\:hover\\:bg-gray-800:hover){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\\:hover\\:bg-zinc-700:hover){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}@media (min-width: 640px){.sm\\:mx-0{margin-left:0;margin-right:0}.sm\\:mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.sm\\:ml-0{margin-left:0}.sm\\:ml-0\\.5{margin-left:.125rem}.sm\\:mr-0{margin-right:0}.sm\\:mr-0\\.5{margin-right:.125rem}.sm\\:block{display:block}.sm\\:flex{display:flex}.sm\\:w-\\[80\\%\\]{width:80%}.sm\\:min-w-\\[164px\\]{min-width:164px}.sm\\:min-w-\\[96px\\]{min-width:96px}.sm\\:max-w-\\[314px\\]{max-width:314px}.sm\\:max-w-\\[35\\%\\]{max-width:35%}.sm\\:flex-row{flex-direction:row}.sm\\:flex-col{flex-direction:column}.sm\\:justify-end{justify-content:flex-end}.sm\\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\\:rounded-lg{border-radius:var(--radius)}.sm\\:pl-6{padding-left:1.5rem}.sm\\:text-left{text-align:left}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.lg\\:w-\\[880px\\]{width:880px}.lg\\:flex-nowrap{flex-wrap:nowrap}}.\\[\\&\\>span\\]\\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\[data-panel-group-direction\\=vertical\\]\\>div\\]\\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 [cmdk-item] svg{width:1.25rem}
`, N0t = `code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.App{height:100%;background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.dark.App{color-scheme:dark}*{border-color:hsl(var(--border))}*:focus-visible{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: hsl(var(--ring))}#vg-tooltip-element{background-color:hsl(var(--popover));color:hsl(var(--popover-foreground))}:host{--map-tiles-filter: brightness(.6) invert(1) contrast(3) hue-rotate(200deg) saturate(.3) brightness(.7);--radius: .5rem}.dark .map-tile{filter:var(--map-tiles-filter, none)}.dark .leaflet-container{background-color:hsl(var(--background))}.dark .leaflet-control-zoom-out,.dark .leaflet-control-zoom-in{background-color:hsl(var(--background));color:hsl(var(--foreground));border-color:hsl(var(--input))}.dark .leaflet-control-zoom-out:hover,.dark .leaflet-control-zoom-in:hover{background-color:hsl(var(--accent));color:hsl(var(--accent-foreground))}.dark .leaflet-control-zoom{border:2px solid hsl(var(--input))!important}.dark .leaflet-container .leaflet-control-attribution{background-color:hsla(var(--secondary) / .8);color:hsl(var(--secondary-foreground))}.dark .leaflet-tooltip{background-color:hsl(var(--popover));color:hsl(var(--popover-foreground));border-color:hsl(var(--border))}.dark .leaflet-tooltip-right:before{border-right-color:hsl(var(--popover))}.dark .leaflet-tooltip-left:before{border-left-color:hsl(var(--popover))}
`, u5A = u.createContext({ root: null }), wX = function({ onMount: A, onUnmount: e, children: t, uiTheme: i = ERA, ...n }) {
  const [o, g] = u.useState(null), s = u.useRef(null), I = u.useRef(A);
  I.current = A;
  const r = u.useRef(e);
  r.current = e;
  const a = u.useMemo(() => lEe(i), [i]);
  return u.useEffect(() => {
    var C;
    if (s.current) {
      const B = s.current.shadowRoot;
      return g(B), (C = I.current) == null || C.call(I, B), () => {
        var l;
        (l = r.current) == null || l.call(r);
      };
    }
  }, []), b.createElement(
    k0t.div,
    { ...n, mode: "open", ref: s },
    b.createElement(
      _7.Provider,
      { value: i },
      b.createElement("style", null, J0t),
      b.createElement("style", null, N0t),
      b.createElement("style", null, a),
      b.createElement("link", { rel: "stylesheet", href: "https://unpkg.com/leaflet@1.9.4/dist/leaflet.css", integrity: "sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=", crossOrigin: "" }),
      o && b.createElement(
        H7A,
        { target: o },
        b.createElement(u5A.Provider, { value: { root: o } }, t)
      )
    )
  );
}, ByA = (A) => {
  const { className: e, color: t, dia: i, factor: n, style: o } = A, g = b.useMemo(() => {
    const s = new Array(i).fill(0).map((I, r) => [r, 1 / 0, -1]);
    return A2A(i).forEach(([I, r]) => {
      s[r][1] = Math.min(I, s[r][1]), s[r][2] = Math.max(I, s[r][1]);
    }), s.filter((I) => I[1] !== 1 / 0);
  }, [i]);
  return b.createElement(
    "div",
    { className: e, style: o },
    b.createElement("div", { className: "relative", style: {
      width: n * i,
      height: n * i
    } }, g.map(([s, I, r]) => b.createElement("div", { className: "absolute", key: `cursor_${s}`, style: {
      background: t,
      width: (r - I + 1) * n,
      height: n,
      opacity: 0.6,
      top: s * n,
      left: I * n
    } })))
  );
}, d5A = (A) => {
  const { color: e, cursor: t, offsetX: i, offsetY: n, children: o, showPreview: g } = A, [s, I] = b.useState(null);
  return b.createElement(
    "div",
    { className: "relative cursor-none", onMouseOut: () => I(null), onMouseMoveCapture: (r) => I([r.nativeEvent.offsetX, r.nativeEvent.offsetY]), onTouchMoveCapture: (r) => {
      const a = r.currentTarget.getBoundingClientRect();
      I([r.changedTouches[0].pageX - a.left, r.changedTouches[0].pageY - a.top]);
    }, onTouchEnd: () => I(null) },
    o,
    s !== null && t.type === "rect" && b.createElement(
      b.Fragment,
      null,
      b.createElement("div", { className: "absolute pointer-events-none", style: {
        backgroundColor: e,
        left: Math.floor((s[0] - i) / t.xFactor) * t.xFactor + i - (t.x - t.x % 2) / 2 * t.xFactor,
        top: Math.floor((s[1] - n) / t.yFactor) * t.yFactor + n - ((t.y - t.y % 2) / 2 - 1 + t.y % 2) * t.yFactor,
        width: t.x * t.xFactor,
        height: t.y * t.yFactor,
        opacity: 0.6
      } }),
      b.createElement("div", { className: "absolute pointer-events-none bg-primary", style: {
        width: 16,
        height: 16,
        borderRadius: 16,
        opacity: 0.4,
        left: s[0] - 8,
        top: s[1] - 8
      } })
    ),
    g && !s && t.type === "rect" && b.createElement("div", { className: "absolute pointer-events-none", style: {
      backgroundColor: e,
      width: t.x * t.xFactor,
      height: t.y * t.yFactor,
      opacity: 0.6,
      left: `calc(50% - ${(t.x - t.x % 2) / 2 * t.xFactor}px)`,
      top: `calc(50% - ${(t.y - t.y % 2) / 2 * t.yFactor}px)`
    } }),
    s !== null && t.type === "circle" && b.createElement(ByA, { className: "absolute pointer-events-none", color: e, factor: t.factor, dia: t.dia, style: {
      left: Math.floor((s[0] - i) / t.factor) * t.factor + i - (t.dia - t.dia % 2) / 2 * t.factor,
      top: Math.floor((s[1] - n) / t.factor) * t.factor + n - ((t.dia - t.dia % 2) / 2 - 1 + t.dia % 2) * t.factor
    } }),
    g && !s && t.type === "circle" && b.createElement(ByA, { className: "absolute pointer-events-none", color: e, factor: t.factor, dia: t.dia, style: {
      left: `calc(50% - ${(t.dia - t.dia % 2) / 2 * t.factor}px)`,
      top: `calc(50% - ${(t.dia - t.dia % 2) / 2 * t.factor}px)`
    } })
  );
}, h5A = (A) => {
  const [e, t] = b.useState(!1), i = (n) => {
    n.target.value && A.onChange(n.target.value), t(!1);
  };
  return e ? b.createElement(on, { autoFocus: !0, defaultValue: A.value, onBlur: i, onKeyUp: (n) => n.key === "Enter" ? (i(n), !1) : !0 }) : b.createElement("label", { className: "px-3 py-1 text-sm transition-colors rounded hover:bg-accent leading-6", onClick: () => {
    t(!0);
  } }, A.value);
}, m5A = (A) => {
  const [e, t] = b.useState(!1), [i, n] = b.useState(!1), o = b.useRef(null), g = b.useContext(u5A);
  u.useEffect(() => {
    if (e) {
      const r = (C) => {
        var B;
        C.target && !((B = o.current) != null && B.contains(C.target)) && t(!1);
      }, a = g.root;
      return a == null || a.addEventListener("click", r), () => a == null ? void 0 : a.removeEventListener("click", r);
    }
  }, [e]);
  const [s, I] = b.useState(A.color);
  return b.createElement(
    r1,
    { fallback: b.createElement(
      "div",
      { className: "flex space-x-2" },
      b.createElement("div", { className: "w-4 h-4", style: { backgroundColor: A.color } }),
      b.createElement(on, { value: A.color, onChange: (r) => {
        A.onChangeColor(r.target.value);
      } })
    ) },
    b.createElement(
      "div",
      { className: "relative", ref: o },
      b.createElement("div", { className: "w-8 h-5 border-2", style: { backgroundColor: A.color }, onClick: (r) => {
        r.stopPropagation(), r.preventDefault(), t(!0), n(!1), I(A.color);
      } }),
      e && b.createElement(
        "div",
        { className: "absolute right-0 top-8 z-40 flex-col space-y-1 bg-popover shadow-lg rounded-md border" },
        b.createElement(t5A, { presetColors: A.colors, color: s, onChange: (r) => {
          n(!0), I(r.hex);
        }, noShadow: !0, noBorder: !0 }),
        b.createElement(
          "div",
          { className: "flex justify-end p-2" },
          b.createElement(Re, { variant: "outline", children: "Save", onClick: () => {
            t(!1), i && A.onChangeColor(s);
          } })
        )
      )
    )
  );
};
var Y0t = F0t, e_ = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, R0t = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
function F0t(A) {
  var e = [];
  return A.replace(R0t, function(t, i, n) {
    var o = i.toLowerCase();
    for (n = x0t(n), o == "m" && n.length > 2 && (e.push([i].concat(n.splice(0, 2))), o = "l", i = i == "m" ? "l" : "L"); ; ) {
      if (n.length == e_[o])
        return n.unshift(i), e.push(n);
      if (n.length < e_[o])
        throw new Error("malformed path data");
      e.push([i].concat(n.splice(0, e_[o])));
    }
  }), e;
}
var M0t = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
function x0t(A) {
  var e = A.match(M0t);
  return e ? e.map(Number) : [];
}
const L0t = /* @__PURE__ */ Br(Y0t);
var fX = { exports: {} };
function v0t(A, e) {
  var t = A[0] - e[0], i = A[1] - e[1];
  return t * t + i * i;
}
var H0t = function(A, e) {
  if (A.length <= 1)
    return A;
  e = typeof e == "number" ? e : 1;
  for (var t = e * e, i = A[0], n = [i], o, g = 1, s = A.length; g < s; g++)
    o = A[g], v0t(o, i) > t && (n.push(o), i = o);
  return i !== o && n.push(o), n;
};
function S0t(A, e, t) {
  var i = e[0], n = e[1], o = t[0] - i, g = t[1] - n;
  if (o !== 0 || g !== 0) {
    var s = ((A[0] - i) * o + (A[1] - n) * g) / (o * o + g * g);
    s > 1 ? (i = t[0], n = t[1]) : s > 0 && (i += o * s, n += g * s);
  }
  return o = A[0] - i, g = A[1] - n, o * o + g * g;
}
function r6(A, e, t, i, n) {
  for (var o = i, g, s = e + 1; s < t; s++) {
    var I = S0t(A[s], A[e], A[t]);
    I > o && (g = s, o = I);
  }
  o > i && (g - e > 1 && r6(A, e, g, i, n), n.push(A[g]), t - g > 1 && r6(A, g, t, i, n));
}
var Z0t = function(A, e) {
  if (A.length <= 1)
    return A;
  e = typeof e == "number" ? e : 1;
  var t = e * e, i = A.length - 1, n = [A[0]];
  return r6(A, 0, i, t, n), n.push(A[i]), n;
}, p5A = H0t, y5A = Z0t;
fX.exports = function(A, e) {
  return A = p5A(A, e), A = y5A(A, e), A;
};
fX.exports.radialDistance = p5A;
fX.exports.douglasPeucker = y5A;
var W0t = fX.exports;
const K0t = /* @__PURE__ */ Br(W0t);
function lyA(A) {
  return [A[0], A[1]];
}
function uI(A, e) {
  return [A, e];
}
var U0t = function(A) {
  A = A || {};
  var e = typeof A.recursion == "number" ? A.recursion : 8, t = typeof A.epsilon == "number" ? A.epsilon : 11920929e-14, i = typeof A.pathEpsilon == "number" ? A.pathEpsilon : 1, n = typeof A.angleEpsilon == "number" ? A.angleEpsilon : 0.01, o = A.angleTolerance || 0, g = A.cuspLimit || 0;
  return function(r, a, C, B, l, Q) {
    Q || (Q = []), l = typeof l == "number" ? l : 1;
    var E = i / l;
    return E *= E, s(r, a, C, B, Q, E), Q;
  };
  function s(r, a, C, B, l, Q) {
    l.push(lyA(r));
    var E = r[0], d = r[1], m = a[0], y = a[1], f = C[0], w = C[1], G = B[0], R = B[1];
    I(E, d, m, y, f, w, G, R, l, Q, 0), l.push(lyA(B));
  }
  function I(r, a, C, B, l, Q, E, d, m, y, f) {
    if (!(f > e)) {
      var w = Math.PI, G = (r + C) / 2, R = (a + B) / 2, F = (C + l) / 2, Z = (B + Q) / 2, c = (l + E) / 2, J = (Q + d) / 2, p = (G + F) / 2, N = (R + Z) / 2, v = (F + c) / 2, K = (Z + J) / 2, U = (p + v) / 2, j = (N + K) / 2;
      if (f > 0) {
        var q = E - r, O = d - a, $ = Math.abs((C - E) * O - (B - d) * q), _ = Math.abs((l - E) * O - (Q - d) * q), tA, nA;
        if ($ > t && _ > t) {
          if (($ + _) * ($ + _) <= y * (q * q + O * O)) {
            if (o < n) {
              m.push(uI(U, j));
              return;
            }
            var AA = Math.atan2(Q - B, l - C);
            if (tA = Math.abs(AA - Math.atan2(B - a, C - r)), nA = Math.abs(Math.atan2(d - Q, E - l) - AA), tA >= w && (tA = 2 * w - tA), nA >= w && (nA = 2 * w - nA), tA + nA < o) {
              m.push(uI(U, j));
              return;
            }
            if (g !== 0) {
              if (tA > g) {
                m.push(uI(C, B));
                return;
              }
              if (nA > g) {
                m.push(uI(l, Q));
                return;
              }
            }
          }
        } else if ($ > t) {
          if ($ * $ <= y * (q * q + O * O)) {
            if (o < n) {
              m.push(uI(U, j));
              return;
            }
            if (tA = Math.abs(Math.atan2(Q - B, l - C) - Math.atan2(B - a, C - r)), tA >= w && (tA = 2 * w - tA), tA < o) {
              m.push(uI(C, B)), m.push(uI(l, Q));
              return;
            }
            if (g !== 0 && tA > g) {
              m.push(uI(C, B));
              return;
            }
          }
        } else if (_ > t) {
          if (_ * _ <= y * (q * q + O * O)) {
            if (o < n) {
              m.push(uI(U, j));
              return;
            }
            if (tA = Math.abs(Math.atan2(d - Q, E - l) - Math.atan2(Q - B, l - C)), tA >= w && (tA = 2 * w - tA), tA < o) {
              m.push(uI(C, B)), m.push(uI(l, Q));
              return;
            }
            if (g !== 0 && tA > g) {
              m.push(uI(l, Q));
              return;
            }
          }
        } else if (q = U - (r + E) / 2, O = j - (a + d) / 2, q * q + O * O <= y) {
          m.push(uI(U, j));
          return;
        }
      }
      I(r, a, G, R, p, N, U, j, m, y, f + 1), I(U, j, v, K, c, J, E, d, m, y, f + 1);
    }
  }
}, V0t = U0t(), X0t = z0t;
function z0t(A) {
  var e = 0, t = 0, i = 0, n = 0;
  return A.map(function(o) {
    o = o.slice();
    var g = o[0], s = g.toUpperCase();
    if (g != s)
      switch (o[0] = s, g) {
        case "a":
          o[6] += i, o[7] += n;
          break;
        case "v":
          o[1] += n;
          break;
        case "h":
          o[1] += i;
          break;
        default:
          for (var I = 1; I < o.length; )
            o[I++] += i, o[I++] += n;
      }
    switch (s) {
      case "Z":
        i = e, n = t;
        break;
      case "H":
        i = o[1];
        break;
      case "V":
        n = o[1];
        break;
      case "M":
        i = e = o[1], n = t = o[2];
        break;
      default:
        i = o[o.length - 2], n = o[o.length - 1];
    }
    return o;
  });
}
var Oh = Math.PI, cyA = w5A(120), T0t = _0t;
function _0t(A) {
  for (var e, t = [], i = 0, n = 0, o = 0, g = 0, s = null, I = null, r = 0, a = 0, C = 0, B = A.length; C < B; C++) {
    var l = A[C], Q = l[0];
    switch (Q) {
      case "M":
        o = l[1], g = l[2];
        break;
      case "A":
        l = b5A(r, a, l[1], l[2], w5A(l[3]), l[4], l[5], l[6], l[7]), l.unshift("C"), l.length > 7 && (t.push(l.splice(0, 7)), l.unshift("C"));
        break;
      case "S":
        var E = r, d = a;
        (e == "C" || e == "S") && (E += E - i, d += d - n), l = ["C", E, d, l[1], l[2], l[3], l[4]];
        break;
      case "T":
        e == "Q" || e == "T" ? (s = r * 2 - s, I = a * 2 - I) : (s = r, I = a), l = QyA(r, a, s, I, l[1], l[2]);
        break;
      case "Q":
        s = l[1], I = l[2], l = QyA(r, a, l[1], l[2], l[3], l[4]);
        break;
      case "L":
        l = Kx(r, a, l[1], l[2]);
        break;
      case "H":
        l = Kx(r, a, l[1], a);
        break;
      case "V":
        l = Kx(r, a, r, l[1]);
        break;
      case "Z":
        l = Kx(r, a, o, g);
        break;
    }
    e = Q, r = l[l.length - 2], a = l[l.length - 1], l.length > 4 ? (i = l[l.length - 4], n = l[l.length - 3]) : (i = r, n = a), t.push(l);
  }
  return t;
}
function Kx(A, e, t, i) {
  return ["C", A, e, t, i, t, i];
}
function QyA(A, e, t, i, n, o) {
  return [
    "C",
    A / 3 + 2 / 3 * t,
    e / 3 + 2 / 3 * i,
    n / 3 + 2 / 3 * t,
    o / 3 + 2 / 3 * i,
    n,
    o
  ];
}
function b5A(A, e, t, i, n, o, g, s, I, r) {
  if (r)
    f = r[0], w = r[1], m = r[2], y = r[3];
  else {
    var a = t_(A, e, -n);
    A = a.x, e = a.y, a = t_(s, I, -n), s = a.x, I = a.y;
    var C = (A - s) / 2, B = (e - I) / 2, l = C * C / (t * t) + B * B / (i * i);
    l > 1 && (l = Math.sqrt(l), t = l * t, i = l * i);
    var Q = t * t, E = i * i, d = (o == g ? -1 : 1) * Math.sqrt(Math.abs((Q * E - Q * B * B - E * C * C) / (Q * B * B + E * C * C)));
    d == 1 / 0 && (d = 1);
    var m = d * t * B / i + (A + s) / 2, y = d * -i * C / t + (e + I) / 2, f = Math.asin(((e - y) / i).toFixed(9)), w = Math.asin(((I - y) / i).toFixed(9));
    f = A < m ? Oh - f : f, w = s < m ? Oh - w : w, f < 0 && (f = Oh * 2 + f), w < 0 && (w = Oh * 2 + w), g && f > w && (f = f - Oh * 2), !g && w > f && (w = w - Oh * 2);
  }
  if (Math.abs(w - f) > cyA) {
    var G = w, R = s, F = I;
    w = f + cyA * (g && w > f ? 1 : -1), s = m + t * Math.cos(w), I = y + i * Math.sin(w);
    var Z = b5A(s, I, t, i, n, 0, g, R, F, [w, G, m, y]);
  }
  var c = Math.tan((w - f) / 4), J = 4 / 3 * t * c, p = 4 / 3 * i * c, N = [
    2 * A - (A + J * Math.sin(f)),
    2 * e - (e - p * Math.cos(f)),
    s + J * Math.sin(w),
    I - p * Math.cos(w),
    s,
    I
  ];
  if (r)
    return N;
  Z && (N = N.concat(Z));
  for (var v = 0; v < N.length; ) {
    var K = t_(N[v], N[v + 1], n);
    N[v++] = K.x, N[v++] = K.y;
  }
  return N;
}
function t_(A, e, t) {
  return {
    x: A * Math.cos(t) - e * Math.sin(t),
    y: A * Math.sin(t) + e * Math.cos(t)
  };
}
function w5A(A) {
  return A * (Oh / 180);
}
var q0t = function(A, e) {
  return A[0] = e[0], A[1] = e[1], A;
}, O0t = V0t, j0t = X0t, P0t = T0t, $0t = q0t;
function cv(A, e, t) {
  return A[0] = e, A[1] = t, A;
}
var Ayt = [0, 0], eyt = [0, 0], tyt = [0, 0];
function iyt(A, e, t, i) {
  O0t(
    t,
    cv(Ayt, i[1], i[2]),
    cv(eyt, i[3], i[4]),
    cv(tyt, i[5], i[6]),
    e,
    A
  );
}
var nyt = function(A, e) {
  var t = [], i = [], n = [0, 0];
  return P0t(j0t(A)).forEach(function(o, g, s) {
    if (o[0] === "M")
      $0t(n, o.slice(1)), i.length > 0 && (t.push(i), i = []);
    else if (o[0] === "C")
      iyt(i, e, n, o), cv(n, o[5], o[6]);
    else
      throw new Error("illegal type in SVG: " + o[0]);
  }), i.length > 0 && t.push(i), t;
};
const oyt = /* @__PURE__ */ Br(nyt);
var vn = {}, gyt = vn;
vn.WINDING_ODD = 0;
vn.WINDING_NONZERO = 1;
vn.WINDING_POSITIVE = 2;
vn.WINDING_NEGATIVE = 3;
vn.WINDING_ABS_GEQ_TWO = 4;
vn.POLYGONS = 0;
vn.CONNECTED_POLYGONS = 1;
vn.BOUNDARY_CONTOURS = 2;
vn.tesselate = function(A) {
  for (var e = A.debug || !1, t = new Y5A(), i = 0; i < A.contours.length; i++)
    t.addContour(A.vertexSize || 2, A.contours[i]);
  return t.tesselate(
    A.windingRule || vn.WINDING_ODD,
    A.elementType || vn.POLYGONS,
    A.polySize || 3,
    A.vertexSize || 2,
    A.normal || [0, 0, 1]
  ), {
    vertices: t.vertices,
    vertexIndices: t.vertexIndices,
    vertexCount: t.vertexCount,
    elements: t.elements,
    elementCount: t.elementCount,
    mesh: e ? t.mesh : void 0
  };
};
var Me = function(A) {
  if (!A)
    throw "Assertion Failed!";
};
function Xb() {
  this.next = null, this.prev = null, this.anEdge = null, this.coords = [0, 0, 0], this.s = 0, this.t = 0, this.pqHandle = 0, this.n = 0, this.idx = 0;
}
function VJ() {
  this.next = null, this.prev = null, this.anEdge = null, this.trail = null, this.n = 0, this.marked = !1, this.inside = !1;
}
function Y2(A) {
  this.next = null, this.Sym = null, this.Onext = null, this.Lnext = null, this.Org = null, this.Lface = null, this.activeRegion = null, this.winding = 0, this.side = A;
}
Y2.prototype = {
  get Rface() {
    return this.Sym.Lface;
  },
  set Rface(A) {
    this.Sym.Lface = A;
  },
  get Dst() {
    return this.Sym.Org;
  },
  set Dst(A) {
    this.Sym.Org = A;
  },
  get Oprev() {
    return this.Sym.Lnext;
  },
  set Oprev(A) {
    this.Sym.Lnext = A;
  },
  get Lprev() {
    return this.Onext.Sym;
  },
  set Lprev(A) {
    this.Onext.Sym = A;
  },
  get Dprev() {
    return this.Lnext.Sym;
  },
  set Dprev(A) {
    this.Lnext.Sym = A;
  },
  get Rprev() {
    return this.Sym.Onext;
  },
  set Rprev(A) {
    this.Sym.Onext = A;
  },
  get Dnext() {
    return (
      /*this.Rprev*/
      this.Sym.Onext.Sym
    );
  },
  /* 3 pointers */
  set Dnext(A) {
    this.Sym.Onext.Sym = A;
  },
  /* 3 pointers */
  get Rnext() {
    return (
      /*this.Oprev*/
      this.Sym.Lnext.Sym
    );
  },
  /* 3 pointers */
  set Rnext(A) {
    this.Sym.Lnext.Sym = A;
  }
  /* 3 pointers */
};
function f5A() {
  var A = new Xb(), e = new VJ(), t = new Y2(0), i = new Y2(1);
  A.next = A.prev = A, A.anEdge = null, e.next = e.prev = e, e.anEdge = null, e.trail = null, e.marked = !1, e.inside = !1, t.next = t, t.Sym = i, t.Onext = null, t.Lnext = null, t.Org = null, t.Lface = null, t.winding = 0, t.activeRegion = null, i.next = i, i.Sym = t, i.Onext = null, i.Lnext = null, i.Org = null, i.Lface = null, i.winding = 0, i.activeRegion = null, this.vHead = A, this.fHead = e, this.eHead = t, this.eHeadSym = i;
}
f5A.prototype = {
  /* MakeEdge creates a new pair of half-edges which form their own loop.
  * No vertex or face structures are allocated, but these must be assigned
  * before the current edge operation is completed.
  */
  //static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
  makeEdge_: function(A) {
    var e = new Y2(0), t = new Y2(1);
    A.Sym.side < A.side && (A = A.Sym);
    var i = A.Sym.next;
    return t.next = i, i.Sym.next = e, e.next = A, A.Sym.next = t, e.Sym = t, e.Onext = e, e.Lnext = t, e.Org = null, e.Lface = null, e.winding = 0, e.activeRegion = null, t.Sym = e, t.Onext = t, t.Lnext = e, t.Org = null, t.Lface = null, t.winding = 0, t.activeRegion = null, e;
  },
  /* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
  * CS348a notes (see mesh.h).  Basically it modifies the mesh so that
  * a->Onext and b->Onext are exchanged.  This can have various effects
  * depending on whether a and b belong to different face or vertex rings.
  * For more explanation see tessMeshSplice() below.
  */
  // static void Splice( TESShalfEdge *a, TESShalfEdge *b )
  splice_: function(A, e) {
    var t = A.Onext, i = e.Onext;
    t.Sym.Lnext = e, i.Sym.Lnext = A, A.Onext = i, e.Onext = t;
  },
  /* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
  * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
  * a place to insert the new vertex in the global vertex list.  We insert
  * the new vertex *before* vNext so that algorithms which walk the vertex
  * list will not see the newly created vertices.
  */
  //static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
  makeVertex_: function(A, e, t) {
    var i = A;
    Me(i !== null);
    var n = t.prev;
    i.prev = n, n.next = i, i.next = t, t.prev = i, i.anEdge = e;
    var o = e;
    do
      o.Org = i, o = o.Onext;
    while (o !== e);
  },
  /* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
  * face of all edges in the face loop to which eOrig belongs.  "fNext" gives
  * a place to insert the new face in the global face list.  We insert
  * the new face *before* fNext so that algorithms which walk the face
  * list will not see the newly created faces.
  */
  // static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
  makeFace_: function(A, e, t) {
    var i = A;
    Me(i !== null);
    var n = t.prev;
    i.prev = n, n.next = i, i.next = t, t.prev = i, i.anEdge = e, i.trail = null, i.marked = !1, i.inside = t.inside;
    var o = e;
    do
      o.Lface = i, o = o.Lnext;
    while (o !== e);
  },
  /* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
  * and removes from the global edge list.
  */
  //static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
  killEdge_: function(A) {
    A.Sym.side < A.side && (A = A.Sym);
    var e = A.next, t = A.Sym.next;
    e.Sym.next = t, t.Sym.next = e;
  },
  /* KillVertex( vDel ) destroys a vertex and removes it from the global
  * vertex list.  It updates the vertex loop to point to a given new vertex.
  */
  //static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
  killVertex_: function(A, e) {
    var t = A.anEdge, i = t;
    do
      i.Org = e, i = i.Onext;
    while (i !== t);
    var n = A.prev, o = A.next;
    o.prev = n, n.next = o;
  },
  /* KillFace( fDel ) destroys a face and removes it from the global face
  * list.  It updates the face loop to point to a given new face.
  */
  //static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
  killFace_: function(A, e) {
    var t = A.anEdge, i = t;
    do
      i.Lface = e, i = i.Lnext;
    while (i !== t);
    var n = A.prev, o = A.next;
    o.prev = n, n.next = o;
  },
  /****************** Basic Edge Operations **********************/
  /* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
  * The loop consists of the two new half-edges.
  */
  //TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
  makeEdge: function() {
    var A = new Xb(), e = new Xb(), t = new VJ(), i = this.makeEdge_(this.eHead);
    return this.makeVertex_(A, i, this.vHead), this.makeVertex_(e, i.Sym, this.vHead), this.makeFace_(t, i, this.fHead), i;
  },
  /* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
  * mesh connectivity and topology.  It changes the mesh so that
  *	eOrg->Onext <- OLD( eDst->Onext )
  *	eDst->Onext <- OLD( eOrg->Onext )
  * where OLD(...) means the value before the meshSplice operation.
  *
  * This can have two effects on the vertex structure:
  *  - if eOrg->Org != eDst->Org, the two vertices are merged together
  *  - if eOrg->Org == eDst->Org, the origin is split into two vertices
  * In both cases, eDst->Org is changed and eOrg->Org is untouched.
  *
  * Similarly (and independently) for the face structure,
  *  - if eOrg->Lface == eDst->Lface, one loop is split into two
  *  - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
  * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
  *
  * Some special cases:
  * If eDst == eOrg, the operation has no effect.
  * If eDst == eOrg->Lnext, the new face will have a single edge.
  * If eDst == eOrg->Lprev, the old face will have a single edge.
  * If eDst == eOrg->Onext, the new vertex will have a single edge.
  * If eDst == eOrg->Oprev, the old vertex will have a single edge.
  */
  //int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
  splice: function(A, e) {
    var t = !1, i = !1;
    if (A !== e) {
      if (e.Org !== A.Org && (i = !0, this.killVertex_(e.Org, A.Org)), e.Lface !== A.Lface && (t = !0, this.killFace_(e.Lface, A.Lface)), this.splice_(e, A), !i) {
        var n = new Xb();
        this.makeVertex_(n, e, A.Org), A.Org.anEdge = A;
      }
      if (!t) {
        var o = new VJ();
        this.makeFace_(o, e, A.Lface), A.Lface.anEdge = A;
      }
    }
  },
  /* tessMeshDelete( eDel ) removes the edge eDel.  There are several cases:
  * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
  * eDel->Lface is deleted.  Otherwise, we are splitting one loop into two;
  * the newly created loop will contain eDel->Dst.  If the deletion of eDel
  * would create isolated vertices, those are deleted as well.
  *
  * This function could be implemented as two calls to tessMeshSplice
  * plus a few calls to memFree, but this would allocate and delete
  * unnecessary vertices and faces.
  */
  //int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
  delete: function(A) {
    var e = A.Sym, t = !1;
    if (A.Lface !== A.Rface && (t = !0, this.killFace_(A.Lface, A.Rface)), A.Onext === A)
      this.killVertex_(A.Org, null);
    else if (A.Rface.anEdge = A.Oprev, A.Org.anEdge = A.Onext, this.splice_(A, A.Oprev), !t) {
      var i = new VJ();
      this.makeFace_(i, A, A.Lface);
    }
    e.Onext === e ? (this.killVertex_(e.Org, null), this.killFace_(e.Lface, null)) : (A.Lface.anEdge = e.Oprev, e.Org.anEdge = e.Onext, this.splice_(e, e.Oprev)), this.killEdge_(A);
  },
  /******************** Other Edge Operations **********************/
  /* All these routines can be implemented with the basic edge
  * operations above.  They are provided for convenience and efficiency.
  */
  /* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
  * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
  * eOrg and eNew will have the same left face.
  */
  // TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
  addEdgeVertex: function(A) {
    var e = this.makeEdge_(A), t = e.Sym;
    this.splice_(e, A.Lnext), e.Org = A.Dst;
    var i = new Xb();
    return this.makeVertex_(i, t, e.Org), e.Lface = t.Lface = A.Lface, e;
  },
  /* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
  * such that eNew == eOrg->Lnext.  The new vertex is eOrg->Dst == eNew->Org.
  * eOrg and eNew will have the same left face.
  */
  // TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
  splitEdge: function(A, e) {
    var t = this.addEdgeVertex(A), i = t.Sym;
    return this.splice_(A.Sym, A.Sym.Oprev), this.splice_(A.Sym, i), A.Dst = i.Org, i.Dst.anEdge = i.Sym, i.Rface = A.Rface, i.winding = A.winding, i.Sym.winding = A.Sym.winding, i;
  },
  /* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
  * to eDst->Org, and returns the corresponding half-edge eNew.
  * If eOrg->Lface == eDst->Lface, this splits one loop into two,
  * and the newly created loop is eNew->Lface.  Otherwise, two disjoint
  * loops are merged into one, and the loop eDst->Lface is destroyed.
  *
  * If (eOrg == eDst), the new face will have only two edges.
  * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
  * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
  */
  // TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
  connect: function(A, e) {
    var t = !1, i = this.makeEdge_(A), n = i.Sym;
    if (e.Lface !== A.Lface && (t = !0, this.killFace_(e.Lface, A.Lface)), this.splice_(i, A.Lnext), this.splice_(n, e), i.Org = A.Dst, n.Org = e.Org, i.Lface = n.Lface = A.Lface, A.Lface.anEdge = n, !t) {
      var o = new VJ();
      this.makeFace_(o, i, A.Lface);
    }
    return i;
  },
  /* tessMeshZapFace( fZap ) destroys a face and removes it from the
  * global face list.  All edges of fZap will have a NULL pointer as their
  * left face.  Any edges which also have a NULL pointer as their right face
  * are deleted entirely (along with any isolated vertices this produces).
  * An entire mesh can be deleted by zapping its faces, one at a time,
  * in any order.  Zapped faces cannot be used in further mesh operations!
  */
  zapFace: function(A) {
    var e = A.anEdge, t, i, n, o, g;
    i = e.Lnext;
    do
      t = i, i = t.Lnext, t.Lface = null, t.Rface === null && (t.Onext === t ? this.killVertex_(t.Org, null) : (t.Org.anEdge = t.Onext, this.splice_(t, t.Oprev)), n = t.Sym, n.Onext === n ? this.killVertex_(n.Org, null) : (n.Org.anEdge = n.Onext, this.splice_(n, n.Oprev)), this.killEdge_(t));
    while (t != e);
    o = A.prev, g = A.next, g.prev = o, o.next = g;
  },
  countFaceVerts_: function(A) {
    var e = A.anEdge, t = 0;
    do
      t++, e = e.Lnext;
    while (e !== A.anEdge);
    return t;
  },
  //int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
  mergeConvexFaces: function(A) {
    var e, t, i, n, o, g, s;
    for (e = this.fHead.next; e !== this.fHead; e = e.next)
      if (e.inside)
        for (t = e.anEdge, o = t.Org; i = t.Lnext, n = t.Sym, n && n.Lface && n.Lface.inside && (g = this.countFaceVerts_(e), s = this.countFaceVerts_(n.Lface), g + s - 2 <= A && TA.vertCCW(t.Lprev.Org, t.Org, n.Lnext.Lnext.Org) && TA.vertCCW(n.Lprev.Org, n.Org, t.Lnext.Lnext.Org) && (i = n.Lnext, this.delete(n), t = null, n = null)), !(t && t.Lnext.Org === o); )
          t = i;
    return !0;
  },
  /* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
  */
  check: function() {
    var A = this.fHead, e = this.vHead, t = this.eHead, i, n, o, g, s, I;
    for (n = A, n = A; (i = n.next) !== A; n = i) {
      Me(i.prev === n), s = i.anEdge;
      do
        Me(s.Sym !== s), Me(s.Sym.Sym === s), Me(s.Lnext.Onext.Sym === s), Me(s.Onext.Sym.Lnext === s), Me(s.Lface === i), s = s.Lnext;
      while (s !== i.anEdge);
    }
    for (Me(i.prev === n && i.anEdge === null), g = e, g = e; (o = g.next) !== e; g = o) {
      Me(o.prev === g), s = o.anEdge;
      do
        Me(s.Sym !== s), Me(s.Sym.Sym === s), Me(s.Lnext.Onext.Sym === s), Me(s.Onext.Sym.Lnext === s), Me(s.Org === o), s = s.Onext;
      while (s !== o.anEdge);
    }
    for (Me(o.prev === g && o.anEdge === null), I = t, I = t; (s = I.next) !== t; I = s)
      Me(s.Sym.next === I.Sym), Me(s.Sym !== s), Me(s.Sym.Sym === s), Me(s.Org !== null), Me(s.Dst !== null), Me(s.Lnext.Onext.Sym === s), Me(s.Onext.Sym.Lnext === s);
    Me(s.Sym.next === I.Sym && s.Sym === this.eHeadSym && s.Sym.Sym === s && s.Org === null && s.Dst === null && s.Lface === null && s.Rface === null);
  }
};
var TA = {};
TA.vertEq = function(A, e) {
  return A.s === e.s && A.t === e.t;
};
TA.vertLeq = function(A, e) {
  return A.s < e.s || A.s === e.s && A.t <= e.t;
};
TA.transLeq = function(A, e) {
  return A.t < e.t || A.t === e.t && A.s <= e.s;
};
TA.edgeGoesLeft = function(A) {
  return TA.vertLeq(A.Dst, A.Org);
};
TA.edgeGoesRight = function(A) {
  return TA.vertLeq(A.Org, A.Dst);
};
TA.vertL1dist = function(A, e) {
  return Math.abs(A.s - e.s) + Math.abs(A.t - e.t);
};
TA.edgeEval = function(A, e, t) {
  Me(TA.vertLeq(A, e) && TA.vertLeq(e, t));
  var i = e.s - A.s, n = t.s - e.s;
  return i + n > 0 ? i < n ? e.t - A.t + (A.t - t.t) * (i / (i + n)) : e.t - t.t + (t.t - A.t) * (n / (i + n)) : 0;
};
TA.edgeSign = function(A, e, t) {
  Me(TA.vertLeq(A, e) && TA.vertLeq(e, t));
  var i = e.s - A.s, n = t.s - e.s;
  return i + n > 0 ? (e.t - t.t) * i + (e.t - A.t) * n : 0;
};
TA.transEval = function(A, e, t) {
  Me(TA.transLeq(A, e) && TA.transLeq(e, t));
  var i = e.t - A.t, n = t.t - e.t;
  return i + n > 0 ? i < n ? e.s - A.s + (A.s - t.s) * (i / (i + n)) : e.s - t.s + (t.s - A.s) * (n / (i + n)) : 0;
};
TA.transSign = function(A, e, t) {
  Me(TA.transLeq(A, e) && TA.transLeq(e, t));
  var i = e.t - A.t, n = t.t - e.t;
  return i + n > 0 ? (e.s - t.s) * i + (e.s - A.s) * n : 0;
};
TA.vertCCW = function(A, e, t) {
  return A.s * (e.t - t.t) + e.s * (t.t - A.t) + t.s * (A.t - e.t) >= 0;
};
TA.interpolate = function(A, e, t, i) {
  return A = A < 0 ? 0 : A, t = t < 0 ? 0 : t, A <= t ? t == 0 ? (e + i) / 2 : e + (i - e) * (A / (A + t)) : i + (e - i) * (t / (A + t));
};
TA.intersect = function(A, e, t, i, n) {
  var o, g, s;
  TA.vertLeq(A, e) || (s = A, A = e, e = s), TA.vertLeq(t, i) || (s = t, t = i, i = s), TA.vertLeq(A, t) || (s = A, A = t, t = s, s = e, e = i, i = s), TA.vertLeq(t, e) ? TA.vertLeq(e, i) ? (o = TA.edgeEval(A, t, e), g = TA.edgeEval(t, e, i), o + g < 0 && (o = -o, g = -g), n.s = TA.interpolate(o, t.s, g, e.s)) : (o = TA.edgeSign(A, t, e), g = -TA.edgeSign(A, i, e), o + g < 0 && (o = -o, g = -g), n.s = TA.interpolate(o, t.s, g, i.s)) : n.s = (t.s + e.s) / 2, TA.transLeq(A, e) || (s = A, A = e, e = s), TA.transLeq(t, i) || (s = t, t = i, i = s), TA.transLeq(A, t) || (s = A, A = t, t = s, s = e, e = i, i = s), TA.transLeq(t, e) ? TA.transLeq(e, i) ? (o = TA.transEval(A, t, e), g = TA.transEval(t, e, i), o + g < 0 && (o = -o, g = -g), n.t = TA.interpolate(o, t.t, g, e.t)) : (o = TA.transSign(A, t, e), g = -TA.transSign(A, i, e), o + g < 0 && (o = -o, g = -g), n.t = TA.interpolate(o, t.t, g, i.t)) : n.t = (t.t + e.t) / 2;
};
function D5A() {
  this.key = null, this.next = null, this.prev = null;
}
function G5A(A, e) {
  this.head = new D5A(), this.head.next = this.head, this.head.prev = this.head, this.frame = A, this.leq = e;
}
G5A.prototype = {
  min: function() {
    return this.head.next;
  },
  max: function() {
    return this.head.prev;
  },
  insert: function(A) {
    return this.insertBefore(this.head, A);
  },
  search: function(A) {
    var e = this.head;
    do
      e = e.next;
    while (e.key !== null && !this.leq(this.frame, A, e.key));
    return e;
  },
  insertBefore: function(A, e) {
    do
      A = A.prev;
    while (A.key !== null && !this.leq(this.frame, A.key, e));
    var t = new D5A();
    return t.key = e, t.next = A.next, A.next.prev = t, t.prev = A, A.next = t, t;
  },
  delete: function(A) {
    A.next.prev = A.prev, A.prev.next = A.next;
  }
};
function k5A() {
  this.handle = null;
}
function J5A() {
  this.key = null, this.node = null;
}
function N5A(A, e) {
  this.size = 0, this.max = A, this.nodes = [], this.nodes.length = A + 1;
  for (var t = 0; t < this.nodes.length; t++)
    this.nodes[t] = new k5A();
  this.handles = [], this.handles.length = A + 1;
  for (var t = 0; t < this.handles.length; t++)
    this.handles[t] = new J5A();
  this.initialized = !1, this.freeList = 0, this.leq = e, this.nodes[1].handle = 1, this.handles[1].key = null;
}
N5A.prototype = {
  floatDown_: function(A) {
    var e = this.nodes, t = this.handles, i, n, o;
    for (i = e[A].handle; ; ) {
      if (o = A << 1, o < this.size && this.leq(t[e[o + 1].handle].key, t[e[o].handle].key) && ++o, Me(o <= this.max), n = e[o].handle, o > this.size || this.leq(t[i].key, t[n].key)) {
        e[A].handle = i, t[i].node = A;
        break;
      }
      e[A].handle = n, t[n].node = A, A = o;
    }
  },
  floatUp_: function(A) {
    var e = this.nodes, t = this.handles, i, n, o;
    for (i = e[A].handle; ; ) {
      if (o = A >> 1, n = e[o].handle, o == 0 || this.leq(t[n].key, t[i].key)) {
        e[A].handle = i, t[i].node = A;
        break;
      }
      e[A].handle = n, t[n].node = A, A = o;
    }
  },
  init: function() {
    for (var A = this.size; A >= 1; --A)
      this.floatDown_(A);
    this.initialized = !0;
  },
  min: function() {
    return this.handles[this.nodes[1].handle].key;
  },
  isEmpty: function() {
    this.size;
  },
  /* really pqHeapInsert */
  /* returns INV_HANDLE iff out of memory */
  //PQhandle pqHeapInsert( TESSalloc* alloc, PriorityQHeap *pq, PQkey keyNew )
  insert: function(A) {
    var e, t;
    if (e = ++this.size, e * 2 > this.max) {
      this.max *= 2;
      var i;
      i = this.nodes.length, this.nodes.length = this.max + 1;
      for (var n = i; n < this.nodes.length; n++)
        this.nodes[n] = new k5A();
      i = this.handles.length, this.handles.length = this.max + 1;
      for (var n = i; n < this.handles.length; n++)
        this.handles[n] = new J5A();
    }
    return this.freeList === 0 ? t = e : (t = this.freeList, this.freeList = this.handles[t].node), this.nodes[e].handle = t, this.handles[t].node = e, this.handles[t].key = A, this.initialized && this.floatUp_(e), t;
  },
  //PQkey pqHeapExtractMin( PriorityQHeap *pq )
  extractMin: function() {
    var A = this.nodes, e = this.handles, t = A[1].handle, i = e[t].key;
    return this.size > 0 && (A[1].handle = A[this.size].handle, e[A[1].handle].node = 1, e[t].key = null, e[t].node = this.freeList, this.freeList = t, --this.size, this.size > 0 && this.floatDown_(1)), i;
  },
  delete: function(A) {
    var e = this.nodes, t = this.handles, i;
    Me(A >= 1 && A <= this.max && t[A].key !== null), i = t[A].node, e[i].handle = e[this.size].handle, t[e[i].handle].node = i, --this.size, i <= this.size && (i <= 1 || this.leq(t[e[i >> 1].handle].key, t[e[i].handle].key) ? this.floatDown_(i) : this.floatUp_(i)), t[A].key = null, t[A].node = this.freeList, this.freeList = A;
  }
};
function EsA() {
  this.eUp = null, this.nodeUp = null, this.windingNumber = 0, this.inside = !1, this.sentinel = !1, this.dirty = !1, this.fixUpperEdge = !1;
}
var MA = {};
MA.regionBelow = function(A) {
  return A.nodeUp.prev.key;
};
MA.regionAbove = function(A) {
  return A.nodeUp.next.key;
};
MA.debugEvent = function(A) {
};
MA.addWinding = function(A, e) {
  A.winding += e.winding, A.Sym.winding += e.Sym.winding;
};
MA.edgeLeq = function(A, e, t) {
  var i = A.event, g, s, n = e.eUp, o = t.eUp;
  if (n.Dst === i)
    return o.Dst === i ? TA.vertLeq(n.Org, o.Org) ? TA.edgeSign(o.Dst, n.Org, o.Org) <= 0 : TA.edgeSign(n.Dst, o.Org, n.Org) >= 0 : TA.edgeSign(o.Dst, i, o.Org) <= 0;
  if (o.Dst === i)
    return TA.edgeSign(n.Dst, i, n.Org) >= 0;
  var g = TA.edgeEval(n.Dst, i, n.Org), s = TA.edgeEval(o.Dst, i, o.Org);
  return g >= s;
};
MA.deleteRegion = function(A, e) {
  e.fixUpperEdge && Me(e.eUp.winding === 0), e.eUp.activeRegion = null, A.dict.delete(e.nodeUp);
};
MA.fixUpperEdge = function(A, e, t) {
  Me(e.fixUpperEdge), A.mesh.delete(e.eUp), e.fixUpperEdge = !1, e.eUp = t, t.activeRegion = e;
};
MA.topLeftRegion = function(A, e) {
  var t = e.eUp.Org, i;
  do
    e = MA.regionAbove(e);
  while (e.eUp.Org === t);
  if (e.fixUpperEdge) {
    if (i = A.mesh.connect(MA.regionBelow(e).eUp.Sym, e.eUp.Lnext), i === null)
      return null;
    MA.fixUpperEdge(A, e, i), e = MA.regionAbove(e);
  }
  return e;
};
MA.topRightRegion = function(t) {
  var e = t.eUp.Dst, t = null;
  do
    t = MA.regionAbove(t);
  while (t.eUp.Dst === e);
  return t;
};
MA.addRegionBelow = function(A, e, t) {
  var i = new EsA();
  return i.eUp = t, i.nodeUp = A.dict.insertBefore(e.nodeUp, i), i.fixUpperEdge = !1, i.sentinel = !1, i.dirty = !1, t.activeRegion = i, i;
};
MA.isWindingInside = function(A, e) {
  switch (A.windingRule) {
    case vn.WINDING_ODD:
      return (e & 1) != 0;
    case vn.WINDING_NONZERO:
      return e != 0;
    case vn.WINDING_POSITIVE:
      return e > 0;
    case vn.WINDING_NEGATIVE:
      return e < 0;
    case vn.WINDING_ABS_GEQ_TWO:
      return e >= 2 || e <= -2;
  }
  return Me(!1), !1;
};
MA.computeWinding = function(A, e) {
  e.windingNumber = MA.regionAbove(e).windingNumber + e.eUp.winding, e.inside = MA.isWindingInside(A, e.windingNumber);
};
MA.finishRegion = function(A, e) {
  var t = e.eUp, i = t.Lface;
  i.inside = e.inside, i.anEdge = t, MA.deleteRegion(A, e);
};
MA.finishLeftRegions = function(A, e, t) {
  for (var i, g, n = null, o = e, g = e.eUp; o !== t; ) {
    if (o.fixUpperEdge = !1, n = MA.regionBelow(o), i = n.eUp, i.Org != g.Org) {
      if (!n.fixUpperEdge) {
        MA.finishRegion(A, o);
        break;
      }
      i = A.mesh.connect(g.Lprev, i.Sym), MA.fixUpperEdge(A, n, i);
    }
    g.Onext !== i && (A.mesh.splice(i.Oprev, i), A.mesh.splice(g, i)), MA.finishRegion(A, o), g = n.eUp, o = n;
  }
  return g;
};
MA.addRightEdges = function(A, e, t, i, n, o) {
  var g, s, I, r, a = !0;
  I = t;
  do
    Me(TA.vertLeq(I.Org, I.Dst)), MA.addRegionBelow(A, e, I.Sym), I = I.Onext;
  while (I !== i);
  for (n === null && (n = MA.regionBelow(e).eUp.Rprev), s = e, r = n; g = MA.regionBelow(s), I = g.eUp.Sym, I.Org === r.Org; )
    I.Onext !== r && (A.mesh.splice(I.Oprev, I), A.mesh.splice(r.Oprev, I)), g.windingNumber = s.windingNumber - I.winding, g.inside = MA.isWindingInside(A, g.windingNumber), s.dirty = !0, !a && MA.checkForRightSplice(A, s) && (MA.addWinding(I, r), MA.deleteRegion(A, s), A.mesh.delete(r)), a = !1, s = g, r = I;
  s.dirty = !0, Me(s.windingNumber - I.winding === g.windingNumber), o && MA.walkDirtyRegions(A, s);
};
MA.spliceMergeVertices = function(A, e, t) {
  A.mesh.splice(e, t);
};
MA.vertexWeights = function(A, e, t) {
  var i = TA.vertL1dist(e, A), n = TA.vertL1dist(t, A), o = 0.5 * n / (i + n), g = 0.5 * i / (i + n);
  A.coords[0] += o * e.coords[0] + g * t.coords[0], A.coords[1] += o * e.coords[1] + g * t.coords[1], A.coords[2] += o * e.coords[2] + g * t.coords[2];
};
MA.getIntersectData = function(A, e, t, i, n, o) {
  e.coords[0] = e.coords[1] = e.coords[2] = 0, e.idx = -1, MA.vertexWeights(e, t, i), MA.vertexWeights(e, n, o);
};
MA.checkForRightSplice = function(A, e) {
  var t = MA.regionBelow(e), i = e.eUp, n = t.eUp;
  if (TA.vertLeq(i.Org, n.Org)) {
    if (TA.edgeSign(n.Dst, i.Org, n.Org) > 0)
      return !1;
    TA.vertEq(i.Org, n.Org) ? i.Org !== n.Org && (A.pq.delete(i.Org.pqHandle), MA.spliceMergeVertices(A, n.Oprev, i)) : (A.mesh.splitEdge(n.Sym), A.mesh.splice(i, n.Oprev), e.dirty = t.dirty = !0);
  } else {
    if (TA.edgeSign(i.Dst, n.Org, i.Org) < 0)
      return !1;
    MA.regionAbove(e).dirty = e.dirty = !0, A.mesh.splitEdge(i.Sym), A.mesh.splice(n.Oprev, i);
  }
  return !0;
};
MA.checkForLeftSplice = function(A, e) {
  var t = MA.regionBelow(e), i = e.eUp, n = t.eUp, o;
  if (Me(!TA.vertEq(i.Dst, n.Dst)), TA.vertLeq(i.Dst, n.Dst)) {
    if (TA.edgeSign(i.Dst, n.Dst, i.Org) < 0)
      return !1;
    MA.regionAbove(e).dirty = e.dirty = !0, o = A.mesh.splitEdge(i), A.mesh.splice(n.Sym, o), o.Lface.inside = e.inside;
  } else {
    if (TA.edgeSign(n.Dst, i.Dst, n.Org) > 0)
      return !1;
    e.dirty = t.dirty = !0, o = A.mesh.splitEdge(n), A.mesh.splice(i.Lnext, n.Sym), o.Rface.inside = e.inside;
  }
  return !0;
};
MA.checkForIntersect = function(A, e) {
  var t = MA.regionBelow(e), i = e.eUp, n = t.eUp, o = i.Org, g = n.Org, s = i.Dst, I = n.Dst, r, a, C = new Xb(), B, l;
  if (Me(!TA.vertEq(I, s)), Me(TA.edgeSign(s, A.event, o) <= 0), Me(TA.edgeSign(I, A.event, g) >= 0), Me(o !== A.event && g !== A.event), Me(!e.fixUpperEdge && !t.fixUpperEdge), o === g || (r = Math.min(o.t, s.t), a = Math.max(g.t, I.t), r > a))
    return !1;
  if (TA.vertLeq(o, g)) {
    if (TA.edgeSign(I, o, g) > 0)
      return !1;
  } else if (TA.edgeSign(s, g, o) < 0)
    return !1;
  return MA.debugEvent(A), TA.intersect(s, o, I, g, C), Me(Math.min(o.t, s.t) <= C.t), Me(C.t <= Math.max(g.t, I.t)), Me(Math.min(I.s, s.s) <= C.s), Me(C.s <= Math.max(g.s, o.s)), TA.vertLeq(C, A.event) && (C.s = A.event.s, C.t = A.event.t), B = TA.vertLeq(o, g) ? o : g, TA.vertLeq(B, C) && (C.s = B.s, C.t = B.t), TA.vertEq(C, o) || TA.vertEq(C, g) ? (MA.checkForRightSplice(A, e), !1) : !TA.vertEq(s, A.event) && TA.edgeSign(s, A.event, C) >= 0 || !TA.vertEq(I, A.event) && TA.edgeSign(I, A.event, C) <= 0 ? I === A.event ? (A.mesh.splitEdge(i.Sym), A.mesh.splice(n.Sym, i), e = MA.topLeftRegion(A, e), i = MA.regionBelow(e).eUp, MA.finishLeftRegions(A, MA.regionBelow(e), t), MA.addRightEdges(A, e, i.Oprev, i, i, !0), TRUE) : s === A.event ? (A.mesh.splitEdge(n.Sym), A.mesh.splice(i.Lnext, n.Oprev), t = e, e = MA.topRightRegion(e), l = MA.regionBelow(e).eUp.Rprev, t.eUp = n.Oprev, n = MA.finishLeftRegions(A, t, null), MA.addRightEdges(A, e, n.Onext, i.Rprev, l, !0), !0) : (TA.edgeSign(s, A.event, C) >= 0 && (MA.regionAbove(e).dirty = e.dirty = !0, A.mesh.splitEdge(i.Sym), i.Org.s = A.event.s, i.Org.t = A.event.t), TA.edgeSign(I, A.event, C) <= 0 && (e.dirty = t.dirty = !0, A.mesh.splitEdge(n.Sym), n.Org.s = A.event.s, n.Org.t = A.event.t), !1) : (A.mesh.splitEdge(i.Sym), A.mesh.splitEdge(n.Sym), A.mesh.splice(n.Oprev, i), i.Org.s = C.s, i.Org.t = C.t, i.Org.pqHandle = A.pq.insert(i.Org), MA.getIntersectData(A, i.Org, o, s, g, I), MA.regionAbove(e).dirty = e.dirty = t.dirty = !0, !1);
};
MA.walkDirtyRegions = function(A, e) {
  for (var t = MA.regionBelow(e), i, n; ; ) {
    for (; t.dirty; )
      e = t, t = MA.regionBelow(t);
    if (!e.dirty && (t = e, e = MA.regionAbove(e), e == null || !e.dirty))
      return;
    if (e.dirty = !1, i = e.eUp, n = t.eUp, i.Dst !== n.Dst && MA.checkForLeftSplice(A, e) && (t.fixUpperEdge ? (MA.deleteRegion(A, t), A.mesh.delete(n), t = MA.regionBelow(e), n = t.eUp) : e.fixUpperEdge && (MA.deleteRegion(A, e), A.mesh.delete(i), e = MA.regionAbove(t), i = e.eUp)), i.Org !== n.Org)
      if (i.Dst !== n.Dst && !e.fixUpperEdge && !t.fixUpperEdge && (i.Dst === A.event || n.Dst === A.event)) {
        if (MA.checkForIntersect(A, e))
          return;
      } else
        MA.checkForRightSplice(A, e);
    i.Org === n.Org && i.Dst === n.Dst && (MA.addWinding(n, i), MA.deleteRegion(A, e), A.mesh.delete(i), e = MA.regionAbove(t));
  }
};
MA.connectRightVertex = function(A, e, t) {
  var i, n = t.Onext, o = MA.regionBelow(e), g = e.eUp, s = o.eUp, I = !1;
  if (g.Dst !== s.Dst && MA.checkForIntersect(A, e), TA.vertEq(g.Org, A.event) && (A.mesh.splice(n.Oprev, g), e = MA.topLeftRegion(A, e), n = MA.regionBelow(e).eUp, MA.finishLeftRegions(A, MA.regionBelow(e), o), I = !0), TA.vertEq(s.Org, A.event) && (A.mesh.splice(t, s.Oprev), t = MA.finishLeftRegions(A, o, null), I = !0), I) {
    MA.addRightEdges(A, e, t.Onext, n, n, !0);
    return;
  }
  TA.vertLeq(s.Org, g.Org) ? i = s.Oprev : i = g, i = A.mesh.connect(t.Lprev, i), MA.addRightEdges(A, e, i, i.Onext, i.Onext, !1), i.Sym.activeRegion.fixUpperEdge = !0, MA.walkDirtyRegions(A, e);
};
MA.connectLeftDegenerate = function(A, e, t) {
  var i, n, o, g, s;
  if (i = e.eUp, TA.vertEq(i.Org, t)) {
    Me(
      !1
      /*TOLERANCE_NONZERO*/
    ), MA.spliceMergeVertices(A, i, t.anEdge);
    return;
  }
  if (!TA.vertEq(i.Dst, t)) {
    A.mesh.splitEdge(i.Sym), e.fixUpperEdge && (A.mesh.delete(i.Onext), e.fixUpperEdge = !1), A.mesh.splice(t.anEdge, i), MA.sweepEvent(A, t);
    return;
  }
  Me(
    !1
    /*TOLERANCE_NONZERO*/
  ), e = MA.topRightRegion(e), s = MA.regionBelow(e), o = s.eUp.Sym, n = g = o.Onext, s.fixUpperEdge && (Me(n !== o), MA.deleteRegion(A, s), A.mesh.delete(o), o = n.Oprev), A.mesh.splice(t.anEdge, o), TA.edgeGoesLeft(n) || (n = null), MA.addRightEdges(A, e, o.Onext, g, n, !0);
};
MA.connectLeftVertex = function(A, e) {
  var t, i, n, o, g, s, I = new EsA();
  if (I.eUp = e.anEdge.Sym, t = A.dict.search(I).key, i = MA.regionBelow(t), !!i) {
    if (o = t.eUp, g = i.eUp, TA.edgeSign(o.Dst, e, o.Org) === 0) {
      MA.connectLeftDegenerate(A, t, e);
      return;
    }
    if (n = TA.vertLeq(g.Dst, o.Dst) ? t : i, t.inside || n.fixUpperEdge) {
      if (n === t)
        s = A.mesh.connect(e.anEdge.Sym, o.Lnext);
      else {
        var r = A.mesh.connect(g.Dnext, e.anEdge);
        s = r.Sym;
      }
      n.fixUpperEdge ? MA.fixUpperEdge(A, n, s) : MA.computeWinding(A, MA.addRegionBelow(A, t, s)), MA.sweepEvent(A, e);
    } else
      MA.addRightEdges(A, t, e.anEdge, e.anEdge, null, !0);
  }
};
MA.sweepEvent = function(A, e) {
  A.event = e, MA.debugEvent(A);
  for (var t = e.anEdge; t.activeRegion === null; )
    if (t = t.Onext, t == e.anEdge) {
      MA.connectLeftVertex(A, e);
      return;
    }
  var i = MA.topLeftRegion(A, t.activeRegion);
  Me(i !== null);
  var n = MA.regionBelow(i), o = n.eUp, g = MA.finishLeftRegions(A, n, null);
  g.Onext === o ? MA.connectRightVertex(A, i, g) : MA.addRightEdges(A, i, g.Onext, o, o, !0);
};
MA.addSentinel = function(A, e, t, i) {
  var n = new EsA(), o = A.mesh.makeEdge();
  o.Org.s = t, o.Org.t = i, o.Dst.s = e, o.Dst.t = i, A.event = o.Dst, n.eUp = o, n.windingNumber = 0, n.inside = !1, n.fixUpperEdge = !1, n.sentinel = !0, n.dirty = !1, n.nodeUp = A.dict.insert(n);
};
MA.initEdgeDict = function(A) {
  A.dict = new G5A(A, MA.edgeLeq);
  var e = A.bmax[0] - A.bmin[0], t = A.bmax[1] - A.bmin[1], i = A.bmin[0] - e, n = A.bmax[0] + e, o = A.bmin[1] - t, g = A.bmax[1] + t;
  MA.addSentinel(A, i, n, o), MA.addSentinel(A, i, n, g);
};
MA.doneEdgeDict = function(A) {
  for (var e, t = 0; (e = A.dict.min().key) !== null; )
    e.sentinel || (Me(e.fixUpperEdge), Me(++t == 1)), Me(e.windingNumber == 0), MA.deleteRegion(A, e);
};
MA.removeDegenerateEdges = function(A) {
  var e, t, i, n = A.mesh.eHead;
  for (e = n.next; e !== n; e = t)
    t = e.next, i = e.Lnext, TA.vertEq(e.Org, e.Dst) && e.Lnext.Lnext !== e && (MA.spliceMergeVertices(A, i, e), A.mesh.delete(e), e = i, i = e.Lnext), i.Lnext === e && (i !== e && ((i === t || i === t.Sym) && (t = t.next), A.mesh.delete(i)), (e === t || e === t.Sym) && (t = t.next), A.mesh.delete(e));
};
MA.initPriorityQ = function(A) {
  var e, t, i, n = 0;
  for (i = A.mesh.vHead, t = i.next; t !== i; t = t.next)
    n++;
  for (n += 8, e = A.pq = new N5A(n, TA.vertLeq), i = A.mesh.vHead, t = i.next; t !== i; t = t.next)
    t.pqHandle = e.insert(t);
  return t !== i ? !1 : (e.init(), !0);
};
MA.donePriorityQ = function(A) {
  A.pq = null;
};
MA.removeDegenerateFaces = function(A, e) {
  var t, i, n;
  for (t = e.fHead.next; t !== e.fHead; t = i)
    i = t.next, n = t.anEdge, Me(n.Lnext !== n), n.Lnext.Lnext === n && (MA.addWinding(n.Onext, n), A.mesh.delete(n));
  return !0;
};
MA.computeInterior = function(A) {
  var e, t;
  if (MA.removeDegenerateEdges(A), !MA.initPriorityQ(A))
    return !1;
  for (MA.initEdgeDict(A); (e = A.pq.extractMin()) !== null; ) {
    for (; t = A.pq.min(), !(t === null || !TA.vertEq(t, e)); )
      t = A.pq.extractMin(), MA.spliceMergeVertices(A, e.anEdge, t.anEdge);
    MA.sweepEvent(A, e);
  }
  return A.event = A.dict.min().key.eUp.Org, MA.debugEvent(A), MA.doneEdgeDict(A), MA.donePriorityQ(A), MA.removeDegenerateFaces(A, A.mesh) ? (A.mesh.check(), !0) : !1;
};
function Y5A() {
  this.mesh = null, this.normal = [0, 0, 0], this.sUnit = [0, 0, 0], this.tUnit = [0, 0, 0], this.bmin = [0, 0], this.bmax = [0, 0], this.windingRule = vn.WINDING_ODD, this.dict = null, this.pq = null, this.event = null, this.vertexIndexCounter = 0, this.vertices = [], this.vertexIndices = [], this.vertexCount = 0, this.elements = [], this.elementCount = 0;
}
Y5A.prototype = {
  dot_: function(A, e) {
    return A[0] * e[0] + A[1] * e[1] + A[2] * e[2];
  },
  normalize_: function(A) {
    var e = A[0] * A[0] + A[1] * A[1] + A[2] * A[2];
    Me(e > 0), e = Math.sqrt(e), A[0] /= e, A[1] /= e, A[2] /= e;
  },
  longAxis_: function(A) {
    var e = 0;
    return Math.abs(A[1]) > Math.abs(A[0]) && (e = 1), Math.abs(A[2]) > Math.abs(A[e]) && (e = 2), e;
  },
  computeNormal_: function(A) {
    var e, t, i, n, o, g, s = [0, 0, 0], I = [0, 0, 0], r = [0, 0, 0], a = [0, 0, 0], C = [0, 0, 0], B = [null, null, null], l = [null, null, null], Q = this.mesh.vHead, E;
    for (e = Q.next, E = 0; E < 3; ++E)
      n = e.coords[E], I[E] = n, l[E] = e, s[E] = n, B[E] = e;
    for (e = Q.next; e !== Q; e = e.next)
      for (E = 0; E < 3; ++E)
        n = e.coords[E], n < I[E] && (I[E] = n, l[E] = e), n > s[E] && (s[E] = n, B[E] = e);
    if (E = 0, s[1] - I[1] > s[0] - I[0] && (E = 1), s[2] - I[2] > s[E] - I[E] && (E = 2), I[E] >= s[E]) {
      A[0] = 0, A[1] = 0, A[2] = 1;
      return;
    }
    for (g = 0, t = l[E], i = B[E], r[0] = t.coords[0] - i.coords[0], r[1] = t.coords[1] - i.coords[1], r[2] = t.coords[2] - i.coords[2], e = Q.next; e !== Q; e = e.next)
      a[0] = e.coords[0] - i.coords[0], a[1] = e.coords[1] - i.coords[1], a[2] = e.coords[2] - i.coords[2], C[0] = r[1] * a[2] - r[2] * a[1], C[1] = r[2] * a[0] - r[0] * a[2], C[2] = r[0] * a[1] - r[1] * a[0], o = C[0] * C[0] + C[1] * C[1] + C[2] * C[2], o > g && (g = o, A[0] = C[0], A[1] = C[1], A[2] = C[2]);
    g <= 0 && (A[0] = A[1] = A[2] = 0, A[this.longAxis_(r)] = 1);
  },
  checkOrientation_: function() {
    var A, e, t = this.mesh.fHead, i, n = this.mesh.vHead, o;
    for (A = 0, e = t.next; e !== t; e = e.next)
      if (o = e.anEdge, !(o.winding <= 0))
        do
          A += (o.Org.s - o.Dst.s) * (o.Org.t + o.Dst.t), o = o.Lnext;
        while (o !== e.anEdge);
    if (A < 0) {
      for (i = n.next; i !== n; i = i.next)
        i.t = -i.t;
      this.tUnit[0] = -this.tUnit[0], this.tUnit[1] = -this.tUnit[1], this.tUnit[2] = -this.tUnit[2];
    }
  },
  /*	#ifdef FOR_TRITE_TEST_PROGRAM
  	#include <stdlib.h>
  	extern int RandomSweep;
  	#define S_UNIT_X	(RandomSweep ? (2*drand48()-1) : 1.0)
  	#define S_UNIT_Y	(RandomSweep ? (2*drand48()-1) : 0.0)
  	#else
  	#if defined(SLANTED_SWEEP) */
  /* The "feature merging" is not intended to be complete.  There are
  * special cases where edges are nearly parallel to the sweep line
  * which are not implemented.  The algorithm should still behave
  * robustly (ie. produce a reasonable tesselation) in the presence
  * of such edges, however it may miss features which could have been
  * merged.  We could minimize this effect by choosing the sweep line
  * direction to be something unusual (ie. not parallel to one of the
  * coordinate axes).
  */
  /*	#define S_UNIT_X	(TESSreal)0.50941539564955385	// Pre-normalized
  	#define S_UNIT_Y	(TESSreal)0.86052074622010633
  	#else
  	#define S_UNIT_X	(TESSreal)1.0
  	#define S_UNIT_Y	(TESSreal)0.0
  	#endif
  	#endif*/
  /* Determine the polygon normal and project vertices onto the plane
  * of the polygon.
  */
  projectPolygon_: function() {
    var A, e = this.mesh.vHead, t = [0, 0, 0], i, n, o, g, s = !1;
    for (t[0] = this.normal[0], t[1] = this.normal[1], t[2] = this.normal[2], t[0] === 0 && t[1] === 0 && t[2] === 0 && (this.computeNormal_(t), s = !0), i = this.sUnit, n = this.tUnit, o = this.longAxis_(t), i[o] = 0, i[(o + 1) % 3] = 1, i[(o + 2) % 3] = 0, n[o] = 0, n[(o + 1) % 3] = 0, n[(o + 2) % 3] = t[o] > 0 ? 1 : -1, A = e.next; A !== e; A = A.next)
      A.s = this.dot_(A.coords, i), A.t = this.dot_(A.coords, n);
    for (s && this.checkOrientation_(), g = !0, A = e.next; A !== e; A = A.next)
      g ? (this.bmin[0] = this.bmax[0] = A.s, this.bmin[1] = this.bmax[1] = A.t, g = !1) : (A.s < this.bmin[0] && (this.bmin[0] = A.s), A.s > this.bmax[0] && (this.bmax[0] = A.s), A.t < this.bmin[1] && (this.bmin[1] = A.t), A.t > this.bmax[1] && (this.bmax[1] = A.t));
  },
  addWinding_: function(A, e) {
    A.winding += e.winding, A.Sym.winding += e.Sym.winding;
  },
  /* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
  * (what else would it do??)  The region must consist of a single
  * loop of half-edges (see mesh.h) oriented CCW.  "Monotone" in this
  * case means that any vertical line intersects the interior of the
  * region in a single interval.  
  *
  * Tessellation consists of adding interior edges (actually pairs of
  * half-edges), to split the region into non-overlapping triangles.
  *
  * The basic idea is explained in Preparata and Shamos (which I don''t
  * have handy right now), although their implementation is more
  * complicated than this one.  The are two edge chains, an upper chain
  * and a lower chain.  We process all vertices from both chains in order,
  * from right to left.
  *
  * The algorithm ensures that the following invariant holds after each
  * vertex is processed: the untessellated region consists of two
  * chains, where one chain (say the upper) is a single edge, and
  * the other chain is concave.  The left vertex of the single edge
  * is always to the left of all vertices in the concave chain.
  *
  * Each step consists of adding the rightmost unprocessed vertex to one
  * of the two chains, and forming a fan of triangles from the rightmost
  * of two chain endpoints.  Determining whether we can add each triangle
  * to the fan is a simple orientation test.  By making the fan as large
  * as possible, we restore the invariant (check it yourself).
  */
  //	int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
  tessellateMonoRegion_: function(A, e) {
    var t, i;
    for (t = e.anEdge, Me(t.Lnext !== t && t.Lnext.Lnext !== t); TA.vertLeq(t.Dst, t.Org); t = t.Lprev)
      ;
    for (; TA.vertLeq(t.Org, t.Dst); t = t.Lnext)
      ;
    for (i = t.Lprev; t.Lnext !== i; )
      if (TA.vertLeq(t.Dst, i.Org)) {
        for (; i.Lnext !== t && (TA.edgeGoesLeft(i.Lnext) || TA.edgeSign(i.Org, i.Dst, i.Lnext.Dst) <= 0); ) {
          var n = A.connect(i.Lnext, i);
          i = n.Sym;
        }
        i = i.Lprev;
      } else {
        for (; i.Lnext != t && (TA.edgeGoesRight(t.Lprev) || TA.edgeSign(t.Dst, t.Org, t.Lprev.Org) >= 0); ) {
          var n = A.connect(t, t.Lprev);
          t = n.Sym;
        }
        t = t.Lnext;
      }
    for (Me(i.Lnext !== t); i.Lnext.Lnext !== t; ) {
      var n = A.connect(i.Lnext, i);
      i = n.Sym;
    }
    return !0;
  },
  /* tessMeshTessellateInterior( mesh ) tessellates each region of
  * the mesh which is marked "inside" the polygon.  Each such region
  * must be monotone.
  */
  //int tessMeshTessellateInterior( TESSmesh *mesh )
  tessellateInterior_: function(A) {
    var e, t;
    for (e = A.fHead.next; e !== A.fHead; e = t)
      if (t = e.next, e.inside && !this.tessellateMonoRegion_(A, e))
        return !1;
    return !0;
  },
  /* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
  * which are not marked "inside" the polygon.  Since further mesh operations
  * on NULL faces are not allowed, the main purpose is to clean up the
  * mesh so that exterior loops are not represented in the data structure.
  */
  //void tessMeshDiscardExterior( TESSmesh *mesh )
  discardExterior_: function(A) {
    var e, t;
    for (e = A.fHead.next; e !== A.fHead; e = t)
      t = e.next, e.inside || A.zapFace(e);
  },
  /* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
  * winding numbers on all edges so that regions marked "inside" the
  * polygon have a winding number of "value", and regions outside
  * have a winding number of 0.
  *
  * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
  * separate an interior region from an exterior one.
  */
  //	int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
  setWindingNumber_: function(A, e, t) {
    var i, n;
    for (i = A.eHead.next; i !== A.eHead; i = n)
      n = i.next, i.Rface.inside !== i.Lface.inside ? i.winding = i.Lface.inside ? e : -e : t ? A.delete(i) : i.winding = 0;
  },
  getNeighbourFace_: function(A) {
    return !A.Rface || !A.Rface.inside ? -1 : A.Rface.n;
  },
  outputPolymesh_: function(A, e, t, i) {
    var n, o, g, s = 0, I = 0, r, a;
    for (t > 3 && A.mergeConvexFaces(t), n = A.vHead.next; n !== A.vHead; n = n.next)
      n.n = -1;
    for (o = A.fHead.next; o != A.fHead; o = o.next)
      if (o.n = -1, !!o.inside) {
        g = o.anEdge, r = 0;
        do
          n = g.Org, n.n === -1 && (n.n = I, I++), r++, g = g.Lnext;
        while (g !== o.anEdge);
        Me(r <= t), o.n = s, ++s;
      }
    for (this.elementCount = s, e == vn.CONNECTED_POLYGONS && (s *= 2), this.elements = [], this.elements.length = s * t, this.vertexCount = I, this.vertices = [], this.vertices.length = I * i, this.vertexIndices = [], this.vertexIndices.length = I, n = A.vHead.next; n !== A.vHead; n = n.next)
      if (n.n != -1) {
        var C = n.n * i;
        this.vertices[C + 0] = n.coords[0], this.vertices[C + 1] = n.coords[1], i > 2 && (this.vertices[C + 2] = n.coords[2]), this.vertexIndices[n.n] = n.idx;
      }
    var B = 0;
    for (o = A.fHead.next; o !== A.fHead; o = o.next)
      if (o.inside) {
        g = o.anEdge, r = 0;
        do
          n = g.Org, this.elements[B++] = n.n, r++, g = g.Lnext;
        while (g !== o.anEdge);
        for (a = r; a < t; ++a)
          this.elements[B++] = -1;
        if (e == vn.CONNECTED_POLYGONS) {
          g = o.anEdge;
          do
            this.elements[B++] = this.getNeighbourFace_(g), g = g.Lnext;
          while (g !== o.anEdge);
          for (a = r; a < t; ++a)
            this.elements[B++] = -1;
        }
      }
  },
  //	void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
  outputContours_: function(A, e) {
    var t, i, n, o = 0, g = 0;
    for (this.vertexCount = 0, this.elementCount = 0, t = A.fHead.next; t !== A.fHead; t = t.next)
      if (t.inside) {
        n = i = t.anEdge;
        do
          this.vertexCount++, i = i.Lnext;
        while (i !== n);
        this.elementCount++;
      }
    this.elements = [], this.elements.length = this.elementCount * 2, this.vertices = [], this.vertices.length = this.vertexCount * e, this.vertexIndices = [], this.vertexIndices.length = this.vertexCount;
    var s = 0, I = 0, r = 0;
    for (o = 0, t = A.fHead.next; t !== A.fHead; t = t.next)
      if (t.inside) {
        g = 0, n = i = t.anEdge;
        do
          this.vertices[s++] = i.Org.coords[0], this.vertices[s++] = i.Org.coords[1], e > 2 && (this.vertices[s++] = i.Org.coords[2]), this.vertexIndices[I++] = i.Org.idx, g++, i = i.Lnext;
        while (i !== n);
        this.elements[r++] = o, this.elements[r++] = g, o += g;
      }
  },
  addContour: function(A, e) {
    var t, i;
    for (this.mesh === null && (this.mesh = new f5A()), A < 2 && (A = 2), A > 3 && (A = 3), t = null, i = 0; i < e.length; i += A)
      t == null ? (t = this.mesh.makeEdge(), this.mesh.splice(t, t.Sym)) : (this.mesh.splitEdge(t), t = t.Lnext), t.Org.coords[0] = e[i + 0], t.Org.coords[1] = e[i + 1], A > 2 ? t.Org.coords[2] = e[i + 2] : t.Org.coords[2] = 0, t.Org.idx = this.vertexIndexCounter++, t.winding = 1, t.Sym.winding = -1;
  },
  //	int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
  tesselate: function(A, e, t, i, n) {
    if (this.vertices = [], this.elements = [], this.vertexIndices = [], this.vertexIndexCounter = 0, n && (this.normal[0] = n[0], this.normal[1] = n[1], this.normal[2] = n[2]), this.windingRule = A, i < 2 && (i = 2), i > 3 && (i = 3), !this.mesh)
      return !1;
    this.projectPolygon_(), MA.computeInterior(this);
    var o = this.mesh;
    return e == vn.BOUNDARY_CONTOURS ? this.setWindingNumber_(o, 1, !0) : this.tessellateInterior_(o), o.check(), e == vn.BOUNDARY_CONTOURS ? this.outputContours_(o, i) : this.outputPolymesh_(o, e, t, i), !0;
  }
};
var syt = gyt, Iyt = ryt, ayt = Object.prototype.hasOwnProperty;
function ryt() {
  for (var A = {}, e = 0; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      ayt.call(t, i) && (A[i] = t[i]);
  }
  return A;
}
var i_ = syt, Cyt = Iyt, Byt = function(A, e) {
  if (e = e || {}, A = A.filter(function(a) {
    return a.length > 0;
  }), A.length === 0)
    return {
      positions: [],
      cells: []
    };
  typeof e.vertexSize != "number" && (e.vertexSize = A[0][0].length), A = A.map(function(a) {
    return a.reduce(function(C, B) {
      return C.concat(B);
    });
  });
  for (var t = i_.tesselate(Cyt({
    contours: A,
    windingRule: i_.WINDING_ODD,
    elementType: i_.POLYGONS,
    polySize: 3,
    vertexSize: 2
  }, e)), i = [], n = 0; n < t.vertices.length; n += e.vertexSize) {
    var o = t.vertices.slice(n, n + e.vertexSize);
    i.push(o);
  }
  var g = [];
  for (n = 0; n < t.elements.length; n += 3) {
    var s = t.elements[n], I = t.elements[n + 1], r = t.elements[n + 2];
    g.push([s, I, r]);
  }
  return {
    positions: i,
    cells: g
  };
};
const lyt = /* @__PURE__ */ Br(Byt);
function wG(A, e, t) {
  var i = e;
  if (A._pathCache[i])
    return A._pathCacheHit++, A._pathCache[i];
  if (A._pathCacheMiss++, t = t || 1, !e)
    return { lines: [], triangles: [], closed: !1, z: 0 };
  var n = oyt(L0t(e)), o;
  n = n.map(function(m) {
    return K0t(m, t);
  });
  try {
    o = lyt(n);
  } catch {
    o = { positions: [], cells: [] };
  }
  for (var g = A._randomZ ? 0.25 * (Math.random() - 0.5) : 0, s = [], I = o.cells.length, r = o.cells, a = o.positions, C = 0; C < I; C++) {
    var B = r[C], l = a[B[0]], Q = a[B[1]], E = a[B[2]];
    s.push(l[0], l[1], g, Q[0], Q[1], g, E[0], E[1], g);
  }
  var d = {
    lines: n,
    triangles: s,
    closed: e.endsWith("Z"),
    z: g,
    key: i
  };
  return A._pathCache[i] = d, A._pathCacheSize++, A._pathCacheSize > 1e4 && (A._pathCache = {}, A._pathCacheSize = 0), d;
}
function B1(A) {
  return A.x || 0;
}
function l1(A) {
  return A.y || 0;
}
function R5A(A) {
  return A.width || 0;
}
function cyt(A) {
  return A.width || A.height || 1;
}
function F5A(A) {
  return A.height || 0;
}
function Qyt(A) {
  return (A.x || 0) + (A.width || 0);
}
function Eyt(A) {
  return (A.y || 0) + (A.height || 0);
}
function usA(A) {
  return A.cornerRadius || 0;
}
function uyt(A) {
  return A.padAngle || 0;
}
function DX(A) {
  return A.defined !== !1;
}
function dyt(A) {
  return A.size == null ? 64 : A.size;
}
function hyt(A) {
  return ZtA(A.shape || "circle");
}
var EyA = VLA().cornerRadius(usA).padAngle(uyt), myt = hU().x(B1).y1(l1).y0(Eyt).defined(DX), pyt = hU().y(l1).x1(B1).x0(Qyt).defined(DX), yyt = wtA().x(B1).y(l1).defined(DX), byt = WtA().x(B1).y(l1).defined(DX).size(cyt);
DU().x(B1).y(l1).width(R5A).height(F5A).cornerRadius(usA);
var wyt = DU().x(0).y(0).width(R5A).height(F5A).cornerRadius(usA);
qLA().type(hyt).size(dyt);
function fyt(A, e) {
  return !A || A.arc ? EyA.context(A)(e) : wG(A, EyA.context(null)(e), 0.1);
}
function Dyt(A, e) {
  var t = e[0], i = t.interpolate || "linear", n = i === "trail" ? byt : (t.orient === "horizontal" ? pyt : myt).curve(uF(i, t.orient, t.tension));
  return !A || A.arc ? n.context(A)(e) : wG(A, n.context(null)(e), 0.1);
}
function Gyt(A, e) {
  var t = e.mark.shape || e.shape;
  return !A || A.arc ? t.context(A)(e) : wG(A, t.context(null)(e), 0.1);
}
function kyt(A, e) {
  var t = e[0], i = t.interpolate || "linear", n = yyt.curve(uF(i, t.orient, t.tension));
  return !A || A.arc ? n.context(A)(e) : wG(A, n.context(null)(e));
}
function Jyt(A, e, t, i) {
  return wG(A, wyt.context(null)(e, t, i), 0.1);
}
function c1(A, e, t) {
  var i = t.opacity == null ? 1 : t.opacity, n = e._tx + e._origin[0], o = e._ty + e._origin[1];
  i <= 0 || A.numTriangles !== 0 && (e.useProgram(e._shaderProgram), e.bindBuffer(e.ARRAY_BUFFER, A.triangleBuffer), e.vertexAttribPointer(e._coordLocation, 3, e.FLOAT, !1, 0, 0), e.enableVertexAttribArray(e._coordLocation), e._lastTriangleBuffer = A.triangleBuffer, e.bindBuffer(e.ARRAY_BUFFER, A.colorBuffer), e.vertexAttribPointer(e._colorLocation, 4, e.FLOAT, !1, 0, 0), e.enableVertexAttribArray(e._colorLocation), e._lastColorBuffer = A.colorBuffer, e.uniform2fv(e._offsetLocation, [n, o]), e.uniform4fv(e._clipLocation, e._clip), e.drawArrays(e.TRIANGLES, 0, A.numTriangles * 3));
}
function dsA(A, e, t) {
  A.prototype = e.prototype = t, t.constructor = A;
}
function M5A(A, e) {
  var t = Object.create(A.prototype);
  for (var i in e)
    t[i] = e[i];
  return t;
}
function Q1() {
}
var R2 = 0.7, iW = 1 / R2, yw = "\\s*([+-]?\\d+)\\s*", F2 = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", $B = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Nyt = /^#([0-9a-f]{3,8})$/, Yyt = new RegExp("^rgb\\(" + [yw, yw, yw] + "\\)$"), Ryt = new RegExp("^rgb\\(" + [$B, $B, $B] + "\\)$"), Fyt = new RegExp("^rgba\\(" + [yw, yw, yw, F2] + "\\)$"), Myt = new RegExp("^rgba\\(" + [$B, $B, $B, F2] + "\\)$"), xyt = new RegExp("^hsl\\(" + [F2, $B, $B] + "\\)$"), Lyt = new RegExp("^hsla\\(" + [F2, $B, $B, F2] + "\\)$"), uyA = {
  aliceblue: 15792383,
  antiquewhite: 16444375,
  aqua: 65535,
  aquamarine: 8388564,
  azure: 15794175,
  beige: 16119260,
  bisque: 16770244,
  black: 0,
  blanchedalmond: 16772045,
  blue: 255,
  blueviolet: 9055202,
  brown: 10824234,
  burlywood: 14596231,
  cadetblue: 6266528,
  chartreuse: 8388352,
  chocolate: 13789470,
  coral: 16744272,
  cornflowerblue: 6591981,
  cornsilk: 16775388,
  crimson: 14423100,
  cyan: 65535,
  darkblue: 139,
  darkcyan: 35723,
  darkgoldenrod: 12092939,
  darkgray: 11119017,
  darkgreen: 25600,
  darkgrey: 11119017,
  darkkhaki: 12433259,
  darkmagenta: 9109643,
  darkolivegreen: 5597999,
  darkorange: 16747520,
  darkorchid: 10040012,
  darkred: 9109504,
  darksalmon: 15308410,
  darkseagreen: 9419919,
  darkslateblue: 4734347,
  darkslategray: 3100495,
  darkslategrey: 3100495,
  darkturquoise: 52945,
  darkviolet: 9699539,
  deeppink: 16716947,
  deepskyblue: 49151,
  dimgray: 6908265,
  dimgrey: 6908265,
  dodgerblue: 2003199,
  firebrick: 11674146,
  floralwhite: 16775920,
  forestgreen: 2263842,
  fuchsia: 16711935,
  gainsboro: 14474460,
  ghostwhite: 16316671,
  gold: 16766720,
  goldenrod: 14329120,
  gray: 8421504,
  green: 32768,
  greenyellow: 11403055,
  grey: 8421504,
  honeydew: 15794160,
  hotpink: 16738740,
  indianred: 13458524,
  indigo: 4915330,
  ivory: 16777200,
  khaki: 15787660,
  lavender: 15132410,
  lavenderblush: 16773365,
  lawngreen: 8190976,
  lemonchiffon: 16775885,
  lightblue: 11393254,
  lightcoral: 15761536,
  lightcyan: 14745599,
  lightgoldenrodyellow: 16448210,
  lightgray: 13882323,
  lightgreen: 9498256,
  lightgrey: 13882323,
  lightpink: 16758465,
  lightsalmon: 16752762,
  lightseagreen: 2142890,
  lightskyblue: 8900346,
  lightslategray: 7833753,
  lightslategrey: 7833753,
  lightsteelblue: 11584734,
  lightyellow: 16777184,
  lime: 65280,
  limegreen: 3329330,
  linen: 16445670,
  magenta: 16711935,
  maroon: 8388608,
  mediumaquamarine: 6737322,
  mediumblue: 205,
  mediumorchid: 12211667,
  mediumpurple: 9662683,
  mediumseagreen: 3978097,
  mediumslateblue: 8087790,
  mediumspringgreen: 64154,
  mediumturquoise: 4772300,
  mediumvioletred: 13047173,
  midnightblue: 1644912,
  mintcream: 16121850,
  mistyrose: 16770273,
  moccasin: 16770229,
  navajowhite: 16768685,
  navy: 128,
  oldlace: 16643558,
  olive: 8421376,
  olivedrab: 7048739,
  orange: 16753920,
  orangered: 16729344,
  orchid: 14315734,
  palegoldenrod: 15657130,
  palegreen: 10025880,
  paleturquoise: 11529966,
  palevioletred: 14381203,
  papayawhip: 16773077,
  peachpuff: 16767673,
  peru: 13468991,
  pink: 16761035,
  plum: 14524637,
  powderblue: 11591910,
  purple: 8388736,
  rebeccapurple: 6697881,
  red: 16711680,
  rosybrown: 12357519,
  royalblue: 4286945,
  saddlebrown: 9127187,
  salmon: 16416882,
  sandybrown: 16032864,
  seagreen: 3050327,
  seashell: 16774638,
  sienna: 10506797,
  silver: 12632256,
  skyblue: 8900331,
  slateblue: 6970061,
  slategray: 7372944,
  slategrey: 7372944,
  snow: 16775930,
  springgreen: 65407,
  steelblue: 4620980,
  tan: 13808780,
  teal: 32896,
  thistle: 14204888,
  tomato: 16737095,
  turquoise: 4251856,
  violet: 15631086,
  wheat: 16113331,
  white: 16777215,
  whitesmoke: 16119285,
  yellow: 16776960,
  yellowgreen: 10145074
};
dsA(Q1, GX, {
  copy: function(A) {
    return Object.assign(new this.constructor(), this, A);
  },
  displayable: function() {
    return this.rgb().displayable();
  },
  hex: dyA,
  // Deprecated! Use color.formatHex.
  formatHex: dyA,
  formatHsl: vyt,
  formatRgb: hyA,
  toString: hyA
});
function dyA() {
  return this.rgb().formatHex();
}
function vyt() {
  return x5A(this).formatHsl();
}
function hyA() {
  return this.rgb().formatRgb();
}
function GX(A) {
  var e, t;
  return A = (A + "").trim().toLowerCase(), (e = Nyt.exec(A)) ? (t = e[1].length, e = parseInt(e[1], 16), t === 6 ? myA(e) : t === 3 ? new WI(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : t === 8 ? Ux(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : t === 4 ? Ux(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Yyt.exec(A)) ? new WI(e[1], e[2], e[3], 1) : (e = Ryt.exec(A)) ? new WI(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Fyt.exec(A)) ? Ux(e[1], e[2], e[3], e[4]) : (e = Myt.exec(A)) ? Ux(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = xyt.exec(A)) ? byA(e[1], e[2] / 100, e[3] / 100, 1) : (e = Lyt.exec(A)) ? byA(e[1], e[2] / 100, e[3] / 100, e[4]) : uyA.hasOwnProperty(A) ? myA(uyA[A]) : A === "transparent" ? new WI(NaN, NaN, NaN, 0) : null;
}
function myA(A) {
  return new WI(A >> 16 & 255, A >> 8 & 255, A & 255, 1);
}
function Ux(A, e, t, i) {
  return i <= 0 && (A = e = t = NaN), new WI(A, e, t, i);
}
function Hyt(A) {
  return A instanceof Q1 || (A = GX(A)), A ? (A = A.rgb(), new WI(A.r, A.g, A.b, A.opacity)) : new WI();
}
function Syt(A, e, t, i) {
  return arguments.length === 1 ? Hyt(A) : new WI(A, e, t, i ?? 1);
}
function WI(A, e, t, i) {
  this.r = +A, this.g = +e, this.b = +t, this.opacity = +i;
}
dsA(WI, Syt, M5A(Q1, {
  brighter: function(A) {
    return A = A == null ? iW : Math.pow(iW, A), new WI(this.r * A, this.g * A, this.b * A, this.opacity);
  },
  darker: function(A) {
    return A = A == null ? R2 : Math.pow(R2, A), new WI(this.r * A, this.g * A, this.b * A, this.opacity);
  },
  rgb: function() {
    return this;
  },
  displayable: function() {
    return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
  },
  hex: pyA,
  // Deprecated! Use color.formatHex.
  formatHex: pyA,
  formatRgb: yyA,
  toString: yyA
}));
function pyA() {
  return "#" + n_(this.r) + n_(this.g) + n_(this.b);
}
function yyA() {
  var A = this.opacity;
  return A = isNaN(A) ? 1 : Math.max(0, Math.min(1, A)), (A === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (A === 1 ? ")" : ", " + A + ")");
}
function n_(A) {
  return A = Math.max(0, Math.min(255, Math.round(A) || 0)), (A < 16 ? "0" : "") + A.toString(16);
}
function byA(A, e, t, i) {
  return i <= 0 ? A = e = t = NaN : t <= 0 || t >= 1 ? A = e = NaN : e <= 0 && (A = NaN), new hB(A, e, t, i);
}
function x5A(A) {
  if (A instanceof hB)
    return new hB(A.h, A.s, A.l, A.opacity);
  if (A instanceof Q1 || (A = GX(A)), !A)
    return new hB();
  if (A instanceof hB)
    return A;
  A = A.rgb();
  var e = A.r / 255, t = A.g / 255, i = A.b / 255, n = Math.min(e, t, i), o = Math.max(e, t, i), g = NaN, s = o - n, I = (o + n) / 2;
  return s ? (e === o ? g = (t - i) / s + (t < i) * 6 : t === o ? g = (i - e) / s + 2 : g = (e - t) / s + 4, s /= I < 0.5 ? o + n : 2 - o - n, g *= 60) : s = I > 0 && I < 1 ? 0 : g, new hB(g, s, I, A.opacity);
}
function Zyt(A, e, t, i) {
  return arguments.length === 1 ? x5A(A) : new hB(A, e, t, i ?? 1);
}
function hB(A, e, t, i) {
  this.h = +A, this.s = +e, this.l = +t, this.opacity = +i;
}
dsA(hB, Zyt, M5A(Q1, {
  brighter: function(A) {
    return A = A == null ? iW : Math.pow(iW, A), new hB(this.h, this.s, this.l * A, this.opacity);
  },
  darker: function(A) {
    return A = A == null ? R2 : Math.pow(R2, A), new hB(this.h, this.s, this.l * A, this.opacity);
  },
  rgb: function() {
    var A = this.h % 360 + (this.h < 0) * 360, e = isNaN(A) || isNaN(this.s) ? 0 : this.s, t = this.l, i = t + (t < 0.5 ? t : 1 - t) * e, n = 2 * t - i;
    return new WI(
      o_(A >= 240 ? A - 240 : A + 120, n, i),
      o_(A, n, i),
      o_(A < 120 ? A + 240 : A - 120, n, i),
      this.opacity
    );
  },
  displayable: function() {
    return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
  },
  formatHsl: function() {
    var A = this.opacity;
    return A = isNaN(A) ? 1 : Math.max(0, Math.min(1, A)), (A === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (A === 1 ? ")" : ", " + A + ")");
  }
}));
function o_(A, e, t) {
  return (A < 60 ? e + (t - e) * A / 60 : A < 180 ? t : A < 240 ? e + (t - e) * (240 - A) / 60 : e) * 255;
}
var Vx = {};
function Lp(A, e, t) {
  if (!t)
    return [1, 1, 1];
  if (t.id)
    return [1, 1, 1];
  if (Vx[t])
    return Vx[t];
  var i = GX(t).rgb();
  return Vx[t] = [i.r / 255, i.g / 255, i.b / 255], Vx[t];
}
var Wyt = function(A, e) {
  return typeof A == "number" ? A : typeof e == "number" ? e : 0;
}, Kyt = Uyt;
function Uyt(A, e) {
  return A[0] = e[0], A[1] = e[1], A;
}
var Vyt = Xyt;
function Xyt(A, e, t, i) {
  return A[0] = e[0] + t[0] * i, A[1] = e[1] + t[1] * i, A;
}
var L5A = zyt;
function zyt(A, e) {
  return A[0] * e[0] + A[1] * e[1];
}
function Tyt(A) {
  return [A[0], A[1]];
}
function _yt() {
  return [0, 0];
}
var qyt = {
  create: _yt,
  clone: Tyt,
  copy: Kyt,
  scaleAndAdd: Vyt,
  dot: L5A
}, $k = {}, g_, wyA;
function Oyt() {
  if (wyA)
    return g_;
  wyA = 1, g_ = A;
  function A(e, t, i) {
    return e[0] = t[0] + i[0], e[1] = t[1] + i[1], e;
  }
  return g_;
}
var s_, fyA;
function jyt() {
  if (fyA)
    return s_;
  fyA = 1, s_ = A;
  function A(e, t, i) {
    return e[0] = t, e[1] = i, e;
  }
  return s_;
}
var I_, DyA;
function Pyt() {
  if (DyA)
    return I_;
  DyA = 1, I_ = A;
  function A(e, t) {
    var i = t[0], n = t[1], o = i * i + n * n;
    return o > 0 && (o = 1 / Math.sqrt(o), e[0] = t[0] * o, e[1] = t[1] * o), e;
  }
  return I_;
}
var a_, GyA;
function $yt() {
  if (GyA)
    return a_;
  GyA = 1, a_ = A;
  function A(e, t, i) {
    return e[0] = t[0] - i[0], e[1] = t[1] - i[1], e;
  }
  return a_;
}
var kyA;
function Abt() {
  if (kyA)
    return $k;
  kyA = 1;
  var A = Oyt(), e = jyt(), t = Pyt(), i = $yt(), n = L5A, o = [0, 0];
  return $k.computeMiter = function(g, s, I, r, a) {
    return A(g, I, r), t(g, g), e(s, -g[1], g[0]), e(o, -I[1], I[0]), a / n(s, o);
  }, $k.normal = function(g, s) {
    return e(g, -s[1], s[0]), g;
  }, $k.direction = function(g, s, I) {
    return i(g, s, I), t(g, g), g;
  }, $k;
}
var JyA = Wyt, Rn = qyt, yI = Rn.create(), Xx = Rn.create(), Jy = Rn.create(), r_ = Rn.create(), NyA = Rn.create(), zx = Rn.create(), hsA = Abt(), ebt = hsA.computeMiter, C_ = hsA.normal, YyA = hsA.direction;
function Of(A) {
  if (!(this instanceof Of))
    return new Of(A);
  A = A || {}, this.miterLimit = JyA(A.miterLimit, 10), this.thickness = JyA(A.thickness, 1), this.join = A.join || "miter", this.cap = A.cap || "butt", this._normal = null, this._lastFlip = -1, this._started = !1;
}
Of.prototype.mapThickness = function(A, e, t) {
  return this.thickness;
};
Of.prototype.build = function(A) {
  var e = {
    positions: [],
    cells: []
  };
  if (A.length <= 1)
    return e;
  var t = A.length;
  this._lastFlip = -1, this._started = !1, this._normal = null;
  for (var i = 1, n = 0; i < t; i++) {
    var o = A[i - 1], g = A[i], s = i < A.length - 1 ? A[i + 1] : null, I = this.mapThickness(g, i, A), r = this._seg(e, n, o, g, s, I / 2);
    n += r;
  }
  return e;
};
Of.prototype._seg = function(A, e, t, i, n, o) {
  var g = 0, s = A.cells, I = A.positions, r = this.cap === "square", a = this.join === "bevel";
  if (YyA(Jy, i, t), this._normal || (this._normal = Rn.create(), C_(this._normal, Jy)), this._started || (this._started = !0, r && (Rn.scaleAndAdd(Xx, t, Jy, -o), t = Xx), B_(I, t, this._normal, o)), s.push([e + 0, e + 1, e + 2]), !n)
    C_(this._normal, Jy), r && (Rn.scaleAndAdd(Xx, i, Jy, o), i = Xx), B_(I, i, this._normal, o), s.push(this._lastFlip === 1 ? [e, e + 2, e + 3] : [e + 2, e + 1, e + 3]), g += 2;
  else {
    YyA(r_, n, i);
    var C = ebt(NyA, zx, Jy, r_, o), B = Rn.dot(NyA, this._normal) < 0 ? -1 : 1, l = a;
    if (!l && this.join === "miter") {
      var Q = C / o;
      Q > this.miterLimit && (l = !0);
    }
    l ? (Rn.scaleAndAdd(yI, i, this._normal, -o * B), I.push(Rn.clone(yI)), Rn.scaleAndAdd(yI, i, zx, C * B), I.push(Rn.clone(yI)), s.push(this._lastFlip !== -B ? [e, e + 2, e + 3] : [e + 2, e + 1, e + 3]), s.push([e + 2, e + 3, e + 4]), C_(yI, r_), Rn.copy(this._normal, yI), Rn.scaleAndAdd(yI, i, yI, -o * B), I.push(Rn.clone(yI)), g += 3) : (B_(I, i, zx, C), s.push(this._lastFlip === 1 ? [e, e + 2, e + 3] : [e + 2, e + 1, e + 3]), B = -1, Rn.copy(this._normal, zx), g += 2), this._lastFlip = B;
  }
  return g;
};
function B_(A, e, t, i) {
  Rn.scaleAndAdd(yI, e, t, -i), A.push(Rn.clone(yI)), Rn.scaleAndAdd(yI, e, t, i), A.push(Rn.clone(yI));
}
var tbt = Of;
const ibt = /* @__PURE__ */ Br(tbt);
function E1(A, e, t) {
  var i = (i = e.strokeWidth) != null ? i : 1, n = (n = e.strokeCap) != null ? n : "butt", o = [], g, s, I, r, a, C, B = [], l = [], Q, E, d, m, y, f, w, G, R, F = 0, Z = !1, c = !1, J = e.opacity == null ? 1 : e.opacity, p = J * (e.fillOpacity == null ? 1 : e.fillOpacity), N = J * (e.strokeOpacity == null ? 1 : e.strokeOpacity), v, K = t.z || 0, U = t.triangles, j;
  if (e.fill === "transparent" && (p = 0), e.fill && p > 0 && (Z = !0, F = U ? U.length / 9 : 0), e.stroke === "transparent" && (N = 0), i > 0 && e.stroke && N > 0)
    for (c = !0, v = ibt({
      thickness: i,
      cap: n,
      join: "miter",
      miterLimit: 1,
      closed: !!t.closed
    }), r = 0; r < t.lines.length; r++)
      C = v.build(t.lines[r]), o.push(C), F += C.cells.length;
  if (B = new Float32Array(F * 3 * 3), l = new Float32Array(F * 3 * 4), Z) {
    for (I = Lp(A, e, e.fill), g = 0, s = U.length; g < s; g += 3)
      B[g] = U[g], B[g + 1] = U[g + 1], B[g + 2] = U[g + 2];
    for (g = 0, s = U.length / 3; g < s; g++)
      l[g * 4] = I[0], l[g * 4 + 1] = I[1], l[g * 4 + 2] = I[2], l[g * 4 + 3] = p;
  }
  if (c)
    for (I = Lp(A, e, e.stroke), g = Z ? U.length / 3 : 0, r = 0; r < o.length; r++)
      for (C = o[r], y = C.positions, f = C.cells, w = C.cells.length, a = 0; a < w; a++)
        Q = f[a], E = y[Q[0]], d = y[Q[1]], m = y[Q[2]], B[g * 3] = E[0], B[g * 3 + 1] = E[1], B[g * 3 + 2] = K, l[g * 4] = I[0], l[g * 4 + 1] = I[1], l[g * 4 + 2] = I[2], l[g * 4 + 3] = N, g++, B[g * 3] = d[0], B[g * 3 + 1] = d[1], B[g * 3 + 2] = K, l[g * 4] = I[0], l[g * 4 + 1] = I[1], l[g * 4 + 2] = I[2], l[g * 4 + 3] = N, g++, B[g * 3] = m[0], B[g * 3 + 1] = m[1], B[g * 3 + 2] = K, l[g * 4] = I[0], l[g * 4 + 1] = I[1], l[g * 4 + 2] = I[2], l[g * 4 + 3] = N, g++;
  return G = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, G), A.bufferData(A.ARRAY_BUFFER, B, A.STATIC_DRAW), R = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, R), A.bufferData(A.ARRAY_BUFFER, l, A.STATIC_DRAW), j = {
    triangleBuffer: G,
    colorBuffer: R,
    numTriangles: F
  }, e._geom && (e._geom.triangleBuffer && A.deleteBuffer(e._geom.triangleBuffer), e._geom.colorBuffer && A.deleteBuffer(e._geom.colorBuffer)), j;
}
function v5A(A, e) {
  function t(i, n, o) {
    Nn(n, function(g) {
      if (!(o && !o.intersects(g.bounds))) {
        var s = g.x || 0, I = g.y || 0, r;
        i._tx += s, i._ty += I, (i._fullRedraw || g._dirty || !g._geom || g._geom.deleted) && (r = e(i, g), g._geom = E1(i, g, r)), c1(g._geom, i, g), i._tx -= s, i._ty -= I;
      }
    });
  }
  return {
    type: A,
    drawGL: t
  };
}
const nbt = v5A("arc", fyt);
function H5A(A, e) {
  function t(i, n, o) {
    if (n.items.length && (!o || o.intersects(n.bounds))) {
      for (var g = n.items[0], s = !1, I = 0; I < n.items.length; I++)
        if (n.items[I]._dirty) {
          s = !0;
          break;
        }
      if (i._fullRedraw || s || !g._geom || g._geom.deleted) {
        var r = e(i, n.items);
        g._geom = E1(i, g, r);
      }
      c1(g._geom, i, g);
    }
  }
  return {
    type: A,
    drawGL: t
  };
}
const obt = H5A("area", Dyt);
function gbt(A, e, t) {
  var i = this;
  Nn(e, function(n) {
    var o = n.x || 0, g = n.y || 0, s = n.width || 0, I = n.height || 0, r, a;
    if (A._tx += o, A._ty += g, A._textContext.save(), A._textContext.translate(o, g), A._fullRedraw || n._dirty || !n._geom || n._geom.deleted) {
      r = n.stroke ? 0.5 : 0;
      var C = Jyt(A, n, r, r);
      n._geom = E1(A, n, C);
    }
    c1(n._geom, A, n), n.clip && (a = A._clip, A._clip = [
      A._origin[0] + A._tx,
      A._origin[1] + A._ty,
      A._origin[0] + A._tx + s,
      A._origin[1] + A._ty + I
    ]), t && t.translate(-o, -g), Nn(n, function(B) {
      i.draw(A, B, t);
    }), t && t.translate(o, g), n.clip && (A._clip = a), A._tx -= o, A._ty -= g, A._textContext.restore();
  });
}
const sbt = {
  type: "group",
  drawGL: gbt
};
function GE(A, e) {
  for (var t = [
    0,
    0,
    4,
    1,
    8,
    2,
    12,
    3,
    1,
    0,
    5,
    1,
    9,
    2,
    13,
    3,
    2,
    0,
    6,
    1,
    10,
    2,
    14,
    3,
    3,
    0,
    7,
    1,
    11,
    2,
    15,
    3,
    0,
    4,
    4,
    5,
    8,
    6,
    12,
    7,
    1,
    4,
    5,
    5,
    9,
    6,
    13,
    7,
    2,
    4,
    6,
    5,
    10,
    6,
    14,
    7,
    3,
    4,
    7,
    5,
    11,
    6,
    15,
    7,
    0,
    8,
    4,
    9,
    8,
    10,
    12,
    11,
    1,
    8,
    5,
    9,
    9,
    10,
    13,
    11,
    2,
    8,
    6,
    9,
    10,
    10,
    14,
    11,
    3,
    8,
    7,
    9,
    11,
    10,
    15,
    11,
    0,
    12,
    4,
    13,
    8,
    14,
    12,
    15,
    1,
    12,
    5,
    13,
    9,
    14,
    13,
    15,
    2,
    12,
    6,
    13,
    10,
    14,
    14,
    15,
    3,
    12,
    7,
    13,
    11,
    14,
    15,
    15
  ], i = [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ], n = 0; n < t.length / 2; n++)
    i[Math.floor(n / 4)] += A[t[2 * n]] * e[t[2 * n + 1]];
  return i;
}
function Ibt(A, e, t, i) {
  var n = Math.tan(Math.PI * 0.5 - 0.5 * A), o = 1 / (t - i);
  return [
    n / e,
    0,
    0,
    0,
    0,
    n,
    0,
    0,
    0,
    0,
    (t + i) * o,
    -1,
    0,
    0,
    t * i * o * 2,
    0
  ];
}
function abt(A) {
  return [
    1,
    0,
    0,
    0,
    0,
    Math.cos(A),
    Math.sin(A),
    0,
    0,
    -Math.sin(A),
    Math.cos(A),
    0,
    0,
    0,
    0,
    1
  ];
}
function rbt(A) {
  return [
    Math.cos(A),
    0,
    -Math.sin(A),
    0,
    0,
    1,
    0,
    0,
    Math.sin(A),
    0,
    Math.cos(A),
    0,
    0,
    0,
    0,
    1
  ];
}
function Cbt(A) {
  return [
    Math.cos(A),
    Math.sin(A),
    0,
    0,
    -Math.sin(A),
    Math.cos(A),
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    0,
    0,
    1
  ];
}
function RyA(A, e, t) {
  return [
    1,
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    0,
    0,
    1,
    0,
    A,
    e,
    t,
    1
  ];
}
function S5A(A, e) {
  var t = A.createTexture();
  A.bindTexture(A.TEXTURE_2D, t), A.texImage2D(
    A.TEXTURE_2D,
    0,
    A.RGBA,
    1,
    1,
    0,
    A.RGBA,
    A.UNSIGNED_BYTE,
    new Uint8Array([0, 0, 255, 255])
  ), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_S, A.CLAMP_TO_EDGE), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_T, A.CLAMP_TO_EDGE), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MIN_FILTER, A.LINEAR);
  var i = { texture: t };
  return i.width = e.width, i.height = e.height, A.bindTexture(A.TEXTURE_2D, i.texture), A.texImage2D(A.TEXTURE_2D, 0, A.RGBA, A.RGBA, A.UNSIGNED_BYTE, e), i;
}
function Bbt(A, e, t) {
  A.bindTexture(A.TEXTURE_2D, e.texture), A.useProgram(A._imageShaderProgram), A.bindBuffer(A.ARRAY_BUFFER, A._imagePositionBuffer), A.enableVertexAttribArray(A._imagePositionLocation), A.vertexAttribPointer(A._imagePositionLocation, 2, A.FLOAT, !1, 0, 0), A.bindBuffer(A.ARRAY_BUFFER, A._imageTexcoordBuffer), A.enableVertexAttribArray(A._imageTexcoordLocation), A.vertexAttribPointer(A._imageTexcoordLocation, 2, A.FLOAT, !1, 0, 0);
  var i = [
    e.w,
    0,
    0,
    0,
    0,
    e.h,
    0,
    0,
    0,
    0,
    1,
    0,
    e.x,
    e.y,
    0,
    1
  ];
  t = GE(t, i), A.uniformMatrix4fv(A._imageMatrixLocation, !1, t), A.uniform1i(A._imageTextureLocation, 0), A.drawArrays(A.TRIANGLES, 0, 6);
}
function lbt(A, e) {
  var t = A.image;
  return (!t || t.url !== A.url) && (t = { loaded: !1, width: 0, height: 0 }, e.loadImage(A.url).then(function(i) {
    A.image = i, A.image.url = A.url;
  })), t;
}
function cbt(A, e) {
  return A === "center" ? e / 2 : A === "right" ? e : 0;
}
function Qbt(A, e) {
  return A === "middle" ? e / 2 : A === "bottom" ? e : 0;
}
function Ebt(A, e, t) {
  var i = this;
  Nn(e, function(n) {
    if (!(t && !t.intersects(n.bounds))) {
      var o = lbt(n, i), g = n.x || 0, s = n.y || 0, I = n.width || o.width || 0, r = n.height || o.height || 0;
      if (g -= cbt(n.align, I), s -= Qbt(n.baseline, r), o.loaded) {
        var a = S5A(A, o);
        a.x = g + A._tx + A._origin[0], a.y = s + A._ty + A._origin[1], a.w = I, a.h = r, A._images.push(a);
      }
    }
  });
}
const ubt = {
  type: "image",
  drawGL: Ebt
}, dbt = H5A("line", kyt);
function hbt(A, e) {
  Nn(e, function(t) {
    var i = t.path;
    if (i == null)
      return !0;
    var n = t.x || 0, o = t.y || 0;
    if (A._tx += n, A._ty += o, A._fullRedraw || t._dirty || !t._geom || t._geom.deleted) {
      var g = wG(A, i);
      t._geom = E1(A, t, g);
    }
    c1(t._geom, A, t), A._tx -= n, A._ty -= o;
  });
}
const mbt = {
  type: "path",
  drawGL: hbt
};
function pbt(A, e, t) {
  var i, n, o, g, s, I, r, a, C, B, l, Q, E, d, m, y, f, w, G = 0, R = 0, F = 0, Z = e.items.length, c, J, p = !1, N, v = e._rectGeom;
  for (J = 0; J < e.items.length; ++J)
    if (N = e.items[J], N.stroke && N.stroke.id || N.fill && N.fill.id) {
      p = !0;
      break;
    }
  if (p) {
    Rg.rect.draw(A._textContext, e, t);
    return;
  }
  if (v && v.numPts === Z)
    i = v.unit, B = v.unitBuffer, n = v.pos, o = v.size, g = v.strokeWidth, s = v.strokeOpacity, I = v.strokeColor, r = v.fillOpacity, a = v.fillColor, C = v.cornerRadius;
  else
    for (v && A.deleteBuffer(v.unitBuffer), i = new Float32Array(6 * Z * 2), n = new Float32Array(6 * Z * 3), o = new Float32Array(6 * Z * 2), g = new Float32Array(6 * Z), s = new Float32Array(6 * Z), I = new Float32Array(6 * Z * 3), r = new Float32Array(6 * Z), a = new Float32Array(6 * Z * 3), C = new Float32Array(6 * Z), c = [
      0,
      1,
      1,
      1,
      1,
      0,
      1,
      0,
      0,
      0,
      0,
      1
    ], J = 0; J < Z * c.length; J += 1)
      i[J] = c[J % c.length];
  v && (A.deleteBuffer(v.posBuffer), A.deleteBuffer(v.sizeBuffer), A.deleteBuffer(v.strokeWidthBuffer), A.deleteBuffer(v.strokeOpacityBuffer), A.deleteBuffer(v.strokeColorBuffer), A.deleteBuffer(v.fillOpacityBuffer), A.deleteBuffer(v.fillColorBuffer), A.deleteBuffer(v.cornerRadiusBuffer)), Nn(e, function(K) {
    var U = (K.x || 0) + A._tx + A._origin[0], j = (K.y || 0) + A._ty + A._origin[1], q = Lp(A, K, K.fill), O = Lp(A, K, K.stroke), $ = K.opacity == null ? 1 : K.opacity, _ = $ * (K.fill == null || K.fill == "transparent" ? 0 : 1) * (K.fillOpacity == null ? 1 : K.fillOpacity), tA = $ * (K.stroke == null || K.stroke == "transparent" ? 0 : 1) * (K.strokeOpacity == null ? 1 : K.strokeOpacity), nA = (K.stroke == null || K.stroke == "transparent" ? 0 : 1) * (K.strokeWidth == null ? 1 : K.strokeWidth), AA = K.width == null ? 0 : K.width, gA = K.height == null ? 0 : K.height, rA = K.cornerRadius == null ? 0 : K.cornerRadius;
    for (J = 0; J < 6; J += 1, G += 1, R += 2, F += 3)
      n[F] = U, n[F + 1] = j, n[F + 2] = 0, o[R] = AA, o[R + 1] = gA, g[G] = nA, s[G] = tA, I[F] = O[0], I[F + 1] = O[1], I[F + 2] = O[2], r[G] = _, a[F] = q[0], a[F + 1] = q[1], a[F + 2] = q[2], C[G] = rA;
  }), A.useProgram(A._rectShaderProgram), B ? (A.bindBuffer(A.ARRAY_BUFFER, B), A.vertexAttribPointer(A._rectUnitLocation, 2, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectUnitLocation)) : (B = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, B), A.bufferData(A.ARRAY_BUFFER, i, A.STATIC_DRAW), A.vertexAttribPointer(A._rectUnitLocation, 2, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectUnitLocation)), l = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, l), A.bufferData(A.ARRAY_BUFFER, n, A.STATIC_DRAW), A.vertexAttribPointer(A._rectPosLocation, 3, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectPosLocation), Q = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, Q), A.bufferData(A.ARRAY_BUFFER, o, A.STATIC_DRAW), A.vertexAttribPointer(A._rectSizeLocation, 2, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectSizeLocation), E = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, E), A.bufferData(A.ARRAY_BUFFER, g, A.STATIC_DRAW), A.vertexAttribPointer(A._rectStrokeWidthLocation, 1, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectStrokeWidthLocation), d = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, d), A.bufferData(A.ARRAY_BUFFER, s, A.STATIC_DRAW), A.vertexAttribPointer(A._rectStrokeOpacityLocation, 1, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectStrokeOpacityLocation), m = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, m), A.bufferData(A.ARRAY_BUFFER, I, A.STATIC_DRAW), A.vertexAttribPointer(A._rectStrokeColorLocation, 3, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectStrokeColorLocation), y = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, y), A.bufferData(A.ARRAY_BUFFER, r, A.STATIC_DRAW), A.vertexAttribPointer(A._rectFillOpacityLocation, 1, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectFillOpacityLocation), f = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, f), A.bufferData(A.ARRAY_BUFFER, a, A.STATIC_DRAW), A.vertexAttribPointer(A._rectFillColorLocation, 3, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectFillColorLocation), w = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, w), A.bufferData(A.ARRAY_BUFFER, C, A.STATIC_DRAW), A.vertexAttribPointer(A._rectCornerRadiusLocation, 1, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._rectCornerRadiusLocation), A.uniformMatrix4fv(A._rectMatrixLocation, !1, A._matrix), A.uniform4fv(A._rectClipLocation, A._clip), A.drawArrays(A.TRIANGLES, 0, Z * 6), e._rectGeom = {
    numPts: Z,
    unit: i,
    pos: n,
    size: o,
    strokeWidth: g,
    strokeOpacity: s,
    strokeColor: I,
    fillOpacity: r,
    fillColor: a,
    cornerRadius: C,
    unitBuffer: B,
    posBuffer: l,
    sizeBuffer: Q,
    strokeWidthBuffer: E,
    strokeOpacityBuffer: d,
    strokeColorBuffer: m,
    fillOpacityBuffer: y,
    fillColorBuffer: f,
    cornerRadiusBuffer: w
  };
}
const ybt = {
  type: "rect",
  drawGL: pbt
};
function bbt(A, e, t) {
  Nn(e, function(i) {
    var n, o, g, s, I;
    t && !t.intersects(i.bounds) || ((A._fullRedraw || i._dirty || !i._geom || i._geom.deleted) && (n = i.x || 0, o = i.y || 0, g = i.x2 != null ? i.x2 : n, s = i.y2 != null ? i.y2 : o, I = {
      lines: [[[n, o], [g, s]]],
      closed: !1
    }, I.key = JSON.stringify(I.lines), i._geom = E1(A, i, I)), c1(i._geom, A, i));
  });
}
const wbt = {
  type: "rule",
  drawGL: bbt
}, fbt = v5A("shape", Gyt);
function Dbt(A, e) {
  var t, i, n, o, g, s, I, r, a, C, B, l, Q, E, d, m, y, f, w = 0, G = 0, R = e.items.length, F = 0, Z = 0, c = 1, J = 1, p, N, v = e._symbolGeom, K;
  if (R !== 0) {
    if (K = {
      circle: 0,
      cross: 1,
      diamond: 2,
      square: 3,
      star: 4,
      triangle: 5,
      "triangle-up": 5,
      "triangle-right": 6,
      "triangle-down": 7,
      "triangle-left": 8,
      wye: 9
    }, v && v.numPts === R)
      t = v.unit, C = v.unitBuffer, i = v.pos, n = v.size, o = v.shape, g = v.strokeWidth, s = v.strokeOpacity, I = v.strokeColor, r = v.fillOpacity, a = v.fillColor;
    else
      for (v && A.deleteBuffer(v.unitBuffer), t = new Float32Array(3 * R * 2), i = new Float32Array(3 * R * 3), n = new Float32Array(3 * R), o = new Float32Array(3 * R), g = new Float32Array(3 * R), s = new Float32Array(3 * R), I = new Float32Array(3 * R * 3), r = new Float32Array(3 * R), a = new Float32Array(3 * R * 3), N = [
        F,
        Z - J * 2,
        F - c * Math.sqrt(3),
        Z + J,
        F + c * Math.sqrt(3),
        Z + J
      ], p = 0; p < R * N.length; p += 1)
        t[p] = N[p % N.length];
    v && (A.deleteBuffer(v.posBuffer), A.deleteBuffer(v.sizeBuffer), A.deleteBuffer(v.shapeBuffer), A.deleteBuffer(v.strokeWidthBuffer), A.deleteBuffer(v.strokeOpacityBuffer), A.deleteBuffer(v.strokeColorBuffer), A.deleteBuffer(v.fillOpacityBuffer), A.deleteBuffer(v.fillColorBuffer)), Nn(e, function(U) {
      var j = (U.x || 0) + A._tx + A._origin[0], q = (U.y || 0) + A._ty + A._origin[1], O = Lp(A, U, U.fill), $ = Lp(A, U, U.stroke), _ = U.opacity == null ? 1 : U.opacity, tA = _ * (U.fill == null || U.fill == "transparent" ? 0 : 1) * (U.fillOpacity == null ? 1 : U.fillOpacity), nA = _ * (U.stroke == null || U.stroke == "transparent" ? 0 : 1) * (U.strokeOpacity == null ? 1 : U.strokeOpacity), AA = (U.stroke == null || U.stroke == "transparent" ? 0 : 1) * (U.strokeWidth == null ? 1 : U.strokeWidth), gA = U.size == null ? 64 : U.size, rA = K[U.shape] == null ? 0 : K[U.shape];
      for (p = 0; p < 3; p += 1, w += 1, G += 3)
        i[G] = j, i[G + 1] = q, i[G + 2] = 0, n[w] = gA, g[w] = AA, o[w] = rA, s[w] = nA, I[G] = $[0], I[G + 1] = $[1], I[G + 2] = $[2], r[w] = tA, a[G] = O[0], a[G + 1] = O[1], a[G + 2] = O[2];
    }), A.useProgram(A._symbolShaderProgram), C ? (A.bindBuffer(A.ARRAY_BUFFER, C), A.vertexAttribPointer(A._symbolUnitLocation, 2, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolUnitLocation)) : (C = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, C), A.bufferData(A.ARRAY_BUFFER, t, A.STATIC_DRAW), A.vertexAttribPointer(A._symbolUnitLocation, 2, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolUnitLocation)), B = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, B), A.bufferData(A.ARRAY_BUFFER, i, A.STATIC_DRAW), A.vertexAttribPointer(A._symbolPosLocation, 3, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolPosLocation), l = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, l), A.bufferData(A.ARRAY_BUFFER, n, A.STATIC_DRAW), A.vertexAttribPointer(A._symbolSizeLocation, 1, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolSizeLocation), Q = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, Q), A.bufferData(A.ARRAY_BUFFER, o, A.STATIC_DRAW), A.vertexAttribPointer(A._symbolShapeLocation, 1, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolShapeLocation), E = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, E), A.bufferData(A.ARRAY_BUFFER, g, A.STATIC_DRAW), A.vertexAttribPointer(A._symbolStrokeWidthLocation, 1, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolStrokeWidthLocation), d = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, d), A.bufferData(A.ARRAY_BUFFER, s, A.STATIC_DRAW), A.vertexAttribPointer(A._symbolStrokeOpacityLocation, 1, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolStrokeOpacityLocation), m = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, m), A.bufferData(A.ARRAY_BUFFER, I, A.STATIC_DRAW), A.vertexAttribPointer(A._symbolStrokeColorLocation, 3, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolStrokeColorLocation), y = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, y), A.bufferData(A.ARRAY_BUFFER, r, A.STATIC_DRAW), A.vertexAttribPointer(A._symbolFillOpacityLocation, 1, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolFillOpacityLocation), f = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, f), A.bufferData(A.ARRAY_BUFFER, a, A.STATIC_DRAW), A.vertexAttribPointer(A._symbolFillColorLocation, 3, A.FLOAT, !1, 0, 0), A.enableVertexAttribArray(A._symbolFillColorLocation), A.uniformMatrix4fv(A._symbolMatrixLocation, !1, A._matrix), A.uniform4fv(A._symbolClipLocation, A._clip), A.drawArrays(A.TRIANGLES, 0, R * 3), e._symbolGeom = {
      numPts: R,
      unit: t,
      pos: i,
      size: n,
      shape: o,
      strokeWidth: g,
      strokeOpacity: s,
      strokeColor: I,
      fillOpacity: r,
      fillColor: a,
      unitBuffer: C,
      posBuffer: B,
      sizeBuffer: l,
      shapeBuffer: Q,
      strokeWidthBuffer: E,
      strokeOpacityBuffer: d,
      strokeColorBuffer: m,
      fillOpacityBuffer: y,
      fillColorBuffer: f
    };
  }
}
const Gbt = {
  type: "symbol",
  drawGL: Dbt
};
function kbt(A, e, t) {
  Rg.text.draw(A._textContext, e, t);
}
const Jbt = {
  type: "text",
  drawGL: kbt
}, Nbt = {
  arc: nbt,
  area: obt,
  group: sbt,
  image: ubt,
  line: dbt,
  path: mbt,
  rect: ybt,
  rule: wbt,
  shape: fbt,
  symbol: Gbt,
  text: Jbt
};
function Ybt(A, e) {
  var t = A.prototype = Object.create(e.prototype);
  return t.constructor = A, t;
}
function Rbt(A, e) {
  var t = document.createElement("canvas");
  t.width = A, t.height = e;
  var i = t.getContext("webgl") || t.getContext("experimental-webgl");
  i._pathCache = {}, i._pathCacheSize = 0, i._itemCache = {}, i._itemCacheSize = 0, i._shapeCache = {}, i._shapeCacheSize = 0, i._textCanvas = document.createElement("canvas"), i._textCanvas.width = A, i._textCanvas.height = e, i._textContext = i._textCanvas.getContext("2d"), t._textCanvas = i._textCanvas, i.clearColor(1, 1, 1, 1), i.disable(i.CULL_FACE), i.disable(i.DEPTH_TEST), i.enable(i.BLEND), i.blendFuncSeparate(i.SRC_ALPHA, i.ONE_MINUS_SRC_ALPHA, i.ONE, i.ONE_MINUS_SRC_ALPHA);
  var n = "attribute vec3 coordinates;attribute vec4 color;uniform mat4 matrix;uniform float zFactor;uniform vec2 offset;varying vec4 vColor;varying vec4 vPosition;void main(void) {  vPosition = vec4(coordinates.x + offset.x, coordinates.y + offset.y, coordinates.z*zFactor - 1.0, 1.0);  gl_Position = matrix * vPosition;  vColor = color;}", o = i.createShader(i.VERTEX_SHADER);
  if (i.shaderSource(o, n), i.compileShader(o), !i.getShaderParameter(o, i.COMPILE_STATUS))
    throw i.getShaderInfoLog(o);
  var g = "precision mediump float;varying vec4 vColor;varying vec4 vPosition;uniform vec4 clip;void main(void) {  if (vPosition.x < clip[0] || vPosition.x > clip[2] || vPosition.y < clip[1] || vPosition.y > clip[3]) {    discard;  }  gl_FragColor = vColor;}", s = i.createShader(i.FRAGMENT_SHADER);
  if (i.shaderSource(s, g), i.compileShader(s), !i.getShaderParameter(s, i.COMPILE_STATUS))
    throw i.getShaderInfoLog(s);
  var I = i.createProgram();
  if (i.attachShader(I, o), i.attachShader(I, s), i.linkProgram(I), i.useProgram(I), i._shaderProgram = I, i._coordLocation = i.getAttribLocation(i._shaderProgram, "coordinates"), i._colorLocation = i.getAttribLocation(i._shaderProgram, "color"), i._matrixLocation = i.getUniformLocation(i._shaderProgram, "matrix"), i._zFactorLocation = i.getUniformLocation(i._shaderProgram, "zFactor"), i._offsetLocation = i.getUniformLocation(i._shaderProgram, "offset"), i._clipLocation = i.getUniformLocation(i._shaderProgram, "clip"), n = "attribute vec2 a_position;attribute vec2 a_texcoord;uniform mat4 u_matrix;varying vec2 v_texcoord;void main() {  gl_Position = u_matrix * vec4(a_position, -1.0, 1.0);  v_texcoord = a_texcoord;}", o = i.createShader(i.VERTEX_SHADER), i.shaderSource(o, n), i.compileShader(o), !i.getShaderParameter(o, i.COMPILE_STATUS))
    throw i.getShaderInfoLog(o);
  if (g = "precision mediump float;varying vec2 v_texcoord;uniform sampler2D u_texture;void main() {  gl_FragColor = texture2D(u_texture, v_texcoord);}", s = i.createShader(i.FRAGMENT_SHADER), i.shaderSource(s, g), i.compileShader(s), !i.getShaderParameter(s, i.COMPILE_STATUS))
    throw i.getShaderInfoLog(s);
  I = i.createProgram(), i.attachShader(I, o), i.attachShader(I, s), i.linkProgram(I);
  var r = i.createBuffer();
  i.bindBuffer(i.ARRAY_BUFFER, r);
  var a = [
    0,
    0,
    0,
    1,
    1,
    0,
    1,
    0,
    0,
    1,
    1,
    1
  ];
  i.bufferData(i.ARRAY_BUFFER, new Float32Array(a), i.STATIC_DRAW);
  var C = i.createBuffer();
  i.bindBuffer(i.ARRAY_BUFFER, C);
  var B = [
    0,
    0,
    0,
    1,
    1,
    0,
    1,
    0,
    0,
    1,
    1,
    1
  ];
  if (i.bufferData(i.ARRAY_BUFFER, new Float32Array(B), i.STATIC_DRAW), i._imageShaderProgram = I, i._imagePositionLocation = i.getAttribLocation(i._imageShaderProgram, "a_position"), i._imageTexcoordLocation = i.getAttribLocation(i._imageShaderProgram, "a_texcoord"), i._imageMatrixLocation = i.getUniformLocation(i._imageShaderProgram, "u_matrix"), i._imageTextureLocation = i.getUniformLocation(i._imageShaderProgram, "u_texture"), i._imagePositionBuffer = r, i._imageTexcoordBuffer = C, n = [
    "attribute vec3 pos;",
    "attribute vec3 fillColor;",
    "attribute vec3 strokeColor;",
    "attribute float fillOpacity;",
    "attribute float strokeWidth;",
    "attribute float size;",
    "attribute float shape;",
    "attribute float strokeOpacity;",
    "attribute vec2 unit;",
    "uniform mat4 matrix;",
    "varying vec4 positionVar;",
    "varying vec4 fillColorVar;",
    "varying vec4 strokeColorVar;",
    "varying float sizeVar;",
    "varying float shapeVar;",
    "varying float strokeWidthVar;",
    "varying vec2 unitVar;",
    "void main(void)",
    "{",
    "  strokeWidthVar = strokeWidth;",
    "  fillColorVar = vec4(fillColor, fillOpacity);",
    "  strokeColorVar = vec4(strokeColor, strokeOpacity);",
    // circle
    "  if (shape == 0.0) {",
    "    sizeVar = sqrt(size) / 2.0;",
    "  }",
    // cross
    "  if (shape == 1.0) {",
    "    sizeVar = sqrt(size) / 2.0;",
    "  }",
    // diamond
    "  if (shape == 2.0) {",
    "    sizeVar = sqrt(size) / 2.0;",
    "  }",
    // square
    "  if (shape == 3.0) {",
    "    sizeVar = sqrt(2.0) * sqrt(size) / 2.0;",
    "  }",
    // star
    "  if (shape == 4.0) {",
    "    sizeVar = sqrt(size) / 2.0;",
    "  }",
    // triangle-up
    "  if (shape == 5.0) {",
    "    sizeVar = (sqrt(6.0)/2.0) * sqrt(size) / 2.0;",
    "  }",
    // triangle-right
    "  if (shape == 6.0) {",
    "    sizeVar = (sqrt(6.0)/2.0) * sqrt(size) / 2.0;",
    "  }",
    // triangle-down
    "  if (shape == 7.0) {",
    "    sizeVar = (sqrt(6.0)/2.0) * sqrt(size) / 2.0;",
    "  }",
    // triangle-left
    "  if (shape == 8.0) {",
    "    sizeVar = (sqrt(6.0)/2.0) * sqrt(size) / 2.0;",
    "  }",
    // wye
    "  if (shape == 9.0) {",
    "    sizeVar = sqrt(size) / 2.0;",
    "  }",
    // '  sizeVar = size;',
    "  shapeVar = shape;",
    // '  float m = size + strokeWidth;',
    "  float factor = (sizeVar + strokeWidth / 2.0 + 1.0) / sizeVar;",
    "  unitVar = factor * unit;",
    "  positionVar = vec4(pos.xy + factor * sizeVar * unit, -1.0, 1.0);",
    "  gl_Position = matrix * positionVar;",
    "}"
  ].join(`
`), o = i.createShader(i.VERTEX_SHADER), i.shaderSource(o, n), i.compileShader(o), !i.getShaderParameter(o, i.COMPILE_STATUS))
    throw i.getShaderInfoLog(o);
  if (g = [
    "precision mediump float;",
    "const float PI = 3.1415926535897932384626433832795;",
    "varying vec4 positionVar;",
    "varying vec4 fillColorVar;",
    "varying vec4 strokeColorVar;",
    "varying vec2 unitVar;",
    "varying float sizeVar;",
    "varying float shapeVar;",
    "varying float strokeWidthVar;",
    "uniform vec4 clip;",
    "float distToLine(vec2 pt1, vec2 pt2, vec2 testPt)",
    "{",
    "  vec2 lineDir = pt2 - pt1;",
    "  vec2 perpDir = vec2(lineDir.y, -lineDir.x);",
    "  vec2 dirToPt1 = pt1 - testPt;",
    "  return dot(normalize(perpDir), dirToPt1);",
    "}",
    "float distToAngle(vec2 apex, vec2 left, vec2 right, vec2 testPt)",
    "{",
    "  float dist = distToLine(apex, left, testPt);",
    "  dist = min(dist, distToLine(right, apex, testPt));",
    "  float cut = distToLine(left, right, testPt);",
    "  if (cut < 0.0) return -1.0;",
    "  return dist;",
    "}",
    "float distToHull(vec2 p1, vec2 p2, vec2 p3, vec2 p4, vec2 testPt)",
    "{",
    "  float dist = distToLine(p1, p2, testPt);",
    "  dist = min(dist, distToLine(p2, p3, testPt));",
    "  dist = min(dist, distToLine(p4, p1, testPt));",
    "  float cut = distToLine(p3, p4, testPt);",
    "  if (cut < 0.0) return -1.0;",
    "  return dist;",
    "}",
    "vec2 rotate(vec2 pt, float a)",
    "{",
    "  return vec2(cos(a)*pt.x - sin(a)*pt.y, sin(a)*pt.x + cos(a)*pt.y);",
    "}",
    "void main () {",
    "  if (positionVar.x < clip[0] || positionVar.x > clip[2] || positionVar.y < clip[1] || positionVar.y > clip[3]) {",
    "    discard;",
    "  }",
    "  float dist;",
    "  float d1;",
    "  float d2;",
    // circle
    "  if (shapeVar == 0.0) {",
    "    dist = length(unitVar);",
    "  }",
    // cross
    "  if (shapeVar == 1.0) {",
    "    float inset = 1.0 / 2.5;",
    "    d1 = distToLine(vec2(-inset, -1.0), vec2(inset, -1.0), unitVar);",
    "    d1 = min(d1, distToLine(vec2(inset, -1.0), vec2(inset, 1.0), unitVar));",
    "    d1 = min(d1, distToLine(vec2(inset, 1.0), vec2(-inset, 1.0), unitVar));",
    "    d1 = min(d1, distToLine(vec2(-inset, 1.0), vec2(-inset, -1.0), unitVar));",
    "    d1 = 1.0 - d1;",
    "    d2 = distToLine(vec2(1.0, -inset), vec2(1.0, inset), unitVar);",
    "    d2 = min(d2, distToLine(vec2(1.0, inset), vec2(-1.0, inset), unitVar));",
    "    d2 = min(d2, distToLine(vec2(-1.0, inset), vec2(-1.0, -inset), unitVar));",
    "    d2 = min(d2, distToLine(vec2(-1.0, -inset), vec2(1.0, -inset), unitVar));",
    "    d2 = 1.0 - d2;",
    "    dist = min(d1, d2);",
    "  }",
    // diamond
    "  if (shapeVar == 2.0) {",
    "    dist = distToLine(vec2(0.0, -1.0), vec2(1.0, 0.0), unitVar);",
    "    dist = min(dist, distToLine(vec2(1.0, 0.0), vec2(0.0, 1.0), unitVar));",
    "    dist = min(dist, distToLine(vec2(0.0, 1.0), vec2(-1.0, 0.0), unitVar));",
    "    dist = min(dist, distToLine(vec2(-1.0, 0.0), vec2(0.0, -1.0), unitVar));",
    "    dist = 1.0 - dist;",
    "  }",
    // square
    "  if (shapeVar == 3.0) {",
    "    float side = sqrt(2.0)/2.0;",
    "    dist = distToLine(vec2(-side, -side), vec2(side, -side), unitVar);",
    "    dist = min(dist, distToLine(vec2(side, -side), vec2(side, side), unitVar));",
    "    dist = min(dist, distToLine(vec2(side, side), vec2(-side, side), unitVar));",
    "    dist = min(dist, distToLine(vec2(-side, side), vec2(-side, -side), unitVar));",
    "    dist = 1.0 - dist;",
    "  }",
    // star
    "  if (shapeVar == 4.0) {",
    "    float h = 1.0;",
    "    float x = h * tan(PI/10.0);",
    "    vec2 p1 = vec2(0.0, -h);",
    "    vec2 p2 = vec2(x, 0);",
    "    vec2 p3 = vec2(-x, 0);",
    "    float angle = 0.0;",
    "    dist = 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar);",
    "    angle = angle + 2.0*PI/5.0;",
    "    dist = min(dist, 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar));",
    "    angle = angle + 2.0*PI/5.0;",
    "    dist = min(dist, 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar));",
    "    angle = angle + 2.0*PI/5.0;",
    "    dist = min(dist, 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar));",
    "    angle = angle + 2.0*PI/5.0;",
    "    dist = min(dist, 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar));",
    "  }",
    // triangle-up
    "  if (shapeVar == 5.0) {",
    "    vec2 p1 = vec2(0.0, -sqrt(2.0)/2.0);",
    "    vec2 p2 = vec2(sqrt(6.0)/3.0, sqrt(2.0)/2.0);",
    "    vec2 p3 = vec2(-sqrt(6.0)/3.0, sqrt(2.0)/2.0);",
    "    dist = distToLine(p1, p2, unitVar);",
    "    dist = min(dist, distToLine(p2, p3, unitVar));",
    "    dist = min(dist, distToLine(p3, p1, unitVar));",
    "    dist = 1.0 - dist;",
    "  }",
    // triangle-right
    "  if (shapeVar == 6.0) {",
    "    vec2 p1 = vec2(sqrt(2.0)/2.0, 0.0);",
    "    vec2 p2 = vec2(-sqrt(2.0)/2.0, sqrt(6.0)/3.0);",
    "    vec2 p3 = vec2(-sqrt(2.0)/2.0, -sqrt(6.0)/3.0);",
    "    dist = distToLine(p1, p2, unitVar);",
    "    dist = min(dist, distToLine(p2, p3, unitVar));",
    "    dist = min(dist, distToLine(p3, p1, unitVar));",
    "    dist = 1.0 - dist;",
    "  }",
    // triangle-down
    "  if (shapeVar == 7.0) {",
    "    vec2 p1 = vec2(0.0, sqrt(2.0)/2.0);",
    "    vec2 p2 = vec2(-sqrt(6.0)/3.0, -sqrt(2.0)/2.0);",
    "    vec2 p3 = vec2(sqrt(6.0)/3.0, -sqrt(2.0)/2.0);",
    "    dist = distToLine(p1, p2, unitVar);",
    "    dist = min(dist, distToLine(p2, p3, unitVar));",
    "    dist = min(dist, distToLine(p3, p1, unitVar));",
    "    dist = 1.0 - dist;",
    "  }",
    // triangle-left
    "  if (shapeVar == 8.0) {",
    "    vec2 p1 = vec2(-sqrt(2.0)/2.0, 0.0);",
    "    vec2 p2 = vec2(sqrt(2.0)/2.0, -sqrt(6.0)/3.0);",
    "    vec2 p3 = vec2(sqrt(2.0)/2.0, sqrt(6.0)/3.0);",
    "    dist = distToLine(p1, p2, unitVar);",
    "    dist = min(dist, distToLine(p2, p3, unitVar));",
    "    dist = min(dist, distToLine(p3, p1, unitVar));",
    "    dist = 1.0 - dist;",
    "  }",
    // wye
    "  if (shapeVar == 9.0) {",
    "    float h = 12.0 / (12.0 + sqrt(12.0));",
    "    float y = h / sqrt(12.0) + h;",
    "    vec2 p1 = vec2(h / 2.0, y);",
    "    vec2 p2 = vec2(-h / 2.0, y);",
    "    vec2 p3 = vec2(-h / 2.0, 0.0);",
    "    vec2 p4 = vec2(h / 2.0, 0.0);",
    "    float angle = 0.0;",
    "    dist = 1.0 - distToHull(p1, p2, p3, p4, unitVar);",
    "    angle = angle + 2.0*PI/3.0;",
    "    dist = min(dist, 1.0 - distToHull(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), rotate(p4, angle), unitVar));",
    "    angle = angle + 2.0*PI/3.0;",
    "    dist = min(dist, 1.0 - distToHull(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), rotate(p4, angle), unitVar));",
    "  }",
    "  float endStep = 1.0;",
    "  float antialiasDist = 1.0 / sizeVar / 2.0;",
    "  float widthDist = strokeWidthVar / sizeVar / 2.0;",
    "  vec4 c1;",
    "  vec4 c2;",
    "  float step;",
    "  if (dist < endStep) {",
    "    step = smoothstep(endStep - widthDist - antialiasDist, endStep - widthDist + antialiasDist, dist);",
    "    if (fillColorVar.a > 0.0) {",
    "      c1 = fillColorVar;",
    "    } else {",
    "      c1 = vec4(strokeColorVar.rgb, 0.0);",
    "    }",
    "    if (strokeColorVar.a > 0.0) {",
    "      c2 = strokeColorVar;",
    "    } else {",
    "      c2 = vec4(fillColorVar.rgb, 0.0);",
    "    }",
    "  } else {",
    "    step = smoothstep(endStep + widthDist - antialiasDist, endStep + widthDist + antialiasDist, dist);",
    "    if (strokeColorVar.a > 0.0) {",
    "      c1 = strokeColorVar;",
    "      c2 = vec4(strokeColorVar.rgb, 0.0);",
    "    } else {",
    "      c1 = vec4(fillColorVar.rgb, 0.0);",
    "      c2 = vec4(fillColorVar.rgb, 0.0);",
    "    }",
    "  }",
    "  gl_FragColor = mix(c1, c2, step);",
    "}"
  ].join(`
`), s = i.createShader(i.FRAGMENT_SHADER), i.shaderSource(s, g), i.compileShader(s), !i.getShaderParameter(s, i.COMPILE_STATUS))
    throw i.getShaderInfoLog(s);
  if (I = i.createProgram(), i.attachShader(I, o), i.attachShader(I, s), i.linkProgram(I), i._symbolShaderProgram = I, i._symbolPosLocation = i.getAttribLocation(I, "pos"), i._symbolFillColorLocation = i.getAttribLocation(I, "fillColor"), i._symbolStrokeColorLocation = i.getAttribLocation(I, "strokeColor"), i._symbolFillOpacityLocation = i.getAttribLocation(I, "fillOpacity"), i._symbolStrokeWidthLocation = i.getAttribLocation(I, "strokeWidth"), i._symbolSizeLocation = i.getAttribLocation(I, "size"), i._symbolShapeLocation = i.getAttribLocation(I, "shape"), i._symbolStrokeOpacityLocation = i.getAttribLocation(I, "strokeOpacity"), i._symbolUnitLocation = i.getAttribLocation(I, "unit"), i._symbolMatrixLocation = i.getUniformLocation(I, "matrix"), i._symbolClipLocation = i.getUniformLocation(I, "clip"), n = [
    "attribute vec3 pos;",
    "attribute vec3 fillColor;",
    "attribute vec3 strokeColor;",
    "attribute float fillOpacity;",
    "attribute float strokeWidth;",
    "attribute float strokeOpacity;",
    "attribute float cornerRadius;",
    "attribute vec2 size;",
    "attribute vec2 unit;",
    "uniform mat4 matrix;",
    "varying vec4 fillColorVar;",
    "varying vec4 strokeColorVar;",
    "varying float strokeWidthVar;",
    "varying float cornerRadiusVar;",
    "varying float factorVar;",
    "varying vec2 sizeVar;",
    "varying vec2 unitVar;",
    "varying vec4 positionVar;",
    "void main(void)",
    "{",
    "  strokeWidthVar = strokeWidth;",
    "  fillColorVar = vec4(fillColor, fillOpacity);",
    "  strokeColorVar = vec4(strokeColor, strokeOpacity);",
    "  cornerRadiusVar = cornerRadius;",
    "  sizeVar = size;",
    "  unitVar = unit;",
    "  factorVar = max(size.x, size.y) + strokeWidth + 1.0;",
    "  positionVar = vec4(pos.xy + factorVar*unitVar - 0.5*strokeWidth - 0.5, -1.0, 1.0);",
    "  gl_Position = matrix * positionVar;",
    "}"
  ].join(`
`), o = i.createShader(i.VERTEX_SHADER), i.shaderSource(o, n), i.compileShader(o), !i.getShaderParameter(o, i.COMPILE_STATUS))
    throw i.getShaderInfoLog(o);
  if (g = [
    "precision mediump float;",
    "const float PI = 3.1415926535897932384626433832795;",
    "varying vec4 fillColorVar;",
    "varying vec4 strokeColorVar;",
    "varying float strokeWidthVar;",
    "varying float cornerRadiusVar;",
    "varying float factorVar;",
    "varying vec2 unitVar;",
    "varying vec2 sizeVar;",
    "varying vec4 positionVar;",
    "uniform vec4 clip;",
    "float distToLine(vec2 pt1, vec2 pt2, vec2 testPt)",
    "{",
    "  vec2 lineDir = pt2 - pt1;",
    "  vec2 perpDir = vec2(lineDir.y, -lineDir.x);",
    "  vec2 dirToPt1 = pt1 - testPt;",
    "  return dot(normalize(perpDir), dirToPt1);",
    "}",
    "float cornerDist(vec2 pt, float radius, float xdir, float ydir, vec2 testPt)",
    "{",
    "  if (xdir * (pt.x - testPt.x) > 0.0) return 1.0;",
    "  if (ydir * (pt.y - testPt.y) > 0.0) return 1.0;",
    "  return radius - length(pt - testPt);",
    "}",
    "void main () {",
    "  if (positionVar.x < clip[0] || positionVar.x > clip[2] || positionVar.y < clip[1] || positionVar.y > clip[3]) {",
    "    discard;",
    "  }",
    "  float delta = (0.5 + 0.5*strokeWidthVar)/factorVar;",
    "  float xmax = (0.5 + 0.5*strokeWidthVar + sizeVar.x)/factorVar;",
    "  float ymax = (0.5 + 0.5*strokeWidthVar + sizeVar.y)/factorVar;",
    "  vec2 p1 = vec2(delta, delta);",
    "  vec2 p2 = vec2(xmax, delta);",
    "  vec2 p3 = vec2(xmax, ymax);",
    "  vec2 p4 = vec2(delta, ymax);",
    "  float dist = distToLine(p1, p2, unitVar);",
    "  dist = min(dist, distToLine(p2, p3, unitVar));",
    "  dist = min(dist, distToLine(p3, p4, unitVar));",
    "  dist = min(dist, distToLine(p4, p1, unitVar));",
    "  if (cornerRadiusVar > 0.0) {",
    "    delta = (0.5 + 0.5*strokeWidthVar + cornerRadiusVar)/factorVar;",
    "    xmax = (0.5 + 0.5*strokeWidthVar + sizeVar.x - cornerRadiusVar)/factorVar;",
    "    ymax = (0.5 + 0.5*strokeWidthVar + sizeVar.y - cornerRadiusVar)/factorVar;",
    "    p1 = vec2(delta, delta);",
    "    p2 = vec2(xmax, delta);",
    "    p3 = vec2(xmax, ymax);",
    "    p4 = vec2(delta, ymax);",
    "    dist = min(dist, cornerDist(p1, cornerRadiusVar/factorVar, -1.0, -1.0, unitVar));",
    "    dist = min(dist, cornerDist(p2, cornerRadiusVar/factorVar, 1.0, -1.0, unitVar));",
    "    dist = min(dist, cornerDist(p3, cornerRadiusVar/factorVar, 1.0, 1.0, unitVar));",
    "    dist = min(dist, cornerDist(p4, cornerRadiusVar/factorVar, -1.0, 1.0, unitVar));",
    "  }",
    "  dist = 1.0 - dist;",
    "  float endStep = 1.0;",
    "  float antialiasDist = 0.5 / factorVar;",
    "  float widthDist = 0.5*strokeWidthVar / factorVar;",
    "  vec4 c1;",
    "  vec4 c2;",
    "  float step;",
    "  if (dist < endStep) {",
    "    step = smoothstep(endStep - widthDist - antialiasDist, endStep - widthDist + antialiasDist, dist);",
    "    if (fillColorVar.a > 0.0) {",
    "      c1 = fillColorVar;",
    "    } else {",
    "      c1 = vec4(strokeColorVar.rgb, 0.0);",
    "    }",
    "    if (strokeWidthVar > 0.0) {",
    "      c2 = strokeColorVar;",
    "    } else {",
    "      c2 = vec4(fillColorVar.rgb, 0.0);",
    "    }",
    "  } else {",
    "    step = smoothstep(endStep + widthDist - antialiasDist, endStep + widthDist + antialiasDist, dist);",
    "    if (strokeWidthVar > 0.0) {",
    "      c1 = strokeColorVar;",
    "      c2 = vec4(strokeColorVar.rgb, 0.0);",
    "    } else {",
    "      c1 = vec4(fillColorVar.rgb, 0.0);",
    "      c2 = vec4(fillColorVar.rgb, 0.0);",
    "    }",
    "  }",
    "  gl_FragColor = mix(c1, c2, step);",
    "}"
  ].join(`
`), s = i.createShader(i.FRAGMENT_SHADER), i.shaderSource(s, g), i.compileShader(s), !i.getShaderParameter(s, i.COMPILE_STATUS))
    throw i.getShaderInfoLog(s);
  return I = i.createProgram(), i.attachShader(I, o), i.attachShader(I, s), i.linkProgram(I), i._rectShaderProgram = I, i._rectPosLocation = i.getAttribLocation(I, "pos"), i._rectFillColorLocation = i.getAttribLocation(I, "fillColor"), i._rectStrokeColorLocation = i.getAttribLocation(I, "strokeColor"), i._rectFillOpacityLocation = i.getAttribLocation(I, "fillOpacity"), i._rectStrokeWidthLocation = i.getAttribLocation(I, "strokeWidth"), i._rectSizeLocation = i.getAttribLocation(I, "size"), i._rectStrokeOpacityLocation = i.getAttribLocation(I, "strokeOpacity"), i._rectCornerRadiusLocation = i.getAttribLocation(I, "cornerRadius"), i._rectUnitLocation = i.getAttribLocation(I, "unit"), i._rectMatrixLocation = i.getUniformLocation(I, "matrix"), i._rectClipLocation = i.getUniformLocation(I, "clip"), t;
}
var Fbt = typeof window < "u" && window.devicePixelRatio || 1;
function Mbt(A, e, t, i) {
  var n = typeof HTMLElement < "u" && A instanceof HTMLElement && A.parentNode != null, o = A.getContext("webgl") || A.getContext("experimental-webgl"), g = n ? Fbt : 1;
  return A.width = e * g, A.height = t * g, o._textCanvas.width = e * g, o._textCanvas.height = t * g, o._textContext.pixelRatio = g, o._textContext.setTransform(
    g,
    0,
    0,
    g,
    g * i[0],
    g * i[1]
  ), g !== 1 && (A.style.width = e + "px", A.style.height = t + "px"), o.lineWidth(g), o.viewport(0, 0, o.canvas.width, o.canvas.height), o._origin = i, o._ratio = g, o._clip = [0, 0, A.width / o._ratio, A.height / o._ratio], A;
}
function msA(A) {
  Fg.call(this, A), this._redraw = !1, this._angleX = 0, this._angleY = 0, this._angleZ = 0, this._translateX = 0, this._translateY = 0, this._translateZ = 0, this._zFactor = 0, this._depthTest = !1, this._randomZ = !1;
}
var hs = Ybt(msA, Fg), Z5A = Fg.prototype;
hs.initialize = function(A, e, t, i) {
  return this._canvas = Rbt(1, 1), A && (GI(A, 0).appendChild(this._canvas), this._canvas.setAttribute("class", "marks")), Z5A.initialize.call(this, A, e, t, i);
};
hs.resize = function(A, e, t) {
  return Z5A.resize.call(this, A, e, t), Mbt(this._canvas, this._width, this._height, this._origin), this._redraw = !0, this;
};
hs.canvas = function() {
  return this._canvas;
};
hs.context = function() {
  return this._canvas ? this._canvas.getContext("webgl") || this._canvas.getContext("experimental-webgl") : null;
};
hs.rotate = function(A, e, t) {
  return this._angleX = A, this._angleY = e, this._angleZ = t, this;
};
hs.translate = function(A, e, t) {
  return this._translateX = A, this._translateY = e, this._translateZ = t, this;
};
hs.zFactor = function(A) {
  return this._zFactor = A, this;
};
hs.depthTest = function(A) {
  return this._depthTest = A, this;
};
hs.randomZ = function(A) {
  return this._randomZ = A, this;
};
hs._updateUniforms = function() {
  var A = this.context();
  A.useProgram(A._shaderProgram);
  var e = A.canvas.width / A._ratio, t = A.canvas.height / A._ratio, i = [
    2 / e,
    0,
    0,
    0,
    0,
    -2 / e,
    0,
    0,
    0,
    0,
    1,
    0,
    -1,
    t / e,
    0,
    1
  ];
  this.matrix = [
    1,
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    0,
    0,
    1
  ], this.matrix = GE(this.matrix, Ibt(Math.PI / 2, e / t, 0.01, 3e3)), this.matrix = GE(this.matrix, RyA(this._translateX, this._translateY, (this._translateZ - 1) * t / e)), this.matrix = GE(this.matrix, Cbt(this._angleZ)), this.matrix = GE(this.matrix, rbt(this._angleY)), this.matrix = GE(this.matrix, abt(this._angleX)), this.matrix = GE(this.matrix, RyA(0, 0, 1)), this.matrix = GE(this.matrix, i), A._matrix = this.matrix, A.uniform1f(A._zFactorLocation, this._zFactor), A.uniformMatrix4fv(A._matrixLocation, !1, this.matrix);
};
hs._render = function(A, e) {
  var t = this.context(), i, n;
  if (t._tx = 0, t._ty = 0, t._triangleGeometry = [], t._triangleColor = [], t._images)
    for (n = 0; n < t._images.length; n++)
      t.deleteTexture(t._images[n].texture);
  if (t._images = [], t._randomZ = this._randomZ, t._pathCacheHit = 0, t._pathCacheMiss = 0, t._itemCacheHit = 0, t._itemCacheMiss = 0, t._shapeCacheHit = 0, t._shapeCacheMiss = 0, i = !e || this._redraw ? (this._redraw = !1, null) : void 0, e)
    for (n = 0; n < e.length; n++)
      e[n]._dirty = !0, e[n].exit && Rg[e[n].mark.marktype].nested && e[n].mark.items.length && (e[n].mark.items[0]._dirty = !0);
  else
    t._fullRedraw = !0;
  this._depthTest ? t.enable(t.DEPTH_TEST) : t.disable(t.DEPTH_TEST), this._updateUniforms(), this.clear(), this.draw(t, A, i);
  var o = S5A(t, t._textCanvas);
  for (o.x = 0, o.y = 0, o.w = t.canvas.width / t._ratio, o.h = t.canvas.height / t._ratio, t._images.push(o), n = 0; n < t._images.length; n++)
    Bbt(t, t._images[n], this.matrix);
  if (e)
    for (n = 0; n < e.length; n++)
      e[n]._dirty = !1;
  return t._fullRedraw = !1, this._lastScene = A, this;
};
hs.frame = function() {
  return this._lastScene && this._render(this._lastScene, []), this;
};
hs.draw = function(A, e, t) {
  var i = Nbt[e.marktype];
  i.drawGL && i.drawGL.call(this, A, e, t);
};
hs.toDataURL = function(A) {
  return this.render(A, null), this.canvas().toDataURL("image/png", 1);
};
hs.clear = function() {
  var A = this.context(), e;
  this._bgcolor != null ? (e = Lp(A, null, this._bgcolor), A.clearColor(e[0], e[1], e[2], 1)) : A.clearColor(1, 1, 1, 1), A.clear(A.COLOR_BUFFER_BIT | A.DEPTH_BUFFER_BIT), A._textContext.save(), A._textContext.setTransform(1, 0, 0, 1, 0, 0), A._textContext.clearRect(0, 0, A._textCanvas.width, A._textCanvas.height), A._textContext.restore();
};
gr.prototype.context = function() {
  return this._canvas.getContext("2d") || this._canvas._textCanvas.getContext("2d");
};
$D("webgl", { handler: gr, renderer: msA });
function xbt(A, e, t, i, n) {
  W5A(A, e, t || 0, i || A.length - 1, n || Lbt);
}
function W5A(A, e, t, i, n) {
  for (; i > t; ) {
    if (i - t > 600) {
      var o = i - t + 1, g = e - t + 1, s = Math.log(o), I = 0.5 * Math.exp(2 * s / 3), r = 0.5 * Math.sqrt(s * I * (o - I) / o) * (g - o / 2 < 0 ? -1 : 1), a = Math.max(t, Math.floor(e - g * I / o + r)), C = Math.min(i, Math.floor(e + (o - g) * I / o + r));
      W5A(A, e, a, C, n);
    }
    var B = A[e], l = t, Q = i;
    for (AJ(A, t, e), n(A[i], B) > 0 && AJ(A, t, i); l < Q; ) {
      for (AJ(A, l, Q), l++, Q--; n(A[l], B) < 0; )
        l++;
      for (; n(A[Q], B) > 0; )
        Q--;
    }
    n(A[t], B) === 0 ? AJ(A, t, Q) : (Q++, AJ(A, Q, i)), Q <= e && (t = Q + 1), e <= Q && (i = Q - 1);
  }
}
function AJ(A, e, t) {
  var i = A[e];
  A[e] = A[t], A[t] = i;
}
function Lbt(A, e) {
  return A < e ? -1 : A > e ? 1 : 0;
}
class vbt {
  constructor(e = 9) {
    this._maxEntries = Math.max(4, e), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();
  }
  all() {
    return this._all(this.data, []);
  }
  search(e) {
    let t = this.data;
    const i = [];
    if (!_x(e, t))
      return i;
    const n = this.toBBox, o = [];
    for (; t; ) {
      for (let g = 0; g < t.children.length; g++) {
        const s = t.children[g], I = t.leaf ? n(s) : s;
        _x(e, I) && (t.leaf ? i.push(s) : c_(e, I) ? this._all(s, i) : o.push(s));
      }
      t = o.pop();
    }
    return i;
  }
  collides(e) {
    let t = this.data;
    if (!_x(e, t))
      return !1;
    const i = [];
    for (; t; ) {
      for (let n = 0; n < t.children.length; n++) {
        const o = t.children[n], g = t.leaf ? this.toBBox(o) : o;
        if (_x(e, g)) {
          if (t.leaf || c_(e, g))
            return !0;
          i.push(o);
        }
      }
      t = i.pop();
    }
    return !1;
  }
  load(e) {
    if (!(e && e.length))
      return this;
    if (e.length < this._minEntries) {
      for (let i = 0; i < e.length; i++)
        this.insert(e[i]);
      return this;
    }
    let t = this._build(e.slice(), 0, e.length - 1, 0);
    if (!this.data.children.length)
      this.data = t;
    else if (this.data.height === t.height)
      this._splitRoot(this.data, t);
    else {
      if (this.data.height < t.height) {
        const i = this.data;
        this.data = t, t = i;
      }
      this._insert(t, this.data.height - t.height - 1, !0);
    }
    return this;
  }
  insert(e) {
    return e && this._insert(e, this.data.height - 1), this;
  }
  clear() {
    return this.data = Bb([]), this;
  }
  remove(e, t) {
    if (!e)
      return this;
    let i = this.data;
    const n = this.toBBox(e), o = [], g = [];
    let s, I, r;
    for (; i || o.length; ) {
      if (i || (i = o.pop(), I = o[o.length - 1], s = g.pop(), r = !0), i.leaf) {
        const a = Hbt(e, i.children, t);
        if (a !== -1)
          return i.children.splice(a, 1), o.push(i), this._condense(o), this;
      }
      !r && !i.leaf && c_(i, n) ? (o.push(i), g.push(s), s = 0, I = i, i = i.children[0]) : I ? (s++, i = I.children[s], r = !1) : i = null;
    }
    return this;
  }
  toBBox(e) {
    return e;
  }
  compareMinX(e, t) {
    return e.minX - t.minX;
  }
  compareMinY(e, t) {
    return e.minY - t.minY;
  }
  toJSON() {
    return this.data;
  }
  fromJSON(e) {
    return this.data = e, this;
  }
  _all(e, t) {
    const i = [];
    for (; e; )
      e.leaf ? t.push(...e.children) : i.push(...e.children), e = i.pop();
    return t;
  }
  _build(e, t, i, n) {
    const o = i - t + 1;
    let g = this._maxEntries, s;
    if (o <= g)
      return s = Bb(e.slice(t, i + 1)), Ny(s, this.toBBox), s;
    n || (n = Math.ceil(Math.log(o) / Math.log(g)), g = Math.ceil(o / Math.pow(g, n - 1))), s = Bb([]), s.leaf = !1, s.height = n;
    const I = Math.ceil(o / g), r = I * Math.ceil(Math.sqrt(g));
    FyA(e, t, i, r, this.compareMinX);
    for (let a = t; a <= i; a += r) {
      const C = Math.min(a + r - 1, i);
      FyA(e, a, C, I, this.compareMinY);
      for (let B = a; B <= C; B += I) {
        const l = Math.min(B + I - 1, C);
        s.children.push(this._build(e, B, l, n - 1));
      }
    }
    return Ny(s, this.toBBox), s;
  }
  _chooseSubtree(e, t, i, n) {
    for (; n.push(t), !(t.leaf || n.length - 1 === i); ) {
      let o = 1 / 0, g = 1 / 0, s;
      for (let I = 0; I < t.children.length; I++) {
        const r = t.children[I], a = l_(r), C = Wbt(e, r) - a;
        C < g ? (g = C, o = a < o ? a : o, s = r) : C === g && a < o && (o = a, s = r);
      }
      t = s || t.children[0];
    }
    return t;
  }
  _insert(e, t, i) {
    const n = i ? e : this.toBBox(e), o = [], g = this._chooseSubtree(n, this.data, t, o);
    for (g.children.push(e), zJ(g, n); t >= 0 && o[t].children.length > this._maxEntries; )
      this._split(o, t), t--;
    this._adjustParentBBoxes(n, o, t);
  }
  // split overflowed node into two
  _split(e, t) {
    const i = e[t], n = i.children.length, o = this._minEntries;
    this._chooseSplitAxis(i, o, n);
    const g = this._chooseSplitIndex(i, o, n), s = Bb(i.children.splice(g, i.children.length - g));
    s.height = i.height, s.leaf = i.leaf, Ny(i, this.toBBox), Ny(s, this.toBBox), t ? e[t - 1].children.push(s) : this._splitRoot(i, s);
  }
  _splitRoot(e, t) {
    this.data = Bb([e, t]), this.data.height = e.height + 1, this.data.leaf = !1, Ny(this.data, this.toBBox);
  }
  _chooseSplitIndex(e, t, i) {
    let n, o = 1 / 0, g = 1 / 0;
    for (let s = t; s <= i - t; s++) {
      const I = XJ(e, 0, s, this.toBBox), r = XJ(e, s, i, this.toBBox), a = Kbt(I, r), C = l_(I) + l_(r);
      a < o ? (o = a, n = s, g = C < g ? C : g) : a === o && C < g && (g = C, n = s);
    }
    return n || i - t;
  }
  // sorts node children by the best axis for split
  _chooseSplitAxis(e, t, i) {
    const n = e.leaf ? this.compareMinX : Sbt, o = e.leaf ? this.compareMinY : Zbt, g = this._allDistMargin(e, t, i, n), s = this._allDistMargin(e, t, i, o);
    g < s && e.children.sort(n);
  }
  // total margin of all possible split distributions where each node is at least m full
  _allDistMargin(e, t, i, n) {
    e.children.sort(n);
    const o = this.toBBox, g = XJ(e, 0, t, o), s = XJ(e, i - t, i, o);
    let I = Tx(g) + Tx(s);
    for (let r = t; r < i - t; r++) {
      const a = e.children[r];
      zJ(g, e.leaf ? o(a) : a), I += Tx(g);
    }
    for (let r = i - t - 1; r >= t; r--) {
      const a = e.children[r];
      zJ(s, e.leaf ? o(a) : a), I += Tx(s);
    }
    return I;
  }
  _adjustParentBBoxes(e, t, i) {
    for (let n = i; n >= 0; n--)
      zJ(t[n], e);
  }
  _condense(e) {
    for (let t = e.length - 1, i; t >= 0; t--)
      e[t].children.length === 0 ? t > 0 ? (i = e[t - 1].children, i.splice(i.indexOf(e[t]), 1)) : this.clear() : Ny(e[t], this.toBBox);
  }
}
function Hbt(A, e, t) {
  if (!t)
    return e.indexOf(A);
  for (let i = 0; i < e.length; i++)
    if (t(A, e[i]))
      return i;
  return -1;
}
function Ny(A, e) {
  XJ(A, 0, A.children.length, e, A);
}
function XJ(A, e, t, i, n) {
  n || (n = Bb(null)), n.minX = 1 / 0, n.minY = 1 / 0, n.maxX = -1 / 0, n.maxY = -1 / 0;
  for (let o = e; o < t; o++) {
    const g = A.children[o];
    zJ(n, A.leaf ? i(g) : g);
  }
  return n;
}
function zJ(A, e) {
  return A.minX = Math.min(A.minX, e.minX), A.minY = Math.min(A.minY, e.minY), A.maxX = Math.max(A.maxX, e.maxX), A.maxY = Math.max(A.maxY, e.maxY), A;
}
function Sbt(A, e) {
  return A.minX - e.minX;
}
function Zbt(A, e) {
  return A.minY - e.minY;
}
function l_(A) {
  return (A.maxX - A.minX) * (A.maxY - A.minY);
}
function Tx(A) {
  return A.maxX - A.minX + (A.maxY - A.minY);
}
function Wbt(A, e) {
  return (Math.max(e.maxX, A.maxX) - Math.min(e.minX, A.minX)) * (Math.max(e.maxY, A.maxY) - Math.min(e.minY, A.minY));
}
function Kbt(A, e) {
  const t = Math.max(A.minX, e.minX), i = Math.max(A.minY, e.minY), n = Math.min(A.maxX, e.maxX), o = Math.min(A.maxY, e.maxY);
  return Math.max(0, n - t) * Math.max(0, o - i);
}
function c_(A, e) {
  return A.minX <= e.minX && A.minY <= e.minY && e.maxX <= A.maxX && e.maxY <= A.maxY;
}
function _x(A, e) {
  return e.minX <= A.maxX && e.minY <= A.maxY && e.maxX >= A.minX && e.maxY >= A.minY;
}
function Bb(A) {
  return {
    children: A,
    height: 1,
    leaf: !0,
    minX: 1 / 0,
    minY: 1 / 0,
    maxX: -1 / 0,
    maxY: -1 / 0
  };
}
function FyA(A, e, t, i, n) {
  const o = [e, t];
  for (; o.length; ) {
    if (t = o.pop(), e = o.pop(), t - e <= i)
      continue;
    const g = e + Math.ceil((t - e) / i / 2) * i;
    xbt(A, g, e, t, n), o.push(e, g, g, t);
  }
}
gr.prototype.context = function() {
  return this._canvas.getContext("2d") || this._canvas._textCanvas.getContext("2d");
};
$D("webgl", { handler: gr, renderer: msA });
const ka = 5, nW = "_gw_pixel_index", Wc = 255, K5A = {
  PRIMARY: 1,
  SECONDARY: 2,
  WHELL: 4,
  BACK: 8,
  FORWARD: 16
}, psA = ["#4c78a8", "#f58518", "#e45756", "#72b7b2", "#54a24b", "#eeca3b", "#b279a2", "#ff9da6", "#9d755d", "#bab0ac"], qx = Object.fromEntries(psA.map((A, e) => [e + 1, { name: `L_${e + 1}`, color: A }])), C6 = [];
function U5A(A, e, t) {
  const [i, n] = u.useState(t), [o, g] = u.useState(!0);
  return u.useEffect(() => {
    let s = !1;
    g(!0);
    const I = A();
    if (I != null)
      return I.then((r) => {
        s || (g(!1), n(r));
      }), () => {
        s = !0;
      };
  }, e), [i, o];
}
function V5A(A) {
  const e = [];
  let t = 0;
  function i(n) {
    if (n.interactive !== !1) {
      if (n._ig_start = t, n.items)
        for (let o of n.items)
          i(o);
      n._ig_end = t, n.interactive === !0 && n._ig_start === n._ig_end && (e.push(n), ++t, ++n._ig_end);
    }
  }
  return i(A.root), e;
}
const MyA = (A) => A.domain.type === "nominal" ? We.PAINT_SIZE_FACTOR * We.PAINT_MAP_SIZE / A.domain.width : We.PAINT_SIZE_FACTOR;
function Ubt(A) {
  return A.every((e) => e === "quantitative") ? "circle" : A.find((e) => e === "quantitative") ? "bar" : "square";
}
function Vbt(A) {
  return A.every((e) => e === "quantitative") ? "circle" : A.find((e) => e === "quantitative") ? "tick" : "square";
}
const Xbt = ["circle", "bar"], oW = (A) => A === "quantitative" ? "quantitative" : "nominal", gW = function(A, e) {
  const t = /* @__PURE__ */ new Map();
  return A.forEach((i) => t.set(e(i), i)), [...t.values()];
}, xyA = (A) => gW([A.x, A.y, A.color, A.size, A.opacity, A.shape].filter((e) => !!e).filter((e) => e.analyticType === "dimension"), (e) => e.fid), LyA = (A, e, t) => e.domain.value.every((i) => i instanceof Array) ? {
  field: `${A.fid}[0]`,
  title: A.name,
  type: e.domain.type,
  axis: { labelOverlap: !0 },
  scale: {
    domain: e.domain.type === "nominal" && t != null && t.reverseNominalDomain ? e.domain.value.toReversed().map((i) => i[0]) : e.domain.value.map((i) => i[0])
  }
} : {
  field: A.fid,
  title: A.name,
  type: e.domain.type,
  axis: { labelOverlap: !0 },
  scale: { domain: e.domain.type === "nominal" && t != null && t.reverseNominalDomain ? e.domain.value.toReversed() : e.domain.value }
}, Yy = (A, e, t) => e != null && e.domain.value.every((i) => i instanceof Array) ? {
  field: `${A.fid}[0]`,
  title: A.name,
  type: oW(A.semanticType),
  axis: { labelOverlap: !0 },
  scale: e ? {
    domain: e.domain.type === "nominal" && t != null && t.reverseNominalDomain ? e.domain.value.toReversed().map((i) => i[0]) : e.domain.value.map((i) => i[0])
  } : void 0,
  aggregate: (t == null ? void 0 : t.aggregate) && A.analyticType === "measure"
} : {
  field: A.fid,
  title: A.name,
  type: oW(A.semanticType),
  axis: { labelOverlap: !0 },
  scale: e ? { domain: e.domain.type === "nominal" && t != null && t.reverseNominalDomain ? e.domain.value.toReversed() : e.domain.value } : void 0,
  aggregate: (t == null ? void 0 : t.aggregate) && A.analyticType === "measure"
}, zbt = (A) => {
  var e;
  const { t } = qe(), i = u.useContext(FQ), n = sg(), o = u.useMemo(() => [A.x, A.y, A.color, A.size, A.opacity, A.shape].filter((N) => N).map((N) => N.field), [A.x, A.y, A.color, A.size, A.opacity, A.shape]), [g, s] = u.useMemo(() => [gW(o.concat(A.facets.flatMap((N) => N.dimensions.map((v) => ({
    fid: v.fid,
    name: v.fid,
    semanticType: v.domain.type,
    analyticType: v.domain.type === "nominal" ? "dimension" : "measure"
  })))), (N) => N.fid).filter((N) => N.analyticType === "dimension"), o.filter((N) => N.analyticType === "measure")], [o, A.facets]), I = u.useMemo(() => gW([A.x, A.y, A.color, A.size, A.opacity, A.shape].filter((N) => N).filter((N) => N.domain), (N) => N.field.fid).map((N) => N.domain), []), r = u.useRef(We.PAINT_DEFAULT_BRUSH_SIZE), [a, C] = u.useState(We.PAINT_DEFAULT_BRUSH_SIZE);
  r.current = a;
  const B = u.useRef(2), [l, Q] = u.useState(2);
  B.current = l;
  const E = u.useRef(null), { loading: d, viewData: m } = jF({
    computationFunction: n,
    defaultAggregated: !0,
    filters: C6,
    allFields: A.allFields,
    limit: -1,
    sort: "none",
    viewDimensions: g,
    viewMeasures: s,
    timezoneDisplayOffset: A.displayOffset
  }), y = u.useMemo(() => m.map(w7(I)), [m, I]), [f, w] = U5A(async () => {
    const N = await i2A(m, { dict: A.dict, facets: A.facets, usedColor: [] });
    return m.map((v, K) => {
      var U;
      const j = A.paintMapRef.current[y[K]];
      return {
        ...v,
        [ln]: j === 0 ? N[K] ?? A.dict[1].name : (U = A.dict[j]) == null ? void 0 : U.name,
        [nW]: y[K]
      };
    });
  }, [y, m, A.dict, A.facets]), [G, R] = u.useState([0, 0]), F = u.useRef(() => {
  }), Z = d || w;
  u.useEffect(() => {
    if (!Z && E.current) {
      const N = Ubt([oW(A.y.field.semanticType), oW(A.x.field.semanticType)]), v = A.mark === "auto" ? C3([A.x.field.semanticType, A.y.field.semanticType]) : A.mark, K = Object.entries(A.dict), U = Xbt.includes(v) ? v : N, j = {
        data: {
          name: "data",
          values: f
        },
        mark: { type: U, fillOpacity: 0.66, strokeWidth: 4, strokeOpacity: 1, size: U === "circle" ? 600 : void 0 },
        encoding: {
          x: Yy(A.x.field, A.x.domain, { aggregate: !0 }),
          y: Yy(A.y.field, A.y.domain, { reverseNominalDomain: !0, aggregate: !0 }),
          fill: {
            field: ln,
            type: "nominal",
            title: "custom feature",
            scale: {
              domain: K.map(([q, O]) => O.name),
              range: K.map(([q, O]) => O.color)
            }
          },
          stroke: A.color ? Yy(A.color.field, A.color.domain) : void 0,
          opacity: A.opacity ? Yy(A.opacity.field, A.opacity.domain) : void 0,
          size: A.size ? Yy(A.size.field, A.size.domain) : void 0,
          shape: A.shape ? Yy(A.shape.field, A.shape.domain) : void 0
        },
        width: We.PAINT_MAP_SIZE * We.PAINT_SIZE_FACTOR,
        height: We.PAINT_MAP_SIZE * We.PAINT_SIZE_FACTOR
      };
      Object.values(j.encoding).forEach((q) => {
        if (!q || q.aggregate === null)
          return;
        const O = s.find(($) => $.fid === q.field);
        O && (q.title = op(O.name, O.aggName), q.field = io(O.fid, O.aggName));
      }), Tf(E.current, j, {
        renderer: "webgl",
        config: A.vegaConfig,
        actions: !1,
        tooltip: {
          theme: i
        }
      }).then((q) => {
        const O = q.view.scenegraph(), $ = q.view.origin();
        R([$[0] + ka, $[1] + ka]);
        const _ = /* @__PURE__ */ new Map(), tA = V5A(O), nA = new vbt();
        tA.forEach((rA) => Nn(rA, (sA) => {
          var lA;
          if ("datum" in sA) {
            const cA = sA.datum[nW];
            _.has(cA) || _.set(cA, []), (lA = _.get(cA)) == null || lA.push(sA), sA.bounds && nA.insert({ minX: sA.bounds.x1, minY: sA.bounds.y1, maxX: sA.bounds.x2, maxY: sA.bounds.y2, id: cA });
          }
        }));
        const AA = Lb(() => q.view._renderer._render(O.root), 15, { trailing: !0 });
        F.current = () => {
          A.onReset(), A.paintMapRef.current = xH(I);
          const { name: rA, color: sA } = A.dict[1];
          tA.forEach((lA) => Nn(lA, (cA) => {
            "datum" in cA && (cA.fill = sA, cA.datum[ln] = rA);
          })), AA();
        };
        const gA = (rA) => {
          rA.stopPropagation(), rA.preventDefault();
          const sA = (lA, cA) => {
            const aA = B.current === Wc ? {
              name: "",
              color: "transparent"
            } : A.dict[B.current];
            if (!aA)
              return;
            const QA = nA.search({
              minX: lA - r.current,
              minY: cA - r.current,
              maxX: lA + r.current,
              maxY: cA + r.current
            }).map((EA) => EA.id);
            let hA = 0;
            QA.forEach((EA) => {
              var RA;
              (RA = _.get(EA)) == null || RA.forEach((xA) => {
                xA.fill = aA.color, xA.datum[ln] = aA.name, hA++;
              }), A.paintMapRef.current[EA] = B.current;
            }), hA > 0 && AA();
          };
          if (rA instanceof MouseEvent && rA.buttons & K5A.PRIMARY)
            sA(rA.offsetX - $[0] - ka, rA.offsetY - $[1] - ka);
          else if (window.TouchEvent && rA instanceof TouchEvent) {
            const lA = E.current.getBoundingClientRect();
            sA(rA.changedTouches[0].pageX - lA.left - $[0] - ka, rA.changedTouches[0].pageY - lA.top - $[1] - ka);
          }
        };
        q.view.addEventListener("mousedown", gA), q.view.addEventListener("mousemove", gA), q.view.addEventListener("touchstart", gA), q.view.addEventListener("touchmove", gA);
      });
    }
  }, [Z, f, A.dict, A.vegaConfig, I, A.onReset, A.mark]);
  const [c, J] = b.useState(!1), p = u.useMemo(() => ({ type: "rect", x: a, y: a, xFactor: We.PAINT_SIZE_FACTOR, yFactor: We.PAINT_SIZE_FACTOR }), [a]);
  return u.useEffect(() => {
    J(!0);
    const N = setTimeout(() => {
      J(!1);
    }, 1e3);
    return () => {
      clearTimeout(N);
    };
  }, [a, l]), b.createElement(
    "div",
    { className: "flex" },
    b.createElement(
      d5A,
      { color: ((e = A.dict[l]) == null ? void 0 : e.color) ?? "#333", cursor: p, offsetX: G[0], offsetY: G[1], showPreview: c },
      b.createElement("div", { ref: E, id: "painter-container", className: "!cursor-none min-w-[600px] min-h-[512px]" })
    ),
    b.createElement(
      "div",
      { className: "flex flex-col space-y-2 pt-10 w-40 flex-shrink-0 px-1" },
      b.createElement(
        $F,
        { value: l === Wc ? "eraser" : "palette", onValueChange: (N) => {
          Q(N === "palette" ? 2 : Wc);
        } },
        b.createElement(
          lG,
          null,
          b.createElement(
            CC,
            { value: "palette" },
            " ",
            t("main.tabpanel.settings.paint.palette")
          ),
          b.createElement(
            CC,
            { value: "eraser" },
            " ",
            t("main.tabpanel.settings.paint.eraser")
          )
        ),
        l !== Wc && b.createElement(
          k2,
          { value: "palette" },
          b.createElement("div", { className: "grid grid-cols-5 gap-2 p-2" }, Object.entries(A.dict).map(([N, { color: v }]) => b.createElement("div", { key: N, className: `box-border rounded-full border-primary hover: ${N === `${l}` ? "border-2" : "hover:border-2"} active:ring-ring active:ring-1 w-4 h-4`, style: {
            background: v
          }, onClick: () => Q(Number(N)) }))),
          b.createElement(
            "div",
            { className: "flex space-x-2" },
            b.createElement("label", { className: "block text-xs font-medium" }, t("main.tabpanel.settings.paint.color")),
            b.createElement(m5A, { color: A.dict[l].color, colors: psA, onChangeColor: (N) => {
              A.onChangeDict({
                ...A.dict,
                [l]: {
                  color: N,
                  name: A.dict[l].name
                }
              });
            } })
          ),
          b.createElement(
            "div",
            { className: "flex flex-col space-y-2" },
            b.createElement("label", { className: "block text-xs font-medium" }, t("main.tabpanel.settings.paint.label")),
            b.createElement(h5A, { value: A.dict[l].name, onChange: (N) => {
              A.onChangeDict({
                ...A.dict,
                [l]: {
                  color: A.dict[l].color,
                  name: N
                }
              });
            } })
          )
        )
      ),
      b.createElement(
        "div",
        { className: "pt-2" },
        b.createElement(
          "output",
          { className: "text-sm" },
          t("main.tabpanel.settings.paint.brush_size"),
          ": ",
          `${a}`
        ),
        b.createElement(DY, { className: "mt-2", value: [a], min: We.PAINT_MIN_BRUSH_SIZE, max: We.PAINT_MAX_BRUSH_SIZE, onValueChange: ([N]) => C(N) })
      ),
      b.createElement(
        "div",
        { className: "flex-1 flex flex-col space-y-2 justify-end" },
        b.createElement(Re, { variant: "destructive", children: t("main.tabpanel.settings.paint.delete_paint"), onClick: A.onDelete }),
        b.createElement(Re, { variant: "outline", children: t("main.tabpanel.settings.paint.reset_paint"), onClick: () => F.current() }),
        b.createElement(Re, { variant: "outline", children: t("main.tabpanel.settings.paint.cancel"), onClick: A.onCancel }),
        b.createElement(Re, { children: t("main.tabpanel.settings.paint.save_paint"), onClick: A.onSave })
      )
    )
  );
}, Tbt = ["point", "circle", "tick"], _bt = (A) => {
  var e;
  const { t } = qe(), i = u.useContext(FQ), n = sg(), o = u.useMemo(() => gW([
    {
      ...A.x,
      analyticType: "measure"
    },
    {
      ...A.y,
      analyticType: "measure"
    }
  ].concat(A.facets.flatMap((c) => c.dimensions.map((J) => ({ fid: J.fid, name: J.fid, semanticType: J.domain.type, analyticType: "measure" })))), (c) => c.fid), [A.x, A.y]), g = u.useRef(We.PAINT_DEFAULT_BRUSH_SIZE), [s, I] = u.useState(We.PAINT_DEFAULT_BRUSH_SIZE);
  g.current = s;
  const r = u.useRef(2), [a, C] = u.useState(2);
  r.current = a;
  const B = u.useRef(null), { loading: l, viewData: Q } = jF({
    computationFunction: n,
    defaultAggregated: !1,
    filters: C6,
    allFields: A.allFields,
    limit: -1,
    sort: "none",
    viewDimensions: C6,
    viewMeasures: o,
    timezoneDisplayOffset: A.displayOffset
  }), E = u.useMemo(() => Q.map(w7([A.domainY, A.domainX])), [Q, A.domainX, A.domainY]), [d, m] = U5A(async () => {
    const c = await i2A(Q, { dict: A.dict, facets: A.facets, usedColor: [] });
    return Q.map((J, p) => {
      var N;
      const v = A.paintMapRef.current[E[p]];
      return {
        ...J,
        [ln]: v === 0 ? c[p] : (N = A.dict[v]) == null ? void 0 : N.name,
        [nW]: E[p]
      };
    });
  }, [E, Q, A.dict, A.facets]), [y, f] = u.useState([0, 0]), w = u.useRef(() => {
  }), G = l || m;
  u.useEffect(() => {
    if (!G && B.current) {
      const c = Vbt([A.domainY.domain.type, A.domainX.domain.type]), J = A.mark === "auto" ? C3([A.x.semanticType, A.y.semanticType]) : A.mark, p = Object.entries(A.dict), N = {
        data: {
          name: "data",
          values: d
        },
        mark: { type: Tbt.includes(J) ? J : c, opacity: 0.66 },
        encoding: {
          x: LyA(A.x, A.domainX),
          y: LyA(A.y, A.domainY, { reverseNominalDomain: !0 }),
          color: {
            field: ln,
            type: "nominal",
            title: "custom feature",
            scale: {
              domain: p.map(([v, K]) => K.name),
              range: p.map(([v, K]) => K.color)
            }
          }
        },
        width: We.PAINT_MAP_SIZE * We.PAINT_SIZE_FACTOR,
        height: We.PAINT_MAP_SIZE * We.PAINT_SIZE_FACTOR
      };
      Tf(B.current, N, {
        renderer: "webgl",
        config: A.vegaConfig,
        actions: !1,
        tooltip: {
          theme: i
        }
      }).then((v) => {
        const K = v.view.scenegraph(), U = v.view.origin();
        f([U[0] + ka, U[1] + ka]);
        const j = /* @__PURE__ */ new Map(), q = V5A(K);
        q.forEach((_) => Nn(_, (tA) => {
          var nA;
          if ("datum" in tA) {
            const AA = tA.datum[nW];
            j.has(AA) || j.set(AA, []), (nA = j.get(AA)) == null || nA.push(tA);
          }
        }));
        const O = Lb(() => v.view._renderer._render(K.root), 15, { trailing: !0 });
        w.current = () => {
          A.onReset(), A.paintMapRef.current = xH([A.domainY, A.domainX]);
          const { name: _, color: tA } = A.dict[1];
          q.forEach((nA) => Nn(nA, (AA) => {
            "datum" in AA && (AA.fill && AA.fill !== "transparent" && (AA.fill = tA), AA.stroke && AA.stroke !== "transparent" && (AA.stroke = tA), AA.datum[ln] = _);
          })), O();
        };
        const $ = (_) => {
          _.stopPropagation(), _.preventDefault();
          const tA = (nA, AA) => {
            const gA = r.current === Wc ? {
              name: "",
              color: "transparent"
            } : A.dict[r.current];
            if (!gA)
              return;
            const rA = UBe([Math.floor(nA / MyA(A.domainX)), A.domainY.domain.width - 1 - Math.floor(AA / MyA(A.domainY))], g.current, [A.domainY, A.domainX]);
            let sA = 0;
            rA.forEach((lA) => {
              var cA;
              (cA = j.get(lA)) == null || cA.forEach((aA) => {
                switch (aA.ariaRoleDescription) {
                  case "circle":
                  case "square":
                  case "tick":
                    aA.fill = gA.color;
                    break;
                  case "point":
                    aA.stroke = gA.color;
                    break;
                }
                aA.datum[ln] = gA.name, sA++;
              }), A.paintMapRef.current[lA] = r.current;
            }), sA > 0 && O();
          };
          if (_ instanceof MouseEvent && _.buttons & K5A.PRIMARY)
            tA(_.offsetX - U[0] - ka, _.offsetY - U[1] - ka);
          else if (window.TouchEvent && _ instanceof TouchEvent) {
            const nA = B.current.getBoundingClientRect();
            tA(_.changedTouches[0].pageX - nA.left - U[0] - ka, _.changedTouches[0].pageY - nA.top - U[1] - ka);
          }
        };
        v.view.addEventListener("mousedown", $), v.view.addEventListener("mousemove", $), v.view.addEventListener("touchstart", $), v.view.addEventListener("touchmove", $);
      });
    }
  }, [G, d, A.dict, A.vegaConfig, A.domainX, A.domainY, A.onReset, A.mark]);
  const [R, F] = b.useState(!1), Z = u.useMemo(() => A.domainX.domain.type === "quantitative" && A.domainY.domain.type === "quantitative" ? { dia: s, factor: We.PAINT_SIZE_FACTOR, type: "circle" } : {
    type: "rect",
    x: A.domainX.domain.type === "nominal" ? 1 : s,
    xFactor: A.domainX.domain.type === "nominal" ? We.PAINT_SIZE_FACTOR * We.PAINT_MAP_SIZE / A.domainX.domain.width : We.PAINT_SIZE_FACTOR,
    y: A.domainY.domain.type === "nominal" ? 1 : s,
    yFactor: A.domainY.domain.type === "nominal" ? We.PAINT_SIZE_FACTOR * We.PAINT_MAP_SIZE / A.domainY.domain.width : We.PAINT_SIZE_FACTOR
  }, [A.domainX, A.domainY, s]);
  return u.useEffect(() => {
    F(!0);
    const c = setTimeout(() => {
      F(!1);
    }, 1e3);
    return () => {
      clearTimeout(c);
    };
  }, [s, a]), b.createElement(
    "div",
    { className: "flex" },
    b.createElement(
      d5A,
      { color: ((e = A.dict[a]) == null ? void 0 : e.color) ?? "#333", cursor: Z, offsetX: y[0], offsetY: y[1], showPreview: R },
      b.createElement("div", { ref: B, id: "painter-container", className: "!cursor-none min-w-[600px] min-h-[512px]" })
    ),
    b.createElement(
      "div",
      { className: "flex flex-col space-y-2 pt-10 w-40 flex-shrink-0 px-1" },
      b.createElement(
        $F,
        { value: a === Wc ? "eraser" : "palette", onValueChange: (c) => {
          C(c === "palette" ? 2 : Wc);
        } },
        b.createElement(
          lG,
          null,
          b.createElement(
            CC,
            { value: "palette" },
            " ",
            t("main.tabpanel.settings.paint.palette")
          ),
          b.createElement(
            CC,
            { value: "eraser" },
            " ",
            t("main.tabpanel.settings.paint.eraser")
          )
        ),
        a !== Wc && b.createElement(
          k2,
          { value: "palette" },
          b.createElement("div", { className: "grid grid-cols-5 gap-2 p-2" }, Object.entries(A.dict).map(([c, { color: J }]) => b.createElement("div", { key: c, className: `box-border rounded-full border-primary hover: ${c === `${a}` ? "border-2" : "hover:border-2"} active:ring-ring active:ring-1 w-4 h-4`, style: {
            background: J
          }, onClick: () => C(Number(c)) }))),
          b.createElement(
            "div",
            { className: "flex space-x-2" },
            b.createElement("label", { className: "block text-xs font-medium" }, t("main.tabpanel.settings.paint.color")),
            b.createElement(m5A, { color: A.dict[a].color, colors: psA, onChangeColor: (c) => {
              A.onChangeDict({
                ...A.dict,
                [a]: {
                  color: c,
                  name: A.dict[a].name
                }
              });
            } })
          ),
          b.createElement(
            "div",
            { className: "flex flex-col space-y-2" },
            b.createElement("label", { className: "block text-xs font-medium" }, t("main.tabpanel.settings.paint.label")),
            b.createElement(h5A, { value: A.dict[a].name, onChange: (c) => {
              A.onChangeDict({
                ...A.dict,
                [a]: {
                  color: A.dict[a].color,
                  name: c
                }
              });
            } })
          )
        )
      ),
      (A.domainX.domain.type === "quantitative" || A.domainY.domain.type === "quantitative") && b.createElement(
        "div",
        { className: "pt-2" },
        b.createElement(
          "output",
          { className: "text-sm" },
          t("main.tabpanel.settings.paint.brush_size"),
          ": ",
          `${s}`
        ),
        b.createElement(DY, { className: "mt-2", value: [s], min: We.PAINT_MIN_BRUSH_SIZE, max: We.PAINT_MAX_BRUSH_SIZE, onValueChange: ([c]) => I(c) })
      ),
      b.createElement(
        "div",
        { className: "flex-1 flex flex-col space-y-2 justify-end" },
        b.createElement(Re, { variant: "destructive", children: t("main.tabpanel.settings.paint.delete_paint"), onClick: A.onDelete }),
        b.createElement(Re, { variant: "outline", children: t("main.tabpanel.settings.paint.reset_paint"), onClick: () => w.current() }),
        b.createElement(Re, { variant: "outline", children: t("main.tabpanel.settings.paint.cancel"), onClick: A.onCancel }),
        b.createElement(Re, { children: t("main.tabpanel.settings.paint.save_paint"), onClick: A.onSave })
      )
    )
  );
};
function qbt([A, e]) {
  return A < 0 && e > 0 || A === 0 || e === 0;
}
function Q_(A, e) {
  return A ? A.type === "nominal" ? !0 : qbt(A.value) === e : !1;
}
function Obt([A, e]) {
  return A > 0 ? [0, e] : e < 0 ? [A, 0] : [A, e];
}
const jbt = ({ themeConfig: A, themeKey: e }) => {
  const t = xt(), { showPainterPanel: i, allFields: n, layout: o, config: g } = t, { geoms: s, timezoneDisplayOffset: I } = g, { zeroScale: r } = o, { t: a } = qe(), C = sg(), [B, l] = u.useState(!0), Q = u.useRef(), [E, d] = u.useState(qx), [m, y] = u.useState(null), [f, w] = u.useState(), [G, R] = u.useState(), [F, Z] = u.useState(), [c, J] = u.useState(), [p, N] = u.useState([]);
  u.useEffect(() => {
    i && (l(!0), (async () => {
      var O, $, _, tA, nA, AA;
      const { paintInfo: gA, allFields: rA } = t, sA = async (aA) => {
        if (aA.semanticType === "quantitative") {
          const QA = await eS(C, aA, { range: !0, values: !1, valuesMeta: !1 }, rA);
          return {
            domain: {
              type: "quantitative",
              value: r ? Obt(QA.range) : QA.range,
              width: We.PAINT_MAP_SIZE
            },
            fid: aA.fid
          };
        } else {
          const QA = (await eS(C, aA, { range: !1, values: !0, valuesMeta: !1 }, rA)).values.map((hA) => hA.value).sort();
          return {
            domain: {
              type: "nominal",
              value: QA,
              width: QA.length
            },
            fid: aA.fid
          };
        }
      }, lA = async (aA) => {
        const [QA, hA] = await Promise.all([sA(aA.x), sA(aA.y)]);
        return {
          x: aA.x,
          y: aA.y,
          domainX: QA,
          domainY: hA,
          map: xH([hA, QA])
        };
      }, cA = async (aA) => {
        const QA = xyA(aA), hA = await Promise.all(QA.map((EA) => sA(EA)));
        return {
          x: { field: aA.x, domain: hA.find((EA) => EA.fid === aA.x.fid) },
          y: { field: aA.y, domain: hA.find((EA) => EA.fid === aA.y.fid) },
          color: aA.color ? { field: aA.color, domain: hA.find((EA) => EA.fid === aA.color.fid) } : void 0,
          size: aA.size ? { field: aA.size, domain: hA.find((EA) => EA.fid === aA.size.fid) } : void 0,
          opacity: aA.opacity ? { field: aA.opacity, domain: hA.find((EA) => EA.fid === aA.opacity.fid) } : void 0,
          shape: aA.shape ? { field: aA.shape, domain: hA.find((EA) => EA.fid === aA.shape.fid) } : void 0,
          map: xH(hA)
        };
      };
      if (gA) {
        if (gA.type === "exist") {
          const aA = gA.item.facets.at(-1);
          if (gA.new.type === "new")
            if (((O = aA.dimensions[0]) == null ? void 0 : O.fid) !== gA.new.y.fid || (($ = aA.dimensions[1]) == null ? void 0 : $.fid) !== gA.new.x.fid || !Q_((_ = aA.dimensions[0]) == null ? void 0 : _.domain, r) || !Q_((tA = aA.dimensions[1]) == null ? void 0 : tA.domain, r)) {
              const { domainX: QA, domainY: hA, map: EA } = await lA(gA.new);
              gA.item.facets[0] && !gA.item.facets[0].usedColor && (gA.item.facets[0].usedColor = gA.item.usedColor), Q.current = EA, Jt.unstable_batchedUpdates(() => {
                d(gA.item.dict), Z(QA), J(hA), N(gA.item.facets), w(gA.new.x), R(gA.new.y), y(null), l(!1);
              });
            } else {
              const QA = (nA = aA.dimensions.at(-1)) == null ? void 0 : nA.fid, hA = (AA = aA.dimensions.at(-2)) == null ? void 0 : AA.fid, EA = rA.find((xA) => xA.fid === QA), RA = rA.find((xA) => xA.fid === hA);
              Jt.unstable_batchedUpdates(() => {
                d(gA.item.dict), Z(aA.dimensions.at(-1)), J(aA.dimensions.at(-2)), N(gA.item.facets.slice(0, -1)), w(EA), R(RA), y(null), l(!1);
              });
            }
          else if (gA.new.type === "agg")
            if (xyA(gA.new).every((QA, hA) => {
              const EA = aA.dimensions[hA];
              return (QA == null ? void 0 : QA.fid) === (EA == null ? void 0 : EA.fid) && Q_(EA == null ? void 0 : EA.domain, r);
            })) {
              Q.current = await e2A(aA.map);
              const { map: QA, ...hA } = await cA(gA.new);
              Jt.unstable_batchedUpdates(() => {
                d(gA.item.dict), y(hA), N(gA.item.facets.slice(0, -1)), Z(void 0), J(void 0), w(void 0), R(void 0), l(!1);
              });
            } else {
              const { map: QA, ...hA } = await cA(gA.new);
              Q.current = QA, Jt.unstable_batchedUpdates(() => {
                d(qx), y(hA), N(gA.item.facets), Z(void 0), J(void 0), w(void 0), R(void 0), l(!1);
              });
            }
          else
            throw new Error("paintInfo.new.type is not supported");
        } else if (gA.type === "new") {
          const { domainX: aA, domainY: QA, map: hA } = await lA(gA);
          Q.current = hA, Jt.unstable_batchedUpdates(() => {
            d(qx), Z(aA), J(QA), w(gA.x), R(gA.y), y(null), N([]), l(!1);
          });
        } else if (gA.type === "agg") {
          const { map: aA, ...QA } = await cA(gA);
          Q.current = aA, Jt.unstable_batchedUpdates(() => {
            d(qx), y(QA), N([]), Z(void 0), J(void 0), w(void 0), R(void 0), l(!1);
          });
        }
      }
    })());
  }, [i, t, C, r]);
  const v = async () => {
    const O = F && c ? [c, F] : m ? [m.x, m.y, m.color, m.size, m.opacity, m.shape].map(($) => $ == null ? void 0 : $.domain).filter(($) => !!$) : null;
    if (O && Q.current) {
      const $ = [
        ...p,
        {
          map: await XBe(Q.current),
          dimensions: O,
          usedColor: Array.from(new Set(Q.current)).map((tA) => tA || 1)
        }
      ], _ = Object.keys(E).map((tA) => parseInt(tA)).concat(Wc);
      t.updatePaint({
        dict: E,
        facets: $,
        usedColor: Array.from(new Set($.flatMap((tA) => tA.usedColor ?? _)))
      }, a("constant.paint_key"));
    }
    t.setShowPainter(!1);
  }, K = u.useCallback(() => {
    N([]);
  }, []), U = u.useContext(FQ), j = u.useContext(_7), q = u.useMemo(() => {
    const O = A ?? lS[e ?? "vega"];
    return {
      ...O == null ? void 0 : O[U],
      background: QRA(j[U].background)
    };
  }, [j, A, e, U]);
  return b.createElement(
    ig,
    { open: i, onOpenChange: () => {
      t.setShowPainter(!1);
    } },
    b.createElement(
      So,
      null,
      B && b.createElement(Ts, null),
      !B && !m && b.createElement(_bt, { mark: s[0], vegaConfig: q, onSave: v, onDelete: () => {
        t.updatePaint(null, ""), t.setShowPainter(!1);
      }, onCancel: () => {
        t.setShowPainter(!1);
      }, x: f, y: G, facets: p, allFields: n, domainX: F, domainY: c, dict: E, onChangeDict: d, paintMapRef: Q, onReset: K, displayOffset: I }),
      !B && m && b.createElement(zbt, { mark: s[0], vegaConfig: q, onSave: v, onDelete: () => {
        t.updatePaint(null, ""), t.setShowPainter(!1);
      }, onCancel: () => {
        t.setShowPainter(!1);
      }, x: m.x, y: m.y, color: m.color, size: m.size, opacity: m.opacity, shape: m.shape, facets: p, allFields: n, dict: E, onChangeDict: d, paintMapRef: Q, onReset: K, displayOffset: I })
    )
  );
}, Pbt = gt(jbt), $bt = ji.div`
    min-width: 100px;
    position: absolute;
    z-index: 99;
    cursor: pointer;
    padding: 4px;
`, Awt = (A) => {
  const { x: e, y: t, children: i } = A, [n, o] = u.useState(), g = u.useCallback((r) => {
    r && o(r.getBoundingClientRect());
  }, []), s = e - ((n == null ? void 0 : n.left) ?? 0), I = t - ((n == null ? void 0 : n.top) ?? 0);
  return b.createElement(
    "div",
    { ref: g },
    b.createElement($bt, { className: "shadow-lg text-sm border rounded-md bg-popover text-popover-foreground border-border", style: { left: s, top: I } }, i)
  );
}, ewt = Awt, twt = gt(function() {
  const A = xt(), { t: e } = qe(), { vizEmbededMenu: t } = A;
  return b.createElement(
    M3,
    { appear: !0, show: t.show, className: "absolute inset-0", enter: "transition ease-out duration-100", enterFrom: "transform opacity-0 scale-95", enterTo: "transform opacity-100 scale-100", leave: "transition ease-in duration-75", leaveFrom: "transform opacity-100 scale-100", leaveTo: "transform opacity-0 scale-95" },
    b.createElement(ewt, { x: t.position[0], y: t.position[1] }, We.EMBEDED_MENU_LIST.map((i) => {
      switch (i) {
        case "data_interpretation":
          return b.createElement(
            "div",
            { key: i, className: "flex items-center whitespace-nowrap rounded-md transition-colors py-1 px-4 hover:bg-accent hover:text-accent-foreground cursor-pointer", onClick: () => {
              A.closeEmbededMenu(), A.setShowInsightBoard(!0);
            } },
            b.createElement("span", { className: "flex-1 pr-2" }, e("App.labels.data_interpretation")),
            b.createElement(mYA, { className: "ml-1 w-3 flex-grow-0 flex-shrink-0" })
          );
        case "data_view":
          return b.createElement(
            "div",
            { key: i, className: "flex items-center whitespace-nowrap rounded-md transition-colors py-1 px-4 hover:bg-accent hover:text-accent-foreground cursor-pointer", onClick: () => {
              A.closeEmbededMenu(), A.setShowDataBoard(!0);
            } },
            b.createElement("span", { className: "flex-1 pr-2" }, e("App.labels.data_view"))
          );
        default:
          return console.error("Unknown item", i), null;
      }
    }))
  );
}), iwt = gt(function() {
  const A = xt(), e = sg(), { showDataBoard: t, selectedMarkObject: i, allFields: n, config: o, viewFilters: g } = A, s = u.useMemo(() => {
    const C = $K(i), B = Object.entries(C).filter((l) => ![Zi, Wi, Hn].includes(l[0]) && an(l[1]));
    return an(C[Zi]) && an(C[Wi]) && B.push([C[Zi], C[Wi]]), B.map(([l, Q]) => ({ fid: l, rule: { type: "one of", value: [Q] } }));
  }, [i]), I = u.useMemo(() => n.filter((C) => C.fid !== Hn && C.computed && C.expression && C.aggName !== "expr"), [n]), r = u.useMemo(() => (C) => e(fle(d2A(C, g.map((B) => ({ fid: B.fid, rule: B.rule })).filter((B) => !!B.rule).concat(s)), I.map((B) => ({
    expression: NY(B.expression, n, o),
    key: B.fid
  })))), [e, s, I, n, o]), a = u.useMemo(() => n.filter((C) => C.aggName !== "expr").filter((C) => ![Zi, Wi, Hn].includes(C.fid)), [n]);
  return b.createElement(
    ig,
    { open: t, onOpenChange: () => {
      A.setShowDataBoard(!1);
    } },
    b.createElement(
      So,
      null,
      b.createElement(
        "div",
        { className: "mt-4" },
        b.createElement(sX, { size: 100, computation: r, metas: a, disableFilter: !0, displayOffset: o.timezoneDisplayOffset })
      )
    )
  );
}), nwt = iwt;
function vyA(A) {
  const e = u.useRef(null), [t, i] = u.useState(!1), [n, o] = u.useState(A.defaultWidth), g = b.useCallback(() => {
    i(!0);
  }, []), s = b.useCallback(() => {
    i(!1);
  }, []), I = b.useCallback((r) => {
    t && o(r.clientX - e.current.getBoundingClientRect().left);
  }, [t]);
  return b.useEffect(() => (window.addEventListener("mousemove", I), window.addEventListener("mouseup", s), () => {
    window.removeEventListener("mousemove", I), window.removeEventListener("mouseup", s);
  }), [I, s]), b.createElement(
    "div",
    { className: `relative ${A.className}`, style: { width: n }, ref: e },
    A.children,
    b.createElement("div", { className: `absolute right-0 inset-y-0 cursor-col-resize ${A.handlerClassName}`, style: { width: A.handleWidth ?? 6 }, onMouseDown: g })
  );
}
const owt = /* @__PURE__ */ new Set(["column", "row", "color", "opacity", "shape", "size", "details", "theta", "x", "y", "facet", "order", "radius"]), gwt = (A) => owt.has(A), swt = /* @__PURE__ */ new Set(["sum", "count", "max", "min", "mean", "median", "variance", "stdev"]), Iwt = (A) => !!A && swt.has(A), LN = {
  fid: "gw_count_fid",
  name: "Row count",
  analyticType: "measure",
  semanticType: "quantitative",
  aggName: "sum",
  computed: !0,
  expression: {
    op: "one",
    params: [],
    as: "gw_count_fid"
  }
}, awt = (A) => A === "zero" || A === !0 ? "stack" : A === null ? "none" : A;
function HyA(A) {
  let e = "none";
  if (typeof A == "string" ? e = A : A && A instanceof Object && (e = A.order ?? "ascending"), e !== "none") {
    const t = ["x", "y", "color", "size", "opacity"];
    if (e.startsWith("-") || e === "descending")
      return "descending";
    if (t.indexOf(e) > -1 || e === "ascending")
      return "ascending";
  }
}
const rwt = {
  row: "facetY",
  facet: "facetY",
  column: "facetX",
  x: "column",
  y: "row",
  opacity: "opacity",
  size: "size",
  shape: "shape",
  radius: "radius",
  theta: "theta",
  details: "details",
  text: "text",
  color: "color"
}, SyA = /* @__PURE__ */ new Set(["theta", "x", "y"]);
function Cwt(A) {
  const e = `gw_${jYA(4)}`;
  return {
    fid: e,
    name: `bin(${A.name})`,
    semanticType: "ordinal",
    analyticType: "dimension",
    computed: !0,
    expression: {
      op: "bin",
      as: e,
      params: [
        {
          type: "field",
          value: A.fid
        }
      ]
    }
  };
}
function Bwt(A, e, t) {
  switch (A) {
    case "order":
      return {
        sort: HyA(e.sort)
      };
    default:
      const i = SyA.has(A), n = t.get(e.field) ?? LN, o = e.bin ? Cwt(n) : n, g = o === LN ? "count" : Iwt(e.aggregate) && i ? e.aggregate : void 0;
      let s;
      return o === LN || g ? s = "measure" : o.analyticType === "measure" && SyA.has(A) ? s = "auto" : s = "dimension", {
        dimension: o,
        binDimension: e.bin ? o : void 0,
        dimensionType: rwt[A],
        analyticType: s,
        aggregate: g,
        stack: awt(e.stack),
        sort: e.sort ? HyA(e.sort) : void 0
      };
  }
}
const Ry = (A) => Object.keys(A).map((e) => ({ name: e, value: A[e] }));
function eJ(A) {
  function e(t) {
    switch (t) {
      case "interval":
      case "bar":
        return "bar";
      case "line":
        return "line";
      case "boxplot":
        return "boxplot";
      case "area":
        return "area";
      case "point":
        return "point";
      case "arc":
        return "arc";
      case "circle":
        return "circle";
      case "heatmap":
        return "circle";
      case "rect":
        return "rect";
      case "tick":
      default:
        return "tick";
    }
  }
  return e(typeof A == "string" ? A : A.type);
}
const ZyA = (A) => {
  switch (A) {
    case "==":
    case "===":
    case "equal":
    case "oneOf":
      return "one of";
    case "!=":
    case "!==":
      return "not in";
    case ">":
    case ">=":
    case "<":
    case "<=":
    case "lt":
    case "lte":
    case "gt":
    case "gte":
    case "range":
      return "range";
  }
  return "one of";
};
function WyA(A, e) {
  const t = /* @__PURE__ */ new Set(), i = [];
  return A.forEach((n) => {
    const o = e(n);
    t.has(o) || (t.add(o), i.push(n));
  }), i;
}
function X5A(A, e, t, i) {
  let n = "tick";
  const o = [];
  A.facet && o.push(...Ry(A.facet)), A.encoding && o.push(...Ry(A.encoding)), A.mark && (n = eJ(A.mark)), A.spec && (n = eJ(A.spec.mark), A.spec.encoding && o.push(...Ry(A.spec.encoding))), A.concat && A.concat.forEach((w) => {
    n = eJ(w.mark), w.encoding && o.push(...Ry(w.encoding));
  }), A.hconcat && A.hconcat.forEach((w) => {
    n = eJ(w.mark), w.encoding && o.push(...Ry(w.encoding));
  }), A.vconcat && A.vconcat.forEach((w) => {
    n = eJ(w.mark), w.encoding && o.push(...Ry(w.encoding));
  });
  const g = {}, s = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map();
  e.forEach((w) => {
    I.set(w.name, w);
  });
  const r = (w, G, R) => {
    const F = `${w}|${ZyA(G)}`;
    s.has(F) || s.set(F, { field: w, rule: ZyA(G), value: [] }), G.startsWith(">") || G.startsWith("gt") ? s.get(F).value = [R, s.get(F).value[1] ?? null] : G.startsWith("<") || G.startsWith("lt") ? s.get(F).value = [s.get(F).value[0] ?? null, R] : G === "range" ? s.get(F).value = R : G === "oneOf" ? s.get(F).value.push(...R) : s.get(F).value.push(R);
  };
  A.transform && A.transform.forEach((w) => {
    if (w.fold && (g.folds = w.fold.map((G) => {
      var R;
      return ((R = I.get(G)) == null ? void 0 : R.fid) ?? G;
    })), w.filter && (typeof w.filter == "string" && w.filter.split(/[\&\&|\|\|]/g).forEach((G) => {
      const R = /datum(\.[A-z_]+|\[['"][A-z\s_]+['"]\])\s*((\!=|==|>|<)=?)\s*(.*)/.exec(G);
      if (R) {
        const F = /(?:\.|\[["'])([A-z\s_]*)(?:["']\])?/.exec(R[1]), Z = /["'](.*)["']/.exec(R[4]);
        if (!F || !Z)
          return;
        const c = R[2];
        r(F[1], c, Z[1]);
      }
    }), typeof w.filter == "object"))
      if (w.filter.field === "rank")
        w.filter.lte ? g.limit = w.filter.lte : w.filter.lt && (g.limit = Math.floor(w.filter.lt), g.limit == w.filter.lt && (g.limit -= 1));
      else {
        const G = Object.keys(w.filter).find((R) => ["equal", "oneOf", "lt", "lte", "gt", "gte", "range"].includes(R));
        G && r(w.filter.field, G, w.filter[G]);
      }
  });
  const a = Array.from(s.values()).map(({ field: w, rule: G, value: R }) => ({
    fid: w,
    rule: {
      type: G,
      value: R
    }
  })), C = o.flatMap(({ name: w, value: G }) => gwt(w) ? [Bwt(w, G, I)] : []), B = C.reduce((w, G) => w || !!G.aggregate, !1), l = C.reduce((w, G) => G.sort ?? w, "none"), Q = C.reduce((w, G) => G.stack ?? w, ["bar", "area", "arc"].includes(n) ? "stack" : "none"), E = C.reduce((w, G) => G.binDimension && !w.has(G.binDimension.name) ? w.set(G.binDimension.name, G.binDimension) : w, /* @__PURE__ */ new Map()), d = C.flatMap((w) => {
    if (w.dimension && w.dimensionType) {
      if (w.binDimension)
        return [
          {
            name: w.dimensionType,
            value: E.get(w.binDimension.name) ?? w.binDimension
          }
        ];
      const G = w.analyticType === "auto" ? B ? "dimension" : "measure" : w.analyticType;
      return [
        {
          name: w.dimensionType,
          value: {
            ...w.dimension,
            analyticType: G,
            ...w.aggregate ? {
              aggName: w.aggregate
            } : {},
            ...l && l !== "none" && (w.dimensionType === "column" || w.dimensionType === "row") && G === "dimension" ? {
              sort: l
            } : {}
          }
        }
      ];
    }
    return [];
  }), m = (w) => (G) => G.name === w, y = (w) => w.value, f = (w) => WyA(w, (G) => G.fid);
  return r2A({
    visId: t,
    name: i,
    encodings: {
      dimensions: e.filter((w) => w.analyticType === "dimension").concat(...E.values()),
      measures: e.filter((w) => w.analyticType === "measure" && w.fid !== LN.fid).concat(LN),
      columns: f(d.filter(m("facetX")).concat(d.filter(m("column"))).map(y)),
      rows: f(d.filter(m("facetY")).concat(d.filter(m("row"))).map(y)),
      details: f(d.filter(m("details")).map(y)),
      opacity: f(d.filter(m("opacity")).map(y)),
      radius: f(d.filter(m("radius")).map(y)),
      shape: f(d.filter(m("shape")).map(y)),
      size: f(d.filter(m("size")).map(y)),
      text: f(d.filter(m("text")).map(y)),
      theta: f(d.filter(m("theta")).map(y)),
      color: f(d.filter(m("color")).map(y)),
      filters: WyA(a.map((w) => ({
        ...I.get(w.fid),
        rule: w.rule
      })), (w) => {
        var G;
        return `${w.fid}_${(G = w.rule) == null ? void 0 : G.type}`;
      })
    },
    layout: {
      stack: Q
    },
    config: {
      defaultAggregated: B,
      geoms: [n],
      ...g
    }
  });
}
function lwt(A) {
  return b.forwardRef(function({ placeholder: e, onChange: t, value: i }, n) {
    const o = A(i);
    return b.createElement(
      "div",
      { className: "relative flex min-h-[60px] w-full rounded-md border border-input bg-transparent text-sm shadow-sm" },
      b.createElement("div", { className: "absolute whitespace-pre inset-0 pointer-events-none px-3 py-2", dangerouslySetInnerHTML: { __html: o } }),
      e && i === "" && b.createElement("div", { className: "px-3 py-2 pointer-events-none text-muted-foreground absolute inset-0 select-none" }, e),
      b.createElement("div", { ref: n, contentEditable: "plaintext-only", onInput: (g) => {
        const s = g.currentTarget.textContent ?? "";
        t == null || t(s);
      }, className: "px-3 py-2 w-full focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 rounded-md border-0 text-transparent caret-foreground" })
    );
  });
}
const cwt = new RegExp(`\\b(${Array.from(_Be).join("|")})\\b`, "gi"), Qwt = new RegExp(`\\b(${Array.from(qBe).join("|")})(\\s*)\\(`, "gi"), Ewt = new RegExp(`\\b(${Array.from(n2A).join("|")})(\\s*)\\(`, "gi"), uwt = /('[^']*'?)/g, dwt = gt(() => {
  const A = xt(), { editingComputedFieldFid: e } = A, [t, i] = u.useState(""), [n, o] = u.useState(""), [g, s] = u.useState(""), I = u.useRef(null), r = u.useMemo(() => {
    const a = A.allFields.filter((B) => ![Hn, Zi, Wi, ln].includes(B.fid)).map((B) => B.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")).join("|"), C = a.length > 0 ? new RegExp(`\\b(${a})\\b`, "gi") : null;
    return lwt((B) => (C && (B = B.replace(C, '<span class="text-blue-700 dark:text-blue-600">$1</span>')), B = B.replace(cwt, '<span class="text-fuchsia-700 dark:text-fuchsia-600">$1</span>'), B = B.replace(Qwt, '<span class="text-yellow-700 dark:text-yellow-600">$1</span>$2('), B = B.replace(Ewt, '<span class="text-amber-700 dark:text-amber-600">$1</span>$2('), B = B.replace(uwt, '<span class="text-green-700 dark:text-green-600">$1</span>'), B));
  }, [A.allFields]);
  return u.useEffect(() => {
    var a;
    if (an(e))
      if (e === "") {
        let C = 1;
        for (; A.allFields.find((B) => B.name === `Computed ${C}`); )
          C++;
        Jt.unstable_batchedUpdates(() => {
          i(`Computed ${C}`), o(""), s("");
        }), I.current && (I.current.innerHTML = "");
      } else {
        const C = A.allFields.find((l) => l.fid === e);
        if (!C || !C.computed || ((a = C.expression) == null ? void 0 : a.op) !== "expr") {
          A.setComputedFieldFid("");
          return;
        }
        const B = C.expression.params.find((l) => l.type === "sql");
        if (!B) {
          A.setComputedFieldFid("");
          return;
        }
        Jt.unstable_batchedUpdates(() => {
          i(C.name), o(B.value), s("");
        }), I.current && (I.current.innerHTML = B.value);
      }
  }, [e, A]), an(e) ? b.createElement(
    ig,
    { open: !0, onOpenChange: () => {
      A.setComputedFieldFid();
    } },
    b.createElement(
      So,
      null,
      b.createElement(
        "div",
        { className: "flex flex-col space-y-2" },
        b.createElement(
          "div",
          null,
          b.createElement("div", { className: "text-xl font-bold" }, e === "" ? "Add Computed Field" : "Edit Computed Field"),
          b.createElement(
            "span",
            { className: "text-xs text-muted-foreground" },
            "Computed fields guide:",
            " ",
            b.createElement("a", { target: "_blank", className: "underline text-primary", href: "https://github.com/Kanaries/graphic-walker/wiki/How-to-Create-Computed-field-in-Graphic-Walker" }, "read here")
          )
        ),
        b.createElement(
          "div",
          { className: "flex flex-col space-y-2" },
          b.createElement("label", { className: "text-ml whitespace-nowrap" }, "Name"),
          b.createElement(on, { type: "text", value: t, placeholder: "Enter Field Name...", onChange: (a) => {
            i(a.target.value);
          } }),
          b.createElement("label", { className: "text-ml whitespace-nowrap" }, "SQL"),
          b.createElement(r, { ref: I, value: n, onChange: o, placeholder: "Enter SQL..." })
        ),
        g && b.createElement("div", { className: "text-xs text-red-500" }, g),
        b.createElement(
          "div",
          { className: "flex justify-end space-x-2" },
          b.createElement(Re, { disabled: !n || !t, children: e === "" ? "Add" : "Edit", onClick: () => {
            try {
              A.upsertComputedField(e, t, n), A.setComputedFieldFid();
            } catch (a) {
              s(GD(a));
            }
          } }),
          b.createElement(Re, { variant: "outline", children: "Cancel", onClick: () => A.setComputedFieldFid() })
        )
      )
    )
  ) : null;
}), hwt = dwt;
function mwt(A) {
  return function(e) {
    let t = e.children;
    return Object.keys(A).forEach((i) => {
      const n = A[i];
      t = b.createElement(n.Provider, { value: e[i] }, t);
    }), t;
  };
}
const kX = mwt({ ComputationContext: vR, themeContext: FQ, vegaThemeContext: T7, portalContainerContext: xD }), ysA = u.forwardRef(({ className: A, ...e }, t) => u.createElement("div", { ref: t, className: me("rounded-xl border bg-card text-card-foreground shadow", A), ...e }));
ysA.displayName = "Card";
const pwt = u.forwardRef(({ className: A, ...e }, t) => u.createElement("div", { ref: t, className: me("flex flex-col space-y-1.5 p-6", A), ...e }));
pwt.displayName = "CardHeader";
const bsA = u.forwardRef(({ className: A, ...e }, t) => u.createElement("h3", { ref: t, className: me("font-semibold leading-none tracking-tight", A), ...e }));
bsA.displayName = "CardTitle";
const ywt = u.forwardRef(({ className: A, ...e }, t) => u.createElement("p", { ref: t, className: me("text-sm text-muted-foreground", A), ...e }));
ywt.displayName = "CardDescription";
const wsA = u.forwardRef(({ className: A, ...e }, t) => u.createElement("div", { ref: t, className: me("p-6 pt-0", A), ...e }));
wsA.displayName = "CardContent";
const bwt = u.forwardRef(({ className: A, ...e }, t) => u.createElement("div", { ref: t, className: me("flex items-center p-6 pt-0", A), ...e }));
bwt.displayName = "CardFooter";
const z5A = "Collapsible", [wwt, VXt] = gg(z5A), [fwt, fsA] = wwt(z5A), Dwt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeCollapsible: t, open: i, defaultOpen: n, disabled: o, onOpenChange: g, ...s } = A, [I = !1, r] = as({
    prop: i,
    defaultProp: n,
    onChange: g
  });
  return /* @__PURE__ */ u.createElement(fwt, {
    scope: t,
    disabled: o,
    contentId: za(),
    open: I,
    onOpenToggle: u.useCallback(
      () => r(
        (a) => !a
      ),
      [
        r
      ]
    )
  }, /* @__PURE__ */ u.createElement(ze.div, NA({
    "data-state": DsA(I),
    "data-disabled": o ? "" : void 0
  }, s, {
    ref: e
  })));
}), Gwt = "CollapsibleTrigger", kwt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeCollapsible: t, ...i } = A, n = fsA(Gwt, t);
  return /* @__PURE__ */ u.createElement(ze.button, NA({
    type: "button",
    "aria-controls": n.contentId,
    "aria-expanded": n.open || !1,
    "data-state": DsA(n.open),
    "data-disabled": n.disabled ? "" : void 0,
    disabled: n.disabled
  }, i, {
    ref: e,
    onClick: ge(A.onClick, n.onOpenToggle)
  }));
}), T5A = "CollapsibleContent", Jwt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { forceMount: t, ...i } = A, n = fsA(T5A, A.__scopeCollapsible);
  return /* @__PURE__ */ u.createElement(
    Ig,
    {
      present: t || n.open
    },
    ({ present: o }) => /* @__PURE__ */ u.createElement(Nwt, NA({}, i, {
      ref: e,
      present: o
    }))
  );
}), Nwt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeCollapsible: t, present: i, children: n, ...o } = A, g = fsA(T5A, t), [s, I] = u.useState(i), r = u.useRef(null), a = Dt(e, r), C = u.useRef(0), B = C.current, l = u.useRef(0), Q = l.current, E = g.open || s, d = u.useRef(E), m = u.useRef();
  return u.useEffect(() => {
    const y = requestAnimationFrame(
      () => d.current = !1
    );
    return () => cancelAnimationFrame(y);
  }, []), rs(() => {
    const y = r.current;
    if (y) {
      m.current = m.current || {
        transitionDuration: y.style.transitionDuration,
        animationName: y.style.animationName
      }, y.style.transitionDuration = "0s", y.style.animationName = "none";
      const f = y.getBoundingClientRect();
      C.current = f.height, l.current = f.width, d.current || (y.style.transitionDuration = m.current.transitionDuration, y.style.animationName = m.current.animationName), I(i);
    }
  }, [
    g.open,
    i
  ]), /* @__PURE__ */ u.createElement(ze.div, NA({
    "data-state": DsA(g.open),
    "data-disabled": g.disabled ? "" : void 0,
    id: g.contentId,
    hidden: !E
  }, o, {
    ref: a,
    style: {
      "--radix-collapsible-content-height": B ? `${B}px` : void 0,
      "--radix-collapsible-content-width": Q ? `${Q}px` : void 0,
      ...A.style
    }
  }), E && n);
});
function DsA(A) {
  return A ? "open" : "closed";
}
const Ywt = Dwt, Rwt = Ywt, Fwt = kwt, Mwt = Jwt, _5A = u.forwardRef(({ className: A, ...e }, t) => u.createElement("textarea", { className: me("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", A), ref: t, ...e }));
_5A.displayName = "Textarea";
async function xwt(A, e, t, i) {
  const n = await (await fetch(A, {
    headers: {
      "Content-Type": "application/json",
      ...i
    },
    credentials: "include",
    method: "POST",
    body: JSON.stringify({
      metas: e,
      messages: t
    })
  })).json();
  if (n.success)
    return n.data;
  throw new Error(n.message);
}
async function Lwt(A, e, t) {
  const i = e.chats.concat({
    role: "user",
    content: e.query,
    type: "normal"
  });
  return typeof A == "string" ? xwt(A, e.metas, i, t) : A(e.metas, i);
}
function vwt(A) {
  const e = A.message.type === "generated";
  return b.createElement(
    ysA,
    null,
    b.createElement(
      "div",
      { className: "p-6 pb-2 flex space-x-2 items-center" },
      b.createElement(
        "div",
        { className: "p-1 w-6 h-6 rounded-full bg-muted" },
        b.createElement(zae, { className: "w-4 h-4" })
      ),
      b.createElement(bsA, { className: "flex-1" }, "You"),
      A.onRemove && b.createElement(
        Re,
        { variant: "ghost", size: "icon-sm", onClick: A.onRemove },
        b.createElement(A3, { className: "w-4 h-4" })
      )
    ),
    b.createElement(
      wsA,
      { className: "pl-14" },
      e && b.createElement(
        Rwt,
        null,
        b.createElement(Fwt, { className: "text-muted-foreground" }, "Click to expand auto generated message"),
        b.createElement(Mwt, { className: "whitespace-pre" }, A.message.content)
      ),
      !e && A.message.content
    )
  );
}
const Hwt = gt(function(A) {
  const e = sg(), { config: t, encodings: i, layout: n, name: o } = A.message.chart, { vizThemeConfig: g } = u.useContext(T7), s = gf(i), { allFields: I, viewDimensions: r, viewMeasures: a, filters: C } = u.useMemo(() => {
    const E = [], d = [], { dimensions: m, measures: y, filters: f, ...w } = i, G = [...m, ...y], R = Object.keys(w);
    for (const F of R)
      for (const Z of w[F])
        Z.analyticType === "dimension" ? E.push(Z) : Z.analyticType === "measure" && d.push(Z);
    return { allFields: G, viewDimensions: E, viewMeasures: d, filters: f };
  }, [i]), { viewData: B, loading: l } = jF({
    allFields: I,
    viewDimensions: r,
    viewMeasures: a,
    filters: C,
    defaultAggregated: t.defaultAggregated,
    sort: s,
    folds: t.folds,
    limit: t.limit ?? -1,
    computationFunction: e,
    timezoneDisplayOffset: t.timezoneDisplayOffset
  }), { i18n: Q } = qe();
  return b.createElement(
    ysA,
    null,
    b.createElement(
      "div",
      { className: "p-6 pb-2 flex space-x-2 items-center" },
      b.createElement(
        "div",
        { className: "p-1 w-6 h-6 rounded-full bg-muted" },
        b.createElement(MIe, { className: "w-4 h-4" })
      ),
      b.createElement(bsA, { className: "flex-1" }, "Viz.GPT"),
      A.onRemove && b.createElement(
        Re,
        { variant: "ghost", size: "icon-sm", onClick: A.onRemove },
        b.createElement(A3, { className: "w-4 h-4" })
      )
    ),
    b.createElement(
      wsA,
      { className: "pl-16" },
      l && b.createElement(Ts, null),
      b.createElement(bgA, { vizThemeConfig: g, name: o, data: B, draggableFieldState: i, visualConfig: t, layout: {
        ...n,
        size: {
          mode: "auto",
          width: 300,
          height: 200
        }
      }, locale: Q.language, scales: A.scales })
    )
  );
}), Swt = "https://api.kanaries.net/vis/chat2gw", Zwt = gt(function(A) {
  const [e, t] = u.useState(""), [i, n] = u.useState(!1), o = xt(), { chatMessages: g, allFields: s } = o, { reportError: I } = pgA(), r = async () => {
    n(!0), Lwt(A.api || Swt, { chats: g, metas: s, query: e }, A.headers ?? {}).then((a) => {
      o.replaceWithNLPQuery(e, JSON.stringify(a)), t("");
    }).catch((a) => {
      I(GD(a), 502);
    }).finally(() => {
      n(!1);
    });
  };
  return b.createElement(
    "div",
    { className: "flex flex-col gap-4 p-4 pb-12" },
    g.map((a, C, B) => {
      if (a.role === "assistant")
        return b.createElement(Hwt, { message: a, scales: A.scales, key: C, onRemove: C === B.length - 1 && a.type === "normal" ? () => o.undo() : void 0 });
      if (a.role === "user")
        return b.createElement(vwt, { message: a, key: C, onRemove: C === B.length - 2 && a.type == "normal" ? () => o.undo() : void 0 });
    }),
    b.createElement(
      "div",
      { className: "flex gap-4" },
      b.createElement(_5A, { className: "resize-none min-h-[36px]", disabled: i, rows: 1, value: e, onKeyDown: (a) => {
        a.key === "Enter" && !a.shiftKey && i === !1 && e.length > 0 && (a.preventDefault(), r());
      }, placeholder: "Ask question about your data", onChange: (a) => t(a.target.value) }),
      b.createElement(
        Re,
        { disabled: i, onClick: r },
        i && b.createElement(Sse, { className: "w-3 h-3 mr-2 animate-spin" }),
        "Submit"
      )
    )
  );
}), Wwt = gt(function(A) {
  var e, t, i;
  const { computation: n, darkMode: o = "light", i18nLang: g = "en-US", enhanceAPI: s, i18nResources: I, themeKey: r = "vega", themeConfig: a, vizThemeConfig: C, toolbar: B, geographicData: l, computationTimeout: Q = 6e4, spec: E, chart: d, vlSpec: m, onError: y } = A, { t: f, i18n: w } = qe(), G = w.language;
  u.useEffect(() => {
    I && fgA(I);
  }, [I]), u.useEffect(() => {
    g !== G && DgA(g);
  }, [g, G]);
  const R = xt();
  u.useEffect(() => {
    l && R.setGeographicData(l, l.key);
  }, [R, l]), u.useEffect(() => {
    E && R.replaceNow(y2A(E, R.meta, R.currentVis.name ?? "Chart 1", R.currentVis.visId));
  }, [E, R]), u.useEffect(() => {
    d && R.importCode(d);
  }, [d, R]), u.useEffect(() => {
    if (m) {
      const U = a3(R.meta, "");
      R.replaceNow(X5A(E, [...U.encodings.dimensions, ...U.encodings.measures], R.currentVis.name ?? "Chart 1", R.currentVis.visId));
    }
  }, [m, R]);
  const F = u.useRef(null), Z = u.useRef({ download() {
  } }), c = u.useCallback((U, j) => {
    const q = new Error(`Error${j ? `(${j})` : ""}: ${U}`);
    console.error(q), y == null || y(q), j && R.updateShowErrorResolutionPanel(j, U);
  }, [R, y]), { segmentKey: J, vizEmbededMenu: p } = R, N = u.useMemo(() => n ? L7(x7(n, Q), (U) => c(GD(U), 501)) : async () => [], [c, n, Q]), [v, K] = u.useState(null);
  return b.createElement(
    ygA,
    { value: { reportError: c } },
    b.createElement(
      r1,
      { fallback: b.createElement("div", null, "Something went wrong"), onError: A.onError },
      b.createElement(
        kX,
        { ComputationContext: N, themeContext: o, vegaThemeContext: { vizThemeConfig: A.vizThemeConfig ?? A.themeConfig ?? A.themeKey }, portalContainerContext: v },
        b.createElement(
          "div",
          { className: $a("App font-sans bg-background text-foreground m-0 p-0", o === "dark" ? "dark" : "") },
          b.createElement(
            Yhe,
            null,
            b.createElement(
              "div",
              { className: "bg-background text-foreground" },
              b.createElement(QsA, null),
              b.createElement(
                $F,
                { value: J, onValueChange: (U) => R.setSegmentKey(U) },
                b.createElement(
                  lG,
                  { className: "mx-4" },
                  b.createElement(
                    CC,
                    { value: hc.data },
                    b.createElement(JIe, { className: "w-4 mr-2" }),
                    " ",
                    f("App.segments.data")
                  ),
                  b.createElement(
                    CC,
                    { value: hc.vis },
                    b.createElement(sIe, { className: "w-4 mr-2" }),
                    " ",
                    f("App.segments.vis")
                  ),
                  ((e = s == null ? void 0 : s.features) == null ? void 0 : e.vlChat) && b.createElement(
                    CC,
                    { value: hc.chat },
                    b.createElement(rIe, { className: "w-4 mr-2" }),
                    " ",
                    f("App.segments.chat")
                  )
                ),
                b.createElement(
                  Bv,
                  { value: hc.data },
                  b.createElement(
                    "div",
                    { className: "mx-4 -mt-px p-4 border rounded-md rounded-t-none" },
                    b.createElement(ant, null)
                  )
                ),
                b.createElement(
                  Bv,
                  { value: hc.vis },
                  !A.hideChartNav && b.createElement(
                    "div",
                    { className: "px-2 mx-2 mt-2" },
                    b.createElement(SAt, null)
                  ),
                  b.createElement(
                    "div",
                    { style: { marginTop: "0em" }, className: me("m-4 p-4 border border-border rounded-md rounded-tl-none", A.hideChartNav ? "border-t-0 rounded-t-none" : "") },
                    ((t = s == null ? void 0 : s.features) == null ? void 0 : t.askviz) && b.createElement(o0t, { api: typeof s.features.askviz == "boolean" ? "" : s.features.askviz, feedbackApi: typeof s.features.feedbackAskviz == "boolean" ? "" : s.features.feedbackAskviz, headers: s == null ? void 0 : s.header }),
                    b.createElement(phe, { csvHandler: Z, rendererHandler: F, darkModePreference: o, experimentalFeatures: A.experimentalFeatures, exclude: B == null ? void 0 : B.exclude, extra: B == null ? void 0 : B.extra }),
                    b.createElement(pnt, null),
                    b.createElement(Apt, { themeKey: r }),
                    R.showDataBoard && b.createElement(nwt, null),
                    b.createElement(Vmt, null),
                    b.createElement(I0t, null),
                    b.createElement(r0t, null),
                    b.createElement(B0t, null),
                    b.createElement(hwt, null),
                    b.createElement(Pbt, { themeConfig: a, themeKey: r }),
                    R.showGeoJSONConfigPanel && b.createElement(e0t, { geoList: A.geoList }),
                    b.createElement(
                      "div",
                      { className: "sm:flex" },
                      b.createElement(
                        vyA,
                        { defaultWidth: 240, handleWidth: 4, className: "min-w-[100%] max-w-full sm:min-w-[96px] sm:max-w-[35%] flex-shrink-0", handlerClassName: "hidden sm:block" },
                        b.createElement(Sfe, null)
                      ),
                      b.createElement(
                        vyA,
                        { defaultWidth: 180, handleWidth: 4, className: "min-w-[100%] max-w-full sm:min-w-[164px] sm:max-w-[314px] flex-shrink-0", handlerClassName: "hidden sm:block" },
                        b.createElement(Git, null),
                        b.createElement(Ppe, null)
                      ),
                      b.createElement(
                        "div",
                        { className: "flex-1 min-w-[0px]" },
                        b.createElement(
                          "div",
                          null,
                          b.createElement(Vpe, null)
                        ),
                        b.createElement(
                          "div",
                          { className: "my-0.5 sm:ml-0.5 p-1 border relative h-[600px]", onMouseLeave: () => {
                            p.show && R.closeEmbededMenu();
                          }, onClick: () => {
                            p.show && R.closeEmbededMenu();
                          } },
                          n && b.createElement(GVA, {
                            csvRef: Z,
                            ref: F,
                            vizThemeConfig: C ?? a ?? r,
                            computationFunction: N,
                            // @TODO remove channelScales
                            scales: A.scales ?? A.channelScales
                          }),
                          b.createElement(twt, null)
                        )
                      )
                    )
                  )
                ),
                ((i = s == null ? void 0 : s.features) == null ? void 0 : i.vlChat) && b.createElement(
                  Bv,
                  { value: hc.chat },
                  b.createElement(Zwt, {
                    api: typeof s.features.vlChat == "boolean" ? "" : s.features.vlChat,
                    headers: s == null ? void 0 : s.header,
                    // @TODO remove channelScales
                    scales: A.scales ?? A.channelScales
                  })
                )
              )
            )
          ),
          b.createElement("div", { ref: K })
        )
      )
    )
  );
});
function Kwt(A) {
  const { computation: e, onMetaChange: t, fieldKeyGuard: i, keepAlive: n, storeRef: o, defaultConfig: g, ...s } = A, I = A.appearance ?? A.dark, r = A.data ?? A.dataSource, a = A.fields ?? A.rawFields ?? [], { computation: C, safeMetas: B, onMetaChange: l } = u.useMemo(() => {
    if (r) {
      if (A.fieldKeyGuard) {
        const { safeData: E, safeMetas: d } = F7(r, a);
        return {
          safeMetas: d,
          computation: Cd(E),
          onMetaChange: (m, y) => {
            var f;
            const w = d.findIndex((G) => G.fid === m);
            w >= 0 && ((f = A.onMetaChange) == null || f.call(A, a[w].fid, y));
          }
        };
      }
      return {
        safeMetas: a,
        computation: Cd(r),
        onMetaChange: A.onMetaChange
      };
    }
    return {
      safeMetas: a,
      computation: A.computation,
      onMetaChange: A.onMetaChange
    };
  }, [a, r || A.computation, A.fieldKeyGuard, A.onMetaChange]), Q = bX(I);
  return b.createElement(
    M7,
    { onMetaChange: l, meta: B, keepAlive: n, storeRef: o, defaultConfig: g },
    b.createElement(Wwt, { darkMode: Q, computation: C, ...s })
  );
}
const Uwt = gt(function(A) {
  const { computation: e, darkMode: t = "light", i18nLang: i = "en-US", i18nResources: n, computationTimeout: o = 6e4, onError: g, pageSize: s = 20, themeConfig: I, themeKey: r, vizThemeConfig: a } = A, { i18n: C } = qe(), B = C.language;
  u.useEffect(() => {
    n && fgA(n);
  }, [n]), u.useEffect(() => {
    i !== B && DgA(i);
  }, [i, B]);
  const l = xt(), Q = u.useCallback((f, w) => {
    const G = new Error(`Error${w ? `(${w})` : ""}: ${f}`);
    console.error(G), g == null || g(G), w && l.updateShowErrorResolutionPanel(w, f);
  }, [l, g]), E = u.useMemo(() => e ? L7(x7(e, o), (f) => Q(GD(f), 501)) : async () => [], [Q, e, o]), d = $K(l.meta), [m, y] = u.useState(null);
  return b.createElement(
    ygA,
    { value: { reportError: Q } },
    b.createElement(
      r1,
      { fallback: b.createElement("div", null, "Something went wrong"), onError: A.onError },
      b.createElement(
        kX,
        { ComputationContext: E, themeContext: t, vegaThemeContext: { vizThemeConfig: a ?? I ?? r }, portalContainerContext: m },
        b.createElement(
          "div",
          { className: `${t === "dark" ? "dark" : ""} App font-sans bg-background text-foreground h-full m-0 p-0` },
          b.createElement(
            "div",
            { className: "bg-background text-foreground h-full" },
            b.createElement(sX, { ref: A.tableFilterRef, onMetaChange: l.onMetaChange ? (f, w, G) => {
              l.updateCurrentDatasetMetas(f, G);
            } : void 0, size: s, metas: d, computation: E, displayOffset: A.displayOffset, hidePaginationAtOnepage: A.hidePaginationAtOnepage, hideProfiling: A.hideProfiling })
          ),
          b.createElement("div", { ref: y })
        ),
        b.createElement(QsA, null)
      )
    )
  );
});
function Vwt(A) {
  const { dark: e, dataSource: t, computation: i, onMetaChange: n, fieldKeyGuard: o, keepAlive: g, storeRef: s, defaultConfig: I, ...r } = A, a = A.appearance ?? A.dark, C = A.data ?? A.dataSource, B = A.fields ?? A.rawFields ?? [], { computation: l, safeMetas: Q, onMetaChange: E } = u.useMemo(() => {
    if (C) {
      if (A.fieldKeyGuard) {
        const { safeData: m, safeMetas: y } = F7(C, B);
        return {
          safeMetas: y,
          computation: Cd(m),
          onMetaChange: n ? (f, w) => {
            const G = y.findIndex((R) => R.fid === f);
            G >= 0 && n(B[G].fid, w);
          } : void 0
        };
      }
      return {
        safeMetas: B,
        computation: Cd(C),
        onMetaChange: n
      };
    }
    return {
      safeMetas: B,
      computation: A.computation,
      onMetaChange: n
    };
  }, [B, C || A.computation, A.fieldKeyGuard, n]), d = bX(a);
  return b.createElement(
    M7,
    { onMetaChange: E, meta: Q, keepAlive: g, storeRef: s, defaultConfig: I },
    b.createElement(Uwt, { darkMode: d, computation: l, ...r })
  );
}
const q5A = {
  key: "value",
  ascending: !0
}, Xwt = gt(function({ field: A, onChange: e }) {
  var t;
  if (((t = A.rule) == null ? void 0 : t.type) !== "regexp")
    return null;
  const { value: i, caseSensitive: n } = A.rule;
  return b.createElement(
    "div",
    { className: "flex flex-col space-y-2 p-2" },
    b.createElement("label", { className: "text-sm leading-none font-medium" }, A.name),
    b.createElement(
      "div",
      { className: "relative" },
      b.createElement(on, { type: "search", className: "pr-8", value: i, placeholder: "Input Regular Expression...", onChange: (o) => {
        e({
          type: "regexp",
          value: o.target.value,
          caseSensitive: !!n
        });
      } }),
      b.createElement(
        "div",
        { className: "absolute flex space-x-1 items-center inset-y-0 right-2" },
        b.createElement(
          Qv,
          { label: "Match Case", value: !!n, onChange: (o) => {
            e({
              type: "regexp",
              value: i,
              caseSensitive: o
            });
          } },
          b.createElement(
            "svg",
            { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" },
            b.createElement("path", { fill: "currentColor", d: "M8.854 11.702h-1l-.816-2.159H3.772l-.768 2.16H2L4.954 4h.935zm-2.111-2.97L5.534 5.45a3.142 3.142 0 0 1-.118-.515h-.021c-.036.218-.077.39-.124.515L4.073 8.732zm7.013 2.97h-.88v-.86h-.022c-.383.66-.947.99-1.692.99c-.548 0-.978-.146-1.29-.436c-.307-.29-.461-.675-.461-1.155c0-1.027.605-1.625 1.815-1.794l1.65-.23c0-.935-.379-1.403-1.134-1.403c-.663 0-1.26.226-1.794.677V6.59c.54-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782l-1.327.183c-.409.057-.717.159-.924.306c-.208.143-.312.399-.312.768c0 .268.095.489.285.66c.193.169.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165z" })
          )
        )
      )
    )
  );
});
function Qv(A) {
  return b.createElement("div", { title: A.label, onClick: () => {
    var e;
    (e = A.onChange) == null || e.call(A, !A.value);
  }, className: $a(A.value ? "bg-gray-100 dark:bg-zinc-700" : "hover:bg-gray-100 dark:hover:bg-zinc-700", "rounded cursor-pointer p-1 w-6 h-6 flex items-center justify-center") }, A.children);
}
const zwt = gt(function({ field: A, onChange: e, allFields: t, displayOffset: i }) {
  var n, o;
  const g = sg(), [s, I] = u.useState(""), [r, a] = u.useState(!1), [C, B] = u.useState(!1), [l, Q] = u.useState(!1), E = u.useMemo(() => s ? {
    value: s,
    caseSenstive: r,
    word: C,
    regexp: l
  } : void 0, [s, r, C, l]), d = u.useMemo(() => {
    const { timeout: c, ...J } = We.KEYWORD_DEBOUNCE_SETTING;
    return function(p) {
      return wD(p, c, J);
    };
  }, []), m = d7(d)(E), y = A.semanticType === "nominal", f = y ? m : void 0, { data: w, currentRows: G, handleSelect: R, loadData: F, loading: Z } = $VA(A, `${q5A.key}`, g, e, t, {
    displayOffset: i,
    keyword: f
  });
  return ((n = A.rule) == null ? void 0 : n.type) !== "one of" && ((o = A.rule) == null ? void 0 : o.type) !== "not in" ? null : b.createElement(
    "div",
    { className: "flex flex-col space-y-2 p-2 relative" },
    b.createElement("label", { className: "text-sm leading-none font-medium" }, A.name),
    b.createElement(
      Z5,
      { className: "w-full" },
      b.createElement(
        Z5.Button,
        { className: "flex shadow-sm items-center h-9 space-x-2 px-4 py-2 rounded-md border w-full text-left text-sm outline-none hover:bg-accent transition-colors bg-popover" },
        A.rule.value.length > 0 && b.createElement(
          "div",
          { className: "flex flex-1 space-x-2 min-w-[0px]" },
          b.createElement(
            "div",
            { className: "overflow-hidden text-ellipsis whitespace-nowrap" },
            A.rule.type === "not in" ? "exclude: " : "",
            Array.from(A.rule.value).slice(0, 3).join(", ")
          ),
          A.rule.value.length > 3 && b.createElement(
            "div",
            { className: "flex-shrink-0" },
            "+",
            A.rule.value.length - 3
          )
        ),
        A.rule.value.length === 0 && b.createElement("div", { className: "flex-1 text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap" }, A.rule.type === "one of" ? "Select Values..." : "Select Values to Exclude..."),
        b.createElement(
          "span",
          null,
          b.createElement(NR, { className: "h-4 w-4 text-gray-400", "aria-hidden": "true" })
        )
      ),
      b.createElement(
        M3,
        { as: u.Fragment, enter: "transition ease-out duration-200", enterFrom: "opacity-0 translate-y-1", enterTo: "opacity-100 translate-y-0", leave: "transition ease-in duration-150", leaveFrom: "opacity-100 translate-y-0", leaveTo: "opacity-0 translate-y-1" },
        b.createElement(
          Z5.Panel,
          { className: "absolute mt-2 z-10 border rounded-md inset-x-2 bg-popover shadow-md" },
          b.createElement(
            "div",
            { className: "flex flex-col w-full" },
            y && b.createElement(
              "div",
              { className: "relative border-b p-3 flex space-x-2 items-center text-sm" },
              b.createElement(cae, { className: "w-4 h-4" }),
              b.createElement("input", { type: "search", autoFocus: !0, className: "block focus:ring-0 focus:outline-none py-0 pl-0  w-full border-0 shadow-none bg-transparent text-gray-700 text-sm h-4 dark:text-gray-200 placeholder:text-gray-400", value: s, placeholder: "Search Value...", onChange: (c) => {
                I(c.target.value);
              } }),
              b.createElement(
                "div",
                { className: "absolute flex space-x-1 items-center inset-y-0 right-3" },
                b.createElement(
                  Qv,
                  { label: "Match Case", value: r, onChange: a },
                  b.createElement(
                    "svg",
                    { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" },
                    b.createElement("path", { fill: "currentColor", d: "M8.854 11.702h-1l-.816-2.159H3.772l-.768 2.16H2L4.954 4h.935zm-2.111-2.97L5.534 5.45a3.142 3.142 0 0 1-.118-.515h-.021c-.036.218-.077.39-.124.515L4.073 8.732zm7.013 2.97h-.88v-.86h-.022c-.383.66-.947.99-1.692.99c-.548 0-.978-.146-1.29-.436c-.307-.29-.461-.675-.461-1.155c0-1.027.605-1.625 1.815-1.794l1.65-.23c0-.935-.379-1.403-1.134-1.403c-.663 0-1.26.226-1.794.677V6.59c.54-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782l-1.327.183c-.409.057-.717.159-.924.306c-.208.143-.312.399-.312.768c0 .268.095.489.285.66c.193.169.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165z" })
                  )
                ),
                b.createElement(
                  Qv,
                  { label: "Match Whole Word", value: C, onChange: B },
                  b.createElement(
                    "svg",
                    { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" },
                    b.createElement(
                      "g",
                      { fill: "currentColor" },
                      b.createElement("path", { fillRule: "evenodd", d: "M0 11h1v2h14v-2h1v3H0z", clipRule: "evenodd" }),
                      b.createElement("path", { d: "M6.84 11h-.88v-.86h-.022c-.383.66-.947.989-1.692.989c-.548 0-.977-.145-1.289-.435c-.308-.29-.462-.675-.462-1.155c0-1.028.605-1.626 1.816-1.794l1.649-.23c0-.935-.378-1.403-1.134-1.403c-.662 0-1.26.226-1.794.677v-.902c.541-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782L4.633 8.4c-.408.058-.716.16-.924.307c-.208.143-.311.399-.311.768c0 .268.095.488.284.66c.194.168.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165zm3.388 1.987h-.022V11h-.88V2.857h.88v3.61h.021c.434-.73 1.068-1.096 1.902-1.096c.705 0 1.257.247 1.654.741c.401.49.602 1.15.602 1.977c0 .92-.224 1.658-.672 2.213c-.447.551-1.06.827-1.837.827c-.726 0-1.276-.308-1.649-.924m-.022-2.218v.768c0 .455.147.841.44 1.16c.298.315.674.473 1.128.473c.534 0 .951-.204 1.252-.613c.304-.408.456-.975.456-1.702c0-.613-.141-1.092-.424-1.44c-.283-.347-.666-.52-1.15-.52c-.511 0-.923.178-1.235.536c-.311.355-.467.8-.467 1.338" })
                    )
                  )
                ),
                b.createElement(
                  Qv,
                  { label: "Use Regular Expression", value: l, onChange: Q },
                  b.createElement(
                    "svg",
                    { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" },
                    b.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M10.012 2h.976v3.113l2.56-1.557l.486.885L11.47 6l2.564 1.559l-.485.885l-2.561-1.557V10h-.976V6.887l-2.56 1.557l-.486-.885L9.53 6L6.966 4.441l.485-.885l2.561 1.557zM2 10h4v4H2z", clipRule: "evenodd" })
                  )
                )
              )
            ),
            Z && b.createElement(
              "div",
              { className: "h-24 w-full relative" },
              b.createElement(Ts, null)
            ),
            !Z && b.createElement(Twt, { field: A, data: w, distinctTotal: G, handleSelect: R, loadData: F, displayOffset: i })
          )
        )
      )
    )
  );
}), KyA = "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none space-x-2 hover:bg-gray-100 dark:hover:bg-gray-800";
function Twt({ field: A, distinctTotal: e, data: t, handleSelect: i, loadData: n, displayOffset: o }) {
  const g = u.useRef(null), s = KVA({
    count: e ?? 0,
    getScrollElement: () => g.current,
    estimateSize: () => 32,
    overscan: 10
  }), I = u.useMemo(() => {
    var r;
    return A.rule && (A.rule.type === "not in" || ((r = A.rule) == null ? void 0 : r.type) === "one of") ? new Set(A.rule.value.map((a) => nw(a))) : null;
  }, [A]);
  return b.createElement(
    "div",
    { className: "overflow-y-auto w-full flex flex-col max-h-64 p-1", ref: g },
    b.createElement("div", { style: {
      paddingBottom: `${s.getTotalSize()}px`,
      width: "100%",
      position: "relative"
    } }, s.getVirtualItems().map((r) => {
      var a, C;
      const B = r.index, l = t == null ? void 0 : t[B];
      if (!l)
        return b.createElement(
          "div",
          { key: B, className: $a("animate-pulse", KyA), style: {
            height: `${r.size}px`,
            transform: `translateY(${r.start}px)`,
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%"
          } },
          b.createElement("div", { className: "h-4 w-4" }),
          b.createElement(
            "div",
            { className: "flex justify-left items-center" },
            b.createElement("div", { className: "h-3 w-20 bg-slate-200 rounded" })
          ),
          b.createElement(_wt, { effect: () => n(B), effectId: `${A.fid}_${q5A.key}_${B}` })
        );
      const { value: Q, count: E } = l, d = !!I && ((a = A.rule) == null ? void 0 : a.type) === "one of" && I.has(nw(Q)) || !!I && ((C = A.rule) == null ? void 0 : C.type) === "not in" && !I.has(nw(Q)), m = A.semanticType === "temporal" ? CQ(Uu(o, A.offset)(Q)) : `${Q}`;
      return b.createElement(
        "div",
        { key: B, className: KyA, style: {
          height: `${r.size}px`,
          transform: `translateY(${r.start}px)`,
          position: "absolute",
          top: 0,
          left: 0,
          width: "100%"
        }, onClick: () => i(Q, !d, E) },
        b.createElement(dYA, { className: $a("w-4 h-4", d ? "opacity-100" : "opacity-0") }),
        b.createElement("div", { className: "whitespace-nowrap text-ellipsis overflow-hidden min-w-0 flex-1" }, m)
      );
    })),
    e === 0 && b.createElement("div", { className: "py-6 text-center" }, "No value found.")
  );
}
const _wt = (A) => (u.useEffect(() => {
  A.effect();
}, [A.effectId]), null), qwt = ({ field: A, allFields: e, onChange: t, displayOffset: i }) => {
  var n;
  const o = sg(), [g, s] = u.useState(() => [0, 0, "", !1]);
  b.useEffect(() => {
    $FA(A, e, o, { timezoneDisplayOffset: i })((Q) => A1A(Q, A.fid, A.offset)).then(([Q, E, d]) => s([Q, E, d, !0]));
  }, [A.fid]);
  const [I, r, a, C] = g, B = A.offset ?? (/* @__PURE__ */ new Date()).getTimezoneOffset(), l = b.useCallback((Q) => {
    t({
      type: "temporal range",
      value: Q,
      format: a,
      offset: B
    });
  }, [a, B]);
  return ((n = A.rule) == null ? void 0 : n.type) !== "temporal range" ? null : C ? b.createElement(
    "div",
    { className: "flex flex-col space-y-2 p-2" },
    b.createElement("label", { className: "text-sm leading-none font-medium" }, A.name),
    b.createElement(
      "div",
      { className: "flex space-x-2 items-center h-9" },
      b.createElement(
        "div",
        { className: "flex-1" },
        b.createElement(zZ, { className: "h-9 py-4", displayOffset: i, min: I, max: A.rule.value[1] ?? r, value: A.rule.value[0] ?? I, onChange: (Q) => {
          var E;
          return l([Q, (E = A.rule) == null ? void 0 : E.value[1]]);
        } })
      ),
      b.createElement(
        "div",
        { className: "flex-shrink-0" },
        b.createElement(Kse, { className: "w-4 h-4" })
      ),
      b.createElement(
        "div",
        { className: "flex-1" },
        b.createElement(zZ, { className: "h-9 py-4", displayOffset: i, min: A.rule.value[0] ?? I, max: r, value: A.rule.value[1] ?? r, onChange: (Q) => {
          var E;
          return l([(E = A.rule) == null ? void 0 : E.value[0], Q]);
        } })
      )
    )
  ) : b.createElement(
    "div",
    { className: "flex flex-col space-y-2 p-2" },
    b.createElement("label", { className: "text-sm leading-none font-medium" }, A.name),
    b.createElement(
      "div",
      { className: "h-9 w-full relative" },
      b.createElement(Ts, null)
    )
  );
}, Owt = ({ field: A, onChange: e, allFields: t, displayOffset: i }) => {
  var n;
  const o = sg(), [g] = XZ(A, { values: !1, range: !0, valuesMeta: !1, displayOffset: i }, "none", o, t), s = g == null ? void 0 : g.range, I = b.useCallback((r) => {
    e({
      type: "range",
      value: r
    });
  }, []);
  return ((n = A.rule) == null ? void 0 : n.type) !== "range" ? null : s ? b.createElement(jwt, { name: A.name, value: A.rule.value, range: s, onChange: I }) : b.createElement(
    "div",
    { className: "flex flex-col space-y-2 p-2" },
    b.createElement("label", { className: "text-sm leading-none font-medium" }, A.name),
    b.createElement(
      "div",
      { className: "h-9 w-full relative" },
      b.createElement(Ts, null)
    )
  );
};
function jwt({ name: A, value: e, range: t, onChange: i }) {
  const [n, o] = Mq(e, i), g = 10 ** Math.floor(Math.log10((t[1] - t[0]) / 100));
  return b.createElement(
    "div",
    { className: "flex flex-col space-y-2 p-2" },
    b.createElement(
      "div",
      { className: "flex justify-between text-sm leading-none" },
      b.createElement("label", { className: "font-medium" }, A),
      b.createElement(
        "span",
        { className: "text-right text-gray-500" },
        "[",
        n[0],
        ",",
        n[1],
        "]"
      )
    ),
    b.createElement(
      "div",
      { className: "flex items-center h-9" },
      b.createElement($V, { step: g, min: t[0], max: t[1], value: [n[0] ?? t[0], n[1] ?? t[1]], onValueChange: ([s, I]) => o([s, I]) })
    )
  );
}
const Pwt = 1280, $wt = 768, Aft = gt(function(A) {
  const { computation: e, darkMode: t = "light", i18nLang: i = "en-US", i18nResources: n, themeKey: o = "vega", themeConfig: g, vizThemeConfig: s, geographicData: I, computationTimeout: r = 6e4, spec: a, vlSpec: C, chart: B, onError: l } = A, { i18n: Q } = qe(), E = Q.language;
  u.useEffect(() => {
    n && fgA(n);
  }, [n]), u.useEffect(() => {
    i !== E && DgA(i);
  }, [i, E]);
  const d = xt();
  u.useEffect(() => {
    I && d.setGeographicData(I, I.key);
  }, [d, I]), u.useEffect(() => {
    a && d.replaceNow(y2A(a, d.meta, d.currentVis.name ?? "Chart 1", d.currentVis.visId));
  }, [a, d]), u.useEffect(() => {
    B && d.importCode(B);
  }, [B, d]), u.useEffect(() => {
    if (C) {
      const G = a3(d.meta, "");
      d.replaceNow(X5A(a, [...G.encodings.dimensions, ...G.encodings.measures], d.currentVis.name ?? "Chart 1", d.currentVis.visId));
    }
  }, [C, d]);
  const m = u.useCallback((G, R) => {
    const F = new Error(`Error${R ? `(${R})` : ""}: ${G}`);
    console.error(F), l == null || l(F), R && d.updateShowErrorResolutionPanel(R, G);
  }, [d, l]), y = u.useMemo(() => e ? L7(x7(e, r), (G) => m(GD(G), 501)) : async () => [], [m, e, r]), [f, w] = u.useState(null);
  return b.createElement(
    ygA,
    { value: { reportError: m } },
    b.createElement(
      r1,
      { fallback: b.createElement("div", null, "Something went wrong"), onError: A.onError },
      b.createElement(
        kX,
        { ComputationContext: y, themeContext: t, vegaThemeContext: { vizThemeConfig: s ?? g ?? o }, portalContainerContext: f },
        b.createElement(
          "div",
          { className: `${t === "dark" ? "dark" : ""} App font-sans bg-background text-foreground m-0 p-0` },
          b.createElement(
            "div",
            { className: "flex flex-col space-y-2 bg-background text-foreground" },
            b.createElement(QsA, null),
            b.createElement(tft, null),
            b.createElement("div", { className: A.containerClassName, style: A.containerStyle }, e && b.createElement(GVA, {
              vizThemeConfig: s ?? g ?? o,
              computationFunction: y,
              // @TODO remove channelScales
              scales: A.scales ?? A.channelScales,
              overrideSize: A.overrideSize
            }))
          ),
          b.createElement("div", { ref: w })
        )
      )
    )
  );
}), eft = gt(function({ filter: A, onChange: e }) {
  var t, i, n, o, g;
  const s = xt(), { allFields: I, viewDimensions: r, config: a } = s, { timezoneDisplayOffset: C } = a, B = sg(), l = A.enableAgg ? I.find((d) => d.fid === A.fid) : void 0, Q = A != null && A.enableAgg ? A.aggName : void 0, E = u.useMemo(() => {
    if (l && r.length > 0) {
      const d = Vu([], I, r, [{ ...l, aggName: Q }], !0, "none", [], void 0, C).map((m) => m.type === "view" ? {
        ...m,
        query: m.query.map((y) => y.op === "aggregate" ? { ...y, measures: y.measures.map((f) => ({ ...f, asFieldKey: f.field })) } : y)
      } : m);
      return (m) => B({
        ...m,
        workflow: d.concat(m.workflow.filter((y) => y.type !== "transform"))
      });
    } else
      return B;
  }, [B, r, l, Q]);
  return b.createElement(
    vR.Provider,
    { value: E },
    ((t = A.rule) == null ? void 0 : t.type) === "regexp" && b.createElement(Xwt, { allFields: I, key: rm(A), field: A, onChange: e, displayOffset: C }),
    (((i = A.rule) == null ? void 0 : i.type) === "not in" || ((n = A.rule) == null ? void 0 : n.type) === "one of") && b.createElement(zwt, { allFields: I, key: rm(A), field: A, onChange: e, displayOffset: C }),
    ((o = A.rule) == null ? void 0 : o.type) === "range" && b.createElement(Owt, { allFields: I, key: rm(A), field: A, onChange: e, displayOffset: C }),
    ((g = A.rule) == null ? void 0 : g.type) === "temporal range" && b.createElement(qwt, { allFields: I, key: rm(A), field: A, onChange: e, displayOffset: C })
  );
}), tft = gt(function() {
  const A = xt(), e = b.useCallback((o, g) => {
    o !== null && A.writeFilter(o, g ?? null);
  }, [A]), { width: t = 0, ref: i } = DVA(), n = t > Pwt ? "grid-cols-3" : t > $wt ? "grid-cols-2" : "grid-cols-1";
  return b.createElement("div", { className: $a("grid gap-2 px-2", n), ref: i }, A.viewFilters.map((o, g) => b.createElement(eft, { key: o.fid, filter: o, onChange: (s) => e(g, s) })));
});
function ift(A) {
  const { dark: e, dataSource: t, computation: i, onMetaChange: n, fieldKeyGuard: o, keepAlive: g, storeRef: s, defaultConfig: I, ...r } = A, a = A.appearance ?? A.dark, C = A.data ?? A.dataSource, B = A.fields ?? A.rawFields ?? [], { computation: l, safeMetas: Q, onMetaChange: E } = u.useMemo(() => {
    if (C) {
      if (A.fieldKeyGuard) {
        const { safeData: m, safeMetas: y } = F7(C, B);
        return {
          safeMetas: y,
          computation: Cd(m),
          onMetaChange: (f, w) => {
            var G;
            const R = y.findIndex((F) => F.fid === f);
            R >= 0 && ((G = A.onMetaChange) == null || G.call(A, B[R].fid, w));
          }
        };
      }
      return {
        safeMetas: B,
        computation: Cd(C),
        onMetaChange: A.onMetaChange
      };
    }
    return {
      safeMetas: B,
      computation: A.computation,
      onMetaChange: A.onMetaChange
    };
  }, [B, C || A.computation, A.fieldKeyGuard, A.onMetaChange]), d = bX(a);
  return b.createElement(
    M7,
    { onMetaChange: E, meta: Q, keepAlive: g, storeRef: s, defaultConfig: I },
    b.createElement(Aft, { ...r, darkMode: d, computation: l })
  );
}
const O5A = gt(u.forwardRef((A, e) => {
  const [t, i] = u.useState(null), n = (g) => {
    i(g);
  }, o = () => {
    i(null);
  };
  return b.createElement(
    S3,
    { ref: e },
    b.createElement(
      wX,
      { onMount: n, onUnmount: o, uiTheme: A.uiTheme ?? A.colorConfig },
      b.createElement(
        H$,
        { value: { head: t ?? document.head, body: t ?? document.body } },
        b.createElement(Kwt, { ...A })
      )
    )
  );
})), UyA = gt(u.forwardRef((A, e) => {
  const [t, i] = u.useState(null), n = (g) => {
    i(g);
  }, o = () => {
    i(null);
  };
  return b.createElement(
    S3,
    { ref: e },
    b.createElement(
      wX,
      { onMount: n, onUnmount: o, uiTheme: A.uiTheme ?? A.colorConfig },
      b.createElement(
        H$,
        { value: { head: t ?? document.head, body: t ?? document.body } },
        b.createElement(ift, { ...A })
      )
    )
  );
})), VyA = gt(u.forwardRef((A, e) => {
  const [t, i] = u.useState(null), n = (g) => {
    i(g);
  }, o = () => {
    i(null);
  };
  return b.createElement(
    S3,
    { ref: e },
    b.createElement(
      wX,
      { style: { width: "100%", height: "100%" }, onMount: n, onUnmount: o, uiTheme: A.uiTheme ?? A.colorConfig },
      b.createElement(
        H$,
        { value: { head: t ?? document.head, body: t ?? document.body } },
        b.createElement(Vwt, { ...A })
      )
    )
  );
})), nft = u.forwardRef(function(A, e) {
  const { name: t, className: i, themeKey: n, uiTheme: o, colorConfig: g, vizThemeConfig: s, appearance: I, dark: r, visualState: a, visualConfig: C, visualLayout: B, overrideSize: l, locale: Q, type: E, themeConfig: d, channelScales: m, scales: y, disableCollapse: f } = A, w = u.useMemo(() => A.type === "remote" ? A.computation : Cd(A.rawData), [E, E === "remote" ? A.computation : A.rawData]), G = B ?? C, R = u.useMemo(() => ({
    ...G,
    ...l ? { size: l } : {}
  }), [G, l]), F = R.size.mode, Z = gf(a), c = C.limit ?? -1, J = (C == null ? void 0 : C.defaultAggregated) ?? !1, [p, N] = u.useState([]), { allFields: v, viewDimensions: K, viewMeasures: U, filters: j } = u.useMemo(() => {
    const rA = [], sA = [], { dimensions: lA, measures: cA, filters: aA, ...QA } = a, hA = [...lA, ...cA], EA = Object.keys(QA);
    for (const RA of EA)
      for (const xA of QA[RA])
        xA.analyticType === "dimension" ? rA.push(xA) : xA.analyticType === "measure" && sA.push(xA);
    return { allFields: hA, viewDimensions: rA, viewMeasures: sA, filters: aA };
  }, [a]), { viewData: q, loading: O } = jF({
    allFields: v,
    viewDimensions: K,
    viewMeasures: U,
    filters: j,
    defaultAggregated: J,
    sort: Z,
    folds: C.folds,
    limit: c,
    computationFunction: w,
    timezoneDisplayOffset: C.timezoneDisplayOffset
  }), $ = u.useRef({ data: q });
  $.current = { data: q }, u.useEffect(() => {
    O === !1 && Jt.unstable_batchedUpdates(() => {
      N($.current.data);
    });
  }, [O]);
  const { coordSystem: _ = "generic" } = C, tA = _ === "geographic", nA = bX(I ?? r), [AA, gA] = u.useState(null);
  return b.createElement(
    wX,
    { style: F === "full" ? { width: "100%", height: "100%" } : void 0, className: i, uiTheme: o ?? g },
    b.createElement(
      kX,
      { ComputationContext: w, themeContext: nA, vegaThemeContext: { vizThemeConfig: s ?? d ?? n }, portalContainerContext: AA },
      O && b.createElement(Ts, null),
      b.createElement(
        "div",
        { className: `App relative ${nA === "dark" ? "dark" : ""}`, style: F === "full" ? { width: "100%", height: "100%" } : void 0 },
        tA && b.createElement(
          "div",
          { className: "max-w-full", style: { height: QS, flexGrow: 1 } },
          b.createElement(WMA, { data: q, draggableFieldState: a, visualConfig: C, visualLayout: R })
        ),
        tA || b.createElement(bgA, { name: t, data: p, ref: e, draggableFieldState: a, visualConfig: C, layout: R, locale: Q ?? "en-US", scales: y ?? m, vizThemeConfig: s ?? d ?? n, disableCollapse: f }),
        b.createElement("div", { ref: gA })
      )
    )
  );
}), GsA = gt(oDe(nft)), oft = (A) => b.createElement("input", { style: { display: "none" }, type: "file", ref: A.fileRef, onChange: (e) => {
  const t = e.target.files;
  if (t !== null) {
    const i = t[0];
    A.onImport(i);
  }
} }), gft = oft;
var j5A = { exports: {} };
/* @license
Papa Parse
v5.4.1
https://github.com/mholt/PapaParse
License: MIT
*/
(function(A, e) {
  (function(t, i) {
    A.exports = i();
  })(qE, function t() {
    var i = typeof self < "u" ? self : typeof window < "u" ? window : i !== void 0 ? i : {}, n = !i.document && !!i.postMessage, o = i.IS_PAPA_WORKER || !1, g = {}, s = 0, I = { parse: function(Z, c) {
      var J = (c = c || {}).dynamicTyping || !1;
      if (F(J) && (c.dynamicTypingFunction = J, J = {}), c.dynamicTyping = J, c.transform = !!F(c.transform) && c.transform, c.worker && I.WORKERS_SUPPORTED) {
        var p = function() {
          if (!I.WORKERS_SUPPORTED)
            return !1;
          var v = (U = i.URL || i.webkitURL || null, j = t.toString(), I.BLOB_URL || (I.BLOB_URL = U.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", j, ")();"], { type: "text/javascript" })))), K = new i.Worker(v), U, j;
          return K.onmessage = y, K.id = s++, g[K.id] = K;
        }();
        return p.userStep = c.step, p.userChunk = c.chunk, p.userComplete = c.complete, p.userError = c.error, c.step = F(c.step), c.chunk = F(c.chunk), c.complete = F(c.complete), c.error = F(c.error), delete c.worker, void p.postMessage({ input: Z, config: c, workerId: p.id });
      }
      var N = null;
      return I.NODE_STREAM_INPUT, typeof Z == "string" ? (Z = function(v) {
        return v.charCodeAt(0) === 65279 ? v.slice(1) : v;
      }(Z), N = c.download ? new C(c) : new l(c)) : Z.readable === !0 && F(Z.read) && F(Z.on) ? N = new Q(c) : (i.File && Z instanceof File || Z instanceof Object) && (N = new B(c)), N.stream(Z);
    }, unparse: function(Z, c) {
      var J = !1, p = !0, N = ",", v = `\r
`, K = '"', U = K + K, j = !1, q = null, O = !1;
      (function() {
        if (typeof c == "object") {
          if (typeof c.delimiter != "string" || I.BAD_DELIMITERS.filter(function(nA) {
            return c.delimiter.indexOf(nA) !== -1;
          }).length || (N = c.delimiter), (typeof c.quotes == "boolean" || typeof c.quotes == "function" || Array.isArray(c.quotes)) && (J = c.quotes), typeof c.skipEmptyLines != "boolean" && typeof c.skipEmptyLines != "string" || (j = c.skipEmptyLines), typeof c.newline == "string" && (v = c.newline), typeof c.quoteChar == "string" && (K = c.quoteChar), typeof c.header == "boolean" && (p = c.header), Array.isArray(c.columns)) {
            if (c.columns.length === 0)
              throw new Error("Option columns is empty");
            q = c.columns;
          }
          c.escapeChar !== void 0 && (U = c.escapeChar + K), (typeof c.escapeFormulae == "boolean" || c.escapeFormulae instanceof RegExp) && (O = c.escapeFormulae instanceof RegExp ? c.escapeFormulae : /^[=+\-@\t\r].*$/);
        }
      })();
      var $ = new RegExp(d(K), "g");
      if (typeof Z == "string" && (Z = JSON.parse(Z)), Array.isArray(Z)) {
        if (!Z.length || Array.isArray(Z[0]))
          return _(null, Z, j);
        if (typeof Z[0] == "object")
          return _(q || Object.keys(Z[0]), Z, j);
      } else if (typeof Z == "object")
        return typeof Z.data == "string" && (Z.data = JSON.parse(Z.data)), Array.isArray(Z.data) && (Z.fields || (Z.fields = Z.meta && Z.meta.fields || q), Z.fields || (Z.fields = Array.isArray(Z.data[0]) ? Z.fields : typeof Z.data[0] == "object" ? Object.keys(Z.data[0]) : []), Array.isArray(Z.data[0]) || typeof Z.data[0] == "object" || (Z.data = [Z.data])), _(Z.fields || [], Z.data || [], j);
      throw new Error("Unable to serialize unrecognized input");
      function _(nA, AA, gA) {
        var rA = "";
        typeof nA == "string" && (nA = JSON.parse(nA)), typeof AA == "string" && (AA = JSON.parse(AA));
        var sA = Array.isArray(nA) && 0 < nA.length, lA = !Array.isArray(AA[0]);
        if (sA && p) {
          for (var cA = 0; cA < nA.length; cA++)
            0 < cA && (rA += N), rA += tA(nA[cA], cA);
          0 < AA.length && (rA += v);
        }
        for (var aA = 0; aA < AA.length; aA++) {
          var QA = sA ? nA.length : AA[aA].length, hA = !1, EA = sA ? Object.keys(AA[aA]).length === 0 : AA[aA].length === 0;
          if (gA && !sA && (hA = gA === "greedy" ? AA[aA].join("").trim() === "" : AA[aA].length === 1 && AA[aA][0].length === 0), gA === "greedy" && sA) {
            for (var RA = [], xA = 0; xA < QA; xA++) {
              var HA = lA ? nA[xA] : xA;
              RA.push(AA[aA][HA]);
            }
            hA = RA.join("").trim() === "";
          }
          if (!hA) {
            for (var ne = 0; ne < QA; ne++) {
              0 < ne && !EA && (rA += N);
              var VA = sA && lA ? nA[ne] : ne;
              rA += tA(AA[aA][VA], ne);
            }
            aA < AA.length - 1 && (!gA || 0 < QA && !EA) && (rA += v);
          }
        }
        return rA;
      }
      function tA(nA, AA) {
        if (nA == null)
          return "";
        if (nA.constructor === Date)
          return JSON.stringify(nA).slice(1, 25);
        var gA = !1;
        O && typeof nA == "string" && O.test(nA) && (nA = "'" + nA, gA = !0);
        var rA = nA.toString().replace($, U);
        return (gA = gA || J === !0 || typeof J == "function" && J(nA, AA) || Array.isArray(J) && J[AA] || function(sA, lA) {
          for (var cA = 0; cA < lA.length; cA++)
            if (-1 < sA.indexOf(lA[cA]))
              return !0;
          return !1;
        }(rA, I.BAD_DELIMITERS) || -1 < rA.indexOf(N) || rA.charAt(0) === " " || rA.charAt(rA.length - 1) === " ") ? K + rA + K : rA;
      }
    } };
    if (I.RECORD_SEP = String.fromCharCode(30), I.UNIT_SEP = String.fromCharCode(31), I.BYTE_ORDER_MARK = "\uFEFF", I.BAD_DELIMITERS = ["\r", `
`, '"', I.BYTE_ORDER_MARK], I.WORKERS_SUPPORTED = !n && !!i.Worker, I.NODE_STREAM_INPUT = 1, I.LocalChunkSize = 10485760, I.RemoteChunkSize = 5242880, I.DefaultDelimiter = ",", I.Parser = m, I.ParserHandle = E, I.NetworkStreamer = C, I.FileStreamer = B, I.StringStreamer = l, I.ReadableStreamStreamer = Q, i.jQuery) {
      var r = i.jQuery;
      r.fn.parse = function(Z) {
        var c = Z.config || {}, J = [];
        return this.each(function(v) {
          if (!(r(this).prop("tagName").toUpperCase() === "INPUT" && r(this).attr("type").toLowerCase() === "file" && i.FileReader) || !this.files || this.files.length === 0)
            return !0;
          for (var K = 0; K < this.files.length; K++)
            J.push({ file: this.files[K], inputElem: this, instanceConfig: r.extend({}, c) });
        }), p(), this;
        function p() {
          if (J.length !== 0) {
            var v, K, U, j, q = J[0];
            if (F(Z.before)) {
              var O = Z.before(q.file, q.inputElem);
              if (typeof O == "object") {
                if (O.action === "abort")
                  return v = "AbortError", K = q.file, U = q.inputElem, j = O.reason, void (F(Z.error) && Z.error({ name: v }, K, U, j));
                if (O.action === "skip")
                  return void N();
                typeof O.config == "object" && (q.instanceConfig = r.extend(q.instanceConfig, O.config));
              } else if (O === "skip")
                return void N();
            }
            var $ = q.instanceConfig.complete;
            q.instanceConfig.complete = function(_) {
              F($) && $(_, q.file, q.inputElem), N();
            }, I.parse(q.file, q.instanceConfig);
          } else
            F(Z.complete) && Z.complete();
        }
        function N() {
          J.splice(0, 1), p();
        }
      };
    }
    function a(Z) {
      this._handle = null, this._finished = !1, this._completed = !1, this._halted = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = { data: [], errors: [], meta: {} }, function(c) {
        var J = G(c);
        J.chunkSize = parseInt(J.chunkSize), c.step || c.chunk || (J.chunkSize = null), this._handle = new E(J), (this._handle.streamer = this)._config = J;
      }.call(this, Z), this.parseChunk = function(c, J) {
        if (this.isFirstChunk && F(this._config.beforeFirstChunk)) {
          var p = this._config.beforeFirstChunk(c);
          p !== void 0 && (c = p);
        }
        this.isFirstChunk = !1, this._halted = !1;
        var N = this._partialLine + c;
        this._partialLine = "";
        var v = this._handle.parse(N, this._baseIndex, !this._finished);
        if (!this._handle.paused() && !this._handle.aborted()) {
          var K = v.meta.cursor;
          this._finished || (this._partialLine = N.substring(K - this._baseIndex), this._baseIndex = K), v && v.data && (this._rowCount += v.data.length);
          var U = this._finished || this._config.preview && this._rowCount >= this._config.preview;
          if (o)
            i.postMessage({ results: v, workerId: I.WORKER_ID, finished: U });
          else if (F(this._config.chunk) && !J) {
            if (this._config.chunk(v, this._handle), this._handle.paused() || this._handle.aborted())
              return void (this._halted = !0);
            v = void 0, this._completeResults = void 0;
          }
          return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(v.data), this._completeResults.errors = this._completeResults.errors.concat(v.errors), this._completeResults.meta = v.meta), this._completed || !U || !F(this._config.complete) || v && v.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), U || v && v.meta.paused || this._nextChunk(), v;
        }
        this._halted = !0;
      }, this._sendError = function(c) {
        F(this._config.error) ? this._config.error(c) : o && this._config.error && i.postMessage({ workerId: I.WORKER_ID, error: c, finished: !1 });
      };
    }
    function C(Z) {
      var c;
      (Z = Z || {}).chunkSize || (Z.chunkSize = I.RemoteChunkSize), a.call(this, Z), this._nextChunk = n ? function() {
        this._readChunk(), this._chunkLoaded();
      } : function() {
        this._readChunk();
      }, this.stream = function(J) {
        this._input = J, this._nextChunk();
      }, this._readChunk = function() {
        if (this._finished)
          this._chunkLoaded();
        else {
          if (c = new XMLHttpRequest(), this._config.withCredentials && (c.withCredentials = this._config.withCredentials), n || (c.onload = R(this._chunkLoaded, this), c.onerror = R(this._chunkError, this)), c.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !n), this._config.downloadRequestHeaders) {
            var J = this._config.downloadRequestHeaders;
            for (var p in J)
              c.setRequestHeader(p, J[p]);
          }
          if (this._config.chunkSize) {
            var N = this._start + this._config.chunkSize - 1;
            c.setRequestHeader("Range", "bytes=" + this._start + "-" + N);
          }
          try {
            c.send(this._config.downloadRequestBody);
          } catch (v) {
            this._chunkError(v.message);
          }
          n && c.status === 0 && this._chunkError();
        }
      }, this._chunkLoaded = function() {
        c.readyState === 4 && (c.status < 200 || 400 <= c.status ? this._chunkError() : (this._start += this._config.chunkSize ? this._config.chunkSize : c.responseText.length, this._finished = !this._config.chunkSize || this._start >= function(J) {
          var p = J.getResponseHeader("Content-Range");
          return p === null ? -1 : parseInt(p.substring(p.lastIndexOf("/") + 1));
        }(c), this.parseChunk(c.responseText)));
      }, this._chunkError = function(J) {
        var p = c.statusText || J;
        this._sendError(new Error(p));
      };
    }
    function B(Z) {
      var c, J;
      (Z = Z || {}).chunkSize || (Z.chunkSize = I.LocalChunkSize), a.call(this, Z);
      var p = typeof FileReader < "u";
      this.stream = function(N) {
        this._input = N, J = N.slice || N.webkitSlice || N.mozSlice, p ? ((c = new FileReader()).onload = R(this._chunkLoaded, this), c.onerror = R(this._chunkError, this)) : c = new FileReaderSync(), this._nextChunk();
      }, this._nextChunk = function() {
        this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
      }, this._readChunk = function() {
        var N = this._input;
        if (this._config.chunkSize) {
          var v = Math.min(this._start + this._config.chunkSize, this._input.size);
          N = J.call(N, this._start, v);
        }
        var K = c.readAsText(N, this._config.encoding);
        p || this._chunkLoaded({ target: { result: K } });
      }, this._chunkLoaded = function(N) {
        this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(N.target.result);
      }, this._chunkError = function() {
        this._sendError(c.error);
      };
    }
    function l(Z) {
      var c;
      a.call(this, Z = Z || {}), this.stream = function(J) {
        return c = J, this._nextChunk();
      }, this._nextChunk = function() {
        if (!this._finished) {
          var J, p = this._config.chunkSize;
          return p ? (J = c.substring(0, p), c = c.substring(p)) : (J = c, c = ""), this._finished = !c, this.parseChunk(J);
        }
      };
    }
    function Q(Z) {
      a.call(this, Z = Z || {});
      var c = [], J = !0, p = !1;
      this.pause = function() {
        a.prototype.pause.apply(this, arguments), this._input.pause();
      }, this.resume = function() {
        a.prototype.resume.apply(this, arguments), this._input.resume();
      }, this.stream = function(N) {
        this._input = N, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
      }, this._checkIsFinished = function() {
        p && c.length === 1 && (this._finished = !0);
      }, this._nextChunk = function() {
        this._checkIsFinished(), c.length ? this.parseChunk(c.shift()) : J = !0;
      }, this._streamData = R(function(N) {
        try {
          c.push(typeof N == "string" ? N : N.toString(this._config.encoding)), J && (J = !1, this._checkIsFinished(), this.parseChunk(c.shift()));
        } catch (v) {
          this._streamError(v);
        }
      }, this), this._streamError = R(function(N) {
        this._streamCleanUp(), this._sendError(N);
      }, this), this._streamEnd = R(function() {
        this._streamCleanUp(), p = !0, this._streamData("");
      }, this), this._streamCleanUp = R(function() {
        this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
      }, this);
    }
    function E(Z) {
      var c, J, p, N = Math.pow(2, 53), v = -N, K = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, U = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, j = this, q = 0, O = 0, $ = !1, _ = !1, tA = [], nA = { data: [], errors: [], meta: {} };
      if (F(Z.step)) {
        var AA = Z.step;
        Z.step = function(aA) {
          if (nA = aA, sA())
            rA();
          else {
            if (rA(), nA.data.length === 0)
              return;
            q += aA.data.length, Z.preview && q > Z.preview ? J.abort() : (nA.data = nA.data[0], AA(nA, j));
          }
        };
      }
      function gA(aA) {
        return Z.skipEmptyLines === "greedy" ? aA.join("").trim() === "" : aA.length === 1 && aA[0].length === 0;
      }
      function rA() {
        return nA && p && (cA("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + I.DefaultDelimiter + "'"), p = !1), Z.skipEmptyLines && (nA.data = nA.data.filter(function(aA) {
          return !gA(aA);
        })), sA() && function() {
          if (!nA)
            return;
          function aA(hA, EA) {
            F(Z.transformHeader) && (hA = Z.transformHeader(hA, EA)), tA.push(hA);
          }
          if (Array.isArray(nA.data[0])) {
            for (var QA = 0; sA() && QA < nA.data.length; QA++)
              nA.data[QA].forEach(aA);
            nA.data.splice(0, 1);
          } else
            nA.data.forEach(aA);
        }(), function() {
          if (!nA || !Z.header && !Z.dynamicTyping && !Z.transform)
            return nA;
          function aA(hA, EA) {
            var RA, xA = Z.header ? {} : [];
            for (RA = 0; RA < hA.length; RA++) {
              var HA = RA, ne = hA[RA];
              Z.header && (HA = RA >= tA.length ? "__parsed_extra" : tA[RA]), Z.transform && (ne = Z.transform(ne, HA)), ne = lA(HA, ne), HA === "__parsed_extra" ? (xA[HA] = xA[HA] || [], xA[HA].push(ne)) : xA[HA] = ne;
            }
            return Z.header && (RA > tA.length ? cA("FieldMismatch", "TooManyFields", "Too many fields: expected " + tA.length + " fields but parsed " + RA, O + EA) : RA < tA.length && cA("FieldMismatch", "TooFewFields", "Too few fields: expected " + tA.length + " fields but parsed " + RA, O + EA)), xA;
          }
          var QA = 1;
          return !nA.data.length || Array.isArray(nA.data[0]) ? (nA.data = nA.data.map(aA), QA = nA.data.length) : nA.data = aA(nA.data, 0), Z.header && nA.meta && (nA.meta.fields = tA), O += QA, nA;
        }();
      }
      function sA() {
        return Z.header && tA.length === 0;
      }
      function lA(aA, QA) {
        return hA = aA, Z.dynamicTypingFunction && Z.dynamicTyping[hA] === void 0 && (Z.dynamicTyping[hA] = Z.dynamicTypingFunction(hA)), (Z.dynamicTyping[hA] || Z.dynamicTyping) === !0 ? QA === "true" || QA === "TRUE" || QA !== "false" && QA !== "FALSE" && (function(EA) {
          if (K.test(EA)) {
            var RA = parseFloat(EA);
            if (v < RA && RA < N)
              return !0;
          }
          return !1;
        }(QA) ? parseFloat(QA) : U.test(QA) ? new Date(QA) : QA === "" ? null : QA) : QA;
        var hA;
      }
      function cA(aA, QA, hA, EA) {
        var RA = { type: aA, code: QA, message: hA };
        EA !== void 0 && (RA.row = EA), nA.errors.push(RA);
      }
      this.parse = function(aA, QA, hA) {
        var EA = Z.quoteChar || '"';
        if (Z.newline || (Z.newline = function(HA, ne) {
          HA = HA.substring(0, 1048576);
          var VA = new RegExp(d(ne) + "([^]*?)" + d(ne), "gm"), le = (HA = HA.replace(VA, "")).split("\r"), we = HA.split(`
`), De = 1 < we.length && we[0].length < le[0].length;
          if (le.length === 1 || De)
            return `
`;
          for (var Ke = 0, ee = 0; ee < le.length; ee++)
            le[ee][0] === `
` && Ke++;
          return Ke >= le.length / 2 ? `\r
` : "\r";
        }(aA, EA)), p = !1, Z.delimiter)
          F(Z.delimiter) && (Z.delimiter = Z.delimiter(aA), nA.meta.delimiter = Z.delimiter);
        else {
          var RA = function(HA, ne, VA, le, we) {
            var De, Ke, ee, re;
            we = we || [",", "	", "|", ";", I.RECORD_SEP, I.UNIT_SEP];
            for (var wA = 0; wA < we.length; wA++) {
              var WA = we[wA], Pe = 0, je = 0, it = 0;
              ee = void 0;
              for (var Li = new m({ comments: le, delimiter: WA, newline: ne, preview: 10 }).parse(HA), zA = 0; zA < Li.data.length; zA++)
                if (VA && gA(Li.data[zA]))
                  it++;
                else {
                  var Qe = Li.data[zA].length;
                  je += Qe, ee !== void 0 ? 0 < Qe && (Pe += Math.abs(Qe - ee), ee = Qe) : ee = Qe;
                }
              0 < Li.data.length && (je /= Li.data.length - it), (Ke === void 0 || Pe <= Ke) && (re === void 0 || re < je) && 1.99 < je && (Ke = Pe, De = WA, re = je);
            }
            return { successful: !!(Z.delimiter = De), bestDelimiter: De };
          }(aA, Z.newline, Z.skipEmptyLines, Z.comments, Z.delimitersToGuess);
          RA.successful ? Z.delimiter = RA.bestDelimiter : (p = !0, Z.delimiter = I.DefaultDelimiter), nA.meta.delimiter = Z.delimiter;
        }
        var xA = G(Z);
        return Z.preview && Z.header && xA.preview++, c = aA, J = new m(xA), nA = J.parse(c, QA, hA), rA(), $ ? { meta: { paused: !0 } } : nA || { meta: { paused: !1 } };
      }, this.paused = function() {
        return $;
      }, this.pause = function() {
        $ = !0, J.abort(), c = F(Z.chunk) ? "" : c.substring(J.getCharIndex());
      }, this.resume = function() {
        j.streamer._halted ? ($ = !1, j.streamer.parseChunk(c, !0)) : setTimeout(j.resume, 3);
      }, this.aborted = function() {
        return _;
      }, this.abort = function() {
        _ = !0, J.abort(), nA.meta.aborted = !0, F(Z.complete) && Z.complete(nA), c = "";
      };
    }
    function d(Z) {
      return Z.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
    }
    function m(Z) {
      var c, J = (Z = Z || {}).delimiter, p = Z.newline, N = Z.comments, v = Z.step, K = Z.preview, U = Z.fastMode, j = c = Z.quoteChar === void 0 || Z.quoteChar === null ? '"' : Z.quoteChar;
      if (Z.escapeChar !== void 0 && (j = Z.escapeChar), (typeof J != "string" || -1 < I.BAD_DELIMITERS.indexOf(J)) && (J = ","), N === J)
        throw new Error("Comment character same as delimiter");
      N === !0 ? N = "#" : (typeof N != "string" || -1 < I.BAD_DELIMITERS.indexOf(N)) && (N = !1), p !== `
` && p !== "\r" && p !== `\r
` && (p = `
`);
      var q = 0, O = !1;
      this.parse = function($, _, tA) {
        if (typeof $ != "string")
          throw new Error("Input must be a string");
        var nA = $.length, AA = J.length, gA = p.length, rA = N.length, sA = F(v), lA = [], cA = [], aA = [], QA = q = 0;
        if (!$)
          return de();
        if (Z.header && !_) {
          var hA = $.split(p)[0].split(J), EA = [], RA = {}, xA = !1;
          for (var HA in hA) {
            var ne = hA[HA];
            F(Z.transformHeader) && (ne = Z.transformHeader(ne, HA));
            var VA = ne, le = RA[ne] || 0;
            for (0 < le && (xA = !0, VA = ne + "_" + le), RA[ne] = le + 1; EA.includes(VA); )
              VA = VA + "_" + le;
            EA.push(VA);
          }
          if (xA) {
            var we = $.split(p);
            we[0] = EA.join(J), $ = we.join(p);
          }
        }
        if (U || U !== !1 && $.indexOf(c) === -1) {
          for (var De = $.split(p), Ke = 0; Ke < De.length; Ke++) {
            if (aA = De[Ke], q += aA.length, Ke !== De.length - 1)
              q += p.length;
            else if (tA)
              return de();
            if (!N || aA.substring(0, rA) !== N) {
              if (sA) {
                if (lA = [], it(aA.split(J)), xe(), O)
                  return de();
              } else
                it(aA.split(J));
              if (K && K <= Ke)
                return lA = lA.slice(0, K), de(!0);
            }
          }
          return de();
        }
        for (var ee = $.indexOf(J, q), re = $.indexOf(p, q), wA = new RegExp(d(j) + d(c), "g"), WA = $.indexOf(c, q); ; )
          if ($[q] !== c)
            if (N && aA.length === 0 && $.substring(q, q + rA) === N) {
              if (re === -1)
                return de();
              q = re + gA, re = $.indexOf(p, q), ee = $.indexOf(J, q);
            } else if (ee !== -1 && (ee < re || re === -1))
              aA.push($.substring(q, ee)), q = ee + AA, ee = $.indexOf(J, q);
            else {
              if (re === -1)
                break;
              if (aA.push($.substring(q, re)), Qe(re + gA), sA && (xe(), O))
                return de();
              if (K && lA.length >= K)
                return de(!0);
            }
          else
            for (WA = q, q++; ; ) {
              if ((WA = $.indexOf(c, WA + 1)) === -1)
                return tA || cA.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: lA.length, index: q }), zA();
              if (WA === nA - 1)
                return zA($.substring(q, WA).replace(wA, c));
              if (c !== j || $[WA + 1] !== j) {
                if (c === j || WA === 0 || $[WA - 1] !== j) {
                  ee !== -1 && ee < WA + 1 && (ee = $.indexOf(J, WA + 1)), re !== -1 && re < WA + 1 && (re = $.indexOf(p, WA + 1));
                  var Pe = Li(re === -1 ? ee : Math.min(ee, re));
                  if ($.substr(WA + 1 + Pe, AA) === J) {
                    aA.push($.substring(q, WA).replace(wA, c)), $[q = WA + 1 + Pe + AA] !== c && (WA = $.indexOf(c, q)), ee = $.indexOf(J, q), re = $.indexOf(p, q);
                    break;
                  }
                  var je = Li(re);
                  if ($.substring(WA + 1 + je, WA + 1 + je + gA) === p) {
                    if (aA.push($.substring(q, WA).replace(wA, c)), Qe(WA + 1 + je + gA), ee = $.indexOf(J, q), WA = $.indexOf(c, q), sA && (xe(), O))
                      return de();
                    if (K && lA.length >= K)
                      return de(!0);
                    break;
                  }
                  cA.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: lA.length, index: q }), WA++;
                }
              } else
                WA++;
            }
        return zA();
        function it($e) {
          lA.push($e), QA = q;
        }
        function Li($e) {
          var Pn = 0;
          if ($e !== -1) {
            var Zt = $.substring(WA + 1, $e);
            Zt && Zt.trim() === "" && (Pn = Zt.length);
          }
          return Pn;
        }
        function zA($e) {
          return tA || ($e === void 0 && ($e = $.substring(q)), aA.push($e), q = nA, it(aA), sA && xe()), de();
        }
        function Qe($e) {
          q = $e, it(aA), aA = [], re = $.indexOf(p, q);
        }
        function de($e) {
          return { data: lA, errors: cA, meta: { delimiter: J, linebreak: p, aborted: O, truncated: !!$e, cursor: QA + (_ || 0) } };
        }
        function xe() {
          v(de()), lA = [], cA = [];
        }
      }, this.abort = function() {
        O = !0;
      }, this.getCharIndex = function() {
        return q;
      };
    }
    function y(Z) {
      var c = Z.data, J = g[c.workerId], p = !1;
      if (c.error)
        J.userError(c.error, c.file);
      else if (c.results && c.results.data) {
        var N = { abort: function() {
          p = !0, f(c.workerId, { data: [], errors: [], meta: { aborted: !0 } });
        }, pause: w, resume: w };
        if (F(J.userStep)) {
          for (var v = 0; v < c.results.data.length && (J.userStep({ data: c.results.data[v], errors: c.results.errors, meta: c.results.meta }, N), !p); v++)
            ;
          delete c.results;
        } else
          F(J.userChunk) && (J.userChunk(c.results, N, c.file), delete c.results);
      }
      c.finished && !p && f(c.workerId, c.results);
    }
    function f(Z, c) {
      var J = g[Z];
      F(J.userComplete) && J.userComplete(c), J.terminate(), delete g[Z];
    }
    function w() {
      throw new Error("Not implemented.");
    }
    function G(Z) {
      if (typeof Z != "object" || Z === null)
        return Z;
      var c = Array.isArray(Z) ? [] : {};
      for (var J in Z)
        c[J] = G(Z[J]);
      return c;
    }
    function R(Z, c) {
      return function() {
        Z.apply(c, arguments);
      };
    }
    function F(Z) {
      return typeof Z == "function";
    }
    return o && (i.onmessage = function(Z) {
      var c = Z.data;
      if (I.WORKER_ID === void 0 && c && (I.WORKER_ID = c.workerId), typeof c.input == "string")
        i.postMessage({ workerId: I.WORKER_ID, results: I.parse(c.input, c.config), finished: !0 });
      else if (i.File && c.input instanceof File || c.input instanceof Object) {
        var J = I.parse(c.input, c.config);
        J && i.postMessage({ workerId: I.WORKER_ID, results: J, finished: !0 });
      }
    }), (C.prototype = Object.create(a.prototype)).constructor = C, (B.prototype = Object.create(a.prototype)).constructor = B, (l.prototype = Object.create(l.prototype)).constructor = l, (Q.prototype = Object.create(a.prototype)).constructor = Q, I;
  });
})(j5A);
var P5A = j5A.exports;
const $5A = 1e4;
function sft(A) {
  const { file: e, config: t, onLoading: i, encoding: n = "utf-8" } = A;
  return new Promise((o, g) => {
    t ? aft(e, n, t.size, o, g, i) : Ift(e, n, o, g, i);
  });
}
function Ift(A, e, t, i, n) {
  const o = [];
  let g = [], s = -1, I = 0;
  P5A.parse(A, {
    worker: !0,
    encoding: e,
    step(r) {
      I += r.data.join(",").length, s === -1 ? g = r.data : r.data && r.data.length && r.data.length === g.length && o.push(r.data), n && s % $5A === 0 && n(I / A.size), s++;
    },
    complete() {
      const r = AzA(g, o);
      n && n(1), t(r);
    },
    error(r) {
      i(r);
    }
  });
}
function aft(A, e, t, i, n, o) {
  const g = [];
  let s = [], I = -1, r = 0;
  P5A.parse(A, {
    worker: !0,
    encoding: e,
    step(a) {
      if (r += a.data.join(",").length, I === -1)
        s = a.data;
      else if (a.data && a.data.length && a.data.length === s.length)
        if (I < t)
          g.push(a.data);
        else {
          let C = Math.round(Math.random() * I);
          C < t && (g[C] = a.data);
        }
      o && I % $5A === 0 && o(r / A.size), I++;
    },
    complete() {
      const a = AzA(s, g);
      o && o(1), i(a);
    },
    error(a) {
      n(a);
    }
  });
}
function AzA(A, e) {
  const t = [];
  for (let i = 0; i < e.length; i++) {
    let n = {};
    for (let o = 0; o < A.length; o++)
      n[A[o]] = e[i][o];
    t.push(n);
  }
  return t;
}
const rft = ({ commonStore: A, size: e = 10 }) => {
  const { tmpDSRawFields: t, tmpDataSource: i, displayOffset: n } = A, o = $K(t), g = b.useMemo(() => Cd(i), [i]);
  return b.createElement(
    "div",
    { className: "rounded border" },
    b.createElement(sX, { size: e, metas: o, computation: g, displayOffset: n, onMetaChange: (s, I, r) => {
      A.updateTempDatasetMetas(s, r);
    } })
  );
}, ezA = gt(rft), Cft = [
  {
    label: "UTF-8",
    value: "utf-8"
  },
  {
    label: "GB2312",
    value: "gb2312"
  },
  {
    label: "US-ASCII",
    value: "us-ascii"
  },
  {
    label: "Big5",
    value: "big5"
  },
  {
    label: "Big5-HKSCS",
    value: "Big5-HKSCS"
  },
  {
    label: "GB18030",
    value: "GB18030"
  }
], Bft = [
  {
    label: "CSV",
    value: "csv"
  },
  {
    label: "JSON",
    value: "json"
  }
];
function lft(A) {
  return new Promise((e, t) => {
    const i = new FileReader();
    i.onload = () => {
      try {
        const n = JSON.parse(i.result);
        if (!Array.isArray(n))
          throw new Error("Invalid JSON file");
        e(n);
      } catch (n) {
        t(n);
      }
    }, i.readAsText(A);
  });
}
const cft = ({ commonStore: A }) => {
  const e = u.useRef(null), { tmpDSName: t, tmpDataSource: i, tmpDSRawFields: n } = A, [o, g] = u.useState("utf-8"), [s, I] = u.useState("csv"), r = u.useCallback(() => {
    A.commitTempDS();
  }, [A]), { t: a } = qe("translation", { keyPrefix: "DataSource.dialog.file" }), C = i.length > 0 && n.length > 0, B = u.useCallback((l) => {
    const Q = l.target.files;
    if (Q !== null) {
      const E = Q[0];
      s === "csv" ? sft({
        file: E,
        config: { type: "reservoirSampling", size: 1 / 0 },
        onLoading: () => {
        },
        encoding: o
      }).then((d) => {
        A.updateTempDS(d);
      }) : lft(E).then((d) => {
        A.updateTempDS(d);
      });
    }
  }, [A, s, o]);
  return b.createElement(
    "div",
    { className: "min-h-[300px]" },
    !C && b.createElement(
      "div",
      { className: "text-center" },
      b.createElement(
        "svg",
        { className: "mx-auto h-12 w-12 text-muted-foreground", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", "aria-hidden": "true" },
        b.createElement("path", { vectorEffect: "non-scaling-stroke", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z" })
      ),
      b.createElement("h3", { className: "mt-2 text-sm font-semibold text-foreground" }, a("choose_file")),
      b.createElement("p", { className: "mt-1 text-sm text-muted-foreground" }, a("get_start_desc"))
    ),
    b.createElement("input", { style: { display: "none" }, type: "file", ref: e, onChange: B }),
    !C && b.createElement(
      "div",
      { className: "my-1" },
      b.createElement(
        "div",
        { className: "flex flex-col items-center gap-1 w-fit mx-auto" },
        b.createElement(
          "div",
          { className: "w-full" },
          b.createElement(
            Cm,
            { value: s, onChange: I, className: "mt-2" },
            b.createElement(Cm.Label, { className: "sr-only" }, " Choose a memory option "),
            b.createElement("div", { className: "grid grid-cols-2 gap-3" }, Bft.map((l) => b.createElement(
              Cm.Option,
              { key: l.value, value: l.value, className: ({ checked: Q }) => $a(HR({
                variant: Q ? "default" : "outline",
                className: Q ? "border-transparent" : ""
              }), "cursor-pointer px-8 border") },
              b.createElement(Cm.Label, { as: "span" }, l.label)
            )))
          )
        ),
        b.createElement(
          "div",
          { className: "flex w-full" },
          b.createElement(Re, { className: "mr-2", variant: "outline", onClick: () => {
            e.current && e.current.click();
          } }, a("open")),
          b.createElement(
            "div",
            { className: "relative flex-grow" },
            b.createElement(G2, { className: "w-full", options: Cft, selectedKey: o, onSelect: (l) => {
              g(l);
            } })
          )
        )
      )
    ),
    C && b.createElement(
      "div",
      { className: "mb-2 mt-6" },
      b.createElement("label", { className: "block text-xs text-secondary-foreground mb-1 font-bold" }, a("dataset_name")),
      b.createElement(
        "div",
        { className: "flex space-x-2" },
        b.createElement(on, { type: "text", placeholder: a("dataset_name"), value: t, onChange: (l) => {
          A.updateTempName(l.target.value);
        }, className: "text-xs placeholder:italic w-36" }),
        b.createElement(Re, { disabled: i.length === 0, onClick: () => {
          r();
        } }, a("submit"))
      )
    ),
    C && b.createElement(ezA, { commonStore: A })
  );
}, Qft = gt(cft), Eft = {
  CARS: "https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-cars-service.json",
  STUDENTS: "https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-students-service.json",
  BTC_GOLD: "https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-btcgold-service.json",
  BIKE_SHARING: "https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-bikesharing-service.json",
  CAR_SALES: "https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-carsales-service.json",
  COLLAGE: "https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-collage-service.json",
  TITANIC: "https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-titanic-service.json",
  KELPER: "https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-kelper-service.json",
  EARTHQUAKE: "https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-earthquake-service.json"
}, uft = [
  {
    key: "CARS",
    title: "Cars"
  },
  {
    key: "STUDENTS",
    title: "Students' Performance"
  },
  {
    key: "BIKE_SHARING",
    title: "Bike Sharing"
  },
  {
    key: "EARTHQUAKE",
    title: "Earthquakes"
  },
  {
    key: "CAR_SALES",
    title: "Car Sales"
  },
  {
    key: "COLLAGE",
    title: "Collage"
  },
  {
    key: "KELPER",
    title: "NASA Kelper"
  },
  {
    key: "BTC_GOLD",
    title: "2022MCM Problem C: Trading Strategies"
  },
  {
    key: "TITANIC",
    title: "Titanic"
  }
], dft = ({ commonStore: A }) => {
  const { tmpDataSource: e } = A, { t } = qe("translation", { keyPrefix: "DataSource.dialog.public" }), i = async (n) => {
    try {
      const o = await (await fetch(Eft[n.key])).json();
      A.updateTempSTDDS({
        dataSource: o.dataSource,
        rawFields: o.fields.map((g) => ({
          fid: g.fid,
          name: g.name,
          analyticType: g.analyticType,
          semanticType: g.semanticType,
          dataType: g.dataType || "?"
        })),
        name: n.title
      });
    } catch (o) {
      console.error("Error fetching public data:", o);
    }
  };
  return b.createElement(
    "div",
    null,
    b.createElement(Cm, { className: "h-48 overflow-auto mb-1", by: "key", onChange: i }, uft.map((n) => b.createElement(Cm.Option, { key: n.key, value: n, className: ({ active: o, checked: g }) => $a("flex focus:outline-none border ring-ring rounded items-center justify-between p-2 m-2 cursor-pointer hover:bg-accent hover:text-accent-foreground", o ? "ring-2 ring-offset-2" : "", g ? "bg-muted text-muted-foreground" : "") }, ({ checked: o }) => b.createElement(
      b.Fragment,
      null,
      b.createElement(Cm.Label, { as: "p" }, n.title),
      o && b.createElement(
        "div",
        { className: "shrink-0 text-primary" },
        b.createElement(EEe, { className: "w-5 h-5" })
      )
    )))),
    b.createElement(Re, { className: "my-1", disabled: e.length === 0, onClick: () => {
      A.commitTempDS();
    } }, t("submit")),
    b.createElement(ezA, { commonStore: A })
  );
}, hft = gt(dft), mft = (A) => {
  const { commonStore: e } = A, { t } = qe("translation", { keyPrefix: "DataSource" });
  return b.createElement(
    "div",
    { className: "text-sm" },
    b.createElement(
      "div",
      { className: "mt-4" },
      b.createElement(
        $F,
        { defaultValue: "file" },
        b.createElement(
          lG,
          null,
          b.createElement(CC, { value: "file" }, t("dialog.text_file_data")),
          b.createElement(CC, { value: "public" }, t("dialog.public_data"))
        ),
        b.createElement(
          k2,
          { value: "file" },
          b.createElement(Qft, { commonStore: e })
        ),
        b.createElement(
          k2,
          { value: "public" },
          b.createElement(hft, { commonStore: e })
        )
      )
    )
  );
}, pft = mft;
gt((A) => {
  const { commonStore: e, dataSources: t, onSelectId: i, selectedId: n, onLoad: o, onSave: g } = A, s = u.useRef(null), { t: I } = qe(), { showDSPanel: r } = e;
  return b.createElement(
    "div",
    { className: "font-sans gap-2 flex flex-wrap items-center m-4 p-4 border rounded-md" },
    A.onLoad && b.createElement(gft, { onImport: A.onLoad, fileRef: s }),
    b.createElement(
      "div",
      null,
      b.createElement(G2, { className: "text-xs !h-8", options: t.map((a) => ({ label: a.name, value: a.id })), selectedKey: n, onSelect: i, placeholder: I("DataSource.labels.cur_dataset") })
    ),
    b.createElement(Re, { size: "sm", onClick: () => {
      e.startDSBuildingTask();
    } }, I("DataSource.buttons.create_dataset")),
    g && b.createElement(Re, { size: "sm", variant: "outline", onClick: async () => {
      const a = await g();
      MBe(a, "graphic-walker-notebook.json");
    } }, I("DataSource.buttons.export_as_file")),
    A.onLoad && b.createElement(Re, { size: "sm", variant: "outline", onClick: () => {
      s.current && s.current.click();
    } }, I("DataSource.buttons.import_file")),
    b.createElement(
      ig,
      { onOpenChange: () => {
        e.setShowDSPanel(!1);
      }, open: r },
      b.createElement(
        So,
        null,
        b.createElement(
          PF,
          null,
          b.createElement(wgA, null, I("DataSource.dialog.create_data_source"))
        ),
        b.createElement(pft, { commonStore: e })
      )
    )
  );
});
u.createContext(null);
function be() {
  return be = Object.assign ? Object.assign.bind() : function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, be.apply(this, arguments);
}
function qt(A, e, { checkForDefaultPrevented: t = !0 } = {}) {
  return function(n) {
    if (A == null || A(n), t === !1 || !n.defaultPrevented)
      return e == null ? void 0 : e(n);
  };
}
function Ah(A, e = []) {
  let t = [];
  function i(o, g) {
    const s = /* @__PURE__ */ u.createContext(g), I = t.length;
    t = [
      ...t,
      g
    ];
    function r(C) {
      const { scope: B, children: l, ...Q } = C, E = (B == null ? void 0 : B[A][I]) || s, d = u.useMemo(
        () => Q,
        Object.values(Q)
      );
      return /* @__PURE__ */ u.createElement(E.Provider, {
        value: d
      }, l);
    }
    function a(C, B) {
      const l = (B == null ? void 0 : B[A][I]) || s, Q = u.useContext(l);
      if (Q)
        return Q;
      if (g !== void 0)
        return g;
      throw new Error(`\`${C}\` must be used within \`${o}\``);
    }
    return r.displayName = o + "Provider", [
      r,
      a
    ];
  }
  const n = () => {
    const o = t.map((g) => /* @__PURE__ */ u.createContext(g));
    return function(s) {
      const I = (s == null ? void 0 : s[A]) || o;
      return u.useMemo(
        () => ({
          [`__scope${A}`]: {
            ...s,
            [A]: I
          }
        }),
        [
          s,
          I
        ]
      );
    };
  };
  return n.scopeName = A, [
    i,
    yft(n, ...e)
  ];
}
function yft(...A) {
  const e = A[0];
  if (A.length === 1)
    return e;
  const t = () => {
    const i = A.map(
      (n) => ({
        useScope: n(),
        scopeName: n.scopeName
      })
    );
    return function(o) {
      const g = i.reduce((s, { useScope: I, scopeName: r }) => {
        const C = I(o)[`__scope${r}`];
        return {
          ...s,
          ...C
        };
      }, {});
      return u.useMemo(
        () => ({
          [`__scope${e.scopeName}`]: g
        }),
        [
          g
        ]
      );
    };
  };
  return t.scopeName = e.scopeName, t;
}
function bft(A, e) {
  typeof A == "function" ? A(e) : A != null && (A.current = e);
}
function tzA(...A) {
  return (e) => A.forEach(
    (t) => bft(t, e)
  );
}
function On(...A) {
  return u.useCallback(tzA(...A), A);
}
const vp = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { children: t, ...i } = A, n = u.Children.toArray(t), o = n.find(fft);
  if (o) {
    const g = o.props.children, s = n.map((I) => I === o ? u.Children.count(g) > 1 ? u.Children.only(null) : /* @__PURE__ */ u.isValidElement(g) ? g.props.children : null : I);
    return /* @__PURE__ */ u.createElement(B6, be({}, i, {
      ref: e
    }), /* @__PURE__ */ u.isValidElement(g) ? /* @__PURE__ */ u.cloneElement(g, void 0, s) : null);
  }
  return /* @__PURE__ */ u.createElement(B6, be({}, i, {
    ref: e
  }), t);
});
vp.displayName = "Slot";
const B6 = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { children: t, ...i } = A;
  return /* @__PURE__ */ u.isValidElement(t) ? /* @__PURE__ */ u.cloneElement(t, {
    ...Dft(i, t.props),
    ref: e ? tzA(e, t.ref) : t.ref
  }) : u.Children.count(t) > 1 ? u.Children.only(null) : null;
});
B6.displayName = "SlotClone";
const wft = ({ children: A }) => /* @__PURE__ */ u.createElement(u.Fragment, null, A);
function fft(A) {
  return /* @__PURE__ */ u.isValidElement(A) && A.type === wft;
}
function Dft(A, e) {
  const t = {
    ...e
  };
  for (const i in e) {
    const n = A[i], o = e[i];
    /^on[A-Z]/.test(i) ? n && o ? t[i] = (...s) => {
      o(...s), n(...s);
    } : n && (t[i] = n) : i === "style" ? t[i] = {
      ...n,
      ...o
    } : i === "className" && (t[i] = [
      n,
      o
    ].filter(Boolean).join(" "));
  }
  return {
    ...A,
    ...t
  };
}
function izA(A) {
  const e = A + "CollectionProvider", [t, i] = Ah(e), [n, o] = t(e, {
    collectionRef: {
      current: null
    },
    itemMap: /* @__PURE__ */ new Map()
  }), g = (l) => {
    const { scope: Q, children: E } = l, d = b.useRef(null), m = b.useRef(/* @__PURE__ */ new Map()).current;
    return /* @__PURE__ */ b.createElement(n, {
      scope: Q,
      itemMap: m,
      collectionRef: d
    }, E);
  }, s = A + "CollectionSlot", I = /* @__PURE__ */ b.forwardRef((l, Q) => {
    const { scope: E, children: d } = l, m = o(s, E), y = On(Q, m.collectionRef);
    return /* @__PURE__ */ b.createElement(vp, {
      ref: y
    }, d);
  }), r = A + "CollectionItemSlot", a = "data-radix-collection-item", C = /* @__PURE__ */ b.forwardRef((l, Q) => {
    const { scope: E, children: d, ...m } = l, y = b.useRef(null), f = On(Q, y), w = o(r, E);
    return b.useEffect(() => (w.itemMap.set(y, {
      ref: y,
      ...m
    }), () => void w.itemMap.delete(y))), /* @__PURE__ */ b.createElement(vp, {
      [a]: "",
      ref: f
    }, d);
  });
  function B(l) {
    const Q = o(A + "CollectionConsumer", l);
    return b.useCallback(() => {
      const d = Q.collectionRef.current;
      if (!d)
        return [];
      const m = Array.from(d.querySelectorAll(`[${a}]`));
      return Array.from(Q.itemMap.values()).sort(
        (w, G) => m.indexOf(w.ref.current) - m.indexOf(G.ref.current)
      );
    }, [
      Q.collectionRef,
      Q.itemMap
    ]);
  }
  return [
    {
      Provider: g,
      Slot: I,
      ItemSlot: C
    },
    B,
    i
  ];
}
const AI = Boolean(globalThis == null ? void 0 : globalThis.document) ? u.useLayoutEffect : () => {
}, Gft = y8["useId".toString()] || (() => {
});
let kft = 0;
function Km(A) {
  const [e, t] = u.useState(Gft());
  return AI(() => {
    A || t(
      (i) => i ?? String(kft++)
    );
  }, [
    A
  ]), A || (e ? `radix-${e}` : "");
}
const Jft = [
  "a",
  "button",
  "div",
  "form",
  "h2",
  "h3",
  "img",
  "input",
  "label",
  "li",
  "nav",
  "ol",
  "p",
  "span",
  "svg",
  "ul"
], ii = Jft.reduce((A, e) => {
  const t = /* @__PURE__ */ u.forwardRef((i, n) => {
    const { asChild: o, ...g } = i, s = o ? vp : e;
    return u.useEffect(() => {
      window[Symbol.for("radix-ui")] = !0;
    }, []), /* @__PURE__ */ u.createElement(s, be({}, g, {
      ref: n
    }));
  });
  return t.displayName = `Primitive.${e}`, {
    ...A,
    [e]: t
  };
}, {});
function Nft(A, e) {
  A && Jt.flushSync(
    () => A.dispatchEvent(e)
  );
}
function cl(A) {
  const e = u.useRef(A);
  return u.useEffect(() => {
    e.current = A;
  }), u.useMemo(
    () => (...t) => {
      var i;
      return (i = e.current) === null || i === void 0 ? void 0 : i.call(e, ...t);
    },
    []
  );
}
function yQ({ prop: A, defaultProp: e, onChange: t = () => {
} }) {
  const [i, n] = Yft({
    defaultProp: e,
    onChange: t
  }), o = A !== void 0, g = o ? A : i, s = cl(t), I = u.useCallback((r) => {
    if (o) {
      const C = typeof r == "function" ? r(A) : r;
      C !== A && s(C);
    } else
      n(r);
  }, [
    o,
    A,
    n,
    s
  ]);
  return [
    g,
    I
  ];
}
function Yft({ defaultProp: A, onChange: e }) {
  const t = u.useState(A), [i] = t, n = u.useRef(i), o = cl(e);
  return u.useEffect(() => {
    n.current !== i && (o(i), n.current = i);
  }, [
    i,
    n,
    o
  ]), t;
}
const Rft = /* @__PURE__ */ u.createContext(void 0);
function JX(A) {
  const e = u.useContext(Rft);
  return A || e || "ltr";
}
const E_ = "rovingFocusGroup.onEntryFocus", Fft = {
  bubbles: !1,
  cancelable: !0
}, ksA = "RovingFocusGroup", [l6, nzA, Mft] = izA(ksA), [xft, NX] = Ah(ksA, [
  Mft
]), [Lft, vft] = xft(ksA), Hft = /* @__PURE__ */ u.forwardRef((A, e) => /* @__PURE__ */ u.createElement(l6.Provider, {
  scope: A.__scopeRovingFocusGroup
}, /* @__PURE__ */ u.createElement(l6.Slot, {
  scope: A.__scopeRovingFocusGroup
}, /* @__PURE__ */ u.createElement(Sft, be({}, A, {
  ref: e
}))))), Sft = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeRovingFocusGroup: t, orientation: i, loop: n = !1, dir: o, currentTabStopId: g, defaultCurrentTabStopId: s, onCurrentTabStopIdChange: I, onEntryFocus: r, ...a } = A, C = u.useRef(null), B = On(e, C), l = JX(o), [Q = null, E] = yQ({
    prop: g,
    defaultProp: s,
    onChange: I
  }), [d, m] = u.useState(!1), y = cl(r), f = nzA(t), w = u.useRef(!1), [G, R] = u.useState(0);
  return u.useEffect(() => {
    const F = C.current;
    if (F)
      return F.addEventListener(E_, y), () => F.removeEventListener(E_, y);
  }, [
    y
  ]), /* @__PURE__ */ u.createElement(Lft, {
    scope: t,
    orientation: i,
    dir: l,
    loop: n,
    currentTabStopId: Q,
    onItemFocus: u.useCallback(
      (F) => E(F),
      [
        E
      ]
    ),
    onItemShiftTab: u.useCallback(
      () => m(!0),
      []
    ),
    onFocusableItemAdd: u.useCallback(
      () => R(
        (F) => F + 1
      ),
      []
    ),
    onFocusableItemRemove: u.useCallback(
      () => R(
        (F) => F - 1
      ),
      []
    )
  }, /* @__PURE__ */ u.createElement(ii.div, be({
    tabIndex: d || G === 0 ? -1 : 0,
    "data-orientation": i
  }, a, {
    ref: B,
    style: {
      outline: "none",
      ...A.style
    },
    onMouseDown: qt(A.onMouseDown, () => {
      w.current = !0;
    }),
    onFocus: qt(A.onFocus, (F) => {
      const Z = !w.current;
      if (F.target === F.currentTarget && Z && !d) {
        const c = new CustomEvent(E_, Fft);
        if (F.currentTarget.dispatchEvent(c), !c.defaultPrevented) {
          const J = f().filter(
            (U) => U.focusable
          ), p = J.find(
            (U) => U.active
          ), N = J.find(
            (U) => U.id === Q
          ), K = [
            p,
            N,
            ...J
          ].filter(Boolean).map(
            (U) => U.ref.current
          );
          ozA(K);
        }
      }
      w.current = !1;
    }),
    onBlur: qt(
      A.onBlur,
      () => m(!1)
    )
  })));
}), Zft = "RovingFocusGroupItem", Wft = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeRovingFocusGroup: t, focusable: i = !0, active: n = !1, tabStopId: o, ...g } = A, s = Km(), I = o || s, r = vft(Zft, t), a = r.currentTabStopId === I, C = nzA(t), { onFocusableItemAdd: B, onFocusableItemRemove: l } = r;
  return u.useEffect(() => {
    if (i)
      return B(), () => l();
  }, [
    i,
    B,
    l
  ]), /* @__PURE__ */ u.createElement(l6.ItemSlot, {
    scope: t,
    id: I,
    focusable: i,
    active: n
  }, /* @__PURE__ */ u.createElement(ii.span, be({
    tabIndex: a ? 0 : -1,
    "data-orientation": r.orientation
  }, g, {
    ref: e,
    onMouseDown: qt(A.onMouseDown, (Q) => {
      i ? r.onItemFocus(I) : Q.preventDefault();
    }),
    onFocus: qt(
      A.onFocus,
      () => r.onItemFocus(I)
    ),
    onKeyDown: qt(A.onKeyDown, (Q) => {
      if (Q.key === "Tab" && Q.shiftKey) {
        r.onItemShiftTab();
        return;
      }
      if (Q.target !== Q.currentTarget)
        return;
      const E = Vft(Q, r.orientation, r.dir);
      if (E !== void 0) {
        Q.preventDefault();
        let m = C().filter(
          (y) => y.focusable
        ).map(
          (y) => y.ref.current
        );
        if (E === "last")
          m.reverse();
        else if (E === "prev" || E === "next") {
          E === "prev" && m.reverse();
          const y = m.indexOf(Q.currentTarget);
          m = r.loop ? Xft(m, y + 1) : m.slice(y + 1);
        }
        setTimeout(
          () => ozA(m)
        );
      }
    })
  })));
}), Kft = {
  ArrowLeft: "prev",
  ArrowUp: "prev",
  ArrowRight: "next",
  ArrowDown: "next",
  PageUp: "first",
  Home: "first",
  PageDown: "last",
  End: "last"
};
function Uft(A, e) {
  return e !== "rtl" ? A : A === "ArrowLeft" ? "ArrowRight" : A === "ArrowRight" ? "ArrowLeft" : A;
}
function Vft(A, e, t) {
  const i = Uft(A.key, t);
  if (!(e === "vertical" && [
    "ArrowLeft",
    "ArrowRight"
  ].includes(i)) && !(e === "horizontal" && [
    "ArrowUp",
    "ArrowDown"
  ].includes(i)))
    return Kft[i];
}
function ozA(A) {
  const e = document.activeElement;
  for (const t of A)
    if (t === e || (t.focus(), document.activeElement !== e))
      return;
}
function Xft(A, e) {
  return A.map(
    (t, i) => A[(e + i) % A.length]
  );
}
const gzA = Hft, szA = Wft;
function zft(A, e) {
  return u.useReducer((t, i) => {
    const n = e[t][i];
    return n ?? t;
  }, A);
}
const fG = (A) => {
  const { present: e, children: t } = A, i = Tft(e), n = typeof t == "function" ? t({
    present: i.isPresent
  }) : u.Children.only(t), o = On(i.ref, n.ref);
  return typeof t == "function" || i.isPresent ? /* @__PURE__ */ u.cloneElement(n, {
    ref: o
  }) : null;
};
fG.displayName = "Presence";
function Tft(A) {
  const [e, t] = u.useState(), i = u.useRef({}), n = u.useRef(A), o = u.useRef("none"), g = A ? "mounted" : "unmounted", [s, I] = zft(g, {
    mounted: {
      UNMOUNT: "unmounted",
      ANIMATION_OUT: "unmountSuspended"
    },
    unmountSuspended: {
      MOUNT: "mounted",
      ANIMATION_END: "unmounted"
    },
    unmounted: {
      MOUNT: "mounted"
    }
  });
  return u.useEffect(() => {
    const r = Ox(i.current);
    o.current = s === "mounted" ? r : "none";
  }, [
    s
  ]), AI(() => {
    const r = i.current, a = n.current;
    if (a !== A) {
      const B = o.current, l = Ox(r);
      A ? I("MOUNT") : l === "none" || (r == null ? void 0 : r.display) === "none" ? I("UNMOUNT") : I(a && B !== l ? "ANIMATION_OUT" : "UNMOUNT"), n.current = A;
    }
  }, [
    A,
    I
  ]), AI(() => {
    if (e) {
      const r = (C) => {
        const l = Ox(i.current).includes(C.animationName);
        C.target === e && l && Jt.flushSync(
          () => I("ANIMATION_END")
        );
      }, a = (C) => {
        C.target === e && (o.current = Ox(i.current));
      };
      return e.addEventListener("animationstart", a), e.addEventListener("animationcancel", r), e.addEventListener("animationend", r), () => {
        e.removeEventListener("animationstart", a), e.removeEventListener("animationcancel", r), e.removeEventListener("animationend", r);
      };
    } else
      I("ANIMATION_END");
  }, [
    e,
    I
  ]), {
    isPresent: [
      "mounted",
      "unmountSuspended"
    ].includes(s),
    ref: u.useCallback((r) => {
      r && (i.current = getComputedStyle(r)), t(r);
    }, [])
  };
}
function Ox(A) {
  return (A == null ? void 0 : A.animationName) || "none";
}
const IzA = "Tabs", [_ft, XXt] = Ah(IzA, [
  NX
]), azA = NX(), [qft, JsA] = _ft(IzA), Oft = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTabs: t, value: i, onValueChange: n, defaultValue: o, orientation: g = "horizontal", dir: s, activationMode: I = "automatic", ...r } = A, a = JX(s), [C, B] = yQ({
    prop: i,
    onChange: n,
    defaultProp: o
  });
  return /* @__PURE__ */ u.createElement(qft, {
    scope: t,
    baseId: Km(),
    value: C,
    onValueChange: B,
    orientation: g,
    dir: a,
    activationMode: I
  }, /* @__PURE__ */ u.createElement(ii.div, be({
    dir: a,
    "data-orientation": g
  }, r, {
    ref: e
  })));
}), jft = "TabsList", Pft = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTabs: t, loop: i = !0, ...n } = A, o = JsA(jft, t), g = azA(t);
  return /* @__PURE__ */ u.createElement(gzA, be({
    asChild: !0
  }, g, {
    orientation: o.orientation,
    dir: o.dir,
    loop: i
  }), /* @__PURE__ */ u.createElement(ii.div, be({
    role: "tablist",
    "aria-orientation": o.orientation
  }, n, {
    ref: e
  })));
}), $ft = "TabsTrigger", ADt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTabs: t, value: i, disabled: n = !1, ...o } = A, g = JsA($ft, t), s = azA(t), I = rzA(g.baseId, i), r = CzA(g.baseId, i), a = i === g.value;
  return /* @__PURE__ */ u.createElement(szA, be({
    asChild: !0
  }, s, {
    focusable: !n,
    active: a
  }), /* @__PURE__ */ u.createElement(ii.button, be({
    type: "button",
    role: "tab",
    "aria-selected": a,
    "aria-controls": r,
    "data-state": a ? "active" : "inactive",
    "data-disabled": n ? "" : void 0,
    disabled: n,
    id: I
  }, o, {
    ref: e,
    onMouseDown: qt(A.onMouseDown, (C) => {
      !n && C.button === 0 && C.ctrlKey === !1 ? g.onValueChange(i) : C.preventDefault();
    }),
    onKeyDown: qt(A.onKeyDown, (C) => {
      [
        " ",
        "Enter"
      ].includes(C.key) && g.onValueChange(i);
    }),
    onFocus: qt(A.onFocus, () => {
      const C = g.activationMode !== "manual";
      !a && !n && C && g.onValueChange(i);
    })
  })));
}), eDt = "TabsContent", tDt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeTabs: t, value: i, forceMount: n, children: o, ...g } = A, s = JsA(eDt, t), I = rzA(s.baseId, i), r = CzA(s.baseId, i), a = i === s.value, C = u.useRef(a);
  return u.useEffect(() => {
    const B = requestAnimationFrame(
      () => C.current = !1
    );
    return () => cancelAnimationFrame(B);
  }, []), /* @__PURE__ */ u.createElement(
    fG,
    {
      present: n || a
    },
    ({ present: B }) => /* @__PURE__ */ u.createElement(ii.div, be({
      "data-state": a ? "active" : "inactive",
      "data-orientation": s.orientation,
      role: "tabpanel",
      "aria-labelledby": I,
      hidden: !B,
      id: r,
      tabIndex: 0
    }, g, {
      ref: e,
      style: {
        ...A.style,
        animationDuration: C.current ? "0s" : void 0
      }
    }), B && o)
  );
});
function rzA(A, e) {
  return `${A}-trigger-${e}`;
}
function CzA(A, e) {
  return `${A}-content-${e}`;
}
const iDt = Oft, BzA = Pft, lzA = ADt, czA = tDt;
function QzA(A) {
  var e, t, i = "";
  if (typeof A == "string" || typeof A == "number")
    i += A;
  else if (typeof A == "object")
    if (Array.isArray(A))
      for (e = 0; e < A.length; e++)
        A[e] && (t = QzA(A[e])) && (i && (i += " "), i += t);
    else
      for (e in A)
        A[e] && (i && (i += " "), i += e);
  return i;
}
function EzA() {
  for (var A, e, t = 0, i = ""; t < arguments.length; )
    (A = arguments[t++]) && (e = QzA(A)) && (i && (i += " "), i += e);
  return i;
}
function nDt() {
  for (var A = 0, e, t, i = ""; A < arguments.length; )
    (e = arguments[A++]) && (t = uzA(e)) && (i && (i += " "), i += t);
  return i;
}
function uzA(A) {
  if (typeof A == "string")
    return A;
  for (var e, t = "", i = 0; i < A.length; i++)
    A[i] && (e = uzA(A[i])) && (t && (t += " "), t += e);
  return t;
}
var NsA = "-";
function oDt(A) {
  var e = sDt(A), t = A.conflictingClassGroups, i = A.conflictingClassGroupModifiers, n = i === void 0 ? {} : i;
  function o(s) {
    var I = s.split(NsA);
    return I[0] === "" && I.length !== 1 && I.shift(), dzA(I, e) || gDt(s);
  }
  function g(s, I) {
    var r = t[s] || [];
    return I && n[s] ? [].concat(r, n[s]) : r;
  }
  return {
    getClassGroupId: o,
    getConflictingClassGroupIds: g
  };
}
function dzA(A, e) {
  var g;
  if (A.length === 0)
    return e.classGroupId;
  var t = A[0], i = e.nextPart.get(t), n = i ? dzA(A.slice(1), i) : void 0;
  if (n)
    return n;
  if (e.validators.length !== 0) {
    var o = A.join(NsA);
    return (g = e.validators.find(function(s) {
      var I = s.validator;
      return I(o);
    })) == null ? void 0 : g.classGroupId;
  }
}
var XyA = /^\[(.+)\]$/;
function gDt(A) {
  if (XyA.test(A)) {
    var e = XyA.exec(A)[1], t = e == null ? void 0 : e.substring(0, e.indexOf(":"));
    if (t)
      return "arbitrary.." + t;
  }
}
function sDt(A) {
  var e = A.theme, t = A.prefix, i = {
    nextPart: /* @__PURE__ */ new Map(),
    validators: []
  }, n = aDt(Object.entries(A.classGroups), t);
  return n.forEach(function(o) {
    var g = o[0], s = o[1];
    c6(s, i, g, e);
  }), i;
}
function c6(A, e, t, i) {
  A.forEach(function(n) {
    if (typeof n == "string") {
      var o = n === "" ? e : zyA(e, n);
      o.classGroupId = t;
      return;
    }
    if (typeof n == "function") {
      if (IDt(n)) {
        c6(n(i), e, t, i);
        return;
      }
      e.validators.push({
        validator: n,
        classGroupId: t
      });
      return;
    }
    Object.entries(n).forEach(function(g) {
      var s = g[0], I = g[1];
      c6(I, zyA(e, s), t, i);
    });
  });
}
function zyA(A, e) {
  var t = A;
  return e.split(NsA).forEach(function(i) {
    t.nextPart.has(i) || t.nextPart.set(i, {
      nextPart: /* @__PURE__ */ new Map(),
      validators: []
    }), t = t.nextPart.get(i);
  }), t;
}
function IDt(A) {
  return A.isThemeGetter;
}
function aDt(A, e) {
  return e ? A.map(function(t) {
    var i = t[0], n = t[1], o = n.map(function(g) {
      return typeof g == "string" ? e + g : typeof g == "object" ? Object.fromEntries(Object.entries(g).map(function(s) {
        var I = s[0], r = s[1];
        return [e + I, r];
      })) : g;
    });
    return [i, o];
  }) : A;
}
function rDt(A) {
  if (A < 1)
    return {
      get: function() {
      },
      set: function() {
      }
    };
  var e = 0, t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
  function n(o, g) {
    t.set(o, g), e++, e > A && (e = 0, i = t, t = /* @__PURE__ */ new Map());
  }
  return {
    get: function(g) {
      var s = t.get(g);
      if (s !== void 0)
        return s;
      if ((s = i.get(g)) !== void 0)
        return n(g, s), s;
    },
    set: function(g, s) {
      t.has(g) ? t.set(g, s) : n(g, s);
    }
  };
}
var hzA = "!";
function CDt(A) {
  var e = A.separator || ":", t = e.length === 1, i = e[0], n = e.length;
  return function(g) {
    for (var s = [], I = 0, r = 0, a, C = 0; C < g.length; C++) {
      var B = g[C];
      if (I === 0) {
        if (B === i && (t || g.slice(C, C + n) === e)) {
          s.push(g.slice(r, C)), r = C + n;
          continue;
        }
        if (B === "/") {
          a = C;
          continue;
        }
      }
      B === "[" ? I++ : B === "]" && I--;
    }
    var l = s.length === 0 ? g : g.substring(r), Q = l.startsWith(hzA), E = Q ? l.substring(1) : l, d = a && a > r ? a - r : void 0;
    return {
      modifiers: s,
      hasImportantModifier: Q,
      baseClassName: E,
      maybePostfixModifierPosition: d
    };
  };
}
function BDt(A) {
  if (A.length <= 1)
    return A;
  var e = [], t = [];
  return A.forEach(function(i) {
    var n = i[0] === "[";
    n ? (e.push.apply(e, t.sort().concat([i])), t = []) : t.push(i);
  }), e.push.apply(e, t.sort()), e;
}
function lDt(A) {
  return {
    cache: rDt(A.cacheSize),
    splitModifiers: CDt(A),
    ...oDt(A)
  };
}
var cDt = /\s+/;
function QDt(A, e) {
  var t = e.splitModifiers, i = e.getClassGroupId, n = e.getConflictingClassGroupIds, o = /* @__PURE__ */ new Set();
  return A.trim().split(cDt).map(function(g) {
    var s = t(g), I = s.modifiers, r = s.hasImportantModifier, a = s.baseClassName, C = s.maybePostfixModifierPosition, B = i(C ? a.substring(0, C) : a), l = Boolean(C);
    if (!B) {
      if (!C)
        return {
          isTailwindClass: !1,
          originalClassName: g
        };
      if (B = i(a), !B)
        return {
          isTailwindClass: !1,
          originalClassName: g
        };
      l = !1;
    }
    var Q = BDt(I).join(":"), E = r ? Q + hzA : Q;
    return {
      isTailwindClass: !0,
      modifierId: E,
      classGroupId: B,
      originalClassName: g,
      hasPostfixModifier: l
    };
  }).reverse().filter(function(g) {
    if (!g.isTailwindClass)
      return !0;
    var s = g.modifierId, I = g.classGroupId, r = g.hasPostfixModifier, a = s + I;
    return o.has(a) ? !1 : (o.add(a), n(I, r).forEach(function(C) {
      return o.add(s + C);
    }), !0);
  }).reverse().map(function(g) {
    return g.originalClassName;
  }).join(" ");
}
function EDt() {
  for (var A = arguments.length, e = new Array(A), t = 0; t < A; t++)
    e[t] = arguments[t];
  var i, n, o, g = s;
  function s(r) {
    var a = e[0], C = e.slice(1), B = C.reduce(function(l, Q) {
      return Q(l);
    }, a());
    return i = lDt(B), n = i.cache.get, o = i.cache.set, g = I, I(r);
  }
  function I(r) {
    var a = n(r);
    if (a)
      return a;
    var C = QDt(r, i);
    return o(r, C), C;
  }
  return function() {
    return g(nDt.apply(null, arguments));
  };
}
function An(A) {
  var e = function(i) {
    return i[A] || [];
  };
  return e.isThemeGetter = !0, e;
}
var mzA = /^\[(?:([a-z-]+):)?(.+)\]$/i, uDt = /^\d+\/\d+$/, dDt = /* @__PURE__ */ new Set(["px", "full", "screen"]), hDt = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, mDt = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, pDt = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
function Dr(A) {
  return um(A) || dDt.has(A) || uDt.test(A) || Q6(A);
}
function Q6(A) {
  return G0(A, "length", GDt);
}
function yDt(A) {
  return G0(A, "size", pzA);
}
function bDt(A) {
  return G0(A, "position", pzA);
}
function wDt(A) {
  return G0(A, "url", kDt);
}
function jx(A) {
  return G0(A, "number", um);
}
function um(A) {
  return !Number.isNaN(Number(A));
}
function fDt(A) {
  return A.endsWith("%") && um(A.slice(0, -1));
}
function tJ(A) {
  return TyA(A) || G0(A, "number", TyA);
}
function Lt(A) {
  return mzA.test(A);
}
function iJ() {
  return !0;
}
function dE(A) {
  return hDt.test(A);
}
function DDt(A) {
  return G0(A, "", JDt);
}
function G0(A, e, t) {
  var i = mzA.exec(A);
  return i ? i[1] ? i[1] === e : t(i[2]) : !1;
}
function GDt(A) {
  return mDt.test(A);
}
function pzA() {
  return !1;
}
function kDt(A) {
  return A.startsWith("url(");
}
function TyA(A) {
  return Number.isInteger(Number(A));
}
function JDt(A) {
  return pDt.test(A);
}
function NDt() {
  var A = An("colors"), e = An("spacing"), t = An("blur"), i = An("brightness"), n = An("borderColor"), o = An("borderRadius"), g = An("borderSpacing"), s = An("borderWidth"), I = An("contrast"), r = An("grayscale"), a = An("hueRotate"), C = An("invert"), B = An("gap"), l = An("gradientColorStops"), Q = An("gradientColorStopPositions"), E = An("inset"), d = An("margin"), m = An("opacity"), y = An("padding"), f = An("saturate"), w = An("scale"), G = An("sepia"), R = An("skew"), F = An("space"), Z = An("translate"), c = function() {
    return ["auto", "contain", "none"];
  }, J = function() {
    return ["auto", "hidden", "clip", "visible", "scroll"];
  }, p = function() {
    return ["auto", Lt, e];
  }, N = function() {
    return [Lt, e];
  }, v = function() {
    return ["", Dr];
  }, K = function() {
    return ["auto", um, Lt];
  }, U = function() {
    return ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"];
  }, j = function() {
    return ["solid", "dashed", "dotted", "double", "none"];
  }, q = function() {
    return ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity", "plus-lighter"];
  }, O = function() {
    return ["start", "end", "center", "between", "around", "evenly", "stretch"];
  }, $ = function() {
    return ["", "0", Lt];
  }, _ = function() {
    return ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
  }, tA = function() {
    return [um, jx];
  }, nA = function() {
    return [um, Lt];
  };
  return {
    cacheSize: 500,
    theme: {
      colors: [iJ],
      spacing: [Dr],
      blur: ["none", "", dE, Lt],
      brightness: tA(),
      borderColor: [A],
      borderRadius: ["none", "", "full", dE, Lt],
      borderSpacing: N(),
      borderWidth: v(),
      contrast: tA(),
      grayscale: $(),
      hueRotate: nA(),
      invert: $(),
      gap: N(),
      gradientColorStops: [A],
      gradientColorStopPositions: [fDt, Q6],
      inset: p(),
      margin: p(),
      opacity: tA(),
      padding: N(),
      saturate: tA(),
      scale: tA(),
      sepia: $(),
      skew: nA(),
      space: N(),
      translate: N()
    },
    classGroups: {
      // Layout
      /**
       * Aspect Ratio
       * @see https://tailwindcss.com/docs/aspect-ratio
       */
      aspect: [{
        aspect: ["auto", "square", "video", Lt]
      }],
      /**
       * Container
       * @see https://tailwindcss.com/docs/container
       */
      container: ["container"],
      /**
       * Columns
       * @see https://tailwindcss.com/docs/columns
       */
      columns: [{
        columns: [dE]
      }],
      /**
       * Break After
       * @see https://tailwindcss.com/docs/break-after
       */
      "break-after": [{
        "break-after": _()
      }],
      /**
       * Break Before
       * @see https://tailwindcss.com/docs/break-before
       */
      "break-before": [{
        "break-before": _()
      }],
      /**
       * Break Inside
       * @see https://tailwindcss.com/docs/break-inside
       */
      "break-inside": [{
        "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
      }],
      /**
       * Box Decoration Break
       * @see https://tailwindcss.com/docs/box-decoration-break
       */
      "box-decoration": [{
        "box-decoration": ["slice", "clone"]
      }],
      /**
       * Box Sizing
       * @see https://tailwindcss.com/docs/box-sizing
       */
      box: [{
        box: ["border", "content"]
      }],
      /**
       * Display
       * @see https://tailwindcss.com/docs/display
       */
      display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
      /**
       * Floats
       * @see https://tailwindcss.com/docs/float
       */
      float: [{
        float: ["right", "left", "none"]
      }],
      /**
       * Clear
       * @see https://tailwindcss.com/docs/clear
       */
      clear: [{
        clear: ["left", "right", "both", "none"]
      }],
      /**
       * Isolation
       * @see https://tailwindcss.com/docs/isolation
       */
      isolation: ["isolate", "isolation-auto"],
      /**
       * Object Fit
       * @see https://tailwindcss.com/docs/object-fit
       */
      "object-fit": [{
        object: ["contain", "cover", "fill", "none", "scale-down"]
      }],
      /**
       * Object Position
       * @see https://tailwindcss.com/docs/object-position
       */
      "object-position": [{
        object: [].concat(U(), [Lt])
      }],
      /**
       * Overflow
       * @see https://tailwindcss.com/docs/overflow
       */
      overflow: [{
        overflow: J()
      }],
      /**
       * Overflow X
       * @see https://tailwindcss.com/docs/overflow
       */
      "overflow-x": [{
        "overflow-x": J()
      }],
      /**
       * Overflow Y
       * @see https://tailwindcss.com/docs/overflow
       */
      "overflow-y": [{
        "overflow-y": J()
      }],
      /**
       * Overscroll Behavior
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      overscroll: [{
        overscroll: c()
      }],
      /**
       * Overscroll Behavior X
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      "overscroll-x": [{
        "overscroll-x": c()
      }],
      /**
       * Overscroll Behavior Y
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      "overscroll-y": [{
        "overscroll-y": c()
      }],
      /**
       * Position
       * @see https://tailwindcss.com/docs/position
       */
      position: ["static", "fixed", "absolute", "relative", "sticky"],
      /**
       * Top / Right / Bottom / Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      inset: [{
        inset: [E]
      }],
      /**
       * Right / Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      "inset-x": [{
        "inset-x": [E]
      }],
      /**
       * Top / Bottom
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      "inset-y": [{
        "inset-y": [E]
      }],
      /**
       * Start
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      start: [{
        start: [E]
      }],
      /**
       * End
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      end: [{
        end: [E]
      }],
      /**
       * Top
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      top: [{
        top: [E]
      }],
      /**
       * Right
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      right: [{
        right: [E]
      }],
      /**
       * Bottom
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      bottom: [{
        bottom: [E]
      }],
      /**
       * Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      left: [{
        left: [E]
      }],
      /**
       * Visibility
       * @see https://tailwindcss.com/docs/visibility
       */
      visibility: ["visible", "invisible", "collapse"],
      /**
       * Z-Index
       * @see https://tailwindcss.com/docs/z-index
       */
      z: [{
        z: ["auto", tJ]
      }],
      // Flexbox and Grid
      /**
       * Flex Basis
       * @see https://tailwindcss.com/docs/flex-basis
       */
      basis: [{
        basis: p()
      }],
      /**
       * Flex Direction
       * @see https://tailwindcss.com/docs/flex-direction
       */
      "flex-direction": [{
        flex: ["row", "row-reverse", "col", "col-reverse"]
      }],
      /**
       * Flex Wrap
       * @see https://tailwindcss.com/docs/flex-wrap
       */
      "flex-wrap": [{
        flex: ["wrap", "wrap-reverse", "nowrap"]
      }],
      /**
       * Flex
       * @see https://tailwindcss.com/docs/flex
       */
      flex: [{
        flex: ["1", "auto", "initial", "none", Lt]
      }],
      /**
       * Flex Grow
       * @see https://tailwindcss.com/docs/flex-grow
       */
      grow: [{
        grow: $()
      }],
      /**
       * Flex Shrink
       * @see https://tailwindcss.com/docs/flex-shrink
       */
      shrink: [{
        shrink: $()
      }],
      /**
       * Order
       * @see https://tailwindcss.com/docs/order
       */
      order: [{
        order: ["first", "last", "none", tJ]
      }],
      /**
       * Grid Template Columns
       * @see https://tailwindcss.com/docs/grid-template-columns
       */
      "grid-cols": [{
        "grid-cols": [iJ]
      }],
      /**
       * Grid Column Start / End
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-start-end": [{
        col: ["auto", {
          span: ["full", tJ]
        }, Lt]
      }],
      /**
       * Grid Column Start
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-start": [{
        "col-start": K()
      }],
      /**
       * Grid Column End
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-end": [{
        "col-end": K()
      }],
      /**
       * Grid Template Rows
       * @see https://tailwindcss.com/docs/grid-template-rows
       */
      "grid-rows": [{
        "grid-rows": [iJ]
      }],
      /**
       * Grid Row Start / End
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-start-end": [{
        row: ["auto", {
          span: [tJ]
        }, Lt]
      }],
      /**
       * Grid Row Start
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-start": [{
        "row-start": K()
      }],
      /**
       * Grid Row End
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-end": [{
        "row-end": K()
      }],
      /**
       * Grid Auto Flow
       * @see https://tailwindcss.com/docs/grid-auto-flow
       */
      "grid-flow": [{
        "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
      }],
      /**
       * Grid Auto Columns
       * @see https://tailwindcss.com/docs/grid-auto-columns
       */
      "auto-cols": [{
        "auto-cols": ["auto", "min", "max", "fr", Lt]
      }],
      /**
       * Grid Auto Rows
       * @see https://tailwindcss.com/docs/grid-auto-rows
       */
      "auto-rows": [{
        "auto-rows": ["auto", "min", "max", "fr", Lt]
      }],
      /**
       * Gap
       * @see https://tailwindcss.com/docs/gap
       */
      gap: [{
        gap: [B]
      }],
      /**
       * Gap X
       * @see https://tailwindcss.com/docs/gap
       */
      "gap-x": [{
        "gap-x": [B]
      }],
      /**
       * Gap Y
       * @see https://tailwindcss.com/docs/gap
       */
      "gap-y": [{
        "gap-y": [B]
      }],
      /**
       * Justify Content
       * @see https://tailwindcss.com/docs/justify-content
       */
      "justify-content": [{
        justify: ["normal"].concat(O())
      }],
      /**
       * Justify Items
       * @see https://tailwindcss.com/docs/justify-items
       */
      "justify-items": [{
        "justify-items": ["start", "end", "center", "stretch"]
      }],
      /**
       * Justify Self
       * @see https://tailwindcss.com/docs/justify-self
       */
      "justify-self": [{
        "justify-self": ["auto", "start", "end", "center", "stretch"]
      }],
      /**
       * Align Content
       * @see https://tailwindcss.com/docs/align-content
       */
      "align-content": [{
        content: ["normal"].concat(O(), ["baseline"])
      }],
      /**
       * Align Items
       * @see https://tailwindcss.com/docs/align-items
       */
      "align-items": [{
        items: ["start", "end", "center", "baseline", "stretch"]
      }],
      /**
       * Align Self
       * @see https://tailwindcss.com/docs/align-self
       */
      "align-self": [{
        self: ["auto", "start", "end", "center", "stretch", "baseline"]
      }],
      /**
       * Place Content
       * @see https://tailwindcss.com/docs/place-content
       */
      "place-content": [{
        "place-content": [].concat(O(), ["baseline"])
      }],
      /**
       * Place Items
       * @see https://tailwindcss.com/docs/place-items
       */
      "place-items": [{
        "place-items": ["start", "end", "center", "baseline", "stretch"]
      }],
      /**
       * Place Self
       * @see https://tailwindcss.com/docs/place-self
       */
      "place-self": [{
        "place-self": ["auto", "start", "end", "center", "stretch"]
      }],
      // Spacing
      /**
       * Padding
       * @see https://tailwindcss.com/docs/padding
       */
      p: [{
        p: [y]
      }],
      /**
       * Padding X
       * @see https://tailwindcss.com/docs/padding
       */
      px: [{
        px: [y]
      }],
      /**
       * Padding Y
       * @see https://tailwindcss.com/docs/padding
       */
      py: [{
        py: [y]
      }],
      /**
       * Padding Start
       * @see https://tailwindcss.com/docs/padding
       */
      ps: [{
        ps: [y]
      }],
      /**
       * Padding End
       * @see https://tailwindcss.com/docs/padding
       */
      pe: [{
        pe: [y]
      }],
      /**
       * Padding Top
       * @see https://tailwindcss.com/docs/padding
       */
      pt: [{
        pt: [y]
      }],
      /**
       * Padding Right
       * @see https://tailwindcss.com/docs/padding
       */
      pr: [{
        pr: [y]
      }],
      /**
       * Padding Bottom
       * @see https://tailwindcss.com/docs/padding
       */
      pb: [{
        pb: [y]
      }],
      /**
       * Padding Left
       * @see https://tailwindcss.com/docs/padding
       */
      pl: [{
        pl: [y]
      }],
      /**
       * Margin
       * @see https://tailwindcss.com/docs/margin
       */
      m: [{
        m: [d]
      }],
      /**
       * Margin X
       * @see https://tailwindcss.com/docs/margin
       */
      mx: [{
        mx: [d]
      }],
      /**
       * Margin Y
       * @see https://tailwindcss.com/docs/margin
       */
      my: [{
        my: [d]
      }],
      /**
       * Margin Start
       * @see https://tailwindcss.com/docs/margin
       */
      ms: [{
        ms: [d]
      }],
      /**
       * Margin End
       * @see https://tailwindcss.com/docs/margin
       */
      me: [{
        me: [d]
      }],
      /**
       * Margin Top
       * @see https://tailwindcss.com/docs/margin
       */
      mt: [{
        mt: [d]
      }],
      /**
       * Margin Right
       * @see https://tailwindcss.com/docs/margin
       */
      mr: [{
        mr: [d]
      }],
      /**
       * Margin Bottom
       * @see https://tailwindcss.com/docs/margin
       */
      mb: [{
        mb: [d]
      }],
      /**
       * Margin Left
       * @see https://tailwindcss.com/docs/margin
       */
      ml: [{
        ml: [d]
      }],
      /**
       * Space Between X
       * @see https://tailwindcss.com/docs/space
       */
      "space-x": [{
        "space-x": [F]
      }],
      /**
       * Space Between X Reverse
       * @see https://tailwindcss.com/docs/space
       */
      "space-x-reverse": ["space-x-reverse"],
      /**
       * Space Between Y
       * @see https://tailwindcss.com/docs/space
       */
      "space-y": [{
        "space-y": [F]
      }],
      /**
       * Space Between Y Reverse
       * @see https://tailwindcss.com/docs/space
       */
      "space-y-reverse": ["space-y-reverse"],
      // Sizing
      /**
       * Width
       * @see https://tailwindcss.com/docs/width
       */
      w: [{
        w: ["auto", "min", "max", "fit", Lt, e]
      }],
      /**
       * Min-Width
       * @see https://tailwindcss.com/docs/min-width
       */
      "min-w": [{
        "min-w": ["min", "max", "fit", Lt, Dr]
      }],
      /**
       * Max-Width
       * @see https://tailwindcss.com/docs/max-width
       */
      "max-w": [{
        "max-w": ["0", "none", "full", "min", "max", "fit", "prose", {
          screen: [dE]
        }, dE, Lt]
      }],
      /**
       * Height
       * @see https://tailwindcss.com/docs/height
       */
      h: [{
        h: [Lt, e, "auto", "min", "max", "fit"]
      }],
      /**
       * Min-Height
       * @see https://tailwindcss.com/docs/min-height
       */
      "min-h": [{
        "min-h": ["min", "max", "fit", Lt, Dr]
      }],
      /**
       * Max-Height
       * @see https://tailwindcss.com/docs/max-height
       */
      "max-h": [{
        "max-h": [Lt, e, "min", "max", "fit"]
      }],
      // Typography
      /**
       * Font Size
       * @see https://tailwindcss.com/docs/font-size
       */
      "font-size": [{
        text: ["base", dE, Q6]
      }],
      /**
       * Font Smoothing
       * @see https://tailwindcss.com/docs/font-smoothing
       */
      "font-smoothing": ["antialiased", "subpixel-antialiased"],
      /**
       * Font Style
       * @see https://tailwindcss.com/docs/font-style
       */
      "font-style": ["italic", "not-italic"],
      /**
       * Font Weight
       * @see https://tailwindcss.com/docs/font-weight
       */
      "font-weight": [{
        font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", jx]
      }],
      /**
       * Font Family
       * @see https://tailwindcss.com/docs/font-family
       */
      "font-family": [{
        font: [iJ]
      }],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-normal": ["normal-nums"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-ordinal": ["ordinal"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-slashed-zero": ["slashed-zero"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-figure": ["lining-nums", "oldstyle-nums"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-spacing": ["proportional-nums", "tabular-nums"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-fraction": ["diagonal-fractions", "stacked-fractons"],
      /**
       * Letter Spacing
       * @see https://tailwindcss.com/docs/letter-spacing
       */
      tracking: [{
        tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", Lt]
      }],
      /**
       * Line Clamp
       * @see https://tailwindcss.com/docs/line-clamp
       */
      "line-clamp": [{
        "line-clamp": ["none", um, jx]
      }],
      /**
       * Line Height
       * @see https://tailwindcss.com/docs/line-height
       */
      leading: [{
        leading: ["none", "tight", "snug", "normal", "relaxed", "loose", Lt, Dr]
      }],
      /**
       * List Style Image
       * @see https://tailwindcss.com/docs/list-style-image
       */
      "list-image": [{
        "list-image": ["none", Lt]
      }],
      /**
       * List Style Type
       * @see https://tailwindcss.com/docs/list-style-type
       */
      "list-style-type": [{
        list: ["none", "disc", "decimal", Lt]
      }],
      /**
       * List Style Position
       * @see https://tailwindcss.com/docs/list-style-position
       */
      "list-style-position": [{
        list: ["inside", "outside"]
      }],
      /**
       * Placeholder Color
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/placeholder-color
       */
      "placeholder-color": [{
        placeholder: [A]
      }],
      /**
       * Placeholder Opacity
       * @see https://tailwindcss.com/docs/placeholder-opacity
       */
      "placeholder-opacity": [{
        "placeholder-opacity": [m]
      }],
      /**
       * Text Alignment
       * @see https://tailwindcss.com/docs/text-align
       */
      "text-alignment": [{
        text: ["left", "center", "right", "justify", "start", "end"]
      }],
      /**
       * Text Color
       * @see https://tailwindcss.com/docs/text-color
       */
      "text-color": [{
        text: [A]
      }],
      /**
       * Text Opacity
       * @see https://tailwindcss.com/docs/text-opacity
       */
      "text-opacity": [{
        "text-opacity": [m]
      }],
      /**
       * Text Decoration
       * @see https://tailwindcss.com/docs/text-decoration
       */
      "text-decoration": ["underline", "overline", "line-through", "no-underline"],
      /**
       * Text Decoration Style
       * @see https://tailwindcss.com/docs/text-decoration-style
       */
      "text-decoration-style": [{
        decoration: [].concat(j(), ["wavy"])
      }],
      /**
       * Text Decoration Thickness
       * @see https://tailwindcss.com/docs/text-decoration-thickness
       */
      "text-decoration-thickness": [{
        decoration: ["auto", "from-font", Dr]
      }],
      /**
       * Text Underline Offset
       * @see https://tailwindcss.com/docs/text-underline-offset
       */
      "underline-offset": [{
        "underline-offset": ["auto", Lt, Dr]
      }],
      /**
       * Text Decoration Color
       * @see https://tailwindcss.com/docs/text-decoration-color
       */
      "text-decoration-color": [{
        decoration: [A]
      }],
      /**
       * Text Transform
       * @see https://tailwindcss.com/docs/text-transform
       */
      "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
      /**
       * Text Overflow
       * @see https://tailwindcss.com/docs/text-overflow
       */
      "text-overflow": ["truncate", "text-ellipsis", "text-clip"],
      /**
       * Text Indent
       * @see https://tailwindcss.com/docs/text-indent
       */
      indent: [{
        indent: N()
      }],
      /**
       * Vertical Alignment
       * @see https://tailwindcss.com/docs/vertical-align
       */
      "vertical-align": [{
        align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", Lt]
      }],
      /**
       * Whitespace
       * @see https://tailwindcss.com/docs/whitespace
       */
      whitespace: [{
        whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
      }],
      /**
       * Word Break
       * @see https://tailwindcss.com/docs/word-break
       */
      break: [{
        break: ["normal", "words", "all", "keep"]
      }],
      /**
       * Hyphens
       * @see https://tailwindcss.com/docs/hyphens
       */
      hyphens: [{
        hyphens: ["none", "manual", "auto"]
      }],
      /**
       * Content
       * @see https://tailwindcss.com/docs/content
       */
      content: [{
        content: ["none", Lt]
      }],
      // Backgrounds
      /**
       * Background Attachment
       * @see https://tailwindcss.com/docs/background-attachment
       */
      "bg-attachment": [{
        bg: ["fixed", "local", "scroll"]
      }],
      /**
       * Background Clip
       * @see https://tailwindcss.com/docs/background-clip
       */
      "bg-clip": [{
        "bg-clip": ["border", "padding", "content", "text"]
      }],
      /**
       * Background Opacity
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/background-opacity
       */
      "bg-opacity": [{
        "bg-opacity": [m]
      }],
      /**
       * Background Origin
       * @see https://tailwindcss.com/docs/background-origin
       */
      "bg-origin": [{
        "bg-origin": ["border", "padding", "content"]
      }],
      /**
       * Background Position
       * @see https://tailwindcss.com/docs/background-position
       */
      "bg-position": [{
        bg: [].concat(U(), [bDt])
      }],
      /**
       * Background Repeat
       * @see https://tailwindcss.com/docs/background-repeat
       */
      "bg-repeat": [{
        bg: ["no-repeat", {
          repeat: ["", "x", "y", "round", "space"]
        }]
      }],
      /**
       * Background Size
       * @see https://tailwindcss.com/docs/background-size
       */
      "bg-size": [{
        bg: ["auto", "cover", "contain", yDt]
      }],
      /**
       * Background Image
       * @see https://tailwindcss.com/docs/background-image
       */
      "bg-image": [{
        bg: ["none", {
          "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
        }, wDt]
      }],
      /**
       * Background Color
       * @see https://tailwindcss.com/docs/background-color
       */
      "bg-color": [{
        bg: [A]
      }],
      /**
       * Gradient Color Stops From Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-from-pos": [{
        from: [Q]
      }],
      /**
       * Gradient Color Stops Via Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-via-pos": [{
        via: [Q]
      }],
      /**
       * Gradient Color Stops To Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-to-pos": [{
        to: [Q]
      }],
      /**
       * Gradient Color Stops From
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-from": [{
        from: [l]
      }],
      /**
       * Gradient Color Stops Via
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-via": [{
        via: [l]
      }],
      /**
       * Gradient Color Stops To
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-to": [{
        to: [l]
      }],
      // Borders
      /**
       * Border Radius
       * @see https://tailwindcss.com/docs/border-radius
       */
      rounded: [{
        rounded: [o]
      }],
      /**
       * Border Radius Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-s": [{
        "rounded-s": [o]
      }],
      /**
       * Border Radius End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-e": [{
        "rounded-e": [o]
      }],
      /**
       * Border Radius Top
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-t": [{
        "rounded-t": [o]
      }],
      /**
       * Border Radius Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-r": [{
        "rounded-r": [o]
      }],
      /**
       * Border Radius Bottom
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-b": [{
        "rounded-b": [o]
      }],
      /**
       * Border Radius Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-l": [{
        "rounded-l": [o]
      }],
      /**
       * Border Radius Start Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-ss": [{
        "rounded-ss": [o]
      }],
      /**
       * Border Radius Start End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-se": [{
        "rounded-se": [o]
      }],
      /**
       * Border Radius End End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-ee": [{
        "rounded-ee": [o]
      }],
      /**
       * Border Radius End Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-es": [{
        "rounded-es": [o]
      }],
      /**
       * Border Radius Top Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-tl": [{
        "rounded-tl": [o]
      }],
      /**
       * Border Radius Top Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-tr": [{
        "rounded-tr": [o]
      }],
      /**
       * Border Radius Bottom Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-br": [{
        "rounded-br": [o]
      }],
      /**
       * Border Radius Bottom Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-bl": [{
        "rounded-bl": [o]
      }],
      /**
       * Border Width
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w": [{
        border: [s]
      }],
      /**
       * Border Width X
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-x": [{
        "border-x": [s]
      }],
      /**
       * Border Width Y
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-y": [{
        "border-y": [s]
      }],
      /**
       * Border Width Start
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-s": [{
        "border-s": [s]
      }],
      /**
       * Border Width End
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-e": [{
        "border-e": [s]
      }],
      /**
       * Border Width Top
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-t": [{
        "border-t": [s]
      }],
      /**
       * Border Width Right
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-r": [{
        "border-r": [s]
      }],
      /**
       * Border Width Bottom
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-b": [{
        "border-b": [s]
      }],
      /**
       * Border Width Left
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-l": [{
        "border-l": [s]
      }],
      /**
       * Border Opacity
       * @see https://tailwindcss.com/docs/border-opacity
       */
      "border-opacity": [{
        "border-opacity": [m]
      }],
      /**
       * Border Style
       * @see https://tailwindcss.com/docs/border-style
       */
      "border-style": [{
        border: [].concat(j(), ["hidden"])
      }],
      /**
       * Divide Width X
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-x": [{
        "divide-x": [s]
      }],
      /**
       * Divide Width X Reverse
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-x-reverse": ["divide-x-reverse"],
      /**
       * Divide Width Y
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-y": [{
        "divide-y": [s]
      }],
      /**
       * Divide Width Y Reverse
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-y-reverse": ["divide-y-reverse"],
      /**
       * Divide Opacity
       * @see https://tailwindcss.com/docs/divide-opacity
       */
      "divide-opacity": [{
        "divide-opacity": [m]
      }],
      /**
       * Divide Style
       * @see https://tailwindcss.com/docs/divide-style
       */
      "divide-style": [{
        divide: j()
      }],
      /**
       * Border Color
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color": [{
        border: [n]
      }],
      /**
       * Border Color X
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-x": [{
        "border-x": [n]
      }],
      /**
       * Border Color Y
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-y": [{
        "border-y": [n]
      }],
      /**
       * Border Color Top
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-t": [{
        "border-t": [n]
      }],
      /**
       * Border Color Right
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-r": [{
        "border-r": [n]
      }],
      /**
       * Border Color Bottom
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-b": [{
        "border-b": [n]
      }],
      /**
       * Border Color Left
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-l": [{
        "border-l": [n]
      }],
      /**
       * Divide Color
       * @see https://tailwindcss.com/docs/divide-color
       */
      "divide-color": [{
        divide: [n]
      }],
      /**
       * Outline Style
       * @see https://tailwindcss.com/docs/outline-style
       */
      "outline-style": [{
        outline: [""].concat(j())
      }],
      /**
       * Outline Offset
       * @see https://tailwindcss.com/docs/outline-offset
       */
      "outline-offset": [{
        "outline-offset": [Lt, Dr]
      }],
      /**
       * Outline Width
       * @see https://tailwindcss.com/docs/outline-width
       */
      "outline-w": [{
        outline: [Dr]
      }],
      /**
       * Outline Color
       * @see https://tailwindcss.com/docs/outline-color
       */
      "outline-color": [{
        outline: [A]
      }],
      /**
       * Ring Width
       * @see https://tailwindcss.com/docs/ring-width
       */
      "ring-w": [{
        ring: v()
      }],
      /**
       * Ring Width Inset
       * @see https://tailwindcss.com/docs/ring-width
       */
      "ring-w-inset": ["ring-inset"],
      /**
       * Ring Color
       * @see https://tailwindcss.com/docs/ring-color
       */
      "ring-color": [{
        ring: [A]
      }],
      /**
       * Ring Opacity
       * @see https://tailwindcss.com/docs/ring-opacity
       */
      "ring-opacity": [{
        "ring-opacity": [m]
      }],
      /**
       * Ring Offset Width
       * @see https://tailwindcss.com/docs/ring-offset-width
       */
      "ring-offset-w": [{
        "ring-offset": [Dr]
      }],
      /**
       * Ring Offset Color
       * @see https://tailwindcss.com/docs/ring-offset-color
       */
      "ring-offset-color": [{
        "ring-offset": [A]
      }],
      // Effects
      /**
       * Box Shadow
       * @see https://tailwindcss.com/docs/box-shadow
       */
      shadow: [{
        shadow: ["", "inner", "none", dE, DDt]
      }],
      /**
       * Box Shadow Color
       * @see https://tailwindcss.com/docs/box-shadow-color
       */
      "shadow-color": [{
        shadow: [iJ]
      }],
      /**
       * Opacity
       * @see https://tailwindcss.com/docs/opacity
       */
      opacity: [{
        opacity: [m]
      }],
      /**
       * Mix Blend Mode
       * @see https://tailwindcss.com/docs/mix-blend-mode
       */
      "mix-blend": [{
        "mix-blend": q()
      }],
      /**
       * Background Blend Mode
       * @see https://tailwindcss.com/docs/background-blend-mode
       */
      "bg-blend": [{
        "bg-blend": q()
      }],
      // Filters
      /**
       * Filter
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/filter
       */
      filter: [{
        filter: ["", "none"]
      }],
      /**
       * Blur
       * @see https://tailwindcss.com/docs/blur
       */
      blur: [{
        blur: [t]
      }],
      /**
       * Brightness
       * @see https://tailwindcss.com/docs/brightness
       */
      brightness: [{
        brightness: [i]
      }],
      /**
       * Contrast
       * @see https://tailwindcss.com/docs/contrast
       */
      contrast: [{
        contrast: [I]
      }],
      /**
       * Drop Shadow
       * @see https://tailwindcss.com/docs/drop-shadow
       */
      "drop-shadow": [{
        "drop-shadow": ["", "none", dE, Lt]
      }],
      /**
       * Grayscale
       * @see https://tailwindcss.com/docs/grayscale
       */
      grayscale: [{
        grayscale: [r]
      }],
      /**
       * Hue Rotate
       * @see https://tailwindcss.com/docs/hue-rotate
       */
      "hue-rotate": [{
        "hue-rotate": [a]
      }],
      /**
       * Invert
       * @see https://tailwindcss.com/docs/invert
       */
      invert: [{
        invert: [C]
      }],
      /**
       * Saturate
       * @see https://tailwindcss.com/docs/saturate
       */
      saturate: [{
        saturate: [f]
      }],
      /**
       * Sepia
       * @see https://tailwindcss.com/docs/sepia
       */
      sepia: [{
        sepia: [G]
      }],
      /**
       * Backdrop Filter
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/backdrop-filter
       */
      "backdrop-filter": [{
        "backdrop-filter": ["", "none"]
      }],
      /**
       * Backdrop Blur
       * @see https://tailwindcss.com/docs/backdrop-blur
       */
      "backdrop-blur": [{
        "backdrop-blur": [t]
      }],
      /**
       * Backdrop Brightness
       * @see https://tailwindcss.com/docs/backdrop-brightness
       */
      "backdrop-brightness": [{
        "backdrop-brightness": [i]
      }],
      /**
       * Backdrop Contrast
       * @see https://tailwindcss.com/docs/backdrop-contrast
       */
      "backdrop-contrast": [{
        "backdrop-contrast": [I]
      }],
      /**
       * Backdrop Grayscale
       * @see https://tailwindcss.com/docs/backdrop-grayscale
       */
      "backdrop-grayscale": [{
        "backdrop-grayscale": [r]
      }],
      /**
       * Backdrop Hue Rotate
       * @see https://tailwindcss.com/docs/backdrop-hue-rotate
       */
      "backdrop-hue-rotate": [{
        "backdrop-hue-rotate": [a]
      }],
      /**
       * Backdrop Invert
       * @see https://tailwindcss.com/docs/backdrop-invert
       */
      "backdrop-invert": [{
        "backdrop-invert": [C]
      }],
      /**
       * Backdrop Opacity
       * @see https://tailwindcss.com/docs/backdrop-opacity
       */
      "backdrop-opacity": [{
        "backdrop-opacity": [m]
      }],
      /**
       * Backdrop Saturate
       * @see https://tailwindcss.com/docs/backdrop-saturate
       */
      "backdrop-saturate": [{
        "backdrop-saturate": [f]
      }],
      /**
       * Backdrop Sepia
       * @see https://tailwindcss.com/docs/backdrop-sepia
       */
      "backdrop-sepia": [{
        "backdrop-sepia": [G]
      }],
      // Tables
      /**
       * Border Collapse
       * @see https://tailwindcss.com/docs/border-collapse
       */
      "border-collapse": [{
        border: ["collapse", "separate"]
      }],
      /**
       * Border Spacing
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing": [{
        "border-spacing": [g]
      }],
      /**
       * Border Spacing X
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing-x": [{
        "border-spacing-x": [g]
      }],
      /**
       * Border Spacing Y
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing-y": [{
        "border-spacing-y": [g]
      }],
      /**
       * Table Layout
       * @see https://tailwindcss.com/docs/table-layout
       */
      "table-layout": [{
        table: ["auto", "fixed"]
      }],
      /**
       * Caption Side
       * @see https://tailwindcss.com/docs/caption-side
       */
      caption: [{
        caption: ["top", "bottom"]
      }],
      // Transitions and Animation
      /**
       * Tranisition Property
       * @see https://tailwindcss.com/docs/transition-property
       */
      transition: [{
        transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", Lt]
      }],
      /**
       * Transition Duration
       * @see https://tailwindcss.com/docs/transition-duration
       */
      duration: [{
        duration: nA()
      }],
      /**
       * Transition Timing Function
       * @see https://tailwindcss.com/docs/transition-timing-function
       */
      ease: [{
        ease: ["linear", "in", "out", "in-out", Lt]
      }],
      /**
       * Transition Delay
       * @see https://tailwindcss.com/docs/transition-delay
       */
      delay: [{
        delay: nA()
      }],
      /**
       * Animation
       * @see https://tailwindcss.com/docs/animation
       */
      animate: [{
        animate: ["none", "spin", "ping", "pulse", "bounce", Lt]
      }],
      // Transforms
      /**
       * Transform
       * @see https://tailwindcss.com/docs/transform
       */
      transform: [{
        transform: ["", "gpu", "none"]
      }],
      /**
       * Scale
       * @see https://tailwindcss.com/docs/scale
       */
      scale: [{
        scale: [w]
      }],
      /**
       * Scale X
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-x": [{
        "scale-x": [w]
      }],
      /**
       * Scale Y
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-y": [{
        "scale-y": [w]
      }],
      /**
       * Rotate
       * @see https://tailwindcss.com/docs/rotate
       */
      rotate: [{
        rotate: [tJ, Lt]
      }],
      /**
       * Translate X
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-x": [{
        "translate-x": [Z]
      }],
      /**
       * Translate Y
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-y": [{
        "translate-y": [Z]
      }],
      /**
       * Skew X
       * @see https://tailwindcss.com/docs/skew
       */
      "skew-x": [{
        "skew-x": [R]
      }],
      /**
       * Skew Y
       * @see https://tailwindcss.com/docs/skew
       */
      "skew-y": [{
        "skew-y": [R]
      }],
      /**
       * Transform Origin
       * @see https://tailwindcss.com/docs/transform-origin
       */
      "transform-origin": [{
        origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", Lt]
      }],
      // Interactivity
      /**
       * Accent Color
       * @see https://tailwindcss.com/docs/accent-color
       */
      accent: [{
        accent: ["auto", A]
      }],
      /**
       * Appearance
       * @see https://tailwindcss.com/docs/appearance
       */
      appearance: ["appearance-none"],
      /**
       * Cursor
       * @see https://tailwindcss.com/docs/cursor
       */
      cursor: [{
        cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", Lt]
      }],
      /**
       * Caret Color
       * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
       */
      "caret-color": [{
        caret: [A]
      }],
      /**
       * Pointer Events
       * @see https://tailwindcss.com/docs/pointer-events
       */
      "pointer-events": [{
        "pointer-events": ["none", "auto"]
      }],
      /**
       * Resize
       * @see https://tailwindcss.com/docs/resize
       */
      resize: [{
        resize: ["none", "y", "x", ""]
      }],
      /**
       * Scroll Behavior
       * @see https://tailwindcss.com/docs/scroll-behavior
       */
      "scroll-behavior": [{
        scroll: ["auto", "smooth"]
      }],
      /**
       * Scroll Margin
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-m": [{
        "scroll-m": N()
      }],
      /**
       * Scroll Margin X
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mx": [{
        "scroll-mx": N()
      }],
      /**
       * Scroll Margin Y
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-my": [{
        "scroll-my": N()
      }],
      /**
       * Scroll Margin Start
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-ms": [{
        "scroll-ms": N()
      }],
      /**
       * Scroll Margin End
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-me": [{
        "scroll-me": N()
      }],
      /**
       * Scroll Margin Top
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mt": [{
        "scroll-mt": N()
      }],
      /**
       * Scroll Margin Right
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mr": [{
        "scroll-mr": N()
      }],
      /**
       * Scroll Margin Bottom
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mb": [{
        "scroll-mb": N()
      }],
      /**
       * Scroll Margin Left
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-ml": [{
        "scroll-ml": N()
      }],
      /**
       * Scroll Padding
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-p": [{
        "scroll-p": N()
      }],
      /**
       * Scroll Padding X
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-px": [{
        "scroll-px": N()
      }],
      /**
       * Scroll Padding Y
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-py": [{
        "scroll-py": N()
      }],
      /**
       * Scroll Padding Start
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-ps": [{
        "scroll-ps": N()
      }],
      /**
       * Scroll Padding End
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pe": [{
        "scroll-pe": N()
      }],
      /**
       * Scroll Padding Top
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pt": [{
        "scroll-pt": N()
      }],
      /**
       * Scroll Padding Right
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pr": [{
        "scroll-pr": N()
      }],
      /**
       * Scroll Padding Bottom
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pb": [{
        "scroll-pb": N()
      }],
      /**
       * Scroll Padding Left
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pl": [{
        "scroll-pl": N()
      }],
      /**
       * Scroll Snap Align
       * @see https://tailwindcss.com/docs/scroll-snap-align
       */
      "snap-align": [{
        snap: ["start", "end", "center", "align-none"]
      }],
      /**
       * Scroll Snap Stop
       * @see https://tailwindcss.com/docs/scroll-snap-stop
       */
      "snap-stop": [{
        snap: ["normal", "always"]
      }],
      /**
       * Scroll Snap Type
       * @see https://tailwindcss.com/docs/scroll-snap-type
       */
      "snap-type": [{
        snap: ["none", "x", "y", "both"]
      }],
      /**
       * Scroll Snap Type Strictness
       * @see https://tailwindcss.com/docs/scroll-snap-type
       */
      "snap-strictness": [{
        snap: ["mandatory", "proximity"]
      }],
      /**
       * Touch Action
       * @see https://tailwindcss.com/docs/touch-action
       */
      touch: [{
        touch: ["auto", "none", "pinch-zoom", "manipulation", {
          pan: ["x", "left", "right", "y", "up", "down"]
        }]
      }],
      /**
       * User Select
       * @see https://tailwindcss.com/docs/user-select
       */
      select: [{
        select: ["none", "text", "all", "auto"]
      }],
      /**
       * Will Change
       * @see https://tailwindcss.com/docs/will-change
       */
      "will-change": [{
        "will-change": ["auto", "scroll", "contents", "transform", Lt]
      }],
      // SVG
      /**
       * Fill
       * @see https://tailwindcss.com/docs/fill
       */
      fill: [{
        fill: [A, "none"]
      }],
      /**
       * Stroke Width
       * @see https://tailwindcss.com/docs/stroke-width
       */
      "stroke-w": [{
        stroke: [Dr, jx]
      }],
      /**
       * Stroke
       * @see https://tailwindcss.com/docs/stroke
       */
      stroke: [{
        stroke: [A, "none"]
      }],
      // Accessibility
      /**
       * Screen Readers
       * @see https://tailwindcss.com/docs/screen-readers
       */
      sr: ["sr-only", "not-sr-only"]
    },
    conflictingClassGroups: {
      overflow: ["overflow-x", "overflow-y"],
      overscroll: ["overscroll-x", "overscroll-y"],
      inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
      "inset-x": ["right", "left"],
      "inset-y": ["top", "bottom"],
      flex: ["basis", "grow", "shrink"],
      gap: ["gap-x", "gap-y"],
      p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
      px: ["pr", "pl"],
      py: ["pt", "pb"],
      m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
      mx: ["mr", "ml"],
      my: ["mt", "mb"],
      "font-size": ["leading"],
      "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
      "fvn-ordinal": ["fvn-normal"],
      "fvn-slashed-zero": ["fvn-normal"],
      "fvn-figure": ["fvn-normal"],
      "fvn-spacing": ["fvn-normal"],
      "fvn-fraction": ["fvn-normal"],
      rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"],
      "rounded-s": ["rounded-ss", "rounded-es"],
      "rounded-e": ["rounded-se", "rounded-ee"],
      "rounded-t": ["rounded-tl", "rounded-tr"],
      "rounded-r": ["rounded-tr", "rounded-br"],
      "rounded-b": ["rounded-br", "rounded-bl"],
      "rounded-l": ["rounded-tl", "rounded-bl"],
      "border-spacing": ["border-spacing-x", "border-spacing-y"],
      "border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
      "border-w-x": ["border-w-r", "border-w-l"],
      "border-w-y": ["border-w-t", "border-w-b"],
      "border-color": ["border-color-t", "border-color-r", "border-color-b", "border-color-l"],
      "border-color-x": ["border-color-r", "border-color-l"],
      "border-color-y": ["border-color-t", "border-color-b"],
      "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
      "scroll-mx": ["scroll-mr", "scroll-ml"],
      "scroll-my": ["scroll-mt", "scroll-mb"],
      "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
      "scroll-px": ["scroll-pr", "scroll-pl"],
      "scroll-py": ["scroll-pt", "scroll-pb"]
    },
    conflictingClassGroupModifiers: {
      "font-size": ["leading"]
    }
  };
}
var YDt = /* @__PURE__ */ EDt(NDt);
function dn(...A) {
  return YDt(EzA(A));
}
const YsA = iDt, YX = u.forwardRef(({ className: A, ...e }, t) => pA(BzA, { ref: t, className: dn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground", A), ...e }));
YX.displayName = BzA.displayName;
const M2 = u.forwardRef(({ className: A, ...e }, t) => pA(lzA, { ref: t, className: dn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow", A), ...e }));
M2.displayName = lzA.displayName;
const x2 = u.forwardRef(({ className: A, ...e }, t) => pA(czA, { ref: t, className: dn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", A), ...e }));
x2.displayName = czA.displayName;
var E6 = function(A, e) {
  return E6 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
    t.__proto__ = i;
  } || function(t, i) {
    for (var n in i)
      Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
  }, E6(A, e);
};
function la(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
  E6(A, e);
  function t() {
    this.constructor = A;
  }
  A.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
}
var qA = function() {
  return qA = Object.assign || function(e) {
    for (var t, i = 1, n = arguments.length; i < n; i++) {
      t = arguments[i];
      for (var o in t)
        Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
    }
    return e;
  }, qA.apply(this, arguments);
};
function RsA(A, e) {
  var t = {};
  for (var i in A)
    Object.prototype.hasOwnProperty.call(A, i) && e.indexOf(i) < 0 && (t[i] = A[i]);
  if (A != null && typeof Object.getOwnPropertySymbols == "function")
    for (var n = 0, i = Object.getOwnPropertySymbols(A); n < i.length; n++)
      e.indexOf(i[n]) < 0 && Object.prototype.propertyIsEnumerable.call(A, i[n]) && (t[i[n]] = A[i[n]]);
  return t;
}
function UA(A, e, t, i) {
  function n(o) {
    return o instanceof t ? o : new t(function(g) {
      g(o);
    });
  }
  return new (t || (t = Promise))(function(o, g) {
    function s(a) {
      try {
        r(i.next(a));
      } catch (C) {
        g(C);
      }
    }
    function I(a) {
      try {
        r(i.throw(a));
      } catch (C) {
        g(C);
      }
    }
    function r(a) {
      a.done ? o(a.value) : n(a.value).then(s, I);
    }
    r((i = i.apply(A, e || [])).next());
  });
}
function Ee(A, e) {
  var t = { label: 0, sent: function() {
    if (o[0] & 1)
      throw o[1];
    return o[1];
  }, trys: [], ops: [] }, i, n, o, g;
  return g = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
    return this;
  }), g;
  function s(r) {
    return function(a) {
      return I([r, a]);
    };
  }
  function I(r) {
    if (i)
      throw new TypeError("Generator is already executing.");
    for (; g && (g = 0, r[0] && (t = 0)), t; )
      try {
        if (i = 1, n && (o = r[0] & 2 ? n.return : r[0] ? n.throw || ((o = n.return) && o.call(n), 0) : n.next) && !(o = o.call(n, r[1])).done)
          return o;
        switch (n = 0, o && (r = [r[0] & 2, o.value]), r[0]) {
          case 0:
          case 1:
            o = r;
            break;
          case 4:
            return t.label++, { value: r[1], done: !1 };
          case 5:
            t.label++, n = r[1], r = [0];
            continue;
          case 7:
            r = t.ops.pop(), t.trys.pop();
            continue;
          default:
            if (o = t.trys, !(o = o.length > 0 && o[o.length - 1]) && (r[0] === 6 || r[0] === 2)) {
              t = 0;
              continue;
            }
            if (r[0] === 3 && (!o || r[1] > o[0] && r[1] < o[3])) {
              t.label = r[1];
              break;
            }
            if (r[0] === 6 && t.label < o[1]) {
              t.label = o[1], o = r;
              break;
            }
            if (o && t.label < o[2]) {
              t.label = o[2], t.ops.push(r);
              break;
            }
            o[2] && t.ops.pop(), t.trys.pop();
            continue;
        }
        r = e.call(A, t);
      } catch (a) {
        r = [6, a], n = 0;
      } finally {
        i = o = 0;
      }
    if (r[0] & 5)
      throw r[1];
    return { value: r[0] ? r[1] : void 0, done: !0 };
  }
}
function _yA(A) {
  var e = typeof Symbol == "function" && Symbol.iterator, t = e && A[e], i = 0;
  if (t)
    return t.call(A);
  if (A && typeof A.length == "number")
    return {
      next: function() {
        return A && i >= A.length && (A = void 0), { value: A && A[i++], done: !A };
      }
    };
  throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function zn(A, e, t) {
  if (t || arguments.length === 2)
    for (var i = 0, n = e.length, o; i < n; i++)
      (o || !(i in e)) && (o || (o = Array.prototype.slice.call(e, 0, i)), o[i] = e[i]);
  return A.concat(o || Array.prototype.slice.call(e));
}
function ft(A) {
  return this instanceof ft ? (this.v = A, this) : new ft(A);
}
function RB(A, e, t) {
  if (!Symbol.asyncIterator)
    throw new TypeError("Symbol.asyncIterator is not defined.");
  var i = t.apply(A, e || []), n, o = [];
  return n = {}, g("next"), g("throw"), g("return"), n[Symbol.asyncIterator] = function() {
    return this;
  }, n;
  function g(B) {
    i[B] && (n[B] = function(l) {
      return new Promise(function(Q, E) {
        o.push([B, l, Q, E]) > 1 || s(B, l);
      });
    });
  }
  function s(B, l) {
    try {
      I(i[B](l));
    } catch (Q) {
      C(o[0][3], Q);
    }
  }
  function I(B) {
    B.value instanceof ft ? Promise.resolve(B.value.v).then(r, a) : C(o[0][2], B);
  }
  function r(B) {
    s("next", B);
  }
  function a(B) {
    s("throw", B);
  }
  function C(B, l) {
    B(l), o.shift(), o.length && s(o[0][0], o[0][1]);
  }
}
function Ev(A) {
  var e, t;
  return e = {}, i("next"), i("throw", function(n) {
    throw n;
  }), i("return"), e[Symbol.iterator] = function() {
    return this;
  }, e;
  function i(n, o) {
    e[n] = A[n] ? function(g) {
      return (t = !t) ? { value: ft(A[n](g)), done: !1 } : o ? o(g) : g;
    } : o;
  }
}
function Um(A) {
  if (!Symbol.asyncIterator)
    throw new TypeError("Symbol.asyncIterator is not defined.");
  var e = A[Symbol.asyncIterator], t;
  return e ? e.call(A) : (A = typeof _yA == "function" ? _yA(A) : A[Symbol.iterator](), t = {}, i("next"), i("throw"), i("return"), t[Symbol.asyncIterator] = function() {
    return this;
  }, t);
  function i(o) {
    t[o] = A[o] && function(g) {
      return new Promise(function(s, I) {
        g = A[o](g), n(s, I, g.done, g.value);
      });
    };
  }
  function n(o, g, s, I) {
    Promise.resolve(I).then(function(r) {
      o({ value: r, done: s });
    }, g);
  }
}
const RDt = new TextDecoder("utf-8"), u6 = (A) => RDt.decode(A), FDt = new TextEncoder(), FsA = (A) => FDt.encode(A), [zXt, MDt] = (() => {
  const A = () => {
    throw new Error("BigInt is not available in this environment");
  };
  function e() {
    throw A();
  }
  return e.asIntN = () => {
    throw A();
  }, e.asUintN = () => {
    throw A();
  }, typeof BigInt < "u" ? [BigInt, !0] : [e, !1];
})(), [u1, TXt] = (() => {
  const A = () => {
    throw new Error("BigInt64Array is not available in this environment");
  };
  class e {
    static get BYTES_PER_ELEMENT() {
      return 8;
    }
    static of() {
      throw A();
    }
    static from() {
      throw A();
    }
    constructor() {
      throw A();
    }
  }
  return typeof BigInt64Array < "u" ? [BigInt64Array, !0] : [e, !1];
})(), [d1, _Xt] = (() => {
  const A = () => {
    throw new Error("BigUint64Array is not available in this environment");
  };
  class e {
    static get BYTES_PER_ELEMENT() {
      return 8;
    }
    static of() {
      throw A();
    }
    static from() {
      throw A();
    }
    constructor() {
      throw A();
    }
  }
  return typeof BigUint64Array < "u" ? [BigUint64Array, !0] : [e, !1];
})(), xDt = (A) => typeof A == "number", yzA = (A) => typeof A == "boolean", Io = (A) => typeof A == "function", eI = (A) => A != null && Object(A) === A, Bd = (A) => eI(A) && Io(A.then), h1 = (A) => eI(A) && Io(A[Symbol.iterator]), DG = (A) => eI(A) && Io(A[Symbol.asyncIterator]), d6 = (A) => eI(A) && eI(A.schema), bzA = (A) => eI(A) && "done" in A && "value" in A, wzA = (A) => eI(A) && Io(A.stat) && xDt(A.fd), fzA = (A) => eI(A) && MsA(A.body), RX = (A) => "_getDOMStream" in A && "_getNodeStream" in A, LDt = (A) => eI(A) && Io(A.abort) && Io(A.getWriter) && !RX(A), MsA = (A) => eI(A) && Io(A.cancel) && Io(A.getReader) && !RX(A), vDt = (A) => eI(A) && Io(A.end) && Io(A.write) && yzA(A.writable) && !RX(A), DzA = (A) => eI(A) && Io(A.read) && Io(A.pipe) && yzA(A.readable) && !RX(A), HDt = (A) => eI(A) && Io(A.clear) && Io(A.bytes) && Io(A.position) && Io(A.setPosition) && Io(A.capacity) && Io(A.getBufferIdentifier) && Io(A.createLong), xsA = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : ArrayBuffer;
function SDt(A) {
  const e = A[0] ? [A[0]] : [];
  let t, i, n, o;
  for (let g, s, I = 0, r = 0, a = A.length; ++I < a; ) {
    if (g = e[r], s = A[I], !g || !s || g.buffer !== s.buffer || s.byteOffset < g.byteOffset) {
      s && (e[++r] = s);
      continue;
    }
    if ({ byteOffset: t, byteLength: n } = g, { byteOffset: i, byteLength: o } = s, t + n < i || i + o < t) {
      s && (e[++r] = s);
      continue;
    }
    e[r] = new Uint8Array(g.buffer, t, i - t + o);
  }
  return e;
}
function qyA(A, e, t = 0, i = e.byteLength) {
  const n = A.byteLength, o = new Uint8Array(A.buffer, A.byteOffset, n), g = new Uint8Array(e.buffer, e.byteOffset, Math.min(i, n));
  return o.set(g, t), A;
}
function Ql(A, e) {
  const t = SDt(A), i = t.reduce((a, C) => a + C.byteLength, 0);
  let n, o, g, s = 0, I = -1;
  const r = Math.min(e || Number.POSITIVE_INFINITY, i);
  for (const a = t.length; ++I < a; ) {
    if (n = t[I], o = n.subarray(0, Math.min(n.length, r - s)), r <= s + o.length) {
      o.length < n.length ? t[I] = n.subarray(o.length) : o.length === n.length && I++, g ? qyA(g, o, s) : g = o;
      break;
    }
    qyA(g || (g = new Uint8Array(r)), o, s), s += o.length;
  }
  return [g || new Uint8Array(0), t.slice(I), i - (g ? g.byteLength : 0)];
}
function Si(A, e) {
  let t = bzA(e) ? e.value : e;
  return t instanceof A ? A === Uint8Array ? new A(t.buffer, t.byteOffset, t.byteLength) : t : t ? (typeof t == "string" && (t = FsA(t)), t instanceof ArrayBuffer ? new A(t) : t instanceof xsA ? new A(t) : HDt(t) ? Si(A, t.bytes()) : ArrayBuffer.isView(t) ? t.byteLength <= 0 ? new A(0) : new A(t.buffer, t.byteOffset, t.byteLength / A.BYTES_PER_ELEMENT) : A.from(t)) : new A(0);
}
const nJ = (A) => Si(Int32Array, A), li = (A) => Si(Uint8Array, A), h6 = (A) => (A.next(), A);
function* ZDt(A, e) {
  const t = function* (n) {
    yield n;
  }, i = typeof e == "string" || ArrayBuffer.isView(e) || e instanceof ArrayBuffer || e instanceof xsA ? t(e) : h1(e) ? e : t(e);
  return yield* h6(function* (n) {
    let o = null;
    do
      o = n.next(yield Si(A, o));
    while (!o.done);
  }(i[Symbol.iterator]())), new A();
}
const WDt = (A) => ZDt(Uint8Array, A);
function GzA(A, e) {
  return RB(this, arguments, function* () {
    if (Bd(e))
      return yield ft(yield ft(yield* Ev(Um(GzA(A, yield ft(e))))));
    const i = function(g) {
      return RB(this, arguments, function* () {
        yield yield ft(yield ft(g));
      });
    }, n = function(g) {
      return RB(this, arguments, function* () {
        yield ft(yield* Ev(Um(h6(function* (s) {
          let I = null;
          do
            I = s.next(yield I == null ? void 0 : I.value);
          while (!I.done);
        }(g[Symbol.iterator]())))));
      });
    }, o = typeof e == "string" || ArrayBuffer.isView(e) || e instanceof ArrayBuffer || e instanceof xsA ? i(e) : h1(e) ? n(e) : DG(e) ? e : i(e);
    return yield ft(
      // otherwise if AsyncIterable, use it
      yield* Ev(Um(h6(function(g) {
        return RB(this, arguments, function* () {
          let s = null;
          do
            s = yield ft(g.next(yield yield ft(Si(A, s))));
          while (!s.done);
        });
      }(o[Symbol.asyncIterator]()))))
    ), yield ft(new A());
  });
}
const KDt = (A) => GzA(Uint8Array, A);
function LsA(A, e, t) {
  if (A !== 0) {
    t = t.slice(0, e + 1);
    for (let i = -1; ++i <= e; )
      t[i] += A;
  }
  return t;
}
function UDt(A, e) {
  let t = 0;
  const i = A.length;
  if (i !== e.length)
    return !1;
  if (i > 0)
    do
      if (A[t] !== e[t])
        return !1;
    while (++t < i);
  return !0;
}
const fa = {
  fromIterable(A) {
    return Px(VDt(A));
  },
  fromAsyncIterable(A) {
    return Px(XDt(A));
  },
  fromDOMStream(A) {
    return Px(zDt(A));
  },
  fromNodeStream(A) {
    return Px(_Dt(A));
  },
  // @ts-ignore
  toDOMStream(A, e) {
    throw new Error('"toDOMStream" not available in this environment');
  },
  // @ts-ignore
  toNodeStream(A, e) {
    throw new Error('"toNodeStream" not available in this environment');
  }
}, Px = (A) => (A.next(), A);
function* VDt(A) {
  let e, t = !1, i = [], n, o, g, s = 0;
  function I() {
    return o === "peek" ? Ql(i, g)[0] : ([n, i, s] = Ql(i, g), n);
  }
  ({ cmd: o, size: g } = yield null);
  const r = WDt(A)[Symbol.iterator]();
  try {
    do
      if ({ done: e, value: n } = Number.isNaN(g - s) ? r.next() : r.next(g - s), !e && n.byteLength > 0 && (i.push(n), s += n.byteLength), e || g <= s)
        do
          ({ cmd: o, size: g } = yield I());
        while (g < s);
    while (!e);
  } catch (a) {
    (t = !0) && typeof r.throw == "function" && r.throw(a);
  } finally {
    t === !1 && typeof r.return == "function" && r.return(null);
  }
  return null;
}
function XDt(A) {
  return RB(this, arguments, function* () {
    let t, i = !1, n = [], o, g, s, I = 0;
    function r() {
      return g === "peek" ? Ql(n, s)[0] : ([o, n, I] = Ql(n, s), o);
    }
    ({ cmd: g, size: s } = yield yield ft(null));
    const a = KDt(A)[Symbol.asyncIterator]();
    try {
      do
        if ({ done: t, value: o } = Number.isNaN(s - I) ? yield ft(a.next()) : yield ft(a.next(s - I)), !t && o.byteLength > 0 && (n.push(o), I += o.byteLength), t || s <= I)
          do
            ({ cmd: g, size: s } = yield yield ft(r()));
          while (s < I);
      while (!t);
    } catch (C) {
      (i = !0) && typeof a.throw == "function" && (yield ft(a.throw(C)));
    } finally {
      i === !1 && typeof a.return == "function" && (yield ft(a.return(new Uint8Array(0))));
    }
    return yield ft(null);
  });
}
function zDt(A) {
  return RB(this, arguments, function* () {
    let t = !1, i = !1, n = [], o, g, s, I = 0;
    function r() {
      return g === "peek" ? Ql(n, s)[0] : ([o, n, I] = Ql(n, s), o);
    }
    ({ cmd: g, size: s } = yield yield ft(null));
    const a = new TDt(A);
    try {
      do
        if ({ done: t, value: o } = Number.isNaN(s - I) ? yield ft(a.read()) : yield ft(a.read(s - I)), !t && o.byteLength > 0 && (n.push(li(o)), I += o.byteLength), t || s <= I)
          do
            ({ cmd: g, size: s } = yield yield ft(r()));
          while (s < I);
      while (!t);
    } catch (C) {
      (i = !0) && (yield ft(a.cancel(C)));
    } finally {
      i === !1 ? yield ft(a.cancel()) : A.locked && a.releaseLock();
    }
    return yield ft(null);
  });
}
class TDt {
  constructor(e) {
    this.source = e, this.reader = null, this.reader = this.source.getReader(), this.reader.closed.catch(() => {
    });
  }
  get closed() {
    return this.reader ? this.reader.closed.catch(() => {
    }) : Promise.resolve();
  }
  releaseLock() {
    this.reader && this.reader.releaseLock(), this.reader = null;
  }
  cancel(e) {
    return UA(this, void 0, void 0, function* () {
      const { reader: t, source: i } = this;
      t && (yield t.cancel(e).catch(() => {
      })), i && i.locked && this.releaseLock();
    });
  }
  read(e) {
    return UA(this, void 0, void 0, function* () {
      if (e === 0)
        return { done: this.reader == null, value: new Uint8Array(0) };
      const t = yield this.reader.read();
      return !t.done && (t.value = li(t)), t;
    });
  }
}
const u_ = (A, e) => {
  const t = (n) => i([e, n]);
  let i;
  return [e, t, new Promise((n) => (i = n) && A.once(e, t))];
};
function _Dt(A) {
  return RB(this, arguments, function* () {
    const t = [];
    let i = "error", n = !1, o = null, g, s, I = 0, r = [], a;
    function C() {
      return g === "peek" ? Ql(r, s)[0] : ([a, r, I] = Ql(r, s), a);
    }
    if ({ cmd: g, size: s } = yield yield ft(null), A.isTTY)
      return yield yield ft(new Uint8Array(0)), yield ft(null);
    try {
      t[0] = u_(A, "end"), t[1] = u_(A, "error");
      do {
        if (t[2] = u_(A, "readable"), [i, o] = yield ft(Promise.race(t.map((l) => l[2]))), i === "error")
          break;
        if ((n = i === "end") || (Number.isFinite(s - I) ? (a = li(A.read(s - I)), a.byteLength < s - I && (a = li(A.read()))) : a = li(A.read()), a.byteLength > 0 && (r.push(a), I += a.byteLength)), n || s <= I)
          do
            ({ cmd: g, size: s } = yield yield ft(C()));
          while (s < I);
      } while (!n);
    } finally {
      yield ft(B(t, i === "error" ? o : null));
    }
    return yield ft(null);
    function B(l, Q) {
      return a = r = null, new Promise((E, d) => {
        for (const [m, y] of l)
          A.off(m, y);
        try {
          const m = A.destroy;
          m && m.call(A, Q), Q = void 0;
        } catch (m) {
          Q = m || Q;
        } finally {
          Q != null ? d(Q) : E();
        }
      });
    }
  });
}
var RI;
(function(A) {
  A[A.V1 = 0] = "V1", A[A.V2 = 1] = "V2", A[A.V3 = 2] = "V3", A[A.V4 = 3] = "V4", A[A.V5 = 4] = "V5";
})(RI || (RI = {}));
var na;
(function(A) {
  A[A.Sparse = 0] = "Sparse", A[A.Dense = 1] = "Dense";
})(na || (na = {}));
var Xs;
(function(A) {
  A[A.HALF = 0] = "HALF", A[A.SINGLE = 1] = "SINGLE", A[A.DOUBLE = 2] = "DOUBLE";
})(Xs || (Xs = {}));
var bQ;
(function(A) {
  A[A.DAY = 0] = "DAY", A[A.MILLISECOND = 1] = "MILLISECOND";
})(bQ || (bQ = {}));
var ci;
(function(A) {
  A[A.SECOND = 0] = "SECOND", A[A.MILLISECOND = 1] = "MILLISECOND", A[A.MICROSECOND = 2] = "MICROSECOND", A[A.NANOSECOND = 3] = "NANOSECOND";
})(ci || (ci = {}));
var ld;
(function(A) {
  A[A.YEAR_MONTH = 0] = "YEAR_MONTH", A[A.DAY_TIME = 1] = "DAY_TIME", A[A.MONTH_DAY_NANO = 2] = "MONTH_DAY_NANO";
})(ld || (ld = {}));
var mi;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.Schema = 1] = "Schema", A[A.DictionaryBatch = 2] = "DictionaryBatch", A[A.RecordBatch = 3] = "RecordBatch", A[A.Tensor = 4] = "Tensor", A[A.SparseTensor = 5] = "SparseTensor";
})(mi || (mi = {}));
var bA;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.Null = 1] = "Null", A[A.Int = 2] = "Int", A[A.Float = 3] = "Float", A[A.Binary = 4] = "Binary", A[A.Utf8 = 5] = "Utf8", A[A.Bool = 6] = "Bool", A[A.Decimal = 7] = "Decimal", A[A.Date = 8] = "Date", A[A.Time = 9] = "Time", A[A.Timestamp = 10] = "Timestamp", A[A.Interval = 11] = "Interval", A[A.List = 12] = "List", A[A.Struct = 13] = "Struct", A[A.Union = 14] = "Union", A[A.FixedSizeBinary = 15] = "FixedSizeBinary", A[A.FixedSizeList = 16] = "FixedSizeList", A[A.Map = 17] = "Map", A[A.Dictionary = -1] = "Dictionary", A[A.Int8 = -2] = "Int8", A[A.Int16 = -3] = "Int16", A[A.Int32 = -4] = "Int32", A[A.Int64 = -5] = "Int64", A[A.Uint8 = -6] = "Uint8", A[A.Uint16 = -7] = "Uint16", A[A.Uint32 = -8] = "Uint32", A[A.Uint64 = -9] = "Uint64", A[A.Float16 = -10] = "Float16", A[A.Float32 = -11] = "Float32", A[A.Float64 = -12] = "Float64", A[A.DateDay = -13] = "DateDay", A[A.DateMillisecond = -14] = "DateMillisecond", A[A.TimestampSecond = -15] = "TimestampSecond", A[A.TimestampMillisecond = -16] = "TimestampMillisecond", A[A.TimestampMicrosecond = -17] = "TimestampMicrosecond", A[A.TimestampNanosecond = -18] = "TimestampNanosecond", A[A.TimeSecond = -19] = "TimeSecond", A[A.TimeMillisecond = -20] = "TimeMillisecond", A[A.TimeMicrosecond = -21] = "TimeMicrosecond", A[A.TimeNanosecond = -22] = "TimeNanosecond", A[A.DenseUnion = -23] = "DenseUnion", A[A.SparseUnion = -24] = "SparseUnion", A[A.IntervalDayTime = -25] = "IntervalDayTime", A[A.IntervalYearMonth = -26] = "IntervalYearMonth";
})(bA || (bA = {}));
var cc;
(function(A) {
  A[A.OFFSET = 0] = "OFFSET", A[A.DATA = 1] = "DATA", A[A.VALIDITY = 2] = "VALIDITY", A[A.TYPE = 3] = "TYPE";
})(cc || (cc = {}));
const qDt = void 0;
function L2(A) {
  if (A === null)
    return "null";
  if (A === qDt)
    return "undefined";
  switch (typeof A) {
    case "number":
      return `${A}`;
    case "bigint":
      return `${A}`;
    case "string":
      return `"${A}"`;
  }
  return typeof A[Symbol.toPrimitive] == "function" ? A[Symbol.toPrimitive]("string") : ArrayBuffer.isView(A) ? A instanceof u1 || A instanceof d1 ? `[${[...A].map((e) => L2(e))}]` : `[${A}]` : ArrayBuffer.isView(A) ? `[${A}]` : JSON.stringify(A, (e, t) => typeof t == "bigint" ? `${t}` : t);
}
const ODt = Symbol.for("isArrowBigNum");
function HC(A, ...e) {
  return e.length === 0 ? Object.setPrototypeOf(Si(this.TypedArray, A), this.constructor.prototype) : Object.setPrototypeOf(new this.TypedArray(A, ...e), this.constructor.prototype);
}
HC.prototype[ODt] = !0;
HC.prototype.toJSON = function() {
  return `"${Vm(this)}"`;
};
HC.prototype.valueOf = function() {
  return kzA(this);
};
HC.prototype.toString = function() {
  return Vm(this);
};
HC.prototype[Symbol.toPrimitive] = function(A = "default") {
  switch (A) {
    case "number":
      return kzA(this);
    case "string":
      return Vm(this);
    case "default":
      return m6(this);
  }
  return Vm(this);
};
function bw(...A) {
  return HC.apply(this, A);
}
function ww(...A) {
  return HC.apply(this, A);
}
function v2(...A) {
  return HC.apply(this, A);
}
Object.setPrototypeOf(bw.prototype, Object.create(Int32Array.prototype));
Object.setPrototypeOf(ww.prototype, Object.create(Uint32Array.prototype));
Object.setPrototypeOf(v2.prototype, Object.create(Uint32Array.prototype));
Object.assign(bw.prototype, HC.prototype, { constructor: bw, signed: !0, TypedArray: Int32Array, BigIntArray: u1 });
Object.assign(ww.prototype, HC.prototype, { constructor: ww, signed: !1, TypedArray: Uint32Array, BigIntArray: d1 });
Object.assign(v2.prototype, HC.prototype, { constructor: v2, signed: !0, TypedArray: Uint32Array, BigIntArray: d1 });
function kzA(A) {
  const { buffer: e, byteOffset: t, length: i, signed: n } = A, o = new d1(e, t, i), g = n && o[o.length - 1] & BigInt(1) << BigInt(63);
  let s = BigInt(g ? 1 : 0), I = BigInt(0);
  if (g) {
    for (const r of o)
      s += ~r * (BigInt(1) << BigInt(32) * I++);
    s *= BigInt(-1);
  } else
    for (const r of o)
      s += r * (BigInt(1) << BigInt(32) * I++);
  return s;
}
let Vm, m6;
MDt ? (m6 = (A) => A.byteLength === 8 ? new A.BigIntArray(A.buffer, A.byteOffset, 1)[0] : d_(A), Vm = (A) => A.byteLength === 8 ? `${new A.BigIntArray(A.buffer, A.byteOffset, 1)[0]}` : d_(A)) : (Vm = d_, m6 = Vm);
function d_(A) {
  let e = "";
  const t = new Uint32Array(2);
  let i = new Uint16Array(A.buffer, A.byteOffset, A.byteLength / 2);
  const n = new Uint32Array((i = new Uint16Array(i).reverse()).buffer);
  let o = -1;
  const g = i.length - 1;
  do {
    for (t[0] = i[o = 0]; o < g; )
      i[o++] = t[1] = t[0] / 10, t[0] = (t[0] - t[1] * 10 << 16) + i[o];
    i[o] = t[1] = t[0] / 10, t[0] = t[0] - t[1] * 10, e = `${t[0]}${e}`;
  } while (n[0] || n[1] || n[2] || n[3]);
  return e ?? "0";
}
class vsA {
  /** @nocollapse */
  static new(e, t) {
    switch (t) {
      case !0:
        return new bw(e);
      case !1:
        return new ww(e);
    }
    switch (e.constructor) {
      case Int8Array:
      case Int16Array:
      case Int32Array:
      case u1:
        return new bw(e);
    }
    return e.byteLength === 16 ? new v2(e) : new ww(e);
  }
  /** @nocollapse */
  static signed(e) {
    return new bw(e);
  }
  /** @nocollapse */
  static unsigned(e) {
    return new ww(e);
  }
  /** @nocollapse */
  static decimal(e) {
    return new v2(e);
  }
  constructor(e, t) {
    return vsA.new(e, t);
  }
}
var JzA, NzA, YzA, RzA, FzA, MzA, xzA, LzA, vzA, HzA, SzA, ZzA, WzA, KzA, UzA, VzA, XzA, zzA, TzA;
class Ct {
  /** @nocollapse */
  static isNull(e) {
    return (e == null ? void 0 : e.typeId) === bA.Null;
  }
  /** @nocollapse */
  static isInt(e) {
    return (e == null ? void 0 : e.typeId) === bA.Int;
  }
  /** @nocollapse */
  static isFloat(e) {
    return (e == null ? void 0 : e.typeId) === bA.Float;
  }
  /** @nocollapse */
  static isBinary(e) {
    return (e == null ? void 0 : e.typeId) === bA.Binary;
  }
  /** @nocollapse */
  static isUtf8(e) {
    return (e == null ? void 0 : e.typeId) === bA.Utf8;
  }
  /** @nocollapse */
  static isBool(e) {
    return (e == null ? void 0 : e.typeId) === bA.Bool;
  }
  /** @nocollapse */
  static isDecimal(e) {
    return (e == null ? void 0 : e.typeId) === bA.Decimal;
  }
  /** @nocollapse */
  static isDate(e) {
    return (e == null ? void 0 : e.typeId) === bA.Date;
  }
  /** @nocollapse */
  static isTime(e) {
    return (e == null ? void 0 : e.typeId) === bA.Time;
  }
  /** @nocollapse */
  static isTimestamp(e) {
    return (e == null ? void 0 : e.typeId) === bA.Timestamp;
  }
  /** @nocollapse */
  static isInterval(e) {
    return (e == null ? void 0 : e.typeId) === bA.Interval;
  }
  /** @nocollapse */
  static isList(e) {
    return (e == null ? void 0 : e.typeId) === bA.List;
  }
  /** @nocollapse */
  static isStruct(e) {
    return (e == null ? void 0 : e.typeId) === bA.Struct;
  }
  /** @nocollapse */
  static isUnion(e) {
    return (e == null ? void 0 : e.typeId) === bA.Union;
  }
  /** @nocollapse */
  static isFixedSizeBinary(e) {
    return (e == null ? void 0 : e.typeId) === bA.FixedSizeBinary;
  }
  /** @nocollapse */
  static isFixedSizeList(e) {
    return (e == null ? void 0 : e.typeId) === bA.FixedSizeList;
  }
  /** @nocollapse */
  static isMap(e) {
    return (e == null ? void 0 : e.typeId) === bA.Map;
  }
  /** @nocollapse */
  static isDictionary(e) {
    return (e == null ? void 0 : e.typeId) === bA.Dictionary;
  }
  /** @nocollapse */
  static isDenseUnion(e) {
    return Ct.isUnion(e) && e.mode === na.Dense;
  }
  /** @nocollapse */
  static isSparseUnion(e) {
    return Ct.isUnion(e) && e.mode === na.Sparse;
  }
  get typeId() {
    return bA.NONE;
  }
}
JzA = Symbol.toStringTag;
Ct[JzA] = ((A) => (A.children = null, A.ArrayType = Array, A[Symbol.toStringTag] = "DataType"))(Ct.prototype);
let cd = class extends Ct {
  toString() {
    return "Null";
  }
  get typeId() {
    return bA.Null;
  }
};
NzA = Symbol.toStringTag;
cd[NzA] = ((A) => A[Symbol.toStringTag] = "Null")(cd.prototype);
class Qd extends Ct {
  constructor(e, t) {
    super(), this.isSigned = e, this.bitWidth = t;
  }
  get typeId() {
    return bA.Int;
  }
  get ArrayType() {
    switch (this.bitWidth) {
      case 8:
        return this.isSigned ? Int8Array : Uint8Array;
      case 16:
        return this.isSigned ? Int16Array : Uint16Array;
      case 32:
        return this.isSigned ? Int32Array : Uint32Array;
      case 64:
        return this.isSigned ? u1 : d1;
    }
    throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
  }
  toString() {
    return `${this.isSigned ? "I" : "Ui"}nt${this.bitWidth}`;
  }
}
YzA = Symbol.toStringTag;
Qd[YzA] = ((A) => (A.isSigned = null, A.bitWidth = null, A[Symbol.toStringTag] = "Int"))(Qd.prototype);
class H2 extends Qd {
  constructor() {
    super(!0, 32);
  }
  get ArrayType() {
    return Int32Array;
  }
}
Object.defineProperty(H2.prototype, "ArrayType", { value: Int32Array });
class S2 extends Ct {
  constructor(e) {
    super(), this.precision = e;
  }
  get typeId() {
    return bA.Float;
  }
  get ArrayType() {
    switch (this.precision) {
      case Xs.HALF:
        return Uint16Array;
      case Xs.SINGLE:
        return Float32Array;
      case Xs.DOUBLE:
        return Float64Array;
    }
    throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
  }
  toString() {
    return `Float${this.precision << 5 || 16}`;
  }
}
RzA = Symbol.toStringTag;
S2[RzA] = ((A) => (A.precision = null, A[Symbol.toStringTag] = "Float"))(S2.prototype);
let sW = class extends Ct {
  constructor() {
    super();
  }
  get typeId() {
    return bA.Binary;
  }
  toString() {
    return "Binary";
  }
};
FzA = Symbol.toStringTag;
sW[FzA] = ((A) => (A.ArrayType = Uint8Array, A[Symbol.toStringTag] = "Binary"))(sW.prototype);
let IW = class extends Ct {
  constructor() {
    super();
  }
  get typeId() {
    return bA.Utf8;
  }
  toString() {
    return "Utf8";
  }
};
MzA = Symbol.toStringTag;
IW[MzA] = ((A) => (A.ArrayType = Uint8Array, A[Symbol.toStringTag] = "Utf8"))(IW.prototype);
let aW = class extends Ct {
  constructor() {
    super();
  }
  get typeId() {
    return bA.Bool;
  }
  toString() {
    return "Bool";
  }
};
xzA = Symbol.toStringTag;
aW[xzA] = ((A) => (A.ArrayType = Uint8Array, A[Symbol.toStringTag] = "Bool"))(aW.prototype);
let rW = class extends Ct {
  constructor(e, t, i = 128) {
    super(), this.scale = e, this.precision = t, this.bitWidth = i;
  }
  get typeId() {
    return bA.Decimal;
  }
  toString() {
    return `Decimal[${this.precision}e${this.scale > 0 ? "+" : ""}${this.scale}]`;
  }
};
LzA = Symbol.toStringTag;
rW[LzA] = ((A) => (A.scale = null, A.precision = null, A.ArrayType = Uint32Array, A[Symbol.toStringTag] = "Decimal"))(rW.prototype);
class CW extends Ct {
  constructor(e) {
    super(), this.unit = e;
  }
  get typeId() {
    return bA.Date;
  }
  toString() {
    return `Date${(this.unit + 1) * 32}<${bQ[this.unit]}>`;
  }
}
vzA = Symbol.toStringTag;
CW[vzA] = ((A) => (A.unit = null, A.ArrayType = Int32Array, A[Symbol.toStringTag] = "Date"))(CW.prototype);
class Z2 extends Ct {
  constructor(e, t) {
    super(), this.unit = e, this.bitWidth = t;
  }
  get typeId() {
    return bA.Time;
  }
  toString() {
    return `Time${this.bitWidth}<${ci[this.unit]}>`;
  }
  get ArrayType() {
    switch (this.bitWidth) {
      case 32:
        return Int32Array;
      case 64:
        return u1;
    }
    throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
  }
}
HzA = Symbol.toStringTag;
Z2[HzA] = ((A) => (A.unit = null, A.bitWidth = null, A[Symbol.toStringTag] = "Time"))(Z2.prototype);
class BW extends Ct {
  constructor(e, t) {
    super(), this.unit = e, this.timezone = t;
  }
  get typeId() {
    return bA.Timestamp;
  }
  toString() {
    return `Timestamp<${ci[this.unit]}${this.timezone ? `, ${this.timezone}` : ""}>`;
  }
}
SzA = Symbol.toStringTag;
BW[SzA] = ((A) => (A.unit = null, A.timezone = null, A.ArrayType = Int32Array, A[Symbol.toStringTag] = "Timestamp"))(BW.prototype);
class lW extends Ct {
  constructor(e) {
    super(), this.unit = e;
  }
  get typeId() {
    return bA.Interval;
  }
  toString() {
    return `Interval<${ld[this.unit]}>`;
  }
}
ZzA = Symbol.toStringTag;
lW[ZzA] = ((A) => (A.unit = null, A.ArrayType = Int32Array, A[Symbol.toStringTag] = "Interval"))(lW.prototype);
let cW = class extends Ct {
  constructor(e) {
    super(), this.children = [e];
  }
  get typeId() {
    return bA.List;
  }
  toString() {
    return `List<${this.valueType}>`;
  }
  get valueType() {
    return this.children[0].type;
  }
  get valueField() {
    return this.children[0];
  }
  get ArrayType() {
    return this.valueType.ArrayType;
  }
};
WzA = Symbol.toStringTag;
cW[WzA] = ((A) => (A.children = null, A[Symbol.toStringTag] = "List"))(cW.prototype);
class es extends Ct {
  constructor(e) {
    super(), this.children = e;
  }
  get typeId() {
    return bA.Struct;
  }
  toString() {
    return `Struct<{${this.children.map((e) => `${e.name}:${e.type}`).join(", ")}}>`;
  }
}
KzA = Symbol.toStringTag;
es[KzA] = ((A) => (A.children = null, A[Symbol.toStringTag] = "Struct"))(es.prototype);
class QW extends Ct {
  constructor(e, t, i) {
    super(), this.mode = e, this.children = i, this.typeIds = t = Int32Array.from(t), this.typeIdToChildIndex = t.reduce((n, o, g) => (n[o] = g) && n || n, /* @__PURE__ */ Object.create(null));
  }
  get typeId() {
    return bA.Union;
  }
  toString() {
    return `${this[Symbol.toStringTag]}<${this.children.map((e) => `${e.type}`).join(" | ")}>`;
  }
}
UzA = Symbol.toStringTag;
QW[UzA] = ((A) => (A.mode = null, A.typeIds = null, A.children = null, A.typeIdToChildIndex = null, A.ArrayType = Int8Array, A[Symbol.toStringTag] = "Union"))(QW.prototype);
let EW = class extends Ct {
  constructor(e) {
    super(), this.byteWidth = e;
  }
  get typeId() {
    return bA.FixedSizeBinary;
  }
  toString() {
    return `FixedSizeBinary[${this.byteWidth}]`;
  }
};
VzA = Symbol.toStringTag;
EW[VzA] = ((A) => (A.byteWidth = null, A.ArrayType = Uint8Array, A[Symbol.toStringTag] = "FixedSizeBinary"))(EW.prototype);
let uW = class extends Ct {
  constructor(e, t) {
    super(), this.listSize = e, this.children = [t];
  }
  get typeId() {
    return bA.FixedSizeList;
  }
  get valueType() {
    return this.children[0].type;
  }
  get valueField() {
    return this.children[0];
  }
  get ArrayType() {
    return this.valueType.ArrayType;
  }
  toString() {
    return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
  }
};
XzA = Symbol.toStringTag;
uW[XzA] = ((A) => (A.children = null, A.listSize = null, A[Symbol.toStringTag] = "FixedSizeList"))(uW.prototype);
class dW extends Ct {
  constructor(e, t = !1) {
    super(), this.children = [e], this.keysSorted = t;
  }
  get typeId() {
    return bA.Map;
  }
  get keyType() {
    return this.children[0].type.children[0].type;
  }
  get valueType() {
    return this.children[0].type.children[1].type;
  }
  get childType() {
    return this.children[0].type;
  }
  toString() {
    return `Map<{${this.children[0].type.children.map((e) => `${e.name}:${e.type}`).join(", ")}}>`;
  }
}
zzA = Symbol.toStringTag;
dW[zzA] = ((A) => (A.children = null, A.keysSorted = null, A[Symbol.toStringTag] = "Map_"))(dW.prototype);
const jDt = ((A) => () => ++A)(-1);
class jf extends Ct {
  constructor(e, t, i, n) {
    super(), this.indices = t, this.dictionary = e, this.isOrdered = n || !1, this.id = i == null ? jDt() : typeof i == "number" ? i : i.low;
  }
  get typeId() {
    return bA.Dictionary;
  }
  get children() {
    return this.dictionary.children;
  }
  get valueType() {
    return this.dictionary;
  }
  get ArrayType() {
    return this.dictionary.ArrayType;
  }
  toString() {
    return `Dictionary<${this.indices}, ${this.dictionary}>`;
  }
}
TzA = Symbol.toStringTag;
jf[TzA] = ((A) => (A.id = null, A.indices = null, A.isOrdered = null, A.dictionary = null, A[Symbol.toStringTag] = "Dictionary"))(jf.prototype);
function Qc(A) {
  const e = A;
  switch (A.typeId) {
    case bA.Decimal:
      return A.bitWidth / 32;
    case bA.Timestamp:
      return 2;
    case bA.Date:
      return 1 + e.unit;
    case bA.Interval:
      return 1 + e.unit;
    case bA.FixedSizeList:
      return e.listSize;
    case bA.FixedSizeBinary:
      return e.byteWidth;
    default:
      return 1;
  }
}
class zt {
  visitMany(e, ...t) {
    return e.map((i, n) => this.visit(i, ...t.map((o) => o[n])));
  }
  visit(...e) {
    return this.getVisitFn(e[0], !1).apply(this, e);
  }
  getVisitFn(e, t = !0) {
    return PDt(this, e, t);
  }
  getVisitFnByTypeId(e, t = !0) {
    return lb(this, e, t);
  }
  visitNull(e, ...t) {
    return null;
  }
  visitBool(e, ...t) {
    return null;
  }
  visitInt(e, ...t) {
    return null;
  }
  visitFloat(e, ...t) {
    return null;
  }
  visitUtf8(e, ...t) {
    return null;
  }
  visitBinary(e, ...t) {
    return null;
  }
  visitFixedSizeBinary(e, ...t) {
    return null;
  }
  visitDate(e, ...t) {
    return null;
  }
  visitTimestamp(e, ...t) {
    return null;
  }
  visitTime(e, ...t) {
    return null;
  }
  visitDecimal(e, ...t) {
    return null;
  }
  visitList(e, ...t) {
    return null;
  }
  visitStruct(e, ...t) {
    return null;
  }
  visitUnion(e, ...t) {
    return null;
  }
  visitDictionary(e, ...t) {
    return null;
  }
  visitInterval(e, ...t) {
    return null;
  }
  visitFixedSizeList(e, ...t) {
    return null;
  }
  visitMap(e, ...t) {
    return null;
  }
}
function PDt(A, e, t = !0) {
  return typeof e == "number" ? lb(A, e, t) : typeof e == "string" && e in bA ? lb(A, bA[e], t) : e && e instanceof Ct ? lb(A, OyA(e), t) : e != null && e.type && e.type instanceof Ct ? lb(A, OyA(e.type), t) : lb(A, bA.NONE, t);
}
function lb(A, e, t = !0) {
  let i = null;
  switch (e) {
    case bA.Null:
      i = A.visitNull;
      break;
    case bA.Bool:
      i = A.visitBool;
      break;
    case bA.Int:
      i = A.visitInt;
      break;
    case bA.Int8:
      i = A.visitInt8 || A.visitInt;
      break;
    case bA.Int16:
      i = A.visitInt16 || A.visitInt;
      break;
    case bA.Int32:
      i = A.visitInt32 || A.visitInt;
      break;
    case bA.Int64:
      i = A.visitInt64 || A.visitInt;
      break;
    case bA.Uint8:
      i = A.visitUint8 || A.visitInt;
      break;
    case bA.Uint16:
      i = A.visitUint16 || A.visitInt;
      break;
    case bA.Uint32:
      i = A.visitUint32 || A.visitInt;
      break;
    case bA.Uint64:
      i = A.visitUint64 || A.visitInt;
      break;
    case bA.Float:
      i = A.visitFloat;
      break;
    case bA.Float16:
      i = A.visitFloat16 || A.visitFloat;
      break;
    case bA.Float32:
      i = A.visitFloat32 || A.visitFloat;
      break;
    case bA.Float64:
      i = A.visitFloat64 || A.visitFloat;
      break;
    case bA.Utf8:
      i = A.visitUtf8;
      break;
    case bA.Binary:
      i = A.visitBinary;
      break;
    case bA.FixedSizeBinary:
      i = A.visitFixedSizeBinary;
      break;
    case bA.Date:
      i = A.visitDate;
      break;
    case bA.DateDay:
      i = A.visitDateDay || A.visitDate;
      break;
    case bA.DateMillisecond:
      i = A.visitDateMillisecond || A.visitDate;
      break;
    case bA.Timestamp:
      i = A.visitTimestamp;
      break;
    case bA.TimestampSecond:
      i = A.visitTimestampSecond || A.visitTimestamp;
      break;
    case bA.TimestampMillisecond:
      i = A.visitTimestampMillisecond || A.visitTimestamp;
      break;
    case bA.TimestampMicrosecond:
      i = A.visitTimestampMicrosecond || A.visitTimestamp;
      break;
    case bA.TimestampNanosecond:
      i = A.visitTimestampNanosecond || A.visitTimestamp;
      break;
    case bA.Time:
      i = A.visitTime;
      break;
    case bA.TimeSecond:
      i = A.visitTimeSecond || A.visitTime;
      break;
    case bA.TimeMillisecond:
      i = A.visitTimeMillisecond || A.visitTime;
      break;
    case bA.TimeMicrosecond:
      i = A.visitTimeMicrosecond || A.visitTime;
      break;
    case bA.TimeNanosecond:
      i = A.visitTimeNanosecond || A.visitTime;
      break;
    case bA.Decimal:
      i = A.visitDecimal;
      break;
    case bA.List:
      i = A.visitList;
      break;
    case bA.Struct:
      i = A.visitStruct;
      break;
    case bA.Union:
      i = A.visitUnion;
      break;
    case bA.DenseUnion:
      i = A.visitDenseUnion || A.visitUnion;
      break;
    case bA.SparseUnion:
      i = A.visitSparseUnion || A.visitUnion;
      break;
    case bA.Dictionary:
      i = A.visitDictionary;
      break;
    case bA.Interval:
      i = A.visitInterval;
      break;
    case bA.IntervalDayTime:
      i = A.visitIntervalDayTime || A.visitInterval;
      break;
    case bA.IntervalYearMonth:
      i = A.visitIntervalYearMonth || A.visitInterval;
      break;
    case bA.FixedSizeList:
      i = A.visitFixedSizeList;
      break;
    case bA.Map:
      i = A.visitMap;
      break;
  }
  if (typeof i == "function")
    return i;
  if (!t)
    return () => null;
  throw new Error(`Unrecognized type '${bA[e]}'`);
}
function OyA(A) {
  switch (A.typeId) {
    case bA.Null:
      return bA.Null;
    case bA.Int: {
      const { bitWidth: e, isSigned: t } = A;
      switch (e) {
        case 8:
          return t ? bA.Int8 : bA.Uint8;
        case 16:
          return t ? bA.Int16 : bA.Uint16;
        case 32:
          return t ? bA.Int32 : bA.Uint32;
        case 64:
          return t ? bA.Int64 : bA.Uint64;
      }
      return bA.Int;
    }
    case bA.Float:
      switch (A.precision) {
        case Xs.HALF:
          return bA.Float16;
        case Xs.SINGLE:
          return bA.Float32;
        case Xs.DOUBLE:
          return bA.Float64;
      }
      return bA.Float;
    case bA.Binary:
      return bA.Binary;
    case bA.Utf8:
      return bA.Utf8;
    case bA.Bool:
      return bA.Bool;
    case bA.Decimal:
      return bA.Decimal;
    case bA.Time:
      switch (A.unit) {
        case ci.SECOND:
          return bA.TimeSecond;
        case ci.MILLISECOND:
          return bA.TimeMillisecond;
        case ci.MICROSECOND:
          return bA.TimeMicrosecond;
        case ci.NANOSECOND:
          return bA.TimeNanosecond;
      }
      return bA.Time;
    case bA.Timestamp:
      switch (A.unit) {
        case ci.SECOND:
          return bA.TimestampSecond;
        case ci.MILLISECOND:
          return bA.TimestampMillisecond;
        case ci.MICROSECOND:
          return bA.TimestampMicrosecond;
        case ci.NANOSECOND:
          return bA.TimestampNanosecond;
      }
      return bA.Timestamp;
    case bA.Date:
      switch (A.unit) {
        case bQ.DAY:
          return bA.DateDay;
        case bQ.MILLISECOND:
          return bA.DateMillisecond;
      }
      return bA.Date;
    case bA.Interval:
      switch (A.unit) {
        case ld.DAY_TIME:
          return bA.IntervalDayTime;
        case ld.YEAR_MONTH:
          return bA.IntervalYearMonth;
      }
      return bA.Interval;
    case bA.Map:
      return bA.Map;
    case bA.List:
      return bA.List;
    case bA.Struct:
      return bA.Struct;
    case bA.Union:
      switch (A.mode) {
        case na.Dense:
          return bA.DenseUnion;
        case na.Sparse:
          return bA.SparseUnion;
      }
      return bA.Union;
    case bA.FixedSizeBinary:
      return bA.FixedSizeBinary;
    case bA.FixedSizeList:
      return bA.FixedSizeList;
    case bA.Dictionary:
      return bA.Dictionary;
  }
  throw new Error(`Unrecognized type '${bA[A.typeId]}'`);
}
zt.prototype.visitInt8 = null;
zt.prototype.visitInt16 = null;
zt.prototype.visitInt32 = null;
zt.prototype.visitInt64 = null;
zt.prototype.visitUint8 = null;
zt.prototype.visitUint16 = null;
zt.prototype.visitUint32 = null;
zt.prototype.visitUint64 = null;
zt.prototype.visitFloat16 = null;
zt.prototype.visitFloat32 = null;
zt.prototype.visitFloat64 = null;
zt.prototype.visitDateDay = null;
zt.prototype.visitDateMillisecond = null;
zt.prototype.visitTimestampSecond = null;
zt.prototype.visitTimestampMillisecond = null;
zt.prototype.visitTimestampMicrosecond = null;
zt.prototype.visitTimestampNanosecond = null;
zt.prototype.visitTimeSecond = null;
zt.prototype.visitTimeMillisecond = null;
zt.prototype.visitTimeMicrosecond = null;
zt.prototype.visitTimeNanosecond = null;
zt.prototype.visitDenseUnion = null;
zt.prototype.visitSparseUnion = null;
zt.prototype.visitIntervalDayTime = null;
zt.prototype.visitIntervalYearMonth = null;
const _zA = new Float64Array(1), Fy = new Uint32Array(_zA.buffer);
function qzA(A) {
  const e = (A & 31744) >> 10, t = (A & 1023) / 1024, i = Math.pow(-1, (A & 32768) >> 15);
  switch (e) {
    case 31:
      return i * (t ? Number.NaN : 1 / 0);
    case 0:
      return i * (t ? 6103515625e-14 * t : 0);
  }
  return i * Math.pow(2, e - 15) * (1 + t);
}
function $Dt(A) {
  if (A !== A)
    return 32256;
  _zA[0] = A;
  const e = (Fy[1] & 2147483648) >> 16 & 65535;
  let t = Fy[1] & 2146435072, i = 0;
  return t >= 1089470464 ? Fy[0] > 0 ? t = 31744 : (t = (t & 2080374784) >> 16, i = (Fy[1] & 1048575) >> 10) : t <= 1056964608 ? (i = 1048576 + (Fy[1] & 1048575), i = 1048576 + (i << (t >> 20) - 998) >> 21, t = 0) : (t = t - 1056964608 >> 10, i = (Fy[1] & 1048575) + 512 >> 10), e | t | i & 65535;
}
class ut extends zt {
}
function bt(A) {
  return (e, t, i) => {
    if (e.setValid(t, i != null))
      return A(e, t, i);
  };
}
const AGt = (A, e, t) => {
  A[e] = Math.trunc(t / 864e5);
}, HsA = (A, e, t) => {
  A[e] = Math.trunc(t % 4294967296), A[e + 1] = Math.trunc(t / 4294967296);
}, eGt = (A, e, t) => {
  A[e] = Math.trunc(t * 1e3 % 4294967296), A[e + 1] = Math.trunc(t * 1e3 / 4294967296);
}, tGt = (A, e, t) => {
  A[e] = Math.trunc(t * 1e6 % 4294967296), A[e + 1] = Math.trunc(t * 1e6 / 4294967296);
}, OzA = (A, e, t, i) => {
  if (t + 1 < e.length) {
    const { [t]: n, [t + 1]: o } = e;
    A.set(i.subarray(0, o - n), n);
  }
}, iGt = ({ offset: A, values: e }, t, i) => {
  const n = A + t;
  i ? e[n >> 3] |= 1 << n % 8 : e[n >> 3] &= ~(1 << n % 8);
}, TQ = ({ values: A }, e, t) => {
  A[e] = t;
}, SsA = ({ values: A }, e, t) => {
  A[e] = t;
}, jzA = ({ values: A }, e, t) => {
  A[e] = $Dt(t);
}, nGt = (A, e, t) => {
  switch (A.type.precision) {
    case Xs.HALF:
      return jzA(A, e, t);
    case Xs.SINGLE:
    case Xs.DOUBLE:
      return SsA(A, e, t);
  }
}, PzA = ({ values: A }, e, t) => {
  AGt(A, e, t.valueOf());
}, $zA = ({ values: A }, e, t) => {
  HsA(A, e * 2, t.valueOf());
}, oGt = ({ stride: A, values: e }, t, i) => {
  e.set(i.subarray(0, A), A * t);
}, gGt = ({ values: A, valueOffsets: e }, t, i) => OzA(A, e, t, i), sGt = ({ values: A, valueOffsets: e }, t, i) => {
  OzA(A, e, t, FsA(i));
}, IGt = (A, e, t) => {
  A.type.unit === bQ.DAY ? PzA(A, e, t) : $zA(A, e, t);
}, ATA = ({ values: A }, e, t) => HsA(A, e * 2, t / 1e3), eTA = ({ values: A }, e, t) => HsA(A, e * 2, t), tTA = ({ values: A }, e, t) => eGt(A, e * 2, t), iTA = ({ values: A }, e, t) => tGt(A, e * 2, t), aGt = (A, e, t) => {
  switch (A.type.unit) {
    case ci.SECOND:
      return ATA(A, e, t);
    case ci.MILLISECOND:
      return eTA(A, e, t);
    case ci.MICROSECOND:
      return tTA(A, e, t);
    case ci.NANOSECOND:
      return iTA(A, e, t);
  }
}, nTA = ({ values: A }, e, t) => {
  A[e] = t;
}, oTA = ({ values: A }, e, t) => {
  A[e] = t;
}, gTA = ({ values: A }, e, t) => {
  A[e] = t;
}, sTA = ({ values: A }, e, t) => {
  A[e] = t;
}, rGt = (A, e, t) => {
  switch (A.type.unit) {
    case ci.SECOND:
      return nTA(A, e, t);
    case ci.MILLISECOND:
      return oTA(A, e, t);
    case ci.MICROSECOND:
      return gTA(A, e, t);
    case ci.NANOSECOND:
      return sTA(A, e, t);
  }
}, CGt = ({ values: A, stride: e }, t, i) => {
  A.set(i.subarray(0, e), e * t);
}, BGt = (A, e, t) => {
  const i = A.children[0], n = A.valueOffsets, o = rr.getVisitFn(i);
  if (Array.isArray(t))
    for (let g = -1, s = n[e], I = n[e + 1]; s < I; )
      o(i, s++, t[++g]);
  else
    for (let g = -1, s = n[e], I = n[e + 1]; s < I; )
      o(i, s++, t.get(++g));
}, lGt = (A, e, t) => {
  const i = A.children[0], { valueOffsets: n } = A, o = rr.getVisitFn(i);
  let { [e]: g, [e + 1]: s } = n;
  const I = t instanceof Map ? t.entries() : Object.entries(t);
  for (const r of I)
    if (o(i, g, r), ++g >= s)
      break;
}, cGt = (A, e) => (t, i, n, o) => i && t(i, A, e[o]), QGt = (A, e) => (t, i, n, o) => i && t(i, A, e.get(o)), EGt = (A, e) => (t, i, n, o) => i && t(i, A, e.get(n.name)), uGt = (A, e) => (t, i, n, o) => i && t(i, A, e[n.name]), dGt = (A, e, t) => {
  const i = A.type.children.map((o) => rr.getVisitFn(o.type)), n = t instanceof Map ? EGt(e, t) : t instanceof pi ? QGt(e, t) : Array.isArray(t) ? cGt(e, t) : uGt(e, t);
  A.type.children.forEach((o, g) => n(i[g], A.children[g], o, g));
}, hGt = (A, e, t) => {
  A.type.mode === na.Dense ? ITA(A, e, t) : aTA(A, e, t);
}, ITA = (A, e, t) => {
  const i = A.type.typeIdToChildIndex[A.typeIds[e]], n = A.children[i];
  rr.visit(n, A.valueOffsets[e], t);
}, aTA = (A, e, t) => {
  const i = A.type.typeIdToChildIndex[A.typeIds[e]], n = A.children[i];
  rr.visit(n, e, t);
}, mGt = (A, e, t) => {
  var i;
  (i = A.dictionary) === null || i === void 0 || i.set(A.values[e], t);
}, pGt = (A, e, t) => {
  A.type.unit === ld.DAY_TIME ? rTA(A, e, t) : CTA(A, e, t);
}, rTA = ({ values: A }, e, t) => {
  A.set(t.subarray(0, 2), 2 * e);
}, CTA = ({ values: A }, e, t) => {
  A[e] = t[0] * 12 + t[1] % 12;
}, yGt = (A, e, t) => {
  const { stride: i } = A, n = A.children[0], o = rr.getVisitFn(n);
  if (Array.isArray(t))
    for (let g = -1, s = e * i; ++g < i; )
      o(n, s + g, t[g]);
  else
    for (let g = -1, s = e * i; ++g < i; )
      o(n, s + g, t.get(g));
};
ut.prototype.visitBool = bt(iGt);
ut.prototype.visitInt = bt(TQ);
ut.prototype.visitInt8 = bt(TQ);
ut.prototype.visitInt16 = bt(TQ);
ut.prototype.visitInt32 = bt(TQ);
ut.prototype.visitInt64 = bt(TQ);
ut.prototype.visitUint8 = bt(TQ);
ut.prototype.visitUint16 = bt(TQ);
ut.prototype.visitUint32 = bt(TQ);
ut.prototype.visitUint64 = bt(TQ);
ut.prototype.visitFloat = bt(nGt);
ut.prototype.visitFloat16 = bt(jzA);
ut.prototype.visitFloat32 = bt(SsA);
ut.prototype.visitFloat64 = bt(SsA);
ut.prototype.visitUtf8 = bt(sGt);
ut.prototype.visitBinary = bt(gGt);
ut.prototype.visitFixedSizeBinary = bt(oGt);
ut.prototype.visitDate = bt(IGt);
ut.prototype.visitDateDay = bt(PzA);
ut.prototype.visitDateMillisecond = bt($zA);
ut.prototype.visitTimestamp = bt(aGt);
ut.prototype.visitTimestampSecond = bt(ATA);
ut.prototype.visitTimestampMillisecond = bt(eTA);
ut.prototype.visitTimestampMicrosecond = bt(tTA);
ut.prototype.visitTimestampNanosecond = bt(iTA);
ut.prototype.visitTime = bt(rGt);
ut.prototype.visitTimeSecond = bt(nTA);
ut.prototype.visitTimeMillisecond = bt(oTA);
ut.prototype.visitTimeMicrosecond = bt(gTA);
ut.prototype.visitTimeNanosecond = bt(sTA);
ut.prototype.visitDecimal = bt(CGt);
ut.prototype.visitList = bt(BGt);
ut.prototype.visitStruct = bt(dGt);
ut.prototype.visitUnion = bt(hGt);
ut.prototype.visitDenseUnion = bt(ITA);
ut.prototype.visitSparseUnion = bt(aTA);
ut.prototype.visitDictionary = bt(mGt);
ut.prototype.visitInterval = bt(pGt);
ut.prototype.visitIntervalDayTime = bt(rTA);
ut.prototype.visitIntervalYearMonth = bt(CTA);
ut.prototype.visitFixedSizeList = bt(yGt);
ut.prototype.visitMap = bt(lGt);
const rr = new ut(), Hr = Symbol.for("parent"), fw = Symbol.for("rowIndex");
class ZsA {
  constructor(e, t) {
    return this[Hr] = e, this[fw] = t, new Proxy(this, new wGt());
  }
  toArray() {
    return Object.values(this.toJSON());
  }
  toJSON() {
    const e = this[fw], t = this[Hr], i = t.type.children, n = {};
    for (let o = -1, g = i.length; ++o < g; )
      n[i[o].name] = tI.visit(t.children[o], e);
    return n;
  }
  toString() {
    return `{${[...this].map(([e, t]) => `${L2(e)}: ${L2(t)}`).join(", ")}}`;
  }
  [Symbol.for("nodejs.util.inspect.custom")]() {
    return this.toString();
  }
  [Symbol.iterator]() {
    return new bGt(this[Hr], this[fw]);
  }
}
class bGt {
  constructor(e, t) {
    this.childIndex = 0, this.children = e.children, this.rowIndex = t, this.childFields = e.type.children, this.numChildren = this.childFields.length;
  }
  [Symbol.iterator]() {
    return this;
  }
  next() {
    const e = this.childIndex;
    return e < this.numChildren ? (this.childIndex = e + 1, {
      done: !1,
      value: [
        this.childFields[e].name,
        tI.visit(this.children[e], this.rowIndex)
      ]
    }) : { done: !0, value: null };
  }
}
Object.defineProperties(ZsA.prototype, {
  [Symbol.toStringTag]: { enumerable: !1, configurable: !1, value: "Row" },
  [Hr]: { writable: !0, enumerable: !1, configurable: !1, value: null },
  [fw]: { writable: !0, enumerable: !1, configurable: !1, value: -1 }
});
class wGt {
  isExtensible() {
    return !1;
  }
  deleteProperty() {
    return !1;
  }
  preventExtensions() {
    return !0;
  }
  ownKeys(e) {
    return e[Hr].type.children.map((t) => t.name);
  }
  has(e, t) {
    return e[Hr].type.children.findIndex((i) => i.name === t) !== -1;
  }
  getOwnPropertyDescriptor(e, t) {
    if (e[Hr].type.children.findIndex((i) => i.name === t) !== -1)
      return { writable: !0, enumerable: !0, configurable: !0 };
  }
  get(e, t) {
    if (Reflect.has(e, t))
      return e[t];
    const i = e[Hr].type.children.findIndex((n) => n.name === t);
    if (i !== -1) {
      const n = tI.visit(e[Hr].children[i], e[fw]);
      return Reflect.set(e, t, n), n;
    }
  }
  set(e, t, i) {
    const n = e[Hr].type.children.findIndex((o) => o.name === t);
    return n !== -1 ? (rr.visit(e[Hr].children[n], e[fw], i), Reflect.set(e, t, i)) : Reflect.has(e, t) || typeof t == "symbol" ? Reflect.set(e, t, i) : !1;
  }
}
class Bt extends zt {
}
function dt(A) {
  return (e, t) => e.getValid(t) ? A(e, t) : null;
}
const fGt = (A, e) => 864e5 * A[e], WsA = (A, e) => 4294967296 * A[e + 1] + (A[e] >>> 0), DGt = (A, e) => 4294967296 * (A[e + 1] / 1e3) + (A[e] >>> 0) / 1e3, GGt = (A, e) => 4294967296 * (A[e + 1] / 1e6) + (A[e] >>> 0) / 1e6, BTA = (A) => new Date(A), kGt = (A, e) => BTA(fGt(A, e)), JGt = (A, e) => BTA(WsA(A, e)), NGt = (A, e) => null, lTA = (A, e, t) => {
  if (t + 1 >= e.length)
    return null;
  const i = e[t], n = e[t + 1];
  return A.subarray(i, n);
}, YGt = ({ offset: A, values: e }, t) => {
  const i = A + t;
  return (e[i >> 3] & 1 << i % 8) !== 0;
}, cTA = ({ values: A }, e) => kGt(A, e), QTA = ({ values: A }, e) => JGt(A, e * 2), eh = ({ stride: A, values: e }, t) => e[A * t], RGt = ({ stride: A, values: e }, t) => qzA(e[A * t]), ETA = ({ values: A }, e) => A[e], FGt = ({ stride: A, values: e }, t) => e.subarray(A * t, A * (t + 1)), MGt = ({ values: A, valueOffsets: e }, t) => lTA(A, e, t), xGt = ({ values: A, valueOffsets: e }, t) => {
  const i = lTA(A, e, t);
  return i !== null ? u6(i) : null;
}, LGt = ({ values: A }, e) => A[e], vGt = ({ type: A, values: e }, t) => A.precision !== Xs.HALF ? e[t] : qzA(e[t]), HGt = (A, e) => A.type.unit === bQ.DAY ? cTA(A, e) : QTA(A, e), uTA = ({ values: A }, e) => 1e3 * WsA(A, e * 2), dTA = ({ values: A }, e) => WsA(A, e * 2), hTA = ({ values: A }, e) => DGt(A, e * 2), mTA = ({ values: A }, e) => GGt(A, e * 2), SGt = (A, e) => {
  switch (A.type.unit) {
    case ci.SECOND:
      return uTA(A, e);
    case ci.MILLISECOND:
      return dTA(A, e);
    case ci.MICROSECOND:
      return hTA(A, e);
    case ci.NANOSECOND:
      return mTA(A, e);
  }
}, pTA = ({ values: A }, e) => A[e], yTA = ({ values: A }, e) => A[e], bTA = ({ values: A }, e) => A[e], wTA = ({ values: A }, e) => A[e], ZGt = (A, e) => {
  switch (A.type.unit) {
    case ci.SECOND:
      return pTA(A, e);
    case ci.MILLISECOND:
      return yTA(A, e);
    case ci.MICROSECOND:
      return bTA(A, e);
    case ci.NANOSECOND:
      return wTA(A, e);
  }
}, WGt = ({ values: A, stride: e }, t) => vsA.decimal(A.subarray(e * t, e * (t + 1))), KGt = (A, e) => {
  const { valueOffsets: t, stride: i, children: n } = A, { [e * i]: o, [e * i + 1]: g } = t, I = n[0].slice(o, g - o);
  return new pi([I]);
}, UGt = (A, e) => {
  const { valueOffsets: t, children: i } = A, { [e]: n, [e + 1]: o } = t, g = i[0];
  return new KsA(g.slice(n, o - n));
}, VGt = (A, e) => new ZsA(A, e), XGt = (A, e) => A.type.mode === na.Dense ? fTA(A, e) : DTA(A, e), fTA = (A, e) => {
  const t = A.type.typeIdToChildIndex[A.typeIds[e]], i = A.children[t];
  return tI.visit(i, A.valueOffsets[e]);
}, DTA = (A, e) => {
  const t = A.type.typeIdToChildIndex[A.typeIds[e]], i = A.children[t];
  return tI.visit(i, e);
}, zGt = (A, e) => {
  var t;
  return (t = A.dictionary) === null || t === void 0 ? void 0 : t.get(A.values[e]);
}, TGt = (A, e) => A.type.unit === ld.DAY_TIME ? GTA(A, e) : kTA(A, e), GTA = ({ values: A }, e) => A.subarray(2 * e, 2 * (e + 1)), kTA = ({ values: A }, e) => {
  const t = A[e], i = new Int32Array(2);
  return i[0] = Math.trunc(t / 12), i[1] = Math.trunc(t % 12), i;
}, _Gt = (A, e) => {
  const { stride: t, children: i } = A, o = i[0].slice(e * t, t);
  return new pi([o]);
};
Bt.prototype.visitNull = dt(NGt);
Bt.prototype.visitBool = dt(YGt);
Bt.prototype.visitInt = dt(LGt);
Bt.prototype.visitInt8 = dt(eh);
Bt.prototype.visitInt16 = dt(eh);
Bt.prototype.visitInt32 = dt(eh);
Bt.prototype.visitInt64 = dt(ETA);
Bt.prototype.visitUint8 = dt(eh);
Bt.prototype.visitUint16 = dt(eh);
Bt.prototype.visitUint32 = dt(eh);
Bt.prototype.visitUint64 = dt(ETA);
Bt.prototype.visitFloat = dt(vGt);
Bt.prototype.visitFloat16 = dt(RGt);
Bt.prototype.visitFloat32 = dt(eh);
Bt.prototype.visitFloat64 = dt(eh);
Bt.prototype.visitUtf8 = dt(xGt);
Bt.prototype.visitBinary = dt(MGt);
Bt.prototype.visitFixedSizeBinary = dt(FGt);
Bt.prototype.visitDate = dt(HGt);
Bt.prototype.visitDateDay = dt(cTA);
Bt.prototype.visitDateMillisecond = dt(QTA);
Bt.prototype.visitTimestamp = dt(SGt);
Bt.prototype.visitTimestampSecond = dt(uTA);
Bt.prototype.visitTimestampMillisecond = dt(dTA);
Bt.prototype.visitTimestampMicrosecond = dt(hTA);
Bt.prototype.visitTimestampNanosecond = dt(mTA);
Bt.prototype.visitTime = dt(ZGt);
Bt.prototype.visitTimeSecond = dt(pTA);
Bt.prototype.visitTimeMillisecond = dt(yTA);
Bt.prototype.visitTimeMicrosecond = dt(bTA);
Bt.prototype.visitTimeNanosecond = dt(wTA);
Bt.prototype.visitDecimal = dt(WGt);
Bt.prototype.visitList = dt(KGt);
Bt.prototype.visitStruct = dt(VGt);
Bt.prototype.visitUnion = dt(XGt);
Bt.prototype.visitDenseUnion = dt(fTA);
Bt.prototype.visitSparseUnion = dt(DTA);
Bt.prototype.visitDictionary = dt(zGt);
Bt.prototype.visitInterval = dt(TGt);
Bt.prototype.visitIntervalDayTime = dt(GTA);
Bt.prototype.visitIntervalYearMonth = dt(kTA);
Bt.prototype.visitFixedSizeList = dt(_Gt);
Bt.prototype.visitMap = dt(UGt);
const tI = new Bt(), mB = Symbol.for("keys"), Dw = Symbol.for("vals");
class KsA {
  constructor(e) {
    return this[mB] = new pi([e.children[0]]).memoize(), this[Dw] = e.children[1], new Proxy(this, new OGt());
  }
  [Symbol.iterator]() {
    return new qGt(this[mB], this[Dw]);
  }
  get size() {
    return this[mB].length;
  }
  toArray() {
    return Object.values(this.toJSON());
  }
  toJSON() {
    const e = this[mB], t = this[Dw], i = {};
    for (let n = -1, o = e.length; ++n < o; )
      i[e.get(n)] = tI.visit(t, n);
    return i;
  }
  toString() {
    return `{${[...this].map(([e, t]) => `${L2(e)}: ${L2(t)}`).join(", ")}}`;
  }
  [Symbol.for("nodejs.util.inspect.custom")]() {
    return this.toString();
  }
}
class qGt {
  constructor(e, t) {
    this.keys = e, this.vals = t, this.keyIndex = 0, this.numKeys = e.length;
  }
  [Symbol.iterator]() {
    return this;
  }
  next() {
    const e = this.keyIndex;
    return e === this.numKeys ? { done: !0, value: null } : (this.keyIndex++, {
      done: !1,
      value: [
        this.keys.get(e),
        tI.visit(this.vals, e)
      ]
    });
  }
}
class OGt {
  isExtensible() {
    return !1;
  }
  deleteProperty() {
    return !1;
  }
  preventExtensions() {
    return !0;
  }
  ownKeys(e) {
    return e[mB].toArray().map(String);
  }
  has(e, t) {
    return e[mB].includes(t);
  }
  getOwnPropertyDescriptor(e, t) {
    if (e[mB].indexOf(t) !== -1)
      return { writable: !0, enumerable: !0, configurable: !0 };
  }
  get(e, t) {
    if (Reflect.has(e, t))
      return e[t];
    const i = e[mB].indexOf(t);
    if (i !== -1) {
      const n = tI.visit(Reflect.get(e, Dw), i);
      return Reflect.set(e, t, n), n;
    }
  }
  set(e, t, i) {
    const n = e[mB].indexOf(t);
    return n !== -1 ? (rr.visit(Reflect.get(e, Dw), n, i), Reflect.set(e, t, i)) : Reflect.has(e, t) ? Reflect.set(e, t, i) : !1;
  }
}
Object.defineProperties(KsA.prototype, {
  [Symbol.toStringTag]: { enumerable: !1, configurable: !1, value: "Row" },
  [mB]: { writable: !0, enumerable: !1, configurable: !1, value: null },
  [Dw]: { writable: !0, enumerable: !1, configurable: !1, value: null }
});
let jyA;
function JTA(A, e, t, i) {
  const { length: n = 0 } = A;
  let o = typeof e != "number" ? 0 : e, g = typeof t != "number" ? n : t;
  return o < 0 && (o = (o % n + n) % n), g < 0 && (g = (g % n + n) % n), g < o && (jyA = o, o = g, g = jyA), g > n && (g = n), i ? i(A, o, g) : [o, g];
}
const PyA = (A) => A !== A;
function GG(A) {
  if (typeof A !== "object" || A === null)
    return PyA(A) ? PyA : (t) => t === A;
  if (A instanceof Date) {
    const t = A.valueOf();
    return (i) => i instanceof Date ? i.valueOf() === t : !1;
  }
  return ArrayBuffer.isView(A) ? (t) => t ? UDt(A, t) : !1 : A instanceof Map ? PGt(A) : Array.isArray(A) ? jGt(A) : A instanceof pi ? $Gt(A) : Akt(A, !0);
}
function jGt(A) {
  const e = [];
  for (let t = -1, i = A.length; ++t < i; )
    e[t] = GG(A[t]);
  return FX(e);
}
function PGt(A) {
  let e = -1;
  const t = [];
  for (const i of A.values())
    t[++e] = GG(i);
  return FX(t);
}
function $Gt(A) {
  const e = [];
  for (let t = -1, i = A.length; ++t < i; )
    e[t] = GG(A.get(t));
  return FX(e);
}
function Akt(A, e = !1) {
  const t = Object.keys(A);
  if (!e && t.length === 0)
    return () => !1;
  const i = [];
  for (let n = -1, o = t.length; ++n < o; )
    i[n] = GG(A[t[n]]);
  return FX(i, t);
}
function FX(A, e) {
  return (t) => {
    if (!t || typeof t != "object")
      return !1;
    switch (t.constructor) {
      case Array:
        return ekt(A, t);
      case Map:
        return $yA(A, t, t.keys());
      case KsA:
      case ZsA:
      case Object:
      case void 0:
        return $yA(A, t, e || Object.keys(t));
    }
    return t instanceof pi ? tkt(A, t) : !1;
  };
}
function ekt(A, e) {
  const t = A.length;
  if (e.length !== t)
    return !1;
  for (let i = -1; ++i < t; )
    if (!A[i](e[i]))
      return !1;
  return !0;
}
function tkt(A, e) {
  const t = A.length;
  if (e.length !== t)
    return !1;
  for (let i = -1; ++i < t; )
    if (!A[i](e.get(i)))
      return !1;
  return !0;
}
function $yA(A, e, t) {
  const i = t[Symbol.iterator](), n = e instanceof Map ? e.keys() : Object.keys(e)[Symbol.iterator](), o = e instanceof Map ? e.values() : Object.values(e)[Symbol.iterator]();
  let g = 0;
  const s = A.length;
  let I = o.next(), r = i.next(), a = n.next();
  for (; g < s && !r.done && !a.done && !I.done && !(r.value !== a.value || !A[g](I.value)); ++g, r = i.next(), a = n.next(), I = o.next())
    ;
  return g === s && r.done && a.done && I.done ? !0 : (i.return && i.return(), n.return && n.return(), o.return && o.return(), !1);
}
function NTA(A, e, t, i) {
  return (t & 1 << i) !== 0;
}
function ikt(A, e, t, i) {
  return (t & 1 << i) >> i;
}
function UsA(A, e, t) {
  const i = t.byteLength + 7 & -8;
  if (A > 0 || t.byteLength < i) {
    const n = new Uint8Array(i);
    return n.set(A % 8 === 0 ? t.subarray(A >> 3) : (
      // Otherwise iterate each bit from the offset and return a new one
      hW(new VsA(t, A, e, null, NTA)).subarray(0, i)
    )), n;
  }
  return t;
}
function hW(A) {
  const e = [];
  let t = 0, i = 0, n = 0;
  for (const g of A)
    g && (n |= 1 << i), ++i === 8 && (e[t++] = n, n = i = 0);
  (t === 0 || i > 0) && (e[t++] = n);
  const o = new Uint8Array(e.length + 7 & -8);
  return o.set(e), o;
}
class VsA {
  constructor(e, t, i, n, o) {
    this.bytes = e, this.length = i, this.context = n, this.get = o, this.bit = t % 8, this.byteIndex = t >> 3, this.byte = e[this.byteIndex++], this.index = 0;
  }
  next() {
    return this.index < this.length ? (this.bit === 8 && (this.bit = 0, this.byte = this.bytes[this.byteIndex++]), {
      value: this.get(this.context, this.index++, this.byte, this.bit++)
    }) : { done: !0, value: null };
  }
  [Symbol.iterator]() {
    return this;
  }
}
function p6(A, e, t) {
  if (t - e <= 0)
    return 0;
  if (t - e < 8) {
    let o = 0;
    for (const g of new VsA(A, e, t - e, A, ikt))
      o += g;
    return o;
  }
  const i = t >> 3 << 3, n = e + (e % 8 === 0 ? 0 : 8 - e % 8);
  return (
    // Get the popcnt of bits between the left hand side, and the next highest multiple of 8
    p6(A, e, n) + // Get the popcnt of bits between the right hand side, and the next lowest multiple of 8
    p6(A, i, t) + // Get the popcnt of all bits between the left and right hand sides' multiples of 8
    nkt(A, n >> 3, i - n >> 3)
  );
}
function nkt(A, e, t) {
  let i = 0, n = Math.trunc(e);
  const o = new DataView(A.buffer, A.byteOffset, A.byteLength), g = t === void 0 ? A.byteLength : n + t;
  for (; g - n >= 4; )
    i += h_(o.getUint32(n)), n += 4;
  for (; g - n >= 2; )
    i += h_(o.getUint16(n)), n += 2;
  for (; g - n >= 1; )
    i += h_(o.getUint8(n)), n += 1;
  return i;
}
function h_(A) {
  let e = Math.trunc(A);
  return e = e - (e >>> 1 & 1431655765), e = (e & 858993459) + (e >>> 2 & 858993459), (e + (e >>> 4) & 252645135) * 16843009 >>> 24;
}
const okt = -1;
class zi {
  constructor(e, t, i, n, o, g = [], s) {
    this.type = e, this.children = g, this.dictionary = s, this.offset = Math.floor(Math.max(t || 0, 0)), this.length = Math.floor(Math.max(i || 0, 0)), this._nullCount = Math.floor(Math.max(n || 0, -1));
    let I;
    o instanceof zi ? (this.stride = o.stride, this.values = o.values, this.typeIds = o.typeIds, this.nullBitmap = o.nullBitmap, this.valueOffsets = o.valueOffsets) : (this.stride = Qc(e), o && ((I = o[0]) && (this.valueOffsets = I), (I = o[1]) && (this.values = I), (I = o[2]) && (this.nullBitmap = I), (I = o[3]) && (this.typeIds = I))), this.nullable = this._nullCount !== 0 && this.nullBitmap && this.nullBitmap.byteLength > 0;
  }
  get typeId() {
    return this.type.typeId;
  }
  get ArrayType() {
    return this.type.ArrayType;
  }
  get buffers() {
    return [this.valueOffsets, this.values, this.nullBitmap, this.typeIds];
  }
  get byteLength() {
    let e = 0;
    const { valueOffsets: t, values: i, nullBitmap: n, typeIds: o } = this;
    return t && (e += t.byteLength), i && (e += i.byteLength), n && (e += n.byteLength), o && (e += o.byteLength), this.children.reduce((g, s) => g + s.byteLength, e);
  }
  get nullCount() {
    let e = this._nullCount, t;
    return e <= okt && (t = this.nullBitmap) && (this._nullCount = e = this.length - p6(t, this.offset, this.offset + this.length)), e;
  }
  getValid(e) {
    if (this.nullable && this.nullCount > 0) {
      const t = this.offset + e;
      return (this.nullBitmap[t >> 3] & 1 << t % 8) !== 0;
    }
    return !0;
  }
  setValid(e, t) {
    if (!this.nullable)
      return t;
    if (!this.nullBitmap || this.nullBitmap.byteLength <= e >> 3) {
      const { nullBitmap: I } = this._changeLengthAndBackfillNullBitmap(this.length);
      Object.assign(this, { nullBitmap: I, _nullCount: 0 });
    }
    const { nullBitmap: i, offset: n } = this, o = n + e >> 3, g = (n + e) % 8, s = i[o] >> g & 1;
    return t ? s === 0 && (i[o] |= 1 << g, this._nullCount = this.nullCount + 1) : s === 1 && (i[o] &= ~(1 << g), this._nullCount = this.nullCount - 1), t;
  }
  clone(e = this.type, t = this.offset, i = this.length, n = this._nullCount, o = this, g = this.children) {
    return new zi(e, t, i, n, o, g, this.dictionary);
  }
  slice(e, t) {
    const { stride: i, typeId: n, children: o } = this, g = +(this._nullCount === 0) - 1, s = n === 16 ? i : 1, I = this._sliceBuffers(e, t, i, n);
    return this.clone(
      this.type,
      this.offset + e,
      t,
      g,
      I,
      // Don't slice children if we have value offsets (the variable-width types)
      o.length === 0 || this.valueOffsets ? o : this._sliceChildren(o, s * e, s * t)
    );
  }
  _changeLengthAndBackfillNullBitmap(e) {
    if (this.typeId === bA.Null)
      return this.clone(this.type, 0, e, 0);
    const { length: t, nullCount: i } = this, n = new Uint8Array((e + 63 & -64) >> 3).fill(255, 0, t >> 3);
    n[t >> 3] = (1 << t - (t & -8)) - 1, i > 0 && n.set(UsA(this.offset, t, this.nullBitmap), 0);
    const o = this.buffers;
    return o[cc.VALIDITY] = n, this.clone(this.type, 0, e, i + (e - t), o);
  }
  _sliceBuffers(e, t, i, n) {
    let o;
    const { buffers: g } = this;
    return (o = g[cc.TYPE]) && (g[cc.TYPE] = o.subarray(e, e + t)), (o = g[cc.OFFSET]) && (g[cc.OFFSET] = o.subarray(e, e + t + 1)) || // Otherwise if no offsets, slice the data buffer. Don't slice the data vector for Booleans, since the offset goes by bits not bytes
    (o = g[cc.DATA]) && (g[cc.DATA] = n === 6 ? o : o.subarray(i * e, i * (e + t))), g;
  }
  _sliceChildren(e, t, i) {
    return e.map((n) => n.slice(t, i));
  }
}
zi.prototype.children = Object.freeze([]);
class vN extends zt {
  visit(e) {
    return this.getVisitFn(e.type).call(this, e);
  }
  visitNull(e) {
    const { ["type"]: t, ["offset"]: i = 0, ["length"]: n = 0 } = e;
    return new zi(t, i, n, 0);
  }
  visitBool(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.ArrayType, e.data), { ["length"]: g = o.length >> 3, ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, o, n]);
  }
  visitInt(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.ArrayType, e.data), { ["length"]: g = o.length, ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, o, n]);
  }
  visitFloat(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.ArrayType, e.data), { ["length"]: g = o.length, ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, o, n]);
  }
  visitUtf8(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.data), o = li(e.nullBitmap), g = nJ(e.valueOffsets), { ["length"]: s = g.length - 1, ["nullCount"]: I = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, s, I, [g, n, o]);
  }
  visitBinary(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.data), o = li(e.nullBitmap), g = nJ(e.valueOffsets), { ["length"]: s = g.length - 1, ["nullCount"]: I = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, s, I, [g, n, o]);
  }
  visitFixedSizeBinary(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.ArrayType, e.data), { ["length"]: g = o.length / Qc(t), ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, o, n]);
  }
  visitDate(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.ArrayType, e.data), { ["length"]: g = o.length / Qc(t), ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, o, n]);
  }
  visitTimestamp(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.ArrayType, e.data), { ["length"]: g = o.length / Qc(t), ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, o, n]);
  }
  visitTime(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.ArrayType, e.data), { ["length"]: g = o.length / Qc(t), ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, o, n]);
  }
  visitDecimal(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.ArrayType, e.data), { ["length"]: g = o.length / Qc(t), ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, o, n]);
  }
  visitList(e) {
    const { ["type"]: t, ["offset"]: i = 0, ["child"]: n } = e, o = li(e.nullBitmap), g = nJ(e.valueOffsets), { ["length"]: s = g.length - 1, ["nullCount"]: I = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, s, I, [g, void 0, o], [n]);
  }
  visitStruct(e) {
    const { ["type"]: t, ["offset"]: i = 0, ["children"]: n = [] } = e, o = li(e.nullBitmap), { length: g = n.reduce((I, { length: r }) => Math.max(I, r), 0), nullCount: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, void 0, o], n);
  }
  visitUnion(e) {
    const { ["type"]: t, ["offset"]: i = 0, ["children"]: n = [] } = e, o = li(e.nullBitmap), g = Si(t.ArrayType, e.typeIds), { ["length"]: s = g.length, ["nullCount"]: I = e.nullBitmap ? -1 : 0 } = e;
    if (Ct.isSparseUnion(t))
      return new zi(t, i, s, I, [void 0, void 0, o, g], n);
    const r = nJ(e.valueOffsets);
    return new zi(t, i, s, I, [r, void 0, o, g], n);
  }
  visitDictionary(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.indices.ArrayType, e.data), { ["dictionary"]: g = new pi([new vN().visit({ type: t.dictionary })]) } = e, { ["length"]: s = o.length, ["nullCount"]: I = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, s, I, [void 0, o, n], [], g);
  }
  visitInterval(e) {
    const { ["type"]: t, ["offset"]: i = 0 } = e, n = li(e.nullBitmap), o = Si(t.ArrayType, e.data), { ["length"]: g = o.length / Qc(t), ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, o, n]);
  }
  visitFixedSizeList(e) {
    const { ["type"]: t, ["offset"]: i = 0, ["child"]: n = new vN().visit({ type: t.valueType }) } = e, o = li(e.nullBitmap), { ["length"]: g = n.length / Qc(t), ["nullCount"]: s = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, g, s, [void 0, void 0, o], [n]);
  }
  visitMap(e) {
    const { ["type"]: t, ["offset"]: i = 0, ["child"]: n = new vN().visit({ type: t.childType }) } = e, o = li(e.nullBitmap), g = nJ(e.valueOffsets), { ["length"]: s = g.length - 1, ["nullCount"]: I = e.nullBitmap ? -1 : 0 } = e;
    return new zi(t, i, s, I, [g, void 0, o], [n]);
  }
}
function Kt(A) {
  return new vN().visit(A);
}
class AbA {
  constructor(e = 0, t) {
    this.numChunks = e, this.getChunkIterator = t, this.chunkIndex = 0, this.chunkIterator = this.getChunkIterator(0);
  }
  next() {
    for (; this.chunkIndex < this.numChunks; ) {
      const e = this.chunkIterator.next();
      if (!e.done)
        return e;
      ++this.chunkIndex < this.numChunks && (this.chunkIterator = this.getChunkIterator(this.chunkIndex));
    }
    return { done: !0, value: null };
  }
  [Symbol.iterator]() {
    return this;
  }
}
function YTA(A) {
  return A.reduce((e, t) => e + t.nullCount, 0);
}
function RTA(A) {
  return A.reduce((e, t, i) => (e[i + 1] = e[i] + t.length, e), new Uint32Array(A.length + 1));
}
function FTA(A, e, t, i) {
  const n = [];
  for (let o = -1, g = A.length; ++o < g; ) {
    const s = A[o], I = e[o], { length: r } = s;
    if (I >= i)
      break;
    if (t >= I + r)
      continue;
    if (I >= t && I + r <= i) {
      n.push(s);
      continue;
    }
    const a = Math.max(0, t - I), C = Math.min(i - I, r);
    n.push(s.slice(a, C - a));
  }
  return n.length === 0 && n.push(A[0].slice(0, 0)), n;
}
function XsA(A, e, t, i) {
  let n = 0, o = 0, g = e.length - 1;
  do {
    if (n >= g - 1)
      return t < e[g] ? i(A, n, t - e[n]) : null;
    o = n + Math.trunc((g - n) * 0.5), t < e[o] ? g = o : n = o;
  } while (n < g);
}
function zsA(A, e) {
  return A.getValid(e);
}
function Gw(A) {
  function e(t, i, n) {
    return A(t[i], n);
  }
  return function(t) {
    const i = this.data;
    return XsA(i, this._offsets, t, e);
  };
}
function MTA(A) {
  let e;
  function t(i, n, o) {
    return A(i[n], o, e);
  }
  return function(i, n) {
    const o = this.data;
    e = n;
    const g = XsA(o, this._offsets, i, t);
    return e = void 0, g;
  };
}
function xTA(A) {
  let e;
  function t(i, n, o) {
    let g = o, s = 0, I = 0;
    for (let r = n - 1, a = i.length; ++r < a; ) {
      const C = i[r];
      if (~(s = A(C, e, g)))
        return I + s;
      g = 0, I += C.length;
    }
    return -1;
  }
  return function(i, n) {
    e = i;
    const o = this.data, g = typeof n != "number" ? t(o, 0, 0) : XsA(o, this._offsets, n, t);
    return e = void 0, g;
  };
}
class lt extends zt {
}
function gkt(A, e) {
  return e === null && A.length > 0 ? 0 : -1;
}
function skt(A, e) {
  const { nullBitmap: t } = A;
  if (!t || A.nullCount <= 0)
    return -1;
  let i = 0;
  for (const n of new VsA(t, A.offset + (e || 0), A.length, t, NTA)) {
    if (!n)
      return i;
    ++i;
  }
  return -1;
}
function Nt(A, e, t) {
  if (e === void 0)
    return -1;
  if (e === null)
    return skt(A, t);
  const i = tI.getVisitFn(A), n = GG(e);
  for (let o = (t || 0) - 1, g = A.length; ++o < g; )
    if (n(i(A, o)))
      return o;
  return -1;
}
function LTA(A, e, t) {
  const i = tI.getVisitFn(A), n = GG(e);
  for (let o = (t || 0) - 1, g = A.length; ++o < g; )
    if (n(i(A, o)))
      return o;
  return -1;
}
lt.prototype.visitNull = gkt;
lt.prototype.visitBool = Nt;
lt.prototype.visitInt = Nt;
lt.prototype.visitInt8 = Nt;
lt.prototype.visitInt16 = Nt;
lt.prototype.visitInt32 = Nt;
lt.prototype.visitInt64 = Nt;
lt.prototype.visitUint8 = Nt;
lt.prototype.visitUint16 = Nt;
lt.prototype.visitUint32 = Nt;
lt.prototype.visitUint64 = Nt;
lt.prototype.visitFloat = Nt;
lt.prototype.visitFloat16 = Nt;
lt.prototype.visitFloat32 = Nt;
lt.prototype.visitFloat64 = Nt;
lt.prototype.visitUtf8 = Nt;
lt.prototype.visitBinary = Nt;
lt.prototype.visitFixedSizeBinary = Nt;
lt.prototype.visitDate = Nt;
lt.prototype.visitDateDay = Nt;
lt.prototype.visitDateMillisecond = Nt;
lt.prototype.visitTimestamp = Nt;
lt.prototype.visitTimestampSecond = Nt;
lt.prototype.visitTimestampMillisecond = Nt;
lt.prototype.visitTimestampMicrosecond = Nt;
lt.prototype.visitTimestampNanosecond = Nt;
lt.prototype.visitTime = Nt;
lt.prototype.visitTimeSecond = Nt;
lt.prototype.visitTimeMillisecond = Nt;
lt.prototype.visitTimeMicrosecond = Nt;
lt.prototype.visitTimeNanosecond = Nt;
lt.prototype.visitDecimal = Nt;
lt.prototype.visitList = Nt;
lt.prototype.visitStruct = Nt;
lt.prototype.visitUnion = Nt;
lt.prototype.visitDenseUnion = LTA;
lt.prototype.visitSparseUnion = LTA;
lt.prototype.visitDictionary = Nt;
lt.prototype.visitInterval = Nt;
lt.prototype.visitIntervalDayTime = Nt;
lt.prototype.visitIntervalYearMonth = Nt;
lt.prototype.visitFixedSizeList = Nt;
lt.prototype.visitMap = Nt;
const mW = new lt();
class ct extends zt {
}
function ht(A) {
  const { type: e } = A;
  if (A.nullCount === 0 && A.stride === 1 && (e.typeId === bA.Timestamp || e instanceof Qd && e.bitWidth !== 64 || e instanceof Z2 && e.bitWidth !== 64 || e instanceof S2 && e.precision !== Xs.HALF))
    return new AbA(A.data.length, (i) => {
      const n = A.data[i];
      return n.values.subarray(0, n.length)[Symbol.iterator]();
    });
  let t = 0;
  return new AbA(A.data.length, (i) => {
    const o = A.data[i].length, g = A.slice(t, t + o);
    return t += o, new Ikt(g);
  });
}
class Ikt {
  constructor(e) {
    this.vector = e, this.index = 0;
  }
  next() {
    return this.index < this.vector.length ? {
      value: this.vector.get(this.index++)
    } : { done: !0, value: null };
  }
  [Symbol.iterator]() {
    return this;
  }
}
ct.prototype.visitNull = ht;
ct.prototype.visitBool = ht;
ct.prototype.visitInt = ht;
ct.prototype.visitInt8 = ht;
ct.prototype.visitInt16 = ht;
ct.prototype.visitInt32 = ht;
ct.prototype.visitInt64 = ht;
ct.prototype.visitUint8 = ht;
ct.prototype.visitUint16 = ht;
ct.prototype.visitUint32 = ht;
ct.prototype.visitUint64 = ht;
ct.prototype.visitFloat = ht;
ct.prototype.visitFloat16 = ht;
ct.prototype.visitFloat32 = ht;
ct.prototype.visitFloat64 = ht;
ct.prototype.visitUtf8 = ht;
ct.prototype.visitBinary = ht;
ct.prototype.visitFixedSizeBinary = ht;
ct.prototype.visitDate = ht;
ct.prototype.visitDateDay = ht;
ct.prototype.visitDateMillisecond = ht;
ct.prototype.visitTimestamp = ht;
ct.prototype.visitTimestampSecond = ht;
ct.prototype.visitTimestampMillisecond = ht;
ct.prototype.visitTimestampMicrosecond = ht;
ct.prototype.visitTimestampNanosecond = ht;
ct.prototype.visitTime = ht;
ct.prototype.visitTimeSecond = ht;
ct.prototype.visitTimeMillisecond = ht;
ct.prototype.visitTimeMicrosecond = ht;
ct.prototype.visitTimeNanosecond = ht;
ct.prototype.visitDecimal = ht;
ct.prototype.visitList = ht;
ct.prototype.visitStruct = ht;
ct.prototype.visitUnion = ht;
ct.prototype.visitDenseUnion = ht;
ct.prototype.visitSparseUnion = ht;
ct.prototype.visitDictionary = ht;
ct.prototype.visitInterval = ht;
ct.prototype.visitIntervalDayTime = ht;
ct.prototype.visitIntervalYearMonth = ht;
ct.prototype.visitFixedSizeList = ht;
ct.prototype.visitMap = ht;
const TsA = new ct(), akt = (A, e) => A + e;
class th extends zt {
  visitNull(e, t) {
    return 0;
  }
  visitInt(e, t) {
    return e.type.bitWidth / 8;
  }
  visitFloat(e, t) {
    return e.type.ArrayType.BYTES_PER_ELEMENT;
  }
  visitBool(e, t) {
    return 1 / 8;
  }
  visitDecimal(e, t) {
    return e.type.bitWidth / 8;
  }
  visitDate(e, t) {
    return (e.type.unit + 1) * 4;
  }
  visitTime(e, t) {
    return e.type.bitWidth / 8;
  }
  visitTimestamp(e, t) {
    return e.type.unit === ci.SECOND ? 4 : 8;
  }
  visitInterval(e, t) {
    return (e.type.unit + 1) * 4;
  }
  visitStruct(e, t) {
    return e.children.reduce((i, n) => i + El.visit(n, t), 0);
  }
  visitFixedSizeBinary(e, t) {
    return e.type.byteWidth;
  }
  visitMap(e, t) {
    return 8 + e.children.reduce((i, n) => i + El.visit(n, t), 0);
  }
  visitDictionary(e, t) {
    var i;
    return e.type.indices.bitWidth / 8 + (((i = e.dictionary) === null || i === void 0 ? void 0 : i.getByteLength(e.values[t])) || 0);
  }
}
const rkt = ({ valueOffsets: A }, e) => 8 + (A[e + 1] - A[e]), Ckt = ({ valueOffsets: A }, e) => 8 + (A[e + 1] - A[e]), Bkt = ({ valueOffsets: A, stride: e, children: t }, i) => {
  const n = t[0], { [i * e]: o } = A, { [i * e + 1]: g } = A, s = El.getVisitFn(n.type), I = n.slice(o, g - o);
  let r = 8;
  for (let a = -1, C = g - o; ++a < C; )
    r += s(I, a);
  return r;
}, lkt = ({ stride: A, children: e }, t) => {
  const i = e[0], n = i.slice(t * A, A), o = El.getVisitFn(i.type);
  let g = 0;
  for (let s = -1, I = n.length; ++s < I; )
    g += o(n, s);
  return g;
}, ckt = (A, e) => A.type.mode === na.Dense ? vTA(A, e) : HTA(A, e), vTA = ({ type: A, children: e, typeIds: t, valueOffsets: i }, n) => {
  const o = A.typeIdToChildIndex[t[n]];
  return 8 + El.visit(e[o], i[n]);
}, HTA = ({ children: A }, e) => 4 + El.visitMany(A, A.map(() => e)).reduce(akt, 0);
th.prototype.visitUtf8 = rkt;
th.prototype.visitBinary = Ckt;
th.prototype.visitList = Bkt;
th.prototype.visitFixedSizeList = lkt;
th.prototype.visitUnion = ckt;
th.prototype.visitDenseUnion = vTA;
th.prototype.visitSparseUnion = HTA;
const El = new th();
var STA;
const ZTA = {}, WTA = {};
class pi {
  constructor(e) {
    var t, i, n;
    const o = e[0] instanceof pi ? e.flatMap((s) => s.data) : e;
    if (o.length === 0 || o.some((s) => !(s instanceof zi)))
      throw new TypeError("Vector constructor expects an Array of Data instances.");
    const g = (t = o[0]) === null || t === void 0 ? void 0 : t.type;
    switch (o.length) {
      case 0:
        this._offsets = [0];
        break;
      case 1: {
        const { get: s, set: I, indexOf: r, byteLength: a } = ZTA[g.typeId], C = o[0];
        this.isValid = (B) => zsA(C, B), this.get = (B) => s(C, B), this.set = (B, l) => I(C, B, l), this.indexOf = (B) => r(C, B), this.getByteLength = (B) => a(C, B), this._offsets = [0, C.length];
        break;
      }
      default:
        Object.setPrototypeOf(this, WTA[g.typeId]), this._offsets = RTA(o);
        break;
    }
    this.data = o, this.type = g, this.stride = Qc(g), this.numChildren = (n = (i = g.children) === null || i === void 0 ? void 0 : i.length) !== null && n !== void 0 ? n : 0, this.length = this._offsets[this._offsets.length - 1];
  }
  /**
   * The aggregate size (in bytes) of this Vector's buffers and/or child Vectors.
   */
  get byteLength() {
    return this._byteLength === -1 && (this._byteLength = this.data.reduce((e, t) => e + t.byteLength, 0)), this._byteLength;
  }
  /**
   * The number of null elements in this Vector.
   */
  get nullCount() {
    return this._nullCount === -1 && (this._nullCount = YTA(this.data)), this._nullCount;
  }
  /**
   * The Array or TypedAray constructor used for the JS representation
   *  of the element's values in {@link Vector.prototype.toArray `toArray()`}.
   */
  get ArrayType() {
    return this.type.ArrayType;
  }
  /**
   * The name that should be printed when the Vector is logged in a message.
   */
  get [Symbol.toStringTag]() {
    return `${this.VectorName}<${this.type[Symbol.toStringTag]}>`;
  }
  /**
   * The name of this Vector.
   */
  get VectorName() {
    return `${bA[this.type.typeId]}Vector`;
  }
  /**
   * Check whether an element is null.
   * @param index The index at which to read the validity bitmap.
   */
  // @ts-ignore
  isValid(e) {
    return !1;
  }
  /**
   * Get an element value by position.
   * @param index The index of the element to read.
   */
  // @ts-ignore
  get(e) {
    return null;
  }
  /**
   * Set an element value by position.
   * @param index The index of the element to write.
   * @param value The value to set.
   */
  // @ts-ignore
  set(e, t) {
  }
  /**
   * Retrieve the index of the first occurrence of a value in an Vector.
   * @param element The value to locate in the Vector.
   * @param offset The index at which to begin the search. If offset is omitted, the search starts at index 0.
   */
  // @ts-ignore
  indexOf(e, t) {
    return -1;
  }
  includes(e, t) {
    return this.indexOf(e, t) > 0;
  }
  /**
   * Get the size in bytes of an element by index.
   * @param index The index at which to get the byteLength.
   */
  // @ts-ignore
  getByteLength(e) {
    return 0;
  }
  /**
   * Iterator for the Vector's elements.
   */
  [Symbol.iterator]() {
    return TsA.visit(this);
  }
  /**
   * Combines two or more Vectors of the same type.
   * @param others Additional Vectors to add to the end of this Vector.
   */
  concat(...e) {
    return new pi(this.data.concat(e.flatMap((t) => t.data).flat(Number.POSITIVE_INFINITY)));
  }
  /**
   * Return a zero-copy sub-section of this Vector.
   * @param start The beginning of the specified portion of the Vector.
   * @param end The end of the specified portion of the Vector. This is exclusive of the element at the index 'end'.
   */
  slice(e, t) {
    return new pi(JTA(this, e, t, ({ data: i, _offsets: n }, o, g) => FTA(i, n, o, g)));
  }
  toJSON() {
    return [...this];
  }
  /**
   * Return a JavaScript Array or TypedArray of the Vector's elements.
   *
   * @note If this Vector contains a single Data chunk and the Vector's type is a
   *  primitive numeric type corresponding to one of the JavaScript TypedArrays, this
   *  method returns a zero-copy slice of the underlying TypedArray values. If there's
   *  more than one chunk, the resulting TypedArray will be a copy of the data from each
   *  chunk's underlying TypedArray values.
   *
   * @returns An Array or TypedArray of the Vector's elements, based on the Vector's DataType.
   */
  toArray() {
    const { type: e, data: t, length: i, stride: n, ArrayType: o } = this;
    switch (e.typeId) {
      case bA.Int:
      case bA.Float:
      case bA.Decimal:
      case bA.Time:
      case bA.Timestamp:
        switch (t.length) {
          case 0:
            return new o();
          case 1:
            return t[0].values.subarray(0, i * n);
          default:
            return t.reduce((g, { values: s, length: I }) => (g.array.set(s.subarray(0, I * n), g.offset), g.offset += I * n, g), { array: new o(i * n), offset: 0 }).array;
        }
    }
    return [...this];
  }
  /**
   * Returns a string representation of the Vector.
   *
   * @returns A string representation of the Vector.
   */
  toString() {
    return `[${[...this].join(",")}]`;
  }
  /**
   * Returns a child Vector by name, or null if this Vector has no child with the given name.
   * @param name The name of the child to retrieve.
   */
  getChild(e) {
    var t;
    return this.getChildAt((t = this.type.children) === null || t === void 0 ? void 0 : t.findIndex((i) => i.name === e));
  }
  /**
   * Returns a child Vector by index, or null if this Vector has no child at the supplied index.
   * @param index The index of the child to retrieve.
   */
  getChildAt(e) {
    return e > -1 && e < this.numChildren ? new pi(this.data.map(({ children: t }) => t[e])) : null;
  }
  get isMemoized() {
    return Ct.isDictionary(this.type) ? this.data[0].dictionary.isMemoized : !1;
  }
  /**
   * Adds memoization to the Vector's {@link get} method. For dictionary
   * vectors, this method return a vector that memoizes only the dictionary
   * values.
   *
   * Memoization is very useful when decoding a value is expensive such as
   * Uft8. The memoization creates a cache of the size of the Vector and
   * therfore increases memory usage.
   *
   * @returns A new vector that memoizes calls to {@link get}.
   */
  memoize() {
    if (Ct.isDictionary(this.type)) {
      const e = new pW(this.data[0].dictionary), t = this.data.map((i) => {
        const n = i.clone();
        return n.dictionary = e, n;
      });
      return new pi(t);
    }
    return new pW(this);
  }
  /**
   * Returns a vector without memoization of the {@link get} method. If this
   * vector is not memoized, this method returns this vector.
   *
   * @returns A a vector without memoization.
   */
  unmemoize() {
    if (Ct.isDictionary(this.type) && this.isMemoized) {
      const e = this.data[0].dictionary.unmemoize(), t = this.data.map((i) => {
        const n = i.clone();
        return n.dictionary = e, n;
      });
      return new pi(t);
    }
    return this;
  }
}
STA = Symbol.toStringTag;
pi[STA] = ((A) => {
  A.type = Ct.prototype, A.data = [], A.length = 0, A.stride = 1, A.numChildren = 0, A._nullCount = -1, A._byteLength = -1, A._offsets = new Uint32Array([0]), A[Symbol.isConcatSpreadable] = !0;
  const e = Object.keys(bA).map((t) => bA[t]).filter((t) => typeof t == "number" && t !== bA.NONE);
  for (const t of e) {
    const i = tI.getVisitFnByTypeId(t), n = rr.getVisitFnByTypeId(t), o = mW.getVisitFnByTypeId(t), g = El.getVisitFnByTypeId(t);
    ZTA[t] = { get: i, set: n, indexOf: o, byteLength: g }, WTA[t] = Object.create(A, {
      isValid: { value: Gw(zsA) },
      get: { value: Gw(tI.getVisitFnByTypeId(t)) },
      set: { value: MTA(rr.getVisitFnByTypeId(t)) },
      indexOf: { value: xTA(mW.getVisitFnByTypeId(t)) },
      getByteLength: { value: Gw(El.getVisitFnByTypeId(t)) }
    });
  }
  return "Vector";
})(pi.prototype);
class pW extends pi {
  constructor(e) {
    super(e.data);
    const t = this.get, i = this.set, n = this.slice, o = new Array(this.length);
    Object.defineProperty(this, "get", {
      value(g) {
        const s = o[g];
        if (s !== void 0)
          return s;
        const I = t.call(this, g);
        return o[g] = I, I;
      }
    }), Object.defineProperty(this, "set", {
      value(g, s) {
        i.call(this, g, s), o[g] = s;
      }
    }), Object.defineProperty(this, "slice", {
      value: (g, s) => new pW(n.call(this, g, s))
    }), Object.defineProperty(this, "isMemoized", { value: !0 }), Object.defineProperty(this, "unmemoize", {
      value: () => new pi(this.data)
    }), Object.defineProperty(this, "memoize", {
      value: () => this
    });
  }
}
class y6 {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  /**
   * Index to the start of the RecordBlock (note this is past the Message header)
   */
  offset() {
    return this.bb.readInt64(this.bb_pos);
  }
  /**
   * Length of the metadata
   */
  metaDataLength() {
    return this.bb.readInt32(this.bb_pos + 8);
  }
  /**
   * Length of the data (this is aligned so there can be a gap between this and
   * the metadata).
   */
  bodyLength() {
    return this.bb.readInt64(this.bb_pos + 16);
  }
  static sizeOf() {
    return 24;
  }
  static createBlock(e, t, i, n) {
    return e.prep(8, 24), e.writeInt64(n), e.pad(4), e.writeInt32(i), e.writeInt64(t), e.offset();
  }
}
const m_ = 2, pB = 4, Gc = 4, Vi = 4, vE = new Int32Array(2), ebA = new Float32Array(vE.buffer), tbA = new Float64Array(vE.buffer), $x = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
let eQ = class b6 {
  constructor(e, t) {
    this.low = e | 0, this.high = t | 0;
  }
  static create(e, t) {
    return e == 0 && t == 0 ? b6.ZERO : new b6(e, t);
  }
  toFloat64() {
    return (this.low >>> 0) + this.high * 4294967296;
  }
  equals(e) {
    return this.low == e.low && this.high == e.high;
  }
};
eQ.ZERO = new eQ(0, 0);
var w6;
(function(A) {
  A[A.UTF8_BYTES = 1] = "UTF8_BYTES", A[A.UTF16_STRING = 2] = "UTF16_STRING";
})(w6 || (w6 = {}));
let Pf = class KTA {
  /**
   * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)
   */
  constructor(e) {
    this.bytes_ = e, this.position_ = 0;
  }
  /**
   * Create and allocate a new ByteBuffer with a given size.
   */
  static allocate(e) {
    return new KTA(new Uint8Array(e));
  }
  clear() {
    this.position_ = 0;
  }
  /**
   * Get the underlying `Uint8Array`.
   */
  bytes() {
    return this.bytes_;
  }
  /**
   * Get the buffer's position.
   */
  position() {
    return this.position_;
  }
  /**
   * Set the buffer's position.
   */
  setPosition(e) {
    this.position_ = e;
  }
  /**
   * Get the buffer's capacity.
   */
  capacity() {
    return this.bytes_.length;
  }
  readInt8(e) {
    return this.readUint8(e) << 24 >> 24;
  }
  readUint8(e) {
    return this.bytes_[e];
  }
  readInt16(e) {
    return this.readUint16(e) << 16 >> 16;
  }
  readUint16(e) {
    return this.bytes_[e] | this.bytes_[e + 1] << 8;
  }
  readInt32(e) {
    return this.bytes_[e] | this.bytes_[e + 1] << 8 | this.bytes_[e + 2] << 16 | this.bytes_[e + 3] << 24;
  }
  readUint32(e) {
    return this.readInt32(e) >>> 0;
  }
  readInt64(e) {
    return new eQ(this.readInt32(e), this.readInt32(e + 4));
  }
  readUint64(e) {
    return new eQ(this.readUint32(e), this.readUint32(e + 4));
  }
  readFloat32(e) {
    return vE[0] = this.readInt32(e), ebA[0];
  }
  readFloat64(e) {
    return vE[$x ? 0 : 1] = this.readInt32(e), vE[$x ? 1 : 0] = this.readInt32(e + 4), tbA[0];
  }
  writeInt8(e, t) {
    this.bytes_[e] = t;
  }
  writeUint8(e, t) {
    this.bytes_[e] = t;
  }
  writeInt16(e, t) {
    this.bytes_[e] = t, this.bytes_[e + 1] = t >> 8;
  }
  writeUint16(e, t) {
    this.bytes_[e] = t, this.bytes_[e + 1] = t >> 8;
  }
  writeInt32(e, t) {
    this.bytes_[e] = t, this.bytes_[e + 1] = t >> 8, this.bytes_[e + 2] = t >> 16, this.bytes_[e + 3] = t >> 24;
  }
  writeUint32(e, t) {
    this.bytes_[e] = t, this.bytes_[e + 1] = t >> 8, this.bytes_[e + 2] = t >> 16, this.bytes_[e + 3] = t >> 24;
  }
  writeInt64(e, t) {
    this.writeInt32(e, t.low), this.writeInt32(e + 4, t.high);
  }
  writeUint64(e, t) {
    this.writeUint32(e, t.low), this.writeUint32(e + 4, t.high);
  }
  writeFloat32(e, t) {
    ebA[0] = t, this.writeInt32(e, vE[0]);
  }
  writeFloat64(e, t) {
    tbA[0] = t, this.writeInt32(e, vE[$x ? 0 : 1]), this.writeInt32(e + 4, vE[$x ? 1 : 0]);
  }
  /**
   * Return the file identifier.   Behavior is undefined for FlatBuffers whose
   * schema does not include a file_identifier (likely points at padding or the
   * start of a the root vtable).
   */
  getBufferIdentifier() {
    if (this.bytes_.length < this.position_ + pB + Gc)
      throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");
    let e = "";
    for (let t = 0; t < Gc; t++)
      e += String.fromCharCode(this.readInt8(this.position_ + pB + t));
    return e;
  }
  /**
   * Look up a field in the vtable, return an offset into the object, or 0 if the
   * field is not present.
   */
  __offset(e, t) {
    const i = e - this.readInt32(e);
    return t < this.readInt16(i) ? this.readInt16(i + t) : 0;
  }
  /**
   * Initialize any Table-derived type to point to the union at the given offset.
   */
  __union(e, t) {
    return e.bb_pos = t + this.readInt32(t), e.bb = this, e;
  }
  /**
   * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
   * This allocates a new string and converts to wide chars upon each access.
   *
   * To avoid the conversion to UTF-16, pass Encoding.UTF8_BYTES as
   * the "optionalEncoding" argument. This is useful for avoiding conversion to
   * and from UTF-16 when the data will just be packaged back up in another
   * FlatBuffer later on.
   *
   * @param offset
   * @param opt_encoding Defaults to UTF16_STRING
   */
  __string(e, t) {
    e += this.readInt32(e);
    const i = this.readInt32(e);
    let n = "", o = 0;
    if (e += pB, t === w6.UTF8_BYTES)
      return this.bytes_.subarray(e, e + i);
    for (; o < i; ) {
      let g;
      const s = this.readUint8(e + o++);
      if (s < 192)
        g = s;
      else {
        const I = this.readUint8(e + o++);
        if (s < 224)
          g = (s & 31) << 6 | I & 63;
        else {
          const r = this.readUint8(e + o++);
          if (s < 240)
            g = (s & 15) << 12 | (I & 63) << 6 | r & 63;
          else {
            const a = this.readUint8(e + o++);
            g = (s & 7) << 18 | (I & 63) << 12 | (r & 63) << 6 | a & 63;
          }
        }
      }
      g < 65536 ? n += String.fromCharCode(g) : (g -= 65536, n += String.fromCharCode((g >> 10) + 55296, (g & (1 << 10) - 1) + 56320));
    }
    return n;
  }
  /**
   * Handle unions that can contain string as its member, if a Table-derived type then initialize it,
   * if a string then return a new one
   *
   * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
   * makes the behaviour of __union_with_string different compared to __union
   */
  __union_with_string(e, t) {
    return typeof e == "string" ? this.__string(t) : this.__union(e, t);
  }
  /**
   * Retrieve the relative offset stored at "offset"
   */
  __indirect(e) {
    return e + this.readInt32(e);
  }
  /**
   * Get the start of data of a vector whose offset is stored at "offset" in this object.
   */
  __vector(e) {
    return e + this.readInt32(e) + pB;
  }
  /**
   * Get the length of a vector whose offset is stored at "offset" in this object.
   */
  __vector_len(e) {
    return this.readInt32(e + this.readInt32(e));
  }
  __has_identifier(e) {
    if (e.length != Gc)
      throw new Error("FlatBuffers: file identifier must be length " + Gc);
    for (let t = 0; t < Gc; t++)
      if (e.charCodeAt(t) != this.readInt8(this.position() + pB + t))
        return !1;
    return !0;
  }
  /**
   * A helper function to avoid generated code depending on this file directly.
   */
  createLong(e, t) {
    return eQ.create(e, t);
  }
  /**
   * A helper function for generating list for obj api
   */
  createScalarList(e, t) {
    const i = [];
    for (let n = 0; n < t; ++n)
      e(n) !== null && i.push(e(n));
    return i;
  }
  /**
   * A helper function for generating list for obj api
   * @param listAccessor function that accepts an index and return data at that index
   * @param listLength listLength
   * @param res result list
   */
  createObjList(e, t) {
    const i = [];
    for (let n = 0; n < t; ++n) {
      const o = e(n);
      o !== null && i.push(o.unpack());
    }
    return i;
  }
}, UTA = class VTA {
  /**
   * Create a FlatBufferBuilder.
   */
  constructor(e) {
    this.minalign = 1, this.vtable = null, this.vtable_in_use = 0, this.isNested = !1, this.object_start = 0, this.vtables = [], this.vector_num_elems = 0, this.force_defaults = !1, this.string_maps = null;
    let t;
    e ? t = e : t = 1024, this.bb = Pf.allocate(t), this.space = t;
  }
  clear() {
    this.bb.clear(), this.space = this.bb.capacity(), this.minalign = 1, this.vtable = null, this.vtable_in_use = 0, this.isNested = !1, this.object_start = 0, this.vtables = [], this.vector_num_elems = 0, this.force_defaults = !1, this.string_maps = null;
  }
  /**
   * In order to save space, fields that are set to their default value
   * don't get serialized into the buffer. Forcing defaults provides a
   * way to manually disable this optimization.
   *
   * @param forceDefaults true always serializes default values
   */
  forceDefaults(e) {
    this.force_defaults = e;
  }
  /**
   * Get the ByteBuffer representing the FlatBuffer. Only call this after you've
   * called finish(). The actual data starts at the ByteBuffer's current position,
   * not necessarily at 0.
   */
  dataBuffer() {
    return this.bb;
  }
  /**
   * Get the bytes representing the FlatBuffer. Only call this after you've
   * called finish().
   */
  asUint8Array() {
    return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
  }
  /**
   * Prepare to write an element of `size` after `additional_bytes` have been
   * written, e.g. if you write a string, you need to align such the int length
   * field is aligned to 4 bytes, and the string data follows it directly. If all
   * you need to do is alignment, `additional_bytes` will be 0.
   *
   * @param size This is the of the new element to write
   * @param additional_bytes The padding size
   */
  prep(e, t) {
    e > this.minalign && (this.minalign = e);
    const i = ~(this.bb.capacity() - this.space + t) + 1 & e - 1;
    for (; this.space < i + e + t; ) {
      const n = this.bb.capacity();
      this.bb = VTA.growByteBuffer(this.bb), this.space += this.bb.capacity() - n;
    }
    this.pad(i);
  }
  pad(e) {
    for (let t = 0; t < e; t++)
      this.bb.writeInt8(--this.space, 0);
  }
  writeInt8(e) {
    this.bb.writeInt8(this.space -= 1, e);
  }
  writeInt16(e) {
    this.bb.writeInt16(this.space -= 2, e);
  }
  writeInt32(e) {
    this.bb.writeInt32(this.space -= 4, e);
  }
  writeInt64(e) {
    this.bb.writeInt64(this.space -= 8, e);
  }
  writeFloat32(e) {
    this.bb.writeFloat32(this.space -= 4, e);
  }
  writeFloat64(e) {
    this.bb.writeFloat64(this.space -= 8, e);
  }
  /**
   * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
   * @param value The `int8` to add the the buffer.
   */
  addInt8(e) {
    this.prep(1, 0), this.writeInt8(e);
  }
  /**
   * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
   * @param value The `int16` to add the the buffer.
   */
  addInt16(e) {
    this.prep(2, 0), this.writeInt16(e);
  }
  /**
   * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
   * @param value The `int32` to add the the buffer.
   */
  addInt32(e) {
    this.prep(4, 0), this.writeInt32(e);
  }
  /**
   * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
   * @param value The `int64` to add the the buffer.
   */
  addInt64(e) {
    this.prep(8, 0), this.writeInt64(e);
  }
  /**
   * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
   * @param value The `float32` to add the the buffer.
   */
  addFloat32(e) {
    this.prep(4, 0), this.writeFloat32(e);
  }
  /**
   * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
   * @param value The `float64` to add the the buffer.
   */
  addFloat64(e) {
    this.prep(8, 0), this.writeFloat64(e);
  }
  addFieldInt8(e, t, i) {
    (this.force_defaults || t != i) && (this.addInt8(t), this.slot(e));
  }
  addFieldInt16(e, t, i) {
    (this.force_defaults || t != i) && (this.addInt16(t), this.slot(e));
  }
  addFieldInt32(e, t, i) {
    (this.force_defaults || t != i) && (this.addInt32(t), this.slot(e));
  }
  addFieldInt64(e, t, i) {
    (this.force_defaults || !t.equals(i)) && (this.addInt64(t), this.slot(e));
  }
  addFieldFloat32(e, t, i) {
    (this.force_defaults || t != i) && (this.addFloat32(t), this.slot(e));
  }
  addFieldFloat64(e, t, i) {
    (this.force_defaults || t != i) && (this.addFloat64(t), this.slot(e));
  }
  addFieldOffset(e, t, i) {
    (this.force_defaults || t != i) && (this.addOffset(t), this.slot(e));
  }
  /**
   * Structs are stored inline, so nothing additional is being added. `d` is always 0.
   */
  addFieldStruct(e, t, i) {
    t != i && (this.nested(t), this.slot(e));
  }
  /**
   * Structures are always stored inline, they need to be created right
   * where they're used.  You'll get this assertion failure if you
   * created it elsewhere.
   */
  nested(e) {
    if (e != this.offset())
      throw new Error("FlatBuffers: struct must be serialized inline.");
  }
  /**
   * Should not be creating any other object, string or vector
   * while an object is being constructed
   */
  notNested() {
    if (this.isNested)
      throw new Error("FlatBuffers: object serialization must not be nested.");
  }
  /**
   * Set the current vtable at `voffset` to the current location in the buffer.
   */
  slot(e) {
    this.vtable !== null && (this.vtable[e] = this.offset());
  }
  /**
   * @returns Offset relative to the end of the buffer.
   */
  offset() {
    return this.bb.capacity() - this.space;
  }
  /**
   * Doubles the size of the backing ByteBuffer and copies the old data towards
   * the end of the new buffer (since we build the buffer backwards).
   *
   * @param bb The current buffer with the existing data
   * @returns A new byte buffer with the old data copied
   * to it. The data is located at the end of the buffer.
   *
   * uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass
   * it a uint8Array we need to suppress the type check:
   * @suppress {checkTypes}
   */
  static growByteBuffer(e) {
    const t = e.capacity();
    if (t & 3221225472)
      throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");
    const i = t << 1, n = Pf.allocate(i);
    return n.setPosition(i - t), n.bytes().set(e.bytes(), i - t), n;
  }
  /**
   * Adds on offset, relative to where it will be written.
   *
   * @param offset The offset to add.
   */
  addOffset(e) {
    this.prep(pB, 0), this.writeInt32(this.offset() - e + pB);
  }
  /**
   * Start encoding a new object in the buffer.  Users will not usually need to
   * call this directly. The FlatBuffers compiler will generate helper methods
   * that call this method internally.
   */
  startObject(e) {
    this.notNested(), this.vtable == null && (this.vtable = []), this.vtable_in_use = e;
    for (let t = 0; t < e; t++)
      this.vtable[t] = 0;
    this.isNested = !0, this.object_start = this.offset();
  }
  /**
   * Finish off writing the object that is under construction.
   *
   * @returns The offset to the object inside `dataBuffer`
   */
  endObject() {
    if (this.vtable == null || !this.isNested)
      throw new Error("FlatBuffers: endObject called without startObject");
    this.addInt32(0);
    const e = this.offset();
    let t = this.vtable_in_use - 1;
    for (; t >= 0 && this.vtable[t] == 0; t--)
      ;
    const i = t + 1;
    for (; t >= 0; t--)
      this.addInt16(this.vtable[t] != 0 ? e - this.vtable[t] : 0);
    const n = 2;
    this.addInt16(e - this.object_start);
    const o = (i + n) * m_;
    this.addInt16(o);
    let g = 0;
    const s = this.space;
    A:
      for (t = 0; t < this.vtables.length; t++) {
        const I = this.bb.capacity() - this.vtables[t];
        if (o == this.bb.readInt16(I)) {
          for (let r = m_; r < o; r += m_)
            if (this.bb.readInt16(s + r) != this.bb.readInt16(I + r))
              continue A;
          g = this.vtables[t];
          break;
        }
      }
    return g ? (this.space = this.bb.capacity() - e, this.bb.writeInt32(this.space, g - e)) : (this.vtables.push(this.offset()), this.bb.writeInt32(this.bb.capacity() - e, this.offset() - e)), this.isNested = !1, e;
  }
  /**
   * Finalize a buffer, poiting to the given `root_table`.
   */
  finish(e, t, i) {
    const n = i ? Vi : 0;
    if (t) {
      const o = t;
      if (this.prep(this.minalign, pB + Gc + n), o.length != Gc)
        throw new Error("FlatBuffers: file identifier must be length " + Gc);
      for (let g = Gc - 1; g >= 0; g--)
        this.writeInt8(o.charCodeAt(g));
    }
    this.prep(this.minalign, pB + n), this.addOffset(e), n && this.addInt32(this.bb.capacity() - this.space), this.bb.setPosition(this.space);
  }
  /**
   * Finalize a size prefixed buffer, pointing to the given `root_table`.
   */
  finishSizePrefixed(e, t) {
    this.finish(e, t, !0);
  }
  /**
   * This checks a required field has been set in a given table that has
   * just been constructed.
   */
  requiredField(e, t) {
    const i = this.bb.capacity() - e, n = i - this.bb.readInt32(i);
    if (!(this.bb.readInt16(n + t) != 0))
      throw new Error("FlatBuffers: field " + t + " must be set");
  }
  /**
   * Start a new array/vector of objects.  Users usually will not call
   * this directly. The FlatBuffers compiler will create a start/end
   * method for vector types in generated code.
   *
   * @param elem_size The size of each element in the array
   * @param num_elems The number of elements in the array
   * @param alignment The alignment of the array
   */
  startVector(e, t, i) {
    this.notNested(), this.vector_num_elems = t, this.prep(pB, e * t), this.prep(i, e * t);
  }
  /**
   * Finish off the creation of an array and all its elements. The array must be
   * created with `startVector`.
   *
   * @returns The offset at which the newly created array
   * starts.
   */
  endVector() {
    return this.writeInt32(this.vector_num_elems), this.offset();
  }
  /**
   * Encode the string `s` in the buffer using UTF-8. If the string passed has
   * already been seen, we return the offset of the already written string
   *
   * @param s The string to encode
   * @return The offset in the buffer where the encoded string starts
   */
  createSharedString(e) {
    if (!e)
      return 0;
    if (this.string_maps || (this.string_maps = /* @__PURE__ */ new Map()), this.string_maps.has(e))
      return this.string_maps.get(e);
    const t = this.createString(e);
    return this.string_maps.set(e, t), t;
  }
  /**
   * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
   * instead of a string, it is assumed to contain valid UTF-8 encoded data.
   *
   * @param s The string to encode
   * @return The offset in the buffer where the encoded string starts
   */
  createString(e) {
    if (!e)
      return 0;
    let t;
    if (e instanceof Uint8Array)
      t = e;
    else {
      t = [];
      let i = 0;
      for (; i < e.length; ) {
        let n;
        const o = e.charCodeAt(i++);
        if (o < 55296 || o >= 56320)
          n = o;
        else {
          const g = e.charCodeAt(i++);
          n = (o << 10) + g + (65536 - (55296 << 10) - 56320);
        }
        n < 128 ? t.push(n) : (n < 2048 ? t.push(n >> 6 & 31 | 192) : (n < 65536 ? t.push(n >> 12 & 15 | 224) : t.push(n >> 18 & 7 | 240, n >> 12 & 63 | 128), t.push(n >> 6 & 63 | 128)), t.push(n & 63 | 128));
      }
    }
    this.addInt8(0), this.startVector(1, t.length, 1), this.bb.setPosition(this.space -= t.length);
    for (let i = 0, n = this.space, o = this.bb.bytes(); i < t.length; i++)
      o[n++] = t[i];
    return this.endVector();
  }
  /**
   * A helper function to avoid generated code depending on this file directly.
   */
  createLong(e, t) {
    return eQ.create(e, t);
  }
  /**
   * A helper function to pack an object
   *
   * @returns offset of obj
   */
  createObjectOffset(e) {
    return e === null ? 0 : typeof e == "string" ? this.createString(e) : e.pack(this);
  }
  /**
   * A helper function to pack a list of object
   *
   * @returns list of offsets of each non null object
   */
  createObjectOffsetList(e) {
    const t = [];
    for (let i = 0; i < e.length; ++i) {
      const n = e[i];
      if (n !== null)
        t.push(this.createObjectOffset(n));
      else
        throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.");
    }
    return t;
  }
  createStructOffsetList(e, t) {
    return t(this, e.length), this.createObjectOffsetList(e), this.endVector();
  }
};
class ro {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsKeyValue(e, t) {
    return (t || new ro()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsKeyValue(e, t) {
    return e.setPosition(e.position() + Vi), (t || new ro()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  key(e) {
    const t = this.bb.__offset(this.bb_pos, 4);
    return t ? this.bb.__string(this.bb_pos + t, e) : null;
  }
  value(e) {
    const t = this.bb.__offset(this.bb_pos, 6);
    return t ? this.bb.__string(this.bb_pos + t, e) : null;
  }
  static startKeyValue(e) {
    e.startObject(2);
  }
  static addKey(e, t) {
    e.addFieldOffset(0, t, 0);
  }
  static addValue(e, t) {
    e.addFieldOffset(1, t, 0);
  }
  static endKeyValue(e) {
    return e.endObject();
  }
  static createKeyValue(e, t, i) {
    return ro.startKeyValue(e), ro.addKey(e, t), ro.addValue(e, i), ro.endKeyValue(e);
  }
}
var $f;
(function(A) {
  A[A.V1 = 0] = "V1", A[A.V2 = 1] = "V2", A[A.V3 = 2] = "V3", A[A.V4 = 3] = "V4", A[A.V5 = 4] = "V5";
})($f || ($f = {}));
var AD;
(function(A) {
  A[A.Little = 0] = "Little", A[A.Big = 1] = "Big";
})(AD || (AD = {}));
var yW;
(function(A) {
  A[A.DenseArray = 0] = "DenseArray";
})(yW || (yW = {}));
class JI {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsInt(e, t) {
    return (t || new JI()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsInt(e, t) {
    return e.setPosition(e.position() + Vi), (t || new JI()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  bitWidth() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt32(this.bb_pos + e) : 0;
  }
  isSigned() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? !!this.bb.readInt8(this.bb_pos + e) : !1;
  }
  static startInt(e) {
    e.startObject(2);
  }
  static addBitWidth(e, t) {
    e.addFieldInt32(0, t, 0);
  }
  static addIsSigned(e, t) {
    e.addFieldInt8(1, +t, 0);
  }
  static endInt(e) {
    return e.endObject();
  }
  static createInt(e, t, i) {
    return JI.startInt(e), JI.addBitWidth(e, t), JI.addIsSigned(e, i), JI.endInt(e);
  }
}
class kc {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsDictionaryEncoding(e, t) {
    return (t || new kc()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsDictionaryEncoding(e, t) {
    return e.setPosition(e.position() + Vi), (t || new kc()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  /**
   * The known dictionary id in the application where this data is used. In
   * the file or streaming formats, the dictionary ids are found in the
   * DictionaryBatch messages
   */
  id() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt64(this.bb_pos + e) : this.bb.createLong(0, 0);
  }
  /**
   * The dictionary indices are constrained to be non-negative integers. If
   * this field is null, the indices must be signed int32. To maximize
   * cross-language compatibility and performance, implementations are
   * recommended to prefer signed integer types over unsigned integer types
   * and to avoid uint64 indices unless they are required by an application.
   */
  indexType(e) {
    const t = this.bb.__offset(this.bb_pos, 6);
    return t ? (e || new JI()).__init(this.bb.__indirect(this.bb_pos + t), this.bb) : null;
  }
  /**
   * By default, dictionaries are not ordered, or the order does not have
   * semantic meaning. In some statistical, applications, dictionary-encoding
   * is used to represent ordered categorical data, and we provide a way to
   * preserve that metadata here
   */
  isOrdered() {
    const e = this.bb.__offset(this.bb_pos, 8);
    return e ? !!this.bb.readInt8(this.bb_pos + e) : !1;
  }
  dictionaryKind() {
    const e = this.bb.__offset(this.bb_pos, 10);
    return e ? this.bb.readInt16(this.bb_pos + e) : yW.DenseArray;
  }
  static startDictionaryEncoding(e) {
    e.startObject(4);
  }
  static addId(e, t) {
    e.addFieldInt64(0, t, e.createLong(0, 0));
  }
  static addIndexType(e, t) {
    e.addFieldOffset(1, t, 0);
  }
  static addIsOrdered(e, t) {
    e.addFieldInt8(2, +t, 0);
  }
  static addDictionaryKind(e, t) {
    e.addFieldInt16(3, t, yW.DenseArray);
  }
  static endDictionaryEncoding(e) {
    return e.endObject();
  }
}
class dm {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsBinary(e, t) {
    return (t || new dm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsBinary(e, t) {
    return e.setPosition(e.position() + Vi), (t || new dm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static startBinary(e) {
    e.startObject(0);
  }
  static endBinary(e) {
    return e.endObject();
  }
  static createBinary(e) {
    return dm.startBinary(e), dm.endBinary(e);
  }
}
class hm {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsBool(e, t) {
    return (t || new hm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsBool(e, t) {
    return e.setPosition(e.position() + Vi), (t || new hm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static startBool(e) {
    e.startObject(0);
  }
  static endBool(e) {
    return e.endObject();
  }
  static createBool(e) {
    return hm.startBool(e), hm.endBool(e);
  }
}
var bW;
(function(A) {
  A[A.DAY = 0] = "DAY", A[A.MILLISECOND = 1] = "MILLISECOND";
})(bW || (bW = {}));
let uv = class cb {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsDate(e, t) {
    return (t || new cb()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsDate(e, t) {
    return e.setPosition(e.position() + Vi), (t || new cb()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  unit() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt16(this.bb_pos + e) : bW.MILLISECOND;
  }
  static startDate(e) {
    e.startObject(1);
  }
  static addUnit(e, t) {
    e.addFieldInt16(0, t, bW.MILLISECOND);
  }
  static endDate(e) {
    return e.endObject();
  }
  static createDate(e, t) {
    return cb.startDate(e), cb.addUnit(e, t), cb.endDate(e);
  }
};
class ks {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsDecimal(e, t) {
    return (t || new ks()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsDecimal(e, t) {
    return e.setPosition(e.position() + Vi), (t || new ks()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  /**
   * Total number of decimal digits
   */
  precision() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt32(this.bb_pos + e) : 0;
  }
  /**
   * Number of digits after the decimal point "."
   */
  scale() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? this.bb.readInt32(this.bb_pos + e) : 0;
  }
  /**
   * Number of bits per value. The only accepted widths are 128 and 256.
   * We use bitWidth for consistency with Int::bitWidth.
   */
  bitWidth() {
    const e = this.bb.__offset(this.bb_pos, 8);
    return e ? this.bb.readInt32(this.bb_pos + e) : 128;
  }
  static startDecimal(e) {
    e.startObject(3);
  }
  static addPrecision(e, t) {
    e.addFieldInt32(0, t, 0);
  }
  static addScale(e, t) {
    e.addFieldInt32(1, t, 0);
  }
  static addBitWidth(e, t) {
    e.addFieldInt32(2, t, 128);
  }
  static endDecimal(e) {
    return e.endObject();
  }
  static createDecimal(e, t, i, n) {
    return ks.startDecimal(e), ks.addPrecision(e, t), ks.addScale(e, i), ks.addBitWidth(e, n), ks.endDecimal(e);
  }
}
var eD;
(function(A) {
  A[A.SECOND = 0] = "SECOND", A[A.MILLISECOND = 1] = "MILLISECOND", A[A.MICROSECOND = 2] = "MICROSECOND", A[A.NANOSECOND = 3] = "NANOSECOND";
})(eD || (eD = {}));
class yB {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsFixedSizeBinary(e, t) {
    return (t || new yB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsFixedSizeBinary(e, t) {
    return e.setPosition(e.position() + Vi), (t || new yB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  /**
   * Number of bytes per value
   */
  byteWidth() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt32(this.bb_pos + e) : 0;
  }
  static startFixedSizeBinary(e) {
    e.startObject(1);
  }
  static addByteWidth(e, t) {
    e.addFieldInt32(0, t, 0);
  }
  static endFixedSizeBinary(e) {
    return e.endObject();
  }
  static createFixedSizeBinary(e, t) {
    return yB.startFixedSizeBinary(e), yB.addByteWidth(e, t), yB.endFixedSizeBinary(e);
  }
}
class bB {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsFixedSizeList(e, t) {
    return (t || new bB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsFixedSizeList(e, t) {
    return e.setPosition(e.position() + Vi), (t || new bB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  /**
   * Number of list items per value
   */
  listSize() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt32(this.bb_pos + e) : 0;
  }
  static startFixedSizeList(e) {
    e.startObject(1);
  }
  static addListSize(e, t) {
    e.addFieldInt32(0, t, 0);
  }
  static endFixedSizeList(e) {
    return e.endObject();
  }
  static createFixedSizeList(e, t) {
    return bB.startFixedSizeList(e), bB.addListSize(e, t), bB.endFixedSizeList(e);
  }
}
var wW;
(function(A) {
  A[A.HALF = 0] = "HALF", A[A.SINGLE = 1] = "SINGLE", A[A.DOUBLE = 2] = "DOUBLE";
})(wW || (wW = {}));
class wB {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsFloatingPoint(e, t) {
    return (t || new wB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsFloatingPoint(e, t) {
    return e.setPosition(e.position() + Vi), (t || new wB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  precision() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt16(this.bb_pos + e) : wW.HALF;
  }
  static startFloatingPoint(e) {
    e.startObject(1);
  }
  static addPrecision(e, t) {
    e.addFieldInt16(0, t, wW.HALF);
  }
  static endFloatingPoint(e) {
    return e.endObject();
  }
  static createFloatingPoint(e, t) {
    return wB.startFloatingPoint(e), wB.addPrecision(e, t), wB.endFloatingPoint(e);
  }
}
var fW;
(function(A) {
  A[A.YEAR_MONTH = 0] = "YEAR_MONTH", A[A.DAY_TIME = 1] = "DAY_TIME", A[A.MONTH_DAY_NANO = 2] = "MONTH_DAY_NANO";
})(fW || (fW = {}));
class fB {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsInterval(e, t) {
    return (t || new fB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsInterval(e, t) {
    return e.setPosition(e.position() + Vi), (t || new fB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  unit() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt16(this.bb_pos + e) : fW.YEAR_MONTH;
  }
  static startInterval(e) {
    e.startObject(1);
  }
  static addUnit(e, t) {
    e.addFieldInt16(0, t, fW.YEAR_MONTH);
  }
  static endInterval(e) {
    return e.endObject();
  }
  static createInterval(e, t) {
    return fB.startInterval(e), fB.addUnit(e, t), fB.endInterval(e);
  }
}
class mm {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsList(e, t) {
    return (t || new mm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsList(e, t) {
    return e.setPosition(e.position() + Vi), (t || new mm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static startList(e) {
    e.startObject(0);
  }
  static endList(e) {
    return e.endObject();
  }
  static createList(e) {
    return mm.startList(e), mm.endList(e);
  }
}
let dv = class Qb {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsMap(e, t) {
    return (t || new Qb()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsMap(e, t) {
    return e.setPosition(e.position() + Vi), (t || new Qb()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  /**
   * Set to true if the keys within each value are sorted
   */
  keysSorted() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? !!this.bb.readInt8(this.bb_pos + e) : !1;
  }
  static startMap(e) {
    e.startObject(1);
  }
  static addKeysSorted(e, t) {
    e.addFieldInt8(0, +t, 0);
  }
  static endMap(e) {
    return e.endObject();
  }
  static createMap(e, t) {
    return Qb.startMap(e), Qb.addKeysSorted(e, t), Qb.endMap(e);
  }
};
class pm {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsNull(e, t) {
    return (t || new pm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsNull(e, t) {
    return e.setPosition(e.position() + Vi), (t || new pm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static startNull(e) {
    e.startObject(0);
  }
  static endNull(e) {
    return e.endObject();
  }
  static createNull(e) {
    return pm.startNull(e), pm.endNull(e);
  }
}
class ym {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsStruct_(e, t) {
    return (t || new ym()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsStruct_(e, t) {
    return e.setPosition(e.position() + Vi), (t || new ym()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static startStruct_(e) {
    e.startObject(0);
  }
  static endStruct_(e) {
    return e.endObject();
  }
  static createStruct_(e) {
    return ym.startStruct_(e), ym.endStruct_(e);
  }
}
class Ja {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsTime(e, t) {
    return (t || new Ja()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsTime(e, t) {
    return e.setPosition(e.position() + Vi), (t || new Ja()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  unit() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt16(this.bb_pos + e) : eD.MILLISECOND;
  }
  bitWidth() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? this.bb.readInt32(this.bb_pos + e) : 32;
  }
  static startTime(e) {
    e.startObject(2);
  }
  static addUnit(e, t) {
    e.addFieldInt16(0, t, eD.MILLISECOND);
  }
  static addBitWidth(e, t) {
    e.addFieldInt32(1, t, 32);
  }
  static endTime(e) {
    return e.endObject();
  }
  static createTime(e, t, i) {
    return Ja.startTime(e), Ja.addUnit(e, t), Ja.addBitWidth(e, i), Ja.endTime(e);
  }
}
class Na {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsTimestamp(e, t) {
    return (t || new Na()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsTimestamp(e, t) {
    return e.setPosition(e.position() + Vi), (t || new Na()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  unit() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt16(this.bb_pos + e) : eD.SECOND;
  }
  timezone(e) {
    const t = this.bb.__offset(this.bb_pos, 6);
    return t ? this.bb.__string(this.bb_pos + t, e) : null;
  }
  static startTimestamp(e) {
    e.startObject(2);
  }
  static addUnit(e, t) {
    e.addFieldInt16(0, t, eD.SECOND);
  }
  static addTimezone(e, t) {
    e.addFieldOffset(1, t, 0);
  }
  static endTimestamp(e) {
    return e.endObject();
  }
  static createTimestamp(e, t, i) {
    return Na.startTimestamp(e), Na.addUnit(e, t), Na.addTimezone(e, i), Na.endTimestamp(e);
  }
}
var DW;
(function(A) {
  A[A.Sparse = 0] = "Sparse", A[A.Dense = 1] = "Dense";
})(DW || (DW = {}));
class Rs {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsUnion(e, t) {
    return (t || new Rs()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsUnion(e, t) {
    return e.setPosition(e.position() + Vi), (t || new Rs()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  mode() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt16(this.bb_pos + e) : DW.Sparse;
  }
  typeIds(e) {
    const t = this.bb.__offset(this.bb_pos, 6);
    return t ? this.bb.readInt32(this.bb.__vector(this.bb_pos + t) + e * 4) : 0;
  }
  typeIdsLength() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  typeIdsArray() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? new Int32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + e), this.bb.__vector_len(this.bb_pos + e)) : null;
  }
  static startUnion(e) {
    e.startObject(2);
  }
  static addMode(e, t) {
    e.addFieldInt16(0, t, DW.Sparse);
  }
  static addTypeIds(e, t) {
    e.addFieldOffset(1, t, 0);
  }
  static createTypeIdsVector(e, t) {
    e.startVector(4, t.length, 4);
    for (let i = t.length - 1; i >= 0; i--)
      e.addInt32(t[i]);
    return e.endVector();
  }
  static startTypeIdsVector(e, t) {
    e.startVector(4, t, 4);
  }
  static endUnion(e) {
    return e.endObject();
  }
  static createUnion(e, t, i) {
    return Rs.startUnion(e), Rs.addMode(e, t), Rs.addTypeIds(e, i), Rs.endUnion(e);
  }
}
class bm {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsUtf8(e, t) {
    return (t || new bm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsUtf8(e, t) {
    return e.setPosition(e.position() + Vi), (t || new bm()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static startUtf8(e) {
    e.startObject(0);
  }
  static endUtf8(e) {
    return e.endObject();
  }
  static createUtf8(e) {
    return bm.startUtf8(e), bm.endUtf8(e);
  }
}
var yn;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.Null = 1] = "Null", A[A.Int = 2] = "Int", A[A.FloatingPoint = 3] = "FloatingPoint", A[A.Binary = 4] = "Binary", A[A.Utf8 = 5] = "Utf8", A[A.Bool = 6] = "Bool", A[A.Decimal = 7] = "Decimal", A[A.Date = 8] = "Date", A[A.Time = 9] = "Time", A[A.Timestamp = 10] = "Timestamp", A[A.Interval = 11] = "Interval", A[A.List = 12] = "List", A[A.Struct_ = 13] = "Struct_", A[A.Union = 14] = "Union", A[A.FixedSizeBinary = 15] = "FixedSizeBinary", A[A.FixedSizeList = 16] = "FixedSizeList", A[A.Map = 17] = "Map", A[A.Duration = 18] = "Duration", A[A.LargeBinary = 19] = "LargeBinary", A[A.LargeUtf8 = 20] = "LargeUtf8", A[A.LargeList = 21] = "LargeList";
})(yn || (yn = {}));
let wa = class hv {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsField(e, t) {
    return (t || new hv()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsField(e, t) {
    return e.setPosition(e.position() + Vi), (t || new hv()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  name(e) {
    const t = this.bb.__offset(this.bb_pos, 4);
    return t ? this.bb.__string(this.bb_pos + t, e) : null;
  }
  /**
   * Whether or not this field can contain nulls. Should be true in general.
   */
  nullable() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? !!this.bb.readInt8(this.bb_pos + e) : !1;
  }
  typeType() {
    const e = this.bb.__offset(this.bb_pos, 8);
    return e ? this.bb.readUint8(this.bb_pos + e) : yn.NONE;
  }
  /**
   * This is the type of the decoded value if the field is dictionary encoded.
   */
  // @ts-ignore
  type(e) {
    const t = this.bb.__offset(this.bb_pos, 10);
    return t ? this.bb.__union(e, this.bb_pos + t) : null;
  }
  /**
   * Present only if the field is dictionary encoded.
   */
  dictionary(e) {
    const t = this.bb.__offset(this.bb_pos, 12);
    return t ? (e || new kc()).__init(this.bb.__indirect(this.bb_pos + t), this.bb) : null;
  }
  /**
   * children apply only to nested data types like Struct, List and Union. For
   * primitive types children will have length 0.
   */
  children(e, t) {
    const i = this.bb.__offset(this.bb_pos, 14);
    return i ? (t || new hv()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + e * 4), this.bb) : null;
  }
  childrenLength() {
    const e = this.bb.__offset(this.bb_pos, 14);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  /**
   * User-defined metadata
   */
  customMetadata(e, t) {
    const i = this.bb.__offset(this.bb_pos, 16);
    return i ? (t || new ro()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + e * 4), this.bb) : null;
  }
  customMetadataLength() {
    const e = this.bb.__offset(this.bb_pos, 16);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  static startField(e) {
    e.startObject(7);
  }
  static addName(e, t) {
    e.addFieldOffset(0, t, 0);
  }
  static addNullable(e, t) {
    e.addFieldInt8(1, +t, 0);
  }
  static addTypeType(e, t) {
    e.addFieldInt8(2, t, yn.NONE);
  }
  static addType(e, t) {
    e.addFieldOffset(3, t, 0);
  }
  static addDictionary(e, t) {
    e.addFieldOffset(4, t, 0);
  }
  static addChildren(e, t) {
    e.addFieldOffset(5, t, 0);
  }
  static createChildrenVector(e, t) {
    e.startVector(4, t.length, 4);
    for (let i = t.length - 1; i >= 0; i--)
      e.addOffset(t[i]);
    return e.endVector();
  }
  static startChildrenVector(e, t) {
    e.startVector(4, t, 4);
  }
  static addCustomMetadata(e, t) {
    e.addFieldOffset(6, t, 0);
  }
  static createCustomMetadataVector(e, t) {
    e.startVector(4, t.length, 4);
    for (let i = t.length - 1; i >= 0; i--)
      e.addOffset(t[i]);
    return e.endVector();
  }
  static startCustomMetadataVector(e, t) {
    e.startVector(4, t, 4);
  }
  static endField(e) {
    return e.endObject();
  }
}, IB = class Ic {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsSchema(e, t) {
    return (t || new Ic()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsSchema(e, t) {
    return e.setPosition(e.position() + Vi), (t || new Ic()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  /**
   * endianness of the buffer
   * it is Little Endian by default
   * if endianness doesn't match the underlying system then the vectors need to be converted
   */
  endianness() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt16(this.bb_pos + e) : AD.Little;
  }
  fields(e, t) {
    const i = this.bb.__offset(this.bb_pos, 6);
    return i ? (t || new wa()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + e * 4), this.bb) : null;
  }
  fieldsLength() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  customMetadata(e, t) {
    const i = this.bb.__offset(this.bb_pos, 8);
    return i ? (t || new ro()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + e * 4), this.bb) : null;
  }
  customMetadataLength() {
    const e = this.bb.__offset(this.bb_pos, 8);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  /**
   * Features used in the stream/file.
   */
  features(e) {
    const t = this.bb.__offset(this.bb_pos, 10);
    return t ? this.bb.readInt64(this.bb.__vector(this.bb_pos + t) + e * 8) : this.bb.createLong(0, 0);
  }
  featuresLength() {
    const e = this.bb.__offset(this.bb_pos, 10);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  static startSchema(e) {
    e.startObject(4);
  }
  static addEndianness(e, t) {
    e.addFieldInt16(0, t, AD.Little);
  }
  static addFields(e, t) {
    e.addFieldOffset(1, t, 0);
  }
  static createFieldsVector(e, t) {
    e.startVector(4, t.length, 4);
    for (let i = t.length - 1; i >= 0; i--)
      e.addOffset(t[i]);
    return e.endVector();
  }
  static startFieldsVector(e, t) {
    e.startVector(4, t, 4);
  }
  static addCustomMetadata(e, t) {
    e.addFieldOffset(2, t, 0);
  }
  static createCustomMetadataVector(e, t) {
    e.startVector(4, t.length, 4);
    for (let i = t.length - 1; i >= 0; i--)
      e.addOffset(t[i]);
    return e.endVector();
  }
  static startCustomMetadataVector(e, t) {
    e.startVector(4, t, 4);
  }
  static addFeatures(e, t) {
    e.addFieldOffset(3, t, 0);
  }
  static createFeaturesVector(e, t) {
    e.startVector(8, t.length, 8);
    for (let i = t.length - 1; i >= 0; i--)
      e.addInt64(t[i]);
    return e.endVector();
  }
  static startFeaturesVector(e, t) {
    e.startVector(8, t, 8);
  }
  static endSchema(e) {
    return e.endObject();
  }
  static finishSchemaBuffer(e, t) {
    e.finish(t);
  }
  static finishSizePrefixedSchemaBuffer(e, t) {
    e.finish(t, void 0, !0);
  }
  static createSchema(e, t, i, n, o) {
    return Ic.startSchema(e), Ic.addEndianness(e, t), Ic.addFields(e, i), Ic.addCustomMetadata(e, n), Ic.addFeatures(e, o), Ic.endSchema(e);
  }
};
class pI {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsFooter(e, t) {
    return (t || new pI()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsFooter(e, t) {
    return e.setPosition(e.position() + Vi), (t || new pI()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  version() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt16(this.bb_pos + e) : $f.V1;
  }
  schema(e) {
    const t = this.bb.__offset(this.bb_pos, 6);
    return t ? (e || new IB()).__init(this.bb.__indirect(this.bb_pos + t), this.bb) : null;
  }
  dictionaries(e, t) {
    const i = this.bb.__offset(this.bb_pos, 8);
    return i ? (t || new y6()).__init(this.bb.__vector(this.bb_pos + i) + e * 24, this.bb) : null;
  }
  dictionariesLength() {
    const e = this.bb.__offset(this.bb_pos, 8);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  recordBatches(e, t) {
    const i = this.bb.__offset(this.bb_pos, 10);
    return i ? (t || new y6()).__init(this.bb.__vector(this.bb_pos + i) + e * 24, this.bb) : null;
  }
  recordBatchesLength() {
    const e = this.bb.__offset(this.bb_pos, 10);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  /**
   * User-defined metadata
   */
  customMetadata(e, t) {
    const i = this.bb.__offset(this.bb_pos, 12);
    return i ? (t || new ro()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + e * 4), this.bb) : null;
  }
  customMetadataLength() {
    const e = this.bb.__offset(this.bb_pos, 12);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  static startFooter(e) {
    e.startObject(5);
  }
  static addVersion(e, t) {
    e.addFieldInt16(0, t, $f.V1);
  }
  static addSchema(e, t) {
    e.addFieldOffset(1, t, 0);
  }
  static addDictionaries(e, t) {
    e.addFieldOffset(2, t, 0);
  }
  static startDictionariesVector(e, t) {
    e.startVector(24, t, 8);
  }
  static addRecordBatches(e, t) {
    e.addFieldOffset(3, t, 0);
  }
  static startRecordBatchesVector(e, t) {
    e.startVector(24, t, 8);
  }
  static addCustomMetadata(e, t) {
    e.addFieldOffset(4, t, 0);
  }
  static createCustomMetadataVector(e, t) {
    e.startVector(4, t.length, 4);
    for (let i = t.length - 1; i >= 0; i--)
      e.addOffset(t[i]);
    return e.endVector();
  }
  static startCustomMetadataVector(e, t) {
    e.startVector(4, t, 4);
  }
  static endFooter(e) {
    return e.endObject();
  }
  static finishFooterBuffer(e, t) {
    e.finish(t);
  }
  static finishSizePrefixedFooterBuffer(e, t) {
    e.finish(t, void 0, !0);
  }
}
class yi {
  constructor(e = [], t, i) {
    this.fields = e || [], this.metadata = t || /* @__PURE__ */ new Map(), i || (i = f6(e)), this.dictionaries = i;
  }
  get [Symbol.toStringTag]() {
    return "Schema";
  }
  get names() {
    return this.fields.map((e) => e.name);
  }
  toString() {
    return `Schema<{ ${this.fields.map((e, t) => `${t}: ${e}`).join(", ")} }>`;
  }
  /**
   * Construct a new Schema containing only specified fields.
   *
   * @param fieldNames Names of fields to keep.
   * @returns A new Schema of fields matching the specified names.
   */
  select(e) {
    const t = new Set(e), i = this.fields.filter((n) => t.has(n.name));
    return new yi(i, this.metadata);
  }
  /**
   * Construct a new Schema containing only fields at the specified indices.
   *
   * @param fieldIndices Indices of fields to keep.
   * @returns A new Schema of fields at the specified indices.
   */
  selectAt(e) {
    const t = e.map((i) => this.fields[i]).filter(Boolean);
    return new yi(t, this.metadata);
  }
  assign(...e) {
    const t = e[0] instanceof yi ? e[0] : Array.isArray(e[0]) ? new yi(e[0]) : new yi(e), i = [...this.fields], n = AL(AL(/* @__PURE__ */ new Map(), this.metadata), t.metadata), o = t.fields.filter((s) => {
      const I = i.findIndex((r) => r.name === s.name);
      return ~I ? (i[I] = s.clone({
        metadata: AL(AL(/* @__PURE__ */ new Map(), i[I].metadata), s.metadata)
      })) && !1 : !0;
    }), g = f6(o, /* @__PURE__ */ new Map());
    return new yi([...i, ...o], n, new Map([...this.dictionaries, ...g]));
  }
}
yi.prototype.fields = null;
yi.prototype.metadata = null;
yi.prototype.dictionaries = null;
class rn {
  constructor(e, t, i = !1, n) {
    this.name = e, this.type = t, this.nullable = i, this.metadata = n || /* @__PURE__ */ new Map();
  }
  /** @nocollapse */
  static new(...e) {
    let [t, i, n, o] = e;
    return e[0] && typeof e[0] == "object" && ({ name: t } = e[0], i === void 0 && (i = e[0].type), n === void 0 && (n = e[0].nullable), o === void 0 && (o = e[0].metadata)), new rn(`${t}`, i, n, o);
  }
  get typeId() {
    return this.type.typeId;
  }
  get [Symbol.toStringTag]() {
    return "Field";
  }
  toString() {
    return `${this.name}: ${this.type}`;
  }
  clone(...e) {
    let [t, i, n, o] = e;
    return !e[0] || typeof e[0] != "object" ? [t = this.name, i = this.type, n = this.nullable, o = this.metadata] = e : { name: t = this.name, type: i = this.type, nullable: n = this.nullable, metadata: o = this.metadata } = e[0], rn.new(t, i, n, o);
  }
}
rn.prototype.type = null;
rn.prototype.name = null;
rn.prototype.nullable = null;
rn.prototype.metadata = null;
function AL(A, e) {
  return new Map([...A || /* @__PURE__ */ new Map(), ...e || /* @__PURE__ */ new Map()]);
}
function f6(A, e = /* @__PURE__ */ new Map()) {
  for (let t = -1, i = A.length; ++t < i; ) {
    const o = A[t].type;
    if (Ct.isDictionary(o)) {
      if (!e.has(o.id))
        e.set(o.id, o.dictionary);
      else if (e.get(o.id) !== o.dictionary)
        throw new Error("Cannot create Schema containing two different dictionaries with the same Id");
    }
    o.children && o.children.length > 0 && f6(o.children, e);
  }
  return e;
}
var ibA = eQ, Qkt = UTA, Ekt = Pf;
class W2 {
  constructor(e, t = RI.V4, i, n) {
    this.schema = e, this.version = t, i && (this._recordBatches = i), n && (this._dictionaryBatches = n);
  }
  /** @nocollapse */
  static decode(e) {
    e = new Ekt(li(e));
    const t = pI.getRootAsFooter(e), i = yi.decode(t.schema());
    return new ukt(i, t);
  }
  /** @nocollapse */
  static encode(e) {
    const t = new Qkt(), i = yi.encode(t, e.schema);
    pI.startRecordBatchesVector(t, e.numRecordBatches);
    for (const g of [...e.recordBatches()].slice().reverse())
      Ed.encode(t, g);
    const n = t.endVector();
    pI.startDictionariesVector(t, e.numDictionaries);
    for (const g of [...e.dictionaryBatches()].slice().reverse())
      Ed.encode(t, g);
    const o = t.endVector();
    return pI.startFooter(t), pI.addSchema(t, i), pI.addVersion(t, RI.V4), pI.addRecordBatches(t, n), pI.addDictionaries(t, o), pI.finishFooterBuffer(t, pI.endFooter(t)), t.asUint8Array();
  }
  get numRecordBatches() {
    return this._recordBatches.length;
  }
  get numDictionaries() {
    return this._dictionaryBatches.length;
  }
  *recordBatches() {
    for (let e, t = -1, i = this.numRecordBatches; ++t < i; )
      (e = this.getRecordBatch(t)) && (yield e);
  }
  *dictionaryBatches() {
    for (let e, t = -1, i = this.numDictionaries; ++t < i; )
      (e = this.getDictionaryBatch(t)) && (yield e);
  }
  getRecordBatch(e) {
    return e >= 0 && e < this.numRecordBatches && this._recordBatches[e] || null;
  }
  getDictionaryBatch(e) {
    return e >= 0 && e < this.numDictionaries && this._dictionaryBatches[e] || null;
  }
}
class ukt extends W2 {
  constructor(e, t) {
    super(e, t.version()), this._footer = t;
  }
  get numRecordBatches() {
    return this._footer.recordBatchesLength();
  }
  get numDictionaries() {
    return this._footer.dictionariesLength();
  }
  getRecordBatch(e) {
    if (e >= 0 && e < this.numRecordBatches) {
      const t = this._footer.recordBatches(e);
      if (t)
        return Ed.decode(t);
    }
    return null;
  }
  getDictionaryBatch(e) {
    if (e >= 0 && e < this.numDictionaries) {
      const t = this._footer.dictionaries(e);
      if (t)
        return Ed.decode(t);
    }
    return null;
  }
}
class Ed {
  constructor(e, t, i) {
    this.metaDataLength = e, this.offset = typeof i == "number" ? i : i.low, this.bodyLength = typeof t == "number" ? t : t.low;
  }
  /** @nocollapse */
  static decode(e) {
    return new Ed(e.metaDataLength(), e.bodyLength(), e.offset());
  }
  /** @nocollapse */
  static encode(e, t) {
    const { metaDataLength: i } = t, n = new ibA(t.offset, 0), o = new ibA(t.bodyLength, 0);
    return y6.createBlock(e, n, i, o);
  }
}
const Gn = Object.freeze({ done: !0, value: void 0 });
class nbA {
  constructor(e) {
    this._json = e;
  }
  get schema() {
    return this._json.schema;
  }
  get batches() {
    return this._json.batches || [];
  }
  get dictionaries() {
    return this._json.dictionaries || [];
  }
}
class _sA {
  tee() {
    return this._getDOMStream().tee();
  }
  pipe(e, t) {
    return this._getNodeStream().pipe(e, t);
  }
  pipeTo(e, t) {
    return this._getDOMStream().pipeTo(e, t);
  }
  pipeThrough(e, t) {
    return this._getDOMStream().pipeThrough(e, t);
  }
  _getDOMStream() {
    return this._DOMStream || (this._DOMStream = this.toDOMStream());
  }
  _getNodeStream() {
    return this._nodeStream || (this._nodeStream = this.toNodeStream());
  }
}
class dkt extends _sA {
  constructor() {
    super(), this._values = [], this.resolvers = [], this._closedPromise = new Promise((e) => this._closedPromiseResolve = e);
  }
  get closed() {
    return this._closedPromise;
  }
  cancel(e) {
    return UA(this, void 0, void 0, function* () {
      yield this.return(e);
    });
  }
  write(e) {
    this._ensureOpen() && (this.resolvers.length <= 0 ? this._values.push(e) : this.resolvers.shift().resolve({ done: !1, value: e }));
  }
  abort(e) {
    this._closedPromiseResolve && (this.resolvers.length <= 0 ? this._error = { error: e } : this.resolvers.shift().reject({ done: !0, value: e }));
  }
  close() {
    if (this._closedPromiseResolve) {
      const { resolvers: e } = this;
      for (; e.length > 0; )
        e.shift().resolve(Gn);
      this._closedPromiseResolve(), this._closedPromiseResolve = void 0;
    }
  }
  [Symbol.asyncIterator]() {
    return this;
  }
  toDOMStream(e) {
    return fa.toDOMStream(this._closedPromiseResolve || this._error ? this : this._values, e);
  }
  toNodeStream(e) {
    return fa.toNodeStream(this._closedPromiseResolve || this._error ? this : this._values, e);
  }
  throw(e) {
    return UA(this, void 0, void 0, function* () {
      return yield this.abort(e), Gn;
    });
  }
  return(e) {
    return UA(this, void 0, void 0, function* () {
      return yield this.close(), Gn;
    });
  }
  read(e) {
    return UA(this, void 0, void 0, function* () {
      return (yield this.next(e, "read")).value;
    });
  }
  peek(e) {
    return UA(this, void 0, void 0, function* () {
      return (yield this.next(e, "peek")).value;
    });
  }
  next(...e) {
    return this._values.length > 0 ? Promise.resolve({ done: !1, value: this._values.shift() }) : this._error ? Promise.reject({ done: !0, value: this._error.error }) : this._closedPromiseResolve ? new Promise((t, i) => {
      this.resolvers.push({ resolve: t, reject: i });
    }) : Promise.resolve(Gn);
  }
  _ensureOpen() {
    if (this._closedPromiseResolve)
      return !0;
    throw new Error("AsyncQueue is closed");
  }
}
class mv extends dkt {
  write(e) {
    if ((e = li(e)).byteLength > 0)
      return super.write(e);
  }
  toString(e = !1) {
    return e ? u6(this.toUint8Array(!0)) : this.toUint8Array(!1).then(u6);
  }
  toUint8Array(e = !1) {
    return e ? Ql(this._values)[0] : (() => UA(this, void 0, void 0, function* () {
      var t, i;
      const n = [];
      let o = 0;
      try {
        for (var g = Um(this), s; s = yield g.next(), !s.done; ) {
          const I = s.value;
          n.push(I), o += I.byteLength;
        }
      } catch (I) {
        t = { error: I };
      } finally {
        try {
          s && !s.done && (i = g.return) && (yield i.call(g));
        } finally {
          if (t)
            throw t.error;
        }
      }
      return Ql(n, o)[0];
    }))();
  }
}
class GW {
  constructor(e) {
    e && (this.source = new hkt(fa.fromIterable(e)));
  }
  [Symbol.iterator]() {
    return this;
  }
  next(e) {
    return this.source.next(e);
  }
  throw(e) {
    return this.source.throw(e);
  }
  return(e) {
    return this.source.return(e);
  }
  peek(e) {
    return this.source.peek(e);
  }
  read(e) {
    return this.source.read(e);
  }
}
class tD {
  constructor(e) {
    e instanceof tD ? this.source = e.source : e instanceof mv ? this.source = new vh(fa.fromAsyncIterable(e)) : DzA(e) ? this.source = new vh(fa.fromNodeStream(e)) : MsA(e) ? this.source = new vh(fa.fromDOMStream(e)) : fzA(e) ? this.source = new vh(fa.fromDOMStream(e.body)) : h1(e) ? this.source = new vh(fa.fromIterable(e)) : Bd(e) ? this.source = new vh(fa.fromAsyncIterable(e)) : DG(e) && (this.source = new vh(fa.fromAsyncIterable(e)));
  }
  [Symbol.asyncIterator]() {
    return this;
  }
  next(e) {
    return this.source.next(e);
  }
  throw(e) {
    return this.source.throw(e);
  }
  return(e) {
    return this.source.return(e);
  }
  get closed() {
    return this.source.closed;
  }
  cancel(e) {
    return this.source.cancel(e);
  }
  peek(e) {
    return this.source.peek(e);
  }
  read(e) {
    return this.source.read(e);
  }
}
class hkt {
  constructor(e) {
    this.source = e;
  }
  cancel(e) {
    this.return(e);
  }
  peek(e) {
    return this.next(e, "peek").value;
  }
  read(e) {
    return this.next(e, "read").value;
  }
  next(e, t = "read") {
    return this.source.next({ cmd: t, size: e });
  }
  throw(e) {
    return Object.create(this.source.throw && this.source.throw(e) || Gn);
  }
  return(e) {
    return Object.create(this.source.return && this.source.return(e) || Gn);
  }
}
class vh {
  constructor(e) {
    this.source = e, this._closedPromise = new Promise((t) => this._closedPromiseResolve = t);
  }
  cancel(e) {
    return UA(this, void 0, void 0, function* () {
      yield this.return(e);
    });
  }
  get closed() {
    return this._closedPromise;
  }
  read(e) {
    return UA(this, void 0, void 0, function* () {
      return (yield this.next(e, "read")).value;
    });
  }
  peek(e) {
    return UA(this, void 0, void 0, function* () {
      return (yield this.next(e, "peek")).value;
    });
  }
  next(e, t = "read") {
    return UA(this, void 0, void 0, function* () {
      return yield this.source.next({ cmd: t, size: e });
    });
  }
  throw(e) {
    return UA(this, void 0, void 0, function* () {
      const t = this.source.throw && (yield this.source.throw(e)) || Gn;
      return this._closedPromiseResolve && this._closedPromiseResolve(), this._closedPromiseResolve = void 0, Object.create(t);
    });
  }
  return(e) {
    return UA(this, void 0, void 0, function* () {
      const t = this.source.return && (yield this.source.return(e)) || Gn;
      return this._closedPromiseResolve && this._closedPromiseResolve(), this._closedPromiseResolve = void 0, Object.create(t);
    });
  }
}
class obA extends GW {
  constructor(e, t) {
    super(), this.position = 0, this.buffer = li(e), this.size = typeof t > "u" ? this.buffer.byteLength : t;
  }
  readInt32(e) {
    const { buffer: t, byteOffset: i } = this.readAt(e, 4);
    return new DataView(t, i).getInt32(0, !0);
  }
  seek(e) {
    return this.position = Math.min(e, this.size), e < this.size;
  }
  read(e) {
    const { buffer: t, size: i, position: n } = this;
    return t && n < i ? (typeof e != "number" && (e = Number.POSITIVE_INFINITY), this.position = Math.min(i, n + Math.min(i - n, e)), t.subarray(n, this.position)) : null;
  }
  readAt(e, t) {
    const i = this.buffer, n = Math.min(this.size, e + t);
    return i ? i.subarray(e, n) : new Uint8Array(t);
  }
  close() {
    this.buffer && (this.buffer = null);
  }
  throw(e) {
    return this.close(), { done: !0, value: e };
  }
  return(e) {
    return this.close(), { done: !0, value: e };
  }
}
class kW extends tD {
  constructor(e, t) {
    super(), this.position = 0, this._handle = e, typeof t == "number" ? this.size = t : this._pending = (() => UA(this, void 0, void 0, function* () {
      this.size = (yield e.stat()).size, delete this._pending;
    }))();
  }
  readInt32(e) {
    return UA(this, void 0, void 0, function* () {
      const { buffer: t, byteOffset: i } = yield this.readAt(e, 4);
      return new DataView(t, i).getInt32(0, !0);
    });
  }
  seek(e) {
    return UA(this, void 0, void 0, function* () {
      return this._pending && (yield this._pending), this.position = Math.min(e, this.size), e < this.size;
    });
  }
  read(e) {
    return UA(this, void 0, void 0, function* () {
      this._pending && (yield this._pending);
      const { _handle: t, size: i, position: n } = this;
      if (t && n < i) {
        typeof e != "number" && (e = Number.POSITIVE_INFINITY);
        let o = n, g = 0, s = 0;
        const I = Math.min(i, o + Math.min(i - o, e)), r = new Uint8Array(Math.max(0, (this.position = I) - o));
        for (; (o += s) < I && (g += s) < r.byteLength; )
          ({ bytesRead: s } = yield t.read(r, g, r.byteLength - g, o));
        return r;
      }
      return null;
    });
  }
  readAt(e, t) {
    return UA(this, void 0, void 0, function* () {
      this._pending && (yield this._pending);
      const { _handle: i, size: n } = this;
      if (i && e + t < n) {
        const o = Math.min(n, e + t), g = new Uint8Array(o - e);
        return (yield i.read(g, 0, t, e)).buffer;
      }
      return new Uint8Array(t);
    });
  }
  close() {
    return UA(this, void 0, void 0, function* () {
      const e = this._handle;
      this._handle = null, e && (yield e.close());
    });
  }
  throw(e) {
    return UA(this, void 0, void 0, function* () {
      return yield this.close(), { done: !0, value: e };
    });
  }
  return(e) {
    return UA(this, void 0, void 0, function* () {
      return yield this.close(), { done: !0, value: e };
    });
  }
}
const mkt = 1 << 16;
function zb(A) {
  return A < 0 && (A = 4294967295 + A + 1), `0x${A.toString(16)}`;
}
const iD = 8, qsA = [
  1,
  10,
  100,
  1e3,
  1e4,
  1e5,
  1e6,
  1e7,
  1e8
];
class XTA {
  constructor(e) {
    this.buffer = e;
  }
  high() {
    return this.buffer[1];
  }
  low() {
    return this.buffer[0];
  }
  _times(e) {
    const t = new Uint32Array([
      this.buffer[1] >>> 16,
      this.buffer[1] & 65535,
      this.buffer[0] >>> 16,
      this.buffer[0] & 65535
    ]), i = new Uint32Array([
      e.buffer[1] >>> 16,
      e.buffer[1] & 65535,
      e.buffer[0] >>> 16,
      e.buffer[0] & 65535
    ]);
    let n = t[3] * i[3];
    this.buffer[0] = n & 65535;
    let o = n >>> 16;
    return n = t[2] * i[3], o += n, n = t[3] * i[2] >>> 0, o += n, this.buffer[0] += o << 16, this.buffer[1] = o >>> 0 < n ? mkt : 0, this.buffer[1] += o >>> 16, this.buffer[1] += t[1] * i[3] + t[2] * i[2] + t[3] * i[1], this.buffer[1] += t[0] * i[3] + t[1] * i[2] + t[2] * i[1] + t[3] * i[0] << 16, this;
  }
  _plus(e) {
    const t = this.buffer[0] + e.buffer[0] >>> 0;
    this.buffer[1] += e.buffer[1], t < this.buffer[0] >>> 0 && ++this.buffer[1], this.buffer[0] = t;
  }
  lessThan(e) {
    return this.buffer[1] < e.buffer[1] || this.buffer[1] === e.buffer[1] && this.buffer[0] < e.buffer[0];
  }
  equals(e) {
    return this.buffer[1] === e.buffer[1] && this.buffer[0] == e.buffer[0];
  }
  greaterThan(e) {
    return e.lessThan(this);
  }
  hex() {
    return `${zb(this.buffer[1])} ${zb(this.buffer[0])}`;
  }
}
class Di extends XTA {
  times(e) {
    return this._times(e), this;
  }
  plus(e) {
    return this._plus(e), this;
  }
  /** @nocollapse */
  static from(e, t = new Uint32Array(2)) {
    return Di.fromString(typeof e == "string" ? e : e.toString(), t);
  }
  /** @nocollapse */
  static fromNumber(e, t = new Uint32Array(2)) {
    return Di.fromString(e.toString(), t);
  }
  /** @nocollapse */
  static fromString(e, t = new Uint32Array(2)) {
    const i = e.length, n = new Di(t);
    for (let o = 0; o < i; ) {
      const g = iD < i - o ? iD : i - o, s = new Di(new Uint32Array([Number.parseInt(e.slice(o, o + g), 10), 0])), I = new Di(new Uint32Array([qsA[g], 0]));
      n.times(I), n.plus(s), o += g;
    }
    return n;
  }
  /** @nocollapse */
  static convertArray(e) {
    const t = new Uint32Array(e.length * 2);
    for (let i = -1, n = e.length; ++i < n; )
      Di.from(e[i], new Uint32Array(t.buffer, t.byteOffset + 2 * i * 4, 2));
    return t;
  }
  /** @nocollapse */
  static multiply(e, t) {
    return new Di(new Uint32Array(e.buffer)).times(t);
  }
  /** @nocollapse */
  static add(e, t) {
    return new Di(new Uint32Array(e.buffer)).plus(t);
  }
}
class Ds extends XTA {
  negate() {
    return this.buffer[0] = ~this.buffer[0] + 1, this.buffer[1] = ~this.buffer[1], this.buffer[0] == 0 && ++this.buffer[1], this;
  }
  times(e) {
    return this._times(e), this;
  }
  plus(e) {
    return this._plus(e), this;
  }
  lessThan(e) {
    const t = this.buffer[1] << 0, i = e.buffer[1] << 0;
    return t < i || t === i && this.buffer[0] < e.buffer[0];
  }
  /** @nocollapse */
  static from(e, t = new Uint32Array(2)) {
    return Ds.fromString(typeof e == "string" ? e : e.toString(), t);
  }
  /** @nocollapse */
  static fromNumber(e, t = new Uint32Array(2)) {
    return Ds.fromString(e.toString(), t);
  }
  /** @nocollapse */
  static fromString(e, t = new Uint32Array(2)) {
    const i = e.startsWith("-"), n = e.length, o = new Ds(t);
    for (let g = i ? 1 : 0; g < n; ) {
      const s = iD < n - g ? iD : n - g, I = new Ds(new Uint32Array([Number.parseInt(e.slice(g, g + s), 10), 0])), r = new Ds(new Uint32Array([qsA[s], 0]));
      o.times(r), o.plus(I), g += s;
    }
    return i ? o.negate() : o;
  }
  /** @nocollapse */
  static convertArray(e) {
    const t = new Uint32Array(e.length * 2);
    for (let i = -1, n = e.length; ++i < n; )
      Ds.from(e[i], new Uint32Array(t.buffer, t.byteOffset + 2 * i * 4, 2));
    return t;
  }
  /** @nocollapse */
  static multiply(e, t) {
    return new Ds(new Uint32Array(e.buffer)).times(t);
  }
  /** @nocollapse */
  static add(e, t) {
    return new Ds(new Uint32Array(e.buffer)).plus(t);
  }
}
class aB {
  constructor(e) {
    this.buffer = e;
  }
  high() {
    return new Ds(new Uint32Array(this.buffer.buffer, this.buffer.byteOffset + 8, 2));
  }
  low() {
    return new Ds(new Uint32Array(this.buffer.buffer, this.buffer.byteOffset, 2));
  }
  negate() {
    return this.buffer[0] = ~this.buffer[0] + 1, this.buffer[1] = ~this.buffer[1], this.buffer[2] = ~this.buffer[2], this.buffer[3] = ~this.buffer[3], this.buffer[0] == 0 && ++this.buffer[1], this.buffer[1] == 0 && ++this.buffer[2], this.buffer[2] == 0 && ++this.buffer[3], this;
  }
  times(e) {
    const t = new Di(new Uint32Array([this.buffer[3], 0])), i = new Di(new Uint32Array([this.buffer[2], 0])), n = new Di(new Uint32Array([this.buffer[1], 0])), o = new Di(new Uint32Array([this.buffer[0], 0])), g = new Di(new Uint32Array([e.buffer[3], 0])), s = new Di(new Uint32Array([e.buffer[2], 0])), I = new Di(new Uint32Array([e.buffer[1], 0])), r = new Di(new Uint32Array([e.buffer[0], 0]));
    let a = Di.multiply(o, r);
    this.buffer[0] = a.low();
    const C = new Di(new Uint32Array([a.high(), 0]));
    return a = Di.multiply(n, r), C.plus(a), a = Di.multiply(o, I), C.plus(a), this.buffer[1] = C.low(), this.buffer[3] = C.lessThan(a) ? 1 : 0, this.buffer[2] = C.high(), new Di(new Uint32Array(this.buffer.buffer, this.buffer.byteOffset + 8, 2)).plus(Di.multiply(i, r)).plus(Di.multiply(n, I)).plus(Di.multiply(o, s)), this.buffer[3] += Di.multiply(t, r).plus(Di.multiply(i, I)).plus(Di.multiply(n, s)).plus(Di.multiply(o, g)).low(), this;
  }
  plus(e) {
    const t = new Uint32Array(4);
    return t[3] = this.buffer[3] + e.buffer[3] >>> 0, t[2] = this.buffer[2] + e.buffer[2] >>> 0, t[1] = this.buffer[1] + e.buffer[1] >>> 0, t[0] = this.buffer[0] + e.buffer[0] >>> 0, t[0] < this.buffer[0] >>> 0 && ++t[1], t[1] < this.buffer[1] >>> 0 && ++t[2], t[2] < this.buffer[2] >>> 0 && ++t[3], this.buffer[3] = t[3], this.buffer[2] = t[2], this.buffer[1] = t[1], this.buffer[0] = t[0], this;
  }
  hex() {
    return `${zb(this.buffer[3])} ${zb(this.buffer[2])} ${zb(this.buffer[1])} ${zb(this.buffer[0])}`;
  }
  /** @nocollapse */
  static multiply(e, t) {
    return new aB(new Uint32Array(e.buffer)).times(t);
  }
  /** @nocollapse */
  static add(e, t) {
    return new aB(new Uint32Array(e.buffer)).plus(t);
  }
  /** @nocollapse */
  static from(e, t = new Uint32Array(4)) {
    return aB.fromString(typeof e == "string" ? e : e.toString(), t);
  }
  /** @nocollapse */
  static fromNumber(e, t = new Uint32Array(4)) {
    return aB.fromString(e.toString(), t);
  }
  /** @nocollapse */
  static fromString(e, t = new Uint32Array(4)) {
    const i = e.startsWith("-"), n = e.length, o = new aB(t);
    for (let g = i ? 1 : 0; g < n; ) {
      const s = iD < n - g ? iD : n - g, I = new aB(new Uint32Array([Number.parseInt(e.slice(g, g + s), 10), 0, 0, 0])), r = new aB(new Uint32Array([qsA[s], 0, 0, 0]));
      o.times(r), o.plus(I), g += s;
    }
    return i ? o.negate() : o;
  }
  /** @nocollapse */
  static convertArray(e) {
    const t = new Uint32Array(e.length * 4);
    for (let i = -1, n = e.length; ++i < n; )
      aB.from(e[i], new Uint32Array(t.buffer, t.byteOffset + 4 * 4 * i, 4));
    return t;
  }
}
class zTA extends zt {
  constructor(e, t, i, n) {
    super(), this.nodesIndex = -1, this.buffersIndex = -1, this.bytes = e, this.nodes = t, this.buffers = i, this.dictionaries = n;
  }
  visit(e) {
    return super.visit(e instanceof rn ? e.type : e);
  }
  visitNull(e, { length: t } = this.nextFieldNode()) {
    return Kt({ type: e, length: t });
  }
  visitBool(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e) });
  }
  visitInt(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e) });
  }
  visitFloat(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e) });
  }
  visitUtf8(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), valueOffsets: this.readOffsets(e), data: this.readData(e) });
  }
  visitBinary(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), valueOffsets: this.readOffsets(e), data: this.readData(e) });
  }
  visitFixedSizeBinary(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e) });
  }
  visitDate(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e) });
  }
  visitTimestamp(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e) });
  }
  visitTime(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e) });
  }
  visitDecimal(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e) });
  }
  visitList(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), valueOffsets: this.readOffsets(e), child: this.visit(e.children[0]) });
  }
  visitStruct(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), children: this.visitMany(e.children) });
  }
  visitUnion(e) {
    return e.mode === na.Sparse ? this.visitSparseUnion(e) : this.visitDenseUnion(e);
  }
  visitDenseUnion(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), typeIds: this.readTypeIds(e), valueOffsets: this.readOffsets(e), children: this.visitMany(e.children) });
  }
  visitSparseUnion(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), typeIds: this.readTypeIds(e), children: this.visitMany(e.children) });
  }
  visitDictionary(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e.indices), dictionary: this.readDictionary(e) });
  }
  visitInterval(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), data: this.readData(e) });
  }
  visitFixedSizeList(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), child: this.visit(e.children[0]) });
  }
  visitMap(e, { length: t, nullCount: i } = this.nextFieldNode()) {
    return Kt({ type: e, length: t, nullCount: i, nullBitmap: this.readNullBitmap(e, i), valueOffsets: this.readOffsets(e), child: this.visit(e.children[0]) });
  }
  nextFieldNode() {
    return this.nodes[++this.nodesIndex];
  }
  nextBufferRange() {
    return this.buffers[++this.buffersIndex];
  }
  readNullBitmap(e, t, i = this.nextBufferRange()) {
    return t > 0 && this.readData(e, i) || new Uint8Array(0);
  }
  readOffsets(e, t) {
    return this.readData(e, t);
  }
  readTypeIds(e, t) {
    return this.readData(e, t);
  }
  readData(e, { length: t, offset: i } = this.nextBufferRange()) {
    return this.bytes.subarray(i, i + t);
  }
  readDictionary(e) {
    return this.dictionaries.get(e.id);
  }
}
class pkt extends zTA {
  constructor(e, t, i, n) {
    super(new Uint8Array(0), t, i, n), this.sources = e;
  }
  readNullBitmap(e, t, { offset: i } = this.nextBufferRange()) {
    return t <= 0 ? new Uint8Array(0) : hW(this.sources[i]);
  }
  readOffsets(e, { offset: t } = this.nextBufferRange()) {
    return Si(Uint8Array, Si(Int32Array, this.sources[t]));
  }
  readTypeIds(e, { offset: t } = this.nextBufferRange()) {
    return Si(Uint8Array, Si(e.ArrayType, this.sources[t]));
  }
  readData(e, { offset: t } = this.nextBufferRange()) {
    const { sources: i } = this;
    return Ct.isTimestamp(e) || (Ct.isInt(e) || Ct.isTime(e)) && e.bitWidth === 64 || Ct.isDate(e) && e.unit === bQ.MILLISECOND ? Si(Uint8Array, Ds.convertArray(i[t])) : Ct.isDecimal(e) ? Si(Uint8Array, aB.convertArray(i[t])) : Ct.isBinary(e) || Ct.isFixedSizeBinary(e) ? ykt(i[t]) : Ct.isBool(e) ? hW(i[t]) : Ct.isUtf8(e) ? FsA(i[t].join("")) : Si(Uint8Array, Si(e.ArrayType, i[t].map((n) => +n)));
  }
}
function ykt(A) {
  const e = A.join(""), t = new Uint8Array(e.length / 2);
  for (let i = 0; i < e.length; i += 2)
    t[i >> 1] = Number.parseInt(e.slice(i, i + 2), 16);
  return t;
}
class Qt extends zt {
  compareSchemas(e, t) {
    return e === t || t instanceof e.constructor && this.compareManyFields(e.fields, t.fields);
  }
  compareManyFields(e, t) {
    return e === t || Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((i, n) => this.compareFields(i, t[n]));
  }
  compareFields(e, t) {
    return e === t || t instanceof e.constructor && e.name === t.name && e.nullable === t.nullable && this.visit(e.type, t.type);
  }
}
function aI(A, e) {
  return e instanceof A.constructor;
}
function m1(A, e) {
  return A === e || aI(A, e);
}
function _Q(A, e) {
  return A === e || aI(A, e) && A.bitWidth === e.bitWidth && A.isSigned === e.isSigned;
}
function MX(A, e) {
  return A === e || aI(A, e) && A.precision === e.precision;
}
function bkt(A, e) {
  return A === e || aI(A, e) && A.byteWidth === e.byteWidth;
}
function OsA(A, e) {
  return A === e || aI(A, e) && A.unit === e.unit;
}
function p1(A, e) {
  return A === e || aI(A, e) && A.unit === e.unit && A.timezone === e.timezone;
}
function y1(A, e) {
  return A === e || aI(A, e) && A.unit === e.unit && A.bitWidth === e.bitWidth;
}
function wkt(A, e) {
  return A === e || aI(A, e) && A.children.length === e.children.length && ud.compareManyFields(A.children, e.children);
}
function fkt(A, e) {
  return A === e || aI(A, e) && A.children.length === e.children.length && ud.compareManyFields(A.children, e.children);
}
function jsA(A, e) {
  return A === e || aI(A, e) && A.mode === e.mode && A.typeIds.every((t, i) => t === e.typeIds[i]) && ud.compareManyFields(A.children, e.children);
}
function Dkt(A, e) {
  return A === e || aI(A, e) && A.id === e.id && A.isOrdered === e.isOrdered && ud.visit(A.indices, e.indices) && ud.visit(A.dictionary, e.dictionary);
}
function PsA(A, e) {
  return A === e || aI(A, e) && A.unit === e.unit;
}
function Gkt(A, e) {
  return A === e || aI(A, e) && A.listSize === e.listSize && A.children.length === e.children.length && ud.compareManyFields(A.children, e.children);
}
function kkt(A, e) {
  return A === e || aI(A, e) && A.keysSorted === e.keysSorted && A.children.length === e.children.length && ud.compareManyFields(A.children, e.children);
}
Qt.prototype.visitNull = m1;
Qt.prototype.visitBool = m1;
Qt.prototype.visitInt = _Q;
Qt.prototype.visitInt8 = _Q;
Qt.prototype.visitInt16 = _Q;
Qt.prototype.visitInt32 = _Q;
Qt.prototype.visitInt64 = _Q;
Qt.prototype.visitUint8 = _Q;
Qt.prototype.visitUint16 = _Q;
Qt.prototype.visitUint32 = _Q;
Qt.prototype.visitUint64 = _Q;
Qt.prototype.visitFloat = MX;
Qt.prototype.visitFloat16 = MX;
Qt.prototype.visitFloat32 = MX;
Qt.prototype.visitFloat64 = MX;
Qt.prototype.visitUtf8 = m1;
Qt.prototype.visitBinary = m1;
Qt.prototype.visitFixedSizeBinary = bkt;
Qt.prototype.visitDate = OsA;
Qt.prototype.visitDateDay = OsA;
Qt.prototype.visitDateMillisecond = OsA;
Qt.prototype.visitTimestamp = p1;
Qt.prototype.visitTimestampSecond = p1;
Qt.prototype.visitTimestampMillisecond = p1;
Qt.prototype.visitTimestampMicrosecond = p1;
Qt.prototype.visitTimestampNanosecond = p1;
Qt.prototype.visitTime = y1;
Qt.prototype.visitTimeSecond = y1;
Qt.prototype.visitTimeMillisecond = y1;
Qt.prototype.visitTimeMicrosecond = y1;
Qt.prototype.visitTimeNanosecond = y1;
Qt.prototype.visitDecimal = m1;
Qt.prototype.visitList = wkt;
Qt.prototype.visitStruct = fkt;
Qt.prototype.visitUnion = jsA;
Qt.prototype.visitDenseUnion = jsA;
Qt.prototype.visitSparseUnion = jsA;
Qt.prototype.visitDictionary = Dkt;
Qt.prototype.visitInterval = PsA;
Qt.prototype.visitIntervalDayTime = PsA;
Qt.prototype.visitIntervalYearMonth = PsA;
Qt.prototype.visitFixedSizeList = Gkt;
Qt.prototype.visitMap = kkt;
const ud = new Qt();
function D6(A, e) {
  return ud.compareSchemas(A, e);
}
function p_(A, e) {
  return Jkt(A, e.map((t) => t.data.concat()));
}
function Jkt(A, e) {
  const t = [...A.fields], i = [], n = { numBatches: e.reduce((C, B) => Math.max(C, B.length), 0) };
  let o = 0, g = 0, s = -1;
  const I = e.length;
  let r, a = [];
  for (; n.numBatches-- > 0; ) {
    for (g = Number.POSITIVE_INFINITY, s = -1; ++s < I; )
      a[s] = r = e[s].shift(), g = Math.min(g, r ? r.length : g);
    Number.isFinite(g) && (a = Nkt(t, g, a, e, n), g > 0 && (i[o++] = Kt({
      type: new es(t),
      length: g,
      nullCount: 0,
      children: a.slice()
    })));
  }
  return [
    A = A.assign(t),
    i.map((C) => new Fs(A, C))
  ];
}
function Nkt(A, e, t, i, n) {
  var o;
  const g = (e + 63 & -64) >> 3;
  for (let s = -1, I = i.length; ++s < I; ) {
    const r = t[s], a = r == null ? void 0 : r.length;
    if (a >= e)
      a === e ? t[s] = r : (t[s] = r.slice(0, e), n.numBatches = Math.max(n.numBatches, i[s].unshift(r.slice(e, a - e))));
    else {
      const C = A[s];
      A[s] = C.clone({ nullable: !0 }), t[s] = (o = r == null ? void 0 : r._changeLengthAndBackfillNullBitmap(e)) !== null && o !== void 0 ? o : Kt({
        type: C.type,
        length: e,
        nullCount: e,
        nullBitmap: new Uint8Array(g)
      });
    }
  }
  return t;
}
var TTA;
class $g {
  constructor(...e) {
    var t, i;
    if (e.length === 0)
      return this.batches = [], this.schema = new yi([]), this._offsets = [0], this;
    let n, o;
    e[0] instanceof yi && (n = e.shift()), e[e.length - 1] instanceof Uint32Array && (o = e.pop());
    const g = (I) => {
      if (I) {
        if (I instanceof Fs)
          return [I];
        if (I instanceof $g)
          return I.batches;
        if (I instanceof zi) {
          if (I.type instanceof es)
            return [new Fs(new yi(I.type.children), I)];
        } else {
          if (Array.isArray(I))
            return I.flatMap((r) => g(r));
          if (typeof I[Symbol.iterator] == "function")
            return [...I].flatMap((r) => g(r));
          if (typeof I == "object") {
            const r = Object.keys(I), a = r.map((l) => new pi([I[l]])), C = new yi(r.map((l, Q) => new rn(String(l), a[Q].type))), [, B] = p_(C, a);
            return B.length === 0 ? [new Fs(I)] : B;
          }
        }
      }
      return [];
    }, s = e.flatMap((I) => g(I));
    if (n = (i = n ?? ((t = s[0]) === null || t === void 0 ? void 0 : t.schema)) !== null && i !== void 0 ? i : new yi([]), !(n instanceof yi))
      throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");
    for (const I of s) {
      if (!(I instanceof Fs))
        throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");
      if (!D6(n, I.schema))
        throw new TypeError("Table and inner RecordBatch schemas must be equivalent.");
    }
    this.schema = n, this.batches = s, this._offsets = o ?? RTA(this.data);
  }
  /**
   * The contiguous {@link RecordBatch `RecordBatch`} chunks of the Table rows.
   */
  get data() {
    return this.batches.map(({ data: e }) => e);
  }
  /**
   * The number of columns in this Table.
   */
  get numCols() {
    return this.schema.fields.length;
  }
  /**
   * The number of rows in this Table.
   */
  get numRows() {
    return this.data.reduce((e, t) => e + t.length, 0);
  }
  /**
   * The number of null rows in this Table.
   */
  get nullCount() {
    return this._nullCount === -1 && (this._nullCount = YTA(this.data)), this._nullCount;
  }
  /**
   * Check whether an element is null.
   *
   * @param index The index at which to read the validity bitmap.
   */
  // @ts-ignore
  isValid(e) {
    return !1;
  }
  /**
   * Get an element value by position.
   *
   * @param index The index of the element to read.
   */
  // @ts-ignore
  get(e) {
    return null;
  }
  /**
   * Set an element value by position.
   *
   * @param index The index of the element to write.
   * @param value The value to set.
   */
  // @ts-ignore
  set(e, t) {
  }
  /**
   * Retrieve the index of the first occurrence of a value in an Vector.
   *
   * @param element The value to locate in the Vector.
   * @param offset The index at which to begin the search. If offset is omitted, the search starts at index 0.
   */
  // @ts-ignore
  indexOf(e, t) {
    return -1;
  }
  /**
   * Get the size in bytes of an element by index.
   * @param index The index at which to get the byteLength.
   */
  // @ts-ignore
  getByteLength(e) {
    return 0;
  }
  /**
   * Iterator for rows in this Table.
   */
  [Symbol.iterator]() {
    return this.batches.length > 0 ? TsA.visit(new pi(this.data)) : new Array(0)[Symbol.iterator]();
  }
  /**
   * Return a JavaScript Array of the Table rows.
   *
   * @returns An Array of Table rows.
   */
  toArray() {
    return [...this];
  }
  /**
   * Returns a string representation of the Table rows.
   *
   * @returns A string representation of the Table rows.
   */
  toString() {
    return `[
  ${this.toArray().join(`,
  `)}
]`;
  }
  /**
   * Combines two or more Tables of the same schema.
   *
   * @param others Additional Tables to add to the end of this Tables.
   */
  concat(...e) {
    const t = this.schema, i = this.data.concat(e.flatMap(({ data: n }) => n));
    return new $g(t, i.map((n) => new Fs(t, n)));
  }
  /**
   * Return a zero-copy sub-section of this Table.
   *
   * @param begin The beginning of the specified portion of the Table.
   * @param end The end of the specified portion of the Table. This is exclusive of the element at the index 'end'.
   */
  slice(e, t) {
    const i = this.schema;
    [e, t] = JTA({ length: this.numRows }, e, t);
    const n = FTA(this.data, this._offsets, e, t);
    return new $g(i, n.map((o) => new Fs(i, o)));
  }
  /**
   * Returns a child Vector by name, or null if this Vector has no child with the given name.
   *
   * @param name The name of the child to retrieve.
   */
  getChild(e) {
    return this.getChildAt(this.schema.fields.findIndex((t) => t.name === e));
  }
  /**
   * Returns a child Vector by index, or null if this Vector has no child at the supplied index.
   *
   * @param index The index of the child to retrieve.
   */
  getChildAt(e) {
    if (e > -1 && e < this.schema.fields.length) {
      const t = this.data.map((i) => i.children[e]);
      if (t.length === 0) {
        const { type: i } = this.schema.fields[e], n = Kt({ type: i, length: 0, nullCount: 0 });
        t.push(n._changeLengthAndBackfillNullBitmap(this.numRows));
      }
      return new pi(t);
    }
    return null;
  }
  /**
   * Sets a child Vector by name.
   *
   * @param name The name of the child to overwrite.
   * @returns A new Table with the supplied child for the specified name.
   */
  setChild(e, t) {
    var i;
    return this.setChildAt((i = this.schema.fields) === null || i === void 0 ? void 0 : i.findIndex((n) => n.name === e), t);
  }
  setChildAt(e, t) {
    let i = this.schema, n = [...this.batches];
    if (e > -1 && e < this.numCols) {
      t || (t = new pi([Kt({ type: new cd(), length: this.numRows })]));
      const o = i.fields.slice(), g = o[e].clone({ type: t.type }), s = this.schema.fields.map((I, r) => this.getChildAt(r));
      [o[e], s[e]] = [g, t], [i, n] = p_(i, s);
    }
    return new $g(i, n);
  }
  /**
   * Construct a new Table containing only specified columns.
   *
   * @param columnNames Names of columns to keep.
   * @returns A new Table of columns matching the specified names.
   */
  select(e) {
    const t = this.schema.fields.reduce((i, n, o) => i.set(n.name, o), /* @__PURE__ */ new Map());
    return this.selectAt(e.map((i) => t.get(i)).filter((i) => i > -1));
  }
  /**
   * Construct a new Table containing only columns at the specified indices.
   *
   * @param columnIndices Indices of columns to keep.
   * @returns A new Table of columns at the specified indices.
   */
  selectAt(e) {
    const t = this.schema.selectAt(e), i = this.batches.map((n) => n.selectAt(e));
    return new $g(t, i);
  }
  assign(e) {
    const t = this.schema.fields, [i, n] = e.schema.fields.reduce((s, I, r) => {
      const [a, C] = s, B = t.findIndex((l) => l.name === I.name);
      return ~B ? C[B] = r : a.push(r), s;
    }, [[], []]), o = this.schema.assign(e.schema), g = [
      ...t.map((s, I) => [I, n[I]]).map(([s, I]) => I === void 0 ? this.getChildAt(s) : e.getChildAt(I)),
      ...i.map((s) => e.getChildAt(s))
    ].filter(Boolean);
    return new $g(...p_(o, g));
  }
}
TTA = Symbol.toStringTag;
$g[TTA] = ((A) => (A.schema = null, A.batches = [], A._offsets = new Uint32Array([0]), A._nullCount = -1, A[Symbol.isConcatSpreadable] = !0, A.isValid = Gw(zsA), A.get = Gw(tI.getVisitFn(bA.Struct)), A.set = MTA(rr.getVisitFn(bA.Struct)), A.indexOf = xTA(mW.getVisitFn(bA.Struct)), A.getByteLength = Gw(El.getVisitFn(bA.Struct)), "Table"))($g.prototype);
var _TA;
let Fs = class TJ {
  constructor(...e) {
    switch (e.length) {
      case 2: {
        if ([this.schema] = e, !(this.schema instanceof yi))
          throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");
        if ([
          ,
          this.data = Kt({
            nullCount: 0,
            type: new es(this.schema.fields),
            children: this.schema.fields.map((t) => Kt({ type: t.type, nullCount: 0 }))
          })
        ] = e, !(this.data instanceof zi))
          throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");
        [this.schema, this.data] = gbA(this.schema, this.data.children);
        break;
      }
      case 1: {
        const [t] = e, { fields: i, children: n, length: o } = Object.keys(t).reduce((I, r, a) => (I.children[a] = t[r], I.length = Math.max(I.length, t[r].length), I.fields[a] = rn.new({ name: r, type: t[r].type, nullable: !0 }), I), {
          length: 0,
          fields: new Array(),
          children: new Array()
        }), g = new yi(i), s = Kt({ type: new es(i), length: o, children: n, nullCount: 0 });
        [this.schema, this.data] = gbA(g, s.children, o);
        break;
      }
      default:
        throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.");
    }
  }
  get dictionaries() {
    return this._dictionaries || (this._dictionaries = qTA(this.schema.fields, this.data.children));
  }
  /**
   * The number of columns in this RecordBatch.
   */
  get numCols() {
    return this.schema.fields.length;
  }
  /**
   * The number of rows in this RecordBatch.
   */
  get numRows() {
    return this.data.length;
  }
  /**
   * The number of null rows in this RecordBatch.
   */
  get nullCount() {
    return this.data.nullCount;
  }
  /**
   * Check whether an element is null.
   * @param index The index at which to read the validity bitmap.
   */
  isValid(e) {
    return this.data.getValid(e);
  }
  /**
   * Get a row by position.
   * @param index The index of the element to read.
   */
  get(e) {
    return tI.visit(this.data, e);
  }
  /**
   * Set a row by position.
   * @param index The index of the element to write.
   * @param value The value to set.
   */
  set(e, t) {
    return rr.visit(this.data, e, t);
  }
  /**
   * Retrieve the index of the first occurrence of a row in an RecordBatch.
   * @param element The row to locate in the RecordBatch.
   * @param offset The index at which to begin the search. If offset is omitted, the search starts at index 0.
   */
  indexOf(e, t) {
    return mW.visit(this.data, e, t);
  }
  /**
   * Get the size (in bytes) of a row by index.
   * @param index The row index for which to compute the byteLength.
   */
  getByteLength(e) {
    return El.visit(this.data, e);
  }
  /**
   * Iterator for rows in this RecordBatch.
   */
  [Symbol.iterator]() {
    return TsA.visit(new pi([this.data]));
  }
  /**
   * Return a JavaScript Array of the RecordBatch rows.
   * @returns An Array of RecordBatch rows.
   */
  toArray() {
    return [...this];
  }
  /**
   * Combines two or more RecordBatch of the same schema.
   * @param others Additional RecordBatch to add to the end of this RecordBatch.
   */
  concat(...e) {
    return new $g(this.schema, [this, ...e]);
  }
  /**
   * Return a zero-copy sub-section of this RecordBatch.
   * @param start The beginning of the specified portion of the RecordBatch.
   * @param end The end of the specified portion of the RecordBatch. This is exclusive of the element at the index 'end'.
   */
  slice(e, t) {
    const [i] = new pi([this.data]).slice(e, t).data;
    return new TJ(this.schema, i);
  }
  /**
   * Returns a child Vector by name, or null if this Vector has no child with the given name.
   * @param name The name of the child to retrieve.
   */
  getChild(e) {
    var t;
    return this.getChildAt((t = this.schema.fields) === null || t === void 0 ? void 0 : t.findIndex((i) => i.name === e));
  }
  /**
   * Returns a child Vector by index, or null if this Vector has no child at the supplied index.
   * @param index The index of the child to retrieve.
   */
  getChildAt(e) {
    return e > -1 && e < this.schema.fields.length ? new pi([this.data.children[e]]) : null;
  }
  /**
   * Sets a child Vector by name.
   * @param name The name of the child to overwrite.
   * @returns A new RecordBatch with the new child for the specified name.
   */
  setChild(e, t) {
    var i;
    return this.setChildAt((i = this.schema.fields) === null || i === void 0 ? void 0 : i.findIndex((n) => n.name === e), t);
  }
  setChildAt(e, t) {
    let i = this.schema, n = this.data;
    if (e > -1 && e < this.numCols) {
      t || (t = new pi([Kt({ type: new cd(), length: this.numRows })]));
      const o = i.fields.slice(), g = n.children.slice(), s = o[e].clone({ type: t.type });
      [o[e], g[e]] = [s, t.data[0]], i = new yi(o, new Map(this.schema.metadata)), n = Kt({ type: new es(o), children: g });
    }
    return new TJ(i, n);
  }
  /**
   * Construct a new RecordBatch containing only specified columns.
   *
   * @param columnNames Names of columns to keep.
   * @returns A new RecordBatch of columns matching the specified names.
   */
  select(e) {
    const t = this.schema.select(e), i = new es(t.fields), n = [];
    for (const o of e) {
      const g = this.schema.fields.findIndex((s) => s.name === o);
      ~g && (n[g] = this.data.children[g]);
    }
    return new TJ(t, Kt({ type: i, length: this.numRows, children: n }));
  }
  /**
   * Construct a new RecordBatch containing only columns at the specified indices.
   *
   * @param columnIndices Indices of columns to keep.
   * @returns A new RecordBatch of columns matching at the specified indices.
   */
  selectAt(e) {
    const t = this.schema.selectAt(e), i = e.map((o) => this.data.children[o]).filter(Boolean), n = Kt({ type: new es(t.fields), length: this.numRows, children: i });
    return new TJ(t, n);
  }
};
_TA = Symbol.toStringTag;
Fs[_TA] = ((A) => (A._nullCount = -1, A[Symbol.isConcatSpreadable] = !0, "RecordBatch"))(Fs.prototype);
function gbA(A, e, t = e.reduce((i, n) => Math.max(i, n.length), 0)) {
  var i;
  const n = [...A.fields], o = [...e], g = (t + 63 & -64) >> 3;
  for (const [s, I] of A.fields.entries()) {
    const r = e[s];
    (!r || r.length !== t) && (n[s] = I.clone({ nullable: !0 }), o[s] = (i = r == null ? void 0 : r._changeLengthAndBackfillNullBitmap(t)) !== null && i !== void 0 ? i : Kt({
      type: I.type,
      length: t,
      nullCount: t,
      nullBitmap: new Uint8Array(g)
    }));
  }
  return [
    A.assign(n),
    Kt({ type: new es(n), length: t, children: o })
  ];
}
function qTA(A, e, t = /* @__PURE__ */ new Map()) {
  for (let i = -1, n = A.length; ++i < n; ) {
    const g = A[i].type, s = e[i];
    if (Ct.isDictionary(g)) {
      if (!t.has(g.id))
        s.dictionary && t.set(g.id, s.dictionary);
      else if (t.get(g.id) !== s.dictionary)
        throw new Error("Cannot create Schema containing two different dictionaries with the same Id");
    }
    g.children && g.children.length > 0 && qTA(g.children, s.children, t);
  }
  return t;
}
class $sA extends Fs {
  constructor(e) {
    const t = e.fields.map((n) => Kt({ type: n.type })), i = Kt({ type: new es(e.fields), nullCount: 0, children: t });
    super(e, i);
  }
}
var JW;
(function(A) {
  A[A.BUFFER = 0] = "BUFFER";
})(JW || (JW = {}));
var NW;
(function(A) {
  A[A.LZ4_FRAME = 0] = "LZ4_FRAME", A[A.ZSTD = 1] = "ZSTD";
})(NW || (NW = {}));
class HE {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsBodyCompression(e, t) {
    return (t || new HE()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsBodyCompression(e, t) {
    return e.setPosition(e.position() + Vi), (t || new HE()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  /**
   * Compressor library.
   * For LZ4_FRAME, each compressed buffer must consist of a single frame.
   */
  codec() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt8(this.bb_pos + e) : NW.LZ4_FRAME;
  }
  /**
   * Indicates the way the record batch body was compressed
   */
  method() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? this.bb.readInt8(this.bb_pos + e) : JW.BUFFER;
  }
  static startBodyCompression(e) {
    e.startObject(2);
  }
  static addCodec(e, t) {
    e.addFieldInt8(0, t, NW.LZ4_FRAME);
  }
  static addMethod(e, t) {
    e.addFieldInt8(1, t, JW.BUFFER);
  }
  static endBodyCompression(e) {
    return e.endObject();
  }
  static createBodyCompression(e, t, i) {
    return HE.startBodyCompression(e), HE.addCodec(e, t), HE.addMethod(e, i), HE.endBodyCompression(e);
  }
}
let OTA = class {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  /**
   * The relative offset into the shared memory page where the bytes for this
   * buffer starts
   */
  offset() {
    return this.bb.readInt64(this.bb_pos);
  }
  /**
   * The absolute length (in bytes) of the memory buffer. The memory is found
   * from offset (inclusive) to offset + length (non-inclusive). When building
   * messages using the encapsulated IPC message, padding bytes may be written
   * after a buffer, but such padding bytes do not need to be accounted for in
   * the size here.
   */
  length() {
    return this.bb.readInt64(this.bb_pos + 8);
  }
  static sizeOf() {
    return 16;
  }
  static createBuffer(e, t, i) {
    return e.prep(8, 16), e.writeInt64(i), e.writeInt64(t), e.offset();
  }
}, jTA = class {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  /**
   * The number of value slots in the Arrow array at this level of a nested
   * tree
   */
  length() {
    return this.bb.readInt64(this.bb_pos);
  }
  /**
   * The number of observed nulls. Fields with null_count == 0 may choose not
   * to write their physical validity bitmap out as a materialized buffer,
   * instead setting the length of the bitmap buffer to 0.
   */
  nullCount() {
    return this.bb.readInt64(this.bb_pos + 8);
  }
  static sizeOf() {
    return 16;
  }
  static createFieldNode(e, t, i) {
    return e.prep(8, 16), e.writeInt64(i), e.writeInt64(t), e.offset();
  }
}, Ec = class G6 {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsRecordBatch(e, t) {
    return (t || new G6()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsRecordBatch(e, t) {
    return e.setPosition(e.position() + Vi), (t || new G6()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  /**
   * number of records / rows. The arrays in the batch should all have this
   * length
   */
  length() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt64(this.bb_pos + e) : this.bb.createLong(0, 0);
  }
  /**
   * Nodes correspond to the pre-ordered flattened logical schema
   */
  nodes(e, t) {
    const i = this.bb.__offset(this.bb_pos, 6);
    return i ? (t || new jTA()).__init(this.bb.__vector(this.bb_pos + i) + e * 16, this.bb) : null;
  }
  nodesLength() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  /**
   * Buffers correspond to the pre-ordered flattened buffer tree
   *
   * The number of buffers appended to this list depends on the schema. For
   * example, most primitive arrays will have 2 buffers, 1 for the validity
   * bitmap and 1 for the values. For struct arrays, there will only be a
   * single buffer for the validity (nulls) bitmap
   */
  buffers(e, t) {
    const i = this.bb.__offset(this.bb_pos, 8);
    return i ? (t || new OTA()).__init(this.bb.__vector(this.bb_pos + i) + e * 16, this.bb) : null;
  }
  buffersLength() {
    const e = this.bb.__offset(this.bb_pos, 8);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  /**
   * Optional compression of the message body
   */
  compression(e) {
    const t = this.bb.__offset(this.bb_pos, 10);
    return t ? (e || new HE()).__init(this.bb.__indirect(this.bb_pos + t), this.bb) : null;
  }
  static startRecordBatch(e) {
    e.startObject(4);
  }
  static addLength(e, t) {
    e.addFieldInt64(0, t, e.createLong(0, 0));
  }
  static addNodes(e, t) {
    e.addFieldOffset(1, t, 0);
  }
  static startNodesVector(e, t) {
    e.startVector(16, t, 8);
  }
  static addBuffers(e, t) {
    e.addFieldOffset(2, t, 0);
  }
  static startBuffersVector(e, t) {
    e.startVector(16, t, 8);
  }
  static addCompression(e, t) {
    e.addFieldOffset(3, t, 0);
  }
  static endRecordBatch(e) {
    return e.endObject();
  }
}, Eb = class k6 {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsDictionaryBatch(e, t) {
    return (t || new k6()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsDictionaryBatch(e, t) {
    return e.setPosition(e.position() + Vi), (t || new k6()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  id() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt64(this.bb_pos + e) : this.bb.createLong(0, 0);
  }
  data(e) {
    const t = this.bb.__offset(this.bb_pos, 6);
    return t ? (e || new Ec()).__init(this.bb.__indirect(this.bb_pos + t), this.bb) : null;
  }
  /**
   * If isDelta is true the values in the dictionary are to be appended to a
   * dictionary with the indicated id. If isDelta is false this dictionary
   * should replace the existing dictionary.
   */
  isDelta() {
    const e = this.bb.__offset(this.bb_pos, 8);
    return e ? !!this.bb.readInt8(this.bb_pos + e) : !1;
  }
  static startDictionaryBatch(e) {
    e.startObject(3);
  }
  static addId(e, t) {
    e.addFieldInt64(0, t, e.createLong(0, 0));
  }
  static addData(e, t) {
    e.addFieldOffset(1, t, 0);
  }
  static addIsDelta(e, t) {
    e.addFieldInt8(2, +t, 0);
  }
  static endDictionaryBatch(e) {
    return e.endObject();
  }
};
var YW;
(function(A) {
  A[A.NONE = 0] = "NONE", A[A.Schema = 1] = "Schema", A[A.DictionaryBatch = 2] = "DictionaryBatch", A[A.RecordBatch = 3] = "RecordBatch", A[A.Tensor = 4] = "Tensor", A[A.SparseTensor = 5] = "SparseTensor";
})(YW || (YW = {}));
let hE = class nB {
  constructor() {
    this.bb = null, this.bb_pos = 0;
  }
  __init(e, t) {
    return this.bb_pos = e, this.bb = t, this;
  }
  static getRootAsMessage(e, t) {
    return (t || new nB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  static getSizePrefixedRootAsMessage(e, t) {
    return e.setPosition(e.position() + Vi), (t || new nB()).__init(e.readInt32(e.position()) + e.position(), e);
  }
  version() {
    const e = this.bb.__offset(this.bb_pos, 4);
    return e ? this.bb.readInt16(this.bb_pos + e) : $f.V1;
  }
  headerType() {
    const e = this.bb.__offset(this.bb_pos, 6);
    return e ? this.bb.readUint8(this.bb_pos + e) : YW.NONE;
  }
  // @ts-ignore
  header(e) {
    const t = this.bb.__offset(this.bb_pos, 8);
    return t ? this.bb.__union(e, this.bb_pos + t) : null;
  }
  bodyLength() {
    const e = this.bb.__offset(this.bb_pos, 10);
    return e ? this.bb.readInt64(this.bb_pos + e) : this.bb.createLong(0, 0);
  }
  customMetadata(e, t) {
    const i = this.bb.__offset(this.bb_pos, 12);
    return i ? (t || new ro()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + e * 4), this.bb) : null;
  }
  customMetadataLength() {
    const e = this.bb.__offset(this.bb_pos, 12);
    return e ? this.bb.__vector_len(this.bb_pos + e) : 0;
  }
  static startMessage(e) {
    e.startObject(5);
  }
  static addVersion(e, t) {
    e.addFieldInt16(0, t, $f.V1);
  }
  static addHeaderType(e, t) {
    e.addFieldInt8(1, t, YW.NONE);
  }
  static addHeader(e, t) {
    e.addFieldOffset(2, t, 0);
  }
  static addBodyLength(e, t) {
    e.addFieldInt64(3, t, e.createLong(0, 0));
  }
  static addCustomMetadata(e, t) {
    e.addFieldOffset(4, t, 0);
  }
  static createCustomMetadataVector(e, t) {
    e.startVector(4, t.length, 4);
    for (let i = t.length - 1; i >= 0; i--)
      e.addOffset(t[i]);
    return e.endVector();
  }
  static startCustomMetadataVector(e, t) {
    e.startVector(4, t, 4);
  }
  static endMessage(e) {
    return e.endObject();
  }
  static finishMessageBuffer(e, t) {
    e.finish(t);
  }
  static finishSizePrefixedMessageBuffer(e, t) {
    e.finish(t, void 0, !0);
  }
  static createMessage(e, t, i, n, o, g) {
    return nB.startMessage(e), nB.addVersion(e, t), nB.addHeaderType(e, i), nB.addHeader(e, n), nB.addBodyLength(e, o), nB.addCustomMetadata(e, g), nB.endMessage(e);
  }
};
var Ykt = eQ;
class Rkt extends zt {
  visit(e, t) {
    return e == null || t == null ? void 0 : super.visit(e, t);
  }
  visitNull(e, t) {
    return pm.startNull(t), pm.endNull(t);
  }
  visitInt(e, t) {
    return JI.startInt(t), JI.addBitWidth(t, e.bitWidth), JI.addIsSigned(t, e.isSigned), JI.endInt(t);
  }
  visitFloat(e, t) {
    return wB.startFloatingPoint(t), wB.addPrecision(t, e.precision), wB.endFloatingPoint(t);
  }
  visitBinary(e, t) {
    return dm.startBinary(t), dm.endBinary(t);
  }
  visitBool(e, t) {
    return hm.startBool(t), hm.endBool(t);
  }
  visitUtf8(e, t) {
    return bm.startUtf8(t), bm.endUtf8(t);
  }
  visitDecimal(e, t) {
    return ks.startDecimal(t), ks.addScale(t, e.scale), ks.addPrecision(t, e.precision), ks.addBitWidth(t, e.bitWidth), ks.endDecimal(t);
  }
  visitDate(e, t) {
    return uv.startDate(t), uv.addUnit(t, e.unit), uv.endDate(t);
  }
  visitTime(e, t) {
    return Ja.startTime(t), Ja.addUnit(t, e.unit), Ja.addBitWidth(t, e.bitWidth), Ja.endTime(t);
  }
  visitTimestamp(e, t) {
    const i = e.timezone && t.createString(e.timezone) || void 0;
    return Na.startTimestamp(t), Na.addUnit(t, e.unit), i !== void 0 && Na.addTimezone(t, i), Na.endTimestamp(t);
  }
  visitInterval(e, t) {
    return fB.startInterval(t), fB.addUnit(t, e.unit), fB.endInterval(t);
  }
  visitList(e, t) {
    return mm.startList(t), mm.endList(t);
  }
  visitStruct(e, t) {
    return ym.startStruct_(t), ym.endStruct_(t);
  }
  visitUnion(e, t) {
    Rs.startTypeIdsVector(t, e.typeIds.length);
    const i = Rs.createTypeIdsVector(t, e.typeIds);
    return Rs.startUnion(t), Rs.addMode(t, e.mode), Rs.addTypeIds(t, i), Rs.endUnion(t);
  }
  visitDictionary(e, t) {
    const i = this.visit(e.indices, t);
    return kc.startDictionaryEncoding(t), kc.addId(t, new Ykt(e.id, 0)), kc.addIsOrdered(t, e.isOrdered), i !== void 0 && kc.addIndexType(t, i), kc.endDictionaryEncoding(t);
  }
  visitFixedSizeBinary(e, t) {
    return yB.startFixedSizeBinary(t), yB.addByteWidth(t, e.byteWidth), yB.endFixedSizeBinary(t);
  }
  visitFixedSizeList(e, t) {
    return bB.startFixedSizeList(t), bB.addListSize(t, e.listSize), bB.endFixedSizeList(t);
  }
  visitMap(e, t) {
    return dv.startMap(t), dv.addKeysSorted(t, e.keysSorted), dv.endMap(t);
  }
}
const y_ = new Rkt();
function Fkt(A, e = /* @__PURE__ */ new Map()) {
  return new yi(xkt(A, e), pv(A.customMetadata), e);
}
function PTA(A) {
  return new oa(A.count, $TA(A.columns), A_A(A.columns));
}
function Mkt(A) {
  return new ul(PTA(A.data), A.id, A.isDelta);
}
function xkt(A, e) {
  return (A.fields || []).filter(Boolean).map((t) => rn.fromJSON(t, e));
}
function sbA(A, e) {
  return (A.children || []).filter(Boolean).map((t) => rn.fromJSON(t, e));
}
function $TA(A) {
  return (A || []).reduce((e, t) => [
    ...e,
    new k0(t.count, Lkt(t.VALIDITY)),
    ...$TA(t.children)
  ], []);
}
function A_A(A, e = []) {
  for (let t = -1, i = (A || []).length; ++t < i; ) {
    const n = A[t];
    n.VALIDITY && e.push(new FB(e.length, n.VALIDITY.length)), n.TYPE && e.push(new FB(e.length, n.TYPE.length)), n.OFFSET && e.push(new FB(e.length, n.OFFSET.length)), n.DATA && e.push(new FB(e.length, n.DATA.length)), e = A_A(n.children, e);
  }
  return e;
}
function Lkt(A) {
  return (A || []).reduce((e, t) => e + +(t === 0), 0);
}
function vkt(A, e) {
  let t, i, n, o, g, s;
  return !e || !(o = A.dictionary) ? (g = abA(A, sbA(A, e)), n = new rn(A.name, g, A.nullable, pv(A.customMetadata))) : e.has(t = o.id) ? (i = (i = o.indexType) ? IbA(i) : new H2(), s = new jf(e.get(t), i, t, o.isOrdered), n = new rn(A.name, s, A.nullable, pv(A.customMetadata))) : (i = (i = o.indexType) ? IbA(i) : new H2(), e.set(t, g = abA(A, sbA(A, e))), s = new jf(g, i, t, o.isOrdered), n = new rn(A.name, s, A.nullable, pv(A.customMetadata))), n || null;
}
function pv(A) {
  return new Map(Object.entries(A || {}));
}
function IbA(A) {
  return new Qd(A.isSigned, A.bitWidth);
}
function abA(A, e) {
  const t = A.type.name;
  switch (t) {
    case "NONE":
      return new cd();
    case "null":
      return new cd();
    case "binary":
      return new sW();
    case "utf8":
      return new IW();
    case "bool":
      return new aW();
    case "list":
      return new cW((e || [])[0]);
    case "struct":
      return new es(e || []);
    case "struct_":
      return new es(e || []);
  }
  switch (t) {
    case "int": {
      const i = A.type;
      return new Qd(i.isSigned, i.bitWidth);
    }
    case "floatingpoint": {
      const i = A.type;
      return new S2(Xs[i.precision]);
    }
    case "decimal": {
      const i = A.type;
      return new rW(i.scale, i.precision, i.bitWidth);
    }
    case "date": {
      const i = A.type;
      return new CW(bQ[i.unit]);
    }
    case "time": {
      const i = A.type;
      return new Z2(ci[i.unit], i.bitWidth);
    }
    case "timestamp": {
      const i = A.type;
      return new BW(ci[i.unit], i.timezone);
    }
    case "interval": {
      const i = A.type;
      return new lW(ld[i.unit]);
    }
    case "union": {
      const i = A.type;
      return new QW(na[i.mode], i.typeIds || [], e || []);
    }
    case "fixedsizebinary": {
      const i = A.type;
      return new EW(i.byteWidth);
    }
    case "fixedsizelist": {
      const i = A.type;
      return new uW(i.listSize, (e || [])[0]);
    }
    case "map": {
      const i = A.type;
      return new dW((e || [])[0], i.keysSorted);
    }
  }
  throw new Error(`Unrecognized type: "${t}"`);
}
var Hp = eQ, Hkt = UTA, Skt = Pf;
class ts {
  constructor(e, t, i, n) {
    this._version = t, this._headerType = i, this.body = new Uint8Array(0), n && (this._createHeader = () => n), this._bodyLength = typeof e == "number" ? e : e.low;
  }
  /** @nocollapse */
  static fromJSON(e, t) {
    const i = new ts(0, RI.V4, t);
    return i._createHeader = Zkt(e, t), i;
  }
  /** @nocollapse */
  static decode(e) {
    e = new Skt(li(e));
    const t = hE.getRootAsMessage(e), i = t.bodyLength(), n = t.version(), o = t.headerType(), g = new ts(i, n, o);
    return g._createHeader = Wkt(t, o), g;
  }
  /** @nocollapse */
  static encode(e) {
    const t = new Hkt();
    let i = -1;
    return e.isSchema() ? i = yi.encode(t, e.header()) : e.isRecordBatch() ? i = oa.encode(t, e.header()) : e.isDictionaryBatch() && (i = ul.encode(t, e.header())), hE.startMessage(t), hE.addVersion(t, RI.V4), hE.addHeader(t, i), hE.addHeaderType(t, e.headerType), hE.addBodyLength(t, new Hp(e.bodyLength, 0)), hE.finishMessageBuffer(t, hE.endMessage(t)), t.asUint8Array();
  }
  /** @nocollapse */
  static from(e, t = 0) {
    if (e instanceof yi)
      return new ts(0, RI.V4, mi.Schema, e);
    if (e instanceof oa)
      return new ts(t, RI.V4, mi.RecordBatch, e);
    if (e instanceof ul)
      return new ts(t, RI.V4, mi.DictionaryBatch, e);
    throw new Error(`Unrecognized Message header: ${e}`);
  }
  get type() {
    return this.headerType;
  }
  get version() {
    return this._version;
  }
  get headerType() {
    return this._headerType;
  }
  get bodyLength() {
    return this._bodyLength;
  }
  header() {
    return this._createHeader();
  }
  isSchema() {
    return this.headerType === mi.Schema;
  }
  isRecordBatch() {
    return this.headerType === mi.RecordBatch;
  }
  isDictionaryBatch() {
    return this.headerType === mi.DictionaryBatch;
  }
}
class oa {
  constructor(e, t, i) {
    this._nodes = t, this._buffers = i, this._length = typeof e == "number" ? e : e.low;
  }
  get nodes() {
    return this._nodes;
  }
  get length() {
    return this._length;
  }
  get buffers() {
    return this._buffers;
  }
}
class ul {
  constructor(e, t, i = !1) {
    this._data = e, this._isDelta = i, this._id = typeof t == "number" ? t : t.low;
  }
  get id() {
    return this._id;
  }
  get data() {
    return this._data;
  }
  get isDelta() {
    return this._isDelta;
  }
  get length() {
    return this.data.length;
  }
  get nodes() {
    return this.data.nodes;
  }
  get buffers() {
    return this.data.buffers;
  }
}
class FB {
  constructor(e, t) {
    this.offset = typeof e == "number" ? e : e.low, this.length = typeof t == "number" ? t : t.low;
  }
}
class k0 {
  constructor(e, t) {
    this.length = typeof e == "number" ? e : e.low, this.nullCount = typeof t == "number" ? t : t.low;
  }
}
function Zkt(A, e) {
  return () => {
    switch (e) {
      case mi.Schema:
        return yi.fromJSON(A);
      case mi.RecordBatch:
        return oa.fromJSON(A);
      case mi.DictionaryBatch:
        return ul.fromJSON(A);
    }
    throw new Error(`Unrecognized Message type: { name: ${mi[e]}, type: ${e} }`);
  };
}
function Wkt(A, e) {
  return () => {
    switch (e) {
      case mi.Schema:
        return yi.decode(A.header(new IB()));
      case mi.RecordBatch:
        return oa.decode(A.header(new Ec()), A.version());
      case mi.DictionaryBatch:
        return ul.decode(A.header(new Eb()), A.version());
    }
    throw new Error(`Unrecognized Message type: { name: ${mi[e]}, type: ${e} }`);
  };
}
rn.encode = Pkt;
rn.decode = Okt;
rn.fromJSON = vkt;
yi.encode = jkt;
yi.decode = Kkt;
yi.fromJSON = Fkt;
oa.encode = $kt;
oa.decode = Ukt;
oa.fromJSON = PTA;
ul.encode = AJt;
ul.decode = Vkt;
ul.fromJSON = Mkt;
k0.encode = eJt;
k0.decode = zkt;
FB.encode = tJt;
FB.decode = Xkt;
function Kkt(A, e = /* @__PURE__ */ new Map()) {
  const t = qkt(A, e);
  return new yi(t, yv(A), e);
}
function Ukt(A, e = RI.V4) {
  if (A.compression() !== null)
    throw new Error("Record batch compression not implemented");
  return new oa(A.length(), Tkt(A), _kt(A, e));
}
function Vkt(A, e = RI.V4) {
  return new ul(oa.decode(A.data(), e), A.id(), A.isDelta());
}
function Xkt(A) {
  return new FB(A.offset(), A.length());
}
function zkt(A) {
  return new k0(A.length(), A.nullCount());
}
function Tkt(A) {
  const e = [];
  for (let t, i = -1, n = -1, o = A.nodesLength(); ++i < o; )
    (t = A.nodes(i)) && (e[++n] = k0.decode(t));
  return e;
}
function _kt(A, e) {
  const t = [];
  for (let i, n = -1, o = -1, g = A.buffersLength(); ++n < g; )
    (i = A.buffers(n)) && (e < RI.V4 && (i.bb_pos += 8 * (n + 1)), t[++o] = FB.decode(i));
  return t;
}
function qkt(A, e) {
  const t = [];
  for (let i, n = -1, o = -1, g = A.fieldsLength(); ++n < g; )
    (i = A.fields(n)) && (t[++o] = rn.decode(i, e));
  return t;
}
function rbA(A, e) {
  const t = [];
  for (let i, n = -1, o = -1, g = A.childrenLength(); ++n < g; )
    (i = A.children(n)) && (t[++o] = rn.decode(i, e));
  return t;
}
function Okt(A, e) {
  let t, i, n, o, g, s;
  return !e || !(s = A.dictionary()) ? (n = BbA(A, rbA(A, e)), i = new rn(A.name(), n, A.nullable(), yv(A))) : e.has(t = s.id().low) ? (o = (o = s.indexType()) ? CbA(o) : new H2(), g = new jf(e.get(t), o, t, s.isOrdered()), i = new rn(A.name(), g, A.nullable(), yv(A))) : (o = (o = s.indexType()) ? CbA(o) : new H2(), e.set(t, n = BbA(A, rbA(A, e))), g = new jf(n, o, t, s.isOrdered()), i = new rn(A.name(), g, A.nullable(), yv(A))), i || null;
}
function yv(A) {
  const e = /* @__PURE__ */ new Map();
  if (A)
    for (let t, i, n = -1, o = Math.trunc(A.customMetadataLength()); ++n < o; )
      (t = A.customMetadata(n)) && (i = t.key()) != null && e.set(i, t.value());
  return e;
}
function CbA(A) {
  return new Qd(A.isSigned(), A.bitWidth());
}
function BbA(A, e) {
  const t = A.typeType();
  switch (t) {
    case yn.NONE:
      return new cd();
    case yn.Null:
      return new cd();
    case yn.Binary:
      return new sW();
    case yn.Utf8:
      return new IW();
    case yn.Bool:
      return new aW();
    case yn.List:
      return new cW((e || [])[0]);
    case yn.Struct_:
      return new es(e || []);
  }
  switch (t) {
    case yn.Int: {
      const i = A.type(new JI());
      return new Qd(i.isSigned(), i.bitWidth());
    }
    case yn.FloatingPoint: {
      const i = A.type(new wB());
      return new S2(i.precision());
    }
    case yn.Decimal: {
      const i = A.type(new ks());
      return new rW(i.scale(), i.precision(), i.bitWidth());
    }
    case yn.Date: {
      const i = A.type(new uv());
      return new CW(i.unit());
    }
    case yn.Time: {
      const i = A.type(new Ja());
      return new Z2(i.unit(), i.bitWidth());
    }
    case yn.Timestamp: {
      const i = A.type(new Na());
      return new BW(i.unit(), i.timezone());
    }
    case yn.Interval: {
      const i = A.type(new fB());
      return new lW(i.unit());
    }
    case yn.Union: {
      const i = A.type(new Rs());
      return new QW(i.mode(), i.typeIdsArray() || [], e || []);
    }
    case yn.FixedSizeBinary: {
      const i = A.type(new yB());
      return new EW(i.byteWidth());
    }
    case yn.FixedSizeList: {
      const i = A.type(new bB());
      return new uW(i.listSize(), (e || [])[0]);
    }
    case yn.Map: {
      const i = A.type(new dv());
      return new dW((e || [])[0], i.keysSorted());
    }
  }
  throw new Error(`Unrecognized type: "${yn[t]}" (${t})`);
}
function jkt(A, e) {
  const t = e.fields.map((o) => rn.encode(A, o));
  IB.startFieldsVector(A, t.length);
  const i = IB.createFieldsVector(A, t), n = e.metadata && e.metadata.size > 0 ? IB.createCustomMetadataVector(A, [...e.metadata].map(([o, g]) => {
    const s = A.createString(`${o}`), I = A.createString(`${g}`);
    return ro.startKeyValue(A), ro.addKey(A, s), ro.addValue(A, I), ro.endKeyValue(A);
  })) : -1;
  return IB.startSchema(A), IB.addFields(A, i), IB.addEndianness(A, iJt ? AD.Little : AD.Big), n !== -1 && IB.addCustomMetadata(A, n), IB.endSchema(A);
}
function Pkt(A, e) {
  let t = -1, i = -1, n = -1;
  const o = e.type;
  let g = e.typeId;
  Ct.isDictionary(o) ? (g = o.dictionary.typeId, n = y_.visit(o, A), i = y_.visit(o.dictionary, A)) : i = y_.visit(o, A);
  const s = (o.children || []).map((a) => rn.encode(A, a)), I = wa.createChildrenVector(A, s), r = e.metadata && e.metadata.size > 0 ? wa.createCustomMetadataVector(A, [...e.metadata].map(([a, C]) => {
    const B = A.createString(`${a}`), l = A.createString(`${C}`);
    return ro.startKeyValue(A), ro.addKey(A, B), ro.addValue(A, l), ro.endKeyValue(A);
  })) : -1;
  return e.name && (t = A.createString(e.name)), wa.startField(A), wa.addType(A, i), wa.addTypeType(A, g), wa.addChildren(A, I), wa.addNullable(A, !!e.nullable), t !== -1 && wa.addName(A, t), n !== -1 && wa.addDictionary(A, n), r !== -1 && wa.addCustomMetadata(A, r), wa.endField(A);
}
function $kt(A, e) {
  const t = e.nodes || [], i = e.buffers || [];
  Ec.startNodesVector(A, t.length);
  for (const g of t.slice().reverse())
    k0.encode(A, g);
  const n = A.endVector();
  Ec.startBuffersVector(A, i.length);
  for (const g of i.slice().reverse())
    FB.encode(A, g);
  const o = A.endVector();
  return Ec.startRecordBatch(A), Ec.addLength(A, new Hp(e.length, 0)), Ec.addNodes(A, n), Ec.addBuffers(A, o), Ec.endRecordBatch(A);
}
function AJt(A, e) {
  const t = oa.encode(A, e.data);
  return Eb.startDictionaryBatch(A), Eb.addId(A, new Hp(e.id, 0)), Eb.addIsDelta(A, e.isDelta), Eb.addData(A, t), Eb.endDictionaryBatch(A);
}
function eJt(A, e) {
  return jTA.createFieldNode(A, new Hp(e.length, 0), new Hp(e.nullCount, 0));
}
function tJt(A, e) {
  return OTA.createBuffer(A, new Hp(e.offset, 0), new Hp(e.length, 0));
}
const iJt = (() => {
  const A = new ArrayBuffer(2);
  return new DataView(A).setInt16(
    0,
    256,
    !0
    /* littleEndian */
  ), new Int16Array(A)[0] === 256;
})(), AIA = (A) => `Expected ${mi[A]} Message in stream, but was null or length 0.`, eIA = (A) => `Header pointer of flatbuffer-encoded ${mi[A]} Message is null or length 0.`, e_A = (A, e) => `Expected to read ${A} metadata bytes, but only read ${e}.`, t_A = (A, e) => `Expected to read ${A} bytes for message body, but only read ${e}.`;
class i_A {
  constructor(e) {
    this.source = e instanceof GW ? e : new GW(e);
  }
  [Symbol.iterator]() {
    return this;
  }
  next() {
    let e;
    return (e = this.readMetadataLength()).done || e.value === -1 && (e = this.readMetadataLength()).done || (e = this.readMetadata(e.value)).done ? Gn : e;
  }
  throw(e) {
    return this.source.throw(e);
  }
  return(e) {
    return this.source.return(e);
  }
  readMessage(e) {
    let t;
    if ((t = this.next()).done)
      return null;
    if (e != null && t.value.headerType !== e)
      throw new Error(AIA(e));
    return t.value;
  }
  readMessageBody(e) {
    if (e <= 0)
      return new Uint8Array(0);
    const t = li(this.source.read(e));
    if (t.byteLength < e)
      throw new Error(t_A(e, t.byteLength));
    return (
      /* 1. */
      t.byteOffset % 8 === 0 && /* 2. */
      t.byteOffset + t.byteLength <= t.buffer.byteLength ? t : t.slice()
    );
  }
  readSchema(e = !1) {
    const t = mi.Schema, i = this.readMessage(t), n = i == null ? void 0 : i.header();
    if (e && !n)
      throw new Error(eIA(t));
    return n;
  }
  readMetadataLength() {
    const e = this.source.read(xX), t = e && new Pf(e), i = (t == null ? void 0 : t.readInt32(0)) || 0;
    return { done: i === 0, value: i };
  }
  readMetadata(e) {
    const t = this.source.read(e);
    if (!t)
      return Gn;
    if (t.byteLength < e)
      throw new Error(e_A(e, t.byteLength));
    return { done: !1, value: ts.decode(t) };
  }
}
class nJt {
  constructor(e, t) {
    this.source = e instanceof tD ? e : wzA(e) ? new kW(e, t) : new tD(e);
  }
  [Symbol.asyncIterator]() {
    return this;
  }
  next() {
    return UA(this, void 0, void 0, function* () {
      let e;
      return (e = yield this.readMetadataLength()).done || e.value === -1 && (e = yield this.readMetadataLength()).done || (e = yield this.readMetadata(e.value)).done ? Gn : e;
    });
  }
  throw(e) {
    return UA(this, void 0, void 0, function* () {
      return yield this.source.throw(e);
    });
  }
  return(e) {
    return UA(this, void 0, void 0, function* () {
      return yield this.source.return(e);
    });
  }
  readMessage(e) {
    return UA(this, void 0, void 0, function* () {
      let t;
      if ((t = yield this.next()).done)
        return null;
      if (e != null && t.value.headerType !== e)
        throw new Error(AIA(e));
      return t.value;
    });
  }
  readMessageBody(e) {
    return UA(this, void 0, void 0, function* () {
      if (e <= 0)
        return new Uint8Array(0);
      const t = li(yield this.source.read(e));
      if (t.byteLength < e)
        throw new Error(t_A(e, t.byteLength));
      return (
        /* 1. */
        t.byteOffset % 8 === 0 && /* 2. */
        t.byteOffset + t.byteLength <= t.buffer.byteLength ? t : t.slice()
      );
    });
  }
  readSchema(e = !1) {
    return UA(this, void 0, void 0, function* () {
      const t = mi.Schema, i = yield this.readMessage(t), n = i == null ? void 0 : i.header();
      if (e && !n)
        throw new Error(eIA(t));
      return n;
    });
  }
  readMetadataLength() {
    return UA(this, void 0, void 0, function* () {
      const e = yield this.source.read(xX), t = e && new Pf(e), i = (t == null ? void 0 : t.readInt32(0)) || 0;
      return { done: i === 0, value: i };
    });
  }
  readMetadata(e) {
    return UA(this, void 0, void 0, function* () {
      const t = yield this.source.read(e);
      if (!t)
        return Gn;
      if (t.byteLength < e)
        throw new Error(e_A(e, t.byteLength));
      return { done: !1, value: ts.decode(t) };
    });
  }
}
class oJt extends i_A {
  constructor(e) {
    super(new Uint8Array(0)), this._schema = !1, this._body = [], this._batchIndex = 0, this._dictionaryIndex = 0, this._json = e instanceof nbA ? e : new nbA(e);
  }
  next() {
    const { _json: e } = this;
    if (!this._schema)
      return this._schema = !0, { done: !1, value: ts.fromJSON(e.schema, mi.Schema) };
    if (this._dictionaryIndex < e.dictionaries.length) {
      const t = e.dictionaries[this._dictionaryIndex++];
      return this._body = t.data.columns, { done: !1, value: ts.fromJSON(t, mi.DictionaryBatch) };
    }
    if (this._batchIndex < e.batches.length) {
      const t = e.batches[this._batchIndex++];
      return this._body = t.columns, { done: !1, value: ts.fromJSON(t, mi.RecordBatch) };
    }
    return this._body = [], Gn;
  }
  readMessageBody(e) {
    return t(this._body);
    function t(i) {
      return (i || []).reduce((n, o) => [
        ...n,
        ...o.VALIDITY && [o.VALIDITY] || [],
        ...o.TYPE && [o.TYPE] || [],
        ...o.OFFSET && [o.OFFSET] || [],
        ...o.DATA && [o.DATA] || [],
        ...t(o.children)
      ], []);
    }
  }
  readMessage(e) {
    let t;
    if ((t = this.next()).done)
      return null;
    if (e != null && t.value.headerType !== e)
      throw new Error(AIA(e));
    return t.value;
  }
  readSchema() {
    const e = mi.Schema, t = this.readMessage(e), i = t == null ? void 0 : t.header();
    if (!t || !i)
      throw new Error(eIA(e));
    return i;
  }
}
const xX = 4, J6 = "ARROW1", K2 = new Uint8Array(J6.length);
for (let A = 0; A < J6.length; A += 1)
  K2[A] = J6.codePointAt(A);
function tIA(A, e = 0) {
  for (let t = -1, i = K2.length; ++t < i; )
    if (K2[t] !== A[e + t])
      return !1;
  return !0;
}
const b1 = K2.length, n_A = b1 + xX, gJt = b1 * 2 + xX;
class tQ extends _sA {
  constructor(e) {
    super(), this._impl = e;
  }
  get closed() {
    return this._impl.closed;
  }
  get schema() {
    return this._impl.schema;
  }
  get autoDestroy() {
    return this._impl.autoDestroy;
  }
  get dictionaries() {
    return this._impl.dictionaries;
  }
  get numDictionaries() {
    return this._impl.numDictionaries;
  }
  get numRecordBatches() {
    return this._impl.numRecordBatches;
  }
  get footer() {
    return this._impl.isFile() ? this._impl.footer : null;
  }
  isSync() {
    return this._impl.isSync();
  }
  isAsync() {
    return this._impl.isAsync();
  }
  isFile() {
    return this._impl.isFile();
  }
  isStream() {
    return this._impl.isStream();
  }
  next() {
    return this._impl.next();
  }
  throw(e) {
    return this._impl.throw(e);
  }
  return(e) {
    return this._impl.return(e);
  }
  cancel() {
    return this._impl.cancel();
  }
  reset(e) {
    return this._impl.reset(e), this._DOMStream = void 0, this._nodeStream = void 0, this;
  }
  open(e) {
    const t = this._impl.open(e);
    return Bd(t) ? t.then(() => this) : this;
  }
  readRecordBatch(e) {
    return this._impl.isFile() ? this._impl.readRecordBatch(e) : null;
  }
  [Symbol.iterator]() {
    return this._impl[Symbol.iterator]();
  }
  [Symbol.asyncIterator]() {
    return this._impl[Symbol.asyncIterator]();
  }
  toDOMStream() {
    return fa.toDOMStream(this.isSync() ? { [Symbol.iterator]: () => this } : { [Symbol.asyncIterator]: () => this });
  }
  toNodeStream() {
    return fa.toNodeStream(this.isSync() ? { [Symbol.iterator]: () => this } : { [Symbol.asyncIterator]: () => this }, { objectMode: !0 });
  }
  /** @nocollapse */
  // @ts-ignore
  static throughNode(e) {
    throw new Error('"throughNode" not available in this environment');
  }
  /** @nocollapse */
  static throughDOM(e, t) {
    throw new Error('"throughDOM" not available in this environment');
  }
  /** @nocollapse */
  static from(e) {
    return e instanceof tQ ? e : d6(e) ? rJt(e) : wzA(e) ? lJt(e) : Bd(e) ? (() => UA(this, void 0, void 0, function* () {
      return yield tQ.from(yield e);
    }))() : fzA(e) || MsA(e) || DzA(e) || DG(e) ? BJt(new tD(e)) : CJt(new GW(e));
  }
  /** @nocollapse */
  static readAll(e) {
    return e instanceof tQ ? e.isSync() ? lbA(e) : cbA(e) : d6(e) || ArrayBuffer.isView(e) || h1(e) || bzA(e) ? lbA(e) : cbA(e);
  }
}
class RW extends tQ {
  constructor(e) {
    super(e), this._impl = e;
  }
  readAll() {
    return [...this];
  }
  [Symbol.iterator]() {
    return this._impl[Symbol.iterator]();
  }
  [Symbol.asyncIterator]() {
    return RB(this, arguments, function* () {
      yield ft(yield* Ev(Um(this[Symbol.iterator]())));
    });
  }
}
class FW extends tQ {
  constructor(e) {
    super(e), this._impl = e;
  }
  readAll() {
    var e, t;
    return UA(this, void 0, void 0, function* () {
      const i = new Array();
      try {
        for (var n = Um(this), o; o = yield n.next(), !o.done; ) {
          const g = o.value;
          i.push(g);
        }
      } catch (g) {
        e = { error: g };
      } finally {
        try {
          o && !o.done && (t = n.return) && (yield t.call(n));
        } finally {
          if (e)
            throw e.error;
        }
      }
      return i;
    });
  }
  [Symbol.iterator]() {
    throw new Error("AsyncRecordBatchStreamReader is not Iterable");
  }
  [Symbol.asyncIterator]() {
    return this._impl[Symbol.asyncIterator]();
  }
}
class o_A extends RW {
  constructor(e) {
    super(e), this._impl = e;
  }
}
class sJt extends FW {
  constructor(e) {
    super(e), this._impl = e;
  }
}
class g_A {
  constructor(e = /* @__PURE__ */ new Map()) {
    this.closed = !1, this.autoDestroy = !0, this._dictionaryIndex = 0, this._recordBatchIndex = 0, this.dictionaries = e;
  }
  get numDictionaries() {
    return this._dictionaryIndex;
  }
  get numRecordBatches() {
    return this._recordBatchIndex;
  }
  isSync() {
    return !1;
  }
  isAsync() {
    return !1;
  }
  isFile() {
    return !1;
  }
  isStream() {
    return !1;
  }
  reset(e) {
    return this._dictionaryIndex = 0, this._recordBatchIndex = 0, this.schema = e, this.dictionaries = /* @__PURE__ */ new Map(), this;
  }
  _loadRecordBatch(e, t) {
    const i = this._loadVectors(e, t, this.schema.fields), n = Kt({ type: new es(this.schema.fields), length: e.length, children: i });
    return new Fs(this.schema, n);
  }
  _loadDictionaryBatch(e, t) {
    const { id: i, isDelta: n } = e, { dictionaries: o, schema: g } = this, s = o.get(i);
    if (n || !s) {
      const I = g.dictionaries.get(i), r = this._loadVectors(e.data, t, [I]);
      return (s && n ? s.concat(new pi(r)) : new pi(r)).memoize();
    }
    return s.memoize();
  }
  _loadVectors(e, t, i) {
    return new zTA(t, e.nodes, e.buffers, this.dictionaries).visitMany(i);
  }
}
class MW extends g_A {
  constructor(e, t) {
    super(t), this._reader = d6(e) ? new oJt(this._handle = e) : new i_A(this._handle = e);
  }
  isSync() {
    return !0;
  }
  isStream() {
    return !0;
  }
  [Symbol.iterator]() {
    return this;
  }
  cancel() {
    !this.closed && (this.closed = !0) && (this.reset()._reader.return(), this._reader = null, this.dictionaries = null);
  }
  open(e) {
    return this.closed || (this.autoDestroy = I_A(this, e), this.schema || (this.schema = this._reader.readSchema()) || this.cancel()), this;
  }
  throw(e) {
    return !this.closed && this.autoDestroy && (this.closed = !0) ? this.reset()._reader.throw(e) : Gn;
  }
  return(e) {
    return !this.closed && this.autoDestroy && (this.closed = !0) ? this.reset()._reader.return(e) : Gn;
  }
  next() {
    if (this.closed)
      return Gn;
    let e;
    const { _reader: t } = this;
    for (; e = this._readNextMessageAndValidate(); )
      if (e.isSchema())
        this.reset(e.header());
      else if (e.isRecordBatch()) {
        this._recordBatchIndex++;
        const i = e.header(), n = t.readMessageBody(e.bodyLength);
        return { done: !1, value: this._loadRecordBatch(i, n) };
      } else if (e.isDictionaryBatch()) {
        this._dictionaryIndex++;
        const i = e.header(), n = t.readMessageBody(e.bodyLength), o = this._loadDictionaryBatch(i, n);
        this.dictionaries.set(i.id, o);
      }
    return this.schema && this._recordBatchIndex === 0 ? (this._recordBatchIndex++, { done: !1, value: new $sA(this.schema) }) : this.return();
  }
  _readNextMessageAndValidate(e) {
    return this._reader.readMessage(e);
  }
}
class xW extends g_A {
  constructor(e, t) {
    super(t), this._reader = new nJt(this._handle = e);
  }
  isAsync() {
    return !0;
  }
  isStream() {
    return !0;
  }
  [Symbol.asyncIterator]() {
    return this;
  }
  cancel() {
    return UA(this, void 0, void 0, function* () {
      !this.closed && (this.closed = !0) && (yield this.reset()._reader.return(), this._reader = null, this.dictionaries = null);
    });
  }
  open(e) {
    return UA(this, void 0, void 0, function* () {
      return this.closed || (this.autoDestroy = I_A(this, e), this.schema || (this.schema = yield this._reader.readSchema()) || (yield this.cancel())), this;
    });
  }
  throw(e) {
    return UA(this, void 0, void 0, function* () {
      return !this.closed && this.autoDestroy && (this.closed = !0) ? yield this.reset()._reader.throw(e) : Gn;
    });
  }
  return(e) {
    return UA(this, void 0, void 0, function* () {
      return !this.closed && this.autoDestroy && (this.closed = !0) ? yield this.reset()._reader.return(e) : Gn;
    });
  }
  next() {
    return UA(this, void 0, void 0, function* () {
      if (this.closed)
        return Gn;
      let e;
      const { _reader: t } = this;
      for (; e = yield this._readNextMessageAndValidate(); )
        if (e.isSchema())
          yield this.reset(e.header());
        else if (e.isRecordBatch()) {
          this._recordBatchIndex++;
          const i = e.header(), n = yield t.readMessageBody(e.bodyLength);
          return { done: !1, value: this._loadRecordBatch(i, n) };
        } else if (e.isDictionaryBatch()) {
          this._dictionaryIndex++;
          const i = e.header(), n = yield t.readMessageBody(e.bodyLength), o = this._loadDictionaryBatch(i, n);
          this.dictionaries.set(i.id, o);
        }
      return this.schema && this._recordBatchIndex === 0 ? (this._recordBatchIndex++, { done: !1, value: new $sA(this.schema) }) : yield this.return();
    });
  }
  _readNextMessageAndValidate(e) {
    return UA(this, void 0, void 0, function* () {
      return yield this._reader.readMessage(e);
    });
  }
}
class s_A extends MW {
  constructor(e, t) {
    super(e instanceof obA ? e : new obA(e), t);
  }
  get footer() {
    return this._footer;
  }
  get numDictionaries() {
    return this._footer ? this._footer.numDictionaries : 0;
  }
  get numRecordBatches() {
    return this._footer ? this._footer.numRecordBatches : 0;
  }
  isSync() {
    return !0;
  }
  isFile() {
    return !0;
  }
  open(e) {
    if (!this.closed && !this._footer) {
      this.schema = (this._footer = this._readFooter()).schema;
      for (const t of this._footer.dictionaryBatches())
        t && this._readDictionaryBatch(this._dictionaryIndex++);
    }
    return super.open(e);
  }
  readRecordBatch(e) {
    var t;
    if (this.closed)
      return null;
    this._footer || this.open();
    const i = (t = this._footer) === null || t === void 0 ? void 0 : t.getRecordBatch(e);
    if (i && this._handle.seek(i.offset)) {
      const n = this._reader.readMessage(mi.RecordBatch);
      if (n != null && n.isRecordBatch()) {
        const o = n.header(), g = this._reader.readMessageBody(n.bodyLength);
        return this._loadRecordBatch(o, g);
      }
    }
    return null;
  }
  _readDictionaryBatch(e) {
    var t;
    const i = (t = this._footer) === null || t === void 0 ? void 0 : t.getDictionaryBatch(e);
    if (i && this._handle.seek(i.offset)) {
      const n = this._reader.readMessage(mi.DictionaryBatch);
      if (n != null && n.isDictionaryBatch()) {
        const o = n.header(), g = this._reader.readMessageBody(n.bodyLength), s = this._loadDictionaryBatch(o, g);
        this.dictionaries.set(o.id, s);
      }
    }
  }
  _readFooter() {
    const { _handle: e } = this, t = e.size - n_A, i = e.readInt32(t), n = e.readAt(t - i, i);
    return W2.decode(n);
  }
  _readNextMessageAndValidate(e) {
    var t;
    if (this._footer || this.open(), this._footer && this._recordBatchIndex < this.numRecordBatches) {
      const i = (t = this._footer) === null || t === void 0 ? void 0 : t.getRecordBatch(this._recordBatchIndex);
      if (i && this._handle.seek(i.offset))
        return this._reader.readMessage(e);
    }
    return null;
  }
}
class IJt extends xW {
  constructor(e, ...t) {
    const i = typeof t[0] != "number" ? t.shift() : void 0, n = t[0] instanceof Map ? t.shift() : void 0;
    super(e instanceof kW ? e : new kW(e, i), n);
  }
  get footer() {
    return this._footer;
  }
  get numDictionaries() {
    return this._footer ? this._footer.numDictionaries : 0;
  }
  get numRecordBatches() {
    return this._footer ? this._footer.numRecordBatches : 0;
  }
  isFile() {
    return !0;
  }
  isAsync() {
    return !0;
  }
  open(e) {
    const t = Object.create(null, {
      open: { get: () => super.open }
    });
    return UA(this, void 0, void 0, function* () {
      if (!this.closed && !this._footer) {
        this.schema = (this._footer = yield this._readFooter()).schema;
        for (const i of this._footer.dictionaryBatches())
          i && (yield this._readDictionaryBatch(this._dictionaryIndex++));
      }
      return yield t.open.call(this, e);
    });
  }
  readRecordBatch(e) {
    var t;
    return UA(this, void 0, void 0, function* () {
      if (this.closed)
        return null;
      this._footer || (yield this.open());
      const i = (t = this._footer) === null || t === void 0 ? void 0 : t.getRecordBatch(e);
      if (i && (yield this._handle.seek(i.offset))) {
        const n = yield this._reader.readMessage(mi.RecordBatch);
        if (n != null && n.isRecordBatch()) {
          const o = n.header(), g = yield this._reader.readMessageBody(n.bodyLength);
          return this._loadRecordBatch(o, g);
        }
      }
      return null;
    });
  }
  _readDictionaryBatch(e) {
    var t;
    return UA(this, void 0, void 0, function* () {
      const i = (t = this._footer) === null || t === void 0 ? void 0 : t.getDictionaryBatch(e);
      if (i && (yield this._handle.seek(i.offset))) {
        const n = yield this._reader.readMessage(mi.DictionaryBatch);
        if (n != null && n.isDictionaryBatch()) {
          const o = n.header(), g = yield this._reader.readMessageBody(n.bodyLength), s = this._loadDictionaryBatch(o, g);
          this.dictionaries.set(o.id, s);
        }
      }
    });
  }
  _readFooter() {
    return UA(this, void 0, void 0, function* () {
      const { _handle: e } = this;
      e._pending && (yield e._pending);
      const t = e.size - n_A, i = yield e.readInt32(t), n = yield e.readAt(t - i, i);
      return W2.decode(n);
    });
  }
  _readNextMessageAndValidate(e) {
    return UA(this, void 0, void 0, function* () {
      if (this._footer || (yield this.open()), this._footer && this._recordBatchIndex < this.numRecordBatches) {
        const t = this._footer.getRecordBatch(this._recordBatchIndex);
        if (t && (yield this._handle.seek(t.offset)))
          return yield this._reader.readMessage(e);
      }
      return null;
    });
  }
}
class aJt extends MW {
  constructor(e, t) {
    super(e, t);
  }
  _loadVectors(e, t, i) {
    return new pkt(t, e.nodes, e.buffers, this.dictionaries).visitMany(i);
  }
}
function I_A(A, e) {
  return e && typeof e.autoDestroy == "boolean" ? e.autoDestroy : A.autoDestroy;
}
function* lbA(A) {
  const e = tQ.from(A);
  try {
    if (!e.open({ autoDestroy: !1 }).closed)
      do
        yield e;
      while (!e.reset().open().closed);
  } finally {
    e.cancel();
  }
}
function cbA(A) {
  return RB(this, arguments, function* () {
    const t = yield ft(tQ.from(A));
    try {
      if (!(yield ft(t.open({ autoDestroy: !1 }))).closed)
        do
          yield yield ft(t);
        while (!(yield ft(t.reset().open())).closed);
    } finally {
      yield ft(t.cancel());
    }
  });
}
function rJt(A) {
  return new RW(new aJt(A));
}
function CJt(A) {
  const e = A.peek(b1 + 7 & -8);
  return e && e.byteLength >= 4 ? tIA(e) ? new o_A(new s_A(A.read())) : new RW(new MW(A)) : new RW(new MW(function* () {
  }()));
}
function BJt(A) {
  return UA(this, void 0, void 0, function* () {
    const e = yield A.peek(b1 + 7 & -8);
    return e && e.byteLength >= 4 ? tIA(e) ? new o_A(new s_A(yield A.read())) : new FW(new xW(A)) : new FW(new xW(function() {
      return RB(this, arguments, function* () {
      });
    }()));
  });
}
function lJt(A) {
  return UA(this, void 0, void 0, function* () {
    const { size: e } = yield A.stat(), t = new kW(A, e);
    return e >= gJt && tIA(yield t.readAt(0, b1 + 7 & -8)) ? new sJt(new IJt(t)) : new FW(new xW(t));
  });
}
class oo extends zt {
  constructor() {
    super(), this._byteLength = 0, this._nodes = [], this._buffers = [], this._bufferRegions = [];
  }
  /** @nocollapse */
  static assemble(...e) {
    const t = (n) => n.flatMap((o) => Array.isArray(o) ? t(o) : o instanceof Fs ? o.data.children : o.data), i = new oo();
    return i.visitMany(t(e)), i;
  }
  visit(e) {
    if (e instanceof pi)
      return this.visitMany(e.data), this;
    const { type: t } = e;
    if (!Ct.isDictionary(t)) {
      const { length: i, nullCount: n } = e;
      if (i > 2147483647)
        throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");
      Ct.isNull(t) || BC.call(this, n <= 0 ? new Uint8Array(0) : UsA(e.offset, i, e.nullBitmap)), this.nodes.push(new k0(i, n));
    }
    return super.visit(e);
  }
  visitNull(e) {
    return this;
  }
  visitDictionary(e) {
    return this.visit(e.clone(e.type.indices));
  }
  get nodes() {
    return this._nodes;
  }
  get buffers() {
    return this._buffers;
  }
  get byteLength() {
    return this._byteLength;
  }
  get bufferRegions() {
    return this._bufferRegions;
  }
}
function BC(A) {
  const e = A.byteLength + 7 & -8;
  return this.buffers.push(A), this.bufferRegions.push(new FB(this._byteLength, e)), this._byteLength += e, this;
}
function cJt(A) {
  const { type: e, length: t, typeIds: i, valueOffsets: n } = A;
  if (BC.call(this, i), e.mode === na.Sparse)
    return N6.call(this, A);
  if (e.mode === na.Dense) {
    if (A.offset <= 0)
      return BC.call(this, n), N6.call(this, A);
    {
      const o = i.reduce((a, C) => Math.max(a, C), i[0]), g = new Int32Array(o + 1), s = new Int32Array(o + 1).fill(-1), I = new Int32Array(t), r = LsA(-n[0], t, n);
      for (let a, C, B = -1; ++B < t; )
        (C = s[a = i[B]]) === -1 && (C = s[a] = r[a]), I[B] = r[B] - C, ++g[a];
      BC.call(this, I);
      for (let a, C = -1, B = e.children.length; ++C < B; )
        if (a = A.children[C]) {
          const l = e.typeIds[C], Q = Math.min(t, g[l]);
          this.visit(a.slice(s[l], Q));
        }
    }
  }
  return this;
}
function QJt(A) {
  let e;
  return A.nullCount >= A.length ? BC.call(this, new Uint8Array(0)) : (e = A.values) instanceof Uint8Array ? BC.call(this, UsA(A.offset, A.length, e)) : BC.call(this, hW(A.values));
}
function ih(A) {
  return BC.call(this, A.values.subarray(0, A.length * A.stride));
}
function a_A(A) {
  const { length: e, values: t, valueOffsets: i } = A, n = i[0], o = i[e], g = Math.min(o - n, t.byteLength - n);
  return BC.call(this, LsA(-i[0], e, i)), BC.call(this, t.subarray(n, n + g)), this;
}
function iIA(A) {
  const { length: e, valueOffsets: t } = A;
  return t && BC.call(this, LsA(t[0], e, t)), this.visit(A.children[0]);
}
function N6(A) {
  return this.visitMany(A.type.children.map((e, t) => A.children[t]).filter(Boolean))[0];
}
oo.prototype.visitBool = QJt;
oo.prototype.visitInt = ih;
oo.prototype.visitFloat = ih;
oo.prototype.visitUtf8 = a_A;
oo.prototype.visitBinary = a_A;
oo.prototype.visitFixedSizeBinary = ih;
oo.prototype.visitDate = ih;
oo.prototype.visitTimestamp = ih;
oo.prototype.visitTime = ih;
oo.prototype.visitDecimal = ih;
oo.prototype.visitList = iIA;
oo.prototype.visitStruct = N6;
oo.prototype.visitUnion = cJt;
oo.prototype.visitInterval = ih;
oo.prototype.visitFixedSizeList = iIA;
oo.prototype.visitMap = iIA;
class r_A extends _sA {
  constructor(e) {
    super(), this._position = 0, this._started = !1, this._sink = new mv(), this._schema = null, this._dictionaryBlocks = [], this._recordBatchBlocks = [], this._dictionaryDeltaOffsets = /* @__PURE__ */ new Map(), eI(e) || (e = { autoDestroy: !0, writeLegacyIpcFormat: !1 }), this._autoDestroy = typeof e.autoDestroy == "boolean" ? e.autoDestroy : !0, this._writeLegacyIpcFormat = typeof e.writeLegacyIpcFormat == "boolean" ? e.writeLegacyIpcFormat : !1;
  }
  /** @nocollapse */
  // @ts-ignore
  static throughNode(e) {
    throw new Error('"throughNode" not available in this environment');
  }
  /** @nocollapse */
  static throughDOM(e, t) {
    throw new Error('"throughDOM" not available in this environment');
  }
  toString(e = !1) {
    return this._sink.toString(e);
  }
  toUint8Array(e = !1) {
    return this._sink.toUint8Array(e);
  }
  writeAll(e) {
    return Bd(e) ? e.then((t) => this.writeAll(t)) : DG(e) ? sIA(this, e) : gIA(this, e);
  }
  get closed() {
    return this._sink.closed;
  }
  [Symbol.asyncIterator]() {
    return this._sink[Symbol.asyncIterator]();
  }
  toDOMStream(e) {
    return this._sink.toDOMStream(e);
  }
  toNodeStream(e) {
    return this._sink.toNodeStream(e);
  }
  close() {
    return this.reset()._sink.close();
  }
  abort(e) {
    return this.reset()._sink.abort(e);
  }
  finish() {
    return this._autoDestroy ? this.close() : this.reset(this._sink, this._schema), this;
  }
  reset(e = this._sink, t = null) {
    return e === this._sink || e instanceof mv ? this._sink = e : (this._sink = new mv(), e && LDt(e) ? this.toDOMStream({ type: "bytes" }).pipeTo(e) : e && vDt(e) && this.toNodeStream({ objectMode: !1 }).pipe(e)), this._started && this._schema && this._writeFooter(this._schema), this._started = !1, this._dictionaryBlocks = [], this._recordBatchBlocks = [], this._dictionaryDeltaOffsets = /* @__PURE__ */ new Map(), (!t || !D6(t, this._schema)) && (t == null ? (this._position = 0, this._schema = null) : (this._started = !0, this._schema = t, this._writeSchema(t))), this;
  }
  write(e) {
    let t = null;
    if (this._sink) {
      if (e == null)
        return this.finish() && void 0;
      if (e instanceof $g && !(t = e.schema))
        return this.finish() && void 0;
      if (e instanceof Fs && !(t = e.schema))
        return this.finish() && void 0;
    } else
      throw new Error("RecordBatchWriter is closed");
    if (t && !D6(t, this._schema)) {
      if (this._started && this._autoDestroy)
        return this.close();
      this.reset(this._sink, t);
    }
    e instanceof Fs ? e instanceof $sA || this._writeRecordBatch(e) : e instanceof $g ? this.writeAll(e.batches) : h1(e) && this.writeAll(e);
  }
  _writeMessage(e, t = 8) {
    const i = t - 1, n = ts.encode(e), o = n.byteLength, g = this._writeLegacyIpcFormat ? 4 : 8, s = o + g + i & ~i, I = s - o - g;
    return e.headerType === mi.RecordBatch ? this._recordBatchBlocks.push(new Ed(s, e.bodyLength, this._position)) : e.headerType === mi.DictionaryBatch && this._dictionaryBlocks.push(new Ed(s, e.bodyLength, this._position)), this._writeLegacyIpcFormat || this._write(Int32Array.of(-1)), this._write(Int32Array.of(s - g)), o > 0 && this._write(n), this._writePadding(I);
  }
  _write(e) {
    if (this._started) {
      const t = li(e);
      t && t.byteLength > 0 && (this._sink.write(t), this._position += t.byteLength);
    }
    return this;
  }
  _writeSchema(e) {
    return this._writeMessage(ts.from(e));
  }
  // @ts-ignore
  _writeFooter(e) {
    return this._writeLegacyIpcFormat ? this._write(Int32Array.of(0)) : this._write(Int32Array.of(-1, 0));
  }
  _writeMagic() {
    return this._write(K2);
  }
  _writePadding(e) {
    return e > 0 ? this._write(new Uint8Array(e)) : this;
  }
  _writeRecordBatch(e) {
    const { byteLength: t, nodes: i, bufferRegions: n, buffers: o } = oo.assemble(e), g = new oa(e.numRows, i, n), s = ts.from(g, t);
    return this._writeDictionaries(e)._writeMessage(s)._writeBodyBuffers(o);
  }
  _writeDictionaryBatch(e, t, i = !1) {
    this._dictionaryDeltaOffsets.set(t, e.length + (this._dictionaryDeltaOffsets.get(t) || 0));
    const { byteLength: n, nodes: o, bufferRegions: g, buffers: s } = oo.assemble(new pi([e])), I = new oa(e.length, o, g), r = new ul(I, t, i), a = ts.from(r, n);
    return this._writeMessage(a)._writeBodyBuffers(s);
  }
  _writeBodyBuffers(e) {
    let t, i, n;
    for (let o = -1, g = e.length; ++o < g; )
      (t = e[o]) && (i = t.byteLength) > 0 && (this._write(t), (n = (i + 7 & -8) - i) > 0 && this._writePadding(n));
    return this;
  }
  _writeDictionaries(e) {
    for (let [t, i] of e.dictionaries) {
      let n = this._dictionaryDeltaOffsets.get(t) || 0;
      if (n === 0 || (i = i == null ? void 0 : i.slice(n)).length > 0)
        for (const o of i.data)
          this._writeDictionaryBatch(o, t, n > 0), n += o.length;
    }
    return this;
  }
}
class nIA extends r_A {
  /** @nocollapse */
  static writeAll(e, t) {
    const i = new nIA(t);
    return Bd(e) ? e.then((n) => i.writeAll(n)) : DG(e) ? sIA(i, e) : gIA(i, e);
  }
}
class oIA extends r_A {
  /** @nocollapse */
  static writeAll(e) {
    const t = new oIA();
    return Bd(e) ? e.then((i) => t.writeAll(i)) : DG(e) ? sIA(t, e) : gIA(t, e);
  }
  constructor() {
    super(), this._autoDestroy = !0;
  }
  // @ts-ignore
  _writeSchema(e) {
    return this._writeMagic()._writePadding(2);
  }
  _writeFooter(e) {
    const t = W2.encode(new W2(e, RI.V4, this._recordBatchBlocks, this._dictionaryBlocks));
    return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic();
  }
}
function gIA(A, e) {
  let t = e;
  e instanceof $g && (t = e.batches, A.reset(void 0, e.schema));
  for (const i of t)
    A.write(i);
  return A.finish();
}
function sIA(A, e) {
  var t, i, n, o;
  return UA(this, void 0, void 0, function* () {
    try {
      for (t = Um(e); i = yield t.next(), !i.done; ) {
        const g = i.value;
        A.write(g);
      }
    } catch (g) {
      n = { error: g };
    } finally {
      try {
        i && !i.done && (o = t.return) && (yield o.call(t));
      } finally {
        if (n)
          throw n.error;
      }
    }
    return A.finish();
  });
}
function _J(A) {
  const e = tQ.from(A);
  return Bd(e) ? e.then((t) => _J(t)) : e.isAsync() ? e.readAll().then((t) => new $g(t)) : new $g(e.readAll());
}
function b_(A, e = "stream") {
  return (e === "stream" ? nIA : oIA).writeAll(A).toUint8Array(!0);
}
var QbA = (
  /** @class */
  function() {
    function A(e, t, i, n) {
      var o = this;
      this.getCell = function(g, s) {
        var I = g < o.headerRows && s < o.headerColumns, r = g >= o.headerRows && s < o.headerColumns, a = g < o.headerRows && s >= o.headerColumns;
        if (I) {
          var C = ["blank"];
          return s > 0 && C.push("level" + g), {
            type: "blank",
            classNames: C.join(" "),
            content: ""
          };
        } else if (a) {
          var B = s - o.headerColumns, C = [
            "col_heading",
            "level" + g,
            "col" + B
          ];
          return {
            type: "columns",
            classNames: C.join(" "),
            content: o.getContent(o.columnsTable, B, g)
          };
        } else if (r) {
          var l = g - o.headerRows, C = [
            "row_heading",
            "level" + s,
            "row" + l
          ];
          return {
            type: "index",
            id: "T_".concat(o.uuid, "level").concat(s, "_row").concat(l),
            classNames: C.join(" "),
            content: o.getContent(o.indexTable, l, s)
          };
        } else {
          var l = g - o.headerRows, B = s - o.headerColumns, C = [
            "data",
            "row" + l,
            "col" + B
          ], Q = o.styler ? o.getContent(o.styler.displayValuesTable, l, B) : o.getContent(o.dataTable, l, B);
          return {
            type: "data",
            id: "T_".concat(o.uuid, "row").concat(l, "_col").concat(B),
            classNames: C.join(" "),
            content: Q
          };
        }
      }, this.getContent = function(g, s, I) {
        var r = g.getChildAt(I);
        if (r === null)
          return "";
        var a = o.getColumnTypeId(g, I);
        switch (a) {
          case bA.Timestamp:
            return o.nanosToDate(r.get(s));
          default:
            return r.get(s);
        }
      }, this.dataTable = _J(e), this.indexTable = _J(t), this.columnsTable = _J(i), this.styler = n ? {
        caption: n.caption,
        displayValuesTable: _J(n.displayValues),
        styles: n.styles,
        uuid: n.uuid
      } : void 0;
    }
    return Object.defineProperty(A.prototype, "rows", {
      get: function() {
        return this.indexTable.numRows + this.columnsTable.numCols;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "columns", {
      get: function() {
        return this.indexTable.numCols + this.columnsTable.numRows;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "headerRows", {
      get: function() {
        return this.rows - this.dataRows;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "headerColumns", {
      get: function() {
        return this.columns - this.dataColumns;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "dataRows", {
      get: function() {
        return this.dataTable.numRows;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "dataColumns", {
      get: function() {
        return this.dataTable.numCols;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "uuid", {
      get: function() {
        return this.styler && this.styler.uuid;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "caption", {
      get: function() {
        return this.styler && this.styler.caption;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "styles", {
      get: function() {
        return this.styler && this.styler.styles;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "table", {
      get: function() {
        return this.dataTable;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "index", {
      get: function() {
        return this.indexTable;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(A.prototype, "columnTable", {
      get: function() {
        return this.columnsTable;
      },
      enumerable: !1,
      configurable: !0
    }), A.prototype.serialize = function() {
      return {
        data: b_(this.dataTable),
        index: b_(this.indexTable),
        columns: b_(this.columnsTable)
      };
    }, A.prototype.getColumnTypeId = function(e, t) {
      return e.schema.fields[t].type.typeId;
    }, A.prototype.nanosToDate = function(e) {
      return new Date(e / 1e6);
    }, A;
  }()
), HN = globalThis && globalThis.__assign || function() {
  return HN = Object.assign || function(A) {
    for (var e, t = 1, i = arguments.length; t < i; t++) {
      e = arguments[t];
      for (var n in e)
        Object.prototype.hasOwnProperty.call(e, n) && (A[n] = e[n]);
    }
    return A;
  }, HN.apply(this, arguments);
}, SN;
(function(A) {
  A.COMPONENT_READY = "streamlit:componentReady", A.SET_COMPONENT_VALUE = "streamlit:setComponentValue", A.SET_FRAME_HEIGHT = "streamlit:setFrameHeight";
})(SN || (SN = {}));
var lB = (
  /** @class */
  function() {
    function A() {
    }
    return A.API_VERSION = 1, A.RENDER_EVENT = "streamlit:render", A.events = new EventTarget(), A.registeredMessageListener = !1, A.setComponentReady = function() {
      A.registeredMessageListener || (window.addEventListener("message", A.onMessageEvent), A.registeredMessageListener = !0), A.sendBackMsg(SN.COMPONENT_READY, {
        apiVersion: A.API_VERSION
      });
    }, A.setFrameHeight = function(e) {
      e === void 0 && (e = document.body.scrollHeight), e !== A.lastFrameHeight && (A.lastFrameHeight = e, A.sendBackMsg(SN.SET_FRAME_HEIGHT, { height: e }));
    }, A.setComponentValue = function(e) {
      var t;
      e instanceof QbA ? (t = "dataframe", e = e.serialize()) : uJt(e) ? (t = "bytes", e = new Uint8Array(e.buffer)) : e instanceof ArrayBuffer ? (t = "bytes", e = new Uint8Array(e)) : t = "json", A.sendBackMsg(SN.SET_COMPONENT_VALUE, {
        value: e,
        dataType: t
      });
    }, A.onMessageEvent = function(e) {
      var t = e.data.type;
      switch (t) {
        case A.RENDER_EVENT:
          A.onRenderMessage(e.data);
          break;
      }
    }, A.onRenderMessage = function(e) {
      var t = e.args;
      t == null && (console.error("Got null args in onRenderMessage. This should never happen"), t = {});
      var i = e.dfs && e.dfs.length > 0 ? A.argsDataframeToObject(e.dfs) : {};
      t = HN(HN({}, t), i);
      var n = Boolean(e.disabled), o = e.theme;
      o && EJt(o);
      var g = { disabled: n, args: t, theme: o }, s = new CustomEvent(A.RENDER_EVENT, {
        detail: g
      });
      A.events.dispatchEvent(s);
    }, A.argsDataframeToObject = function(e) {
      var t = e.map(function(i) {
        var n = i.key, o = i.value;
        return [n, A.toArrowTable(o)];
      });
      return Object.fromEntries(t);
    }, A.toArrowTable = function(e) {
      var t, i = (t = e.data, t.data), n = t.index, o = t.columns, g = t.styler;
      return new QbA(i, n, o, g);
    }, A.sendBackMsg = function(e, t) {
      window.parent.postMessage(HN({ isStreamlitMessage: !0, type: e }, t), "*");
    }, A;
  }()
), EJt = function(A) {
  var e = document.createElement("style");
  document.head.appendChild(e), e.innerHTML = `
    :root {
      --primary-color: `.concat(A.primaryColor, `;
      --background-color: `).concat(A.backgroundColor, `;
      --secondary-background-color: `).concat(A.secondaryBackgroundColor, `;
      --text-color: `).concat(A.textColor, `;
      --font: `).concat(A.font, `;
    }

    body {
      background-color: var(--background-color);
      color: var(--text-color);
    }
  `);
};
function uJt(A) {
  var e = !1;
  try {
    e = A instanceof BigInt64Array || A instanceof BigUint64Array;
  } catch {
  }
  return A instanceof Int8Array || A instanceof Uint8Array || A instanceof Uint8ClampedArray || A instanceof Int16Array || A instanceof Uint16Array || A instanceof Int32Array || A instanceof Uint32Array || A instanceof Float32Array || A instanceof Float64Array || e;
}
var C_A = globalThis && globalThis.__extends || function() {
  var A = function(e, t) {
    return A = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, n) {
      i.__proto__ = n;
    } || function(i, n) {
      for (var o in n)
        Object.prototype.hasOwnProperty.call(n, o) && (i[o] = n[o]);
    }, A(e, t);
  };
  return function(e, t) {
    if (typeof t != "function" && t !== null)
      throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
    A(e, t);
    function i() {
      this.constructor = e;
    }
    e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
  };
}();
(function(A) {
  C_A(e, A);
  function e() {
    return A !== null && A.apply(this, arguments) || this;
  }
  return e.prototype.componentDidMount = function() {
    lB.setFrameHeight();
  }, e.prototype.componentDidUpdate = function() {
    lB.setFrameHeight();
  }, e;
})(b.PureComponent);
function dJt(A) {
  var e = (
    /** @class */
    function(t) {
      C_A(i, t);
      function i(n) {
        var o = t.call(this, n) || this;
        return o.componentDidMount = function() {
          lB.events.addEventListener(lB.RENDER_EVENT, o.onRenderEvent), lB.setComponentReady();
        }, o.componentDidUpdate = function() {
          o.state.componentError != null && lB.setFrameHeight();
        }, o.componentWillUnmount = function() {
          lB.events.removeEventListener(lB.RENDER_EVENT, o.onRenderEvent);
        }, o.onRenderEvent = function(g) {
          o.setState({ renderData: g.detail });
        }, o.state = {
          renderData: void 0,
          componentError: void 0
        }, o;
      }
      return i.prototype.render = function() {
        return this.state.componentError != null ? b.createElement(
          "div",
          null,
          b.createElement("h1", null, "Component Error"),
          b.createElement("span", null, this.state.componentError.message)
        ) : this.state.renderData == null ? null : b.createElement(A, { width: window.innerWidth, disabled: this.state.renderData.disabled, args: this.state.renderData.args, theme: this.state.renderData.theme });
      }, i.getDerivedStateFromError = function(n) {
        return { componentError: n };
      }, i;
    }(b.PureComponent)
  );
  return VkA(e, A);
}
var B_A, EbA = Jt;
B_A = EbA.createRoot, EbA.hydrateRoot;
let l_A = u.createContext(
  /** @type {any} */
  null
);
function hJt() {
  let A = u.useContext(l_A);
  if (!A)
    throw new Error("RenderContext not found");
  return A;
}
function mJt() {
  return hJt().model;
}
function pJt(A) {
  return ({ el: e, model: t, experimental: i }) => {
    let n = B_A(e);
    return n.render(
      u.createElement(
        u.StrictMode,
        null,
        u.createElement(
          l_A.Provider,
          { value: { model: t, experimental: i } },
          u.createElement(A)
        )
      )
    ), () => n.unmount();
  };
}
const yJt = async (A) => navigator.clipboard.writeText(A), bJt = [
  {
    header: "Using pip:",
    cmd: "pip install pygwalker --upgrade"
  },
  {
    header: "Using anaconda:",
    cmd: "conda install -c conda-forge pygwalker"
  }
], wJt = (A) => {
  const [e, t] = u.useState(!1);
  return ue(LB, { children: [pA("header", { children: A.header }), ue("div", { children: [pA("code", { children: A.cmd }), ue("div", { role: "button", "aria-label": "Copy command", tabIndex: 0, "aria-disabled": e, onClick: () => {
    e || (t(!0), yJt(A.cmd).finally(() => {
      setTimeout(() => {
        t(!1);
      }, 2e3);
    }));
  }, children: [pA("small", { children: e ? "Copied" : "Copy" }), pA("span", { children: e ? "✅" : "❏" })] })] })] });
}, fJt = Math.random().toString(16).split(".").at(1) + new Date().getTime().toString(16).padStart(16, "0"), DJt = (A) => {
  var a, C, B;
  const [e, t] = u.useState(!1), [i, n] = u.useState({}), [o, g] = u.useState(!1);
  window.localStorage.getItem("HASH") === null && window.localStorage.setItem("HASH", fJt);
  const s = "https://5agko11g7e.execute-api.us-west-1.amazonaws.com/default/check_updates", I = (window == null ? void 0 : window.__GW_VERSION) || "current", r = window.localStorage.getItem("HASH");
  return u.useEffect(() => {
    var l;
    if (((l = A.userConfig) == null ? void 0 : l.privacy) !== "offline") {
      const Q = `${s}?pkg=pygwalker-app&v=${I}&hashcode=${r}&env=production&kernelHashcode=${A.hashcode}`;
      fetch(Q, {
        headers: {
          "Content-Type": "application/json"
        }
      }).then((E) => E.json()).then((E) => {
        var d;
        n({ data: E.data }), t(((d = E == null ? void 0 : E.data) == null ? void 0 : d.outdated) || !1);
      });
    }
  }, []), u.useEffect(() => {
    g(!1);
  }, [e]), u.useEffect(() => {
    if (!o)
      return;
    const l = () => {
      g(!1);
    };
    return document.addEventListener("click", l), () => {
      document.removeEventListener("click", l);
    };
  }, [o]), u.useEffect(() => {
    g(!1);
  }, [e]), u.useEffect(() => {
    if (!o)
      return;
    const l = () => {
      g(!1);
    };
    return document.addEventListener("click", l), () => {
      document.removeEventListener("click", l);
    };
  }, [o]), ue(LB, { children: [pA("style", { children: `
        .update_link {
            position: fixed;
            right: 2rem;
            top: 1rem;
            background-color: rgba(56,189,248,.1);
            color: rgb(2, 132, 199);
            --line-height: 1.25rem;
            line-height: var(--line-height);
            --padding-block: 0.25rem;
            padding: var(--padding-block) 0.75rem;
            border-radius: calc(var(--padding-block) + var(--line-height) * .5);
            font-weight: 500;
            font-size: .75rem;
            font-family: sans-serif;
            text-align: end;
        }
        .update_link p {
            margin: 0;
            padding: 0;
        }
        .update_link *[role="button"] {
            cursor: pointer;
        }
        .update_link *[role="separator"] {
            user-select: none;
            margin-inline: 0.5em;
            display: inline-block;
        }
        .update_link .solutions {
            margin: 1em 0 1em 2em;
            display: grid;
            grid-template-columns: repeat(2, auto);
            gap: 0.2em 0.8em;
            font-family: monospace;
        }
        .update_link .solutions > * {
            display: flex;
            align-items: center;
        }
        .update_link .solutions div:has(> code) {
            display: flex;
            align-items: center;
            background-color: #777;
            color: #eee;
            padding-inline: 0.8em 6em;
            padding-block: 0.1em;
            border-radius: 2px;
            position: relative;
            height: 2em;
        }
        .update_link *[aria-disabled="true"] {
            opacity: 1 !important;
            cursor: default !important;
        }
        .update_link .solutions div *[role="button"] {
            user-select: none;
            flex-grow: 0;
            flex-shrink: 0;
            cursor: pointer;
            margin-left: 1em;
            background-color: #eee;
            color: #444;
            padding-inline: 0.4em;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            border-radius: 1em;
            opacity: 0.5;
            position: absolute;
            right: 0.5em;
            z-index: 10;
            font-family: 
        }
        .update_link .solutions div:hover *[role="button"] {
            opacity: 1;
        }
        .update_link .solutions div *[role="button"] > small {
            font-size: 0.65rem;
            margin-right: 0.5em;
        }
        .update_link .solutions div > code {
            flex-grow: 1;
            flex-shrink: 1;
            text-align: start;
        }
        .update_link a {
            font-family: monospace;
            color: inherit;
            text-decoration: none;
            cursor: pointer;
        }
        .update_link a span {
            filter: brightness(1.8);
        }
        .update_link p span {
            font-family: monospace;
            color: inherit;
        }
        @media (prefers-color-scheme: dark) {
            .update_link span, .update_link header, .update_link a {
                filter: brightness(1.5);
            }
        }
    ` }), e && ue("div", { className: "update_link", "aria-live": "assertive", role: "alert", tabIndex: 0, onClick: (l) => l.stopPropagation(), children: [ue("p", { children: [ue("a", { href: "https://pypi.org/project/pygwalker", target: "_blank", children: ["Update: ", `${I}↑`, pA("span", { children: ` ${((B = (C = (a = i == null ? void 0 : i.data) == null ? void 0 : a.latest) == null ? void 0 : C.release) == null ? void 0 : B.version) || "latest"}` })] }), pA("span", { role: "separator", children: "|" }), pA("span", { "aria-haspopup": !0, role: "button", tabIndex: 0, onClick: () => g((l) => !l), children: `${o ? "Hide" : " Cmd"} ❏` })] }), o && pA("div", { className: "solutions", children: bJt.map((l, Q) => pA(wJt, { ...l }, Q)) })] })] });
};
class GJt {
  constructor() {
    yr(this, "_notifyTimeoutFunc", setTimeout(() => {
    }, 0));
    yr(this, "initModalOpen", !1);
    yr(this, "initModalInfo", {
      total: 0,
      curIndex: 0,
      title: ""
    });
    yr(this, "showCloudTool", !1);
    yr(this, "version", "");
    yr(this, "notification", null);
    yr(this, "uploadSpecModalOpen", !1);
    yr(this, "uploadChartModalOpen", !1);
    yr(this, "isStreamlitComponent", !1);
    m$(this, {
      initModalOpen: _i,
      initModalInfo: _i,
      showCloudTool: _i,
      version: _i,
      notification: _i,
      uploadSpecModalOpen: _i,
      uploadChartModalOpen: _i,
      isStreamlitComponent: _i,
      setInitModalOpen: hg,
      setInitModalInfo: hg,
      setShowCloudTool: hg,
      setVersion: hg,
      setNotification: hg,
      setUploadSpecModalOpen: hg,
      setUploadChartModalOpen: hg,
      setIsStreamlitComponent: hg
    });
  }
  setInitModalOpen(e) {
    this.initModalOpen = e;
  }
  setInitModalInfo(e) {
    this.initModalInfo = e;
  }
  setShowCloudTool(e) {
    this.showCloudTool = e;
  }
  setVersion(e) {
    this.version = e;
  }
  setNotification(e, t = 5e3) {
    clearTimeout(this._notifyTimeoutFunc), this.notification = e, this._notifyTimeoutFunc = setTimeout(() => {
      this.notification = null;
    }, t);
  }
  setUploadSpecModalOpen(e) {
    this.uploadSpecModalOpen = e;
  }
  setUploadChartModalOpen(e) {
    this.uploadChartModalOpen = e;
  }
  setIsStreamlitComponent(e) {
    this.isStreamlitComponent = e;
  }
}
const Te = new GJt();
class kJt {
  constructor() {
    yr(this, "comm", null);
    m$(this, {
      comm: _i,
      setComm: hg
    });
  }
  setComm(e) {
    this.comm = e;
  }
}
const ga = new kJt();
let ug, ZN = 0, qJ = null;
function bv() {
  return (qJ === null || qJ.byteLength === 0) && (qJ = new Uint8Array(ug.memory.buffer)), qJ;
}
const wv = typeof TextEncoder < "u" ? new TextEncoder("utf-8") : { encode: () => {
  throw Error("TextEncoder not available");
} }, JJt = typeof wv.encodeInto == "function" ? function(A, e) {
  return wv.encodeInto(A, e);
} : function(A, e) {
  const t = wv.encode(A);
  return e.set(t), {
    read: A.length,
    written: t.length
  };
};
function w_(A, e, t) {
  if (t === void 0) {
    const s = wv.encode(A), I = e(s.length, 1) >>> 0;
    return bv().subarray(I, I + s.length).set(s), ZN = s.length, I;
  }
  let i = A.length, n = e(i, 1) >>> 0;
  const o = bv();
  let g = 0;
  for (; g < i; g++) {
    const s = A.charCodeAt(g);
    if (s > 127)
      break;
    o[n + g] = s;
  }
  if (g !== i) {
    g !== 0 && (A = A.slice(g)), n = t(n, i, i = g + A.length * 3, 1) >>> 0;
    const s = bv().subarray(n + g, n + i), I = JJt(A, s);
    g += I.written, n = t(n, i, g, 1) >>> 0;
  }
  return ZN = g, n;
}
let OJ = null;
function ubA() {
  return (OJ === null || OJ.byteLength === 0) && (OJ = new Int32Array(ug.memory.buffer)), OJ;
}
const c_A = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
  throw Error("TextDecoder not available");
} };
typeof TextDecoder < "u" && c_A.decode();
function NJt(A, e) {
  return A = A >>> 0, c_A.decode(bv().subarray(A, A + e));
}
function Q_A(A, e, t) {
  let i, n;
  try {
    const s = ug.__wbindgen_add_to_stack_pointer(-16), I = w_(A, ug.__wbindgen_malloc, ug.__wbindgen_realloc), r = ZN, a = w_(e, ug.__wbindgen_malloc, ug.__wbindgen_realloc), C = ZN, B = w_(t, ug.__wbindgen_malloc, ug.__wbindgen_realloc), l = ZN;
    ug.parser_dsl_with_meta(s, I, r, a, C, B, l);
    var o = ubA()[s / 4 + 0], g = ubA()[s / 4 + 1];
    return i = o, n = g, NJt(o, g);
  } finally {
    ug.__wbindgen_add_to_stack_pointer(16), ug.__wbindgen_free(i, n, 1);
  }
}
async function YJt(A, e) {
  if (typeof Response == "function" && A instanceof Response) {
    if (typeof WebAssembly.instantiateStreaming == "function")
      try {
        return await WebAssembly.instantiateStreaming(A, e);
      } catch (i) {
        if (A.headers.get("Content-Type") != "application/wasm")
          console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", i);
        else
          throw i;
      }
    const t = await A.arrayBuffer();
    return await WebAssembly.instantiate(t, e);
  } else {
    const t = await WebAssembly.instantiate(A, e);
    return t instanceof WebAssembly.Instance ? { instance: t, module: A } : t;
  }
}
function RJt() {
  const A = {};
  return A.wbg = {}, A;
}
function FJt(A, e) {
  return ug = A.exports, LX.__wbindgen_wasm_module = e, OJ = null, qJ = null, ug;
}
async function LX(A) {
  if (ug !== void 0)
    return ug;
  typeof A > "u" && (A = new URL("data:application/wasm;base64, ", self.location));
  const e = RJt();
  (typeof A == "string" || typeof Request == "function" && A instanceof Request || typeof URL == "function" && A instanceof URL) && (A = fetch(A));
  const { instance: t, module: i } = await YJt(await A, e);
  return FJt(t, i);
}
async function MJt(A) {
  const { dataSourceId: e } = A;
  return new Promise((t, i) => {
    const n = new Array(), o = () => {
      i("timeout");
    };
    let g = setTimeout(o, 1e5);
    const s = (I) => {
      try {
        I.data.dataSourceId === e && (clearTimeout(g), g = setTimeout(o, 1e5), I.data.action === "postData" ? (Te.setInitModalOpen(!0), Te.setInitModalInfo({
          total: I.data.total,
          curIndex: I.data.curIndex,
          title: "Loading Data"
        }), n.push(...I.data.data ?? [])) : I.data.action === "finishData" && (window.removeEventListener("message", s), t(n)));
      } catch (r) {
        i({ message: "handler", error: r });
      }
    };
    window.addEventListener("message", s);
  });
}
function xJt(A) {
  window.postMessage({
    action: "postData",
    dataSourceId: A.dataSourceId,
    total: A.total,
    curIndex: A.curIndex,
    data: A.data
  }, "*");
}
function LJt(A) {
  window.postMessage({
    action: "finishData",
    dataSourceId: A.dataSourceId
  }, "*");
}
function E_A(A) {
  const e = [], t = async (n) => {
    var g;
    const o = await ((g = ga.comm) == null ? void 0 : g.sendMsg(A, { queryList: n.map((s) => s.query) }, 6e4));
    if (o)
      for (let s = 0; s < n.length; s++)
        n[s].resolve(o.data.datas[s]);
    else
      for (let s = 0; s < n.length; s++)
        n[s].reject("get result error");
  };
  return {
    getDatas: (n) => new Promise((o, g) => {
      e.push({ query: n, resolve: o, reject: g }), e.length === 1 && setTimeout(() => {
        t(e.splice(0, e.length));
      }, 100);
    })
  };
}
const vJt = E_A("batch_get_datas_by_sql"), HJt = E_A("batch_get_datas_by_payload"), LW = 5e4;
function u_A() {
  Te.setNotification({
    type: "warning",
    title: "Data Limit Reached",
    message: ue(LB, { children: ["The current computation has returned more than 50,000 rows of data. To ensure optimal performance, we are currently rendering only the first 50,000 rows. If you need to render the entire all datas, please use the 'limit' tool (", pA("svg", { className: "inline bg-black", width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: pA("path", { d: "M9.94969 7.49989C9.94969 8.85288 8.85288 9.94969 7.49989 9.94969C6.14691 9.94969 5.0501 8.85288 5.0501 7.49989C5.0501 6.14691 6.14691 5.0501 7.49989 5.0501C8.85288 5.0501 9.94969 6.14691 9.94969 7.49989ZM10.8632 8C10.6213 9.64055 9.20764 10.8997 7.49989 10.8997C5.79214 10.8997 4.37847 9.64055 4.13662 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H4.13659C4.37835 5.35935 5.79206 4.1001 7.49989 4.1001C9.20772 4.1001 10.6214 5.35935 10.8632 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H10.8632Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }), ") to manually set the maximum number of rows to be returned."] })
  }, 6e4);
}
function SJt(A) {
  return async (e) => {
    const t = Q_A("pygwalker_mid_table", JSON.stringify({ ...e, limit: e.limit ?? LW }), JSON.stringify({ pygwalker_mid_table: A })), i = await vJt.getDatas(t) ?? [];
    return !e.limit && i.length === LW && u_A(), i;
  };
}
async function ZJt(A) {
  const e = await HJt.getDatas({ ...A, limit: A.limit ?? LW }) ?? [];
  return !A.limit && e.length === LW && u_A(), e;
}
var eL, WJt = new Uint8Array(16);
function KJt() {
  if (!eL && (eL = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), !eL))
    throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
  return eL(WJt);
}
const UJt = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
function VJt(A) {
  return typeof A == "string" && UJt.test(A);
}
var To = [];
for (var f_ = 0; f_ < 256; ++f_)
  To.push((f_ + 256).toString(16).substr(1));
function XJt(A) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, t = (To[A[e + 0]] + To[A[e + 1]] + To[A[e + 2]] + To[A[e + 3]] + "-" + To[A[e + 4]] + To[A[e + 5]] + "-" + To[A[e + 6]] + To[A[e + 7]] + "-" + To[A[e + 8]] + To[A[e + 9]] + "-" + To[A[e + 10]] + To[A[e + 11]] + To[A[e + 12]] + To[A[e + 13]] + To[A[e + 14]] + To[A[e + 15]]).toLowerCase();
  if (!VJt(t))
    throw TypeError("Stringified UUID is invalid");
  return t;
}
function U2(A, e, t) {
  A = A || {};
  var i = A.random || (A.rng || KJt)();
  if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, e) {
    t = t || 0;
    for (var n = 0; n < 16; ++n)
      e[t + n] = i[n];
    return e;
  }
  return XJt(i);
}
const vW = (A) => `hacker-comm-pyg-done-signal-${A}`, zJt = () => window.parent.location.host === "datalore.jetbrains.com" ? "datalore" : "jupyter", nD = (A, e) => {
  let t = pA(LB, { children: A });
  switch (e) {
    case 20001:
      t = ue(LB, { children: [pA("p", { className: "py-1", children: "kanaries_api_key is not valid." }), pA("p", { className: "py-1", children: "Please set kanaries_api_key first." }), pA("p", { className: "py-1", children: "execute it in terminal:" }), pA("p", { className: "font-semibold px-1 py-1", children: "`pygwalker login`" })] });
      break;
    case 20002:
      t = pA(LB, { children: ue("p", { className: "py-1", children: ["The usage of cloud config has reached the upper limit. If you want to use more cloud config files, please subscribe to different cloud packages according to your usage:", pA("a", { className: "font-semibold px-1", href: "https://kanaries.net/home/pygwalker", target: "_blank", children: "https://kanaries.net/home/pygwalker" })] }) });
      break;
  }
  Te.setNotification({
    type: "error",
    title: "Error",
    message: t || "Unknown error"
  }, 2e4);
}, TJt = (A) => {
  let t = 0;
  const i = zJt(), n = window.parent.document, o = n.getElementsByClassName(`hacker-comm-pyg-html-store-${A}`)[0].childNodes[1], g = Array.from({ length: 5 }, (Q, E) => E).map((Q) => n.getElementsByClassName(`hacker-comm-pyg-kernel-store-${A}-${Q}`)[0].childNodes[1]), s = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), r = (Q) => {
    const E = new Event("input", { bubbles: !0 }), d = g[t];
    d.value = Q, d.dispatchEvent(E), t = (t + 1) % 5;
  }, a = (Q) => {
    const E = JSON.parse(Q), d = E.action;
    if (d === "finish_request") {
      I.set(E.rid, E.data), n.dispatchEvent(new CustomEvent(vW(E.rid)));
      return;
    }
    const m = s.get(d);
    if (m) {
      const y = m(E.data) ?? {};
      B("finish_request", y, E.rid);
    }
  }, C = async (Q, E, d = 3e4) => {
    const m = U2();
    return new Promise((f, w) => {
      setTimeout(() => {
        B(Q, E, m);
      }, 0);
      const G = setTimeout(() => {
        nD("communication timeout", 0), w(new Error("get result timeout"));
      }, d);
      n.addEventListener(vW(m), (R) => {
        clearTimeout(G);
        const F = I.get(m);
        F.code !== 0 && (nD(F.message, F.code), w(new Error(F.message))), f(F);
      });
    });
  }, B = (Q, E, d) => {
    d = d ?? U2(), r(JSON.stringify({ gid: A, rid: d, action: Q, data: E }));
  }, l = (Q, E) => {
    s.set(Q, E);
  };
  if (i === "datalore") {
    const Q = window.parent.Jupyter.notebook.kernel;
    Q.__pre_can_handle_message === void 0 && (Q.__pre_can_handle_message = Q._can_handle_message), Q._can_handle_message = (E) => {
      if (E.msg_type === "comm_msg" && E.content.data.method === "update") {
        const d = E.content.data.state.value;
        try {
          JSON.parse(d).gid === A && a(d);
        } catch {
        }
      }
      return Q.__pre_can_handle_message(E);
    };
  } else
    new MutationObserver((E) => {
      E.forEach((d) => {
        d.type === "attributes" && a(o.value);
      });
    }).observe(o, {
      attributes: !0,
      attributeFilter: ["placeholder"]
    });
  return {
    sendMsg: C,
    registerEndpoint: l,
    sendMsgAsync: B
  };
}, _Jt = async (A, e) => {
  if (A === "")
    return e;
  const t = A.split("/"), i = [];
  for (let o = t.length; o >= 0; o--)
    i.push(t.slice(0, o).join("/"));
  const n = i.slice(0, 2).map((o) => `${o.length === 0 ? "" : "/"}${o}/${e}`);
  return (await Promise.all(n.map(async (o) => {
    try {
      return (await (await fetch(o, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ action: "ping", data: {} })
      })).json()).code === 0 ? o : null;
    } catch {
      return null;
    }
  }))).find((o) => o !== null);
}, qJt = async (A, e) => {
  const t = window.parent.document.location.host.split(".").slice(-2).join(".");
  let i = "";
  if (t === "streamlit.app")
    i = `/~/+/_stcore/_pygwalker/comm/${A}`;
  else {
    const s = window.parent.location.pathname.replace(/\/+$/, "").replace(/^\/+/, "");
    i = await _Jt(s, `${e}/${A}`);
  }
  i = "/" + i.replace(new RegExp("/*"), "");
  const n = async (s, I, r = 3e4) => {
    const a = setTimeout(() => {
      throw nD("communication timeout", 0), new Error("get result timeout");
    }, r);
    try {
      const C = await o(s, I);
      if (C.code !== 0)
        throw nD(C.message, C.code), new Error(C.message);
      return C;
    } finally {
      clearTimeout(a);
    }
  }, o = async (s, I) => {
    const r = U2();
    return await (await fetch(i, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ action: s, data: I, rid: r, gid: A })
    })).json();
  };
  return {
    sendMsg: n,
    registerEndpoint: (s, I) => {
    },
    sendMsgAsync: o
  };
}, OJt = (A) => {
  Te.isStreamlitComponent && lB.setComponentValue(A);
}, jJt = async (A, e) => {
  const t = /* @__PURE__ */ new Map(), i = (s) => {
    const I = JSON.parse(s);
    if (I.action === "finish_request") {
      t.set(I.rid, I.data), document.dispatchEvent(new CustomEvent(vW(I.rid)));
      return;
    }
  };
  e.on("msg:custom", (s) => {
    s.type === "pyg_response" && i(s.data);
  });
  const n = async (s, I, r = 3e4) => {
    const a = U2();
    return new Promise((B, l) => {
      setTimeout(() => {
        o(s, I, a);
      }, 0);
      const Q = setTimeout(() => {
        nD("communication timeout", 0), l(new Error("get result timeout"));
      }, r);
      document.addEventListener(vW(a), (E) => {
        clearTimeout(Q);
        const d = t.get(a);
        d.code !== 0 && (nD(d.message, d.code), l(new Error(d.message))), B(d);
      });
    });
  }, o = (s, I, r) => {
    r = r ?? U2(), e.send({ type: "pyg_request", msg: { gid: A, rid: r, action: s, data: I } });
  };
  return {
    sendMsg: n,
    registerEndpoint: (s, I) => {
    },
    sendMsgAsync: o
  };
};
let d_A = {
  privacy: "events"
};
function dbA() {
  return d_A.privacy !== "offline";
}
function PJt(A) {
  d_A = A;
}
function $Jt(A, e) {
  if (A == null)
    return {};
  var t = {}, i = Object.keys(A), n, o;
  for (o = 0; o < i.length; o++)
    n = i[o], !(e.indexOf(n) >= 0) && (t[n] = A[n]);
  return t;
}
function ANt(A, e) {
  if (A == null)
    return {};
  var t = $Jt(A, e), i, n;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(A);
    for (n = 0; n < o.length; n++)
      i = o[n], !(e.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(A, i) && (t[i] = A[i]);
  }
  return t;
}
function Y6(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}
function eNt(A) {
  if (Array.isArray(A))
    return Y6(A);
}
function tNt(A) {
  if (typeof Symbol < "u" && A[Symbol.iterator] != null || A["@@iterator"] != null)
    return Array.from(A);
}
function iNt(A, e) {
  if (A) {
    if (typeof A == "string")
      return Y6(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    if (t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set")
      return Array.from(A);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return Y6(A, e);
  }
}
function nNt() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function oNt(A) {
  return eNt(A) || tNt(A) || iNt(A) || nNt();
}
function V2(A) {
  return V2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, V2(A);
}
function gNt(A, e) {
  if (V2(A) !== "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (V2(i) !== "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function sNt(A) {
  var e = gNt(A, "string");
  return V2(e) === "symbol" ? e : String(e);
}
function h_A(A, e, t) {
  return e = sNt(e), e in A ? Object.defineProperty(A, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : A[e] = t, A;
}
function R6() {
  return R6 = Object.assign ? Object.assign.bind() : function(A) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var i in t)
        Object.prototype.hasOwnProperty.call(t, i) && (A[i] = t[i]);
    }
    return A;
  }, R6.apply(this, arguments);
}
function hbA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function Tb(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? hbA(Object(t), !0).forEach(function(i) {
      h_A(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : hbA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function INt(A) {
  var e = A.length;
  if (e === 0 || e === 1)
    return A;
  if (e === 2)
    return [A[0], A[1], "".concat(A[0], ".").concat(A[1]), "".concat(A[1], ".").concat(A[0])];
  if (e === 3)
    return [A[0], A[1], A[2], "".concat(A[0], ".").concat(A[1]), "".concat(A[0], ".").concat(A[2]), "".concat(A[1], ".").concat(A[0]), "".concat(A[1], ".").concat(A[2]), "".concat(A[2], ".").concat(A[0]), "".concat(A[2], ".").concat(A[1]), "".concat(A[0], ".").concat(A[1], ".").concat(A[2]), "".concat(A[0], ".").concat(A[2], ".").concat(A[1]), "".concat(A[1], ".").concat(A[0], ".").concat(A[2]), "".concat(A[1], ".").concat(A[2], ".").concat(A[0]), "".concat(A[2], ".").concat(A[0], ".").concat(A[1]), "".concat(A[2], ".").concat(A[1], ".").concat(A[0])];
  if (e >= 4)
    return [A[0], A[1], A[2], A[3], "".concat(A[0], ".").concat(A[1]), "".concat(A[0], ".").concat(A[2]), "".concat(A[0], ".").concat(A[3]), "".concat(A[1], ".").concat(A[0]), "".concat(A[1], ".").concat(A[2]), "".concat(A[1], ".").concat(A[3]), "".concat(A[2], ".").concat(A[0]), "".concat(A[2], ".").concat(A[1]), "".concat(A[2], ".").concat(A[3]), "".concat(A[3], ".").concat(A[0]), "".concat(A[3], ".").concat(A[1]), "".concat(A[3], ".").concat(A[2]), "".concat(A[0], ".").concat(A[1], ".").concat(A[2]), "".concat(A[0], ".").concat(A[1], ".").concat(A[3]), "".concat(A[0], ".").concat(A[2], ".").concat(A[1]), "".concat(A[0], ".").concat(A[2], ".").concat(A[3]), "".concat(A[0], ".").concat(A[3], ".").concat(A[1]), "".concat(A[0], ".").concat(A[3], ".").concat(A[2]), "".concat(A[1], ".").concat(A[0], ".").concat(A[2]), "".concat(A[1], ".").concat(A[0], ".").concat(A[3]), "".concat(A[1], ".").concat(A[2], ".").concat(A[0]), "".concat(A[1], ".").concat(A[2], ".").concat(A[3]), "".concat(A[1], ".").concat(A[3], ".").concat(A[0]), "".concat(A[1], ".").concat(A[3], ".").concat(A[2]), "".concat(A[2], ".").concat(A[0], ".").concat(A[1]), "".concat(A[2], ".").concat(A[0], ".").concat(A[3]), "".concat(A[2], ".").concat(A[1], ".").concat(A[0]), "".concat(A[2], ".").concat(A[1], ".").concat(A[3]), "".concat(A[2], ".").concat(A[3], ".").concat(A[0]), "".concat(A[2], ".").concat(A[3], ".").concat(A[1]), "".concat(A[3], ".").concat(A[0], ".").concat(A[1]), "".concat(A[3], ".").concat(A[0], ".").concat(A[2]), "".concat(A[3], ".").concat(A[1], ".").concat(A[0]), "".concat(A[3], ".").concat(A[1], ".").concat(A[2]), "".concat(A[3], ".").concat(A[2], ".").concat(A[0]), "".concat(A[3], ".").concat(A[2], ".").concat(A[1]), "".concat(A[0], ".").concat(A[1], ".").concat(A[2], ".").concat(A[3]), "".concat(A[0], ".").concat(A[1], ".").concat(A[3], ".").concat(A[2]), "".concat(A[0], ".").concat(A[2], ".").concat(A[1], ".").concat(A[3]), "".concat(A[0], ".").concat(A[2], ".").concat(A[3], ".").concat(A[1]), "".concat(A[0], ".").concat(A[3], ".").concat(A[1], ".").concat(A[2]), "".concat(A[0], ".").concat(A[3], ".").concat(A[2], ".").concat(A[1]), "".concat(A[1], ".").concat(A[0], ".").concat(A[2], ".").concat(A[3]), "".concat(A[1], ".").concat(A[0], ".").concat(A[3], ".").concat(A[2]), "".concat(A[1], ".").concat(A[2], ".").concat(A[0], ".").concat(A[3]), "".concat(A[1], ".").concat(A[2], ".").concat(A[3], ".").concat(A[0]), "".concat(A[1], ".").concat(A[3], ".").concat(A[0], ".").concat(A[2]), "".concat(A[1], ".").concat(A[3], ".").concat(A[2], ".").concat(A[0]), "".concat(A[2], ".").concat(A[0], ".").concat(A[1], ".").concat(A[3]), "".concat(A[2], ".").concat(A[0], ".").concat(A[3], ".").concat(A[1]), "".concat(A[2], ".").concat(A[1], ".").concat(A[0], ".").concat(A[3]), "".concat(A[2], ".").concat(A[1], ".").concat(A[3], ".").concat(A[0]), "".concat(A[2], ".").concat(A[3], ".").concat(A[0], ".").concat(A[1]), "".concat(A[2], ".").concat(A[3], ".").concat(A[1], ".").concat(A[0]), "".concat(A[3], ".").concat(A[0], ".").concat(A[1], ".").concat(A[2]), "".concat(A[3], ".").concat(A[0], ".").concat(A[2], ".").concat(A[1]), "".concat(A[3], ".").concat(A[1], ".").concat(A[0], ".").concat(A[2]), "".concat(A[3], ".").concat(A[1], ".").concat(A[2], ".").concat(A[0]), "".concat(A[3], ".").concat(A[2], ".").concat(A[0], ".").concat(A[1]), "".concat(A[3], ".").concat(A[2], ".").concat(A[1], ".").concat(A[0])];
}
var D_ = {};
function aNt(A) {
  if (A.length === 0 || A.length === 1)
    return A;
  var e = A.join(".");
  return D_[e] || (D_[e] = INt(A)), D_[e];
}
function rNt(A) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = arguments.length > 2 ? arguments[2] : void 0, i = A.filter(function(o) {
    return o !== "token";
  }), n = aNt(i);
  return n.reduce(function(o, g) {
    return Tb(Tb({}, o), t[g]);
  }, e);
}
function mbA(A) {
  return A.join(" ");
}
function CNt(A, e) {
  var t = 0;
  return function(i) {
    return t += 1, i.map(function(n, o) {
      return m_A({
        node: n,
        stylesheet: A,
        useInlineStyles: e,
        key: "code-segment-".concat(t, "-").concat(o)
      });
    });
  };
}
function m_A(A) {
  var e = A.node, t = A.stylesheet, i = A.style, n = i === void 0 ? {} : i, o = A.useInlineStyles, g = A.key, s = e.properties, I = e.type, r = e.tagName, a = e.value;
  if (I === "text")
    return a;
  if (r) {
    var C = CNt(t, o), B;
    if (!o)
      B = Tb(Tb({}, s), {}, {
        className: mbA(s.className)
      });
    else {
      var l = Object.keys(t).reduce(function(m, y) {
        return y.split(".").forEach(function(f) {
          m.includes(f) || m.push(f);
        }), m;
      }, []), Q = s.className && s.className.includes("token") ? ["token"] : [], E = s.className && Q.concat(s.className.filter(function(m) {
        return !l.includes(m);
      }));
      B = Tb(Tb({}, s), {}, {
        className: mbA(E) || void 0,
        style: rNt(s.className, Object.assign({}, s.style, n), t)
      });
    }
    var d = C(e.children);
    return /* @__PURE__ */ b.createElement(r, R6({
      key: g
    }, B), d);
  }
}
const BNt = function(A, e) {
  var t = A.listLanguages();
  return t.indexOf(e) !== -1;
};
var lNt = ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"];
function pbA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function cB(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? pbA(Object(t), !0).forEach(function(i) {
      h_A(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : pbA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
var cNt = /\n/g;
function QNt(A) {
  return A.match(cNt);
}
function ENt(A) {
  var e = A.lines, t = A.startingLineNumber, i = A.style;
  return e.map(function(n, o) {
    var g = o + t;
    return /* @__PURE__ */ b.createElement("span", {
      key: "line-".concat(o),
      className: "react-syntax-highlighter-line-number",
      style: typeof i == "function" ? i(g) : i
    }, "".concat(g, `
`));
  });
}
function uNt(A) {
  var e = A.codeString, t = A.codeStyle, i = A.containerStyle, n = i === void 0 ? {
    float: "left",
    paddingRight: "10px"
  } : i, o = A.numberStyle, g = o === void 0 ? {} : o, s = A.startingLineNumber;
  return /* @__PURE__ */ b.createElement("code", {
    style: Object.assign({}, t, n)
  }, ENt({
    lines: e.replace(/\n$/, "").split(`
`),
    style: g,
    startingLineNumber: s
  }));
}
function dNt(A) {
  return "".concat(A.toString().length, ".25em");
}
function p_A(A, e) {
  return {
    type: "element",
    tagName: "span",
    properties: {
      key: "line-number--".concat(A),
      className: ["comment", "linenumber", "react-syntax-highlighter-line-number"],
      style: e
    },
    children: [{
      type: "text",
      value: A
    }]
  };
}
function y_A(A, e, t) {
  var i = {
    display: "inline-block",
    minWidth: dNt(t),
    paddingRight: "1em",
    textAlign: "right",
    userSelect: "none"
  }, n = typeof A == "function" ? A(e) : A, o = cB(cB({}, i), n);
  return o;
}
function fv(A) {
  var e = A.children, t = A.lineNumber, i = A.lineNumberStyle, n = A.largestLineNumber, o = A.showInlineLineNumbers, g = A.lineProps, s = g === void 0 ? {} : g, I = A.className, r = I === void 0 ? [] : I, a = A.showLineNumbers, C = A.wrapLongLines, B = typeof s == "function" ? s(t) : s;
  if (B.className = r, t && o) {
    var l = y_A(i, t, n);
    e.unshift(p_A(t, l));
  }
  return C & a && (B.style = cB(cB({}, B.style), {}, {
    display: "flex"
  })), {
    type: "element",
    tagName: "span",
    properties: B,
    children: e
  };
}
function b_A(A) {
  for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], i = 0; i < A.length; i++) {
    var n = A[i];
    if (n.type === "text")
      t.push(fv({
        children: [n],
        className: oNt(new Set(e))
      }));
    else if (n.children) {
      var o = e.concat(n.properties.className);
      b_A(n.children, o).forEach(function(g) {
        return t.push(g);
      });
    }
  }
  return t;
}
function hNt(A, e, t, i, n, o, g, s, I) {
  var r, a = b_A(A.value), C = [], B = -1, l = 0;
  function Q(G, R) {
    var F = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
    return fv({
      children: G,
      lineNumber: R,
      lineNumberStyle: s,
      largestLineNumber: g,
      showInlineLineNumbers: n,
      lineProps: t,
      className: F,
      showLineNumbers: i,
      wrapLongLines: I
    });
  }
  function E(G, R) {
    if (i && R && n) {
      var F = y_A(s, R, g);
      G.unshift(p_A(R, F));
    }
    return G;
  }
  function d(G, R) {
    var F = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
    return e || F.length > 0 ? Q(G, R, F) : E(G, R);
  }
  for (var m = function() {
    var R = a[l], F = R.children[0].value, Z = QNt(F);
    if (Z) {
      var c = F.split(`
`);
      c.forEach(function(J, p) {
        var N = i && C.length + o, v = {
          type: "text",
          value: "".concat(J, `
`)
        };
        if (p === 0) {
          var K = a.slice(B + 1, l).concat(fv({
            children: [v],
            className: R.properties.className
          })), U = d(K, N);
          C.push(U);
        } else if (p === c.length - 1) {
          var j = a[l + 1] && a[l + 1].children && a[l + 1].children[0], q = {
            type: "text",
            value: "".concat(J)
          };
          if (j) {
            var O = fv({
              children: [q],
              className: R.properties.className
            });
            a.splice(l + 1, 0, O);
          } else {
            var $ = [q], _ = d($, N, R.properties.className);
            C.push(_);
          }
        } else {
          var tA = [v], nA = d(tA, N, R.properties.className);
          C.push(nA);
        }
      }), B = l;
    }
    l++;
  }; l < a.length; )
    m();
  if (B !== a.length - 1) {
    var y = a.slice(B + 1, a.length);
    if (y && y.length) {
      var f = i && C.length + o, w = d(y, f);
      C.push(w);
    }
  }
  return e ? C : (r = []).concat.apply(r, C);
}
function mNt(A) {
  var e = A.rows, t = A.stylesheet, i = A.useInlineStyles;
  return e.map(function(n, o) {
    return m_A({
      node: n,
      stylesheet: t,
      useInlineStyles: i,
      key: "code-segement".concat(o)
    });
  });
}
function w_A(A) {
  return A && typeof A.highlightAuto < "u";
}
function pNt(A) {
  var e = A.astGenerator, t = A.language, i = A.code, n = A.defaultCodeValue;
  if (w_A(e)) {
    var o = BNt(e, t);
    return t === "text" ? {
      value: n,
      language: "text"
    } : o ? e.highlight(t, i) : e.highlightAuto(i);
  }
  try {
    return t && t !== "text" ? {
      value: e.highlight(i, t)
    } : {
      value: n
    };
  } catch {
    return {
      value: n
    };
  }
}
function yNt(A, e) {
  return function(i) {
    var n = i.language, o = i.children, g = i.style, s = g === void 0 ? e : g, I = i.customStyle, r = I === void 0 ? {} : I, a = i.codeTagProps, C = a === void 0 ? {
      className: n ? "language-".concat(n) : void 0,
      style: cB(cB({}, s['code[class*="language-"]']), s['code[class*="language-'.concat(n, '"]')])
    } : a, B = i.useInlineStyles, l = B === void 0 ? !0 : B, Q = i.showLineNumbers, E = Q === void 0 ? !1 : Q, d = i.showInlineLineNumbers, m = d === void 0 ? !0 : d, y = i.startingLineNumber, f = y === void 0 ? 1 : y, w = i.lineNumberContainerStyle, G = i.lineNumberStyle, R = G === void 0 ? {} : G, F = i.wrapLines, Z = i.wrapLongLines, c = Z === void 0 ? !1 : Z, J = i.lineProps, p = J === void 0 ? {} : J, N = i.renderer, v = i.PreTag, K = v === void 0 ? "pre" : v, U = i.CodeTag, j = U === void 0 ? "code" : U, q = i.code, O = q === void 0 ? (Array.isArray(o) ? o[0] : o) || "" : q, $ = i.astGenerator, _ = ANt(i, lNt);
    $ = $ || A;
    var tA = E ? /* @__PURE__ */ b.createElement(uNt, {
      containerStyle: w,
      codeStyle: C.style || {},
      numberStyle: R,
      startingLineNumber: f,
      codeString: O
    }) : null, nA = s.hljs || s['pre[class*="language-"]'] || {
      backgroundColor: "#fff"
    }, AA = w_A($) ? "hljs" : "prismjs", gA = l ? Object.assign({}, _, {
      style: Object.assign({}, nA, r)
    }) : Object.assign({}, _, {
      className: _.className ? "".concat(AA, " ").concat(_.className) : AA,
      style: Object.assign({}, r)
    });
    if (c ? C.style = cB(cB({}, C.style), {}, {
      whiteSpace: "pre-wrap"
    }) : C.style = cB(cB({}, C.style), {}, {
      whiteSpace: "pre"
    }), !$)
      return /* @__PURE__ */ b.createElement(K, gA, tA, /* @__PURE__ */ b.createElement(j, C, O));
    (F === void 0 && N || c) && (F = !0), N = N || mNt;
    var rA = [{
      type: "text",
      value: O
    }], sA = pNt({
      astGenerator: $,
      language: n,
      code: O,
      defaultCodeValue: rA
    });
    sA.language === null && (sA.value = rA);
    var lA = sA.value.length + f, cA = hNt(sA, F, p, E, m, f, lA, R, c);
    return /* @__PURE__ */ b.createElement(K, gA, /* @__PURE__ */ b.createElement(j, C, !m && tA, N({
      rows: cA,
      stylesheet: s,
      useInlineStyles: l
    })));
  };
}
var J0 = {};
function IIA(A) {
  return A instanceof Map ? A.clear = A.delete = A.set = function() {
    throw new Error("map is read-only");
  } : A instanceof Set && (A.add = A.clear = A.delete = function() {
    throw new Error("set is read-only");
  }), Object.freeze(A), Object.getOwnPropertyNames(A).forEach(function(e) {
    var t = A[e];
    typeof t == "object" && !Object.isFrozen(t) && IIA(t);
  }), A;
}
var f_A = IIA, bNt = IIA;
f_A.default = bNt;
let ybA = class {
  /**
   * @param {CompiledMode} mode
   */
  constructor(e) {
    e.data === void 0 && (e.data = {}), this.data = e.data, this.isMatchIgnored = !1;
  }
  ignoreMatch() {
    this.isMatchIgnored = !0;
  }
};
function kw(A) {
  return A.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
}
function gu(A, ...e) {
  const t = /* @__PURE__ */ Object.create(null);
  for (const i in A)
    t[i] = A[i];
  return e.forEach(function(i) {
    for (const n in i)
      t[n] = i[n];
  }), /** @type {T} */
  t;
}
const wNt = "</span>", bbA = (A) => !!A.kind;
class fNt {
  /**
   * Creates a new HTMLRenderer
   *
   * @param {Tree} parseTree - the parse tree (must support `walk` API)
   * @param {{classPrefix: string}} options
   */
  constructor(e, t) {
    this.buffer = "", this.classPrefix = t.classPrefix, e.walk(this);
  }
  /**
   * Adds texts to the output stream
   *
   * @param {string} text */
  addText(e) {
    this.buffer += kw(e);
  }
  /**
   * Adds a node open to the output stream (if needed)
   *
   * @param {Node} node */
  openNode(e) {
    if (!bbA(e))
      return;
    let t = e.kind;
    e.sublanguage || (t = `${this.classPrefix}${t}`), this.span(t);
  }
  /**
   * Adds a node close to the output stream (if needed)
   *
   * @param {Node} node */
  closeNode(e) {
    bbA(e) && (this.buffer += wNt);
  }
  /**
   * returns the accumulated buffer
  */
  value() {
    return this.buffer;
  }
  // helpers
  /**
   * Builds a span element
   *
   * @param {string} className */
  span(e) {
    this.buffer += `<span class="${e}">`;
  }
}
class aIA {
  constructor() {
    this.rootNode = { children: [] }, this.stack = [this.rootNode];
  }
  get top() {
    return this.stack[this.stack.length - 1];
  }
  get root() {
    return this.rootNode;
  }
  /** @param {Node} node */
  add(e) {
    this.top.children.push(e);
  }
  /** @param {string} kind */
  openNode(e) {
    const t = { kind: e, children: [] };
    this.add(t), this.stack.push(t);
  }
  closeNode() {
    if (this.stack.length > 1)
      return this.stack.pop();
  }
  closeAllNodes() {
    for (; this.closeNode(); )
      ;
  }
  toJSON() {
    return JSON.stringify(this.rootNode, null, 4);
  }
  /**
   * @typedef { import("./html_renderer").Renderer } Renderer
   * @param {Renderer} builder
   */
  walk(e) {
    return this.constructor._walk(e, this.rootNode);
  }
  /**
   * @param {Renderer} builder
   * @param {Node} node
   */
  static _walk(e, t) {
    return typeof t == "string" ? e.addText(t) : t.children && (e.openNode(t), t.children.forEach((i) => this._walk(e, i)), e.closeNode(t)), e;
  }
  /**
   * @param {Node} node
   */
  static _collapse(e) {
    typeof e != "string" && e.children && (e.children.every((t) => typeof t == "string") ? e.children = [e.children.join("")] : e.children.forEach((t) => {
      aIA._collapse(t);
    }));
  }
}
class DNt extends aIA {
  /**
   * @param {*} options
   */
  constructor(e) {
    super(), this.options = e;
  }
  /**
   * @param {string} text
   * @param {string} kind
   */
  addKeyword(e, t) {
    e !== "" && (this.openNode(t), this.addText(e), this.closeNode());
  }
  /**
   * @param {string} text
   */
  addText(e) {
    e !== "" && this.add(e);
  }
  /**
   * @param {Emitter & {root: DataNode}} emitter
   * @param {string} name
   */
  addSublanguage(e, t) {
    const i = e.root;
    i.kind = t, i.sublanguage = !0, this.add(i);
  }
  toHTML() {
    return new fNt(this, this.options).value();
  }
  finalize() {
    return !0;
  }
}
function GNt(A) {
  return new RegExp(A.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), "m");
}
function X2(A) {
  return A ? typeof A == "string" ? A : A.source : null;
}
function kNt(...A) {
  return A.map((t) => X2(t)).join("");
}
function JNt(...A) {
  return "(" + A.map((t) => X2(t)).join("|") + ")";
}
function NNt(A) {
  return new RegExp(A.toString() + "|").exec("").length - 1;
}
function YNt(A, e) {
  const t = A && A.exec(e);
  return t && t.index === 0;
}
const RNt = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
function FNt(A, e = "|") {
  let t = 0;
  return A.map((i) => {
    t += 1;
    const n = t;
    let o = X2(i), g = "";
    for (; o.length > 0; ) {
      const s = RNt.exec(o);
      if (!s) {
        g += o;
        break;
      }
      g += o.substring(0, s.index), o = o.substring(s.index + s[0].length), s[0][0] === "\\" && s[1] ? g += "\\" + String(Number(s[1]) + n) : (g += s[0], s[0] === "(" && t++);
    }
    return g;
  }).map((i) => `(${i})`).join(e);
}
const MNt = /\b\B/, D_A = "[a-zA-Z]\\w*", rIA = "[a-zA-Z_]\\w*", CIA = "\\b\\d+(\\.\\d+)?", G_A = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", k_A = "\\b(0b[01]+)", xNt = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", LNt = (A = {}) => {
  const e = /^#![ ]*\//;
  return A.binary && (A.begin = kNt(
    e,
    /.*\b/,
    A.binary,
    /\b.*/
  )), gu({
    className: "meta",
    begin: e,
    end: /$/,
    relevance: 0,
    /** @type {ModeCallback} */
    "on:begin": (t, i) => {
      t.index !== 0 && i.ignoreMatch();
    }
  }, A);
}, z2 = {
  begin: "\\\\[\\s\\S]",
  relevance: 0
}, vNt = {
  className: "string",
  begin: "'",
  end: "'",
  illegal: "\\n",
  contains: [z2]
}, HNt = {
  className: "string",
  begin: '"',
  end: '"',
  illegal: "\\n",
  contains: [z2]
}, J_A = {
  begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
}, vX = function(A, e, t = {}) {
  const i = gu(
    {
      className: "comment",
      begin: A,
      end: e,
      contains: []
    },
    t
  );
  return i.contains.push(J_A), i.contains.push({
    className: "doctag",
    begin: "(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",
    relevance: 0
  }), i;
}, SNt = vX("//", "$"), ZNt = vX("/\\*", "\\*/"), WNt = vX("#", "$"), KNt = {
  className: "number",
  begin: CIA,
  relevance: 0
}, UNt = {
  className: "number",
  begin: G_A,
  relevance: 0
}, VNt = {
  className: "number",
  begin: k_A,
  relevance: 0
}, XNt = {
  className: "number",
  begin: CIA + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
  relevance: 0
}, zNt = {
  // this outer rule makes sure we actually have a WHOLE regex and not simply
  // an expression such as:
  //
  //     3 / something
  //
  // (which will then blow up when regex's `illegal` sees the newline)
  begin: /(?=\/[^/\n]*\/)/,
  contains: [{
    className: "regexp",
    begin: /\//,
    end: /\/[gimuy]*/,
    illegal: /\n/,
    contains: [
      z2,
      {
        begin: /\[/,
        end: /\]/,
        relevance: 0,
        contains: [z2]
      }
    ]
  }]
}, TNt = {
  className: "title",
  begin: D_A,
  relevance: 0
}, _Nt = {
  className: "title",
  begin: rIA,
  relevance: 0
}, qNt = {
  // excludes method names from keyword processing
  begin: "\\.\\s*" + rIA,
  relevance: 0
}, ONt = function(A) {
  return Object.assign(
    A,
    {
      /** @type {ModeCallback} */
      "on:begin": (e, t) => {
        t.data._beginMatch = e[1];
      },
      /** @type {ModeCallback} */
      "on:end": (e, t) => {
        t.data._beginMatch !== e[1] && t.ignoreMatch();
      }
    }
  );
};
var tL = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  MATCH_NOTHING_RE: MNt,
  IDENT_RE: D_A,
  UNDERSCORE_IDENT_RE: rIA,
  NUMBER_RE: CIA,
  C_NUMBER_RE: G_A,
  BINARY_NUMBER_RE: k_A,
  RE_STARTERS_RE: xNt,
  SHEBANG: LNt,
  BACKSLASH_ESCAPE: z2,
  APOS_STRING_MODE: vNt,
  QUOTE_STRING_MODE: HNt,
  PHRASAL_WORDS_MODE: J_A,
  COMMENT: vX,
  C_LINE_COMMENT_MODE: SNt,
  C_BLOCK_COMMENT_MODE: ZNt,
  HASH_COMMENT_MODE: WNt,
  NUMBER_MODE: KNt,
  C_NUMBER_MODE: UNt,
  BINARY_NUMBER_MODE: VNt,
  CSS_NUMBER_MODE: XNt,
  REGEXP_MODE: zNt,
  TITLE_MODE: TNt,
  UNDERSCORE_TITLE_MODE: _Nt,
  METHOD_GUARD: qNt,
  END_SAME_AS_BEGIN: ONt
});
function jNt(A, e) {
  A.input[A.index - 1] === "." && e.ignoreMatch();
}
function PNt(A, e) {
  e && A.beginKeywords && (A.begin = "\\b(" + A.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", A.__beforeBegin = jNt, A.keywords = A.keywords || A.beginKeywords, delete A.beginKeywords, A.relevance === void 0 && (A.relevance = 0));
}
function $Nt(A, e) {
  Array.isArray(A.illegal) && (A.illegal = JNt(...A.illegal));
}
function AYt(A, e) {
  if (A.match) {
    if (A.begin || A.end)
      throw new Error("begin & end are not supported with match");
    A.begin = A.match, delete A.match;
  }
}
function eYt(A, e) {
  A.relevance === void 0 && (A.relevance = 1);
}
const tYt = [
  "of",
  "and",
  "for",
  "in",
  "not",
  "or",
  "if",
  "then",
  "parent",
  // common variable name
  "list",
  // common variable name
  "value"
  // common variable name
], iYt = "keyword";
function N_A(A, e, t = iYt) {
  const i = {};
  return typeof A == "string" ? n(t, A.split(" ")) : Array.isArray(A) ? n(t, A) : Object.keys(A).forEach(function(o) {
    Object.assign(
      i,
      N_A(A[o], e, o)
    );
  }), i;
  function n(o, g) {
    e && (g = g.map((s) => s.toLowerCase())), g.forEach(function(s) {
      const I = s.split("|");
      i[I[0]] = [o, nYt(I[0], I[1])];
    });
  }
}
function nYt(A, e) {
  return e ? Number(e) : oYt(A) ? 0 : 1;
}
function oYt(A) {
  return tYt.includes(A.toLowerCase());
}
function gYt(A, { plugins: e }) {
  function t(s, I) {
    return new RegExp(
      X2(s),
      "m" + (A.case_insensitive ? "i" : "") + (I ? "g" : "")
    );
  }
  class i {
    constructor() {
      this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
    }
    // @ts-ignore
    addRule(I, r) {
      r.position = this.position++, this.matchIndexes[this.matchAt] = r, this.regexes.push([r, I]), this.matchAt += NNt(I) + 1;
    }
    compile() {
      this.regexes.length === 0 && (this.exec = () => null);
      const I = this.regexes.map((r) => r[1]);
      this.matcherRe = t(FNt(I), !0), this.lastIndex = 0;
    }
    /** @param {string} s */
    exec(I) {
      this.matcherRe.lastIndex = this.lastIndex;
      const r = this.matcherRe.exec(I);
      if (!r)
        return null;
      const a = r.findIndex((B, l) => l > 0 && B !== void 0), C = this.matchIndexes[a];
      return r.splice(0, a), Object.assign(r, C);
    }
  }
  class n {
    constructor() {
      this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
    }
    // @ts-ignore
    getMatcher(I) {
      if (this.multiRegexes[I])
        return this.multiRegexes[I];
      const r = new i();
      return this.rules.slice(I).forEach(([a, C]) => r.addRule(a, C)), r.compile(), this.multiRegexes[I] = r, r;
    }
    resumingScanAtSamePosition() {
      return this.regexIndex !== 0;
    }
    considerAll() {
      this.regexIndex = 0;
    }
    // @ts-ignore
    addRule(I, r) {
      this.rules.push([I, r]), r.type === "begin" && this.count++;
    }
    /** @param {string} s */
    exec(I) {
      const r = this.getMatcher(this.regexIndex);
      r.lastIndex = this.lastIndex;
      let a = r.exec(I);
      if (this.resumingScanAtSamePosition() && !(a && a.index === this.lastIndex)) {
        const C = this.getMatcher(0);
        C.lastIndex = this.lastIndex + 1, a = C.exec(I);
      }
      return a && (this.regexIndex += a.position + 1, this.regexIndex === this.count && this.considerAll()), a;
    }
  }
  function o(s) {
    const I = new n();
    return s.contains.forEach((r) => I.addRule(r.begin, { rule: r, type: "begin" })), s.terminatorEnd && I.addRule(s.terminatorEnd, { type: "end" }), s.illegal && I.addRule(s.illegal, { type: "illegal" }), I;
  }
  function g(s, I) {
    const r = (
      /** @type CompiledMode */
      s
    );
    if (s.isCompiled)
      return r;
    [
      // do this early so compiler extensions generally don't have to worry about
      // the distinction between match/begin
      AYt
    ].forEach((C) => C(s, I)), A.compilerExtensions.forEach((C) => C(s, I)), s.__beforeBegin = null, [
      PNt,
      // do this later so compiler extensions that come earlier have access to the
      // raw array if they wanted to perhaps manipulate it, etc.
      $Nt,
      // default to 1 relevance if not specified
      eYt
    ].forEach((C) => C(s, I)), s.isCompiled = !0;
    let a = null;
    if (typeof s.keywords == "object" && (a = s.keywords.$pattern, delete s.keywords.$pattern), s.keywords && (s.keywords = N_A(s.keywords, A.case_insensitive)), s.lexemes && a)
      throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");
    return a = a || s.lexemes || /\w+/, r.keywordPatternRe = t(a, !0), I && (s.begin || (s.begin = /\B|\b/), r.beginRe = t(s.begin), s.endSameAsBegin && (s.end = s.begin), !s.end && !s.endsWithParent && (s.end = /\B|\b/), s.end && (r.endRe = t(s.end)), r.terminatorEnd = X2(s.end) || "", s.endsWithParent && I.terminatorEnd && (r.terminatorEnd += (s.end ? "|" : "") + I.terminatorEnd)), s.illegal && (r.illegalRe = t(
      /** @type {RegExp | string} */
      s.illegal
    )), s.contains || (s.contains = []), s.contains = [].concat(...s.contains.map(function(C) {
      return sYt(C === "self" ? s : C);
    })), s.contains.forEach(function(C) {
      g(
        /** @type Mode */
        C,
        r
      );
    }), s.starts && g(s.starts, I), r.matcher = o(r), r;
  }
  if (A.compilerExtensions || (A.compilerExtensions = []), A.contains && A.contains.includes("self"))
    throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");
  return A.classNameAliases = gu(A.classNameAliases || {}), g(
    /** @type Mode */
    A
  );
}
function Y_A(A) {
  return A ? A.endsWithParent || Y_A(A.starts) : !1;
}
function sYt(A) {
  return A.variants && !A.cachedVariants && (A.cachedVariants = A.variants.map(function(e) {
    return gu(A, { variants: null }, e);
  })), A.cachedVariants ? A.cachedVariants : Y_A(A) ? gu(A, { starts: A.starts ? gu(A.starts) : null }) : Object.isFrozen(A) ? gu(A) : A;
}
var IYt = "10.7.3";
function aYt(A) {
  return Boolean(A || A === "");
}
function rYt(A) {
  const e = {
    props: ["language", "code", "autodetect"],
    data: function() {
      return {
        detectedLanguage: "",
        unknownLanguage: !1
      };
    },
    computed: {
      className() {
        return this.unknownLanguage ? "" : "hljs " + this.detectedLanguage;
      },
      highlighted() {
        if (!this.autoDetect && !A.getLanguage(this.language))
          return console.warn(`The language "${this.language}" you specified could not be found.`), this.unknownLanguage = !0, kw(this.code);
        let i = {};
        return this.autoDetect ? (i = A.highlightAuto(this.code), this.detectedLanguage = i.language) : (i = A.highlight(this.language, this.code, this.ignoreIllegals), this.detectedLanguage = this.language), i.value;
      },
      autoDetect() {
        return !this.language || aYt(this.autodetect);
      },
      ignoreIllegals() {
        return !0;
      }
    },
    // this avoids needing to use a whole Vue compilation pipeline just
    // to build Highlight.js
    render(i) {
      return i("pre", {}, [
        i("code", {
          class: this.className,
          domProps: { innerHTML: this.highlighted }
        })
      ]);
    }
    // template: `<pre><code :class="className" v-html="highlighted"></code></pre>`
  };
  return { Component: e, VuePlugin: {
    install(i) {
      i.component("highlightjs", e);
    }
  } };
}
const CYt = {
  "after:highlightElement": ({ el: A, result: e, text: t }) => {
    const i = wbA(A);
    if (!i.length)
      return;
    const n = document.createElement("div");
    n.innerHTML = e.value, e.value = BYt(i, wbA(n), t);
  }
};
function F6(A) {
  return A.nodeName.toLowerCase();
}
function wbA(A) {
  const e = [];
  return function t(i, n) {
    for (let o = i.firstChild; o; o = o.nextSibling)
      o.nodeType === 3 ? n += o.nodeValue.length : o.nodeType === 1 && (e.push({
        event: "start",
        offset: n,
        node: o
      }), n = t(o, n), F6(o).match(/br|hr|img|input/) || e.push({
        event: "stop",
        offset: n,
        node: o
      }));
    return n;
  }(A, 0), e;
}
function BYt(A, e, t) {
  let i = 0, n = "";
  const o = [];
  function g() {
    return !A.length || !e.length ? A.length ? A : e : A[0].offset !== e[0].offset ? A[0].offset < e[0].offset ? A : e : e[0].event === "start" ? A : e;
  }
  function s(a) {
    function C(B) {
      return " " + B.nodeName + '="' + kw(B.value) + '"';
    }
    n += "<" + F6(a) + [].map.call(a.attributes, C).join("") + ">";
  }
  function I(a) {
    n += "</" + F6(a) + ">";
  }
  function r(a) {
    (a.event === "start" ? s : I)(a.node);
  }
  for (; A.length || e.length; ) {
    let a = g();
    if (n += kw(t.substring(i, a[0].offset)), i = a[0].offset, a === A) {
      o.reverse().forEach(I);
      do
        r(a.splice(0, 1)[0]), a = g();
      while (a === A && a.length && a[0].offset === i);
      o.reverse().forEach(s);
    } else
      a[0].event === "start" ? o.push(a[0].node) : o.pop(), r(a.splice(0, 1)[0]);
  }
  return n + kw(t.substr(i));
}
const fbA = {}, G_ = (A) => {
  console.error(A);
}, DbA = (A, ...e) => {
  console.log(`WARN: ${A}`, ...e);
}, ba = (A, e) => {
  fbA[`${A}/${e}`] || (console.log(`Deprecated as of ${A}. ${e}`), fbA[`${A}/${e}`] = !0);
}, k_ = kw, GbA = gu, kbA = Symbol("nomatch"), lYt = function(A) {
  const e = /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ Object.create(null), i = [];
  let n = !0;
  const o = /(^(<[^>]+>|\t|)+|\n)/gm, g = "Could not find the language '{}', did you forget to load/include a language module?", s = { disableAutodetect: !0, name: "Plain text", contains: [] };
  let I = {
    noHighlightRe: /^(no-?highlight)$/i,
    languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
    classPrefix: "hljs-",
    tabReplace: null,
    useBR: !1,
    languages: null,
    // beta configuration options, subject to change, welcome to discuss
    // https://github.com/highlightjs/highlight.js/issues/1086
    __emitter: DNt
  };
  function r(AA) {
    return I.noHighlightRe.test(AA);
  }
  function a(AA) {
    let gA = AA.className + " ";
    gA += AA.parentNode ? AA.parentNode.className : "";
    const rA = I.languageDetectRe.exec(gA);
    if (rA) {
      const sA = U(rA[1]);
      return sA || (DbA(g.replace("{}", rA[1])), DbA("Falling back to no-highlight mode for this block.", AA)), sA ? rA[1] : "no-highlight";
    }
    return gA.split(/\s+/).find((sA) => r(sA) || U(sA));
  }
  function C(AA, gA, rA, sA) {
    let lA = "", cA = "";
    typeof gA == "object" ? (lA = AA, rA = gA.ignoreIllegals, cA = gA.language, sA = void 0) : (ba("10.7.0", "highlight(lang, code, ...args) has been deprecated."), ba("10.7.0", `Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`), cA = AA, lA = gA);
    const aA = {
      code: lA,
      language: cA
    };
    _("before:highlight", aA);
    const QA = aA.result ? aA.result : B(aA.language, aA.code, rA, sA);
    return QA.code = aA.code, _("after:highlight", QA), QA;
  }
  function B(AA, gA, rA, sA) {
    function lA(zA, Qe) {
      const de = we.case_insensitive ? Qe[0].toLowerCase() : Qe[0];
      return Object.prototype.hasOwnProperty.call(zA.keywords, de) && zA.keywords[de];
    }
    function cA() {
      if (!ee.keywords) {
        wA.addText(WA);
        return;
      }
      let zA = 0;
      ee.keywordPatternRe.lastIndex = 0;
      let Qe = ee.keywordPatternRe.exec(WA), de = "";
      for (; Qe; ) {
        de += WA.substring(zA, Qe.index);
        const xe = lA(ee, Qe);
        if (xe) {
          const [$e, Pn] = xe;
          if (wA.addText(de), de = "", Pe += Pn, $e.startsWith("_"))
            de += Qe[0];
          else {
            const Zt = we.classNameAliases[$e] || $e;
            wA.addKeyword(Qe[0], Zt);
          }
        } else
          de += Qe[0];
        zA = ee.keywordPatternRe.lastIndex, Qe = ee.keywordPatternRe.exec(WA);
      }
      de += WA.substr(zA), wA.addText(de);
    }
    function aA() {
      if (WA === "")
        return;
      let zA = null;
      if (typeof ee.subLanguage == "string") {
        if (!e[ee.subLanguage]) {
          wA.addText(WA);
          return;
        }
        zA = B(ee.subLanguage, WA, !0, re[ee.subLanguage]), re[ee.subLanguage] = /** @type {CompiledMode} */
        zA.top;
      } else
        zA = Q(WA, ee.subLanguage.length ? ee.subLanguage : null);
      ee.relevance > 0 && (Pe += zA.relevance), wA.addSublanguage(zA.emitter, zA.language);
    }
    function QA() {
      ee.subLanguage != null ? aA() : cA(), WA = "";
    }
    function hA(zA) {
      return zA.className && wA.openNode(we.classNameAliases[zA.className] || zA.className), ee = Object.create(zA, { parent: { value: ee } }), ee;
    }
    function EA(zA, Qe, de) {
      let xe = YNt(zA.endRe, de);
      if (xe) {
        if (zA["on:end"]) {
          const $e = new ybA(zA);
          zA["on:end"](Qe, $e), $e.isMatchIgnored && (xe = !1);
        }
        if (xe) {
          for (; zA.endsParent && zA.parent; )
            zA = zA.parent;
          return zA;
        }
      }
      if (zA.endsWithParent)
        return EA(zA.parent, Qe, de);
    }
    function RA(zA) {
      return ee.matcher.regexIndex === 0 ? (WA += zA[0], 1) : (Li = !0, 0);
    }
    function xA(zA) {
      const Qe = zA[0], de = zA.rule, xe = new ybA(de), $e = [de.__beforeBegin, de["on:begin"]];
      for (const Pn of $e)
        if (Pn && (Pn(zA, xe), xe.isMatchIgnored))
          return RA(Qe);
      return de && de.endSameAsBegin && (de.endRe = GNt(Qe)), de.skip ? WA += Qe : (de.excludeBegin && (WA += Qe), QA(), !de.returnBegin && !de.excludeBegin && (WA = Qe)), hA(de), de.returnBegin ? 0 : Qe.length;
    }
    function HA(zA) {
      const Qe = zA[0], de = gA.substr(zA.index), xe = EA(ee, zA, de);
      if (!xe)
        return kbA;
      const $e = ee;
      $e.skip ? WA += Qe : ($e.returnEnd || $e.excludeEnd || (WA += Qe), QA(), $e.excludeEnd && (WA = Qe));
      do
        ee.className && wA.closeNode(), !ee.skip && !ee.subLanguage && (Pe += ee.relevance), ee = ee.parent;
      while (ee !== xe.parent);
      return xe.starts && (xe.endSameAsBegin && (xe.starts.endRe = xe.endRe), hA(xe.starts)), $e.returnEnd ? 0 : Qe.length;
    }
    function ne() {
      const zA = [];
      for (let Qe = ee; Qe !== we; Qe = Qe.parent)
        Qe.className && zA.unshift(Qe.className);
      zA.forEach((Qe) => wA.openNode(Qe));
    }
    let VA = {};
    function le(zA, Qe) {
      const de = Qe && Qe[0];
      if (WA += zA, de == null)
        return QA(), 0;
      if (VA.type === "begin" && Qe.type === "end" && VA.index === Qe.index && de === "") {
        if (WA += gA.slice(Qe.index, Qe.index + 1), !n) {
          const xe = new Error("0 width match regex");
          throw xe.languageName = AA, xe.badRule = VA.rule, xe;
        }
        return 1;
      }
      if (VA = Qe, Qe.type === "begin")
        return xA(Qe);
      if (Qe.type === "illegal" && !rA) {
        const xe = new Error('Illegal lexeme "' + de + '" for mode "' + (ee.className || "<unnamed>") + '"');
        throw xe.mode = ee, xe;
      } else if (Qe.type === "end") {
        const xe = HA(Qe);
        if (xe !== kbA)
          return xe;
      }
      if (Qe.type === "illegal" && de === "")
        return 1;
      if (it > 1e5 && it > Qe.index * 3)
        throw new Error("potential infinite loop, way more iterations than matches");
      return WA += de, de.length;
    }
    const we = U(AA);
    if (!we)
      throw G_(g.replace("{}", AA)), new Error('Unknown language: "' + AA + '"');
    const De = gYt(we, { plugins: i });
    let Ke = "", ee = sA || De;
    const re = {}, wA = new I.__emitter(I);
    ne();
    let WA = "", Pe = 0, je = 0, it = 0, Li = !1;
    try {
      for (ee.matcher.considerAll(); ; ) {
        it++, Li ? Li = !1 : ee.matcher.considerAll(), ee.matcher.lastIndex = je;
        const zA = ee.matcher.exec(gA);
        if (!zA)
          break;
        const Qe = gA.substring(je, zA.index), de = le(Qe, zA);
        je = zA.index + de;
      }
      return le(gA.substr(je)), wA.closeAllNodes(), wA.finalize(), Ke = wA.toHTML(), {
        // avoid possible breakage with v10 clients expecting
        // this to always be an integer
        relevance: Math.floor(Pe),
        value: Ke,
        language: AA,
        illegal: !1,
        emitter: wA,
        top: ee
      };
    } catch (zA) {
      if (zA.message && zA.message.includes("Illegal"))
        return {
          illegal: !0,
          illegalBy: {
            msg: zA.message,
            context: gA.slice(je - 100, je + 100),
            mode: zA.mode
          },
          sofar: Ke,
          relevance: 0,
          value: k_(gA),
          emitter: wA
        };
      if (n)
        return {
          illegal: !1,
          relevance: 0,
          value: k_(gA),
          emitter: wA,
          language: AA,
          top: ee,
          errorRaised: zA
        };
      throw zA;
    }
  }
  function l(AA) {
    const gA = {
      relevance: 0,
      emitter: new I.__emitter(I),
      value: k_(AA),
      illegal: !1,
      top: s
    };
    return gA.emitter.addText(AA), gA;
  }
  function Q(AA, gA) {
    gA = gA || I.languages || Object.keys(e);
    const rA = l(AA), sA = gA.filter(U).filter(q).map(
      (hA) => B(hA, AA, !1)
    );
    sA.unshift(rA);
    const lA = sA.sort((hA, EA) => {
      if (hA.relevance !== EA.relevance)
        return EA.relevance - hA.relevance;
      if (hA.language && EA.language) {
        if (U(hA.language).supersetOf === EA.language)
          return 1;
        if (U(EA.language).supersetOf === hA.language)
          return -1;
      }
      return 0;
    }), [cA, aA] = lA, QA = cA;
    return QA.second_best = aA, QA;
  }
  function E(AA) {
    return I.tabReplace || I.useBR ? AA.replace(o, (gA) => gA === `
` ? I.useBR ? "<br>" : gA : I.tabReplace ? gA.replace(/\t/g, I.tabReplace) : gA) : AA;
  }
  function d(AA, gA, rA) {
    const sA = gA ? t[gA] : rA;
    AA.classList.add("hljs"), sA && AA.classList.add(sA);
  }
  const m = {
    "before:highlightElement": ({ el: AA }) => {
      I.useBR && (AA.innerHTML = AA.innerHTML.replace(/\n/g, "").replace(/<br[ /]*>/g, `
`));
    },
    "after:highlightElement": ({ result: AA }) => {
      I.useBR && (AA.value = AA.value.replace(/\n/g, "<br>"));
    }
  }, y = /^(<[^>]+>|\t)+/gm, f = {
    "after:highlightElement": ({ result: AA }) => {
      I.tabReplace && (AA.value = AA.value.replace(
        y,
        (gA) => gA.replace(/\t/g, I.tabReplace)
      ));
    }
  };
  function w(AA) {
    let gA = null;
    const rA = a(AA);
    if (r(rA))
      return;
    _(
      "before:highlightElement",
      { el: AA, language: rA }
    ), gA = AA;
    const sA = gA.textContent, lA = rA ? C(sA, { language: rA, ignoreIllegals: !0 }) : Q(sA);
    _("after:highlightElement", { el: AA, result: lA, text: sA }), AA.innerHTML = lA.value, d(AA, rA, lA.language), AA.result = {
      language: lA.language,
      // TODO: remove with version 11.0
      re: lA.relevance,
      relavance: lA.relevance
    }, lA.second_best && (AA.second_best = {
      language: lA.second_best.language,
      // TODO: remove with version 11.0
      re: lA.second_best.relevance,
      relavance: lA.second_best.relevance
    });
  }
  function G(AA) {
    AA.useBR && (ba("10.3.0", "'useBR' will be removed entirely in v11.0"), ba("10.3.0", "Please see https://github.com/highlightjs/highlight.js/issues/2559")), I = GbA(I, AA);
  }
  const R = () => {
    if (R.called)
      return;
    R.called = !0, ba("10.6.0", "initHighlighting() is deprecated.  Use highlightAll() instead."), document.querySelectorAll("pre code").forEach(w);
  };
  function F() {
    ba("10.6.0", "initHighlightingOnLoad() is deprecated.  Use highlightAll() instead."), Z = !0;
  }
  let Z = !1;
  function c() {
    if (document.readyState === "loading") {
      Z = !0;
      return;
    }
    document.querySelectorAll("pre code").forEach(w);
  }
  function J() {
    Z && c();
  }
  typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded", J, !1);
  function p(AA, gA) {
    let rA = null;
    try {
      rA = gA(A);
    } catch (sA) {
      if (G_("Language definition for '{}' could not be registered.".replace("{}", AA)), n)
        G_(sA);
      else
        throw sA;
      rA = s;
    }
    rA.name || (rA.name = AA), e[AA] = rA, rA.rawDefinition = gA.bind(null, A), rA.aliases && j(rA.aliases, { languageName: AA });
  }
  function N(AA) {
    delete e[AA];
    for (const gA of Object.keys(t))
      t[gA] === AA && delete t[gA];
  }
  function v() {
    return Object.keys(e);
  }
  function K(AA) {
    ba("10.4.0", "requireLanguage will be removed entirely in v11."), ba("10.4.0", "Please see https://github.com/highlightjs/highlight.js/pull/2844");
    const gA = U(AA);
    if (gA)
      return gA;
    throw new Error("The '{}' language is required, but not loaded.".replace("{}", AA));
  }
  function U(AA) {
    return AA = (AA || "").toLowerCase(), e[AA] || e[t[AA]];
  }
  function j(AA, { languageName: gA }) {
    typeof AA == "string" && (AA = [AA]), AA.forEach((rA) => {
      t[rA.toLowerCase()] = gA;
    });
  }
  function q(AA) {
    const gA = U(AA);
    return gA && !gA.disableAutodetect;
  }
  function O(AA) {
    AA["before:highlightBlock"] && !AA["before:highlightElement"] && (AA["before:highlightElement"] = (gA) => {
      AA["before:highlightBlock"](
        Object.assign({ block: gA.el }, gA)
      );
    }), AA["after:highlightBlock"] && !AA["after:highlightElement"] && (AA["after:highlightElement"] = (gA) => {
      AA["after:highlightBlock"](
        Object.assign({ block: gA.el }, gA)
      );
    });
  }
  function $(AA) {
    O(AA), i.push(AA);
  }
  function _(AA, gA) {
    const rA = AA;
    i.forEach(function(sA) {
      sA[rA] && sA[rA](gA);
    });
  }
  function tA(AA) {
    return ba("10.2.0", "fixMarkup will be removed entirely in v11.0"), ba("10.2.0", "Please see https://github.com/highlightjs/highlight.js/issues/2534"), E(AA);
  }
  function nA(AA) {
    return ba("10.7.0", "highlightBlock will be removed entirely in v12.0"), ba("10.7.0", "Please use highlightElement now."), w(AA);
  }
  Object.assign(A, {
    highlight: C,
    highlightAuto: Q,
    highlightAll: c,
    fixMarkup: tA,
    highlightElement: w,
    // TODO: Remove with v12 API
    highlightBlock: nA,
    configure: G,
    initHighlighting: R,
    initHighlightingOnLoad: F,
    registerLanguage: p,
    unregisterLanguage: N,
    listLanguages: v,
    getLanguage: U,
    registerAliases: j,
    requireLanguage: K,
    autoDetection: q,
    inherit: GbA,
    addPlugin: $,
    // plugins for frameworks
    vuePlugin: rYt(A).VuePlugin
  }), A.debugMode = function() {
    n = !1;
  }, A.safeMode = function() {
    n = !0;
  }, A.versionString = IYt;
  for (const AA in tL)
    typeof tL[AA] == "object" && f_A(tL[AA]);
  return Object.assign(A, tL), A.addPlugin(m), A.addPlugin(CYt), A.addPlugin(f), A;
};
var cYt = lYt({}), QYt = cYt, M6 = {}, EYt = {
  get exports() {
    return M6;
  },
  set exports(A) {
    M6 = A;
  }
};
(function(A) {
  (function() {
    var e;
    e = A.exports = n, e.format = n, e.vsprintf = i, typeof console < "u" && typeof console.log == "function" && (e.printf = t);
    function t() {
      console.log(n.apply(null, arguments));
    }
    function i(o, g) {
      return n.apply(null, [o].concat(g));
    }
    function n(o) {
      for (var g = 1, s = [].slice.call(arguments), I = 0, r = o.length, a = "", C, B = !1, l, Q, E = !1, d, m = function() {
        return s[g++];
      }, y = function() {
        for (var f = ""; /\d/.test(o[I]); )
          f += o[I++], C = o[I];
        return f.length > 0 ? parseInt(f) : null;
      }; I < r; ++I)
        if (C = o[I], B)
          switch (B = !1, C == "." ? (E = !1, C = o[++I]) : C == "0" && o[I + 1] == "." ? (E = !0, I += 2, C = o[I]) : E = !0, d = y(), C) {
            case "b":
              a += parseInt(m(), 10).toString(2);
              break;
            case "c":
              l = m(), typeof l == "string" || l instanceof String ? a += l : a += String.fromCharCode(parseInt(l, 10));
              break;
            case "d":
              a += parseInt(m(), 10);
              break;
            case "f":
              Q = String(parseFloat(m()).toFixed(d || 6)), a += E ? Q : Q.replace(/^0/, "");
              break;
            case "j":
              a += JSON.stringify(m());
              break;
            case "o":
              a += "0" + parseInt(m(), 10).toString(8);
              break;
            case "s":
              a += m();
              break;
            case "x":
              a += "0x" + parseInt(m(), 10).toString(16);
              break;
            case "X":
              a += "0x" + parseInt(m(), 10).toString(16).toUpperCase();
              break;
            default:
              a += C;
              break;
          }
        else
          C === "%" ? B = !0 : a += C;
      return a;
    }
  })();
})(EYt);
var uYt = M6, nh = oh(Error), dYt = nh;
nh.eval = oh(EvalError);
nh.range = oh(RangeError);
nh.reference = oh(ReferenceError);
nh.syntax = oh(SyntaxError);
nh.type = oh(TypeError);
nh.uri = oh(URIError);
nh.create = oh;
function oh(A) {
  return e.displayName = A.displayName || A.name, e;
  function e(t) {
    return t && (t = uYt.apply(null, arguments)), new A(t);
  }
}
var DB = QYt, Dv = dYt;
J0.highlight = R_A;
J0.highlightAuto = mYt;
J0.registerLanguage = pYt;
J0.listLanguages = yYt;
J0.registerAlias = bYt;
qQ.prototype.addText = DYt;
qQ.prototype.addKeyword = wYt;
qQ.prototype.addSublanguage = fYt;
qQ.prototype.openNode = GYt;
qQ.prototype.closeNode = kYt;
qQ.prototype.closeAllNodes = F_A;
qQ.prototype.finalize = F_A;
qQ.prototype.toHTML = JYt;
var hYt = "hljs-";
function R_A(A, e, t) {
  var i = DB.configure({}), n = t || {}, o = n.prefix, g;
  if (typeof A != "string")
    throw Dv("Expected `string` for name, got `%s`", A);
  if (!DB.getLanguage(A))
    throw Dv("Unknown language: `%s` is not registered", A);
  if (typeof e != "string")
    throw Dv("Expected `string` for value, got `%s`", e);
  if (o == null && (o = hYt), DB.configure({ __emitter: qQ, classPrefix: o }), g = DB.highlight(e, { language: A, ignoreIllegals: !0 }), DB.configure(i || {}), g.errorRaised)
    throw g.errorRaised;
  return {
    relevance: g.relevance,
    language: g.language,
    value: g.emitter.rootNode.children
  };
}
function mYt(A, e) {
  var t = e || {}, i = t.subset || DB.listLanguages();
  t.prefix;
  var n = i.length, o = -1, g, s, I, r;
  if (typeof A != "string")
    throw Dv("Expected `string` for value, got `%s`", A);
  for (s = { relevance: 0, language: null, value: [] }, g = { relevance: 0, language: null, value: [] }; ++o < n; )
    r = i[o], DB.getLanguage(r) && (I = R_A(r, A, e), I.language = r, I.relevance > s.relevance && (s = I), I.relevance > g.relevance && (s = g, g = I));
  return s.language && (g.secondBest = s), g;
}
function pYt(A, e) {
  DB.registerLanguage(A, e);
}
function yYt() {
  return DB.listLanguages();
}
function bYt(A, e) {
  var t = A, i;
  e && (t = {}, t[A] = e);
  for (i in t)
    DB.registerAliases(t[i], { languageName: i });
}
function qQ(A) {
  this.options = A, this.rootNode = { children: [] }, this.stack = [this.rootNode];
}
function wYt(A, e) {
  this.openNode(e), this.addText(A), this.closeNode();
}
function fYt(A, e) {
  var t = this.stack, i = t[t.length - 1], n = A.rootNode.children, o = e ? {
    type: "element",
    tagName: "span",
    properties: { className: [e] },
    children: n
  } : n;
  i.children = i.children.concat(o);
}
function DYt(A) {
  var e = this.stack, t, i;
  A !== "" && (t = e[e.length - 1], i = t.children[t.children.length - 1], i && i.type === "text" ? i.value += A : t.children.push({ type: "text", value: A }));
}
function GYt(A) {
  var e = this.stack, t = this.options.classPrefix + A, i = e[e.length - 1], n = {
    type: "element",
    tagName: "span",
    properties: { className: [t] },
    children: []
  };
  i.children.push(n), e.push(n);
}
function kYt() {
  this.stack.pop();
}
function JYt() {
  return "";
}
function F_A() {
}
function NYt(A) {
  const e = {
    literal: "true false null"
  }, t = [
    A.C_LINE_COMMENT_MODE,
    A.C_BLOCK_COMMENT_MODE
  ], i = [
    A.QUOTE_STRING_MODE,
    A.C_NUMBER_MODE
  ], n = {
    end: ",",
    endsWithParent: !0,
    excludeEnd: !0,
    contains: i,
    keywords: e
  }, o = {
    begin: /\{/,
    end: /\}/,
    contains: [
      {
        className: "attr",
        begin: /"/,
        end: /"/,
        contains: [A.BACKSLASH_ESCAPE],
        illegal: "\\n"
      },
      A.inherit(n, {
        begin: /:/
      })
    ].concat(t),
    illegal: "\\S"
  }, g = {
    begin: "\\[",
    end: "\\]",
    contains: [A.inherit(n)],
    // inherit is a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents
    illegal: "\\S"
  };
  return i.push(o, g), t.forEach(function(s) {
    i.push(s);
  }), {
    name: "JSON",
    contains: i,
    keywords: e,
    illegal: "\\S"
  };
}
var YYt = NYt;
const RYt = YYt;
function FYt(A) {
  return A ? typeof A == "string" ? A : A.source : null;
}
function MYt(A) {
  return xYt("(?=", A, ")");
}
function xYt(...A) {
  return A.map((t) => FYt(t)).join("");
}
function LYt(A) {
  const o = {
    $pattern: /[A-Za-z]\w+|__\w+__/,
    keyword: [
      "and",
      "as",
      "assert",
      "async",
      "await",
      "break",
      "class",
      "continue",
      "def",
      "del",
      "elif",
      "else",
      "except",
      "finally",
      "for",
      "from",
      "global",
      "if",
      "import",
      "in",
      "is",
      "lambda",
      "nonlocal|10",
      "not",
      "or",
      "pass",
      "raise",
      "return",
      "try",
      "while",
      "with",
      "yield"
    ],
    built_in: [
      "__import__",
      "abs",
      "all",
      "any",
      "ascii",
      "bin",
      "bool",
      "breakpoint",
      "bytearray",
      "bytes",
      "callable",
      "chr",
      "classmethod",
      "compile",
      "complex",
      "delattr",
      "dict",
      "dir",
      "divmod",
      "enumerate",
      "eval",
      "exec",
      "filter",
      "float",
      "format",
      "frozenset",
      "getattr",
      "globals",
      "hasattr",
      "hash",
      "help",
      "hex",
      "id",
      "input",
      "int",
      "isinstance",
      "issubclass",
      "iter",
      "len",
      "list",
      "locals",
      "map",
      "max",
      "memoryview",
      "min",
      "next",
      "object",
      "oct",
      "open",
      "ord",
      "pow",
      "print",
      "property",
      "range",
      "repr",
      "reversed",
      "round",
      "set",
      "setattr",
      "slice",
      "sorted",
      "staticmethod",
      "str",
      "sum",
      "super",
      "tuple",
      "type",
      "vars",
      "zip"
    ],
    literal: [
      "__debug__",
      "Ellipsis",
      "False",
      "None",
      "NotImplemented",
      "True"
    ],
    type: [
      "Any",
      "Callable",
      "Coroutine",
      "Dict",
      "List",
      "Literal",
      "Generic",
      "Optional",
      "Sequence",
      "Set",
      "Tuple",
      "Type",
      "Union"
    ]
  }, g = {
    className: "meta",
    begin: /^(>>>|\.\.\.) /
  }, s = {
    className: "subst",
    begin: /\{/,
    end: /\}/,
    keywords: o,
    illegal: /#/
  }, I = {
    begin: /\{\{/,
    relevance: 0
  }, r = {
    className: "string",
    contains: [A.BACKSLASH_ESCAPE],
    variants: [
      {
        begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,
        end: /'''/,
        contains: [
          A.BACKSLASH_ESCAPE,
          g
        ],
        relevance: 10
      },
      {
        begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,
        end: /"""/,
        contains: [
          A.BACKSLASH_ESCAPE,
          g
        ],
        relevance: 10
      },
      {
        begin: /([fF][rR]|[rR][fF]|[fF])'''/,
        end: /'''/,
        contains: [
          A.BACKSLASH_ESCAPE,
          g,
          I,
          s
        ]
      },
      {
        begin: /([fF][rR]|[rR][fF]|[fF])"""/,
        end: /"""/,
        contains: [
          A.BACKSLASH_ESCAPE,
          g,
          I,
          s
        ]
      },
      {
        begin: /([uU]|[rR])'/,
        end: /'/,
        relevance: 10
      },
      {
        begin: /([uU]|[rR])"/,
        end: /"/,
        relevance: 10
      },
      {
        begin: /([bB]|[bB][rR]|[rR][bB])'/,
        end: /'/
      },
      {
        begin: /([bB]|[bB][rR]|[rR][bB])"/,
        end: /"/
      },
      {
        begin: /([fF][rR]|[rR][fF]|[fF])'/,
        end: /'/,
        contains: [
          A.BACKSLASH_ESCAPE,
          I,
          s
        ]
      },
      {
        begin: /([fF][rR]|[rR][fF]|[fF])"/,
        end: /"/,
        contains: [
          A.BACKSLASH_ESCAPE,
          I,
          s
        ]
      },
      A.APOS_STRING_MODE,
      A.QUOTE_STRING_MODE
    ]
  }, a = "[0-9](_?[0-9])*", C = `(\\b(${a}))?\\.(${a})|\\b(${a})\\.`, B = {
    className: "number",
    relevance: 0,
    variants: [
      // exponentfloat, pointfloat
      // https://docs.python.org/3.9/reference/lexical_analysis.html#floating-point-literals
      // optionally imaginary
      // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
      // Note: no leading \b because floats can start with a decimal point
      // and we don't want to mishandle e.g. `fn(.5)`,
      // no trailing \b for pointfloat because it can end with a decimal point
      // and we don't want to mishandle e.g. `0..hex()`; this should be safe
      // because both MUST contain a decimal point and so cannot be confused with
      // the interior part of an identifier
      {
        begin: `(\\b(${a})|(${C}))[eE][+-]?(${a})[jJ]?\\b`
      },
      {
        begin: `(${C})[jJ]?`
      },
      // decinteger, bininteger, octinteger, hexinteger
      // https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals
      // optionally "long" in Python 2
      // https://docs.python.org/2.7/reference/lexical_analysis.html#integer-and-long-integer-literals
      // decinteger is optionally imaginary
      // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
      {
        begin: "\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"
      },
      {
        begin: "\\b0[bB](_?[01])+[lL]?\\b"
      },
      {
        begin: "\\b0[oO](_?[0-7])+[lL]?\\b"
      },
      {
        begin: "\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"
      },
      // imagnumber (digitpart-based)
      // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
      {
        begin: `\\b(${a})[jJ]\\b`
      }
    ]
  }, l = {
    className: "comment",
    begin: MYt(/# type:/),
    end: /$/,
    keywords: o,
    contains: [
      {
        // prevent keywords from coloring `type`
        begin: /# type:/
      },
      // comment within a datatype comment includes no keywords
      {
        begin: /#/,
        end: /\b\B/,
        endsWithParent: !0
      }
    ]
  }, Q = {
    className: "params",
    variants: [
      // Exclude params in functions without params
      {
        className: "",
        begin: /\(\s*\)/,
        skip: !0
      },
      {
        begin: /\(/,
        end: /\)/,
        excludeBegin: !0,
        excludeEnd: !0,
        keywords: o,
        contains: [
          "self",
          g,
          B,
          r,
          A.HASH_COMMENT_MODE
        ]
      }
    ]
  };
  return s.contains = [
    r,
    B,
    g
  ], {
    name: "Python",
    aliases: [
      "py",
      "gyp",
      "ipython"
    ],
    keywords: o,
    illegal: /(<\/|->|\?)|=>/,
    contains: [
      g,
      B,
      {
        // very common convention
        begin: /\bself\b/
      },
      {
        // eat "if" prior to string so that it won't accidentally be
        // labeled as an f-string
        beginKeywords: "if",
        relevance: 0
      },
      r,
      l,
      A.HASH_COMMENT_MODE,
      {
        variants: [
          {
            className: "function",
            beginKeywords: "def"
          },
          {
            className: "class",
            beginKeywords: "class"
          }
        ],
        end: /:/,
        illegal: /[${=;\n,]/,
        contains: [
          A.UNDERSCORE_TITLE_MODE,
          Q,
          {
            begin: /->/,
            endsWithParent: !0,
            keywords: o
          }
        ]
      },
      {
        className: "meta",
        begin: /^[\t ]*@/,
        end: /(?=#)|$/,
        contains: [
          B,
          Q,
          r
        ]
      }
    ]
  };
}
var vYt = LYt;
const HYt = vYt;
var M_A = yNt(J0, {});
M_A.registerLanguage = J0.registerLanguage;
const HW = M_A, JbA = {
  hljs: {
    display: "block",
    overflowX: "auto",
    padding: "0.5em",
    color: "#383a42",
    background: "#fafafa"
  },
  "hljs-comment": {
    color: "#a0a1a7",
    fontStyle: "italic"
  },
  "hljs-quote": {
    color: "#a0a1a7",
    fontStyle: "italic"
  },
  "hljs-doctag": {
    color: "#a626a4"
  },
  "hljs-keyword": {
    color: "#a626a4"
  },
  "hljs-formula": {
    color: "#a626a4"
  },
  "hljs-section": {
    color: "#e45649"
  },
  "hljs-name": {
    color: "#e45649"
  },
  "hljs-selector-tag": {
    color: "#e45649"
  },
  "hljs-deletion": {
    color: "#e45649"
  },
  "hljs-subst": {
    color: "#e45649"
  },
  "hljs-literal": {
    color: "#0184bb"
  },
  "hljs-string": {
    color: "#50a14f"
  },
  "hljs-regexp": {
    color: "#50a14f"
  },
  "hljs-addition": {
    color: "#50a14f"
  },
  "hljs-attribute": {
    color: "#50a14f"
  },
  "hljs-meta-string": {
    color: "#50a14f"
  },
  "hljs-built_in": {
    color: "#c18401"
  },
  "hljs-class .hljs-title": {
    color: "#c18401"
  },
  "hljs-attr": {
    color: "#986801"
  },
  "hljs-variable": {
    color: "#986801"
  },
  "hljs-template-variable": {
    color: "#986801"
  },
  "hljs-type": {
    color: "#986801"
  },
  "hljs-selector-class": {
    color: "#986801"
  },
  "hljs-selector-attr": {
    color: "#986801"
  },
  "hljs-selector-pseudo": {
    color: "#986801"
  },
  "hljs-number": {
    color: "#986801"
  },
  "hljs-symbol": {
    color: "#4078f2"
  },
  "hljs-bullet": {
    color: "#4078f2"
  },
  "hljs-link": {
    color: "#4078f2",
    textDecoration: "underline"
  },
  "hljs-meta": {
    color: "#4078f2"
  },
  "hljs-selector-id": {
    color: "#4078f2"
  },
  "hljs-title": {
    color: "#4078f2"
  },
  "hljs-emphasis": {
    fontStyle: "italic"
  },
  "hljs-strong": {
    fontWeight: "bold"
  }
}, NbA = {
  hljs: {
    display: "block",
    overflowX: "auto",
    padding: "0.5em",
    color: "#abb2bf",
    background: "#282c34"
  },
  "hljs-comment": {
    color: "#5c6370",
    fontStyle: "italic"
  },
  "hljs-quote": {
    color: "#5c6370",
    fontStyle: "italic"
  },
  "hljs-doctag": {
    color: "#c678dd"
  },
  "hljs-keyword": {
    color: "#c678dd"
  },
  "hljs-formula": {
    color: "#c678dd"
  },
  "hljs-section": {
    color: "#e06c75"
  },
  "hljs-name": {
    color: "#e06c75"
  },
  "hljs-selector-tag": {
    color: "#e06c75"
  },
  "hljs-deletion": {
    color: "#e06c75"
  },
  "hljs-subst": {
    color: "#e06c75"
  },
  "hljs-literal": {
    color: "#56b6c2"
  },
  "hljs-string": {
    color: "#98c379"
  },
  "hljs-regexp": {
    color: "#98c379"
  },
  "hljs-addition": {
    color: "#98c379"
  },
  "hljs-attribute": {
    color: "#98c379"
  },
  "hljs-meta-string": {
    color: "#98c379"
  },
  "hljs-built_in": {
    color: "#e6c07b"
  },
  "hljs-class .hljs-title": {
    color: "#e6c07b"
  },
  "hljs-attr": {
    color: "#d19a66"
  },
  "hljs-variable": {
    color: "#d19a66"
  },
  "hljs-template-variable": {
    color: "#d19a66"
  },
  "hljs-type": {
    color: "#d19a66"
  },
  "hljs-selector-class": {
    color: "#d19a66"
  },
  "hljs-selector-attr": {
    color: "#d19a66"
  },
  "hljs-selector-pseudo": {
    color: "#d19a66"
  },
  "hljs-number": {
    color: "#d19a66"
  },
  "hljs-symbol": {
    color: "#61aeee"
  },
  "hljs-bullet": {
    color: "#61aeee"
  },
  "hljs-link": {
    color: "#61aeee",
    textDecoration: "underline"
  },
  "hljs-meta": {
    color: "#61aeee"
  },
  "hljs-selector-id": {
    color: "#61aeee"
  },
  "hljs-title": {
    color: "#61aeee"
  },
  "hljs-emphasis": {
    fontStyle: "italic"
  },
  "hljs-strong": {
    fontWeight: "bold"
  }
};
function SYt(A) {
  return function(e) {
    let t = e.children;
    return Object.keys(A).forEach((i) => {
      const n = A[i];
      t = pA(n.Provider, { value: e[i], children: t });
    }), t;
  };
}
const BIA = u.createContext(null), dd = u.createContext("light"), ZYt = SYt({ portalContainerContext: BIA, darkModeContext: dd }), YbA = (A) => typeof A == "boolean" ? "".concat(A) : A === 0 ? "0" : A, RbA = EzA, HX = (A, e) => (t) => {
  var i;
  if ((e == null ? void 0 : e.variants) == null)
    return RbA(A, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
  const { variants: n, defaultVariants: o } = e, g = Object.keys(n).map((r) => {
    const a = t == null ? void 0 : t[r], C = o == null ? void 0 : o[r];
    if (a === null)
      return null;
    const B = YbA(a) || YbA(C);
    return n[r][B];
  }), s = t && Object.entries(t).reduce((r, a) => {
    let [C, B] = a;
    return B === void 0 || (r[C] = B), r;
  }, {}), I = e == null || (i = e.compoundVariants) === null || i === void 0 ? void 0 : i.reduce((r, a) => {
    let { class: C, className: B, ...l } = a;
    return Object.entries(l).every((Q) => {
      let [E, d] = Q;
      return Array.isArray(d) ? d.includes({
        ...o,
        ...s
      }[E]) : {
        ...o,
        ...s
      }[E] === d;
    }) ? [
      ...r,
      C,
      B
    ] : r;
  }, []);
  return RbA(A, g, I, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
}, WYt = HX("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", {
  variants: {
    variant: {
      default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
      destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
      outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
      secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
      ghost: "hover:bg-accent hover:text-accent-foreground",
      link: "text-primary underline-offset-4 hover:underline"
    },
    size: {
      default: "h-9 px-4 py-2",
      sm: "h-8 rounded-md px-3 text-xs",
      lg: "h-10 rounded-md px-8",
      icon: "h-9 w-9"
    }
  },
  defaultVariants: {
    variant: "default",
    size: "default"
  }
}), Kc = u.forwardRef(({ className: A, variant: e, size: t, asChild: i = !1, ...n }, o) => pA(i ? vp : "button", { className: dn(WYt({ variant: e, size: t, className: A })), ref: o, ...n }));
Kc.displayName = "Button";
function KYt(A, e = globalThis == null ? void 0 : globalThis.document) {
  const t = cl(A);
  u.useEffect(() => {
    const i = (n) => {
      n.key === "Escape" && t(n);
    };
    return e.addEventListener("keydown", i), () => e.removeEventListener("keydown", i);
  }, [
    t,
    e
  ]);
}
const x6 = "dismissableLayer.update", UYt = "dismissableLayer.pointerDownOutside", VYt = "dismissableLayer.focusOutside";
let FbA;
const XYt = /* @__PURE__ */ u.createContext({
  layers: /* @__PURE__ */ new Set(),
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
  branches: /* @__PURE__ */ new Set()
}), x_A = /* @__PURE__ */ u.forwardRef((A, e) => {
  var t;
  const { disableOutsidePointerEvents: i = !1, onEscapeKeyDown: n, onPointerDownOutside: o, onFocusOutside: g, onInteractOutside: s, onDismiss: I, ...r } = A, a = u.useContext(XYt), [C, B] = u.useState(null), l = (t = C == null ? void 0 : C.ownerDocument) !== null && t !== void 0 ? t : globalThis == null ? void 0 : globalThis.document, [, Q] = u.useState({}), E = On(
    e,
    (Z) => B(Z)
  ), d = Array.from(a.layers), [m] = [
    ...a.layersWithOutsidePointerEventsDisabled
  ].slice(-1), y = d.indexOf(m), f = C ? d.indexOf(C) : -1, w = a.layersWithOutsidePointerEventsDisabled.size > 0, G = f >= y, R = zYt((Z) => {
    const c = Z.target, J = [
      ...a.branches
    ].some(
      (p) => p.contains(c)
    );
    !G || J || (o == null || o(Z), s == null || s(Z), Z.defaultPrevented || I == null || I());
  }, l), F = TYt((Z) => {
    const c = Z.target;
    [
      ...a.branches
    ].some(
      (p) => p.contains(c)
    ) || (g == null || g(Z), s == null || s(Z), Z.defaultPrevented || I == null || I());
  }, l);
  return KYt((Z) => {
    f === a.layers.size - 1 && (n == null || n(Z), !Z.defaultPrevented && I && (Z.preventDefault(), I()));
  }, l), u.useEffect(() => {
    if (C)
      return i && (a.layersWithOutsidePointerEventsDisabled.size === 0 && (FbA = l.body.style.pointerEvents, l.body.style.pointerEvents = "none"), a.layersWithOutsidePointerEventsDisabled.add(C)), a.layers.add(C), MbA(), () => {
        i && a.layersWithOutsidePointerEventsDisabled.size === 1 && (l.body.style.pointerEvents = FbA);
      };
  }, [
    C,
    l,
    i,
    a
  ]), u.useEffect(() => () => {
    C && (a.layers.delete(C), a.layersWithOutsidePointerEventsDisabled.delete(C), MbA());
  }, [
    C,
    a
  ]), u.useEffect(() => {
    const Z = () => Q({});
    return document.addEventListener(x6, Z), () => document.removeEventListener(x6, Z);
  }, []), /* @__PURE__ */ u.createElement(ii.div, be({}, r, {
    ref: E,
    style: {
      pointerEvents: w ? G ? "auto" : "none" : void 0,
      ...A.style
    },
    onFocusCapture: qt(A.onFocusCapture, F.onFocusCapture),
    onBlurCapture: qt(A.onBlurCapture, F.onBlurCapture),
    onPointerDownCapture: qt(A.onPointerDownCapture, R.onPointerDownCapture)
  }));
});
function zYt(A, e = globalThis == null ? void 0 : globalThis.document) {
  const t = cl(A), i = u.useRef(!1), n = u.useRef(() => {
  });
  return u.useEffect(() => {
    const o = (s) => {
      if (s.target && !i.current) {
        let r = function() {
          L_A(UYt, t, I, {
            discrete: !0
          });
        };
        const I = {
          originalEvent: s
        };
        s.pointerType === "touch" ? (e.removeEventListener("click", n.current), n.current = r, e.addEventListener("click", n.current, {
          once: !0
        })) : r();
      } else
        e.removeEventListener("click", n.current);
      i.current = !1;
    }, g = window.setTimeout(() => {
      e.addEventListener("pointerdown", o);
    }, 0);
    return () => {
      window.clearTimeout(g), e.removeEventListener("pointerdown", o), e.removeEventListener("click", n.current);
    };
  }, [
    e,
    t
  ]), {
    // ensures we check React component tree (not just DOM tree)
    onPointerDownCapture: () => i.current = !0
  };
}
function TYt(A, e = globalThis == null ? void 0 : globalThis.document) {
  const t = cl(A), i = u.useRef(!1);
  return u.useEffect(() => {
    const n = (o) => {
      o.target && !i.current && L_A(VYt, t, {
        originalEvent: o
      }, {
        discrete: !1
      });
    };
    return e.addEventListener("focusin", n), () => e.removeEventListener("focusin", n);
  }, [
    e,
    t
  ]), {
    onFocusCapture: () => i.current = !0,
    onBlurCapture: () => i.current = !1
  };
}
function MbA() {
  const A = new CustomEvent(x6);
  document.dispatchEvent(A);
}
function L_A(A, e, t, { discrete: i }) {
  const n = t.originalEvent.target, o = new CustomEvent(A, {
    bubbles: !1,
    cancelable: !0,
    detail: t
  });
  e && n.addEventListener(A, e, {
    once: !0
  }), i ? Nft(n, o) : n.dispatchEvent(o);
}
const J_ = "focusScope.autoFocusOnMount", N_ = "focusScope.autoFocusOnUnmount", xbA = {
  bubbles: !1,
  cancelable: !0
}, v_A = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { loop: t = !1, trapped: i = !1, onMountAutoFocus: n, onUnmountAutoFocus: o, ...g } = A, [s, I] = u.useState(null), r = cl(n), a = cl(o), C = u.useRef(null), B = On(
    e,
    (E) => I(E)
  ), l = u.useRef({
    paused: !1,
    pause() {
      this.paused = !0;
    },
    resume() {
      this.paused = !1;
    }
  }).current;
  u.useEffect(() => {
    if (i) {
      let E = function(f) {
        if (l.paused || !s)
          return;
        const w = f.target;
        s.contains(w) ? C.current = w : kE(C.current, {
          select: !0
        });
      }, d = function(f) {
        if (l.paused || !s)
          return;
        const w = f.relatedTarget;
        w !== null && (s.contains(w) || kE(C.current, {
          select: !0
        }));
      }, m = function(f) {
        if (document.activeElement === document.body)
          for (const G of f)
            G.removedNodes.length > 0 && kE(s);
      };
      document.addEventListener("focusin", E), document.addEventListener("focusout", d);
      const y = new MutationObserver(m);
      return s && y.observe(s, {
        childList: !0,
        subtree: !0
      }), () => {
        document.removeEventListener("focusin", E), document.removeEventListener("focusout", d), y.disconnect();
      };
    }
  }, [
    i,
    s,
    l.paused
  ]), u.useEffect(() => {
    if (s) {
      vbA.add(l);
      const E = document.activeElement;
      if (!s.contains(E)) {
        const m = new CustomEvent(J_, xbA);
        s.addEventListener(J_, r), s.dispatchEvent(m), m.defaultPrevented || (_Yt($Yt(H_A(s)), {
          select: !0
        }), document.activeElement === E && kE(s));
      }
      return () => {
        s.removeEventListener(J_, r), setTimeout(() => {
          const m = new CustomEvent(N_, xbA);
          s.addEventListener(N_, a), s.dispatchEvent(m), m.defaultPrevented || kE(E ?? document.body, {
            select: !0
          }), s.removeEventListener(N_, a), vbA.remove(l);
        }, 0);
      };
    }
  }, [
    s,
    r,
    a,
    l
  ]);
  const Q = u.useCallback((E) => {
    if (!t && !i || l.paused)
      return;
    const d = E.key === "Tab" && !E.altKey && !E.ctrlKey && !E.metaKey, m = document.activeElement;
    if (d && m) {
      const y = E.currentTarget, [f, w] = qYt(y);
      f && w ? !E.shiftKey && m === w ? (E.preventDefault(), t && kE(f, {
        select: !0
      })) : E.shiftKey && m === f && (E.preventDefault(), t && kE(w, {
        select: !0
      })) : m === y && E.preventDefault();
    }
  }, [
    t,
    i,
    l.paused
  ]);
  return /* @__PURE__ */ u.createElement(ii.div, be({
    tabIndex: -1
  }, g, {
    ref: B,
    onKeyDown: Q
  }));
});
function _Yt(A, { select: e = !1 } = {}) {
  const t = document.activeElement;
  for (const i of A)
    if (kE(i, {
      select: e
    }), document.activeElement !== t)
      return;
}
function qYt(A) {
  const e = H_A(A), t = LbA(e, A), i = LbA(e.reverse(), A);
  return [
    t,
    i
  ];
}
function H_A(A) {
  const e = [], t = document.createTreeWalker(A, NodeFilter.SHOW_ELEMENT, {
    acceptNode: (i) => {
      const n = i.tagName === "INPUT" && i.type === "hidden";
      return i.disabled || i.hidden || n ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
    }
  });
  for (; t.nextNode(); )
    e.push(t.currentNode);
  return e;
}
function LbA(A, e) {
  for (const t of A)
    if (!OYt(t, {
      upTo: e
    }))
      return t;
}
function OYt(A, { upTo: e }) {
  if (getComputedStyle(A).visibility === "hidden")
    return !0;
  for (; A; ) {
    if (e !== void 0 && A === e)
      return !1;
    if (getComputedStyle(A).display === "none")
      return !0;
    A = A.parentElement;
  }
  return !1;
}
function jYt(A) {
  return A instanceof HTMLInputElement && "select" in A;
}
function kE(A, { select: e = !1 } = {}) {
  if (A && A.focus) {
    const t = document.activeElement;
    A.focus({
      preventScroll: !0
    }), A !== t && jYt(A) && e && A.select();
  }
}
const vbA = PYt();
function PYt() {
  let A = [];
  return {
    add(e) {
      const t = A[0];
      e !== t && (t == null || t.pause()), A = HbA(A, e), A.unshift(e);
    },
    remove(e) {
      var t;
      A = HbA(A, e), (t = A[0]) === null || t === void 0 || t.resume();
    }
  };
}
function HbA(A, e) {
  const t = [
    ...A
  ], i = t.indexOf(e);
  return i !== -1 && t.splice(i, 1), t;
}
function $Yt(A) {
  return A.filter(
    (e) => e.tagName !== "A"
  );
}
const S_A = /* @__PURE__ */ u.forwardRef((A, e) => {
  var t;
  const { container: i = globalThis == null || (t = globalThis.document) === null || t === void 0 ? void 0 : t.body, ...n } = A;
  return i ? /* @__PURE__ */ kd.createPortal(/* @__PURE__ */ u.createElement(ii.div, be({}, n, {
    ref: e
  })), i) : null;
});
let Y_ = 0;
function Z_A() {
  u.useEffect(() => {
    var A, e;
    const t = document.querySelectorAll("[data-radix-focus-guard]");
    return document.body.insertAdjacentElement("afterbegin", (A = t[0]) !== null && A !== void 0 ? A : SbA()), document.body.insertAdjacentElement("beforeend", (e = t[1]) !== null && e !== void 0 ? e : SbA()), Y_++, () => {
      Y_ === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach(
        (i) => i.remove()
      ), Y_--;
    };
  }, []);
}
function SbA() {
  const A = document.createElement("span");
  return A.setAttribute("data-radix-focus-guard", ""), A.tabIndex = 0, A.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", A;
}
var XE = function() {
  return XE = Object.assign || function(e) {
    for (var t, i = 1, n = arguments.length; i < n; i++) {
      t = arguments[i];
      for (var o in t)
        Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
    }
    return e;
  }, XE.apply(this, arguments);
};
function A2t(A, e) {
  var t = {};
  for (var i in A)
    Object.prototype.hasOwnProperty.call(A, i) && e.indexOf(i) < 0 && (t[i] = A[i]);
  if (A != null && typeof Object.getOwnPropertySymbols == "function")
    for (var n = 0, i = Object.getOwnPropertySymbols(A); n < i.length; n++)
      e.indexOf(i[n]) < 0 && Object.prototype.propertyIsEnumerable.call(A, i[n]) && (t[i[n]] = A[i[n]]);
  return t;
}
function e2t(A, e, t) {
  if (t || arguments.length === 2)
    for (var i = 0, n = e.length, o; i < n; i++)
      (o || !(i in e)) && (o || (o = Array.prototype.slice.call(e, 0, i)), o[i] = e[i]);
  return A.concat(o || Array.prototype.slice.call(e));
}
var Gv = "right-scroll-bar-position", kv = "width-before-scroll-bar", t2t = "with-scroll-bars-hidden", i2t = "--removed-body-scroll-bar-size";
function n2t(A, e) {
  return typeof A == "function" ? A(e) : A && (A.current = e), A;
}
function o2t(A, e) {
  var t = u.useState(function() {
    return {
      // value
      value: A,
      // last callback
      callback: e,
      // "memoized" public interface
      facade: {
        get current() {
          return t.value;
        },
        set current(i) {
          var n = t.value;
          n !== i && (t.value = i, t.callback(i, n));
        }
      }
    };
  })[0];
  return t.callback = e, t.facade;
}
function g2t(A, e) {
  return o2t(e || null, function(t) {
    return A.forEach(function(i) {
      return n2t(i, t);
    });
  });
}
function s2t(A) {
  return A;
}
function I2t(A, e) {
  e === void 0 && (e = s2t);
  var t = [], i = !1, n = {
    read: function() {
      if (i)
        throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
      return t.length ? t[t.length - 1] : A;
    },
    useMedium: function(o) {
      var g = e(o, i);
      return t.push(g), function() {
        t = t.filter(function(s) {
          return s !== g;
        });
      };
    },
    assignSyncMedium: function(o) {
      for (i = !0; t.length; ) {
        var g = t;
        t = [], g.forEach(o);
      }
      t = {
        push: function(s) {
          return o(s);
        },
        filter: function() {
          return t;
        }
      };
    },
    assignMedium: function(o) {
      i = !0;
      var g = [];
      if (t.length) {
        var s = t;
        t = [], s.forEach(o), g = t;
      }
      var I = function() {
        var a = g;
        g = [], a.forEach(o);
      }, r = function() {
        return Promise.resolve().then(I);
      };
      r(), t = {
        push: function(a) {
          g.push(a), r();
        },
        filter: function(a) {
          return g = g.filter(a), t;
        }
      };
    }
  };
  return n;
}
function a2t(A) {
  A === void 0 && (A = {});
  var e = I2t(null);
  return e.options = qA({ async: !0, ssr: !1 }, A), e;
}
var W_A = function(A) {
  var e = A.sideCar, t = RsA(A, ["sideCar"]);
  if (!e)
    throw new Error("Sidecar: please provide `sideCar` property to import the right car");
  var i = e.read();
  if (!i)
    throw new Error("Sidecar medium not found");
  return u.createElement(i, qA({}, t));
};
W_A.isSideCarExport = !0;
function r2t(A, e) {
  return A.useMedium(e), W_A;
}
var K_A = a2t(), R_ = function() {
}, SX = u.forwardRef(function(A, e) {
  var t = u.useRef(null), i = u.useState({
    onScrollCapture: R_,
    onWheelCapture: R_,
    onTouchMoveCapture: R_
  }), n = i[0], o = i[1], g = A.forwardProps, s = A.children, I = A.className, r = A.removeScrollBar, a = A.enabled, C = A.shards, B = A.sideCar, l = A.noIsolation, Q = A.inert, E = A.allowPinchZoom, d = A.as, m = d === void 0 ? "div" : d, y = A2t(A, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), f = B, w = g2t([t, e]), G = XE(XE({}, y), n);
  return u.createElement(
    u.Fragment,
    null,
    a && u.createElement(f, { sideCar: K_A, removeScrollBar: r, shards: C, noIsolation: l, inert: Q, setCallbacks: o, allowPinchZoom: !!E, lockRef: t }),
    g ? u.cloneElement(u.Children.only(s), XE(XE({}, G), { ref: w })) : u.createElement(m, XE({}, G, { className: I, ref: w }), s)
  );
});
SX.defaultProps = {
  enabled: !0,
  removeScrollBar: !0,
  inert: !1
};
SX.classNames = {
  fullWidth: kv,
  zeroRight: Gv
};
var ZbA, C2t = function() {
  if (ZbA)
    return ZbA;
  if (typeof __webpack_nonce__ < "u")
    return __webpack_nonce__;
};
function B2t() {
  if (!document)
    return null;
  var A = document.createElement("style");
  A.type = "text/css";
  var e = C2t();
  return e && A.setAttribute("nonce", e), A;
}
function l2t(A, e) {
  A.styleSheet ? A.styleSheet.cssText = e : A.appendChild(document.createTextNode(e));
}
function c2t(A) {
  var e = document.head || document.getElementsByTagName("head")[0];
  e.appendChild(A);
}
var Q2t = function() {
  var A = 0, e = null;
  return {
    add: function(t) {
      A == 0 && (e = B2t()) && (l2t(e, t), c2t(e)), A++;
    },
    remove: function() {
      A--, !A && e && (e.parentNode && e.parentNode.removeChild(e), e = null);
    }
  };
}, E2t = function() {
  var A = Q2t();
  return function(e, t) {
    u.useEffect(function() {
      return A.add(e), function() {
        A.remove();
      };
    }, [e && t]);
  };
}, U_A = function() {
  var A = E2t(), e = function(t) {
    var i = t.styles, n = t.dynamic;
    return A(i, n), null;
  };
  return e;
}, u2t = {
  left: 0,
  top: 0,
  right: 0,
  gap: 0
}, F_ = function(A) {
  return parseInt(A || "", 10) || 0;
}, d2t = function(A) {
  var e = window.getComputedStyle(document.body), t = e[A === "padding" ? "paddingLeft" : "marginLeft"], i = e[A === "padding" ? "paddingTop" : "marginTop"], n = e[A === "padding" ? "paddingRight" : "marginRight"];
  return [F_(t), F_(i), F_(n)];
}, h2t = function(A) {
  if (A === void 0 && (A = "margin"), typeof window > "u")
    return u2t;
  var e = d2t(A), t = document.documentElement.clientWidth, i = window.innerWidth;
  return {
    left: e[0],
    top: e[1],
    right: e[2],
    gap: Math.max(0, i - t + e[2] - e[0])
  };
}, m2t = U_A(), p2t = function(A, e, t, i) {
  var n = A.left, o = A.top, g = A.right, s = A.gap;
  return t === void 0 && (t = "margin"), `
  .`.concat(t2t, ` {
   overflow: hidden `).concat(i, `;
   padding-right: `).concat(s, "px ").concat(i, `;
  }
  body {
    overflow: hidden `).concat(i, `;
    overscroll-behavior: contain;
    `).concat([
    e && "position: relative ".concat(i, ";"),
    t === "margin" && `
    padding-left: `.concat(n, `px;
    padding-top: `).concat(o, `px;
    padding-right: `).concat(g, `px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(s, "px ").concat(i, `;
    `),
    t === "padding" && "padding-right: ".concat(s, "px ").concat(i, ";")
  ].filter(Boolean).join(""), `
  }
  
  .`).concat(Gv, ` {
    right: `).concat(s, "px ").concat(i, `;
  }
  
  .`).concat(kv, ` {
    margin-right: `).concat(s, "px ").concat(i, `;
  }
  
  .`).concat(Gv, " .").concat(Gv, ` {
    right: 0 `).concat(i, `;
  }
  
  .`).concat(kv, " .").concat(kv, ` {
    margin-right: 0 `).concat(i, `;
  }
  
  body {
    `).concat(i2t, ": ").concat(s, `px;
  }
`);
}, y2t = function(A) {
  var e = A.noRelative, t = A.noImportant, i = A.gapMode, n = i === void 0 ? "margin" : i, o = u.useMemo(function() {
    return h2t(n);
  }, [n]);
  return u.createElement(m2t, { styles: p2t(o, !e, n, t ? "" : "!important") });
}, L6 = !1;
if (typeof window < "u")
  try {
    var iL = Object.defineProperty({}, "passive", {
      get: function() {
        return L6 = !0, !0;
      }
    });
    window.addEventListener("test", iL, iL), window.removeEventListener("test", iL, iL);
  } catch {
    L6 = !1;
  }
var My = L6 ? { passive: !1 } : !1, b2t = function(A) {
  return A.tagName === "TEXTAREA";
}, V_A = function(A, e) {
  var t = window.getComputedStyle(A);
  return (
    // not-not-scrollable
    t[e] !== "hidden" && // contains scroll inside self
    !(t.overflowY === t.overflowX && !b2t(A) && t[e] === "visible")
  );
}, w2t = function(A) {
  return V_A(A, "overflowY");
}, f2t = function(A) {
  return V_A(A, "overflowX");
}, WbA = function(A, e) {
  var t = e;
  do {
    typeof ShadowRoot < "u" && t instanceof ShadowRoot && (t = t.host);
    var i = X_A(A, t);
    if (i) {
      var n = z_A(A, t), o = n[1], g = n[2];
      if (o > g)
        return !0;
    }
    t = t.parentNode;
  } while (t && t !== document.body);
  return !1;
}, D2t = function(A) {
  var e = A.scrollTop, t = A.scrollHeight, i = A.clientHeight;
  return [
    e,
    t,
    i
  ];
}, G2t = function(A) {
  var e = A.scrollLeft, t = A.scrollWidth, i = A.clientWidth;
  return [
    e,
    t,
    i
  ];
}, X_A = function(A, e) {
  return A === "v" ? w2t(e) : f2t(e);
}, z_A = function(A, e) {
  return A === "v" ? D2t(e) : G2t(e);
}, k2t = function(A, e) {
  return A === "h" && e === "rtl" ? -1 : 1;
}, J2t = function(A, e, t, i, n) {
  var o = k2t(A, window.getComputedStyle(e).direction), g = o * i, s = t.target, I = e.contains(s), r = !1, a = g > 0, C = 0, B = 0;
  do {
    var l = z_A(A, s), Q = l[0], E = l[1], d = l[2], m = E - d - o * Q;
    (Q || m) && X_A(A, s) && (C += m, B += Q), s = s.parentNode;
  } while (
    // portaled content
    !I && s !== document.body || // self content
    I && (e.contains(s) || e === s)
  );
  return (a && (n && C === 0 || !n && g > C) || !a && (n && B === 0 || !n && -g > B)) && (r = !0), r;
}, nL = function(A) {
  return "changedTouches" in A ? [A.changedTouches[0].clientX, A.changedTouches[0].clientY] : [0, 0];
}, KbA = function(A) {
  return [A.deltaX, A.deltaY];
}, UbA = function(A) {
  return A && "current" in A ? A.current : A;
}, N2t = function(A, e) {
  return A[0] === e[0] && A[1] === e[1];
}, Y2t = function(A) {
  return `
  .block-interactivity-`.concat(A, ` {pointer-events: none;}
  .allow-interactivity-`).concat(A, ` {pointer-events: all;}
`);
}, R2t = 0, xy = [];
function F2t(A) {
  var e = u.useRef([]), t = u.useRef([0, 0]), i = u.useRef(), n = u.useState(R2t++)[0], o = u.useState(function() {
    return U_A();
  })[0], g = u.useRef(A);
  u.useEffect(function() {
    g.current = A;
  }, [A]), u.useEffect(function() {
    if (A.inert) {
      document.body.classList.add("block-interactivity-".concat(n));
      var E = e2t([A.lockRef.current], (A.shards || []).map(UbA), !0).filter(Boolean);
      return E.forEach(function(d) {
        return d.classList.add("allow-interactivity-".concat(n));
      }), function() {
        document.body.classList.remove("block-interactivity-".concat(n)), E.forEach(function(d) {
          return d.classList.remove("allow-interactivity-".concat(n));
        });
      };
    }
  }, [A.inert, A.lockRef.current, A.shards]);
  var s = u.useCallback(function(E, d) {
    if ("touches" in E && E.touches.length === 2)
      return !g.current.allowPinchZoom;
    var m = nL(E), y = t.current, f = "deltaX" in E ? E.deltaX : y[0] - m[0], w = "deltaY" in E ? E.deltaY : y[1] - m[1], G, R = E.target, F = Math.abs(f) > Math.abs(w) ? "h" : "v";
    if ("touches" in E && F === "h" && R.type === "range")
      return !1;
    var Z = WbA(F, R);
    if (!Z)
      return !0;
    if (Z ? G = F : (G = F === "v" ? "h" : "v", Z = WbA(F, R)), !Z)
      return !1;
    if (!i.current && "changedTouches" in E && (f || w) && (i.current = G), !G)
      return !0;
    var c = i.current || G;
    return J2t(c, d, E, c === "h" ? f : w, !0);
  }, []), I = u.useCallback(function(E) {
    var d = E;
    if (!(!xy.length || xy[xy.length - 1] !== o)) {
      var m = "deltaY" in d ? KbA(d) : nL(d), y = e.current.filter(function(G) {
        return G.name === d.type && G.target === d.target && N2t(G.delta, m);
      })[0];
      if (y && y.should) {
        d.cancelable && d.preventDefault();
        return;
      }
      if (!y) {
        var f = (g.current.shards || []).map(UbA).filter(Boolean).filter(function(G) {
          return G.contains(d.target);
        }), w = f.length > 0 ? s(d, f[0]) : !g.current.noIsolation;
        w && d.cancelable && d.preventDefault();
      }
    }
  }, []), r = u.useCallback(function(E, d, m, y) {
    var f = { name: E, delta: d, target: m, should: y };
    e.current.push(f), setTimeout(function() {
      e.current = e.current.filter(function(w) {
        return w !== f;
      });
    }, 1);
  }, []), a = u.useCallback(function(E) {
    t.current = nL(E), i.current = void 0;
  }, []), C = u.useCallback(function(E) {
    r(E.type, KbA(E), E.target, s(E, A.lockRef.current));
  }, []), B = u.useCallback(function(E) {
    r(E.type, nL(E), E.target, s(E, A.lockRef.current));
  }, []);
  u.useEffect(function() {
    return xy.push(o), A.setCallbacks({
      onScrollCapture: C,
      onWheelCapture: C,
      onTouchMoveCapture: B
    }), document.addEventListener("wheel", I, My), document.addEventListener("touchmove", I, My), document.addEventListener("touchstart", a, My), function() {
      xy = xy.filter(function(E) {
        return E !== o;
      }), document.removeEventListener("wheel", I, My), document.removeEventListener("touchmove", I, My), document.removeEventListener("touchstart", a, My);
    };
  }, []);
  var l = A.removeScrollBar, Q = A.inert;
  return u.createElement(
    u.Fragment,
    null,
    Q ? u.createElement(o, { styles: Y2t(n) }) : null,
    l ? u.createElement(y2t, { gapMode: "margin" }) : null
  );
}
const M2t = r2t(K_A, F2t);
var T_A = u.forwardRef(function(A, e) {
  return u.createElement(SX, XE({}, A, { ref: e, sideCar: M2t }));
});
T_A.classNames = SX.classNames;
const __A = T_A;
var x2t = function(A) {
  if (typeof document > "u")
    return null;
  var e = Array.isArray(A) ? A[0] : A;
  return e.ownerDocument.body;
}, Ly = /* @__PURE__ */ new WeakMap(), oL = /* @__PURE__ */ new WeakMap(), gL = {}, M_ = 0, q_A = function(A) {
  return A && (A.host || q_A(A.parentNode));
}, L2t = function(A, e) {
  return e.map(function(t) {
    if (A.contains(t))
      return t;
    var i = q_A(t);
    return i && A.contains(i) ? i : (console.error("aria-hidden", t, "in not contained inside", A, ". Doing nothing"), null);
  }).filter(function(t) {
    return Boolean(t);
  });
}, v2t = function(A, e, t, i) {
  var n = L2t(e, Array.isArray(A) ? A : [A]);
  gL[t] || (gL[t] = /* @__PURE__ */ new WeakMap());
  var o = gL[t], g = [], s = /* @__PURE__ */ new Set(), I = new Set(n), r = function(C) {
    !C || s.has(C) || (s.add(C), r(C.parentNode));
  };
  n.forEach(r);
  var a = function(C) {
    !C || I.has(C) || Array.prototype.forEach.call(C.children, function(B) {
      if (s.has(B))
        a(B);
      else {
        var l = B.getAttribute(i), Q = l !== null && l !== "false", E = (Ly.get(B) || 0) + 1, d = (o.get(B) || 0) + 1;
        Ly.set(B, E), o.set(B, d), g.push(B), E === 1 && Q && oL.set(B, !0), d === 1 && B.setAttribute(t, "true"), Q || B.setAttribute(i, "true");
      }
    });
  };
  return a(e), s.clear(), M_++, function() {
    g.forEach(function(C) {
      var B = Ly.get(C) - 1, l = o.get(C) - 1;
      Ly.set(C, B), o.set(C, l), B || (oL.has(C) || C.removeAttribute(i), oL.delete(C)), l || C.removeAttribute(t);
    }), M_--, M_ || (Ly = /* @__PURE__ */ new WeakMap(), Ly = /* @__PURE__ */ new WeakMap(), oL = /* @__PURE__ */ new WeakMap(), gL = {});
  };
}, O_A = function(A, e, t) {
  t === void 0 && (t = "data-aria-hidden");
  var i = Array.from(Array.isArray(A) ? A : [A]), n = e || x2t(A);
  return n ? (i.push.apply(i, Array.from(n.querySelectorAll("[aria-live]"))), v2t(i, n, t, "aria-hidden")) : function() {
    return null;
  };
};
const j_A = "Dialog", [P_A, g9t] = Ah(j_A), [H2t, Hl] = P_A(j_A), S2t = (A) => {
  const { __scopeDialog: e, children: t, open: i, defaultOpen: n, onOpenChange: o, modal: g = !0 } = A, s = u.useRef(null), I = u.useRef(null), [r = !1, a] = yQ({
    prop: i,
    defaultProp: n,
    onChange: o
  });
  return /* @__PURE__ */ u.createElement(H2t, {
    scope: e,
    triggerRef: s,
    contentRef: I,
    contentId: Km(),
    titleId: Km(),
    descriptionId: Km(),
    open: r,
    onOpenChange: a,
    onOpenToggle: u.useCallback(
      () => a(
        (C) => !C
      ),
      [
        a
      ]
    ),
    modal: g
  }, t);
}, $_A = "DialogPortal", [Z2t, A4A] = P_A($_A, {
  forceMount: void 0
}), W2t = (A) => {
  const { __scopeDialog: e, forceMount: t, children: i, container: n } = A, o = Hl($_A, e);
  return /* @__PURE__ */ u.createElement(Z2t, {
    scope: e,
    forceMount: t
  }, u.Children.map(
    i,
    (g) => /* @__PURE__ */ u.createElement(fG, {
      present: t || o.open
    }, /* @__PURE__ */ u.createElement(S_A, {
      asChild: !0,
      container: n
    }, g))
  ));
}, v6 = "DialogOverlay", K2t = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = A4A(v6, A.__scopeDialog), { forceMount: i = t.forceMount, ...n } = A, o = Hl(v6, A.__scopeDialog);
  return o.modal ? /* @__PURE__ */ u.createElement(fG, {
    present: i || o.open
  }, /* @__PURE__ */ u.createElement(U2t, be({}, n, {
    ref: e
  }))) : null;
}), U2t = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, ...i } = A, n = Hl(v6, t);
  return (
    // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
    // ie. when `Overlay` and `Content` are siblings
    /* @__PURE__ */ u.createElement(__A, {
      as: vp,
      allowPinchZoom: !0,
      shards: [
        n.contentRef
      ]
    }, /* @__PURE__ */ u.createElement(ii.div, be({
      "data-state": t4A(n.open)
    }, i, {
      ref: e,
      style: {
        pointerEvents: "auto",
        ...i.style
      }
    })))
  );
}), T2 = "DialogContent", V2t = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = A4A(T2, A.__scopeDialog), { forceMount: i = t.forceMount, ...n } = A, o = Hl(T2, A.__scopeDialog);
  return /* @__PURE__ */ u.createElement(fG, {
    present: i || o.open
  }, o.modal ? /* @__PURE__ */ u.createElement(X2t, be({}, n, {
    ref: e
  })) : /* @__PURE__ */ u.createElement(z2t, be({}, n, {
    ref: e
  })));
}), X2t = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = Hl(T2, A.__scopeDialog), i = u.useRef(null), n = On(e, t.contentRef, i);
  return u.useEffect(() => {
    const o = i.current;
    if (o)
      return O_A(o);
  }, []), /* @__PURE__ */ u.createElement(e4A, be({}, A, {
    ref: n,
    trapFocus: t.open,
    disableOutsidePointerEvents: !0,
    onCloseAutoFocus: qt(A.onCloseAutoFocus, (o) => {
      var g;
      o.preventDefault(), (g = t.triggerRef.current) === null || g === void 0 || g.focus();
    }),
    onPointerDownOutside: qt(A.onPointerDownOutside, (o) => {
      const g = o.detail.originalEvent, s = g.button === 0 && g.ctrlKey === !0;
      (g.button === 2 || s) && o.preventDefault();
    }),
    onFocusOutside: qt(
      A.onFocusOutside,
      (o) => o.preventDefault()
    )
  }));
}), z2t = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = Hl(T2, A.__scopeDialog), i = u.useRef(!1), n = u.useRef(!1);
  return /* @__PURE__ */ u.createElement(e4A, be({}, A, {
    ref: e,
    trapFocus: !1,
    disableOutsidePointerEvents: !1,
    onCloseAutoFocus: (o) => {
      var g;
      if ((g = A.onCloseAutoFocus) === null || g === void 0 || g.call(A, o), !o.defaultPrevented) {
        var s;
        i.current || (s = t.triggerRef.current) === null || s === void 0 || s.focus(), o.preventDefault();
      }
      i.current = !1, n.current = !1;
    },
    onInteractOutside: (o) => {
      var g, s;
      (g = A.onInteractOutside) === null || g === void 0 || g.call(A, o), o.defaultPrevented || (i.current = !0, o.detail.originalEvent.type === "pointerdown" && (n.current = !0));
      const I = o.target;
      ((s = t.triggerRef.current) === null || s === void 0 ? void 0 : s.contains(I)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && n.current && o.preventDefault();
    }
  }));
}), e4A = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, trapFocus: i, onOpenAutoFocus: n, onCloseAutoFocus: o, ...g } = A, s = Hl(T2, t), I = u.useRef(null), r = On(e, I);
  return Z_A(), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(v_A, {
    asChild: !0,
    loop: !0,
    trapped: i,
    onMountAutoFocus: n,
    onUnmountAutoFocus: o
  }, /* @__PURE__ */ u.createElement(x_A, be({
    role: "dialog",
    id: s.contentId,
    "aria-describedby": s.descriptionId,
    "aria-labelledby": s.titleId,
    "data-state": t4A(s.open)
  }, g, {
    ref: r,
    onDismiss: () => s.onOpenChange(!1)
  }))), !1);
}), T2t = "DialogTitle", _2t = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, ...i } = A, n = Hl(T2t, t);
  return /* @__PURE__ */ u.createElement(ii.h2, be({
    id: n.titleId
  }, i, {
    ref: e
  }));
}), q2t = "DialogDescription", O2t = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, ...i } = A, n = Hl(q2t, t);
  return /* @__PURE__ */ u.createElement(ii.p, be({
    id: n.descriptionId
  }, i, {
    ref: e
  }));
}), j2t = "DialogClose", P2t = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeDialog: t, ...i } = A, n = Hl(j2t, t);
  return /* @__PURE__ */ u.createElement(ii.button, be({
    type: "button"
  }, i, {
    ref: e,
    onClick: qt(
      A.onClick,
      () => n.onOpenChange(!1)
    )
  }));
});
function t4A(A) {
  return A ? "open" : "closed";
}
const $2t = S2t, ARt = W2t, i4A = K2t, n4A = V2t, o4A = _2t, g4A = O2t, eRt = P2t;
function Sl(A, e) {
  if (A == null)
    return {};
  var t = {}, i = Object.keys(A), n, o;
  for (o = 0; o < i.length; o++)
    n = i[o], !(e.indexOf(n) >= 0) && (t[n] = A[n]);
  return t;
}
var tRt = ["color"], iRt = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, tRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), nRt = ["color"], s4A = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, nRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), oRt = ["color"], gRt = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, oRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), sRt = ["color"], IRt = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, sRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), aRt = ["color"], rRt = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, aRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), CRt = ["color"], BRt = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, CRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), lRt = ["color"], cRt = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, lRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), QRt = ["color"], ERt = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, QRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M1 3.25C1 3.11193 1.11193 3 1.25 3H13.75C13.8881 3 14 3.11193 14 3.25V10.75C14 10.8881 13.8881 11 13.75 11H1.25C1.11193 11 1 10.8881 1 10.75V3.25ZM1.25 2C0.559643 2 0 2.55964 0 3.25V10.75C0 11.4404 0.559644 12 1.25 12H5.07341L4.82991 13.2986C4.76645 13.6371 5.02612 13.95 5.37049 13.95H9.62951C9.97389 13.95 10.2336 13.6371 10.1701 13.2986L9.92659 12H13.75C14.4404 12 15 11.4404 15 10.75V3.25C15 2.55964 14.4404 2 13.75 2H1.25ZM9.01091 12H5.98909L5.79222 13.05H9.20778L9.01091 12Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), uRt = ["color"], dRt = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, uRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M2.89998 0.499976C2.89998 0.279062 2.72089 0.0999756 2.49998 0.0999756C2.27906 0.0999756 2.09998 0.279062 2.09998 0.499976V1.09998H1.49998C1.27906 1.09998 1.09998 1.27906 1.09998 1.49998C1.09998 1.72089 1.27906 1.89998 1.49998 1.89998H2.09998V2.49998C2.09998 2.72089 2.27906 2.89998 2.49998 2.89998C2.72089 2.89998 2.89998 2.72089 2.89998 2.49998V1.89998H3.49998C3.72089 1.89998 3.89998 1.72089 3.89998 1.49998C3.89998 1.27906 3.72089 1.09998 3.49998 1.09998H2.89998V0.499976ZM5.89998 3.49998C5.89998 3.27906 5.72089 3.09998 5.49998 3.09998C5.27906 3.09998 5.09998 3.27906 5.09998 3.49998V4.09998H4.49998C4.27906 4.09998 4.09998 4.27906 4.09998 4.49998C4.09998 4.72089 4.27906 4.89998 4.49998 4.89998H5.09998V5.49998C5.09998 5.72089 5.27906 5.89998 5.49998 5.89998C5.72089 5.89998 5.89998 5.72089 5.89998 5.49998V4.89998H6.49998C6.72089 4.89998 6.89998 4.72089 6.89998 4.49998C6.89998 4.27906 6.72089 4.09998 6.49998 4.09998H5.89998V3.49998ZM1.89998 6.49998C1.89998 6.27906 1.72089 6.09998 1.49998 6.09998C1.27906 6.09998 1.09998 6.27906 1.09998 6.49998V7.09998H0.499976C0.279062 7.09998 0.0999756 7.27906 0.0999756 7.49998C0.0999756 7.72089 0.279062 7.89998 0.499976 7.89998H1.09998V8.49998C1.09998 8.72089 1.27906 8.89997 1.49998 8.89997C1.72089 8.89997 1.89998 8.72089 1.89998 8.49998V7.89998H2.49998C2.72089 7.89998 2.89998 7.72089 2.89998 7.49998C2.89998 7.27906 2.72089 7.09998 2.49998 7.09998H1.89998V6.49998ZM8.54406 0.98184L8.24618 0.941586C8.03275 0.917676 7.90692 1.1655 8.02936 1.34194C8.17013 1.54479 8.29981 1.75592 8.41754 1.97445C8.91878 2.90485 9.20322 3.96932 9.20322 5.10022C9.20322 8.37201 6.82247 11.0878 3.69887 11.6097C3.45736 11.65 3.20988 11.6772 2.96008 11.6906C2.74563 11.702 2.62729 11.9535 2.77721 12.1072C2.84551 12.1773 2.91535 12.2458 2.98667 12.3128L3.05883 12.3795L3.31883 12.6045L3.50684 12.7532L3.62796 12.8433L3.81491 12.9742L3.99079 13.089C4.11175 13.1651 4.23536 13.2375 4.36157 13.3059L4.62496 13.4412L4.88553 13.5607L5.18837 13.6828L5.43169 13.7686C5.56564 13.8128 5.70149 13.8529 5.83857 13.8885C5.94262 13.9155 6.04767 13.9401 6.15405 13.9622C6.27993 13.9883 6.40713 14.0109 6.53544 14.0298L6.85241 14.0685L7.11934 14.0892C7.24637 14.0965 7.37436 14.1002 7.50322 14.1002C11.1483 14.1002 14.1032 11.1453 14.1032 7.50023C14.1032 7.25044 14.0893 7.00389 14.0623 6.76131L14.0255 6.48407C13.991 6.26083 13.9453 6.04129 13.8891 5.82642C13.8213 5.56709 13.7382 5.31398 13.6409 5.06881L13.5279 4.80132L13.4507 4.63542L13.3766 4.48666C13.2178 4.17773 13.0353 3.88295 12.8312 3.60423L12.6782 3.40352L12.4793 3.16432L12.3157 2.98361L12.1961 2.85951L12.0355 2.70246L11.8134 2.50184L11.4925 2.24191L11.2483 2.06498L10.9562 1.87446L10.6346 1.68894L10.3073 1.52378L10.1938 1.47176L9.95488 1.3706L9.67791 1.2669L9.42566 1.1846L9.10075 1.09489L8.83599 1.03486L8.54406 0.98184ZM10.4032 5.30023C10.4032 4.27588 10.2002 3.29829 9.83244 2.40604C11.7623 3.28995 13.1032 5.23862 13.1032 7.50023C13.1032 10.593 10.596 13.1002 7.50322 13.1002C6.63646 13.1002 5.81597 12.9036 5.08355 12.5522C6.5419 12.0941 7.81081 11.2082 8.74322 10.0416C8.87963 10.2284 9.10028 10.3497 9.34928 10.3497C9.76349 10.3497 10.0993 10.0139 10.0993 9.59971C10.0993 9.24256 9.84965 8.94373 9.51535 8.86816C9.57741 8.75165 9.63653 8.63334 9.6926 8.51332C9.88358 8.63163 10.1088 8.69993 10.35 8.69993C11.0403 8.69993 11.6 8.14028 11.6 7.44993C11.6 6.75976 11.0406 6.20024 10.3505 6.19993C10.3853 5.90487 10.4032 5.60464 10.4032 5.30023Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
}), hRt = ["color"], mRt = /* @__PURE__ */ u.forwardRef(function(A, e) {
  var t = A.color, i = t === void 0 ? "currentColor" : t, n = Sl(A, hRt);
  return u.createElement("svg", Object.assign({
    width: "15",
    height: "15",
    viewBox: "0 0 15 15",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, n, {
    ref: e
  }), u.createElement("path", {
    d: "M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",
    fill: i,
    fillRule: "evenodd",
    clipRule: "evenodd"
  }));
});
const ZX = $2t, pRt = ARt, I4A = u.forwardRef(({ className: A, ...e }, t) => pA(i4A, { ref: t, className: dn("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", A), ...e }));
I4A.displayName = i4A.displayName;
const oD = u.forwardRef(({ className: A, children: e, hideClose: t, ...i }, n) => ue(pRt, { container: u.useContext(BIA), children: [pA(I4A, {}), ue(n4A, { ref: n, className: dn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", A), ...i, children: [e, !t && ue(eRt, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [pA(cRt, { className: "h-4 w-4" }), pA("span", { className: "sr-only", children: "Close" })] })] })] }));
oD.displayName = n4A.displayName;
const _2 = ({ className: A, ...e }) => pA("div", { className: dn("flex flex-col space-y-1.5 text-center sm:text-left", A), ...e });
_2.displayName = "DialogHeader";
const q2 = u.forwardRef(({ className: A, ...e }, t) => pA(o4A, { ref: t, className: dn("text-lg font-semibold leading-none tracking-tight text-muted-foreground", A), ...e }));
q2.displayName = o4A.displayName;
const WX = u.forwardRef(({ className: A, ...e }, t) => pA(g4A, { ref: t, className: dn("text-sm text-muted-foreground", A), ...e }));
WX.displayName = g4A.displayName;
function SW(A, e, t) {
  e.split && (e = e.split("."));
  for (var i = 0, n = e.length, o = A, g, s; i < n && (s = e[i++], !(s === "__proto__" || s === "constructor" || s === "prototype")); )
    o = o[s] = i === n ? t : typeof (g = o[s]) == typeof e ? g : e[i] * 0 !== 0 || ~("" + e[i]).indexOf(".") ? {} : [];
}
const yRt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  dset: SW
}, Symbol.toStringTag, { value: "Module" }));
var bRt = function(A, e) {
  return Object.keys(A).filter(function(t) {
    return e(t, A[t]);
  }).reduce(function(t, i) {
    return t[i] = A[i], t;
  }, {});
}, Sp = (
  /** @class */
  function(A) {
    la(e, A);
    function e(t, i) {
      var n = A.call(this, "".concat(t, " ").concat(i)) || this;
      return n.field = t, n;
    }
    return e;
  }(Error)
);
function N0(A) {
  return typeof A == "string";
}
function H6(A) {
  return typeof A == "number";
}
function Jw(A) {
  return typeof A == "function";
}
function wRt(A) {
  return A != null;
}
function Hs(A) {
  return Object.prototype.toString.call(A).slice(8, -1).toLowerCase() === "object";
}
var lIA = "is not a string", cIA = "is not an object", fRt = "is nil";
function DRt(A) {
  if (!wRt(A))
    throw new Sp("Event", fRt);
  if (typeof A != "object")
    throw new Sp("Event", cIA);
}
function GRt(A) {
  if (!N0(A.type))
    throw new Sp(".type", lIA);
}
function kRt(A) {
  if (!N0(A.event))
    throw new Sp(".event", lIA);
}
function JRt(A) {
  if (!Hs(A.properties))
    throw new Sp(".properties", cIA);
}
function NRt(A) {
  if (!Hs(A.traits))
    throw new Sp(".traits", cIA);
}
function YRt(A) {
  if (!N0(A.messageId))
    throw new Sp(".messageId", lIA);
}
function RRt(A) {
  DRt(A), GRt(A), YRt(A), A.type === "track" && (kRt(A), JRt(A)), ["group", "identify"].includes(A.type) && NRt(A);
}
var FRt = (
  /** @class */
  function() {
    function A(e) {
      var t, i;
      this.settings = e, this.createMessageId = e.createMessageId, this.onEventMethodCall = (t = e.onEventMethodCall) !== null && t !== void 0 ? t : function() {
      }, this.onFinishedEvent = (i = e.onFinishedEvent) !== null && i !== void 0 ? i : function() {
      };
    }
    return A;
  }()
), MRt = (
  /** @class */
  function() {
    function A(e) {
      this.settings = new FRt(e);
    }
    return A.prototype.track = function(e, t, i, n) {
      return this.settings.onEventMethodCall({ type: "track", options: i }), this.normalize(qA(qA({}, this.baseEvent()), { event: e, type: "track", properties: t ?? {}, options: qA({}, i), integrations: qA({}, n) }));
    }, A.prototype.page = function(e, t, i, n, o) {
      var g;
      this.settings.onEventMethodCall({ type: "page", options: n });
      var s = {
        type: "page",
        properties: qA({}, i),
        options: qA({}, n),
        integrations: qA({}, o)
      };
      return e !== null && (s.category = e, s.properties = (g = s.properties) !== null && g !== void 0 ? g : {}, s.properties.category = e), t !== null && (s.name = t), this.normalize(qA(qA({}, this.baseEvent()), s));
    }, A.prototype.screen = function(e, t, i, n, o) {
      this.settings.onEventMethodCall({ type: "screen", options: n });
      var g = {
        type: "screen",
        properties: qA({}, i),
        options: qA({}, n),
        integrations: qA({}, o)
      };
      return e !== null && (g.category = e), t !== null && (g.name = t), this.normalize(qA(qA({}, this.baseEvent()), g));
    }, A.prototype.identify = function(e, t, i, n) {
      return this.settings.onEventMethodCall({ type: "identify", options: i }), this.normalize(qA(qA({}, this.baseEvent()), { type: "identify", userId: e, traits: t ?? {}, options: qA({}, i), integrations: n }));
    }, A.prototype.group = function(e, t, i, n) {
      return this.settings.onEventMethodCall({ type: "group", options: i }), this.normalize(qA(qA({}, this.baseEvent()), {
        type: "group",
        traits: t ?? {},
        options: qA({}, i),
        integrations: qA({}, n),
        //
        groupId: e
      }));
    }, A.prototype.alias = function(e, t, i, n) {
      this.settings.onEventMethodCall({ type: "alias", options: i });
      var o = {
        userId: e,
        type: "alias",
        options: qA({}, i),
        integrations: qA({}, n)
      };
      return t !== null && (o.previousId = t), e === void 0 ? this.normalize(qA(qA({}, o), this.baseEvent())) : this.normalize(qA(qA({}, this.baseEvent()), o));
    }, A.prototype.baseEvent = function() {
      return {
        integrations: {},
        options: {}
      };
    }, A.prototype.context = function(e) {
      var t, i = [
        "userId",
        "anonymousId",
        "timestamp",
        "messageId"
      ];
      delete e.integrations;
      var n = Object.keys(e), o = (t = e.context) !== null && t !== void 0 ? t : {}, g = {};
      return n.forEach(function(s) {
        s !== "context" && (i.includes(s) ? SW(g, s, e[s]) : SW(o, s, e[s]));
      }), [o, g];
    }, A.prototype.normalize = function(e) {
      var t, i, n = Object.keys((t = e.integrations) !== null && t !== void 0 ? t : {}).reduce(function(B, l) {
        var Q, E;
        return qA(qA({}, B), (Q = {}, Q[l] = Boolean((E = e.integrations) === null || E === void 0 ? void 0 : E[l]), Q));
      }, {});
      e.options = bRt(e.options || {}, function(B, l) {
        return l !== void 0;
      });
      var o = qA(qA({}, n), (i = e.options) === null || i === void 0 ? void 0 : i.integrations), g = e.options ? this.context(e.options) : [], s = g[0], I = g[1], r = e.options, a = RsA(e, ["options"]), C = qA(qA(qA(qA({ timestamp: new Date() }, a), { context: s, integrations: o }), I), { messageId: r.messageId || this.settings.createMessageId() });
      return this.settings.onFinishedEvent(C), RRt(C), C;
    }, A;
  }()
);
function QIA(A, e) {
  return new Promise(function(t, i) {
    var n = setTimeout(function() {
      i(Error("Promise timed out"));
    }, e);
    A.then(function(o) {
      return clearTimeout(n), t(o);
    }).catch(i);
  });
}
function xRt(A) {
  return new Promise(function(e) {
    return setTimeout(e, A);
  });
}
function LRt(A, e, t) {
  var i = function() {
    try {
      return Promise.resolve(e(A));
    } catch (n) {
      return Promise.reject(n);
    }
  };
  return xRt(t).then(function() {
    return QIA(i(), 1e3);
  }).catch(function(n) {
    A == null || A.log("warn", "Callback Error", { error: n }), A == null || A.stats.increment("callback_error");
  }).then(function() {
    return A;
  });
}
var EIA = function() {
  var A, e, t = !1, i = new Promise(function(n, o) {
    A = function() {
      for (var g = [], s = 0; s < arguments.length; s++)
        g[s] = arguments[s];
      t = !0, n.apply(void 0, g);
    }, e = function() {
      for (var g = [], s = 0; s < arguments.length; s++)
        g[s] = arguments[s];
      t = !0, o.apply(void 0, g);
    };
  });
  return {
    resolve: A,
    reject: e,
    promise: i,
    isSettled: function() {
      return t;
    }
  };
}, uIA = (
  /** @class */
  function() {
    function A(e) {
      var t;
      this.callbacks = {}, this.warned = !1, this.maxListeners = (t = e == null ? void 0 : e.maxListeners) !== null && t !== void 0 ? t : 10;
    }
    return A.prototype.warnIfPossibleMemoryLeak = function(e) {
      this.warned || this.maxListeners && this.callbacks[e].length > this.maxListeners && (console.warn("Event Emitter: Possible memory leak detected; ".concat(String(e), " has exceeded ").concat(this.maxListeners, " listeners.")), this.warned = !0);
    }, A.prototype.on = function(e, t) {
      return this.callbacks[e] ? (this.callbacks[e].push(t), this.warnIfPossibleMemoryLeak(e)) : this.callbacks[e] = [t], this;
    }, A.prototype.once = function(e, t) {
      var i = this, n = function() {
        for (var o = [], g = 0; g < arguments.length; g++)
          o[g] = arguments[g];
        i.off(e, n), t.apply(i, o);
      };
      return this.on(e, n), this;
    }, A.prototype.off = function(e, t) {
      var i, n = (i = this.callbacks[e]) !== null && i !== void 0 ? i : [], o = n.filter(function(g) {
        return g !== t;
      });
      return this.callbacks[e] = o, this;
    }, A.prototype.emit = function(e) {
      for (var t = this, i, n = [], o = 1; o < arguments.length; o++)
        n[o - 1] = arguments[o];
      var g = (i = this.callbacks[e]) !== null && i !== void 0 ? i : [];
      return g.forEach(function(s) {
        s.apply(t, n);
      }), this;
    }, A;
  }()
);
function vRt(A) {
  var e = Math.random() + 1, t = A.minTimeout, i = t === void 0 ? 500 : t, n = A.factor, o = n === void 0 ? 2 : n, g = A.attempt, s = A.maxTimeout, I = s === void 0 ? 1 / 0 : s;
  return Math.min(e * i * Math.pow(o, g), I);
}
var a4A = "onRemoveFromFuture", KX = (
  /** @class */
  function(A) {
    la(e, A);
    function e(t, i, n) {
      var o = A.call(this) || this;
      return o.future = [], o.maxAttempts = t, o.queue = i, o.seen = n ?? {}, o;
    }
    return e.prototype.push = function() {
      for (var t = this, i = [], n = 0; n < arguments.length; n++)
        i[n] = arguments[n];
      var o = i.map(function(g) {
        var s = t.updateAttempts(g);
        return s > t.maxAttempts || t.includes(g) ? !1 : (t.queue.push(g), !0);
      });
      return this.queue = this.queue.sort(function(g, s) {
        return t.getAttempts(g) - t.getAttempts(s);
      }), o;
    }, e.prototype.pushWithBackoff = function(t) {
      var i = this;
      if (this.getAttempts(t) === 0)
        return this.push(t)[0];
      var n = this.updateAttempts(t);
      if (n > this.maxAttempts || this.includes(t))
        return !1;
      var o = vRt({ attempt: n - 1 });
      return setTimeout(function() {
        i.queue.push(t), i.future = i.future.filter(function(g) {
          return g.id !== t.id;
        }), i.emit(a4A);
      }, o), this.future.push(t), !0;
    }, e.prototype.getAttempts = function(t) {
      var i;
      return (i = this.seen[t.id]) !== null && i !== void 0 ? i : 0;
    }, e.prototype.updateAttempts = function(t) {
      return this.seen[t.id] = this.getAttempts(t) + 1, this.getAttempts(t);
    }, e.prototype.includes = function(t) {
      return this.queue.includes(t) || this.future.includes(t) || Boolean(this.queue.find(function(i) {
        return i.id === t.id;
      })) || Boolean(this.future.find(function(i) {
        return i.id === t.id;
      }));
    }, e.prototype.pop = function() {
      return this.queue.shift();
    }, Object.defineProperty(e.prototype, "length", {
      get: function() {
        return this.queue.length;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e.prototype, "todo", {
      get: function() {
        return this.queue.length + this.future.length;
      },
      enumerable: !1,
      configurable: !0
    }), e;
  }(uIA)
), wm = 256, Jv = [], sL;
for (; wm--; )
  Jv[wm] = (wm + 256).toString(16).substring(1);
function dIA() {
  var A = 0, e, t = "";
  if (!sL || wm + 16 > 256) {
    for (sL = Array(A = 256); A--; )
      sL[A] = 256 * Math.random() | 0;
    A = wm = 0;
  }
  for (; A < 16; A++)
    e = sL[wm + A], A == 6 ? t += Jv[e & 15 | 64] : A == 8 ? t += Jv[e & 63 | 128] : t += Jv[e], A & 1 && A > 1 && A < 11 && (t += "-");
  return wm++, t;
}
var HRt = (
  /** @class */
  function() {
    function A() {
      this._logs = [];
    }
    return A.prototype.log = function(e, t, i) {
      var n = new Date();
      this._logs.push({
        level: e,
        message: t,
        time: n,
        extras: i
      });
    }, Object.defineProperty(A.prototype, "logs", {
      get: function() {
        return this._logs;
      },
      enumerable: !1,
      configurable: !0
    }), A.prototype.flush = function() {
      if (this.logs.length > 1) {
        var e = this._logs.reduce(function(t, i) {
          var n, o, g, s = qA(qA({}, i), { json: JSON.stringify(i.extras, null, " "), extras: i.extras });
          delete s.time;
          var I = (g = (o = i.time) === null || o === void 0 ? void 0 : o.toISOString()) !== null && g !== void 0 ? g : "";
          return t[I] && (I = "".concat(I, "-").concat(Math.random())), qA(qA({}, t), (n = {}, n[I] = s, n));
        }, {});
        console.table ? console.table(e) : console.log(e);
      } else
        this.logs.forEach(function(t) {
          var i = t.level, n = t.message, o = t.extras;
          i === "info" || i === "debug" ? console.log(n, o ?? "") : console[i](n, o ?? "");
        });
      this._logs = [];
    }, A;
  }()
), SRt = function(A) {
  var e = {
    gauge: "g",
    counter: "c"
  };
  return e[A];
}, r4A = (
  /** @class */
  function() {
    function A() {
      this.metrics = [];
    }
    return A.prototype.increment = function(e, t, i) {
      t === void 0 && (t = 1), this.metrics.push({
        metric: e,
        value: t,
        tags: i ?? [],
        type: "counter",
        timestamp: Date.now()
      });
    }, A.prototype.gauge = function(e, t, i) {
      this.metrics.push({
        metric: e,
        value: t,
        tags: i ?? [],
        type: "gauge",
        timestamp: Date.now()
      });
    }, A.prototype.flush = function() {
      var e = this.metrics.map(function(t) {
        return qA(qA({}, t), { tags: t.tags.join(",") });
      });
      console.table ? console.table(e) : console.log(e), this.metrics = [];
    }, A.prototype.serialize = function() {
      return this.metrics.map(function(e) {
        return {
          m: e.metric,
          v: e.value,
          t: e.tags,
          k: SRt(e.type),
          e: e.timestamp
        };
      });
    }, A;
  }()
), ZRt = (
  /** @class */
  function(A) {
    la(e, A);
    function e() {
      return A !== null && A.apply(this, arguments) || this;
    }
    return e.prototype.gauge = function() {
    }, e.prototype.increment = function() {
    }, e.prototype.flush = function() {
    }, e.prototype.serialize = function() {
      return [];
    }, e;
  }(r4A)
), hd = (
  /** @class */
  function() {
    function A(e) {
      var t, i, n;
      this.retry = (t = e.retry) !== null && t !== void 0 ? t : !0, this.type = (i = e.type) !== null && i !== void 0 ? i : "plugin Error", this.reason = (n = e.reason) !== null && n !== void 0 ? n : "";
    }
    return A;
  }()
), ZW = (
  /** @class */
  function() {
    function A(e, t, i, n) {
      t === void 0 && (t = dIA()), i === void 0 && (i = new ZRt()), n === void 0 && (n = new HRt()), this.attempts = 0, this.event = e, this._id = t, this.logger = n, this.stats = i;
    }
    return A.system = function() {
    }, A.prototype.isSame = function(e) {
      return e.id === this.id;
    }, A.prototype.cancel = function(e) {
      throw e || new hd({ reason: "Context Cancel" });
    }, A.prototype.log = function(e, t, i) {
      this.logger.log(e, t, i);
    }, Object.defineProperty(A.prototype, "id", {
      get: function() {
        return this._id;
      },
      enumerable: !1,
      configurable: !0
    }), A.prototype.updateEvent = function(e, t) {
      var i;
      if (e.split(".")[0] === "integrations") {
        var n = e.split(".")[1];
        if (((i = this.event.integrations) === null || i === void 0 ? void 0 : i[n]) === !1)
          return this.event;
      }
      return SW(this.event, e, t), this.event;
    }, A.prototype.failedDelivery = function() {
      return this._failedDelivery;
    }, A.prototype.setFailedDelivery = function(e) {
      this._failedDelivery = e;
    }, A.prototype.logs = function() {
      return this.logger.logs;
    }, A.prototype.flush = function() {
      this.logger.flush(), this.stats.flush();
    }, A.prototype.toJSON = function() {
      return {
        id: this._id,
        event: this.event,
        logs: this.logger.logs,
        metrics: this.stats.metrics
      };
    }, A;
  }()
);
function WRt(A, e) {
  var t = {};
  return A.forEach(function(i) {
    var n, o = void 0;
    if (typeof e == "string") {
      var g = i[e];
      o = typeof g != "string" ? JSON.stringify(g) : g;
    } else
      e instanceof Function && (o = e(i));
    o !== void 0 && (t[o] = zn(zn([], (n = t[o]) !== null && n !== void 0 ? n : [], !0), [i], !1));
  }), t;
}
var KRt = function(A) {
  return typeof A == "object" && A !== null && "then" in A && typeof A.then == "function";
}, URt = function() {
  var A, e, t = 0;
  return {
    done: function() {
      return A;
    },
    run: function(i) {
      var n = i();
      return KRt(n) && (++t === 1 && (A = new Promise(function(o) {
        return e = o;
      })), n.finally(function() {
        return --t === 0 && e();
      })), n;
    }
  };
};
function VRt(A) {
  return UA(this, void 0, void 0, function() {
    var e;
    return Ee(this, function(t) {
      switch (t.label) {
        case 0:
          return t.trys.push([0, 2, , 3]), [4, A()];
        case 1:
          return [2, t.sent()];
        case 2:
          return e = t.sent(), [2, Promise.reject(e)];
        case 3:
          return [
            2
            /*return*/
          ];
      }
    });
  });
}
function Nw(A, e) {
  A.log("debug", "plugin", { plugin: e.name });
  var t = new Date().getTime(), i = e[A.event.type];
  if (i === void 0)
    return Promise.resolve(A);
  var n = VRt(function() {
    return i.apply(e, [A]);
  }).then(function(o) {
    var g = new Date().getTime() - t;
    return o.stats.gauge("plugin_time", g, ["plugin:".concat(e.name)]), o;
  }).catch(function(o) {
    if (o instanceof hd && o.type === "middleware_cancellation")
      throw o;
    return o instanceof hd ? (A.log("warn", o.type, {
      plugin: e.name,
      error: o
    }), o) : (A.log("error", "plugin Error", {
      plugin: e.name,
      error: o
    }), A.stats.increment("plugin_error", 1, ["plugin:".concat(e.name)]), o);
  });
  return n;
}
function XRt(A, e) {
  return Nw(A, e).then(function(t) {
    if (t instanceof ZW)
      return t;
    A.log("debug", "Context canceled"), A.stats.increment("context_canceled"), A.cancel(t);
  });
}
var zRt = (
  /** @class */
  function(A) {
    la(e, A);
    function e(t) {
      var i = A.call(this) || this;
      return i.criticalTasks = URt(), i.plugins = [], i.failedInitializations = [], i.flushing = !1, i.queue = t, i.queue.on(a4A, function() {
        i.scheduleFlush(0);
      }), i;
    }
    return e.prototype.register = function(t, i, n) {
      return UA(this, void 0, void 0, function() {
        var o, g, s = this;
        return Ee(this, function(I) {
          switch (I.label) {
            case 0:
              return this.plugins.push(i), o = function(r) {
                s.failedInitializations.push(i.name), s.emit("initialization_failure", i), console.warn(i.name, r), t.log("warn", "Failed to load destination", {
                  plugin: i.name,
                  error: r
                }), s.plugins = s.plugins.filter(function(a) {
                  return a !== i;
                });
              }, i.type === "destination" && i.name !== "Segment.io" ? (i.load(t, n).catch(o), [3, 4]) : [3, 1];
            case 1:
              return I.trys.push([1, 3, , 4]), [4, i.load(t, n)];
            case 2:
              return I.sent(), [3, 4];
            case 3:
              return g = I.sent(), o(g), [3, 4];
            case 4:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, e.prototype.deregister = function(t, i, n) {
      return UA(this, void 0, void 0, function() {
        var o;
        return Ee(this, function(g) {
          switch (g.label) {
            case 0:
              return g.trys.push([0, 3, , 4]), i.unload ? [4, Promise.resolve(i.unload(t, n))] : [3, 2];
            case 1:
              g.sent(), g.label = 2;
            case 2:
              return this.plugins = this.plugins.filter(function(s) {
                return s.name !== i.name;
              }), [3, 4];
            case 3:
              return o = g.sent(), t.log("warn", "Failed to unload destination", {
                plugin: i.name,
                error: o
              }), [3, 4];
            case 4:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, e.prototype.dispatch = function(t) {
      return UA(this, void 0, void 0, function() {
        var i;
        return Ee(this, function(n) {
          return t.log("debug", "Dispatching"), t.stats.increment("message_dispatched"), this.queue.push(t), i = this.subscribeToDelivery(t), this.scheduleFlush(0), [2, i];
        });
      });
    }, e.prototype.subscribeToDelivery = function(t) {
      return UA(this, void 0, void 0, function() {
        var i = this;
        return Ee(this, function(n) {
          return [2, new Promise(function(o) {
            var g = function(s, I) {
              s.isSame(t) && (i.off("flush", g), o(s));
            };
            i.on("flush", g);
          })];
        });
      });
    }, e.prototype.dispatchSingle = function(t) {
      return UA(this, void 0, void 0, function() {
        var i = this;
        return Ee(this, function(n) {
          return t.log("debug", "Dispatching"), t.stats.increment("message_dispatched"), this.queue.updateAttempts(t), t.attempts = 1, [2, this.deliver(t).catch(function(o) {
            var g = i.enqueuRetry(o, t);
            return g ? i.subscribeToDelivery(t) : (t.setFailedDelivery({ reason: o }), t);
          })];
        });
      });
    }, e.prototype.isEmpty = function() {
      return this.queue.length === 0;
    }, e.prototype.scheduleFlush = function(t) {
      var i = this;
      t === void 0 && (t = 500), !this.flushing && (this.flushing = !0, setTimeout(function() {
        i.flush().then(function() {
          setTimeout(function() {
            i.flushing = !1, i.queue.length && i.scheduleFlush(0);
          }, 0);
        });
      }, t));
    }, e.prototype.deliver = function(t) {
      return UA(this, void 0, void 0, function() {
        var i, n, o, g;
        return Ee(this, function(s) {
          switch (s.label) {
            case 0:
              return [4, this.criticalTasks.done()];
            case 1:
              s.sent(), i = Date.now(), s.label = 2;
            case 2:
              return s.trys.push([2, 4, , 5]), [4, this.flushOne(t)];
            case 3:
              return t = s.sent(), n = Date.now() - i, this.emit("delivery_success", t), t.stats.gauge("delivered", n), t.log("debug", "Delivered", t.event), [2, t];
            case 4:
              throw o = s.sent(), g = o, t.log("error", "Failed to deliver", g), this.emit("delivery_failure", t, g), t.stats.increment("delivery_failed"), o;
            case 5:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, e.prototype.enqueuRetry = function(t, i) {
      var n = !(t instanceof hd) || t.retry;
      return n ? this.queue.pushWithBackoff(i) : !1;
    }, e.prototype.flush = function() {
      return UA(this, void 0, void 0, function() {
        var t, i, n;
        return Ee(this, function(o) {
          switch (o.label) {
            case 0:
              if (this.queue.length === 0)
                return [2, []];
              if (t = this.queue.pop(), !t)
                return [2, []];
              t.attempts = this.queue.getAttempts(t), o.label = 1;
            case 1:
              return o.trys.push([1, 3, , 4]), [4, this.deliver(t)];
            case 2:
              return t = o.sent(), this.emit("flush", t, !0), [3, 4];
            case 3:
              return i = o.sent(), n = this.enqueuRetry(i, t), n || (t.setFailedDelivery({ reason: i }), this.emit("flush", t, !1)), [2, []];
            case 4:
              return [2, [t]];
          }
        });
      });
    }, e.prototype.isReady = function() {
      return !0;
    }, e.prototype.availableExtensions = function(t) {
      var i = this.plugins.filter(function(l) {
        var Q, E, d;
        if (l.type !== "destination" && l.name !== "Segment.io")
          return !0;
        var m = void 0;
        return (Q = l.alternativeNames) === null || Q === void 0 || Q.forEach(function(y) {
          t[y] !== void 0 && (m = t[y]);
        }), (d = (E = t[l.name]) !== null && E !== void 0 ? E : m) !== null && d !== void 0 ? d : (l.name === "Segment.io" ? !0 : t.All) !== !1;
      }), n = WRt(i, "type"), o = n.before, g = o === void 0 ? [] : o, s = n.enrichment, I = s === void 0 ? [] : s, r = n.destination, a = r === void 0 ? [] : r, C = n.after, B = C === void 0 ? [] : C;
      return {
        before: g,
        enrichment: I,
        destinations: a,
        after: B
      };
    }, e.prototype.flushOne = function(t) {
      var i, n;
      return UA(this, void 0, void 0, function() {
        var o, g, s, I, r, a, Q, C, B, l, Q, E, d, m, y;
        return Ee(this, function(f) {
          switch (f.label) {
            case 0:
              if (!this.isReady())
                throw new Error("Not ready");
              t.attempts > 1 && this.emit("delivery_retry", t), o = this.availableExtensions((i = t.event.integrations) !== null && i !== void 0 ? i : {}), g = o.before, s = o.enrichment, I = 0, r = g, f.label = 1;
            case 1:
              return I < r.length ? (a = r[I], [4, XRt(t, a)]) : [3, 4];
            case 2:
              Q = f.sent(), Q instanceof ZW && (t = Q), this.emit("message_enriched", t, a), f.label = 3;
            case 3:
              return I++, [3, 1];
            case 4:
              C = 0, B = s, f.label = 5;
            case 5:
              return C < B.length ? (l = B[C], [4, Nw(t, l)]) : [3, 8];
            case 6:
              Q = f.sent(), Q instanceof ZW && (t = Q), this.emit("message_enriched", t, l), f.label = 7;
            case 7:
              return C++, [3, 5];
            case 8:
              return E = this.availableExtensions((n = t.event.integrations) !== null && n !== void 0 ? n : {}), d = E.destinations, m = E.after, [4, new Promise(function(w, G) {
                setTimeout(function() {
                  var R = d.map(function(F) {
                    return Nw(t, F);
                  });
                  Promise.all(R).then(w).catch(G);
                }, 0);
              })];
            case 9:
              return f.sent(), t.stats.increment("message_delivered"), this.emit("message_delivered", t), y = m.map(function(w) {
                return Nw(t, w);
              }), [4, Promise.all(y)];
            case 10:
              return f.sent(), [2, t];
          }
        });
      });
    }, e;
  }(uIA)
), TRt = function(A, e) {
  var t = Date.now() - A;
  return Math.max((e ?? 300) - t, 0);
};
function _Rt(A, e, t, i) {
  return UA(this, void 0, void 0, function() {
    var n, o;
    return Ee(this, function(g) {
      switch (g.label) {
        case 0:
          return t.emit("dispatch_start", A), n = Date.now(), e.isEmpty() ? [4, e.dispatchSingle(A)] : [3, 2];
        case 1:
          return o = g.sent(), [3, 4];
        case 2:
          return [4, e.dispatch(A)];
        case 3:
          o = g.sent(), g.label = 4;
        case 4:
          return i != null && i.callback ? [4, LRt(o, i.callback, TRt(n, i.timeout))] : [3, 6];
        case 5:
          o = g.sent(), g.label = 6;
        case 6:
          return i != null && i.debug && o.flush(), [2, o];
      }
    });
  });
}
function qRt(A, e, t, i) {
  var n, o = [A, e, t, i], g = Hs(A) ? A.event : A;
  if (!g || !N0(g))
    throw new Error("Event missing");
  var s = Hs(A) ? (n = A.properties) !== null && n !== void 0 ? n : {} : Hs(e) ? e : {}, I = {};
  Jw(t) || (I = t ?? {}), Hs(A) && !Jw(e) && (I = e ?? {});
  var r = o.find(Jw);
  return [g, s, I, r];
}
function VbA(A, e, t, i, n) {
  var o, g, s = null, I = null, r = [A, e, t, i, n], a = r.filter(N0);
  a[0] !== void 0 && a[1] !== void 0 && (s = a[0], I = a[1]), a.length === 1 && (s = null, I = a[0]);
  var C = r.find(Jw), B = r.filter(function(E) {
    return I === null ? Hs(E) : Hs(E) || E === null;
  }), l = (o = B[0]) !== null && o !== void 0 ? o : {}, Q = (g = B[1]) !== null && g !== void 0 ? g : {};
  return [
    s,
    I,
    l,
    Q,
    C
  ];
}
var XbA = function(A) {
  return function() {
    for (var e, t, i, n = [], o = 0; o < arguments.length; o++)
      n[o] = arguments[o];
    for (var g = {}, s = [
      "callback",
      "options",
      "traits",
      "id"
    ], I = 0, r = n; I < r.length; I++) {
      var a = r[I], C = s.pop();
      if (C === "id") {
        if (N0(a) || H6(a)) {
          g.id = a.toString();
          continue;
        }
        if (a == null)
          continue;
        C = s.pop();
      }
      if ((C === "traits" || C === "options") && (a == null || Hs(a)) && (g[C] = a), Jw(a)) {
        g.callback = a;
        break;
      }
    }
    return [
      (e = g.id) !== null && e !== void 0 ? e : A.id(),
      (t = g.traits) !== null && t !== void 0 ? t : {},
      (i = g.options) !== null && i !== void 0 ? i : {},
      g.callback
    ];
  };
};
function ORt(A, e, t, i) {
  H6(A) && (A = A.toString()), H6(e) && (e = e.toString());
  var n = [A, e, t, i], o = n.filter(N0), g = o[0], s = g === void 0 ? A : g, I = o[1], r = I === void 0 ? null : I, a = n.filter(Hs)[0], C = a === void 0 ? {} : a, B = n.find(Jw);
  return [s, r, C, B];
}
function hIA() {
  return typeof window < "u";
}
function C4A() {
  return !hIA();
}
function B4A() {
  return hIA() ? window.navigator.onLine : !0;
}
function md() {
  return !B4A();
}
function jRt(A, e) {
  return e = e || {}, new Promise(function(t, i) {
    var n = new XMLHttpRequest(), o = [], g = [], s = {}, I = function() {
      return { ok: (n.status / 100 | 0) == 2, statusText: n.statusText, status: n.status, url: n.responseURL, text: function() {
        return Promise.resolve(n.responseText);
      }, json: function() {
        return Promise.resolve(n.responseText).then(JSON.parse);
      }, blob: function() {
        return Promise.resolve(new Blob([n.response]));
      }, clone: I, headers: { keys: function() {
        return o;
      }, entries: function() {
        return g;
      }, get: function(a) {
        return s[a.toLowerCase()];
      }, has: function(a) {
        return a.toLowerCase() in s;
      } } };
    };
    for (var r in n.open(e.method || "get", A, !0), n.onload = function() {
      n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(a, C, B) {
        o.push(C = C.toLowerCase()), g.push([C, B]), s[C] = s[C] ? s[C] + "," + B : B;
      }), t(I());
    }, n.onerror = i, n.withCredentials = e.credentials == "include", e.headers)
      n.setRequestHeader(r, e.headers[r]);
    n.send(e.body || null);
  });
}
var mIA = function() {
  return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : null;
}, UX = function() {
  for (var A = [], e = 0; e < arguments.length; e++)
    A[e] = arguments[e];
  var t = mIA();
  return (t && t.fetch || jRt).apply(void 0, A);
}, O2 = "1.69.0", PRt = "npm";
function l4A() {
  return PRt;
}
var c4A = "api.segment.io/v1", $Rt = function(A, e, t) {
  var i = e.reduce(function(n, o) {
    var g = o.split(":"), s = g[0], I = g[1];
    return n[s] = I, n;
  }, {});
  return {
    type: "Counter",
    metric: A,
    value: 1,
    tags: qA(qA({}, i), { library: "analytics.js", library_version: t === "web" ? "next-".concat(O2) : "npm:next-".concat(O2) })
  };
};
function x_(A) {
  console.error("Error sending segment performance metrics", A);
}
var AFt = (
  /** @class */
  function() {
    function A(e) {
      var t = this, i, n, o, g, s;
      if (this.host = (i = e == null ? void 0 : e.host) !== null && i !== void 0 ? i : c4A, this.sampleRate = (n = e == null ? void 0 : e.sampleRate) !== null && n !== void 0 ? n : 1, this.flushTimer = (o = e == null ? void 0 : e.flushTimer) !== null && o !== void 0 ? o : 30 * 1e3, this.maxQueueSize = (g = e == null ? void 0 : e.maxQueueSize) !== null && g !== void 0 ? g : 20, this.protocol = (s = e == null ? void 0 : e.protocol) !== null && s !== void 0 ? s : "https", this.queue = [], this.sampleRate > 0) {
        var I = !1, r = function() {
          I || (I = !0, t.flush().catch(x_), I = !1, setTimeout(r, t.flushTimer));
        };
        r();
      }
    }
    return A.prototype.increment = function(e, t) {
      if (e.includes("analytics_js.") && t.length !== 0 && !(Math.random() > this.sampleRate) && !(this.queue.length >= this.maxQueueSize)) {
        var i = $Rt(e, t, l4A());
        this.queue.push(i), e.includes("error") && this.flush().catch(x_);
      }
    }, A.prototype.flush = function() {
      return UA(this, void 0, void 0, function() {
        var e = this;
        return Ee(this, function(t) {
          switch (t.label) {
            case 0:
              return this.queue.length <= 0 ? [
                2
                /*return*/
              ] : [4, this.send().catch(function(i) {
                x_(i), e.sampleRate = 0;
              })];
            case 1:
              return t.sent(), [
                2
                /*return*/
              ];
          }
        });
      });
    }, A.prototype.send = function() {
      return UA(this, void 0, void 0, function() {
        var e, t, i;
        return Ee(this, function(n) {
          return e = { series: this.queue }, this.queue = [], t = { "Content-Type": "text/plain" }, i = "".concat(this.protocol, "://").concat(this.host, "/m"), [2, UX(i, {
            headers: t,
            body: JSON.stringify(e),
            method: "POST"
          })];
        });
      });
    }, A;
  }()
), IL, Q4A = (
  /** @class */
  function(A) {
    la(e, A);
    function e() {
      return A !== null && A.apply(this, arguments) || this;
    }
    return e.initRemoteMetrics = function(t) {
      IL = new AFt(t);
    }, e.prototype.increment = function(t, i, n) {
      A.prototype.increment.call(this, t, i, n), IL == null || IL.increment(t, n ?? []);
    }, e;
  }(r4A)
), iQ = (
  /** @class */
  function(A) {
    la(e, A);
    function e(t, i) {
      return A.call(this, t, i, new Q4A()) || this;
    }
    return e.system = function() {
      return new this({ type: "track", event: "system" });
    }, e;
  }(ZW)
), E4A = "bpc", u4A = function(A, e, t, i, n, o) {
  return {
    __t: E4A,
    c: e,
    p: i,
    u: A,
    s: t,
    t: n,
    r: o
  };
}, eFt = Object.keys(u4A("", "", "", "", "", ""));
function tFt(A) {
  if (!Hs(A) || A.__t !== E4A)
    return !1;
  for (var e in A)
    if (!eFt.includes(e))
      return !1;
  return !0;
}
var iFt = function(A, e) {
  return A.indexOf("?") > -1 ? A : A + e;
}, nFt = function(A) {
  var e = A.indexOf("#");
  return e === -1 ? A : A.slice(0, e);
}, oFt = function(A) {
  try {
    return new URL(A).pathname;
  } catch {
    return A[0] === "/" ? A : "/" + A;
  }
}, d4A = function(A) {
  var e = A.c, t = A.p, i = A.s, n = A.u, o = A.r, g = A.t, s = e ? oFt(e) : t, I = e ? iFt(e, i) : nFt(n);
  return {
    path: s,
    referrer: o,
    search: i,
    title: g,
    url: I
  };
}, h4A = function() {
  var A = document.querySelector("link[rel='canonical']");
  return u4A(location.href, A && A.getAttribute("href") || void 0, location.search, location.pathname, document.title, document.referrer);
}, gFt = function() {
  return d4A(h4A());
};
function sFt(A, e) {
  return Object.assign.apply(Object, zn([{}], e.map(function(t) {
    var i;
    if (A && Object.prototype.hasOwnProperty.call(A, t))
      return i = {}, i[t] = A[t], i;
  }), !1));
}
var vy = function(A, e) {
  e === void 0 && (e = gFt());
  var t = A.context, i;
  A.type === "page" && (i = A.properties && sFt(A.properties, Object.keys(e)), A.properties = qA(qA(qA({}, e), A.properties), A.name ? { name: A.name } : {})), t.page = qA(qA(qA({}, e), i), t.page);
}, IFt = (
  /** @class */
  function(A) {
    la(e, A);
    function e(t) {
      var i = A.call(this, {
        createMessageId: function() {
          return "ajs-next-".concat(Date.now(), "-").concat(dIA());
        },
        onEventMethodCall: function(n) {
          var o = n.options;
          i.maybeUpdateAnonId(o);
        },
        onFinishedEvent: function(n) {
          return i.addIdentity(n), n;
        }
      }) || this;
      return i.user = t, i;
    }
    return e.prototype.maybeUpdateAnonId = function(t) {
      t != null && t.anonymousId && this.user.anonymousId(t.anonymousId);
    }, e.prototype.addIdentity = function(t) {
      this.user.id() && (t.userId = this.user.id()), this.user.anonymousId() && (t.anonymousId = this.user.anonymousId());
    }, e.prototype.track = function(t, i, n, o, g) {
      var s = A.prototype.track.call(this, t, i, n, o);
      return vy(s, g), s;
    }, e.prototype.page = function(t, i, n, o, g, s) {
      var I = A.prototype.page.call(this, t, i, n, o, g);
      return vy(I, s), I;
    }, e.prototype.screen = function(t, i, n, o, g, s) {
      var I = A.prototype.screen.call(this, t, i, n, o, g);
      return vy(I, s), I;
    }, e.prototype.identify = function(t, i, n, o, g) {
      var s = A.prototype.identify.call(this, t, i, n, o);
      return vy(s, g), s;
    }, e.prototype.group = function(t, i, n, o, g) {
      var s = A.prototype.group.call(this, t, i, n, o);
      return vy(s, g), s;
    }, e.prototype.alias = function(t, i, n, o, g) {
      var s = A.prototype.alias.call(this, t, i, n, o);
      return vy(s, g), s;
    }, e;
  }(MRt)
), aFt = function(A) {
  return "addMiddleware" in A && A.type === "destination";
}, Al = {
  getItem: function() {
  },
  setItem: function() {
  },
  removeItem: function() {
  }
};
try {
  Al = hIA() && window.localStorage ? window.localStorage : Al;
} catch (A) {
  console.warn("Unable to access localStorage", A);
}
function m4A(A) {
  var e = Al.getItem(A);
  return (e ? JSON.parse(e) : []).map(function(t) {
    return new iQ(t.event, t.id);
  });
}
function rFt(A, e) {
  var t = m4A(A), i = zn(zn([], e, !0), t, !0), n = i.reduce(function(o, g) {
    var s;
    return qA(qA({}, o), (s = {}, s[g.id] = g, s));
  }, {});
  Al.setItem(A, JSON.stringify(Object.values(n)));
}
function p4A(A) {
  var e = Al.getItem(A);
  return e ? JSON.parse(e) : {};
}
function CFt(A, e) {
  var t = p4A(A);
  Al.setItem(A, JSON.stringify(qA(qA({}, t), e)));
}
function zbA(A) {
  Al.removeItem(A);
}
var BFt = function() {
  return new Date().getTime();
};
function S6(A, e, t) {
  t === void 0 && (t = 0);
  var i = 50, n = "persisted-queue:v1:".concat(A, ":lock"), o = function(r) {
    return new Date().getTime() > r;
  }, g = Al.getItem(n), s = g ? JSON.parse(g) : null, I = s === null || o(s);
  if (I) {
    Al.setItem(n, JSON.stringify(BFt() + i)), e(), Al.removeItem(n);
    return;
  }
  !I && t < 3 ? setTimeout(function() {
    S6(A, e, t + 1);
  }, i) : console.error("Unable to retrieve lock");
}
var VX = (
  /** @class */
  function(A) {
    la(e, A);
    function e(t, i) {
      var n = A.call(this, t, []) || this, o = "persisted-queue:v1:".concat(i, ":items"), g = "persisted-queue:v1:".concat(i, ":seen"), s = [], I = {};
      return S6(i, function() {
        try {
          s = m4A(o), I = p4A(g), zbA(o), zbA(g), n.queue = zn(zn([], s, !0), n.queue, !0), n.seen = qA(qA({}, I), n.seen);
        } catch (r) {
          console.error(r);
        }
      }), window.addEventListener("pagehide", function() {
        if (n.todo > 0) {
          var r = zn(zn([], n.queue, !0), n.future, !0);
          try {
            S6(i, function() {
              rFt(o, r), CFt(g, n.seen);
            });
          } catch (a) {
            console.error(a);
          }
        }
      }), n;
    }
    return e;
  }(KX)
), lFt = (
  /** @class */
  function(A) {
    la(e, A);
    function e(t) {
      return A.call(this, typeof t == "string" ? new VX(4, t) : t) || this;
    }
    return e.prototype.flush = function() {
      return UA(this, void 0, void 0, function() {
        return Ee(this, function(t) {
          return md() ? [2, []] : [2, A.prototype.flush.call(this)];
        });
      });
    }, e;
  }(zRt)
);
function pIA(A) {
  for (var e = A.constructor.prototype, t = 0, i = Object.getOwnPropertyNames(e); t < i.length; t++) {
    var n = i[t];
    if (n !== "constructor") {
      var o = Object.getOwnPropertyDescriptor(A.constructor.prototype, n);
      o && typeof o.value == "function" && (A[n] = A[n].bind(A));
    }
  }
  return A;
}
/*! js-cookie v3.0.1 | MIT */
function aL(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e];
    for (var i in t)
      A[i] = t[i];
  }
  return A;
}
var cFt = {
  read: function(A) {
    return A[0] === '"' && (A = A.slice(1, -1)), A.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
  },
  write: function(A) {
    return encodeURIComponent(A).replace(
      /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
      decodeURIComponent
    );
  }
};
function Z6(A, e) {
  function t(n, o, g) {
    if (!(typeof document > "u")) {
      g = aL({}, e, g), typeof g.expires == "number" && (g.expires = new Date(Date.now() + g.expires * 864e5)), g.expires && (g.expires = g.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
      var s = "";
      for (var I in g)
        g[I] && (s += "; " + I, g[I] !== !0 && (s += "=" + g[I].split(";")[0]));
      return document.cookie = n + "=" + A.write(o, n) + s;
    }
  }
  function i(n) {
    if (!(typeof document > "u" || arguments.length && !n)) {
      for (var o = document.cookie ? document.cookie.split("; ") : [], g = {}, s = 0; s < o.length; s++) {
        var I = o[s].split("="), r = I.slice(1).join("=");
        try {
          var a = decodeURIComponent(I[0]);
          if (g[a] = A.read(r, a), n === a)
            break;
        } catch {
        }
      }
      return n ? g[n] : g;
    }
  }
  return Object.create(
    {
      set: t,
      get: i,
      remove: function(n, o) {
        t(
          n,
          "",
          aL({}, o, {
            expires: -1
          })
        );
      },
      withAttributes: function(n) {
        return Z6(this.converter, aL({}, this.attributes, n));
      },
      withConverter: function(n) {
        return Z6(aL({}, this.converter, n), this.attributes);
      }
    },
    {
      attributes: { value: Object.freeze(e) },
      converter: { value: Object.freeze(A) }
    }
  );
}
var Jc = Z6(cFt, { path: "/" });
function QFt(A) {
  var e = A.hostname, t = e.split("."), i = t[t.length - 1], n = [];
  if (t.length === 4 && parseInt(i, 10) > 0 || t.length <= 1)
    return n;
  for (var o = t.length - 2; o >= 0; --o)
    n.push(t.slice(o).join("."));
  return n;
}
function EFt(A) {
  try {
    return new URL(A);
  } catch {
    return;
  }
}
function y4A(A) {
  var e = EFt(A);
  if (e)
    for (var t = QFt(e), i = 0; i < t.length; ++i) {
      var n = "__tld__", o = t[i], g = { domain: "." + o };
      try {
        if (Jc.set(n, "1", g), Jc.get(n))
          return Jc.remove(n, g), o;
      } catch {
        return;
      }
    }
}
var uFt = 365, b4A = (
  /** @class */
  function() {
    function A(e) {
      e === void 0 && (e = A.defaults), this.options = qA(qA({}, A.defaults), e);
    }
    return Object.defineProperty(A, "defaults", {
      get: function() {
        return {
          maxage: uFt,
          domain: y4A(window.location.href),
          path: "/",
          sameSite: "Lax"
        };
      },
      enumerable: !1,
      configurable: !0
    }), A.prototype.opts = function() {
      return {
        sameSite: this.options.sameSite,
        expires: this.options.maxage,
        domain: this.options.domain,
        path: this.options.path,
        secure: this.options.secure
      };
    }, A.prototype.get = function(e) {
      var t;
      try {
        var i = Jc.get(e);
        if (i == null)
          return null;
        try {
          return (t = JSON.parse(i)) !== null && t !== void 0 ? t : null;
        } catch {
          return i ?? null;
        }
      } catch {
        return null;
      }
    }, A.prototype.set = function(e, t) {
      typeof t == "string" ? Jc.set(e, t, this.opts()) : t === null ? Jc.remove(e, this.opts()) : Jc.set(e, JSON.stringify(t), this.opts());
    }, A.prototype.remove = function(e) {
      return Jc.remove(e, this.opts());
    }, A;
  }()
), dFt = (
  /** @class */
  function() {
    function A() {
    }
    return A.prototype.localStorageWarning = function(e, t) {
      console.warn("Unable to access ".concat(e, ", localStorage may be ").concat(t));
    }, A.prototype.get = function(e) {
      var t;
      try {
        var i = localStorage.getItem(e);
        if (i === null)
          return null;
        try {
          return (t = JSON.parse(i)) !== null && t !== void 0 ? t : null;
        } catch {
          return i ?? null;
        }
      } catch {
        return this.localStorageWarning(e, "unavailable"), null;
      }
    }, A.prototype.set = function(e, t) {
      try {
        localStorage.setItem(e, JSON.stringify(t));
      } catch {
        this.localStorageWarning(e, "full");
      }
    }, A.prototype.remove = function(e) {
      try {
        return localStorage.removeItem(e);
      } catch {
        this.localStorageWarning(e, "unavailable");
      }
    }, A;
  }()
), yIA = (
  /** @class */
  function() {
    function A() {
      this.cache = {};
    }
    return A.prototype.get = function(e) {
      var t;
      return (t = this.cache[e]) !== null && t !== void 0 ? t : null;
    }, A.prototype.set = function(e, t) {
      this.cache[e] = t;
    }, A.prototype.remove = function(e) {
      delete this.cache[e];
    }, A;
  }()
), Ms = {
  Cookie: "cookie",
  LocalStorage: "localStorage",
  Memory: "memory"
};
function w4A(A) {
  return A && A.stores && Array.isArray(A.stores) && A.stores.every(function(e) {
    return Object.values(Ms).includes(e);
  });
}
function hFt(A) {
  return typeof A == "object" && A.name !== void 0;
}
var L_ = function(A, e, t, i) {
  console.warn("".concat(A.constructor.name, ": Can't ").concat(e, ' key "').concat(t, '" | Err: ').concat(i));
}, Xm = (
  /** @class */
  function() {
    function A(e) {
      this.stores = e;
    }
    return A.prototype.get = function(e) {
      for (var t = null, i = 0, n = this.stores; i < n.length; i++) {
        var o = n[i];
        try {
          if (t = o.get(e), t != null)
            return t;
        } catch (g) {
          L_(o, "get", e, g);
        }
      }
      return null;
    }, A.prototype.set = function(e, t) {
      this.stores.forEach(function(i) {
        try {
          i.set(e, t);
        } catch (n) {
          L_(i, "set", e, n);
        }
      });
    }, A.prototype.clear = function(e) {
      this.stores.forEach(function(t) {
        try {
          t.remove(e);
        } catch (i) {
          L_(t, "remove", e, i);
        }
      });
    }, A.prototype.getAndSync = function(e) {
      var t = this.get(e), i = typeof t == "number" ? t.toString() : t;
      return this.set(e, i), i;
    }, A;
  }()
);
function W6(A) {
  var e = A.map(function(t) {
    var i, n;
    switch (hFt(t) ? (i = t.name, n = t.settings) : i = t, i) {
      case Ms.Cookie:
        return new b4A(n);
      case Ms.LocalStorage:
        return new dFt();
      case Ms.Memory:
        return new yIA();
      default:
        throw new Error("Unknown Store Type: ".concat(t));
    }
  });
  return e;
}
function f4A(A, e) {
  return A.map(function(t) {
    return e && t === Ms.Cookie ? {
      name: t,
      settings: e
    } : t;
  });
}
var Hh = {
  persist: !0,
  cookie: {
    key: "ajs_user_id",
    oldKey: "ajs_user"
  },
  localStorage: {
    key: "ajs_user_traits"
  }
}, D4A = (
  /** @class */
  function() {
    function A(e, t) {
      e === void 0 && (e = Hh);
      var i = this, n, o, g, s;
      this.options = {}, this.id = function(r) {
        if (i.options.disable)
          return null;
        var a = i.identityStore.getAndSync(i.idKey);
        if (r !== void 0) {
          i.identityStore.set(i.idKey, r);
          var C = r !== a && a !== null && r !== null;
          C && i.anonymousId(null);
        }
        var B = i.identityStore.getAndSync(i.idKey);
        if (B)
          return B;
        var l = i.legacyUserStore.get(Hh.cookie.oldKey);
        return l ? typeof l == "object" ? l.id : l : null;
      }, this.anonymousId = function(r) {
        var a, C;
        if (i.options.disable)
          return null;
        if (r === void 0) {
          var B = (a = i.identityStore.getAndSync(i.anonKey)) !== null && a !== void 0 ? a : (C = i.legacySIO()) === null || C === void 0 ? void 0 : C[0];
          if (B)
            return B;
        }
        return r === null ? (i.identityStore.set(i.anonKey, null), i.identityStore.getAndSync(i.anonKey)) : (i.identityStore.set(i.anonKey, r ?? dIA()), i.identityStore.getAndSync(i.anonKey));
      }, this.traits = function(r) {
        var a;
        if (!i.options.disable)
          return r === null && (r = {}), r && i.traitsStore.set(i.traitsKey, r ?? {}), (a = i.traitsStore.get(i.traitsKey)) !== null && a !== void 0 ? a : {};
      }, this.options = qA(qA({}, Hh), e), this.cookieOptions = t, this.idKey = (o = (n = e.cookie) === null || n === void 0 ? void 0 : n.key) !== null && o !== void 0 ? o : Hh.cookie.key, this.traitsKey = (s = (g = e.localStorage) === null || g === void 0 ? void 0 : g.key) !== null && s !== void 0 ? s : Hh.localStorage.key, this.anonKey = "ajs_anonymous_id", this.identityStore = this.createStorage(this.options, t), this.legacyUserStore = this.createStorage(this.options, t, function(r) {
        return r === Ms.Cookie;
      }), this.traitsStore = this.createStorage(this.options, t, function(r) {
        return r !== Ms.Cookie;
      });
      var I = this.legacyUserStore.get(Hh.cookie.oldKey);
      I && typeof I == "object" && (I.id && this.id(I.id), I.traits && this.traits(I.traits)), pIA(this);
    }
    return A.prototype.legacySIO = function() {
      var e = this.legacyUserStore.get("_sio");
      if (!e)
        return null;
      var t = e.split("----"), i = t[0], n = t[1];
      return [i, n];
    }, A.prototype.identify = function(e, t) {
      if (!this.options.disable) {
        t = t ?? {};
        var i = this.id();
        (i === null || i === e) && (t = qA(qA({}, this.traits()), t)), e && this.id(e), this.traits(t);
      }
    }, A.prototype.logout = function() {
      this.anonymousId(null), this.id(null), this.traits({});
    }, A.prototype.reset = function() {
      this.logout(), this.identityStore.clear(this.idKey), this.identityStore.clear(this.anonKey), this.traitsStore.clear(this.traitsKey);
    }, A.prototype.load = function() {
      return new A(this.options, this.cookieOptions);
    }, A.prototype.save = function() {
      return !0;
    }, A.prototype.createStorage = function(e, t, i) {
      var n = [
        Ms.LocalStorage,
        Ms.Cookie,
        Ms.Memory
      ];
      return e.disable ? new Xm([]) : e.persist ? (e.storage !== void 0 && e.storage !== null && w4A(e.storage) && (n = e.storage.stores), e.localStorageFallbackDisabled && (n = n.filter(function(o) {
        return o !== Ms.LocalStorage;
      })), i && (n = n.filter(i)), new Xm(W6(f4A(n, t)))) : new Xm([new yIA()]);
    }, A.defaults = Hh, A;
  }()
), TbA = {
  persist: !0,
  cookie: {
    key: "ajs_group_id"
  },
  localStorage: {
    key: "ajs_group_properties"
  }
}, mFt = (
  /** @class */
  function(A) {
    la(e, A);
    function e(t, i) {
      t === void 0 && (t = TbA);
      var n = A.call(this, qA(qA({}, TbA), t), i) || this;
      return n.anonymousId = function(o) {
      }, pIA(n), n;
    }
    return e;
  }(D4A)
), bIA = "analytics";
function wIA() {
  return window[bIA];
}
function pFt(A) {
  bIA = A;
}
function yFt(A) {
  window[bIA] = A;
}
var bFt = function(A) {
  return typeof A == "object" && A !== null && "then" in A && typeof A.then == "function";
}, G4A = function(A, e, t) {
  t.getCalls(A).forEach(function(i) {
    fIA(e, i).catch(console.error);
  });
}, wFt = function(A, e) {
  return UA(void 0, void 0, void 0, function() {
    var t, i, n;
    return Ee(this, function(o) {
      switch (o.label) {
        case 0:
          t = 0, i = e.getCalls("addSourceMiddleware"), o.label = 1;
        case 1:
          return t < i.length ? (n = i[t], [4, fIA(A, n).catch(console.error)]) : [3, 4];
        case 2:
          o.sent(), o.label = 3;
        case 3:
          return t++, [3, 1];
        case 4:
          return [
            2
            /*return*/
          ];
      }
    });
  });
}, fFt = G4A.bind(globalThis, "on"), DFt = G4A.bind(globalThis, "setAnonymousId"), GFt = function(A, e) {
  e.toArray().forEach(function(t) {
    setTimeout(function() {
      fIA(A, t).catch(console.error);
    }, 0);
  });
}, Hy = function(A) {
  if (k4A(A)) {
    var e = A.pop();
    return d4A(e);
  }
}, k4A = function(A) {
  var e = A[A.length - 1];
  return tFt(e);
}, WW = (
  /** @class */
  function() {
    function A(e, t, i, n) {
      i === void 0 && (i = function() {
      }), n === void 0 && (n = console.error), this.method = e, this.resolve = i, this.reject = n, this.called = !1, this.args = t;
    }
    return A;
  }()
), kFt = (
  /** @class */
  function() {
    function A() {
      for (var e = [], t = 0; t < arguments.length; t++)
        e[t] = arguments[t];
      this._callMap = {}, this.push.apply(this, e);
    }
    return Object.defineProperty(A.prototype, "calls", {
      /**
       * Pull any buffered method calls from the window object, and use them to hydrate the instance buffer.
       */
      get: function() {
        return this._pushSnippetWindowBuffer(), this._callMap;
      },
      set: function(e) {
        this._callMap = e;
      },
      enumerable: !1,
      configurable: !0
    }), A.prototype.getCalls = function(e) {
      var t;
      return (t = this.calls[e]) !== null && t !== void 0 ? t : [];
    }, A.prototype.push = function() {
      for (var e = this, t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      t.forEach(function(n) {
        var o = [
          "track",
          "screen",
          "alias",
          "group",
          "page",
          "identify"
        ];
        o.includes(n.method) && !k4A(n.args) && (n.args = zn(zn([], n.args, !0), [h4A()], !1)), e.calls[n.method] ? e.calls[n.method].push(n) : e.calls[n.method] = [n];
      });
    }, A.prototype.clear = function() {
      this._pushSnippetWindowBuffer(), this.calls = {};
    }, A.prototype.toArray = function() {
      var e;
      return (e = []).concat.apply(e, Object.values(this.calls));
    }, A.prototype._pushSnippetWindowBuffer = function() {
      var e = wIA();
      if (Array.isArray(e)) {
        var t = e.splice(0, e.length), i = t.map(function(n) {
          var o = n[0], g = n.slice(1);
          return new WW(o, g);
        });
        this.push.apply(this, i);
      }
    }, A;
  }()
);
function fIA(A, e) {
  return UA(this, void 0, void 0, function() {
    var t, i;
    return Ee(this, function(n) {
      switch (n.label) {
        case 0:
          return n.trys.push([0, 3, , 4]), e.called ? [2, void 0] : (e.called = !0, t = A[e.method].apply(A, e.args), bFt(t) ? [4, t] : [3, 2]);
        case 1:
          n.sent(), n.label = 2;
        case 2:
          return e.resolve(t), [3, 4];
        case 3:
          return i = n.sent(), e.reject(i), [3, 4];
        case 4:
          return [
            2
            /*return*/
          ];
      }
    });
  });
}
var JFt = (
  /** @class */
  function() {
    function A(e) {
      var t = this;
      this.trackSubmit = this._createMethod("trackSubmit"), this.trackClick = this._createMethod("trackClick"), this.trackLink = this._createMethod("trackLink"), this.pageView = this._createMethod("pageview"), this.identify = this._createMethod("identify"), this.reset = this._createMethod("reset"), this.group = this._createMethod("group"), this.track = this._createMethod("track"), this.ready = this._createMethod("ready"), this.alias = this._createMethod("alias"), this.debug = this._createChainableMethod("debug"), this.page = this._createMethod("page"), this.once = this._createChainableMethod("once"), this.off = this._createChainableMethod("off"), this.on = this._createChainableMethod("on"), this.addSourceMiddleware = this._createMethod("addSourceMiddleware"), this.setAnonymousId = this._createMethod("setAnonymousId"), this.addDestinationMiddleware = this._createMethod("addDestinationMiddleware"), this.screen = this._createMethod("screen"), this.register = this._createMethod("register"), this.deregister = this._createMethod("deregister"), this.user = this._createMethod("user"), this.VERSION = O2, this._preInitBuffer = new kFt(), this._promise = e(this._preInitBuffer), this._promise.then(function(i) {
        var n = i[0], o = i[1];
        t.instance = n, t.ctx = o;
      }).catch(function() {
      });
    }
    return A.prototype.then = function() {
      for (var e, t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return (e = this._promise).then.apply(e, t);
    }, A.prototype.catch = function() {
      for (var e, t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return (e = this._promise).catch.apply(e, t);
    }, A.prototype.finally = function() {
      for (var e, t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return (e = this._promise).finally.apply(e, t);
    }, A.prototype._createMethod = function(e) {
      var t = this;
      return function() {
        for (var i, n = [], o = 0; o < arguments.length; o++)
          n[o] = arguments[o];
        if (t.instance) {
          var g = (i = t.instance)[e].apply(i, n);
          return Promise.resolve(g);
        }
        return new Promise(function(s, I) {
          t._preInitBuffer.push(new WW(e, n, s, I));
        });
      };
    }, A.prototype._createChainableMethod = function(e) {
      var t = this;
      return function() {
        for (var i, n = [], o = 0; o < arguments.length; o++)
          n[o] = arguments[o];
        return t.instance ? ((i = t.instance)[e].apply(i, n), t) : (t._preInitBuffer.push(new WW(e, n)), t);
      };
    }, A;
  }()
), JE = "This is being deprecated and will be not be available in future releases of Analytics JS", v_ = mIA(), H_ = v_ == null ? void 0 : v_.analytics;
function NFt(A, e, t) {
  e === void 0 && (e = !1), t === void 0 && (t = !1);
  var i = e ? 10 : 1, n = t ? new KX(i, []) : new VX(i, A);
  return new lFt(n);
}
function $C() {
  console.warn(JE);
}
var J4A = (
  /** @class */
  function(A) {
    la(e, A);
    function e(t, i, n, o, g) {
      var s = this, I, r, a;
      s = A.call(this) || this, s._debug = !1, s.initialized = !1, s.user = function() {
        return s._user;
      }, s.init = s.initialize.bind(s), s.log = $C, s.addIntegrationMiddleware = $C, s.listeners = $C, s.addEventListener = $C, s.removeAllListeners = $C, s.removeListener = $C, s.removeEventListener = $C, s.hasListeners = $C, s.add = $C, s.addIntegration = $C;
      var C = i == null ? void 0 : i.cookie, B = (I = i == null ? void 0 : i.disableClientPersistence) !== null && I !== void 0 ? I : !1;
      s.settings = t, s.settings.timeout = (r = s.settings.timeout) !== null && r !== void 0 ? r : 300, s.queue = n ?? NFt("".concat(t.writeKey, ":event-queue"), i == null ? void 0 : i.retryQueue, B);
      var l = i == null ? void 0 : i.storage;
      return s._universalStorage = s.createStore(B, l, C), s._user = o ?? new D4A(qA({ persist: !B, storage: i == null ? void 0 : i.storage }, i == null ? void 0 : i.user), C).load(), s._group = g ?? new mFt(qA({ persist: !B, storage: i == null ? void 0 : i.storage }, i == null ? void 0 : i.group), C).load(), s.eventFactory = new IFt(s._user), s.integrations = (a = i == null ? void 0 : i.integrations) !== null && a !== void 0 ? a : {}, s.options = i ?? {}, pIA(s), s;
    }
    return e.prototype.createStore = function(t, i, n) {
      return t ? new Xm([new yIA()]) : i && w4A(i) ? new Xm(W6(f4A(i.stores, n))) : new Xm(W6([
        Ms.LocalStorage,
        {
          name: Ms.Cookie,
          settings: n
        },
        Ms.Memory
      ]));
    }, Object.defineProperty(e.prototype, "storage", {
      get: function() {
        return this._universalStorage;
      },
      enumerable: !1,
      configurable: !0
    }), e.prototype.track = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o, g, s, I, r, a, C = this;
        return Ee(this, function(B) {
          return n = Hy(t), o = qRt.apply(void 0, t), g = o[0], s = o[1], I = o[2], r = o[3], a = this.eventFactory.track(g, s, I, this.integrations, n), [2, this._dispatch(a, r).then(function(l) {
            return C.emit("track", g, l.event.properties, l.event.options), l;
          })];
        });
      });
    }, e.prototype.page = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o, g, s, I, r, a, C, B = this;
        return Ee(this, function(l) {
          return n = Hy(t), o = VbA.apply(void 0, t), g = o[0], s = o[1], I = o[2], r = o[3], a = o[4], C = this.eventFactory.page(g, s, I, r, this.integrations, n), [2, this._dispatch(C, a).then(function(Q) {
            return B.emit("page", g, s, Q.event.properties, Q.event.options), Q;
          })];
        });
      });
    }, e.prototype.identify = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o, g, s, I, r, a, C = this;
        return Ee(this, function(B) {
          return n = Hy(t), o = XbA(this._user).apply(void 0, t), g = o[0], s = o[1], I = o[2], r = o[3], this._user.identify(g, s), a = this.eventFactory.identify(this._user.id(), this._user.traits(), I, this.integrations, n), [2, this._dispatch(a, r).then(function(l) {
            return C.emit("identify", l.event.userId, l.event.traits, l.event.options), l;
          })];
        });
      });
    }, e.prototype.group = function() {
      for (var t = this, i = [], n = 0; n < arguments.length; n++)
        i[n] = arguments[n];
      var o = Hy(i);
      if (i.length === 0)
        return this._group;
      var g = XbA(this._group).apply(void 0, i), s = g[0], I = g[1], r = g[2], a = g[3];
      this._group.identify(s, I);
      var C = this._group.id(), B = this._group.traits(), l = this.eventFactory.group(C, B, r, this.integrations, o);
      return this._dispatch(l, a).then(function(Q) {
        return t.emit("group", Q.event.groupId, Q.event.traits, Q.event.options), Q;
      });
    }, e.prototype.alias = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o, g, s, I, r, a, C = this;
        return Ee(this, function(B) {
          return n = Hy(t), o = ORt.apply(void 0, t), g = o[0], s = o[1], I = o[2], r = o[3], a = this.eventFactory.alias(g, s, I, this.integrations, n), [2, this._dispatch(a, r).then(function(l) {
            return C.emit("alias", g, s, l.event.options), l;
          })];
        });
      });
    }, e.prototype.screen = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o, g, s, I, r, a, C, B = this;
        return Ee(this, function(l) {
          return n = Hy(t), o = VbA.apply(void 0, t), g = o[0], s = o[1], I = o[2], r = o[3], a = o[4], C = this.eventFactory.screen(g, s, I, r, this.integrations, n), [2, this._dispatch(C, a).then(function(Q) {
            return B.emit("screen", g, s, Q.event.properties, Q.event.options), Q;
          })];
        });
      });
    }, e.prototype.trackClick = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o;
        return Ee(this, function(g) {
          switch (g.label) {
            case 0:
              return [4, Promise.resolve().then(() => dL)];
            case 1:
              return n = g.sent(), [2, (o = n.link).call.apply(o, zn([this], t, !1))];
          }
        });
      });
    }, e.prototype.trackLink = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o;
        return Ee(this, function(g) {
          switch (g.label) {
            case 0:
              return [4, Promise.resolve().then(() => dL)];
            case 1:
              return n = g.sent(), [2, (o = n.link).call.apply(o, zn([this], t, !1))];
          }
        });
      });
    }, e.prototype.trackSubmit = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o;
        return Ee(this, function(g) {
          switch (g.label) {
            case 0:
              return [4, Promise.resolve().then(() => dL)];
            case 1:
              return n = g.sent(), [2, (o = n.form).call.apply(o, zn([this], t, !1))];
          }
        });
      });
    }, e.prototype.trackForm = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o;
        return Ee(this, function(g) {
          switch (g.label) {
            case 0:
              return [4, Promise.resolve().then(() => dL)];
            case 1:
              return n = g.sent(), [2, (o = n.form).call.apply(o, zn([this], t, !1))];
          }
        });
      });
    }, e.prototype.register = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o, g = this;
        return Ee(this, function(s) {
          switch (s.label) {
            case 0:
              return n = iQ.system(), o = t.map(function(I) {
                return g.queue.register(n, I, g);
              }), [4, Promise.all(o)];
            case 1:
              return s.sent(), [2, n];
          }
        });
      });
    }, e.prototype.deregister = function() {
      for (var t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      return UA(this, void 0, void 0, function() {
        var n, o, g = this;
        return Ee(this, function(s) {
          switch (s.label) {
            case 0:
              return n = iQ.system(), o = t.map(function(I) {
                var r = g.queue.plugins.find(function(a) {
                  return a.name === I;
                });
                if (r)
                  return g.queue.deregister(n, r, g);
                n.log("warn", "plugin ".concat(I, " not found"));
              }), [4, Promise.all(o)];
            case 1:
              return s.sent(), [2, n];
          }
        });
      });
    }, e.prototype.debug = function(t) {
      return t === !1 && localStorage.getItem("debug") && localStorage.removeItem("debug"), this._debug = t, this;
    }, e.prototype.reset = function() {
      this._user.reset(), this._group.reset(), this.emit("reset");
    }, e.prototype.timeout = function(t) {
      this.settings.timeout = t;
    }, e.prototype._dispatch = function(t, i) {
      return UA(this, void 0, void 0, function() {
        var n;
        return Ee(this, function(o) {
          return n = new iQ(t), md() && !this.options.retryQueue ? [2, n] : [2, _Rt(n, this.queue, this, {
            callback: i,
            debug: this._debug,
            timeout: this.settings.timeout
          })];
        });
      });
    }, e.prototype.addSourceMiddleware = function(t) {
      return UA(this, void 0, void 0, function() {
        var i = this;
        return Ee(this, function(n) {
          switch (n.label) {
            case 0:
              return [4, this.queue.criticalTasks.run(function() {
                return UA(i, void 0, void 0, function() {
                  var o, g, s;
                  return Ee(this, function(I) {
                    switch (I.label) {
                      case 0:
                        return [4, Promise.resolve().then(() => Y1t)];
                      case 1:
                        return o = I.sent().sourceMiddlewarePlugin, g = {}, this.queue.plugins.forEach(function(r) {
                          if (r.type === "destination")
                            return g[r.name] = !0;
                        }), s = o(t, g), [4, this.register(s)];
                      case 2:
                        return I.sent(), [
                          2
                          /*return*/
                        ];
                    }
                  });
                });
              })];
            case 1:
              return n.sent(), [2, this];
          }
        });
      });
    }, e.prototype.addDestinationMiddleware = function(t) {
      for (var i = [], n = 1; n < arguments.length; n++)
        i[n - 1] = arguments[n];
      return this.queue.plugins.filter(aFt).forEach(function(o) {
        (t === "*" || o.name.toLowerCase() === t.toLowerCase()) && o.addMiddleware.apply(o, i);
      }), Promise.resolve(this);
    }, e.prototype.setAnonymousId = function(t) {
      return this._user.anonymousId(t);
    }, e.prototype.queryString = function(t) {
      return UA(this, void 0, void 0, function() {
        var i;
        return Ee(this, function(n) {
          switch (n.label) {
            case 0:
              return this.options.useQueryString === !1 ? [2, []] : [4, Promise.resolve().then(() => sZt)];
            case 1:
              return i = n.sent().queryString, [2, i(this, t)];
          }
        });
      });
    }, e.prototype.use = function(t) {
      return t(this), this;
    }, e.prototype.ready = function(t) {
      return t === void 0 && (t = function(i) {
        return i;
      }), UA(this, void 0, void 0, function() {
        return Ee(this, function(i) {
          return [2, Promise.all(this.queue.plugins.map(function(n) {
            return n.ready ? n.ready() : Promise.resolve();
          })).then(function(n) {
            return t(n), n;
          })];
        });
      });
    }, e.prototype.noConflict = function() {
      return console.warn(JE), yFt(H_ ?? this), this;
    }, e.prototype.normalize = function(t) {
      return console.warn(JE), this.eventFactory.normalize(t);
    }, Object.defineProperty(e.prototype, "failedInitializations", {
      get: function() {
        return console.warn(JE), this.queue.failedInitializations;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e.prototype, "VERSION", {
      get: function() {
        return O2;
      },
      enumerable: !1,
      configurable: !0
    }), e.prototype.initialize = function(t, i) {
      return UA(this, void 0, void 0, function() {
        return Ee(this, function(n) {
          return console.warn(JE), [2, Promise.resolve(this)];
        });
      });
    }, e.prototype.pageview = function(t) {
      return UA(this, void 0, void 0, function() {
        return Ee(this, function(i) {
          switch (i.label) {
            case 0:
              return console.warn(JE), [4, this.page({ path: t })];
            case 1:
              return i.sent(), [2, this];
          }
        });
      });
    }, Object.defineProperty(e.prototype, "plugins", {
      get: function() {
        var t;
        return console.warn(JE), (t = this._plugins) !== null && t !== void 0 ? t : {};
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e.prototype, "Integrations", {
      get: function() {
        console.warn(JE);
        var t = this.queue.plugins.filter(function(i) {
          return i.type === "destination";
        }).reduce(function(i, n) {
          var o = "".concat(n.name.toLowerCase().replace(".", "").split(" ").join("-"), "Integration"), g = window[o];
          if (!g)
            return i;
          var s = g.Integration;
          return s ? (i[n.name] = s, i) : (i[n.name] = g, i);
        }, {});
        return t;
      },
      enumerable: !1,
      configurable: !0
    }), e.prototype.push = function(t) {
      var i = this, n = t.shift();
      n && !i[n] || i[n].apply(this, t);
    }, e;
  }(uIA)
), _bA = (
  /** @class */
  function(A) {
    la(e, A);
    function e() {
      var t = A.call(this, { writeKey: "" }, { disableClientPersistence: !0 }) || this;
      return t.initialized = !0, t;
    }
    return e;
  }(J4A)
);
function N4A() {
  return typeof process > "u" || !process.env ? {} : process.env;
}
var YFt = /(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/, RFt = function() {
  var A, e = Array.prototype.slice.call(document.querySelectorAll("script"));
  return e.forEach(function(t) {
    var i, n = (i = t.getAttribute("src")) !== null && i !== void 0 ? i : "", o = YFt.exec(n);
    o && o[1] && (A = o[1]);
  }), A;
}, Nv, FFt = function() {
  var A, e = Nv ?? ((A = wIA()) === null || A === void 0 ? void 0 : A._cdn);
  return e;
}, MFt = function(A) {
  var e = wIA();
  e && (e._cdn = A), Nv = A;
}, DIA = function() {
  var A = FFt();
  if (A)
    return A;
  var e = RFt();
  return e || "https://cdn.segment.com";
}, GIA = function() {
  var A = DIA();
  return "".concat(A, "/next-integrations");
};
function Y4A(A, e) {
  var t, i = Object.entries((t = e.integrations) !== null && t !== void 0 ? t : {}).reduce(function(n, o) {
    var g, s, I = o[0], r = o[1];
    return typeof r == "object" ? qA(qA({}, n), (g = {}, g[I] = r, g)) : qA(qA({}, n), (s = {}, s[I] = {}, s));
  }, {});
  return Object.entries(A.integrations).reduce(function(n, o) {
    var g, s = o[0], I = o[1];
    return qA(qA({}, n), (g = {}, g[s] = qA(qA({}, I), i[s]), g));
  }, {});
}
function R4A(A) {
  try {
    return decodeURIComponent(A.replace(/\+/g, " "));
  } catch {
    return A;
  }
}
function xFt(A) {
  return UA(this, void 0, void 0, function() {
    var e;
    return Ee(this, function(t) {
      return e = navigator.userAgentData, e ? A ? [2, e.getHighEntropyValues(A).catch(function() {
        return e.toJSON();
      })] : [2, e.toJSON()] : [2, void 0];
    });
  });
}
var oJ;
function LFt() {
  if (oJ)
    return oJ;
  var A = y4A(window.location.href);
  return oJ = {
    expires: 31536e6,
    secure: !1,
    path: "/"
  }, A && (oJ.domain = A), oJ;
}
function vFt(A) {
  var e = {
    btid: "dataxu",
    urid: "millennial-media"
  };
  A.startsWith("?") && (A = A.substring(1)), A = A.replace(/\?/g, "&");
  for (var t = A.split("&"), i = 0, n = t; i < n.length; i++) {
    var o = n[i], g = o.split("="), s = g[0], I = g[1];
    if (e[s])
      return {
        id: I,
        type: e[s]
      };
  }
}
function HFt(A) {
  return A.startsWith("?") && (A = A.substring(1)), A = A.replace(/\?/g, "&"), A.split("&").reduce(function(e, t) {
    var i = t.split("="), n = i[0], o = i[1], g = o === void 0 ? "" : o;
    if (n.includes("utm_") && n.length > 4) {
      var s = n.slice(4);
      s === "campaign" && (s = "name"), e[s] = R4A(g);
    }
    return e;
  }, {});
}
function SFt() {
  var A = Jc.get("_ga");
  if (A && A.startsWith("amp"))
    return A;
}
function ZFt(A, e, t) {
  var i, n = new Xm(t ? [] : [new b4A(LFt())]), o = n.get("s:context.referrer"), g = (i = vFt(A)) !== null && i !== void 0 ? i : o;
  g && (e && (e.referrer = qA(qA({}, e.referrer), g)), n.set("s:context.referrer", g));
}
var WFt = function(A) {
  try {
    var e = new URLSearchParams();
    return Object.entries(A).forEach(function(t) {
      var i = t[0], n = t[1];
      Array.isArray(n) ? n.forEach(function(o) {
        return e.append(i, o);
      }) : e.append(i, n);
    }), e.toString();
  } catch {
    return "";
  }
}, KFt = (
  /** @class */
  function() {
    function A() {
      var e = this;
      this.name = "Page Enrichment", this.type = "before", this.version = "0.1.0", this.isLoaded = function() {
        return !0;
      }, this.load = function(t, i) {
        return UA(e, void 0, void 0, function() {
          var n;
          return Ee(this, function(o) {
            switch (o.label) {
              case 0:
                this.instance = i, o.label = 1;
              case 1:
                return o.trys.push([1, 3, , 4]), n = this, [4, xFt(this.instance.options.highEntropyValuesClientHints)];
              case 2:
                return n.userAgentData = o.sent(), [3, 4];
              case 3:
                return o.sent(), [3, 4];
              case 4:
                return [2, Promise.resolve()];
            }
          });
        });
      }, this.enrich = function(t) {
        var i, n, o = t.event.context, g = o.page.search || "", s = typeof g == "object" ? WFt(g) : g;
        o.userAgent = navigator.userAgent, o.userAgentData = e.userAgentData;
        var I = navigator.userLanguage || navigator.language;
        typeof o.locale > "u" && typeof I < "u" && (o.locale = I), (i = o.library) !== null && i !== void 0 || (o.library = {
          name: "analytics.js",
          version: "".concat(l4A() === "web" ? "next" : "npm:next", "-").concat(O2)
        }), s && !o.campaign && (o.campaign = HFt(s));
        var r = SFt();
        r && (o.amp = { id: r }), ZFt(s, o, (n = e.instance.options.disableClientPersistence) !== null && n !== void 0 ? n : !1);
        try {
          o.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
        } catch {
        }
        return t;
      }, this.track = this.enrich, this.identify = this.enrich, this.page = this.enrich, this.group = this.enrich, this.alias = this.enrich, this.screen = this.enrich;
    }
    return A;
  }()
), UFt = new KFt();
function F4A(A) {
  var e = Array.prototype.slice.call(window.document.querySelectorAll("script"));
  return e.find(function(t) {
    return t.src === A;
  });
}
function Yw(A, e) {
  var t = F4A(A);
  if (t !== void 0) {
    var i = t == null ? void 0 : t.getAttribute("status");
    if (i === "loaded")
      return Promise.resolve(t);
    if (i === "loading")
      return new Promise(function(n, o) {
        t.addEventListener("load", function() {
          return n(t);
        }), t.addEventListener("error", function(g) {
          return o(g);
        });
      });
  }
  return new Promise(function(n, o) {
    var g, s = window.document.createElement("script");
    s.type = "text/javascript", s.src = A, s.async = !0, s.setAttribute("status", "loading");
    for (var I = 0, r = Object.entries(e ?? {}); I < r.length; I++) {
      var a = r[I], C = a[0], B = a[1];
      s.setAttribute(C, B);
    }
    s.onload = function() {
      s.onerror = s.onload = null, s.setAttribute("status", "loaded"), n(s);
    }, s.onerror = function() {
      s.onerror = s.onload = null, s.setAttribute("status", "error"), o(new Error("Failed to load ".concat(A)));
    };
    var l = window.document.getElementsByTagName("script")[0];
    (g = l.parentElement) === null || g === void 0 || g.insertBefore(s, l);
  });
}
function VFt(A) {
  var e = F4A(A);
  return e !== void 0 && e.remove(), Promise.resolve();
}
var fI = {}, Zl = {}, kIA = {}, gD = {}, XFt = {
  get exports() {
    return gD;
  },
  set exports(A) {
    gD = A;
  }
};
(function(A) {
  A.exports = e(t), A.exports.find = A.exports, A.exports.replace = function(s, I, r, a) {
    return e(n).call(this, s, I, r, a), s;
  }, A.exports.del = function(s, I, r) {
    return e(i).call(this, s, I, null, r), s;
  };
  function e(s) {
    return function(I, r, a, C) {
      var B = C && g(C.normalizer) ? C.normalizer : o;
      r = B(r);
      for (var l, Q = !1; !Q; )
        E();
      function E() {
        for (l in I) {
          var d = B(l);
          if (r.indexOf(d) === 0) {
            var m = r.substr(d.length);
            if (m.charAt(0) === "." || m.length === 0) {
              r = m.substr(1);
              var y = I[l];
              if (y == null) {
                Q = !0;
                return;
              }
              if (!r.length) {
                Q = !0;
                return;
              }
              I = y;
              return;
            }
          }
        }
        l = void 0, Q = !0;
      }
      if (l)
        return I == null ? I : s(I, l, a);
    };
  }
  function t(s, I) {
    if (s.hasOwnProperty(I))
      return s[I];
  }
  function i(s, I) {
    return s.hasOwnProperty(I) && delete s[I], s;
  }
  function n(s, I, r) {
    return s.hasOwnProperty(I) && (s[I] = r), s;
  }
  function o(s) {
    return s.replace(/[^a-zA-Z0-9\.]+/g, "").toLowerCase();
  }
  function g(s) {
    return typeof s == "function";
  }
})(XFt);
var zFt = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(kIA, "__esModule", { value: !0 });
var mE = zFt(gD);
function Sy(A, e) {
  return function() {
    var t = this.traits(), i = this.properties ? this.properties() : {};
    return mE.default(t, "address." + A) || mE.default(t, A) || (e ? mE.default(t, "address." + e) : null) || (e ? mE.default(t, e) : null) || mE.default(i, "address." + A) || mE.default(i, A) || (e ? mE.default(i, "address." + e) : null) || (e ? mE.default(i, e) : null);
  };
}
function TFt(A) {
  A.zip = Sy("postalCode", "zip"), A.country = Sy("country"), A.street = Sy("street"), A.state = Sy("state"), A.city = Sy("city"), A.region = Sy("region");
}
kIA.default = TFt;
var XX = {};
Object.defineProperty(XX, "__esModule", { value: !0 });
XX.clone = void 0;
function K6(A) {
  if (typeof A != "object")
    return A;
  if (Object.prototype.toString.call(A) === "[object Object]") {
    var e = {};
    for (var t in A)
      Object.prototype.hasOwnProperty.call(A, t) && (e[t] = K6(A[t]));
    return e;
  } else
    return Array.isArray(A) ? A.map(K6) : A;
}
XX.clone = K6;
var JIA = {};
Object.defineProperty(JIA, "__esModule", { value: !0 });
var _Ft = {
  Salesforce: !0
};
function qFt(A) {
  return !_Ft[A];
}
JIA.default = qFt;
var zX = {}, M4A = /^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;
zX.parse = function(A) {
  var e = [1, 5, 6, 7, 11, 12], t = M4A.exec(A), i = 0;
  if (!t)
    return new Date(A);
  for (var n = 0, o; o = e[n]; n++)
    t[o] = parseInt(t[o], 10) || 0;
  t[2] = parseInt(t[2], 10) || 1, t[3] = parseInt(t[3], 10) || 1, t[2]--, t[8] = t[8] ? (t[8] + "00").substring(0, 3) : 0, t[4] === " " ? i = new Date().getTimezoneOffset() : t[9] !== "Z" && t[10] && (i = t[11] * 60 + t[12], t[10] === "+" && (i = 0 - i));
  var g = Date.UTC(t[1], t[2], t[3], t[5], t[6] + i, t[7], t[8]);
  return new Date(g);
};
zX.is = function(A, e) {
  return typeof A != "string" || e && /^\d{4}-\d{2}-\d{2}/.test(A) === !1 ? !1 : M4A.test(A);
};
var NIA = {}, OFt = /\d{13}/;
NIA.is = function(A) {
  return OFt.test(A);
};
NIA.parse = function(A) {
  return A = parseInt(A, 10), new Date(A);
};
var YIA = {}, jFt = /\d{10}/;
YIA.is = function(A) {
  return jFt.test(A);
};
YIA.parse = function(A) {
  var e = parseInt(A, 10) * 1e3;
  return new Date(e);
};
var qbA = zX, ObA = NIA, jbA = YIA, PFt = Object.prototype, x4A = PFt.toString;
function $Ft(A) {
  return x4A.call(A) === "[object Date]";
}
function A1t(A) {
  return x4A.call(A) === "[object Number]";
}
var RIA = function(e) {
  return $Ft(e) ? e : A1t(e) ? new Date(e1t(e)) : qbA.is(e) ? qbA.parse(e) : ObA.is(e) ? ObA.parse(e) : jbA.is(e) ? jbA.parse(e) : new Date(e);
};
function e1t(A) {
  return A < 315576e5 ? A * 1e3 : A;
}
var PbA = zX, t1t = FIA;
function FIA(A, e) {
  return e === void 0 && (e = !0), A && typeof A == "object" ? i1t(A, e) : Array.isArray(A) ? n1t(A, e) : PbA.is(A, e) ? PbA.parse(A) : A;
}
function i1t(A, e) {
  return Object.keys(A).forEach(function(t) {
    A[t] = FIA(A[t], e);
  }), A;
}
function n1t(A, e) {
  return A.forEach(function(t, i) {
    A[i] = FIA(t, e);
  }), A;
}
var w1 = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(Zl, "__esModule", { value: !0 });
Zl.Facade = void 0;
var o1t = w1(kIA), sD = XX, g1t = w1(JIA), s1t = w1(RIA), U6 = w1(gD), I1t = w1(t1t);
function ca(A, e) {
  e = e || {}, this.raw = sD.clone(A), "clone" in e || (e.clone = !0), e.clone && (A = sD.clone(A)), "traverse" in e || (e.traverse = !0), "timestamp" in A ? A.timestamp = s1t.default(A.timestamp) : A.timestamp = new Date(), e.traverse && I1t.default(A), this.opts = e, this.obj = A;
}
Zl.Facade = ca;
var hn = ca.prototype;
hn.proxy = function(A) {
  var e = A.split(".");
  A = e.shift();
  var t = this[A] || this.obj[A];
  return t && (typeof t == "function" && (t = t.call(this) || {}), e.length === 0 ? this.opts.clone ? V6(t) : t : (t = U6.default(t, e.join(".")), this.opts.clone ? V6(t) : t));
};
hn.field = function(A) {
  var e = this.obj[A];
  return this.opts.clone ? V6(e) : e;
};
ca.proxy = function(A) {
  return function() {
    return this.proxy(A);
  };
};
ca.field = function(A) {
  return function() {
    return this.field(A);
  };
};
ca.multi = function(A) {
  return function() {
    var e = this.proxy(A + "s");
    if (Array.isArray(e))
      return e;
    var t = this.proxy(A);
    return t && (t = [this.opts.clone ? sD.clone(t) : t]), t || [];
  };
};
ca.one = function(A) {
  return function() {
    var e = this.proxy(A);
    if (e)
      return e;
    var t = this.proxy(A + "s");
    if (Array.isArray(t))
      return t[0];
  };
};
hn.json = function() {
  var A = this.opts.clone ? sD.clone(this.obj) : this.obj;
  return this.type && (A.type = this.type()), A;
};
hn.rawEvent = function() {
  return this.raw;
};
hn.options = function(A) {
  var e = this.obj.options || this.obj.context || {}, t = this.opts.clone ? sD.clone(e) : e;
  if (!A)
    return t;
  if (this.enabled(A)) {
    var i = this.integrations(), n = i[A] || U6.default(i, A);
    return typeof n != "object" && (n = U6.default(this.options(), A)), typeof n == "object" ? n : {};
  }
};
hn.context = hn.options;
hn.enabled = function(A) {
  var e = this.proxy("options.providers.all");
  typeof e != "boolean" && (e = this.proxy("options.all")), typeof e != "boolean" && (e = this.proxy("integrations.all")), typeof e != "boolean" && (e = !0);
  var t = e && g1t.default(A), i = this.integrations();
  if (i.providers && i.providers.hasOwnProperty(A) && (t = i.providers[A]), i.hasOwnProperty(A)) {
    var n = i[A];
    typeof n == "boolean" ? t = n : t = !0;
  }
  return !!t;
};
hn.integrations = function() {
  return this.obj.integrations || this.proxy("options.providers") || this.options();
};
hn.active = function() {
  var A = this.proxy("options.active");
  return A == null && (A = !0), A;
};
hn.anonymousId = function() {
  return this.field("anonymousId") || this.field("sessionId");
};
hn.sessionId = hn.anonymousId;
hn.groupId = ca.proxy("options.groupId");
hn.traits = function(A) {
  var e = this.proxy("options.traits") || {}, t = this.userId();
  A = A || {}, t && (e.id = t);
  for (var i in A)
    if (Object.prototype.hasOwnProperty.call(A, i)) {
      var n = this[i] == null ? this.proxy("options.traits." + i) : this[i]();
      if (n == null)
        continue;
      e[A[i]] = n, delete e[i];
    }
  return e;
};
hn.library = function() {
  var A = this.proxy("options.library");
  return A ? typeof A == "string" ? { name: A, version: null } : A : { name: "unknown", version: null };
};
hn.device = function() {
  var A = this.proxy("context.device");
  (typeof A != "object" || A === null) && (A = {});
  var e = this.library().name;
  return A.type || (e.indexOf("ios") > -1 && (A.type = "ios"), e.indexOf("android") > -1 && (A.type = "android")), A;
};
hn.userAgent = ca.proxy("context.userAgent");
hn.timezone = ca.proxy("context.timezone");
hn.timestamp = ca.field("timestamp");
hn.channel = ca.field("channel");
hn.ip = ca.proxy("context.ip");
hn.userId = ca.field("userId");
o1t.default(hn);
function V6(A) {
  return sD.clone(A);
}
var TX = {}, wQ = {}, $bA = {
  get exports() {
    return wQ;
  },
  set exports(A) {
    wQ = A;
  }
};
typeof Object.create == "function" ? $bA.exports = function(e, t) {
  t && (e.super_ = t, e.prototype = Object.create(t.prototype, {
    constructor: {
      value: e,
      enumerable: !1,
      writable: !0,
      configurable: !0
    }
  }));
} : $bA.exports = function(e, t) {
  if (t) {
    e.super_ = t;
    var i = function() {
    };
    i.prototype = t.prototype, e.prototype = new i(), e.prototype.constructor = e;
  }
};
var a1t = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(TX, "__esModule", { value: !0 });
TX.Alias = void 0;
var r1t = a1t(wQ), L4A = Zl;
function wC(A, e) {
  L4A.Facade.call(this, A, e);
}
TX.Alias = wC;
r1t.default(wC, L4A.Facade);
wC.prototype.action = function() {
  return "alias";
};
wC.prototype.type = wC.prototype.action;
wC.prototype.previousId = function() {
  return this.field("previousId") || this.field("from");
};
wC.prototype.from = wC.prototype.previousId;
wC.prototype.userId = function() {
  return this.field("userId") || this.field("to");
};
wC.prototype.to = wC.prototype.userId;
var _X = {}, kG = {};
Object.defineProperty(kG, "__esModule", { value: !0 });
var C1t = /.+\@.+\..+/;
function B1t(A) {
  return C1t.test(A);
}
kG.default = B1t;
var MIA = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(_X, "__esModule", { value: !0 });
_X.Group = void 0;
var l1t = MIA(wQ), c1t = MIA(kG), Q1t = MIA(RIA), JG = Zl;
function xIA(A, e) {
  JG.Facade.call(this, A, e);
}
_X.Group = xIA;
l1t.default(xIA, JG.Facade);
var fC = xIA.prototype;
fC.action = function() {
  return "group";
};
fC.type = fC.action;
fC.groupId = JG.Facade.field("groupId");
fC.created = function() {
  var A = this.proxy("traits.createdAt") || this.proxy("traits.created") || this.proxy("properties.createdAt") || this.proxy("properties.created");
  if (A)
    return Q1t.default(A);
};
fC.email = function() {
  var A = this.proxy("traits.email");
  if (A)
    return A;
  var e = this.groupId();
  if (c1t.default(e))
    return e;
};
fC.traits = function(A) {
  var e = this.properties(), t = this.groupId();
  A = A || {}, t && (e.id = t);
  for (var i in A)
    if (Object.prototype.hasOwnProperty.call(A, i)) {
      var n = this[i] == null ? this.proxy("traits." + i) : this[i]();
      if (n == null)
        continue;
      e[A[i]] = n, delete e[i];
    }
  return e;
};
fC.name = JG.Facade.proxy("traits.name");
fC.industry = JG.Facade.proxy("traits.industry");
fC.employees = JG.Facade.proxy("traits.employees");
fC.properties = function() {
  return this.field("traits") || this.field("properties") || {};
};
var f1 = {}, qX = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(f1, "__esModule", { value: !0 });
f1.Identify = void 0;
var Wl = Zl, Rw = qX(gD), E1t = qX(wQ), u1t = qX(kG), v4A = qX(RIA), zm = function(A) {
  return A.trim();
};
function LIA(A, e) {
  Wl.Facade.call(this, A, e);
}
f1.Identify = LIA;
E1t.default(LIA, Wl.Facade);
var mn = LIA.prototype;
mn.action = function() {
  return "identify";
};
mn.type = mn.action;
mn.traits = function(A) {
  var e = this.field("traits") || {}, t = this.userId();
  A = A || {}, t && (e.id = t);
  for (var i in A) {
    var n = this[i] == null ? this.proxy("traits." + i) : this[i]();
    n != null && (e[A[i]] = n, i !== A[i] && delete e[i]);
  }
  return e;
};
mn.email = function() {
  var A = this.proxy("traits.email");
  if (A)
    return A;
  var e = this.userId();
  if (u1t.default(e))
    return e;
};
mn.created = function() {
  var A = this.proxy("traits.created") || this.proxy("traits.createdAt");
  if (A)
    return v4A.default(A);
};
mn.companyCreated = function() {
  var A = this.proxy("traits.company.created") || this.proxy("traits.company.createdAt");
  if (A)
    return v4A.default(A);
};
mn.companyName = function() {
  return this.proxy("traits.company.name");
};
mn.name = function() {
  var A = this.proxy("traits.name");
  if (typeof A == "string")
    return zm(A);
  var e = this.firstName(), t = this.lastName();
  if (e && t)
    return zm(e + " " + t);
};
mn.firstName = function() {
  var A = this.proxy("traits.firstName");
  if (typeof A == "string")
    return zm(A);
  var e = this.proxy("traits.name");
  if (typeof e == "string")
    return zm(e).split(" ")[0];
};
mn.lastName = function() {
  var A = this.proxy("traits.lastName");
  if (typeof A == "string")
    return zm(A);
  var e = this.proxy("traits.name");
  if (typeof e == "string") {
    var t = zm(e).indexOf(" ");
    if (t !== -1)
      return zm(e.substr(t + 1));
  }
};
mn.uid = function() {
  return this.userId() || this.username() || this.email();
};
mn.description = function() {
  return this.proxy("traits.description") || this.proxy("traits.background");
};
mn.age = function() {
  var A = this.birthday(), e = Rw.default(this.traits(), "age");
  if (e != null)
    return e;
  if (A instanceof Date) {
    var t = new Date();
    return t.getFullYear() - A.getFullYear();
  }
};
mn.avatar = function() {
  var A = this.traits();
  return Rw.default(A, "avatar") || Rw.default(A, "photoUrl") || Rw.default(A, "avatarUrl");
};
mn.position = function() {
  var A = this.traits();
  return Rw.default(A, "position") || Rw.default(A, "jobTitle");
};
mn.username = Wl.Facade.proxy("traits.username");
mn.website = Wl.Facade.one("traits.website");
mn.websites = Wl.Facade.multi("traits.website");
mn.phone = Wl.Facade.one("traits.phone");
mn.phones = Wl.Facade.multi("traits.phone");
mn.address = Wl.Facade.proxy("traits.address");
mn.gender = Wl.Facade.proxy("traits.gender");
mn.birthday = Wl.Facade.proxy("traits.birthday");
var NG = {}, vIA = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(NG, "__esModule", { value: !0 });
NG.Track = void 0;
var d1t = vIA(wQ), Xo = Zl, h1t = f1, m1t = vIA(kG), H4A = vIA(gD);
function HIA(A, e) {
  Xo.Facade.call(this, A, e);
}
NG.Track = HIA;
d1t.default(HIA, Xo.Facade);
var Gt = HIA.prototype;
Gt.action = function() {
  return "track";
};
Gt.type = Gt.action;
Gt.event = Xo.Facade.field("event");
Gt.value = Xo.Facade.proxy("properties.value");
Gt.category = Xo.Facade.proxy("properties.category");
Gt.id = Xo.Facade.proxy("properties.id");
Gt.productId = function() {
  return this.proxy("properties.product_id") || this.proxy("properties.productId");
};
Gt.promotionId = function() {
  return this.proxy("properties.promotion_id") || this.proxy("properties.promotionId");
};
Gt.cartId = function() {
  return this.proxy("properties.cart_id") || this.proxy("properties.cartId");
};
Gt.checkoutId = function() {
  return this.proxy("properties.checkout_id") || this.proxy("properties.checkoutId");
};
Gt.paymentId = function() {
  return this.proxy("properties.payment_id") || this.proxy("properties.paymentId");
};
Gt.couponId = function() {
  return this.proxy("properties.coupon_id") || this.proxy("properties.couponId");
};
Gt.wishlistId = function() {
  return this.proxy("properties.wishlist_id") || this.proxy("properties.wishlistId");
};
Gt.reviewId = function() {
  return this.proxy("properties.review_id") || this.proxy("properties.reviewId");
};
Gt.orderId = function() {
  return this.proxy("properties.id") || this.proxy("properties.order_id") || this.proxy("properties.orderId");
};
Gt.sku = Xo.Facade.proxy("properties.sku");
Gt.tax = Xo.Facade.proxy("properties.tax");
Gt.name = Xo.Facade.proxy("properties.name");
Gt.price = Xo.Facade.proxy("properties.price");
Gt.total = Xo.Facade.proxy("properties.total");
Gt.repeat = Xo.Facade.proxy("properties.repeat");
Gt.coupon = Xo.Facade.proxy("properties.coupon");
Gt.shipping = Xo.Facade.proxy("properties.shipping");
Gt.discount = Xo.Facade.proxy("properties.discount");
Gt.shippingMethod = function() {
  return this.proxy("properties.shipping_method") || this.proxy("properties.shippingMethod");
};
Gt.paymentMethod = function() {
  return this.proxy("properties.payment_method") || this.proxy("properties.paymentMethod");
};
Gt.description = Xo.Facade.proxy("properties.description");
Gt.plan = Xo.Facade.proxy("properties.plan");
Gt.subtotal = function() {
  var A = H4A.default(this.properties(), "subtotal"), e = this.total() || this.revenue();
  if (A)
    return A;
  if (!e)
    return 0;
  if (this.total()) {
    var t = this.tax();
    t && (e -= t), t = this.shipping(), t && (e -= t), t = this.discount(), t && (e += t);
  }
  return e;
};
Gt.products = function() {
  var A = this.properties(), e = H4A.default(A, "products");
  return Array.isArray(e) ? e.filter(function(t) {
    return t !== null;
  }) : [];
};
Gt.quantity = function() {
  var A = this.obj.properties || {};
  return A.quantity || 1;
};
Gt.currency = function() {
  var A = this.obj.properties || {};
  return A.currency || "USD";
};
Gt.referrer = function() {
  return this.proxy("context.referrer.url") || this.proxy("context.page.referrer") || this.proxy("properties.referrer");
};
Gt.query = Xo.Facade.proxy("options.query");
Gt.properties = function(A) {
  var e = this.field("properties") || {};
  A = A || {};
  for (var t in A)
    if (Object.prototype.hasOwnProperty.call(A, t)) {
      var i = this[t] == null ? this.proxy("properties." + t) : this[t]();
      if (i == null)
        continue;
      e[A[t]] = i, delete e[t];
    }
  return e;
};
Gt.username = function() {
  return this.proxy("traits.username") || this.proxy("properties.username") || this.userId() || this.sessionId();
};
Gt.email = function() {
  var A = this.proxy("traits.email") || this.proxy("properties.email") || this.proxy("options.traits.email");
  if (A)
    return A;
  var e = this.userId();
  if (m1t.default(e))
    return e;
};
Gt.revenue = function() {
  var A = this.proxy("properties.revenue"), e = this.event(), t = /^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i;
  return !A && e && e.match(t) && (A = this.proxy("properties.total")), p1t(A);
};
Gt.cents = function() {
  var A = this.revenue();
  return typeof A != "number" ? this.value() || 0 : A * 100;
};
Gt.identify = function() {
  var A = this.json();
  return A.traits = this.traits(), new h1t.Identify(A, this.opts);
};
function p1t(A) {
  if (A) {
    if (typeof A == "number")
      return A;
    if (typeof A == "string" && (A = A.replace(/\$/g, ""), A = parseFloat(A), !isNaN(A)))
      return A;
  }
}
var D1 = {}, S4A = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(D1, "__esModule", { value: !0 });
D1.Page = void 0;
var y1t = S4A(wQ), Y0 = Zl, b1t = NG, w1t = S4A(kG);
function SIA(A, e) {
  Y0.Facade.call(this, A, e);
}
D1.Page = SIA;
y1t.default(SIA, Y0.Facade);
var iI = SIA.prototype;
iI.action = function() {
  return "page";
};
iI.type = iI.action;
iI.category = Y0.Facade.field("category");
iI.name = Y0.Facade.field("name");
iI.title = Y0.Facade.proxy("properties.title");
iI.path = Y0.Facade.proxy("properties.path");
iI.url = Y0.Facade.proxy("properties.url");
iI.referrer = function() {
  return this.proxy("context.referrer.url") || this.proxy("context.page.referrer") || this.proxy("properties.referrer");
};
iI.properties = function(A) {
  var e = this.field("properties") || {}, t = this.category(), i = this.name();
  A = A || {}, t && (e.category = t), i && (e.name = i);
  for (var n in A)
    if (Object.prototype.hasOwnProperty.call(A, n)) {
      var o = this[n] == null ? this.proxy("properties." + n) : this[n]();
      if (o == null)
        continue;
      e[A[n]] = o, n !== A[n] && delete e[n];
    }
  return e;
};
iI.email = function() {
  var A = this.proxy("context.traits.email") || this.proxy("properties.email");
  if (A)
    return A;
  var e = this.userId();
  if (w1t.default(e))
    return e;
};
iI.fullName = function() {
  var A = this.category(), e = this.name();
  return e && A ? A + " " + e : e;
};
iI.event = function(A) {
  return A ? "Viewed " + A + " Page" : "Loaded a Page";
};
iI.track = function(A) {
  var e = this.json();
  return e.event = this.event(A), e.timestamp = this.timestamp(), e.properties = this.properties(), new b1t.Track(e, this.opts);
};
var OX = {}, f1t = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(OX, "__esModule", { value: !0 });
OX.Screen = void 0;
var D1t = f1t(wQ), Z4A = D1, G1t = NG;
function Zp(A, e) {
  Z4A.Page.call(this, A, e);
}
OX.Screen = Zp;
D1t.default(Zp, Z4A.Page);
Zp.prototype.action = function() {
  return "screen";
};
Zp.prototype.type = Zp.prototype.action;
Zp.prototype.event = function(A) {
  return A ? "Viewed " + A + " Screen" : "Loaded a Screen";
};
Zp.prototype.track = function(A) {
  var e = this.json();
  return e.event = this.event(A), e.timestamp = this.timestamp(), e.properties = this.properties(), new G1t.Track(e, this.opts);
};
var jX = {}, k1t = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(jX, "__esModule", { value: !0 });
jX.Delete = void 0;
var J1t = k1t(wQ), W4A = Zl;
function ZIA(A, e) {
  W4A.Facade.call(this, A, e);
}
jX.Delete = ZIA;
J1t.default(ZIA, W4A.Facade);
ZIA.prototype.type = function() {
  return "delete";
};
(function(A) {
  var e = wi && wi.__assign || function() {
    return e = Object.assign || function(a) {
      for (var C, B = 1, l = arguments.length; B < l; B++) {
        C = arguments[B];
        for (var Q in C)
          Object.prototype.hasOwnProperty.call(C, Q) && (a[Q] = C[Q]);
      }
      return a;
    }, e.apply(this, arguments);
  };
  Object.defineProperty(A, "__esModule", { value: !0 }), A.Delete = A.Screen = A.Page = A.Track = A.Identify = A.Group = A.Alias = A.Facade = void 0;
  var t = Zl;
  Object.defineProperty(A, "Facade", { enumerable: !0, get: function() {
    return t.Facade;
  } });
  var i = TX;
  Object.defineProperty(A, "Alias", { enumerable: !0, get: function() {
    return i.Alias;
  } });
  var n = _X;
  Object.defineProperty(A, "Group", { enumerable: !0, get: function() {
    return n.Group;
  } });
  var o = f1;
  Object.defineProperty(A, "Identify", { enumerable: !0, get: function() {
    return o.Identify;
  } });
  var g = NG;
  Object.defineProperty(A, "Track", { enumerable: !0, get: function() {
    return g.Track;
  } });
  var s = D1;
  Object.defineProperty(A, "Page", { enumerable: !0, get: function() {
    return s.Page;
  } });
  var I = OX;
  Object.defineProperty(A, "Screen", { enumerable: !0, get: function() {
    return I.Screen;
  } });
  var r = jX;
  Object.defineProperty(A, "Delete", { enumerable: !0, get: function() {
    return r.Delete;
  } }), A.default = e(e({}, t.Facade), {
    Alias: i.Alias,
    Group: n.Group,
    Identify: o.Identify,
    Track: g.Track,
    Page: s.Page,
    Screen: I.Screen,
    Delete: r.Delete
  });
})(fI);
function KW(A, e) {
  var t = new fI.Facade(A, e);
  return A.type === "track" && (t = new fI.Track(A, e)), A.type === "identify" && (t = new fI.Identify(A, e)), A.type === "page" && (t = new fI.Page(A, e)), A.type === "alias" && (t = new fI.Alias(A, e)), A.type === "group" && (t = new fI.Group(A, e)), A.type === "screen" && (t = new fI.Screen(A, e)), Object.defineProperty(t, "obj", {
    value: A,
    writable: !0
  }), t;
}
function WIA(A, e, t) {
  return UA(this, void 0, void 0, function() {
    function i(r, a) {
      return UA(this, void 0, void 0, function() {
        var C, B, l;
        return Ee(this, function(Q) {
          switch (Q.label) {
            case 0:
              return C = !1, B = null, [4, a({
                payload: KW(r, {
                  clone: !0,
                  traverse: !1
                }),
                integration: A,
                next: function(E) {
                  C = !0, E === null && (B = null), E && (B = E.obj);
                }
              })];
            case 1:
              return Q.sent(), !C && B !== null && (B = B, B.integrations = qA(qA({}, r.integrations), (l = {}, l[A] = !1, l))), [2, B];
          }
        });
      });
    }
    var n, o, g, s, I;
    return Ee(this, function(r) {
      switch (r.label) {
        case 0:
          n = KW(e, {
            clone: !0,
            traverse: !1
          }).rawEvent(), o = 0, g = t, r.label = 1;
        case 1:
          return o < g.length ? (s = g[o], [4, i(n, s)]) : [3, 4];
        case 2:
          if (I = r.sent(), I === null)
            return [2, null];
          n = I, r.label = 3;
        case 3:
          return o++, [3, 1];
        case 4:
          return [2, n];
      }
    });
  });
}
function N1t(A, e) {
  function t(i) {
    return UA(this, void 0, void 0, function() {
      var n;
      return Ee(this, function(o) {
        switch (o.label) {
          case 0:
            return n = !1, [4, A({
              payload: KW(i.event, {
                clone: !0,
                traverse: !1
              }),
              integrations: e ?? {},
              next: function(g) {
                n = !0, g && (i.event = g.obj);
              }
            })];
          case 1:
            if (o.sent(), !n)
              throw new hd({
                retry: !1,
                type: "middleware_cancellation",
                reason: "Middleware `next` function skipped"
              });
            return [2, i];
        }
      });
    });
  }
  return {
    name: "Source Middleware ".concat(A.name),
    type: "before",
    version: "0.1.0",
    isLoaded: function() {
      return !0;
    },
    load: function(i) {
      return Promise.resolve(i);
    },
    track: t,
    page: t,
    identify: t,
    alias: t,
    group: t
  };
}
const Y1t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  applyDestinationMiddleware: WIA,
  sourceMiddlewarePlugin: N1t
}, Symbol.toStringTag, { value: "Module" }));
function su(A, e) {
  var t = e.methodName, i = e.integrationName, n = e.type, o = e.didError, g = o === void 0 ? !1 : o;
  A.stats.increment("analytics_js.integration.invoke".concat(g ? ".error" : ""), 1, [
    "method:".concat(t),
    "integration_name:".concat(i),
    "type:".concat(n)
  ]);
}
var R1t = (
  /** @class */
  function() {
    function A(e, t) {
      this.version = "1.0.0", this.alternativeNames = [], this.loadPromise = EIA(), this.middleware = [], this.alias = this._createMethod("alias"), this.group = this._createMethod("group"), this.identify = this._createMethod("identify"), this.page = this._createMethod("page"), this.screen = this._createMethod("screen"), this.track = this._createMethod("track"), this.action = t, this.name = e, this.type = t.type, this.alternativeNames.push(t.name);
    }
    return A.prototype.addMiddleware = function() {
      for (var e, t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      this.type === "destination" && (e = this.middleware).push.apply(e, t);
    }, A.prototype.transform = function(e) {
      return UA(this, void 0, void 0, function() {
        var t;
        return Ee(this, function(i) {
          switch (i.label) {
            case 0:
              return [4, WIA(this.name, e.event, this.middleware)];
            case 1:
              return t = i.sent(), t === null && e.cancel(new hd({
                retry: !1,
                reason: "dropped by destination middleware"
              })), [2, new iQ(t)];
          }
        });
      });
    }, A.prototype._createMethod = function(e) {
      var t = this;
      return function(i) {
        return UA(t, void 0, void 0, function() {
          var n, o;
          return Ee(this, function(g) {
            switch (g.label) {
              case 0:
                return this.action[e] ? (n = i, this.type !== "destination" ? [3, 2] : [4, this.transform(i)]) : [2, i];
              case 1:
                n = g.sent(), g.label = 2;
              case 2:
                return g.trys.push([2, 5, , 6]), [4, this.ready()];
              case 3:
                if (!g.sent())
                  throw new Error("Something prevented the destination from getting ready");
                return su(i, {
                  integrationName: this.action.name,
                  methodName: e,
                  type: "action"
                }), [4, this.action[e](n)];
              case 4:
                return g.sent(), [3, 6];
              case 5:
                throw o = g.sent(), su(i, {
                  integrationName: this.action.name,
                  methodName: e,
                  type: "action",
                  didError: !0
                }), o;
              case 6:
                return [2, i];
            }
          });
        });
      };
    }, A.prototype.isLoaded = function() {
      return this.action.isLoaded();
    }, A.prototype.ready = function() {
      return UA(this, void 0, void 0, function() {
        return Ee(this, function(e) {
          switch (e.label) {
            case 0:
              return e.trys.push([0, 2, , 3]), [4, this.loadPromise.promise];
            case 1:
              return e.sent(), [2, !0];
            case 2:
              return e.sent(), [2, !1];
            case 3:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, A.prototype.load = function(e, t) {
      return UA(this, void 0, void 0, function() {
        var i, n, o, g;
        return Ee(this, function(s) {
          switch (s.label) {
            case 0:
              if (this.loadPromise.isSettled())
                return [2, this.loadPromise.promise];
              s.label = 1;
            case 1:
              return s.trys.push([1, 3, , 4]), su(e, {
                integrationName: this.action.name,
                methodName: "load",
                type: "action"
              }), i = this.action.load(e, t), o = (n = this.loadPromise).resolve, [4, i];
            case 2:
              return o.apply(n, [s.sent()]), [2, i];
            case 3:
              throw g = s.sent(), su(e, {
                integrationName: this.action.name,
                methodName: "load",
                type: "action",
                didError: !0
              }), this.loadPromise.reject(g), g;
            case 4:
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, A.prototype.unload = function(e, t) {
      var i, n;
      return (n = (i = this.action).unload) === null || n === void 0 ? void 0 : n.call(i, e, t);
    }, A;
  }()
);
function F1t(A) {
  if (!Array.isArray(A))
    throw new Error("Not a valid list of plugins");
  var e = ["load", "isLoaded", "name", "version", "type"];
  return A.forEach(function(t) {
    e.forEach(function(i) {
      var n;
      if (t[i] === void 0)
        throw new Error("Plugin: ".concat((n = t.name) !== null && n !== void 0 ? n : "unknown", " missing required function ").concat(i));
    });
  }), !0;
}
function M1t(A, e) {
  var t = A[e.creationName], i = A[e.name];
  return A.All === !1 && !t && !i || t === !1 || i === !1;
}
function x1t(A, e) {
  return UA(this, void 0, void 0, function() {
    var t, i, n, o, g;
    return Ee(this, function(s) {
      switch (s.label) {
        case 0:
          if (t = new RegExp("https://cdn.segment.(com|build)"), i = DIA(), !e)
            return [3, 6];
          n = A.url.split("/"), o = n[n.length - 2], g = A.url.replace(o, btoa(o).replace(/=/g, "")), s.label = 1;
        case 1:
          return s.trys.push([1, 3, , 5]), [4, Yw(g.replace(t, i))];
        case 2:
          return s.sent(), [3, 5];
        case 3:
          return s.sent(), [4, Yw(A.url.replace(t, i))];
        case 4:
          return s.sent(), [3, 5];
        case 5:
          return [3, 8];
        case 6:
          return [4, Yw(A.url.replace(t, i))];
        case 7:
          s.sent(), s.label = 8;
        case 8:
          return typeof window[A.libraryName] == "function" ? [2, window[A.libraryName]] : [
            2
            /*return*/
          ];
      }
    });
  });
}
function L1t(A, e, t, i, n, o) {
  var g, s, I;
  return UA(this, void 0, void 0, function() {
    var r, a, C, B = this;
    return Ee(this, function(l) {
      switch (l.label) {
        case 0:
          return r = [], a = (s = (g = A.middlewareSettings) === null || g === void 0 ? void 0 : g.routingRules) !== null && s !== void 0 ? s : [], C = ((I = A.remotePlugins) !== null && I !== void 0 ? I : []).map(function(Q) {
            return UA(B, void 0, void 0, function() {
              var E, d, m, y, f, w;
              return Ee(this, function(G) {
                switch (G.label) {
                  case 0:
                    if (M1t(e, Q))
                      return [
                        2
                        /*return*/
                      ];
                    G.label = 1;
                  case 1:
                    return G.trys.push([1, 6, , 7]), d = o == null ? void 0 : o.find(function(R) {
                      var F = R.pluginName;
                      return F === Q.name;
                    }), d ? [3, 3] : [4, x1t(Q, i == null ? void 0 : i.obfuscate)];
                  case 2:
                    d = G.sent(), G.label = 3;
                  case 3:
                    return E = d, E ? [4, E(qA(qA({}, Q.settings), t[Q.name]))] : [3, 5];
                  case 4:
                    m = G.sent(), y = Array.isArray(m) ? m : [m], F1t(y), f = a.filter(function(R) {
                      return R.destinationName === Q.creationName;
                    }), y.forEach(function(R) {
                      var F = new R1t(Q.creationName, R);
                      f.length && n && F.addMiddleware(n), r.push(F);
                    }), G.label = 5;
                  case 5:
                    return [3, 7];
                  case 6:
                    return w = G.sent(), console.warn("Failed to load Remote Plugin", w), [3, 7];
                  case 7:
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          }), [4, Promise.all(C)];
        case 1:
          return l.sent(), [2, r.filter(Boolean)];
      }
    });
  });
}
var v1t = function(A) {
  var e = !1;
  window.addEventListener("pagehide", function() {
    e || (e = !0, A(e));
  }), document.addEventListener("visibilitychange", function() {
    if (document.visibilityState == "hidden") {
      if (e)
        return;
      e = !0;
    } else
      e = !1;
    A(e);
  });
}, H1t = 500;
function K4A(A) {
  var e = encodeURI(JSON.stringify(A)).split(/%..|./).length - 1;
  return e / 1024;
}
function S1t(A) {
  return K4A(A) >= H1t - 50;
}
function Z1t(A) {
  var e = [], t = 0;
  return A.forEach(function(i) {
    var n = K4A(e[t]);
    n >= 64 && t++, e[t] ? e[t].push(i) : e[t] = [i];
  }), e;
}
function W1t(A, e) {
  var t, i, n = [], o = !1, g = (t = e == null ? void 0 : e.size) !== null && t !== void 0 ? t : 10, s = (i = e == null ? void 0 : e.timeout) !== null && i !== void 0 ? i : 5e3;
  function I(l) {
    var Q;
    if (l.length !== 0) {
      var E = (Q = l[0]) === null || Q === void 0 ? void 0 : Q.writeKey, d = l.map(function(m) {
        var y = m;
        y.sentAt;
        var f = RsA(y, ["sentAt"]);
        return f;
      });
      return UX("https://".concat(A, "/b"), {
        keepalive: o,
        headers: {
          "Content-Type": "text/plain"
        },
        method: "post",
        body: JSON.stringify({
          writeKey: E,
          batch: d,
          sentAt: new Date().toISOString()
        })
      });
    }
  }
  function r() {
    return UA(this, void 0, void 0, function() {
      var l;
      return Ee(this, function(Q) {
        return n.length ? (l = n, n = [], [2, I(l)]) : [
          2
          /*return*/
        ];
      });
    });
  }
  var a;
  function C() {
    a || (a = setTimeout(function() {
      a = void 0, r().catch(console.error);
    }, s));
  }
  v1t(function(l) {
    if (o = l, o && n.length) {
      var Q = Z1t(n).map(I);
      Promise.all(Q).catch(console.error);
    }
  });
  function B(l, Q) {
    return UA(this, void 0, void 0, function() {
      var E;
      return Ee(this, function(d) {
        return n.push(Q), E = n.length >= g || S1t(n), [2, E || o ? r() : C()];
      });
    });
  }
  return {
    dispatch: B
  };
}
function K1t(A) {
  function e(t, i) {
    return UX(t, {
      keepalive: A == null ? void 0 : A.keepalive,
      headers: { "Content-Type": "text/plain" },
      method: "post",
      body: JSON.stringify(i)
    });
  }
  return {
    dispatch: e
  };
}
function U1t(A, e, t, i) {
  var n, o = A.user();
  delete e.options, e.writeKey = t == null ? void 0 : t.apiKey, e.userId = e.userId || o.id(), e.anonymousId = e.anonymousId || o.anonymousId(), e.sentAt = new Date();
  var g = A.queue.failedInitializations || [];
  g.length > 0 && (e._metadata = { failedInitializations: g });
  var s = [], I = [];
  for (var r in i) {
    var a = i[r];
    r === "Segment.io" && s.push(r), a.bundlingStatus === "bundled" && s.push(r), a.bundlingStatus === "unbundled" && I.push(r);
  }
  for (var C = 0, B = (t == null ? void 0 : t.unbundledIntegrations) || []; C < B.length; C++) {
    var l = B[C];
    I.includes(l) || I.push(l);
  }
  var Q = (n = t == null ? void 0 : t.maybeBundledConfigIds) !== null && n !== void 0 ? n : {}, E = [];
  return s.sort().forEach(function(d) {
    var m;
    ((m = Q[d]) !== null && m !== void 0 ? m : []).forEach(function(y) {
      E.push(y);
    });
  }), (t == null ? void 0 : t.addBundledMetadata) !== !1 && (e._metadata = qA(qA({}, e._metadata), { bundled: s.sort(), unbundled: I.sort(), bundledIds: E })), e;
}
var U4A = function(A, e) {
  return UA(void 0, void 0, void 0, function() {
    var t;
    return Ee(this, function(i) {
      return t = function(n) {
        return UA(void 0, void 0, void 0, function() {
          var o;
          return Ee(this, function(g) {
            switch (g.label) {
              case 0:
                return A(n) ? (o = t, [4, e()]) : [3, 2];
              case 1:
                return [2, o.apply(void 0, [g.sent()])];
              case 2:
                return [
                  2
                  /*return*/
                ];
            }
          });
        });
      }, [2, t(void 0)];
    });
  });
};
function V1t(A, e) {
  return UA(this, void 0, void 0, function() {
    var t, i = this;
    return Ee(this, function(n) {
      switch (n.label) {
        case 0:
          return t = [], md() ? [2, e] : [
            4,
            U4A(function() {
              return e.length > 0 && !md();
            }, function() {
              return UA(i, void 0, void 0, function() {
                var o, g, s;
                return Ee(this, function(I) {
                  switch (I.label) {
                    case 0:
                      return o = e.pop(), o ? [4, Nw(o, A)] : [
                        2
                        /*return*/
                      ];
                    case 1:
                      return g = I.sent(), s = g instanceof iQ, s || t.push(o), [
                        2
                        /*return*/
                      ];
                  }
                });
              });
            })
            // re-add failed tasks
          ];
        case 1:
          return n.sent(), t.map(function(o) {
            return e.pushWithBackoff(o);
          }), [2, e];
      }
    });
  });
}
function Zy(A, e, t, i) {
  var n = this;
  A || setTimeout(function() {
    return UA(n, void 0, void 0, function() {
      var o, g;
      return Ee(this, function(s) {
        switch (s.label) {
          case 0:
            return o = !0, [4, V1t(t, e)];
          case 1:
            return g = s.sent(), o = !1, e.todo > 0 && i(o, g, t, i), [
              2
              /*return*/
            ];
        }
      });
    });
  }, Math.random() * 5e3);
}
function X1t(A, e) {
  var t, i, n, o, g = A.user();
  return e.previousId = (n = (i = (t = e.previousId) !== null && t !== void 0 ? t : e.from) !== null && i !== void 0 ? i : g.id()) !== null && n !== void 0 ? n : g.anonymousId(), e.userId = (o = e.userId) !== null && o !== void 0 ? o : e.to, delete e.from, delete e.to, e;
}
function z1t(A, e, t) {
  var i, n, o;
  window.addEventListener("pagehide", function() {
    s.push.apply(s, Array.from(I)), I.clear();
  });
  var g = (i = e == null ? void 0 : e.apiKey) !== null && i !== void 0 ? i : "", s = A.options.disableClientPersistence ? new KX(A.queue.queue.maxAttempts, []) : new VX(A.queue.queue.maxAttempts, "".concat(g, ":dest-Segment.io")), I = /* @__PURE__ */ new Set(), r = !1, a = (n = e == null ? void 0 : e.apiHost) !== null && n !== void 0 ? n : c4A, C = (o = e == null ? void 0 : e.protocol) !== null && o !== void 0 ? o : "https", B = "".concat(C, "://").concat(a), l = e == null ? void 0 : e.deliveryStrategy, Q = (l == null ? void 0 : l.strategy) === "batching" ? W1t(a, l.config) : K1t(l == null ? void 0 : l.config);
  function E(m) {
    return UA(this, void 0, void 0, function() {
      var y, f;
      return Ee(this, function(w) {
        return md() ? (s.push(m), Zy(r, s, d, Zy), [2, m]) : (I.add(m), y = m.event.type.charAt(0), f = KW(m.event).json(), m.event.type === "track" && delete f.traits, m.event.type === "alias" && (f = X1t(A, f)), [2, Q.dispatch("".concat(B, "/").concat(y), U1t(A, f, e, t)).then(function() {
          return m;
        }).catch(function() {
          return s.pushWithBackoff(m), Zy(r, s, d, Zy), m;
        }).finally(function() {
          I.delete(m);
        })]);
      });
    });
  }
  var d = {
    name: "Segment.io",
    type: "destination",
    version: "0.1.0",
    isLoaded: function() {
      return !0;
    },
    load: function() {
      return Promise.resolve();
    },
    track: E,
    identify: E,
    page: E,
    alias: E,
    group: E,
    screen: E
  };
  return s.todo && Zy(r, s, d, Zy), d;
}
var S_, AwA, T1t = mIA(), ewA = (S_ = (AwA = T1t).__SEGMENT_INSPECTOR__) !== null && S_ !== void 0 ? S_ : AwA.__SEGMENT_INSPECTOR__ = {}, _1t = function(A) {
  var e;
  return (e = ewA.attach) === null || e === void 0 ? void 0 : e.call(ewA, A);
};
function q1t(A, e) {
  var t = e ?? DIA();
  return UX("".concat(t, "/v1/projects/").concat(A, "/settings")).then(function(i) {
    return i.ok ? i.json() : i.text().then(function(n) {
      throw new Error(n);
    });
  }).catch(function(i) {
    throw console.error(i.message), i;
  });
}
function O1t(A) {
  return N4A().NODE_ENV !== "test" && // just one integration means segmentio
  Object.keys(A.integrations).length > 1;
}
function j1t(A) {
  var e, t, i;
  return N4A().NODE_ENV !== "test" && ((i = (t = (e = A.middlewareSettings) === null || e === void 0 ? void 0 : e.routingRules) === null || t === void 0 ? void 0 : t.length) !== null && i !== void 0 ? i : 0) > 0;
}
function P1t(A, e) {
  DFt(A, e), fFt(A, e);
}
function $1t(A, e) {
  return UA(this, void 0, void 0, function() {
    return Ee(this, function(t) {
      switch (t.label) {
        case 0:
          return [4, wFt(A, e)];
        case 1:
          return t.sent(), GFt(A, e), e.clear(), [
            2
            /*return*/
          ];
      }
    });
  });
}
function AMt(A, e, t, i, n, o) {
  var g, s, I;
  return n === void 0 && (n = []), UA(this, void 0, void 0, function() {
    var r, a, C, B, l, Q, E, d, m, y, f, w, G, R, F, Z = this;
    return Ee(this, function(c) {
      switch (c.label) {
        case 0:
          return r = n == null ? void 0 : n.filter(function(J) {
            return typeof J == "object";
          }), a = n == null ? void 0 : n.filter(function(J) {
            return typeof J == "function" && typeof J.pluginName == "string";
          }), j1t(e) ? [4, Promise.resolve().then(() => yVt).then(function(J) {
            return J.tsubMiddleware(e.middlewareSettings.routingRules);
          })] : [3, 2];
        case 1:
          return B = c.sent(), [3, 3];
        case 2:
          B = void 0, c.label = 3;
        case 3:
          return C = B, O1t(e) || o.length > 0 ? [4, Promise.resolve().then(() => FVt).then(function(J) {
            return J.ajsDestinations(A, e, t.integrations, i, C, o);
          })] : [3, 5];
        case 4:
          return Q = c.sent(), [3, 6];
        case 5:
          Q = [], c.label = 6;
        case 6:
          return l = Q, e.legacyVideoPluginsEnabled ? [4, Promise.resolve().then(() => xVt).then(function(J) {
            return J.loadLegacyVideoPlugins(t);
          })] : [3, 8];
        case 7:
          c.sent(), c.label = 8;
        case 8:
          return !((g = i.plan) === null || g === void 0) && g.track ? [4, Promise.resolve().then(() => HVt).then(function(J) {
            var p;
            return J.schemaFilter((p = i.plan) === null || p === void 0 ? void 0 : p.track, e);
          })] : [3, 10];
        case 9:
          return d = c.sent(), [3, 11];
        case 10:
          d = void 0, c.label = 11;
        case 11:
          return E = d, m = Y4A(e, i), [4, L1t(e, t.integrations, m, i, C, a).catch(function() {
            return [];
          })];
        case 12:
          return y = c.sent(), f = zn(zn(zn([
            UFt
          ], r, !0), l, !0), y, !0), E && f.push(E), w = ((s = i.integrations) === null || s === void 0 ? void 0 : s.All) === !1 && !i.integrations["Segment.io"] || i.integrations && i.integrations["Segment.io"] === !1, w ? [3, 14] : (R = (G = f).push, [4, z1t(t, m["Segment.io"], e.integrations)]);
        case 13:
          R.apply(G, [c.sent()]), c.label = 14;
        case 14:
          return [4, t.register.apply(t, f)];
        case 15:
          return F = c.sent(), Object.entries((I = e.enabledMiddleware) !== null && I !== void 0 ? I : {}).some(function(J) {
            var p = J[1];
            return p;
          }) ? [4, Promise.resolve().then(() => ZVt).then(function(J) {
            var p = J.remoteMiddlewares;
            return UA(Z, void 0, void 0, function() {
              var N, v;
              return Ee(this, function(K) {
                switch (K.label) {
                  case 0:
                    return [4, p(F, e, i.obfuscate)];
                  case 1:
                    return N = K.sent(), v = N.map(function(U) {
                      return t.addSourceMiddleware(U);
                    }), [2, Promise.all(v)];
                }
              });
            });
          })] : [3, 17];
        case 16:
          c.sent(), c.label = 17;
        case 17:
          return [2, F];
      }
    });
  });
}
function eMt(A, e, t) {
  var i, n, o, g, s, I, r, a, C, B;
  return e === void 0 && (e = {}), UA(this, void 0, void 0, function() {
    var l, Q, E, d, m, y, f, w, G, R, F, Z;
    return Ee(this, function(c) {
      switch (c.label) {
        case 0:
          return e.disable === !0 ? [2, [new _bA(), iQ.system()]] : (e.globalAnalyticsKey && pFt(e.globalAnalyticsKey), A.cdnURL && MFt(A.cdnURL), e.initialPageview && t.push(new WW("page", [])), (i = A.cdnSettings) !== null && i !== void 0 ? (Q = i, [3, 3]) : [3, 1]);
        case 1:
          return [4, q1t(A.writeKey, A.cdnURL)];
        case 2:
          Q = c.sent(), c.label = 3;
        case 3:
          return l = Q, e.updateCDNSettings && (l = e.updateCDNSettings(l)), typeof e.disable != "function" ? [3, 5] : [4, e.disable(l)];
        case 4:
          if (E = c.sent(), E)
            return [2, [new _bA(), iQ.system()]];
          c.label = 5;
        case 5:
          return d = (o = (n = l.integrations["Segment.io"]) === null || n === void 0 ? void 0 : n.retryQueue) !== null && o !== void 0 ? o : !0, e = qA({ retryQueue: d }, e), m = new J4A(A, e), _1t(m), y = (g = A.plugins) !== null && g !== void 0 ? g : [], f = (s = A.classicIntegrations) !== null && s !== void 0 ? s : [], w = (I = e.integrations) === null || I === void 0 ? void 0 : I["Segment.io"], Q4A.initRemoteMetrics(qA(qA({}, l.metrics), { host: (r = w == null ? void 0 : w.apiHost) !== null && r !== void 0 ? r : (a = l.metrics) === null || a === void 0 ? void 0 : a.host, protocol: w == null ? void 0 : w.protocol })), P1t(m, t), [4, AMt(A.writeKey, l, m, e, y, f)];
        case 6:
          return G = c.sent(), R = (C = window.location.search) !== null && C !== void 0 ? C : "", F = (B = window.location.hash) !== null && B !== void 0 ? B : "", Z = R.length ? R : F.replace(/(?=#).*(?=\?)/, ""), Z.includes("ajs_") ? [4, m.queryString(Z).catch(console.error)] : [3, 8];
        case 7:
          c.sent(), c.label = 8;
        case 8:
          return m.initialized = !0, m.emit("initialize", A, e), [4, $1t(m, t)];
        case 9:
          return c.sent(), [2, [m, G]];
      }
    });
  });
}
var tMt = (
  /** @class */
  function(A) {
    la(e, A);
    function e() {
      var t = this, i = EIA(), n = i.promise, o = i.resolve;
      return t = A.call(this, function(g) {
        return n.then(function(s) {
          var I = s[0], r = s[1];
          return eMt(I, r, g);
        });
      }) || this, t._resolveLoadStart = function(g, s) {
        return o([g, s]);
      }, t;
    }
    return e.prototype.load = function(t, i) {
      return i === void 0 && (i = {}), this._resolveLoadStart(t, i), this;
    }, e.load = function(t, i) {
      return i === void 0 && (i = {}), new e().load(t, i);
    }, e.standalone = function(t, i) {
      return e.load({ writeKey: t }, i).then(function(n) {
        return n[0];
      });
    }, e;
  }(JFt)
);
const iMt = () => {
  var A = "", e = !1, t;
  return {
    setUserId: (g) => {
      A = g;
    },
    setOpen: (g) => {
      g && (t = tMt.load({ writeKey: "9gxTNvl6Pl4WaZ5aymeHEBqNN8K4Op0U" })), e = g;
    },
    track: (g, s) => {
      e && t.track(g, { ...s, userId: A });
    }
  };
}, lC = iMt();
function cC(A) {
  return cC = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, cC(A);
}
function Kl(A, e) {
  if (!(A instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function nMt(A, e) {
  if (cC(A) !== "object" || A === null)
    return A;
  var t = A[Symbol.toPrimitive];
  if (t !== void 0) {
    var i = t.call(A, e || "default");
    if (cC(i) !== "object")
      return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(A);
}
function V4A(A) {
  var e = nMt(A, "string");
  return cC(e) === "symbol" ? e : String(e);
}
function twA(A, e) {
  for (var t = 0; t < e.length; t++) {
    var i = e[t];
    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(A, V4A(i.key), i);
  }
}
function Ul(A, e, t) {
  return e && twA(A.prototype, e), t && twA(A, t), Object.defineProperty(A, "prototype", {
    writable: !1
  }), A;
}
function Fu(A) {
  if (A === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return A;
}
function X6(A, e) {
  return X6 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(i, n) {
    return i.__proto__ = n, i;
  }, X6(A, e);
}
function PX(A, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function");
  A.prototype = Object.create(e && e.prototype, {
    constructor: {
      value: A,
      writable: !0,
      configurable: !0
    }
  }), Object.defineProperty(A, "prototype", {
    writable: !1
  }), e && X6(A, e);
}
function G1(A, e) {
  if (e && (cC(e) === "object" || typeof e == "function"))
    return e;
  if (e !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return Fu(A);
}
function dl(A) {
  return dl = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
    return t.__proto__ || Object.getPrototypeOf(t);
  }, dl(A);
}
function gh(A, e, t) {
  return e = V4A(e), e in A ? Object.defineProperty(A, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : A[e] = t, A;
}
function oMt(A) {
  if (Array.isArray(A))
    return A;
}
function gMt(A) {
  if (typeof Symbol < "u" && A[Symbol.iterator] != null || A["@@iterator"] != null)
    return Array.from(A);
}
function iwA(A, e) {
  (e == null || e > A.length) && (e = A.length);
  for (var t = 0, i = new Array(e); t < e; t++)
    i[t] = A[t];
  return i;
}
function sMt(A, e) {
  if (A) {
    if (typeof A == "string")
      return iwA(A, e);
    var t = Object.prototype.toString.call(A).slice(8, -1);
    if (t === "Object" && A.constructor && (t = A.constructor.name), t === "Map" || t === "Set")
      return Array.from(A);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
      return iwA(A, e);
  }
}
function IMt() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function aMt(A) {
  return oMt(A) || gMt(A) || sMt(A) || IMt();
}
function nwA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function owA(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? nwA(Object(t), !0).forEach(function(i) {
      gh(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : nwA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
var rMt = {
  type: "logger",
  log: function(e) {
    this.output("log", e);
  },
  warn: function(e) {
    this.output("warn", e);
  },
  error: function(e) {
    this.output("error", e);
  },
  output: function(e, t) {
    console && console[e] && console[e].apply(console, t);
  }
}, CMt = function() {
  function A(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    Kl(this, A), this.init(e, t);
  }
  return Ul(A, [{
    key: "init",
    value: function(t) {
      var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      this.prefix = i.prefix || "i18next:", this.logger = t || rMt, this.options = i, this.debug = i.debug;
    }
  }, {
    key: "setDebug",
    value: function(t) {
      this.debug = t;
    }
  }, {
    key: "log",
    value: function() {
      for (var t = arguments.length, i = new Array(t), n = 0; n < t; n++)
        i[n] = arguments[n];
      return this.forward(i, "log", "", !0);
    }
  }, {
    key: "warn",
    value: function() {
      for (var t = arguments.length, i = new Array(t), n = 0; n < t; n++)
        i[n] = arguments[n];
      return this.forward(i, "warn", "", !0);
    }
  }, {
    key: "error",
    value: function() {
      for (var t = arguments.length, i = new Array(t), n = 0; n < t; n++)
        i[n] = arguments[n];
      return this.forward(i, "error", "");
    }
  }, {
    key: "deprecate",
    value: function() {
      for (var t = arguments.length, i = new Array(t), n = 0; n < t; n++)
        i[n] = arguments[n];
      return this.forward(i, "warn", "WARNING DEPRECATED: ", !0);
    }
  }, {
    key: "forward",
    value: function(t, i, n, o) {
      return o && !this.debug ? null : (typeof t[0] == "string" && (t[0] = "".concat(n).concat(this.prefix, " ").concat(t[0])), this.logger[i](t));
    }
  }, {
    key: "create",
    value: function(t) {
      return new A(this.logger, owA(owA({}, {
        prefix: "".concat(this.prefix, ":").concat(t, ":")
      }), this.options));
    }
  }, {
    key: "clone",
    value: function(t) {
      return t = t || this.options, t.prefix = t.prefix || this.prefix, new A(this.logger, t);
    }
  }]), A;
}(), MB = new CMt(), pd = function() {
  function A() {
    Kl(this, A), this.observers = {};
  }
  return Ul(A, [{
    key: "on",
    value: function(t, i) {
      var n = this;
      return t.split(" ").forEach(function(o) {
        n.observers[o] = n.observers[o] || [], n.observers[o].push(i);
      }), this;
    }
  }, {
    key: "off",
    value: function(t, i) {
      if (this.observers[t]) {
        if (!i) {
          delete this.observers[t];
          return;
        }
        this.observers[t] = this.observers[t].filter(function(n) {
          return n !== i;
        });
      }
    }
  }, {
    key: "emit",
    value: function(t) {
      for (var i = arguments.length, n = new Array(i > 1 ? i - 1 : 0), o = 1; o < i; o++)
        n[o - 1] = arguments[o];
      if (this.observers[t]) {
        var g = [].concat(this.observers[t]);
        g.forEach(function(I) {
          I.apply(void 0, n);
        });
      }
      if (this.observers["*"]) {
        var s = [].concat(this.observers["*"]);
        s.forEach(function(I) {
          I.apply(I, [t].concat(n));
        });
      }
    }
  }]), A;
}();
function gJ() {
  var A, e, t = new Promise(function(i, n) {
    A = i, e = n;
  });
  return t.resolve = A, t.reject = e, t;
}
function gwA(A) {
  return A == null ? "" : "" + A;
}
function BMt(A, e, t) {
  A.forEach(function(i) {
    e[i] && (t[i] = e[i]);
  });
}
function KIA(A, e, t) {
  function i(s) {
    return s && s.indexOf("###") > -1 ? s.replace(/###/g, ".") : s;
  }
  function n() {
    return !A || typeof A == "string";
  }
  for (var o = typeof e != "string" ? [].concat(e) : e.split("."); o.length > 1; ) {
    if (n())
      return {};
    var g = i(o.shift());
    !A[g] && t && (A[g] = new t()), Object.prototype.hasOwnProperty.call(A, g) ? A = A[g] : A = {};
  }
  return n() ? {} : {
    obj: A,
    k: i(o.shift())
  };
}
function swA(A, e, t) {
  var i = KIA(A, e, Object), n = i.obj, o = i.k;
  n[o] = t;
}
function lMt(A, e, t, i) {
  var n = KIA(A, e, Object), o = n.obj, g = n.k;
  o[g] = o[g] || [], i && (o[g] = o[g].concat(t)), i || o[g].push(t);
}
function UW(A, e) {
  var t = KIA(A, e), i = t.obj, n = t.k;
  if (i)
    return i[n];
}
function IwA(A, e, t) {
  var i = UW(A, t);
  return i !== void 0 ? i : UW(e, t);
}
function X4A(A, e, t) {
  for (var i in e)
    i !== "__proto__" && i !== "constructor" && (i in A ? typeof A[i] == "string" || A[i] instanceof String || typeof e[i] == "string" || e[i] instanceof String ? t && (A[i] = e[i]) : X4A(A[i], e[i], t) : A[i] = e[i]);
  return A;
}
function Wy(A) {
  return A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
var cMt = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;",
  "/": "&#x2F;"
};
function QMt(A) {
  return typeof A == "string" ? A.replace(/[&<>"'\/]/g, function(e) {
    return cMt[e];
  }) : A;
}
var $X = typeof window < "u" && window.navigator && typeof window.navigator.userAgentData > "u" && window.navigator.userAgent && window.navigator.userAgent.indexOf("MSIE") > -1, EMt = [" ", ",", "?", "!", ";"];
function uMt(A, e, t) {
  e = e || "", t = t || "";
  var i = EMt.filter(function(s) {
    return e.indexOf(s) < 0 && t.indexOf(s) < 0;
  });
  if (i.length === 0)
    return !0;
  var n = new RegExp("(".concat(i.map(function(s) {
    return s === "?" ? "\\?" : s;
  }).join("|"), ")")), o = !n.test(A);
  if (!o) {
    var g = A.indexOf(t);
    g > 0 && !n.test(A.substring(0, g)) && (o = !0);
  }
  return o;
}
function awA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function rL(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? awA(Object(t), !0).forEach(function(i) {
      gh(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : awA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function dMt(A) {
  var e = hMt();
  return function() {
    var i = dl(A), n;
    if (e) {
      var o = dl(this).constructor;
      n = Reflect.construct(i, arguments, o);
    } else
      n = i.apply(this, arguments);
    return G1(this, n);
  };
}
function hMt() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
    return !1;
  if (typeof Proxy == "function")
    return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function z4A(A, e) {
  var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
  if (A) {
    if (A[e])
      return A[e];
    for (var i = e.split(t), n = A, o = 0; o < i.length; ++o) {
      if (!n || typeof n[i[o]] == "string" && o + 1 < i.length)
        return;
      if (n[i[o]] === void 0) {
        for (var g = 2, s = i.slice(o, o + g).join(t), I = n[s]; I === void 0 && i.length > o + g; )
          g++, s = i.slice(o, o + g).join(t), I = n[s];
        if (I === void 0)
          return;
        if (I === null)
          return null;
        if (e.endsWith(s)) {
          if (typeof I == "string")
            return I;
          if (s && typeof I[s] == "string")
            return I[s];
        }
        var r = i.slice(o + g).join(t);
        return r ? z4A(I, r, t) : void 0;
      }
      n = n[i[o]];
    }
    return n;
  }
}
var mMt = function(A) {
  PX(t, A);
  var e = dMt(t);
  function t(i) {
    var n, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
      ns: ["translation"],
      defaultNS: "translation"
    };
    return Kl(this, t), n = e.call(this), $X && pd.call(Fu(n)), n.data = i || {}, n.options = o, n.options.keySeparator === void 0 && (n.options.keySeparator = "."), n.options.ignoreJSONStructure === void 0 && (n.options.ignoreJSONStructure = !0), n;
  }
  return Ul(t, [{
    key: "addNamespaces",
    value: function(n) {
      this.options.ns.indexOf(n) < 0 && this.options.ns.push(n);
    }
  }, {
    key: "removeNamespaces",
    value: function(n) {
      var o = this.options.ns.indexOf(n);
      o > -1 && this.options.ns.splice(o, 1);
    }
  }, {
    key: "getResource",
    value: function(n, o, g) {
      var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, I = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, r = s.ignoreJSONStructure !== void 0 ? s.ignoreJSONStructure : this.options.ignoreJSONStructure, a = [n, o];
      g && typeof g != "string" && (a = a.concat(g)), g && typeof g == "string" && (a = a.concat(I ? g.split(I) : g)), n.indexOf(".") > -1 && (a = n.split("."));
      var C = UW(this.data, a);
      return C || !r || typeof g != "string" ? C : z4A(this.data && this.data[n] && this.data[n][o], g, I);
    }
  }, {
    key: "addResource",
    value: function(n, o, g, s) {
      var I = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
        silent: !1
      }, r = this.options.keySeparator;
      r === void 0 && (r = ".");
      var a = [n, o];
      g && (a = a.concat(r ? g.split(r) : g)), n.indexOf(".") > -1 && (a = n.split("."), s = o, o = a[1]), this.addNamespaces(o), swA(this.data, a, s), I.silent || this.emit("added", n, o, g, s);
    }
  }, {
    key: "addResources",
    value: function(n, o, g) {
      var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
        silent: !1
      };
      for (var I in g)
        (typeof g[I] == "string" || Object.prototype.toString.apply(g[I]) === "[object Array]") && this.addResource(n, o, I, g[I], {
          silent: !0
        });
      s.silent || this.emit("added", n, o, g);
    }
  }, {
    key: "addResourceBundle",
    value: function(n, o, g, s, I) {
      var r = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
        silent: !1
      }, a = [n, o];
      n.indexOf(".") > -1 && (a = n.split("."), s = g, g = o, o = a[1]), this.addNamespaces(o);
      var C = UW(this.data, a) || {};
      s ? X4A(C, g, I) : C = rL(rL({}, C), g), swA(this.data, a, C), r.silent || this.emit("added", n, o, g);
    }
  }, {
    key: "removeResourceBundle",
    value: function(n, o) {
      this.hasResourceBundle(n, o) && delete this.data[n][o], this.removeNamespaces(o), this.emit("removed", n, o);
    }
  }, {
    key: "hasResourceBundle",
    value: function(n, o) {
      return this.getResource(n, o) !== void 0;
    }
  }, {
    key: "getResourceBundle",
    value: function(n, o) {
      return o || (o = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? rL(rL({}, {}), this.getResource(n, o)) : this.getResource(n, o);
    }
  }, {
    key: "getDataByLanguage",
    value: function(n) {
      return this.data[n];
    }
  }, {
    key: "hasLanguageSomeTranslations",
    value: function(n) {
      var o = this.getDataByLanguage(n), g = o && Object.keys(o) || [];
      return !!g.find(function(s) {
        return o[s] && Object.keys(o[s]).length > 0;
      });
    }
  }, {
    key: "toJSON",
    value: function() {
      return this.data;
    }
  }]), t;
}(pd), T4A = {
  processors: {},
  addPostProcessor: function(e) {
    this.processors[e.name] = e;
  },
  handle: function(e, t, i, n, o) {
    var g = this;
    return e.forEach(function(s) {
      g.processors[s] && (t = g.processors[s].process(t, i, n, o));
    }), t;
  }
};
function rwA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function Xg(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? rwA(Object(t), !0).forEach(function(i) {
      gh(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : rwA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function pMt(A) {
  var e = yMt();
  return function() {
    var i = dl(A), n;
    if (e) {
      var o = dl(this).constructor;
      n = Reflect.construct(i, arguments, o);
    } else
      n = i.apply(this, arguments);
    return G1(this, n);
  };
}
function yMt() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
    return !1;
  if (typeof Proxy == "function")
    return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
var CwA = {}, BwA = function(A) {
  PX(t, A);
  var e = pMt(t);
  function t(i) {
    var n, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return Kl(this, t), n = e.call(this), $X && pd.call(Fu(n)), BMt(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], i, Fu(n)), n.options = o, n.options.keySeparator === void 0 && (n.options.keySeparator = "."), n.logger = MB.create("translator"), n;
  }
  return Ul(t, [{
    key: "changeLanguage",
    value: function(n) {
      n && (this.language = n);
    }
  }, {
    key: "exists",
    value: function(n) {
      var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
        interpolation: {}
      };
      if (n == null)
        return !1;
      var g = this.resolve(n, o);
      return g && g.res !== void 0;
    }
  }, {
    key: "extractFromKey",
    value: function(n, o) {
      var g = o.nsSeparator !== void 0 ? o.nsSeparator : this.options.nsSeparator;
      g === void 0 && (g = ":");
      var s = o.keySeparator !== void 0 ? o.keySeparator : this.options.keySeparator, I = o.ns || this.options.defaultNS || [], r = g && n.indexOf(g) > -1, a = !this.options.userDefinedKeySeparator && !o.keySeparator && !this.options.userDefinedNsSeparator && !o.nsSeparator && !uMt(n, g, s);
      if (r && !a) {
        var C = n.match(this.interpolator.nestingRegexp);
        if (C && C.length > 0)
          return {
            key: n,
            namespaces: I
          };
        var B = n.split(g);
        (g !== s || g === s && this.options.ns.indexOf(B[0]) > -1) && (I = B.shift()), n = B.join(s);
      }
      return typeof I == "string" && (I = [I]), {
        key: n,
        namespaces: I
      };
    }
  }, {
    key: "translate",
    value: function(n, o, g) {
      var s = this;
      if (cC(o) !== "object" && this.options.overloadTranslationOptionHandler && (o = this.options.overloadTranslationOptionHandler(arguments)), o || (o = {}), n == null)
        return "";
      Array.isArray(n) || (n = [String(n)]);
      var I = o.returnDetails !== void 0 ? o.returnDetails : this.options.returnDetails, r = o.keySeparator !== void 0 ? o.keySeparator : this.options.keySeparator, a = this.extractFromKey(n[n.length - 1], o), C = a.key, B = a.namespaces, l = B[B.length - 1], Q = o.lng || this.language, E = o.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
      if (Q && Q.toLowerCase() === "cimode") {
        if (E) {
          var d = o.nsSeparator || this.options.nsSeparator;
          return I ? (m.res = "".concat(l).concat(d).concat(C), m) : "".concat(l).concat(d).concat(C);
        }
        return I ? (m.res = C, m) : C;
      }
      var m = this.resolve(n, o), y = m && m.res, f = m && m.usedKey || C, w = m && m.exactUsedKey || C, G = Object.prototype.toString.apply(y), R = ["[object Number]", "[object Function]", "[object RegExp]"], F = o.joinArrays !== void 0 ? o.joinArrays : this.options.joinArrays, Z = !this.i18nFormat || this.i18nFormat.handleAsObject, c = typeof y != "string" && typeof y != "boolean" && typeof y != "number";
      if (Z && y && c && R.indexOf(G) < 0 && !(typeof F == "string" && G === "[object Array]")) {
        if (!o.returnObjects && !this.options.returnObjects) {
          this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
          var J = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(f, y, Xg(Xg({}, o), {}, {
            ns: B
          })) : "key '".concat(C, " (").concat(this.language, ")' returned an object instead of string.");
          return I ? (m.res = J, m) : J;
        }
        if (r) {
          var p = G === "[object Array]", N = p ? [] : {}, v = p ? w : f;
          for (var K in y)
            if (Object.prototype.hasOwnProperty.call(y, K)) {
              var U = "".concat(v).concat(r).concat(K);
              N[K] = this.translate(U, Xg(Xg({}, o), {
                joinArrays: !1,
                ns: B
              })), N[K] === U && (N[K] = y[K]);
            }
          y = N;
        }
      } else if (Z && typeof F == "string" && G === "[object Array]")
        y = y.join(F), y && (y = this.extendTranslation(y, n, o, g));
      else {
        var j = !1, q = !1, O = o.count !== void 0 && typeof o.count != "string", $ = t.hasDefaultValue(o), _ = O ? this.pluralResolver.getSuffix(Q, o.count, o) : "", tA = o["defaultValue".concat(_)] || o.defaultValue;
        !this.isValidLookup(y) && $ && (j = !0, y = tA), this.isValidLookup(y) || (q = !0, y = C);
        var nA = o.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey, AA = nA && q ? void 0 : y, gA = $ && tA !== y && this.options.updateMissing;
        if (q || j || gA) {
          if (this.logger.log(gA ? "updateKey" : "missingKey", Q, l, C, gA ? tA : y), r) {
            var rA = this.resolve(C, Xg(Xg({}, o), {}, {
              keySeparator: !1
            }));
            rA && rA.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
          }
          var sA = [], lA = this.languageUtils.getFallbackCodes(this.options.fallbackLng, o.lng || this.language);
          if (this.options.saveMissingTo === "fallback" && lA && lA[0])
            for (var cA = 0; cA < lA.length; cA++)
              sA.push(lA[cA]);
          else
            this.options.saveMissingTo === "all" ? sA = this.languageUtils.toResolveHierarchy(o.lng || this.language) : sA.push(o.lng || this.language);
          var aA = function(hA, EA, RA) {
            var xA = $ && RA !== y ? RA : AA;
            s.options.missingKeyHandler ? s.options.missingKeyHandler(hA, l, EA, xA, gA, o) : s.backendConnector && s.backendConnector.saveMissing && s.backendConnector.saveMissing(hA, l, EA, xA, gA, o), s.emit("missingKey", hA, l, EA, y);
          };
          this.options.saveMissing && (this.options.saveMissingPlurals && O ? sA.forEach(function(QA) {
            s.pluralResolver.getSuffixes(QA, o).forEach(function(hA) {
              aA([QA], C + hA, o["defaultValue".concat(hA)] || tA);
            });
          }) : aA(sA, C, tA));
        }
        y = this.extendTranslation(y, n, o, m, g), q && y === C && this.options.appendNamespaceToMissingKey && (y = "".concat(l, ":").concat(C)), (q || j) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? y = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(l, ":").concat(C) : C, j ? y : void 0) : y = this.options.parseMissingKeyHandler(y));
      }
      return I ? (m.res = y, m) : y;
    }
  }, {
    key: "extendTranslation",
    value: function(n, o, g, s, I) {
      var r = this;
      if (this.i18nFormat && this.i18nFormat.parse)
        n = this.i18nFormat.parse(n, Xg(Xg({}, this.options.interpolation.defaultVariables), g), s.usedLng, s.usedNS, s.usedKey, {
          resolved: s
        });
      else if (!g.skipInterpolation) {
        g.interpolation && this.interpolator.init(Xg(Xg({}, g), {
          interpolation: Xg(Xg({}, this.options.interpolation), g.interpolation)
        }));
        var a = typeof n == "string" && (g && g.interpolation && g.interpolation.skipOnVariables !== void 0 ? g.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables), C;
        if (a) {
          var B = n.match(this.interpolator.nestingRegexp);
          C = B && B.length;
        }
        var l = g.replace && typeof g.replace != "string" ? g.replace : g;
        if (this.options.interpolation.defaultVariables && (l = Xg(Xg({}, this.options.interpolation.defaultVariables), l)), n = this.interpolator.interpolate(n, l, g.lng || this.language, g), a) {
          var Q = n.match(this.interpolator.nestingRegexp), E = Q && Q.length;
          C < E && (g.nest = !1);
        }
        g.nest !== !1 && (n = this.interpolator.nest(n, function() {
          for (var y = arguments.length, f = new Array(y), w = 0; w < y; w++)
            f[w] = arguments[w];
          return I && I[0] === f[0] && !g.context ? (r.logger.warn("It seems you are nesting recursively key: ".concat(f[0], " in key: ").concat(o[0])), null) : r.translate.apply(r, f.concat([o]));
        }, g)), g.interpolation && this.interpolator.reset();
      }
      var d = g.postProcess || this.options.postProcess, m = typeof d == "string" ? [d] : d;
      return n != null && m && m.length && g.applyPostProcessor !== !1 && (n = T4A.handle(m, n, o, this.options && this.options.postProcessPassResolved ? Xg({
        i18nResolved: s
      }, g) : g, this)), n;
    }
  }, {
    key: "resolve",
    value: function(n) {
      var o = this, g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, I, r, a, C;
      return typeof n == "string" && (n = [n]), n.forEach(function(B) {
        if (!o.isValidLookup(s)) {
          var l = o.extractFromKey(B, g), Q = l.key;
          I = Q;
          var E = l.namespaces;
          o.options.fallbackNS && (E = E.concat(o.options.fallbackNS));
          var d = g.count !== void 0 && typeof g.count != "string", m = d && !g.ordinal && g.count === 0 && o.pluralResolver.shouldUseIntlApi(), y = g.context !== void 0 && (typeof g.context == "string" || typeof g.context == "number") && g.context !== "", f = g.lngs ? g.lngs : o.languageUtils.toResolveHierarchy(g.lng || o.language, g.fallbackLng);
          E.forEach(function(w) {
            o.isValidLookup(s) || (C = w, !CwA["".concat(f[0], "-").concat(w)] && o.utils && o.utils.hasLoadedNamespace && !o.utils.hasLoadedNamespace(C) && (CwA["".concat(f[0], "-").concat(w)] = !0, o.logger.warn('key "'.concat(I, '" for languages "').concat(f.join(", "), `" won't get resolved as namespace "`).concat(C, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), f.forEach(function(G) {
              if (!o.isValidLookup(s)) {
                a = G;
                var R = [Q];
                if (o.i18nFormat && o.i18nFormat.addLookupKeys)
                  o.i18nFormat.addLookupKeys(R, Q, G, w, g);
                else {
                  var F;
                  d && (F = o.pluralResolver.getSuffix(G, g.count, g));
                  var Z = "".concat(o.options.pluralSeparator, "zero");
                  if (d && (R.push(Q + F), m && R.push(Q + Z)), y) {
                    var c = "".concat(Q).concat(o.options.contextSeparator).concat(g.context);
                    R.push(c), d && (R.push(c + F), m && R.push(c + Z));
                  }
                }
                for (var J; J = R.pop(); )
                  o.isValidLookup(s) || (r = J, s = o.getResource(G, w, J, g));
              }
            }));
          });
        }
      }), {
        res: s,
        usedKey: I,
        exactUsedKey: r,
        usedLng: a,
        usedNS: C
      };
    }
  }, {
    key: "isValidLookup",
    value: function(n) {
      return n !== void 0 && !(!this.options.returnNull && n === null) && !(!this.options.returnEmptyString && n === "");
    }
  }, {
    key: "getResource",
    value: function(n, o, g) {
      var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
      return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(n, o, g, s) : this.resourceStore.getResource(n, o, g, s);
    }
  }], [{
    key: "hasDefaultValue",
    value: function(n) {
      var o = "defaultValue";
      for (var g in n)
        if (Object.prototype.hasOwnProperty.call(n, g) && o === g.substring(0, o.length) && n[g] !== void 0)
          return !0;
      return !1;
    }
  }]), t;
}(pd);
function Z_(A) {
  return A.charAt(0).toUpperCase() + A.slice(1);
}
var bMt = function() {
  function A(e) {
    Kl(this, A), this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = MB.create("languageUtils");
  }
  return Ul(A, [{
    key: "getScriptPartFromCode",
    value: function(t) {
      if (!t || t.indexOf("-") < 0)
        return null;
      var i = t.split("-");
      return i.length === 2 || (i.pop(), i[i.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(i.join("-"));
    }
  }, {
    key: "getLanguagePartFromCode",
    value: function(t) {
      if (!t || t.indexOf("-") < 0)
        return t;
      var i = t.split("-");
      return this.formatLanguageCode(i[0]);
    }
  }, {
    key: "formatLanguageCode",
    value: function(t) {
      if (typeof t == "string" && t.indexOf("-") > -1) {
        var i = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"], n = t.split("-");
        return this.options.lowerCaseLng ? n = n.map(function(o) {
          return o.toLowerCase();
        }) : n.length === 2 ? (n[0] = n[0].toLowerCase(), n[1] = n[1].toUpperCase(), i.indexOf(n[1].toLowerCase()) > -1 && (n[1] = Z_(n[1].toLowerCase()))) : n.length === 3 && (n[0] = n[0].toLowerCase(), n[1].length === 2 && (n[1] = n[1].toUpperCase()), n[0] !== "sgn" && n[2].length === 2 && (n[2] = n[2].toUpperCase()), i.indexOf(n[1].toLowerCase()) > -1 && (n[1] = Z_(n[1].toLowerCase())), i.indexOf(n[2].toLowerCase()) > -1 && (n[2] = Z_(n[2].toLowerCase()))), n.join("-");
      }
      return this.options.cleanCode || this.options.lowerCaseLng ? t.toLowerCase() : t;
    }
  }, {
    key: "isSupportedCode",
    value: function(t) {
      return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (t = this.getLanguagePartFromCode(t)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(t) > -1;
    }
  }, {
    key: "getBestMatchFromCodes",
    value: function(t) {
      var i = this;
      if (!t)
        return null;
      var n;
      return t.forEach(function(o) {
        if (!n) {
          var g = i.formatLanguageCode(o);
          (!i.options.supportedLngs || i.isSupportedCode(g)) && (n = g);
        }
      }), !n && this.options.supportedLngs && t.forEach(function(o) {
        if (!n) {
          var g = i.getLanguagePartFromCode(o);
          if (i.isSupportedCode(g))
            return n = g;
          n = i.options.supportedLngs.find(function(s) {
            if (s.indexOf(g) === 0)
              return s;
          });
        }
      }), n || (n = this.getFallbackCodes(this.options.fallbackLng)[0]), n;
    }
  }, {
    key: "getFallbackCodes",
    value: function(t, i) {
      if (!t)
        return [];
      if (typeof t == "function" && (t = t(i)), typeof t == "string" && (t = [t]), Object.prototype.toString.apply(t) === "[object Array]")
        return t;
      if (!i)
        return t.default || [];
      var n = t[i];
      return n || (n = t[this.getScriptPartFromCode(i)]), n || (n = t[this.formatLanguageCode(i)]), n || (n = t[this.getLanguagePartFromCode(i)]), n || (n = t.default), n || [];
    }
  }, {
    key: "toResolveHierarchy",
    value: function(t, i) {
      var n = this, o = this.getFallbackCodes(i || this.options.fallbackLng || [], t), g = [], s = function(r) {
        r && (n.isSupportedCode(r) ? g.push(r) : n.logger.warn("rejecting language code not found in supportedLngs: ".concat(r)));
      };
      return typeof t == "string" && t.indexOf("-") > -1 ? (this.options.load !== "languageOnly" && s(this.formatLanguageCode(t)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && s(this.getScriptPartFromCode(t)), this.options.load !== "currentOnly" && s(this.getLanguagePartFromCode(t))) : typeof t == "string" && s(this.formatLanguageCode(t)), o.forEach(function(I) {
        g.indexOf(I) < 0 && s(n.formatLanguageCode(I));
      }), g;
    }
  }]), A;
}(), wMt = [{
  lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
  nr: [1, 2],
  fc: 1
}, {
  lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
  nr: [1, 2],
  fc: 2
}, {
  lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
  nr: [1],
  fc: 3
}, {
  lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
  nr: [1, 2, 5],
  fc: 4
}, {
  lngs: ["ar"],
  nr: [0, 1, 2, 3, 11, 100],
  fc: 5
}, {
  lngs: ["cs", "sk"],
  nr: [1, 2, 5],
  fc: 6
}, {
  lngs: ["csb", "pl"],
  nr: [1, 2, 5],
  fc: 7
}, {
  lngs: ["cy"],
  nr: [1, 2, 3, 8],
  fc: 8
}, {
  lngs: ["fr"],
  nr: [1, 2],
  fc: 9
}, {
  lngs: ["ga"],
  nr: [1, 2, 3, 7, 11],
  fc: 10
}, {
  lngs: ["gd"],
  nr: [1, 2, 3, 20],
  fc: 11
}, {
  lngs: ["is"],
  nr: [1, 2],
  fc: 12
}, {
  lngs: ["jv"],
  nr: [0, 1],
  fc: 13
}, {
  lngs: ["kw"],
  nr: [1, 2, 3, 4],
  fc: 14
}, {
  lngs: ["lt"],
  nr: [1, 2, 10],
  fc: 15
}, {
  lngs: ["lv"],
  nr: [1, 2, 0],
  fc: 16
}, {
  lngs: ["mk"],
  nr: [1, 2],
  fc: 17
}, {
  lngs: ["mnk"],
  nr: [0, 1, 2],
  fc: 18
}, {
  lngs: ["mt"],
  nr: [1, 2, 11, 20],
  fc: 19
}, {
  lngs: ["or"],
  nr: [2, 1],
  fc: 2
}, {
  lngs: ["ro"],
  nr: [1, 2, 20],
  fc: 20
}, {
  lngs: ["sl"],
  nr: [5, 1, 2, 3],
  fc: 21
}, {
  lngs: ["he", "iw"],
  nr: [1, 2, 20, 21],
  fc: 22
}], fMt = {
  1: function(e) {
    return Number(e > 1);
  },
  2: function(e) {
    return Number(e != 1);
  },
  3: function(e) {
    return 0;
  },
  4: function(e) {
    return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 10 || e % 100 >= 20) ? 1 : 2);
  },
  5: function(e) {
    return Number(e == 0 ? 0 : e == 1 ? 1 : e == 2 ? 2 : e % 100 >= 3 && e % 100 <= 10 ? 3 : e % 100 >= 11 ? 4 : 5);
  },
  6: function(e) {
    return Number(e == 1 ? 0 : e >= 2 && e <= 4 ? 1 : 2);
  },
  7: function(e) {
    return Number(e == 1 ? 0 : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 10 || e % 100 >= 20) ? 1 : 2);
  },
  8: function(e) {
    return Number(e == 1 ? 0 : e == 2 ? 1 : e != 8 && e != 11 ? 2 : 3);
  },
  9: function(e) {
    return Number(e >= 2);
  },
  10: function(e) {
    return Number(e == 1 ? 0 : e == 2 ? 1 : e < 7 ? 2 : e < 11 ? 3 : 4);
  },
  11: function(e) {
    return Number(e == 1 || e == 11 ? 0 : e == 2 || e == 12 ? 1 : e > 2 && e < 20 ? 2 : 3);
  },
  12: function(e) {
    return Number(e % 10 != 1 || e % 100 == 11);
  },
  13: function(e) {
    return Number(e !== 0);
  },
  14: function(e) {
    return Number(e == 1 ? 0 : e == 2 ? 1 : e == 3 ? 2 : 3);
  },
  15: function(e) {
    return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && (e % 100 < 10 || e % 100 >= 20) ? 1 : 2);
  },
  16: function(e) {
    return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e !== 0 ? 1 : 2);
  },
  17: function(e) {
    return Number(e == 1 || e % 10 == 1 && e % 100 != 11 ? 0 : 1);
  },
  18: function(e) {
    return Number(e == 0 ? 0 : e == 1 ? 1 : 2);
  },
  19: function(e) {
    return Number(e == 1 ? 0 : e == 0 || e % 100 > 1 && e % 100 < 11 ? 1 : e % 100 > 10 && e % 100 < 20 ? 2 : 3);
  },
  20: function(e) {
    return Number(e == 1 ? 0 : e == 0 || e % 100 > 0 && e % 100 < 20 ? 1 : 2);
  },
  21: function(e) {
    return Number(e % 100 == 1 ? 1 : e % 100 == 2 ? 2 : e % 100 == 3 || e % 100 == 4 ? 3 : 0);
  },
  22: function(e) {
    return Number(e == 1 ? 0 : e == 2 ? 1 : (e < 0 || e > 10) && e % 10 == 0 ? 2 : 3);
  }
}, DMt = ["v1", "v2", "v3"], lwA = {
  zero: 0,
  one: 1,
  two: 2,
  few: 3,
  many: 4,
  other: 5
};
function GMt() {
  var A = {};
  return wMt.forEach(function(e) {
    e.lngs.forEach(function(t) {
      A[t] = {
        numbers: e.nr,
        plurals: fMt[e.fc]
      };
    });
  }), A;
}
var kMt = function() {
  function A(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    Kl(this, A), this.languageUtils = e, this.options = t, this.logger = MB.create("pluralResolver"), (!this.options.compatibilityJSON || this.options.compatibilityJSON === "v4") && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = GMt();
  }
  return Ul(A, [{
    key: "addRule",
    value: function(t, i) {
      this.rules[t] = i;
    }
  }, {
    key: "getRule",
    value: function(t) {
      var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      if (this.shouldUseIntlApi())
        try {
          return new Intl.PluralRules(t, {
            type: i.ordinal ? "ordinal" : "cardinal"
          });
        } catch {
          return;
        }
      return this.rules[t] || this.rules[this.languageUtils.getLanguagePartFromCode(t)];
    }
  }, {
    key: "needsPlural",
    value: function(t) {
      var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(t, i);
      return this.shouldUseIntlApi() ? n && n.resolvedOptions().pluralCategories.length > 1 : n && n.numbers.length > 1;
    }
  }, {
    key: "getPluralFormsOfKey",
    value: function(t, i) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      return this.getSuffixes(t, n).map(function(o) {
        return "".concat(i).concat(o);
      });
    }
  }, {
    key: "getSuffixes",
    value: function(t) {
      var i = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = this.getRule(t, n);
      return o ? this.shouldUseIntlApi() ? o.resolvedOptions().pluralCategories.sort(function(g, s) {
        return lwA[g] - lwA[s];
      }).map(function(g) {
        return "".concat(i.options.prepend).concat(g);
      }) : o.numbers.map(function(g) {
        return i.getSuffix(t, g, n);
      }) : [];
    }
  }, {
    key: "getSuffix",
    value: function(t, i) {
      var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = this.getRule(t, n);
      return o ? this.shouldUseIntlApi() ? "".concat(this.options.prepend).concat(o.select(i)) : this.getSuffixRetroCompatible(o, i) : (this.logger.warn("no plural rule found for: ".concat(t)), "");
    }
  }, {
    key: "getSuffixRetroCompatible",
    value: function(t, i) {
      var n = this, o = t.noAbs ? t.plurals(i) : t.plurals(Math.abs(i)), g = t.numbers[o];
      this.options.simplifyPluralSuffix && t.numbers.length === 2 && t.numbers[0] === 1 && (g === 2 ? g = "plural" : g === 1 && (g = ""));
      var s = function() {
        return n.options.prepend && g.toString() ? n.options.prepend + g.toString() : g.toString();
      };
      return this.options.compatibilityJSON === "v1" ? g === 1 ? "" : typeof g == "number" ? "_plural_".concat(g.toString()) : s() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && t.numbers.length === 2 && t.numbers[0] === 1 ? s() : this.options.prepend && o.toString() ? this.options.prepend + o.toString() : o.toString();
    }
  }, {
    key: "shouldUseIntlApi",
    value: function() {
      return !DMt.includes(this.options.compatibilityJSON);
    }
  }]), A;
}();
function cwA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function Gr(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? cwA(Object(t), !0).forEach(function(i) {
      gh(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : cwA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
var JMt = function() {
  function A() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    Kl(this, A), this.logger = MB.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || function(t) {
      return t;
    }, this.init(e);
  }
  return Ul(A, [{
    key: "init",
    value: function() {
      var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      t.interpolation || (t.interpolation = {
        escapeValue: !0
      });
      var i = t.interpolation;
      this.escape = i.escape !== void 0 ? i.escape : QMt, this.escapeValue = i.escapeValue !== void 0 ? i.escapeValue : !0, this.useRawValueToEscape = i.useRawValueToEscape !== void 0 ? i.useRawValueToEscape : !1, this.prefix = i.prefix ? Wy(i.prefix) : i.prefixEscaped || "{{", this.suffix = i.suffix ? Wy(i.suffix) : i.suffixEscaped || "}}", this.formatSeparator = i.formatSeparator ? i.formatSeparator : i.formatSeparator || ",", this.unescapePrefix = i.unescapeSuffix ? "" : i.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : i.unescapeSuffix || "", this.nestingPrefix = i.nestingPrefix ? Wy(i.nestingPrefix) : i.nestingPrefixEscaped || Wy("$t("), this.nestingSuffix = i.nestingSuffix ? Wy(i.nestingSuffix) : i.nestingSuffixEscaped || Wy(")"), this.nestingOptionsSeparator = i.nestingOptionsSeparator ? i.nestingOptionsSeparator : i.nestingOptionsSeparator || ",", this.maxReplaces = i.maxReplaces ? i.maxReplaces : 1e3, this.alwaysFormat = i.alwaysFormat !== void 0 ? i.alwaysFormat : !1, this.resetRegExp();
    }
  }, {
    key: "reset",
    value: function() {
      this.options && this.init(this.options);
    }
  }, {
    key: "resetRegExp",
    value: function() {
      var t = "".concat(this.prefix, "(.+?)").concat(this.suffix);
      this.regexp = new RegExp(t, "g");
      var i = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
      this.regexpUnescape = new RegExp(i, "g");
      var n = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
      this.nestingRegexp = new RegExp(n, "g");
    }
  }, {
    key: "interpolate",
    value: function(t, i, n, o) {
      var g = this, s, I, r, a = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
      function C(d) {
        return d.replace(/\$/g, "$$$$");
      }
      var B = function(m) {
        if (m.indexOf(g.formatSeparator) < 0) {
          var y = IwA(i, a, m);
          return g.alwaysFormat ? g.format(y, void 0, n, Gr(Gr(Gr({}, o), i), {}, {
            interpolationkey: m
          })) : y;
        }
        var f = m.split(g.formatSeparator), w = f.shift().trim(), G = f.join(g.formatSeparator).trim();
        return g.format(IwA(i, a, w), G, n, Gr(Gr(Gr({}, o), i), {}, {
          interpolationkey: w
        }));
      };
      this.resetRegExp();
      var l = o && o.missingInterpolationHandler || this.options.missingInterpolationHandler, Q = o && o.interpolation && o.interpolation.skipOnVariables !== void 0 ? o.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables, E = [{
        regex: this.regexpUnescape,
        safeValue: function(m) {
          return C(m);
        }
      }, {
        regex: this.regexp,
        safeValue: function(m) {
          return g.escapeValue ? C(g.escape(m)) : C(m);
        }
      }];
      return E.forEach(function(d) {
        for (r = 0; s = d.regex.exec(t); ) {
          var m = s[1].trim();
          if (I = B(m), I === void 0)
            if (typeof l == "function") {
              var y = l(t, s, o);
              I = typeof y == "string" ? y : "";
            } else if (o && o.hasOwnProperty(m))
              I = "";
            else if (Q) {
              I = s[0];
              continue;
            } else
              g.logger.warn("missed to pass in variable ".concat(m, " for interpolating ").concat(t)), I = "";
          else
            typeof I != "string" && !g.useRawValueToEscape && (I = gwA(I));
          var f = d.safeValue(I);
          if (t = t.replace(s[0], f), Q ? (d.regex.lastIndex += I.length, d.regex.lastIndex -= s[0].length) : d.regex.lastIndex = 0, r++, r >= g.maxReplaces)
            break;
        }
      }), t;
    }
  }, {
    key: "nest",
    value: function(t, i) {
      var n = this, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, g, s, I = Gr({}, o);
      I.applyPostProcessor = !1, delete I.defaultValue;
      function r(l, Q) {
        var E = this.nestingOptionsSeparator;
        if (l.indexOf(E) < 0)
          return l;
        var d = l.split(new RegExp("".concat(E, "[ ]*{"))), m = "{".concat(d[1]);
        l = d[0], m = this.interpolate(m, I);
        var y = m.match(/'/g), f = m.match(/"/g);
        (y && y.length % 2 === 0 && !f || f.length % 2 !== 0) && (m = m.replace(/'/g, '"'));
        try {
          I = JSON.parse(m), Q && (I = Gr(Gr({}, Q), I));
        } catch (w) {
          return this.logger.warn("failed parsing options string in nesting for key ".concat(l), w), "".concat(l).concat(E).concat(m);
        }
        return delete I.defaultValue, l;
      }
      for (; g = this.nestingRegexp.exec(t); ) {
        var a = [], C = !1;
        if (g[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(g[1])) {
          var B = g[1].split(this.formatSeparator).map(function(l) {
            return l.trim();
          });
          g[1] = B.shift(), a = B, C = !0;
        }
        if (s = i(r.call(this, g[1].trim(), I), I), s && g[0] === t && typeof s != "string")
          return s;
        typeof s != "string" && (s = gwA(s)), s || (this.logger.warn("missed to resolve ".concat(g[1], " for nesting ").concat(t)), s = ""), C && (s = a.reduce(function(l, Q) {
          return n.format(l, Q, o.lng, Gr(Gr({}, o), {}, {
            interpolationkey: g[1].trim()
          }));
        }, s.trim())), t = t.replace(g[0], s), this.regexp.lastIndex = 0;
      }
      return t;
    }
  }]), A;
}();
function QwA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function pE(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? QwA(Object(t), !0).forEach(function(i) {
      gh(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : QwA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function NMt(A) {
  var e = A.toLowerCase().trim(), t = {};
  if (A.indexOf("(") > -1) {
    var i = A.split("(");
    e = i[0].toLowerCase().trim();
    var n = i[1].substring(0, i[1].length - 1);
    if (e === "currency" && n.indexOf(":") < 0)
      t.currency || (t.currency = n.trim());
    else if (e === "relativetime" && n.indexOf(":") < 0)
      t.range || (t.range = n.trim());
    else {
      var o = n.split(";");
      o.forEach(function(g) {
        if (g) {
          var s = g.split(":"), I = aMt(s), r = I[0], a = I.slice(1), C = a.join(":").trim().replace(/^'+|'+$/g, "");
          t[r.trim()] || (t[r.trim()] = C), C === "false" && (t[r.trim()] = !1), C === "true" && (t[r.trim()] = !0), isNaN(C) || (t[r.trim()] = parseInt(C, 10));
        }
      });
    }
  }
  return {
    formatName: e,
    formatOptions: t
  };
}
function Ky(A) {
  var e = {};
  return function(i, n, o) {
    var g = n + JSON.stringify(o), s = e[g];
    return s || (s = A(n, o), e[g] = s), s(i);
  };
}
var YMt = function() {
  function A() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    Kl(this, A), this.logger = MB.create("formatter"), this.options = e, this.formats = {
      number: Ky(function(t, i) {
        var n = new Intl.NumberFormat(t, i);
        return function(o) {
          return n.format(o);
        };
      }),
      currency: Ky(function(t, i) {
        var n = new Intl.NumberFormat(t, pE(pE({}, i), {}, {
          style: "currency"
        }));
        return function(o) {
          return n.format(o);
        };
      }),
      datetime: Ky(function(t, i) {
        var n = new Intl.DateTimeFormat(t, pE({}, i));
        return function(o) {
          return n.format(o);
        };
      }),
      relativetime: Ky(function(t, i) {
        var n = new Intl.RelativeTimeFormat(t, pE({}, i));
        return function(o) {
          return n.format(o, i.range || "day");
        };
      }),
      list: Ky(function(t, i) {
        var n = new Intl.ListFormat(t, pE({}, i));
        return function(o) {
          return n.format(o);
        };
      })
    }, this.init(e);
  }
  return Ul(A, [{
    key: "init",
    value: function(t) {
      var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
        interpolation: {}
      }, n = i.interpolation;
      this.formatSeparator = n.formatSeparator ? n.formatSeparator : n.formatSeparator || ",";
    }
  }, {
    key: "add",
    value: function(t, i) {
      this.formats[t.toLowerCase().trim()] = i;
    }
  }, {
    key: "addCached",
    value: function(t, i) {
      this.formats[t.toLowerCase().trim()] = Ky(i);
    }
  }, {
    key: "format",
    value: function(t, i, n, o) {
      var g = this, s = i.split(this.formatSeparator), I = s.reduce(function(r, a) {
        var C = NMt(a), B = C.formatName, l = C.formatOptions;
        if (g.formats[B]) {
          var Q = r;
          try {
            var E = o && o.formatParams && o.formatParams[o.interpolationkey] || {}, d = E.locale || E.lng || o.locale || o.lng || n;
            Q = g.formats[B](r, d, pE(pE(pE({}, l), o), E));
          } catch (m) {
            g.logger.warn(m);
          }
          return Q;
        } else
          g.logger.warn("there was no format function for ".concat(B));
        return r;
      }, t);
      return I;
    }
  }]), A;
}();
function EwA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function uwA(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? EwA(Object(t), !0).forEach(function(i) {
      gh(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : EwA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function RMt(A) {
  var e = FMt();
  return function() {
    var i = dl(A), n;
    if (e) {
      var o = dl(this).constructor;
      n = Reflect.construct(i, arguments, o);
    } else
      n = i.apply(this, arguments);
    return G1(this, n);
  };
}
function FMt() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
    return !1;
  if (typeof Proxy == "function")
    return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function MMt(A, e) {
  A.pending[e] !== void 0 && (delete A.pending[e], A.pendingCount--);
}
var xMt = function(A) {
  PX(t, A);
  var e = RMt(t);
  function t(i, n, o) {
    var g, s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
    return Kl(this, t), g = e.call(this), $X && pd.call(Fu(g)), g.backend = i, g.store = n, g.services = o, g.languageUtils = o.languageUtils, g.options = s, g.logger = MB.create("backendConnector"), g.waitingReads = [], g.maxParallelReads = s.maxParallelReads || 10, g.readingCalls = 0, g.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, g.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, g.state = {}, g.queue = [], g.backend && g.backend.init && g.backend.init(o, s.backend, s), g;
  }
  return Ul(t, [{
    key: "queueLoad",
    value: function(n, o, g, s) {
      var I = this, r = {}, a = {}, C = {}, B = {};
      return n.forEach(function(l) {
        var Q = !0;
        o.forEach(function(E) {
          var d = "".concat(l, "|").concat(E);
          !g.reload && I.store.hasResourceBundle(l, E) ? I.state[d] = 2 : I.state[d] < 0 || (I.state[d] === 1 ? a[d] === void 0 && (a[d] = !0) : (I.state[d] = 1, Q = !1, a[d] === void 0 && (a[d] = !0), r[d] === void 0 && (r[d] = !0), B[E] === void 0 && (B[E] = !0)));
        }), Q || (C[l] = !0);
      }), (Object.keys(r).length || Object.keys(a).length) && this.queue.push({
        pending: a,
        pendingCount: Object.keys(a).length,
        loaded: {},
        errors: [],
        callback: s
      }), {
        toLoad: Object.keys(r),
        pending: Object.keys(a),
        toLoadLanguages: Object.keys(C),
        toLoadNamespaces: Object.keys(B)
      };
    }
  }, {
    key: "loaded",
    value: function(n, o, g) {
      var s = n.split("|"), I = s[0], r = s[1];
      o && this.emit("failedLoading", I, r, o), g && this.store.addResourceBundle(I, r, g), this.state[n] = o ? -1 : 2;
      var a = {};
      this.queue.forEach(function(C) {
        lMt(C.loaded, [I], r), MMt(C, n), o && C.errors.push(o), C.pendingCount === 0 && !C.done && (Object.keys(C.loaded).forEach(function(B) {
          a[B] || (a[B] = {});
          var l = C.loaded[B];
          l.length && l.forEach(function(Q) {
            a[B][Q] === void 0 && (a[B][Q] = !0);
          });
        }), C.done = !0, C.errors.length ? C.callback(C.errors) : C.callback());
      }), this.emit("loaded", a), this.queue = this.queue.filter(function(C) {
        return !C.done;
      });
    }
  }, {
    key: "read",
    value: function(n, o, g) {
      var s = this, I = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
      if (!n.length)
        return a(null, {});
      if (this.readingCalls >= this.maxParallelReads) {
        this.waitingReads.push({
          lng: n,
          ns: o,
          fcName: g,
          tried: I,
          wait: r,
          callback: a
        });
        return;
      }
      return this.readingCalls++, this.backend[g](n, o, function(C, B) {
        if (s.readingCalls--, s.waitingReads.length > 0) {
          var l = s.waitingReads.shift();
          s.read(l.lng, l.ns, l.fcName, l.tried, l.wait, l.callback);
        }
        if (C && B && I < s.maxRetries) {
          setTimeout(function() {
            s.read.call(s, n, o, g, I + 1, r * 2, a);
          }, r);
          return;
        }
        a(C, B);
      });
    }
  }, {
    key: "prepareLoading",
    value: function(n, o) {
      var g = this, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, I = arguments.length > 3 ? arguments[3] : void 0;
      if (!this.backend)
        return this.logger.warn("No backend was added via i18next.use. Will not load resources."), I && I();
      typeof n == "string" && (n = this.languageUtils.toResolveHierarchy(n)), typeof o == "string" && (o = [o]);
      var r = this.queueLoad(n, o, s, I);
      if (!r.toLoad.length)
        return r.pending.length || I(), null;
      r.toLoad.forEach(function(a) {
        g.loadOne(a);
      });
    }
  }, {
    key: "load",
    value: function(n, o, g) {
      this.prepareLoading(n, o, {}, g);
    }
  }, {
    key: "reload",
    value: function(n, o, g) {
      this.prepareLoading(n, o, {
        reload: !0
      }, g);
    }
  }, {
    key: "loadOne",
    value: function(n) {
      var o = this, g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", s = n.split("|"), I = s[0], r = s[1];
      this.read(I, r, "read", void 0, void 0, function(a, C) {
        a && o.logger.warn("".concat(g, "loading namespace ").concat(r, " for language ").concat(I, " failed"), a), !a && C && o.logger.log("".concat(g, "loaded namespace ").concat(r, " for language ").concat(I), C), o.loaded(n, a, C);
      });
    }
  }, {
    key: "saveMissing",
    value: function(n, o, g, s, I) {
      var r = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
      if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(o)) {
        this.logger.warn('did not save key "'.concat(g, '" as the namespace "').concat(o, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
        return;
      }
      g == null || g === "" || (this.backend && this.backend.create && this.backend.create(n, o, g, s, null, uwA(uwA({}, r), {}, {
        isUpdate: I
      })), !(!n || !n[0]) && this.store.addResource(n[0], o, g, s));
    }
  }]), t;
}(pd);
function LMt() {
  return {
    debug: !1,
    initImmediate: !0,
    ns: ["translation"],
    defaultNS: ["translation"],
    fallbackLng: ["dev"],
    fallbackNS: !1,
    supportedLngs: !1,
    nonExplicitSupportedLngs: !1,
    load: "all",
    preload: !1,
    simplifyPluralSuffix: !0,
    keySeparator: ".",
    nsSeparator: ":",
    pluralSeparator: "_",
    contextSeparator: "_",
    partialBundledLanguages: !1,
    saveMissing: !1,
    updateMissing: !1,
    saveMissingTo: "fallback",
    saveMissingPlurals: !0,
    missingKeyHandler: !1,
    missingInterpolationHandler: !1,
    postProcess: !1,
    postProcessPassResolved: !1,
    returnNull: !0,
    returnEmptyString: !0,
    returnObjects: !1,
    joinArrays: !1,
    returnedObjectHandler: !1,
    parseMissingKeyHandler: !1,
    appendNamespaceToMissingKey: !1,
    appendNamespaceToCIMode: !1,
    overloadTranslationOptionHandler: function(e) {
      var t = {};
      if (cC(e[1]) === "object" && (t = e[1]), typeof e[1] == "string" && (t.defaultValue = e[1]), typeof e[2] == "string" && (t.tDescription = e[2]), cC(e[2]) === "object" || cC(e[3]) === "object") {
        var i = e[3] || e[2];
        Object.keys(i).forEach(function(n) {
          t[n] = i[n];
        });
      }
      return t;
    },
    interpolation: {
      escapeValue: !0,
      format: function(e, t, i, n) {
        return e;
      },
      prefix: "{{",
      suffix: "}}",
      formatSeparator: ",",
      unescapePrefix: "-",
      nestingPrefix: "$t(",
      nestingSuffix: ")",
      nestingOptionsSeparator: ",",
      maxReplaces: 1e3,
      skipOnVariables: !0
    }
  };
}
function dwA(A) {
  return typeof A.ns == "string" && (A.ns = [A.ns]), typeof A.fallbackLng == "string" && (A.fallbackLng = [A.fallbackLng]), typeof A.fallbackNS == "string" && (A.fallbackNS = [A.fallbackNS]), A.supportedLngs && A.supportedLngs.indexOf("cimode") < 0 && (A.supportedLngs = A.supportedLngs.concat(["cimode"])), A;
}
function hwA(A, e) {
  var t = Object.keys(A);
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(A);
    e && (i = i.filter(function(n) {
      return Object.getOwnPropertyDescriptor(A, n).enumerable;
    })), t.push.apply(t, i);
  }
  return t;
}
function AB(A) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? hwA(Object(t), !0).forEach(function(i) {
      gh(A, i, t[i]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A, Object.getOwnPropertyDescriptors(t)) : hwA(Object(t)).forEach(function(i) {
      Object.defineProperty(A, i, Object.getOwnPropertyDescriptor(t, i));
    });
  }
  return A;
}
function vMt(A) {
  var e = HMt();
  return function() {
    var i = dl(A), n;
    if (e) {
      var o = dl(this).constructor;
      n = Reflect.construct(i, arguments, o);
    } else
      n = i.apply(this, arguments);
    return G1(this, n);
  };
}
function HMt() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
    return !1;
  if (typeof Proxy == "function")
    return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function CL() {
}
function SMt(A) {
  var e = Object.getOwnPropertyNames(Object.getPrototypeOf(A));
  e.forEach(function(t) {
    typeof A[t] == "function" && (A[t] = A[t].bind(A));
  });
}
var VW = function(A) {
  PX(t, A);
  var e = vMt(t);
  function t() {
    var i, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 ? arguments[1] : void 0;
    if (Kl(this, t), i = e.call(this), $X && pd.call(Fu(i)), i.options = dwA(n), i.services = {}, i.logger = MB, i.modules = {
      external: []
    }, SMt(Fu(i)), o && !i.isInitialized && !n.isClone) {
      if (!i.options.initImmediate)
        return i.init(n, o), G1(i, Fu(i));
      setTimeout(function() {
        i.init(n, o);
      }, 0);
    }
    return i;
  }
  return Ul(t, [{
    key: "init",
    value: function() {
      var n = this, o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, g = arguments.length > 1 ? arguments[1] : void 0;
      typeof o == "function" && (g = o, o = {}), !o.defaultNS && o.defaultNS !== !1 && o.ns && (typeof o.ns == "string" ? o.defaultNS = o.ns : o.ns.indexOf("translation") < 0 && (o.defaultNS = o.ns[0]));
      var s = LMt();
      this.options = AB(AB(AB({}, s), this.options), dwA(o)), this.options.compatibilityAPI !== "v1" && (this.options.interpolation = AB(AB({}, s.interpolation), this.options.interpolation)), o.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = o.keySeparator), o.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = o.nsSeparator);
      function I(m) {
        return m ? typeof m == "function" ? new m() : m : null;
      }
      if (!this.options.isClone) {
        this.modules.logger ? MB.init(I(this.modules.logger), this.options) : MB.init(null, this.options);
        var r;
        this.modules.formatter ? r = this.modules.formatter : typeof Intl < "u" && (r = YMt);
        var a = new bMt(this.options);
        this.store = new mMt(this.options.resources, this.options);
        var C = this.services;
        C.logger = MB, C.resourceStore = this.store, C.languageUtils = a, C.pluralResolver = new kMt(a, {
          prepend: this.options.pluralSeparator,
          compatibilityJSON: this.options.compatibilityJSON,
          simplifyPluralSuffix: this.options.simplifyPluralSuffix
        }), r && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (C.formatter = I(r), C.formatter.init(C, this.options), this.options.interpolation.format = C.formatter.format.bind(C.formatter)), C.interpolator = new JMt(this.options), C.utils = {
          hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
        }, C.backendConnector = new xMt(I(this.modules.backend), C.resourceStore, C, this.options), C.backendConnector.on("*", function(m) {
          for (var y = arguments.length, f = new Array(y > 1 ? y - 1 : 0), w = 1; w < y; w++)
            f[w - 1] = arguments[w];
          n.emit.apply(n, [m].concat(f));
        }), this.modules.languageDetector && (C.languageDetector = I(this.modules.languageDetector), C.languageDetector.init(C, this.options.detection, this.options)), this.modules.i18nFormat && (C.i18nFormat = I(this.modules.i18nFormat), C.i18nFormat.init && C.i18nFormat.init(this)), this.translator = new BwA(this.services, this.options), this.translator.on("*", function(m) {
          for (var y = arguments.length, f = new Array(y > 1 ? y - 1 : 0), w = 1; w < y; w++)
            f[w - 1] = arguments[w];
          n.emit.apply(n, [m].concat(f));
        }), this.modules.external.forEach(function(m) {
          m.init && m.init(n);
        });
      }
      if (this.format = this.options.interpolation.format, g || (g = CL), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
        var B = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
        B.length > 0 && B[0] !== "dev" && (this.options.lng = B[0]);
      }
      !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined");
      var l = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"];
      l.forEach(function(m) {
        n[m] = function() {
          var y;
          return (y = n.store)[m].apply(y, arguments);
        };
      });
      var Q = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"];
      Q.forEach(function(m) {
        n[m] = function() {
          var y;
          return (y = n.store)[m].apply(y, arguments), n;
        };
      });
      var E = gJ(), d = function() {
        var y = function(w, G) {
          n.isInitialized && !n.initializedStoreOnce && n.logger.warn("init: i18next is already initialized. You should call init just once!"), n.isInitialized = !0, n.options.isClone || n.logger.log("initialized", n.options), n.emit("initialized", n.options), E.resolve(G), g(w, G);
        };
        if (n.languages && n.options.compatibilityAPI !== "v1" && !n.isInitialized)
          return y(null, n.t.bind(n));
        n.changeLanguage(n.options.lng, y);
      };
      return this.options.resources || !this.options.initImmediate ? d() : setTimeout(d, 0), E;
    }
  }, {
    key: "loadResources",
    value: function(n) {
      var o = this, g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : CL, s = g, I = typeof n == "string" ? n : this.language;
      if (typeof n == "function" && (s = n), !this.options.resources || this.options.partialBundledLanguages) {
        if (I && I.toLowerCase() === "cimode")
          return s();
        var r = [], a = function(l) {
          if (l) {
            var Q = o.services.languageUtils.toResolveHierarchy(l);
            Q.forEach(function(E) {
              r.indexOf(E) < 0 && r.push(E);
            });
          }
        };
        if (I)
          a(I);
        else {
          var C = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
          C.forEach(function(B) {
            return a(B);
          });
        }
        this.options.preload && this.options.preload.forEach(function(B) {
          return a(B);
        }), this.services.backendConnector.load(r, this.options.ns, function(B) {
          !B && !o.resolvedLanguage && o.language && o.setResolvedLanguage(o.language), s(B);
        });
      } else
        s(null);
    }
  }, {
    key: "reloadResources",
    value: function(n, o, g) {
      var s = gJ();
      return n || (n = this.languages), o || (o = this.options.ns), g || (g = CL), this.services.backendConnector.reload(n, o, function(I) {
        s.resolve(), g(I);
      }), s;
    }
  }, {
    key: "use",
    value: function(n) {
      if (!n)
        throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
      if (!n.type)
        throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
      return n.type === "backend" && (this.modules.backend = n), (n.type === "logger" || n.log && n.warn && n.error) && (this.modules.logger = n), n.type === "languageDetector" && (this.modules.languageDetector = n), n.type === "i18nFormat" && (this.modules.i18nFormat = n), n.type === "postProcessor" && T4A.addPostProcessor(n), n.type === "formatter" && (this.modules.formatter = n), n.type === "3rdParty" && this.modules.external.push(n), this;
    }
  }, {
    key: "setResolvedLanguage",
    value: function(n) {
      if (!(!n || !this.languages) && !(["cimode", "dev"].indexOf(n) > -1))
        for (var o = 0; o < this.languages.length; o++) {
          var g = this.languages[o];
          if (!(["cimode", "dev"].indexOf(g) > -1) && this.store.hasLanguageSomeTranslations(g)) {
            this.resolvedLanguage = g;
            break;
          }
        }
    }
  }, {
    key: "changeLanguage",
    value: function(n, o) {
      var g = this;
      this.isLanguageChangingTo = n;
      var s = gJ();
      this.emit("languageChanging", n);
      var I = function(B) {
        g.language = B, g.languages = g.services.languageUtils.toResolveHierarchy(B), g.resolvedLanguage = void 0, g.setResolvedLanguage(B);
      }, r = function(B, l) {
        l ? (I(l), g.translator.changeLanguage(l), g.isLanguageChangingTo = void 0, g.emit("languageChanged", l), g.logger.log("languageChanged", l)) : g.isLanguageChangingTo = void 0, s.resolve(function() {
          return g.t.apply(g, arguments);
        }), o && o(B, function() {
          return g.t.apply(g, arguments);
        });
      }, a = function(B) {
        !n && !B && g.services.languageDetector && (B = []);
        var l = typeof B == "string" ? B : g.services.languageUtils.getBestMatchFromCodes(B);
        l && (g.language || I(l), g.translator.language || g.translator.changeLanguage(l), g.services.languageDetector && g.services.languageDetector.cacheUserLanguage(l)), g.loadResources(l, function(Q) {
          r(Q, l);
        });
      };
      return !n && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !n && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect(a) : a(n), s;
    }
  }, {
    key: "getFixedT",
    value: function(n, o, g) {
      var s = this, I = function r(a, C) {
        var B;
        if (cC(C) !== "object") {
          for (var l = arguments.length, Q = new Array(l > 2 ? l - 2 : 0), E = 2; E < l; E++)
            Q[E - 2] = arguments[E];
          B = s.options.overloadTranslationOptionHandler([a, C].concat(Q));
        } else
          B = AB({}, C);
        B.lng = B.lng || r.lng, B.lngs = B.lngs || r.lngs, B.ns = B.ns || r.ns, B.keyPrefix = B.keyPrefix || g || r.keyPrefix;
        var d = s.options.keySeparator || ".", m = B.keyPrefix ? "".concat(B.keyPrefix).concat(d).concat(a) : a;
        return s.t(m, B);
      };
      return typeof n == "string" ? I.lng = n : I.lngs = n, I.ns = o, I.keyPrefix = g, I;
    }
  }, {
    key: "t",
    value: function() {
      var n;
      return this.translator && (n = this.translator).translate.apply(n, arguments);
    }
  }, {
    key: "exists",
    value: function() {
      var n;
      return this.translator && (n = this.translator).exists.apply(n, arguments);
    }
  }, {
    key: "setDefaultNamespace",
    value: function(n) {
      this.options.defaultNS = n;
    }
  }, {
    key: "hasLoadedNamespace",
    value: function(n) {
      var o = this, g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      if (!this.isInitialized)
        return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
      if (!this.languages || !this.languages.length)
        return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
      var s = this.resolvedLanguage || this.languages[0], I = this.options ? this.options.fallbackLng : !1, r = this.languages[this.languages.length - 1];
      if (s.toLowerCase() === "cimode")
        return !0;
      var a = function(l, Q) {
        var E = o.services.backendConnector.state["".concat(l, "|").concat(Q)];
        return E === -1 || E === 2;
      };
      if (g.precheck) {
        var C = g.precheck(this, a);
        if (C !== void 0)
          return C;
      }
      return !!(this.hasResourceBundle(s, n) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(s, n) && (!I || a(r, n)));
    }
  }, {
    key: "loadNamespaces",
    value: function(n, o) {
      var g = this, s = gJ();
      return this.options.ns ? (typeof n == "string" && (n = [n]), n.forEach(function(I) {
        g.options.ns.indexOf(I) < 0 && g.options.ns.push(I);
      }), this.loadResources(function(I) {
        s.resolve(), o && o(I);
      }), s) : (o && o(), Promise.resolve());
    }
  }, {
    key: "loadLanguages",
    value: function(n, o) {
      var g = gJ();
      typeof n == "string" && (n = [n]);
      var s = this.options.preload || [], I = n.filter(function(r) {
        return s.indexOf(r) < 0;
      });
      return I.length ? (this.options.preload = s.concat(I), this.loadResources(function(r) {
        g.resolve(), o && o(r);
      }), g) : (o && o(), Promise.resolve());
    }
  }, {
    key: "dir",
    value: function(n) {
      if (n || (n = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !n)
        return "rtl";
      var o = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"];
      return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(n)) > -1 || n.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
    }
  }, {
    key: "cloneInstance",
    value: function() {
      var n = this, o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : CL, s = AB(AB(AB({}, this.options), o), {
        isClone: !0
      }), I = new t(s);
      (o.debug !== void 0 || o.prefix !== void 0) && (I.logger = I.logger.clone(o));
      var r = ["store", "services", "language"];
      return r.forEach(function(a) {
        I[a] = n[a];
      }), I.services = AB({}, this.services), I.services.utils = {
        hasLoadedNamespace: I.hasLoadedNamespace.bind(I)
      }, I.translator = new BwA(I.services, I.options), I.translator.on("*", function(a) {
        for (var C = arguments.length, B = new Array(C > 1 ? C - 1 : 0), l = 1; l < C; l++)
          B[l - 1] = arguments[l];
        I.emit.apply(I, [a].concat(B));
      }), I.init(s, g), I.translator.options = I.options, I.translator.backendConnector.services.utils = {
        hasLoadedNamespace: I.hasLoadedNamespace.bind(I)
      }, I;
    }
  }, {
    key: "toJSON",
    value: function() {
      return {
        options: this.options,
        store: this.store,
        language: this.language,
        languages: this.languages,
        resolvedLanguage: this.resolvedLanguage
      };
    }
  }]), t;
}(pd);
gh(VW, "createInstance", function() {
  var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = arguments.length > 1 ? arguments[1] : void 0;
  return new VW(A, e);
});
var rI = VW.createInstance();
rI.createInstance = VW.createInstance;
rI.createInstance;
rI.init;
rI.loadResources;
rI.reloadResources;
rI.use;
rI.changeLanguage;
rI.getFixedT;
rI.t;
rI.exists;
rI.setDefaultNamespace;
rI.hasLoadedNamespace;
rI.loadNamespaces;
rI.loadLanguages;
const ZMt = "gw_count_fid", XW = "gw_mea_key_fid", Fw = "gw_mea_val_fid", jh = "gw_paint_fid";
function z6(A, e) {
  return !e || e === "expr" ? A : `${A}_${e}`;
}
function WMt(A) {
  return A.enableAgg && A.aggName ? z6(A.fid, A.aggName) : A.fid;
}
function KMt({ rows: A, columns: e }) {
  return A.length && !A.find((t) => t.analyticType === "measure") ? A[A.length - 1].sort || "none" : e.length && !e.find((t) => t.analyticType === "measure") && e[e.length - 1].sort || "none";
}
const mwA = (A) => A != null;
function pwA(A, e) {
  if (A.length !== e.length)
    return !1;
  for (let t = 0; t < A.length; t++)
    if (A[t] !== e[t])
      return !1;
  return !0;
}
const UMt = {
  generic: ["auto", "bar", "line", "area", "trail", "point", "circle", "tick", "rect", "arc", "text", "boxplot", "table"],
  geographic: ["poi", "choropleth"]
}, VMt = ["generic", "geographic"], XMt = ["none", "stack", "normalize", "center"], zMt = ["auto", "fixed", "full"], TMt = {
  rows: 1 / 0,
  columns: 1 / 0,
  color: 1,
  opacity: 1,
  size: 1,
  shape: 1,
  theta: 1,
  radius: 1,
  details: 1 / 0,
  text: 1
}, _Mt = ["dimensions", "measures"], qMt = ["x", "y"], OMt = ["color", "opacity", "shape", "size"], jMt = ["sum", "mean", "median", "count", "min", "max", "variance", "stdev"], PMt = ["data_interpretation", "data_view"], UIA = {
  AGGREGATOR_LIST: jMt,
  CHART_LAYOUT_TYPE: zMt,
  COORD_TYPES: VMt,
  GEOM_TYPES: UMt,
  MAX_HISTORY_SIZE: 20,
  STACK_MODE: XMt,
  META_FIELD_KEYS: _Mt,
  CHANNEL_LIMIT: TMt,
  POSITION_CHANNEL_CONFIG_LIST: qMt,
  NON_POSITION_CHANNEL_CONFIG_LIST: OMt,
  EMBEDED_MENU_LIST: PMt,
  PAINT_MAP_SIZE: 128,
  PAINT_SIZE_FACTOR: 4,
  PAINT_MIN_BRUSH_SIZE: 1,
  PAINT_DEFAULT_BRUSH_SIZE: 9,
  PAINT_MAX_BRUSH_SIZE: 36,
  KEYWORD_DEBOUNCE_SETTING: { timeout: 300, leading: !0, trailing: !0 }
};
function $Mt() {
  return {
    dimensions: [],
    measures: [],
    rows: [],
    columns: [],
    color: [],
    opacity: [],
    size: [],
    shape: [],
    radius: [],
    theta: [],
    longitude: [],
    latitude: [],
    geoId: [],
    details: [],
    filters: [],
    text: []
  };
}
function Axt() {
  const [A] = UIA.GEOM_TYPES.generic;
  return {
    defaultAggregated: !0,
    geoms: [A],
    showTableSummary: !1,
    coordSystem: "generic",
    stack: "stack",
    showActions: !1,
    interactiveScale: !1,
    sorted: "none",
    zeroScale: !0,
    scaleIncludeUnmatchedChoropleth: !1,
    background: void 0,
    size: {
      mode: "auto",
      width: 320,
      height: 200
    },
    format: {
      numberFormat: void 0,
      timeFormat: void 0,
      normalizedNumberFormat: void 0
    },
    geoKey: "name",
    resolve: {
      x: !1,
      y: !1,
      color: !1,
      opacity: !1,
      shape: !1,
      size: !1
    },
    limit: -1
  };
}
const ywA = {
  showActions: !1,
  showTableSummary: !1,
  stack: "stack",
  interactiveScale: !1,
  zeroScale: !0,
  background: void 0,
  size: {
    mode: "auto",
    width: 320,
    height: 200
  },
  format: {
    numberFormat: void 0,
    timeFormat: void 0,
    normalizedNumberFormat: void 0
  },
  geoKey: "name",
  resolve: {
    x: !1,
    y: !1,
    color: !1,
    opacity: !1,
    shape: !1,
    size: !1
  }
}, bwA = {
  defaultAggregated: !0,
  geoms: [UIA.GEOM_TYPES.generic[0]],
  coordSystem: "generic",
  limit: -1
}, ext = {
  dimensions: [],
  measures: [],
  rows: [],
  columns: [],
  color: [],
  opacity: [],
  size: [],
  shape: [],
  radius: [],
  theta: [],
  longitude: [],
  latitude: [],
  geoId: [],
  details: [],
  filters: [],
  text: []
};
function txt(A) {
  return {
    ...A,
    encodings: {
      ...$Mt(),
      ...A.encodings
    }
  };
}
const ixt = (A) => ({
  ...A,
  config: {
    ...Axt(),
    ...A.config
  }
});
let _4A = (A = 21) => crypto.getRandomValues(new Uint8Array(A)).reduce((e, t) => (t &= 63, t < 36 ? e += t.toString(36) : t < 62 ? e += (t - 26).toString(36).toUpperCase() : t > 62 ? e += "-" : e += "_", e), "");
function nxt() {
  return "gw_" + _4A(4);
}
const BL = (A, e, t) => t === A.length ? A.concat([e]) : A.flatMap((i, n) => n === t ? [e, i] : [i]), wwA = (A, e) => A.filter((t, i) => i !== e), yE = (A, e, t) => A.map((i, n) => n === e ? t(i) : i);
function jt(A, e, t) {
  const i = (n, o, g) => {
    const [s, ...I] = o;
    return I.length === 0 ? {
      ...n,
      [s]: g(n[s])
    } : {
      ...n,
      [s]: i(n[s], I, g)
    };
  };
  return i(A, e.split("."), t);
}
const oxt = (A) => Math.floor(Math.sqrt(2 * A));
function gxt(A) {
  return (e, t) => {
    const { base: i, cache: n, cursor: o, now: g, timeline: s } = e;
    return {
      base: i,
      now: A(g, t),
      cursor: o + 1,
      cache: o - n.cursor > oxt(o) ? {
        value: A(n.value, s[n.cursor]),
        cursor: n.cursor + 1
      } : n,
      timeline: s.slice(0, o).concat([t])
    };
  };
}
const eB = {
  /**
   * measures should appear after dimensions, for we do not apply cross operator on measures.
   * @param fields
   * @returns
   */
  measureAfterDimension(A) {
    return A.filter((e) => e.analyticType === "dimension").concat(A.filter((e) => e.analyticType === "measure"));
  },
  // due to renderer, we set a limit of var can be applied to cross operator in GoG.
  crossLimit(A) {
    return function(e) {
      let t = 0;
      return e.reduce((i, n) => (n.analyticType === "dimension" && t < A && (i.push(n), t++), n.analyticType === "measure" && i.push(n), i), []);
    };
  },
  forceAnalyticType(A) {
    return function(e) {
      return e.map((t) => ({
        ...t,
        analyticType: A
      }));
    };
  },
  forceSemanticType(A) {
    return function(e) {
      return e.map((t) => ({
        ...t,
        semanticType: A
      }));
    };
  }
};
function lL(A, e) {
  return e.reduce((t, i) => i(t), A);
}
function fwA(A, e) {
  const t = {};
  return e.rows && e.rows.length > 0 && (t.rows = lL(e.rows, [eB.measureAfterDimension, eB.crossLimit(A === "table" ? 1 / 0 : 2)])), e.columns && e.columns.length > 0 && (t.columns = lL(e.columns, [eB.measureAfterDimension, eB.crossLimit(A === "table" ? 1 / 0 : 2)])), e.latitude && e.latitude.length > 0 && (t.latitude = lL(e.latitude, [eB.forceAnalyticType("dimension"), eB.forceSemanticType("quantitative"), eB.crossLimit(1)])), e.longitude && e.longitude.length > 0 && (t.longitude = lL(e.longitude, [eB.forceAnalyticType("dimension"), eB.forceSemanticType("quantitative"), eB.crossLimit(1)])), t;
}
var WN = {}, zW = {}, sxt = {
  get exports() {
    return zW;
  },
  set exports(A) {
    zW = A;
  }
}, DwA;
function Ixt() {
  return DwA || (DwA = 1, function(A) {
    (function(e, t) {
      A.exports ? A.exports = t() : e.moo = t();
    })(wi, function() {
      var e = Object.prototype.hasOwnProperty, t = Object.prototype.toString, i = typeof new RegExp().sticky == "boolean";
      function n(p) {
        return p && t.call(p) === "[object RegExp]";
      }
      function o(p) {
        return p && typeof p == "object" && !n(p) && !Array.isArray(p);
      }
      function g(p) {
        return p.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
      }
      function s(p) {
        var N = new RegExp("|" + p);
        return N.exec("").length - 1;
      }
      function I(p) {
        return "(" + p + ")";
      }
      function r(p) {
        if (!p.length)
          return "(?!)";
        var N = p.map(function(v) {
          return "(?:" + v + ")";
        }).join("|");
        return "(?:" + N + ")";
      }
      function a(p) {
        if (typeof p == "string")
          return "(?:" + g(p) + ")";
        if (n(p)) {
          if (p.ignoreCase)
            throw new Error("RegExp /i flag not allowed");
          if (p.global)
            throw new Error("RegExp /g flag is implied");
          if (p.sticky)
            throw new Error("RegExp /y flag is implied");
          if (p.multiline)
            throw new Error("RegExp /m flag is implied");
          return p.source;
        } else
          throw new Error("Not a pattern: " + p);
      }
      function C(p, N) {
        return p.length > N ? p : Array(N - p.length + 1).join(" ") + p;
      }
      function B(p, N) {
        for (var v = p.length, K = 0; ; ) {
          var U = p.lastIndexOf(`
`, v - 1);
          if (U === -1 || (K++, v = U, K === N) || v === 0)
            break;
        }
        var j = K < N ? 0 : v + 1;
        return p.substring(j).split(`
`);
      }
      function l(p) {
        for (var N = Object.getOwnPropertyNames(p), v = [], K = 0; K < N.length; K++) {
          var U = N[K], j = p[U], q = [].concat(j);
          if (U === "include") {
            for (var O = 0; O < q.length; O++)
              v.push({ include: q[O] });
            continue;
          }
          var $ = [];
          q.forEach(function(_) {
            o(_) ? ($.length && v.push(E(U, $)), v.push(E(U, _)), $ = []) : $.push(_);
          }), $.length && v.push(E(U, $));
        }
        return v;
      }
      function Q(p) {
        for (var N = [], v = 0; v < p.length; v++) {
          var K = p[v];
          if (K.include) {
            for (var U = [].concat(K.include), j = 0; j < U.length; j++)
              N.push({ include: U[j] });
            continue;
          }
          if (!K.type)
            throw new Error("Rule has no type: " + JSON.stringify(K));
          N.push(E(K.type, K));
        }
        return N;
      }
      function E(p, N) {
        if (o(N) || (N = { match: N }), N.include)
          throw new Error("Matching rules cannot also include states");
        var v = {
          defaultType: p,
          lineBreaks: !!N.error || !!N.fallback,
          pop: !1,
          next: null,
          push: null,
          error: !1,
          fallback: !1,
          value: null,
          type: null,
          shouldThrow: !1
        };
        for (var K in N)
          e.call(N, K) && (v[K] = N[K]);
        if (typeof v.type == "string" && p !== v.type)
          throw new Error("Type transform cannot be a string (type '" + v.type + "' for token '" + p + "')");
        var U = v.match;
        return v.match = Array.isArray(U) ? U : U ? [U] : [], v.match.sort(function(j, q) {
          return n(j) && n(q) ? 0 : n(q) ? -1 : n(j) ? 1 : q.length - j.length;
        }), v;
      }
      function d(p) {
        return Array.isArray(p) ? Q(p) : l(p);
      }
      var m = E("error", { lineBreaks: !0, shouldThrow: !0 });
      function y(p, N) {
        for (var v = null, K = /* @__PURE__ */ Object.create(null), U = !0, j = null, q = [], O = [], $ = 0; $ < p.length; $++)
          p[$].fallback && (U = !1);
        for (var $ = 0; $ < p.length; $++) {
          var _ = p[$];
          if (_.include)
            throw new Error("Inheritance is not allowed in stateless lexers");
          if (_.error || _.fallback) {
            if (v)
              throw !_.fallback == !v.fallback ? new Error("Multiple " + (_.fallback ? "fallback" : "error") + " rules not allowed (for token '" + _.defaultType + "')") : new Error("fallback and error are mutually exclusive (for token '" + _.defaultType + "')");
            v = _;
          }
          var tA = _.match.slice();
          if (U)
            for (; tA.length && typeof tA[0] == "string" && tA[0].length === 1; ) {
              var nA = tA.shift();
              K[nA.charCodeAt(0)] = _;
            }
          if (_.pop || _.push || _.next) {
            if (!N)
              throw new Error("State-switching options are not allowed in stateless lexers (for token '" + _.defaultType + "')");
            if (_.fallback)
              throw new Error("State-switching options are not allowed on fallback tokens (for token '" + _.defaultType + "')");
          }
          if (tA.length !== 0) {
            U = !1, q.push(_);
            for (var AA = 0; AA < tA.length; AA++) {
              var gA = tA[AA];
              if (n(gA)) {
                if (j === null)
                  j = gA.unicode;
                else if (j !== gA.unicode && _.fallback === !1)
                  throw new Error("If one rule is /u then all must be");
              }
            }
            var rA = r(tA.map(a)), sA = new RegExp(rA);
            if (sA.test(""))
              throw new Error("RegExp matches empty string: " + sA);
            var lA = s(rA);
            if (lA > 0)
              throw new Error("RegExp has capture groups: " + sA + `
Use (?: … ) instead`);
            if (!_.lineBreaks && sA.test(`
`))
              throw new Error("Rule should declare lineBreaks: " + sA);
            O.push(I(rA));
          }
        }
        var cA = v && v.fallback, aA = i && !cA ? "ym" : "gm", QA = i || cA ? "" : "|";
        j === !0 && (aA += "u");
        var hA = new RegExp(r(O) + QA, aA);
        return { regexp: hA, groups: q, fast: K, error: v || m };
      }
      function f(p) {
        var N = y(d(p));
        return new F({ start: N }, "start");
      }
      function w(p, N, v) {
        var K = p && (p.push || p.next);
        if (K && !v[K])
          throw new Error("Missing state '" + K + "' (in token '" + p.defaultType + "' of state '" + N + "')");
        if (p && p.pop && +p.pop != 1)
          throw new Error("pop must be 1 (in token '" + p.defaultType + "' of state '" + N + "')");
      }
      function G(p, N) {
        var v = p.$all ? d(p.$all) : [];
        delete p.$all;
        var K = Object.getOwnPropertyNames(p);
        N || (N = K[0]);
        for (var U = /* @__PURE__ */ Object.create(null), j = 0; j < K.length; j++) {
          var q = K[j];
          U[q] = d(p[q]).concat(v);
        }
        for (var j = 0; j < K.length; j++)
          for (var q = K[j], O = U[q], $ = /* @__PURE__ */ Object.create(null), _ = 0; _ < O.length; _++) {
            var tA = O[_];
            if (tA.include) {
              var nA = [_, 1];
              if (tA.include !== q && !$[tA.include]) {
                $[tA.include] = !0;
                var AA = U[tA.include];
                if (!AA)
                  throw new Error("Cannot include nonexistent state '" + tA.include + "' (in state '" + q + "')");
                for (var gA = 0; gA < AA.length; gA++) {
                  var rA = AA[gA];
                  O.indexOf(rA) === -1 && nA.push(rA);
                }
              }
              O.splice.apply(O, nA), _--;
            }
          }
        for (var sA = /* @__PURE__ */ Object.create(null), j = 0; j < K.length; j++) {
          var q = K[j];
          sA[q] = y(U[q], !0);
        }
        for (var j = 0; j < K.length; j++) {
          for (var lA = K[j], cA = sA[lA], aA = cA.groups, _ = 0; _ < aA.length; _++)
            w(aA[_], lA, sA);
          for (var QA = Object.getOwnPropertyNames(cA.fast), _ = 0; _ < QA.length; _++)
            w(cA.fast[QA[_]], lA, sA);
        }
        return new F(sA, N);
      }
      function R(p) {
        for (var N = typeof Map < "u", v = N ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null), K = Object.getOwnPropertyNames(p), U = 0; U < K.length; U++) {
          var j = K[U], q = p[j], O = Array.isArray(q) ? q : [q];
          O.forEach(function($) {
            if (typeof $ != "string")
              throw new Error("keyword must be string (in keyword '" + j + "')");
            N ? v.set($, j) : v[$] = j;
          });
        }
        return function($) {
          return N ? v.get($) : v[$];
        };
      }
      var F = function(p, N) {
        this.startState = N, this.states = p, this.buffer = "", this.stack = [], this.reset();
      };
      F.prototype.reset = function(p, N) {
        return this.buffer = p || "", this.index = 0, this.line = N ? N.line : 1, this.col = N ? N.col : 1, this.queuedToken = N ? N.queuedToken : null, this.queuedText = N ? N.queuedText : "", this.queuedThrow = N ? N.queuedThrow : null, this.setState(N ? N.state : this.startState), this.stack = N && N.stack ? N.stack.slice() : [], this;
      }, F.prototype.save = function() {
        return {
          line: this.line,
          col: this.col,
          state: this.state,
          stack: this.stack.slice(),
          queuedToken: this.queuedToken,
          queuedText: this.queuedText,
          queuedThrow: this.queuedThrow
        };
      }, F.prototype.setState = function(p) {
        if (!(!p || this.state === p)) {
          this.state = p;
          var N = this.states[p];
          this.groups = N.groups, this.error = N.error, this.re = N.regexp, this.fast = N.fast;
        }
      }, F.prototype.popState = function() {
        this.setState(this.stack.pop());
      }, F.prototype.pushState = function(p) {
        this.stack.push(this.state), this.setState(p);
      };
      var Z = i ? function(p, N) {
        return p.exec(N);
      } : function(p, N) {
        var v = p.exec(N);
        return v[0].length === 0 ? null : v;
      };
      F.prototype._getGroup = function(p) {
        for (var N = this.groups.length, v = 0; v < N; v++)
          if (p[v + 1] !== void 0)
            return this.groups[v];
        throw new Error("Cannot find token type for matched text");
      };
      function c() {
        return this.value;
      }
      if (F.prototype.next = function() {
        var p = this.index;
        if (this.queuedGroup) {
          var N = this._token(this.queuedGroup, this.queuedText, p);
          return this.queuedGroup = null, this.queuedText = "", N;
        }
        var v = this.buffer;
        if (p !== v.length) {
          var q = this.fast[v.charCodeAt(p)];
          if (q)
            return this._token(q, v.charAt(p), p);
          var K = this.re;
          K.lastIndex = p;
          var U = Z(K, v), j = this.error;
          if (U == null)
            return this._token(j, v.slice(p, v.length), p);
          var q = this._getGroup(U), O = U[0];
          return j.fallback && U.index !== p ? (this.queuedGroup = q, this.queuedText = O, this._token(j, v.slice(p, U.index), p)) : this._token(q, O, p);
        }
      }, F.prototype._token = function(p, N, v) {
        var K = 0;
        if (p.lineBreaks) {
          var U = /\n/g, j = 1;
          if (N === `
`)
            K = 1;
          else
            for (; U.exec(N); )
              K++, j = U.lastIndex;
        }
        var q = {
          type: typeof p.type == "function" && p.type(N) || p.defaultType,
          value: typeof p.value == "function" ? p.value(N) : N,
          text: N,
          toString: c,
          offset: v,
          lineBreaks: K,
          line: this.line,
          col: this.col
        }, O = N.length;
        if (this.index += O, this.line += K, K !== 0 ? this.col = O - j + 1 : this.col += O, p.shouldThrow) {
          var $ = new Error(this.formatError(q, "invalid syntax"));
          throw $;
        }
        return p.pop ? this.popState() : p.push ? this.pushState(p.push) : p.next && this.setState(p.next), q;
      }, typeof Symbol < "u" && Symbol.iterator) {
        var J = function(p) {
          this.lexer = p;
        };
        J.prototype.next = function() {
          var p = this.lexer.next();
          return { value: p, done: !p };
        }, J.prototype[Symbol.iterator] = function() {
          return this;
        }, F.prototype[Symbol.iterator] = function() {
          return new J(this);
        };
      }
      return F.prototype.formatError = function(p, N) {
        if (p == null)
          var v = this.buffer.slice(this.index), p = {
            text: v,
            offset: this.index,
            lineBreaks: v.indexOf(`
`) === -1 ? 0 : 1,
            line: this.line,
            col: this.col
          };
        var K = 2, U = Math.max(p.line - K, 1), j = p.line + K, q = String(j).length, O = B(
          this.buffer,
          this.line - p.line + K + 1
        ).slice(0, 5), $ = [];
        $.push(N + " at line " + p.line + " col " + p.col + ":"), $.push("");
        for (var _ = 0; _ < O.length; _++) {
          var tA = O[_], nA = U + _;
          $.push(C(String(nA), q) + "  " + tA), nA === p.line && $.push(C("", q + p.col + 1) + "^");
        }
        return $.join(`
`);
      }, F.prototype.clone = function() {
        return new F(this.states, this.state);
      }, F.prototype.has = function(p) {
        return !0;
      }, {
        compile: f,
        states: G,
        error: Object.freeze({ error: !0 }),
        fallback: Object.freeze({ fallback: !0 }),
        keywords: R
      };
    });
  }(sxt)), zW;
}
var TW = {}, axt = {
  get exports() {
    return TW;
  },
  set exports(A) {
    TW = A;
  }
}, GwA;
function rxt() {
  return GwA || (GwA = 1, function(A) {
    (function(e, t) {
      A.exports ? A.exports = t() : e.nearley = t();
    })(wi, function() {
      function e(r, a, C) {
        return this.id = ++e.highestId, this.name = r, this.symbols = a, this.postprocess = C, this;
      }
      e.highestId = 0, e.prototype.toString = function(r) {
        var a = typeof r > "u" ? this.symbols.map(I).join(" ") : this.symbols.slice(0, r).map(I).join(" ") + " ● " + this.symbols.slice(r).map(I).join(" ");
        return this.name + " → " + a;
      };
      function t(r, a, C, B) {
        this.rule = r, this.dot = a, this.reference = C, this.data = [], this.wantedBy = B, this.isComplete = this.dot === r.symbols.length;
      }
      t.prototype.toString = function() {
        return "{" + this.rule.toString(this.dot) + "}, from: " + (this.reference || 0);
      }, t.prototype.nextState = function(r) {
        var a = new t(this.rule, this.dot + 1, this.reference, this.wantedBy);
        return a.left = this, a.right = r, a.isComplete && (a.data = a.build(), a.right = void 0), a;
      }, t.prototype.build = function() {
        var r = [], a = this;
        do
          r.push(a.right.data), a = a.left;
        while (a.left);
        return r.reverse(), r;
      }, t.prototype.finish = function() {
        this.rule.postprocess && (this.data = this.rule.postprocess(this.data, this.reference, g.fail));
      };
      function i(r, a) {
        this.grammar = r, this.index = a, this.states = [], this.wants = {}, this.scannable = [], this.completed = {};
      }
      i.prototype.process = function(r) {
        for (var a = this.states, C = this.wants, B = this.completed, l = 0; l < a.length; l++) {
          var Q = a[l];
          if (Q.isComplete) {
            if (Q.finish(), Q.data !== g.fail) {
              for (var E = Q.wantedBy, d = E.length; d--; ) {
                var m = E[d];
                this.complete(m, Q);
              }
              if (Q.reference === this.index) {
                var y = Q.rule.name;
                (this.completed[y] = this.completed[y] || []).push(Q);
              }
            }
          } else {
            var y = Q.rule.symbols[Q.dot];
            if (typeof y != "string") {
              this.scannable.push(Q);
              continue;
            }
            if (C[y]) {
              if (C[y].push(Q), B.hasOwnProperty(y))
                for (var f = B[y], d = 0; d < f.length; d++) {
                  var w = f[d];
                  this.complete(Q, w);
                }
            } else
              C[y] = [Q], this.predict(y);
          }
        }
      }, i.prototype.predict = function(r) {
        for (var a = this.grammar.byName[r] || [], C = 0; C < a.length; C++) {
          var B = a[C], l = this.wants[r], Q = new t(B, 0, this.index, l);
          this.states.push(Q);
        }
      }, i.prototype.complete = function(r, a) {
        var C = r.nextState(a);
        this.states.push(C);
      };
      function n(r, a) {
        this.rules = r, this.start = a || this.rules[0].name;
        var C = this.byName = {};
        this.rules.forEach(function(B) {
          C.hasOwnProperty(B.name) || (C[B.name] = []), C[B.name].push(B);
        });
      }
      n.fromCompiled = function(B, a) {
        var C = B.Lexer;
        B.ParserStart && (a = B.ParserStart, B = B.ParserRules);
        var B = B.map(function(Q) {
          return new e(Q.name, Q.symbols, Q.postprocess);
        }), l = new n(B, a);
        return l.lexer = C, l;
      };
      function o() {
        this.reset("");
      }
      o.prototype.reset = function(r, a) {
        this.buffer = r, this.index = 0, this.line = a ? a.line : 1, this.lastLineBreak = a ? -a.col : 0;
      }, o.prototype.next = function() {
        if (this.index < this.buffer.length) {
          var r = this.buffer[this.index++];
          return r === `
` && (this.line += 1, this.lastLineBreak = this.index), { value: r };
        }
      }, o.prototype.save = function() {
        return {
          line: this.line,
          col: this.index - this.lastLineBreak
        };
      }, o.prototype.formatError = function(r, a) {
        var C = this.buffer;
        if (typeof C == "string") {
          var B = C.split(`
`).slice(
            Math.max(0, this.line - 5),
            this.line
          ), l = C.indexOf(`
`, this.index);
          l === -1 && (l = C.length);
          var Q = this.index - this.lastLineBreak, E = String(this.line).length;
          return a += " at line " + this.line + " col " + Q + `:

`, a += B.map(function(m, y) {
            return d(this.line - B.length + y + 1, E) + " " + m;
          }, this).join(`
`), a += `
` + d("", E + Q) + `^
`, a;
        } else
          return a + " at index " + (this.index - 1);
        function d(m, y) {
          var f = String(m);
          return Array(y - f.length + 1).join(" ") + f;
        }
      };
      function g(r, a, C) {
        if (r instanceof n)
          var B = r, C = a;
        else
          var B = n.fromCompiled(r, a);
        this.grammar = B, this.options = {
          keepHistory: !1,
          lexer: B.lexer || new o()
        };
        for (var l in C || {})
          this.options[l] = C[l];
        this.lexer = this.options.lexer, this.lexerState = void 0;
        var Q = new i(B, 0);
        this.table = [Q], Q.wants[B.start] = [], Q.predict(B.start), Q.process(), this.current = 0;
      }
      g.fail = {}, g.prototype.feed = function(r) {
        var a = this.lexer;
        a.reset(r, this.lexerState);
        for (var C; ; ) {
          try {
            if (C = a.next(), !C)
              break;
          } catch (F) {
            var E = new i(this.grammar, this.current + 1);
            this.table.push(E);
            var B = new Error(this.reportLexerError(F));
            throw B.offset = this.current, B.token = F.token, B;
          }
          var l = this.table[this.current];
          this.options.keepHistory || delete this.table[this.current - 1];
          var Q = this.current + 1, E = new i(this.grammar, Q);
          this.table.push(E);
          for (var d = C.text !== void 0 ? C.text : C.value, m = a.constructor === o ? C.value : C, y = l.scannable, f = y.length; f--; ) {
            var w = y[f], G = w.rule.symbols[w.dot];
            if (G.test ? G.test(m) : G.type ? G.type === C.type : G.literal === d) {
              var R = w.nextState({ data: m, token: C, isToken: !0, reference: Q - 1 });
              E.states.push(R);
            }
          }
          if (E.process(), E.states.length === 0) {
            var B = new Error(this.reportError(C));
            throw B.offset = this.current, B.token = C, B;
          }
          this.options.keepHistory && (l.lexerState = a.save()), this.current++;
        }
        return l && (this.lexerState = a.save()), this.results = this.finish(), this;
      }, g.prototype.reportLexerError = function(r) {
        var a, C, B = r.token;
        return B ? (a = "input " + JSON.stringify(B.text[0]) + " (lexer error)", C = this.lexer.formatError(B, "Syntax error")) : (a = "input (lexer error)", C = r.message), this.reportErrorCommon(C, a);
      }, g.prototype.reportError = function(r) {
        var a = (r.type ? r.type + " token: " : "") + JSON.stringify(r.value !== void 0 ? r.value : r), C = this.lexer.formatError(r, "Syntax error");
        return this.reportErrorCommon(C, a);
      }, g.prototype.reportErrorCommon = function(r, a) {
        var C = [];
        C.push(r);
        var B = this.table.length - 2, l = this.table[B], Q = l.states.filter(function(d) {
          var m = d.rule.symbols[d.dot];
          return m && typeof m != "string";
        });
        if (Q.length === 0)
          C.push("Unexpected " + a + `. I did not expect any more input. Here is the state of my parse table:
`), this.displayStateStack(l.states, C);
        else {
          C.push("Unexpected " + a + `. Instead, I was expecting to see one of the following:
`);
          var E = Q.map(function(d) {
            return this.buildFirstStateStack(d, []) || [d];
          }, this);
          E.forEach(function(d) {
            var m = d[0], y = m.rule.symbols[m.dot], f = this.getSymbolDisplay(y);
            C.push("A " + f + " based on:"), this.displayStateStack(d, C);
          }, this);
        }
        return C.push(""), C.join(`
`);
      }, g.prototype.displayStateStack = function(r, a) {
        for (var C, B = 0, l = 0; l < r.length; l++) {
          var Q = r[l], E = Q.rule.toString(Q.dot);
          E === C ? B++ : (B > 0 && a.push("    ^ " + B + " more lines identical to this"), B = 0, a.push("    " + E)), C = E;
        }
      }, g.prototype.getSymbolDisplay = function(r) {
        return s(r);
      }, g.prototype.buildFirstStateStack = function(r, a) {
        if (a.indexOf(r) !== -1)
          return null;
        if (r.wantedBy.length === 0)
          return [r];
        var C = r.wantedBy[0], B = [r].concat(a), l = this.buildFirstStateStack(C, B);
        return l === null ? null : [r].concat(l);
      }, g.prototype.save = function() {
        var r = this.table[this.current];
        return r.lexerState = this.lexerState, r;
      }, g.prototype.restore = function(r) {
        var a = r.index;
        this.current = a, this.table[a] = r, this.table.splice(a + 1), this.lexerState = r.lexerState, this.results = this.finish();
      }, g.prototype.rewind = function(r) {
        if (!this.options.keepHistory)
          throw new Error("set option `keepHistory` to enable rewinding");
        this.restore(this.table[r]);
      }, g.prototype.finish = function() {
        var r = [], a = this.grammar.start, C = this.table[this.table.length - 1];
        return C.states.forEach(function(B) {
          B.rule.name === a && B.dot === B.rule.symbols.length && B.reference === 0 && B.data !== g.fail && r.push(B);
        }), r.map(function(B) {
          return B.data;
        });
      };
      function s(r) {
        var a = typeof r;
        if (a === "string")
          return r;
        if (a === "object") {
          if (r.literal)
            return JSON.stringify(r.literal);
          if (r instanceof RegExp)
            return "character matching " + r;
          if (r.type)
            return r.type + " token";
          if (r.test)
            return "token matching " + String(r.test);
          throw new Error("Unknown symbol type: " + r);
        }
      }
      function I(r) {
        var a = typeof r;
        if (a === "string")
          return r;
        if (a === "object") {
          if (r.literal)
            return JSON.stringify(r.literal);
          if (r instanceof RegExp)
            return r.toString();
          if (r.type)
            return "%" + r.type;
          if (r.test)
            return "<" + String(r.test) + ">";
          throw new Error("Unknown symbol type: " + r);
        }
      }
      return {
        Parser: g,
        Grammar: n,
        Rule: e
      };
    });
  }(axt)), TW;
}
(function(A) {
  (function(e, t) {
    for (var i in t)
      e[i] = t[i];
  })(
    A,
    /******/
    function(e) {
      var t = {};
      function i(n) {
        if (t[n])
          return t[n].exports;
        var o = t[n] = {
          /******/
          i: n,
          /******/
          l: !1,
          /******/
          exports: {}
          /******/
        };
        return e[n].call(o.exports, o, o.exports, i), o.l = !0, o.exports;
      }
      return i.m = e, i.c = t, i.d = function(n, o, g) {
        i.o(n, o) || Object.defineProperty(n, o, { enumerable: !0, get: g });
      }, i.r = function(n) {
        typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(n, "__esModule", { value: !0 });
      }, i.t = function(n, o) {
        if (o & 1 && (n = i(n)), o & 8 || o & 4 && typeof n == "object" && n && n.__esModule)
          return n;
        var g = /* @__PURE__ */ Object.create(null);
        if (i.r(g), Object.defineProperty(g, "default", { enumerable: !0, value: n }), o & 2 && typeof n != "string")
          for (var s in n)
            i.d(g, s, function(I) {
              return n[I];
            }.bind(null, s));
        return g;
      }, i.n = function(n) {
        var o = n && n.__esModule ? (
          /******/
          function() {
            return n.default;
          }
        ) : (
          /******/
          function() {
            return n;
          }
        );
        return i.d(o, "a", o), o;
      }, i.o = function(n, o) {
        return Object.prototype.hasOwnProperty.call(n, o);
      }, i.p = "", i(i.s = 7);
    }([
      /* 0 */
      /***/
      function(e, t) {
        e.exports = Ixt();
      },
      /* 1 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.unbox = t.doubleQuoted = t.box = t.track = t.tracking = t.trackingComments = t.lexerAny = t.lexer = void 0;
        const n = i(0), o = i(3), g = {};
        for (const G of o.sqlKeywords)
          g["kw_" + G.toLowerCase()] = G;
        const s = (G) => {
          const R = (0, n.keywords)(G);
          return (F) => R(F.toUpperCase());
        };
        t.lexer = (0, n.compile)({
          word: {
            match: /[eE](?!')[A-Za-z0-9_]*|[a-df-zA-DF-Z_][A-Za-z0-9_]*/,
            type: s(g),
            value: (G) => G.toLowerCase()
          },
          wordQuoted: {
            match: /"(?:[^"\*]|"")+"/,
            type: () => "quoted_word",
            value: (G) => G.substring(1, G.length - 1)
          },
          string: {
            match: /'(?:[^']|\'\')*'/,
            value: (G) => G.substring(1, G.length - 1).replace(/''/g, "'")
          },
          eString: {
            match: /\b(?:e|E)'(?:[^'\\]|[\r\n\s]|(?:\\\s)|(?:\\\n)|(?:\\.)|(?:\'\'))+'/,
            value: (G) => G.substring(2, G.length - 1).replace(/''/g, "'").replace(/\\([\s\n])/g, (R, F) => F).replace(/\\./g, (R) => JSON.parse('"' + R + '"'))
          },
          qparam: {
            match: /\$\d+/
          },
          commentLine: /\-\-.*?$[\s\r\n]*/,
          commentFullOpen: /\/\*/,
          commentFullClose: /\*\/[\s\r\n]*/,
          star: "*",
          comma: ",",
          space: { match: /[\s\t\n\v\f\r]+/, lineBreaks: !0 },
          int: /\-?\d+(?![\.\d])/,
          float: /\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,
          // word: /[a-zA-Z][A-Za-z0-9_\-]*/,
          lparen: "(",
          rparen: ")",
          lbracket: "[",
          rbracket: "]",
          semicolon: ";",
          dot: /\.(?!\d)/,
          op_cast: "::",
          op_colon: ":",
          op_plus: "+",
          op_eq: "=",
          op_neq: {
            match: /(?:!=)|(?:\<\>)/,
            value: () => "!="
          },
          op_membertext: "->>",
          op_member: "->",
          op_minus: "-",
          op_div: /\//,
          op_not_ilike: /\!~~\*/,
          op_not_like: /\!~~/,
          op_ilike: /~~\*/,
          op_like: /~~/,
          op_mod: "%",
          op_exp: "^",
          op_additive: {
            // group other additive operators
            match: ["||", "-", "#-", "&&"]
          },
          op_compare: {
            // group other comparison operators
            // ... to add: "IN" and "NOT IN" that are matched by keywords
            match: [">", ">=", "<", "<=", "@>", "<@", "?", "?|", "?&", "#>>", ">>", "<<", "~", "~*", "!~", "!~*", "@@"]
          },
          ops_others: {
            // referenced as (any other operator) in https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-PRECEDENCE
            // see also https://www.postgresql.org/docs/9.0/functions-math.html
            match: ["|", "&", "^", "#"]
          },
          codeblock: {
            match: /\$\$(?:.|[\s\t\n\v\f\r])*?\$\$/s,
            lineBreaks: !0,
            value: (G) => G.substring(2, G.length - 2)
          }
        }), t.lexer.next = ((G) => () => {
          let R, F = null;
          for (; R = G.call(t.lexer); ) {
            if (R.type === "commentFullOpen") {
              if (F === null) {
                F = {
                  nested: 0,
                  offset: R.offset,
                  text: R.text
                };
                continue;
              }
              F.nested++;
            }
            if (F != null) {
              if (F.text += R.text, R.type === "commentFullClose") {
                if (F.nested === 0) {
                  I == null || I.push(r(F)), F = null;
                  continue;
                }
                F.nested--;
              }
              continue;
            }
            if (R.type !== "space") {
              if (R.type === "commentLine") {
                I == null || I.push(r(R));
                continue;
              }
              break;
            }
          }
          if (C && R) {
            const Z = R.offset, c = {
              start: Z,
              end: Z + R.text.length
            };
            R._location = c;
          }
          return R;
        })(t.lexer.next), t.lexerAny = t.lexer;
        let I = null;
        const r = ({ offset: G, text: R }) => ({
          _location: { start: G, end: G + R.length },
          comment: R
        });
        function a(G) {
          if (I)
            throw new Error("WAT ? Recursive comments tracking 🤔🤨 ?");
          try {
            I = [];
            const R = G();
            return { comments: I, ast: R };
          } finally {
            I = null;
          }
        }
        t.trackingComments = a;
        let C = !1;
        function B(G) {
          if (C)
            return G();
          try {
            return C = !0, G();
          } finally {
            C = !1;
          }
        }
        t.tracking = B;
        function l(G, R) {
          if (!C || !R || typeof R != "object")
            return R;
          const F = w(G, !0), Z = w(G, !1);
          if (!F || !Z)
            return R;
          if (F === Z)
            R._location = F;
          else {
            const c = {
              start: F.start,
              end: Z.end
            };
            R._location = c;
          }
          return R;
        }
        t.track = l;
        const Q = Symbol("_literal"), E = Symbol("_doublequoted");
        function d(G, R, F) {
          return !C && !F ? R : l(G, { [Q]: R, [E]: F });
        }
        t.box = d;
        function m(G) {
          return Array.isArray(G) && G.length === 1 && (G = m(G[0])), Array.isArray(G) && !G.length ? null : G;
        }
        function y(G) {
          const R = m(G);
          if (typeof G == "object" && (R != null && R[E]))
            return { doubleQuoted: !0 };
        }
        t.doubleQuoted = y;
        function f(G) {
          var R;
          return typeof G == "object" && (R = G == null ? void 0 : G[Q]) !== null && R !== void 0 ? R : G;
        }
        t.unbox = f;
        function w(G, R) {
          if (!G)
            return null;
          if (Array.isArray(G)) {
            const F = R ? 1 : -1;
            for (let Z = R ? 0 : G.length - 1; Z >= 0 && Z < G.length; Z += F) {
              const c = w(G[Z], R);
              if (c)
                return c;
            }
            return null;
          }
          return typeof G != "object" ? null : G._location;
        }
      },
      /* 2 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.AstDefaultMapper = t.arrayNilMap = t.assignChanged = t.astMapper = void 0;
        const n = i(6);
        function o(B) {
          const l = new r();
          return l.wrapped = B(l), l;
        }
        t.astMapper = o;
        function g(B, l) {
          if (!B)
            return B;
          let Q = !1;
          for (const E of Object.keys(l))
            if (B[E] !== l[E]) {
              Q = !0;
              break;
            }
          return Q ? (0, n.trimNullish)({
            ...B,
            ...l
          }, 0) : B;
        }
        t.assignChanged = g;
        function s(B, l) {
          if (!(B != null && B.length))
            return B;
          let Q = !1, E = B;
          for (let d = 0; d < B.length; d++) {
            const m = B[d], y = l(m);
            !Q && (!y || y !== m) && (Q = !0, E = B.slice(0, d)), y && Q && E.push(y);
          }
          return E;
        }
        t.arrayNilMap = s;
        function I(B) {
          switch (B == null ? void 0 : B.type) {
            case "select":
            case "delete":
            case "insert":
            case "update":
            case "union":
            case "union all":
            case "with":
              return !0;
            default:
              return !1;
          }
        }
        class r {
          super() {
            return new C(this);
          }
          statement(l) {
            switch (l.type) {
              case "alter table":
                return this.alterTable(l);
              case "alter index":
                return this.alterIndex(l);
              case "commit":
              case "start transaction":
              case "rollback":
                return this.transaction(l);
              case "create index":
                return this.createIndex(l);
              case "create table":
                return this.createTable(l);
              case "truncate table":
                return this.truncateTable(l);
              case "delete":
                return this.delete(l);
              case "insert":
                return this.insert(l);
              case "with":
                return this.with(l);
              case "with recursive":
                return this.withRecursive(l);
              case "select":
                return this.selection(l);
              case "update":
                return this.update(l);
              case "create extension":
                return this.createExtension(l);
              case "tablespace":
                return this.tablespace(l);
              case "set":
                return this.setGlobal(l);
              case "set timezone":
                return this.setTimezone(l);
              case "create sequence":
                return this.createSequence(l);
              case "alter sequence":
                return this.alterSequence(l);
              case "begin":
                return this.begin(l);
              case "drop table":
              case "drop index":
              case "drop sequence":
              case "drop type":
              case "drop trigger":
                return this.drop(l);
              case "create enum":
                return this.createEnum(l);
              case "create composite type":
                return this.createCompositeType(l);
              case "union":
              case "union all":
                return this.union(l);
              case "show":
                return this.show(l);
              case "prepare":
                return this.prepare(l);
              case "deallocate":
                return this.deallocate(l);
              case "create view":
                return this.createView(l);
              case "create materialized view":
                return this.createMaterializedView(l);
              case "refresh materialized view":
                return this.refreshMaterializedView(l);
              case "create schema":
                return this.createSchema(l);
              case "raise":
                return this.raise(l);
              case "comment":
                return this.comment(l);
              case "do":
                return this.do(l);
              case "create function":
                return this.createFunction(l);
              case "drop function":
                return this.dropFunction(l);
              case "values":
                return this.values(l);
              default:
                throw n.NotSupported.never(l);
            }
          }
          comment(l) {
            return l;
          }
          createView(l) {
            const Q = this.select(l.query);
            if (!Q)
              return null;
            const E = this.tableRef(l.name);
            return E ? g(l, {
              query: Q,
              name: E
            }) : null;
          }
          createMaterializedView(l) {
            const Q = this.select(l.query);
            if (!Q)
              return null;
            const E = this.tableRef(l.name);
            return E ? g(l, {
              query: Q,
              name: E
            }) : null;
          }
          refreshMaterializedView(l) {
            return l;
          }
          do(l) {
            return l;
          }
          createFunction(l) {
            const Q = s(l.arguments, (d) => {
              const m = this.dataType(d.type);
              return g(d, { type: m });
            });
            let E;
            if (l.returns)
              switch (l.returns.kind) {
                case "table":
                  E = g(l.returns, {
                    columns: s(l.returns.columns, (d) => {
                      const m = this.dataType(d.type);
                      return m && g(d, { type: m });
                    })
                  });
                  break;
                case void 0:
                case null:
                case "array":
                  E = this.dataType(l.returns);
                  break;
                default:
                  throw n.NotSupported.never(l.returns);
              }
            return g(l, {
              returns: E,
              arguments: Q
            });
          }
          dropFunction(l) {
            const Q = s(l.arguments, (E) => {
              const d = this.dataType(E.type);
              return g(E, { type: d });
            });
            return g(l, {
              arguments: Q
            });
          }
          show(l) {
            return l;
          }
          createEnum(l) {
            return l;
          }
          createCompositeType(l) {
            const Q = s(l.attributes, (E) => g(E, {
              dataType: this.dataType(E.dataType)
            }));
            return g(l, { attributes: Q });
          }
          drop(l) {
            return l;
          }
          alterSequence(l) {
            return l.change.type === "set options" && l.change.as && this.dataType(l.change.as), l;
          }
          begin(l) {
            return l;
          }
          createSequence(l) {
            return l.options.as && this.dataType(l.options.as), l;
          }
          tablespace(l) {
            return l;
          }
          setGlobal(l) {
            return l;
          }
          setTimezone(l) {
            return l;
          }
          update(l) {
            if (!l)
              return l;
            const Q = this.tableRef(l.table);
            if (!Q)
              return null;
            const E = l.from && this.from(l.from), d = l.where && this.expr(l.where), m = s(l.sets, (f) => this.set(f));
            if (!(m != null && m.length))
              return null;
            const y = s(l.returning, (f) => this.selectionColumn(f));
            return g(l, {
              table: Q,
              where: d,
              sets: m,
              from: E,
              returning: y
            });
          }
          insert(l) {
            var Q, E;
            const d = this.tableRef(l.into);
            if (!d)
              return null;
            const m = l.insert && this.select(l.insert);
            if (!m)
              return null;
            const y = s(l.returning, (G) => this.selectionColumn(G));
            let f = (Q = l.onConflict) === null || Q === void 0 ? void 0 : Q.on;
            switch (f == null ? void 0 : f.type) {
              case "on constraint":
                break;
              case "on expr":
                f = g(f, {
                  exprs: s(f.exprs, (G) => this.expr(G))
                });
                break;
              case null:
              case void 0:
                break;
              default:
                throw n.NotSupported.never(f);
            }
            let w = (E = l.onConflict) === null || E === void 0 ? void 0 : E.do;
            if (w && w !== "do nothing") {
              const G = s(w.sets, (R) => this.set(R));
              G != null && G.length ? w.sets !== G && (w = { sets: G }) : w = "do nothing";
            }
            return g(l, {
              into: d,
              insert: m,
              returning: y,
              onConflict: w ? g(l.onConflict, {
                do: w,
                on: f
              }) : l.onConflict
            });
          }
          raise(l) {
            return g(l, {
              formatExprs: l.formatExprs && s(l.formatExprs, (Q) => this.expr(Q)),
              using: l.using && s(l.using, (Q) => g(Q, {
                value: this.expr(Q.value)
              }))
            });
          }
          delete(l) {
            const Q = this.tableRef(l.from);
            if (!Q)
              return null;
            const E = l.where && this.expr(l.where), d = s(l.returning, (m) => this.selectionColumn(m));
            return g(l, {
              where: E,
              returning: d,
              from: Q
            });
          }
          createSchema(l) {
            return l;
          }
          createTable(l) {
            const Q = s(l.columns, (E) => {
              switch (E.kind) {
                case "column":
                  return this.createColumn(E);
                case "like table":
                  return this.likeTable(E);
                default:
                  throw n.NotSupported.never(E);
              }
            });
            return Q != null && Q.length ? g(l, {
              columns: Q
            }) : null;
          }
          likeTable(l) {
            const Q = this.tableRef(l.like);
            return Q ? g(l, { like: Q }) : null;
          }
          truncateTable(l) {
            return l;
          }
          constraint(l) {
            switch (l.type) {
              case "not null":
              case "null":
              case "primary key":
              case "unique":
              case "add generated":
                return l;
              case "default": {
                const Q = this.expr(l.default);
                return Q ? g(l, {
                  default: Q
                }) : null;
              }
              case "check": {
                const Q = this.expr(l.expr);
                return Q ? g(l, {
                  expr: Q
                }) : null;
              }
              case "reference": {
                const Q = this.tableRef(l.foreignTable);
                return Q ? g(l, {
                  foreignTable: Q
                }) : null;
              }
              default:
                throw n.NotSupported.never(l);
            }
          }
          set(l) {
            const Q = this.expr(l.value);
            return Q ? g(l, {
              value: Q
            }) : null;
          }
          // =========================================
          // ================ STUFF ==================
          // =========================================
          /** Called when a data type definition is encountered */
          dataType(l) {
            return l;
          }
          /** Called when an alias of a table is created */
          tableRef(l) {
            return l;
          }
          transaction(l) {
            return l;
          }
          createExtension(l) {
            return l;
          }
          createIndex(l) {
            const Q = s(l.expressions, (E) => {
              const d = this.expr(E.expression);
              return d === E.expression ? E : d ? {
                ...E,
                expression: d
              } : null;
            });
            return Q != null && Q.length ? g(l, {
              expressions: Q
            }) : null;
          }
          prepare(l) {
            const Q = this.statement(l.statement);
            return Q ? g(l, {
              args: s(l.args, (E) => this.dataType(E)),
              statement: Q
            }) : null;
          }
          deallocate(l) {
            return l;
          }
          // =========================================
          // ============== ALTER INDEX ==============
          // =========================================
          alterIndex(l) {
            return l;
          }
          // =========================================
          // ============== ALTER TABLE ==============
          // =========================================
          alterTable(l) {
            var Q;
            const E = this.tableRef(l.table);
            if (!E)
              return null;
            let d = [], m = !1;
            for (let y = 0; y < (((Q = l.changes) === null || Q === void 0 ? void 0 : Q.length) || 0); y++) {
              const f = l.changes[y], w = this.tableAlteration(f, l.table);
              m = m || w != f, w && d.push(w);
            }
            return d.length ? m ? g(l, {
              table: E,
              changes: d
            }) : l : null;
          }
          tableAlteration(l, Q) {
            switch (l.type) {
              case "add column":
                return this.addColumn(l, Q);
              case "add constraint":
                return this.addConstraint(l, Q);
              case "alter column":
                return this.alterColumn(l, Q);
              case "rename":
                return this.renameTable(l, Q);
              case "rename column":
                return this.renameColumn(l, Q);
              case "rename constraint":
                return this.renameConstraint(l, Q);
              case "drop column":
                return this.dropColumn(l, Q);
              case "drop constraint":
                return this.dropConstraint(l, Q);
              case "owner":
                return this.setTableOwner(l, Q);
              default:
                throw n.NotSupported.never(l);
            }
          }
          dropColumn(l, Q) {
            return l;
          }
          dropConstraint(l, Q) {
            return l;
          }
          setTableOwner(l, Q) {
            return l;
          }
          renameConstraint(l, Q) {
            return l;
          }
          renameColumn(l, Q) {
            return l;
          }
          renameTable(l, Q) {
            return l;
          }
          alterColumn(l, Q) {
            let E;
            switch (l.alter.type) {
              case "set default":
                E = this.setColumnDefault(l.alter, Q, l.column);
                break;
              case "set type":
                E = this.setColumnType(l.alter, Q, l.column);
                break;
              case "drop default":
              case "set not null":
              case "drop not null":
                E = this.alterColumnSimple(l.alter, Q, l.column);
                break;
              case "add generated":
                E = this.alterColumnAddGenerated(l.alter, Q, l.column);
                break;
              default:
                throw n.NotSupported.never(l.alter);
            }
            return E ? g(l, {
              alter: E
            }) : null;
          }
          setColumnType(l, Q, E) {
            const d = this.dataType(l.dataType);
            return g(l, {
              dataType: d
            });
          }
          alterColumnAddGenerated(l, Q, E) {
            return l;
          }
          alterColumnSimple(l, Q, E) {
            return l;
          }
          setColumnDefault(l, Q, E) {
            const d = this.expr(l.default);
            return d ? g(l, {
              default: d
            }) : null;
          }
          addConstraint(l, Q) {
            return l;
          }
          addColumn(l, Q) {
            const E = this.createColumn(l.column);
            return E ? g(l, {
              column: E
            }) : null;
          }
          createColumn(l) {
            var Q;
            const E = this.dataType(l.dataType);
            if (!E)
              return null;
            const d = (Q = s(l.constraints, (m) => this.constraint(m))) !== null && Q !== void 0 ? Q : void 0;
            return g(l, {
              dataType: E,
              constraints: d
            });
          }
          // =========================================
          // ============== SELECTIONS ==============
          // =========================================
          select(l) {
            switch (l.type) {
              case "select":
                return this.selection(l);
              case "union":
              case "union all":
                return this.union(l);
              case "with":
                return this.with(l);
              case "values":
                return this.values(l);
              case "with recursive":
                return this.withRecursive(l);
              default:
                throw n.NotSupported.never(l);
            }
          }
          selection(l) {
            var Q, E;
            const d = s(l.from, (F) => this.from(F)), m = s(l.columns, (F) => this.selectionColumn(F)), y = l.where && this.expr(l.where), f = s(l.groupBy, (F) => this.expr(F)), w = l.having && this.expr(l.having), G = this.orderBy(l.orderBy), R = g(l.limit, {
              limit: this.expr((Q = l.limit) === null || Q === void 0 ? void 0 : Q.limit),
              offset: this.expr((E = l.limit) === null || E === void 0 ? void 0 : E.offset)
            });
            return g(l, {
              from: d,
              columns: m,
              where: y,
              groupBy: f,
              having: w,
              orderBy: G,
              limit: R
            });
          }
          orderBy(l) {
            return s(l, (Q) => {
              const E = this.expr(Q.by);
              return E ? E === Q.by ? Q : {
                ...Q,
                by: E
              } : null;
            });
          }
          union(l) {
            const Q = this.select(l.left), E = this.select(l.right);
            return !Q || !E ? Q ?? E : g(l, {
              left: Q,
              right: E
            });
          }
          with(l) {
            const Q = s(l.bind, (d) => {
              const m = this.statement(d.statement);
              return I(m) ? g(d, { statement: m }) : null;
            });
            if (!Q)
              return null;
            const E = this.statement(l.in);
            return I(E) ? g(l, {
              bind: Q,
              in: E
            }) : null;
          }
          withRecursive(l) {
            const Q = this.union(l.bind);
            if (!Q || Q.type !== "union" && Q.type !== "union all")
              return null;
            const E = this.statement(l.in);
            return I(E) ? g(l, {
              bind: Q,
              in: E
            }) : null;
          }
          from(l) {
            switch (l.type) {
              case "table":
                return this.fromTable(l);
              case "statement":
                return this.fromStatement(l);
              case "call":
                return this.fromCall(l);
              default:
                throw n.NotSupported.never(l);
            }
          }
          fromCall(l) {
            const Q = this.call(l);
            return !Q || Q.type !== "call" ? null : g(l, Q);
          }
          fromStatement(l) {
            const Q = this.select(l.statement);
            if (!Q)
              return null;
            const E = l.join && this.join(l.join);
            return g(l, {
              statement: Q,
              join: E
            });
          }
          values(l) {
            const Q = s(l.values, (E) => s(E, (d) => this.expr(d)));
            return Q != null && Q.length ? g(l, {
              values: Q
            }) : null;
          }
          join(l) {
            const Q = l.on && this.expr(l.on);
            return !Q && !l.using ? l : g(l, {
              on: Q
            });
          }
          fromTable(l) {
            const Q = this.tableRef(l.name);
            if (!Q)
              return null;
            const E = l.join && this.join(l.join);
            return g(l, {
              name: Q,
              join: E
            });
          }
          selectionColumn(l) {
            const Q = this.expr(l.expr);
            return Q ? g(l, {
              expr: Q
            }) : null;
          }
          // =========================================
          // ============== EXPRESSIONS ==============
          // =========================================
          expr(l) {
            if (!l)
              return l;
            switch (l.type) {
              case "binary":
                return this.binary(l);
              case "unary":
                return this.unary(l);
              case "ref":
                return this.ref(l);
              case "string":
              case "numeric":
              case "integer":
              case "boolean":
              case "constant":
              case "null":
                return this.constant(l);
              case "list":
              case "array":
                return this.array(l);
              case "array select":
                return this.arraySelect(l);
              case "call":
                return this.call(l);
              case "cast":
                return this.cast(l);
              case "case":
                return this.case(l);
              case "member":
                return this.member(l);
              case "arrayIndex":
                return this.arrayIndex(l);
              case "ternary":
                return this.ternary(l);
              case "select":
              case "union":
              case "union all":
              case "with":
              case "with recursive":
                return this.select(l);
              case "keyword":
                return this.valueKeyword(l);
              case "parameter":
                return this.parameter(l);
              case "extract":
                return this.extract(l);
              case "overlay":
                return this.callOverlay(l);
              case "substring":
                return this.callSubstring(l);
              case "values":
                return this.values(l);
              case "default":
                return this.default(l);
              default:
                throw n.NotSupported.never(l);
            }
          }
          arraySelect(l) {
            const Q = this.select(l.select);
            return Q ? g(l, { select: Q }) : null;
          }
          extract(l) {
            const Q = this.expr(l.from);
            return Q ? g(l, { from: Q }) : null;
          }
          valueKeyword(l) {
            return l;
          }
          ternary(l) {
            const Q = this.expr(l.value), E = this.expr(l.lo), d = this.expr(l.hi);
            return !Q || !E || !d ? null : g(l, {
              value: Q,
              lo: E,
              hi: d
            });
          }
          parameter(l) {
            return l;
          }
          arrayIndex(l) {
            const Q = this.expr(l.array), E = this.expr(l.index);
            return !Q || !E ? null : g(l, {
              array: Q,
              index: E
            });
          }
          member(l) {
            const Q = this.expr(l.operand);
            return Q ? g(l, {
              operand: Q
            }) : null;
          }
          case(l) {
            const Q = l.value && this.expr(l.value), E = s(l.whens, (m) => {
              const y = this.expr(m.when), f = this.expr(m.value);
              return !y || !f ? null : g(m, {
                value: f,
                when: y
              });
            });
            if (!(E != null && E.length))
              return null;
            const d = l.else && this.expr(l.else);
            return g(l, {
              value: Q,
              whens: E,
              else: d
            });
          }
          cast(l) {
            const Q = this.expr(l.operand);
            return Q ? g(l, {
              operand: Q
            }) : null;
          }
          call(l) {
            const Q = s(l.args, (m) => this.expr(m));
            if (!Q)
              return null;
            const E = this.orderBy(l.orderBy), d = this.expr(l.filter);
            return g(l, {
              args: Q,
              orderBy: E,
              filter: d
            });
          }
          callSubstring(l) {
            return g(l, {
              value: this.expr(l.value),
              from: this.expr(l.from),
              for: this.expr(l.for)
            });
          }
          callOverlay(l) {
            return g(l, {
              value: this.expr(l.value),
              placing: this.expr(l.placing),
              from: this.expr(l.from),
              for: this.expr(l.for)
            });
          }
          array(l) {
            const Q = s(l.expressions, (E) => this.expr(E));
            return Q ? g(l, {
              expressions: Q
            }) : null;
          }
          constant(l) {
            return l;
          }
          default(l) {
            return l;
          }
          /** Called when a reference is used */
          ref(l) {
            return l;
          }
          unary(l) {
            const Q = this.expr(l.operand);
            return Q ? g(l, {
              operand: Q
            }) : null;
          }
          binary(l) {
            const Q = this.expr(l.left), E = this.expr(l.right);
            return !Q || !E ? null : g(l, {
              left: Q,
              right: E
            });
          }
        }
        t.AstDefaultMapper = r;
        const a = r.prototype;
        for (const B of Object.getOwnPropertyNames(a)) {
          const l = a[B];
          B === "constructor" || B === "super" || typeof l != "function" || Object.defineProperty(a, B, {
            configurable: !1,
            get() {
              return function(...Q) {
                var E;
                if (this.skipNext)
                  return this.skipNext = !1, l.apply(this, Q);
                const d = (E = this.wrapped) === null || E === void 0 ? void 0 : E[B];
                return d ? d.apply(this.wrapped, Q) : l.apply(this, Q);
              };
            }
          });
        }
        class C extends r {
          constructor(l) {
            super(), this.parent = l;
          }
        }
        for (const B of Object.getOwnPropertyNames(a)) {
          const l = a[B];
          B === "constructor" || B === "super" || typeof l != "function" || Object.defineProperty(C.prototype, B, {
            configurable: !1,
            get() {
              return function(...Q) {
                return this.parent.skipNext = !0, l.apply(this.parent, Q);
              };
            }
          });
        }
      },
      /* 3 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.sqlKeywords = void 0, t.sqlKeywords = [
          "ALL",
          "ANALYSE",
          "ANALYZE",
          "AND",
          "ANY",
          "ARRAY",
          "AS",
          "ASC",
          "ASYMMETRIC",
          "AUTHORIZATION",
          "BINARY",
          "BOTH",
          "CASE",
          "CAST",
          "CHECK",
          "COLLATE",
          "COLLATION",
          "CONCURRENTLY",
          "CONSTRAINT",
          "CREATE",
          "CROSS",
          "CURRENT_CATALOG",
          "CURRENT_DATE",
          "CURRENT_ROLE",
          "CURRENT_SCHEMA",
          "CURRENT_TIME",
          "CURRENT_TIMESTAMP",
          "CURRENT_USER",
          "DEFAULT",
          "DEFERRABLE",
          "DESC",
          "DISTINCT",
          "DO",
          "ELSE",
          "END",
          "EXCEPT",
          "FALSE",
          "FETCH",
          "FOR",
          "FOREIGN",
          "FREEZE",
          "FROM",
          "FULL",
          "GRANT",
          "GROUP",
          "HAVING",
          "ILIKE",
          "IN",
          "INITIALLY",
          "INNER",
          "INTERSECT",
          "INTO",
          "IS",
          "ISNULL",
          "JOIN",
          "LATERAL",
          "LEADING",
          "LEFT",
          "LIKE",
          "LIMIT",
          "LOCALTIME",
          "LOCALTIMESTAMP",
          "NATURAL",
          "NOT",
          "NOTNULL",
          "NULL",
          "OFFSET",
          "ON",
          "ONLY",
          "OR",
          "ORDER",
          "OUTER",
          "OVERLAPS",
          "PLACING",
          "PRIMARY",
          "REFERENCES",
          "RETURNING",
          "RIGHT",
          "SELECT",
          "SESSION_USER",
          "SIMILAR",
          "SOME",
          "SYMMETRIC",
          "TABLE",
          "TABLESAMPLE",
          "THEN",
          "TO",
          "TRAILING",
          "TRUE",
          "UNION",
          "UNIQUE",
          "USER",
          "USING",
          "VARIADIC",
          "VERBOSE",
          "WHEN",
          "WHERE",
          "WINDOW",
          "WITH",
          "PRECISION"
        ];
      },
      /* 4 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.intervalToString = t.normalizeInterval = t.buildInterval = void 0;
        const n = [
          ["years", 12],
          ["months", 30],
          ["days", 24],
          ["hours", 60],
          ["minutes", 60],
          ["seconds", 1e3],
          ["milliseconds", 0]
        ];
        function* o(C) {
          if (typeof C[1] == "number")
            yield C;
          else
            for (const B of C)
              yield* o(B);
        }
        function g(C, B) {
          var l;
          const Q = {};
          if (B === "invalid")
            throw new Error(`invalid input syntax for type interval: "${C}"`);
          for (const [E, d] of o(B))
            Q[E] = ((l = Q[E]) !== null && l !== void 0 ? l : 0) + d;
          return Q;
        }
        t.buildInterval = g;
        function s(C) {
          var B, l, Q, E, d, m, y, f, w;
          const G = { ...C };
          for (let Z = 0; Z < n.length; Z++) {
            const [c, J] = n[Z], p = (B = G[c]) !== null && B !== void 0 ? B : 0, N = p >= 0 ? Math.floor(p) : Math.ceil(p);
            if (!p || N === p)
              continue;
            const v = (l = n[Z + 1]) === null || l === void 0 ? void 0 : l[0];
            v && (G[v] = ((Q = G[v]) !== null && Q !== void 0 ? Q : 0) + J * (p - N)), G[c] = N;
          }
          if (G.months || G.years) {
            const Z = ((E = G.months) !== null && E !== void 0 ? E : 0) + ((d = G.years) !== null && d !== void 0 ? d : 0) * 12;
            G.months = Z % 12, G.years = (Z - G.months) / 12;
          }
          let R = ((m = G.hours) !== null && m !== void 0 ? m : 0) * 3600 + ((y = G.minutes) !== null && y !== void 0 ? y : 0) * 60 + ((f = G.seconds) !== null && f !== void 0 ? f : 0) + ((w = G.milliseconds) !== null && w !== void 0 ? w : 0) / 1e3, F = 1;
          R < 0 && (F = -1, R = -R), R >= 3600 ? (G.hours = F * Math.floor(R / 3600), R -= F * G.hours * 3600) : delete G.hours, R >= 60 ? (G.minutes = F * Math.floor(R / 60), R -= F * G.minutes * 60) : delete G.minutes, R > 0 ? (G.seconds = F * Math.floor(R), R -= F * G.seconds) : delete G.seconds, R > 0 ? G.milliseconds = F * Math.round(R * 1e3) : delete G.milliseconds;
          for (const [Z] of n)
            G[Z] || delete G[Z];
          return G;
        }
        t.normalizeInterval = s;
        function I(C) {
          var B, l, Q;
          C = s(C);
          const E = [];
          if (C.years && E.push(C.years === 1 ? "1 year" : C.years + " years"), C.months && E.push(C.months === 1 ? "1 month" : C.months + " months"), C.days && E.push(C.days === 1 ? "1 day" : C.days + " days"), C.hours || C.minutes || C.seconds || C.milliseconds) {
            let d = `${r((B = C.hours) !== null && B !== void 0 ? B : 0)}:${r((l = C.minutes) !== null && l !== void 0 ? l : 0)}:${r((Q = C.seconds) !== null && Q !== void 0 ? Q : 0)}`;
            C.milliseconds && (d = d + (C.milliseconds / 1e3).toString().substr(1)), (a(C.hours) || a(C.minutes) || a(C.seconds) || a(C.milliseconds)) && (d = "-" + d), E.push(d);
          }
          return E.join(" ");
        }
        t.intervalToString = I;
        function r(C) {
          return C = Math.abs(C), C < 10 ? "0" + C : C.toString();
        }
        function a(C) {
          return C && C < 0;
        }
      },
      /* 5 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.astVisitor = void 0;
        const n = i(2);
        class o {
          super() {
            return new s(this);
          }
        }
        const g = n.AstDefaultMapper.prototype;
        for (const r of Object.getOwnPropertyNames(g)) {
          const a = g[r];
          r === "constructor" || r === "super" || typeof a != "function" || Object.defineProperty(o.prototype, r, {
            configurable: !1,
            get() {
              return function(...C) {
                const B = this.visitor[r];
                return B ? (B.apply(this.visitor, C), C[0]) : a.apply(this, C);
              };
            }
          });
        }
        class s {
          constructor(a) {
            this.parent = a;
          }
        }
        for (const r of Object.getOwnPropertyNames(g)) {
          const a = g[r];
          r === "constructor" || r === "super" || typeof a != "function" || Object.defineProperty(s.prototype, r, {
            configurable: !1,
            get() {
              return function(...C) {
                return a.apply(this.parent, C);
              };
            }
          });
        }
        function I(r) {
          return (0, n.astMapper)((a) => {
            const C = new o();
            return C.mapper = a, C.visitor = r(C), C;
          });
        }
        t.astVisitor = I;
      },
      /* 6 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.trimNullish = t.NotSupported = void 0;
        class n extends Error {
          constructor(s) {
            super("Not supported" + (s ? ": " + s : ""));
          }
          static never(s, I) {
            return new n(`${I ?? ""} ${JSON.stringify(s)}`);
          }
        }
        t.NotSupported = n;
        function o(g, s = 5) {
          if (s < 0 || (g instanceof Array && g.forEach((I) => o(I, s - 1)), typeof g != "object" || g instanceof Date) || !g)
            return g;
          for (const I of Object.keys(g)) {
            const r = g[I];
            r == null ? delete g[I] : o(r, s - 1);
          }
          return g;
        }
        t.trimNullish = o;
      },
      /* 7 */
      /***/
      function(e, t, i) {
        var n = this && this.__createBinding || (Object.create ? function(C, B, l, Q) {
          Q === void 0 && (Q = l);
          var E = Object.getOwnPropertyDescriptor(B, l);
          (!E || ("get" in E ? !B.__esModule : E.writable || E.configurable)) && (E = { enumerable: !0, get: function() {
            return B[l];
          } }), Object.defineProperty(C, Q, E);
        } : function(C, B, l, Q) {
          Q === void 0 && (Q = l), C[Q] = B[l];
        }), o = this && this.__exportStar || function(C, B) {
          for (var l in C)
            l !== "default" && !Object.prototype.hasOwnProperty.call(B, l) && n(B, C, l);
        };
        Object.defineProperty(t, "__esModule", { value: !0 }), t.normalizeInterval = t.intervalToString = t.toSql = t.astMapper = t.assignChanged = t.arrayNilMap = t.astVisitor = t.parseWithComments = t.parseIntervalLiteral = t.parseGeometricLiteral = t.parseArrayLiteral = t.parseFirst = t.parse = void 0;
        var g = i(8);
        Object.defineProperty(t, "parse", { enumerable: !0, get: function() {
          return g.parse;
        } }), Object.defineProperty(t, "parseFirst", { enumerable: !0, get: function() {
          return g.parseFirst;
        } }), Object.defineProperty(t, "parseArrayLiteral", { enumerable: !0, get: function() {
          return g.parseArrayLiteral;
        } }), Object.defineProperty(t, "parseGeometricLiteral", { enumerable: !0, get: function() {
          return g.parseGeometricLiteral;
        } }), Object.defineProperty(t, "parseIntervalLiteral", { enumerable: !0, get: function() {
          return g.parseIntervalLiteral;
        } }), Object.defineProperty(t, "parseWithComments", { enumerable: !0, get: function() {
          return g.parseWithComments;
        } });
        var s = i(5);
        Object.defineProperty(t, "astVisitor", { enumerable: !0, get: function() {
          return s.astVisitor;
        } });
        var I = i(2);
        Object.defineProperty(t, "arrayNilMap", { enumerable: !0, get: function() {
          return I.arrayNilMap;
        } }), Object.defineProperty(t, "assignChanged", { enumerable: !0, get: function() {
          return I.assignChanged;
        } }), Object.defineProperty(t, "astMapper", { enumerable: !0, get: function() {
          return I.astMapper;
        } });
        var r = i(19);
        Object.defineProperty(t, "toSql", { enumerable: !0, get: function() {
          return r.toSql;
        } }), o(i(21), t);
        var a = i(4);
        Object.defineProperty(t, "intervalToString", { enumerable: !0, get: function() {
          return a.intervalToString;
        } }), Object.defineProperty(t, "normalizeInterval", { enumerable: !0, get: function() {
          return a.normalizeInterval;
        } });
      },
      /* 8 */
      /***/
      function(e, t, i) {
        var n = this && this.__importDefault || function(c) {
          return c && c.__esModule ? c : { default: c };
        };
        Object.defineProperty(t, "__esModule", { value: !0 }), t.parseGeometricLiteral = t.parseIntervalLiteral = t.parseArrayLiteral = t.parse = t.parseWithComments = t.parseFirst = void 0;
        const o = i(9), g = n(i(10)), s = n(i(11)), I = n(i(13)), r = n(i(15)), a = n(i(17)), C = i(4), B = i(1);
        let l, Q, E, d, m;
        function y(c) {
          return w(c)[0];
        }
        t.parseFirst = y;
        function f(c, J) {
          return (0, B.trackingComments)(() => w(c, J));
        }
        t.parseWithComments = f;
        function w(c, J) {
          l || (l = o.Grammar.fromCompiled(g.default));
          const p = typeof J == "string" ? J : J == null ? void 0 : J.entry, N = typeof J == "string" ? null : J, v = () => Z(c, l, p);
          let K = N != null && N.locationTracking ? (0, B.tracking)(v) : v();
          return typeof J != "string" && !Array.isArray(K) && (K = [K]), K;
        }
        t.parse = w;
        function G(c) {
          return Q || (Q = o.Grammar.fromCompiled(s.default)), Z(c, Q);
        }
        t.parseArrayLiteral = G;
        function R(c) {
          if (c.startsWith("P"))
            return m || (m = o.Grammar.fromCompiled(a.default)), (0, C.buildInterval)(c, Z(c, m));
          {
            d || (d = o.Grammar.fromCompiled(r.default));
            const J = c.toLowerCase();
            return (0, C.buildInterval)(c, Z(J, d));
          }
        }
        t.parseIntervalLiteral = R;
        function F(c, J) {
          return E || (E = o.Grammar.fromCompiled(I.default)), Z(c, E, J);
        }
        t.parseGeometricLiteral = F;
        function Z(c, J, p) {
          try {
            J.start = p ?? "main";
            const N = new o.Parser(J);
            N.feed(c);
            const v = N.finish();
            if (v.length) {
              if (v.length !== 1)
                throw new Error(`💀 Ambiguous SQL syntax: Please file an issue stating the request that has failed at https://github.com/oguimbal/pgsql-ast-parser:

        ${c}

        `);
            } else
              throw new Error("Unexpected end of input");
            return v[0];
          } catch (N) {
            if (typeof (N == null ? void 0 : N.message) != "string")
              throw N;
            let v = N.message, K = null;
            const U = [], j = /A (.+) token based on:/g;
            let q;
            for (; q = j.exec(v); )
              K = K ?? v.substr(0, q.index), U.push(`    - A "${q[1]}" token`);
            throw K && (v = K + U.join(`
`) + `

`), N.message = v, N;
          }
        }
      },
      /* 9 */
      /***/
      function(e, t) {
        e.exports = rxt();
      },
      /* 10 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(c) {
          return c[0];
        }
        const o = i(1), g = i(1);
        function s(c) {
          return I(c, void 0);
        }
        function I(c, J) {
          const p = d(c);
          return !J || J.length === 0 ? (0, g.track)(c, { name: p }) : (0, g.track)(c, {
            name: p,
            columns: J.map((N) => ({ name: d(N) }))
          });
        }
        function r(c) {
          const J = d(c);
          return (0, g.track)(c, { value: J });
        }
        function a(c) {
          return Array.isArray(c) && c.length === 1 && (c = a(c[0])), Array.isArray(c) && !c.length ? null : (0, g.unbox)(c);
        }
        const C = (c) => (J) => (0, g.track)(J, J[c]), B = (c) => Array.isArray(c) ? (0, g.track)(c[c.length - 1], c[c.length - 1]) : c;
        function l(c) {
          if (Array.isArray(c)) {
            const J = [];
            for (const p of c)
              J.push(...l(p));
            return J;
          }
          return c ? [c] : [];
        }
        function Q(c) {
          var J;
          return c = (0, g.unbox)(c), (J = c == null ? void 0 : c.value) !== null && J !== void 0 ? J : c;
        }
        function E(c) {
          return l((0, g.unbox)(c)).filter((p) => !!p).map((p) => Q(p)).filter((p) => typeof p == "string").map((p) => p.trim()).filter((p) => !!p);
        }
        function d(c, J) {
          return E(c).join(J || "");
        }
        function m(c) {
          const J = {};
          for (const [p, N] of c)
            J[p] = N;
          return J;
        }
        const y = { sensitivity: "accent" }, f = (c, J) => c.localeCompare(J, void 0, y) === 0, w = (c) => (J, p, N) => {
          const v = Q(J[0]);
          return f(v, c) ? (0, g.box)(J, c) : N;
        }, G = w, R = (...c) => {
          const J = new Set(c);
          return (p, N, v) => {
            const K = typeof p[0] == "string" ? p[0] : p[0].value;
            return J.has(K) ? K : v;
          };
        };
        function F(c, J) {
          const p = /* @__PURE__ */ new Set(), N = J.map(g.unbox);
          for (const [v, K] of N) {
            if (p.has(v))
              throw new Error("conflicting or redundant options");
            p.add(v), c[v] = (0, g.unbox)(K);
          }
        }
        const Z = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "lparen", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen] },
            { name: "rparen", symbols: [o.lexerAny.has("rparen") ? { type: "rparen" } : rparen] },
            { name: "number$subexpression$1", symbols: ["float"] },
            { name: "number$subexpression$1", symbols: ["int"] },
            { name: "number", symbols: ["number$subexpression$1"], postprocess: a },
            { name: "dot", symbols: [o.lexerAny.has("dot") ? { type: "dot" } : dot], postprocess: n },
            { name: "float", symbols: [o.lexerAny.has("float") ? { type: "float" } : float], postprocess: (c) => (0, g.box)(c, parseFloat(a(c))) },
            { name: "int", symbols: [o.lexerAny.has("int") ? { type: "int" } : int], postprocess: (c) => (0, g.box)(c, parseInt(a(c), 10)) },
            { name: "comma", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma], postprocess: n },
            { name: "star", symbols: [o.lexerAny.has("star") ? { type: "star" } : star], postprocess: (c) => (0, g.box)(c, c[0].value) },
            { name: "string$subexpression$1", symbols: [o.lexerAny.has("string") ? { type: "string" } : string] },
            { name: "string$subexpression$1", symbols: [o.lexerAny.has("eString") ? { type: "eString" } : eString] },
            { name: "string", symbols: ["string$subexpression$1"], postprocess: (c) => (0, g.box)(c, a(c[0]).value) },
            { name: "ident", symbols: ["word"], postprocess: C(0) },
            { name: "word", symbols: [o.lexerAny.has("kw_primary") ? { type: "kw_primary" } : kw_primary], postprocess: (c) => (0, g.box)(c, "primary") },
            { name: "word", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique], postprocess: (c) => (0, g.box)(c, "unique") },
            { name: "word", symbols: [o.lexerAny.has("quoted_word") ? { type: "quoted_word" } : quoted_word], postprocess: (c) => (0, g.box)(c, c[0].value, !0) },
            { name: "word", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: (c) => (0, g.box)(c, c[0].value) },
            { name: "collist_paren", symbols: ["lparen", "collist", "rparen"], postprocess: C(1) },
            { name: "collist$ebnf$1", symbols: [] },
            { name: "collist$ebnf$1$subexpression$1", symbols: ["comma", "ident"], postprocess: B },
            { name: "collist$ebnf$1", symbols: ["collist$ebnf$1", "collist$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "collist", symbols: ["ident", "collist$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "kw_between", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("between") },
            { name: "kw_conflict", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("conflict") },
            { name: "kw_nothing", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("nothing") },
            { name: "kw_begin", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("begin") },
            { name: "kw_if", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("if") },
            { name: "kw_exists", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("exists") },
            { name: "kw_key", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("key") },
            { name: "kw_index", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("index") },
            { name: "kw_extension", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("extension") },
            { name: "kw_schema", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("schema") },
            { name: "kw_nulls", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("nulls") },
            { name: "kw_first", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("first") },
            { name: "kw_last", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("last") },
            { name: "kw_start", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("start") },
            { name: "kw_restart", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("restart") },
            { name: "kw_filter", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("filter") },
            { name: "kw_commit", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("commit") },
            { name: "kw_tablespace", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("tablespace") },
            { name: "kw_transaction", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("transaction") },
            { name: "kw_work", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("work") },
            { name: "kw_read", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("read") },
            { name: "kw_write", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("write") },
            { name: "kw_isolation", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("isolation") },
            { name: "kw_level", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("level") },
            { name: "kw_serializable", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("serializable") },
            { name: "kw_rollback", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("rollback") },
            { name: "kw_insert", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("insert") },
            { name: "kw_value", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("value") },
            { name: "kw_values", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("values") },
            { name: "kw_update", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("update") },
            { name: "kw_column", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("column") },
            { name: "kw_set", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("set") },
            { name: "kw_version", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("version") },
            { name: "kw_alter", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("alter") },
            { name: "kw_rename", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("rename") },
            { name: "kw_sequence", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("sequence") },
            { name: "kw_temp", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("temp") },
            { name: "kw_temporary", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("temporary") },
            { name: "kw_add", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("add") },
            { name: "kw_owner", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("owner") },
            { name: "kw_owned", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("owned") },
            { name: "kw_including", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("including") },
            { name: "kw_excluding", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("excluding") },
            { name: "kw_none", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("none") },
            { name: "kw_drop", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("drop") },
            { name: "kw_operator", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("operator") },
            { name: "kw_minvalue", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("minvalue") },
            { name: "kw_maxvalue", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("maxvalue") },
            { name: "kw_data", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("data") },
            { name: "kw_type", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("type") },
            { name: "kw_trigger", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("trigger") },
            { name: "kw_delete", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("delete") },
            { name: "kw_cache", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("cache") },
            { name: "kw_cascade", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("cascade") },
            { name: "kw_no", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("no") },
            { name: "kw_timestamp", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("timestamp") },
            { name: "kw_cycle", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("cycle") },
            { name: "kw_function", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("function") },
            { name: "kw_returns", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("returns") },
            { name: "kw_language", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("language") },
            { name: "kw_out", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("out") },
            { name: "kw_inout", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("inout") },
            { name: "kw_variadic", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("variadic") },
            { name: "kw_action", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("action") },
            { name: "kw_restrict", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("restrict") },
            { name: "kw_truncate", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("truncate") },
            { name: "kw_increment", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("increment") },
            { name: "kw_by", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("by") },
            { name: "kw_row", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("row") },
            { name: "kw_rows", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("rows") },
            { name: "kw_next", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("next") },
            { name: "kw_match", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("match") },
            { name: "kw_replace", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("replace") },
            { name: "kw_recursive", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("recursive") },
            { name: "kw_view", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("view") },
            { name: "kw_cascaded", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("cascaded") },
            { name: "kw_unlogged", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("unlogged") },
            { name: "kw_global", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("global") },
            { name: "kw_option", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("option") },
            { name: "kw_materialized", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("materialized") },
            { name: "kw_partial", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("partial") },
            { name: "kw_partition", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("partition") },
            { name: "kw_simple", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("simple") },
            { name: "kw_generated", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("generated") },
            { name: "kw_always", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("always") },
            { name: "kw_identity", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("identity") },
            { name: "kw_name", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("name") },
            { name: "kw_enum", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("enum") },
            { name: "kw_show", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("show") },
            { name: "kw_ordinality", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("ordinality") },
            { name: "kw_overriding", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("overriding") },
            { name: "kw_over", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("over") },
            { name: "kw_system", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("system") },
            { name: "kw_comment", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("comment") },
            { name: "kw_time", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("time") },
            { name: "kw_at", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("at") },
            { name: "kw_zone", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("zone") },
            { name: "kw_interval", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("interval") },
            { name: "kw_hour", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("hour") },
            { name: "kw_minute", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("minute") },
            { name: "kw_local", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("local") },
            { name: "kw_prepare", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("prepare") },
            { name: "kw_deallocate", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("deallocate") },
            { name: "kw_raise", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("raise") },
            { name: "kw_continue", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("continue") },
            { name: "kw_share", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("share") },
            { name: "kw_refresh", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("refresh") },
            { name: "kw_nowait", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("nowait") },
            { name: "kw_skip", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("skip") },
            { name: "kw_locked", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: w("locked") },
            { name: "kw_ifnotexists", symbols: ["kw_if", o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not, "kw_exists"] },
            { name: "kw_ifexists", symbols: ["kw_if", "kw_exists"] },
            { name: "kw_withordinality", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "kw_ordinality"] },
            { name: "kw_not_null", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not, o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null] },
            { name: "kw_primary_key", symbols: [o.lexerAny.has("kw_primary") ? { type: "kw_primary" } : kw_primary, "kw_key"] },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$2", symbols: ["int"] },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "data_type$ebnf$1$subexpression$1$macrocall$2"], postprocess: B },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1", symbols: ["data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1", "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "data_type$ebnf$1$subexpression$1$macrocall$1", symbols: ["data_type$ebnf$1$subexpression$1$macrocall$2", "data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "data_type$ebnf$1$subexpression$1", symbols: ["lparen", "data_type$ebnf$1$subexpression$1$macrocall$1", "rparen"], postprocess: C(1) },
            { name: "data_type$ebnf$1", symbols: ["data_type$ebnf$1$subexpression$1"], postprocess: n },
            { name: "data_type$ebnf$1", symbols: [], postprocess: () => null },
            { name: "data_type$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("kw_array") ? { type: "kw_array" } : kw_array] },
            { name: "data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket] },
            { name: "data_type$ebnf$2$subexpression$1$ebnf$1", symbols: ["data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1"] },
            { name: "data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2", symbols: [o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket] },
            { name: "data_type$ebnf$2$subexpression$1$ebnf$1", symbols: ["data_type$ebnf$2$subexpression$1$ebnf$1", "data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "data_type$ebnf$2$subexpression$1", symbols: ["data_type$ebnf$2$subexpression$1$ebnf$1"] },
            { name: "data_type$ebnf$2", symbols: ["data_type$ebnf$2$subexpression$1"], postprocess: n },
            { name: "data_type$ebnf$2", symbols: [], postprocess: () => null },
            { name: "data_type", symbols: ["data_type_simple", "data_type$ebnf$1", "data_type$ebnf$2"], postprocess: (c) => {
              let J = c[2];
              const p = a(c[0]);
              let N;
              if (N = {
                ...p,
                ...Array.isArray(c[1]) && c[1].length ? { config: c[1].map(a) } : {}
              }, J) {
                J[0].type === "kw_array" && (J = [["array"]]);
                for (const v of J[0])
                  N = {
                    kind: "array",
                    arrayOf: N
                  };
              }
              return (0, g.track)(c, N);
            } },
            { name: "data_type_list$ebnf$1", symbols: [] },
            { name: "data_type_list$ebnf$1$subexpression$1", symbols: ["comma", "data_type"], postprocess: B },
            { name: "data_type_list$ebnf$1", symbols: ["data_type_list$ebnf$1", "data_type_list$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "data_type_list", symbols: ["data_type", "data_type_list$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "data_type_simple", symbols: ["data_type_text"], postprocess: (c) => (0, g.track)(c, { name: d(c, " ") }) },
            { name: "data_type_simple", symbols: ["data_type_numeric"], postprocess: (c) => (0, g.track)(c, { name: d(c, " ") }) },
            { name: "data_type_simple", symbols: ["data_type_date"] },
            { name: "data_type_simple", symbols: ["qualified_name_mark_quotes"] },
            { name: "data_type_numeric$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("double") },
            { name: "data_type_numeric", symbols: ["data_type_numeric$subexpression$1", o.lexerAny.has("kw_precision") ? { type: "kw_precision" } : kw_precision] },
            { name: "data_type_text$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("character", "bit") },
            { name: "data_type_text$subexpression$2", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("varying") },
            { name: "data_type_text", symbols: ["data_type_text$subexpression$1", "data_type_text$subexpression$2"] },
            { name: "data_type_date$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("timestamp", "time") },
            { name: "data_type_date$subexpression$2", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with] },
            { name: "data_type_date$subexpression$2", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("without") },
            { name: "data_type_date$subexpression$3", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("time") },
            { name: "data_type_date$subexpression$4", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("zone") },
            { name: "data_type_date", symbols: ["data_type_date$subexpression$1", "data_type_date$subexpression$2", "data_type_date$subexpression$3", "data_type_date$subexpression$4"], postprocess: (c) => (0, g.track)(c, { name: d(c, " ") }) },
            { name: "data_type_date$subexpression$5", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("timestamp", "time") },
            { name: "data_type_date$subexpression$6", symbols: ["lparen", "int", "rparen"], postprocess: C(1) },
            { name: "data_type_date$subexpression$7", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with] },
            { name: "data_type_date$subexpression$7", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("without") },
            { name: "data_type_date$subexpression$8", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("time") },
            { name: "data_type_date$subexpression$9", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: G("zone") },
            { name: "data_type_date", symbols: ["data_type_date$subexpression$5", "data_type_date$subexpression$6", "data_type_date$subexpression$7", "data_type_date$subexpression$8", "data_type_date$subexpression$9"], postprocess: (c) => (0, g.track)(c, { name: `timestamp ${d(c[2])} time zone`, config: [(0, g.unbox)(c[1])] }) },
            { name: "ident_aliased$subexpression$1", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "ident"], postprocess: B },
            { name: "ident_aliased", symbols: ["ident_aliased$subexpression$1"] },
            { name: "ident_aliased", symbols: ["ident"], postprocess: a },
            { name: "table_ref", symbols: ["qualified_name"], postprocess: a },
            { name: "qcolumn$ebnf$1$subexpression$1", symbols: ["dot", "ident"], postprocess: B },
            { name: "qcolumn$ebnf$1", symbols: ["qcolumn$ebnf$1$subexpression$1"], postprocess: n },
            { name: "qcolumn$ebnf$1", symbols: [], postprocess: () => null },
            { name: "qcolumn", symbols: ["ident", "dot", "ident", "qcolumn$ebnf$1"], postprocess: (c) => c[3] ? (0, g.track)(c, {
              schema: (0, g.unbox)(c[0]),
              table: (0, g.unbox)(c[2]),
              column: (0, g.unbox)(c[3])
            }) : (0, g.track)(c, {
              table: (0, g.unbox)(c[0]),
              column: (0, g.unbox)(c[2])
            }) },
            { name: "table_ref_aliased$ebnf$1", symbols: ["ident_aliased"], postprocess: n },
            { name: "table_ref_aliased$ebnf$1", symbols: [], postprocess: () => null },
            { name: "table_ref_aliased", symbols: ["table_ref", "table_ref_aliased$ebnf$1"], postprocess: (c) => {
              const J = a(c[1]);
              return (0, g.track)(c, {
                ...a(c[0]),
                ...J ? { alias: J } : {}
              });
            } },
            { name: "qualified_name", symbols: ["qname_ident"], postprocess: (c) => (0, g.track)(c, { name: d(c) }) },
            { name: "qualified_name", symbols: ["ident", "dot", "ident_extended"], postprocess: (c) => {
              const J = d(c[0]), p = d(c[2]);
              return (0, g.track)(c, { schema: J, name: p });
            } },
            { name: "qualified_name", symbols: [o.lexerAny.has("kw_current_schema") ? { type: "kw_current_schema" } : kw_current_schema], postprocess: (c) => (0, g.track)(c, { name: "current_schema" }) },
            { name: "qualified_name_mark_quotes", symbols: ["qname_ident"], postprocess: (c) => (0, g.track)(c, { name: d(c), ...(0, g.doubleQuoted)(c) }) },
            { name: "qualified_name_mark_quotes", symbols: ["ident", "dot", "ident_extended"], postprocess: (c) => {
              const J = d(c[0]), p = d(c[2]);
              return (0, g.track)(c, { schema: J, name: p, ...(0, g.doubleQuoted)(c[2]) });
            } },
            { name: "qualified_name_mark_quotes", symbols: [o.lexerAny.has("kw_current_schema") ? { type: "kw_current_schema" } : kw_current_schema], postprocess: (c) => (0, g.track)(c, { name: "current_schema" }) },
            { name: "qname_ident", symbols: ["ident"] },
            { name: "qname_ident", symbols: [o.lexerAny.has("kw_precision") ? { type: "kw_precision" } : kw_precision] },
            { name: "qname", symbols: ["qualified_name"], postprocess: a },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_analyse") ? { type: "kw_analyse" } : kw_analyse] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_analyze") ? { type: "kw_analyze" } : kw_analyze] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_and") ? { type: "kw_and" } : kw_and] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_any") ? { type: "kw_any" } : kw_any] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_array") ? { type: "kw_array" } : kw_array] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_asc") ? { type: "kw_asc" } : kw_asc] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_asymmetric") ? { type: "kw_asymmetric" } : kw_asymmetric] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_authorization") ? { type: "kw_authorization" } : kw_authorization] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_binary") ? { type: "kw_binary" } : kw_binary] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_both") ? { type: "kw_both" } : kw_both] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_case") ? { type: "kw_case" } : kw_case] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_cast") ? { type: "kw_cast" } : kw_cast] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_check") ? { type: "kw_check" } : kw_check] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_collate") ? { type: "kw_collate" } : kw_collate] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_collation") ? { type: "kw_collation" } : kw_collation] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_concurrently") ? { type: "kw_concurrently" } : kw_concurrently] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_cross") ? { type: "kw_cross" } : kw_cross] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_catalog") ? { type: "kw_current_catalog" } : kw_current_catalog] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_date") ? { type: "kw_current_date" } : kw_current_date] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_role") ? { type: "kw_current_role" } : kw_current_role] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_schema") ? { type: "kw_current_schema" } : kw_current_schema] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_time") ? { type: "kw_current_time" } : kw_current_time] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_timestamp") ? { type: "kw_current_timestamp" } : kw_current_timestamp] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_current_user") ? { type: "kw_current_user" } : kw_current_user] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_deferrable") ? { type: "kw_deferrable" } : kw_deferrable] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_desc") ? { type: "kw_desc" } : kw_desc] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_distinct") ? { type: "kw_distinct" } : kw_distinct] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_do") ? { type: "kw_do" } : kw_do] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_else") ? { type: "kw_else" } : kw_else] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_end") ? { type: "kw_end" } : kw_end] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_except") ? { type: "kw_except" } : kw_except] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_false") ? { type: "kw_false" } : kw_false] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_fetch") ? { type: "kw_fetch" } : kw_fetch] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_for") ? { type: "kw_for" } : kw_for] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_foreign") ? { type: "kw_foreign" } : kw_foreign] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_freeze") ? { type: "kw_freeze" } : kw_freeze] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_full") ? { type: "kw_full" } : kw_full] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_grant") ? { type: "kw_grant" } : kw_grant] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_group") ? { type: "kw_group" } : kw_group] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_having") ? { type: "kw_having" } : kw_having] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_ilike") ? { type: "kw_ilike" } : kw_ilike] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_in") ? { type: "kw_in" } : kw_in] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_initially") ? { type: "kw_initially" } : kw_initially] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_inner") ? { type: "kw_inner" } : kw_inner] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_intersect") ? { type: "kw_intersect" } : kw_intersect] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_into") ? { type: "kw_into" } : kw_into] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_isnull") ? { type: "kw_isnull" } : kw_isnull] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_join") ? { type: "kw_join" } : kw_join] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_lateral") ? { type: "kw_lateral" } : kw_lateral] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_leading") ? { type: "kw_leading" } : kw_leading] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_left") ? { type: "kw_left" } : kw_left] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_like") ? { type: "kw_like" } : kw_like] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_limit") ? { type: "kw_limit" } : kw_limit] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_localtime") ? { type: "kw_localtime" } : kw_localtime] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_localtimestamp") ? { type: "kw_localtimestamp" } : kw_localtimestamp] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_natural") ? { type: "kw_natural" } : kw_natural] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_notnull") ? { type: "kw_notnull" } : kw_notnull] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_offset") ? { type: "kw_offset" } : kw_offset] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_only") ? { type: "kw_only" } : kw_only] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_or") ? { type: "kw_or" } : kw_or] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_order") ? { type: "kw_order" } : kw_order] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_outer") ? { type: "kw_outer" } : kw_outer] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_overlaps") ? { type: "kw_overlaps" } : kw_overlaps] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_placing") ? { type: "kw_placing" } : kw_placing] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_primary") ? { type: "kw_primary" } : kw_primary] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_references") ? { type: "kw_references" } : kw_references] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_returning") ? { type: "kw_returning" } : kw_returning] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_right") ? { type: "kw_right" } : kw_right] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_select") ? { type: "kw_select" } : kw_select] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_session_user") ? { type: "kw_session_user" } : kw_session_user] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_similar") ? { type: "kw_similar" } : kw_similar] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_some") ? { type: "kw_some" } : kw_some] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_symmetric") ? { type: "kw_symmetric" } : kw_symmetric] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_tablesample") ? { type: "kw_tablesample" } : kw_tablesample] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_then") ? { type: "kw_then" } : kw_then] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_trailing") ? { type: "kw_trailing" } : kw_trailing] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_true") ? { type: "kw_true" } : kw_true] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_union") ? { type: "kw_union" } : kw_union] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_user") ? { type: "kw_user" } : kw_user] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_using") ? { type: "kw_using" } : kw_using] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_variadic") ? { type: "kw_variadic" } : kw_variadic] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_verbose") ? { type: "kw_verbose" } : kw_verbose] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_when") ? { type: "kw_when" } : kw_when] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_window") ? { type: "kw_window" } : kw_window] },
            { name: "any_keyword", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with] },
            { name: "ident_extended", symbols: ["ident"] },
            { name: "ident_extended", symbols: ["any_keyword"] },
            { name: "select_statement$ebnf$1", symbols: ["select_from"], postprocess: n },
            { name: "select_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$2", symbols: ["select_where"], postprocess: n },
            { name: "select_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$3$subexpression$1$ebnf$1", symbols: ["select_having"], postprocess: n },
            { name: "select_statement$ebnf$3$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$3$subexpression$1", symbols: ["select_groupby", "select_statement$ebnf$3$subexpression$1$ebnf$1"] },
            { name: "select_statement$ebnf$3", symbols: ["select_statement$ebnf$3$subexpression$1"], postprocess: n },
            { name: "select_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$4", symbols: ["select_order_by"], postprocess: n },
            { name: "select_statement$ebnf$4", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$5", symbols: ["select_limit_offset"], postprocess: n },
            { name: "select_statement$ebnf$5", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$6$subexpression$1$ebnf$1", symbols: ["select_skip"], postprocess: n },
            { name: "select_statement$ebnf$6$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_statement$ebnf$6$subexpression$1", symbols: ["select_for", "select_statement$ebnf$6$subexpression$1$ebnf$1"] },
            { name: "select_statement$ebnf$6", symbols: ["select_statement$ebnf$6$subexpression$1"], postprocess: n },
            { name: "select_statement$ebnf$6", symbols: [], postprocess: () => null },
            { name: "select_statement", symbols: ["select_what", "select_statement$ebnf$1", "select_statement$ebnf$2", "select_statement$ebnf$3", "select_statement$ebnf$4", "select_statement$ebnf$5", "select_statement$ebnf$6"], postprocess: (c) => {
              let [J, p, N, v, K, U, j] = c;
              p = a(p);
              let q = v && v[0], O = v && v[1];
              q = q && (q.length === 1 && q[0].type === "list" ? q[0].expressions : q), O = O && a(O);
              let $ = j && j[0], _ = j && j[1];
              return _ = a(_), (0, g.track)(c, {
                ...J,
                ...p ? { from: Array.isArray(p) ? p : [p] } : {},
                ...q ? { groupBy: q } : {},
                ...O ? { having: O } : {},
                ...U ? { limit: a(U) } : {},
                ...K ? { orderBy: K } : {},
                ...N ? { where: N } : {},
                ...$ ? { for: $[1] } : {},
                ..._ ? { skip: _ } : {},
                type: "select"
              });
            } },
            { name: "select_from", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "select_from_items"], postprocess: B },
            { name: "select_from_items$ebnf$1", symbols: [] },
            { name: "select_from_items$ebnf$1$subexpression$1", symbols: ["comma", "select_from_item"], postprocess: B },
            { name: "select_from_items$ebnf$1", symbols: ["select_from_items$ebnf$1", "select_from_items$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_from_items", symbols: ["select_from_item", "select_from_items$ebnf$1"], postprocess: ([c, J]) => [...c, ...l(J) || []] },
            { name: "select_from_item", symbols: ["select_from_subject"] },
            { name: "select_from_item", symbols: ["select_from_item_joins"], postprocess: C(0) },
            { name: "select_from_item_joins$subexpression$1", symbols: ["select_from_item"], postprocess: C(0) },
            { name: "select_from_item_joins", symbols: ["select_from_item_joins$subexpression$1", "select_table_join"], postprocess: l },
            { name: "select_from_item_joins", symbols: ["lparen", "select_from_item_joins", "rparen"], postprocess: C(1) },
            { name: "select_from_subject", symbols: ["stb_table"], postprocess: a },
            { name: "select_from_subject", symbols: ["stb_statement"], postprocess: a },
            { name: "select_from_subject", symbols: ["stb_call"], postprocess: a },
            { name: "stb_opts$ebnf$1", symbols: ["collist_paren"], postprocess: n },
            { name: "stb_opts$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_opts", symbols: ["ident_aliased", "stb_opts$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              alias: d(c[0]),
              ...c[1] && { columnNames: (0, g.unbox)(c[1]).map(s) }
            }) },
            { name: "stb_table$ebnf$1", symbols: ["stb_opts"], postprocess: n },
            { name: "stb_table$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_table", symbols: ["table_ref", "stb_table$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              type: "table",
              name: (0, g.track)(c, {
                ...c[0],
                ...c[1]
              })
            }) },
            { name: "stb_statement", symbols: ["selection_paren", "stb_opts"], postprocess: (c) => (0, g.track)(c, {
              type: "statement",
              statement: a(c[0]),
              ...c[1]
            }) },
            { name: "select_values", symbols: ["kw_values", "insert_values"], postprocess: (c) => (0, g.track)(c, {
              type: "values",
              values: c[1]
            }) },
            { name: "stb_call$ebnf$1", symbols: ["kw_withordinality"], postprocess: n },
            { name: "stb_call$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_call$ebnf$2", symbols: ["stb_call_alias"], postprocess: n },
            { name: "stb_call$ebnf$2", symbols: [], postprocess: () => null },
            { name: "stb_call", symbols: ["expr_function_call", "stb_call$ebnf$1", "stb_call$ebnf$2"], postprocess: (c) => {
              const J = c[1], p = c[2];
              return !J && !p ? c[0] : (0, g.track)(c, {
                ...c[0],
                ...J && { withOrdinality: !0 },
                alias: p ? I(p[0], p[1]) : void 0
              });
            } },
            { name: "stb_call_alias$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as], postprocess: n },
            { name: "stb_call_alias$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_call_alias$subexpression$1", symbols: ["stb_call_alias$subexpression$1$ebnf$1", "ident"], postprocess: B },
            { name: "stb_call_alias$ebnf$1", symbols: ["stb_call_alias_list"], postprocess: n },
            { name: "stb_call_alias$ebnf$1", symbols: [], postprocess: () => null },
            { name: "stb_call_alias", symbols: ["stb_call_alias$subexpression$1", "stb_call_alias$ebnf$1"] },
            { name: "stb_call_alias_list", symbols: ["lparen", "stb_call_alias_list_raw", "rparen"], postprocess: C(1) },
            { name: "stb_call_alias_list_raw$ebnf$1", symbols: [] },
            { name: "stb_call_alias_list_raw$ebnf$1$subexpression$1", symbols: ["comma", "ident"], postprocess: B },
            { name: "stb_call_alias_list_raw$ebnf$1", symbols: ["stb_call_alias_list_raw$ebnf$1", "stb_call_alias_list_raw$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "stb_call_alias_list_raw", symbols: ["ident", "stb_call_alias_list_raw$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "select_table_join$ebnf$1", symbols: ["select_table_join_clause"], postprocess: n },
            { name: "select_table_join$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_table_join", symbols: ["select_join_op", o.lexerAny.has("kw_join") ? { type: "kw_join" } : kw_join, "select_from_subject", "select_table_join$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              ...a(c[2]),
              join: {
                type: d(c[0], " "),
                ...c[3] && a(c[3])
              }
            }) },
            { name: "select_table_join_clause", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "expr"], postprocess: (c) => (0, g.track)(c, { on: B(c) }) },
            { name: "select_table_join_clause$macrocall$2", symbols: ["ident"] },
            { name: "select_table_join_clause$macrocall$1$ebnf$1", symbols: [] },
            { name: "select_table_join_clause$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "select_table_join_clause$macrocall$2"], postprocess: B },
            { name: "select_table_join_clause$macrocall$1$ebnf$1", symbols: ["select_table_join_clause$macrocall$1$ebnf$1", "select_table_join_clause$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_table_join_clause$macrocall$1", symbols: ["select_table_join_clause$macrocall$2", "select_table_join_clause$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "select_table_join_clause", symbols: [o.lexerAny.has("kw_using") ? { type: "kw_using" } : kw_using, "lparen", "select_table_join_clause$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, { using: c[2].map(s) }) },
            { name: "select_join_op$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_inner") ? { type: "kw_inner" } : kw_inner], postprocess: n },
            { name: "select_join_op$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_join_op$subexpression$1", symbols: ["select_join_op$subexpression$1$ebnf$1"], postprocess: (c) => (0, g.box)(c, "INNER JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$1"] },
            { name: "select_join_op$subexpression$2", symbols: [o.lexerAny.has("kw_cross") ? { type: "kw_cross" } : kw_cross], postprocess: (c) => (0, g.box)(c, "CROSS JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$2"] },
            { name: "select_join_op$subexpression$3$ebnf$1", symbols: [o.lexerAny.has("kw_outer") ? { type: "kw_outer" } : kw_outer], postprocess: n },
            { name: "select_join_op$subexpression$3$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_join_op$subexpression$3", symbols: [o.lexerAny.has("kw_left") ? { type: "kw_left" } : kw_left, "select_join_op$subexpression$3$ebnf$1"], postprocess: (c) => (0, g.box)(c, "LEFT JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$3"] },
            { name: "select_join_op$subexpression$4$ebnf$1", symbols: [o.lexerAny.has("kw_outer") ? { type: "kw_outer" } : kw_outer], postprocess: n },
            { name: "select_join_op$subexpression$4$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_join_op$subexpression$4", symbols: [o.lexerAny.has("kw_right") ? { type: "kw_right" } : kw_right, "select_join_op$subexpression$4$ebnf$1"], postprocess: (c) => (0, g.box)(c, "RIGHT JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$4"] },
            { name: "select_join_op$subexpression$5$ebnf$1", symbols: [o.lexerAny.has("kw_outer") ? { type: "kw_outer" } : kw_outer], postprocess: n },
            { name: "select_join_op$subexpression$5$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_join_op$subexpression$5", symbols: [o.lexerAny.has("kw_full") ? { type: "kw_full" } : kw_full, "select_join_op$subexpression$5$ebnf$1"], postprocess: (c) => (0, g.box)(c, "FULL JOIN") },
            { name: "select_join_op", symbols: ["select_join_op$subexpression$5"] },
            { name: "select_what$ebnf$1", symbols: ["select_distinct"], postprocess: n },
            { name: "select_what$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_what$ebnf$2", symbols: ["select_expr_list_aliased"], postprocess: n },
            { name: "select_what$ebnf$2", symbols: [], postprocess: () => null },
            { name: "select_what", symbols: [o.lexerAny.has("kw_select") ? { type: "kw_select" } : kw_select, "select_what$ebnf$1", "select_what$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              columns: c[2],
              ...c[1] && { distinct: (0, g.unbox)(c[1]) }
            }) },
            { name: "select_expr_list_aliased$ebnf$1", symbols: [] },
            { name: "select_expr_list_aliased$ebnf$1$subexpression$1", symbols: ["comma", "select_expr_list_item"], postprocess: B },
            { name: "select_expr_list_aliased$ebnf$1", symbols: ["select_expr_list_aliased$ebnf$1", "select_expr_list_aliased$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_expr_list_aliased", symbols: ["select_expr_list_item", "select_expr_list_aliased$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "select_expr_list_item$ebnf$1", symbols: ["ident_aliased"], postprocess: n },
            { name: "select_expr_list_item$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_expr_list_item", symbols: ["expr", "select_expr_list_item$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              expr: c[0],
              ...c[1] ? { alias: s(c[1]) } : {}
            }) },
            { name: "select_distinct", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all], postprocess: (c) => (0, g.box)(c, "all") },
            { name: "select_distinct$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "lparen", "expr_list_raw", "rparen"], postprocess: C(2) },
            { name: "select_distinct$ebnf$1", symbols: ["select_distinct$ebnf$1$subexpression$1"], postprocess: n },
            { name: "select_distinct$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_distinct", symbols: [o.lexerAny.has("kw_distinct") ? { type: "kw_distinct" } : kw_distinct, "select_distinct$ebnf$1"], postprocess: (c) => (0, g.box)(c, c[1] || "distinct") },
            { name: "select_where", symbols: [o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where, "expr"], postprocess: B },
            { name: "select_groupby", symbols: [o.lexerAny.has("kw_group") ? { type: "kw_group" } : kw_group, "kw_by", "expr_list_raw"], postprocess: B },
            { name: "select_having", symbols: [o.lexerAny.has("kw_having") ? { type: "kw_having" } : kw_having, "expr"], postprocess: B },
            { name: "select_limit_offset$ebnf$1$subexpression$1", symbols: ["select_offset"] },
            { name: "select_limit_offset$ebnf$1$subexpression$1", symbols: ["select_limit"] },
            { name: "select_limit_offset$ebnf$1", symbols: ["select_limit_offset$ebnf$1$subexpression$1"] },
            { name: "select_limit_offset$ebnf$1$subexpression$2", symbols: ["select_offset"] },
            { name: "select_limit_offset$ebnf$1$subexpression$2", symbols: ["select_limit"] },
            { name: "select_limit_offset$ebnf$1", symbols: ["select_limit_offset$ebnf$1", "select_limit_offset$ebnf$1$subexpression$2"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_limit_offset", symbols: ["select_limit_offset$ebnf$1"], postprocess: (c, J) => {
              const p = a(c);
              if (!Array.isArray(p))
                return (0, g.track)(c, p);
              if (p.length != 2)
                return J;
              const N = a(p[0]), v = a(p[1]);
              return N.offset && v.offset || N.limit && v.limit ? J : (0, g.track)(c, {
                ...N,
                ...v
              });
            } },
            { name: "select_offset$ebnf$1$subexpression$1", symbols: ["kw_row"] },
            { name: "select_offset$ebnf$1$subexpression$1", symbols: ["kw_rows"] },
            { name: "select_offset$ebnf$1", symbols: ["select_offset$ebnf$1$subexpression$1"], postprocess: n },
            { name: "select_offset$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_offset", symbols: [o.lexerAny.has("kw_offset") ? { type: "kw_offset" } : kw_offset, "expr_nostar", "select_offset$ebnf$1"], postprocess: (c) => (0, g.track)(c, { offset: a(c[1]) }) },
            { name: "select_limit$subexpression$1", symbols: ["select_limit_1"] },
            { name: "select_limit$subexpression$1", symbols: ["select_limit_2"] },
            { name: "select_limit", symbols: ["select_limit$subexpression$1"], postprocess: (c) => (0, g.track)(c, { limit: a(c) }) },
            { name: "select_limit_1", symbols: [o.lexerAny.has("kw_limit") ? { type: "kw_limit" } : kw_limit, "expr_nostar"], postprocess: B },
            { name: "select_limit_2$ebnf$1$subexpression$1", symbols: ["kw_first"] },
            { name: "select_limit_2$ebnf$1$subexpression$1", symbols: ["kw_next"] },
            { name: "select_limit_2$ebnf$1", symbols: ["select_limit_2$ebnf$1$subexpression$1"], postprocess: n },
            { name: "select_limit_2$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_limit_2$subexpression$1", symbols: ["kw_row"] },
            { name: "select_limit_2$subexpression$1", symbols: ["kw_rows"] },
            { name: "select_limit_2", symbols: [o.lexerAny.has("kw_fetch") ? { type: "kw_fetch" } : kw_fetch, "select_limit_2$ebnf$1", "expr_nostar", "select_limit_2$subexpression$1", o.lexerAny.has("kw_only") ? { type: "kw_only" } : kw_only], postprocess: C(2) },
            { name: "select_for$subexpression$1", symbols: ["kw_update"], postprocess: (c) => (0, g.track)(c, { type: "update" }) },
            { name: "select_for$subexpression$1", symbols: ["kw_no", "kw_key", "kw_update"], postprocess: (c) => (0, g.track)(c, { type: "no key update" }) },
            { name: "select_for$subexpression$1", symbols: ["kw_share"], postprocess: (c) => (0, g.track)(c, { type: "share" }) },
            { name: "select_for$subexpression$1", symbols: ["kw_key", "kw_share"], postprocess: (c) => (0, g.track)(c, { type: "key share" }) },
            { name: "select_for", symbols: [o.lexerAny.has("kw_for") ? { type: "kw_for" } : kw_for, "select_for$subexpression$1"] },
            { name: "select_skip$subexpression$1", symbols: ["kw_nowait"], postprocess: (c) => (0, g.track)(c, { type: "nowait" }) },
            { name: "select_skip$subexpression$1", symbols: ["kw_skip", "kw_locked"], postprocess: (c) => (0, g.track)(c, { type: "skip locked" }) },
            { name: "select_skip", symbols: ["select_skip$subexpression$1"] },
            { name: "select_order_by$subexpression$1", symbols: [o.lexerAny.has("kw_order") ? { type: "kw_order" } : kw_order, "kw_by"] },
            { name: "select_order_by$ebnf$1", symbols: [] },
            { name: "select_order_by$ebnf$1$subexpression$1", symbols: ["comma", "select_order_by_expr"], postprocess: B },
            { name: "select_order_by$ebnf$1", symbols: ["select_order_by$ebnf$1", "select_order_by$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "select_order_by", symbols: ["select_order_by$subexpression$1", "select_order_by_expr", "select_order_by$ebnf$1"], postprocess: ([c, J, p]) => [J, ...p || []] },
            { name: "select_order_by_expr$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_asc") ? { type: "kw_asc" } : kw_asc] },
            { name: "select_order_by_expr$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_desc") ? { type: "kw_desc" } : kw_desc] },
            { name: "select_order_by_expr$ebnf$1", symbols: ["select_order_by_expr$ebnf$1$subexpression$1"], postprocess: n },
            { name: "select_order_by_expr$ebnf$1", symbols: [], postprocess: () => null },
            { name: "select_order_by_expr$ebnf$2$subexpression$1$subexpression$1", symbols: ["kw_first"] },
            { name: "select_order_by_expr$ebnf$2$subexpression$1$subexpression$1", symbols: ["kw_last"] },
            { name: "select_order_by_expr$ebnf$2$subexpression$1", symbols: ["kw_nulls", "select_order_by_expr$ebnf$2$subexpression$1$subexpression$1"], postprocess: B },
            { name: "select_order_by_expr$ebnf$2", symbols: ["select_order_by_expr$ebnf$2$subexpression$1"], postprocess: n },
            { name: "select_order_by_expr$ebnf$2", symbols: [], postprocess: () => null },
            { name: "select_order_by_expr", symbols: ["expr", "select_order_by_expr$ebnf$1", "select_order_by_expr$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              by: c[0],
              ...c[1] && { order: d(c[1]).toUpperCase() },
              ...c[2] && { nulls: d(c[2]).toUpperCase() }
            }) },
            { name: "expr", symbols: ["expr_nostar"], postprocess: a },
            { name: "expr", symbols: ["expr_star"], postprocess: a },
            { name: "expr_nostar", symbols: ["expr_paren"], postprocess: a },
            { name: "expr_nostar", symbols: ["expr_or"], postprocess: a },
            { name: "expr_paren$subexpression$1", symbols: ["expr_or_select"] },
            { name: "expr_paren$subexpression$1", symbols: ["expr_list_many"] },
            { name: "expr_paren", symbols: ["lparen", "expr_paren$subexpression$1", "rparen"], postprocess: C(1) },
            { name: "expr_or$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("kw_or") ? { type: "kw_or" } : kw_or] },
            { name: "expr_or$macrocall$2$macrocall$1", symbols: ["expr_or$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_or$macrocall$2", symbols: ["expr_or$macrocall$2$macrocall$1"] },
            { name: "expr_or$macrocall$3", symbols: ["expr_or"] },
            { name: "expr_or$macrocall$4", symbols: ["expr_and"] },
            { name: "expr_or$macrocall$1$subexpression$1", symbols: ["expr_or$macrocall$3"] },
            { name: "expr_or$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_or$macrocall$1$subexpression$2", symbols: ["expr_or$macrocall$4"] },
            { name: "expr_or$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_or$macrocall$1", symbols: ["expr_or$macrocall$1$subexpression$1", "expr_or$macrocall$2", "expr_or$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_or$macrocall$1", symbols: ["expr_or$macrocall$4"], postprocess: a },
            { name: "expr_or", symbols: ["expr_or$macrocall$1"] },
            { name: "expr_and$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("kw_and") ? { type: "kw_and" } : kw_and] },
            { name: "expr_and$macrocall$2$macrocall$1", symbols: ["expr_and$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_and$macrocall$2", symbols: ["expr_and$macrocall$2$macrocall$1"] },
            { name: "expr_and$macrocall$3", symbols: ["expr_and"] },
            { name: "expr_and$macrocall$4", symbols: ["expr_not"] },
            { name: "expr_and$macrocall$1$subexpression$1", symbols: ["expr_and$macrocall$3"] },
            { name: "expr_and$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_and$macrocall$1$subexpression$2", symbols: ["expr_and$macrocall$4"] },
            { name: "expr_and$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_and$macrocall$1", symbols: ["expr_and$macrocall$1$subexpression$1", "expr_and$macrocall$2", "expr_and$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_and$macrocall$1", symbols: ["expr_and$macrocall$4"], postprocess: a },
            { name: "expr_and", symbols: ["expr_and$macrocall$1"] },
            { name: "expr_not$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not] },
            { name: "expr_not$macrocall$2$macrocall$1", symbols: ["expr_not$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_not$macrocall$2", symbols: ["expr_not$macrocall$2$macrocall$1"] },
            { name: "expr_not$macrocall$3", symbols: ["expr_not"] },
            { name: "expr_not$macrocall$4", symbols: ["expr_eq"] },
            { name: "expr_not$macrocall$1$subexpression$1", symbols: ["expr_not$macrocall$3"] },
            { name: "expr_not$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_not$macrocall$1", symbols: ["expr_not$macrocall$2", "expr_not$macrocall$1$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              type: "unary",
              ...a(c[0]),
              operand: a(c[1])
            }) },
            { name: "expr_not$macrocall$1", symbols: ["expr_not$macrocall$4"], postprocess: a },
            { name: "expr_not", symbols: ["expr_not$macrocall$1"] },
            { name: "expr_eq$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq] },
            { name: "expr_eq$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_neq") ? { type: "op_neq" } : op_neq] },
            { name: "expr_eq$macrocall$2$macrocall$2", symbols: ["expr_eq$macrocall$2$macrocall$2$subexpression$1"] },
            { name: "expr_eq$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_eq$macrocall$2$macrocall$2"] },
            { name: "expr_eq$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_eq$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_eq$macrocall$2$macrocall$1", symbols: ["expr_eq$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_eq$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_eq$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_eq$macrocall$2", symbols: ["expr_eq$macrocall$2$macrocall$1"] },
            { name: "expr_eq$macrocall$3", symbols: ["expr_eq"] },
            { name: "expr_eq$macrocall$4", symbols: ["expr_is"] },
            { name: "expr_eq$macrocall$1$subexpression$1", symbols: ["expr_eq$macrocall$3"] },
            { name: "expr_eq$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_eq$macrocall$1$subexpression$2", symbols: ["expr_eq$macrocall$4"] },
            { name: "expr_eq$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_eq$macrocall$1", symbols: ["expr_eq$macrocall$1$subexpression$1", "expr_eq$macrocall$2", "expr_eq$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_eq$macrocall$1", symbols: ["expr_eq$macrocall$4"], postprocess: a },
            { name: "expr_eq", symbols: ["expr_eq$macrocall$1"] },
            { name: "expr_star", symbols: ["star"], postprocess: (c) => (0, g.track)(c, { type: "ref", name: "*" }) },
            { name: "expr_is$subexpression$1", symbols: ["expr_is"] },
            { name: "expr_is$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_is$subexpression$2", symbols: [o.lexerAny.has("kw_isnull") ? { type: "kw_isnull" } : kw_isnull] },
            { name: "expr_is$subexpression$2", symbols: [o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is, o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null] },
            { name: "expr_is", symbols: ["expr_is$subexpression$1", "expr_is$subexpression$2"], postprocess: (c) => (0, g.track)(c, { type: "unary", op: "IS NULL", operand: a(c[0]) }) },
            { name: "expr_is$subexpression$3", symbols: ["expr_is"] },
            { name: "expr_is$subexpression$3", symbols: ["expr_paren"] },
            { name: "expr_is$subexpression$4", symbols: [o.lexerAny.has("kw_notnull") ? { type: "kw_notnull" } : kw_notnull] },
            { name: "expr_is$subexpression$4", symbols: [o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is, "kw_not_null"] },
            { name: "expr_is", symbols: ["expr_is$subexpression$3", "expr_is$subexpression$4"], postprocess: (c) => (0, g.track)(c, { type: "unary", op: "IS NOT NULL", operand: a(c[0]) }) },
            { name: "expr_is$subexpression$5", symbols: ["expr_is"] },
            { name: "expr_is$subexpression$5", symbols: ["expr_paren"] },
            { name: "expr_is$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "expr_is$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_is$subexpression$6", symbols: [o.lexerAny.has("kw_true") ? { type: "kw_true" } : kw_true] },
            { name: "expr_is$subexpression$6", symbols: [o.lexerAny.has("kw_false") ? { type: "kw_false" } : kw_false] },
            { name: "expr_is", symbols: ["expr_is$subexpression$5", o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is, "expr_is$ebnf$1", "expr_is$subexpression$6"], postprocess: (c) => (0, g.track)(c, {
              type: "unary",
              op: "IS " + E([c[2], c[3]]).join(" ").toUpperCase(),
              operand: a(c[0])
            }) },
            { name: "expr_is", symbols: ["expr_compare"], postprocess: a },
            { name: "expr_compare$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("op_compare") ? { type: "op_compare" } : op_compare] },
            { name: "expr_compare$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_compare$macrocall$2$macrocall$2"] },
            { name: "expr_compare$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_compare$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_compare$macrocall$2$macrocall$1", symbols: ["expr_compare$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_compare$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_compare$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_compare$macrocall$2", symbols: ["expr_compare$macrocall$2$macrocall$1"] },
            { name: "expr_compare$macrocall$3", symbols: ["expr_compare"] },
            { name: "expr_compare$macrocall$4", symbols: ["expr_range"] },
            { name: "expr_compare$macrocall$1$subexpression$1", symbols: ["expr_compare$macrocall$3"] },
            { name: "expr_compare$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_compare$macrocall$1$subexpression$2", symbols: ["expr_compare$macrocall$4"] },
            { name: "expr_compare$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_compare$macrocall$1", symbols: ["expr_compare$macrocall$1$subexpression$1", "expr_compare$macrocall$2", "expr_compare$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_compare$macrocall$1", symbols: ["expr_compare$macrocall$4"], postprocess: a },
            { name: "expr_compare", symbols: ["expr_compare$macrocall$1"] },
            { name: "expr_range$macrocall$2", symbols: ["ops_between"] },
            { name: "expr_range$macrocall$3", symbols: [o.lexerAny.has("kw_and") ? { type: "kw_and" } : kw_and] },
            { name: "expr_range$macrocall$4", symbols: ["expr_range"] },
            { name: "expr_range$macrocall$5", symbols: ["expr_others"] },
            { name: "expr_range$macrocall$1$subexpression$1", symbols: ["expr_range$macrocall$4"] },
            { name: "expr_range$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_range$macrocall$1$subexpression$2", symbols: ["expr_range$macrocall$4"] },
            { name: "expr_range$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_range$macrocall$1$subexpression$3", symbols: ["expr_range$macrocall$5"] },
            { name: "expr_range$macrocall$1$subexpression$3", symbols: ["expr_paren"] },
            { name: "expr_range$macrocall$1", symbols: ["expr_range$macrocall$1$subexpression$1", "expr_range$macrocall$2", "expr_range$macrocall$1$subexpression$2", "expr_range$macrocall$3", "expr_range$macrocall$1$subexpression$3"], postprocess: (c) => (0, g.track)(c, {
              type: "ternary",
              value: a(c[0]),
              lo: a(c[2]),
              hi: a(c[4]),
              op: (E(c[1]).join(" ") || "<error>").toUpperCase()
            }) },
            { name: "expr_range$macrocall$1", symbols: ["expr_range$macrocall$5"], postprocess: a },
            { name: "expr_range", symbols: ["expr_range$macrocall$1"] },
            { name: "expr_others$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("ops_others") ? { type: "ops_others" } : ops_others] },
            { name: "expr_others$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_others$macrocall$2$macrocall$2"] },
            { name: "expr_others$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_others$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_others$macrocall$2$macrocall$1", symbols: ["expr_others$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_others$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_others$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_others$macrocall$2", symbols: ["expr_others$macrocall$2$macrocall$1"] },
            { name: "expr_others$macrocall$3", symbols: ["expr_others"] },
            { name: "expr_others$macrocall$4", symbols: ["expr_like"] },
            { name: "expr_others$macrocall$1$subexpression$1", symbols: ["expr_others$macrocall$3"] },
            { name: "expr_others$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_others$macrocall$1$subexpression$2", symbols: ["expr_others$macrocall$4"] },
            { name: "expr_others$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_others$macrocall$1", symbols: ["expr_others$macrocall$1$subexpression$1", "expr_others$macrocall$2", "expr_others$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_others$macrocall$1", symbols: ["expr_others$macrocall$4"], postprocess: a },
            { name: "expr_others", symbols: ["expr_others$macrocall$1"] },
            { name: "expr_like$macrocall$2$macrocall$2", symbols: ["ops_like"] },
            { name: "expr_like$macrocall$2$macrocall$1", symbols: ["expr_like$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_like$macrocall$2", symbols: ["expr_like$macrocall$2$macrocall$1"] },
            { name: "expr_like$macrocall$3", symbols: ["expr_like"] },
            { name: "expr_like$macrocall$4", symbols: ["expr_in"] },
            { name: "expr_like$macrocall$1$subexpression$1", symbols: ["expr_like$macrocall$3"] },
            { name: "expr_like$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_like$macrocall$1$subexpression$2", symbols: ["expr_like$macrocall$4"] },
            { name: "expr_like$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_like$macrocall$1", symbols: ["expr_like$macrocall$1$subexpression$1", "expr_like$macrocall$2", "expr_like$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_like$macrocall$1", symbols: ["expr_like$macrocall$4"], postprocess: a },
            { name: "expr_like", symbols: ["expr_like$macrocall$1"] },
            { name: "expr_in$macrocall$2$macrocall$2", symbols: ["ops_in"] },
            { name: "expr_in$macrocall$2$macrocall$1", symbols: ["expr_in$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_in$macrocall$2", symbols: ["expr_in$macrocall$2$macrocall$1"] },
            { name: "expr_in$macrocall$3", symbols: ["expr_in"] },
            { name: "expr_in$macrocall$4", symbols: ["expr_add"] },
            { name: "expr_in$macrocall$1$subexpression$1", symbols: ["expr_in$macrocall$3"] },
            { name: "expr_in$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_in$macrocall$1$subexpression$2", symbols: ["expr_in$macrocall$4"] },
            { name: "expr_in$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_in$macrocall$1", symbols: ["expr_in$macrocall$1$subexpression$1", "expr_in$macrocall$2", "expr_in$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_in$macrocall$1", symbols: ["expr_in$macrocall$4"], postprocess: a },
            { name: "expr_in", symbols: ["expr_in$macrocall$1"] },
            { name: "expr_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_plus") ? { type: "op_plus" } : op_plus] },
            { name: "expr_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_minus") ? { type: "op_minus" } : op_minus] },
            { name: "expr_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_additive") ? { type: "op_additive" } : op_additive] },
            { name: "expr_add$macrocall$2$macrocall$2", symbols: ["expr_add$macrocall$2$macrocall$2$subexpression$1"] },
            { name: "expr_add$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_add$macrocall$2$macrocall$2"] },
            { name: "expr_add$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_add$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_add$macrocall$2$macrocall$1", symbols: ["expr_add$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_add$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_add$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_add$macrocall$2", symbols: ["expr_add$macrocall$2$macrocall$1"] },
            { name: "expr_add$macrocall$3", symbols: ["expr_add"] },
            { name: "expr_add$macrocall$4", symbols: ["expr_mult"] },
            { name: "expr_add$macrocall$1$subexpression$1", symbols: ["expr_add$macrocall$3"] },
            { name: "expr_add$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_add$macrocall$1$subexpression$2", symbols: ["expr_add$macrocall$4"] },
            { name: "expr_add$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_add$macrocall$1", symbols: ["expr_add$macrocall$1$subexpression$1", "expr_add$macrocall$2", "expr_add$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_add$macrocall$1", symbols: ["expr_add$macrocall$4"], postprocess: a },
            { name: "expr_add", symbols: ["expr_add$macrocall$1"] },
            { name: "expr_mult$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("star") ? { type: "star" } : star] },
            { name: "expr_mult$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_div") ? { type: "op_div" } : op_div] },
            { name: "expr_mult$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_mod") ? { type: "op_mod" } : op_mod] },
            { name: "expr_mult$macrocall$2$macrocall$2", symbols: ["expr_mult$macrocall$2$macrocall$2$subexpression$1"] },
            { name: "expr_mult$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_mult$macrocall$2$macrocall$2"] },
            { name: "expr_mult$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_mult$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_mult$macrocall$2$macrocall$1", symbols: ["expr_mult$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_mult$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_mult$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_mult$macrocall$2", symbols: ["expr_mult$macrocall$2$macrocall$1"] },
            { name: "expr_mult$macrocall$3", symbols: ["expr_mult"] },
            { name: "expr_mult$macrocall$4", symbols: ["expr_exp"] },
            { name: "expr_mult$macrocall$1$subexpression$1", symbols: ["expr_mult$macrocall$3"] },
            { name: "expr_mult$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_mult$macrocall$1$subexpression$2", symbols: ["expr_mult$macrocall$4"] },
            { name: "expr_mult$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_mult$macrocall$1", symbols: ["expr_mult$macrocall$1$subexpression$1", "expr_mult$macrocall$2", "expr_mult$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_mult$macrocall$1", symbols: ["expr_mult$macrocall$4"], postprocess: a },
            { name: "expr_mult", symbols: ["expr_mult$macrocall$1"] },
            { name: "expr_exp$macrocall$2$macrocall$2", symbols: [o.lexerAny.has("op_exp") ? { type: "op_exp" } : op_exp] },
            { name: "expr_exp$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_exp$macrocall$2$macrocall$2"] },
            { name: "expr_exp$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_exp$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_exp$macrocall$2$macrocall$1", symbols: ["expr_exp$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_exp$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_exp$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_exp$macrocall$2", symbols: ["expr_exp$macrocall$2$macrocall$1"] },
            { name: "expr_exp$macrocall$3", symbols: ["expr_exp"] },
            { name: "expr_exp$macrocall$4", symbols: ["expr_unary_add"] },
            { name: "expr_exp$macrocall$1$subexpression$1", symbols: ["expr_exp$macrocall$3"] },
            { name: "expr_exp$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_exp$macrocall$1$subexpression$2", symbols: ["expr_exp$macrocall$4"] },
            { name: "expr_exp$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_exp$macrocall$1", symbols: ["expr_exp$macrocall$1$subexpression$1", "expr_exp$macrocall$2", "expr_exp$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_exp$macrocall$1", symbols: ["expr_exp$macrocall$4"], postprocess: a },
            { name: "expr_exp", symbols: ["expr_exp$macrocall$1"] },
            { name: "expr_unary_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_plus") ? { type: "op_plus" } : op_plus] },
            { name: "expr_unary_add$macrocall$2$macrocall$2$subexpression$1", symbols: [o.lexerAny.has("op_minus") ? { type: "op_minus" } : op_minus] },
            { name: "expr_unary_add$macrocall$2$macrocall$2", symbols: ["expr_unary_add$macrocall$2$macrocall$2$subexpression$1"] },
            { name: "expr_unary_add$macrocall$2$macrocall$1$macrocall$2", symbols: ["expr_unary_add$macrocall$2$macrocall$2"] },
            { name: "expr_unary_add$macrocall$2$macrocall$1$macrocall$1", symbols: ["expr_unary_add$macrocall$2$macrocall$1$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_unary_add$macrocall$2$macrocall$1", symbols: ["expr_unary_add$macrocall$2$macrocall$1$macrocall$1"], postprocess: a },
            { name: "expr_unary_add$macrocall$2$macrocall$1", symbols: ["kw_operator", "lparen", "ident", "dot", "expr_unary_add$macrocall$2$macrocall$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c[4], " ") || "<error>").toUpperCase(),
              opSchema: d(c[2])
            }) },
            { name: "expr_unary_add$macrocall$2", symbols: ["expr_unary_add$macrocall$2$macrocall$1"] },
            { name: "expr_unary_add$macrocall$3", symbols: ["expr_unary_add"] },
            { name: "expr_unary_add$macrocall$4", symbols: ["expr_various_constructs"] },
            { name: "expr_unary_add$macrocall$1$subexpression$1", symbols: ["expr_unary_add$macrocall$3"] },
            { name: "expr_unary_add$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_unary_add$macrocall$1", symbols: ["expr_unary_add$macrocall$2", "expr_unary_add$macrocall$1$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              type: "unary",
              ...a(c[0]),
              operand: a(c[1])
            }) },
            { name: "expr_unary_add$macrocall$1", symbols: ["expr_unary_add$macrocall$4"], postprocess: a },
            { name: "expr_unary_add", symbols: ["expr_unary_add$macrocall$1"] },
            { name: "expr_various_constructs$macrocall$2$macrocall$2", symbols: ["various_binaries"] },
            { name: "expr_various_constructs$macrocall$2$macrocall$1", symbols: ["expr_various_constructs$macrocall$2$macrocall$2"], postprocess: (c) => (0, g.track)(c, {
              op: (d(c, " ") || "<error>").toUpperCase()
            }) },
            { name: "expr_various_constructs$macrocall$2", symbols: ["expr_various_constructs$macrocall$2$macrocall$1"] },
            { name: "expr_various_constructs$macrocall$3", symbols: ["expr_various_constructs"] },
            { name: "expr_various_constructs$macrocall$4", symbols: ["expr_array_index"] },
            { name: "expr_various_constructs$macrocall$1$subexpression$1", symbols: ["expr_various_constructs$macrocall$3"] },
            { name: "expr_various_constructs$macrocall$1$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_various_constructs$macrocall$1$subexpression$2", symbols: ["expr_various_constructs$macrocall$4"] },
            { name: "expr_various_constructs$macrocall$1$subexpression$2", symbols: ["expr_paren"] },
            { name: "expr_various_constructs$macrocall$1", symbols: ["expr_various_constructs$macrocall$1$subexpression$1", "expr_various_constructs$macrocall$2", "expr_various_constructs$macrocall$1$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "binary",
              left: a(c[0]),
              right: a(c[2]),
              ...a(c[1])
            }) },
            { name: "expr_various_constructs$macrocall$1", symbols: ["expr_various_constructs$macrocall$4"], postprocess: a },
            { name: "expr_various_constructs", symbols: ["expr_various_constructs$macrocall$1"] },
            { name: "expr_array_index$subexpression$1", symbols: ["expr_array_index"] },
            { name: "expr_array_index$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_array_index", symbols: ["expr_array_index$subexpression$1", o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, "expr_nostar", o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket], postprocess: (c) => (0, g.track)(c, {
              type: "arrayIndex",
              array: a(c[0]),
              index: a(c[2])
            }) },
            { name: "expr_array_index", symbols: ["expr_member"], postprocess: a },
            { name: "expr_member$subexpression$1", symbols: ["expr_member"] },
            { name: "expr_member$subexpression$1", symbols: ["expr_paren"] },
            { name: "expr_member$subexpression$2", symbols: ["string"] },
            { name: "expr_member$subexpression$2", symbols: ["int"] },
            { name: "expr_member", symbols: ["expr_member$subexpression$1", "ops_member", "expr_member$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              type: "member",
              operand: a(c[0]),
              op: c[1],
              member: a(c[2])
            }) },
            { name: "expr_member$subexpression$3", symbols: ["expr_member"] },
            { name: "expr_member$subexpression$3", symbols: ["expr_paren"] },
            { name: "expr_member", symbols: ["expr_member$subexpression$3", o.lexerAny.has("op_cast") ? { type: "op_cast" } : op_cast, "data_type"], postprocess: (c) => (0, g.track)(c, {
              type: "cast",
              operand: a(c[0]),
              to: c[2]
            }) },
            { name: "expr_member", symbols: [o.lexerAny.has("kw_cast") ? { type: "kw_cast" } : kw_cast, "lparen", "expr_nostar", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "data_type", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "cast",
              operand: a(c[2]),
              to: c[4]
            }) },
            { name: "expr_member", symbols: ["data_type", "string"], postprocess: (c) => (0, g.track)(c, {
              type: "cast",
              operand: (0, g.track)(c[1], {
                type: "string",
                value: (0, g.unbox)(c[1])
              }),
              to: (0, g.unbox)(c[0])
            }) },
            { name: "expr_member", symbols: ["expr_dot"], postprocess: a },
            { name: "expr_dot$subexpression$1", symbols: ["word"] },
            { name: "expr_dot$subexpression$1", symbols: ["star"] },
            { name: "expr_dot", symbols: ["qname", o.lexerAny.has("dot") ? { type: "dot" } : dot, "expr_dot$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              type: "ref",
              table: a(c[0]),
              name: d(c[2])
            }) },
            { name: "expr_dot", symbols: ["expr_final"], postprocess: a },
            { name: "expr_final", symbols: ["expr_basic"] },
            { name: "expr_final", symbols: ["expr_primary"] },
            { name: "expr_basic", symbols: ["expr_special_calls"] },
            { name: "expr_basic", symbols: ["expr_call"] },
            { name: "expr_basic", symbols: ["expr_array"] },
            { name: "expr_basic", symbols: ["expr_case"] },
            { name: "expr_basic", symbols: ["expr_extract"] },
            { name: "expr_basic", symbols: ["word"], postprocess: (c) => (0, g.track)(c, {
              type: "ref",
              name: a(c[0])
            }) },
            { name: "expr_array$ebnf$1", symbols: ["expr_subarray_items"], postprocess: n },
            { name: "expr_array$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_array", symbols: [o.lexerAny.has("kw_array") ? { type: "kw_array" } : kw_array, o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, "expr_array$ebnf$1", o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket], postprocess: (c) => (0, g.track)(c, {
              type: "array",
              expressions: c[2] || []
            }) },
            { name: "expr_array", symbols: [o.lexerAny.has("kw_array") ? { type: "kw_array" } : kw_array, "lparen", "selection", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "array select",
              select: a(c[2])
            }) },
            { name: "expr_subarray$ebnf$1", symbols: ["expr_subarray_items"], postprocess: n },
            { name: "expr_subarray$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_subarray", symbols: [o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket, "expr_subarray$ebnf$1", o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket], postprocess: C(1) },
            { name: "expr_subarray_items$macrocall$2", symbols: ["expr_list_item"] },
            { name: "expr_subarray_items$macrocall$1$ebnf$1", symbols: [] },
            { name: "expr_subarray_items$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_subarray_items$macrocall$2"], postprocess: B },
            { name: "expr_subarray_items$macrocall$1$ebnf$1", symbols: ["expr_subarray_items$macrocall$1$ebnf$1", "expr_subarray_items$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_subarray_items$macrocall$1", symbols: ["expr_subarray_items$macrocall$2", "expr_subarray_items$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "expr_subarray_items", symbols: ["expr_subarray_items$macrocall$1"], postprocess: (c) => c[0].map(a) },
            { name: "expr_subarray_items$macrocall$4", symbols: ["expr_subarray"] },
            { name: "expr_subarray_items$macrocall$3$ebnf$1", symbols: [] },
            { name: "expr_subarray_items$macrocall$3$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_subarray_items$macrocall$4"], postprocess: B },
            { name: "expr_subarray_items$macrocall$3$ebnf$1", symbols: ["expr_subarray_items$macrocall$3$ebnf$1", "expr_subarray_items$macrocall$3$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_subarray_items$macrocall$3", symbols: ["expr_subarray_items$macrocall$4", "expr_subarray_items$macrocall$3$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "expr_subarray_items", symbols: ["expr_subarray_items$macrocall$3"], postprocess: (c) => c[0].map((J) => (0, g.track)(J, {
              type: "array",
              expressions: J[0].map(a)
            })) },
            { name: "expr_function_call$ebnf$1", symbols: ["expr_list_raw"], postprocess: n },
            { name: "expr_function_call$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_function_call", symbols: ["expr_fn_name", "lparen", "expr_function_call$ebnf$1", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "call",
              function: a(c[0]),
              args: c[2] || []
            }) },
            { name: "expr_call$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all] },
            { name: "expr_call$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_distinct") ? { type: "kw_distinct" } : kw_distinct] },
            { name: "expr_call$ebnf$1", symbols: ["expr_call$ebnf$1$subexpression$1"], postprocess: n },
            { name: "expr_call$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_call$ebnf$2", symbols: ["expr_list_raw"], postprocess: n },
            { name: "expr_call$ebnf$2", symbols: [], postprocess: () => null },
            { name: "expr_call$ebnf$3", symbols: ["select_order_by"], postprocess: n },
            { name: "expr_call$ebnf$3", symbols: [], postprocess: () => null },
            { name: "expr_call$ebnf$4$subexpression$1", symbols: ["kw_filter", "lparen", o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where, "expr", "rparen"], postprocess: C(3) },
            { name: "expr_call$ebnf$4", symbols: ["expr_call$ebnf$4$subexpression$1"], postprocess: n },
            { name: "expr_call$ebnf$4", symbols: [], postprocess: () => null },
            { name: "expr_call$ebnf$5", symbols: ["expr_call_over"], postprocess: n },
            { name: "expr_call$ebnf$5", symbols: [], postprocess: () => null },
            { name: "expr_call", symbols: ["expr_fn_name", "lparen", "expr_call$ebnf$1", "expr_call$ebnf$2", "expr_call$ebnf$3", "rparen", "expr_call$ebnf$4", "expr_call$ebnf$5"], postprocess: (c) => (0, g.track)(c, {
              type: "call",
              function: a(c[0]),
              ...c[2] && { distinct: d(c[2]) },
              args: c[3] || [],
              ...c[4] && { orderBy: c[4] },
              ...c[6] && { filter: a(c[6]) },
              ...c[7] && { over: a(c[7]) }
            }) },
            { name: "expr_call_over$ebnf$1$subexpression$1", symbols: ["kw_partition", "kw_by", "expr_list_raw"], postprocess: B },
            { name: "expr_call_over$ebnf$1", symbols: ["expr_call_over$ebnf$1$subexpression$1"], postprocess: n },
            { name: "expr_call_over$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_call_over$ebnf$2", symbols: ["select_order_by"], postprocess: n },
            { name: "expr_call_over$ebnf$2", symbols: [], postprocess: () => null },
            { name: "expr_call_over", symbols: ["kw_over", "lparen", "expr_call_over$ebnf$1", "expr_call_over$ebnf$2", "rparen"], postprocess: (c) => (0, g.track)(c, {
              ...c[2] && { partitionBy: c[2] },
              ...c[3] && { orderBy: c[3] }
            }) },
            { name: "expr_extract$subexpression$1", symbols: ["word"], postprocess: G("extract") },
            { name: "expr_extract", symbols: ["expr_extract$subexpression$1", "lparen", "word", o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "expr", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "extract",
              field: s(c[2]),
              from: c[4]
            }) },
            { name: "expr_primary", symbols: ["float"], postprocess: (c) => (0, g.track)(c, { type: "numeric", value: (0, g.unbox)(c[0]) }) },
            { name: "expr_primary", symbols: ["int"], postprocess: (c) => (0, g.track)(c, { type: "integer", value: (0, g.unbox)(c[0]) }) },
            { name: "expr_primary", symbols: ["string"], postprocess: (c) => (0, g.track)(c, { type: "string", value: (0, g.unbox)(c[0]) }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("kw_true") ? { type: "kw_true" } : kw_true], postprocess: (c) => (0, g.track)(c, { type: "boolean", value: !0 }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("kw_false") ? { type: "kw_false" } : kw_false], postprocess: (c) => (0, g.track)(c, { type: "boolean", value: !1 }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null], postprocess: (c) => (0, g.track)(c, { type: "null" }) },
            { name: "expr_primary", symbols: ["value_keyword"], postprocess: (c) => (0, g.track)(c, { type: "keyword", keyword: d(c) }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("qparam") ? { type: "qparam" } : qparam], postprocess: (c) => (0, g.track)(c, { type: "parameter", name: d(c[0]) }) },
            { name: "expr_primary", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default], postprocess: (c) => (0, g.track)(c, { type: "default" }) },
            { name: "ops_like", symbols: ["ops_like_keywors"] },
            { name: "ops_like", symbols: ["ops_like_operators"] },
            { name: "ops_like_keywors$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "ops_like_keywors$ebnf$1", symbols: [], postprocess: () => null },
            { name: "ops_like_keywors$subexpression$1", symbols: [o.lexerAny.has("kw_like") ? { type: "kw_like" } : kw_like] },
            { name: "ops_like_keywors$subexpression$1", symbols: [o.lexerAny.has("kw_ilike") ? { type: "kw_ilike" } : kw_ilike] },
            { name: "ops_like_keywors", symbols: ["ops_like_keywors$ebnf$1", "ops_like_keywors$subexpression$1"] },
            { name: "ops_like_operators$subexpression$1", symbols: [o.lexerAny.has("op_like") ? { type: "op_like" } : op_like], postprocess: () => "LIKE" },
            { name: "ops_like_operators", symbols: ["ops_like_operators$subexpression$1"] },
            { name: "ops_like_operators$subexpression$2", symbols: [o.lexerAny.has("op_ilike") ? { type: "op_ilike" } : op_ilike], postprocess: () => "ILIKE" },
            { name: "ops_like_operators", symbols: ["ops_like_operators$subexpression$2"] },
            { name: "ops_like_operators$subexpression$3", symbols: [o.lexerAny.has("op_not_like") ? { type: "op_not_like" } : op_not_like], postprocess: () => "NOT LIKE" },
            { name: "ops_like_operators", symbols: ["ops_like_operators$subexpression$3"] },
            { name: "ops_like_operators$subexpression$4", symbols: [o.lexerAny.has("op_not_ilike") ? { type: "op_not_ilike" } : op_not_ilike], postprocess: () => "NOT ILIKE" },
            { name: "ops_like_operators", symbols: ["ops_like_operators$subexpression$4"] },
            { name: "ops_in$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "ops_in$ebnf$1", symbols: [], postprocess: () => null },
            { name: "ops_in", symbols: ["ops_in$ebnf$1", o.lexerAny.has("kw_in") ? { type: "kw_in" } : kw_in] },
            { name: "ops_between$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "ops_between$ebnf$1", symbols: [], postprocess: () => null },
            { name: "ops_between", symbols: ["ops_between$ebnf$1", "kw_between"] },
            { name: "ops_member$subexpression$1", symbols: [o.lexerAny.has("op_member") ? { type: "op_member" } : op_member] },
            { name: "ops_member$subexpression$1", symbols: [o.lexerAny.has("op_membertext") ? { type: "op_membertext" } : op_membertext] },
            { name: "ops_member", symbols: ["ops_member$subexpression$1"], postprocess: (c) => {
              var J;
              return (J = a(c)) === null || J === void 0 ? void 0 : J.value;
            } },
            { name: "expr_list_item", symbols: ["expr_or_select"], postprocess: a },
            { name: "expr_list_item", symbols: ["expr_star"], postprocess: a },
            { name: "expr_list_raw$macrocall$2", symbols: ["expr_list_item"] },
            { name: "expr_list_raw$macrocall$1$ebnf$1", symbols: [] },
            { name: "expr_list_raw$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_list_raw$macrocall$2"], postprocess: B },
            { name: "expr_list_raw$macrocall$1$ebnf$1", symbols: ["expr_list_raw$macrocall$1$ebnf$1", "expr_list_raw$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_list_raw$macrocall$1", symbols: ["expr_list_raw$macrocall$2", "expr_list_raw$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "expr_list_raw", symbols: ["expr_list_raw$macrocall$1"], postprocess: ([c]) => c.map(a) },
            { name: "expr_list_raw_many$macrocall$2", symbols: ["expr_list_item"] },
            { name: "expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_list_raw_many$macrocall$2"], postprocess: B },
            { name: "expr_list_raw_many$macrocall$1$ebnf$1", symbols: ["expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1"] },
            { name: "expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "expr_list_raw_many$macrocall$2"], postprocess: B },
            { name: "expr_list_raw_many$macrocall$1$ebnf$1", symbols: ["expr_list_raw_many$macrocall$1$ebnf$1", "expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_list_raw_many$macrocall$1", symbols: ["expr_list_raw_many$macrocall$2", "expr_list_raw_many$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "expr_list_raw_many", symbols: ["expr_list_raw_many$macrocall$1"], postprocess: ([c]) => c.map(a) },
            { name: "expr_or_select", symbols: ["expr_nostar"], postprocess: a },
            { name: "expr_or_select", symbols: ["selection"], postprocess: a },
            { name: "expr_list_many", symbols: ["expr_list_raw_many"], postprocess: (c) => (0, g.track)(c, {
              type: "list",
              expressions: c[0]
            }) },
            { name: "expr_case$ebnf$1", symbols: ["expr_nostar"], postprocess: n },
            { name: "expr_case$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_case$ebnf$2", symbols: [] },
            { name: "expr_case$ebnf$2", symbols: ["expr_case$ebnf$2", "expr_case_whens"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "expr_case$ebnf$3", symbols: ["expr_case_else"], postprocess: n },
            { name: "expr_case$ebnf$3", symbols: [], postprocess: () => null },
            { name: "expr_case", symbols: [o.lexerAny.has("kw_case") ? { type: "kw_case" } : kw_case, "expr_case$ebnf$1", "expr_case$ebnf$2", "expr_case$ebnf$3", o.lexerAny.has("kw_end") ? { type: "kw_end" } : kw_end], postprocess: (c) => (0, g.track)(c, {
              type: "case",
              value: c[1],
              whens: c[2],
              else: c[3]
            }) },
            { name: "expr_case_whens", symbols: [o.lexerAny.has("kw_when") ? { type: "kw_when" } : kw_when, "expr_nostar", o.lexerAny.has("kw_then") ? { type: "kw_then" } : kw_then, "expr_nostar"], postprocess: (c) => (0, g.track)(c, {
              when: c[1],
              value: c[3]
            }) },
            { name: "expr_case_else", symbols: [o.lexerAny.has("kw_else") ? { type: "kw_else" } : kw_else, "expr_nostar"], postprocess: B },
            { name: "expr_fn_name$subexpression$1$ebnf$1$subexpression$1", symbols: ["word", o.lexerAny.has("dot") ? { type: "dot" } : dot] },
            { name: "expr_fn_name$subexpression$1$ebnf$1", symbols: ["expr_fn_name$subexpression$1$ebnf$1$subexpression$1"], postprocess: n },
            { name: "expr_fn_name$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "expr_fn_name$subexpression$1", symbols: ["expr_fn_name$subexpression$1$ebnf$1", "word_or_keyword"], postprocess: (c) => (0, g.track)(c, {
              name: (0, g.unbox)(a(c[1])),
              ...c[0] && { schema: d(c[0][0]) }
            }) },
            { name: "expr_fn_name", symbols: ["expr_fn_name$subexpression$1"] },
            { name: "expr_fn_name$subexpression$2$subexpression$1", symbols: [o.lexerAny.has("kw_any") ? { type: "kw_any" } : kw_any] },
            { name: "expr_fn_name$subexpression$2$subexpression$1", symbols: [o.lexerAny.has("kw_some") ? { type: "kw_some" } : kw_some] },
            { name: "expr_fn_name$subexpression$2$subexpression$1", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all] },
            { name: "expr_fn_name$subexpression$2", symbols: ["expr_fn_name$subexpression$2$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              name: d(a(c))
            }) },
            { name: "expr_fn_name", symbols: ["expr_fn_name$subexpression$2"] },
            { name: "word_or_keyword", symbols: ["word"] },
            { name: "word_or_keyword", symbols: ["value_keyword"], postprocess: (c) => (0, g.box)(c, d(c)) },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_catalog") ? { type: "kw_current_catalog" } : kw_current_catalog] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_date") ? { type: "kw_current_date" } : kw_current_date] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_role") ? { type: "kw_current_role" } : kw_current_role] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_schema") ? { type: "kw_current_schema" } : kw_current_schema] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_timestamp") ? { type: "kw_current_timestamp" } : kw_current_timestamp] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_time") ? { type: "kw_current_time" } : kw_current_time] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_localtimestamp") ? { type: "kw_localtimestamp" } : kw_localtimestamp] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_localtime") ? { type: "kw_localtime" } : kw_localtime] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_session_user") ? { type: "kw_session_user" } : kw_session_user] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_user") ? { type: "kw_user" } : kw_user] },
            { name: "value_keyword", symbols: [o.lexerAny.has("kw_current_user") ? { type: "kw_current_user" } : kw_current_user] },
            { name: "expr_special_calls", symbols: ["spe_overlay"] },
            { name: "expr_special_calls", symbols: ["spe_substring"] },
            { name: "spe_overlay$subexpression$1", symbols: ["word"], postprocess: G("overlay") },
            { name: "spe_overlay$subexpression$2", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen, "expr_nostar"] },
            { name: "spe_overlay$subexpression$3", symbols: [o.lexerAny.has("kw_placing") ? { type: "kw_placing" } : kw_placing, "expr_nostar"] },
            { name: "spe_overlay$subexpression$4", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "expr_nostar"] },
            { name: "spe_overlay$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_for") ? { type: "kw_for" } : kw_for, "expr_nostar"] },
            { name: "spe_overlay$ebnf$1", symbols: ["spe_overlay$ebnf$1$subexpression$1"], postprocess: n },
            { name: "spe_overlay$ebnf$1", symbols: [], postprocess: () => null },
            { name: "spe_overlay", symbols: ["spe_overlay$subexpression$1", "spe_overlay$subexpression$2", "spe_overlay$subexpression$3", "spe_overlay$subexpression$4", "spe_overlay$ebnf$1", o.lexerAny.has("rparen") ? { type: "rparen" } : rparen], postprocess: (c) => (0, g.track)(c, {
              type: "overlay",
              value: c[1][1],
              placing: c[2][1],
              from: c[3][1],
              ...c[4] && { for: c[4][1] }
            }) },
            { name: "spe_substring$subexpression$1", symbols: ["word"], postprocess: G("substring") },
            { name: "spe_substring$subexpression$2", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen, "expr_nostar"] },
            { name: "spe_substring$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "expr_nostar"] },
            { name: "spe_substring$ebnf$1", symbols: ["spe_substring$ebnf$1$subexpression$1"], postprocess: n },
            { name: "spe_substring$ebnf$1", symbols: [], postprocess: () => null },
            { name: "spe_substring$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("kw_for") ? { type: "kw_for" } : kw_for, "expr_nostar"] },
            { name: "spe_substring$ebnf$2", symbols: ["spe_substring$ebnf$2$subexpression$1"], postprocess: n },
            { name: "spe_substring$ebnf$2", symbols: [], postprocess: () => null },
            { name: "spe_substring", symbols: ["spe_substring$subexpression$1", "spe_substring$subexpression$2", "spe_substring$ebnf$1", "spe_substring$ebnf$2", o.lexerAny.has("rparen") ? { type: "rparen" } : rparen], postprocess: (c) => (0, g.track)(c, {
              type: "substring",
              value: c[1][1],
              ...c[2] && { from: c[2][1] },
              ...c[3] && { for: c[3][1] }
            }) },
            { name: "various_binaries", symbols: ["kw_at", "kw_time", "kw_zone"], postprocess: () => "AT TIME ZONE" },
            { name: "createtable_statement$ebnf$1", symbols: ["createtable_modifiers"], postprocess: n },
            { name: "createtable_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtable_statement$ebnf$2", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "createtable_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "createtable_statement$ebnf$3", symbols: ["createtable_opts"], postprocess: n },
            { name: "createtable_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "createtable_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "createtable_statement$ebnf$1", o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table, "createtable_statement$ebnf$2", "qname", "lparen", "createtable_declarationlist", "rparen", "createtable_statement$ebnf$3"], postprocess: (c) => {
              const J = c[6].filter((N) => "kind" in N), p = c[6].filter((N) => !("kind" in N));
              return (0, g.track)(c, {
                type: "create table",
                ...c[3] ? { ifNotExists: !0 } : {},
                name: c[4],
                columns: J,
                ...a(c[1]),
                ...p.length ? { constraints: p } : {},
                ...B(c)
              });
            } },
            { name: "createtable_modifiers", symbols: ["kw_unlogged"], postprocess: (c) => c[0] ? { unlogged: !0 } : {} },
            { name: "createtable_modifiers", symbols: ["m_locglob"] },
            { name: "createtable_modifiers", symbols: ["m_tmp"] },
            { name: "createtable_modifiers", symbols: ["m_locglob", "m_tmp"], postprocess: ([c, J]) => ({ ...c, ...J }) },
            { name: "m_locglob$subexpression$1", symbols: ["kw_local"] },
            { name: "m_locglob$subexpression$1", symbols: ["kw_global"] },
            { name: "m_locglob", symbols: ["m_locglob$subexpression$1"], postprocess: (c) => ({ locality: d(c) }) },
            { name: "m_tmp$subexpression$1", symbols: ["kw_temp"] },
            { name: "m_tmp$subexpression$1", symbols: ["kw_temporary"] },
            { name: "m_tmp", symbols: ["m_tmp$subexpression$1"], postprocess: (c) => ({ temporary: !0 }) },
            { name: "createtable_declarationlist$ebnf$1", symbols: [] },
            { name: "createtable_declarationlist$ebnf$1$subexpression$1", symbols: ["comma", "createtable_declaration"], postprocess: B },
            { name: "createtable_declarationlist$ebnf$1", symbols: ["createtable_declarationlist$ebnf$1", "createtable_declarationlist$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_declarationlist", symbols: ["createtable_declaration", "createtable_declarationlist$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "createtable_declaration$subexpression$1", symbols: ["createtable_constraint"] },
            { name: "createtable_declaration$subexpression$1", symbols: ["createtable_column"] },
            { name: "createtable_declaration$subexpression$1", symbols: ["createtable_like"] },
            { name: "createtable_declaration", symbols: ["createtable_declaration$subexpression$1"], postprocess: a },
            { name: "createtable_constraint$macrocall$2", symbols: ["createtable_constraint_def"] },
            { name: "createtable_constraint$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "word"] },
            { name: "createtable_constraint$macrocall$1$ebnf$1", symbols: ["createtable_constraint$macrocall$1$ebnf$1$subexpression$1"], postprocess: n },
            { name: "createtable_constraint$macrocall$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtable_constraint$macrocall$1", symbols: ["createtable_constraint$macrocall$1$ebnf$1", "createtable_constraint$macrocall$2"], postprocess: (c) => {
              const J = c[0] && s(c[0][1]);
              return J ? (0, g.track)(c, {
                constraintName: J,
                ...a(c[1])
              }) : (0, g.track)(c, a(c[1]));
            } },
            { name: "createtable_constraint", symbols: ["createtable_constraint$macrocall$1"], postprocess: a },
            { name: "createtable_constraint_def", symbols: ["createtable_constraint_def_unique"] },
            { name: "createtable_constraint_def", symbols: ["createtable_constraint_def_check"] },
            { name: "createtable_constraint_def", symbols: ["createtable_constraint_foreignkey"] },
            { name: "createtable_constraint_def_unique$subexpression$1", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique] },
            { name: "createtable_constraint_def_unique$subexpression$1", symbols: ["kw_primary_key"] },
            { name: "createtable_constraint_def_unique", symbols: ["createtable_constraint_def_unique$subexpression$1", "lparen", "createtable_collist", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: d(c[0], " "),
              columns: c[2].map(s)
            }) },
            { name: "createtable_constraint_def_check", symbols: [o.lexerAny.has("kw_check") ? { type: "kw_check" } : kw_check, "expr_paren"], postprocess: (c) => (0, g.track)(c, {
              type: "check",
              expr: a(c[1])
            }) },
            { name: "createtable_constraint_foreignkey", symbols: [o.lexerAny.has("kw_foreign") ? { type: "kw_foreign" } : kw_foreign, "kw_key", "collist_paren", "createtable_references"], postprocess: (c) => (0, g.track)(c, {
              type: "foreign key",
              localColumns: c[2].map(s),
              ...c[3]
            }) },
            { name: "createtable_references$ebnf$1", symbols: [] },
            { name: "createtable_references$ebnf$1", symbols: ["createtable_references$ebnf$1", "createtable_constraint_foreignkey_onsometing"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_references", symbols: [o.lexerAny.has("kw_references") ? { type: "kw_references" } : kw_references, "table_ref", "collist_paren", "createtable_references$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              foreignTable: a(c[1]),
              foreignColumns: c[2].map(s),
              ...c[3].reduce((J, p) => ({ ...J, ...p }), {})
            }) },
            { name: "createtable_constraint_foreignkey_onsometing", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "kw_delete", "createtable_constraint_on_action"], postprocess: (c) => (0, g.track)(c, { onDelete: B(c) }) },
            { name: "createtable_constraint_foreignkey_onsometing", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "kw_update", "createtable_constraint_on_action"], postprocess: (c) => (0, g.track)(c, { onUpdate: B(c) }) },
            { name: "createtable_constraint_foreignkey_onsometing$subexpression$1", symbols: [o.lexerAny.has("kw_full") ? { type: "kw_full" } : kw_full] },
            { name: "createtable_constraint_foreignkey_onsometing$subexpression$1", symbols: ["kw_partial"] },
            { name: "createtable_constraint_foreignkey_onsometing$subexpression$1", symbols: ["kw_simple"] },
            { name: "createtable_constraint_foreignkey_onsometing", symbols: ["kw_match", "createtable_constraint_foreignkey_onsometing$subexpression$1"], postprocess: (c) => (0, g.track)(c, { match: d(B(c)) }) },
            { name: "createtable_constraint_on_action$subexpression$1", symbols: ["kw_cascade"] },
            { name: "createtable_constraint_on_action$subexpression$1$subexpression$1", symbols: ["kw_no", "kw_action"] },
            { name: "createtable_constraint_on_action$subexpression$1", symbols: ["createtable_constraint_on_action$subexpression$1$subexpression$1"] },
            { name: "createtable_constraint_on_action$subexpression$1", symbols: ["kw_restrict"] },
            { name: "createtable_constraint_on_action$subexpression$1$subexpression$2", symbols: [o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null] },
            { name: "createtable_constraint_on_action$subexpression$1$subexpression$2", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default] },
            { name: "createtable_constraint_on_action$subexpression$1", symbols: ["kw_set", "createtable_constraint_on_action$subexpression$1$subexpression$2"] },
            { name: "createtable_constraint_on_action", symbols: ["createtable_constraint_on_action$subexpression$1"], postprocess: (c) => d(c, " ") },
            { name: "createtable_collist$ebnf$1", symbols: [] },
            { name: "createtable_collist$ebnf$1$subexpression$1", symbols: ["comma", "ident"], postprocess: B },
            { name: "createtable_collist$ebnf$1", symbols: ["createtable_collist$ebnf$1", "createtable_collist$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_collist", symbols: ["ident", "createtable_collist$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "createtable_column$ebnf$1", symbols: ["createtable_collate"], postprocess: n },
            { name: "createtable_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtable_column$ebnf$2", symbols: [] },
            { name: "createtable_column$ebnf$2", symbols: ["createtable_column$ebnf$2", "createtable_column_constraint"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_column", symbols: ["word", "data_type", "createtable_column$ebnf$1", "createtable_column$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              kind: "column",
              name: s(c[0]),
              dataType: c[1],
              ...c[2] ? { collate: c[2][1] } : {},
              ...c[3] && c[3].length ? { constraints: c[3] } : {}
            }) },
            { name: "createtable_like$ebnf$1", symbols: [] },
            { name: "createtable_like$ebnf$1", symbols: ["createtable_like$ebnf$1", "createtable_like_opt"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_like", symbols: [o.lexerAny.has("kw_like") ? { type: "kw_like" } : kw_like, "qname", "createtable_like$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              kind: "like table",
              like: c[1],
              options: c[2]
            }) },
            { name: "createtable_like_opt$subexpression$1", symbols: ["kw_including"] },
            { name: "createtable_like_opt$subexpression$1", symbols: ["kw_excluding"] },
            { name: "createtable_like_opt", symbols: ["createtable_like_opt$subexpression$1", "createtable_like_opt_val"], postprocess: (c) => (0, g.track)(c, {
              verb: d(c[0]),
              option: d(c[1])
            }) },
            { name: "createtable_like_opt_val", symbols: ["word"], postprocess: R("defaults", "constraints", "indexes", "storage", "comments") },
            { name: "createtable_like_opt_val", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all] },
            { name: "createtable_column_constraint$macrocall$2", symbols: ["createtable_column_constraint_def"] },
            { name: "createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "word"] },
            { name: "createtable_column_constraint$macrocall$1$ebnf$1", symbols: ["createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1"], postprocess: n },
            { name: "createtable_column_constraint$macrocall$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtable_column_constraint$macrocall$1", symbols: ["createtable_column_constraint$macrocall$1$ebnf$1", "createtable_column_constraint$macrocall$2"], postprocess: (c) => {
              const J = c[0] && s(c[0][1]);
              return J ? (0, g.track)(c, {
                constraintName: J,
                ...a(c[1])
              }) : (0, g.track)(c, a(c[1]));
            } },
            { name: "createtable_column_constraint", symbols: ["createtable_column_constraint$macrocall$1"], postprocess: a },
            { name: "createtable_column_constraint_def", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique], postprocess: (c) => (0, g.track)(c, { type: "unique" }) },
            { name: "createtable_column_constraint_def", symbols: ["kw_primary_key"], postprocess: (c) => (0, g.track)(c, { type: "primary key" }) },
            { name: "createtable_column_constraint_def", symbols: ["kw_not_null"], postprocess: (c) => (0, g.track)(c, { type: "not null" }) },
            { name: "createtable_column_constraint_def", symbols: [o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null], postprocess: (c) => (0, g.track)(c, { type: "null" }) },
            { name: "createtable_column_constraint_def", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default, "expr"], postprocess: (c) => (0, g.track)(c, { type: "default", default: a(c[1]) }) },
            { name: "createtable_column_constraint_def", symbols: [o.lexerAny.has("kw_check") ? { type: "kw_check" } : kw_check, "expr_paren"], postprocess: (c) => (0, g.track)(c, { type: "check", expr: a(c[1]) }) },
            { name: "createtable_column_constraint_def", symbols: ["createtable_references"], postprocess: (c) => (0, g.track)(c, { type: "reference", ...a(c) }) },
            { name: "createtable_column_constraint_def", symbols: ["altercol_generated"] },
            { name: "createtable_collate", symbols: [o.lexerAny.has("kw_collate") ? { type: "kw_collate" } : kw_collate, "qualified_name"] },
            { name: "createtable_opts$subexpression$1", symbols: ["word"], postprocess: G("inherits") },
            { name: "createtable_opts$macrocall$2", symbols: ["qname"] },
            { name: "createtable_opts$macrocall$1$ebnf$1", symbols: [] },
            { name: "createtable_opts$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "createtable_opts$macrocall$2"], postprocess: B },
            { name: "createtable_opts$macrocall$1$ebnf$1", symbols: ["createtable_opts$macrocall$1$ebnf$1", "createtable_opts$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtable_opts$macrocall$1", symbols: ["createtable_opts$macrocall$2", "createtable_opts$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "createtable_opts", symbols: ["createtable_opts$subexpression$1", "lparen", "createtable_opts$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, { inherits: c[2] }) },
            { name: "createindex_statement$ebnf$1", symbols: [o.lexerAny.has("kw_unique") ? { type: "kw_unique" } : kw_unique], postprocess: n },
            { name: "createindex_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$2", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "createindex_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$3", symbols: ["word"], postprocess: n },
            { name: "createindex_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$4$subexpression$1", symbols: [o.lexerAny.has("kw_using") ? { type: "kw_using" } : kw_using, "ident"], postprocess: B },
            { name: "createindex_statement$ebnf$4", symbols: ["createindex_statement$ebnf$4$subexpression$1"], postprocess: n },
            { name: "createindex_statement$ebnf$4", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$5", symbols: ["createindex_with"], postprocess: n },
            { name: "createindex_statement$ebnf$5", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$6", symbols: ["createindex_tblspace"], postprocess: n },
            { name: "createindex_statement$ebnf$6", symbols: [], postprocess: () => null },
            { name: "createindex_statement$ebnf$7", symbols: ["createindex_predicate"], postprocess: n },
            { name: "createindex_statement$ebnf$7", symbols: [], postprocess: () => null },
            { name: "createindex_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "createindex_statement$ebnf$1", "kw_index", "createindex_statement$ebnf$2", "createindex_statement$ebnf$3", o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "table_ref", "createindex_statement$ebnf$4", "lparen", "createindex_expressions", "rparen", "createindex_statement$ebnf$5", "createindex_statement$ebnf$6", "createindex_statement$ebnf$7"], postprocess: (c) => (0, g.track)(c, {
              type: "create index",
              ...c[1] && { unique: !0 },
              ...c[3] && { ifNotExists: !0 },
              ...c[4] && { indexName: s(c[4]) },
              table: c[6],
              ...c[7] && { using: s(c[7]) },
              expressions: c[9],
              ...c[11] && { with: c[11] },
              ...c[12] && { tablespace: a(c[12]) },
              ...c[13] && { where: a(c[13]) }
            }) },
            { name: "createindex_expressions$ebnf$1", symbols: [] },
            { name: "createindex_expressions$ebnf$1$subexpression$1", symbols: ["comma", "createindex_expression"], postprocess: B },
            { name: "createindex_expressions$ebnf$1", symbols: ["createindex_expressions$ebnf$1", "createindex_expressions$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createindex_expressions", symbols: ["createindex_expression", "createindex_expressions$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "createindex_expression$subexpression$1", symbols: ["expr_basic"] },
            { name: "createindex_expression$subexpression$1", symbols: ["expr_paren"] },
            { name: "createindex_expression$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_collate") ? { type: "kw_collate" } : kw_collate, "qualified_name"], postprocess: B },
            { name: "createindex_expression$ebnf$1", symbols: ["createindex_expression$ebnf$1$subexpression$1"], postprocess: n },
            { name: "createindex_expression$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createindex_expression$ebnf$2", symbols: ["qualified_name"], postprocess: n },
            { name: "createindex_expression$ebnf$2", symbols: [], postprocess: () => null },
            { name: "createindex_expression$ebnf$3$subexpression$1", symbols: [o.lexerAny.has("kw_asc") ? { type: "kw_asc" } : kw_asc] },
            { name: "createindex_expression$ebnf$3$subexpression$1", symbols: [o.lexerAny.has("kw_desc") ? { type: "kw_desc" } : kw_desc] },
            { name: "createindex_expression$ebnf$3", symbols: ["createindex_expression$ebnf$3$subexpression$1"], postprocess: n },
            { name: "createindex_expression$ebnf$3", symbols: [], postprocess: () => null },
            { name: "createindex_expression$ebnf$4$subexpression$1$subexpression$1", symbols: ["kw_first"] },
            { name: "createindex_expression$ebnf$4$subexpression$1$subexpression$1", symbols: ["kw_last"] },
            { name: "createindex_expression$ebnf$4$subexpression$1", symbols: ["kw_nulls", "createindex_expression$ebnf$4$subexpression$1$subexpression$1"], postprocess: B },
            { name: "createindex_expression$ebnf$4", symbols: ["createindex_expression$ebnf$4$subexpression$1"], postprocess: n },
            { name: "createindex_expression$ebnf$4", symbols: [], postprocess: () => null },
            { name: "createindex_expression", symbols: ["createindex_expression$subexpression$1", "createindex_expression$ebnf$1", "createindex_expression$ebnf$2", "createindex_expression$ebnf$3", "createindex_expression$ebnf$4"], postprocess: (c) => (0, g.track)(c, {
              expression: a(c[0]),
              ...c[1] && { collate: a(c[1]) },
              ...c[2] && { opclass: a(c[2]) },
              ...c[3] && { order: a(c[3]).value },
              ...c[4] && { nulls: a(c[4]) }
            }) },
            { name: "createindex_predicate", symbols: [o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where, "expr"], postprocess: B },
            { name: "createindex_with$macrocall$2", symbols: ["createindex_with_item"] },
            { name: "createindex_with$macrocall$1$ebnf$1", symbols: [] },
            { name: "createindex_with$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "createindex_with$macrocall$2"], postprocess: B },
            { name: "createindex_with$macrocall$1$ebnf$1", symbols: ["createindex_with$macrocall$1$ebnf$1", "createindex_with$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createindex_with$macrocall$1", symbols: ["createindex_with$macrocall$2", "createindex_with$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "createindex_with", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "lparen", "createindex_with$macrocall$1", "rparen"], postprocess: C(2) },
            { name: "createindex_with_item$subexpression$1", symbols: ["string"] },
            { name: "createindex_with_item$subexpression$1", symbols: ["int"] },
            { name: "createindex_with_item", symbols: ["ident", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "createindex_with_item$subexpression$1"], postprocess: (c) => (0, g.track)(c, { parameter: d(c[0]), value: a(c[2]).toString() }) },
            { name: "createindex_tblspace", symbols: ["kw_tablespace", "ident"], postprocess: B },
            { name: "createextension_statement$ebnf$1", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "createextension_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createextension_statement$ebnf$2", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with], postprocess: n },
            { name: "createextension_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "createextension_statement$ebnf$3$subexpression$1", symbols: ["kw_schema", "word"], postprocess: B },
            { name: "createextension_statement$ebnf$3", symbols: ["createextension_statement$ebnf$3$subexpression$1"], postprocess: n },
            { name: "createextension_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "createextension_statement$ebnf$4$subexpression$1", symbols: ["kw_version", "string"], postprocess: B },
            { name: "createextension_statement$ebnf$4", symbols: ["createextension_statement$ebnf$4$subexpression$1"], postprocess: n },
            { name: "createextension_statement$ebnf$4", symbols: [], postprocess: () => null },
            { name: "createextension_statement$ebnf$5$subexpression$1", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "string"], postprocess: B },
            { name: "createextension_statement$ebnf$5", symbols: ["createextension_statement$ebnf$5$subexpression$1"], postprocess: n },
            { name: "createextension_statement$ebnf$5", symbols: [], postprocess: () => null },
            { name: "createextension_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "kw_extension", "createextension_statement$ebnf$1", "word", "createextension_statement$ebnf$2", "createextension_statement$ebnf$3", "createextension_statement$ebnf$4", "createextension_statement$ebnf$5"], postprocess: (c) => (0, g.track)(c, {
              type: "create extension",
              ...c[2] ? { ifNotExists: !0 } : {},
              extension: s(c[3]),
              ...c[5] ? { schema: s(c[5]) } : {},
              ...c[6] ? { version: r(c[6]) } : {},
              ...c[7] ? { from: r(c[7]) } : {}
            }) },
            { name: "simplestatements_all", symbols: ["simplestatements_start_transaction"] },
            { name: "simplestatements_all", symbols: ["simplestatements_commit"] },
            { name: "simplestatements_all", symbols: ["simplestatements_rollback"] },
            { name: "simplestatements_all", symbols: ["simplestatements_tablespace"] },
            { name: "simplestatements_all", symbols: ["simplestatements_set"] },
            { name: "simplestatements_all", symbols: ["simplestatements_show"] },
            { name: "simplestatements_all", symbols: ["simplestatements_begin"] },
            { name: "simplestatements_start_transaction$subexpression$1", symbols: ["kw_start", "kw_transaction"] },
            { name: "simplestatements_start_transaction", symbols: ["simplestatements_start_transaction$subexpression$1"], postprocess: (c) => (0, g.track)(c, { type: "start transaction" }) },
            { name: "simplestatements_commit", symbols: ["kw_commit"], postprocess: (c) => (0, g.track)(c, { type: "commit" }) },
            { name: "simplestatements_rollback", symbols: ["kw_rollback"], postprocess: (c) => (0, g.track)(c, { type: "rollback" }) },
            { name: "simplestatements_tablespace", symbols: ["kw_tablespace", "word"], postprocess: (c) => (0, g.track)(c, {
              type: "tablespace",
              tablespace: s(c[1])
            }) },
            { name: "simplestatements_set$subexpression$1", symbols: ["simplestatements_set_simple"] },
            { name: "simplestatements_set$subexpression$1", symbols: ["simplestatements_set_timezone"] },
            { name: "simplestatements_set", symbols: ["kw_set", "simplestatements_set$subexpression$1"], postprocess: B },
            { name: "simplestatements_set_timezone", symbols: ["kw_time", "kw_zone", "simplestatements_set_timezone_val"], postprocess: (c) => (0, g.track)(c, { type: "set timezone", to: c[2] }) },
            { name: "simplestatements_set_timezone_val$subexpression$1", symbols: ["string"] },
            { name: "simplestatements_set_timezone_val$subexpression$1", symbols: ["int"] },
            { name: "simplestatements_set_timezone_val", symbols: ["simplestatements_set_timezone_val$subexpression$1"], postprocess: (c) => (0, g.track)(c, { type: "value", value: a(c[0]) }) },
            { name: "simplestatements_set_timezone_val", symbols: ["kw_local"], postprocess: (c) => (0, g.track)(c, { type: "local" }) },
            { name: "simplestatements_set_timezone_val", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default], postprocess: (c) => (0, g.track)(c, { type: "default" }) },
            { name: "simplestatements_set_timezone_val", symbols: ["kw_interval", "string", "kw_hour", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "kw_minute"], postprocess: (c) => (0, g.track)(c, { type: "interval", value: (0, g.unbox)(c[1]) }) },
            { name: "simplestatements_set_simple$subexpression$1", symbols: [o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq] },
            { name: "simplestatements_set_simple$subexpression$1", symbols: [o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to] },
            { name: "simplestatements_set_simple", symbols: ["ident", "simplestatements_set_simple$subexpression$1", "simplestatements_set_val"], postprocess: (c) => (0, g.track)(c, {
              type: "set",
              variable: s(c[0]),
              set: (0, g.unbox)(c[2])
            }) },
            { name: "simplestatements_set_val", symbols: ["simplestatements_set_val_raw"], postprocess: a },
            { name: "simplestatements_set_val", symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default], postprocess: (c) => (0, g.track)(c, { type: "default" }) },
            { name: "simplestatements_set_val$ebnf$1$subexpression$1", symbols: ["comma", "simplestatements_set_val_raw"] },
            { name: "simplestatements_set_val$ebnf$1", symbols: ["simplestatements_set_val$ebnf$1$subexpression$1"] },
            { name: "simplestatements_set_val$ebnf$1$subexpression$2", symbols: ["comma", "simplestatements_set_val_raw"] },
            { name: "simplestatements_set_val$ebnf$1", symbols: ["simplestatements_set_val$ebnf$1", "simplestatements_set_val$ebnf$1$subexpression$2"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "simplestatements_set_val", symbols: ["simplestatements_set_val_raw", "simplestatements_set_val$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              type: "list",
              values: [c[0], ...c[1] || []]
            }) },
            { name: "simplestatements_set_val_raw$subexpression$1", symbols: ["string"] },
            { name: "simplestatements_set_val_raw$subexpression$1", symbols: ["int"] },
            { name: "simplestatements_set_val_raw", symbols: ["simplestatements_set_val_raw$subexpression$1"], postprocess: (c) => (0, g.track)(c, { type: "value", value: a(c) }) },
            { name: "simplestatements_set_val_raw$subexpression$2", symbols: [o.lexerAny.has("word") ? { type: "word" } : word] },
            { name: "simplestatements_set_val_raw$subexpression$2", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on] },
            { name: "simplestatements_set_val_raw$subexpression$2", symbols: [o.lexerAny.has("kw_true") ? { type: "kw_true" } : kw_true] },
            { name: "simplestatements_set_val_raw$subexpression$2", symbols: [o.lexerAny.has("kw_false") ? { type: "kw_false" } : kw_false] },
            { name: "simplestatements_set_val_raw", symbols: ["simplestatements_set_val_raw$subexpression$2"], postprocess: (c) => (0, g.track)(c, { type: "identifier", name: a(c).value }) },
            { name: "simplestatements_set_val_raw", symbols: [o.lexerAny.has("quoted_word") ? { type: "quoted_word" } : quoted_word], postprocess: (c) => (0, g.track)(c, { type: "identifier", doubleQuoted: !0, name: a(c).value }) },
            { name: "simplestatements_show", symbols: ["kw_show", "ident"], postprocess: (c) => (0, g.track)(c, { type: "show", variable: s(c[1]) }) },
            { name: "create_schema$subexpression$1", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "kw_schema"] },
            { name: "create_schema$ebnf$1", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "create_schema$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_schema", symbols: ["create_schema$subexpression$1", "create_schema$ebnf$1", "ident"], postprocess: (c) => (0, g.track)(c, {
              type: "create schema",
              name: s(c[2]),
              ...c[1] ? { ifNotExists: !0 } : {}
            }) },
            { name: "raise_statement$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("debug", "log", "info", "notice", "warning", "exception") },
            { name: "raise_statement$ebnf$1", symbols: ["raise_statement$ebnf$1$subexpression$1"], postprocess: n },
            { name: "raise_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "raise_statement$ebnf$2$subexpression$1", symbols: ["comma", "expr_list_raw"], postprocess: B },
            { name: "raise_statement$ebnf$2", symbols: ["raise_statement$ebnf$2$subexpression$1"], postprocess: n },
            { name: "raise_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "raise_statement$ebnf$3", symbols: ["raise_using"], postprocess: n },
            { name: "raise_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "raise_statement", symbols: ["kw_raise", "raise_statement$ebnf$1", "string", "raise_statement$ebnf$2", "raise_statement$ebnf$3"], postprocess: (c) => (0, g.track)(c, {
              type: "raise",
              format: d(c[2]),
              ...c[1] && { level: d(c[1]) },
              ...c[3] && c[3].length && { formatExprs: c[3] },
              ...c[4] && c[4].length && { using: c[4] }
            }) },
            { name: "raise_using$macrocall$2", symbols: ["raise_using_one"] },
            { name: "raise_using$macrocall$1$ebnf$1", symbols: [] },
            { name: "raise_using$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "raise_using$macrocall$2"], postprocess: B },
            { name: "raise_using$macrocall$1$ebnf$1", symbols: ["raise_using$macrocall$1$ebnf$1", "raise_using$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "raise_using$macrocall$1", symbols: ["raise_using$macrocall$2", "raise_using$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "raise_using", symbols: [o.lexerAny.has("kw_using") ? { type: "kw_using" } : kw_using, "raise_using$macrocall$1"], postprocess: B },
            { name: "raise_using_one", symbols: ["raise_using_what", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "expr"], postprocess: (c) => (0, g.track)(c, {
              type: d(c[0]),
              value: c[2]
            }) },
            { name: "raise_using_what", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table] },
            { name: "raise_using_what", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("message", "detail", "hint", "errcode", "column", "constraint", "datatype", "schema") },
            { name: "comment_statement", symbols: ["kw_comment", o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "comment_what", o.lexerAny.has("kw_is") ? { type: "kw_is" } : kw_is, "string"], postprocess: (c) => (0, g.track)(c, {
              type: "comment",
              comment: (0, g.unbox)(B(c)),
              on: a(c[2])
            }) },
            { name: "comment_what", symbols: ["comment_what_col"] },
            { name: "comment_what", symbols: ["comment_what_nm"] },
            { name: "comment_what_nm$subexpression$1", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table] },
            { name: "comment_what_nm$subexpression$1", symbols: ["kw_materialized", "kw_view"] },
            { name: "comment_what_nm$subexpression$1", symbols: [o.lexerAny.has("word") ? { type: "word" } : word], postprocess: R("database", "index", "trigger", "type", "view") },
            { name: "comment_what_nm", symbols: ["comment_what_nm$subexpression$1", "qualified_name"], postprocess: (c) => (0, g.track)(c, {
              type: d(c[0]),
              name: c[1]
            }) },
            { name: "comment_what_col", symbols: ["kw_column", "qcolumn"], postprocess: (c) => (0, g.track)(c, {
              type: "column",
              column: B(c)
            }) },
            { name: "simplestatements_begin$ebnf$1$subexpression$1", symbols: ["kw_transaction"] },
            { name: "simplestatements_begin$ebnf$1$subexpression$1", symbols: ["kw_work"] },
            { name: "simplestatements_begin$ebnf$1", symbols: ["simplestatements_begin$ebnf$1$subexpression$1"], postprocess: n },
            { name: "simplestatements_begin$ebnf$1", symbols: [], postprocess: () => null },
            { name: "simplestatements_begin$ebnf$2", symbols: [] },
            { name: "simplestatements_begin$ebnf$2$subexpression$1", symbols: ["simplestatements_begin_isol"] },
            { name: "simplestatements_begin$ebnf$2$subexpression$1", symbols: ["simplestatements_begin_writ"] },
            { name: "simplestatements_begin$ebnf$2$subexpression$1", symbols: ["simplestatements_begin_def"] },
            { name: "simplestatements_begin$ebnf$2", symbols: ["simplestatements_begin$ebnf$2", "simplestatements_begin$ebnf$2$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            {
              name: "simplestatements_begin",
              symbols: ["kw_begin", "simplestatements_begin$ebnf$1", "simplestatements_begin$ebnf$2"],
              postprocess: (c) => (0, g.track)(c, {
                type: "begin",
                ...c[2].reduce((J, p) => ({ ...a(J), ...a(p) }), {})
              })
            },
            { name: "simplestatements_begin_isol$subexpression$1", symbols: ["kw_isolation", "kw_level"] },
            { name: "simplestatements_begin_isol$subexpression$2", symbols: ["kw_serializable"] },
            { name: "simplestatements_begin_isol$subexpression$2$subexpression$1", symbols: ["word"], postprocess: G("repeatable") },
            { name: "simplestatements_begin_isol$subexpression$2", symbols: ["simplestatements_begin_isol$subexpression$2$subexpression$1", "kw_read"] },
            { name: "simplestatements_begin_isol$subexpression$2$subexpression$2", symbols: ["word"], postprocess: G("committed") },
            { name: "simplestatements_begin_isol$subexpression$2", symbols: ["kw_read", "simplestatements_begin_isol$subexpression$2$subexpression$2"] },
            { name: "simplestatements_begin_isol$subexpression$2$subexpression$3", symbols: ["word"], postprocess: G("uncommitted") },
            { name: "simplestatements_begin_isol$subexpression$2", symbols: ["kw_read", "simplestatements_begin_isol$subexpression$2$subexpression$3"] },
            { name: "simplestatements_begin_isol", symbols: ["simplestatements_begin_isol$subexpression$1", "simplestatements_begin_isol$subexpression$2"], postprocess: (c) => (0, g.track)(c, {
              isolationLevel: d(c[1], " ")
            }) },
            { name: "simplestatements_begin_writ$subexpression$1", symbols: ["kw_read", "kw_write"] },
            { name: "simplestatements_begin_writ$subexpression$1", symbols: ["kw_read", o.lexerAny.has("kw_only") ? { type: "kw_only" } : kw_only] },
            { name: "simplestatements_begin_writ", symbols: ["simplestatements_begin_writ$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              writeable: d(c, " ")
            }) },
            { name: "simplestatements_begin_def$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "simplestatements_begin_def$ebnf$1", symbols: [], postprocess: () => null },
            { name: "simplestatements_begin_def", symbols: ["simplestatements_begin_def$ebnf$1", o.lexerAny.has("kw_deferrable") ? { type: "kw_deferrable" } : kw_deferrable], postprocess: (c) => (0, g.track)(c, {
              deferrable: !c[0]
            }) },
            { name: "insert_statement$subexpression$1", symbols: ["kw_insert", o.lexerAny.has("kw_into") ? { type: "kw_into" } : kw_into] },
            { name: "insert_statement$ebnf$1", symbols: ["collist_paren"], postprocess: n },
            { name: "insert_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "insert_statement$ebnf$2$subexpression$1$subexpression$1", symbols: ["kw_system"] },
            { name: "insert_statement$ebnf$2$subexpression$1$subexpression$1", symbols: [o.lexerAny.has("kw_user") ? { type: "kw_user" } : kw_user] },
            { name: "insert_statement$ebnf$2$subexpression$1", symbols: ["kw_overriding", "insert_statement$ebnf$2$subexpression$1$subexpression$1", "kw_value"], postprocess: C(1) },
            { name: "insert_statement$ebnf$2", symbols: ["insert_statement$ebnf$2$subexpression$1"], postprocess: n },
            { name: "insert_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "insert_statement$ebnf$3$subexpression$1", symbols: ["selection"] },
            { name: "insert_statement$ebnf$3$subexpression$1", symbols: ["selection_paren"] },
            { name: "insert_statement$ebnf$3", symbols: ["insert_statement$ebnf$3$subexpression$1"], postprocess: n },
            { name: "insert_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "insert_statement$ebnf$4$subexpression$1", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, "kw_conflict", "insert_on_conflict"], postprocess: B },
            { name: "insert_statement$ebnf$4", symbols: ["insert_statement$ebnf$4$subexpression$1"], postprocess: n },
            { name: "insert_statement$ebnf$4", symbols: [], postprocess: () => null },
            { name: "insert_statement$ebnf$5$subexpression$1", symbols: [o.lexerAny.has("kw_returning") ? { type: "kw_returning" } : kw_returning, "select_expr_list_aliased"], postprocess: B },
            { name: "insert_statement$ebnf$5", symbols: ["insert_statement$ebnf$5$subexpression$1"], postprocess: n },
            { name: "insert_statement$ebnf$5", symbols: [], postprocess: () => null },
            { name: "insert_statement", symbols: ["insert_statement$subexpression$1", "table_ref_aliased", "insert_statement$ebnf$1", "insert_statement$ebnf$2", "insert_statement$ebnf$3", "insert_statement$ebnf$4", "insert_statement$ebnf$5"], postprocess: (c) => {
              const J = c[2] && c[2].map(s), p = d(c[3]), N = a(c[4]), v = c[5], K = c[6];
              return (0, g.track)(c, {
                type: "insert",
                into: a(c[1]),
                insert: N,
                ...p && { overriding: p },
                ...J && { columns: J },
                ...K && { returning: K },
                ...v && { onConflict: v }
              });
            } },
            { name: "insert_values$ebnf$1", symbols: [] },
            { name: "insert_values$ebnf$1$subexpression$1", symbols: ["comma", "insert_value"], postprocess: B },
            { name: "insert_values$ebnf$1", symbols: ["insert_values$ebnf$1", "insert_values$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "insert_values", symbols: ["insert_value", "insert_values$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "insert_value", symbols: ["lparen", "insert_expr_list_raw", "rparen"], postprocess: C(1) },
            { name: "insert_expr_list_raw$ebnf$1", symbols: [] },
            { name: "insert_expr_list_raw$ebnf$1$subexpression$1", symbols: ["comma", "expr_or_select"], postprocess: B },
            { name: "insert_expr_list_raw$ebnf$1", symbols: ["insert_expr_list_raw$ebnf$1", "insert_expr_list_raw$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "insert_expr_list_raw", symbols: ["expr_or_select", "insert_expr_list_raw$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "insert_on_conflict$ebnf$1", symbols: ["insert_on_conflict_what"], postprocess: n },
            { name: "insert_on_conflict$ebnf$1", symbols: [], postprocess: () => null },
            { name: "insert_on_conflict", symbols: ["insert_on_conflict$ebnf$1", "insert_on_conflict_do"], postprocess: (c) => (0, g.track)(c, {
              ...c[0] ? { on: a(c[0]) } : {},
              ...c[1]
            }) },
            { name: "insert_on_conflict_what", symbols: ["lparen", "expr_list_raw", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "on expr",
              exprs: c[1]
            }) },
            { name: "insert_on_conflict_what", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "qname"], postprocess: (c) => (0, g.track)(c, {
              type: "on constraint",
              constraint: B(c)
            }) },
            { name: "insert_on_conflict_do", symbols: [o.lexerAny.has("kw_do") ? { type: "kw_do" } : kw_do, "kw_nothing"], postprocess: (c) => ({ do: "do nothing" }) },
            { name: "insert_on_conflict_do$subexpression$1", symbols: [o.lexerAny.has("kw_do") ? { type: "kw_do" } : kw_do, "kw_update", "kw_set"] },
            { name: "insert_on_conflict_do$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_where") ? { type: "kw_where" } : kw_where, "expr"], postprocess: B },
            { name: "insert_on_conflict_do$ebnf$1", symbols: ["insert_on_conflict_do$ebnf$1$subexpression$1"], postprocess: n },
            { name: "insert_on_conflict_do$ebnf$1", symbols: [], postprocess: () => null },
            { name: "insert_on_conflict_do", symbols: ["insert_on_conflict_do$subexpression$1", "update_set_list", "insert_on_conflict_do$ebnf$1"], postprocess: (c) => ({
              do: { sets: c[1] },
              ...c[2] && { where: c[2] }
            }) },
            { name: "update_statement$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from, "select_from_subject"], postprocess: B },
            { name: "update_statement$ebnf$1", symbols: ["update_statement$ebnf$1$subexpression$1"], postprocess: n },
            { name: "update_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "update_statement$ebnf$2", symbols: ["select_where"], postprocess: n },
            { name: "update_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "update_statement$ebnf$3$subexpression$1", symbols: [o.lexerAny.has("kw_returning") ? { type: "kw_returning" } : kw_returning, "select_expr_list_aliased"], postprocess: B },
            { name: "update_statement$ebnf$3", symbols: ["update_statement$ebnf$3$subexpression$1"], postprocess: n },
            { name: "update_statement$ebnf$3", symbols: [], postprocess: () => null },
            { name: "update_statement", symbols: ["kw_update", "table_ref_aliased", "kw_set", "update_set_list", "update_statement$ebnf$1", "update_statement$ebnf$2", "update_statement$ebnf$3"], postprocess: (c) => {
              const J = a(c[4]), p = a(c[5]), N = c[6];
              return (0, g.track)(c, {
                type: "update",
                table: a(c[1]),
                sets: c[3],
                ...p ? { where: p } : {},
                ...J ? { from: J } : {},
                ...N ? { returning: N } : {}
              });
            } },
            { name: "update_set_list$ebnf$1", symbols: [] },
            { name: "update_set_list$ebnf$1$subexpression$1", symbols: ["comma", "update_set"], postprocess: B },
            { name: "update_set_list$ebnf$1", symbols: ["update_set_list$ebnf$1", "update_set_list$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "update_set_list", symbols: ["update_set", "update_set_list$ebnf$1"], postprocess: ([c, J]) => {
              const p = [];
              for (const N of [c, ...J || []]) {
                const v = a(N);
                Array.isArray(v) ? p.push(...v) : p.push(v);
              }
              return p;
            } },
            { name: "update_set", symbols: ["update_set_one"] },
            { name: "update_set", symbols: ["update_set_multiple"] },
            { name: "update_set_one", symbols: ["ident", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "expr"], postprocess: (c) => (0, g.box)(c, {
              column: s(c[0]),
              value: a(c[2])
            }) },
            { name: "update_set_multiple$subexpression$1", symbols: ["lparen", "expr_list_raw", "rparen"], postprocess: C(1) },
            { name: "update_set_multiple", symbols: ["collist_paren", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "update_set_multiple$subexpression$1"], postprocess: (c) => {
              const J = c[0], p = c[2];
              if (J.length !== p.length)
                throw new Error("number of columns does not match number of values");
              return (0, g.box)(c, J.map((N, v) => ({
                column: s(N),
                value: a(p[v])
              })));
            } },
            { name: "altertable_statement$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "altertable_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_statement$ebnf$2", symbols: [o.lexerAny.has("kw_only") ? { type: "kw_only" } : kw_only], postprocess: n },
            { name: "altertable_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altertable_statement", symbols: ["kw_alter", o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table, "altertable_statement$ebnf$1", "altertable_statement$ebnf$2", "table_ref", "altertable_actions"], postprocess: (c) => (0, g.track)(c, {
              type: "alter table",
              ...c[2] ? { ifExists: !0 } : {},
              ...c[3] ? { only: !0 } : {},
              table: a(c[4]),
              changes: (0, g.unbox)(c[5]).map(a)
            }) },
            { name: "altertable_actions$ebnf$1", symbols: [] },
            { name: "altertable_actions$ebnf$1$subexpression$1", symbols: ["comma", "altertable_action"], postprocess: B },
            { name: "altertable_actions$ebnf$1", symbols: ["altertable_actions$ebnf$1", "altertable_actions$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "altertable_actions", symbols: ["altertable_action", "altertable_actions$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "altertable_action", symbols: ["altertable_rename_table"] },
            { name: "altertable_action", symbols: ["altertable_rename_column"] },
            { name: "altertable_action", symbols: ["altertable_rename_constraint"] },
            { name: "altertable_action", symbols: ["altertable_add_column"] },
            { name: "altertable_action", symbols: ["altertable_drop_column"] },
            { name: "altertable_action", symbols: ["altertable_alter_column"] },
            { name: "altertable_action", symbols: ["altertable_add_constraint"] },
            { name: "altertable_action", symbols: ["altertable_drop_constraint"] },
            { name: "altertable_action", symbols: ["altertable_owner"] },
            { name: "altertable_rename_table", symbols: ["kw_rename", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "word"], postprocess: (c) => (0, g.track)(c, {
              type: "rename",
              to: s(B(c))
            }) },
            { name: "altertable_rename_column$ebnf$1", symbols: ["kw_column"], postprocess: n },
            { name: "altertable_rename_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_rename_column", symbols: ["kw_rename", "altertable_rename_column$ebnf$1", "ident", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "ident"], postprocess: (c) => (0, g.track)(c, {
              type: "rename column",
              column: s(c[2]),
              to: s(B(c))
            }) },
            { name: "altertable_rename_constraint", symbols: ["kw_rename", o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "ident", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "ident"], postprocess: (c) => (0, g.track)(c, {
              type: "rename constraint",
              constraint: s(c[2]),
              to: s(B(c))
            }) },
            { name: "altertable_add_column$ebnf$1", symbols: ["kw_column"], postprocess: n },
            { name: "altertable_add_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_add_column$ebnf$2", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "altertable_add_column$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altertable_add_column", symbols: ["kw_add", "altertable_add_column$ebnf$1", "altertable_add_column$ebnf$2", "createtable_column"], postprocess: (c) => (0, g.track)(c, {
              type: "add column",
              ...c[2] ? { ifNotExists: !0 } : {},
              column: a(c[3])
            }) },
            { name: "altertable_drop_column$ebnf$1", symbols: ["kw_column"], postprocess: n },
            { name: "altertable_drop_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_drop_column$ebnf$2", symbols: ["kw_ifexists"], postprocess: n },
            { name: "altertable_drop_column$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altertable_drop_column$ebnf$3$subexpression$1", symbols: ["kw_restrict"] },
            { name: "altertable_drop_column$ebnf$3$subexpression$1", symbols: ["kw_cascade"] },
            { name: "altertable_drop_column$ebnf$3", symbols: ["altertable_drop_column$ebnf$3$subexpression$1"], postprocess: n },
            { name: "altertable_drop_column$ebnf$3", symbols: [], postprocess: () => null },
            { name: "altertable_drop_column", symbols: ["kw_drop", "altertable_drop_column$ebnf$1", "altertable_drop_column$ebnf$2", "ident", "altertable_drop_column$ebnf$3"], postprocess: (c) => (0, g.track)(c, {
              type: "drop column",
              ...c[2] ? { ifExists: !0 } : {},
              column: s(c[3]),
              ...c[4] ? { behaviour: d(c[4], " ") } : {}
            }) },
            { name: "altertable_alter_column$ebnf$1", symbols: ["kw_column"], postprocess: n },
            { name: "altertable_alter_column$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_alter_column", symbols: ["kw_alter", "altertable_alter_column$ebnf$1", "ident", "altercol"], postprocess: (c) => (0, g.track)(c, {
              type: "alter column",
              column: s(c[2]),
              alter: a(c[3])
            }) },
            { name: "altercol$ebnf$1$subexpression$1", symbols: ["kw_set", "kw_data"] },
            { name: "altercol$ebnf$1", symbols: ["altercol$ebnf$1$subexpression$1"], postprocess: n },
            { name: "altercol$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altercol", symbols: ["altercol$ebnf$1", "kw_type", "data_type"], postprocess: (c) => (0, g.track)(c, { type: "set type", dataType: a(B(c)) }) },
            { name: "altercol", symbols: ["kw_set", o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default, "expr"], postprocess: (c) => (0, g.track)(c, { type: "set default", default: a(B(c)) }) },
            { name: "altercol", symbols: ["kw_drop", o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default], postprocess: (c) => (0, g.track)(c, { type: "drop default" }) },
            { name: "altercol$subexpression$1", symbols: ["kw_set"] },
            { name: "altercol$subexpression$1", symbols: ["kw_drop"] },
            { name: "altercol", symbols: ["altercol$subexpression$1", "kw_not_null"], postprocess: (c) => (0, g.track)(c, { type: d(c, " ") }) },
            { name: "altercol", symbols: ["altercol_generated_add"], postprocess: a },
            { name: "altertable_add_constraint", symbols: ["kw_add", "createtable_constraint"], postprocess: (c) => (0, g.track)(c, {
              type: "add constraint",
              constraint: a(B(c))
            }) },
            { name: "altertable_drop_constraint$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "altertable_drop_constraint$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altertable_drop_constraint$ebnf$2$subexpression$1", symbols: ["kw_restrict"] },
            { name: "altertable_drop_constraint$ebnf$2$subexpression$1", symbols: ["kw_cascade"] },
            { name: "altertable_drop_constraint$ebnf$2", symbols: ["altertable_drop_constraint$ebnf$2$subexpression$1"], postprocess: n },
            { name: "altertable_drop_constraint$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altertable_drop_constraint", symbols: ["kw_drop", o.lexerAny.has("kw_constraint") ? { type: "kw_constraint" } : kw_constraint, "altertable_drop_constraint$ebnf$1", "ident", "altertable_drop_constraint$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "drop constraint",
              ...c[2] ? { ifExists: !0 } : {},
              constraint: s(c[3]),
              ...c[4] ? { behaviour: d(c[4], " ") } : {}
            }) },
            { name: "altertable_owner", symbols: ["kw_owner", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "ident"], postprocess: (c) => (0, g.track)(c, {
              type: "owner",
              to: s(B(c))
            }) },
            { name: "altercol_generated_add", symbols: ["kw_add", "altercol_generated"], postprocess: B },
            { name: "altercol_generated$ebnf$1$subexpression$1", symbols: ["kw_always"] },
            { name: "altercol_generated$ebnf$1$subexpression$1", symbols: ["kw_by", o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default] },
            { name: "altercol_generated$ebnf$1", symbols: ["altercol_generated$ebnf$1$subexpression$1"], postprocess: n },
            { name: "altercol_generated$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altercol_generated$subexpression$1", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "kw_identity"] },
            { name: "altercol_generated$ebnf$2$subexpression$1", symbols: ["lparen", "altercol_generated_seq", "rparen"], postprocess: C(1) },
            { name: "altercol_generated$ebnf$2", symbols: ["altercol_generated$ebnf$2$subexpression$1"], postprocess: n },
            { name: "altercol_generated$ebnf$2", symbols: [], postprocess: () => null },
            { name: "altercol_generated", symbols: ["kw_generated", "altercol_generated$ebnf$1", "altercol_generated$subexpression$1", "altercol_generated$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "add generated",
              ...c[1] && { always: d(c[1], " ") },
              ...c[3] && { sequence: a(c[3]) }
            }) },
            { name: "altercol_generated_seq$ebnf$1$subexpression$1", symbols: ["kw_sequence", "kw_name", "qualified_name"] },
            { name: "altercol_generated_seq$ebnf$1", symbols: ["altercol_generated_seq$ebnf$1$subexpression$1"], postprocess: n },
            { name: "altercol_generated_seq$ebnf$1", symbols: [], postprocess: () => null },
            { name: "altercol_generated_seq$ebnf$2", symbols: [] },
            { name: "altercol_generated_seq$ebnf$2", symbols: ["altercol_generated_seq$ebnf$2", "create_sequence_option"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "altercol_generated_seq", symbols: ["altercol_generated_seq$ebnf$1", "altercol_generated_seq$ebnf$2"], postprocess: (c) => {
              const J = {
                ...c[0] && { name: a(B(c[0])) }
              };
              return F(J, c[1]), (0, g.track)(c, J);
            } },
            { name: "alterindex_statement$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "alterindex_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "alterindex_statement", symbols: ["kw_alter", "kw_index", "alterindex_statement$ebnf$1", "table_ref", "alterindex_action"], postprocess: (c) => (0, g.track)(c, {
              type: "alter index",
              ...c[2] ? { ifExists: !0 } : {},
              index: a(c[3]),
              change: a(c[4])
            }) },
            { name: "alterindex_action", symbols: ["alterindex_rename"] },
            { name: "alterindex_action", symbols: ["alterindex_set_tablespace"] },
            { name: "alterindex_rename", symbols: ["kw_rename", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "word"], postprocess: (c) => (0, g.track)(c, {
              type: "rename",
              to: s(B(c))
            }) },
            { name: "alterindex_set_tablespace", symbols: ["kw_set", "kw_tablespace", "word"], postprocess: (c) => (0, g.track)(c, {
              type: "set tablespace",
              tablespace: s(B(c))
            }) },
            { name: "delete_statement", symbols: ["delete_delete"] },
            { name: "delete_statement", symbols: ["delete_truncate"] },
            { name: "delete_delete$subexpression$1", symbols: ["kw_delete", o.lexerAny.has("kw_from") ? { type: "kw_from" } : kw_from] },
            { name: "delete_delete$ebnf$1", symbols: ["select_where"], postprocess: n },
            { name: "delete_delete$ebnf$1", symbols: [], postprocess: () => null },
            { name: "delete_delete$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("kw_returning") ? { type: "kw_returning" } : kw_returning, "select_expr_list_aliased"], postprocess: B },
            { name: "delete_delete$ebnf$2", symbols: ["delete_delete$ebnf$2$subexpression$1"], postprocess: n },
            { name: "delete_delete$ebnf$2", symbols: [], postprocess: () => null },
            { name: "delete_delete", symbols: ["delete_delete$subexpression$1", "table_ref_aliased", "delete_delete$ebnf$1", "delete_delete$ebnf$2"], postprocess: (c) => {
              const J = c[2], p = c[3];
              return (0, g.track)(c, {
                type: "delete",
                from: a(c[1]),
                ...J ? { where: J } : {},
                ...p ? { returning: p } : {}
              });
            } },
            { name: "delete_truncate$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table], postprocess: n },
            { name: "delete_truncate$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "delete_truncate$subexpression$1", symbols: ["kw_truncate", "delete_truncate$subexpression$1$ebnf$1"] },
            { name: "delete_truncate$macrocall$2", symbols: ["table_ref"] },
            { name: "delete_truncate$macrocall$1$ebnf$1", symbols: [] },
            { name: "delete_truncate$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "delete_truncate$macrocall$2"], postprocess: B },
            { name: "delete_truncate$macrocall$1$ebnf$1", symbols: ["delete_truncate$macrocall$1$ebnf$1", "delete_truncate$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "delete_truncate$macrocall$1", symbols: ["delete_truncate$macrocall$2", "delete_truncate$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "delete_truncate$ebnf$1$subexpression$1$subexpression$1", symbols: ["kw_restart"] },
            { name: "delete_truncate$ebnf$1$subexpression$1$subexpression$1", symbols: ["kw_continue"] },
            { name: "delete_truncate$ebnf$1$subexpression$1", symbols: ["delete_truncate$ebnf$1$subexpression$1$subexpression$1", "kw_identity"] },
            { name: "delete_truncate$ebnf$1", symbols: ["delete_truncate$ebnf$1$subexpression$1"], postprocess: n },
            { name: "delete_truncate$ebnf$1", symbols: [], postprocess: () => null },
            { name: "delete_truncate$ebnf$2$subexpression$1", symbols: ["kw_restrict"] },
            { name: "delete_truncate$ebnf$2$subexpression$1", symbols: ["kw_cascade"] },
            { name: "delete_truncate$ebnf$2", symbols: ["delete_truncate$ebnf$2$subexpression$1"], postprocess: n },
            { name: "delete_truncate$ebnf$2", symbols: [], postprocess: () => null },
            { name: "delete_truncate", symbols: ["delete_truncate$subexpression$1", "delete_truncate$macrocall$1", "delete_truncate$ebnf$1", "delete_truncate$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "truncate table",
              tables: c[1],
              ...c[2] && { identity: d(c[2][0]) },
              ...c[3] && { cascade: d(c[3]) }
            }) },
            { name: "create_sequence_statement$ebnf$1$subexpression$1", symbols: ["kw_temp"] },
            { name: "create_sequence_statement$ebnf$1$subexpression$1", symbols: ["kw_temporary"] },
            { name: "create_sequence_statement$ebnf$1", symbols: ["create_sequence_statement$ebnf$1$subexpression$1"], postprocess: n },
            { name: "create_sequence_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_sequence_statement$ebnf$2", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "create_sequence_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "create_sequence_statement$ebnf$3", symbols: [] },
            { name: "create_sequence_statement$ebnf$3", symbols: ["create_sequence_statement$ebnf$3", "create_sequence_option"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_sequence_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "create_sequence_statement$ebnf$1", "kw_sequence", "create_sequence_statement$ebnf$2", "qualified_name", "create_sequence_statement$ebnf$3"], postprocess: (c) => {
              const J = {
                type: "create sequence",
                ...c[1] && { temp: !0 },
                ...c[3] && { ifNotExists: !0 },
                name: a(c[4]),
                options: {}
              };
              return F(J.options, c[5]), (0, g.track)(c, J);
            } },
            { name: "create_sequence_option", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "data_type"], postprocess: (c) => (0, g.box)(c, ["as", c[1]]) },
            { name: "create_sequence_option$ebnf$1", symbols: ["kw_by"], postprocess: n },
            { name: "create_sequence_option$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_sequence_option", symbols: ["kw_increment", "create_sequence_option$ebnf$1", "int"], postprocess: (c) => (0, g.box)(c, ["incrementBy", c[2]]) },
            { name: "create_sequence_option", symbols: ["create_sequence_minvalue"], postprocess: (c) => (0, g.box)(c, ["minValue", c[0]]) },
            { name: "create_sequence_option", symbols: ["create_sequence_maxvalue"], postprocess: (c) => (0, g.box)(c, ["maxValue", c[0]]) },
            { name: "create_sequence_option$ebnf$2", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with], postprocess: n },
            { name: "create_sequence_option$ebnf$2", symbols: [], postprocess: () => null },
            { name: "create_sequence_option", symbols: ["kw_start", "create_sequence_option$ebnf$2", "int"], postprocess: (c) => (0, g.box)(c, ["startWith", c[2]]) },
            { name: "create_sequence_option", symbols: ["kw_cache", "int"], postprocess: (c) => (0, g.box)(c, ["cache", c[1]]) },
            { name: "create_sequence_option$ebnf$3", symbols: ["kw_no"], postprocess: n },
            { name: "create_sequence_option$ebnf$3", symbols: [], postprocess: () => null },
            { name: "create_sequence_option", symbols: ["create_sequence_option$ebnf$3", "kw_cycle"], postprocess: (c) => (0, g.box)(c, ["cycle", d(c, " ")]) },
            { name: "create_sequence_option", symbols: ["create_sequence_owned_by"], postprocess: (c) => (0, g.box)(c, ["ownedBy", a(c)]) },
            { name: "create_sequence_minvalue", symbols: ["kw_minvalue", "int"], postprocess: B },
            { name: "create_sequence_minvalue", symbols: ["kw_no", "kw_minvalue"], postprocess: (c) => (0, g.box)(c, "no minvalue") },
            { name: "create_sequence_maxvalue", symbols: ["kw_maxvalue", "int"], postprocess: B },
            { name: "create_sequence_maxvalue", symbols: ["kw_no", "kw_maxvalue"], postprocess: (c) => (0, g.box)(c, "no maxvalue") },
            { name: "create_sequence_owned_by$subexpression$1", symbols: ["kw_none"] },
            { name: "create_sequence_owned_by$subexpression$1", symbols: ["qcolumn"] },
            { name: "create_sequence_owned_by", symbols: ["kw_owned", "kw_by", "create_sequence_owned_by$subexpression$1"], postprocess: (c) => (0, g.box)(c, a(B(c))) },
            { name: "alter_sequence_statement$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "alter_sequence_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "alter_sequence_statement", symbols: ["kw_alter", "kw_sequence", "alter_sequence_statement$ebnf$1", "qualified_name", "alter_sequence_statement_body"], postprocess: (c) => {
              const J = {
                type: "alter sequence",
                ...c[2] && { ifExists: !0 },
                name: a(c[3]),
                change: c[4]
              };
              return (0, g.track)(c, J);
            } },
            { name: "alter_sequence_statement_body$ebnf$1", symbols: ["alter_sequence_option"] },
            { name: "alter_sequence_statement_body$ebnf$1", symbols: ["alter_sequence_statement_body$ebnf$1", "alter_sequence_option"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "alter_sequence_statement_body", symbols: ["alter_sequence_statement_body$ebnf$1"], postprocess: (c) => {
              const J = {
                type: "set options"
              };
              return F(J, c[0]), (0, g.track)(c, J);
            } },
            { name: "alter_sequence_statement_body$subexpression$1", symbols: ["ident"] },
            { name: "alter_sequence_statement_body$subexpression$1", symbols: [o.lexerAny.has("kw_session_user") ? { type: "kw_session_user" } : kw_session_user] },
            { name: "alter_sequence_statement_body$subexpression$1", symbols: [o.lexerAny.has("kw_current_user") ? { type: "kw_current_user" } : kw_current_user] },
            { name: "alter_sequence_statement_body", symbols: ["kw_owner", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "alter_sequence_statement_body$subexpression$1"], postprocess: (c) => (0, g.track)(c, { type: "owner to", owner: s(B(c)) }) },
            { name: "alter_sequence_statement_body", symbols: ["kw_rename", o.lexerAny.has("kw_to") ? { type: "kw_to" } : kw_to, "ident"], postprocess: (c) => (0, g.track)(c, { type: "rename", newName: s(B(c)) }) },
            { name: "alter_sequence_statement_body", symbols: ["kw_set", "kw_schema", "ident"], postprocess: (c) => (0, g.track)(c, { type: "set schema", newSchema: s(B(c)) }) },
            { name: "alter_sequence_option", symbols: ["create_sequence_option"], postprocess: a },
            { name: "alter_sequence_option$ebnf$1$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with], postprocess: n },
            { name: "alter_sequence_option$ebnf$1$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "alter_sequence_option$ebnf$1$subexpression$1", symbols: ["alter_sequence_option$ebnf$1$subexpression$1$ebnf$1", "int"], postprocess: B },
            { name: "alter_sequence_option$ebnf$1", symbols: ["alter_sequence_option$ebnf$1$subexpression$1"], postprocess: n },
            { name: "alter_sequence_option$ebnf$1", symbols: [], postprocess: () => null },
            { name: "alter_sequence_option", symbols: ["kw_restart", "alter_sequence_option$ebnf$1"], postprocess: (c) => (0, g.box)(c, ["restart", typeof (0, g.unbox)(c[1]) == "number" ? (0, g.unbox)(c[1]) : !0]) },
            { name: "drop_statement$ebnf$1", symbols: ["kw_ifexists"], postprocess: n },
            { name: "drop_statement$ebnf$1", symbols: [], postprocess: () => null },
            { name: "drop_statement$macrocall$2", symbols: ["qualified_name"] },
            { name: "drop_statement$macrocall$1$ebnf$1", symbols: [] },
            { name: "drop_statement$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "drop_statement$macrocall$2"], postprocess: B },
            { name: "drop_statement$macrocall$1$ebnf$1", symbols: ["drop_statement$macrocall$1$ebnf$1", "drop_statement$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "drop_statement$macrocall$1", symbols: ["drop_statement$macrocall$2", "drop_statement$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "drop_statement$ebnf$2$subexpression$1", symbols: ["kw_cascade"] },
            { name: "drop_statement$ebnf$2$subexpression$1", symbols: ["kw_restrict"] },
            { name: "drop_statement$ebnf$2", symbols: ["drop_statement$ebnf$2$subexpression$1"], postprocess: n },
            { name: "drop_statement$ebnf$2", symbols: [], postprocess: () => null },
            { name: "drop_statement", symbols: ["kw_drop", "drop_what", "drop_statement$ebnf$1", "drop_statement$macrocall$1", "drop_statement$ebnf$2"], postprocess: (c, J) => {
              const p = a(c[1]);
              return (0, g.track)(c, {
                ...p,
                ...c[2] && { ifExists: !0 },
                names: c[3],
                ...c[4] && { cascade: d(c[4]) }
              });
            } },
            { name: "drop_what", symbols: [o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table], postprocess: (c) => (0, g.track)(c, { type: "drop table" }) },
            { name: "drop_what", symbols: ["kw_sequence"], postprocess: (c) => (0, g.track)(c, { type: "drop sequence" }) },
            { name: "drop_what", symbols: ["kw_type"], postprocess: (c) => (0, g.track)(c, { type: "drop type" }) },
            { name: "drop_what", symbols: ["kw_trigger"], postprocess: (c) => (0, g.track)(c, { type: "drop trigger" }) },
            { name: "drop_what$ebnf$1", symbols: [o.lexerAny.has("kw_concurrently") ? { type: "kw_concurrently" } : kw_concurrently], postprocess: n },
            { name: "drop_what$ebnf$1", symbols: [], postprocess: () => null },
            { name: "drop_what", symbols: ["kw_index", "drop_what$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              type: "drop index",
              ...c[1] && { concurrently: !0 }
            }) },
            { name: "with_statement", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "with_statement_bindings", "with_statement_statement"], postprocess: (c) => (0, g.track)(c, {
              type: "with",
              bind: c[1],
              in: a(c[2])
            }) },
            { name: "with_recursive_statement$subexpression$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "kw_recursive"] },
            { name: "with_recursive_statement", symbols: ["with_recursive_statement$subexpression$1", "ident", "collist_paren", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "lparen", "union_statement", "rparen", "with_statement_statement"], postprocess: (c) => (0, g.track)(c, {
              type: "with recursive",
              alias: s(c[1]),
              columnNames: c[2].map(s),
              bind: c[5],
              in: a(c[7])
            }) },
            { name: "with_statement_bindings$ebnf$1", symbols: [] },
            { name: "with_statement_bindings$ebnf$1$subexpression$1", symbols: ["comma", "with_statement_binding"], postprocess: B },
            { name: "with_statement_bindings$ebnf$1", symbols: ["with_statement_bindings$ebnf$1", "with_statement_bindings$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "with_statement_bindings", symbols: ["with_statement_binding", "with_statement_bindings$ebnf$1"], postprocess: ([c, J]) => [c, ...J || []] },
            { name: "with_statement_binding", symbols: ["word", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "lparen", "with_statement_statement", "rparen"], postprocess: (c) => (0, g.track)(c, {
              alias: s(c[0]),
              statement: a(c[3])
            }) },
            { name: "with_statement_statement", symbols: ["selection"] },
            { name: "with_statement_statement", symbols: ["insert_statement"] },
            { name: "with_statement_statement", symbols: ["update_statement"] },
            { name: "with_statement_statement", symbols: ["delete_statement"] },
            { name: "createtype_statement$subexpression$1", symbols: ["createtype_enum"] },
            { name: "createtype_statement$subexpression$1", symbols: ["createtype_composite"] },
            { name: "createtype_statement", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "kw_type", "qualified_name", "createtype_statement$subexpression$1"], postprocess: (c) => (0, g.track)(c, {
              name: c[2],
              ...a(c[3])
            }) },
            { name: "createtype_enum$macrocall$2", symbols: ["enum_value"] },
            { name: "createtype_enum$macrocall$1$ebnf$1", symbols: [] },
            { name: "createtype_enum$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "createtype_enum$macrocall$2"], postprocess: B },
            { name: "createtype_enum$macrocall$1$ebnf$1", symbols: ["createtype_enum$macrocall$1$ebnf$1", "createtype_enum$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtype_enum$macrocall$1", symbols: ["createtype_enum$macrocall$2", "createtype_enum$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "createtype_enum", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "kw_enum", "lparen", "createtype_enum$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "create enum",
              values: c[3]
            }) },
            { name: "enum_value", symbols: ["string"], postprocess: (c) => (0, g.track)(c, { value: d(c) }) },
            { name: "createtype_composite$macrocall$2", symbols: ["createtype_composite_attr"] },
            { name: "createtype_composite$macrocall$1$ebnf$1", symbols: [] },
            { name: "createtype_composite$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "createtype_composite$macrocall$2"], postprocess: B },
            { name: "createtype_composite$macrocall$1$ebnf$1", symbols: ["createtype_composite$macrocall$1$ebnf$1", "createtype_composite$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "createtype_composite$macrocall$1", symbols: ["createtype_composite$macrocall$2", "createtype_composite$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "createtype_composite", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "lparen", "createtype_composite$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, {
              type: "create composite type",
              attributes: c[2]
            }) },
            { name: "createtype_composite_attr$ebnf$1", symbols: ["createtable_collate"], postprocess: n },
            { name: "createtype_composite_attr$ebnf$1", symbols: [], postprocess: () => null },
            { name: "createtype_composite_attr", symbols: ["word", "data_type", "createtype_composite_attr$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              name: s(c[0]),
              dataType: c[1],
              ...c[2] ? { collate: c[2][1] } : {}
            }) },
            { name: "union_left", symbols: ["select_statement"] },
            { name: "union_left", symbols: ["select_values"] },
            { name: "union_left", symbols: ["selection_paren"] },
            { name: "union_right", symbols: ["selection"] },
            { name: "union_right", symbols: ["selection_paren"] },
            { name: "union_statement$subexpression$1$ebnf$1", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all], postprocess: n },
            { name: "union_statement$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "union_statement$subexpression$1", symbols: [o.lexerAny.has("kw_union") ? { type: "kw_union" } : kw_union, "union_statement$subexpression$1$ebnf$1"] },
            { name: "union_statement", symbols: ["union_left", "union_statement$subexpression$1", "union_right"], postprocess: (c) => (0, g.track)(c, {
              type: d(c[1], " "),
              left: a(c[0]),
              right: a(c[2])
            }) },
            { name: "prepare$ebnf$1$subexpression$1", symbols: ["lparen", "data_type_list", "rparen"], postprocess: C(1) },
            { name: "prepare$ebnf$1", symbols: ["prepare$ebnf$1$subexpression$1"], postprocess: n },
            { name: "prepare$ebnf$1", symbols: [], postprocess: () => null },
            { name: "prepare", symbols: ["kw_prepare", "ident", "prepare$ebnf$1", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "statement_noprep"], postprocess: (c) => (0, g.track)(c, {
              type: "prepare",
              name: s(c[1]),
              ...c[2] && { args: c[2] },
              statement: a(B(c))
            }) },
            { name: "deallocate$ebnf$1", symbols: ["kw_prepare"], postprocess: n },
            { name: "deallocate$ebnf$1", symbols: [], postprocess: () => null },
            { name: "deallocate", symbols: ["kw_deallocate", "deallocate$ebnf$1", "deallocate_target"], postprocess: (c) => (0, g.track)(c, {
              type: "deallocate",
              target: c[2]
            }) },
            { name: "deallocate_target", symbols: ["deallocate_all"], postprocess: a },
            { name: "deallocate_target", symbols: ["deallocate_name"], postprocess: a },
            { name: "deallocate_name", symbols: ["ident"], postprocess: (c) => (0, g.track)(c, s(c[0])) },
            { name: "deallocate_all", symbols: [o.lexerAny.has("kw_all") ? { type: "kw_all" } : kw_all], postprocess: (c) => (0, g.track)(c, { option: "all" }) },
            { name: "create_view_statements", symbols: ["create_view"] },
            { name: "create_view_statements", symbols: ["create_materialized_view"] },
            { name: "create_view$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_or") ? { type: "kw_or" } : kw_or, "kw_replace"] },
            { name: "create_view$ebnf$1", symbols: ["create_view$ebnf$1$subexpression$1"], postprocess: n },
            { name: "create_view$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$2$subexpression$1", symbols: ["kw_temp"] },
            { name: "create_view$ebnf$2$subexpression$1", symbols: ["kw_temporary"] },
            { name: "create_view$ebnf$2", symbols: ["create_view$ebnf$2$subexpression$1"], postprocess: n },
            { name: "create_view$ebnf$2", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$3", symbols: ["kw_recursive"], postprocess: n },
            { name: "create_view$ebnf$3", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$2", symbols: ["ident"] },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "create_view$ebnf$4$subexpression$1$macrocall$2"], postprocess: B },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1", symbols: ["create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1", "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_view$ebnf$4$subexpression$1$macrocall$1", symbols: ["create_view$ebnf$4$subexpression$1$macrocall$2", "create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "create_view$ebnf$4$subexpression$1", symbols: ["lparen", "create_view$ebnf$4$subexpression$1$macrocall$1", "rparen"], postprocess: C(1) },
            { name: "create_view$ebnf$4", symbols: ["create_view$ebnf$4$subexpression$1"], postprocess: n },
            { name: "create_view$ebnf$4", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$5", symbols: ["create_view_opts"], postprocess: n },
            { name: "create_view$ebnf$5", symbols: [], postprocess: () => null },
            { name: "create_view$ebnf$6$subexpression$1$subexpression$1", symbols: ["kw_local"] },
            { name: "create_view$ebnf$6$subexpression$1$subexpression$1", symbols: ["kw_cascaded"] },
            { name: "create_view$ebnf$6$subexpression$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "create_view$ebnf$6$subexpression$1$subexpression$1", o.lexerAny.has("kw_check") ? { type: "kw_check" } : kw_check, "kw_option"], postprocess: C(1) },
            { name: "create_view$ebnf$6", symbols: ["create_view$ebnf$6$subexpression$1"], postprocess: n },
            { name: "create_view$ebnf$6", symbols: [], postprocess: () => null },
            { name: "create_view", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "create_view$ebnf$1", "create_view$ebnf$2", "create_view$ebnf$3", "kw_view", "qualified_name", "create_view$ebnf$4", "create_view$ebnf$5", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "selection", "create_view$ebnf$6"], postprocess: (c) => (0, g.track)(c, {
              type: "create view",
              ...c[1] && { orReplace: !0 },
              ...c[2] && { temp: !0 },
              ...c[3] && { recursive: !0 },
              name: c[5],
              ...c[6] && { columnNames: c[6].map(s) },
              ...c[7] && { parameters: m(c[7]) },
              query: c[9],
              ...c[10] && { checkOption: d(c[10]) }
            }) },
            { name: "create_view_opt", symbols: ["ident", o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "ident"], postprocess: ([c, J, p]) => [d(c), d(p)] },
            { name: "create_view_opts$macrocall$2", symbols: ["create_view_opt"] },
            { name: "create_view_opts$macrocall$1$ebnf$1", symbols: [] },
            { name: "create_view_opts$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "create_view_opts$macrocall$2"], postprocess: B },
            { name: "create_view_opts$macrocall$1$ebnf$1", symbols: ["create_view_opts$macrocall$1$ebnf$1", "create_view_opts$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_view_opts$macrocall$1", symbols: ["create_view_opts$macrocall$2", "create_view_opts$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "create_view_opts", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "create_view_opts$macrocall$1"], postprocess: B },
            { name: "create_materialized_view$ebnf$1", symbols: ["kw_ifnotexists"], postprocess: n },
            { name: "create_materialized_view$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$2", symbols: ["ident"] },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "create_materialized_view$ebnf$2$subexpression$1$macrocall$2"], postprocess: B },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1", symbols: ["create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1", "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_materialized_view$ebnf$2$subexpression$1$macrocall$1", symbols: ["create_materialized_view$ebnf$2$subexpression$1$macrocall$2", "create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "create_materialized_view$ebnf$2$subexpression$1", symbols: ["lparen", "create_materialized_view$ebnf$2$subexpression$1$macrocall$1", "rparen"], postprocess: C(1) },
            { name: "create_materialized_view$ebnf$2", symbols: ["create_materialized_view$ebnf$2$subexpression$1"], postprocess: n },
            { name: "create_materialized_view$ebnf$2", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$3", symbols: ["create_view_opts"], postprocess: n },
            { name: "create_materialized_view$ebnf$3", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$4$subexpression$1", symbols: ["kw_tablespace", "ident"], postprocess: B },
            { name: "create_materialized_view$ebnf$4", symbols: ["create_materialized_view$ebnf$4$subexpression$1"], postprocess: n },
            { name: "create_materialized_view$ebnf$4", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$5$subexpression$1$ebnf$1", symbols: ["kw_no"], postprocess: n },
            { name: "create_materialized_view$ebnf$5$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_materialized_view$ebnf$5$subexpression$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "create_materialized_view$ebnf$5$subexpression$1$ebnf$1", "kw_data"] },
            { name: "create_materialized_view$ebnf$5", symbols: ["create_materialized_view$ebnf$5$subexpression$1"], postprocess: n },
            { name: "create_materialized_view$ebnf$5", symbols: [], postprocess: () => null },
            { name: "create_materialized_view", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "kw_materialized", "kw_view", "create_materialized_view$ebnf$1", "qualified_name", "create_materialized_view$ebnf$2", "create_materialized_view$ebnf$3", "create_materialized_view$ebnf$4", o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "selection", "create_materialized_view$ebnf$5"], postprocess: (c) => (0, g.track)(c, {
              type: "create materialized view",
              ...c[3] && { ifNotExists: !0 },
              name: c[4],
              ...c[5] && { columnNames: c[6].map(s) },
              ...c[6] && { parameters: m(c[6]) },
              ...c[7] && { tablespace: s(c[7]) },
              query: c[9],
              ...c[10] && { withData: d(c[10][1]) !== "no" }
            }) },
            { name: "refresh_view_statements$ebnf$1", symbols: [o.lexerAny.has("kw_concurrently") ? { type: "kw_concurrently" } : kw_concurrently], postprocess: n },
            { name: "refresh_view_statements$ebnf$1", symbols: [], postprocess: () => null },
            { name: "refresh_view_statements$ebnf$2$subexpression$1$ebnf$1", symbols: ["kw_no"], postprocess: n },
            { name: "refresh_view_statements$ebnf$2$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "refresh_view_statements$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("kw_with") ? { type: "kw_with" } : kw_with, "refresh_view_statements$ebnf$2$subexpression$1$ebnf$1", "kw_data"] },
            { name: "refresh_view_statements$ebnf$2", symbols: ["refresh_view_statements$ebnf$2$subexpression$1"], postprocess: n },
            { name: "refresh_view_statements$ebnf$2", symbols: [], postprocess: () => null },
            { name: "refresh_view_statements", symbols: ["kw_refresh", "kw_materialized", "kw_view", "refresh_view_statements$ebnf$1", "qname", "refresh_view_statements$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "refresh materialized view",
              ...c[3] ? { concurrently: !0 } : {},
              name: c[4],
              ...c[5] ? { withData: d(c[5][1]) !== "no" } : {}
            }) },
            { name: "functions_statements", symbols: ["create_func"] },
            { name: "functions_statements", symbols: ["do_stm"] },
            { name: "functions_statements", symbols: ["drop_func"] },
            { name: "create_func$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("kw_or") ? { type: "kw_or" } : kw_or, "kw_replace"] },
            { name: "create_func$ebnf$1", symbols: ["create_func$ebnf$1$subexpression$1"], postprocess: n },
            { name: "create_func$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$2", symbols: ["func_argdef"] },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "create_func$subexpression$1$ebnf$1$macrocall$2"], postprocess: B },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1", symbols: ["create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1", "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_func$subexpression$1$ebnf$1$macrocall$1", symbols: ["create_func$subexpression$1$ebnf$1$macrocall$2", "create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "create_func$subexpression$1$ebnf$1", symbols: ["create_func$subexpression$1$ebnf$1$macrocall$1"], postprocess: n },
            { name: "create_func$subexpression$1$ebnf$1", symbols: [], postprocess: () => null },
            { name: "create_func$subexpression$1", symbols: ["lparen", "create_func$subexpression$1$ebnf$1", "rparen"], postprocess: C(1) },
            { name: "create_func$ebnf$2", symbols: ["func_spec"] },
            { name: "create_func$ebnf$2", symbols: ["create_func$ebnf$2", "func_spec"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "create_func", symbols: [o.lexerAny.has("kw_create") ? { type: "kw_create" } : kw_create, "create_func$ebnf$1", "kw_function", "qname", "create_func$subexpression$1", "create_func$ebnf$2"], postprocess: (c, J) => {
              var p;
              const N = {};
              for (const v of c[5]) {
                for (const K in v)
                  if (K[0] !== "_" && K in N)
                    throw new Error("conflicting or redundant options " + K);
                Object.assign(N, v);
              }
              return (0, g.track)(c, {
                type: "create function",
                ...c[1] && { orReplace: !0 },
                name: c[3],
                arguments: (p = c[4]) !== null && p !== void 0 ? p : [],
                ...N
              });
            } },
            { name: "func_argdef$ebnf$1", symbols: ["func_argopts"], postprocess: n },
            { name: "func_argdef$ebnf$1", symbols: [], postprocess: () => null },
            { name: "func_argdef$ebnf$2", symbols: ["func_argdefault"], postprocess: n },
            { name: "func_argdef$ebnf$2", symbols: [], postprocess: () => null },
            { name: "func_argdef", symbols: ["func_argdef$ebnf$1", "data_type", "func_argdef$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              default: c[2],
              type: c[1],
              ...c[0]
            }) },
            {
              name: "func_argdefault",
              symbols: [o.lexerAny.has("kw_default") ? { type: "kw_default" } : kw_default, "expr"],
              postprocess: (c) => c[1]
            },
            { name: "func_argdefault", symbols: [o.lexerAny.has("op_eq") ? { type: "op_eq" } : op_eq, "expr"], postprocess: (c) => c[1] },
            { name: "func_argopts$ebnf$1", symbols: ["word"], postprocess: n },
            { name: "func_argopts$ebnf$1", symbols: [], postprocess: () => null },
            { name: "func_argopts", symbols: ["func_argmod", "func_argopts$ebnf$1"], postprocess: (c) => (0, g.track)(c, {
              mode: d(c[0]),
              ...c[1] && { name: s(c[1]) }
            }) },
            { name: "func_argopts", symbols: ["word"], postprocess: (c, J) => {
              const p = s(c);
              return p === "out" || p === "inout" || p === "variadic" ? J : (0, g.track)(c, { name: p });
            } },
            { name: "func_argmod", symbols: [o.lexerAny.has("kw_in") ? { type: "kw_in" } : kw_in] },
            { name: "func_argmod", symbols: ["kw_out"] },
            { name: "func_argmod", symbols: ["kw_inout"] },
            { name: "func_argmod", symbols: ["kw_variadic"] },
            { name: "func_spec", symbols: ["kw_language", "word"], postprocess: (c) => (0, g.track)(c, { language: s(B(c)) }) },
            { name: "func_spec", symbols: ["func_purity"], postprocess: (c) => (0, g.track)(c, { purity: d(c) }) },
            { name: "func_spec$subexpression$1", symbols: [o.lexerAny.has("codeblock") ? { type: "codeblock" } : codeblock] },
            { name: "func_spec$subexpression$1", symbols: ["string"] },
            { name: "func_spec", symbols: [o.lexerAny.has("kw_as") ? { type: "kw_as" } : kw_as, "func_spec$subexpression$1"], postprocess: (c) => ({ code: d(B(c)) }) },
            { name: "func_spec$ebnf$1", symbols: [o.lexerAny.has("kw_not") ? { type: "kw_not" } : kw_not], postprocess: n },
            { name: "func_spec$ebnf$1", symbols: [], postprocess: () => null },
            { name: "func_spec$subexpression$2", symbols: ["word"], postprocess: G("leakproof") },
            { name: "func_spec", symbols: ["func_spec$ebnf$1", "func_spec$subexpression$2"], postprocess: (c) => (0, g.track)(c, { leakproof: !c[0] }) },
            { name: "func_spec", symbols: ["func_returns"], postprocess: (c) => (0, g.track)(c, { returns: a(c) }) },
            { name: "func_spec$subexpression$3", symbols: ["word"], postprocess: G("called") },
            { name: "func_spec", symbols: ["func_spec$subexpression$3", "oninp"], postprocess: () => ({ onNullInput: "call" }) },
            { name: "func_spec$subexpression$4", symbols: ["word"], postprocess: G("returns") },
            { name: "func_spec", symbols: ["func_spec$subexpression$4", o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null, "oninp"], postprocess: () => ({ onNullInput: "null" }) },
            { name: "func_spec$subexpression$5", symbols: ["word"], postprocess: G("strict") },
            { name: "func_spec", symbols: ["func_spec$subexpression$5"], postprocess: () => ({ onNullInput: "strict" }) },
            { name: "func_purity", symbols: ["word"], postprocess: G("immutable") },
            { name: "func_purity", symbols: ["word"], postprocess: G("stable") },
            { name: "func_purity", symbols: ["word"], postprocess: G("volatile") },
            { name: "oninp$subexpression$1", symbols: ["word"], postprocess: G("input") },
            { name: "oninp", symbols: [o.lexerAny.has("kw_on") ? { type: "kw_on" } : kw_on, o.lexerAny.has("kw_null") ? { type: "kw_null" } : kw_null, "oninp$subexpression$1"] },
            { name: "func_returns", symbols: ["kw_returns", "data_type"], postprocess: B },
            { name: "func_returns$macrocall$2", symbols: ["func_ret_table_col"] },
            { name: "func_returns$macrocall$1$ebnf$1", symbols: [] },
            { name: "func_returns$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "func_returns$macrocall$2"], postprocess: B },
            { name: "func_returns$macrocall$1$ebnf$1", symbols: ["func_returns$macrocall$1$ebnf$1", "func_returns$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "func_returns$macrocall$1", symbols: ["func_returns$macrocall$2", "func_returns$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "func_returns", symbols: ["kw_returns", o.lexerAny.has("kw_table") ? { type: "kw_table" } : kw_table, "lparen", "func_returns$macrocall$1", "rparen"], postprocess: (c) => (0, g.track)(c, {
              kind: "table",
              columns: c[3]
            }) },
            { name: "func_ret_table_col", symbols: ["word", "data_type"], postprocess: (c) => (0, g.track)(c, { name: s(c[0]), type: c[1] }) },
            { name: "do_stm$ebnf$1$subexpression$1", symbols: ["kw_language", "word"], postprocess: B },
            { name: "do_stm$ebnf$1", symbols: ["do_stm$ebnf$1$subexpression$1"], postprocess: n },
            { name: "do_stm$ebnf$1", symbols: [], postprocess: () => null },
            { name: "do_stm", symbols: [o.lexerAny.has("kw_do") ? { type: "kw_do" } : kw_do, "do_stm$ebnf$1", o.lexerAny.has("codeblock") ? { type: "codeblock" } : codeblock], postprocess: (c) => (0, g.track)(c, {
              type: "do",
              ...c[1] && { language: s(c[1]) },
              code: c[2].value
            }) },
            { name: "drop_func$ebnf$1$subexpression$1", symbols: ["kw_if", "kw_exists"] },
            { name: "drop_func$ebnf$1", symbols: ["drop_func$ebnf$1$subexpression$1"], postprocess: n },
            { name: "drop_func$ebnf$1", symbols: [], postprocess: () => null },
            { name: "drop_func$ebnf$2", symbols: ["drop_func_overload"], postprocess: n },
            { name: "drop_func$ebnf$2", symbols: [], postprocess: () => null },
            { name: "drop_func", symbols: ["kw_drop", "kw_function", "drop_func$ebnf$1", "qname", "drop_func$ebnf$2"], postprocess: (c) => (0, g.track)(c, {
              type: "drop function",
              ...c[2] && { ifExists: !0 },
              name: c[3],
              ...c[4] && { arguments: c[4] }
            }) },
            { name: "drop_func_overload$macrocall$2", symbols: ["drop_func_overload_col"] },
            { name: "drop_func_overload$macrocall$1$ebnf$1", symbols: [] },
            { name: "drop_func_overload$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "drop_func_overload$macrocall$2"], postprocess: B },
            { name: "drop_func_overload$macrocall$1$ebnf$1", symbols: ["drop_func_overload$macrocall$1$ebnf$1", "drop_func_overload$macrocall$1$ebnf$1$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "drop_func_overload$macrocall$1", symbols: ["drop_func_overload$macrocall$2", "drop_func_overload$macrocall$1$ebnf$1"], postprocess: ([c, J]) => [a(c), ...J.map(a) || []] },
            { name: "drop_func_overload", symbols: ["lparen", "drop_func_overload$macrocall$1", "rparen"], postprocess: C(1) },
            { name: "drop_func_overload_col$ebnf$1", symbols: ["word"], postprocess: n },
            { name: "drop_func_overload_col$ebnf$1", symbols: [], postprocess: () => null },
            { name: "drop_func_overload_col", symbols: ["drop_func_overload_col$ebnf$1", "qname"], postprocess: (c) => (0, g.track)(c, {
              type: c[1],
              ...c[0] && { name: s(c[0]) }
            }) },
            { name: "main$ebnf$1", symbols: [] },
            { name: "main$ebnf$1", symbols: ["main$ebnf$1", "statement_separator"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "main$ebnf$2", symbols: [] },
            { name: "main$ebnf$2$subexpression$1$ebnf$1", symbols: ["statement_separator"] },
            { name: "main$ebnf$2$subexpression$1$ebnf$1", symbols: ["main$ebnf$2$subexpression$1$ebnf$1", "statement_separator"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "main$ebnf$2$subexpression$1", symbols: ["main$ebnf$2$subexpression$1$ebnf$1", "statement"] },
            { name: "main$ebnf$2", symbols: ["main$ebnf$2", "main$ebnf$2$subexpression$1"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "main$ebnf$3", symbols: [] },
            { name: "main$ebnf$3", symbols: ["main$ebnf$3", "statement_separator"], postprocess: (c) => c[0].concat([c[1]]) },
            { name: "main", symbols: ["main$ebnf$1", "statement", "main$ebnf$2", "main$ebnf$3"], postprocess: ([c, J, p]) => {
              const N = p, v = [a(J), ...N.map((K) => a(K[1]))];
              return v.length === 1 ? v[0] : v;
            } },
            { name: "statement_separator", symbols: [o.lexerAny.has("semicolon") ? { type: "semicolon" } : semicolon] },
            { name: "statement", symbols: ["statement_noprep"] },
            { name: "statement", symbols: ["prepare"] },
            { name: "statement", symbols: ["deallocate"] },
            { name: "statement_noprep", symbols: ["selection"] },
            { name: "statement_noprep", symbols: ["createtable_statement"] },
            { name: "statement_noprep", symbols: ["createextension_statement"] },
            { name: "statement_noprep", symbols: ["createindex_statement"] },
            { name: "statement_noprep", symbols: ["simplestatements_all"] },
            { name: "statement_noprep", symbols: ["insert_statement"] },
            { name: "statement_noprep", symbols: ["update_statement"] },
            { name: "statement_noprep", symbols: ["altertable_statement"] },
            { name: "statement_noprep", symbols: ["alterindex_statement"] },
            { name: "statement_noprep", symbols: ["delete_statement"] },
            { name: "statement_noprep", symbols: ["create_sequence_statement"] },
            { name: "statement_noprep", symbols: ["alter_sequence_statement"] },
            { name: "statement_noprep", symbols: ["drop_statement"] },
            { name: "statement_noprep", symbols: ["createtype_statement"] },
            { name: "statement_noprep", symbols: ["create_view_statements"] },
            { name: "statement_noprep", symbols: ["refresh_view_statements"] },
            { name: "statement_noprep", symbols: ["create_schema"] },
            { name: "statement_noprep", symbols: ["raise_statement"] },
            { name: "statement_noprep", symbols: ["comment_statement"] },
            { name: "statement_noprep", symbols: ["functions_statements"] },
            { name: "selection", symbols: ["select_statement"], postprocess: a },
            { name: "selection", symbols: ["select_values"], postprocess: a },
            { name: "selection", symbols: ["with_statement"], postprocess: a },
            { name: "selection", symbols: ["with_recursive_statement"], postprocess: a },
            { name: "selection", symbols: ["union_statement"], postprocess: a },
            { name: "selection_paren", symbols: ["lparen", "selection", "rparen"], postprocess: C(1) }
          ],
          ParserStart: "main"
        };
        t.default = Z;
      },
      /* 11 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(I) {
          return I[0];
        }
        const o = i(12), g = (I) => I && I[I.length - 1], s = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "main$ebnf$1", symbols: ["elements"], postprocess: n },
            { name: "main$ebnf$1", symbols: [], postprocess: () => null },
            { name: "main", symbols: [o.lexerAny.has("start_list") ? { type: "start_list" } : start_list, "main$ebnf$1", o.lexerAny.has("end_list") ? { type: "end_list" } : end_list], postprocess: (I) => I[1] || [] },
            { name: "elements$ebnf$1", symbols: [] },
            { name: "elements$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "elt"], postprocess: g },
            { name: "elements$ebnf$1", symbols: ["elements$ebnf$1", "elements$ebnf$1$subexpression$1"], postprocess: (I) => I[0].concat([I[1]]) },
            { name: "elements", symbols: ["elt", "elements$ebnf$1"], postprocess: ([I, r]) => [I, ...r || []] },
            { name: "elt", symbols: [o.lexerAny.has("value") ? { type: "value" } : value], postprocess: (I) => I[0].value },
            { name: "elt", symbols: ["main"], postprocess: (I) => I[0] }
          ],
          ParserStart: "main"
        };
        t.default = s;
      },
      /* 12 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.lexerAny = t.lexer = void 0;
        const n = i(0);
        t.lexer = (0, n.compile)({
          valueString: {
            match: /"(?:\\["\\]|[^\n"\\])*"/,
            value: (o) => JSON.parse(o),
            type: (o) => "value"
          },
          valueRaw: {
            match: /[^\s,\{\}"](?:[^,\{\}"]*[^\s,\{\}"])?/,
            type: () => "value"
          },
          comma: ",",
          space: { match: /[\s\t\n\v\f\r]+/, lineBreaks: !0 },
          start_list: "{",
          end_list: "}"
        }), t.lexer.next = ((o) => () => {
          let g;
          for (; (g = o.call(t.lexer)) && g.type === "space"; )
            ;
          return g;
        })(t.lexer.next), t.lexerAny = t.lexer;
      },
      /* 13 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(a) {
          return a[0];
        }
        const o = i(14), g = (a) => (C) => C[a], s = (a) => a && a[a.length - 1];
        function I(a) {
          return Array.isArray(a) && a.length === 1 && (a = I(a[0])), Array.isArray(a) && !a.length ? null : a;
        }
        const r = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "number$subexpression$1", symbols: ["float"] },
            { name: "number$subexpression$1", symbols: ["int"] },
            { name: "number", symbols: ["number$subexpression$1"], postprocess: I },
            { name: "float", symbols: [o.lexerAny.has("float") ? { type: "float" } : float], postprocess: (a) => parseFloat(I(a)) },
            { name: "int", symbols: [o.lexerAny.has("int") ? { type: "int" } : int], postprocess: (a) => parseInt(I(a), 10) },
            { name: "comma", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma], postprocess: n },
            { name: "point$macrocall$2", symbols: ["point_content"] },
            { name: "point$macrocall$1$subexpression$1", symbols: ["point$macrocall$2"] },
            { name: "point$macrocall$1$subexpression$1", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen, "point$macrocall$2", o.lexerAny.has("rparen") ? { type: "rparen" } : rparen], postprocess: g(1) },
            { name: "point$macrocall$1", symbols: ["point$macrocall$1$subexpression$1"], postprocess: I },
            { name: "point", symbols: ["point$macrocall$1"], postprocess: I },
            { name: "point_content", symbols: ["number", "comma", "number"], postprocess: (a) => ({ x: a[0], y: a[2] }) },
            { name: "line", symbols: [o.lexerAny.has("lcurl") ? { type: "lcurl" } : lcurl, "number", "comma", "number", "comma", "number", o.lexerAny.has("rcurl") ? { type: "rcurl" } : rcurl], postprocess: (a) => ({
              a: a[1],
              b: a[3],
              c: a[5]
            }) },
            { name: "box", symbols: ["closed_path"], postprocess: ([a], C) => a.length !== 2 ? C : a },
            { name: "lseg", symbols: ["path"], postprocess: ([a], C) => a.path.length !== 2 ? C : a.path },
            { name: "path", symbols: ["open_path"], postprocess: ([a]) => ({ closed: !1, path: a }) },
            { name: "path", symbols: ["closed_path"], postprocess: ([a]) => ({ closed: !0, path: a }) },
            { name: "open_path$macrocall$2", symbols: [o.lexerAny.has("lbracket") ? { type: "lbracket" } : lbracket] },
            { name: "open_path$macrocall$3", symbols: [o.lexerAny.has("rbracket") ? { type: "rbracket" } : rbracket] },
            { name: "open_path$macrocall$1$macrocall$2", symbols: ["point"] },
            { name: "open_path$macrocall$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "open_path$macrocall$1$macrocall$2"], postprocess: s },
            { name: "open_path$macrocall$1$macrocall$1$ebnf$1", symbols: ["open_path$macrocall$1$macrocall$1$ebnf$1", "open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (a) => a[0].concat([a[1]]) },
            { name: "open_path$macrocall$1$macrocall$1", symbols: ["open_path$macrocall$1$macrocall$2", "open_path$macrocall$1$macrocall$1$ebnf$1"], postprocess: ([a, C]) => [I(a), ...C.map(I) || []] },
            { name: "open_path$macrocall$1", symbols: ["open_path$macrocall$2", "open_path$macrocall$1$macrocall$1", "open_path$macrocall$3"], postprocess: g(1) },
            { name: "open_path", symbols: ["open_path$macrocall$1"], postprocess: s },
            { name: "closed_path$subexpression$1$macrocall$2", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen] },
            { name: "closed_path$subexpression$1$macrocall$3", symbols: [o.lexerAny.has("rparen") ? { type: "rparen" } : rparen] },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$2", symbols: ["point"] },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1", symbols: [] },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "closed_path$subexpression$1$macrocall$1$macrocall$2"], postprocess: s },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1", symbols: ["closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1", "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1"], postprocess: (a) => a[0].concat([a[1]]) },
            { name: "closed_path$subexpression$1$macrocall$1$macrocall$1", symbols: ["closed_path$subexpression$1$macrocall$1$macrocall$2", "closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1"], postprocess: ([a, C]) => [I(a), ...C.map(I) || []] },
            { name: "closed_path$subexpression$1$macrocall$1", symbols: ["closed_path$subexpression$1$macrocall$2", "closed_path$subexpression$1$macrocall$1$macrocall$1", "closed_path$subexpression$1$macrocall$3"], postprocess: g(1) },
            { name: "closed_path$subexpression$1", symbols: ["closed_path$subexpression$1$macrocall$1"], postprocess: s },
            { name: "closed_path$subexpression$1$macrocall$5", symbols: ["point"] },
            { name: "closed_path$subexpression$1$macrocall$4$ebnf$1", symbols: [] },
            { name: "closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("comma") ? { type: "comma" } : comma, "closed_path$subexpression$1$macrocall$5"], postprocess: s },
            { name: "closed_path$subexpression$1$macrocall$4$ebnf$1", symbols: ["closed_path$subexpression$1$macrocall$4$ebnf$1", "closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1"], postprocess: (a) => a[0].concat([a[1]]) },
            { name: "closed_path$subexpression$1$macrocall$4", symbols: ["closed_path$subexpression$1$macrocall$5", "closed_path$subexpression$1$macrocall$4$ebnf$1"], postprocess: ([a, C]) => [I(a), ...C.map(I) || []] },
            { name: "closed_path$subexpression$1", symbols: ["closed_path$subexpression$1$macrocall$4"], postprocess: s },
            { name: "closed_path", symbols: ["closed_path$subexpression$1"], postprocess: g(0) },
            { name: "polygon", symbols: ["closed_path"], postprocess: g(0) },
            { name: "circle_body", symbols: ["point", "comma", "number"], postprocess: (a) => ({ c: a[0], r: a[2] }) },
            { name: "circle$subexpression$1$macrocall$2", symbols: [o.lexerAny.has("lcomp") ? { type: "lcomp" } : lcomp] },
            { name: "circle$subexpression$1$macrocall$3", symbols: [o.lexerAny.has("rcomp") ? { type: "rcomp" } : rcomp] },
            { name: "circle$subexpression$1$macrocall$1", symbols: ["circle$subexpression$1$macrocall$2", "circle_body", "circle$subexpression$1$macrocall$3"], postprocess: g(1) },
            { name: "circle$subexpression$1", symbols: ["circle$subexpression$1$macrocall$1"] },
            { name: "circle$subexpression$1$macrocall$5", symbols: [o.lexerAny.has("lparen") ? { type: "lparen" } : lparen] },
            { name: "circle$subexpression$1$macrocall$6", symbols: [o.lexerAny.has("rparen") ? { type: "rparen" } : rparen] },
            { name: "circle$subexpression$1$macrocall$4", symbols: ["circle$subexpression$1$macrocall$5", "circle_body", "circle$subexpression$1$macrocall$6"], postprocess: g(1) },
            { name: "circle$subexpression$1", symbols: ["circle$subexpression$1$macrocall$4"] },
            { name: "circle$subexpression$1", symbols: ["circle_body"] },
            { name: "circle", symbols: ["circle$subexpression$1"], postprocess: I }
          ],
          ParserStart: "number"
        };
        t.default = r;
      },
      /* 14 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.lexerAny = t.lexer = void 0;
        const n = i(0);
        t.lexer = (0, n.compile)({
          comma: ",",
          space: { match: /[\s\t\n\v\f\r]+/, lineBreaks: !0 },
          int: /\-?\d+(?![\.\d])/,
          float: /\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,
          lcurl: "{",
          rcurl: "}",
          lparen: "(",
          rparen: ")",
          lbracket: "[",
          rbracket: "]",
          lcomp: "<",
          rcomp: ">"
        }), t.lexer.next = ((o) => () => {
          let g;
          for (; (g = o.call(t.lexer)) && g.type === "space"; )
            ;
          return g;
        })(t.lexer.next), t.lexerAny = t.lexer;
      },
      /* 15 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(s) {
          return s[0];
        }
        const o = i(16), g = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "main$ebnf$1", symbols: ["elt"] },
            { name: "main$ebnf$1", symbols: ["main$ebnf$1", "elt"], postprocess: (s) => s[0].concat([s[1]]) },
            { name: "main", symbols: ["main$ebnf$1"], postprocess: ([s]) => {
              const I = /* @__PURE__ */ new Set();
              for (const r of s) {
                const a = typeof r[1] == "number" ? r[0] : "time";
                if (I.has(a))
                  return "invalid";
                I.add(a);
              }
              return s;
            } },
            { name: "elt", symbols: ["time"] },
            { name: "elt", symbols: ["num", "unit"], postprocess: ([[s], I]) => (I = I[0].type, [I, s]) },
            { name: "unit", symbols: [o.lexerAny.has("years") ? { type: "years" } : years] },
            { name: "unit", symbols: [o.lexerAny.has("months") ? { type: "months" } : months] },
            { name: "unit", symbols: [o.lexerAny.has("days") ? { type: "days" } : days] },
            { name: "unit", symbols: [o.lexerAny.has("hours") ? { type: "hours" } : hours] },
            { name: "unit", symbols: [o.lexerAny.has("minutes") ? { type: "minutes" } : minutes] },
            { name: "unit", symbols: [o.lexerAny.has("seconds") ? { type: "seconds" } : seconds] },
            { name: "unit", symbols: [o.lexerAny.has("milliseconds") ? { type: "milliseconds" } : milliseconds] },
            { name: "num", symbols: ["int"] },
            { name: "num", symbols: ["float"] },
            { name: "uint", symbols: [o.lexerAny.has("int") ? { type: "int" } : int], postprocess: ([s]) => parseInt(s, 10) },
            { name: "int$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("neg") ? { type: "neg" } : neg] },
            { name: "int$ebnf$1", symbols: ["int$ebnf$1$subexpression$1"], postprocess: n },
            { name: "int$ebnf$1", symbols: [], postprocess: () => null },
            { name: "int", symbols: ["int$ebnf$1", o.lexerAny.has("int") ? { type: "int" } : int], postprocess: ([s, I]) => parseInt(I, 10) * (s ? -1 : 1) },
            { name: "float$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("neg") ? { type: "neg" } : neg] },
            { name: "float$ebnf$1", symbols: ["float$ebnf$1$subexpression$1"], postprocess: n },
            { name: "float$ebnf$1", symbols: [], postprocess: () => null },
            { name: "float$ebnf$2", symbols: [o.lexerAny.has("int") ? { type: "int" } : int], postprocess: n },
            { name: "float$ebnf$2", symbols: [], postprocess: () => null },
            { name: "float", symbols: ["float$ebnf$1", "float$ebnf$2", o.lexerAny.has("dot") ? { type: "dot" } : dot, o.lexerAny.has("int") ? { type: "int" } : int], postprocess: ([s, ...I]) => parseFloat(I.map((r) => r ? r.text : "0").join("")) * (s ? -1 : 1) },
            { name: "time$ebnf$1$subexpression$1", symbols: [o.lexerAny.has("colon") ? { type: "colon" } : colon, "uint"] },
            { name: "time$ebnf$1", symbols: ["time$ebnf$1$subexpression$1"], postprocess: n },
            { name: "time$ebnf$1", symbols: [], postprocess: () => null },
            { name: "time$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("dot") ? { type: "dot" } : dot, o.lexerAny.has("int") ? { type: "int" } : int] },
            { name: "time$ebnf$2", symbols: ["time$ebnf$2$subexpression$1"], postprocess: n },
            { name: "time$ebnf$2", symbols: [], postprocess: () => null },
            { name: "time", symbols: ["uint", o.lexerAny.has("colon") ? { type: "colon" } : colon, "uint", "time$ebnf$1", "time$ebnf$2"], postprocess: ([s, I, r, a, C]) => {
              a = a && a[1], C = C && C[1];
              const B = typeof a == "number" ? [
                ["hours", s],
                ["minutes", r],
                ["seconds", a]
              ] : [
                ["minutes", s],
                ["seconds", r]
              ];
              return C && B.push(["milliseconds", parseFloat("0." + C) * 1e3]), B;
            } }
          ],
          ParserStart: "main"
        };
        t.default = g;
      },
      /* 16 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.lexerAny = t.lexer = void 0;
        const n = i(0);
        t.lexer = (0, n.compile)({
          int: /\d+/,
          neg: "-",
          dot: ".",
          years: /(?:y|yrs?|years?)\b/,
          months: /(?:mon(?:th)?s?)\b/,
          days: /(?:d|days?)\b/,
          hours: /(?:h|hrs?|hours?)\b/,
          minutes: /(?:m|mins?|minutes?)\b/,
          seconds: /(?:s|secs?|seconds?)\b/,
          milliseconds: /(?:ms|milliseconds?)\b/,
          space: { match: /[\s\t\n\v\f\r]+/, lineBreaks: !0 },
          colon: ":"
        }), t.lexer.next = ((o) => () => {
          let g;
          for (; (g = o.call(t.lexer)) && g.type === "space"; )
            ;
          return g;
        })(t.lexer.next), t.lexerAny = t.lexer;
      },
      /* 17 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 });
        function n(s) {
          return s[0];
        }
        const o = i(18), g = {
          Lexer: o.lexerAny,
          ParserRules: [
            { name: "num", symbols: [o.lexerAny.has("int") ? { type: "int" } : int] },
            { name: "num", symbols: [o.lexerAny.has("float") ? { type: "float" } : float] },
            { name: "main$ebnf$1", symbols: [] },
            { name: "main$ebnf$1", symbols: ["main$ebnf$1", "long"], postprocess: (s) => s[0].concat([s[1]]) },
            { name: "main$ebnf$2$subexpression$1$ebnf$1", symbols: ["short"] },
            { name: "main$ebnf$2$subexpression$1$ebnf$1", symbols: ["main$ebnf$2$subexpression$1$ebnf$1", "short"], postprocess: (s) => s[0].concat([s[1]]) },
            { name: "main$ebnf$2$subexpression$1", symbols: [o.lexerAny.has("T") ? { type: "T" } : T, "main$ebnf$2$subexpression$1$ebnf$1"] },
            { name: "main$ebnf$2", symbols: ["main$ebnf$2$subexpression$1"], postprocess: n },
            { name: "main$ebnf$2", symbols: [], postprocess: () => null },
            { name: "main", symbols: [o.lexerAny.has("P") ? { type: "P" } : P, "main$ebnf$1", "main$ebnf$2"], postprocess: ([s, I, r], a) => (r = r ? r[1] : [], !I.length && !r.length ? a : I.length ? r.length ? [...I, ...r] : I : r) },
            { name: "long$subexpression$1", symbols: [o.lexerAny.has("Y") ? { type: "Y" } : Y] },
            { name: "long$subexpression$1", symbols: [o.lexerAny.has("M") ? { type: "M" } : M] },
            { name: "long$subexpression$1", symbols: [o.lexerAny.has("W") ? { type: "W" } : W] },
            { name: "long$subexpression$1", symbols: [o.lexerAny.has("D") ? { type: "D" } : D] },
            { name: "long", symbols: ["num", "long$subexpression$1"], postprocess: ([s, I]) => {
              switch (s = parseFloat(s[0].value), I = I[0].type, I) {
                case "Y":
                  return ["years", s];
                case "M":
                  return ["months", s];
                case "W":
                  return ["days", s * 7];
                case "D":
                  return ["days", s];
                default:
                  throw new Error("Unexpected unit " + I);
              }
            } },
            { name: "short$ebnf$1", symbols: [o.lexerAny.has("T") ? { type: "T" } : T], postprocess: n },
            { name: "short$ebnf$1", symbols: [], postprocess: () => null },
            { name: "short$subexpression$1", symbols: [o.lexerAny.has("H") ? { type: "H" } : H] },
            { name: "short$subexpression$1", symbols: [o.lexerAny.has("M") ? { type: "M" } : M] },
            { name: "short$subexpression$1", symbols: [o.lexerAny.has("S") ? { type: "S" } : S] },
            { name: "short", symbols: ["short$ebnf$1", "num", "short$subexpression$1"], postprocess: ([s, I, r]) => {
              switch (I = parseFloat(I[0].value), r = r[0].type, r) {
                case "H":
                  return ["hours", I];
                case "M":
                  return ["minutes", I];
                case "S":
                  return ["seconds", I];
                default:
                  throw new Error("Unexpected unit " + r);
              }
            } }
          ],
          ParserStart: "num"
        };
        t.default = g;
      },
      /* 18 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.lexerAny = t.lexer = void 0;
        const n = i(0);
        t.lexer = (0, n.compile)({
          int: /\-?\d+(?![\.\d])/,
          float: /\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,
          P: "P",
          Y: "Y",
          M: "M",
          W: "W",
          D: "D",
          H: "H",
          S: "S",
          T: "T"
        }), t.lexerAny = t.lexer;
      },
      /* 19 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.toSql = void 0;
        const n = i(2), o = i(5), g = i(6), s = i(20), I = i(3), r = new Set(I.sqlKeywords.map((J) => J.toLowerCase()));
        let a = [];
        function C(J) {
          return B(J.name);
        }
        function B(J, p) {
          if (!p) {
            const N = J.toLowerCase();
            if (N === J && !r.has(N) && /^[a-z][a-z0-9_]*$/.test(N))
              return J;
          }
          return '"' + J + '"';
        }
        function l(J, p, N) {
          N && a.push("(");
          let v = !0;
          for (const K of J)
            v || a.push(", "), v = !1, p(K);
          N && a.push(")");
        }
        function Q(J, p) {
          switch (J.type) {
            case "foreign key":
              a.push(" foreign key (", ...J.localColumns.map(C).join(", "), ")");
            case "reference":
              a.push(" REFERENCES "), p.tableRef(J.foreignTable), a.push("(", ...J.foreignColumns.map(C).join(", "), ") "), J.match && a.push(" MATCH ", J.match.toUpperCase()), J.onDelete && a.push(" ON DELETE ", J.onDelete), J.onUpdate && a.push(" ON UPDATE ", J.onUpdate);
              break;
            case "primary key":
            case "unique":
              a.push(" ", J.type, " "), "columns" in J && a.push("(", ...J.columns.map(C).join(", "), ") ");
              break;
            case "check":
              a.push(" check "), p.expr(J.expr);
              break;
            case "not null":
            case "null":
              a.push(" ", J.type, " ");
              break;
            case "default":
              a.push(" default "), p.expr(J.default);
              break;
            case "add generated":
              a.push(" GENERATED "), f(p, J);
              break;
            default:
              throw g.NotSupported.never(J);
          }
          a.push(" ");
        }
        function E(J, p) {
          J.schema && a.push(B(J.schema), "."), a.push(B(J.name, p), " ");
        }
        function d(J) {
          E(J), J.alias && a.push(" AS ", B(J.alias), " ");
        }
        function m(J, p) {
          a.push(" ORDER BY "), l(p, (N) => {
            J.expr(N.by), N.order && a.push(" ", N.order, " "), N.nulls && a.push(" NULLS ", N.nulls, " ");
          }, !1);
        }
        function y(J) {
          switch (J.type) {
            case "default":
              a.push("DEFAULT ");
              break;
            case "identifier":
              a.push(J.name);
              break;
            case "list":
              let p = !0;
              for (const N of J.values)
                p || a.push(", "), p = !1, y(N);
              break;
            case "value":
              a.push(typeof J.value == "number" ? J.value.toString() : (0, s.literal)(J.value));
              break;
            default:
              throw g.NotSupported.never(J);
          }
        }
        function f(J, p) {
          p.always && a.push(p.always.toUpperCase(), " "), a.push("AS IDENTITY "), p.sequence && (a.push("("), p.sequence.name && (a.push("SEQUENCE NAME "), E(p.sequence.name), a.push(" ")), w(J, p.sequence), a.push(") "));
        }
        function w(J, p) {
          p.as && (a.push("AS "), J.dataType(p.as), a.push(" ")), typeof p.incrementBy == "number" && a.push("INCREMENT BY ", p.incrementBy.toString(), " "), p.minValue === "no minvalue" && a.push("NO MINVALUE "), typeof p.minValue == "number" && a.push("MINVALUE ", p.minValue.toString(), " "), p.maxValue === "no maxvalue" && a.push("NO MAXVALUE "), typeof p.maxValue == "number" && a.push("MAXVALUE ", p.maxValue.toString(), " "), typeof p.startWith == "number" && a.push("START WITH ", p.startWith.toString(), " "), typeof p.cache == "number" && a.push("CACHE ", p.cache.toString(), " "), p.cycle && a.push(p.cycle, " "), p.ownedBy === "none" ? a.push("OWNED BY NONE ") : p.ownedBy && (a.push("OWNED BY "), G(p.ownedBy)), "restart" in p && (p.restart === !0 ? a.push("RESTART ") : p.restart && a.push("RESTART WITH ", p.restart.toString(), " "));
        }
        function G(J) {
          J.schema && a.push(B(J.schema), "."), a.push(B(J.table), ".", B(J.column), " ");
        }
        function R(J, p, N) {
          if (!p) {
            N();
            return;
          }
          a.push(p.type, " "), N(), p.on && (a.push("ON "), J.expr(p.on)), p.using && (a.push("USING ("), l(p.using, (v) => a.push(C(v)), !1), a.push(") ")), a.push(" ");
        }
        function F(J) {
          J.opSchema ? a.push(" operator(", B(J.opSchema), ".", J.op, ") ") : a.push(" ", J.op, " ");
        }
        const Z = (0, o.astVisitor)((J) => ({
          addColumn: (...p) => {
            a.push(" ADD COLUMN "), p[0].ifNotExists && a.push("IF NOT EXISTS "), J.super().addColumn(...p);
          },
          createExtension: (p) => {
            a.push("CREATE EXTENSION "), p.ifNotExists && a.push(" IF NOT EXISTS "), a.push(C(p.extension)), !(!p.from && !p.version && !p.schema) && (a.push(" WITH"), p.schema && a.push(" SCHEMA ", C(p.schema)), p.version && a.push(" VERSION ", (0, s.literal)(p.version.value)), p.from && a.push(" FROM ", (0, s.literal)(p.from.value)));
          },
          tablespace: (p) => {
            a.push("TABLESPACE ", C(p.tablespace));
          },
          addConstraint: (p) => {
            a.push(" ADD ");
            const N = p.constraint.constraintName;
            N && a.push(" CONSTRAINT ", C(N), " "), Q(p.constraint, J);
          },
          alterColumn: (p, N) => {
            a.push(" ALTER COLUMN ", C(p.column), " "), J.super().alterColumn(p, N);
          },
          setColumnDefault: (p, N, v) => {
            if (a.push(" SET DEFAULT "), J.expr(p.default), p.updateExisting)
              throw new Error("Not implemented: updateExisting on set column default");
          },
          createEnum: (p) => {
            a.push("CREATE TYPE "), E(p.name), a.push(" AS ENUM "), l(p.values, (N) => a.push((0, s.literal)(N.value)), !0), a.push(" ");
          },
          createCompositeType: (p) => {
            a.push("CREATE TYPE "), E(p.name), a.push(" AS "), l(p.attributes, (N) => {
              a.push(C(N.name), " "), J.dataType(N.dataType), N.collate && (a.push("COLLATE "), E(N.collate));
            }, !0), a.push(" ");
          },
          setTableOwner: (p) => {
            a.push(" OWNER TO ", C(p.to));
          },
          alterColumnSimple: (p) => a.push(p.type),
          alterColumnAddGenerated: (p) => {
            a.push(" ADD GENERATED "), f(J, p);
          },
          setColumnType: (p) => {
            a.push(" SET DATA TYPE "), J.dataType(p.dataType), a.push(" ");
          },
          alterTable: (p) => {
            a.push("ALTER TABLE "), p.ifExists && a.push(" IF EXISTS "), p.only && a.push(" ONLY "), d(p.table), l(p.changes, (N) => J.tableAlteration(N, p.table), !1);
          },
          alterIndex: (p) => {
            switch (a.push("ALTER INDEX "), p.ifExists && a.push(" IF EXISTS "), d(p.index), p.change.type) {
              case "rename":
                a.push(" RENAME TO "), E(p.change.to), a.push(" ");
                break;
              case "set tablespace":
                a.push(" SET TABLESPACE "), E(p.change.tablespace), a.push(" ");
                break;
              default:
                throw g.NotSupported.never(p.change, "Alter index type not supported: ");
            }
          },
          tableAlteration: (p, N) => {
            switch (p.type) {
              case "add column":
                return J.addColumn(p, N);
              case "add constraint":
                return J.addConstraint(p, N);
              case "alter column":
                return J.alterColumn(p, N);
              case "rename":
                return J.renameTable(p, N);
              case "rename column":
                return J.renameColumn(p, N);
              case "rename constraint":
                return J.renameConstraint(p, N);
              case "drop column":
                return J.dropColumn(p, N);
              case "drop constraint":
                return J.dropConstraint(p, N);
              case "owner":
                return J.setTableOwner(p, N);
              default:
                throw g.NotSupported.never(p);
            }
          },
          array: (p) => {
            a.push(p.type === "array" ? "ARRAY[" : "("), l(p.expressions, (N) => J.expr(N), !1), a.push(p.type === "array" ? "]" : ")");
          },
          arrayIndex: (p) => {
            J.expr(p.array), a.push("["), J.expr(p.index), a.push("] ");
          },
          expr: (p) => {
            if (p.type === "ref") {
              J.ref(p);
              return;
            }
            if (p.type === "list") {
              J.super().expr(p);
              return;
            }
            a.push("("), J.super().expr(p), a.push(")");
          },
          callOverlay: (p) => {
            a.push("OVERLAY("), J.expr(p.value), a.push(" PLACING "), J.expr(p.placing), a.push(" FROM "), J.expr(p.from), p.for && (a.push(" FOR "), J.expr(p.for)), a.push(")");
          },
          callSubstring: (p) => {
            a.push("SUBSTRING("), J.expr(p.value), p.from && (a.push(" FROM "), J.expr(p.from)), p.for && (a.push(" FOR "), J.expr(p.for)), a.push(")");
          },
          binary: (p) => {
            J.expr(p.left), F(p), J.expr(p.right);
          },
          call: (p) => {
            E(p.function), a.push("("), p.distinct && a.push(p.distinct, " "), l(p.args, (N) => J.expr(N), !1), p.orderBy && m(J, p.orderBy), a.push(") "), p.filter && (a.push("filter (where "), J.expr(p.filter), a.push(") ")), p.over && (a.push("over ("), p.over.partitionBy && (a.push("PARTITION BY "), l(p.over.partitionBy, (N) => J.expr(N), !1), a.push(" ")), p.over.orderBy && (m(J, p.over.orderBy), a.push(" ")), a.push(") "));
          },
          case: (p) => {
            a.push("CASE "), p.value && J.expr(p.value);
            for (const N of p.whens)
              a.push(" WHEN "), J.expr(N.when), a.push(" THEN "), J.expr(N.value);
            p.else && (a.push(" ELSE "), J.expr(p.else)), a.push(" END ");
          },
          cast: (p) => {
            J.expr(p.operand), a.push("::"), J.dataType(p.to);
          },
          constant: (p) => {
            switch (p.type) {
              case "boolean":
                a.push(p.value ? "true" : "false");
                break;
              case "integer":
                a.push(p.value.toString(10));
                break;
              case "numeric":
                a.push(p.value.toString()), Number.isInteger(p.value) && a.push(".");
                break;
              case "null":
                a.push("null");
                break;
              case "constant":
                break;
              case "string":
                a.push((0, s.literal)(p.value));
                break;
              default:
                throw g.NotSupported.never(p);
            }
          },
          valueKeyword: (p) => {
            a.push(p.keyword, " ");
          },
          comment: (p) => {
            switch (a.push("COMMENT ON ", p.on.type.toUpperCase(), " "), p.on.type) {
              case "column":
                G(p.on.column);
                break;
              default:
                E(p.on.name);
                break;
            }
            a.push(" IS ", (0, s.literal)(p.comment), " ");
          },
          extract: (p) => {
            a.push("EXTRACT (", p.field.name.toUpperCase(), " FROM "), J.expr(p.from), a.push(") ");
          },
          createColumn: (p) => {
            var N;
            a.push(C(p.name), " "), J.dataType(p.dataType), a.push(" "), p.collate && (a.push("COLLATE "), E(p.collate));
            for (const v of (N = p.constraints) !== null && N !== void 0 ? N : [])
              J.constraint(v);
          },
          begin: (p) => {
            a.push("BEGIN "), p.isolationLevel && a.push("ISOLATION LEVEL ", p.isolationLevel.toUpperCase(), " "), p.writeable && a.push(p.writeable.toUpperCase(), " "), typeof p.deferrable == "boolean" && (p.deferrable || a.push("NOT "), a.push("DEFERRABLE "));
          },
          alterSequence: (p) => {
            switch (a.push("ALTER SEQUENCE "), p.ifExists && a.push("IF EXISTS "), E(p.name), p.change.type) {
              case "set options":
                w(J, p.change);
                break;
              case "rename":
                a.push("RENAME TO ", C(p.change.newName), " ");
                break;
              case "set schema":
                a.push("SET SCHEMA ", C(p.change.newSchema), " ");
                break;
              case "owner to":
                p.change.owner, a.push("OWNER TO ", C(p.change.owner), " ");
                break;
              default:
                throw g.NotSupported.never(p.change);
            }
          },
          createSequence: (p) => {
            a.push("CREATE "), p.temp && a.push("TEMPORARY "), a.push("SEQUENCE "), p.ifNotExists && a.push("IF NOT EXISTS "), E(p.name), w(J, p.options);
          },
          drop: (p) => {
            a.push(p.type.toUpperCase(), " "), p.concurrently && a.push("CONCURRENTLY "), p.ifExists && a.push("IF EXISTS "), l(p.names, (N) => J.tableRef(N), !1), p.cascade && a.push(p.cascade.toUpperCase(), " ");
          },
          constraint: (p) => {
            p.constraintName && a.push(" CONSTRAINT ", C(p.constraintName), " "), Q(p, J);
          },
          do: (p) => {
            a.push("DO"), p.language && a.push(" LANGUAGE ", p.language.name), a.push(" $$", p.code, "$$");
          },
          createFunction: (p) => {
            var N;
            if (a.push(p.orReplace ? "CREATE OR REPLACE FUNCTION " : "CREATE FUNCTION "), E(p.name), l(p.arguments, (v) => {
              v.mode && a.push(v.mode, " "), v.name && a.push(C(v.name), " "), J.dataType(v.type), v.default && (a.push(" = "), J.expr(v.default));
            }, !0), p.returns)
              switch (p.returns.kind) {
                case "table":
                  a.push(" RETURNS TABLE "), l(p.returns.columns, (v) => {
                    a.push(C(v.name), " "), J.dataType(v.type);
                  }, !0);
                  break;
                case void 0:
                case null:
                case "array":
                  a.push(" RETURNS "), J.dataType(p.returns);
                  break;
                default:
                  throw g.NotSupported.never(p.returns);
              }
            switch (a.push(" AS $$", (N = p.code) !== null && N !== void 0 ? N : "", "$$"), p.language && a.push("LANGUAGE ", p.language.name, " "), p.purity && a.push(p.purity.toUpperCase(), " "), typeof p.leakproof == "boolean" && a.push(p.leakproof ? "LEAKPROOF " : "NOT LEAKPROOF "), p.onNullInput) {
              case "call":
                a.push("CALLED ON NULL INPUT ");
                break;
              case "null":
                a.push("RETURNS NULL ON NULL INPUT ");
                break;
              case "strict":
                a.push("STRICT ");
                break;
              case null:
              case void 0:
                break;
              default:
                throw g.NotSupported.never(p.onNullInput);
            }
          },
          dropFunction: (p) => {
            a.push("DROP FUNCTION "), p.ifExists && a.push("IF EXISTS "), E(p.name), p.arguments && l(p.arguments, (N) => {
              N.name && (E(N.name), a.push(" ")), J.dataType(N.type);
            }, !0), a.push(" ");
          },
          with: (p) => {
            a.push("WITH "), l(p.bind, (N) => {
              a.push(C(N.alias), " AS ("), J.statement(N.statement), a.push(") ");
            }, !1), J.statement(p.in);
          },
          withRecursive: (p) => {
            a.push("WITH RECURSIVE ", C(p.alias), "(", ...p.columnNames.map(C).join(", "), ") AS ("), J.union(p.bind), a.push(") "), J.statement(p.in);
          },
          setGlobal: (p) => {
            a.push("SET ", C(p.variable), " = "), y(p.set);
          },
          setTimezone: (p) => {
            switch (a.push("SET TIME ZONE "), p.to.type) {
              case "default":
              case "local":
                a.push(p.to.type.toUpperCase(), " ");
                break;
              case "value":
                a.push(typeof p.to.value == "string" ? (0, s.literal)(p.to.value) : p.to.value.toString(10));
                break;
              case "interval":
                a.push("INTERVAL ", (0, s.literal)(p.to.value), " HOUR TO MINUTE");
                break;
              default:
                throw g.NotSupported.never(p.to);
            }
          },
          dataType: (p) => {
            var N, v;
            if ((p == null ? void 0 : p.kind) === "array") {
              J.dataType(p.arrayOf), a.push("[]");
              return;
            }
            if (!(p != null && p.name)) {
              a.push("unkown");
              return;
            }
            let K = !0;
            if (p.schema)
              E(p, p.doubleQuoted);
            else if (p.doubleQuoted)
              E(p, !0);
            else
              switch (p.name) {
                case "double precision":
                case "character varying":
                case "bit varying":
                  a.push(p.name, " ");
                  break;
                case "time without time zone":
                case "timestamp without time zone":
                case "time with time zone":
                case "timestamp with time zone":
                  const U = p.name.split(" ");
                  a.push(U.shift()), !((N = p.config) === null || N === void 0) && N.length && l(p.config, (j) => a.push(j.toString(10)), !0), a.push(" "), a.push(U.join(" "), " "), K = !1;
                  break;
                default:
                  E(p);
                  break;
              }
            K && (!((v = p.config) === null || v === void 0) && v.length) && l(p.config, (U) => a.push(U.toString(10)), !0);
          },
          createIndex: (p) => {
            a.push(p.unique ? "CREATE UNIQUE INDEX " : "CREATE INDEX "), p.ifNotExists && a.push(" IF NOT EXISTS "), p.indexName && a.push(C(p.indexName), " "), a.push("ON "), J.tableRef(p.table), p.using && a.push("USING ", C(p.using), " "), l(p.expressions, (N) => {
              J.expr(N.expression), a.push(" "), N.collate && (a.push("COLLATE "), E(N.collate)), N.opclass && E(N.opclass), N.order && a.push(N.order, " "), N.nulls && a.push("nulls ", N.nulls, " ");
            }, !0), p.with && (a.push("WITH "), l(p.with, (N) => {
              a.push(N.parameter, " = ", (0, s.literal)(N.value));
            }, !0)), p.tablespace && a.push("TABLESPACE ", B(p.tablespace)), p.where && (a.push(" WHERE "), J.expr(p.where)), a.push(" ");
          },
          createTable: (p) => {
            var N;
            a.push("CREATE "), p.locality && a.push(p.locality.toUpperCase(), " "), p.temporary && a.push("TEMPORARY "), p.unlogged && a.push("UNLOGGED "), a.push(p.ifNotExists ? "TABLE IF NOT EXISTS " : "TABLE "), J.tableRef(p.name), a.push("("), l(p.columns, (v) => {
              switch (v.kind) {
                case "column":
                  return J.createColumn(v);
                case "like table":
                  return J.likeTable(v);
                default:
                  throw g.NotSupported.never(v);
              }
            }, !1), p.constraints && (a.push(", "), l(p.constraints, (v) => {
              const K = v.constraintName;
              K && a.push("CONSTRAINT ", C(K), " "), Q(v, J);
            }, !1)), a.push(") "), !((N = p.inherits) === null || N === void 0) && N.length && (a.push(" INHERITS "), l(p.inherits, (v) => E(v), !0));
          },
          likeTable: (p) => {
            a.push(" LIKE "), J.tableRef(p.like), a.push(" ");
            for (const { verb: N, option: v } of p.options)
              a.push(N.toUpperCase(), " ", v.toUpperCase(), " ");
          },
          createSchema: (p) => {
            a.push(p.ifNotExists ? "CREATE SCHEMA IF NOT EXISTS " : "CREATE SCHEMA "), a.push(C(p.name));
          },
          truncateTable: (p) => {
            a.push("TRUNCATE TABLE ");
            let N = !0;
            for (const v of p.tables)
              N || a.push(", "), N = !1, J.tableRef(v);
            if (p.identity)
              switch (p.identity) {
                case "restart":
                  a.push(" RESTART IDENTITY ");
                  break;
                case "continue":
                  a.push(" CONTINUE IDENTITY ");
                  break;
              }
            p.cascade && a.push(" ", p.cascade, " ");
          },
          delete: (p) => {
            a.push("DELETE FROM "), J.tableRef(p.from), p.where && (a.push(" WHERE "), J.expr(p.where)), p.returning && (a.push(" RETURNING "), l(p.returning, (N) => J.selectionColumn(N), !1)), a.push(" ");
          },
          dropColumn: (p) => {
            a.push(" DROP COLUMN "), p.ifExists && a.push(" IF EXISTS "), a.push(C(p.column)), p.behaviour && a.push(" ", p.behaviour), a.push(" ");
          },
          dropConstraint: (p) => {
            a.push(" DROP CONSTRAINT "), p.ifExists && a.push(" IF EXISTS "), a.push(C(p.constraint)), p.behaviour && a.push(" ", p.behaviour.toUpperCase(), " ");
          },
          from: (p) => J.super().from(p),
          fromCall: (p) => {
            R(J, p.join, () => {
              var N, v;
              if (J.call(p), p.withOrdinality && a.push(" WITH ORDINALITY"), p.alias) {
                a.push(" AS ", C(p.alias), " ");
                const K = (v = (N = p.alias.columns) === null || N === void 0 ? void 0 : N.length) !== null && v !== void 0 ? v : 0;
                if (K > 0) {
                  a.push("(");
                  for (let U = 0; U < K; ++U)
                    U !== 0 && a.push(", "), a.push(C(p.alias.columns[U]));
                  a.push(")");
                }
              }
            }), a.push(" ");
          },
          fromStatement: (p) => {
            R(J, p.join, () => {
              a.push("("), J.select(p.statement), a.push(") "), p.alias && (a.push(" AS ", B(p.alias)), p.columnNames && l(p.columnNames, (N) => a.push(C(N)), !0), a.push(" "));
            }), a.push(" ");
          },
          values: (p) => {
            a.push("VALUES "), l(p.values, (N) => {
              l(N, (v) => {
                J.expr(v);
              }, !0);
            }, !1);
          },
          fromTable: (p) => {
            R(J, p.join, () => {
              if (J.tableRef(p.name), p.name.columnNames) {
                if (!p.name.alias)
                  throw new Error("Cannot specify aliased column names without an alias");
                l(p.name.columnNames, (N) => a.push(C(N)), !0);
              }
            });
          },
          join: (p) => {
            throw new Error("Should not happen 💀");
          },
          insert: (p) => {
            if (a.push("INSERT INTO "), J.tableRef(p.into), p.columns && a.push("(", p.columns.map(C).join(", "), ")"), a.push(" "), p.overriding && a.push("OVERRIDING ", p.overriding.toUpperCase(), " VALUE "), J.select(p.insert), a.push(" "), p.onConflict) {
              a.push("ON CONFLICT ");
              const N = p.onConflict.on;
              switch (N == null ? void 0 : N.type) {
                case "on expr":
                  l(N.exprs, (v) => J.expr(v), !0);
                  break;
                case "on constraint":
                  a.push("ON CONSTRAINT "), E(N.constraint);
                case null:
                case void 0:
                  break;
                default:
                  throw g.NotSupported.never(N);
              }
              p.onConflict.do === "do nothing" ? a.push(" DO NOTHING") : (a.push(" DO UPDATE SET "), l(p.onConflict.do.sets, (v) => J.set(v), !1), p.onConflict.where && (a.push(" WHERE "), J.expr(p.onConflict.where))), a.push(" ");
            }
            p.returning && (a.push(" RETURNING "), l(p.returning, (N) => J.selectionColumn(N), !1));
          },
          raise: (p) => {
            var N, v;
            a.push("RAISE "), p.level && a.push(p.level.toUpperCase(), " "), a.push((0, s.literal)(p.format), " "), !((N = p.formatExprs) === null || N === void 0) && N.length && (a.push(", "), l(p.formatExprs, (K) => J.expr(K), !1)), !((v = p.using) === null || v === void 0) && v.length && (a.push(" USING "), l(p.using, ({ type: K, value: U }) => {
              a.push(K.toUpperCase(), "="), J.expr(U);
            }, !1)), a.push(" ");
          },
          default: () => {
            a.push(" DEFAULT ");
          },
          member: (p) => {
            J.expr(p.operand), a.push(p.op), a.push(typeof p.member == "number" ? p.member.toString(10) : (0, s.literal)(p.member));
          },
          ref: (p) => {
            p.table && (E(p.table), a.push(".")), a.push(p.name === "*" ? "*" : B(p.name));
          },
          parameter: (p) => {
            a.push(p.name);
          },
          renameColumn: (p) => {
            a.push(" RENAME COLUMN ", C(p.column), " TO ", C(p.to));
          },
          renameConstraint: (p) => {
            a.push(" RENAME CONSTRAINT ", C(p.constraint), " TO ", C(p.to));
          },
          renameTable: (p) => {
            a.push(" RENAME TO ", C(p.to));
          },
          createView: (p) => {
            a.push("CREATE "), p.orReplace && a.push("OR REPLACE "), p.temp && a.push("TEMP "), p.recursive && a.push("RECURSIVE "), a.push("VIEW "), J.tableRef(p.name), p.columnNames && l(p.columnNames, (v) => a.push(C(v)), !0);
            const N = p.parameters && Object.entries(p.parameters);
            N != null && N.length && (a.push(" WITH "), l(N, ([v, K]) => a.push(v, "=", K), !1)), a.push(" AS "), J.select(p.query), p.checkOption && a.push(" WITH ", p.checkOption.toUpperCase(), " CHECK OPTION");
          },
          createMaterializedView: (p) => {
            a.push("CREATE MATERIALIZED VIEW "), p.ifNotExists && a.push("IF NOT EXISTS "), J.tableRef(p.name), p.columnNames && l(p.columnNames, (v) => a.push(C(v)), !0);
            const N = p.parameters && Object.entries(p.parameters);
            N != null && N.length && (a.push(" WITH "), l(N, ([v, K]) => a.push(v, "=", K), !1)), p.tablespace && a.push(" TABLESPACE ", C(p.tablespace)), a.push(" AS "), J.select(p.query), typeof p.withData == "boolean" && a.push(p.withData ? " WITH DATA" : " WITH NO DATA");
          },
          refreshMaterializedView: (p) => {
            a.push("REFRESH MATERIALIZED VIEW "), p.concurrently && a.push("CONCURRENTLY "), J.tableRef(p.name), typeof p.withData == "boolean" && a.push(p.withData ? " WITH DATA" : " WITH NO DATA");
          },
          select: (p) => J.super().select(p),
          selection: (p) => {
            if (a.push("SELECT "), p.distinct && (typeof p.distinct == "string" ? a.push(p.distinct.toUpperCase()) : (a.push(" DISTINCT ON "), l(p.distinct, (N) => J.expr(N), !0)), a.push(" ")), p.columns && l(p.columns, (N) => J.selectionColumn(N), !1), a.push(" "), p.from) {
              a.push("FROM ");
              const N = p.from.length;
              for (let v = 0; v < N; v++) {
                const K = p.from[v];
                v > 0 && !K.join && a.push(","), J.from(K);
              }
              a.push(" ");
            }
            p.where && (a.push("WHERE "), J.expr(p.where), a.push(" ")), p.groupBy && (a.push("GROUP BY "), l(p.groupBy, (N) => J.expr(N), !1), a.push(" "), p.having && (a.push(" HAVING "), J.expr(p.having), a.push(" "))), p.orderBy && (m(J, p.orderBy), a.push(" ")), p.limit && (p.limit.offset && (a.push("OFFSET "), J.expr(p.limit.offset)), p.limit.limit && (a.push("LIMIT "), J.expr(p.limit.limit))), p.for && (a.push("FOR ", p.for.type.toUpperCase()), p.skip && a.push(" ", p.skip.type.toUpperCase()));
          },
          show: (p) => {
            a.push("SHOW ", C(p.variable));
          },
          prepare: (p) => {
            var N;
            a.push("PREPARE ", C(p.name)), !((N = p.args) === null || N === void 0) && N.length && l(p.args, (v) => J.dataType(v), !0), a.push(" AS "), J.statement(p.statement);
          },
          deallocate: (p) => {
            if (a.push("DEALLOCATE "), "name" in p.target) {
              a.push(p.target.name);
              return;
            }
            a.push("ALL");
          },
          arraySelect: (p) => {
            a.push("array("), J.select(p.select), a.push(")");
          },
          union: (p) => {
            a.push("("), J.statement(p.left), a.push(") ", p.type.toUpperCase(), " "), p.right.type === "union" || p.right.type === "union all" ? J.union(p.right) : (a.push("("), J.statement(p.right), a.push(")"));
          },
          selectionColumn: (p) => {
            J.expr(p.expr), p.alias && a.push(" AS ", C(p.alias)), a.push(" ");
          },
          set: (p) => {
            a.push(C(p.column), " = "), J.expr(p.value), a.push(" ");
          },
          statement: (p) => J.super().statement(p),
          tableRef: (p) => {
            E(p), p.alias && a.push(" AS ", B(p.alias)), a.push(" ");
          },
          ternary: (p) => {
            J.expr(p.value), a.push(" ", p.op, " "), J.expr(p.lo), a.push(" AND "), J.expr(p.hi), a.push(" ");
          },
          transaction: (p) => {
            a.push(p.type);
          },
          unary: (p) => {
            switch (p.op) {
              case "+":
              case "-":
                F(p), J.expr(p.operand);
                break;
              case "NOT":
                a.push(p.op), a.push(" "), J.expr(p.operand);
                break;
              default:
                J.expr(p.operand), a.push(" "), a.push(p.op);
            }
          },
          update: (p) => {
            a.push("UPDATE "), J.tableRef(p.table), a.push(" SET "), l(p.sets, (N) => J.set(N), !1), a.push(" "), p.from && (a.push("FROM "), J.from(p.from), a.push(" ")), p.where && (a.push("WHERE "), J.expr(p.where), a.push(" ")), p.returning && (a.push(" RETURNING "), l(p.returning, (N) => J.selectionColumn(N), !1), a.push(" "));
          }
        }));
        t.toSql = {};
        const c = n.AstDefaultMapper.prototype;
        for (const J of Object.getOwnPropertyNames(c)) {
          const p = c[J];
          J === "constructor" || J === "super" || typeof p != "function" || (t.toSql[J] = function(...N) {
            try {
              return Z[J].apply(Z, N), a.join("").trim();
            } finally {
              a = [];
            }
          });
        }
      },
      /* 20 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.literal = void 0;
        function n(o) {
          if (o == null)
            return "NULL";
          if (Array.isArray(o)) {
            var g = o.map(n);
            return "(" + g.join(", ") + ")";
          }
          var s = ~o.indexOf("\\"), I = s ? "E" : "";
          return o = o.replace(/'/g, "''"), o = o.replace(/\\/g, "\\\\"), I + "'" + o + "'";
        }
        t.literal = n;
      },
      /* 21 */
      /***/
      function(e, t, i) {
        Object.defineProperty(t, "__esModule", { value: !0 }), t.locationOf = void 0;
        function n(o) {
          const g = o._location;
          if (!g)
            throw new Error("This statement has not been parsed using location tracking (which has a small performance hit). ");
          return g;
        }
        t.locationOf = n;
      }
      /******/
    ])
  );
})(WN);
function VIA(A) {
  return WN.parse(A, "expr");
}
const Cxt = /* @__PURE__ */ new Set([
  "any_value",
  "arg_max",
  "max_by",
  "arg_min",
  "argMin",
  "min_by",
  "avg",
  "mean",
  "bit_and",
  "bit_or",
  "bit_xor",
  "bitstring_agg",
  "bool_and",
  "bool_or",
  "count",
  "favg",
  "first",
  "arbitrary",
  "fsum",
  "kahan_sum",
  "geomean",
  "geometric_mean",
  "histogram",
  "last",
  "list",
  "array_agg",
  "max",
  "min",
  "product",
  "string_agg",
  "group_concat",
  "listagg",
  "sum",
  "approx_count_distinct",
  "approx_quantile",
  "reservoir_quantile",
  "corr",
  "covar_pop",
  "covar_samp",
  "entropy",
  "kurtosis",
  "mad",
  "median",
  "mode",
  "quantile_cont",
  "quantile_disc",
  "quantile",
  "regr_avgx",
  "regr_avgy",
  "regr_count",
  "regr_intercept",
  "regr_r2",
  "regr_slope",
  "regr_sxx",
  "regr_sxy",
  "regr_syy",
  "skewness",
  "stddev_pop",
  "stddev_samp",
  "stddev",
  "var_pop",
  "var_samp",
  "variance"
]);
function Bxt(A, e) {
  const t = /* @__PURE__ */ new Map();
  e.forEach((n) => {
    t.set(n.name ?? n.fid, n);
  });
  const i = (n) => {
    switch (n.type) {
      case "integer":
      case "numeric":
        return ["quantitative", !1];
      case "null":
      case "string":
      case "boolean":
        return ["nominal", !1];
      case "unary":
        const [o, g] = i(n.operand);
        switch (n.op) {
          case "+":
          case "-":
            return ["quantitative", g];
          default:
            return ["nominal", g];
        }
      case "ref": {
        const s = t.get(n.name);
        return s ? [s.semanticType, !1] : ["nominal", !1];
      }
      case "case":
        return n.else ? i(n.else) : i(n.whens[0].value);
      case "array":
      case "list":
        return n.expressions.length ? i(n.expressions[0]) : ["nominal", !1];
      case "binary":
        return i(n.left);
      case "call": {
        if (n.function.name === "count")
          return ["quantitative", !0];
        const [s] = i(n.args[0]);
        return [s, Cxt.has(n.function.name.toLowerCase())];
      }
      case "cast": {
        const [s, I] = i(n.operand);
        if ("name" in n.to)
          switch (n.to.name.toLowerCase()) {
            case "date":
            case "timestamp":
            case "timestamp with time zone":
            case "time":
            case "time with time zone":
            case "interval":
              return ["temporal", I];
            case "smallint":
            case "integer":
            case "bigint":
            case "decimal":
            case "numeric":
            case "real":
            case "double precision":
            case "smallserial":
            case "serial":
            case "bigserial":
              return ["quantitative", I];
          }
        return ["nominal", I];
      }
      default:
        return ["nominal", !1];
    }
  };
  return i(A);
}
function lxt(A) {
  const e = /* @__PURE__ */ new Set(), t = (i) => {
    i.type === "ref" ? e.add(i.name) : Object.values(i).forEach((n) => {
      n !== null && typeof n == "object" && "type" in n && t(n);
    });
  };
  return t(VIA(A)), Array.from(e);
}
function q4A(A, e) {
  const t = /* @__PURE__ */ new Map();
  e.forEach((o) => {
    t.set((o.name ?? o.fid).toLowerCase(), o);
  });
  const i = VIA(A), n = WN.astMapper(() => ({
    ref: (o) => {
      var g;
      return WN.assignChanged(o, { name: ((g = t.get(o.name.toLowerCase())) == null ? void 0 : g.fid) || o.name });
    }
  }));
  return WN.toSql.expr(n.expr(i));
}
function zr(A) {
  for (var e = arguments.length, t = Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
    t[i - 1] = arguments[i];
  throw Error("[Immer] minified error nr: " + A + (t.length ? " " + t.map(function(n) {
    return "'" + n + "'";
  }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
}
function ID(A) {
  return !!A && !!A[sa];
}
function Wp(A) {
  var e;
  return !!A && (function(t) {
    if (!t || typeof t != "object")
      return !1;
    var i = Object.getPrototypeOf(t);
    if (i === null)
      return !0;
    var n = Object.hasOwnProperty.call(i, "constructor") && i.constructor;
    return n === Object || typeof n == "function" && Function.toString.call(n) === pxt;
  }(A) || Array.isArray(A) || !!A[xwA] || !!(!((e = A.constructor) === null || e === void 0) && e[xwA]) || XIA(A) || zIA(A));
}
function j2(A, e, t) {
  t === void 0 && (t = !1), YG(A) === 0 ? (t ? Object.keys : jIA)(A).forEach(function(i) {
    t && typeof i == "symbol" || e(i, A[i], A);
  }) : A.forEach(function(i, n) {
    return e(n, i, A);
  });
}
function YG(A) {
  var e = A[sa];
  return e ? e.i > 3 ? e.i - 4 : e.i : Array.isArray(A) ? 1 : XIA(A) ? 2 : zIA(A) ? 3 : 0;
}
function T6(A, e) {
  return YG(A) === 2 ? A.has(e) : Object.prototype.hasOwnProperty.call(A, e);
}
function cxt(A, e) {
  return YG(A) === 2 ? A.get(e) : A[e];
}
function O4A(A, e, t) {
  var i = YG(A);
  i === 2 ? A.set(e, t) : i === 3 ? A.add(t) : A[e] = t;
}
function Qxt(A, e) {
  return A === e ? A !== 0 || 1 / A == 1 / e : A != A && e != e;
}
function XIA(A) {
  return hxt && A instanceof Map;
}
function zIA(A) {
  return mxt && A instanceof Set;
}
function Ph(A) {
  return A.o || A.t;
}
function TIA(A) {
  if (Array.isArray(A))
    return Array.prototype.slice.call(A);
  var e = yxt(A);
  delete e[sa];
  for (var t = jIA(e), i = 0; i < t.length; i++) {
    var n = t[i], o = e[n];
    o.writable === !1 && (o.writable = !0, o.configurable = !0), (o.get || o.set) && (e[n] = { configurable: !0, writable: !0, enumerable: o.enumerable, value: A[n] });
  }
  return Object.create(Object.getPrototypeOf(A), e);
}
function _IA(A, e) {
  return e === void 0 && (e = !1), qIA(A) || ID(A) || !Wp(A) || (YG(A) > 1 && (A.set = A.add = A.clear = A.delete = Ext), Object.freeze(A), e && j2(A, function(t, i) {
    return _IA(i, !0);
  }, !0)), A;
}
function Ext() {
  zr(2);
}
function qIA(A) {
  return A == null || typeof A != "object" || Object.isFrozen(A);
}
function el(A) {
  var e = bxt[A];
  return e || zr(18, A), e;
}
function kwA() {
  return P2;
}
function W_(A, e) {
  e && (el("Patches"), A.u = [], A.s = [], A.v = e);
}
function _W(A) {
  _6(A), A.p.forEach(uxt), A.p = null;
}
function _6(A) {
  A === P2 && (P2 = A.l);
}
function JwA(A) {
  return P2 = { p: [], l: P2, h: A, m: !0, _: 0 };
}
function uxt(A) {
  var e = A[sa];
  e.i === 0 || e.i === 1 ? e.j() : e.g = !0;
}
function K_(A, e) {
  e._ = e.p.length;
  var t = e.p[0], i = A !== void 0 && A !== t;
  return e.h.O || el("ES5").S(e, A, i), i ? (t[sa].P && (_W(e), zr(4)), Wp(A) && (A = qW(e, A), e.l || OW(e, A)), e.u && el("Patches").M(t[sa].t, A, e.u, e.s)) : A = qW(e, t, []), _W(e), e.u && e.v(e.u, e.s), A !== j4A ? A : void 0;
}
function qW(A, e, t) {
  if (qIA(e))
    return e;
  var i = e[sa];
  if (!i)
    return j2(e, function(s, I) {
      return NwA(A, i, e, s, I, t);
    }, !0), e;
  if (i.A !== A)
    return e;
  if (!i.P)
    return OW(A, i.t, !0), i.t;
  if (!i.I) {
    i.I = !0, i.A._--;
    var n = i.i === 4 || i.i === 5 ? i.o = TIA(i.k) : i.o, o = n, g = !1;
    i.i === 3 && (o = new Set(n), n.clear(), g = !0), j2(o, function(s, I) {
      return NwA(A, i, n, s, I, t, g);
    }), OW(A, n, !1), t && A.u && el("Patches").N(i, t, A.u, A.s);
  }
  return i.o;
}
function NwA(A, e, t, i, n, o, g) {
  if (ID(n)) {
    var s = qW(A, n, o && e && e.i !== 3 && !T6(e.R, i) ? o.concat(i) : void 0);
    if (O4A(t, i, s), !ID(s))
      return;
    A.m = !1;
  } else
    g && t.add(n);
  if (Wp(n) && !qIA(n)) {
    if (!A.h.D && A._ < 1)
      return;
    qW(A, n), e && e.A.l || OW(A, n);
  }
}
function OW(A, e, t) {
  t === void 0 && (t = !1), !A.l && A.h.D && A.m && _IA(e, t);
}
function U_(A, e) {
  var t = A[sa];
  return (t ? Ph(t) : A)[e];
}
function YwA(A, e) {
  if (e in A)
    for (var t = Object.getPrototypeOf(A); t; ) {
      var i = Object.getOwnPropertyDescriptor(t, e);
      if (i)
        return i;
      t = Object.getPrototypeOf(t);
    }
}
function q6(A) {
  A.P || (A.P = !0, A.l && q6(A.l));
}
function V_(A) {
  A.o || (A.o = TIA(A.t));
}
function O6(A, e, t) {
  var i = XIA(e) ? el("MapSet").F(e, t) : zIA(e) ? el("MapSet").T(e, t) : A.O ? function(n, o) {
    var g = Array.isArray(n), s = { i: g ? 1 : 0, A: o ? o.A : kwA(), P: !1, I: !1, R: {}, l: o, t: n, k: null, o: null, j: null, C: !1 }, I = s, r = j6;
    g && (I = [s], r = jJ);
    var a = Proxy.revocable(I, r), C = a.revoke, B = a.proxy;
    return s.k = B, s.j = C, B;
  }(e, t) : el("ES5").J(e, t);
  return (t ? t.A : kwA()).p.push(i), i;
}
function dxt(A) {
  return ID(A) || zr(22, A), function e(t) {
    if (!Wp(t))
      return t;
    var i, n = t[sa], o = YG(t);
    if (n) {
      if (!n.P && (n.i < 4 || !el("ES5").K(n)))
        return n.t;
      n.I = !0, i = RwA(t, o), n.I = !1;
    } else
      i = RwA(t, o);
    return j2(i, function(g, s) {
      n && cxt(n.t, g) === s || O4A(i, g, e(s));
    }), o === 3 ? new Set(i) : i;
  }(A);
}
function RwA(A, e) {
  switch (e) {
    case 2:
      return new Map(A);
    case 3:
      return Array.from(A);
  }
  return TIA(A);
}
var FwA, P2, OIA = typeof Symbol < "u" && typeof Symbol("x") == "symbol", hxt = typeof Map < "u", mxt = typeof Set < "u", MwA = typeof Proxy < "u" && Proxy.revocable !== void 0 && typeof Reflect < "u", j4A = OIA ? Symbol.for("immer-nothing") : ((FwA = {})["immer-nothing"] = !0, FwA), xwA = OIA ? Symbol.for("immer-draftable") : "__$immer_draftable", sa = OIA ? Symbol.for("immer-state") : "__$immer_state", pxt = "" + Object.prototype.constructor, jIA = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : Object.getOwnPropertySymbols !== void 0 ? function(A) {
  return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A));
} : Object.getOwnPropertyNames, yxt = Object.getOwnPropertyDescriptors || function(A) {
  var e = {};
  return jIA(A).forEach(function(t) {
    e[t] = Object.getOwnPropertyDescriptor(A, t);
  }), e;
}, bxt = {}, j6 = { get: function(A, e) {
  if (e === sa)
    return A;
  var t = Ph(A);
  if (!T6(t, e))
    return function(n, o, g) {
      var s, I = YwA(o, g);
      return I ? "value" in I ? I.value : (s = I.get) === null || s === void 0 ? void 0 : s.call(n.k) : void 0;
    }(A, t, e);
  var i = t[e];
  return A.I || !Wp(i) ? i : i === U_(A.t, e) ? (V_(A), A.o[e] = O6(A.A.h, i, A)) : i;
}, has: function(A, e) {
  return e in Ph(A);
}, ownKeys: function(A) {
  return Reflect.ownKeys(Ph(A));
}, set: function(A, e, t) {
  var i = YwA(Ph(A), e);
  if (i != null && i.set)
    return i.set.call(A.k, t), !0;
  if (!A.P) {
    var n = U_(Ph(A), e), o = n == null ? void 0 : n[sa];
    if (o && o.t === t)
      return A.o[e] = t, A.R[e] = !1, !0;
    if (Qxt(t, n) && (t !== void 0 || T6(A.t, e)))
      return !0;
    V_(A), q6(A);
  }
  return A.o[e] === t && (t !== void 0 || e in A.o) || Number.isNaN(t) && Number.isNaN(A.o[e]) || (A.o[e] = t, A.R[e] = !0), !0;
}, deleteProperty: function(A, e) {
  return U_(A.t, e) !== void 0 || e in A.t ? (A.R[e] = !1, V_(A), q6(A)) : delete A.R[e], A.o && delete A.o[e], !0;
}, getOwnPropertyDescriptor: function(A, e) {
  var t = Ph(A), i = Reflect.getOwnPropertyDescriptor(t, e);
  return i && { writable: !0, configurable: A.i !== 1 || e !== "length", enumerable: i.enumerable, value: t[e] };
}, defineProperty: function() {
  zr(11);
}, getPrototypeOf: function(A) {
  return Object.getPrototypeOf(A.t);
}, setPrototypeOf: function() {
  zr(12);
} }, jJ = {};
j2(j6, function(A, e) {
  jJ[A] = function() {
    return arguments[0] = arguments[0][0], e.apply(this, arguments);
  };
}), jJ.deleteProperty = function(A, e) {
  return jJ.set.call(this, A, e, void 0);
}, jJ.set = function(A, e, t) {
  return j6.set.call(this, A[0], e, t, A[0]);
};
var wxt = function() {
  function A(t) {
    var i = this;
    this.O = MwA, this.D = !0, this.produce = function(n, o, g) {
      if (typeof n == "function" && typeof o != "function") {
        var s = o;
        o = n;
        var I = i;
        return function(E) {
          var d = this;
          E === void 0 && (E = s);
          for (var m = arguments.length, y = Array(m > 1 ? m - 1 : 0), f = 1; f < m; f++)
            y[f - 1] = arguments[f];
          return I.produce(E, function(w) {
            var G;
            return (G = o).call.apply(G, [d, w].concat(y));
          });
        };
      }
      var r;
      if (typeof o != "function" && zr(6), g !== void 0 && typeof g != "function" && zr(7), Wp(n)) {
        var a = JwA(i), C = O6(i, n, void 0), B = !0;
        try {
          r = o(C), B = !1;
        } finally {
          B ? _W(a) : _6(a);
        }
        return typeof Promise < "u" && r instanceof Promise ? r.then(function(E) {
          return W_(a, g), K_(E, a);
        }, function(E) {
          throw _W(a), E;
        }) : (W_(a, g), K_(r, a));
      }
      if (!n || typeof n != "object") {
        if ((r = o(n)) === void 0 && (r = n), r === j4A && (r = void 0), i.D && _IA(r, !0), g) {
          var l = [], Q = [];
          el("Patches").M(n, r, l, Q), g(l, Q);
        }
        return r;
      }
      zr(21, n);
    }, this.produceWithPatches = function(n, o) {
      if (typeof n == "function")
        return function(r) {
          for (var a = arguments.length, C = Array(a > 1 ? a - 1 : 0), B = 1; B < a; B++)
            C[B - 1] = arguments[B];
          return i.produceWithPatches(r, function(l) {
            return n.apply(void 0, [l].concat(C));
          });
        };
      var g, s, I = i.produce(n, o, function(r, a) {
        g = r, s = a;
      });
      return typeof Promise < "u" && I instanceof Promise ? I.then(function(r) {
        return [r, g, s];
      }) : [I, g, s];
    }, typeof (t == null ? void 0 : t.useProxies) == "boolean" && this.setUseProxies(t.useProxies), typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze);
  }
  var e = A.prototype;
  return e.createDraft = function(t) {
    Wp(t) || zr(8), ID(t) && (t = dxt(t));
    var i = JwA(this), n = O6(this, t, void 0);
    return n[sa].C = !0, _6(i), n;
  }, e.finishDraft = function(t, i) {
    var n = t && t[sa], o = n.A;
    return W_(o, i), K_(void 0, o);
  }, e.setAutoFreeze = function(t) {
    this.D = t;
  }, e.setUseProxies = function(t) {
    t && !MwA && zr(20), this.O = t;
  }, e.applyPatches = function(t, i) {
    var n;
    for (n = i.length - 1; n >= 0; n--) {
      var o = i[n];
      if (o.path.length === 0 && o.op === "replace") {
        t = o.value;
        break;
      }
    }
    n > -1 && (i = i.slice(n + 1));
    var g = el("Patches").$;
    return ID(t) ? g(t, i) : this.produce(t, function(s) {
      return g(s, i);
    });
  }, A;
}(), Ia = new wxt(), fxt = Ia.produce;
Ia.produceWithPatches.bind(Ia);
Ia.setAutoFreeze.bind(Ia);
Ia.setUseProxies.bind(Ia);
Ia.applyPatches.bind(Ia);
Ia.createDraft.bind(Ia);
Ia.finishDraft.bind(Ia);
const Dxt = fxt;
var Pt;
(function(A) {
  A[A.setConfig = 0] = "setConfig", A[A.removeField = 1] = "removeField", A[A.reorderField = 2] = "reorderField", A[A.moveField = 3] = "moveField", A[A.cloneField = 4] = "cloneField", A[A.createBinlogField = 5] = "createBinlogField", A[A.appendFilter = 6] = "appendFilter", A[A.modFilter = 7] = "modFilter", A[A.writeFilter = 8] = "writeFilter", A[A.setName = 9] = "setName", A[A.applySort = 10] = "applySort", A[A.transpose = 11] = "transpose", A[A.setLayout = 12] = "setLayout", A[A.setFieldAggregator = 13] = "setFieldAggregator", A[A.setGeoData = 14] = "setGeoData", A[A.setCoordSystem = 15] = "setCoordSystem", A[A.createDateDrillField = 16] = "createDateDrillField", A[A.createDateFeatureField = 17] = "createDateFeatureField", A[A.changeSemanticType = 18] = "changeSemanticType", A[A.setFilterAggregator = 19] = "setFilterAggregator", A[A.addFoldField = 20] = "addFoldField", A[A.upsertPaintField = 21] = "upsertPaintField", A[A.addSQLComputedField = 22] = "addSQLComputedField", A[A.removeAllField = 23] = "removeAllField", A[A.editAllField = 24] = "editAllField", A[A.replaceWithNLPQuery = 25] = "replaceWithNLPQuery";
})(Pt || (Pt = {}));
const Yv = {
  [Pt.setConfig]: (A, e, t) => jt(A, "config", (i) => ({ ...i, [e]: t })),
  [Pt.removeField]: (A, e, t) => jt(A, `encodings.${e}`, (i) => wwA(i, t)),
  [Pt.reorderField]: (A, e, t, i) => jt(A, `encodings.${e}`, (n) => n.map((o, g, s) => g === t ? s[i] : g === i ? s[t] : o)),
  [Pt.moveField]: (A, e, t, i, n, o) => {
    const g = A.encodings[e][t], s = i === "dimensions" ? jt(g, "analyticType", () => "dimension") : i === "measures" ? jt(g, "analyticType", () => "measure") : g;
    return jt(A, "encodings", (I) => ({
      ...I,
      [e]: wwA(A.encodings[e], t),
      [i]: BL(A.encodings[i], s, n).slice(0, o ?? 1 / 0)
    }));
  },
  [Pt.cloneField]: (A, e, t, i, n, o, g) => {
    const s = { ...A.encodings[e][t] };
    return jt(A, "encodings", (I) => ({
      ...I,
      [i]: BL(A.encodings[i], s, n).slice(0, g ?? 1 / 0)
    }));
  },
  [Pt.createBinlogField]: (A, e, t, i, n, o) => {
    const g = A.encodings[e][t], s = i.startsWith("bin"), I = s ? "dimensions" : e, r = s ? `${i}${o}` : `log${o}`, a = {
      fid: n,
      name: `${r}(${g.name})`,
      semanticType: s ? "ordinal" : "quantitative",
      analyticType: s ? "dimension" : g.analyticType,
      computed: !0,
      expression: {
        op: i,
        as: n,
        params: [
          {
            type: "field",
            value: g.fid
          }
        ],
        num: o
      }
    };
    return s || (a.aggName = "sum"), jt(A, `encodings.${I}`, (C) => C.concat(a));
  },
  [Pt.appendFilter]: (A, e, t, i, n) => {
    const o = A.encodings[t][i];
    return jt(A, "encodings.filters", (g) => BL(g, {
      ...o,
      rule: null
    }, e));
  },
  [Pt.modFilter]: (A, e, t, i) => jt(A, "encodings.filters", (n) => {
    const o = A.encodings[t][i];
    return yE(n, e, (g) => ({
      ...o,
      rule: null
    }));
  }),
  [Pt.writeFilter]: (A, e, t) => jt(A, "encodings.filters", (i) => yE(i, e, (n) => ({ ...n, rule: t }))),
  [Pt.setName]: (A, e) => ({
    ...A,
    name: e
  }),
  [Pt.applySort]: (A, e) => {
    const { rows: t, columns: i } = A.encodings, n = t.length > 0 ? t[t.length - 1] : null, o = i.length > 0 ? i[i.length - 1] : null;
    return o !== null && o.analyticType === "dimension" && n !== null && n.analyticType === "measure" ? jt(A, "encodings.columns", (g) => yE(g, g.length - 1, (s) => ({ ...s, sort: e }))) : o !== null && o.analyticType === "measure" && n !== null && n.analyticType === "dimension" ? jt(A, "encodings.rows", (g) => yE(g, g.length - 1, (s) => ({ ...s, sort: e }))) : A;
  },
  [Pt.transpose]: (A) => jt(A, "encodings", (e) => ({
    ...e,
    columns: e.rows,
    rows: e.columns
  })),
  [Pt.setLayout]: (A, e) => jt(A, "layout", (t) => Object.assign({}, t, Object.fromEntries(e))),
  [Pt.setFieldAggregator]: (A, e, t, i) => jt(A, `encodings.${e}`, (n) => yE(n, t, (o) => ({ ...o, aggName: i }))),
  [Pt.setGeoData]: (A, e, t, i) => jt(A, "layout", (n) => ({ ...n, geojson: e, geoKey: t, geoUrl: i })),
  [Pt.setCoordSystem]: (A, e) => jt(A, "config", (t) => ({
    ...t,
    coordSystem: e,
    geoms: [UIA.GEOM_TYPES[e][0]]
  })),
  [Pt.createDateDrillField]: (A, e, t, i, n, o, g, s) => {
    const I = A.encodings[e][t], r = {
      fid: n,
      name: o,
      semanticType: "temporal",
      analyticType: I.analyticType,
      aggName: "sum",
      computed: !0,
      timeUnit: i,
      expression: {
        op: "dateTimeDrill",
        as: n,
        params: [
          {
            type: "field",
            value: I.fid
          },
          {
            type: "value",
            value: i
          },
          ...g ? [
            {
              type: "format",
              value: g
            }
          ] : [],
          ...mwA(s) ? [
            {
              type: "offset",
              value: s
            }
          ] : []
        ]
      }
    };
    return jt(A, `encodings.${e}`, (a) => a.concat(r));
  },
  [Pt.createDateFeatureField]: (A, e, t, i, n, o, g, s) => {
    const I = A.encodings[e][t], r = {
      fid: n,
      name: o,
      semanticType: "ordinal",
      analyticType: I.analyticType,
      aggName: "sum",
      computed: !0,
      expression: {
        op: "dateTimeFeature",
        as: n,
        params: [
          {
            type: "field",
            value: I.fid
          },
          {
            type: "value",
            value: i
          },
          ...g ? [
            {
              type: "format",
              value: g
            }
          ] : [],
          ...mwA(s) ? [
            {
              type: "offset",
              value: s
            }
          ] : []
        ]
      }
    };
    return jt(A, `encodings.${e}`, (a) => a.concat(r));
  },
  [Pt.changeSemanticType]: (A, e, t, i) => jt(A, `encodings.${e}`, (n) => yE(n, t, (o) => ({ ...o, semanticType: i }))),
  [Pt.setFilterAggregator]: (A, e, t) => jt(A, "encodings.filters", (i) => yE(i, e, (n) => ({ ...n, aggName: t || "sum", enableAgg: !!t, rule: null }))),
  [Pt.addFoldField]: (A, e, t, i, n, o, g) => {
    let s = A;
    const I = s.encodings[e][t];
    if (!s.config.folds) {
      const r = [...s.encodings.measures, ...s.encodings.details].filter((a) => a.analyticType === "measure" && a.fid !== Fw);
      s = Yv[Pt.setConfig](s, "folds", r.filter((a, C) => C === 0).map((a) => a.fid));
    }
    if (I.fid === Fw) {
      const r = Object.keys(s.encodings).filter((a) => a !== "filters").map((a) => [a, s.encodings[a].findIndex((C) => C.fid === XW)]).filter(([a, C]) => C >= 0);
      if (r.length === 1) {
        const [a, C] = r[0];
        s = Yv[Pt.cloneField](s, a, C, "details", 0, `${o}_auto`, 1 / 0);
      }
    }
    return Yv[Pt.cloneField](s, e, t, i, n, o, g);
  },
  [Pt.upsertPaintField]: (A, e, t) => {
    if (!e)
      return jt(A, "encodings", (o) => Object.fromEntries(Object.entries(o).map(([g, s]) => [g, s.filter((I) => I.fid !== jh)])));
    const i = "facets" in e ? { op: "paint", as: jh, params: [{ type: "newmap", value: e }] } : {
      op: "paint",
      as: jh,
      params: [{ type: "map", value: e }]
    }, n = e.usedColor.includes(255);
    return jt(A, "encodings", (o) => {
      let g = !1, s = !1;
      const I = Object.entries(o).map(([B, l]) => {
        const Q = l.findIndex((E) => E.fid === jh);
        return Q > -1 ? (g = !0, B === "filters" && (s = !0), [
          B,
          yE(l, Q, (E) => ({
            ...E,
            expression: i
          }))
        ]) : [B, l];
      }), r = {
        fid: jh,
        analyticType: "dimension",
        name: t,
        semanticType: "nominal",
        computed: !0,
        expression: i,
        rule: {
          type: "not in",
          value: [""]
        }
      };
      if (g)
        return !s && n ? jt(Object.fromEntries(I), "filters", (B) => B.concat(r)) : Object.fromEntries(I);
      const a = {
        fid: jh,
        analyticType: "dimension",
        name: t,
        semanticType: "nominal",
        computed: !0,
        expression: i
      }, C = jt(jt(o, "dimensions", (B) => BL(B, a, B.length)), "color", () => [{ ...a }]);
      return n ? jt(C, "filters", (B) => B.concat(r)) : C;
    });
  },
  [Pt.addSQLComputedField]: (A, e, t, i) => {
    const [n, o] = Bxt(VIA(i), A.encodings.dimensions.concat(A.encodings.measures)), g = n === "quantitative" ? "measure" : "dimension";
    return jt(A, `encodings.${g}s`, (s) => s.concat({
      analyticType: g,
      fid: e,
      name: t,
      semanticType: n,
      computed: !0,
      aggName: o ? "expr" : g === "dimension" ? void 0 : "sum",
      expression: {
        op: "expr",
        as: e,
        params: [{ type: "sql", value: i }]
      }
    }));
  },
  [Pt.removeAllField]: (A, e) => jt(A, "encodings", (t) => Object.fromEntries(Object.entries(t).map(([i, n]) => {
    const o = n.filter((g) => g.fid !== e);
    return n.length === o.length ? [i, n] : [i, o];
  }))),
  [Pt.editAllField]: (A, e, t) => {
    if (Object.keys(t).includes("name")) {
      const i = A.encodings.dimensions.concat(A.encodings.measures).find((n) => n.fid === e);
      return Dxt(A, (n) => {
        i && Object.values(n.encodings).forEach((o) => o.forEach((g, s) => {
          var I;
          if (g.fid === e)
            o[s] = { ...g, ...t };
          else if (((I = g.expression) == null ? void 0 : I.op) === "expr") {
            const r = g.expression.params.find((a) => a.type === "sql");
            if (r) {
              const a = q4A(r.value, [
                { ...i, fid: t.name, name: i.name ?? i.fid }
              ]);
              a !== r.value && (r.value = a);
            }
          }
        }));
      });
    }
    return jt(A, "encodings", (i) => Object.fromEntries(Object.entries(i).map(([n, o]) => o.find((s) => s.fid === e) ? [n, o.map((s) => s.fid === e ? { ...s, ...t } : s)] : [n, o])));
  },
  [Pt.replaceWithNLPQuery]: (A, e, t) => ({ ...JSON.parse(t), visId: A.visId, name: A.name })
}, Gxt = (A, e) => {
  const t = {};
  return Object.keys(e.encodings).forEach((i) => {
    e.encodings[i] !== A.encodings[i] && (t[i] = e.encodings[i]);
  }), t;
};
function LwA(A, e) {
  const t = [], i = new Array(e.length).fill(null).map(() => []);
  return A.forEach((n) => {
    const o = e.findIndex((g) => g(n));
    o >= 0 ? i[o].push(n) : t.push(n);
  }), t.concat(i.flat());
}
function vwA(A) {
  const e = {};
  return A.dimensions && A.dimensions.length > 0 && (e.dimensions = LwA(A.dimensions, [(t) => t.fid === jh, (t) => t.fid === XW])), A.measures && A.measures.length > 0 && (e.measures = LwA(A.measures, [(t) => t.fid === ZMt, (t) => t.fid === Fw])), e;
}
const kxt = (A, e) => {
  const t = Gxt(e, A), i = A.config.geoms[0];
  return Object.keys(t).length === 0 && pwA(A.config.geoms, e.config.geoms) ? A : pwA(A.config.geoms, e.config.geoms) ? jt(A, "encodings", (n) => ({ ...n, ...fwA(i, t), ...vwA(t) })) : jt(A, "encodings", (n) => ({ ...n, ...fwA(i, n), ...vwA(n) }));
}, Jxt = [kxt];
function Nxt(A, e) {
  const [t, ...i] = e, n = Yv[t](A, ...i);
  return Jxt.reduce((o, g) => g(o, A), n);
}
const Yxt = gxt(Nxt);
Object.fromEntries(Object.keys(Pt).map((A) => [A, (e, ...t) => Yxt(e, [Pt[A], ...t])]));
function P4A(A, e, t) {
  return {
    config: t != null && t.config ? { ...bwA, ...t.config } : bwA,
    encodings: ext,
    layout: t != null && t.layout ? { ...ywA, ...t.layout } : ywA,
    visId: A,
    name: e
  };
}
function Rxt(A) {
  var t;
  const e = P4A(A.visId || nxt(), A.name || "Chart");
  return e.config = {
    ...e.config,
    ...A.config
  }, e.encodings = {
    ...e.encodings,
    ...A.encodings
  }, e.layout = {
    ...e.layout,
    ...A.layout,
    size: {
      ...e.layout.size,
      ...(t = A.layout) == null ? void 0 : t.size
    }
  }, e;
}
function Fxt(A) {
  var t, i, n, o, g, s, I, r, a, C, B, l, Q, E, d, m, y;
  const e = P4A(A.visId, A.name || "Chart");
  return e.config = {
    ...e.config,
    defaultAggregated: A.config.defaultAggregated,
    geoms: ((t = A.config.geoms) == null ? void 0 : t.slice()) ?? [],
    limit: A.config.limit,
    coordSystem: A.config.coordSystem,
    folds: A.config.folds
  }, e.encodings = {
    ...e.encodings,
    dimensions: ((i = A.encodings.dimensions) == null ? void 0 : i.slice()) ?? [],
    measures: ((n = A.encodings.measures) == null ? void 0 : n.slice()) ?? [],
    rows: ((o = A.encodings.rows) == null ? void 0 : o.slice()) ?? [],
    columns: ((g = A.encodings.columns) == null ? void 0 : g.slice()) ?? [],
    color: ((s = A.encodings.color) == null ? void 0 : s.slice()) ?? [],
    opacity: ((I = A.encodings.opacity) == null ? void 0 : I.slice()) ?? [],
    size: ((r = A.encodings.size) == null ? void 0 : r.slice()) ?? [],
    shape: ((a = A.encodings.shape) == null ? void 0 : a.slice()) ?? [],
    theta: ((C = A.encodings.theta) == null ? void 0 : C.slice()) ?? [],
    radius: ((B = A.encodings.radius) == null ? void 0 : B.slice()) ?? [],
    longitude: ((l = A.encodings.longitude) == null ? void 0 : l.slice()) ?? [],
    latitude: ((Q = A.encodings.latitude) == null ? void 0 : Q.slice()) ?? [],
    geoId: ((E = A.encodings.geoId) == null ? void 0 : E.slice()) ?? [],
    details: ((d = A.encodings.details) == null ? void 0 : d.slice()) ?? [],
    filters: ((m = A.encodings.filters) == null ? void 0 : m.slice()) ?? [],
    text: ((y = A.encodings.text) == null ? void 0 : y.slice()) ?? []
  }, e.layout = {
    ...e.layout,
    background: A.config.background,
    format: A.config.format,
    interactiveScale: A.config.interactiveScale,
    resolve: A.config.resolve,
    showActions: A.config.showActions,
    stack: A.config.stack,
    zeroScale: A.config.zeroScale,
    size: {
      ...e.layout.size,
      ...A.config.size
    },
    colorPalette: A.config.colorPalette,
    geojson: A.config.geojson,
    geoKey: A.config.geoKey,
    geoUrl: A.config.geoUrl,
    primaryColor: A.config.primaryColor,
    scale: A.config.scale,
    scaleIncludeUnmatchedChoropleth: A.config.scaleIncludeUnmatchedChoropleth,
    showTableSummary: A.config.showTableSummary,
    useSvg: A.config.useSvg
  }, e;
}
function Mxt(A) {
  return "layout" in A ? A : Fxt(txt(ixt(A)));
}
function xxt(A, e) {
  return A.aggName === "expr" ? A : {
    ...A,
    aggName: e
  };
}
const Lxt = (A) => {
  switch (A) {
    case "choropleth":
      return ["geoId", "color", "opacity", "text", "details"];
    case "poi":
      return ["longitude", "latitude", "color", "opacity", "size", "details"];
    case "arc":
      return ["radius", "theta", "color", "opacity", "size", "details", "text"];
    case "bar":
    case "tick":
    case "line":
    case "area":
    case "boxplot":
      return ["columns", "rows", "color", "opacity", "size", "details", "text"];
    case "text":
      return ["columns", "rows", "color", "opacity", "size", "text"];
    case "table":
      return ["columns", "rows"];
    default:
      return ["columns", "rows", "color", "opacity", "size", "details", "shape"];
  }
}, $4A = (A, e) => {
  for (const t of A.params)
    t.type === "field" ? e(t.value) : t.type === "expression" ? $4A(t.value, e) : t.type === "sql" ? lxt(t.value).forEach(e) : t.type === "map" ? (e(t.value.x), e(t.value.y)) : t.type === "newmap" && t.value.facets.flatMap((i) => i.dimensions).forEach((i) => e(i.fid));
}, HwA = (A, e) => {
  const t = /* @__PURE__ */ new Map();
  return A.forEach((i) => t.set(e(i), i)), [...t.values()];
}, SwA = (A, e) => {
  const t = new Set(e);
  let i = A.filter((g) => t.has(g.key)), n = i.slice(), o = A.filter((g) => !t.has(g.key));
  for (; n.length && o.length; ) {
    const g = /* @__PURE__ */ new Set();
    for (const r of n)
      $4A(r.expression, (a) => g.add(a));
    const s = o.filter((r) => g.has(r.key));
    i = A.filter((r) => g.has(r.key)).concat(i.filter((r) => !g.has(r.key))), n = s, o = o.filter((r) => !g.has(r.key));
  }
  return i;
}, vxt = (A) => {
  const e = WMt(A), t = A.rule;
  return t.type === "one of" ? {
    fid: e,
    rule: {
      type: "one of",
      value: [...t.value]
    }
  } : t.type === "temporal range" ? {
    fid: e,
    rule: {
      type: "temporal range",
      value: t.value,
      offset: t.offset,
      format: t.format
    }
  } : t.type === "not in" ? {
    fid: e,
    rule: {
      type: "not in",
      value: [...t.value]
    }
  } : t.type === "range" ? {
    fid: e,
    rule: {
      type: "range",
      value: [t.value[0] ? Number(t.value[0]) : t.value[0], t.value[1] ? Number(t.value[1]) : t.value[1]]
    }
  } : t.type === "regexp" ? {
    fid: e,
    rule: {
      type: "regexp",
      value: t.value,
      caseSensitive: t.caseSensitive
    }
  } : (console.error("unknown rule", t), {
    fid: e,
    rule: t
  });
}, Hxt = (A, e, t, i, n, o, g = [], s, I) => {
  const r = t.find((N) => N.fid === XW) && i.find((N) => N.fid === Fw), a = t.filter((N) => N.fid !== XW), C = i.filter((N) => N.fid !== Fw);
  if (r) {
    const N = i.find((K) => K.fid === Fw).aggName, v = g.map((K) => e.find((U) => U.fid === K)).filter(Boolean).map((K) => xxt(K, N));
    a.push(...v.filter((K) => (K == null ? void 0 : K.analyticType) === "dimension")), C.push(...v.filter((K) => (K == null ? void 0 : K.analyticType) === "measure"));
  }
  const B = new Set([...a, ...C, ...A].map((N) => N.fid));
  let l = null, Q = null, E = null, d = null, m = null, y = null;
  const f = (N) => {
    const v = vxt(N);
    return B.add(v.fid), v;
  }, w = A.filter((N) => !N.computed && N.rule && !N.enableAgg).map(f);
  w.length && (l = {
    type: "filter",
    filters: w
  });
  const G = SwA(e.filter((N) => N.computed && N.expression && !(N.expression.op === "expr" && N.aggName === "expr")).map((N) => ({
    key: N.fid,
    expression: ZwA(N.expression, e, { timezoneDisplayOffset: I })
  })), [...B]);
  G.length && (Q = {
    type: "transform",
    transform: G
  });
  const R = A.filter((N) => N.computed && N.rule && !N.enableAgg).map(f);
  R.length && (E = {
    type: "filter",
    filters: R
  });
  const F = A.filter((N) => N.enableAgg && N.aggName && N.rule), Z = SwA(e.filter((N) => N.computed && N.expression && N.expression.op === "expr" && N.aggName === "expr").map((N) => ({
    key: N.fid,
    expression: ZwA(N.expression, e, { timezoneDisplayOffset: I })
  })), [...B]), c = C.filter((N) => N.aggName).map((N) => [N.fid, N.aggName]).concat(F.map((N) => [N.fid, N.aggName])).concat(Z.map((N) => [N.expression.params[0].value, "expr"])), J = n && (c.length || C.length === 0 && a.length > 0);
  return J ? d = {
    type: "view",
    query: [
      {
        op: "aggregate",
        groupBy: HwA(a.map((N) => N.fid), (N) => N),
        measures: HwA(C.concat(F).map((N) => ({
          field: N.fid,
          agg: N.aggName,
          asFieldKey: z6(N.fid, N.aggName)
        })).concat(Z.map((N) => ({
          field: N.expression.params[0].value,
          agg: "expr",
          asFieldKey: N.key
        }))), (N) => N.asFieldKey)
      }
    ]
  } : d = {
    type: "view",
    query: [
      {
        op: "raw",
        fields: [.../* @__PURE__ */ new Set([...a, ...C])].filter((N) => N.aggName !== "expr").map((N) => N.fid)
      }
    ]
  }, J && a.length > 0 && F.length > 0 && (y = {
    type: "filter",
    filters: F.map(f)
  }), o !== "none" && s && s !== -1 && (m = {
    type: "sort",
    by: C.map((N) => J ? z6(N.fid, N.aggName) : N.fid),
    sort: o
  }), [
    l,
    Q,
    E,
    d,
    y,
    m
  ].filter(Boolean);
};
function AqA(A) {
  var g, s, I, r, a, C, B, l, Q, E, d;
  const e = Mxt(A), t = Lxt(((s = (g = e.config) == null ? void 0 : g.geoms) == null ? void 0 : s[0]) ?? "auto").flatMap((m) => {
    var y;
    return ((y = e.encodings) == null ? void 0 : y[m]) ?? [];
  }), i = ((I = e.encodings) == null ? void 0 : I.rows) ?? [], n = ((r = e.encodings) == null ? void 0 : r.columns) ?? [], o = ((a = e.config) == null ? void 0 : a.limit) ?? -1;
  return {
    workflow: Hxt(((C = e.encodings) == null ? void 0 : C.filters) ?? [], [...((B = e.encodings) == null ? void 0 : B.dimensions) ?? [], ...((l = e.encodings) == null ? void 0 : l.measures) ?? []], t.filter((m) => m.analyticType === "dimension"), t.filter((m) => m.analyticType === "measure"), ((Q = e.config) == null ? void 0 : Q.defaultAggregated) ?? !0, KMt({ rows: i, columns: n }), ((E = e.config) == null ? void 0 : E.folds) ?? [], o, (d = e.config) == null ? void 0 : d.timezoneDisplayOffset),
    limit: o > 0 ? o : void 0
  };
}
const ZwA = (A, e, t) => (A == null ? void 0 : A.op) === "expr" ? {
  ...A,
  params: [
    {
      type: "sql",
      value: q4A(A.params.find((i) => i.type === "sql").value, e).trim()
    }
  ]
} : A.op === "dateTimeDrill" || A.op === "dateTimeFeature" ? {
  ...A,
  params: [
    ...A.params,
    {
      type: "displayOffset",
      value: t.timezoneDisplayOffset ?? new Date().getTimezoneOffset()
    }
  ]
} : A.op === "paint" ? {
  ...A,
  params: A.params.map((i) => {
    if (i.type === "map") {
      const n = {
        ...i.value.dict,
        255: { name: "" }
      };
      return {
        type: "map",
        value: {
          x: i.value.x,
          y: i.value.y,
          domainX: i.value.domainX,
          domainY: i.value.domainY,
          map: i.value.map,
          dict: Object.fromEntries(i.value.usedColor.map((o) => [
            o,
            {
              name: n[o].name
            }
          ])),
          mapwidth: i.value.mapwidth
        }
      };
    } else if (i.type === "newmap") {
      const n = {
        ...i.value.dict,
        255: { name: "" }
      }, o = Array.from(new Set(i.value.usedColor.concat(1)));
      return {
        type: "newmap",
        value: {
          facets: i.value.facets.map(({ dimensions: g, map: s }) => ({ dimensions: g, map: s })),
          dict: Object.fromEntries(o.map((g) => [
            g,
            {
              name: n[g].name
            }
          ]))
        }
      };
    } else
      return i;
  })
} : A;
function Sxt(A) {
  const { sourceCode: e, visSpec: t, version: i } = A, n = u.useMemo(() => JSON.stringify({
    config: t,
    chart_map: {},
    workflow_list: t.map((g) => AqA(g)),
    version: i
  }), [t]);
  return {
    pyCode: u.useMemo(() => {
      const g = e.replace("'____pyg_walker_spec_params____'", "vis_spec");
      return `vis_spec = r"""${n}"""
${g}`;
    }, [e, n])
  };
}
HW.registerLanguage("json", RYt);
HW.registerLanguage("python", HYt);
const Zxt = NQ((A) => {
  const { globalStore: e, sourceCode: t, open: i, setOpen: n } = A, [o, g] = u.useState([]), [s, I] = u.useState(""), r = b.useContext(dd), { pyCode: a } = Sxt({
    sourceCode: t,
    visSpec: o,
    version: Te.version
  }), C = u.useCallback(() => {
    n(!1);
  }, [n]), B = async (l) => {
    try {
      navigator.clipboard.writeText(l), n(!1);
    } catch {
      I("The Clipboard API has been blocked in this environment. Please copy manully.");
    }
  };
  return u.useEffect(() => {
    if (i && e.current) {
      const l = e.current.exportCode();
      g(l);
    }
  }, [i]), pA(ZX, { open: i, modal: !1, onOpenChange: (l) => {
    n(l);
  }, children: ue(oD, { className: "sm:max-w-[90%] lg:max-w-[900px]", children: [ue(_2, { children: [pA(q2, { children: "Code Export" }), pA(WX, { children: "Export the code of all charts in PyGWalker." })] }), pA("div", { className: "text-sm max-h-64 overflow-auto p-1", children: ue(YsA, { defaultValue: "python", className: "w-full", children: [ue(YX, { children: [pA(M2, { value: "python", children: "Python" }), pA(M2, { value: "json", children: "JSON(Graphic Walker)" })] }), ue(x2, { className: "py-4", value: "python", children: [pA("h3", { className: "text-sm font-medium mb-2", children: "PyGWalker Code" }), pA(HW, { showLineNumbers: !0, language: "python", style: r === "dark" ? NbA : JbA, children: a }), pA("div", { className: "text-xs max-h-56 mt-2", children: pA("p", { children: s }) }), ue("div", { className: "mt-4 flex justify-start gap-2", children: [pA(Kc, { onClick: () => {
    B(a);
  }, children: "Copy to Clipboard" }), pA(Kc, { variant: "outline", onClick: C, children: "Cancel" })] })] }), ue(x2, { value: "json", children: [pA("h3", { className: "text-sm font-medium mb-2", children: "Graphic Walker Specification" }), pA(HW, { showLineNumbers: !0, language: "json", style: r === "dark" ? NbA : JbA, children: JSON.stringify(o, null, 2) }), pA("div", { className: "text-xs max-h-56 mt-2", children: pA("p", { children: s }) }), ue("div", { className: "mt-4 flex justify-start gap-2", children: [pA(Kc, { onClick: () => {
    B(JSON.stringify(o, null, 2)), lC.track("click", { entity: "copy_code_button" });
  }, children: "Copy to Clipboard" }), pA(Kc, { variant: "outline", onClick: C, children: "Cancel" })] })] })] }) })] }) });
}), eqA = `*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 240 10% 3.9%;--radius: .5rem}.dark{--background: 240 10% 3.9%;--foreground: 0 0% 98%;--card: 240 10% 3.9%;--card-foreground: 0 0% 98%;--popover: 240 10% 3.9%;--popover-foreground: 0 0% 98%;--primary: 0 0% 98%;--primary-foreground: 240 5.9% 10%;--secondary: 240 3.7% 15.9;--secondary-foreground: 0 0% 98%;--muted: 240 3.7% 15.9%;--muted-foreground: 240 5% 64.9%;--accent: 240 3.7% 15.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--ring: 240 4.9% 83.9%}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\\!container{width:100%!important;margin-right:auto!important;margin-left:auto!important;padding-right:2rem!important;padding-left:2rem!important}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.\\!container{max-width:1400px!important}.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0px}.left-\\[50\\%\\]{left:50%}.right-2{right:.5rem}.right-4{right:1rem}.top-4{top:1rem}.top-\\[50\\%\\]{top:50%}.z-50{z-index:50}.z-\\[25539\\]{z-index:25539}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-\\[20px\\]{margin-bottom:20px}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.h-10{height:2.5rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[160px\\]{height:160px}.h-\\[30px\\]{height:30px}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-56{max-height:14rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.w-0{width:0px}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-9{width:2.25rem}.w-\\[140px\\]{width:140px}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y: .5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-t{border-top-width:1px}.border-border{border-color:hsl(var(--border))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-transparent{border-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\\/80{background-color:#000c}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-zinc-700{--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}.bg-zinc-900{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pl-2{padding-left:.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-0\\.5{padding-top:.125rem}.text-left{text-align:left}.text-center{text-align:center}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.text-current{color:currentColor}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity: .05}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-100{animation-duration:.1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-destructive\\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\\:bg-primary\\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.hover\\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity))}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\\:opacity-70{opacity:.7}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=active\\]\\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\\[state\\=on\\]\\:bg-accent[data-state=on],.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=active\\]\\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\\[state\\=checked\\]\\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\\[state\\=on\\]\\:text-accent-foreground[data-state=on]{color:hsl(var(--accent-foreground))}.data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\\[state\\=closed\\]\\:slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\\[state\\=closed\\]\\:slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\\[state\\=open\\]\\:slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\\[state\\=open\\]\\:slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y: -48%}:is(.dark .dark\\:bg-gray-700){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}:is(.dark .dark\\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\\:max-w-\\[90\\%\\]{max-width:90%}.sm\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:translate-x-2{--tw-translate-x: .5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:flex-row{flex-direction:row}.sm\\:items-start{align-items:flex-start}.sm\\:items-end{align-items:flex-end}.sm\\:justify-end{justify-content:flex-end}.sm\\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\\:rounded-lg{border-radius:var(--radius)}.sm\\:p-6{padding:1.5rem}.sm\\:text-left{text-align:left}}@media (min-width: 1024px){.lg\\:max-w-\\[900px\\]{max-width:900px}.lg\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\\:grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}
`, Wxt = NQ((A) => {
  const { charts: e, themeKey: t } = A;
  return pA(b.StrictMode, { children: ue("div", { className: "bg-background text-foreground", children: [pA("style", { children: eqA }), ue(YsA, { defaultValue: "0", className: "w-full", children: [pA("div", { className: "overflow-x-auto max-w-full", children: pA(YX, { children: e.map((i, n) => pA(M2, { value: n.toString(), children: i.visSpec.name }, n)) }) }), e.map((i, n) => pA(x2, { value: n.toString(), children: pA(GsA, { vizThemeConfig: t, name: i.visSpec.name, visualConfig: i.visSpec.config, visualLayout: i.visSpec.layout, visualState: i.visSpec.encodings, type: "remote", computation: async (o) => i.data, appearance: A.dark }) }, n))] })] }) });
}), Kxt = NQ((A) => pA(b.StrictMode, { children: ue("div", { children: [pA("h1", { style: { marginTop: "1rem", color: "#333", fontSize: "1.1rem", marginBottom: "0.5rem", paddingInlineStart: "1rem" }, children: A.title }), pA("p", { style: { color: "#666", fontWeight: 300, paddingInlineStart: "1rem" }, children: A.desc }), pA(GsA, { vizThemeConfig: A.themeKey, name: A.visSpec.name, visualConfig: A.visSpec.config, visualLayout: A.visSpec.layout, visualState: A.visSpec.encodings, type: "remote", computation: async (e) => A.data, appearance: A.dark })] }) })), $2 = u.forwardRef(({ className: A, type: e, ...t }, i) => pA("input", { type: e, className: dn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", A), ref: i, ...t }));
$2.displayName = "Input";
const Uxt = /* @__PURE__ */ u.forwardRef((A, e) => /* @__PURE__ */ u.createElement(ii.label, be({}, A, {
  ref: e,
  onMouseDown: (t) => {
    var i;
    (i = A.onMouseDown) === null || i === void 0 || i.call(A, t), !t.defaultPrevented && t.detail > 1 && t.preventDefault();
  }
}))), tqA = Uxt, Vxt = HX("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"), _b = u.forwardRef(({ className: A, ...e }, t) => pA(tqA, { ref: t, className: dn(Vxt(), A), ...e }));
_b.displayName = tqA.displayName;
function iqA(A) {
  const e = u.useRef({
    value: A,
    previous: A
  });
  return u.useMemo(() => (e.current.value !== A && (e.current.previous = e.current.value, e.current.value = A), e.current.previous), [
    A
  ]);
}
function nqA(A) {
  const [e, t] = u.useState(void 0);
  return AI(() => {
    if (A) {
      t({
        width: A.offsetWidth,
        height: A.offsetHeight
      });
      const i = new ResizeObserver((n) => {
        if (!Array.isArray(n) || !n.length)
          return;
        const o = n[0];
        let g, s;
        if ("borderBoxSize" in o) {
          const I = o.borderBoxSize, r = Array.isArray(I) ? I[0] : I;
          g = r.inlineSize, s = r.blockSize;
        } else
          g = A.offsetWidth, s = A.offsetHeight;
        t({
          width: g,
          height: s
        });
      });
      return i.observe(A, {
        box: "border-box"
      }), () => i.unobserve(A);
    } else
      t(void 0);
  }, [
    A
  ]), e;
}
const oqA = "Checkbox", [Xxt, s9t] = Ah(oqA), [zxt, Txt] = Xxt(oqA), _xt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeCheckbox: t, name: i, checked: n, defaultChecked: o, required: g, disabled: s, value: I = "on", onCheckedChange: r, ...a } = A, [C, B] = u.useState(null), l = On(
    e,
    (f) => B(f)
  ), Q = u.useRef(!1), E = C ? Boolean(C.closest("form")) : !0, [d = !1, m] = yQ({
    prop: n,
    defaultProp: o,
    onChange: r
  }), y = u.useRef(d);
  return u.useEffect(() => {
    const f = C == null ? void 0 : C.form;
    if (f) {
      const w = () => m(y.current);
      return f.addEventListener("reset", w), () => f.removeEventListener("reset", w);
    }
  }, [
    C,
    m
  ]), /* @__PURE__ */ u.createElement(zxt, {
    scope: t,
    state: d,
    disabled: s
  }, /* @__PURE__ */ u.createElement(ii.button, be({
    type: "button",
    role: "checkbox",
    "aria-checked": Tm(d) ? "mixed" : d,
    "aria-required": g,
    "data-state": gqA(d),
    "data-disabled": s ? "" : void 0,
    disabled: s,
    value: I
  }, a, {
    ref: l,
    onKeyDown: qt(A.onKeyDown, (f) => {
      f.key === "Enter" && f.preventDefault();
    }),
    onClick: qt(A.onClick, (f) => {
      m(
        (w) => Tm(w) ? !0 : !w
      ), E && (Q.current = f.isPropagationStopped(), Q.current || f.stopPropagation());
    })
  })), E && /* @__PURE__ */ u.createElement(jxt, {
    control: C,
    bubbles: !Q.current,
    name: i,
    value: I,
    checked: d,
    required: g,
    disabled: s,
    style: {
      transform: "translateX(-100%)"
    }
  }));
}), qxt = "CheckboxIndicator", Oxt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeCheckbox: t, forceMount: i, ...n } = A, o = Txt(qxt, t);
  return /* @__PURE__ */ u.createElement(fG, {
    present: i || Tm(o.state) || o.state === !0
  }, /* @__PURE__ */ u.createElement(ii.span, be({
    "data-state": gqA(o.state),
    "data-disabled": o.disabled ? "" : void 0
  }, n, {
    ref: e,
    style: {
      pointerEvents: "none",
      ...A.style
    }
  })));
}), jxt = (A) => {
  const { control: e, checked: t, bubbles: i = !0, ...n } = A, o = u.useRef(null), g = iqA(t), s = nqA(e);
  return u.useEffect(() => {
    const I = o.current, r = window.HTMLInputElement.prototype, C = Object.getOwnPropertyDescriptor(r, "checked").set;
    if (g !== t && C) {
      const B = new Event("click", {
        bubbles: i
      });
      I.indeterminate = Tm(t), C.call(I, Tm(t) ? !1 : t), I.dispatchEvent(B);
    }
  }, [
    g,
    t,
    i
  ]), /* @__PURE__ */ u.createElement("input", be({
    type: "checkbox",
    "aria-hidden": !0,
    defaultChecked: Tm(t) ? !1 : t
  }, n, {
    tabIndex: -1,
    ref: o,
    style: {
      ...A.style,
      ...s,
      position: "absolute",
      pointerEvents: "none",
      opacity: 0,
      margin: 0
    }
  }));
};
function Tm(A) {
  return A === "indeterminate";
}
function gqA(A) {
  return Tm(A) ? "indeterminate" : A ? "checked" : "unchecked";
}
const sqA = _xt, Pxt = Oxt, jW = u.forwardRef(({ className: A, ...e }, t) => pA(sqA, { ref: t, className: dn("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", A), ...e, children: pA(Pxt, { className: dn("flex items-center justify-center text-current"), children: pA(s4A, { className: "h-4 w-4" }) }) }));
jW.displayName = sqA.displayName;
const $xt = HX("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
  variants: {
    variant: {
      default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
      secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
      destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
      outline: "text-foreground"
    }
  },
  defaultVariants: {
    variant: "default"
  }
}), ALt = NQ((A) => {
  const [e, t] = u.useState(!1), [i, n] = u.useState(""), [o, g] = u.useState(!1), [s, I] = u.useState(""), [r, a] = u.useState("onboarding"), C = (m) => {
    Te.setNotification({
      type: "success",
      title: "Success",
      message: ue(LB, { children: [pA("p", { className: "py-1", children: "upload spec success, please use" }), ue("p", { className: "font-semibold px-1 py-1", children: ['`pyg.walk(df, spec="ksf://', m, '")`'] }), pA("p", { className: "py-1", children: "to rerun pygwalker." })] })
    }, 3e4);
  }, B = async () => {
    var m;
    if (!e) {
      lC.track("click", { entity: "upload_spec_to_cloud_button" }), t(!0);
      try {
        const y = await ((m = ga.comm) == null ? void 0 : m.sendMsg("upload_spec_to_cloud", { fileName: i, newToken: o ? s : "" }, 3e4));
        Te.setUploadSpecModalOpen(!1), C(y == null ? void 0 : y.data.specFilePath), A.setGwIsChanged(!1);
      } finally {
        t(!1);
      }
    }
  }, l = (m) => {
    g(m), I("");
  }, Q = () => {
    var R;
    lC.track("click", { entity: "save_spec_to_local_file_button" });
    const m = (R = A.storeRef.current) == null ? void 0 : R.exportCode(), y = {
      config: m,
      chart_map: {},
      version: Te.version,
      workflow_list: m == null ? void 0 : m.map((F) => AqA(F).workflow)
    }, f = new Blob([JSON.stringify(y)], { type: "text/plain;charset=utf-8" }), w = URL.createObjectURL(f), G = document.createElement("a");
    G.href = w, G.download = `pygwalker_spec_${new Date().getTime()}.json`, G.click(), URL.revokeObjectURL(w), Te.setUploadSpecModalOpen(!1), A.setGwIsChanged(!1);
  };
  u.useEffect(() => {
    a("onboarding");
  }, [Te.uploadSpecModalOpen]);
  const E = ue(oD, { children: [pA(_2, { children: pA(q2, { children: "Save Spec" }) }), ue("div", { className: "grid h-full grid-rows-2 gap-6 lg:grid-cols-2 lg:grid-rows-1", children: [pA("button", { className: "flex flex-col items-start gap-2 rounded-lg border p-3 text-left text-sm transition-all hover:bg-accent", onClick: () => {
    a("upload"), lC.track("click", { entity: "select_upload_spec_to_cloud_button" });
  }, children: pA("div", { className: "flex items-center justify-center h-[160px] w-full", children: pA("span", { className: "font-semibold", children: "upload as cloud file" }) }) }), pA("button", { className: "flex flex-col items-start gap-2 rounded-lg border p-3 text-left text-sm transition-all hover:bg-accent", onClick: Q, children: pA("div", { className: "flex items-center justify-center h-[160px] w-full", children: pA("span", { className: "font-semibold", children: "save as local file" }) }) })] })] }), d = ue(oD, { children: [ue(_2, { children: [pA(q2, { children: "Upload Sepc" }), ue(WX, { children: [pA("p", { className: "py-1", children: "Because you currently don't pass in the spec parameter or the passed in spec parameter is not a writable spec file." }), pA("p", { className: "py-1", children: "Currently the spec configuration is already in your ui cache, you may need to upload kanaries cloud to save it." }), ue("p", { className: "py-1", children: ["If you don't have kanaries_token, you need to get it: ", pA("a", { className: $xt({ variant: "outline" }), href: "https://kanaries.net/analytics/settings?tab=apikey", target: "_blank", children: "Kanaries" })] })] })] }), ue("div", { children: [pA("div", { className: "text-sm max-h-64 overflow-auto p-1", children: pA($2, { value: i, onChange: (m) => {
    n(m.target.value);
  }, type: "text", placeholder: "please input spec file name", id: "chart-name-input", className: "mb-1" }) }), ue("div", { className: "flex items-center justify-end mt-2", children: [pA(jW, { id: "link-checkbox", checked: o, onCheckedChange: (m) => {
    l(m);
  } }), pA(_b, { className: "ml-2", children: "Set a new kanaries_token?" })] }), o && pA("div", { className: "text-sm max-h-64 overflow-auto p-1 mt-2", children: pA($2, { value: s, onChange: (m) => {
    I(m.target.value);
  }, type: "text", autoComplete: "off", placeholder: "please input new kanaries token", id: "token-input" }) }), pA("div", { className: "mt-4 flex justify-end", children: pA(Kc, { variant: "outline", className: "mr-2 px-6", disabled: e, onClick: B, children: e ? "uploading.." : "upload" }) })] })] });
  return ue(ZX, { open: Te.uploadSpecModalOpen, modal: !1, onOpenChange: (m) => {
    Te.setUploadSpecModalOpen(m);
  }, children: [r === "upload" && d, r === "onboarding" && E] });
}), eLt = NQ((A) => {
  const [e, t] = u.useState(!1), [i, n] = u.useState(""), [o, g] = u.useState(""), [s, I] = u.useState(!0), [r, a] = u.useState(!0), [C, B] = u.useState("");
  u.useEffect(() => {
    var E;
    if (Te.uploadChartModalOpen) {
      const d = (((E = A.storeRef.current) == null ? void 0 : E.exportCode().length) || 0) > 1 ? "dashboard" : "chart";
      n(`${d}-${new Date().getTime().toString(16).padStart(16, "0")}`), g(`dataset-${new Date().getTime().toString(16).padStart(16, "0")}`), I(!0), B(d);
    }
  }, [Te.uploadChartModalOpen]);
  const l = (E, d, m) => {
    const y = E === "chart" ? `https://kanaries.net/analytics/c/${d}` : `https://kanaries.net/analytics/d/${d}`, f = E === "chart" ? `https://kanaries.net/analytics/chart/${d}/share?theme=${A.dark}` : `https://kanaries.net/analytics/dashboard/${d}/share?theme=${A.dark}`, w = `https://kanaries.net/analytics/detail/${m}`;
    E === "dashboard" && d === "" ? Te.setNotification({
      type: "success",
      title: "Success",
      message: pA(LB, { children: ue("p", { children: ["Upload success, you can view and manager it at:", pA("a", { className: "font-semibold", href: w, target: "_blank", children: w })] }) })
    }, 3e4) : Te.setNotification({
      type: "success",
      title: "Success",
      message: ue(LB, { children: [ue("p", { children: ["Upload success, you can view and manager it at:", pA("a", { className: "font-semibold", href: y, target: "_blank", children: y })] }), pA("br", {}), s && ue("p", { children: ["Since you set the ", E, " to public, you can also share it with others by:", pA("a", { className: "font-semibold", href: f, target: "_blank", children: f })] })] })
    }, 3e4);
  }, Q = async () => {
    var d, m, y;
    if (e)
      return;
    t(!0), lC.track("click", { entity: "upload_chart_button" });
    const E = (d = A.storeRef.current) == null ? void 0 : d.exportCode();
    try {
      if (C === "dashboard") {
        const f = await ((m = ga.comm) == null ? void 0 : m.sendMsg("upload_to_cloud_dashboard", {
          chartName: i,
          datasetName: o,
          isPublic: s,
          isCreateDashboard: r,
          visSpec: E,
          workflowList: E.map((w) => zq(w).workflow)
        }, 12e4));
        l(C, f == null ? void 0 : f.data.dashboardId, f == null ? void 0 : f.data.datasetId);
      } else {
        const f = await ((y = ga.comm) == null ? void 0 : y.sendMsg("upload_to_cloud_charts", {
          chartName: i,
          datasetName: o,
          isPublic: s,
          visSpec: E,
          workflow: zq(E[0]).workflow
        }, 12e4));
        l(C, f == null ? void 0 : f.data.chartId, f == null ? void 0 : f.data.datasetId);
      }
      Te.setUploadChartModalOpen(!1);
    } finally {
      t(!1);
    }
  };
  return pA(ZX, { open: Te.uploadChartModalOpen, modal: !1, onOpenChange: (E) => {
    Te.setUploadChartModalOpen(E);
  }, children: ue(oD, { children: [ue(_2, { children: [pA(q2, { children: "Upload Chart" }), pA(WX, { children: "upload your charts to dashboard of kanaries cloud." })] }), ue("div", { children: [ue("div", { className: "text-sm max-h-64 overflow-auto p-1 flex flex-col space-y-2", children: [ue("div", { className: "grid w-full max-w-sm items-center gap-1.5", children: [pA(_b, { htmlFor: "dataset-name-input", children: "Dataset Name" }), pA($2, { value: o, onChange: (E) => {
    g(E.target.value);
  }, type: "text", placeholder: "please input dataset name", id: "dataset-name-input", className: "mb-1" })] }), ue("div", { className: "grid w-full max-w-sm items-center gap-1.5", children: [pA(_b, { htmlFor: "chart-name-input", children: C === "dashboard" ? "Dashboard Name" : "Chart Name" }), pA($2, { value: i, onChange: (E) => {
    n(E.target.value);
  }, disabled: !r, type: "text", placeholder: "please input chart name", id: "chart-name-input", className: "mb-1" })] }), ue("div", { className: "items-top flex space-x-2", children: [pA(jW, { id: "public-checkbox", checked: s, onCheckedChange: (E) => {
    I(E);
  } }), ue("div", { className: "grid gap-1.5 leading-none", children: [pA(_b, { htmlFor: "public-checkbox", children: "Is Public?" }), ue("p", { className: "text-sm text-muted-foreground", children: ["Make ", C, " publicly accessible."] })] })] }), C === "dashboard" && ue("div", { className: "items-top flex space-x-2", children: [pA(jW, { id: "create-dashboard-checkbox", checked: r, onCheckedChange: (E) => {
    a(E);
  } }), ue("div", { className: "grid gap-1.5 leading-none", children: [pA(_b, { htmlFor: "create-dashboard-checkbox", children: "Create Dashboard?" }), pA("p", { className: "text-sm text-muted-foreground", children: "Create a dashboard containing all charts, or upload charts individually." })] })] })] }), pA("div", { className: "mt-4 flex justify-end", children: pA(Kc, { variant: "outline", className: "mr-2 px-6", disabled: e, onClick: Q, children: e ? "uploading.." : "upload" }) })] })] }) });
}), tLt = NQ((A) => pA(ZX, { open: Te.initModalOpen, modal: !0, children: ue(oD, { hideClose: !0, children: [ue("div", { className: "flex justify-between mb-1", children: [pA("span", { className: "text-base font-medium text-blue-700 dark:text-white", children: Te.initModalInfo.title }), ue("span", { className: "text-sm font-medium text-blue-700 dark:text-white", children: [Te.initModalInfo.curIndex, " / ", Te.initModalInfo.total] })] }), pA("div", { className: "w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700", children: pA("div", { className: "bg-blue-600 h-2.5 rounded-full", style: { width: `${Math.floor(Te.initModalInfo.curIndex / Te.initModalInfo.total * 100)}%` } }) })] }) }));
function iLt(A, e) {
  if (A.match(/^[a-z]+:\/\//i))
    return A;
  if (A.match(/^\/\//))
    return window.location.protocol + A;
  if (A.match(/^[a-z]+:/i))
    return A;
  const t = document.implementation.createHTMLDocument(), i = t.createElement("base"), n = t.createElement("a");
  return t.head.appendChild(i), t.body.appendChild(n), e && (i.href = e), n.href = A, n.href;
}
const nLt = (() => {
  let A = 0;
  const e = () => (
    // eslint-disable-next-line no-bitwise
    `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4)
  );
  return () => (A += 1, `u${e()}${A}`);
})();
function nQ(A) {
  const e = [];
  for (let t = 0, i = A.length; t < i; t++)
    e.push(A[t]);
  return e;
}
function PW(A, e) {
  const i = (A.ownerDocument.defaultView || window).getComputedStyle(A).getPropertyValue(e);
  return i ? parseFloat(i.replace("px", "")) : 0;
}
function oLt(A) {
  const e = PW(A, "border-left-width"), t = PW(A, "border-right-width");
  return A.clientWidth + e + t;
}
function gLt(A) {
  const e = PW(A, "border-top-width"), t = PW(A, "border-bottom-width");
  return A.clientHeight + e + t;
}
function IqA(A, e = {}) {
  const t = e.width || oLt(A), i = e.height || gLt(A);
  return { width: t, height: i };
}
function sLt() {
  let A, e;
  try {
    e = process;
  } catch {
  }
  const t = e && e.env ? e.env.devicePixelRatio : null;
  return t && (A = parseInt(t, 10), Number.isNaN(A) && (A = 1)), A || window.devicePixelRatio || 1;
}
const dI = 16384;
function ILt(A) {
  (A.width > dI || A.height > dI) && (A.width > dI && A.height > dI ? A.width > A.height ? (A.height *= dI / A.width, A.width = dI) : (A.width *= dI / A.height, A.height = dI) : A.width > dI ? (A.height *= dI / A.width, A.width = dI) : (A.width *= dI / A.height, A.height = dI));
}
function $W(A) {
  return new Promise((e, t) => {
    const i = new Image();
    i.decode = () => e(i), i.onload = () => e(i), i.onerror = t, i.crossOrigin = "anonymous", i.decoding = "async", i.src = A;
  });
}
async function aLt(A) {
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(A)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
}
async function rLt(A, e, t) {
  const i = "http://www.w3.org/2000/svg", n = document.createElementNS(i, "svg"), o = document.createElementNS(i, "foreignObject");
  return n.setAttribute("width", `${e}`), n.setAttribute("height", `${t}`), n.setAttribute("viewBox", `0 0 ${e} ${t}`), o.setAttribute("width", "100%"), o.setAttribute("height", "100%"), o.setAttribute("x", "0"), o.setAttribute("y", "0"), o.setAttribute("externalResourcesRequired", "true"), n.appendChild(o), o.appendChild(A), aLt(n);
}
const zs = (A, e) => {
  if (A instanceof e)
    return !0;
  const t = Object.getPrototypeOf(A);
  return t === null ? !1 : t.constructor.name === e.name || zs(t, e);
};
function CLt(A) {
  const e = A.getPropertyValue("content");
  return `${A.cssText} content: '${e.replace(/'|"/g, "")}';`;
}
function BLt(A) {
  return nQ(A).map((e) => {
    const t = A.getPropertyValue(e), i = A.getPropertyPriority(e);
    return `${e}: ${t}${i ? " !important" : ""};`;
  }).join(" ");
}
function lLt(A, e, t) {
  const i = `.${A}:${e}`, n = t.cssText ? CLt(t) : BLt(t);
  return document.createTextNode(`${i}{${n}}`);
}
function WwA(A, e, t) {
  const i = window.getComputedStyle(A, t), n = i.getPropertyValue("content");
  if (n === "" || n === "none")
    return;
  const o = nLt();
  try {
    e.className = `${e.className} ${o}`;
  } catch {
    return;
  }
  const g = document.createElement("style");
  g.appendChild(lLt(o, t, i)), e.appendChild(g);
}
function cLt(A, e) {
  WwA(A, e, ":before"), WwA(A, e, ":after");
}
const KwA = "application/font-woff", UwA = "image/jpeg", QLt = {
  woff: KwA,
  woff2: KwA,
  ttf: "application/font-truetype",
  eot: "application/vnd.ms-fontobject",
  png: "image/png",
  jpg: UwA,
  jpeg: UwA,
  gif: "image/gif",
  tiff: "image/tiff",
  svg: "image/svg+xml",
  webp: "image/webp"
};
function ELt(A) {
  const e = /\.([^./]*?)$/g.exec(A);
  return e ? e[1] : "";
}
function PIA(A) {
  const e = ELt(A).toLowerCase();
  return QLt[e] || "";
}
function uLt(A) {
  return A.split(/,/)[1];
}
function P6(A) {
  return A.search(/^(data:)/) !== -1;
}
function aqA(A, e) {
  return `data:${e};base64,${A}`;
}
async function rqA(A, e, t) {
  const i = await fetch(A, e);
  if (i.status === 404)
    throw new Error(`Resource "${i.url}" not found`);
  const n = await i.blob();
  return new Promise((o, g) => {
    const s = new FileReader();
    s.onerror = g, s.onloadend = () => {
      try {
        o(t({ res: i, result: s.result }));
      } catch (I) {
        g(I);
      }
    }, s.readAsDataURL(n);
  });
}
const X_ = {};
function dLt(A, e, t) {
  let i = A.replace(/\?.*/, "");
  return t && (i = A), /ttf|otf|eot|woff2?/i.test(i) && (i = i.replace(/.*\//, "")), e ? `[${e}]${i}` : i;
}
async function $IA(A, e, t) {
  const i = dLt(A, e, t.includeQueryParams);
  if (X_[i] != null)
    return X_[i];
  t.cacheBust && (A += (/\?/.test(A) ? "&" : "?") + new Date().getTime());
  let n;
  try {
    const o = await rqA(A, t.fetchRequestInit, ({ res: g, result: s }) => (e || (e = g.headers.get("Content-Type") || ""), uLt(s)));
    n = aqA(o, e);
  } catch (o) {
    n = t.imagePlaceholder || "";
    let g = `Failed to fetch resource: ${A}`;
    o && (g = typeof o == "string" ? o : o.message), g && console.warn(g);
  }
  return X_[i] = n, n;
}
async function hLt(A) {
  const e = A.toDataURL();
  return e === "data:," ? A.cloneNode(!1) : $W(e);
}
async function mLt(A, e) {
  if (A.currentSrc) {
    const o = document.createElement("canvas"), g = o.getContext("2d");
    o.width = A.clientWidth, o.height = A.clientHeight, g == null || g.drawImage(A, 0, 0, o.width, o.height);
    const s = o.toDataURL();
    return $W(s);
  }
  const t = A.poster, i = PIA(t), n = await $IA(t, i, e);
  return $W(n);
}
async function pLt(A) {
  var e;
  try {
    if (!((e = A == null ? void 0 : A.contentDocument) === null || e === void 0) && e.body)
      return await A9(A.contentDocument.body, {}, !0);
  } catch {
  }
  return A.cloneNode(!1);
}
async function yLt(A, e) {
  return zs(A, HTMLCanvasElement) ? hLt(A) : zs(A, HTMLVideoElement) ? mLt(A, e) : zs(A, HTMLIFrameElement) ? pLt(A) : A.cloneNode(!1);
}
const bLt = (A) => A.tagName != null && A.tagName.toUpperCase() === "SLOT";
async function wLt(A, e, t) {
  var i, n;
  let o = [];
  return bLt(A) && A.assignedNodes ? o = nQ(A.assignedNodes()) : zs(A, HTMLIFrameElement) && (!((i = A.contentDocument) === null || i === void 0) && i.body) ? o = nQ(A.contentDocument.body.childNodes) : o = nQ(((n = A.shadowRoot) !== null && n !== void 0 ? n : A).childNodes), o.length === 0 || zs(A, HTMLVideoElement) || await o.reduce((g, s) => g.then(() => A9(s, t)).then((I) => {
    I && e.appendChild(I);
  }), Promise.resolve()), e;
}
function fLt(A, e) {
  const t = e.style;
  if (!t)
    return;
  const i = window.getComputedStyle(A);
  i.cssText ? (t.cssText = i.cssText, t.transformOrigin = i.transformOrigin) : nQ(i).forEach((n) => {
    let o = i.getPropertyValue(n);
    n === "font-size" && o.endsWith("px") && (o = `${Math.floor(parseFloat(o.substring(0, o.length - 2))) - 0.1}px`), zs(A, HTMLIFrameElement) && n === "display" && o === "inline" && (o = "block"), n === "d" && e.getAttribute("d") && (o = `path(${e.getAttribute("d")})`), t.setProperty(n, o, i.getPropertyPriority(n));
  });
}
function DLt(A, e) {
  zs(A, HTMLTextAreaElement) && (e.innerHTML = A.value), zs(A, HTMLInputElement) && e.setAttribute("value", A.value);
}
function GLt(A, e) {
  if (zs(A, HTMLSelectElement)) {
    const t = e, i = Array.from(t.children).find((n) => A.value === n.getAttribute("value"));
    i && i.setAttribute("selected", "");
  }
}
function kLt(A, e) {
  return zs(e, Element) && (fLt(A, e), cLt(A, e), DLt(A, e), GLt(A, e)), e;
}
async function JLt(A, e) {
  const t = A.querySelectorAll ? A.querySelectorAll("use") : [];
  if (t.length === 0)
    return A;
  const i = {};
  for (let o = 0; o < t.length; o++) {
    const s = t[o].getAttribute("xlink:href");
    if (s) {
      const I = A.querySelector(s), r = document.querySelector(s);
      !I && r && !i[s] && (i[s] = await A9(r, e, !0));
    }
  }
  const n = Object.values(i);
  if (n.length) {
    const o = "http://www.w3.org/1999/xhtml", g = document.createElementNS(o, "svg");
    g.setAttribute("xmlns", o), g.style.position = "absolute", g.style.width = "0", g.style.height = "0", g.style.overflow = "hidden", g.style.display = "none";
    const s = document.createElementNS(o, "defs");
    g.appendChild(s);
    for (let I = 0; I < n.length; I++)
      s.appendChild(n[I]);
    A.appendChild(g);
  }
  return A;
}
async function A9(A, e, t) {
  return !t && e.filter && !e.filter(A) ? null : Promise.resolve(A).then((i) => yLt(i, e)).then((i) => wLt(A, i, e)).then((i) => kLt(A, i)).then((i) => JLt(i, e));
}
const CqA = /url\((['"]?)([^'"]+?)\1\)/g, NLt = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, YLt = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
function RLt(A) {
  const e = A.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
  return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`, "g");
}
function FLt(A) {
  const e = [];
  return A.replace(CqA, (t, i, n) => (e.push(n), t)), e.filter((t) => !P6(t));
}
async function MLt(A, e, t, i, n) {
  try {
    const o = t ? iLt(e, t) : e, g = PIA(e);
    let s;
    if (n) {
      const I = await n(o);
      s = aqA(I, g);
    } else
      s = await $IA(o, g, i);
    return A.replace(RLt(e), `$1${s}$3`);
  } catch {
  }
  return A;
}
function xLt(A, { preferredFontFormat: e }) {
  return e ? A.replace(YLt, (t) => {
    for (; ; ) {
      const [i, , n] = NLt.exec(t) || [];
      if (!n)
        return "";
      if (n === e)
        return `src: ${i};`;
    }
  }) : A;
}
function BqA(A) {
  return A.search(CqA) !== -1;
}
async function lqA(A, e, t) {
  if (!BqA(A))
    return A;
  const i = xLt(A, t);
  return FLt(i).reduce((o, g) => o.then((s) => MLt(s, g, e, t)), Promise.resolve(i));
}
async function cL(A, e, t) {
  var i;
  const n = (i = e.style) === null || i === void 0 ? void 0 : i.getPropertyValue(A);
  if (n) {
    const o = await lqA(n, null, t);
    return e.style.setProperty(A, o, e.style.getPropertyPriority(A)), !0;
  }
  return !1;
}
async function LLt(A, e) {
  await cL("background", A, e) || await cL("background-image", A, e), await cL("mask", A, e) || await cL("mask-image", A, e);
}
async function vLt(A, e) {
  const t = zs(A, HTMLImageElement);
  if (!(t && !P6(A.src)) && !(zs(A, SVGImageElement) && !P6(A.href.baseVal)))
    return;
  const i = t ? A.src : A.href.baseVal, n = await $IA(i, PIA(i), e);
  await new Promise((o, g) => {
    A.onload = o, A.onerror = g;
    const s = A;
    s.decode && (s.decode = o), s.loading === "lazy" && (s.loading = "eager"), t ? (A.srcset = "", A.src = n) : A.href.baseVal = n;
  });
}
async function HLt(A, e) {
  const i = nQ(A.childNodes).map((n) => cqA(n, e));
  await Promise.all(i).then(() => A);
}
async function cqA(A, e) {
  zs(A, Element) && (await LLt(A, e), await vLt(A, e), await HLt(A, e));
}
function SLt(A, e) {
  const { style: t } = A;
  e.backgroundColor && (t.backgroundColor = e.backgroundColor), e.width && (t.width = `${e.width}px`), e.height && (t.height = `${e.height}px`);
  const i = e.style;
  return i != null && Object.keys(i).forEach((n) => {
    t[n] = i[n];
  }), A;
}
const VwA = {};
async function XwA(A) {
  let e = VwA[A];
  if (e != null)
    return e;
  const i = await (await fetch(A)).text();
  return e = { url: A, cssText: i }, VwA[A] = e, e;
}
async function zwA(A, e) {
  let t = A.cssText;
  const i = /url\(["']?([^"')]+)["']?\)/g, o = (t.match(/url\([^)]+\)/g) || []).map(async (g) => {
    let s = g.replace(i, "$1");
    return s.startsWith("https://") || (s = new URL(s, A.url).href), rqA(s, e.fetchRequestInit, ({ result: I }) => (t = t.replace(g, `url(${I})`), [g, I]));
  });
  return Promise.all(o).then(() => t);
}
function TwA(A) {
  if (A == null)
    return [];
  const e = [], t = /(\/\*[\s\S]*?\*\/)/gi;
  let i = A.replace(t, "");
  const n = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
  for (; ; ) {
    const I = n.exec(i);
    if (I === null)
      break;
    e.push(I[0]);
  }
  i = i.replace(n, "");
  const o = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, g = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", s = new RegExp(g, "gi");
  for (; ; ) {
    let I = o.exec(i);
    if (I === null) {
      if (I = s.exec(i), I === null)
        break;
      o.lastIndex = s.lastIndex;
    } else
      s.lastIndex = o.lastIndex;
    e.push(I[0]);
  }
  return e;
}
async function ZLt(A, e) {
  const t = [], i = [];
  return A.forEach((n) => {
    if ("cssRules" in n)
      try {
        nQ(n.cssRules || []).forEach((o, g) => {
          if (o.type === CSSRule.IMPORT_RULE) {
            let s = g + 1;
            const I = o.href, r = XwA(I).then((a) => zwA(a, e)).then((a) => TwA(a).forEach((C) => {
              try {
                n.insertRule(C, C.startsWith("@import") ? s += 1 : n.cssRules.length);
              } catch (B) {
                console.error("Error inserting rule from remote css", {
                  rule: C,
                  error: B
                });
              }
            })).catch((a) => {
              console.error("Error loading remote css", a.toString());
            });
            i.push(r);
          }
        });
      } catch (o) {
        const g = A.find((s) => s.href == null) || document.styleSheets[0];
        n.href != null && i.push(XwA(n.href).then((s) => zwA(s, e)).then((s) => TwA(s).forEach((I) => {
          g.insertRule(I, n.cssRules.length);
        })).catch((s) => {
          console.error("Error loading remote stylesheet", s);
        })), console.error("Error inlining remote css file", o);
      }
  }), Promise.all(i).then(() => (A.forEach((n) => {
    if ("cssRules" in n)
      try {
        nQ(n.cssRules || []).forEach((o) => {
          t.push(o);
        });
      } catch (o) {
        console.error(`Error while reading CSS rules from ${n.href}`, o);
      }
  }), t));
}
function WLt(A) {
  return A.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => BqA(e.style.getPropertyValue("src")));
}
async function KLt(A, e) {
  if (A.ownerDocument == null)
    throw new Error("Provided element is not within a Document");
  const t = nQ(A.ownerDocument.styleSheets), i = await ZLt(t, e);
  return WLt(i);
}
async function ULt(A, e) {
  const t = await KLt(A, e);
  return (await Promise.all(t.map((n) => {
    const o = n.parentStyleSheet ? n.parentStyleSheet.href : null;
    return lqA(n.cssText, o, e);
  }))).join(`
`);
}
async function VLt(A, e) {
  const t = e.fontEmbedCSS != null ? e.fontEmbedCSS : e.skipFonts ? null : await ULt(A, e);
  if (t) {
    const i = document.createElement("style"), n = document.createTextNode(t);
    i.appendChild(n), A.firstChild ? A.insertBefore(i, A.firstChild) : A.appendChild(i);
  }
}
async function XLt(A, e = {}) {
  const { width: t, height: i } = IqA(A, e), n = await A9(A, e, !0);
  return await VLt(n, e), await cqA(n, e), SLt(n, e), await rLt(n, t, i);
}
async function zLt(A, e = {}) {
  const { width: t, height: i } = IqA(A, e), n = await XLt(A, e), o = await $W(n), g = document.createElement("canvas"), s = g.getContext("2d"), I = e.pixelRatio || sLt(), r = e.canvasWidth || t, a = e.canvasHeight || i;
  return g.width = r * I, g.height = a * I, e.skipAutoScale || ILt(g), g.style.width = `${r}`, g.style.height = `${a}`, e.backgroundColor && (s.fillStyle = e.backgroundColor, s.fillRect(0, 0, g.width, g.height)), s.drawImage(o, 0, 0, g.width, g.height), g;
}
async function TLt(A, e = {}) {
  return (await zLt(A, e)).toDataURL();
}
async function QqA(A) {
  const e = A.container();
  if (e === null)
    return {
      ...A,
      singleChart: ""
    };
  if (A.charts.length === 0)
    return {
      ...A,
      nCols: 1,
      nRows: 1,
      charts: [{
        colIndex: 0,
        rowIndex: 0,
        width: e == null ? void 0 : e.clientWidth,
        height: e == null ? void 0 : e.clientHeight,
        canvasWidth: e == null ? void 0 : e.clientWidth,
        canvasHeight: e == null ? void 0 : e.clientHeight,
        data: "",
        canvas: () => null
      }],
      singleChart: ""
    };
  {
    const t = await TLt(e, { width: e == null ? void 0 : e.scrollWidth, height: e == null ? void 0 : e.scrollHeight });
    return {
      ...A,
      singleChart: t
    };
  }
}
function _Lt({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
  }));
}
const qLt = u.forwardRef(_Lt), z_ = qLt;
function OLt({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M14.25 9.75L16.5 12l-2.25 2.25m-4.5 0L7.5 12l2.25-2.25M6 20.25h12A2.25 2.25 0 0020.25 18V6A2.25 2.25 0 0018 3.75H6A2.25 2.25 0 003.75 6v12A2.25 2.25 0 006 20.25z"
  }));
}
const jLt = u.forwardRef(OLt), PLt = jLt;
function $Lt({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m.75 12l3 3m0 0l3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
  }));
}
const Avt = u.forwardRef($Lt), evt = Avt;
function tvt({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    fill: "none",
    viewBox: "0 0 24 24",
    strokeWidth: 1.5,
    stroke: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    strokeLinecap: "round",
    strokeLinejoin: "round",
    d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
  }));
}
const ivt = u.forwardRef(tvt), EqA = ivt;
/**
 * @license lucide-react v0.341.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
var nvt = {
  xmlns: "http://www.w3.org/2000/svg",
  width: 24,
  height: 24,
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  strokeWidth: 2,
  strokeLinecap: "round",
  strokeLinejoin: "round"
};
/**
 * @license lucide-react v0.341.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const ovt = (A) => A.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim(), gvt = (A, e) => {
  const t = u.forwardRef(
    ({
      color: i = "currentColor",
      size: n = 24,
      strokeWidth: o = 2,
      absoluteStrokeWidth: g,
      className: s = "",
      children: I,
      ...r
    }, a) => u.createElement(
      "svg",
      {
        ref: a,
        ...nvt,
        width: n,
        height: n,
        stroke: i,
        strokeWidth: g ? Number(o) * 24 / Number(n) : o,
        className: ["lucide", `lucide-${ovt(A)}`, s].join(" "),
        ...r
      },
      [
        ...e.map(([C, B]) => u.createElement(C, B)),
        ...Array.isArray(I) ? I : [I]
      ]
    )
  );
  return t.displayName = `${A}`, t;
};
/**
 * @license lucide-react v0.341.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const uqA = gvt("Loader2", [
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
]);
function svt(A) {
  return ue("div", { style: { position: "relative" }, children: [pA(EqA, { ...A }), pA("div", { style: { position: "absolute", top: "-2px", right: "-2px", width: "4px", height: "4px", borderRadius: "50%", backgroundColor: "red" } })] });
}
function Ivt(A, e, t, i, n) {
  const [o, g] = u.useState(!1), s = u.useMemo(() => dbA() && Te.showCloudTool, [Te.showCloudTool]), I = () => {
    Te.setNotification({
      type: "success",
      title: "Tips",
      message: "save success."
    }, 4e3), setTimeout(() => {
      g(!1);
    }, 500);
  }, r = async (C) => {
    var l, Q, E, d, m, y, f, w;
    if (o)
      return;
    if (g(!0), lC.track("click", { entity: `save_${C}`, spec_type: A.specType }), ((l = e.current) == null ? void 0 : l.exportChart) === void 0) {
      I();
      return;
    }
    let B = await ((Q = e.current) == null ? void 0 : Q.exportChart("data-url"));
    try {
      const G = (E = t.current) == null ? void 0 : E.exportCode();
      if (G === void 0)
        throw new Error("visSpec is undefined");
      if (((d = t.current) == null ? void 0 : d.visIndex) !== void 0) {
        const R = G[(m = t.current) == null ? void 0 : m.visIndex];
        R.layout.size.mode === "auto" && (R.layout.size.width = ((y = B.container()) == null ? void 0 : y.clientWidth) || 320, R.layout.size.height = ((f = B.container()) == null ? void 0 : f.clientHeight) || 200);
      }
      await ((w = ga.comm) == null ? void 0 : w.sendMsg("update_spec", {
        visSpec: G,
        chartData: await QqA(B),
        workflowList: G.map((R) => zq(R))
      }));
    } finally {
      g(!1);
    }
    ["json_file", "json_ksf"].indexOf(A.specType) === -1 ? dbA() && Te.showCloudTool ? Te.setUploadSpecModalOpen(!0) : Te.setNotification({
      type: "warning",
      title: "Tips",
      message: "spec params is not 'json_file', save is not supported."
    }, 4e3) : (n(!1), I());
  }, a = () => {
    Te.setUploadChartModalOpen(!0), lC.track("click", { entity: "save_icon_form_upload", spec_type: A.specType });
  };
  return u.useEffect(() => {
    let C = !1;
    document.addEventListener("keydown", (B) => {
      if ((B.metaKey || B.ctrlKey) && B.key === "s") {
        if (B.preventDefault(), C)
          return;
        C = !0, r("from_keyboard").then(() => {
          C = !1;
        });
      }
    });
  }, []), {
    key: "save",
    label: "save",
    icon: (C) => o ? pA(uqA, { className: "animate-spin" }) : i ? pA(svt, { ...C }) : pA(EqA, { ...C }),
    form: ue("div", { className: "flex flex-col", children: [pA(Kc, { variant: "ghost", "aria-label": "save spec", onClick: () => r("icon_form_save"), children: "save spec" }), s && pA(Kc, { variant: "ghost", "aria-label": "upload chart", onClick: a, children: "upload chart" })] }),
    onClick: () => r("icon")
  };
}
function avt(A) {
  return {
    key: "export_pygwalker_code",
    label: "export_code",
    icon: (t) => pA(PLt, { ...t }),
    onClick: () => {
      A(!0), lC.track("click", { entity: "export_code_icon" });
    }
  };
}
function rvt(A, e) {
  const [t, i] = u.useState(!1), n = () => {
    Te.setNotification({
      type: "success",
      title: "Tips",
      message: ue(LB, { children: [pA("p", { className: "py-1", children: "export success, created new dataframe: " }), pA("p", { className: "font-semibold py-1", children: "`walker.last_exported_dataframe`" }), pA("p", { className: "py-1", children: "if you forgot set variable walker, you can use" }), pA("p", { className: "font-semibold py-1", children: "`pyg.GlobalVarManager.last_exported_dataframe`" }), pA("p", { className: "py-1", children: "to get current exported dataframe" })] })
    }, 2e4), setTimeout(() => {
      i(!1);
    }, 500);
  };
  return {
    key: "export_dataframe",
    label: "export_dataframe",
    icon: (g) => t ? pA(uqA, { className: "animate-spin" }) : pA(evt, { ...g }),
    onClick: async () => {
      var g, s, I, r, a, C;
      if (!t) {
        i(!0), lC.track("click", { entity: "export_dataframe_icon" });
        try {
          if (A.parseDslType === "server")
            await ((I = ga.comm) == null ? void 0 : I.sendMsg("export_dataframe_by_payload", {
              payload: {
                workflow: (g = e.current) == null ? void 0 : g.workflow
              },
              encodings: (s = e.current) == null ? void 0 : s.currentVis.encodings
            }));
          else {
            const B = Q_A("pygwalker_mid_table", JSON.stringify({ workflow: (r = e.current) == null ? void 0 : r.workflow }), JSON.stringify({ pygwalker_mid_table: A.fieldMetas }));
            await ((C = ga.comm) == null ? void 0 : C.sendMsg("export_dataframe_by_sql", {
              sql: B,
              encodings: (a = e.current) == null ? void 0 : a.currentVis.encodings
            }));
          }
          n();
        } catch {
          i(!1);
        }
      }
    }
  };
}
var Cvt = Object.defineProperty, Bvt = (A, e, t) => e in A ? Cvt(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t, T_ = (A, e, t) => (Bvt(A, typeof e != "symbol" ? e + "" : e, t), t);
let lvt = class {
  constructor() {
    T_(this, "current", this.detect()), T_(this, "handoffState", "pending"), T_(this, "currentId", 0);
  }
  set(e) {
    this.current !== e && (this.handoffState = "pending", this.currentId = 0, this.current = e);
  }
  reset() {
    this.set(this.detect());
  }
  nextId() {
    return ++this.currentId;
  }
  get isServer() {
    return this.current === "server";
  }
  get isClient() {
    return this.current === "client";
  }
  detect() {
    return typeof window > "u" || typeof document > "u" ? "server" : "client";
  }
  handoff() {
    this.handoffState === "pending" && (this.handoffState = "complete");
  }
  get isHandoffComplete() {
    return this.handoffState === "complete";
  }
}, Rv = new lvt(), e9 = (A, e) => {
  Rv.isServer ? u.useEffect(A, e) : u.useLayoutEffect(A, e);
};
function Mw(A) {
  let e = u.useRef(A);
  return e9(() => {
    e.current = A;
  }, [A]), e;
}
function cvt(A) {
  typeof queueMicrotask == "function" ? queueMicrotask(A) : Promise.resolve().then(A).catch((e) => setTimeout(() => {
    throw e;
  }));
}
function k1() {
  let A = [], e = { addEventListener(t, i, n, o) {
    return t.addEventListener(i, n, o), e.add(() => t.removeEventListener(i, n, o));
  }, requestAnimationFrame(...t) {
    let i = requestAnimationFrame(...t);
    return e.add(() => cancelAnimationFrame(i));
  }, nextFrame(...t) {
    return e.requestAnimationFrame(() => e.requestAnimationFrame(...t));
  }, setTimeout(...t) {
    let i = setTimeout(...t);
    return e.add(() => clearTimeout(i));
  }, microTask(...t) {
    let i = { current: !0 };
    return cvt(() => {
      i.current && t[0]();
    }), e.add(() => {
      i.current = !1;
    });
  }, style(t, i, n) {
    let o = t.style.getPropertyValue(i);
    return Object.assign(t.style, { [i]: n }), this.add(() => {
      Object.assign(t.style, { [i]: o });
    });
  }, group(t) {
    let i = k1();
    return t(i), this.add(() => i.dispose());
  }, add(t) {
    return A.push(t), () => {
      let i = A.indexOf(t);
      if (i >= 0)
        for (let n of A.splice(i, 1))
          n();
    };
  }, dispose() {
    for (let t of A.splice(0))
      t();
  } };
  return e;
}
function dqA() {
  let [A] = u.useState(k1);
  return u.useEffect(() => () => A.dispose(), [A]), A;
}
let fm = function(A) {
  let e = Mw(A);
  return b.useCallback((...t) => e.current(...t), [e]);
};
function hqA() {
  let [A, e] = u.useState(Rv.isHandoffComplete);
  return A && Rv.isHandoffComplete === !1 && e(!1), u.useEffect(() => {
    A !== !0 && e(!0);
  }, [A]), u.useEffect(() => Rv.handoff(), []), A;
}
function xB(A, e, ...t) {
  if (A in e) {
    let n = e[A];
    return typeof n == "function" ? n(...t) : n;
  }
  let i = new Error(`Tried to handle "${A}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map((n) => `"${n}"`).join(", ")}.`);
  throw Error.captureStackTrace && Error.captureStackTrace(i, xB), i;
}
let Qvt = Symbol();
function mqA(...A) {
  let e = u.useRef(A);
  u.useEffect(() => {
    e.current = A;
  }, [A]);
  let t = fm((i) => {
    for (let n of e.current)
      n != null && (typeof n == "function" ? n(i) : n.current = i);
  });
  return A.every((i) => i == null || (i == null ? void 0 : i[Qvt])) ? void 0 : t;
}
function $6(...A) {
  return A.filter(Boolean).join(" ");
}
var pqA = ((A) => (A[A.None = 0] = "None", A[A.RenderStrategy = 1] = "RenderStrategy", A[A.Static = 2] = "Static", A))(pqA || {}), Uc = ((A) => (A[A.Unmount = 0] = "Unmount", A[A.Hidden = 1] = "Hidden", A))(Uc || {});
function yqA({ ourProps: A, theirProps: e, slot: t, defaultTag: i, features: n, visible: o = !0, name: g }) {
  let s = bqA(e, A);
  if (o)
    return QL(s, t, i, g);
  let I = n ?? 0;
  if (I & 2) {
    let { static: r = !1, ...a } = s;
    if (r)
      return QL(a, t, i, g);
  }
  if (I & 1) {
    let { unmount: r = !0, ...a } = s;
    return xB(r ? 0 : 1, { [0]() {
      return null;
    }, [1]() {
      return QL({ ...a, hidden: !0, style: { display: "none" } }, t, i, g);
    } });
  }
  return QL(s, t, i, g);
}
function QL(A, e = {}, t, i) {
  let { as: n = t, children: o, refName: g = "ref", ...s } = __(A, ["unmount", "static"]), I = A.ref !== void 0 ? { [g]: A.ref } : {}, r = typeof o == "function" ? o(e) : o;
  "className" in s && s.className && typeof s.className == "function" && (s.className = s.className(e));
  let a = {};
  if (e) {
    let C = !1, B = [];
    for (let [l, Q] of Object.entries(e))
      typeof Q == "boolean" && (C = !0), Q === !0 && B.push(l);
    C && (a["data-headlessui-state"] = B.join(" "));
  }
  if (n === u.Fragment && Object.keys(_wA(s)).length > 0) {
    if (!u.isValidElement(r) || Array.isArray(r) && r.length > 1)
      throw new Error(['Passing props on "Fragment"!', "", `The current component <${i} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(s).map((Q) => `  - ${Q}`).join(`
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((Q) => `  - ${Q}`).join(`
`)].join(`
`));
    let C = r.props, B = typeof (C == null ? void 0 : C.className) == "function" ? (...Q) => $6(C == null ? void 0 : C.className(...Q), s.className) : $6(C == null ? void 0 : C.className, s.className), l = B ? { className: B } : {};
    return u.cloneElement(r, Object.assign({}, bqA(r.props, _wA(__(s, ["ref"]))), a, I, Evt(r.ref, I.ref), l));
  }
  return u.createElement(n, Object.assign({}, __(s, ["ref"]), n !== u.Fragment && I, n !== u.Fragment && a), r);
}
function Evt(...A) {
  return { ref: A.every((e) => e == null) ? void 0 : (e) => {
    for (let t of A)
      t != null && (typeof t == "function" ? t(e) : t.current = e);
  } };
}
function bqA(...A) {
  if (A.length === 0)
    return {};
  if (A.length === 1)
    return A[0];
  let e = {}, t = {};
  for (let i of A)
    for (let n in i)
      n.startsWith("on") && typeof i[n] == "function" ? (t[n] != null || (t[n] = []), t[n].push(i[n])) : e[n] = i[n];
  if (e.disabled || e["aria-disabled"])
    return Object.assign(e, Object.fromEntries(Object.keys(t).map((i) => [i, void 0])));
  for (let i in t)
    Object.assign(e, { [i](n, ...o) {
      let g = t[i];
      for (let s of g) {
        if ((n instanceof Event || (n == null ? void 0 : n.nativeEvent) instanceof Event) && n.defaultPrevented)
          return;
        s(n, ...o);
      }
    } });
  return e;
}
function AaA(A) {
  var e;
  return Object.assign(u.forwardRef(A), { displayName: (e = A.displayName) != null ? e : A.name });
}
function _wA(A) {
  let e = Object.assign({}, A);
  for (let t in e)
    e[t] === void 0 && delete e[t];
  return e;
}
function __(A, e = []) {
  let t = Object.assign({}, A);
  for (let i of e)
    i in t && delete t[i];
  return t;
}
let eaA = u.createContext(null);
eaA.displayName = "OpenClosedContext";
var bc = ((A) => (A[A.Open = 1] = "Open", A[A.Closed = 2] = "Closed", A[A.Closing = 4] = "Closing", A[A.Opening = 8] = "Opening", A))(bc || {});
function wqA() {
  return u.useContext(eaA);
}
function uvt({ value: A, children: e }) {
  return b.createElement(eaA.Provider, { value: A }, e);
}
function taA() {
  let A = u.useRef(!1);
  return e9(() => (A.current = !0, () => {
    A.current = !1;
  }), []), A;
}
function dvt(A = 0) {
  let [e, t] = u.useState(A), i = taA(), n = u.useCallback((I) => {
    i.current && t((r) => r | I);
  }, [e, i]), o = u.useCallback((I) => Boolean(e & I), [e]), g = u.useCallback((I) => {
    i.current && t((r) => r & ~I);
  }, [t, i]), s = u.useCallback((I) => {
    i.current && t((r) => r ^ I);
  }, [t]);
  return { flags: e, addFlag: n, hasFlag: o, removeFlag: g, toggleFlag: s };
}
function hvt(A) {
  let e = { called: !1 };
  return (...t) => {
    if (!e.called)
      return e.called = !0, A(...t);
  };
}
function q_(A, ...e) {
  A && e.length > 0 && A.classList.add(...e);
}
function O_(A, ...e) {
  A && e.length > 0 && A.classList.remove(...e);
}
function mvt(A, e) {
  let t = k1();
  if (!A)
    return t.dispose;
  let { transitionDuration: i, transitionDelay: n } = getComputedStyle(A), [o, g] = [i, n].map((I) => {
    let [r = 0] = I.split(",").filter(Boolean).map((a) => a.includes("ms") ? parseFloat(a) : parseFloat(a) * 1e3).sort((a, C) => C - a);
    return r;
  }), s = o + g;
  if (s !== 0) {
    t.group((r) => {
      r.setTimeout(() => {
        e(), r.dispose();
      }, s), r.addEventListener(A, "transitionrun", (a) => {
        a.target === a.currentTarget && r.dispose();
      });
    });
    let I = t.addEventListener(A, "transitionend", (r) => {
      r.target === r.currentTarget && (e(), I());
    });
  } else
    e();
  return t.add(() => e()), t.dispose;
}
function pvt(A, e, t, i) {
  let n = t ? "enter" : "leave", o = k1(), g = i !== void 0 ? hvt(i) : () => {
  };
  n === "enter" && (A.removeAttribute("hidden"), A.style.display = "");
  let s = xB(n, { enter: () => e.enter, leave: () => e.leave }), I = xB(n, { enter: () => e.enterTo, leave: () => e.leaveTo }), r = xB(n, { enter: () => e.enterFrom, leave: () => e.leaveFrom });
  return O_(A, ...e.enter, ...e.enterTo, ...e.enterFrom, ...e.leave, ...e.leaveFrom, ...e.leaveTo, ...e.entered), q_(A, ...s, ...r), o.nextFrame(() => {
    O_(A, ...r), q_(A, ...I), mvt(A, () => (O_(A, ...s), q_(A, ...e.entered), g()));
  }), o.dispose;
}
function yvt({ container: A, direction: e, classes: t, onStart: i, onStop: n }) {
  let o = taA(), g = dqA(), s = Mw(e);
  e9(() => {
    let I = k1();
    g.add(I.dispose);
    let r = A.current;
    if (r && s.current !== "idle" && o.current)
      return I.dispose(), i.current(s.current), I.add(pvt(r, t.current, s.current === "enter", () => {
        I.dispose(), n.current(s.current);
      })), I.dispose;
  }, [e]);
}
function Sh(A = "") {
  return A.split(" ").filter((e) => e.trim().length > 1);
}
let t9 = u.createContext(null);
t9.displayName = "TransitionContext";
var bvt = ((A) => (A.Visible = "visible", A.Hidden = "hidden", A))(bvt || {});
function wvt() {
  let A = u.useContext(t9);
  if (A === null)
    throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
  return A;
}
function fvt() {
  let A = u.useContext(i9);
  if (A === null)
    throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
  return A;
}
let i9 = u.createContext(null);
i9.displayName = "NestingContext";
function n9(A) {
  return "children" in A ? n9(A.children) : A.current.filter(({ el: e }) => e.current !== null).filter(({ state: e }) => e === "visible").length > 0;
}
function fqA(A, e) {
  let t = Mw(A), i = u.useRef([]), n = taA(), o = dqA(), g = fm((l, Q = Uc.Hidden) => {
    let E = i.current.findIndex(({ el: d }) => d === l);
    E !== -1 && (xB(Q, { [Uc.Unmount]() {
      i.current.splice(E, 1);
    }, [Uc.Hidden]() {
      i.current[E].state = "hidden";
    } }), o.microTask(() => {
      var d;
      !n9(i) && n.current && ((d = t.current) == null || d.call(t));
    }));
  }), s = fm((l) => {
    let Q = i.current.find(({ el: E }) => E === l);
    return Q ? Q.state !== "visible" && (Q.state = "visible") : i.current.push({ el: l, state: "visible" }), () => g(l, Uc.Unmount);
  }), I = u.useRef([]), r = u.useRef(Promise.resolve()), a = u.useRef({ enter: [], leave: [], idle: [] }), C = fm((l, Q, E) => {
    I.current.splice(0), e && (e.chains.current[Q] = e.chains.current[Q].filter(([d]) => d !== l)), e == null || e.chains.current[Q].push([l, new Promise((d) => {
      I.current.push(d);
    })]), e == null || e.chains.current[Q].push([l, new Promise((d) => {
      Promise.all(a.current[Q].map(([m, y]) => y)).then(() => d());
    })]), Q === "enter" ? r.current = r.current.then(() => e == null ? void 0 : e.wait.current).then(() => E(Q)) : E(Q);
  }), B = fm((l, Q, E) => {
    Promise.all(a.current[Q].splice(0).map(([d, m]) => m)).then(() => {
      var d;
      (d = I.current.shift()) == null || d();
    }).then(() => E(Q));
  });
  return u.useMemo(() => ({ children: i, register: s, unregister: g, onStart: C, onStop: B, wait: r, chains: a }), [s, g, i, C, B, a, r]);
}
function Dvt() {
}
let Gvt = ["beforeEnter", "afterEnter", "beforeLeave", "afterLeave"];
function qwA(A) {
  var e;
  let t = {};
  for (let i of Gvt)
    t[i] = (e = A[i]) != null ? e : Dvt;
  return t;
}
function kvt(A) {
  let e = u.useRef(qwA(A));
  return u.useEffect(() => {
    e.current = qwA(A);
  }, [A]), e;
}
let Jvt = "div", DqA = pqA.RenderStrategy;
function Nvt(A, e) {
  let { beforeEnter: t, afterEnter: i, beforeLeave: n, afterLeave: o, enter: g, enterFrom: s, enterTo: I, entered: r, leave: a, leaveFrom: C, leaveTo: B, ...l } = A, Q = u.useRef(null), E = mqA(Q, e), d = l.unmount ? Uc.Unmount : Uc.Hidden, { show: m, appear: y, initial: f } = wvt(), [w, G] = u.useState(m ? "visible" : "hidden"), R = fvt(), { register: F, unregister: Z } = R, c = u.useRef(null);
  u.useEffect(() => F(Q), [F, Q]), u.useEffect(() => {
    if (d === Uc.Hidden && Q.current) {
      if (m && w !== "visible") {
        G("visible");
        return;
      }
      return xB(w, { hidden: () => Z(Q), visible: () => F(Q) });
    }
  }, [w, Q, F, Z, m, d]);
  let J = Mw({ enter: Sh(g), enterFrom: Sh(s), enterTo: Sh(I), entered: Sh(r), leave: Sh(a), leaveFrom: Sh(C), leaveTo: Sh(B) }), p = kvt({ beforeEnter: t, afterEnter: i, beforeLeave: n, afterLeave: o }), N = hqA();
  u.useEffect(() => {
    if (N && w === "visible" && Q.current === null)
      throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
  }, [Q, w, N]);
  let v = f && !y, K = (() => !N || v || c.current === m ? "idle" : m ? "enter" : "leave")(), U = dvt(0), j = fm((tA) => xB(tA, { enter: () => {
    U.addFlag(bc.Opening), p.current.beforeEnter();
  }, leave: () => {
    U.addFlag(bc.Closing), p.current.beforeLeave();
  }, idle: () => {
  } })), q = fm((tA) => xB(tA, { enter: () => {
    U.removeFlag(bc.Opening), p.current.afterEnter();
  }, leave: () => {
    U.removeFlag(bc.Closing), p.current.afterLeave();
  }, idle: () => {
  } })), O = fqA(() => {
    G("hidden"), Z(Q);
  }, R);
  yvt({ container: Q, classes: J, direction: K, onStart: Mw((tA) => {
    O.onStart(Q, tA, j);
  }), onStop: Mw((tA) => {
    O.onStop(Q, tA, q), tA === "leave" && !n9(O) && (G("hidden"), Z(Q));
  }) }), u.useEffect(() => {
    v && (d === Uc.Hidden ? c.current = null : c.current = m);
  }, [m, v, w]);
  let $ = l, _ = { ref: E };
  return y && m && ($ = { ...$, className: $6(l.className, ...J.current.enter, ...J.current.enterFrom) }), b.createElement(i9.Provider, { value: O }, b.createElement(uvt, { value: xB(w, { visible: bc.Open, hidden: bc.Closed }) | U.flags }, yqA({ ourProps: _, theirProps: $, defaultTag: Jvt, features: DqA, visible: w === "visible", name: "Transition.Child" })));
}
function Yvt(A, e) {
  let { show: t, appear: i = !1, unmount: n, ...o } = A, g = u.useRef(null), s = mqA(g, e);
  hqA();
  let I = wqA();
  if (t === void 0 && I !== null && (t = (I & bc.Open) === bc.Open), ![!0, !1].includes(t))
    throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
  let [r, a] = u.useState(t ? "visible" : "hidden"), C = fqA(() => {
    a("hidden");
  }), [B, l] = u.useState(!0), Q = u.useRef([t]);
  e9(() => {
    B !== !1 && Q.current[Q.current.length - 1] !== t && (Q.current.push(t), l(!1));
  }, [Q, t]);
  let E = u.useMemo(() => ({ show: t, appear: i, initial: B }), [t, i, B]);
  u.useEffect(() => {
    if (t)
      a("visible");
    else if (!n9(C))
      a("hidden");
    else {
      let m = g.current;
      if (!m)
        return;
      let y = m.getBoundingClientRect();
      y.x === 0 && y.y === 0 && y.width === 0 && y.height === 0 && a("hidden");
    }
  }, [t, C]);
  let d = { unmount: n };
  return b.createElement(i9.Provider, { value: C }, b.createElement(t9.Provider, { value: E }, yqA({ ourProps: { ...d, as: u.Fragment, children: b.createElement(GqA, { ref: s, ...d, ...o }) }, theirProps: {}, defaultTag: u.Fragment, features: DqA, visible: r === "visible", name: "Transition" })));
}
function Rvt(A, e) {
  let t = u.useContext(t9) !== null, i = wqA() !== null;
  return b.createElement(b.Fragment, null, !t && i ? b.createElement(A8, { ref: e, ...A }) : b.createElement(GqA, { ref: e, ...A }));
}
let A8 = AaA(Yvt), GqA = AaA(Nvt), Fvt = AaA(Rvt), Mvt = Object.assign(A8, { Child: Fvt, Root: A8 });
function xvt({
  title: A,
  titleId: e,
  ...t
}, i) {
  return /* @__PURE__ */ u.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 20 20",
    fill: "currentColor",
    "aria-hidden": "true",
    ref: i,
    "aria-labelledby": e
  }, t), A ? /* @__PURE__ */ u.createElement("title", {
    id: e
  }, A) : null, /* @__PURE__ */ u.createElement("path", {
    d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
  }));
}
const Lvt = u.forwardRef(xvt), kqA = Lvt;
function vvt(A) {
  switch (A) {
    case "success":
      return pA(z_, { className: "h-6 w-6 text-green-400", "aria-hidden": "true" });
    case "error":
      return pA(kqA, { className: "h-6 w-6 text-red-400", "aria-hidden": "true" });
    case "info":
      return pA(z_, { className: "h-6 w-6 text-blue-400", "aria-hidden": "true" });
    case "warning":
      return pA(z_, { className: "h-6 w-6 text-yellow-400", "aria-hidden": "true" });
  }
}
const Hvt = NQ(() => pA("div", { children: Te.notification && pA("div", { "aria-live": "assertive", className: "pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-[25539]", children: pA("div", { className: "flex w-full flex-col items-center space-y-4 sm:items-end", children: pA(Mvt, { show: Te.notification != null, as: u.Fragment, enter: "transform ease-out duration-300 transition", enterFrom: "translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2", enterTo: "translate-y-0 opacity-100 sm:translate-x-0", leave: "transition ease-in duration-100", leaveFrom: "opacity-100", leaveTo: "opacity-0", children: pA("div", { className: "pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-zinc-700 shadow-lg ring-1 ring-black ring-opacity-5", children: pA("div", { className: "p-4", children: ue("div", { className: "flex items-start", children: [pA("div", { className: "flex-shrink-0", children: vvt(Te.notification.type) }), ue("div", { className: "ml-3 w-0 flex-1 pt-0.5", children: [pA("p", { className: "text-sm font-medium text-gray-50", children: Te.notification.title }), pA("p", { className: "mt-1 text-sm text-gray-300", children: Te.notification.message })] }), pA("div", { className: "ml-4 flex flex-shrink-0", children: ue("button", { type: "button", className: "inline-flex rounded-md bg-zinc-900 text-gray-400 hover:text-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2", onClick: () => {
  Te.setNotification(null);
}, children: [pA("span", { className: "sr-only", children: "Close" }), pA(kqA, { className: "h-5 w-5", "aria-hidden": "true" })] }) })] }) }) }) }) }) }) }));
function OwA(A, [e, t]) {
  return Math.min(t, Math.max(e, A));
}
const Svt = ["top", "right", "bottom", "left"], yd = Math.min, NI = Math.max, AK = Math.round, EL = Math.floor, bd = (A) => ({
  x: A,
  y: A
}), Zvt = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
}, Wvt = {
  start: "end",
  end: "start"
};
function e8(A, e, t) {
  return NI(A, yd(e, t));
}
function fQ(A, e) {
  return typeof A == "function" ? A(e) : A;
}
function DQ(A) {
  return A.split("-")[0];
}
function RG(A) {
  return A.split("-")[1];
}
function iaA(A) {
  return A === "x" ? "y" : "x";
}
function naA(A) {
  return A === "y" ? "height" : "width";
}
function FG(A) {
  return ["top", "bottom"].includes(DQ(A)) ? "y" : "x";
}
function oaA(A) {
  return iaA(FG(A));
}
function Kvt(A, e, t) {
  t === void 0 && (t = !1);
  const i = RG(A), n = oaA(A), o = naA(n);
  let g = n === "x" ? i === (t ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
  return e.reference[o] > e.floating[o] && (g = eK(g)), [g, eK(g)];
}
function Uvt(A) {
  const e = eK(A);
  return [t8(A), e, t8(e)];
}
function t8(A) {
  return A.replace(/start|end/g, (e) => Wvt[e]);
}
function Vvt(A, e, t) {
  const i = ["left", "right"], n = ["right", "left"], o = ["top", "bottom"], g = ["bottom", "top"];
  switch (A) {
    case "top":
    case "bottom":
      return t ? e ? n : i : e ? i : n;
    case "left":
    case "right":
      return e ? o : g;
    default:
      return [];
  }
}
function Xvt(A, e, t, i) {
  const n = RG(A);
  let o = Vvt(DQ(A), t === "start", i);
  return n && (o = o.map((g) => g + "-" + n), e && (o = o.concat(o.map(t8)))), o;
}
function eK(A) {
  return A.replace(/left|right|bottom|top/g, (e) => Zvt[e]);
}
function zvt(A) {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0,
    ...A
  };
}
function JqA(A) {
  return typeof A != "number" ? zvt(A) : {
    top: A,
    right: A,
    bottom: A,
    left: A
  };
}
function tK(A) {
  return {
    ...A,
    top: A.y,
    left: A.x,
    right: A.x + A.width,
    bottom: A.y + A.height
  };
}
function jwA(A, e, t) {
  let {
    reference: i,
    floating: n
  } = A;
  const o = FG(e), g = oaA(e), s = naA(g), I = DQ(e), r = o === "y", a = i.x + i.width / 2 - n.width / 2, C = i.y + i.height / 2 - n.height / 2, B = i[s] / 2 - n[s] / 2;
  let l;
  switch (I) {
    case "top":
      l = {
        x: a,
        y: i.y - n.height
      };
      break;
    case "bottom":
      l = {
        x: a,
        y: i.y + i.height
      };
      break;
    case "right":
      l = {
        x: i.x + i.width,
        y: C
      };
      break;
    case "left":
      l = {
        x: i.x - n.width,
        y: C
      };
      break;
    default:
      l = {
        x: i.x,
        y: i.y
      };
  }
  switch (RG(e)) {
    case "start":
      l[g] -= B * (t && r ? -1 : 1);
      break;
    case "end":
      l[g] += B * (t && r ? -1 : 1);
      break;
  }
  return l;
}
const Tvt = async (A, e, t) => {
  const {
    placement: i = "bottom",
    strategy: n = "absolute",
    middleware: o = [],
    platform: g
  } = t, s = o.filter(Boolean), I = await (g.isRTL == null ? void 0 : g.isRTL(e));
  let r = await g.getElementRects({
    reference: A,
    floating: e,
    strategy: n
  }), {
    x: a,
    y: C
  } = jwA(r, i, I), B = i, l = {}, Q = 0;
  for (let E = 0; E < s.length; E++) {
    const {
      name: d,
      fn: m
    } = s[E], {
      x: y,
      y: f,
      data: w,
      reset: G
    } = await m({
      x: a,
      y: C,
      initialPlacement: i,
      placement: B,
      strategy: n,
      middlewareData: l,
      rects: r,
      platform: g,
      elements: {
        reference: A,
        floating: e
      }
    });
    a = y ?? a, C = f ?? C, l = {
      ...l,
      [d]: {
        ...l[d],
        ...w
      }
    }, G && Q <= 50 && (Q++, typeof G == "object" && (G.placement && (B = G.placement), G.rects && (r = G.rects === !0 ? await g.getElementRects({
      reference: A,
      floating: e,
      strategy: n
    }) : G.rects), {
      x: a,
      y: C
    } = jwA(r, B, I)), E = -1);
  }
  return {
    x: a,
    y: C,
    placement: B,
    strategy: n,
    middlewareData: l
  };
};
async function AR(A, e) {
  var t;
  e === void 0 && (e = {});
  const {
    x: i,
    y: n,
    platform: o,
    rects: g,
    elements: s,
    strategy: I
  } = A, {
    boundary: r = "clippingAncestors",
    rootBoundary: a = "viewport",
    elementContext: C = "floating",
    altBoundary: B = !1,
    padding: l = 0
  } = fQ(e, A), Q = JqA(l), d = s[B ? C === "floating" ? "reference" : "floating" : C], m = tK(await o.getClippingRect({
    element: (t = await (o.isElement == null ? void 0 : o.isElement(d))) == null || t ? d : d.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(s.floating)),
    boundary: r,
    rootBoundary: a,
    strategy: I
  })), y = C === "floating" ? {
    ...g.floating,
    x: i,
    y: n
  } : g.reference, f = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(s.floating)), w = await (o.isElement == null ? void 0 : o.isElement(f)) ? await (o.getScale == null ? void 0 : o.getScale(f)) || {
    x: 1,
    y: 1
  } : {
    x: 1,
    y: 1
  }, G = tK(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
    elements: s,
    rect: y,
    offsetParent: f,
    strategy: I
  }) : y);
  return {
    top: (m.top - G.top + Q.top) / w.y,
    bottom: (G.bottom - m.bottom + Q.bottom) / w.y,
    left: (m.left - G.left + Q.left) / w.x,
    right: (G.right - m.right + Q.right) / w.x
  };
}
const _vt = (A) => ({
  name: "arrow",
  options: A,
  async fn(e) {
    const {
      x: t,
      y: i,
      placement: n,
      rects: o,
      platform: g,
      elements: s,
      middlewareData: I
    } = e, {
      element: r,
      padding: a = 0
    } = fQ(A, e) || {};
    if (r == null)
      return {};
    const C = JqA(a), B = {
      x: t,
      y: i
    }, l = oaA(n), Q = naA(l), E = await g.getDimensions(r), d = l === "y", m = d ? "top" : "left", y = d ? "bottom" : "right", f = d ? "clientHeight" : "clientWidth", w = o.reference[Q] + o.reference[l] - B[l] - o.floating[Q], G = B[l] - o.reference[l], R = await (g.getOffsetParent == null ? void 0 : g.getOffsetParent(r));
    let F = R ? R[f] : 0;
    (!F || !await (g.isElement == null ? void 0 : g.isElement(R))) && (F = s.floating[f] || o.floating[Q]);
    const Z = w / 2 - G / 2, c = F / 2 - E[Q] / 2 - 1, J = yd(C[m], c), p = yd(C[y], c), N = J, v = F - E[Q] - p, K = F / 2 - E[Q] / 2 + Z, U = e8(N, K, v), j = !I.arrow && RG(n) != null && K !== U && o.reference[Q] / 2 - (K < N ? J : p) - E[Q] / 2 < 0, q = j ? K < N ? K - N : K - v : 0;
    return {
      [l]: B[l] + q,
      data: {
        [l]: U,
        centerOffset: K - U - q,
        ...j && {
          alignmentOffset: q
        }
      },
      reset: j
    };
  }
}), qvt = function(A) {
  return A === void 0 && (A = {}), {
    name: "flip",
    options: A,
    async fn(e) {
      var t, i;
      const {
        placement: n,
        middlewareData: o,
        rects: g,
        initialPlacement: s,
        platform: I,
        elements: r
      } = e, {
        mainAxis: a = !0,
        crossAxis: C = !0,
        fallbackPlacements: B,
        fallbackStrategy: l = "bestFit",
        fallbackAxisSideDirection: Q = "none",
        flipAlignment: E = !0,
        ...d
      } = fQ(A, e);
      if ((t = o.arrow) != null && t.alignmentOffset)
        return {};
      const m = DQ(n), y = DQ(s) === s, f = await (I.isRTL == null ? void 0 : I.isRTL(r.floating)), w = B || (y || !E ? [eK(s)] : Uvt(s));
      !B && Q !== "none" && w.push(...Xvt(s, E, Q, f));
      const G = [s, ...w], R = await AR(e, d), F = [];
      let Z = ((i = o.flip) == null ? void 0 : i.overflows) || [];
      if (a && F.push(R[m]), C) {
        const N = Kvt(n, g, f);
        F.push(R[N[0]], R[N[1]]);
      }
      if (Z = [...Z, {
        placement: n,
        overflows: F
      }], !F.every((N) => N <= 0)) {
        var c, J;
        const N = (((c = o.flip) == null ? void 0 : c.index) || 0) + 1, v = G[N];
        if (v)
          return {
            data: {
              index: N,
              overflows: Z
            },
            reset: {
              placement: v
            }
          };
        let K = (J = Z.filter((U) => U.overflows[0] <= 0).sort((U, j) => U.overflows[1] - j.overflows[1])[0]) == null ? void 0 : J.placement;
        if (!K)
          switch (l) {
            case "bestFit": {
              var p;
              const U = (p = Z.map((j) => [j.placement, j.overflows.filter((q) => q > 0).reduce((q, O) => q + O, 0)]).sort((j, q) => j[1] - q[1])[0]) == null ? void 0 : p[0];
              U && (K = U);
              break;
            }
            case "initialPlacement":
              K = s;
              break;
          }
        if (n !== K)
          return {
            reset: {
              placement: K
            }
          };
      }
      return {};
    }
  };
};
function PwA(A, e) {
  return {
    top: A.top - e.height,
    right: A.right - e.width,
    bottom: A.bottom - e.height,
    left: A.left - e.width
  };
}
function $wA(A) {
  return Svt.some((e) => A[e] >= 0);
}
const Ovt = function(A) {
  return A === void 0 && (A = {}), {
    name: "hide",
    options: A,
    async fn(e) {
      const {
        rects: t
      } = e, {
        strategy: i = "referenceHidden",
        ...n
      } = fQ(A, e);
      switch (i) {
        case "referenceHidden": {
          const o = await AR(e, {
            ...n,
            elementContext: "reference"
          }), g = PwA(o, t.reference);
          return {
            data: {
              referenceHiddenOffsets: g,
              referenceHidden: $wA(g)
            }
          };
        }
        case "escaped": {
          const o = await AR(e, {
            ...n,
            altBoundary: !0
          }), g = PwA(o, t.floating);
          return {
            data: {
              escapedOffsets: g,
              escaped: $wA(g)
            }
          };
        }
        default:
          return {};
      }
    }
  };
};
async function jvt(A, e) {
  const {
    placement: t,
    platform: i,
    elements: n
  } = A, o = await (i.isRTL == null ? void 0 : i.isRTL(n.floating)), g = DQ(t), s = RG(t), I = FG(t) === "y", r = ["left", "top"].includes(g) ? -1 : 1, a = o && I ? -1 : 1, C = fQ(e, A);
  let {
    mainAxis: B,
    crossAxis: l,
    alignmentAxis: Q
  } = typeof C == "number" ? {
    mainAxis: C,
    crossAxis: 0,
    alignmentAxis: null
  } : {
    mainAxis: 0,
    crossAxis: 0,
    alignmentAxis: null,
    ...C
  };
  return s && typeof Q == "number" && (l = s === "end" ? Q * -1 : Q), I ? {
    x: l * a,
    y: B * r
  } : {
    x: B * r,
    y: l * a
  };
}
const Pvt = function(A) {
  return A === void 0 && (A = 0), {
    name: "offset",
    options: A,
    async fn(e) {
      var t, i;
      const {
        x: n,
        y: o,
        placement: g,
        middlewareData: s
      } = e, I = await jvt(e, A);
      return g === ((t = s.offset) == null ? void 0 : t.placement) && (i = s.arrow) != null && i.alignmentOffset ? {} : {
        x: n + I.x,
        y: o + I.y,
        data: {
          ...I,
          placement: g
        }
      };
    }
  };
}, $vt = function(A) {
  return A === void 0 && (A = {}), {
    name: "shift",
    options: A,
    async fn(e) {
      const {
        x: t,
        y: i,
        placement: n
      } = e, {
        mainAxis: o = !0,
        crossAxis: g = !1,
        limiter: s = {
          fn: (d) => {
            let {
              x: m,
              y
            } = d;
            return {
              x: m,
              y
            };
          }
        },
        ...I
      } = fQ(A, e), r = {
        x: t,
        y: i
      }, a = await AR(e, I), C = FG(DQ(n)), B = iaA(C);
      let l = r[B], Q = r[C];
      if (o) {
        const d = B === "y" ? "top" : "left", m = B === "y" ? "bottom" : "right", y = l + a[d], f = l - a[m];
        l = e8(y, l, f);
      }
      if (g) {
        const d = C === "y" ? "top" : "left", m = C === "y" ? "bottom" : "right", y = Q + a[d], f = Q - a[m];
        Q = e8(y, Q, f);
      }
      const E = s.fn({
        ...e,
        [B]: l,
        [C]: Q
      });
      return {
        ...E,
        data: {
          x: E.x - t,
          y: E.y - i
        }
      };
    }
  };
}, AHt = function(A) {
  return A === void 0 && (A = {}), {
    options: A,
    fn(e) {
      const {
        x: t,
        y: i,
        placement: n,
        rects: o,
        middlewareData: g
      } = e, {
        offset: s = 0,
        mainAxis: I = !0,
        crossAxis: r = !0
      } = fQ(A, e), a = {
        x: t,
        y: i
      }, C = FG(n), B = iaA(C);
      let l = a[B], Q = a[C];
      const E = fQ(s, e), d = typeof E == "number" ? {
        mainAxis: E,
        crossAxis: 0
      } : {
        mainAxis: 0,
        crossAxis: 0,
        ...E
      };
      if (I) {
        const f = B === "y" ? "height" : "width", w = o.reference[B] - o.floating[f] + d.mainAxis, G = o.reference[B] + o.reference[f] - d.mainAxis;
        l < w ? l = w : l > G && (l = G);
      }
      if (r) {
        var m, y;
        const f = B === "y" ? "width" : "height", w = ["top", "left"].includes(DQ(n)), G = o.reference[C] - o.floating[f] + (w && ((m = g.offset) == null ? void 0 : m[C]) || 0) + (w ? 0 : d.crossAxis), R = o.reference[C] + o.reference[f] + (w ? 0 : ((y = g.offset) == null ? void 0 : y[C]) || 0) - (w ? d.crossAxis : 0);
        Q < G ? Q = G : Q > R && (Q = R);
      }
      return {
        [B]: l,
        [C]: Q
      };
    }
  };
}, eHt = function(A) {
  return A === void 0 && (A = {}), {
    name: "size",
    options: A,
    async fn(e) {
      const {
        placement: t,
        rects: i,
        platform: n,
        elements: o
      } = e, {
        apply: g = () => {
        },
        ...s
      } = fQ(A, e), I = await AR(e, s), r = DQ(t), a = RG(t), C = FG(t) === "y", {
        width: B,
        height: l
      } = i.floating;
      let Q, E;
      r === "top" || r === "bottom" ? (Q = r, E = a === (await (n.isRTL == null ? void 0 : n.isRTL(o.floating)) ? "start" : "end") ? "left" : "right") : (E = r, Q = a === "end" ? "top" : "bottom");
      const d = l - I[Q], m = B - I[E], y = !e.middlewareData.shift;
      let f = d, w = m;
      if (C) {
        const R = B - I.left - I.right;
        w = a || y ? yd(m, R) : R;
      } else {
        const R = l - I.top - I.bottom;
        f = a || y ? yd(d, R) : R;
      }
      if (y && !a) {
        const R = NI(I.left, 0), F = NI(I.right, 0), Z = NI(I.top, 0), c = NI(I.bottom, 0);
        C ? w = B - 2 * (R !== 0 || F !== 0 ? R + F : NI(I.left, I.right)) : f = l - 2 * (Z !== 0 || c !== 0 ? Z + c : NI(I.top, I.bottom));
      }
      await g({
        ...e,
        availableWidth: w,
        availableHeight: f
      });
      const G = await n.getDimensions(o.floating);
      return B !== G.width || l !== G.height ? {
        reset: {
          rects: !0
        }
      } : {};
    }
  };
};
function wd(A) {
  return NqA(A) ? (A.nodeName || "").toLowerCase() : "#document";
}
function _I(A) {
  var e;
  return (A == null || (e = A.ownerDocument) == null ? void 0 : e.defaultView) || window;
}
function OQ(A) {
  var e;
  return (e = (NqA(A) ? A.ownerDocument : A.document) || window.document) == null ? void 0 : e.documentElement;
}
function NqA(A) {
  return A instanceof Node || A instanceof _I(A).Node;
}
function GQ(A) {
  return A instanceof Element || A instanceof _I(A).Element;
}
function hl(A) {
  return A instanceof HTMLElement || A instanceof _I(A).HTMLElement;
}
function AfA(A) {
  return typeof ShadowRoot > "u" ? !1 : A instanceof ShadowRoot || A instanceof _I(A).ShadowRoot;
}
function J1(A) {
  const {
    overflow: e,
    overflowX: t,
    overflowY: i,
    display: n
  } = Cr(A);
  return /auto|scroll|overlay|hidden|clip/.test(e + i + t) && !["inline", "contents"].includes(n);
}
function tHt(A) {
  return ["table", "td", "th"].includes(wd(A));
}
function gaA(A) {
  const e = saA(), t = Cr(A);
  return t.transform !== "none" || t.perspective !== "none" || (t.containerType ? t.containerType !== "normal" : !1) || !e && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !e && (t.filter ? t.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (t.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (t.contain || "").includes(i));
}
function YqA(A) {
  let e = aD(A);
  for (; hl(e) && !o9(e); ) {
    if (gaA(e))
      return e;
    e = aD(e);
  }
  return null;
}
function saA() {
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
}
function o9(A) {
  return ["html", "body", "#document"].includes(wd(A));
}
function Cr(A) {
  return _I(A).getComputedStyle(A);
}
function g9(A) {
  return GQ(A) ? {
    scrollLeft: A.scrollLeft,
    scrollTop: A.scrollTop
  } : {
    scrollLeft: A.pageXOffset,
    scrollTop: A.pageYOffset
  };
}
function aD(A) {
  if (wd(A) === "html")
    return A;
  const e = (
    // Step into the shadow DOM of the parent of a slotted node.
    A.assignedSlot || // DOM Element detected.
    A.parentNode || // ShadowRoot detected.
    AfA(A) && A.host || // Fallback.
    OQ(A)
  );
  return AfA(e) ? e.host : e;
}
function RqA(A) {
  const e = aD(A);
  return o9(e) ? A.ownerDocument ? A.ownerDocument.body : A.body : hl(e) && J1(e) ? e : RqA(e);
}
function eR(A, e, t) {
  var i;
  e === void 0 && (e = []), t === void 0 && (t = !0);
  const n = RqA(A), o = n === ((i = A.ownerDocument) == null ? void 0 : i.body), g = _I(n);
  return o ? e.concat(g, g.visualViewport || [], J1(n) ? n : [], g.frameElement && t ? eR(g.frameElement) : []) : e.concat(n, eR(n, [], t));
}
function FqA(A) {
  const e = Cr(A);
  let t = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
  const n = hl(A), o = n ? A.offsetWidth : t, g = n ? A.offsetHeight : i, s = AK(t) !== o || AK(i) !== g;
  return s && (t = o, i = g), {
    width: t,
    height: i,
    $: s
  };
}
function IaA(A) {
  return GQ(A) ? A : A.contextElement;
}
function xw(A) {
  const e = IaA(A);
  if (!hl(e))
    return bd(1);
  const t = e.getBoundingClientRect(), {
    width: i,
    height: n,
    $: o
  } = FqA(e);
  let g = (o ? AK(t.width) : t.width) / i, s = (o ? AK(t.height) : t.height) / n;
  return (!g || !Number.isFinite(g)) && (g = 1), (!s || !Number.isFinite(s)) && (s = 1), {
    x: g,
    y: s
  };
}
const iHt = /* @__PURE__ */ bd(0);
function MqA(A) {
  const e = _I(A);
  return !saA() || !e.visualViewport ? iHt : {
    x: e.visualViewport.offsetLeft,
    y: e.visualViewport.offsetTop
  };
}
function nHt(A, e, t) {
  return e === void 0 && (e = !1), !t || e && t !== _I(A) ? !1 : e;
}
function Kp(A, e, t, i) {
  e === void 0 && (e = !1), t === void 0 && (t = !1);
  const n = A.getBoundingClientRect(), o = IaA(A);
  let g = bd(1);
  e && (i ? GQ(i) && (g = xw(i)) : g = xw(A));
  const s = nHt(o, t, i) ? MqA(o) : bd(0);
  let I = (n.left + s.x) / g.x, r = (n.top + s.y) / g.y, a = n.width / g.x, C = n.height / g.y;
  if (o) {
    const B = _I(o), l = i && GQ(i) ? _I(i) : i;
    let Q = B.frameElement;
    for (; Q && i && l !== B; ) {
      const E = xw(Q), d = Q.getBoundingClientRect(), m = Cr(Q), y = d.left + (Q.clientLeft + parseFloat(m.paddingLeft)) * E.x, f = d.top + (Q.clientTop + parseFloat(m.paddingTop)) * E.y;
      I *= E.x, r *= E.y, a *= E.x, C *= E.y, I += y, r += f, Q = _I(Q).frameElement;
    }
  }
  return tK({
    width: a,
    height: C,
    x: I,
    y: r
  });
}
const oHt = [":popover-open", ":modal"];
function xqA(A) {
  let e = !1, t = 0, i = 0;
  function n(g) {
    try {
      e = e || A.matches(g);
    } catch {
    }
  }
  oHt.forEach((g) => {
    n(g);
  });
  const o = YqA(A);
  if (e && o) {
    const g = o.getBoundingClientRect();
    t = g.x, i = g.y;
  }
  return [e, t, i];
}
function gHt(A) {
  let {
    elements: e,
    rect: t,
    offsetParent: i,
    strategy: n
  } = A;
  const o = OQ(i), [g] = e ? xqA(e.floating) : [!1];
  if (i === o || g)
    return t;
  let s = {
    scrollLeft: 0,
    scrollTop: 0
  }, I = bd(1);
  const r = bd(0), a = hl(i);
  if ((a || !a && n !== "fixed") && ((wd(i) !== "body" || J1(o)) && (s = g9(i)), hl(i))) {
    const C = Kp(i);
    I = xw(i), r.x = C.x + i.clientLeft, r.y = C.y + i.clientTop;
  }
  return {
    width: t.width * I.x,
    height: t.height * I.y,
    x: t.x * I.x - s.scrollLeft * I.x + r.x,
    y: t.y * I.y - s.scrollTop * I.y + r.y
  };
}
function sHt(A) {
  return Array.from(A.getClientRects());
}
function LqA(A) {
  return Kp(OQ(A)).left + g9(A).scrollLeft;
}
function IHt(A) {
  const e = OQ(A), t = g9(A), i = A.ownerDocument.body, n = NI(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), o = NI(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
  let g = -t.scrollLeft + LqA(A);
  const s = -t.scrollTop;
  return Cr(i).direction === "rtl" && (g += NI(e.clientWidth, i.clientWidth) - n), {
    width: n,
    height: o,
    x: g,
    y: s
  };
}
function aHt(A, e) {
  const t = _I(A), i = OQ(A), n = t.visualViewport;
  let o = i.clientWidth, g = i.clientHeight, s = 0, I = 0;
  if (n) {
    o = n.width, g = n.height;
    const r = saA();
    (!r || r && e === "fixed") && (s = n.offsetLeft, I = n.offsetTop);
  }
  return {
    width: o,
    height: g,
    x: s,
    y: I
  };
}
function rHt(A, e) {
  const t = Kp(A, !0, e === "fixed"), i = t.top + A.clientTop, n = t.left + A.clientLeft, o = hl(A) ? xw(A) : bd(1), g = A.clientWidth * o.x, s = A.clientHeight * o.y, I = n * o.x, r = i * o.y;
  return {
    width: g,
    height: s,
    x: I,
    y: r
  };
}
function efA(A, e, t) {
  let i;
  if (e === "viewport")
    i = aHt(A, t);
  else if (e === "document")
    i = IHt(OQ(A));
  else if (GQ(e))
    i = rHt(e, t);
  else {
    const n = MqA(A);
    i = {
      ...e,
      x: e.x - n.x,
      y: e.y - n.y
    };
  }
  return tK(i);
}
function vqA(A, e) {
  const t = aD(A);
  return t === e || !GQ(t) || o9(t) ? !1 : Cr(t).position === "fixed" || vqA(t, e);
}
function CHt(A, e) {
  const t = e.get(A);
  if (t)
    return t;
  let i = eR(A, [], !1).filter((s) => GQ(s) && wd(s) !== "body"), n = null;
  const o = Cr(A).position === "fixed";
  let g = o ? aD(A) : A;
  for (; GQ(g) && !o9(g); ) {
    const s = Cr(g), I = gaA(g);
    !I && s.position === "fixed" && (n = null), (o ? !I && !n : !I && s.position === "static" && !!n && ["absolute", "fixed"].includes(n.position) || J1(g) && !I && vqA(A, g)) ? i = i.filter((a) => a !== g) : n = s, g = aD(g);
  }
  return e.set(A, i), i;
}
function BHt(A) {
  let {
    element: e,
    boundary: t,
    rootBoundary: i,
    strategy: n
  } = A;
  const g = [...t === "clippingAncestors" ? CHt(e, this._c) : [].concat(t), i], s = g[0], I = g.reduce((r, a) => {
    const C = efA(e, a, n);
    return r.top = NI(C.top, r.top), r.right = yd(C.right, r.right), r.bottom = yd(C.bottom, r.bottom), r.left = NI(C.left, r.left), r;
  }, efA(e, s, n));
  return {
    width: I.right - I.left,
    height: I.bottom - I.top,
    x: I.left,
    y: I.top
  };
}
function lHt(A) {
  const {
    width: e,
    height: t
  } = FqA(A);
  return {
    width: e,
    height: t
  };
}
function cHt(A, e, t, i) {
  const n = hl(e), o = OQ(e), g = t === "fixed", s = Kp(A, !0, g, e);
  let I = {
    scrollLeft: 0,
    scrollTop: 0
  };
  const r = bd(0);
  if (n || !n && !g)
    if ((wd(e) !== "body" || J1(o)) && (I = g9(e)), n) {
      const E = Kp(e, !0, g, e);
      r.x = E.x + e.clientLeft, r.y = E.y + e.clientTop;
    } else
      o && (r.x = LqA(o));
  let a = s.left + I.scrollLeft - r.x, C = s.top + I.scrollTop - r.y;
  const [B, l, Q] = xqA(i);
  return B && (a += l, C += Q, n && (a += e.clientLeft, C += e.clientTop)), {
    x: a,
    y: C,
    width: s.width,
    height: s.height
  };
}
function tfA(A, e) {
  return !hl(A) || Cr(A).position === "fixed" ? null : e ? e(A) : A.offsetParent;
}
function HqA(A, e) {
  const t = _I(A);
  if (!hl(A))
    return t;
  let i = tfA(A, e);
  for (; i && tHt(i) && Cr(i).position === "static"; )
    i = tfA(i, e);
  return i && (wd(i) === "html" || wd(i) === "body" && Cr(i).position === "static" && !gaA(i)) ? t : i || YqA(A) || t;
}
const QHt = async function(A) {
  const e = this.getOffsetParent || HqA, t = this.getDimensions;
  return {
    reference: cHt(A.reference, await e(A.floating), A.strategy, A.floating),
    floating: {
      x: 0,
      y: 0,
      ...await t(A.floating)
    }
  };
};
function EHt(A) {
  return Cr(A).direction === "rtl";
}
const uHt = {
  convertOffsetParentRelativeRectToViewportRelativeRect: gHt,
  getDocumentElement: OQ,
  getClippingRect: BHt,
  getOffsetParent: HqA,
  getElementRects: QHt,
  getClientRects: sHt,
  getDimensions: lHt,
  getScale: xw,
  isElement: GQ,
  isRTL: EHt
};
function dHt(A, e) {
  let t = null, i;
  const n = OQ(A);
  function o() {
    var s;
    clearTimeout(i), (s = t) == null || s.disconnect(), t = null;
  }
  function g(s, I) {
    s === void 0 && (s = !1), I === void 0 && (I = 1), o();
    const {
      left: r,
      top: a,
      width: C,
      height: B
    } = A.getBoundingClientRect();
    if (s || e(), !C || !B)
      return;
    const l = EL(a), Q = EL(n.clientWidth - (r + C)), E = EL(n.clientHeight - (a + B)), d = EL(r), y = {
      rootMargin: -l + "px " + -Q + "px " + -E + "px " + -d + "px",
      threshold: NI(0, yd(1, I)) || 1
    };
    let f = !0;
    function w(G) {
      const R = G[0].intersectionRatio;
      if (R !== I) {
        if (!f)
          return g();
        R ? g(!1, R) : i = setTimeout(() => {
          g(!1, 1e-7);
        }, 100);
      }
      f = !1;
    }
    try {
      t = new IntersectionObserver(w, {
        ...y,
        // Handle <iframe>s
        root: n.ownerDocument
      });
    } catch {
      t = new IntersectionObserver(w, y);
    }
    t.observe(A);
  }
  return g(!0), o;
}
function hHt(A, e, t, i) {
  i === void 0 && (i = {});
  const {
    ancestorScroll: n = !0,
    ancestorResize: o = !0,
    elementResize: g = typeof ResizeObserver == "function",
    layoutShift: s = typeof IntersectionObserver == "function",
    animationFrame: I = !1
  } = i, r = IaA(A), a = n || o ? [...r ? eR(r) : [], ...eR(e)] : [];
  a.forEach((m) => {
    n && m.addEventListener("scroll", t, {
      passive: !0
    }), o && m.addEventListener("resize", t);
  });
  const C = r && s ? dHt(r, t) : null;
  let B = -1, l = null;
  g && (l = new ResizeObserver((m) => {
    let [y] = m;
    y && y.target === r && l && (l.unobserve(e), cancelAnimationFrame(B), B = requestAnimationFrame(() => {
      var f;
      (f = l) == null || f.observe(e);
    })), t();
  }), r && !I && l.observe(r), l.observe(e));
  let Q, E = I ? Kp(A) : null;
  I && d();
  function d() {
    const m = Kp(A);
    E && (m.x !== E.x || m.y !== E.y || m.width !== E.width || m.height !== E.height) && t(), E = m, Q = requestAnimationFrame(d);
  }
  return t(), () => {
    var m;
    a.forEach((y) => {
      n && y.removeEventListener("scroll", t), o && y.removeEventListener("resize", t);
    }), C == null || C(), (m = l) == null || m.disconnect(), l = null, I && cancelAnimationFrame(Q);
  };
}
const mHt = $vt, pHt = qvt, yHt = eHt, bHt = Ovt, ifA = _vt, wHt = AHt, fHt = (A, e, t) => {
  const i = /* @__PURE__ */ new Map(), n = {
    platform: uHt,
    ...t
  }, o = {
    ...n.platform,
    _c: i
  };
  return Tvt(A, e, {
    ...n,
    platform: o
  });
}, DHt = (A) => {
  function e(t) {
    return {}.hasOwnProperty.call(t, "current");
  }
  return {
    name: "arrow",
    options: A,
    fn(t) {
      const {
        element: i,
        padding: n
      } = typeof A == "function" ? A(t) : A;
      return i && e(i) ? i.current != null ? ifA({
        element: i.current,
        padding: n
      }).fn(t) : {} : i ? ifA({
        element: i,
        padding: n
      }).fn(t) : {};
    }
  };
};
var Fv = typeof document < "u" ? u.useLayoutEffect : u.useEffect;
function iK(A, e) {
  if (A === e)
    return !0;
  if (typeof A != typeof e)
    return !1;
  if (typeof A == "function" && A.toString() === e.toString())
    return !0;
  let t, i, n;
  if (A && e && typeof A == "object") {
    if (Array.isArray(A)) {
      if (t = A.length, t !== e.length)
        return !1;
      for (i = t; i-- !== 0; )
        if (!iK(A[i], e[i]))
          return !1;
      return !0;
    }
    if (n = Object.keys(A), t = n.length, t !== Object.keys(e).length)
      return !1;
    for (i = t; i-- !== 0; )
      if (!{}.hasOwnProperty.call(e, n[i]))
        return !1;
    for (i = t; i-- !== 0; ) {
      const o = n[i];
      if (!(o === "_owner" && A.$$typeof) && !iK(A[o], e[o]))
        return !1;
    }
    return !0;
  }
  return A !== A && e !== e;
}
function SqA(A) {
  return typeof window > "u" ? 1 : (A.ownerDocument.defaultView || window).devicePixelRatio || 1;
}
function nfA(A, e) {
  const t = SqA(A);
  return Math.round(e * t) / t;
}
function ofA(A) {
  const e = u.useRef(A);
  return Fv(() => {
    e.current = A;
  }), e;
}
function GHt(A) {
  A === void 0 && (A = {});
  const {
    placement: e = "bottom",
    strategy: t = "absolute",
    middleware: i = [],
    platform: n,
    elements: {
      reference: o,
      floating: g
    } = {},
    transform: s = !0,
    whileElementsMounted: I,
    open: r
  } = A, [a, C] = u.useState({
    x: 0,
    y: 0,
    strategy: t,
    placement: e,
    middlewareData: {},
    isPositioned: !1
  }), [B, l] = u.useState(i);
  iK(B, i) || l(i);
  const [Q, E] = u.useState(null), [d, m] = u.useState(null), y = u.useCallback((q) => {
    q !== R.current && (R.current = q, E(q));
  }, []), f = u.useCallback((q) => {
    q !== F.current && (F.current = q, m(q));
  }, []), w = o || Q, G = g || d, R = u.useRef(null), F = u.useRef(null), Z = u.useRef(a), c = I != null, J = ofA(I), p = ofA(n), N = u.useCallback(() => {
    if (!R.current || !F.current)
      return;
    const q = {
      placement: e,
      strategy: t,
      middleware: B
    };
    p.current && (q.platform = p.current), fHt(R.current, F.current, q).then((O) => {
      const $ = {
        ...O,
        isPositioned: !0
      };
      v.current && !iK(Z.current, $) && (Z.current = $, Jt.flushSync(() => {
        C($);
      }));
    });
  }, [B, e, t, p]);
  Fv(() => {
    r === !1 && Z.current.isPositioned && (Z.current.isPositioned = !1, C((q) => ({
      ...q,
      isPositioned: !1
    })));
  }, [r]);
  const v = u.useRef(!1);
  Fv(() => (v.current = !0, () => {
    v.current = !1;
  }), []), Fv(() => {
    if (w && (R.current = w), G && (F.current = G), w && G) {
      if (J.current)
        return J.current(w, G, N);
      N();
    }
  }, [w, G, N, J, c]);
  const K = u.useMemo(() => ({
    reference: R,
    floating: F,
    setReference: y,
    setFloating: f
  }), [y, f]), U = u.useMemo(() => ({
    reference: w,
    floating: G
  }), [w, G]), j = u.useMemo(() => {
    const q = {
      position: t,
      left: 0,
      top: 0
    };
    if (!U.floating)
      return q;
    const O = nfA(U.floating, a.x), $ = nfA(U.floating, a.y);
    return s ? {
      ...q,
      transform: "translate(" + O + "px, " + $ + "px)",
      ...SqA(U.floating) >= 1.5 && {
        willChange: "transform"
      }
    } : {
      position: t,
      left: O,
      top: $
    };
  }, [t, s, U.floating, a.x, a.y]);
  return u.useMemo(() => ({
    ...a,
    update: N,
    refs: K,
    elements: U,
    floatingStyles: j
  }), [a, N, K, U, j]);
}
const ZqA = "Popper", [WqA, KqA] = Ah(ZqA), [kHt, UqA] = WqA(ZqA), JHt = (A) => {
  const { __scopePopper: e, children: t } = A, [i, n] = u.useState(null);
  return /* @__PURE__ */ u.createElement(kHt, {
    scope: e,
    anchor: i,
    onAnchorChange: n
  }, t);
}, NHt = "PopperAnchor", YHt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopePopper: t, virtualRef: i, ...n } = A, o = UqA(NHt, t), g = u.useRef(null), s = On(e, g);
  return u.useEffect(() => {
    o.onAnchorChange((i == null ? void 0 : i.current) || g.current);
  }), i ? null : /* @__PURE__ */ u.createElement(ii.div, be({}, n, {
    ref: s
  }));
}), VqA = "PopperContent", [RHt, a9t] = WqA(VqA), FHt = /* @__PURE__ */ u.forwardRef((A, e) => {
  var t, i, n, o, g, s, I, r;
  const { __scopePopper: a, side: C = "bottom", sideOffset: B = 0, align: l = "center", alignOffset: Q = 0, arrowPadding: E = 0, avoidCollisions: d = !0, collisionBoundary: m = [], collisionPadding: y = 0, sticky: f = "partial", hideWhenDetached: w = !1, updatePositionStrategy: G = "optimized", onPlaced: R, ...F } = A, Z = UqA(VqA, a), [c, J] = u.useState(null), p = On(
    e,
    (HA) => J(HA)
  ), [N, v] = u.useState(null), K = nqA(N), U = (t = K == null ? void 0 : K.width) !== null && t !== void 0 ? t : 0, j = (i = K == null ? void 0 : K.height) !== null && i !== void 0 ? i : 0, q = C + (l !== "center" ? "-" + l : ""), O = typeof y == "number" ? y : {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0,
    ...y
  }, $ = Array.isArray(m) ? m : [
    m
  ], _ = $.length > 0, tA = {
    padding: O,
    boundary: $.filter(MHt),
    // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
    altBoundary: _
  }, { refs: nA, floatingStyles: AA, placement: gA, isPositioned: rA, middlewareData: sA } = GHt({
    // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
    strategy: "fixed",
    placement: q,
    whileElementsMounted: (...HA) => hHt(...HA, {
      animationFrame: G === "always"
    }),
    elements: {
      reference: Z.anchor
    },
    middleware: [
      Pvt({
        mainAxis: B + j,
        alignmentAxis: Q
      }),
      d && mHt({
        mainAxis: !0,
        crossAxis: !1,
        limiter: f === "partial" ? wHt() : void 0,
        ...tA
      }),
      d && pHt({
        ...tA
      }),
      yHt({
        ...tA,
        apply: ({ elements: HA, rects: ne, availableWidth: VA, availableHeight: le }) => {
          const { width: we, height: De } = ne.reference, Ke = HA.floating.style;
          Ke.setProperty("--radix-popper-available-width", `${VA}px`), Ke.setProperty("--radix-popper-available-height", `${le}px`), Ke.setProperty("--radix-popper-anchor-width", `${we}px`), Ke.setProperty("--radix-popper-anchor-height", `${De}px`);
        }
      }),
      N && DHt({
        element: N,
        padding: E
      }),
      xHt({
        arrowWidth: U,
        arrowHeight: j
      }),
      w && bHt({
        strategy: "referenceHidden",
        ...tA
      })
    ]
  }), [lA, cA] = XqA(gA), aA = cl(R);
  AI(() => {
    rA && (aA == null || aA());
  }, [
    rA,
    aA
  ]);
  const QA = (n = sA.arrow) === null || n === void 0 ? void 0 : n.x, hA = (o = sA.arrow) === null || o === void 0 ? void 0 : o.y, EA = ((g = sA.arrow) === null || g === void 0 ? void 0 : g.centerOffset) !== 0, [RA, xA] = u.useState();
  return AI(() => {
    c && xA(window.getComputedStyle(c).zIndex);
  }, [
    c
  ]), /* @__PURE__ */ u.createElement("div", {
    ref: nA.setFloating,
    "data-radix-popper-content-wrapper": "",
    style: {
      ...AA,
      transform: rA ? AA.transform : "translate(0, -200%)",
      // keep off the page when measuring
      minWidth: "max-content",
      zIndex: RA,
      ["--radix-popper-transform-origin"]: [
        (s = sA.transformOrigin) === null || s === void 0 ? void 0 : s.x,
        (I = sA.transformOrigin) === null || I === void 0 ? void 0 : I.y
      ].join(" ")
    },
    dir: A.dir
  }, /* @__PURE__ */ u.createElement(RHt, {
    scope: a,
    placedSide: lA,
    onArrowChange: v,
    arrowX: QA,
    arrowY: hA,
    shouldHideArrow: EA
  }, /* @__PURE__ */ u.createElement(ii.div, be({
    "data-side": lA,
    "data-align": cA
  }, F, {
    ref: p,
    style: {
      ...F.style,
      // if the PopperContent hasn't been placed yet (not all measurements done)
      // we prevent animations so that users's animation don't kick in too early referring wrong sides
      animation: rA ? void 0 : "none",
      // hide the content if using the hide middleware and should be hidden
      opacity: (r = sA.hide) !== null && r !== void 0 && r.referenceHidden ? 0 : void 0
    }
  }))));
});
function MHt(A) {
  return A !== null;
}
const xHt = (A) => ({
  name: "transformOrigin",
  options: A,
  fn(e) {
    var t, i, n, o, g;
    const { placement: s, rects: I, middlewareData: r } = e, C = ((t = r.arrow) === null || t === void 0 ? void 0 : t.centerOffset) !== 0, B = C ? 0 : A.arrowWidth, l = C ? 0 : A.arrowHeight, [Q, E] = XqA(s), d = {
      start: "0%",
      center: "50%",
      end: "100%"
    }[E], m = ((i = (n = r.arrow) === null || n === void 0 ? void 0 : n.x) !== null && i !== void 0 ? i : 0) + B / 2, y = ((o = (g = r.arrow) === null || g === void 0 ? void 0 : g.y) !== null && o !== void 0 ? o : 0) + l / 2;
    let f = "", w = "";
    return Q === "bottom" ? (f = C ? d : `${m}px`, w = `${-l}px`) : Q === "top" ? (f = C ? d : `${m}px`, w = `${I.floating.height + l}px`) : Q === "right" ? (f = `${-l}px`, w = C ? d : `${y}px`) : Q === "left" && (f = `${I.floating.width + l}px`, w = C ? d : `${y}px`), {
      data: {
        x: f,
        y: w
      }
    };
  }
});
function XqA(A) {
  const [e, t = "center"] = A.split("-");
  return [
    e,
    t
  ];
}
const LHt = JHt, vHt = YHt, HHt = FHt, SHt = /* @__PURE__ */ u.forwardRef((A, e) => /* @__PURE__ */ u.createElement(ii.span, be({}, A, {
  ref: e,
  style: {
    // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
    position: "absolute",
    border: 0,
    width: 1,
    height: 1,
    padding: 0,
    margin: -1,
    overflow: "hidden",
    clip: "rect(0, 0, 0, 0)",
    whiteSpace: "nowrap",
    wordWrap: "normal",
    ...A.style
  }
}))), ZHt = [
  " ",
  "Enter",
  "ArrowUp",
  "ArrowDown"
], WHt = [
  " ",
  "Enter"
], s9 = "Select", [I9, a9, KHt] = izA(s9), [MG, r9t] = Ah(s9, [
  KHt,
  KqA
]), aaA = KqA(), [UHt, R0] = MG(s9), [VHt, XHt] = MG(s9), zHt = (A) => {
  const { __scopeSelect: e, children: t, open: i, defaultOpen: n, onOpenChange: o, value: g, defaultValue: s, onValueChange: I, dir: r, name: a, autoComplete: C, disabled: B, required: l } = A, Q = aaA(e), [E, d] = u.useState(null), [m, y] = u.useState(null), [f, w] = u.useState(!1), G = JX(r), [R = !1, F] = yQ({
    prop: i,
    defaultProp: n,
    onChange: o
  }), [Z, c] = yQ({
    prop: g,
    defaultProp: s,
    onChange: I
  }), J = u.useRef(null), p = E ? Boolean(E.closest("form")) : !0, [N, v] = u.useState(/* @__PURE__ */ new Set()), K = Array.from(N).map(
    (U) => U.props.value
  ).join(";");
  return /* @__PURE__ */ u.createElement(LHt, Q, /* @__PURE__ */ u.createElement(UHt, {
    required: l,
    scope: e,
    trigger: E,
    onTriggerChange: d,
    valueNode: m,
    onValueNodeChange: y,
    valueNodeHasChildren: f,
    onValueNodeHasChildrenChange: w,
    contentId: Km(),
    value: Z,
    onValueChange: c,
    open: R,
    onOpenChange: F,
    dir: G,
    triggerPointerDownPosRef: J,
    disabled: B
  }, /* @__PURE__ */ u.createElement(I9.Provider, {
    scope: e
  }, /* @__PURE__ */ u.createElement(VHt, {
    scope: A.__scopeSelect,
    onNativeOptionAdd: u.useCallback((U) => {
      v(
        (j) => new Set(j).add(U)
      );
    }, []),
    onNativeOptionRemove: u.useCallback((U) => {
      v((j) => {
        const q = new Set(j);
        return q.delete(U), q;
      });
    }, [])
  }, t)), p ? /* @__PURE__ */ u.createElement(OqA, {
    key: K,
    "aria-hidden": !0,
    required: l,
    tabIndex: -1,
    name: a,
    autoComplete: C,
    value: Z,
    onChange: (U) => c(U.target.value),
    disabled: B
  }, Z === void 0 ? /* @__PURE__ */ u.createElement("option", {
    value: ""
  }) : null, Array.from(N)) : null));
}, THt = "SelectTrigger", _Ht = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, disabled: i = !1, ...n } = A, o = aaA(t), g = R0(THt, t), s = g.disabled || i, I = On(e, g.onTriggerChange), r = a9(t), [a, C, B] = jqA((Q) => {
    const E = r().filter(
      (y) => !y.disabled
    ), d = E.find(
      (y) => y.value === g.value
    ), m = PqA(E, Q, d);
    m !== void 0 && g.onValueChange(m.value);
  }), l = () => {
    s || (g.onOpenChange(!0), B());
  };
  return /* @__PURE__ */ u.createElement(vHt, be({
    asChild: !0
  }, o), /* @__PURE__ */ u.createElement(ii.button, be({
    type: "button",
    role: "combobox",
    "aria-controls": g.contentId,
    "aria-expanded": g.open,
    "aria-required": g.required,
    "aria-autocomplete": "none",
    dir: g.dir,
    "data-state": g.open ? "open" : "closed",
    disabled: s,
    "data-disabled": s ? "" : void 0,
    "data-placeholder": qqA(g.value) ? "" : void 0
  }, n, {
    ref: I,
    onClick: qt(n.onClick, (Q) => {
      Q.currentTarget.focus();
    }),
    onPointerDown: qt(n.onPointerDown, (Q) => {
      const E = Q.target;
      E.hasPointerCapture(Q.pointerId) && E.releasePointerCapture(Q.pointerId), Q.button === 0 && Q.ctrlKey === !1 && (l(), g.triggerPointerDownPosRef.current = {
        x: Math.round(Q.pageX),
        y: Math.round(Q.pageY)
      }, Q.preventDefault());
    }),
    onKeyDown: qt(n.onKeyDown, (Q) => {
      const E = a.current !== "";
      !(Q.ctrlKey || Q.altKey || Q.metaKey) && Q.key.length === 1 && C(Q.key), !(E && Q.key === " ") && ZHt.includes(Q.key) && (l(), Q.preventDefault());
    })
  })));
}), qHt = "SelectValue", OHt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, className: i, style: n, children: o, placeholder: g = "", ...s } = A, I = R0(qHt, t), { onValueNodeHasChildrenChange: r } = I, a = o !== void 0, C = On(e, I.onValueNodeChange);
  return AI(() => {
    r(a);
  }, [
    r,
    a
  ]), /* @__PURE__ */ u.createElement(ii.span, be({}, s, {
    ref: C,
    style: {
      pointerEvents: "none"
    }
  }), qqA(I.value) ? /* @__PURE__ */ u.createElement(u.Fragment, null, g) : o);
}), jHt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, children: i, ...n } = A;
  return /* @__PURE__ */ u.createElement(ii.span, be({
    "aria-hidden": !0
  }, n, {
    ref: e
  }), i || "▼");
}), PHt = (A) => /* @__PURE__ */ u.createElement(S_A, be({
  asChild: !0
}, A)), rD = "SelectContent", $Ht = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = R0(rD, A.__scopeSelect), [i, n] = u.useState();
  if (AI(() => {
    n(new DocumentFragment());
  }, []), !t.open) {
    const o = i;
    return o ? /* @__PURE__ */ Jt.createPortal(/* @__PURE__ */ u.createElement(zqA, {
      scope: A.__scopeSelect
    }, /* @__PURE__ */ u.createElement(I9.Slot, {
      scope: A.__scopeSelect
    }, /* @__PURE__ */ u.createElement("div", null, A.children))), o) : null;
  }
  return /* @__PURE__ */ u.createElement(ASt, be({}, A, {
    ref: e
  }));
}), uc = 10, [zqA, F0] = MG(rD), ASt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const {
    __scopeSelect: t,
    position: i = "item-aligned",
    onCloseAutoFocus: n,
    onEscapeKeyDown: o,
    onPointerDownOutside: g,
    side: s,
    sideOffset: I,
    align: r,
    alignOffset: a,
    arrowPadding: C,
    collisionBoundary: B,
    collisionPadding: l,
    sticky: Q,
    hideWhenDetached: E,
    avoidCollisions: d,
    //
    ...m
  } = A, y = R0(rD, t), [f, w] = u.useState(null), [G, R] = u.useState(null), F = On(
    e,
    (lA) => w(lA)
  ), [Z, c] = u.useState(null), [J, p] = u.useState(null), N = a9(t), [v, K] = u.useState(!1), U = u.useRef(!1);
  u.useEffect(() => {
    if (f)
      return O_A(f);
  }, [
    f
  ]), Z_A();
  const j = u.useCallback((lA) => {
    const [cA, ...aA] = N().map(
      (EA) => EA.ref.current
    ), [QA] = aA.slice(-1), hA = document.activeElement;
    for (const EA of lA)
      if (EA === hA || (EA == null || EA.scrollIntoView({
        block: "nearest"
      }), EA === cA && G && (G.scrollTop = 0), EA === QA && G && (G.scrollTop = G.scrollHeight), EA == null || EA.focus(), document.activeElement !== hA))
        return;
  }, [
    N,
    G
  ]), q = u.useCallback(
    () => j([
      Z,
      f
    ]),
    [
      j,
      Z,
      f
    ]
  );
  u.useEffect(() => {
    v && q();
  }, [
    v,
    q
  ]);
  const { onOpenChange: O, triggerPointerDownPosRef: $ } = y;
  u.useEffect(() => {
    if (f) {
      let lA = {
        x: 0,
        y: 0
      };
      const cA = (QA) => {
        var hA, EA, RA, xA;
        lA = {
          x: Math.abs(Math.round(QA.pageX) - ((hA = (EA = $.current) === null || EA === void 0 ? void 0 : EA.x) !== null && hA !== void 0 ? hA : 0)),
          y: Math.abs(Math.round(QA.pageY) - ((RA = (xA = $.current) === null || xA === void 0 ? void 0 : xA.y) !== null && RA !== void 0 ? RA : 0))
        };
      }, aA = (QA) => {
        lA.x <= 10 && lA.y <= 10 ? QA.preventDefault() : f.contains(QA.target) || O(!1), document.removeEventListener("pointermove", cA), $.current = null;
      };
      return $.current !== null && (document.addEventListener("pointermove", cA), document.addEventListener("pointerup", aA, {
        capture: !0,
        once: !0
      })), () => {
        document.removeEventListener("pointermove", cA), document.removeEventListener("pointerup", aA, {
          capture: !0
        });
      };
    }
  }, [
    f,
    O,
    $
  ]), u.useEffect(() => {
    const lA = () => O(!1);
    return window.addEventListener("blur", lA), window.addEventListener("resize", lA), () => {
      window.removeEventListener("blur", lA), window.removeEventListener("resize", lA);
    };
  }, [
    O
  ]);
  const [_, tA] = jqA((lA) => {
    const cA = N().filter(
      (hA) => !hA.disabled
    ), aA = cA.find(
      (hA) => hA.ref.current === document.activeElement
    ), QA = PqA(cA, lA, aA);
    QA && setTimeout(
      () => QA.ref.current.focus()
    );
  }), nA = u.useCallback((lA, cA, aA) => {
    const QA = !U.current && !aA;
    (y.value !== void 0 && y.value === cA || QA) && (c(lA), QA && (U.current = !0));
  }, [
    y.value
  ]), AA = u.useCallback(
    () => f == null ? void 0 : f.focus(),
    [
      f
    ]
  ), gA = u.useCallback((lA, cA, aA) => {
    const QA = !U.current && !aA;
    (y.value !== void 0 && y.value === cA || QA) && p(lA);
  }, [
    y.value
  ]), rA = i === "popper" ? gfA : eSt, sA = rA === gfA ? {
    side: s,
    sideOffset: I,
    align: r,
    alignOffset: a,
    arrowPadding: C,
    collisionBoundary: B,
    collisionPadding: l,
    sticky: Q,
    hideWhenDetached: E,
    avoidCollisions: d
  } : {};
  return /* @__PURE__ */ u.createElement(zqA, {
    scope: t,
    content: f,
    viewport: G,
    onViewportChange: R,
    itemRefCallback: nA,
    selectedItem: Z,
    onItemLeave: AA,
    itemTextRefCallback: gA,
    focusSelectedItem: q,
    selectedItemText: J,
    position: i,
    isPositioned: v,
    searchRef: _
  }, /* @__PURE__ */ u.createElement(__A, {
    as: vp,
    allowPinchZoom: !0
  }, /* @__PURE__ */ u.createElement(v_A, {
    asChild: !0,
    trapped: y.open,
    onMountAutoFocus: (lA) => {
      lA.preventDefault();
    },
    onUnmountAutoFocus: qt(n, (lA) => {
      var cA;
      (cA = y.trigger) === null || cA === void 0 || cA.focus({
        preventScroll: !0
      }), lA.preventDefault();
    })
  }, /* @__PURE__ */ u.createElement(x_A, {
    asChild: !0,
    disableOutsidePointerEvents: !0,
    onEscapeKeyDown: o,
    onPointerDownOutside: g,
    onFocusOutside: (lA) => lA.preventDefault(),
    onDismiss: () => y.onOpenChange(!1)
  }, /* @__PURE__ */ u.createElement(rA, be({
    role: "listbox",
    id: y.contentId,
    "data-state": y.open ? "open" : "closed",
    dir: y.dir,
    onContextMenu: (lA) => lA.preventDefault()
  }, m, sA, {
    onPlaced: () => K(!0),
    ref: F,
    style: {
      // flex layout so we can place the scroll buttons properly
      display: "flex",
      flexDirection: "column",
      // reset the outline by default as the content MAY get focused
      outline: "none",
      ...m.style
    },
    onKeyDown: qt(m.onKeyDown, (lA) => {
      const cA = lA.ctrlKey || lA.altKey || lA.metaKey;
      if (lA.key === "Tab" && lA.preventDefault(), !cA && lA.key.length === 1 && tA(lA.key), [
        "ArrowUp",
        "ArrowDown",
        "Home",
        "End"
      ].includes(lA.key)) {
        let QA = N().filter(
          (hA) => !hA.disabled
        ).map(
          (hA) => hA.ref.current
        );
        if ([
          "ArrowUp",
          "End"
        ].includes(lA.key) && (QA = QA.slice().reverse()), [
          "ArrowUp",
          "ArrowDown"
        ].includes(lA.key)) {
          const hA = lA.target, EA = QA.indexOf(hA);
          QA = QA.slice(EA + 1);
        }
        setTimeout(
          () => j(QA)
        ), lA.preventDefault();
      }
    })
  }))))));
}), eSt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, onPlaced: i, ...n } = A, o = R0(rD, t), g = F0(rD, t), [s, I] = u.useState(null), [r, a] = u.useState(null), C = On(
    e,
    (F) => a(F)
  ), B = a9(t), l = u.useRef(!1), Q = u.useRef(!0), { viewport: E, selectedItem: d, selectedItemText: m, focusSelectedItem: y } = g, f = u.useCallback(() => {
    if (o.trigger && o.valueNode && s && r && E && d && m) {
      const F = o.trigger.getBoundingClientRect(), Z = r.getBoundingClientRect(), c = o.valueNode.getBoundingClientRect(), J = m.getBoundingClientRect();
      if (o.dir !== "rtl") {
        const hA = J.left - Z.left, EA = c.left - hA, RA = F.left - EA, xA = F.width + RA, HA = Math.max(xA, Z.width), ne = window.innerWidth - uc, VA = OwA(EA, [
          uc,
          ne - HA
        ]);
        s.style.minWidth = xA + "px", s.style.left = VA + "px";
      } else {
        const hA = Z.right - J.right, EA = window.innerWidth - c.right - hA, RA = window.innerWidth - F.right - EA, xA = F.width + RA, HA = Math.max(xA, Z.width), ne = window.innerWidth - uc, VA = OwA(EA, [
          uc,
          ne - HA
        ]);
        s.style.minWidth = xA + "px", s.style.right = VA + "px";
      }
      const p = B(), N = window.innerHeight - uc * 2, v = E.scrollHeight, K = window.getComputedStyle(r), U = parseInt(K.borderTopWidth, 10), j = parseInt(K.paddingTop, 10), q = parseInt(K.borderBottomWidth, 10), O = parseInt(K.paddingBottom, 10), $ = U + j + v + O + q, _ = Math.min(d.offsetHeight * 5, $), tA = window.getComputedStyle(E), nA = parseInt(tA.paddingTop, 10), AA = parseInt(tA.paddingBottom, 10), gA = F.top + F.height / 2 - uc, rA = N - gA, sA = d.offsetHeight / 2, lA = d.offsetTop + sA, cA = U + j + lA, aA = $ - cA;
      if (cA <= gA) {
        const hA = d === p[p.length - 1].ref.current;
        s.style.bottom = "0px";
        const EA = r.clientHeight - E.offsetTop - E.offsetHeight, RA = Math.max(rA, sA + (hA ? AA : 0) + EA + q), xA = cA + RA;
        s.style.height = xA + "px";
      } else {
        const hA = d === p[0].ref.current;
        s.style.top = "0px";
        const RA = Math.max(gA, U + E.offsetTop + (hA ? nA : 0) + sA) + aA;
        s.style.height = RA + "px", E.scrollTop = cA - gA + E.offsetTop;
      }
      s.style.margin = `${uc}px 0`, s.style.minHeight = _ + "px", s.style.maxHeight = N + "px", i == null || i(), requestAnimationFrame(
        () => l.current = !0
      );
    }
  }, [
    B,
    o.trigger,
    o.valueNode,
    s,
    r,
    E,
    d,
    m,
    o.dir,
    i
  ]);
  AI(
    () => f(),
    [
      f
    ]
  );
  const [w, G] = u.useState();
  AI(() => {
    r && G(window.getComputedStyle(r).zIndex);
  }, [
    r
  ]);
  const R = u.useCallback((F) => {
    F && Q.current === !0 && (f(), y == null || y(), Q.current = !1);
  }, [
    f,
    y
  ]);
  return /* @__PURE__ */ u.createElement(tSt, {
    scope: t,
    contentWrapper: s,
    shouldExpandOnScrollRef: l,
    onScrollButtonChange: R
  }, /* @__PURE__ */ u.createElement("div", {
    ref: I,
    style: {
      display: "flex",
      flexDirection: "column",
      position: "fixed",
      zIndex: w
    }
  }, /* @__PURE__ */ u.createElement(ii.div, be({}, n, {
    ref: C,
    style: {
      // When we get the height of the content, it includes borders. If we were to set
      // the height without having `boxSizing: 'border-box'` it would be too big.
      boxSizing: "border-box",
      // We need to ensure the content doesn't get taller than the wrapper
      maxHeight: "100%",
      ...n.style
    }
  }))));
}), gfA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, align: i = "start", collisionPadding: n = uc, ...o } = A, g = aaA(t);
  return /* @__PURE__ */ u.createElement(HHt, be({}, g, o, {
    ref: e,
    align: i,
    collisionPadding: n,
    style: {
      // Ensure border-box for floating-ui calculations
      boxSizing: "border-box",
      ...o.style,
      "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-select-content-available-width": "var(--radix-popper-available-width)",
      "--radix-select-content-available-height": "var(--radix-popper-available-height)",
      "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
    }
  }));
}), [tSt, raA] = MG(rD, {}), sfA = "SelectViewport", iSt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, ...i } = A, n = F0(sfA, t), o = raA(sfA, t), g = On(e, n.onViewportChange), s = u.useRef(0);
  return /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("style", {
    dangerouslySetInnerHTML: {
      __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
    }
  }), /* @__PURE__ */ u.createElement(I9.Slot, {
    scope: t
  }, /* @__PURE__ */ u.createElement(ii.div, be({
    "data-radix-select-viewport": "",
    role: "presentation"
  }, i, {
    ref: g,
    style: {
      // we use position: 'relative' here on the `viewport` so that when we call
      // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
      // (independent of the scrollUpButton).
      position: "relative",
      flex: 1,
      overflow: "auto",
      ...i.style
    },
    onScroll: qt(i.onScroll, (I) => {
      const r = I.currentTarget, { contentWrapper: a, shouldExpandOnScrollRef: C } = o;
      if (C != null && C.current && a) {
        const B = Math.abs(s.current - r.scrollTop);
        if (B > 0) {
          const l = window.innerHeight - uc * 2, Q = parseFloat(a.style.minHeight), E = parseFloat(a.style.height), d = Math.max(Q, E);
          if (d < l) {
            const m = d + B, y = Math.min(l, m), f = m - y;
            a.style.height = y + "px", a.style.bottom === "0px" && (r.scrollTop = f > 0 ? f : 0, a.style.justifyContent = "flex-end");
          }
        }
      }
      s.current = r.scrollTop;
    })
  }))));
}), nSt = "SelectGroup", [C9t, oSt] = MG(nSt), gSt = "SelectLabel", sSt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, ...i } = A, n = oSt(gSt, t);
  return /* @__PURE__ */ u.createElement(ii.div, be({
    id: n.id
  }, i, {
    ref: e
  }));
}), i8 = "SelectItem", [ISt, TqA] = MG(i8), aSt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, value: i, disabled: n = !1, textValue: o, ...g } = A, s = R0(i8, t), I = F0(i8, t), r = s.value === i, [a, C] = u.useState(o ?? ""), [B, l] = u.useState(!1), Q = On(e, (m) => {
    var y;
    return (y = I.itemRefCallback) === null || y === void 0 ? void 0 : y.call(I, m, i, n);
  }), E = Km(), d = () => {
    n || (s.onValueChange(i), s.onOpenChange(!1));
  };
  if (i === "")
    throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
  return /* @__PURE__ */ u.createElement(ISt, {
    scope: t,
    value: i,
    disabled: n,
    textId: E,
    isSelected: r,
    onItemTextChange: u.useCallback((m) => {
      C((y) => {
        var f;
        return y || ((f = m == null ? void 0 : m.textContent) !== null && f !== void 0 ? f : "").trim();
      });
    }, [])
  }, /* @__PURE__ */ u.createElement(I9.ItemSlot, {
    scope: t,
    value: i,
    disabled: n,
    textValue: a
  }, /* @__PURE__ */ u.createElement(ii.div, be({
    role: "option",
    "aria-labelledby": E,
    "data-highlighted": B ? "" : void 0,
    "aria-selected": r && B,
    "data-state": r ? "checked" : "unchecked",
    "aria-disabled": n || void 0,
    "data-disabled": n ? "" : void 0,
    tabIndex: n ? void 0 : -1
  }, g, {
    ref: Q,
    onFocus: qt(
      g.onFocus,
      () => l(!0)
    ),
    onBlur: qt(
      g.onBlur,
      () => l(!1)
    ),
    onPointerUp: qt(g.onPointerUp, d),
    onPointerMove: qt(g.onPointerMove, (m) => {
      if (n) {
        var y;
        (y = I.onItemLeave) === null || y === void 0 || y.call(I);
      } else
        m.currentTarget.focus({
          preventScroll: !0
        });
    }),
    onPointerLeave: qt(g.onPointerLeave, (m) => {
      if (m.currentTarget === document.activeElement) {
        var y;
        (y = I.onItemLeave) === null || y === void 0 || y.call(I);
      }
    }),
    onKeyDown: qt(g.onKeyDown, (m) => {
      var y;
      ((y = I.searchRef) === null || y === void 0 ? void 0 : y.current) !== "" && m.key === " " || (WHt.includes(m.key) && d(), m.key === " " && m.preventDefault());
    })
  }))));
}), uL = "SelectItemText", rSt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, className: i, style: n, ...o } = A, g = R0(uL, t), s = F0(uL, t), I = TqA(uL, t), r = XHt(uL, t), [a, C] = u.useState(null), B = On(
    e,
    (m) => C(m),
    I.onItemTextChange,
    (m) => {
      var y;
      return (y = s.itemTextRefCallback) === null || y === void 0 ? void 0 : y.call(s, m, I.value, I.disabled);
    }
  ), l = a == null ? void 0 : a.textContent, Q = u.useMemo(
    () => /* @__PURE__ */ u.createElement("option", {
      key: I.value,
      value: I.value,
      disabled: I.disabled
    }, l),
    [
      I.disabled,
      I.value,
      l
    ]
  ), { onNativeOptionAdd: E, onNativeOptionRemove: d } = r;
  return AI(() => (E(Q), () => d(Q)), [
    E,
    d,
    Q
  ]), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(ii.span, be({
    id: I.textId
  }, o, {
    ref: B
  })), I.isSelected && g.valueNode && !g.valueNodeHasChildren ? /* @__PURE__ */ Jt.createPortal(o.children, g.valueNode) : null);
}), CSt = "SelectItemIndicator", BSt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, ...i } = A;
  return TqA(CSt, t).isSelected ? /* @__PURE__ */ u.createElement(ii.span, be({
    "aria-hidden": !0
  }, i, {
    ref: e
  })) : null;
}), IfA = "SelectScrollUpButton", lSt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = F0(IfA, A.__scopeSelect), i = raA(IfA, A.__scopeSelect), [n, o] = u.useState(!1), g = On(e, i.onScrollButtonChange);
  return AI(() => {
    if (t.viewport && t.isPositioned) {
      let I = function() {
        const r = s.scrollTop > 0;
        o(r);
      };
      const s = t.viewport;
      return I(), s.addEventListener("scroll", I), () => s.removeEventListener("scroll", I);
    }
  }, [
    t.viewport,
    t.isPositioned
  ]), n ? /* @__PURE__ */ u.createElement(_qA, be({}, A, {
    ref: g,
    onAutoScroll: () => {
      const { viewport: s, selectedItem: I } = t;
      s && I && (s.scrollTop = s.scrollTop - I.offsetHeight);
    }
  })) : null;
}), afA = "SelectScrollDownButton", cSt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const t = F0(afA, A.__scopeSelect), i = raA(afA, A.__scopeSelect), [n, o] = u.useState(!1), g = On(e, i.onScrollButtonChange);
  return AI(() => {
    if (t.viewport && t.isPositioned) {
      let I = function() {
        const r = s.scrollHeight - s.clientHeight, a = Math.ceil(s.scrollTop) < r;
        o(a);
      };
      const s = t.viewport;
      return I(), s.addEventListener("scroll", I), () => s.removeEventListener("scroll", I);
    }
  }, [
    t.viewport,
    t.isPositioned
  ]), n ? /* @__PURE__ */ u.createElement(_qA, be({}, A, {
    ref: g,
    onAutoScroll: () => {
      const { viewport: s, selectedItem: I } = t;
      s && I && (s.scrollTop = s.scrollTop + I.offsetHeight);
    }
  })) : null;
}), _qA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, onAutoScroll: i, ...n } = A, o = F0("SelectScrollButton", t), g = u.useRef(null), s = a9(t), I = u.useCallback(() => {
    g.current !== null && (window.clearInterval(g.current), g.current = null);
  }, []);
  return u.useEffect(() => () => I(), [
    I
  ]), AI(() => {
    var r;
    const a = s().find(
      (C) => C.ref.current === document.activeElement
    );
    a == null || (r = a.ref.current) === null || r === void 0 || r.scrollIntoView({
      block: "nearest"
    });
  }, [
    s
  ]), /* @__PURE__ */ u.createElement(ii.div, be({
    "aria-hidden": !0
  }, n, {
    ref: e,
    style: {
      flexShrink: 0,
      ...n.style
    },
    onPointerDown: qt(n.onPointerDown, () => {
      g.current === null && (g.current = window.setInterval(i, 50));
    }),
    onPointerMove: qt(n.onPointerMove, () => {
      var r;
      (r = o.onItemLeave) === null || r === void 0 || r.call(o), g.current === null && (g.current = window.setInterval(i, 50));
    }),
    onPointerLeave: qt(n.onPointerLeave, () => {
      I();
    })
  }));
}), QSt = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { __scopeSelect: t, ...i } = A;
  return /* @__PURE__ */ u.createElement(ii.div, be({
    "aria-hidden": !0
  }, i, {
    ref: e
  }));
});
function qqA(A) {
  return A === "" || A === void 0;
}
const OqA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { value: t, ...i } = A, n = u.useRef(null), o = On(e, n), g = iqA(t);
  return u.useEffect(() => {
    const s = n.current, I = window.HTMLSelectElement.prototype, a = Object.getOwnPropertyDescriptor(I, "value").set;
    if (g !== t && a) {
      const C = new Event("change", {
        bubbles: !0
      });
      a.call(s, t), s.dispatchEvent(C);
    }
  }, [
    g,
    t
  ]), /* @__PURE__ */ u.createElement(SHt, {
    asChild: !0
  }, /* @__PURE__ */ u.createElement("select", be({}, i, {
    ref: o,
    defaultValue: t
  })));
});
OqA.displayName = "BubbleSelect";
function jqA(A) {
  const e = cl(A), t = u.useRef(""), i = u.useRef(0), n = u.useCallback((g) => {
    const s = t.current + g;
    e(s), function I(r) {
      t.current = r, window.clearTimeout(i.current), r !== "" && (i.current = window.setTimeout(
        () => I(""),
        1e3
      ));
    }(s);
  }, [
    e
  ]), o = u.useCallback(() => {
    t.current = "", window.clearTimeout(i.current);
  }, []);
  return u.useEffect(() => () => window.clearTimeout(i.current), []), [
    t,
    n,
    o
  ];
}
function PqA(A, e, t) {
  const n = e.length > 1 && Array.from(e).every(
    (r) => r === e[0]
  ) ? e[0] : e, o = t ? A.indexOf(t) : -1;
  let g = ESt(A, Math.max(o, 0));
  n.length === 1 && (g = g.filter(
    (r) => r !== t
  ));
  const I = g.find(
    (r) => r.textValue.toLowerCase().startsWith(n.toLowerCase())
  );
  return I !== t ? I : void 0;
}
function ESt(A, e) {
  return A.map(
    (t, i) => A[(e + i) % A.length]
  );
}
const uSt = zHt, $qA = _Ht, dSt = OHt, hSt = jHt, mSt = PHt, AOA = $Ht, pSt = iSt, eOA = sSt, tOA = aSt, ySt = rSt, bSt = BSt, iOA = lSt, nOA = cSt, oOA = QSt, wSt = uSt, fSt = dSt, gOA = u.forwardRef(({ className: A, children: e, ...t }, i) => ue($qA, { ref: i, className: dn("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", A), ...t, children: [e, pA(hSt, { asChild: !0, children: pA(iRt, { className: "h-4 w-4 opacity-50" }) })] }));
gOA.displayName = $qA.displayName;
const sOA = u.forwardRef(({ className: A, ...e }, t) => pA(iOA, { ref: t, className: dn("flex cursor-default items-center justify-center py-1", A), ...e, children: pA(BRt, {}) }));
sOA.displayName = iOA.displayName;
const IOA = u.forwardRef(({ className: A, ...e }, t) => pA(nOA, { ref: t, className: dn("flex cursor-default items-center justify-center py-1", A), ...e, children: pA(gRt, {}) }));
IOA.displayName = nOA.displayName;
const aOA = u.forwardRef(({ className: A, children: e, position: t = "popper", ...i }, n) => pA(mSt, { container: u.useContext(BIA), children: ue(AOA, { ref: n, className: dn("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", t === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", A), position: t, ...i, children: [pA(sOA, {}), pA(pSt, { className: dn("p-1", t === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"), children: e }), pA(IOA, {})] }) }));
aOA.displayName = AOA.displayName;
const DSt = u.forwardRef(({ className: A, ...e }, t) => pA(eOA, { ref: t, className: dn("px-2 py-1.5 text-sm font-semibold", A), ...e }));
DSt.displayName = eOA.displayName;
const n8 = u.forwardRef(({ className: A, children: e, ...t }, i) => ue(tOA, { ref: i, className: dn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", A), ...t, children: [pA("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: pA(bSt, { children: pA(s4A, { className: "h-4 w-4" }) }) }), pA(ySt, { children: e })] }));
n8.displayName = tOA.displayName;
const GSt = u.forwardRef(({ className: A, ...e }, t) => pA(oOA, { ref: t, className: dn("-mx-1 my-1 h-px bg-muted", A), ...e }));
GSt.displayName = oOA.displayName;
const rOA = /* @__PURE__ */ u.forwardRef((A, e) => {
  const { pressed: t, defaultPressed: i = !1, onPressedChange: n, ...o } = A, [g = !1, s] = yQ({
    prop: t,
    onChange: n,
    defaultProp: i
  });
  return /* @__PURE__ */ u.createElement(ii.button, be({
    type: "button",
    "aria-pressed": g,
    "data-state": g ? "on" : "off",
    "data-disabled": A.disabled ? "" : void 0
  }, o, {
    ref: e,
    onClick: qt(A.onClick, () => {
      A.disabled || s(!g);
    })
  }));
}), COA = rOA, r9 = "ToggleGroup", [BOA, B9t] = Ah(r9, [
  NX
]), lOA = NX(), kSt = /* @__PURE__ */ b.forwardRef((A, e) => {
  const { type: t, ...i } = A;
  if (t === "single") {
    const n = i;
    return /* @__PURE__ */ b.createElement(JSt, be({}, n, {
      ref: e
    }));
  }
  if (t === "multiple") {
    const n = i;
    return /* @__PURE__ */ b.createElement(NSt, be({}, n, {
      ref: e
    }));
  }
  throw new Error(`Missing prop \`type\` expected on \`${r9}\``);
}), [cOA, QOA] = BOA(r9), JSt = /* @__PURE__ */ b.forwardRef((A, e) => {
  const { value: t, defaultValue: i, onValueChange: n = () => {
  }, ...o } = A, [g, s] = yQ({
    prop: t,
    defaultProp: i,
    onChange: n
  });
  return /* @__PURE__ */ b.createElement(cOA, {
    scope: A.__scopeToggleGroup,
    type: "single",
    value: g ? [
      g
    ] : [],
    onItemActivate: s,
    onItemDeactivate: b.useCallback(
      () => s(""),
      [
        s
      ]
    )
  }, /* @__PURE__ */ b.createElement(EOA, be({}, o, {
    ref: e
  })));
}), NSt = /* @__PURE__ */ b.forwardRef((A, e) => {
  const { value: t, defaultValue: i, onValueChange: n = () => {
  }, ...o } = A, [g = [], s] = yQ({
    prop: t,
    defaultProp: i,
    onChange: n
  }), I = b.useCallback(
    (a) => s(
      (C = []) => [
        ...C,
        a
      ]
    ),
    [
      s
    ]
  ), r = b.useCallback(
    (a) => s(
      (C = []) => C.filter(
        (B) => B !== a
      )
    ),
    [
      s
    ]
  );
  return /* @__PURE__ */ b.createElement(cOA, {
    scope: A.__scopeToggleGroup,
    type: "multiple",
    value: g,
    onItemActivate: I,
    onItemDeactivate: r
  }, /* @__PURE__ */ b.createElement(EOA, be({}, o, {
    ref: e
  })));
}), [YSt, RSt] = BOA(r9), EOA = /* @__PURE__ */ b.forwardRef((A, e) => {
  const { __scopeToggleGroup: t, disabled: i = !1, rovingFocus: n = !0, orientation: o, dir: g, loop: s = !0, ...I } = A, r = lOA(t), a = JX(g), C = {
    role: "group",
    dir: a,
    ...I
  };
  return /* @__PURE__ */ b.createElement(YSt, {
    scope: t,
    rovingFocus: n,
    disabled: i
  }, n ? /* @__PURE__ */ b.createElement(gzA, be({
    asChild: !0
  }, r, {
    orientation: o,
    dir: a,
    loop: s
  }), /* @__PURE__ */ b.createElement(ii.div, be({}, C, {
    ref: e
  }))) : /* @__PURE__ */ b.createElement(ii.div, be({}, C, {
    ref: e
  })));
}), o8 = "ToggleGroupItem", FSt = /* @__PURE__ */ b.forwardRef((A, e) => {
  const t = QOA(o8, A.__scopeToggleGroup), i = RSt(o8, A.__scopeToggleGroup), n = lOA(A.__scopeToggleGroup), o = t.value.includes(A.value), g = i.disabled || A.disabled, s = {
    ...A,
    pressed: o,
    disabled: g
  }, I = b.useRef(null);
  return i.rovingFocus ? /* @__PURE__ */ b.createElement(szA, be({
    asChild: !0
  }, n, {
    focusable: !g,
    active: o,
    ref: I
  }), /* @__PURE__ */ b.createElement(rfA, be({}, s, {
    ref: e
  }))) : /* @__PURE__ */ b.createElement(rfA, be({}, s, {
    ref: e
  }));
}), rfA = /* @__PURE__ */ b.forwardRef((A, e) => {
  const { __scopeToggleGroup: t, value: i, ...n } = A, o = QOA(o8, t), g = {
    role: "radio",
    "aria-checked": A.pressed,
    "aria-pressed": void 0
  }, s = o.type === "single" ? g : void 0;
  return /* @__PURE__ */ b.createElement(rOA, be({}, s, n, {
    ref: e,
    onPressedChange: (I) => {
      I ? o.onItemActivate(i) : o.onItemDeactivate(i);
    }
  }));
}), uOA = kSt, dOA = FSt, hOA = HX("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", {
  variants: {
    variant: {
      default: "bg-transparent",
      outline: "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"
    },
    size: {
      default: "h-9 px-3",
      sm: "h-8 px-2",
      lg: "h-10 px-3"
    }
  },
  defaultVariants: {
    variant: "default",
    size: "default"
  }
}), MSt = u.forwardRef(({ className: A, variant: e, size: t, ...i }, n) => pA(COA, { ref: n, className: dn(hOA({ variant: e, size: t, className: A })), ...i }));
MSt.displayName = COA.displayName;
const mOA = u.createContext({
  size: "default",
  variant: "default"
}), pOA = u.forwardRef(({ className: A, variant: e, size: t, children: i, ...n }, o) => pA(uOA, { ref: o, className: dn("flex items-center justify-center gap-1", A), ...n, children: pA(mOA.Provider, { value: { variant: e, size: t }, children: i }) }));
pOA.displayName = uOA.displayName;
const Mv = u.forwardRef(({ className: A, children: e, variant: t, size: i, ...n }, o) => {
  const g = u.useContext(mOA);
  return pA(dOA, { ref: o, className: dn(hOA({
    variant: g.variant || t,
    size: g.size || i
  }), A), ...n, children: e });
});
Mv.displayName = dOA.displayName;
function j_(A) {
  return A === "media" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : A;
}
const xSt = /* @__PURE__ */ new Set(["column", "row", "color", "opacity", "shape", "size", "details", "theta", "x", "y", "facet", "order", "radius"]), LSt = (A) => xSt.has(A), vSt = /* @__PURE__ */ new Set(["sum", "count", "max", "min", "mean", "median", "variance", "stdev"]), HSt = (A) => !!A && vSt.has(A), KN = {
  fid: "gw_count_fid",
  name: "Row count",
  analyticType: "measure",
  semanticType: "quantitative",
  aggName: "sum",
  computed: !0,
  expression: {
    op: "one",
    params: [],
    as: "gw_count_fid"
  }
}, SSt = (A) => A === "zero" || A === !0 ? "stack" : A === null ? "none" : A;
function CfA(A) {
  let e = "none";
  if (typeof A == "string" ? e = A : A && A instanceof Object && (e = A.order ?? "ascending"), e !== "none") {
    const t = ["x", "y", "color", "size", "opacity"];
    if (e.startsWith("-") || e === "descending")
      return "descending";
    if (t.indexOf(e) > -1 || e === "ascending")
      return "ascending";
  }
}
const ZSt = {
  row: "facetY",
  facet: "facetY",
  column: "facetX",
  x: "column",
  y: "row",
  opacity: "opacity",
  size: "size",
  shape: "shape",
  radius: "radius",
  theta: "theta",
  details: "details",
  text: "text",
  color: "color"
}, BfA = /* @__PURE__ */ new Set(["theta", "x", "y"]);
function WSt(A) {
  const e = `gw_${_4A(4)}`;
  return {
    fid: e,
    name: `bin(${A.name})`,
    semanticType: "ordinal",
    analyticType: "dimension",
    computed: !0,
    expression: {
      op: "bin",
      as: e,
      params: [
        {
          type: "field",
          value: A.fid
        }
      ]
    }
  };
}
function KSt(A, e, t) {
  switch (A) {
    case "order":
      return {
        sort: CfA(e.sort)
      };
    default:
      const i = BfA.has(A), n = t.get(e.field) ?? KN, o = e.bin ? WSt(n) : n, g = o === KN ? "count" : HSt(e.aggregate) && i ? e.aggregate : void 0;
      let s;
      return o === KN || g ? s = "measure" : o.analyticType === "measure" && BfA.has(A) ? s = "auto" : s = "dimension", {
        dimension: o,
        binDimension: e.bin ? o : void 0,
        dimensionType: ZSt[A],
        analyticType: s,
        aggregate: g,
        stack: SSt(e.stack),
        sort: e.sort ? CfA(e.sort) : void 0
      };
  }
}
const Uy = (A) => Object.keys(A).map((e) => ({ name: e, value: A[e] }));
function sJ(A) {
  function e(t) {
    switch (t) {
      case "interval":
      case "bar":
        return "bar";
      case "line":
        return "line";
      case "boxplot":
        return "boxplot";
      case "area":
        return "area";
      case "point":
        return "point";
      case "arc":
        return "arc";
      case "circle":
        return "circle";
      case "heatmap":
        return "circle";
      case "rect":
        return "rect";
      case "tick":
      default:
        return "tick";
    }
  }
  return e(typeof A == "string" ? A : A.type);
}
const lfA = (A) => {
  switch (A) {
    case "==":
    case "===":
    case "equal":
    case "oneOf":
      return "one of";
    case "!=":
    case "!==":
      return "not in";
    case ">":
    case ">=":
    case "<":
    case "<=":
    case "lt":
    case "lte":
    case "gt":
    case "gte":
    case "range":
      return "range";
  }
  return "one of";
};
function cfA(A, e) {
  const t = /* @__PURE__ */ new Set(), i = [];
  return A.forEach((n) => {
    const o = e(n);
    t.has(o) || (t.add(o), i.push(n));
  }), i;
}
function USt(A, e, t, i) {
  let n = "tick";
  const o = [];
  A.facet && o.push(...Uy(A.facet)), A.encoding && o.push(...Uy(A.encoding)), A.mark && (n = sJ(A.mark)), A.spec && (n = sJ(A.spec.mark), A.spec.encoding && o.push(...Uy(A.spec.encoding))), A.concat && A.concat.forEach((w) => {
    n = sJ(w.mark), w.encoding && o.push(...Uy(w.encoding));
  }), A.hconcat && A.hconcat.forEach((w) => {
    n = sJ(w.mark), w.encoding && o.push(...Uy(w.encoding));
  }), A.vconcat && A.vconcat.forEach((w) => {
    n = sJ(w.mark), w.encoding && o.push(...Uy(w.encoding));
  });
  const g = {}, s = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map();
  e.forEach((w) => {
    I.set(w.name, w);
  });
  const r = (w, G, R) => {
    const F = `${w}|${lfA(G)}`;
    s.has(F) || s.set(F, { field: w, rule: lfA(G), value: [] }), G.startsWith(">") || G.startsWith("gt") ? s.get(F).value = [R, s.get(F).value[1] ?? null] : G.startsWith("<") || G.startsWith("lt") ? s.get(F).value = [s.get(F).value[0] ?? null, R] : G === "range" ? s.get(F).value = R : G === "oneOf" ? s.get(F).value.push(...R) : s.get(F).value.push(R);
  };
  A.transform && A.transform.forEach((w) => {
    if (w.fold && (g.folds = w.fold.map((G) => {
      var R;
      return ((R = I.get(G)) == null ? void 0 : R.fid) ?? G;
    })), w.filter && (typeof w.filter == "string" && w.filter.split(/[\&\&|\|\|]/g).forEach((R) => {
      const F = /datum(\.[A-z_]+|\[['"][A-z\s_]+['"]\])\s*((\!=|==|>|<)=?)\s*(.*)/.exec(R);
      if (F) {
        const Z = /(?:\.|\[["'])([A-z\s_]*)(?:["']\])?/.exec(F[1]), c = /["'](.*)["']/.exec(F[4]);
        if (!Z || !c)
          return;
        const J = F[2];
        r(Z[1], J, c[1]);
      }
    }), typeof w.filter == "object"))
      if (w.filter.field === "rank")
        w.filter.lte ? g.limit = w.filter.lte : w.filter.lt && (g.limit = Math.floor(w.filter.lt), g.limit == w.filter.lt && (g.limit -= 1));
      else {
        const G = Object.keys(w.filter).find((R) => ["equal", "oneOf", "lt", "lte", "gt", "gte", "range"].includes(R));
        G && r(w.filter.field, G, w.filter[G]);
      }
  });
  const a = Array.from(s.values()).map(({ field: w, rule: G, value: R }) => ({
    fid: w,
    rule: {
      type: G,
      value: R
    }
  })), C = o.flatMap(({ name: w, value: G }) => LSt(w) ? [KSt(w, G, I)] : []), B = C.reduce((w, G) => w || !!G.aggregate, !1), l = C.reduce((w, G) => G.sort ?? w, "none"), Q = C.reduce((w, G) => G.stack ?? w, ["bar", "area", "arc"].includes(n) ? "stack" : "none"), E = C.reduce((w, G) => G.binDimension && !w.has(G.binDimension.name) ? w.set(G.binDimension.name, G.binDimension) : w, /* @__PURE__ */ new Map()), d = C.flatMap((w) => {
    if (w.dimension && w.dimensionType) {
      if (w.binDimension)
        return [
          {
            name: w.dimensionType,
            value: E.get(w.binDimension.name) ?? w.binDimension
          }
        ];
      const G = w.analyticType === "auto" ? B ? "dimension" : "measure" : w.analyticType;
      return [
        {
          name: w.dimensionType,
          value: {
            ...w.dimension,
            analyticType: G,
            ...w.aggregate ? {
              aggName: w.aggregate
            } : {},
            ...l && l !== "none" && (w.dimensionType === "column" || w.dimensionType === "row") && G === "dimension" ? {
              sort: l
            } : {}
          }
        }
      ];
    }
    return [];
  }), m = (w) => (G) => G.name === w, y = (w) => w.value, f = (w) => cfA(w, (G) => G.fid);
  return Rxt({
    visId: t,
    name: i,
    encodings: {
      dimensions: e.filter((w) => w.analyticType === "dimension").concat(...E.values()),
      measures: e.filter((w) => w.analyticType === "measure" && w.fid !== KN.fid).concat(KN),
      columns: f(d.filter(m("facetX")).concat(d.filter(m("column"))).map(y)),
      rows: f(d.filter(m("facetY")).concat(d.filter(m("row"))).map(y)),
      details: f(d.filter(m("details")).map(y)),
      opacity: f(d.filter(m("opacity")).map(y)),
      radius: f(d.filter(m("radius")).map(y)),
      shape: f(d.filter(m("shape")).map(y)),
      size: f(d.filter(m("size")).map(y)),
      text: f(d.filter(m("text")).map(y)),
      theta: f(d.filter(m("theta")).map(y)),
      color: f(d.filter(m("color")).map(y)),
      filters: cfA(a.map((w) => ({
        ...I.get(w.fid),
        rule: w.rule
      })), (w) => {
        var G;
        return `${w.fid}_${(G = w.rule) == null ? void 0 : G.type}`;
      })
    },
    layout: {
      stack: Q
    },
    config: {
      defaultAggregated: B,
      geoms: [n],
      ...g
    }
  });
}
function xG(A, e) {
  return A.map((t, i) => ["config", "encodings", "visId"].every((n) => t.hasOwnProperty(n)) ? t : USt(t, e, Math.random().toString(16).split(".").at(1), `Chart ${i + 1}`));
}
const VSt = async (A, e, t) => {
  var i, n;
  if (t.needInitChart && t.env === "jupyter_widgets" && e !== 0) {
    Te.setInitModalOpen(!0), Te.setInitModalInfo({
      title: "Recover Charts",
      curIndex: 0,
      total: e
    });
    for await (const o of (i = A.current) == null ? void 0 : i.exportChartList("data-url"))
      await ((n = ga.comm) == null ? void 0 : n.sendMsg("save_chart", await QqA(o.data))), Te.setInitModalInfo({
        title: "Recover Charts",
        curIndex: o.index + 1,
        total: o.total
      });
  }
  Te.setInitModalOpen(!1);
}, C9 = (A) => {
  if (A.useKernelCalc && A.parseDslType === "client")
    return SJt(A.fieldMetas);
  if (A.useKernelCalc && A.parseDslType === "server")
    return ZJt;
}, N1 = NQ((A) => {
  const [e, t] = u.useState(null), [i, n] = u.useState(A.darkMode), [o, g] = u.useState(j_(A.darkMode)), s = u.useCallback((I) => {
    A.sendMessage && window.parent.postMessage({
      action: "changeAppearance",
      gid: A.gid,
      appearance: I
    }, "*");
  }, [A.gid, A.sendMessage]);
  return u.useEffect(() => {
    if (i === "media") {
      g(j_(i)), s(j_(i));
      const I = window.matchMedia("(prefers-color-scheme: dark)"), r = (a) => {
        g(a.matches ? "dark" : "light");
      };
      return I.addEventListener("change", r), () => I.removeEventListener("change", r);
    } else
      s(i), g(i);
  }, [i]), pA(ZYt, { portalContainerContext: e, darkModeContext: o, children: pA("div", { className: `${o === "dark" ? "dark" : ""} bg-background text-foreground`, children: ue("div", { className: "p-2", children: [pA("style", { children: eqA }), pA("div", { className: "overflow-y-auto", children: A.children }), !A.hideToolBar && pA("div", { className: "flex w-full mt-1 p-1 overflow-hidden border-t border-border", children: ue(pOA, { type: "single", value: i, onValueChange: (I) => {
    I && n(I);
  }, children: [pA(Mv, { value: "dark", children: pA(dRt, { className: "h-4 w-4" }) }), pA(Mv, { value: "light", children: pA(mRt, { className: "h-4 w-4" }) }), pA(Mv, { value: "media", children: pA(ERt, { className: "h-4 w-4" }) })] }) }), pA(tLt, {}), pA("div", { ref: t })] }) }) });
}), XSt = (A) => {
  const e = b.useRef(null), { userConfig: t } = A, [i, n] = u.useState(!1), [o, g] = u.useState("walker"), [s, I] = u.useState(A.visSpec), [r, a] = u.useState(!0), [C, B] = u.useState(!1), l = b.useRef(null), Q = b.useRef(), E = b.useMemo(() => new Proxy(l, {
    set(R, F, Z) {
      var c;
      if (F === "current" && Z) {
        (c = Q.current) == null || c.call(Q);
        const J = Z;
        Q.current = r$A(() => J.currentVis, () => {
          B(Z.canUndo), OJt({
            event: "spec_change",
            data: J.exportCode()
          });
        });
      }
      return Reflect.set(R, F, Z);
    }
  }), []);
  Te.setVersion(A.version), u.useEffect(() => {
    Te.setShowCloudTool(A.showCloudTool), lC.setUserId(A.hashcode ?? ""), t && (PJt(t), lC.setOpen(t.privacy === "events"));
  }, []), u.useEffect(() => {
    A.initChartFlag && setTimeout(() => {
      VSt(e, s.length, A);
    }, 0);
  }, [A.initChartFlag]), u.useEffect(() => {
    setTimeout(() => {
      var R;
      (R = l.current) == null || R.setSegmentKey(A.defaultTab);
    }, 0);
  }, [o]);
  const m = [avt(n)];
  if (A.env && ["jupyter_widgets", "streamlit", "gradio", "marimo", "anywidget", "web_server"].indexOf(A.env) !== -1 && A.useSaveTool) {
    const R = Ivt(A, e, l, C, B);
    m.push(R);
  }
  if (A.isExportDataFrame) {
    const R = rvt(A, l);
    m.push(R);
  }
  const y = {
    exclude: ["export_code"],
    extra: m
  }, f = b.useMemo(() => {
    if (A.showCloudTool)
      return {
        features: {
          askviz: async (R, F) => {
            var c;
            const Z = await ((c = ga.comm) == null ? void 0 : c.sendMsg("get_spec_by_text", { metas: R, query: F }));
            return Z == null ? void 0 : Z.data.data;
          },
          vlChat: async (R, F) => {
            var c;
            const Z = await ((c = ga.comm) == null ? void 0 : c.sendMsg("get_chart_by_chats", { metas: R, chats: F }));
            return Z == null ? void 0 : Z.data.data;
          }
        }
      };
  }, [A.showCloudTool]), w = b.useMemo(() => C9(A), []), G = (R) => {
    var F;
    o === "walker" && I((F = l.current) == null ? void 0 : F.exportCode()), g(R);
  };
  return ue(b.StrictMode, { children: [pA(Hvt, {}), pA(ALt, { storeRef: l, setGwIsChanged: B }), pA(eLt, { gwRef: e, storeRef: l, dark: u.useContext(dd) }), pA(Zxt, { open: i, setOpen: n, globalStore: l, sourceCode: A.sourceInvokeCode || "" }), !r && ue(wSt, { onValueChange: G, defaultValue: "walker", children: [ue(gOA, { className: "w-[140px] h-[30px] mb-[20px] text-xs", children: [pA("span", { className: "text-muted-foreground", children: "Mode: " }), pA(fSt, { className: "", placeholder: "Mode" })] }), ue(aOA, { children: [pA(n8, { value: "walker", children: "Walker" }), pA(n8, { value: "renderer", children: "Renderer" })] })] }), o === "walker" ? pA(O5A, { ...A.extraConfig, appearance: u.useContext(dd), vizThemeConfig: A.themeKey, fieldkeyGuard: A.fieldkeyGuard, fields: A.rawFields, data: A.useKernelCalc ? void 0 : A.dataSource, storeRef: E, ref: e, toolbar: y, computation: w, enhanceAPI: f, chart: s.length === 0 ? void 0 : s, experimentalFeatures: { computedField: A.useKernelCalc }, defaultConfig: { config: { timezoneDisplayOffset: 0 } } }) : pA(yOA, { ...A, dataSource: A.dataSource, visSpec: s }), pA(DJt, { ...A })] });
}, zSt = NQ((A) => {
  const e = C9(A), t = A.visSpec[0], [i, n] = u.useState(!1);
  return pA(b.StrictMode, { children: ue("div", { className: "flex", children: [!i && pA(GsA, { ...A.extraConfig, appearance: u.useContext(dd), vizThemeConfig: A.themeKey, name: t.name, visualConfig: t.config, visualLayout: t.layout, visualState: t.encodings, type: "remote", computation: e }), i && Te.isStreamlitComponent && pA("div", { style: { minWidth: "96%" }, children: pA(O5A, { ...A.extraConfig, appearance: u.useContext(dd), vizThemeConfig: A.themeKey, fieldkeyGuard: A.fieldkeyGuard, fields: A.rawFields, data: A.useKernelCalc ? void 0 : A.dataSource, computation: e, chart: A.visSpec, experimentalFeatures: { computedField: A.useKernelCalc }, defaultConfig: { config: { timezoneDisplayOffset: 0 } } }) }), Te.isStreamlitComponent && i && pA(IRt, { className: "h-6 w-6 cursor-pointer border border-black-600 rounded-full", onClick: () => n(!1) }), Te.isStreamlitComponent && !i && pA(rRt, { className: "h-6 w-6 cursor-pointer border border-black-600 rounded-full", onClick: () => n(!0) })] }) });
}), TSt = async (A) => {
  const e = TJt(A.id);
  if (e.registerEndpoint("postData", xJt), e.registerEndpoint("finishData", LJt), ga.setComm(e), A.needLoadLastSpec) {
    const t = await e.sendMsg("get_latest_vis_spec", {});
    A.visSpec = xG(t.data.visSpec, A.rawFields);
  }
  A.needLoadDatas && e.sendMsgAsync("request_data", {}, null), await LX();
}, xv = async (A) => {
  const e = await qJt(A.id, A.communicationUrl);
  if (ga.setComm(e), (A.gwMode === "explore" || A.gwMode === "filter_renderer") && A.needLoadLastSpec) {
    const t = await e.sendMsg("get_latest_vis_spec", {});
    A.visSpec = t.data.visSpec;
  }
  await LX();
}, _St = async (A, e) => {
  const t = await jJt(A.id, e);
  if (ga.setComm(t), (A.gwMode === "explore" || A.gwMode === "filter_renderer") && A.needLoadLastSpec) {
    const i = await t.sendMsg("get_latest_vis_spec", {});
    A.visSpec = i.data.visSpec;
  }
  await LX();
}, QfA = async (A) => {
};
function CaA(A) {
  const [e, t] = u.useState(!1), [i, n] = u.useState(A.dataSource);
  return u.useEffect(() => {
    A.needLoadDatas ? MJt(A.dataSourceProps).then((o) => {
      n(o), t(!0), Te.setInitModalOpen(!1);
    }) : t(!0);
  }, []), ue(b.StrictMode, { children: [A.gwMode === "explore" && pA(XSt, { ...A, dataSource: i, initChartFlag: e }), A.gwMode === "renderer" && pA(zSt, { ...A, dataSource: i }), A.gwMode === "filter_renderer" && pA(yOA, { ...A, dataSource: i }), A.gwMode === "table" && pA(PSt, { ...A, dataSource: i })] });
}
function qSt(A, e) {
  A.visSpec = xG(A.visSpec, A.rawFields);
  let t = QfA;
  switch (A.env) {
    case "jupyter_widgets":
      t = TSt;
      break;
    case "streamlit":
      t = xv;
      break;
    case "gradio":
      t = xv;
      break;
    case "web_server":
      t = xv;
      break;
    default:
      t = QfA;
  }
  t(A).then(() => {
    var i;
    kd.render(pA(N1, { darkMode: A.dark, gid: A.id, sendMessage: (i = A.env) == null ? void 0 : i.startsWith("jupyter"), children: pA(CaA, { ...A }) }), document.getElementById(e));
  });
}
function OSt(A, e) {
  var t;
  A.charts = xG(A.charts.map((i) => i.visSpec), []).map((i, n) => ({ ...A.charts[n], visSpec: i })), window.document.getElementById(`gwalker-${A.gid}`) && ((t = window.document.getElementById(e)) == null || t.remove()), kd.render(pA(N1, { darkMode: A.dark, hideToolBar: !0, children: pA(Wxt, { ...A }) }), document.getElementById(e));
}
function jSt(A, e) {
  A.visSpec = xG([A.visSpec], [])[0], kd.render(pA(N1, { darkMode: A.dark, hideToolBar: !0, children: pA(Kxt, { ...A }) }), document.getElementById(e));
}
function yOA(A) {
  const e = C9(A), t = A.containerSize ?? [null, null], i = {
    rawFields: A.rawFields,
    containerStyle: {
      height: t[1] ? `${t[1] - 200}px` : "700px",
      width: t[0] ? `${t[0] - 20}px` : "60%"
    },
    themeKey: A.themeKey,
    dark: u.useContext(dd)
  };
  return pA(b.StrictMode, { children: ue(YsA, { defaultValue: "0", className: "w-full", children: [pA("div", { className: "overflow-x-auto max-w-full", children: pA(YX, { children: A.visSpec.map((n, o) => pA(M2, { value: o.toString(), children: n.name }, o)) }) }), A.visSpec.map((n, o) => pA(x2, { value: o.toString(), children: A.useKernelCalc ? pA(UyA, { ...i, computation: e, chart: [n] }) : pA(UyA, { ...i, data: A.dataSource, chart: [n] }) }, o))] }) });
}
function PSt(A) {
  const e = C9(A), t = {
    rawFields: A.rawFields,
    themeKey: A.themeKey,
    dark: u.useContext(dd)
  };
  return pA(b.StrictMode, { children: A.useKernelCalc ? pA(VyA, { ...t, computation: e }) : pA(VyA, { ...t, data: A.dataSource }) });
}
function $St(A) {
  const e = A.args, [t, i] = u.useState(!1), n = b.useRef(null);
  return e.visSpec = xG(e.visSpec, e.rawFields), u.useEffect(() => {
    Te.setIsStreamlitComponent(!0), xv(e).then(() => {
      i(!0);
    });
  }, []), u.useEffect(() => {
    if (!n.current)
      return;
    const o = new ResizeObserver(() => {
      var g;
      lB.setFrameHeight((((g = n.current) == null ? void 0 : g.clientHeight) ?? 0) + 20);
    });
    return o.observe(n.current), () => o.disconnect();
  }, [t]), pA(b.StrictMode, { children: t && pA("div", { ref: n, children: pA(N1, { darkMode: e.dark, children: pA(CaA, { ...e }) }) }) });
}
const AZt = () => {
  const A = dJt($St);
  kd.render(pA(b.StrictMode, { children: pA(A, {}) }), document.getElementById("root"));
};
function eZt() {
  const [A, e] = u.useState(!1), t = mJt(), i = JSON.parse(t.get("props"));
  return i.visSpec = xG(i.visSpec, i.rawFields), u.useEffect(() => {
    _St(i, t).then(() => {
      e(!0);
    });
  }, []), ue(b.StrictMode, { children: [!A && pA("div", { children: "Loading..." }), A && pA(N1, { darkMode: i.dark, children: pA(CaA, { ...i }) })] });
}
const l9t = { GWalker: qSt, PreviewApp: OSt, ChartPreviewApp: jSt, StreamlitGWalker: AZt, render: pJt(eZt) };
function tZt(A) {
  var e = A;
  return !!(e.ctrlKey || e.shiftKey || e.metaKey || e.button && e.button == 1);
}
function iZt(A, e) {
  return !!(A.target === "_blank" && e);
}
function nZt(A, e, t, i) {
  var n = this, o = [];
  return A ? (A instanceof Element ? o = [A] : "toArray" in A ? o = A.toArray() : o = A, o.forEach(function(g) {
    g.addEventListener("click", function(s) {
      var I, r, a = e instanceof Function ? e(g) : e, C = t instanceof Function ? t(g) : t, B = g.getAttribute("href") || g.getAttributeNS("http://www.w3.org/1999/xlink", "href") || g.getAttribute("xlink:href") || ((I = g.getElementsByTagName("a")[0]) === null || I === void 0 ? void 0 : I.getAttribute("href")), l = QIA(n.track(a, C, i ?? {}), (r = n.settings.timeout) !== null && r !== void 0 ? r : 500);
      !iZt(g, B) && !tZt(s) && B && (s.preventDefault ? s.preventDefault() : s.returnValue = !1, l.catch(console.error).then(function() {
        window.location.href = B;
      }).catch(console.error));
    }, !1);
  }), this) : this;
}
function oZt(A, e, t, i) {
  var n = this;
  if (!A)
    return this;
  A instanceof HTMLFormElement && (A = [A]);
  var o = A;
  return o.forEach(function(g) {
    if (!(g instanceof Element))
      throw new TypeError("Must pass HTMLElement to trackForm/trackSubmit.");
    var s = function(r) {
      var a;
      r.preventDefault ? r.preventDefault() : r.returnValue = !1;
      var C = e instanceof Function ? e(g) : e, B = t instanceof Function ? t(g) : t, l = QIA(n.track(C, B, i ?? {}), (a = n.settings.timeout) !== null && a !== void 0 ? a : 500);
      l.catch(console.error).then(function() {
        g.submit();
      }).catch(console.error);
    }, I = window.jQuery || window.Zepto;
    I ? I(g).submit(s) : g.addEventListener("submit", s, !1);
  }), this;
}
const dL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  form: oZt,
  link: nZt
}, Symbol.toStringTag, { value: "Module" }));
function EfA(A, e) {
  return Object.keys(e).reduce(function(t, i) {
    if (i.startsWith(A)) {
      var n = i.substr(A.length);
      t[n] = e[i];
    }
    return t;
  }, {});
}
function gZt(A, e) {
  var t = document.createElement("a");
  t.href = e;
  var i = t.search.slice(1), n = i.split("&").reduce(function(f, w) {
    var G = w.split("="), R = G[0], F = G[1];
    return f[R] = R4A(F), f;
  }, {}), o = [], g = n.ajs_uid, s = n.ajs_event, I = n.ajs_aid, r = Hs(A.options.useQueryString) ? A.options.useQueryString : {}, a = r.aid, C = a === void 0 ? /.+/ : a, B = r.uid, l = B === void 0 ? /.+/ : B;
  if (I) {
    var Q = Array.isArray(n.ajs_aid) ? n.ajs_aid[0] : n.ajs_aid;
    C.test(Q) && A.setAnonymousId(Q);
  }
  if (g) {
    var E = Array.isArray(n.ajs_uid) ? n.ajs_uid[0] : n.ajs_uid;
    if (l.test(E)) {
      var d = EfA("ajs_trait_", n);
      o.push(A.identify(E, d));
    }
  }
  if (s) {
    var m = Array.isArray(n.ajs_event) ? n.ajs_event[0] : n.ajs_event, y = EfA("ajs_prop_", n);
    o.push(A.track(m, y));
  }
  return Promise.all(o);
}
const sZt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  queryString: gZt
}, Symbol.toStringTag, { value: "Module" }));
var Lv = {}, BaA = {};
for (var bOA = [], Dm = 0; Dm < 64; )
  bOA[Dm] = 0 | 4294967296 * Math.sin(++Dm % Math.PI);
function IZt(A) {
  var e, t, i, n = [e = 1732584193, t = 4023233417, ~e, ~t], o = [], g = unescape(encodeURI(A)) + "", s = g.length;
  for (A = --s / 4 + 2 | 15, o[--A] = 8 * s; ~s; )
    o[s >> 2] |= g.charCodeAt(s) << 8 * s--;
  for (Dm = g = 0; Dm < A; Dm += 16) {
    for (s = n; g < 64; s = [i = s[3], e + ((i = s[0] + [e & t | ~e & i, i & e | ~i & t, e ^ t ^ i, t ^ (e | ~i)][s = g >> 4] + bOA[g] + ~~o[Dm | 15 & [g, 5 * g + 1, 3 * g + 5, 7 * g][s]]) << (s = [7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21][4 * s + g++ % 4]) | i >>> -s), e, t])
      e = 0 | s[1], t = s[2];
    for (g = 4; g; )
      n[--g] += s[g];
  }
  for (A = ""; g < 32; )
    A += (n[g >> 3] >> 4 * (1 ^ g++) & 15).toString(16);
  return A;
}
const aZt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: IZt
}, Symbol.toStringTag, { value: "Module" })), rZt = /* @__PURE__ */ YfA(aZt);
var tR = {}, CZt = {
  get exports() {
    return tR;
  },
  set exports(A) {
    tR = A;
  }
};
(function(A, e) {
  (function(t, i) {
    A.exports = function(n, o, g, s, I) {
      for (o = o.split ? o.split(".") : o, s = 0; s < o.length; s++)
        n = n ? n[o[s]] : I;
      return n === I ? g : n;
    };
  })();
})(CZt);
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var BZt = Number.POSITIVE_INFINITY, wOA = BZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var lZt = Number;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var cZt = lZt, QZt = cZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var EZt = QZt, uZt = EZt.NEGATIVE_INFINITY, fOA = uZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var dZt = 1023, DOA = dZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var hZt = 1023, mZt = hZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var pZt = -1023, yZt = pZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var bZt = -1074, wZt = bZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function fZt(A) {
  return A !== A;
}
var DZt = fZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var GZt = DZt, GOA = GZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var kZt = wOA, JZt = fOA;
function NZt(A) {
  return A === kZt || A === JZt;
}
var YZt = NZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var RZt = YZt, kOA = RZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2022 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var FZt = 2147483648 >>> 0, MZt = FZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2022 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var xZt = 2147483647 >>> 0, LZt = xZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var vZt = typeof Object.defineProperty == "function" ? Object.defineProperty : null, HZt = vZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var SZt = HZt;
function ZZt() {
  try {
    return SZt({}, "x", {}), !0;
  } catch {
    return !1;
  }
}
var WZt = ZZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var KZt = Object.defineProperty, UZt = KZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var LG = Object.prototype, ufA = LG.toString, dfA = LG.__defineGetter__, hfA = LG.__defineSetter__, VZt = LG.__lookupGetter__, XZt = LG.__lookupSetter__;
function zZt(A, e, t) {
  var i, n, o, g;
  if (typeof A != "object" || A === null || ufA.call(A) === "[object Array]")
    throw new TypeError("invalid argument. First argument must be an object. Value: `" + A + "`.");
  if (typeof t != "object" || t === null || ufA.call(t) === "[object Array]")
    throw new TypeError("invalid argument. Property descriptor must be an object. Value: `" + t + "`.");
  if (n = "value" in t, n && (VZt.call(A, e) || XZt.call(A, e) ? (i = A.__proto__, A.__proto__ = LG, delete A[e], A[e] = t.value, A.__proto__ = i) : A[e] = t.value), o = "get" in t, g = "set" in t, n && (o || g))
    throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");
  return o && dfA && dfA.call(A, e, t.get), g && hfA && hfA.call(A, e, t.set), A;
}
var TZt = zZt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var _Zt = WZt, qZt = UZt, OZt = TZt, g8;
_Zt() ? g8 = qZt : g8 = OZt;
var jZt = g8;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var PZt = jZt;
function $Zt(A, e, t) {
  PZt(A, e, {
    configurable: !1,
    enumerable: !1,
    writable: !1,
    value: t
  });
}
var AWt = $Zt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var eWt = AWt, JOA = eWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function tWt() {
  return typeof Symbol == "function" && typeof Symbol("foo") == "symbol";
}
var iWt = tWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var nWt = iWt, oWt = nWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var gWt = oWt, sWt = gWt();
function IWt() {
  return sWt && typeof Symbol.toStringTag == "symbol";
}
var aWt = IWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var rWt = aWt, CWt = rWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var BWt = Object.prototype.toString, NOA = BWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var lWt = NOA;
function cWt(A) {
  return lWt.call(A);
}
var QWt = cWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var EWt = Object.prototype.hasOwnProperty;
function uWt(A, e) {
  return A == null ? !1 : EWt.call(A, e);
}
var dWt = uWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var hWt = dWt, mWt = hWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var pWt = typeof Symbol == "function" ? Symbol.toStringTag : "", yWt = pWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var bWt = mWt, IJ = yWt, P_ = NOA;
function wWt(A) {
  var e, t, i;
  if (A == null)
    return P_.call(A);
  t = A[IJ], e = bWt(A, IJ);
  try {
    A[IJ] = void 0;
  } catch {
    return P_.call(A);
  }
  return i = P_.call(A), e ? A[IJ] = t : delete A[IJ], i;
}
var fWt = wWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var DWt = CWt, GWt = QWt, kWt = fWt, s8;
DWt() ? s8 = kWt : s8 = GWt;
var B9 = s8;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var JWt = B9, NWt = typeof Uint32Array == "function";
function YWt(A) {
  return NWt && A instanceof Uint32Array || // eslint-disable-line stdlib/require-globals
  JWt(A) === "[object Uint32Array]";
}
var RWt = YWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var FWt = RWt, MWt = FWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var xWt = 4294967295, LWt = xWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var vWt = typeof Uint32Array == "function" ? Uint32Array : null, HWt = vWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var SWt = MWt, $_ = LWt, mfA = HWt;
function ZWt() {
  var A, e;
  if (typeof mfA != "function")
    return !1;
  try {
    e = [1, 3.14, -3.14, $_ + 1, $_ + 2], e = new mfA(e), A = SWt(e) && e[0] === 1 && e[1] === 3 && // truncation
    e[2] === $_ - 2 && // truncation and wrap around
    e[3] === 0 && // wrap around
    e[4] === 1;
  } catch {
    A = !1;
  }
  return A;
}
var WWt = ZWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var KWt = WWt, UWt = KWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var VWt = typeof Uint32Array == "function" ? Uint32Array : void 0, XWt = VWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function zWt() {
  throw new Error("not implemented");
}
var TWt = zWt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var _Wt = UWt, qWt = XWt, OWt = TWt, I8;
_Wt() ? I8 = qWt : I8 = OWt;
var laA = I8;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var jWt = B9, PWt = typeof Float64Array == "function";
function $Wt(A) {
  return PWt && A instanceof Float64Array || // eslint-disable-line stdlib/require-globals
  jWt(A) === "[object Float64Array]";
}
var AKt = $Wt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var eKt = AKt, tKt = eKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var iKt = typeof Float64Array == "function" ? Float64Array : null, nKt = iKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var oKt = tKt, pfA = nKt;
function gKt() {
  var A, e;
  if (typeof pfA != "function")
    return !1;
  try {
    e = new pfA([1, 3.14, -3.14, NaN]), A = oKt(e) && e[0] === 1 && e[1] === 3.14 && e[2] === -3.14 && e[3] !== e[3];
  } catch {
    A = !1;
  }
  return A;
}
var sKt = gKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var IKt = sKt, aKt = IKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var rKt = typeof Float64Array == "function" ? Float64Array : void 0, CKt = rKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function BKt() {
  throw new Error("not implemented");
}
var lKt = BKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var cKt = aKt, QKt = CKt, EKt = lKt, a8;
cKt() ? a8 = QKt : a8 = EKt;
var caA = a8;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var uKt = B9, dKt = typeof Uint8Array == "function";
function hKt(A) {
  return dKt && A instanceof Uint8Array || // eslint-disable-line stdlib/require-globals
  uKt(A) === "[object Uint8Array]";
}
var mKt = hKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var pKt = mKt, yKt = pKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var bKt = 255, wKt = bKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var fKt = typeof Uint8Array == "function" ? Uint8Array : null, DKt = fKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var GKt = yKt, A4 = wKt, yfA = DKt;
function kKt() {
  var A, e;
  if (typeof yfA != "function")
    return !1;
  try {
    e = [1, 3.14, -3.14, A4 + 1, A4 + 2], e = new yfA(e), A = GKt(e) && e[0] === 1 && e[1] === 3 && // truncation
    e[2] === A4 - 2 && // truncation and wrap around
    e[3] === 0 && // wrap around
    e[4] === 1;
  } catch {
    A = !1;
  }
  return A;
}
var JKt = kKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var NKt = JKt, YKt = NKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var RKt = typeof Uint8Array == "function" ? Uint8Array : void 0, FKt = RKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function MKt() {
  throw new Error("not implemented");
}
var xKt = MKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var LKt = YKt, vKt = FKt, HKt = xKt, r8;
LKt() ? r8 = vKt : r8 = HKt;
var SKt = r8;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var ZKt = B9, WKt = typeof Uint16Array == "function";
function KKt(A) {
  return WKt && A instanceof Uint16Array || // eslint-disable-line stdlib/require-globals
  ZKt(A) === "[object Uint16Array]";
}
var UKt = KKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var VKt = UKt, XKt = VKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var zKt = 65535, TKt = zKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var _Kt = typeof Uint16Array == "function" ? Uint16Array : null, qKt = _Kt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var OKt = XKt, e4 = TKt, bfA = qKt;
function jKt() {
  var A, e;
  if (typeof bfA != "function")
    return !1;
  try {
    e = [1, 3.14, -3.14, e4 + 1, e4 + 2], e = new bfA(e), A = OKt(e) && e[0] === 1 && e[1] === 3 && // truncation
    e[2] === e4 - 2 && // truncation and wrap around
    e[3] === 0 && // wrap around
    e[4] === 1;
  } catch {
    A = !1;
  }
  return A;
}
var PKt = jKt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var $Kt = PKt, A3t = $Kt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var e3t = typeof Uint16Array == "function" ? Uint16Array : void 0, t3t = e3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function i3t() {
  throw new Error("not implemented");
}
var n3t = i3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var o3t = A3t, g3t = t3t, s3t = n3t, C8;
o3t() ? C8 = g3t : C8 = s3t;
var I3t = C8;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var a3t = SKt, r3t = I3t, C3t = {
  uint16: r3t,
  uint8: a3t
}, B3t = C3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var wfA = B3t, YOA;
function l3t() {
  var A, e;
  return A = new wfA.uint16(1), A[0] = 4660, e = new wfA.uint8(A.buffer), e[0] === 52;
}
YOA = l3t();
var c3t = YOA;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var Q3t = c3t, QaA = Q3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var E3t = QaA, ROA, B8, l8;
E3t === !0 ? (B8 = 1, l8 = 0) : (B8 = 0, l8 = 1);
ROA = {
  HIGH: B8,
  LOW: l8
};
var u3t = ROA;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var d3t = laA, h3t = caA, FOA = u3t, MOA = new h3t(1), ffA = new d3t(MOA.buffer), m3t = FOA.HIGH, p3t = FOA.LOW;
function y3t(A, e, t, i) {
  return MOA[0] = A, e[i] = ffA[m3t], e[i + t] = ffA[p3t], e;
}
var xOA = y3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var b3t = xOA;
function w3t(A) {
  return b3t(A, [0 >>> 0, 0 >>> 0], 1, 0);
}
var f3t = w3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var D3t = JOA, LOA = f3t, G3t = xOA;
D3t(LOA, "assign", G3t);
var vOA = LOA;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var k3t = QaA, c8;
k3t === !0 ? c8 = 1 : c8 = 0;
var J3t = c8;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var N3t = laA, Y3t = caA, R3t = J3t, HOA = new Y3t(1), F3t = new N3t(HOA.buffer);
function M3t(A) {
  return HOA[0] = A, F3t[R3t];
}
var x3t = M3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var L3t = x3t, SOA = L3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var v3t = QaA, ZOA, Q8, E8;
v3t === !0 ? (Q8 = 1, E8 = 0) : (Q8 = 0, E8 = 1);
ZOA = {
  HIGH: Q8,
  LOW: E8
};
var H3t = ZOA;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var S3t = laA, Z3t = caA, WOA = H3t, KOA = new Z3t(1), DfA = new S3t(KOA.buffer), W3t = WOA.HIGH, K3t = WOA.LOW;
function U3t(A, e) {
  return DfA[W3t] = A, DfA[K3t] = e, KOA[0];
}
var V3t = U3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var X3t = V3t, UOA = X3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var z3t = MZt, T3t = LZt, _3t = vOA, q3t = SOA, O3t = UOA, t4 = [0, 0];
function j3t(A, e) {
  var t, i;
  return _3t.assign(A, t4, 1, 0), t = t4[0], t &= T3t, i = q3t(e), i &= z3t, t |= i, O3t(t, t4[1]);
}
var P3t = j3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var $3t = P3t, AUt = $3t;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var eUt = 22250738585072014e-324, tUt = eUt;
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function iUt(A) {
  return Math.abs(A);
}
var nUt = iUt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var oUt = nUt, gUt = oUt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var sUt = tUt, IUt = kOA, aUt = GOA, rUt = gUt, CUt = 4503599627370496;
function BUt(A, e, t, i) {
  return aUt(A) || IUt(A) ? (e[i] = A, e[i + t] = 0, e) : A !== 0 && rUt(A) < sUt ? (e[i] = A * CUt, e[i + t] = -52, e) : (e[i] = A, e[i + t] = 0, e);
}
var VOA = BUt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var lUt = VOA;
function cUt(A) {
  return lUt(A, [0, 0], 1, 0);
}
var QUt = cUt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var EUt = JOA, XOA = QUt, uUt = VOA;
EUt(XOA, "assign", uUt);
var dUt = XOA;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var hUt = 2146435072, mUt = hUt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var pUt = SOA, yUt = mUt, bUt = DOA;
function wUt(A) {
  var e = pUt(A);
  return e = (e & yUt) >>> 20, e - bUt | 0;
}
var fUt = wUt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var DUt = fUt, GUt = DUt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var kUt = wOA, JUt = fOA, NUt = DOA, YUt = mZt, RUt = yZt, FUt = wZt, MUt = GOA, xUt = kOA, LUt = AUt, vUt = dUt, HUt = GUt, SUt = vOA, ZUt = UOA, WUt = 2220446049250313e-31, KUt = 2148532223 >>> 0, i4 = [0, 0], n4 = [0, 0];
function UUt(A, e) {
  var t, i;
  return A === 0 || // handles +-0
  MUt(A) || xUt(A) ? A : (vUt(i4), A = i4[0], e += i4[1], e += HUt(A), e < FUt ? LUt(0, A) : e > YUt ? A < 0 ? JUt : kUt : (e <= RUt ? (e += 52, i = WUt) : i = 1, SUt(n4), t = n4[0], t &= KUt, t |= e + NUt << 20, i * ZUt(t, n4[1])));
}
var VUt = UUt;
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var XUt = VUt, zUt = XUt;
const TUt = /* @__PURE__ */ YfA(yRt);
var l9 = {}, _Ut = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(l9, "__esModule", { value: !0 });
l9.unset = void 0;
var qUt = _Ut(tR);
function OUt(A, e) {
  if ((0, qUt.default)(A, e)) {
    for (var t = e.split("."), i = t.pop(); t.length && t[t.length - 1].slice(-1) === "\\"; )
      i = t.pop().slice(0, -1) + "." + i;
    for (; t.length; )
      A = A[e = t.shift()];
    return delete A[i];
  }
  return !0;
}
l9.unset = OUt;
var EaA = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(BaA, "__esModule", { value: !0 });
var jUt = EaA(rZt), qb = EaA(tR), PUt = EaA(zUt), aJ = TUt, $Ut = l9;
function AVt(A, e) {
  for (var t = A, i = 0, n = e; i < n.length; i++) {
    var o = n[i];
    switch (o.type) {
      case "drop":
        return null;
      case "drop_properties":
        eVt(t, o.config);
        break;
      case "allow_properties":
        tVt(t, o.config);
        break;
      case "sample_event":
        if (nVt(t, o.config))
          break;
        return null;
      case "map_properties":
        iVt(t, o.config);
        break;
      case "hash_properties":
        break;
      default:
        throw new Error('Transformer of type "'.concat(o.type, '" is unsupported.'));
    }
  }
  return t;
}
BaA.default = AVt;
function eVt(A, e) {
  zOA(A, e.drop, function(t, i) {
    i.forEach(function(n) {
      return delete t[n];
    });
  });
}
function tVt(A, e) {
  zOA(A, e.allow, function(t, i) {
    Object.keys(t).forEach(function(n) {
      i.includes(n) || delete t[n];
    });
  });
}
function zOA(A, e, t) {
  Object.entries(e).forEach(function(i) {
    var n = i[0], o = i[1], g = function(I) {
      typeof I != "object" || I === null || t(I, o);
    }, s = n === "" ? A : (0, qb.default)(A, n);
    Array.isArray(s) ? s.forEach(g) : g(s);
  });
}
function iVt(A, e) {
  var t = JSON.parse(JSON.stringify(A));
  for (var i in e.map)
    if (e.map.hasOwnProperty(i)) {
      var n = e.map[i], o = i.split("."), g = void 0;
      if (o.length > 1 ? (o.pop(), g = (0, qb.default)(t, o.join("."))) : g = A, typeof g == "object") {
        if (n.copy) {
          var s = (0, qb.default)(t, n.copy);
          s !== void 0 && (0, aJ.dset)(A, i, s);
        } else if (n.move) {
          var I = (0, qb.default)(t, n.move);
          I !== void 0 && (0, aJ.dset)(A, i, I), (0, $Ut.unset)(A, n.move);
        } else
          n.hasOwnProperty("set") && (0, aJ.dset)(A, i, n.set);
        if (n.to_string) {
          var r = (0, qb.default)(A, i);
          if (typeof r == "string" || typeof r == "object" && r !== null)
            continue;
          r !== void 0 ? (0, aJ.dset)(A, i, JSON.stringify(r)) : (0, aJ.dset)(A, i, "undefined");
        }
      }
    }
}
function nVt(A, e) {
  return e.sample.percent <= 0 ? !1 : e.sample.percent >= 1 ? !0 : e.sample.path ? gVt(A, e) : oVt(e.sample.percent);
}
function oVt(A) {
  return Math.random() <= A;
}
function gVt(A, e) {
  var t = (0, qb.default)(A, e.sample.path), i = (0, jUt.default)(JSON.stringify(t)), n = -64, o = [];
  GfA(i.slice(0, 8), o);
  for (var g = 0, s = 0; s < 64 && o[s] !== 1; s++)
    g++;
  if (g !== 0) {
    var I = [];
    GfA(i.slice(9, 16), I), n -= g, o.splice(0, g), I.splice(64 - g), o = o.concat(I);
  }
  return o[63] = o[63] === 0 ? 1 : 0, (0, PUt.default)(parseInt(o.join(""), 2), n) < e.sample.percent;
}
function GfA(A, e) {
  for (var t = 0; t < 8; t++)
    for (var i = A[t], n = 128; n >= 1; n /= 2)
      i - n >= 0 ? (i -= n, e.push(1)) : e.push(0);
}
var uaA = {}, sVt = wi && wi.__importDefault || function(A) {
  return A && A.__esModule ? A : { default: A };
};
Object.defineProperty(uaA, "__esModule", { value: !0 });
var IVt = sVt(tR);
function aVt(A, e) {
  if (!e)
    throw new Error("No matcher supplied!");
  switch (e.type) {
    case "all":
      return rVt();
    case "fql":
      return CVt(e.ir, A);
    default:
      throw new Error("Matcher of type ".concat(e.type, " unsupported."));
  }
}
uaA.default = aVt;
function rVt() {
  return !0;
}
function CVt(A, e) {
  if (!A)
    return !1;
  try {
    A = JSON.parse(A);
  } catch (i) {
    throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(A, '": ').concat(i));
  }
  var t = Mu(A, e);
  return typeof t != "boolean" ? !1 : t;
}
function Mu(A, e) {
  if (!Array.isArray(A))
    return zg(A, e) === !0;
  var t = A[0];
  switch (t) {
    case "!":
      return !Mu(A[1], e);
    case "or":
      for (var i = 1; i < A.length; i++)
        if (Mu(A[i], e))
          return !0;
      return !1;
    case "and":
      for (var i = 1; i < A.length; i++)
        if (!Mu(A[i], e))
          return !1;
      return !0;
    case "=":
    case "!=":
      return cVt(zg(A[1], e), zg(A[2], e), t, e);
    case "<=":
    case "<":
    case ">":
    case ">=":
      return lVt(zg(A[1], e), zg(A[2], e), t, e);
    case "in":
      return BVt(zg(A[1], e), zg(A[2], e), e);
    case "contains":
      return QVt(zg(A[1], e), zg(A[2], e));
    case "match":
      return EVt(zg(A[1], e), zg(A[2], e));
    case "lowercase":
      var n = zg(A[1], e);
      return typeof n != "string" ? null : n.toLowerCase();
    case "typeof":
      return typeof zg(A[1], e);
    case "length":
      return uVt(zg(A[1], e));
    default:
      throw new Error("FQL IR could not evaluate for token: ".concat(t));
  }
}
function zg(A, e) {
  return Array.isArray(A) ? A : typeof A == "object" ? A.value : (0, IVt.default)(e, A);
}
function BVt(A, e, t) {
  return e.find(function(i) {
    return zg(i, t) === A;
  }) !== void 0;
}
function lVt(A, e, t, i) {
  if (nK(A) && (A = Mu(A, i)), nK(e) && (e = Mu(e, i)), typeof A != "number" || typeof e != "number")
    return !1;
  switch (t) {
    case "<=":
      return A <= e;
    case ">=":
      return A >= e;
    case "<":
      return A < e;
    case ">":
      return A > e;
    default:
      throw new Error("Invalid operator in compareNumbers: ".concat(t));
  }
}
function cVt(A, e, t, i) {
  switch (nK(A) && (A = Mu(A, i)), nK(e) && (e = Mu(e, i)), typeof A == "object" && typeof e == "object" && (A = JSON.stringify(A), e = JSON.stringify(e)), t) {
    case "=":
      return A === e;
    case "!=":
      return A !== e;
    default:
      throw new Error("Invalid operator in compareItems: ".concat(t));
  }
}
function QVt(A, e) {
  return typeof A != "string" || typeof e != "string" ? !1 : A.indexOf(e) !== -1;
}
function EVt(A, e) {
  return typeof A != "string" || typeof e != "string" ? !1 : dVt(e, A);
}
function uVt(A) {
  return A === null ? 0 : !Array.isArray(A) && typeof A != "string" ? NaN : A.length;
}
function nK(A) {
  return Array.isArray(A) ? (A[0] === "lowercase" || A[0] === "length" || A[0] === "typeof") && A.length === 2 || (A[0] === "contains" || A[0] === "match") && A.length === 3 : !1;
}
function dVt(A, e) {
  var t, i;
  A:
    for (; A.length > 0; ) {
      var n = void 0, o = void 0;
      if (t = hVt(A), n = t.star, o = t.chunk, A = t.pattern, n && o === "")
        return !0;
      var g = kfA(o, e), s = g.t, I = g.ok, r = g.err;
      if (r)
        return !1;
      if (I && (s.length === 0 || A.length > 0)) {
        e = s;
        continue;
      }
      if (n)
        for (var a = 0; a < e.length; a++) {
          if (i = kfA(o, e.slice(a + 1)), s = i.t, I = i.ok, r = i.err, I) {
            if (A.length === 0 && s.length > 0)
              continue;
            e = s;
            continue A;
          }
          if (r)
            return !1;
        }
      return !1;
    }
  return e.length === 0;
}
function hVt(A) {
  for (var e = {
    star: !1,
    chunk: "",
    pattern: ""
  }; A.length > 0 && A[0] === "*"; )
    A = A.slice(1), e.star = !0;
  var t = !1, i;
  A:
    for (i = 0; i < A.length; i++)
      switch (A[i]) {
        case "\\":
          i + 1 < A.length && i++;
          break;
        case "[":
          t = !0;
          break;
        case "]":
          t = !1;
          break;
        case "*":
          if (!t)
            break A;
      }
  return e.chunk = A.slice(0, i), e.pattern = A.slice(i), e;
}
function kfA(A, e) {
  for (var t, i, n = {
    t: "",
    ok: !1,
    err: !1
  }; A.length > 0; ) {
    if (e.length === 0)
      return n;
    switch (A[0]) {
      case "[":
        var o = e[0];
        e = e.slice(1), A = A.slice(1);
        var g = !0;
        A.length > 0 && A[0] === "^" && (g = !1, A = A.slice(1));
        for (var s = !1, I = 0; ; ) {
          if (A.length > 0 && A[0] === "]" && I > 0) {
            A = A.slice(1);
            break;
          }
          var r = "", a = "", C = void 0;
          if (t = JfA(A), r = t.char, A = t.newChunk, C = t.err, C || (a = r, A[0] === "-" && (i = JfA(A.slice(1)), a = i.char, A = i.newChunk, C = i.err, C)))
            return n;
          r <= o && o <= a && (s = !0), I++;
        }
        if (s !== g)
          return n;
        break;
      case "?":
        e = e.slice(1), A = A.slice(1);
        break;
      case "\\":
        if (A = A.slice(1), A.length === 0)
          return n.err = !0, n;
      default:
        if (A[0] !== e[0])
          return n;
        e = e.slice(1), A = A.slice(1);
    }
  }
  return n.t = e, n.ok = !0, n.err = !1, n;
}
function JfA(A) {
  var e = {
    char: "",
    newChunk: "",
    err: !1
  };
  return A.length === 0 || A[0] === "-" || A[0] === "]" || A[0] === "\\" && (A = A.slice(1), A.length === 0) ? (e.err = !0, e) : (e.char = A[0], e.newChunk = A.slice(1), e.newChunk.length === 0 && (e.err = !0), e);
}
var daA = {};
Object.defineProperty(daA, "__esModule", { value: !0 });
var mVt = (
  /** @class */
  function() {
    function A(e) {
      this.rules = [], this.rules = e || [];
    }
    return A.prototype.getRulesByDestinationName = function(e) {
      for (var t = [], i = 0, n = this.rules; i < n.length; i++) {
        var o = n[i];
        (o.destinationName === e || o.destinationName === void 0) && t.push(o);
      }
      return t;
    }, A;
  }()
);
daA.default = mVt;
(function(A) {
  var e = wi && wi.__importDefault || function(o) {
    return o && o.__esModule ? o : { default: o };
  };
  Object.defineProperty(A, "__esModule", { value: !0 }), A.Store = A.matches = A.transform = void 0;
  var t = BaA;
  Object.defineProperty(A, "transform", { enumerable: !0, get: function() {
    return e(t).default;
  } });
  var i = uaA;
  Object.defineProperty(A, "matches", { enumerable: !0, get: function() {
    return e(i).default;
  } });
  var n = daA;
  Object.defineProperty(A, "Store", { enumerable: !0, get: function() {
    return e(n).default;
  } });
})(Lv);
var pVt = function(A) {
  return function(e) {
    var t = e.payload, i = e.integration, n = e.next, o = new Lv.Store(A), g = o.getRulesByDestinationName(i);
    g.forEach(function(s) {
      for (var I = s.matchers, r = s.transformers, a = 0; a < I.length; a++)
        if (Lv.matches(t.obj, I[a]) && (t.obj = Lv.transform(t.obj, r[a]), t.obj === null))
          return n(null);
    }), n(t);
  };
};
const yVt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  tsubMiddleware: pVt
}, Symbol.toStringTag, { value: "Module" }));
function TOA(A, e) {
  var t, i;
  return typeof (e == null ? void 0 : e.enabled) == "boolean" ? e.enabled : (i = (t = A == null ? void 0 : A.__default) === null || t === void 0 ? void 0 : t.enabled) !== null && i !== void 0 ? i : !0;
}
function _OA(A) {
  return A.toLowerCase().replace(".", "").replace(/\s+/g, "-");
}
function qOA(A, e) {
  return e === void 0 && (e = !1), e ? btoa(A).replace(/=/g, "") : void 0;
}
function bVt(A) {
  return ("Integration" in A ? A.Integration : A).prototype.name;
}
function wVt(A, e, t) {
  var i, n;
  try {
    var o = ((n = (i = window == null ? void 0 : window.performance) === null || i === void 0 ? void 0 : i.getEntriesByName(A, "resource")) !== null && n !== void 0 ? n : [])[0];
    o && e.stats.gauge("legacy_destination_time", Math.round(o.duration), zn([
      t
    ], o.duration < 100 ? ["cached"] : [], !0));
  } catch {
  }
}
function fVt(A, e, t) {
  var i;
  if ("Integration" in A) {
    var n = {
      user: function() {
        return t.user();
      },
      addIntegration: function() {
      }
    };
    A(n), i = A.Integration;
  } else
    i = A;
  var o = new i(e);
  return o.analytics = t, o;
}
function DVt(A, e, t, i) {
  return UA(this, void 0, void 0, function() {
    var n, o, g, s, I, r;
    return Ee(this, function(a) {
      switch (a.label) {
        case 0:
          n = _OA(e), o = qOA(n, i), g = GIA(), s = "".concat(g, "/integrations/").concat(o ?? n, "/").concat(t, "/").concat(o ?? n, ".dynamic.js.gz"), a.label = 1;
        case 1:
          return a.trys.push([1, 3, , 4]), [4, Yw(s)];
        case 2:
          return a.sent(), wVt(s, A, e), [3, 4];
        case 3:
          throw I = a.sent(), A.stats.gauge("legacy_destination_time", -1, ["plugin:".concat(e), "failed"]), I;
        case 4:
          return r = window["".concat(n, "Deps")], [
            4,
            Promise.all(r.map(function(C) {
              return Yw(g + C + ".gz");
            }))
            // @ts-ignore
          ];
        case 5:
          return a.sent(), window["".concat(n, "Loader")](), [2, window[
            // @ts-ignore
            "".concat(n, "Integration")
          ]];
      }
    });
  });
}
function GVt(A, e, t) {
  return UA(this, void 0, void 0, function() {
    var i, n, o, g;
    return Ee(this, function(s) {
      return i = GIA(), n = _OA(A), o = qOA(A, t), g = "".concat(i, "/integrations/").concat(o ?? n, "/").concat(e, "/").concat(o ?? n, ".dynamic.js.gz"), [2, VFt(g)];
    });
  });
}
function kVt(A) {
  var e, t, i, n;
  return (n = (t = (e = A == null ? void 0 : A.versionSettings) === null || e === void 0 ? void 0 : e.override) !== null && t !== void 0 ? t : (i = A == null ? void 0 : A.versionSettings) === null || i === void 0 ? void 0 : i.version) !== null && n !== void 0 ? n : "latest";
}
var JVt = function(A, e) {
  var t, i = e.type, n = e.bundlingStatus, o = e.versionSettings, g = n !== "unbundled" && (i === "browser" || ((t = o == null ? void 0 : o.componentTypes) === null || t === void 0 ? void 0 : t.includes("browser")));
  return !A.startsWith("Segment") && A !== "Iterable" && g;
}, NVt = function(A, e) {
  var t = e.All === !1 && e[A] === void 0;
  return e[A] === !1 || t;
};
function YVt(A, e) {
  return UA(this, void 0, void 0, function() {
    var t, i = this;
    return Ee(this, function(n) {
      switch (n.label) {
        case 0:
          return t = [], md() ? [2, e] : [
            4,
            U4A(function() {
              return e.length > 0 && B4A();
            }, function() {
              return UA(i, void 0, void 0, function() {
                var o, g, s;
                return Ee(this, function(I) {
                  switch (I.label) {
                    case 0:
                      return o = e.pop(), o ? [4, Nw(o, A)] : [
                        2
                        /*return*/
                      ];
                    case 1:
                      return g = I.sent(), s = g instanceof iQ, s || t.push(o), [
                        2
                        /*return*/
                      ];
                  }
                });
              });
            })
            // re-add failed tasks
          ];
        case 1:
          return n.sent(), t.map(function(o) {
            return e.pushWithBackoff(o);
          }), [2, e];
      }
    });
  });
}
var OOA = (
  /** @class */
  function() {
    function A(e, t, i, n, o, g) {
      n === void 0 && (n = {});
      var s = this;
      this.options = {}, this.type = "destination", this.middleware = [], this.initializePromise = EIA(), this.flushing = !1, this.name = e, this.version = t, this.settings = qA({}, n), this.disableAutoISOConversion = o.disableAutoISOConversion || !1, this.integrationSource = g, this.settings.type && this.settings.type === "browser" && delete this.settings.type, this.initializePromise.promise.then(function(I) {
        return s._initialized = I;
      }, function() {
      }), this.options = o, this.buffer = o.disableClientPersistence ? new KX(4, []) : new VX(4, "".concat(i, ":dest-").concat(e)), this.scheduleFlush();
    }
    return A.prototype.isLoaded = function() {
      return !!this._ready;
    }, A.prototype.ready = function() {
      var e = this;
      return this.initializePromise.promise.then(function() {
        var t;
        return (t = e.onReady) !== null && t !== void 0 ? t : Promise.resolve();
      });
    }, A.prototype.load = function(e, t) {
      var i;
      return UA(this, void 0, void 0, function() {
        var n, o, g = this;
        return Ee(this, function(s) {
          switch (s.label) {
            case 0:
              return this._ready || this.onReady !== void 0 ? [
                2
                /*return*/
              ] : (i = this.integrationSource) !== null && i !== void 0 ? (o = i, [3, 3]) : [3, 1];
            case 1:
              return [4, DVt(e, this.name, this.version, this.options.obfuscate)];
            case 2:
              o = s.sent(), s.label = 3;
            case 3:
              n = o, this.integration = fVt(n, this.settings, t), this.onReady = new Promise(function(I) {
                var r = function() {
                  g._ready = !0, I(!0);
                };
                g.integration.once("ready", r);
              }), this.integration.on("initialize", function() {
                g.initializePromise.resolve(!0);
              });
              try {
                su(e, {
                  integrationName: this.name,
                  methodName: "initialize",
                  type: "classic"
                }), this.integration.initialize();
              } catch (I) {
                throw su(e, {
                  integrationName: this.name,
                  methodName: "initialize",
                  type: "classic",
                  didError: !0
                }), this.initializePromise.resolve(!1), I;
              }
              return [
                2
                /*return*/
              ];
          }
        });
      });
    }, A.prototype.unload = function(e, t) {
      return GVt(this.name, this.version, this.options.obfuscate);
    }, A.prototype.addMiddleware = function() {
      for (var e, t = [], i = 0; i < arguments.length; i++)
        t[i] = arguments[i];
      this.middleware = (e = this.middleware).concat.apply(e, t);
    }, A.prototype.shouldBuffer = function(e) {
      return (
        // page events can't be buffered because of destinations that automatically add page views
        e.event.type !== "page" && (md() || this._ready !== !0 || this._initialized !== !0)
      );
    }, A.prototype.send = function(e, t, i) {
      var n, o;
      return UA(this, void 0, void 0, function() {
        var g, s, I, r, a, C;
        return Ee(this, function(B) {
          switch (B.label) {
            case 0:
              return this.shouldBuffer(e) ? (this.buffer.push(e), this.scheduleFlush(), [2, e]) : (g = (o = (n = this.options) === null || n === void 0 ? void 0 : n.plan) === null || o === void 0 ? void 0 : o.track, s = e.event.event, g && s && this.name !== "Segment.io" && (I = g[s], TOA(g, I) ? e.updateEvent("integrations", qA(qA({}, e.event.integrations), I == null ? void 0 : I.integrations)) : (e.updateEvent("integrations", qA(qA({}, e.event.integrations), { All: !1, "Segment.io": !0 })), e.cancel(new hd({
                retry: !1,
                reason: "Event ".concat(s, " disabled for integration ").concat(this.name, " in tracking plan"),
                type: "Dropped by plan"
              }))), I != null && I.enabled && (I == null ? void 0 : I.integrations[this.name]) === !1 && e.cancel(new hd({
                retry: !1,
                reason: "Event ".concat(s, " disabled for integration ").concat(this.name, " in tracking plan"),
                type: "Dropped by plan"
              }))), [4, WIA(this.name, e.event, this.middleware)]);
            case 1:
              if (r = B.sent(), r === null)
                return [2, e];
              a = new t(r, {
                traverse: !this.disableAutoISOConversion
              }), su(e, {
                integrationName: this.name,
                methodName: i,
                type: "classic"
              }), B.label = 2;
            case 2:
              return B.trys.push([2, 5, , 6]), this.integration ? [4, this.integration.invoke.call(this.integration, i, a)] : [3, 4];
            case 3:
              B.sent(), B.label = 4;
            case 4:
              return [3, 6];
            case 5:
              throw C = B.sent(), su(e, {
                integrationName: this.name,
                methodName: i,
                type: "classic",
                didError: !0
              }), C;
            case 6:
              return [2, e];
          }
        });
      });
    }, A.prototype.track = function(e) {
      return UA(this, void 0, void 0, function() {
        return Ee(this, function(t) {
          return [2, this.send(e, fI.Track, "track")];
        });
      });
    }, A.prototype.page = function(e) {
      var t;
      return UA(this, void 0, void 0, function() {
        return Ee(this, function(i) {
          switch (i.label) {
            case 0:
              return !((t = this.integration) === null || t === void 0) && t._assumesPageview && !this._initialized && this.integration.initialize(), [4, this.initializePromise.promise];
            case 1:
              return i.sent(), [2, this.send(e, fI.Page, "page")];
          }
        });
      });
    }, A.prototype.identify = function(e) {
      return UA(this, void 0, void 0, function() {
        return Ee(this, function(t) {
          return [2, this.send(e, fI.Identify, "identify")];
        });
      });
    }, A.prototype.alias = function(e) {
      return UA(this, void 0, void 0, function() {
        return Ee(this, function(t) {
          return [2, this.send(e, fI.Alias, "alias")];
        });
      });
    }, A.prototype.group = function(e) {
      return UA(this, void 0, void 0, function() {
        return Ee(this, function(t) {
          return [2, this.send(e, fI.Group, "group")];
        });
      });
    }, A.prototype.scheduleFlush = function() {
      var e = this;
      this.flushing || setTimeout(function() {
        return UA(e, void 0, void 0, function() {
          var t;
          return Ee(this, function(i) {
            switch (i.label) {
              case 0:
                return md() || this._ready !== !0 || this._initialized !== !0 ? (this.scheduleFlush(), [
                  2
                  /*return*/
                ]) : (this.flushing = !0, t = this, [4, YVt(this, this.buffer)]);
              case 1:
                return t.buffer = i.sent(), this.flushing = !1, this.buffer.todo > 0 && this.scheduleFlush(), [
                  2
                  /*return*/
                ];
            }
          });
        });
      }, Math.random() * 5e3);
    }, A;
  }()
);
function RVt(A, e, t, i, n, o) {
  var g, s;
  if (t === void 0 && (t = {}), i === void 0 && (i = {}), C4A())
    return [];
  e.plan && (i = i ?? {}, i.plan = e.plan);
  var I = (s = (g = e.middlewareSettings) === null || g === void 0 ? void 0 : g.routingRules) !== null && s !== void 0 ? s : [], r = e.integrations, a = i.integrations, C = Y4A(e, i ?? {}), B = o == null ? void 0 : o.reduce(function(Q, E) {
    var d;
    return qA(qA({}, Q), (d = {}, d[bVt(E)] = E, d));
  }, {}), l = new Set(zn(zn([], Object.keys(r).filter(function(Q) {
    return JVt(Q, r[Q]);
  }), !0), Object.keys(B || {}).filter(function(Q) {
    return Hs(r[Q]) || Hs(a == null ? void 0 : a[Q]);
  }), !0));
  return Array.from(l).filter(function(Q) {
    return !NVt(Q, t);
  }).map(function(Q) {
    var E = r[Q], d = kVt(E), m = new OOA(Q, d, A, C[Q], i, B == null ? void 0 : B[Q]), y = I.filter(function(f) {
      return f.destinationName === Q;
    });
    return y.length > 0 && n && m.addMiddleware(n), m;
  });
}
const FVt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  LegacyDestination: OOA,
  ajsDestinations: RVt
}, Symbol.toStringTag, { value: "Module" }));
function MVt(A) {
  return UA(this, void 0, void 0, function() {
    var e;
    return Ee(this, function(t) {
      switch (t.label) {
        case 0:
          return [
            4,
            Promise.resolve().then(() => UVt)
            // This is super gross, but we need to support the `window.analytics.plugins` namespace
            // that is linked in the segment docs in order to be backwards compatible with ajs-classic
            // @ts-expect-error
          ];
        case 1:
          return e = t.sent(), A._plugins = e, [
            2
            /*return*/
          ];
      }
    });
  });
}
const xVt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  loadLegacyVideoPlugins: MVt
}, Symbol.toStringTag, { value: "Module" }));
function LVt(A, e) {
  var t, i;
  if (!A || !Object.keys(A))
    return {};
  var n = A.integrations ? Object.keys(A.integrations).filter(function(g) {
    return A.integrations[g] === !1;
  }) : [], o = [];
  return ((t = e.remotePlugins) !== null && t !== void 0 ? t : []).forEach(function(g) {
    n.forEach(function(s) {
      g.creationName == s && o.push(g.name);
    });
  }), ((i = e.remotePlugins) !== null && i !== void 0 ? i : []).reduce(function(g, s) {
    return s.settings.subscriptions && o.includes(s.name) && s.settings.subscriptions.forEach(
      // @ts-expect-error parameter 'sub' implicitly has an 'any' type
      function(I) {
        return g["".concat(s.name, " ").concat(I.partnerAction)] = !1;
      }
    ), g;
  }, {});
}
function vVt(A, e) {
  function t(i) {
    var n = A, o = i.event.event;
    if (n && o) {
      var g = n[o];
      if (TOA(n, g)) {
        var s = LVt(g, e);
        i.updateEvent("integrations", qA(qA(qA({}, i.event.integrations), g == null ? void 0 : g.integrations), s));
      } else
        return i.updateEvent("integrations", qA(qA({}, i.event.integrations), { All: !1, "Segment.io": !0 })), i;
    }
    return i;
  }
  return {
    name: "Schema Filter",
    version: "0.1.0",
    isLoaded: function() {
      return !0;
    },
    load: function() {
      return Promise.resolve();
    },
    type: "before",
    page: t,
    alias: t,
    track: t,
    identify: t,
    group: t
  };
}
const HVt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  schemaFilter: vVt
}, Symbol.toStringTag, { value: "Module" }));
function SVt(A, e, t) {
  var i;
  return UA(this, void 0, void 0, function() {
    var n, o, g, s, I, r = this;
    return Ee(this, function(a) {
      switch (a.label) {
        case 0:
          return C4A() ? [2, []] : (n = GIA(), o = (i = e.enabledMiddleware) !== null && i !== void 0 ? i : {}, g = Object.entries(o).filter(function(C) {
            C[0];
            var B = C[1];
            return B;
          }).map(function(C) {
            var B = C[0];
            return B;
          }), s = g.map(function(C) {
            return UA(r, void 0, void 0, function() {
              var B, l, Q, E;
              return Ee(this, function(d) {
                switch (d.label) {
                  case 0:
                    B = C.replace("@segment/", ""), l = B, t && (l = btoa(B).replace(/=/g, "")), Q = "".concat(n, "/middleware/").concat(l, "/latest/").concat(l, ".js.gz"), d.label = 1;
                  case 1:
                    return d.trys.push([1, 3, , 4]), [
                      4,
                      Yw(Q)
                      // @ts-ignore
                    ];
                  case 2:
                    return d.sent(), [2, window["".concat(B, "Middleware")]];
                  case 3:
                    return E = d.sent(), A.log("error", E), A.stats.increment("failed_remote_middleware"), [3, 4];
                  case 4:
                    return [
                      2
                      /*return*/
                    ];
                }
              });
            });
          }), [4, Promise.all(s)]);
        case 1:
          return I = a.sent(), I = I.filter(Boolean), [2, I];
      }
    });
  });
}
const ZVt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  remoteMiddlewares: SVt
}, Symbol.toStringTag, { value: "Module" }));
var oK = {}, WVt = {
  get exports() {
    return oK;
  },
  set exports(A) {
    oK = A;
  }
};
(function(A, e) {
  (function(t, i) {
    A.exports = i();
  })(window, function() {
    return function(t) {
      var i = {};
      function n(o) {
        if (i[o])
          return i[o].exports;
        var g = i[o] = { i: o, l: !1, exports: {} };
        return t[o].call(g.exports, g, g.exports, n), g.l = !0, g.exports;
      }
      return n.m = t, n.c = i, n.d = function(o, g, s) {
        n.o(o, g) || Object.defineProperty(o, g, { enumerable: !0, get: s });
      }, n.r = function(o) {
        typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: !0 });
      }, n.t = function(o, g) {
        if (1 & g && (o = n(o)), 8 & g || 4 & g && typeof o == "object" && o && o.__esModule)
          return o;
        var s = /* @__PURE__ */ Object.create(null);
        if (n.r(s), Object.defineProperty(s, "default", { enumerable: !0, value: o }), 2 & g && typeof o != "string")
          for (var I in o)
            n.d(s, I, function(r) {
              return o[r];
            }.bind(null, I));
        return s;
      }, n.n = function(o) {
        var g = o && o.__esModule ? function() {
          return o.default;
        } : function() {
          return o;
        };
        return n.d(g, "a", g), g;
      }, n.o = function(o, g) {
        return Object.prototype.hasOwnProperty.call(o, g);
      }, n.p = "", n(n.s = 2);
    }([function(t, i, n) {
      n.r(i);
      var o = typeof fetch == "function" ? fetch.bind() : function(g, s) {
        return s = s || {}, new Promise(function(I, r) {
          var a = new XMLHttpRequest();
          for (var C in a.open(s.method || "get", g, !0), s.headers)
            a.setRequestHeader(C, s.headers[C]);
          function B() {
            var l, Q = [], E = [], d = {};
            return a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(m, y, f) {
              Q.push(y = y.toLowerCase()), E.push([y, f]), l = d[y], d[y] = l ? l + "," + f : f;
            }), { ok: (a.status / 100 | 0) == 2, status: a.status, statusText: a.statusText, url: a.responseURL, clone: B, text: function() {
              return Promise.resolve(a.responseText);
            }, json: function() {
              return Promise.resolve(a.responseText).then(JSON.parse);
            }, blob: function() {
              return Promise.resolve(new Blob([a.response]));
            }, headers: { keys: function() {
              return Q;
            }, entries: function() {
              return E;
            }, get: function(m) {
              return d[m.toLowerCase()];
            }, has: function(m) {
              return m.toLowerCase() in d;
            } } };
          }
          a.withCredentials = s.credentials == "include", a.onload = function() {
            I(B());
          }, a.onerror = r, a.send(s.body);
        });
      };
      i.default = o;
    }, function(t, i, n) {
      Object.defineProperty(i, "__esModule", { value: !0 });
      var o = function() {
        function s(I, r) {
          for (var a = 0; a < r.length; a++) {
            var C = r[a];
            C.enumerable = C.enumerable || !1, C.configurable = !0, "value" in C && (C.writable = !0), Object.defineProperty(I, C.key, C);
          }
        }
        return function(I, r, a) {
          return r && s(I.prototype, r), a && s(I, a), I;
        };
      }(), g = function() {
        function s(I, r) {
          (function(a, C) {
            if (!(a instanceof C))
              throw new TypeError("Cannot call a class as a function");
          })(this, s), this.pluginName = I;
        }
        return o(s, [{ key: "track", value: function(I, r) {
          window.analytics.track(I, r, { integration: { name: this.pluginName } });
        } }]), s;
      }();
      i.default = g;
    }, function(t, i, n) {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.YouTubeAnalytics = i.VimeoAnalytics = void 0;
      var o = s(n(3)), g = s(n(4));
      function s(I) {
        return I && I.__esModule ? I : { default: I };
      }
      i.VimeoAnalytics = o.default, i.YouTubeAnalytics = g.default;
    }, function(t, i, n) {
      Object.defineProperty(i, "__esModule", { value: !0 });
      var o = function() {
        function r(a, C) {
          for (var B = 0; B < C.length; B++) {
            var l = C[B];
            l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(a, l.key, l);
          }
        }
        return function(a, C, B) {
          return C && r(a.prototype, C), B && r(a, B), a;
        };
      }(), g = s(n(0));
      function s(r) {
        return r && r.__esModule ? r : { default: r };
      }
      var I = function(r) {
        function a(C, B) {
          (function(Q, E) {
            if (!(Q instanceof E))
              throw new TypeError("Cannot call a class as a function");
          })(this, a);
          var l = function(Q, E) {
            if (!Q)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return !E || typeof E != "object" && typeof E != "function" ? Q : E;
          }(this, (a.__proto__ || Object.getPrototypeOf(a)).call(this, "VimeoAnalytics"));
          return l.authToken = B, l.player = C, l.metadata = { content: {}, playback: { videoPlayer: "Vimeo" } }, l.mostRecentHeartbeat = 0, l.isPaused = !1, l;
        }
        return function(C, B) {
          if (typeof B != "function" && B !== null)
            throw new TypeError("Super expression must either be null or a function, not " + typeof B);
          C.prototype = Object.create(B && B.prototype, { constructor: { value: C, enumerable: !1, writable: !0, configurable: !0 } }), B && (Object.setPrototypeOf ? Object.setPrototypeOf(C, B) : C.__proto__ = B);
        }(a, r), o(a, [{ key: "initialize", value: function() {
          var C = this, B = { loaded: this.retrieveMetadata, play: this.trackPlay, pause: this.trackPause, ended: this.trackEnded, timeupdate: this.trackHeartbeat };
          for (var l in B)
            this.registerHandler(l, B[l]);
          this.player.getVideoId().then(function(Q) {
            C.retrieveMetadata({ id: Q });
          }).catch(console.error);
        } }, { key: "registerHandler", value: function(C, B) {
          var l = this;
          this.player.on(C, function(Q) {
            l.updateMetadata(Q), B.call(l, Q);
          });
        } }, { key: "trackPlay", value: function() {
          this.isPaused ? (this.track("Video Playback Resumed", this.metadata.playback), this.isPaused = !1) : (this.track("Video Playback Started", this.metadata.playback), this.track("Video Content Started", this.metadata.content));
        } }, { key: "trackEnded", value: function() {
          this.track("Video Playback Completed", this.metadata.playback), this.track("Video Content Completed", this.metadata.content);
        } }, { key: "trackHeartbeat", value: function() {
          var C = this.mostRecentHeartbeat, B = this.metadata.playback.position;
          B !== C && B - C >= 10 && (this.track("Video Content Playing", this.metadata.content), this.mostRecentHeartbeat = Math.floor(B));
        } }, { key: "trackPause", value: function() {
          this.isPaused = !0, this.track("Video Playback Paused", this.metadata.playback);
        } }, { key: "retrieveMetadata", value: function(C) {
          var B = this;
          return new Promise(function(l, Q) {
            var E = C.id;
            (0, g.default)("https://api.vimeo.com/videos/" + E, { headers: { Authorization: "Bearer " + B.authToken } }).then(function(d) {
              return d.ok ? d.json() : Q(d);
            }).then(function(d) {
              B.metadata.content.title = d.name, B.metadata.content.description = d.description, B.metadata.content.publisher = d.user.name, B.metadata.playback.position = 0, B.metadata.playback.totalLength = d.duration;
            }).catch(function(d) {
              return console.error("Request to Vimeo API Failed with: ", d), Q(d);
            });
          });
        } }, { key: "updateMetadata", value: function(C) {
          var B = this;
          return new Promise(function(l, Q) {
            B.player.getVolume().then(function(E) {
              E && (B.metadata.playback.sound = 100 * E), B.metadata.playback.position = C.seconds, l();
            }).catch(Q);
          });
        } }]), a;
      }(s(n(1)).default);
      i.default = I;
    }, function(t, i, n) {
      Object.defineProperty(i, "__esModule", { value: !0 });
      var o = function() {
        function C(B, l) {
          for (var Q = 0; Q < l.length; Q++) {
            var E = l[Q];
            E.enumerable = E.enumerable || !1, E.configurable = !0, "value" in E && (E.writable = !0), Object.defineProperty(B, E.key, E);
          }
        }
        return function(B, l, Q) {
          return l && C(B.prototype, l), Q && C(B, Q), B;
        };
      }(), g = I(n(0)), s = I(n(1));
      function I(C) {
        return C && C.__esModule ? C : { default: C };
      }
      var r = function(C) {
        function B(l, Q) {
          (function(d, m) {
            if (!(d instanceof m))
              throw new TypeError("Cannot call a class as a function");
          })(this, B);
          var E = function(d, m) {
            if (!d)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return !m || typeof m != "object" && typeof m != "function" ? d : m;
          }(this, (B.__proto__ || Object.getPrototypeOf(B)).call(this, "YoutubeAnalytics"));
          return E.player = l, E.apiKey = Q, E.playerLoaded = !1, E.playbackStarted = !1, E.contentStarted = !1, E.isPaused = !1, E.isBuffering = !1, E.isSeeking = !1, E.lastRecordedTime = { timeReported: Date.now(), timeElapsed: 0 }, E.metadata = [{ playback: { video_player: "youtube" }, content: {} }], E.playlistIndex = 0, E;
        }
        return function(l, Q) {
          if (typeof Q != "function" && Q !== null)
            throw new TypeError("Super expression must either be null or a function, not " + typeof Q);
          l.prototype = Object.create(Q && Q.prototype, { constructor: { value: l, enumerable: !1, writable: !0, configurable: !0 } }), Q && (Object.setPrototypeOf ? Object.setPrototypeOf(l, Q) : l.__proto__ = Q);
        }(B, C), o(B, [{ key: "initialize", value: function() {
          window.segmentYoutubeOnStateChange = this.onPlayerStateChange.bind(this), window.segmentYoutubeOnReady = this.onPlayerReady.bind(this), this.player.addEventListener("onReady", "segmentYoutubeOnReady"), this.player.addEventListener("onStateChange", "segmentYoutubeOnStateChange");
        } }, { key: "onPlayerReady", value: function(l) {
          this.retrieveMetadata();
        } }, { key: "onPlayerStateChange", value: function(l) {
          var Q = this.player.getCurrentTime();
          switch (this.metadata[this.playlistIndex] && (this.metadata[this.playlistIndex].playback.position = this.metadata[this.playlistIndex].content.position = Q, this.metadata[this.playlistIndex].playback.quality = this.player.getPlaybackQuality(), this.metadata[this.playlistIndex].playback.sound = this.player.isMuted() ? 0 : this.player.getVolume()), l.data) {
            case -1:
              if (this.playerLoaded)
                break;
              this.retrieveMetadata(), this.playerLoaded = !0;
              break;
            case YT.PlayerState.BUFFERING:
              this.handleBuffer();
              break;
            case YT.PlayerState.PLAYING:
              this.handlePlay();
              break;
            case YT.PlayerState.PAUSED:
              this.handlePause();
              break;
            case YT.PlayerState.ENDED:
              this.handleEnd();
          }
          this.lastRecordedTime = { timeReported: Date.now(), timeElapsed: 1e3 * this.player.getCurrentTime() };
        } }, { key: "retrieveMetadata", value: function() {
          var l = this;
          return new Promise(function(Q, E) {
            var d = l.player.getVideoData(), m = l.player.getPlaylist() || [d.video_id], y = m.join();
            (0, g.default)("https://www.googleapis.com/youtube/v3/videos?id=" + y + "&part=snippet,contentDetails&key=" + l.apiKey).then(function(f) {
              if (!f.ok) {
                var w = new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");
                throw w.response = f, w;
              }
              return f.json();
            }).then(function(f) {
              l.metadata = [];
              for (var w = 0, G = 0; G < m.length; G++) {
                var R = f.items[G];
                l.metadata.push({ content: { title: R.snippet.title, description: R.snippet.description, keywords: R.snippet.tags, channel: R.snippet.channelTitle, airdate: R.snippet.publishedAt } }), w += a(R.contentDetails.duration);
              }
              for (G = 0; G < m.length; G++)
                l.metadata[G].playback = { total_length: w, video_player: "youtube" };
              Q();
            }).catch(function(f) {
              l.metadata = m.map(function(w) {
                return { playback: { video_player: "youtube" }, content: {} };
              }), E(f);
            });
          });
        } }, { key: "handleBuffer", value: function() {
          var l = this.determineSeek();
          this.playbackStarted || (this.playbackStarted = !0, this.track("Video Playback Started", this.metadata[this.playlistIndex].playback)), l && !this.isSeeking && (this.isSeeking = !0, this.track("Video Playback Seek Started", this.metadata[this.playlistIndex].playback)), this.isSeeking && (this.track("Video Playback Seek Completed", this.metadata[this.playlistIndex].playback), this.isSeeking = !1);
          var Q = this.player.getPlaylist();
          Q && this.player.getCurrentTime() === 0 && this.player.getPlaylistIndex() !== this.playlistIndex && (this.contentStarted = !1, this.playlistIndex === Q.length - 1 && this.player.getPlaylistIndex() === 0 && (this.track("Video Playback Completed", this.metadata[this.player.getPlaylistIndex()].playback), this.track("Video Playback Started", this.metadata[this.player.getPlaylistIndex()].playback))), this.track("Video Playback Buffer Started", this.metadata[this.playlistIndex].playback), this.isBuffering = !0;
        } }, { key: "handlePlay", value: function() {
          this.contentStarted || (this.playlistIndex = this.player.getPlaylistIndex(), this.playlistIndex === -1 && (this.playlistIndex = 0), this.track("Video Content Started", this.metadata[this.playlistIndex].content), this.contentStarted = !0), this.isBuffering && (this.track("Video Playback Buffer Completed", this.metadata[this.playlistIndex].playback), this.isBuffering = !1), this.isPaused && (this.track("Video Playback Resumed", this.metadata[this.playlistIndex].playback), this.isPaused = !1);
        } }, { key: "handlePause", value: function() {
          var l = this.determineSeek();
          this.isBuffering && (this.track("Video Playback Buffer Completed", this.metadata[this.playlistIndex].playback), this.isBuffering = !1), this.isPaused || (l ? (this.track("Video Playback Seek Started", this.metadata[this.playlistIndex].playback), this.isSeeking = !0) : (this.track("Video Playback Paused", this.metadata[this.playlistIndex].playback), this.isPaused = !0));
        } }, { key: "handleEnd", value: function() {
          this.track("Video Content Completed", this.metadata[this.playlistIndex].content), this.contentStarted = !1;
          var l = this.player.getPlaylistIndex(), Q = this.player.getPlaylist();
          (Q && l === Q.length - 1 || l === -1) && (this.track("Video Playback Completed", this.metadata[this.playlistIndex].playback), this.playbackStarted = !1);
        } }, { key: "determineSeek", value: function() {
          var l = this.isPaused || this.isBuffering ? 0 : Date.now() - this.lastRecordedTime.timeReported, Q = 1e3 * this.player.getCurrentTime() - this.lastRecordedTime.timeElapsed;
          return Math.abs(l - Q) > 2e3;
        } }]), B;
      }(s.default);
      function a(C) {
        var B = C.match(/PT(\d+H)?(\d+M)?(\d+S)?/);
        return B = B.slice(1).map(function(l) {
          if (l != null)
            return l.replace(/\D/, "");
        }), 3600 * (parseInt(B[0]) || 0) + 60 * (parseInt(B[1]) || 0) + (parseInt(B[2]) || 0);
      }
      i.default = r;
    }]);
  });
})(WVt);
const KVt = /* @__PURE__ */ u8(oK), UVt = /* @__PURE__ */ NfA({
  __proto__: null,
  default: KVt
}, [oK]);
export {
  l9t as default
};
