UNPKG

clock-analog-digital-react

Version:

A reusable React clock package with analog and digital clocks

1,640 lines (1,638 loc) 77.7 kB
import * as ae from "react"; import rr, { useRef as xr, useState as oe, useCallback as de, useEffect as We, useMemo as q, forwardRef as Et, useContext as _t, useLayoutEffect as Tt } from "react"; var Xe = { exports: {} }, Oe = {}; /** * @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 Ir; function jt() { if (Ir) return Oe; Ir = 1; var e = rr, r = Symbol.for("react.element"), n = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 }; function c(u, h, k) { var d, p = {}, _ = null, $ = null; k !== void 0 && (_ = "" + k), h.key !== void 0 && (_ = "" + h.key), h.ref !== void 0 && ($ = h.ref); for (d in h) a.call(h, d) && !i.hasOwnProperty(d) && (p[d] = h[d]); if (u && u.defaultProps) for (d in h = u.defaultProps, h) p[d] === void 0 && (p[d] = h[d]); return { $$typeof: r, type: u, key: _, ref: $, props: p, _owner: o.current }; } return Oe.Fragment = n, Oe.jsx = c, Oe.jsxs = c, Oe; } var Ie = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var $r; function Pt() { return $r || ($r = 1, process.env.NODE_ENV !== "production" && function() { var e = rr, r = Symbol.for("react.element"), n = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), u = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), $ = Symbol.for("react.offscreen"), C = Symbol.iterator, f = "@@iterator"; function g(t) { if (t === null || typeof t != "object") return null; var s = C && t[C] || t[f]; return typeof s == "function" ? s : null; } var x = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function b(t) { { for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), y = 1; y < s; y++) l[y - 1] = arguments[y]; T("error", t, l); } } function T(t, s, l) { { var y = x.ReactDebugCurrentFrame, A = y.getStackAddendum(); A !== "" && (s += "%s", l = l.concat([A])); var W = l.map(function(E) { return String(E); }); W.unshift("Warning: " + s), Function.prototype.apply.call(console[t], console, W); } } var v = !1, O = !1, S = !1, w = !1, z = !1, X; X = Symbol.for("react.module.reference"); function I(t) { return !!(typeof t == "string" || typeof t == "function" || t === a || t === i || z || t === o || t === k || t === d || w || t === $ || v || O || S || typeof t == "object" && t !== null && (t.$$typeof === _ || t.$$typeof === p || t.$$typeof === c || t.$$typeof === u || t.$$typeof === h || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. t.$$typeof === X || t.getModuleId !== void 0)); } function ie(t, s, l) { var y = t.displayName; if (y) return y; var A = s.displayName || s.name || ""; return A !== "" ? l + "(" + A + ")" : l; } function Le(t) { return t.displayName || "Context"; } function Z(t) { if (t == null) return null; if (typeof t.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function") return t.displayName || t.name || null; if (typeof t == "string") return t; switch (t) { case a: return "Fragment"; case n: return "Portal"; case i: return "Profiler"; case o: return "StrictMode"; case k: return "Suspense"; case d: return "SuspenseList"; } if (typeof t == "object") switch (t.$$typeof) { case u: var s = t; return Le(s) + ".Consumer"; case c: var l = t; return Le(l._context) + ".Provider"; case h: return ie(t, t.render, "ForwardRef"); case p: var y = t.displayName || null; return y !== null ? y : Z(t.type) || "Memo"; case _: { var A = t, W = A._payload, E = A._init; try { return Z(E(W)); } catch { return null; } } } return null; } var Q = Object.assign, se = 0, J, ne, Ne, Te, he, He, Ve; function je() { } je.__reactDisabledLog = !0; function pe() { { if (se === 0) { J = console.log, ne = console.info, Ne = console.warn, Te = console.error, he = console.group, He = console.groupCollapsed, Ve = console.groupEnd; var t = { configurable: !0, enumerable: !0, value: je, writable: !0 }; Object.defineProperties(console, { info: t, log: t, warn: t, error: t, group: t, groupCollapsed: t, groupEnd: t }); } se++; } } function me() { { if (se--, se === 0) { var t = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: Q({}, t, { value: J }), info: Q({}, t, { value: ne }), warn: Q({}, t, { value: Ne }), error: Q({}, t, { value: Te }), group: Q({}, t, { value: he }), groupCollapsed: Q({}, t, { value: He }), groupEnd: Q({}, t, { value: Ve }) }); } se < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var ge = x.ReactCurrentDispatcher, be; function ve(t, s, l) { { if (be === void 0) try { throw Error(); } catch (A) { var y = A.stack.trim().match(/\n( *(at )?)/); be = y && y[1] || ""; } return ` ` + be + t; } } var Pe = !1, xe; { var or = typeof WeakMap == "function" ? WeakMap : Map; xe = new or(); } function Be(t, s) { if (!t || Pe) return ""; { var l = xe.get(t); if (l !== void 0) return l; } var y; Pe = !0; var A = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var W; W = ge.current, ge.current = null, pe(); try { if (s) { var E = function() { throw Error(); }; if (Object.defineProperty(E.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(E, []); } catch (U) { y = U; } Reflect.construct(t, [], E); } else { try { E.call(); } catch (U) { y = U; } t.call(E.prototype); } } else { try { throw Error(); } catch (U) { y = U; } t(); } } catch (U) { if (U && y && typeof U.stack == "string") { for (var R = U.stack.split(` `), B = y.stack.split(` `), F = R.length - 1, D = B.length - 1; F >= 1 && D >= 0 && R[F] !== B[D]; ) D--; for (; F >= 1 && D >= 0; F--, D--) if (R[F] !== B[D]) { if (F !== 1 || D !== 1) do if (F--, D--, D < 0 || R[F] !== B[D]) { var K = ` ` + R[F].replace(" at new ", " at "); return t.displayName && K.includes("<anonymous>") && (K = K.replace("<anonymous>", t.displayName)), typeof t == "function" && xe.set(t, K), K; } while (F >= 1 && D >= 0); break; } } } finally { Pe = !1, ge.current = W, me(), Error.prepareStackTrace = A; } var ke = t ? t.displayName || t.name : "", fe = ke ? ve(ke) : ""; return typeof t == "function" && xe.set(t, fe), fe; } function ir(t, s, l) { return Be(t, !1); } function sr(t) { var s = t.prototype; return !!(s && s.isReactComponent); } function ce(t, s, l) { if (t == null) return ""; if (typeof t == "function") return Be(t, sr(t)); if (typeof t == "string") return ve(t); switch (t) { case k: return ve("Suspense"); case d: return ve("SuspenseList"); } if (typeof t == "object") switch (t.$$typeof) { case h: return ir(t.render); case p: return ce(t.type, s, l); case _: { var y = t, A = y._payload, W = y._init; try { return ce(W(A), s, l); } catch { } } } return ""; } var le = Object.prototype.hasOwnProperty, Ue = {}, Ye = x.ReactDebugCurrentFrame; function V(t) { if (t) { var s = t._owner, l = ce(t.type, t._source, s ? s.type : null); Ye.setExtraStackFrame(l); } else Ye.setExtraStackFrame(null); } function ue(t, s, l, y, A) { { var W = Function.call.bind(le); for (var E in t) if (W(t, E)) { var R = void 0; try { if (typeof t[E] != "function") { var B = Error((y || "React class") + ": " + l + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw B.name = "Invariant Violation", B; } R = t[E](s, E, y, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (F) { R = F; } R && !(R instanceof Error) && (V(A), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", y || "React class", l, E, typeof R), V(null)), R instanceof Error && !(R.message in Ue) && (Ue[R.message] = !0, V(A), b("Failed %s type: %s", l, R.message), V(null)); } } } var cr = Array.isArray; function Ae(t) { return cr(t); } function lr(t) { { var s = typeof Symbol == "function" && Symbol.toStringTag, l = s && t[Symbol.toStringTag] || t.constructor.name || "Object"; return l; } } function ur(t) { try { return qe(t), !1; } catch { return !0; } } function qe(t) { return "" + t; } function Ge(t) { if (ur(t)) return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", lr(t)), qe(t); } var Cr = x.ReactCurrentOwner, ct = { key: !0, ref: !0, __self: !0, __source: !0 }, Sr, Rr; function lt(t) { if (le.call(t, "ref")) { var s = Object.getOwnPropertyDescriptor(t, "ref").get; if (s && s.isReactWarning) return !1; } return t.ref !== void 0; } function ut(t) { if (le.call(t, "key")) { var s = Object.getOwnPropertyDescriptor(t, "key").get; if (s && s.isReactWarning) return !1; } return t.key !== void 0; } function ft(t, s) { typeof t.ref == "string" && Cr.current; } function dt(t, s) { { var l = function() { Sr || (Sr = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s)); }; l.isReactWarning = !0, Object.defineProperty(t, "key", { get: l, configurable: !0 }); } } function ht(t, s) { { var l = function() { Rr || (Rr = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s)); }; l.isReactWarning = !0, Object.defineProperty(t, "ref", { get: l, configurable: !0 }); } } var pt = function(t, s, l, y, A, W, E) { var R = { // This tag allows us to uniquely identify this as a React Element $$typeof: r, // Built-in properties that belong on the element type: t, key: s, ref: l, props: E, // Record the component responsible for creating this element. _owner: W }; return R._store = {}, Object.defineProperty(R._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(R, "_self", { configurable: !1, enumerable: !1, writable: !1, value: y }), Object.defineProperty(R, "_source", { configurable: !1, enumerable: !1, writable: !1, value: A }), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R; }; function mt(t, s, l, y, A) { { var W, E = {}, R = null, B = null; l !== void 0 && (Ge(l), R = "" + l), ut(s) && (Ge(s.key), R = "" + s.key), lt(s) && (B = s.ref, ft(s, A)); for (W in s) le.call(s, W) && !ct.hasOwnProperty(W) && (E[W] = s[W]); if (t && t.defaultProps) { var F = t.defaultProps; for (W in F) E[W] === void 0 && (E[W] = F[W]); } if (R || B) { var D = typeof t == "function" ? t.displayName || t.name || "Unknown" : t; R && dt(E, D), B && ht(E, D); } return pt(t, R, B, A, y, Cr.current, E); } } var fr = x.ReactCurrentOwner, Er = x.ReactDebugCurrentFrame; function ye(t) { if (t) { var s = t._owner, l = ce(t.type, t._source, s ? s.type : null); Er.setExtraStackFrame(l); } else Er.setExtraStackFrame(null); } var dr; dr = !1; function hr(t) { return typeof t == "object" && t !== null && t.$$typeof === r; } function _r() { { if (fr.current) { var t = Z(fr.current.type); if (t) return ` Check the render method of \`` + t + "`."; } return ""; } } function gt(t) { return ""; } var Tr = {}; function bt(t) { { var s = _r(); if (!s) { var l = typeof t == "string" ? t : t.displayName || t.name; l && (s = ` Check the top-level render call using <` + l + ">."); } return s; } } function jr(t, s) { { if (!t._store || t._store.validated || t.key != null) return; t._store.validated = !0; var l = bt(s); if (Tr[l]) return; Tr[l] = !0; var y = ""; t && t._owner && t._owner !== fr.current && (y = " It was passed a child from " + Z(t._owner.type) + "."), ye(t), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, y), ye(null); } } function Pr(t, s) { { if (typeof t != "object") return; if (Ae(t)) for (var l = 0; l < t.length; l++) { var y = t[l]; hr(y) && jr(y, s); } else if (hr(t)) t._store && (t._store.validated = !0); else if (t) { var A = g(t); if (typeof A == "function" && A !== t.entries) for (var W = A.call(t), E; !(E = W.next()).done; ) hr(E.value) && jr(E.value, s); } } } function vt(t) { { var s = t.type; if (s == null || typeof s == "string") return; var l; if (typeof s == "function") l = s.propTypes; else if (typeof s == "object" && (s.$$typeof === h || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. s.$$typeof === p)) l = s.propTypes; else return; if (l) { var y = Z(s); ue(l, t.props, "prop", y, t); } else if (s.PropTypes !== void 0 && !dr) { dr = !0; var A = Z(s); b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", A || "Unknown"); } typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function xt(t) { { for (var s = Object.keys(t.props), l = 0; l < s.length; l++) { var y = s[l]; if (y !== "children" && y !== "key") { ye(t), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", y), ye(null); break; } } t.ref !== null && (ye(t), b("Invalid attribute `ref` supplied to `React.Fragment`."), ye(null)); } } var Ar = {}; function Or(t, s, l, y, A, W) { { var E = I(t); if (!E) { var R = ""; (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var B = gt(); B ? R += B : R += _r(); var F; t === null ? F = "null" : Ae(t) ? F = "array" : t !== void 0 && t.$$typeof === r ? (F = "<" + (Z(t.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : F = typeof t, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", F, R); } var D = mt(t, s, l, A, W); if (D == null) return D; if (E) { var K = s.children; if (K !== void 0) if (y) if (Ae(K)) { for (var ke = 0; ke < K.length; ke++) Pr(K[ke], t); Object.freeze && Object.freeze(K); } else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else Pr(K, t); } if (le.call(s, "key")) { var fe = Z(t), U = Object.keys(s).filter(function(Rt) { return Rt !== "key"; }), pr = U.length > 0 ? "{key: someKey, " + U.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!Ar[fe + pr]) { var St = U.length > 0 ? "{" + U.join(": ..., ") + ": ...}" : "{}"; b(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, pr, fe, St, fe), Ar[fe + pr] = !0; } } return t === a ? xt(D) : vt(D), D; } } function yt(t, s, l) { return Or(t, s, l, !0); } function kt(t, s, l) { return Or(t, s, l, !1); } var wt = kt, Ct = yt; Ie.Fragment = a, Ie.jsx = wt, Ie.jsxs = Ct; }()), Ie; } var Wr; function At() { return Wr || (Wr = 1, process.env.NODE_ENV === "production" ? Xe.exports = jt() : Xe.exports = Pt()), Xe.exports; } var m = At(); const qr = () => { const e = xr(null), [r, n] = oe(() => /* @__PURE__ */ new Date()), a = de(() => { e.current = window.setInterval(() => { n(/* @__PURE__ */ new Date()); }, 1e3); }, []), o = de(() => { e.current !== null && (clearInterval(e.current), e.current = null); }, []); We(() => (a(), o), [a, o]); const i = r.getSeconds(), c = r.getMinutes(), u = r.getHours(); return { seconds: i, minutes: c, hours: u }; }, Ot = (e, r, n, a, o, i, c, u, h, k, d) => { const p = [], $ = [0, 15, 30, 45], C = (f, g, x, b, T) => { if (rr.isValidElement(f) && f.props) { const { style: v } = f.props; return { width: String((v == null ? void 0 : v.width) || g), height: String((v == null ? void 0 : v.height) || x), backgroundColor: String((v == null ? void 0 : v.backgroundColor) || b), display: T ? "block" : "none" }; } return { width: g, height: x, backgroundColor: b, display: T ? "block" : "none" }; }; for (let f = 0; f < 60; f++) { const g = f * 6, x = g * Math.PI / 180, b = (e - (r ? r * 8 : e * 0.07)) * Math.cos(x), T = (e - (r ? r * 8 : e * 0.07)) * Math.sin(x); let v = "minor", O, S, w, z; if (f % 5 !== 0) { v = "minor"; const I = C( d, `${1e-3 * e}rem`, `${2e-3 * e}rem`, u || "cyan", o ); O = I.width, S = I.height, w = I.backgroundColor, z = I.display; } else if ($.includes(f)) { v = "primary"; const I = C( h, `${15e-4 * e}rem`, `${45e-4 * e}rem`, i || "#e9f2ef", n ); O = I.width, S = I.height, w = I.backgroundColor, z = I.display; } else { v = "major"; const I = C( k, `${15e-4 * e}rem`, `${3e-3 * e}rem`, c || "#f7bee2", a ); O = I.width, S = I.height, w = I.backgroundColor, z = I.display; } const X = { type: v, position: "absolute", top: `calc(50% + ${T}px)`, left: `calc(50% + ${b}px)`, transform: `translate(-50%, -50%) rotate(${g + 90}deg)`, transformOrigin: "center", width: String(O), height: String(S), backgroundColor: String(w), display: z }; p.push(X); } return p; }, It = ({ radius: e, clockNumbersType: r, effectiveClockBorderThickness: n, effectivePrimaryNumbersFontSize: a, effectiveMajorNumbersFontSize: o, effectivePrimaryNumbersColor: i, effectiveMajorNumbersColor: c, hasPrimaryNumbers: u = !0, hasMajorNumbers: h = !0, PrimaryNumbersComponent: k, MajorNumbersComponent: d }) => q(() => { const p = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"], _ = (C) => { const f = (C + 1) * 30 - 90, g = e - (n > 1.4 ? n * 3 : 0) - e * 0.25; return { x: g * Math.cos(f * Math.PI / 180), y: g * Math.sin(f * Math.PI / 180) }; }, $ = (C, f) => { if (rr.isValidElement(C) && C.props) { const { style: g } = C.props; return { ...f, ...g, fontSize: `${(g == null ? void 0 : g.fontSize) || f.fontSize}`, color: `${(g == null ? void 0 : g.color) || f.color}` }; } return f; }; return [...Array(12)].map((C, f) => { const g = r === "ENGLISH" ? f + 1 : r === "ROMAN" ? p[f] : null, { x, y: b } = _(f), T = [12, 3, 6, 9].includes(f + 1), v = T ? k : d, O = T ? a : o, S = T ? i || "#c7eaf0" : c || "#6df2bf", w = T ? u ? "block" : "none" : h ? "block" : "none", z = $(v, { fontSize: `${Math.min(O, 0.18) * e}px`, color: S, width: "auto", height: "auto" }); return { num: v || g, x, y: b, fontSize: z.fontSize, color: z.color, width: z.width, height: z.height, display: w, style: z }; }); }, [ e, r, n, a, o, i, c, u, h, k, d ]); function gr() { return gr = Object.assign ? Object.assign.bind() : function(e) { for (var r = 1; r < arguments.length; r++) { var n = arguments[r]; for (var a in n) ({}).hasOwnProperty.call(n, a) && (e[a] = n[a]); } return e; }, gr.apply(null, arguments); } function $t(e) { if (e.sheet) return e.sheet; for (var r = 0; r < document.styleSheets.length; r++) if (document.styleSheets[r].ownerNode === e) return document.styleSheets[r]; } function Wt(e) { var r = document.createElement("style"); return r.setAttribute("data-emotion", e.key), e.nonce !== void 0 && r.setAttribute("nonce", e.nonce), r.appendChild(document.createTextNode("")), r.setAttribute("data-s", ""), r; } var Mt = /* @__PURE__ */ function() { function e(n) { var a = this; this._insertTag = function(o) { var i; a.tags.length === 0 ? a.insertionPoint ? i = a.insertionPoint.nextSibling : a.prepend ? i = a.container.firstChild : i = a.before : i = a.tags[a.tags.length - 1].nextSibling, a.container.insertBefore(o, i), a.tags.push(o); }, this.isSpeedy = n.speedy === void 0 ? !0 : n.speedy, this.tags = [], this.ctr = 0, this.nonce = n.nonce, this.key = n.key, this.container = n.container, this.prepend = n.prepend, this.insertionPoint = n.insertionPoint, this.before = null; } var r = e.prototype; return r.hydrate = function(a) { a.forEach(this._insertTag); }, r.insert = function(a) { this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(Wt(this)); var o = this.tags[this.tags.length - 1]; if (this.isSpeedy) { var i = $t(o); try { i.insertRule(a, i.cssRules.length); } catch { } } else o.appendChild(document.createTextNode(a)); this.ctr++; }, r.flush = function() { this.tags.forEach(function(a) { var o; return (o = a.parentNode) == null ? void 0 : o.removeChild(a); }), this.tags = [], this.ctr = 0; }, e; }(), H = "-ms-", er = "-moz-", j = "-webkit-", Gr = "comm", yr = "rule", kr = "decl", Ft = "@import", Xr = "@keyframes", zt = "@layer", Dt = Math.abs, tr = String.fromCharCode, Lt = Object.assign; function Nt(e, r) { return N(e, 0) ^ 45 ? (((r << 2 ^ N(e, 0)) << 2 ^ N(e, 1)) << 2 ^ N(e, 2)) << 2 ^ N(e, 3) : 0; } function Kr(e) { return e.trim(); } function Ht(e, r) { return (e = r.exec(e)) ? e[0] : e; } function P(e, r, n) { return e.replace(r, n); } function br(e, r) { return e.indexOf(r); } function N(e, r) { return e.charCodeAt(r) | 0; } function Me(e, r, n) { return e.slice(r, n); } function ee(e) { return e.length; } function wr(e) { return e.length; } function Ke(e, r) { return r.push(e), e; } function Vt(e, r) { return e.map(r).join(""); } var nr = 1, Ee = 1, Jr = 0, Y = 0, L = 0, _e = ""; function ar(e, r, n, a, o, i, c) { return { value: e, root: r, parent: n, type: a, props: o, children: i, line: nr, column: Ee, length: c, return: "" }; } function $e(e, r) { return Lt(ar("", null, null, "", null, null, 0), e, { length: -e.length }, r); } function Bt() { return L; } function Ut() { return L = Y > 0 ? N(_e, --Y) : 0, Ee--, L === 10 && (Ee = 1, nr--), L; } function G() { return L = Y < Jr ? N(_e, Y++) : 0, Ee++, L === 10 && (Ee = 1, nr++), L; } function te() { return N(_e, Y); } function Je() { return Y; } function De(e, r) { return Me(_e, e, r); } function Fe(e) { switch (e) { // \0 \t \n \r \s whitespace token case 0: case 9: case 10: case 13: case 32: return 5; // ! + , / > @ ~ isolate token case 33: case 43: case 44: case 47: case 62: case 64: case 126: // ; { } breakpoint token case 59: case 123: case 125: return 4; // : accompanied token case 58: return 3; // " ' ( [ opening delimit token case 34: case 39: case 40: case 91: return 2; // ) ] closing delimit token case 41: case 93: return 1; } return 0; } function Zr(e) { return nr = Ee = 1, Jr = ee(_e = e), Y = 0, []; } function Qr(e) { return _e = "", e; } function Ze(e) { return Kr(De(Y - 1, vr(e === 91 ? e + 2 : e === 40 ? e + 1 : e))); } function Yt(e) { for (; (L = te()) && L < 33; ) G(); return Fe(e) > 2 || Fe(L) > 3 ? "" : " "; } function qt(e, r) { for (; --r && G() && !(L < 48 || L > 102 || L > 57 && L < 65 || L > 70 && L < 97); ) ; return De(e, Je() + (r < 6 && te() == 32 && G() == 32)); } function vr(e) { for (; G(); ) switch (L) { // ] ) " ' case e: return Y; // " ' case 34: case 39: e !== 34 && e !== 39 && vr(L); break; // ( case 40: e === 41 && vr(e); break; // \ case 92: G(); break; } return Y; } function Gt(e, r) { for (; G() && e + L !== 57; ) if (e + L === 84 && te() === 47) break; return "/*" + De(r, Y - 1) + "*" + tr(e === 47 ? e : G()); } function Xt(e) { for (; !Fe(te()); ) G(); return De(e, Y); } function Kt(e) { return Qr(Qe("", null, null, null, [""], e = Zr(e), 0, [0], e)); } function Qe(e, r, n, a, o, i, c, u, h) { for (var k = 0, d = 0, p = c, _ = 0, $ = 0, C = 0, f = 1, g = 1, x = 1, b = 0, T = "", v = o, O = i, S = a, w = T; g; ) switch (C = b, b = G()) { // ( case 40: if (C != 108 && N(w, p - 1) == 58) { br(w += P(Ze(b), "&", "&\f"), "&\f") != -1 && (x = -1); break; } // " ' [ case 34: case 39: case 91: w += Ze(b); break; // \t \n \r \s case 9: case 10: case 13: case 32: w += Yt(C); break; // \ case 92: w += qt(Je() - 1, 7); continue; // / case 47: switch (te()) { case 42: case 47: Ke(Jt(Gt(G(), Je()), r, n), h); break; default: w += "/"; } break; // { case 123 * f: u[k++] = ee(w) * x; // } ; \0 case 125 * f: case 59: case 0: switch (b) { // \0 } case 0: case 125: g = 0; // ; case 59 + d: x == -1 && (w = P(w, /\f/g, "")), $ > 0 && ee(w) - p && Ke($ > 32 ? Fr(w + ";", a, n, p - 1) : Fr(P(w, " ", "") + ";", a, n, p - 2), h); break; // @ ; case 59: w += ";"; // { rule/at-rule default: if (Ke(S = Mr(w, r, n, k, d, o, u, T, v = [], O = [], p), i), b === 123) if (d === 0) Qe(w, r, S, S, v, i, p, u, O); else switch (_ === 99 && N(w, 3) === 110 ? 100 : _) { // d l m s case 100: case 108: case 109: case 115: Qe(e, S, S, a && Ke(Mr(e, S, S, 0, 0, o, u, T, o, v = [], p), O), o, O, p, u, a ? v : O); break; default: Qe(w, S, S, S, [""], O, 0, u, O); } } k = d = $ = 0, f = x = 1, T = w = "", p = c; break; // : case 58: p = 1 + ee(w), $ = C; default: if (f < 1) { if (b == 123) --f; else if (b == 125 && f++ == 0 && Ut() == 125) continue; } switch (w += tr(b), b * f) { // & case 38: x = d > 0 ? 1 : (w += "\f", -1); break; // , case 44: u[k++] = (ee(w) - 1) * x, x = 1; break; // @ case 64: te() === 45 && (w += Ze(G())), _ = te(), d = p = ee(T = w += Xt(Je())), b++; break; // - case 45: C === 45 && ee(w) == 2 && (f = 0); } } return i; } function Mr(e, r, n, a, o, i, c, u, h, k, d) { for (var p = o - 1, _ = o === 0 ? i : [""], $ = wr(_), C = 0, f = 0, g = 0; C < a; ++C) for (var x = 0, b = Me(e, p + 1, p = Dt(f = c[C])), T = e; x < $; ++x) (T = Kr(f > 0 ? _[x] + " " + b : P(b, /&\f/g, _[x]))) && (h[g++] = T); return ar(e, r, n, o === 0 ? yr : u, h, k, d); } function Jt(e, r, n) { return ar(e, r, n, Gr, tr(Bt()), Me(e, 2, -2), 0); } function Fr(e, r, n, a) { return ar(e, r, n, kr, Me(e, 0, a), Me(e, a + 1, -1), a); } function Re(e, r) { for (var n = "", a = wr(e), o = 0; o < a; o++) n += r(e[o], o, e, r) || ""; return n; } function Zt(e, r, n, a) { switch (e.type) { case zt: if (e.children.length) break; case Ft: case kr: return e.return = e.return || e.value; case Gr: return ""; case Xr: return e.return = e.value + "{" + Re(e.children, a) + "}"; case yr: e.value = e.props.join(","); } return ee(n = Re(e.children, a)) ? e.return = e.value + "{" + n + "}" : ""; } function Qt(e) { var r = wr(e); return function(n, a, o, i) { for (var c = "", u = 0; u < r; u++) c += e[u](n, a, o, i) || ""; return c; }; } function en(e) { return function(r) { r.root || (r = r.return) && e(r); }; } function et(e) { var r = /* @__PURE__ */ Object.create(null); return function(n) { return r[n] === void 0 && (r[n] = e(n)), r[n]; }; } var rn = function(r, n, a) { for (var o = 0, i = 0; o = i, i = te(), o === 38 && i === 12 && (n[a] = 1), !Fe(i); ) G(); return De(r, Y); }, tn = function(r, n) { var a = -1, o = 44; do switch (Fe(o)) { case 0: o === 38 && te() === 12 && (n[a] = 1), r[a] += rn(Y - 1, n, a); break; case 2: r[a] += Ze(o); break; case 4: if (o === 44) { r[++a] = te() === 58 ? "&\f" : "", n[a] = r[a].length; break; } // fallthrough default: r[a] += tr(o); } while (o = G()); return r; }, nn = function(r, n) { return Qr(tn(Zr(r), n)); }, zr = /* @__PURE__ */ new WeakMap(), an = function(r) { if (!(r.type !== "rule" || !r.parent || // positive .length indicates that this rule contains pseudo // negative .length indicates that this rule has been already prefixed r.length < 1)) { for (var n = r.value, a = r.parent, o = r.column === a.column && r.line === a.line; a.type !== "rule"; ) if (a = a.parent, !a) return; if (!(r.props.length === 1 && n.charCodeAt(0) !== 58 && !zr.get(a)) && !o) { zr.set(r, !0); for (var i = [], c = nn(n, i), u = a.props, h = 0, k = 0; h < c.length; h++) for (var d = 0; d < u.length; d++, k++) r.props[k] = i[h] ? c[h].replace(/&\f/g, u[d]) : u[d] + " " + c[h]; } } }, on = function(r) { if (r.type === "decl") { var n = r.value; // charcode for l n.charCodeAt(0) === 108 && // charcode for b n.charCodeAt(2) === 98 && (r.return = "", r.value = ""); } }; function rt(e, r) { switch (Nt(e, r)) { // color-adjust case 5103: return j + "print-" + e + e; // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: return j + e + e; // appearance, user-select, transform, hyphens, text-size-adjust case 5349: case 4246: case 4810: case 6968: case 2756: return j + e + er + e + H + e + e; // flex, flex-direction case 6828: case 4268: return j + e + H + e + e; // order case 6165: return j + e + H + "flex-" + e + e; // align-items case 5187: return j + e + P(e, /(\w+).+(:[^]+)/, j + "box-$1$2" + H + "flex-$1$2") + e; // align-self case 5443: return j + e + H + "flex-item-" + P(e, /flex-|-self/, "") + e; // align-content case 4675: return j + e + H + "flex-line-pack" + P(e, /align-content|flex-|-self/, "") + e; // flex-shrink case 5548: return j + e + H + P(e, "shrink", "negative") + e; // flex-basis case 5292: return j + e + H + P(e, "basis", "preferred-size") + e; // flex-grow case 6060: return j + "box-" + P(e, "-grow", "") + j + e + H + P(e, "grow", "positive") + e; // transition case 4554: return j + P(e, /([^-])(transform)/g, "$1" + j + "$2") + e; // cursor case 6187: return P(P(P(e, /(zoom-|grab)/, j + "$1"), /(image-set)/, j + "$1"), e, "") + e; // background, background-image case 5495: case 3959: return P(e, /(image-set\([^]*)/, j + "$1$`$1"); // justify-content case 4968: return P(P(e, /(.+:)(flex-)?(.*)/, j + "box-pack:$3" + H + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + j + e + e; // (margin|padding)-inline-(start|end) case 4095: case 3583: case 4068: case 2532: return P(e, /(.+)-inline(.+)/, j + "$1$2") + e; // (min|max)?(width|height|inline-size|block-size) case 8116: case 7059: case 5753: case 5535: case 5445: case 5701: case 4933: case 4677: case 5533: case 5789: case 5021: case 4765: if (ee(e) - 1 - r > 6) switch (N(e, r + 1)) { // (m)ax-content, (m)in-content case 109: if (N(e, r + 4) !== 45) break; // (f)ill-available, (f)it-content case 102: return P(e, /(.+:)(.+)-([^]+)/, "$1" + j + "$2-$3$1" + er + (N(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; // (s)tretch case 115: return ~br(e, "stretch") ? rt(P(e, "stretch", "fill-available"), r) + e : e; } break; // position: sticky case 4949: if (N(e, r + 1) !== 115) break; // display: (flex|inline-flex) case 6444: switch (N(e, ee(e) - 3 - (~br(e, "!important") && 10))) { // stic(k)y case 107: return P(e, ":", ":" + j) + e; // (inline-)?fl(e)x case 101: return P(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + j + (N(e, 14) === 45 ? "inline-" : "") + "box$3$1" + j + "$2$3$1" + H + "$2box$3") + e; } break; // writing-mode case 5936: switch (N(e, r + 11)) { // vertical-l(r) case 114: return j + e + H + P(e, /[svh]\w+-[tblr]{2}/, "tb") + e; // vertical-r(l) case 108: return j + e + H + P(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; // horizontal(-)tb case 45: return j + e + H + P(e, /[svh]\w+-[tblr]{2}/, "lr") + e; } return j + e + H + e + e; } return e; } var sn = function(r, n, a, o) { if (r.length > -1 && !r.return) switch (r.type) { case kr: r.return = rt(r.value, r.length); break; case Xr: return Re([$e(r, { value: P(r.value, "@", "@" + j) })], o); case yr: if (r.length) return Vt(r.props, function(i) { switch (Ht(i, /(::plac\w+|:read-\w+)/)) { // :read-(only|write) case ":read-only": case ":read-write": return Re([$e(r, { props: [P(i, /:(read-\w+)/, ":" + er + "$1")] })], o); // :placeholder case "::placeholder": return Re([$e(r, { props: [P(i, /:(plac\w+)/, ":" + j + "input-$1")] }), $e(r, { props: [P(i, /:(plac\w+)/, ":" + er + "$1")] }), $e(r, { props: [P(i, /:(plac\w+)/, H + "input-$1")] })], o); } return ""; }); } }, cn = [sn], ln = function(r) { var n = r.key; if (n === "css") { var a = document.querySelectorAll("style[data-emotion]:not([data-s])"); Array.prototype.forEach.call(a, function(f) { var g = f.getAttribute("data-emotion"); g.indexOf(" ") !== -1 && (document.head.appendChild(f), f.setAttribute("data-s", "")); }); } var o = r.stylisPlugins || cn, i = {}, c, u = []; c = r.container || document.head, Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which // means that the style elements we're looking at are only Emotion 11 server-rendered style elements document.querySelectorAll('style[data-emotion^="' + n + ' "]'), function(f) { for (var g = f.getAttribute("data-emotion").split(" "), x = 1; x < g.length; x++) i[g[x]] = !0; u.push(f); } ); var h, k = [an, on]; { var d, p = [Zt, en(function(f) { d.insert(f); })], _ = Qt(k.concat(o, p)), $ = function(g) { return Re(Kt(g), _); }; h = function(g, x, b, T) { d = b, $(g ? g + "{" + x.styles + "}" : x.styles), T && (C.inserted[x.name] = !0); }; } var C = { key: n, sheet: new Mt({ key: n, container: c, nonce: r.nonce, speedy: r.speedy, prepend: r.prepend, insertionPoint: r.insertionPoint }), nonce: r.nonce, inserted: i, registered: {}, insert: h }; return C.sheet.hydrate(u), C; }, un = !0; function fn(e, r, n) { var a = ""; return n.split(" ").forEach(function(o) { e[o] !== void 0 ? r.push(e[o] + ";") : o && (a += o + " "); }), a; } var tt = function(r, n, a) { var o = r.key + "-" + n.name; // we only need to add the styles to the registered cache if the // class name could be used further down // the tree but if it's a string tag, we know it won't // so we don't have to add it to registered cache. // this improves memory usage since we can avoid storing the whole style string (a === !1 || // we need to always store it if we're in compat mode and // in node since emotion-server relies on whether a style is in // the registered cache to know whether a style is global or not // also, note that this check will be dead code eliminated in the browser un === !1) && r.registered[o] === void 0 && (r.registered[o] = n.styles); }, dn = function(r, n, a) { tt(r, n, a); var o = r.key + "-" + n.name; if (r.inserted[n.name] === void 0) { var i = n; do r.insert(n === i ? "." + o : "", i, r.sheet, !0), i = i.next; while (i !== void 0); } }; function hn(e) { for (var r = 0, n, a = 0, o = e.length; o >= 4; ++a, o -= 4) n = e.charCodeAt(a) & 255 | (e.charCodeAt(++a) & 255) << 8 | (e.charCodeAt(++a) & 255) << 16 | (e.charCodeAt(++a) & 255) << 24, n = /* Math.imul(k, m): */ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */ n >>> 24, r = /* Math.imul(k, m): */ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16); switch (o) { case 3: r ^= (e.charCodeAt(a + 2) & 255) << 16; case 2: r ^= (e.charCodeAt(a + 1) & 255) << 8; case 1: r ^= e.charCodeAt(a) & 255, r = /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16); } return r ^= r >>> 13, r = /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), ((r ^ r >>> 15) >>> 0).toString(36); } var pn = { animationIterationCount: 1, aspectRatio: 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, scale: 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 }, mn = /[A-Z]|^ms/g, gn = /_EMO_([^_]+?)_([^]*?)_EMO_/g, nt = function(r) { return r.charCodeAt(1) === 45; }, Dr = function(r) { return r != null && typeof r != "boolean"; }, mr = /* @__PURE__ */ et(function(e) { return nt(e) ? e : e.replace(mn, "-$&").toLowerCase(); }), Lr = function(r, n) { switch (r) { case "animation": case "animationName": if (typeof n == "string") return n.replace(gn, function(a, o, i) { return re = { name: o, styles: i, next: re }, o; }); } return pn[r] !== 1 && !nt(r) && typeof n == "number" && n !== 0 ? n + "px" : n; }; function ze(e, r, n) { if (n == null) return ""; var a = n; if (a.__emotion_styles !== void 0) return a; switch (typeof n) { case "boolean": return ""; case "object": { var o = n; if (o.anim === 1) return re = { name: o.name, styles: o.styles, next: re }, o.name; var i = n; if (i.styles !== void 0) { var c = i.next; if (c !== void 0) for (; c !== void 0; ) re = { name: c.name, styles: c.styles, next: re }, c = c.next; var u = i.styles + ";"; return u; } return bn(e, r, n); } case "function": { if (e !== void 0) { var h = re, k = n(e); return re = h, ze(e, r, k); } break; } } var d = n; if (r == null) return d; var p = r[d]; return p !== void 0 ? p : d; } function bn(e, r, n) { var a = ""; if (Array.isArray(n)) for (var o = 0; o < n.length; o++) a += ze(e, r, n[o]) + ";"; else for (var i in n) { var c = n[i]; if (typeof c != "object") { var u = c; r != null && r[u] !== void 0 ? a += i + "{" + r[u] + "}" : Dr(u) && (a += mr(i) + ":" + Lr(i, u) + ";"); } else if (Array.isArray(c) && typeof c[0] == "string" && (r == null || r[c[0]] === void 0)) for (var h = 0; h < c.length; h++) Dr(c[h]) && (a += mr(i) + ":" + Lr(i, c[h]) + ";"); else { var k = ze(e, r, c); switch (i) { case "animation": case "animationName": { a += mr(i) + ":" + k + ";"; break; } default: a += i + "{" + k + "}"; } } } return a; } var Nr = /label:\s*([^\s;{]+)\s*(;|$)/g, re; function vn(e, r, n) { if (e.length === 1 && typeof e[0] == "object" && e[0] !== null && e[0].styles !== void 0) return e[0]; var a = !0, o = ""; re = void 0; var i = e[0]; if (i == null || i.raw === void 0) a = !1, o += ze(n, r, i); else { var c = i; o += c[0]; } for (var u = 1; u < e.length; u++) if (o += ze(n, r, e[u]), a) { var h = i; o += h[u]; } Nr.lastIndex = 0; for (var k = "", d; (d = Nr.exec(o)) !== null; ) k += "-" + d[1]; var p = hn(o) + k; return { name: p, styles: o, next: re }; } var xn = function(r) { return r(); }, yn = ae.useInsertionEffect ? ae.useInsertionEffect : !1, kn = yn || xn, at = /* @__PURE__ */ ae.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement < "u" ? /* @__PURE__ */ ln({ key: "css" }) : null ); at.Provider; var wn = function(r) { return /* @__PURE__ */ Et(function(n, a) { var o = _t(at); return r(n, o, a); }); }, Cn = /* @__PURE__ */ ae.createContext({}), Sn = /^((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|contr