UNPKG

@astropay/payments-lib

Version:

Official AstroPay payments library for web and mobile.

1,598 lines 1.4 MB
var Ma = Object.defineProperty; var Ua = (ee, re, te) => re in ee ? Ma(ee, re, { enumerable: !0, configurable: !0, writable: !0, value: te }) : ee[re] = te; var Ie = (ee, re, te) => Ua(ee, typeof re != "symbol" ? re + "" : re, te); const FONT_SIZES = { xxsm: 10, xsm: 12, sm: 14, base: 16, md: 20, lg: 26, xl: 32, xxl: 40 }, FONT_SIZE_MAP = { sm: { xSmall: FONT_SIZES.xxsm, small: FONT_SIZES.xsm, medium: FONT_SIZES.sm, base: FONT_SIZES.base, large: FONT_SIZES.md, xLarge: FONT_SIZES.lg }, md: { xSmall: FONT_SIZES.xsm, small: FONT_SIZES.sm, medium: FONT_SIZES.base, base: FONT_SIZES.md, large: FONT_SIZES.lg, xLarge: FONT_SIZES.xl }, lg: { xSmall: FONT_SIZES.sm, small: FONT_SIZES.base, medium: FONT_SIZES.md, base: FONT_SIZES.lg, large: FONT_SIZES.xl, xLarge: FONT_SIZES.xxl } }, DEFAULT_COLORS = { transparent: "transparent", surface_dark: "#041311", surface_light: "#FFFFFF", neutral_lightest: "#FFFFFF", neutral_light: "#F3F6F6", neutral_lighter: "#ECF1F0", neutral_base: "#B4C5C3", neutral_darker: "#7C9995", neutral_dark: "#536663", neutral_darkest: "#151E1D", primary_lightest: "#DBFFFB", primary_light: "#AAF6EC", primary_base: "#00DBBF", primary_darker: "#0FC3AC", primary_dark: "#059986", primary_darkest: "#07544A", warning_lightest: "#FFF7DB", warning_light: "#FFEBA8", warning_darker: "#DBA800", warning_darkest: "#755A00", error_lightest: "#FFDCD6", error_light: "#FFB0A3", error_lighter: "#FF8470", error_base: "#FF2C0A", error_darker: "#D61D00", error_dark: "#A31600", error_darkest: "#700F00", success_lightest: "#F0FAEB", success_light: "#D3EFC2", success_base: "#7CD049", success_darker: "#62B52F", success_dark: "#4D8E25", success_darkest: "#37651A" }, DEFAULT_FONTS = { poppins: "Poppins" }, loadFonts = async () => { try { const ee = document.createElement("link"); ee.href = "https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap", ee.rel = "stylesheet", document.head.appendChild(ee), await document.fonts.ready; } catch (ee) { console.error("Font loading failed:", ee); } }, DARK_THEME = { backgroundColor: DEFAULT_COLORS.surface_dark, fontFamily: DEFAULT_FONTS.poppins, textColor: DEFAULT_COLORS.neutral_light, fontScale: FONT_SIZE_MAP.md, primaryColor: DEFAULT_COLORS.primary_base, secondaryColor: DEFAULT_COLORS.primary_darkest, textPrimaryColor: DEFAULT_COLORS.neutral_lightest, textSecondaryColor: DEFAULT_COLORS.neutral_base, width: "100%", paddingWrapper: "12px", borderRadiusWrapper: "4px", messages: { success: { textColor: DEFAULT_COLORS.success_base }, error: { textColor: DEFAULT_COLORS.error_lighter } }, input: { normal: { textColor: DEFAULT_COLORS.neutral_lightest, backgroundColor: DEFAULT_COLORS.neutral_darkest, hintTextColor: DEFAULT_COLORS.neutral_darker, placeholderTextColor: DEFAULT_COLORS.neutral_dark, borderColor: DEFAULT_COLORS.transparent, borderRadius: 8, borderWidth: 3 }, focus: { textColor: DEFAULT_COLORS.neutral_lightest, backgroundColor: DEFAULT_COLORS.neutral_darkest, hintTextColor: DEFAULT_COLORS.neutral_darker, placeholderTextColor: DEFAULT_COLORS.neutral_darker, borderColor: DEFAULT_COLORS.primary_base, borderRadius: 8, borderWidth: 3 }, disabled: { textColor: DEFAULT_COLORS.neutral_darker, backgroundColor: DEFAULT_COLORS.neutral_dark, hintTextColor: DEFAULT_COLORS.neutral_darker, placeholderTextColor: DEFAULT_COLORS.neutral_base, borderColor: DEFAULT_COLORS.neutral_dark, borderRadius: 8, borderWidth: 3 }, error: { textColor: DEFAULT_COLORS.neutral_lightest, backgroundColor: DEFAULT_COLORS.neutral_darkest, hintTextColor: DEFAULT_COLORS.error_base, placeholderTextColor: DEFAULT_COLORS.neutral_darker, borderColor: DEFAULT_COLORS.error_base, borderRadius: 8, borderWidth: 3 } }, button: { small: { borderRadius: 4 }, medium: { borderRadius: 8 }, large: { borderRadius: 8 }, primary: { textColor: DEFAULT_COLORS.neutral_lightest, backgroundColor: DEFAULT_COLORS.primary_base, borderColor: DEFAULT_COLORS.transparent, borderWidth: 0 }, secondary: { textColor: DEFAULT_COLORS.primary_lightest, backgroundColor: DEFAULT_COLORS.primary_darkest, borderColor: DEFAULT_COLORS.transparent, borderWidth: 0 }, text: { textColor: DEFAULT_COLORS.primary_base, backgroundColor: "unset", borderColor: DEFAULT_COLORS.primary_base, borderWidth: 1 }, disabled: { textColor: DEFAULT_COLORS.neutral_dark, backgroundColor: DEFAULT_COLORS.neutral_base, borderColor: DEFAULT_COLORS.transparent, borderWidth: 0 } }, divider: { color: DEFAULT_COLORS.neutral_darker, variant: "dashed", size: 1 }, card: { padding: 12, backgroundColor: DEFAULT_COLORS.neutral_darkest, borderWidth: 0, borderStyle: "none", borderColor: DEFAULT_COLORS.transparent, borderRadius: 16 }, qrCode: { padding: 16, backgroundColor: DEFAULT_COLORS.neutral_darkest, borderWidth: 1, borderStyle: "solid", borderColor: DEFAULT_COLORS.primary_base, borderRadius: 16 }, badge: { default: { padding: "2px 6px", textColor: DEFAULT_COLORS.neutral_light, backgroundColor: DEFAULT_COLORS.neutral_dark, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 }, highlight: { padding: "2px 6px", textColor: DEFAULT_COLORS.primary_light, backgroundColor: DEFAULT_COLORS.primary_darkest, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 }, error: { padding: "2px 6px", textColor: DEFAULT_COLORS.error_light, backgroundColor: DEFAULT_COLORS.error_darkest, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 }, success: { padding: "2px 6px", textColor: DEFAULT_COLORS.success_light, backgroundColor: DEFAULT_COLORS.success_darkest, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 }, warning: { padding: "2px 6px", textColor: DEFAULT_COLORS.warning_light, backgroundColor: DEFAULT_COLORS.warning_darkest, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 } }, timer: { padding: "4px 8px", textColor: DEFAULT_COLORS.error_lightest, backgroundColor: DEFAULT_COLORS.warning_darkest, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 12 }, cardTabs: { activeTextColor: DEFAULT_COLORS.neutral_lightest, inactiveTextColor: DEFAULT_COLORS.neutral_base, indicatorColor: DEFAULT_COLORS.neutral_lightest, borderColor: DEFAULT_COLORS.neutral_darker }, cardTabsSegmented: { trackBackgroundColor: DEFAULT_COLORS.neutral_base, trackBorderRadius: 12, activeBackgroundColor: DEFAULT_COLORS.surface_dark, activeTextColor: DEFAULT_COLORS.neutral_lightest, inactiveTextColor: DEFAULT_COLORS.neutral_dark, itemBorderRadius: 10 }, savedCardSelector: { row: { borderColor: DEFAULT_COLORS.neutral_darker, borderWidth: 1, borderRadius: 12 }, radio: { color: DEFAULT_COLORS.neutral_darker, activeColor: DEFAULT_COLORS.neutral_light }, cardNumber: { textColor: DEFAULT_COLORS.neutral_light }, cardMeta: { textColor: DEFAULT_COLORS.neutral_base }, deleteButton: { color: DEFAULT_COLORS.neutral_base, hoverColor: DEFAULT_COLORS.error_light, hoverBackgroundColor: DEFAULT_COLORS.error_darkest, confirmBackground: DEFAULT_COLORS.error_dark, confirmTextColor: DEFAULT_COLORS.neutral_lightest, confirmActionBackground: DEFAULT_COLORS.neutral_lightest, confirmActionColor: DEFAULT_COLORS.error_dark, confirmCancelColor: DEFAULT_COLORS.neutral_lightest, confirmCancelHoverBackground: DEFAULT_COLORS.error_darkest, confirmCancelHoverColor: DEFAULT_COLORS.neutral_lightest }, panel: { borderColor: DEFAULT_COLORS.transparent } }, checkbox: { box: { borderColor: DEFAULT_COLORS.neutral_darker, size: 22, borderRadius: 7 }, check: { iconColor: DEFAULT_COLORS.neutral_lightest } }, // AstroPay styles apFontFamily: DEFAULT_FONTS.poppins, apPrimaryColor: DEFAULT_COLORS.primary_base, apButtonPrimaryBgColor: DEFAULT_COLORS.primary_base, apButtonPrimaryTxtColor: DEFAULT_COLORS.neutral_darkest, apButtonSecondaryBgColor: DEFAULT_COLORS.primary_darkest, apButtonSecondaryTxtColor: DEFAULT_COLORS.primary_base, apButtonTextTxtColor: DEFAULT_COLORS.primary_base, apButtonDisableBgColor: DEFAULT_COLORS.neutral_base, apButtonDisableTextColor: DEFAULT_COLORS.neutral_dark }, LIGHT_THEME = { backgroundColor: DEFAULT_COLORS.surface_light, fontFamily: DEFAULT_FONTS.poppins, textColor: DEFAULT_COLORS.neutral_darkest, fontScale: FONT_SIZE_MAP.md, primaryColor: DEFAULT_COLORS.primary_base, secondaryColor: DEFAULT_COLORS.primary_lightest, textPrimaryColor: DEFAULT_COLORS.neutral_darkest, textSecondaryColor: DEFAULT_COLORS.neutral_dark, width: "100%", paddingWrapper: "12px", borderRadiusWrapper: "4px", messages: { success: { textColor: DEFAULT_COLORS.success_darker }, error: { textColor: DEFAULT_COLORS.error_dark } }, input: { normal: { textColor: DEFAULT_COLORS.neutral_darkest, backgroundColor: DEFAULT_COLORS.neutral_lighter, hintTextColor: DEFAULT_COLORS.neutral_dark, placeholderTextColor: DEFAULT_COLORS.neutral_dark, borderColor: DEFAULT_COLORS.transparent, borderRadius: 8, borderWidth: 3 }, focus: { textColor: DEFAULT_COLORS.neutral_darkest, backgroundColor: DEFAULT_COLORS.neutral_lighter, hintTextColor: DEFAULT_COLORS.neutral_dark, placeholderTextColor: DEFAULT_COLORS.neutral_dark, borderColor: DEFAULT_COLORS.primary_base, borderRadius: 8, borderWidth: 3 }, disabled: { textColor: DEFAULT_COLORS.neutral_dark, backgroundColor: DEFAULT_COLORS.neutral_base, hintTextColor: DEFAULT_COLORS.neutral_dark, placeholderTextColor: DEFAULT_COLORS.neutral_darker, borderColor: DEFAULT_COLORS.neutral_base, borderRadius: 8, borderWidth: 3 }, error: { textColor: DEFAULT_COLORS.neutral_darkest, backgroundColor: DEFAULT_COLORS.neutral_lighter, hintTextColor: DEFAULT_COLORS.error_dark, placeholderTextColor: DEFAULT_COLORS.neutral_dark, borderColor: DEFAULT_COLORS.error_dark, borderRadius: 8, borderWidth: 3 } }, button: { small: { borderRadius: 4 }, medium: { borderRadius: 8 }, large: { borderRadius: 8 }, primary: { textColor: DEFAULT_COLORS.neutral_darkest, backgroundColor: DEFAULT_COLORS.primary_base, borderColor: DEFAULT_COLORS.transparent, borderWidth: 0 }, secondary: { textColor: DEFAULT_COLORS.primary_darker, backgroundColor: DEFAULT_COLORS.primary_lightest, borderColor: DEFAULT_COLORS.transparent, borderWidth: 0 }, text: { textColor: DEFAULT_COLORS.primary_base, backgroundColor: "unset", borderColor: DEFAULT_COLORS.primary_base, borderWidth: 1 }, disabled: { textColor: DEFAULT_COLORS.neutral_dark, backgroundColor: DEFAULT_COLORS.neutral_base, borderColor: DEFAULT_COLORS.transparent, borderWidth: 0 } }, divider: { color: DEFAULT_COLORS.neutral_base, variant: "dashed", size: 1 }, card: { padding: 12, backgroundColor: DEFAULT_COLORS.neutral_light, borderWidth: 0, borderStyle: "none", borderColor: DEFAULT_COLORS.transparent, borderRadius: 16 }, qrCode: { padding: 16, backgroundColor: DEFAULT_COLORS.neutral_lightest, borderWidth: 1, borderStyle: "solid", borderColor: DEFAULT_COLORS.primary_base, borderRadius: 16 }, badge: { default: { padding: "2px 6px", textColor: DEFAULT_COLORS.neutral_dark, backgroundColor: DEFAULT_COLORS.neutral_light, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 }, highlight: { padding: "2px 6px", textColor: DEFAULT_COLORS.primary_dark, backgroundColor: DEFAULT_COLORS.primary_lightest, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 }, error: { padding: "2px 6px", textColor: DEFAULT_COLORS.error_dark, backgroundColor: DEFAULT_COLORS.error_lightest, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 }, success: { padding: "2px 6px", textColor: DEFAULT_COLORS.success_dark, backgroundColor: DEFAULT_COLORS.success_lightest, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 }, warning: { padding: "2px 6px", textColor: DEFAULT_COLORS.warning_darker, backgroundColor: DEFAULT_COLORS.warning_lightest, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 4 } }, timer: { padding: "4px 8px", textColor: DEFAULT_COLORS.error_dark, backgroundColor: DEFAULT_COLORS.warning_light, borderWidth: 0, borderStyle: "none", borderColor: "unset", borderRadius: 12 }, cardTabs: { activeTextColor: DEFAULT_COLORS.neutral_darkest, inactiveTextColor: DEFAULT_COLORS.neutral_dark, indicatorColor: DEFAULT_COLORS.neutral_darkest, borderColor: DEFAULT_COLORS.neutral_base }, cardTabsSegmented: { trackBackgroundColor: DEFAULT_COLORS.neutral_base, trackBorderRadius: 12, activeBackgroundColor: DEFAULT_COLORS.surface_light, activeTextColor: DEFAULT_COLORS.neutral_darkest, inactiveTextColor: DEFAULT_COLORS.neutral_dark, itemBorderRadius: 10 }, savedCardSelector: { row: { borderColor: DEFAULT_COLORS.neutral_base, borderWidth: 1, borderRadius: 12 }, radio: { color: DEFAULT_COLORS.neutral_base, activeColor: DEFAULT_COLORS.neutral_darkest }, cardNumber: { textColor: DEFAULT_COLORS.neutral_darkest }, cardMeta: { textColor: DEFAULT_COLORS.neutral_dark }, deleteButton: { color: DEFAULT_COLORS.neutral_dark, hoverColor: DEFAULT_COLORS.error_dark, hoverBackgroundColor: DEFAULT_COLORS.error_lightest, confirmBackground: DEFAULT_COLORS.error_darker, confirmTextColor: DEFAULT_COLORS.neutral_lightest, confirmActionBackground: DEFAULT_COLORS.neutral_lightest, confirmActionColor: DEFAULT_COLORS.error_darker, confirmCancelColor: DEFAULT_COLORS.neutral_lightest, confirmCancelHoverBackground: DEFAULT_COLORS.error_dark, confirmCancelHoverColor: DEFAULT_COLORS.neutral_lightest }, panel: { borderColor: DEFAULT_COLORS.transparent } }, checkbox: { box: { borderColor: DEFAULT_COLORS.neutral_base, size: 22, borderRadius: 7 }, check: { iconColor: DEFAULT_COLORS.neutral_lightest } }, // AstroPay styles apFontFamily: DEFAULT_FONTS.poppins, apPrimaryColor: DEFAULT_COLORS.primary_base, apButtonPrimaryBgColor: DEFAULT_COLORS.primary_base, apButtonPrimaryTxtColor: DEFAULT_COLORS.neutral_darkest, apButtonSecondaryBgColor: DEFAULT_COLORS.primary_lightest, apButtonSecondaryTxtColor: DEFAULT_COLORS.primary_dark, apButtonTextTxtColor: DEFAULT_COLORS.primary_dark, apButtonDisableBgColor: DEFAULT_COLORS.neutral_base, apButtonDisableTextColor: DEFAULT_COLORS.neutral_dark }, CONFIG_ENVIRONMENT_VALUES = ["production", "sandbox"], CONFIG_THEME_VALUES = ["light", "dark"], CONFIG_LANGUAGE_VALUES = ["en", "pt", "es"], CONFIG_CURRENCY_MODE_VALUES = ["iso", "symbol"], CONFIG_FONT_SCALE_VALUES = ["sm", "md", "lg"], copyToClipboard = async (ee) => navigator.clipboard && window.isSecureContext ? navigator.clipboard.writeText(ee).catch((re) => { console.error("Error to copy:", re); }) : new Promise((re, te) => { const ne = document.createElement("textarea"); ne.value = ee, ne.style.position = "fixed", document.body.appendChild(ne), ne.focus(), ne.select(); try { document.execCommand("copy") ? re() : te(new Error("Failed to copy text using execCommand")); } catch (ie) { te(ie); } finally { document.body.removeChild(ne); } }), shareInfo = async (ee, re, te) => { if (navigator.share) try { const ne = { title: ee, text: re, ...te && { url: te } }; await navigator.share(ne); } catch (ne) { console.error("Failed to share information:", ne); } else { console.warn("Web Share API not supported"); const ne = `${ee} ${re}${te ? ` ${te}` : ""}`; await copyToClipboard(ne); } }; function validateValue(ee, re, te) { return re.includes(ee) ? ee : te; } const NON_BREAKING_SPACE = " ", toCamelCase$1 = (ee) => ee.toLowerCase().replace( /(?:^|[^a-zA-Z0-9]+)([a-zA-Z0-9])/g, (re, te, ne) => ne === 0 ? te.toLowerCase() : te.toUpperCase() ), toSnakeCase = (ee) => ee.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[^a-zA-Z0-9]+/g, "_").toLowerCase(), encodeData = (ee) => { const re = JSON.stringify(ee); return btoa(re); }, applyMask = (ee, re) => { if (!re) return ee; const te = re.split(""), ne = ee.replace(/[^A-Za-z0-9]/g, ""); let ie = "", oe = 0, se = !1; for (const ae of te) { if (se) { ie += ae, se = !1; continue; } if (ae === "\\") { se = !0; continue; } if (oe >= ne.length) break; switch (ae) { case "#": if (/\d/.test(ne[oe])) ie += ne[oe++]; else { oe++; continue; } break; case "A": if (/[A-Za-z]/.test(ne[oe])) ie += ne[oe++]; else { oe++; continue; } break; case "*": if (/[A-Za-z0-9]/.test(ne[oe])) ie += ne[oe++]; else { oe++; continue; } break; default: ie += ae, ne[oe] === ae && oe++; break; } } return ie; }, removeMask = (ee, re) => { if (!re) return ee; const te = re.split(""), ne = ee.split(""); let ie = "", oe = !1, se = 0; for (const ae of te) { if (oe) { oe = !1, ne[se] === ae && se++; continue; } if (ae === "\\") { oe = !0; continue; } if (se >= ne.length) break; switch (ae) { case "#": /\d/.test(ne[se]) && (ie += ne[se]), se++; break; case "A": /[A-Za-z]/.test(ne[se]) && (ie += ne[se]), se++; break; case "*": /[A-Za-z0-9]/.test(ne[se]) && (ie += ne[se]), se++; break; default: ne[se] === ae && se++; break; } } return ie; }, uuid = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (ee) => { const re = Math.random() * 16 | 0; return (ee === "x" ? re : re & 3 || 8).toString(16); }), formatPhoneNumber = (ee) => ee ? ee.startsWith("+") ? ee : `+${ee}` : "", isArray$3 = Array.isArray, isObject$1 = (ee) => ee !== null && typeof ee == "object" && !isArray$3(ee), snakeCaseToCamelCaseObject = (ee) => Object.entries(ee).reduce( (re, [te, ne]) => ({ ...re, [toCamelCase$1(te)]: isObject$1(ne) ? snakeCaseToCamelCaseObject(ne) : isArray$3(ne) ? ne.map((ie) => isObject$1(ie) ? snakeCaseToCamelCaseObject(ie) : ie) : ne }), {} ), snakeCaseToCamelCaseArray = (ee) => { if (isArray$3(ee)) return ee.map((re) => isObject$1(re) ? snakeCaseToCamelCaseObject(re) : re); throw new Error("Input is not an array"); }, camelCaseToSnakeCaseObject = (ee) => Object.entries(ee).reduce( (re, [te, ne]) => ({ ...re, [toSnakeCase(te)]: isObject$1(ne) ? camelCaseToSnakeCaseObject(ne) : isArray$3(ne) ? ne.map((ie) => isObject$1(ie) ? camelCaseToSnakeCaseObject(ie) : ie) : ne }), {} ), camelCaseToSnakeCaseArray = (ee) => { if (isArray$3(ee)) return ee.map((re) => isObject$1(re) ? camelCaseToSnakeCaseObject(re) : re); throw new Error("Input is not an array"); }, convertData = (ee, re) => isArray$3(ee) ? re === "snake_case-to-camelCase" ? snakeCaseToCamelCaseArray(ee) : camelCaseToSnakeCaseArray(ee) : isObject$1(ee) ? re === "snake_case-to-camelCase" ? snakeCaseToCamelCaseObject(ee) : camelCaseToSnakeCaseObject(ee) : ee, deepMerge = (ee, re) => { if (!re) return ee; const te = { ...ee }; for (const ne in re) if (Object.prototype.hasOwnProperty.call(re, ne)) { const ie = re[ne], oe = ee[ne]; isObject$1(ie) && isObject$1(oe) ? te[ne] = deepMerge(oe, ie) : ie !== void 0 && (te[ne] = ie); } return te; }, defaultThemes = { light: LIGHT_THEME, dark: DARK_THEME }, Li = class Li { static init(re) { const te = validateValue(re == null ? void 0 : re.theme, CONFIG_THEME_VALUES, "light"); Li.currentTheme = te; const ne = Li.processStyles(re == null ? void 0 : re.styles); Li.styles = deepMerge(defaultThemes[te], ne); } static getStyles() { return Li.styles; } static getTheme() { return Li.currentTheme; } static getFontScale() { return this.getStyles().fontScale; } // #region auxiliary methods static processStyles(re) { if (!re) return; const te = { ...re }; return typeof re.fontScale == "string" && CONFIG_FONT_SCALE_VALUES.includes(re.fontScale) && (te.fontScale = FONT_SIZE_MAP[re.fontScale]), te; } // #endregion }; Ie(Li, "currentTheme", "light"), Ie(Li, "styles", LIGHT_THEME); let ThemeManager = Li; class Component { constructor({ tag: re, elementId: te, styles: ne }) { Ie(this, "element"); if (this.element = document.createElement(re), te && this.element.setAttribute("id", te), ne) { const ie = ThemeManager.getStyles(), oe = ne(ie); this.element.className = oe; } } addStyleClass(re) { this.element.classList.add(re); } render(re) { re instanceof Component ? re.element.appendChild(this.element) : re.appendChild(this.element); } destroy() { this.element.parentElement && this.element.parentElement.removeChild(this.element); } } function sheetForTag(ee) { if (ee.sheet) return ee.sheet; for (var re = 0; re < document.styleSheets.length; re++) if (document.styleSheets[re].ownerNode === ee) return document.styleSheets[re]; } function createStyleElement(ee) { var re = document.createElement("style"); return re.setAttribute("data-emotion", ee.key), ee.nonce !== void 0 && re.setAttribute("nonce", ee.nonce), re.appendChild(document.createTextNode("")), re.setAttribute("data-s", ""), re; } var StyleSheet = /* @__PURE__ */ (function() { function ee(te) { var ne = this; this._insertTag = function(ie) { var oe; ne.tags.length === 0 ? ne.insertionPoint ? oe = ne.insertionPoint.nextSibling : ne.prepend ? oe = ne.container.firstChild : oe = ne.before : oe = ne.tags[ne.tags.length - 1].nextSibling, ne.container.insertBefore(ie, oe), ne.tags.push(ie); }, this.isSpeedy = te.speedy === void 0 ? !0 : te.speedy, this.tags = [], this.ctr = 0, this.nonce = te.nonce, this.key = te.key, this.container = te.container, this.prepend = te.prepend, this.insertionPoint = te.insertionPoint, this.before = null; } var re = ee.prototype; return re.hydrate = function(ne) { ne.forEach(this._insertTag); }, re.insert = function(ne) { this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(createStyleElement(this)); var ie = this.tags[this.tags.length - 1]; if (this.isSpeedy) { var oe = sheetForTag(ie); try { oe.insertRule(ne, oe.cssRules.length); } catch { } } else ie.appendChild(document.createTextNode(ne)); this.ctr++; }, re.flush = function() { this.tags.forEach(function(ne) { var ie; return (ie = ne.parentNode) == null ? void 0 : ie.removeChild(ne); }), this.tags = [], this.ctr = 0; }, ee; })(), MS = "-ms-", MOZ = "-moz-", WEBKIT = "-webkit-", COMMENT = "comm", RULESET = "rule", DECLARATION = "decl", IMPORT = "@import", KEYFRAMES = "@keyframes", LAYER = "@layer", abs = Math.abs, from$1 = String.fromCharCode, assign = Object.assign; function hash(ee, re) { return charat(ee, 0) ^ 45 ? (((re << 2 ^ charat(ee, 0)) << 2 ^ charat(ee, 1)) << 2 ^ charat(ee, 2)) << 2 ^ charat(ee, 3) : 0; } function trim$1(ee) { return ee.trim(); } function match(ee, re) { return (ee = re.exec(ee)) ? ee[0] : ee; } function replace(ee, re, te) { return ee.replace(re, te); } function indexof(ee, re) { return ee.indexOf(re); } function charat(ee, re) { return ee.charCodeAt(re) | 0; } function substr(ee, re, te) { return ee.slice(re, te); } function strlen(ee) { return ee.length; } function sizeof(ee) { return ee.length; } function append(ee, re) { return re.push(ee), ee; } function combine$1(ee, re) { return ee.map(re).join(""); } var line = 1, column = 1, length = 0, position = 0, character = 0, characters = ""; function node(ee, re, te, ne, ie, oe, se) { return { value: ee, root: re, parent: te, type: ne, props: ie, children: oe, line, column, length: se, return: "" }; } function copy$1(ee, re) { return assign(node("", null, null, "", null, null, 0), ee, { length: -ee.length }, re); } function char() { return character; } function prev() { return character = position > 0 ? charat(characters, --position) : 0, column--, character === 10 && (column = 1, line--), character; } function next$1() { return character = position < length ? charat(characters, position++) : 0, column++, character === 10 && (column = 1, line++), character; } function peek() { return charat(characters, position); } function caret() { return position; } function slice(ee, re) { return substr(characters, ee, re); } function token(ee) { switch (ee) { // \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 alloc(ee) { return line = column = 1, length = strlen(characters = ee), position = 0, []; } function dealloc(ee) { return characters = "", ee; } function delimit(ee) { return trim$1(slice(position - 1, delimiter(ee === 91 ? ee + 2 : ee === 40 ? ee + 1 : ee))); } function whitespace(ee) { for (; (character = peek()) && character < 33; ) next$1(); return token(ee) > 2 || token(character) > 3 ? "" : " "; } function escaping(ee, re) { for (; --re && next$1() && !(character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97); ) ; return slice(ee, caret() + (re < 6 && peek() == 32 && next$1() == 32)); } function delimiter(ee) { for (; next$1(); ) switch (character) { // ] ) " ' case ee: return position; // " ' case 34: case 39: ee !== 34 && ee !== 39 && delimiter(character); break; // ( case 40: ee === 41 && delimiter(ee); break; // \ case 92: next$1(); break; } return position; } function commenter(ee, re) { for (; next$1() && ee + character !== 57; ) if (ee + character === 84 && peek() === 47) break; return "/*" + slice(re, position - 1) + "*" + from$1(ee === 47 ? ee : next$1()); } function identifier(ee) { for (; !token(peek()); ) next$1(); return slice(ee, position); } function compile(ee) { return dealloc(parse("", null, null, null, [""], ee = alloc(ee), 0, [0], ee)); } function parse(ee, re, te, ne, ie, oe, se, ae, ce) { for (var ue = 0, le = 0, de = se, fe = 0, he = 0, pe = 0, ge = 1, me = 1, ye = 1, ve = 0, be = "", _e = ie, Te = oe, Ce = ne, Se = be; me; ) switch (pe = ve, ve = next$1()) { // ( case 40: if (pe != 108 && charat(Se, de - 1) == 58) { indexof(Se += replace(delimit(ve), "&", "&\f"), "&\f") != -1 && (ye = -1); break; } // " ' [ case 34: case 39: case 91: Se += delimit(ve); break; // \t \n \r \s case 9: case 10: case 13: case 32: Se += whitespace(pe); break; // \ case 92: Se += escaping(caret() - 1, 7); continue; // / case 47: switch (peek()) { case 42: case 47: append(comment(commenter(next$1(), caret()), re, te), ce); break; default: Se += "/"; } break; // { case 123 * ge: ae[ue++] = strlen(Se) * ye; // } ; \0 case 125 * ge: case 59: case 0: switch (ve) { // \0 } case 0: case 125: me = 0; // ; case 59 + le: ye == -1 && (Se = replace(Se, /\f/g, "")), he > 0 && strlen(Se) - de && append(he > 32 ? declaration(Se + ";", ne, te, de - 1) : declaration(replace(Se, " ", "") + ";", ne, te, de - 2), ce); break; // @ ; case 59: Se += ";"; // { rule/at-rule default: if (append(Ce = ruleset(Se, re, te, ue, le, ie, ae, be, _e = [], Te = [], de), oe), ve === 123) if (le === 0) parse(Se, re, Ce, Ce, _e, oe, de, ae, Te); else switch (fe === 99 && charat(Se, 3) === 110 ? 100 : fe) { // d l m s case 100: case 108: case 109: case 115: parse(ee, Ce, Ce, ne && append(ruleset(ee, Ce, Ce, 0, 0, ie, ae, be, ie, _e = [], de), Te), ie, Te, de, ae, ne ? _e : Te); break; default: parse(Se, Ce, Ce, Ce, [""], Te, 0, ae, Te); } } ue = le = he = 0, ge = ye = 1, be = Se = "", de = se; break; // : case 58: de = 1 + strlen(Se), he = pe; default: if (ge < 1) { if (ve == 123) --ge; else if (ve == 125 && ge++ == 0 && prev() == 125) continue; } switch (Se += from$1(ve), ve * ge) { // & case 38: ye = le > 0 ? 1 : (Se += "\f", -1); break; // , case 44: ae[ue++] = (strlen(Se) - 1) * ye, ye = 1; break; // @ case 64: peek() === 45 && (Se += delimit(next$1())), fe = peek(), le = de = strlen(be = Se += identifier(caret())), ve++; break; // - case 45: pe === 45 && strlen(Se) == 2 && (ge = 0); } } return oe; } function ruleset(ee, re, te, ne, ie, oe, se, ae, ce, ue, le) { for (var de = ie - 1, fe = ie === 0 ? oe : [""], he = sizeof(fe), pe = 0, ge = 0, me = 0; pe < ne; ++pe) for (var ye = 0, ve = substr(ee, de + 1, de = abs(ge = se[pe])), be = ee; ye < he; ++ye) (be = trim$1(ge > 0 ? fe[ye] + " " + ve : replace(ve, /&\f/g, fe[ye]))) && (ce[me++] = be); return node(ee, re, te, ie === 0 ? RULESET : ae, ce, ue, le); } function comment(ee, re, te) { return node(ee, re, te, COMMENT, from$1(char()), substr(ee, 2, -2), 0); } function declaration(ee, re, te, ne) { return node(ee, re, te, DECLARATION, substr(ee, 0, ne), substr(ee, ne + 1, -1), ne); } function serialize(ee, re) { for (var te = "", ne = sizeof(ee), ie = 0; ie < ne; ie++) te += re(ee[ie], ie, ee, re) || ""; return te; } function stringify(ee, re, te, ne) { switch (ee.type) { case LAYER: if (ee.children.length) break; case IMPORT: case DECLARATION: return ee.return = ee.return || ee.value; case COMMENT: return ""; case KEYFRAMES: return ee.return = ee.value + "{" + serialize(ee.children, ne) + "}"; case RULESET: ee.value = ee.props.join(","); } return strlen(te = serialize(ee.children, ne)) ? ee.return = ee.value + "{" + te + "}" : ""; } function middleware(ee) { var re = sizeof(ee); return function(te, ne, ie, oe) { for (var se = "", ae = 0; ae < re; ae++) se += ee[ae](te, ne, ie, oe) || ""; return se; }; } function rulesheet(ee) { return function(re) { re.root || (re = re.return) && ee(re); }; } function memoize(ee) { var re = /* @__PURE__ */ Object.create(null); return function(te) { return re[te] === void 0 && (re[te] = ee(te)), re[te]; }; } var identifierWithPointTracking = function(re, te, ne) { for (var ie = 0, oe = 0; ie = oe, oe = peek(), ie === 38 && oe === 12 && (te[ne] = 1), !token(oe); ) next$1(); return slice(re, position); }, toRules = function(re, te) { var ne = -1, ie = 44; do switch (token(ie)) { case 0: ie === 38 && peek() === 12 && (te[ne] = 1), re[ne] += identifierWithPointTracking(position - 1, te, ne); break; case 2: re[ne] += delimit(ie); break; case 4: if (ie === 44) { re[++ne] = peek() === 58 ? "&\f" : "", te[ne] = re[ne].length; break; } // fallthrough default: re[ne] += from$1(ie); } while (ie = next$1()); return re; }, getRules = function(re, te) { return dealloc(toRules(alloc(re), te)); }, fixedElements = /* @__PURE__ */ new WeakMap(), compat = function(re) { if (!(re.type !== "rule" || !re.parent || // positive .length indicates that this rule contains pseudo // negative .length indicates that this rule has been already prefixed re.length < 1)) { for (var te = re.value, ne = re.parent, ie = re.column === ne.column && re.line === ne.line; ne.type !== "rule"; ) if (ne = ne.parent, !ne) return; if (!(re.props.length === 1 && te.charCodeAt(0) !== 58 && !fixedElements.get(ne)) && !ie) { fixedElements.set(re, !0); for (var oe = [], se = getRules(te, oe), ae = ne.props, ce = 0, ue = 0; ce < se.length; ce++) for (var le = 0; le < ae.length; le++, ue++) re.props[ue] = oe[ce] ? se[ce].replace(/&\f/g, ae[le]) : ae[le] + " " + se[ce]; } } }, removeLabel = function(re) { if (re.type === "decl") { var te = re.value; // charcode for l te.charCodeAt(0) === 108 && // charcode for b te.charCodeAt(2) === 98 && (re.return = "", re.value = ""); } }; function prefix(ee, re) { switch (hash(ee, re)) { // color-adjust case 5103: return WEBKIT + "print-" + ee + ee; // 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 WEBKIT + ee + ee; // appearance, user-select, transform, hyphens, text-size-adjust case 5349: case 4246: case 4810: case 6968: case 2756: return WEBKIT + ee + MOZ + ee + MS + ee + ee; // flex, flex-direction case 6828: case 4268: return WEBKIT + ee + MS + ee + ee; // order case 6165: return WEBKIT + ee + MS + "flex-" + ee + ee; // align-items case 5187: return WEBKIT + ee + replace(ee, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + ee; // align-self case 5443: return WEBKIT + ee + MS + "flex-item-" + replace(ee, /flex-|-self/, "") + ee; // align-content case 4675: return WEBKIT + ee + MS + "flex-line-pack" + replace(ee, /align-content|flex-|-self/, "") + ee; // flex-shrink case 5548: return WEBKIT + ee + MS + replace(ee, "shrink", "negative") + ee; // flex-basis case 5292: return WEBKIT + ee + MS + replace(ee, "basis", "preferred-size") + ee; // flex-grow case 6060: return WEBKIT + "box-" + replace(ee, "-grow", "") + WEBKIT + ee + MS + replace(ee, "grow", "positive") + ee; // transition case 4554: return WEBKIT + replace(ee, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + ee; // cursor case 6187: return replace(replace(replace(ee, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), ee, "") + ee; // background, background-image case 5495: case 3959: return replace(ee, /(image-set\([^]*)/, WEBKIT + "$1$`$1"); // justify-content case 4968: return replace(replace(ee, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + ee + ee; // (margin|padding)-inline-(start|end) case 4095: case 3583: case 4068: case 2532: return replace(ee, /(.+)-inline(.+)/, WEBKIT + "$1$2") + ee; // (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 (strlen(ee) - 1 - re > 6) switch (charat(ee, re + 1)) { // (m)ax-content, (m)in-content case 109: if (charat(ee, re + 4) !== 45) break; // (f)ill-available, (f)it-content case 102: return replace(ee, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(ee, re + 3) == 108 ? "$3" : "$2-$3")) + ee; // (s)tretch case 115: return ~indexof(ee, "stretch") ? prefix(replace(ee, "stretch", "fill-available"), re) + ee : ee; } break; // position: sticky case 4949: if (charat(ee, re + 1) !== 115) break; // display: (flex|inline-flex) case 6444: switch (charat(ee, strlen(ee) - 3 - (~indexof(ee, "!important") && 10))) { // stic(k)y case 107: return replace(ee, ":", ":" + WEBKIT) + ee; // (inline-)?fl(e)x case 101: return replace(ee, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(ee, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + ee; } break; // writing-mode case 5936: switch (charat(ee, re + 11)) { // vertical-l(r) case 114: return WEBKIT + ee + MS + replace(ee, /[svh]\w+-[tblr]{2}/, "tb") + ee; // vertical-r(l) case 108: return WEBKIT + ee + MS + replace(ee, /[svh]\w+-[tblr]{2}/, "tb-rl") + ee; // horizontal(-)tb case 45: return WEBKIT + ee + MS + replace(ee, /[svh]\w+-[tblr]{2}/, "lr") + ee; } return WEBKIT + ee + MS + ee + ee; } return ee; } var prefixer = function(re, te, ne, ie) { if (re.length > -1 && !re.return) switch (re.type) { case DECLARATION: re.return = prefix(re.value, re.length); break; case KEYFRAMES: return serialize([copy$1(re, { value: replace(re.value, "@", "@" + WEBKIT) })], ie); case RULESET: if (re.length) return combine$1(re.props, function(oe) { switch (match(oe, /(::plac\w+|:read-\w+)/)) { // :read-(only|write) case ":read-only": case ":read-write": return serialize([copy$1(re, { props: [replace(oe, /:(read-\w+)/, ":" + MOZ + "$1")] })], ie); // :placeholder case "::placeholder": return serialize([copy$1(re, { props: [replace(oe, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] }), copy$1(re, { props: [replace(oe, /:(plac\w+)/, ":" + MOZ + "$1")] }), copy$1(re, { props: [replace(oe, /:(plac\w+)/, MS + "input-$1")] })], ie); } return ""; }); } }, defaultStylisPlugins = [prefixer], createCache = function(re) { var te = re.key; if (te === "css") { var ne = document.querySelectorAll("style[data-emotion]:not([data-s])"); Array.prototype.forEach.call(ne, function(ge) { var me = ge.getAttribute("data-emotion"); me.indexOf(" ") !== -1 && (document.head.appendChild(ge), ge.setAttribute("data-s", "")); }); } var ie = re.stylisPlugins || defaultStylisPlugins, oe = {}, se, ae = []; se = re.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^="' + te + ' "]'), function(ge) { for (var me = ge.getAttribute("data-emotion").split(" "), ye = 1; ye < me.length; ye++) oe[me[ye]] = !0; ae.push(ge); } ); var ce, ue = [compat, removeLabel]; { var le, de = [stringify, rulesheet(function(ge) { le.insert(ge); })], fe = middleware(ue.concat(ie, de)), he = function(me) { return serialize(compile(me), fe); }; ce = function(me, ye, ve, be) { le = ve, he(me ? me + "{" + ye.styles + "}" : ye.styles), be && (pe.inserted[ye.name] = !0); }; } var pe = { key: te, sheet: new StyleSheet({ key: te, container: se, nonce: re.nonce, speedy: re.speedy, prepend: re.prepend, insertionPoint: re.insertionPoint }), nonce: re.nonce, inserted: oe, registered: {}, insert: ce }; return pe.sheet.hydrate(ae), pe; }; function murmur2(ee) { for (var re = 0, te, ne = 0, ie = ee.length; ie >= 4; ++ne, ie -= 4) te = ee.charCodeAt(ne) & 255 | (ee.charCodeAt(++ne) & 255) << 8 | (ee.charCodeAt(++ne) & 255) << 16 | (ee.charCodeAt(++ne) & 255) << 24, te = /* Math.imul(k, m): */ (te & 65535) * 1540483477 + ((te >>> 16) * 59797 << 16), te ^= /* k >>> r: */ te >>> 24, re = /* Math.imul(k, m): */ (te & 65535) * 1540483477 + ((te >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */ (re & 65535) * 1540483477 + ((re >>> 16) * 59797 << 16); switch (ie) { case 3: re ^= (ee.charCodeAt(ne + 2) & 255) << 16; case 2: re ^= (ee.charCodeAt(ne + 1) & 255) << 8; case 1: re ^= ee.charCodeAt(ne) & 255, re = /* Math.imul(h, m): */ (re & 65535) * 1540483477 + ((re >>> 16) * 59797 << 16); } return re ^= re >>> 13, re = /* Math.imul(h, m): */ (re & 65535) * 1540483477 + ((re >>> 16) * 59797 << 16), ((re ^ re >>> 15) >>> 0).toString(36); } var unitlessKeys = { 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 }, hyphenateRegex = /[A-Z]|^ms/g, animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g, isCustomProperty = function(re) { return re.charCodeAt(1) === 45; }, isProcessableValue = function(re) { return re != null && typeof re != "boolean"; }, processStyleName = /* @__PURE__ */ memoize(function(ee) { return isCustomProperty(ee) ? ee : ee.replace(hyphenateRegex, "-$&").toLowerCase(); }), processStyleValue = function(re, te) { switch (re) { case "animation": case "animationName": if (typeof te == "string") return te.replace(animationRegex, function(ne, ie, oe) { return cursor = { name: ie, styles: oe, next: cursor }, ie; }); } return unitlessKeys[re] !== 1 && !isCustomProperty(re) && typeof te == "number" && te !== 0 ? te + "px" : te; }; function handleInterpolation(ee, re, te) { if (te == null) return ""; var ne = te; if (ne.__emotion_styles !== void 0) return ne; switch (typeof te) { case "boolean": return ""; case "object": { var ie = te; if (ie.anim === 1) return cursor = { name: ie.name, styles: ie.styles, next: cursor }, ie.name; var oe = te; if (oe.styles !== void 0) { var se = oe.next; if (se !== void 0) for (; se !== void 0; ) cursor = { name: se.name, styles: se.styles, next: cursor }, se = se.next; var ae = oe.styles + ";"; return ae; } return createStringFromObject(ee, re, te); } } var ce = te; if (re == null) return ce; var ue = re[ce]; return ue !== void 0 ? ue : ce; } function createStringFromObject(ee, re, te) { var ne = ""; if (Array.isArray(te)) for (var ie = 0; ie < te.length; ie++) ne += handleInterpolation(ee, re, te[ie]) + ";"; else for (var oe in te) { var se = te[oe]; if (typeof se != "object") { var ae = se; re != null && re[ae] !== void 0 ? ne += oe + "{" + re[ae] + "}" : isProcessableValue(ae) && (ne += processStyleName(oe) + ":" + processStyleValue(oe, ae) + ";"); } else if (Array.isArray(se) && typeof se[0] == "string" && (re == null || re[se[0]] === void 0)) for (var ce = 0; ce < se.length; ce++) isProcessableValue(se[ce]) && (ne += processStyleName(oe) + ":" + processStyleValue(oe, se[ce]) + ";"); else { var ue = handleInterpolation(ee, re, se); switch (oe) { case "animation": case "animationName": { ne += processStyleName(oe) + ":" + ue + ";"; break; } default: ne += oe + "{" + ue + "}"; } } } return ne; } var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g, cursor; function serializeStyles(ee, re, te) { if (ee.length === 1 && typeof ee[0] == "object" && ee[0] !== null && ee[0].styles !== void 0) return ee[0]; var ne = !0, ie = ""; cursor = void 0; var oe = ee[0]; if (oe == null || oe.raw === void 0) ne = !1, ie += handleInterpolation(te, re, oe); else { var se = oe; ie += se[0]; } for (var ae = 1; ae < ee.length; ae++) if (ie += handleInterpolation(te, re, ee[ae]), ne) { var ce = oe; ie += ce[ae]; } labelPattern.lastIndex = 0; for (var ue = "", le; (le = labelPattern.exec(ie)) !== null; ) ue += "-" + le[1]; var de = murmur2(ie) + ue; return { name: de, styles: ie, next: cursor }; } function getRegisteredStyles(ee, re, te) { var ne = ""; return te.split(" ").forEach(function(ie) { ee[ie] !== void 0 ? re.push(ee[ie] + ";") : ie && (ne += ie + " "); }), ne; } var registerStyles = function(re, te, ne) { var ie = re.key + "-" + te.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 re.registered[ie] === void 0 && (re.registered[ie] = te.styles); }, insertStyles = function(re, te, ne) { registerStyles(re, te); var ie = re.key + "-" + te.name; if (re.inserted[te.name] === void 0) { var oe = te; do re.insert(te === oe ? "." + ie : "", oe, re.sheet, !0), oe = oe.next; while (oe !== void 0); } }; function insertWithoutScoping(ee, re) { if (ee.inserted[re.name] === void 0) return ee.insert("", re, ee.sheet, !0); } function merge$2(ee, re, te) { var ne = [], ie = getRegisteredStyles(ee, ne, te); return ne.length < 2 ? te : ie + re(ne); } var createEmotion = function(re) { var te = createCache(re); te.sheet.speedy = function(ae) { this.isSpeedy = ae; }, te.compat = !0; var ne = function() { for (var ce = arguments.length, ue = new Array(ce), le = 0; le < ce; le++) ue[le] = arguments[le]; var de = serializeStyles(ue, te.registered, void 0); return insertStyles(te, de), te.key + "-" + de.name; }, ie = function() { for (var ce = arguments.length, ue = new Array(ce), le = 0; le < ce; le++) ue[le] = arguments[le]; var de = serializeStyles(ue, te.registered), fe = "animation-" + de.name; return insertWithoutScop