window.env = Object.assign({}, window.env||{}, {"STRIPE_ACCOUNT":"acct_1LJ1zfCfn25WxNXd","FORDPAY_SCRIPT_URL_DEV":"https:\u002F\u002Ffordpay-components-uat.ford.com\u002Fjs\u002Ffordpay-ui-checkout-bundle.js","FORDPAY_SCRIPT_URL_PROD":"https:\u002F\u002Ffordpay-components.ford.com\u002Fjs\u002Ffordpay-ui-checkout-bundle.js","APIGEE_BASE_URL":"https:\u002F\u002Fapi-prd.fordpro.com","HERE_MAP_GEOCODE_API":"https:\u002F\u002Fgeocode.search.hereapi.com\u002Fv1","HERE_MAP_API_KEY":"Ij9nlvM6icpauSrkohS4yCNbF-AyYJZ0IiTp_Gvgbbs"}); var e_commerce_chargers_app; /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@cxc/react-fds-components/index.mjs": /*!**********************************************************!*\ !*** ./node_modules/@cxc/react-fds-components/index.mjs ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Accordion: () => (/* binding */ r1), /* harmony export */ AccordionPanel: () => (/* binding */ a1), /* harmony export */ Badge: () => (/* binding */ s1), /* harmony export */ BannerNotification: () => (/* binding */ v1), /* harmony export */ BaseTextField: () => (/* binding */ ct), /* harmony export */ Billboard: () => (/* binding */ c1), /* harmony export */ BillboardCarousel: () => (/* binding */ _1), /* harmony export */ BreadcrumbItem: () => (/* binding */ $l), /* harmony export */ BreadcrumbLink: () => (/* binding */ _l), /* harmony export */ Breadcrumbs: () => (/* binding */ E1), /* harmony export */ Calendar: () => (/* binding */ Il), /* harmony export */ CalendarPicker: () => (/* binding */ b1), /* harmony export */ CanadaPopUp: () => (/* binding */ S1), /* harmony export */ Card: () => (/* binding */ u1), /* harmony export */ CardAlert: () => (/* binding */ f1), /* harmony export */ CardCarousel: () => (/* binding */ g1), /* harmony export */ CardContent: () => (/* binding */ h1), /* harmony export */ CardGroup: () => (/* binding */ is), /* harmony export */ CardImageMedia: () => (/* binding */ p1), /* harmony export */ CardOverflowMenu: () => (/* binding */ $1), /* harmony export */ CardVideoMedia: () => (/* binding */ m1), /* harmony export */ Carousel: () => (/* binding */ T1), /* harmony export */ Checkbox: () => (/* binding */ pc), /* harmony export */ CheckboxForDropdown: () => (/* binding */ D1), /* harmony export */ CheckboxGroup: () => (/* binding */ P1), /* harmony export */ CircularActivityIndicator: () => (/* binding */ i1), /* harmony export */ Collapse: () => (/* binding */ Po), /* harmony export */ CurrencyTextField: () => (/* binding */ R1), /* harmony export */ CurrencyTextField2: () => (/* binding */ z1), /* harmony export */ Dialog: () => (/* binding */ Jd), /* harmony export */ DialogContent: () => (/* binding */ Qd), /* harmony export */ DialogImage: () => (/* binding */ C1), /* harmony export */ DialogVideo: () => (/* binding */ N1), /* harmony export */ Divider: () => (/* binding */ O1), /* harmony export */ Dropdown: () => (/* binding */ w1), /* harmony export */ FilterChip: () => (/* binding */ I1), /* harmony export */ FilterChipGroup: () => (/* binding */ A1), /* harmony export */ FloatingActionButton: () => (/* binding */ l1), /* harmony export */ Icon: () => (/* binding */ Wt), /* harmony export */ IconButton: () => (/* binding */ d1), /* harmony export */ InfoModal: () => (/* binding */ q1), /* harmony export */ LinearActivityIndicator: () => (/* binding */ o1), /* harmony export */ LinkWrapper: () => (/* binding */ X1), /* harmony export */ OverflowMenu: () => (/* binding */ e2), /* harmony export */ OverflowMenuDivider: () => (/* binding */ n2), /* harmony export */ OverflowMenuItem: () => (/* binding */ t2), /* harmony export */ PasswordField: () => (/* binding */ dc), /* harmony export */ PhoneTextField: () => (/* binding */ F1), /* harmony export */ PhoneTextField2: () => (/* binding */ v0), /* harmony export */ PostalCodeTextField: () => (/* binding */ G1), /* harmony export */ PostalCodeTextField2: () => (/* binding */ j1), /* harmony export */ PredictiveSearchField: () => (/* binding */ V1), /* harmony export */ PrimaryButton: () => (/* binding */ Tt), /* harmony export */ Radio: () => (/* binding */ L1), /* harmony export */ RadioGroup: () => (/* binding */ x1), /* harmony export */ SearchBar: () => (/* binding */ H1), /* harmony export */ SecondaryButton: () => (/* binding */ ui), /* harmony export */ Select: () => (/* binding */ W1), /* harmony export */ Slider: () => (/* binding */ r2), /* harmony export */ StandardButton: () => (/* binding */ Tt), /* harmony export */ Tab: () => (/* binding */ ii), /* harmony export */ Table: () => (/* binding */ A0), /* harmony export */ TableBody: () => (/* binding */ D0), /* harmony export */ TableCell: () => (/* binding */ I0), /* harmony export */ TableContainer: () => (/* binding */ O0), /* harmony export */ TableHead: () => (/* binding */ L0), /* harmony export */ TablePagination: () => (/* binding */ F0), /* harmony export */ TableRow: () => (/* binding */ P0), /* harmony export */ TableSortLabel: () => (/* binding */ k0), /* harmony export */ Tabs: () => (/* binding */ J1), /* harmony export */ TextButton: () => (/* binding */ ui), /* harmony export */ TextField: () => (/* binding */ ct), /* harmony export */ Toggle: () => (/* binding */ Q1), /* harmony export */ Tooltip: () => (/* binding */ B0), /* harmony export */ Tracker: () => (/* binding */ K0), /* harmony export */ TrackerStep: () => (/* binding */ q0), /* harmony export */ TrackerStepContent: () => (/* binding */ J0), /* harmony export */ TrackerStepLabel: () => (/* binding */ To), /* harmony export */ Typography: () => (/* binding */ ns), /* harmony export */ ValidationMessage: () => (/* binding */ ci), /* harmony export */ classes: () => (/* binding */ Ke), /* harmony export */ getCurrencyObject: () => (/* binding */ Y1), /* harmony export */ isPossiblePhoneNumber: () => (/* binding */ B1), /* harmony export */ isValidNumberForRegion: () => (/* binding */ U1), /* harmony export */ isValidPhoneNumber: () => (/* binding */ k1), /* harmony export */ isValidPostalCode: () => (/* binding */ K1), /* harmony export */ parsePhoneNumber: () => (/* binding */ M1), /* harmony export */ secondaryButtonClasses: () => (/* binding */ Ne), /* harmony export */ textButtonClasses: () => (/* binding */ Ne), /* harmony export */ useBannerNotification: () => (/* binding */ y1), /* harmony export */ useModal: () => (/* binding */ Z1), /* harmony export */ useValidationMessage: () => (/* binding */ a2), /* harmony export */ useWindowDimensions: () => (/* binding */ Ci) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react/react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "webpack/sharing/consume/default/react-dom/react-dom"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__); function li(t) { var e, n, r = ""; if (typeof t == "string" || typeof t == "number") r += t; else if (typeof t == "object") if (Array.isArray(t)) for (e = 0; e < t.length; e++) t[e] && (n = li(t[e])) && (r && (r += " "), r += n); else for (e in t) t[e] && (r && (r += " "), r += e); return r; } function E() { for (var t, e, n = 0, r = ""; n < arguments.length; ) (t = arguments[n++]) && (e = li(t)) && (r && (r += " "), r += e); return r; } const we = { COMPONENT: "js-fmc-accordion", PANEL: "fmc-accordion__panel", BUTTON: "fmc-accordion__button", BUTTON_TITLE: "fmc-accordion__button-icon", BUTTON_TITLE_TEXT: "fmc-accordion__button-text", BUTTON_DESCRIPTION_TEXT: "fmc-accordion__button-description-text", BUTTON_DESCRIPTION: "fmc-accordion__button__description", BUTTON_DESCRIPTION_LABEL: "fmc-accordion__button__description_label", BUTTON_DESCRIPTION_LABEL_FEEDBACK: "fmc-accordion__button__description_label_feedback", BUTTON_LABEL_TEXT_SUCCESS: "fmc-accordion__button-label-text-success", BUTTON_LABEL_TEXT_ERROR: "fmc-accordion__button-label-text-error", BUTTON_TITLE_WRAPPER: "fmc-accordion__button-title-wrapper", FEEDBACK: "fmc-accordion-feedback", BODY: "fmc-accordion__body", CONTENT: "fmc-accordion__content", ACTIVE: "fmc-accordion--active", EXPANDED: "fmc-accordion--expanded" }, wr = { DARK: "dark", LIGHT: "light" }, Lr = { SUCCESS: "success", ERROR: "error" }, Ro = "ACCORDION_DATA_TEST_ID", r1 = ({ background: t, foreground: e, dataTestId: n = Ro, children: r, className: a }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": `${n}_MAIN`, className: E( we.COMPONENT, "fmc-accordion", t === wr.DARK ? "fds-color__bg--dark" : "fds-color__bg--light", e === wr.LIGHT ? "fmc-accordion--light" : "fmc-accordion--dark", a ), children: r } ), xr = { BODY: "fmc-accordion__body", CONTENT: "fmc-accordion__content" }, Do = "COLLAPSE_DATA_TEST_ID", Po = ({ children: t, dataTestId: e = Do, isOpen: n, className: r }) => { const [a, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), o = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const c = o?.current?.getBoundingClientRect()?.height; c !== void 0 && i(c); }, [a, n]); const l = { height: `${n ? a : 0}px` }, d = { visibility: `${n ? "visible" : "hidden"}` }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { style: l, className: E(xr.BODY, r), ref: s, "data-testid": `${e}_BODY`, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: xr.CONTENT, "aria-labelledby": "panel-button", id: "panel-content", "aria-hidden": !n, style: d, ref: o, "data-testid": `${e}_CONTENT`, children: t } ) } ); }, wo = "ICON_DATA_TEST_ID", Wt = ({ name: t, disabled: e = !1, size: n = 16, onClick: r, className: a, dataTestId: i = wo, ...o }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( r ? "button" : "span", { className: E( `fds-font fds-icon--${n} fds-font--ford-icons__${t}`, e && "fds-font--color__disabled cxc-icon--disabled", a ), disabled: e, onClick: r, "data-testid": i, ...o } ), Lo = "ACCORDION_PANEL_DATA_TEST_ID", a1 = ({ index: t, titleText: e, descriptionText: n, labelText: r, feedbackText: a, icon: i, children: o, className: s, initiallyOpen: l = !1, dataTestId: d = Lo }) => { const c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), [f, h] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(l), p = f, m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), _ = () => { h(!f); }, g = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Wt, { name: p ? "chevron-up" : "chevron-down" }), v = () => r === Lr.SUCCESS ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "span", { className: we.BUTTON_LABEL_TEXT_SUCCESS, "data-testid": `${d}_${t}_LABEL_SUCCESS`, children: [ "Completed", " ", /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fds-font fds-icon--16 fds-font--ford-icons__check-filled" }) ] } ) : r === Lr.ERROR ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "span", { className: we.BUTTON_LABEL_TEXT_ERROR, "data-testid": `${d}_${t}_LABEL_ERROR`, children: [ "Required", " ", /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fds-font fds-icon--16 fds-font--ford-icons__warning-filled" }) ] } ) : null, $ = () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: we.BUTTON_TITLE_WRAPPER, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(v, {}), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: we.BUTTON_TITLE_TEXT, "data-testid": `${d}_${t}_TITLE`, children: e } ), n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: we.BUTTON_DESCRIPTION_TEXT, "data-testid": `${d}_${t}_DESCRIPTION`, children: n } ), a && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fmc-accordion-feedback-mobile", children: a }) ] }); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E(we.PANEL, s), "data-testid": `${d}_${t}_PANEL`, "aria-expanded": p, ref: c, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "button", { type: "button", onClick: _, className: E( we.BUTTON, (n || r || a) && we.BUTTON_DESCRIPTION, n && r && !a && we.BUTTON_DESCRIPTION_LABEL, n && r && a && we.BUTTON_DESCRIPTION_LABEL_FEEDBACK ), id: `panel-${t}-button`, "aria-controls": `panel-${t}-content`, "aria-expanded": p, "aria-hidden": !p, ref: m, "data-testid": `${d}_${t}_BUTTON`, children: [ i ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: we.BUTTON_TITLE, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: i, "data-testid": `${d}_${t}_ICON` } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($, {}) ] }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($, {}), a ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: we.FEEDBACK, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: "feedback-text", "data-testid": `${d}_${t}_FEEDBACK`, children: a } ), g ] }) : g ] } ) }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Po, { dataTestId: `ACCORDION_PANEL_DATA_TEST_ID_${t}`, isOpen: p, children: o } ) ] } ); }, Re = { ACTIVITY_INDICATOR: "fds-activity-indicator", CIRCULAR_INDICATOR: "cxc-activity-indicator--circular", PROGRESS_WRAPPER: "cxc-activity-indicator__progress-wrapper", PROGRESS_LINE: "cxc-activity-indicator__progress-line", LINE_DETERMINATE: "cxc-activity-indicator__progress-line_line--determinate", DISPLAY_PERCENT: "cxc-activity-indicator__display-percent", PROGRESS_INDICATOR_BACKGROUND_COLOR_LIGHT: "fds-color__bg--light", PROGRESS_INDICATOR_FLEX: "fds-flex", PROGRESS_LINE_SVG: "cxc-activity-indicator__progress-line_svg", PROGRESS_LINE_SVG_DETERMINATE: "cxc-activity-indicator__progress-line_svg--determinate", CIRCULAR_LINE_ANIMATION_DETERMINATE: "cxc-activity-indicator__animation--circular--determinate", FMC_ACTIVITY_CIRCLE: "fmc-activity-circle", FMC_ACTIVITY_CIRCLE_PROGRESS: "fmc-activity-circle__progress" }, di = 23, $n = 2 * Math.PI * di, xo = 80, Fo = 0.0625, Mo = 3 * Fo, ko = 1024; getComputedStyle(document.documentElement).getPropertyValue( "--fds-base-multiplier-rem" ); const Ce = { UP: 38, DOWN: 40, LEFT: 37, RIGHT: 39, TAB: 9, ENTER: 13, HOME: 36, END: 35, SPACE: 32, ESC: 27 }; function Bo(t) { return new Promise((e) => { setTimeout(e, t); }); } const Ve = function() { let t = 0; const e = (/* @__PURE__ */ new Date()).getTime(); return function(n) { const r = (/* @__PURE__ */ new Date()).getTime() - e, a = Math.floor(Math.random() * 1e3); n = n !== void 0 ? String(n) : ""; const i = (n && "-") + t + "-" + r + "-" + a; return t += 1, n + i; }; }(), $r = (t) => $n * ((100 - t) / 100), Uo = (t, e) => `@keyframes cxc-activity-indicator__animation--circular--determinate-${e} { 0% { stroke-dashoffset: ${$n} ; } ${t}% { stroke-dashoffset: ${$r(t)} ; } }`, Ho = (t, e) => `@-webkit-keyframes cxc-activity-indicator__animation--circular--determinate-${e} { 0% { stroke-dashoffset: ${$n}; } ${t}% { stroke-dashoffset: ${$r(t)}; } }`, Wo = (t, e) => ` .cxc-activity-indicator__progress-line_line--determinate-${e} { stroke-width: ${Mo}rem; stroke-dasharray: ${$n}; stroke-dashoffset: ${t}; animation: cxc-activity-indicator__animation--circular--determinate-${e} linear 1; stroke-linecap: round; stroke: var(--fds-color--primary); } `, Vo = (t, e) => { const n = $r(t), r = Uo(t, e), a = Ho(t, e), i = Wo(n, e), o = document.styleSheets?.[0]?.cssRules; for (let s = 0; s < o?.length; s++) //@ts-ignore (o[s].name === `${Re.CIRCULAR_LINE_ANIMATION_DETERMINATE}-${e}` || //@ts-ignore o[s].selectorText === `.${Re.LINE_DETERMINATE}-${e}`) && document.styleSheets[0].deleteRule(s); document.styleSheets?.[0]?.insertRule(r, 0), document.styleSheets?.[0]?.insertRule(a, 1), t > 0 && document.styleSheets?.[0]?.insertRule(i, 2); }, Fr = "CIRCULAR_ACTIVITY_INDICATOR_DATA_TEST_ID", Go = "SVG_DATA_TEST_ID", Ko = "INDETERMINATE_TEST_ID", i1 = ({ dataTestId: t = Fr, className: e, value: n, diameter: r = xo }) => { const a = n !== void 0, i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => Ve(), []); return react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => { a && Vo(n, i); }, [a, n, i]), // eslint-disable-next-line react/jsx-no-useless-fragment /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: a ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( Re.ACTIVITY_INDICATOR, Re.CIRCULAR_INDICATOR, Re.PROGRESS_INDICATOR_BACKGROUND_COLOR_LIGHT, Re.PROGRESS_INDICATOR_FLEX, e ), "data-aria-loading-message": "Please wait while page loads.", "data-aria-loading-complete-message": "Loading live region is complete.", "data-aria-determinate-percent-message": "loaded", role: "progressbar", "aria-label": "progressbar", "aria-busy": !0, "data-testid": t, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E(Re.PROGRESS_WRAPPER), style: { //@ts-ignore "--circle-width": `${r}px`, "--circle-height": `${r}px`, "--progress-wrapper-width": `${r * 1.08}px`, "--progress-wrapper-height": `${r * 1.08}px` }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E(Re.PROGRESS_LINE), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "svg", { className: E( Re.PROGRESS_LINE_SVG, Re.PROGRESS_LINE_SVG_DETERMINATE ), viewBox: "25 25 50 50", "data-testid": Go, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "circle", { className: `${Re.LINE_DETERMINATE}-${i}`, cx: "50", cy: "50", r: di, fill: "none", strokeMiterlimit: "10" } ) } ) }) } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E(Re.DISPLAY_PERCENT), children: n }) ] } ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: Re.FMC_ACTIVITY_CIRCLE, style: { //@ts-ignore "--circle-diameter": `${r}px` }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: Re.FMC_ACTIVITY_CIRCLE_PROGRESS, "data-testid": t === Fr ? Ko : t } ) } ) }); }, Rt = { FMC_ACTIVITY: "fmc-activity", FMC_ACTIVITY_PROGRESS: "fmc-activity__progress", FMC_ACTIVITY_PROGRESS__PERCENT: "fmc-activity__progress--percent", FMC_ACTIVITY__TEXT: "fmc-activity__text", FDS_TYPE__CAPTION: "fds-type--caption" }, jo = "LINEAR_ACTIVITY_INDICATOR_DATA_TEST_ID", o1 = ({ dataTestId: t = jo, className: e, value: n }) => { const r = n !== void 0; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: Rt.FMC_ACTIVITY, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E( Rt.FMC_ACTIVITY_PROGRESS, r && Rt.FMC_ACTIVITY_PROGRESS__PERCENT, e ), style: { width: r ? `${n}%` : "" }, role: "progressbar", "aria-busy": !0, "data-testid": t } ), r && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "p", { className: E( Rt.FMC_ACTIVITY__TEXT, Rt.FDS_TYPE__CAPTION ), children: n } ) ] }) }); }, Yo = "BADGE_DATA_TEST_ID", zt = { BADGE: "fmc-badge", DARK_MODE: "fmc-badge--dark", ICON: "fds-icon", ICON_FONT_PREFIX: "fds-font--ford-icons__" }, s1 = ({ text: t, icon: e, mode: n = "light", className: r, dataTestId: a = Yo }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { role: "note", className: E(zt.BADGE, n == "dark" && zt.DARK_MODE, r), "data-testid": a, children: [ e && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `${zt.ICON} ${zt.ICON_FONT_PREFIX}${e}` }), t ] }), le = { COMPONENT: "fmc-billboard", IMAGE: "fmc-billboard__image", JUSTIFY_START: "fmc-billboard--justify-start", JUSTIFY_CENTER: "fmc-billboard--justify-center", JUSTIFY_END: "fmc-billboard--justify-end", ALIGN_START: "fmc-billboard--align-start", ALIGN_CENTER: "fmc-billboard--align-center", ALIGN_END: "fmc-billboard--align-end", SPLIT_RIGHT: "fmc-billboard--split-image-right", SPLIT_BOTTOM: "fmc-billboard--split-image-bottom", SPLIT_TOP: "fmc-billboard--split-image-top", SPLIT_LEFT: "fmc-billboard--split-image-left", MASK: "fmc-billboard__scrim", MASK_TOP: "fmc-billboard--scrim-top", MASK_BOTTOM: "fmc-billboard--scrim-bottom", MASK_LEFT: "fmc-billboard--scrim-left", MASK_RIGHT: "fmc-billboard--scrim-right", MASK_FULL: "fmc-billboard--scrim-full", WHITE: "fmc-billboard--scrim-white", DARK: "fmc-billboard--scrim-dark", BLACK: "fmc-billboard--scrim-black", CONTENT: "fmc-billboard__content", CENTER: "fds-align--center", CONTENT_TITLE: "cxc-billboard__content--title", CONTENT_BODY: "cxc-billboard__content--body", CONTENT_DISCLAIMER: "cxc-billboard__content--disclaimer", CONTENT_BUTTON: "cxc-billboard__content--button", SIZE_TWO_THIRDS: "fmc-billboard--height-67vh", SIZE_ONE_THIRD: "fmc-billboard--height-33vh" }, ci = ({ validationMessage: t, validationMessageType: e, className: n, ...r }) => t && t !== "" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "p", { style: { textAlign: "left", display: "flex", ...r.styles }, className: E( "fds-validation__message", e === "error" && "fds-validation__message--error", e === "success" && "fds-validation__message--success", e === "default" && "fds-validation__message--default", n ), children: t } ) : null; const Ke = { BUTTON: "fmc-button", OUTLINED: "fmc-button--outlined", SPINNER: "cxc-spinner", STANDARD_BUTTON: "fds-standard-button", BUTTON_TEXT_INVISIBLE: "cxc-standard-button__text--invisible", NO_SHADOW: "fmc-button--no-shadow", HIGHLIGHTED: "cxc-standard-button--highlighted", ICON_LEFT_OFFSET: "fds-icon--offset-left", ICON_RIGHT_OFFSET: "fds-icon--offset-right" }, zo = "STANDARD_BUTTON_TEST_ID", Tt = ({ disabled: t = !1, outlined: e = !1, onClick: n, title: r, mode: a = "light", loading: i = !1, className: o, enableValidation: s = !1, validationMessage: l, validationMessageType: d, type: c = "button", htmlTitle: f, href: h, as: p, target: m = "_self", icon: _, iconName: g, iconAlignment: v, isHighlighted: $, ariaLabel: N, dataTestId: y = zo, ...T }) => { let D; const U = p || "button", I = U === "button" && { type: c }, R = U === "a" && { target: m, href: h }, k = { onClick: n, title: f, disabled: t || i }, P = (_ || g) && v === "left", V = (_ || g) && v === "right", M = { maxWidth: "16px", maxHeight: "16px" }; return (P || V) && (D = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "span", { className: v === "left" ? Ke.ICON_LEFT_OFFSET : Ke.ICON_RIGHT_OFFSET, children: [ _ && react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(_, { style: M }), g && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Wt, { name: g }) ] } )), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: Ke.STANDARD_BUTTON, "data-testid": y, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( U, { className: E( Ke.BUTTON, e && Ke.OUTLINED, Ke.NO_SHADOW, $ && Ke.HIGHLIGHTED, o ), ...I, ...R, ...k, ...T, ...a === "dark" && { "data-dark": !0 }, "aria-label": N, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ P && !i && D, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: E(i && Ke.BUTTON_TEXT_INVISIBLE), children: [ r, i && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: Ke.SPINNER }) ] }), V && !i && D ] }) } ) }), s && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ci, { validationMessage: l, validationMessageType: d } ) ] }); }, Ne = { BUTTON: "fmc-text-button", BUTTON_TEXT: "fds-text-button__text", HOVER: "fmc-button--hover", ACTIVE: "fmc-button--active", FOCUSED: "fmc-text-button--focus", DISABLED: "fmc-text-button--disabled", TOUCH: "fmc-text-button--touch", REMOVE_UNDERLINE: "fmc-text-button--remove-underline", OUTLINED: "fmc-button--outlined", LIGHT_BACKGROUND: "fds-color__bg--light", DARK_BACKGROUND: "fds-color__bg--dark", SPINNER: "cxc-spinner", NO_SHADOW: "fmc-button--no-shadow", ICON_WRAPPER: "fmc-text-button__chevron", ICON: "fds-icon", ICON_LEFT: "fds-icon--offset-left", ICON_RIGHT: "fds-icon--offset-right", ICON_CHEVRON_FILLED_LEFT: "fds-font--ford-icons__chevron-filled-left", ICON_CHEVRON_FILLED_RIGHT: "fds-font--ford-icons__chevron-filled-right" }, Xo = "TEXT_BUTTON_TEST_ID", ui = ({ disabled: t = !1, onClick: e, title: n, mode: r = "light", loading: a = !1, chevronLeft: i = !1, chevronRight: o = !1, className: s, type: l = "button", as: d, href: c = "", target: f = "_self", isAnchorUnderlined: h = !0, dataTestId: p = Xo, ariaLabel: m, ..._ }) => { const [g, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [$, N] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), y = d || "button", T = () => { e && e(); }, D = { className: Ne.BUTTON, disabled: t || a, onClick: T, "aria-label": m }, U = () => { v(!1), N(!1); }, I = () => { N(!0); }, R = () => { N(!1); }, k = (M) => { M.key === "Tab" && v(!0); }, P = y === "button" && { type: l }, V = y === "a" && { target: f, href: c }; return ( // TODO: Refactor to button instead of div /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": p, className: E( Ne.BUTTON, r === "light" && Ne.LIGHT_BACKGROUND, r === "dark" && Ne.DARK_BACKGROUND, $ && Ne.HOVER, g && Ne.FOCUSED, (t || a) && Ne.DISABLED, !h && Ne.REMOVE_UNDERLINE, s ), onKeyUp: k, onBlur: U, onMouseOut: R, onMouseOver: I, onFocus: I, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( y, { ...P, ...V, ...D, ..._, ...r == "dark" && { "data-dark": !0 }, children: [ i && !o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E(Ne.ICON_WRAPPER, Ne.ICON_LEFT), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E(Ne.ICON, Ne.ICON_CHEVRON_FILLED_LEFT) } ) }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: Ne.BUTTON_TEXT, children: n }), o && !i && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E(Ne.ICON_WRAPPER, Ne.ICON_RIGHT), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( Ne.ICON, Ne.ICON_CHEVRON_FILLED_RIGHT ) } ) }) ] } ) } ) ); }, Xt = { BUTTON: "fmc-fab", BUTTON_SINGLE_ICON: "fds-icon fds-font--ford-icons__chat fds-icon--24", BUTTON_MULTIPLE_ICON: "fds-icon fds-font--ford-icons__chevron-up fds-icon--24", BUTTON_TEXT: "fmc-fab__text", BUTTON_FIXED: "fmc-fabs fmc-fabs--fixed", DISABLED: "disabled" }, qo = "FLOATING_ACTION_BUTTON_TEST_ID", l1 = ({ disabled: t = !1, onClick: e, title: n = "", fixed: r = !1, mode: a = "light", className: i, type: o = "button", icon: s = "", dataTestId: l = qo, ...d }) => { function c() { e && e(); } const f = () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "button", { "data-testid": l, ...d, className: E(Xt.BUTTON), onClick: c, disabled: t, type: o, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( `fds-icon ${s || "fds-font--ford-icons__chat"} fds-icon--24` ) } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { "data-testid": Xt.BUTTON_TEXT, className: Xt.BUTTON_TEXT, children: n }) ] } ); return r ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: Xt.BUTTON_FIXED, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(f, {}) }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(f, {}); }, Zo = { BUTTON: "cxc-icon-button", DISABLED: "disabled" }, Jo = "ICON_BUTTON_TEST_ID", d1 = ({ disabled: t = !1, onClick: e, mode: n = "light", className: r, type: a = "button", size: i = "medium", icon: o, dataTestId: s = Jo, ...l }) => { function d() { e && e(); } let c = "", f = "", h = "", p = "", m = "", _ = "8px"; switch (i) { case "large": c = "32px", f = "32px", h = "8px", p = "48px", m = "48px"; break; case "small": c = "20px", f = "20px", h = "6px", p = "32px", m = "32px"; break; case "extra-small": c = "16px", f = "16px", h = "4px", p = "24px", m = "24px", _ = "6px"; break; case "medium": default: c = "24px", f = "24px", h = "8px", p = "40px", m = "40px"; break; } const g = { width: c, height: f, margin: h }, v = o && react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(o, { style: g }); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { "data-testid": s, ...n === "dark" && { "data-dark": !0 }, style: { "--cxc-icon-button-width": p, "--cxc-icon-button-height": m, "--cxc-icon-button-border-radius": _ }, ...l, className: E(Zo.BUTTON), onClick: d, disabled: t, type: a, children: v } ); }, Qo = (t) => t.charAt(0) !== "/"; function es({ containerId: t, style: e, title: n, onClick: r, as: a, target: i, mode: o = "light", ariaLabel: s, isHighlighted: l, iconAlignment: d, ...c }) { const f = i ? { to: i, href: i, target: Qo(i) ? "_blank" : "_self" } : {}; if (e === "standard" || e === "primary") return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Tt, { id: t, title: n, onClick: r, as: a, mode: o, ariaLabel: s, isHighlighted: l, iconAlignment: d, ...f, ...c } ); if (e === "outlined") return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Tt, { id: t, outlined: !0, title: n, onClick: r, as: a, mode: o, ariaLabel: s, isHighlighted: l, iconAlignment: d, ...f, ...c } ); if (e === "text" || e === "secondary") return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ui, { id: t, title: n, onClick: r, as: a, mode: o, ariaLabel: s, ...f, style: { margin: 0, height: "40px" }, ...c } ); } const ts = "TYPOGRAPHY_WRAPPER_TEST_ID", ns = ({ children: t, variant: e = "body", className: n, mode: r = "light", upperCase: a = !1, center: i = !1, style: o, dataTestId: s }) => { function l(h) { switch (h) { case "caption": return "p"; case "display1": return "h1"; case "display2": return "h2"; case "display3": return "h3"; case "title1": return "h4"; case "title2": return "h5"; case "title3": return "h6"; default: return "p"; } } const d = (h) => h === "caption" ? "p" : h === "display1" ? "h1" : h === "display2" ? "h2" : h === "display3" ? "h3" : h === "title1" ? "h4" : h === "title2" ? "h5" : h === "title3" ? "h6" : "p", c = l(e), f = d(e); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E(r === "light" ? "fds-bg--light" : "fds-bg--dark"), "data-testid": ts, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( c, { className: E( a && "fds-transform--uppercase", i && "cxc-center-text", e === "display1" && "fmc-type--heading1", e === "display2" && "fmc-type--heading2", e === "display3" && "fmc-type--heading3", e === "title1" && "fmc-type--heading4", e === "title2" && "fmc-type--heading5", e === "title3" && "fmc-type--heading6", e === "subtitle1" && "fmc-type--subtitle1", e === "subtitle2" && "fmc-type--subtitle2", e === "body1" && "fmc-type--body1", e === "body2" && "fmc-type--body2", e === "button" && "fmc-type--content1", e === "caption" && "fmc-type--content2", n ), style: o, role: f, "data-testid": s, children: t } ) } ); }, rs = "BILL_DATA_TEST_ID", c1 = ({ maskColor: t = "dark", maskLocation: e = "bottom", justifyContent: n = "center", alignContent: r = "center", image: a, title: i, body: o, splitScreen: s = "none", height: l = "fullscreen", buttons: d = [], disclaimer: c = "", className: f, dataTestId: h = rs }) => { let p; return c && (p = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E( le.CONTENT_DISCLAIMER, t === "white" && le.WHITE, t === "dark" && le.DARK, t === "black" && le.BLACK ), "data-testid": `${h}_DISCLAIMER`, children: c } )), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { id: "FDSBillboard", "data-testid": h, className: E( le.COMPONENT, n === "start" && le.JUSTIFY_START, n === "center" && le.JUSTIFY_CENTER, n === "end" && le.JUSTIFY_END, r === "start" && le.ALIGN_START, r === "center" && le.ALIGN_CENTER, r === "end" && le.ALIGN_END, l === "two-thirds" && le.SIZE_TWO_THIRDS, l === "one-third" && le.SIZE_ONE_THIRD, s === "image right" && le.SPLIT_RIGHT, s === "image left" && le.SPLIT_LEFT, s === "image bottom" && le.SPLIT_BOTTOM, s === "image top" && le.SPLIT_TOP, f ), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": `${h}_IMAGE`, className: le.IMAGE, style: { backgroundImage: "url(" + a + ")" } } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": `${h}_MASK`, className: E( t !== "none" ? le.MASK : "", t === "white" && le.WHITE, t === "dark" && le.DARK, t === "black" && le.BLACK, e === "top" && le.MASK_TOP, e === "bottom" && le.MASK_BOTTOM, e === "left" && le.MASK_LEFT, e === "right" && le.MASK_RIGHT, e === "full" && le.MASK_FULL ) } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { "data-testid": `${h}_CONTENT`, className: `${le.CONTENT} ${le.CENTER}`, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ns, { variant: "display3", dataTestId: `${h}_TITLE`, className: E( t === "white" && le.WHITE, t === "dark" && le.DARK, t === "black" && le.BLACK, le.CONTENT_TITLE ), children: i } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "p", { "data-testid": `${h}_BODY`, className: E( t === "white" && le.WHITE, t === "dark" && le.DARK, t === "black" && le.BLACK, le.CONTENT_BODY ), children: o } ), d && d.length > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: d.map((m, _) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: le.CONTENT_BUTTON, "data-testid": `${h}_BUTTON_${_}`, children: es({ mode: t === "white" ? "light" : "dark", ...m }) }, `button-${_}` )) }), c && p ] } ) ] } ); }, fe = { GROUP: "fmc-cards", COMPONENT: "fmc-cards__card", SELECTED: "fmc-cards__card--selected", VIDEO: "fmc-cards__video", VIDEO_COVER: "fmc-cards__video-cover", VIDEO_FULL: "fmc-cards__video--full", VIDEO_PLAYING: "fmc-cards__video--playing", CAROUSEL: "fmc-cards__video--playing", TITLE: "fmc-cards__title", SUBTITLE: "fmc-cards__subtitle", MEDIA: "fmc-cards__media-area", IMAGE: "fmc-cards__image", IMAGE_WRAPPER: "fmc-cards__image-wrapper", CONTENT_WRAPPER: "fmc-cards__content-wrapper", CONTENT: "fmc-cards__content", BODY: "fmc-cards__body", FOOTER: "fmc-cards__footer", HORIZONTAL: "fmc-cards__card--horizontal", HORIZONTAL_25: "fmc-cards__card--horizontal-25", HORIZONTAL_75: "fmc-cards__card--horizontal-75", HORIZONTAL_REVERSE: "fmc-cards__card--horizontal-reverse", QUIET: "fmc-cards__card--quiet", QUIET_CARD: "fmc-cards__quiet-card", ALERT: "fmc-cards__alert", ALERT_SUCCESS: "fmc-cards__alert--success", ALERT_ERROR: "fmc-cards__alert--error", ALERT_CAUTION: "fmc-cards__alert--caution", UPPER_CASE: "fds-transform--uppercase", // ====================== FOOTER_BUTTON_CONTAINER: "fmc-cards__button-container", TITLE_CONTAINER: "fmc-cards__title-container", OVERFLOW_MENU_CONTAINER: "fmc-cards__overflow-menu__container", OVERFLOW_MENU_ICON: "fmc-cards__overflow-menu__icon" }, ye = { CARD_DEFAULT_DATA_TEST_ID: "CARD_DATA_TEST_ID", CARD_IMAGE_MDEIA_TEST_ID: "CARD_IMAGE_MEDIA_TEST_ID", CARD_IMAGE_TEST_ID: "CARD_IMAGE_TEST_ID", CARD_VIDEO_MEDIA_TEST_ID: "CARD_VIDEO_MEDIA_TEST_ID", CARD_VIDEO_COVER_TEST_ID: "CARD_VIDEO_COVER_TEST_ID", CARD_HTML5_VIDEO_TEST_ID: "CARD_HTML5_VIDEO_TEST_ID", CARD_HTML5_VIDEO_TRACK_TEST_ID: "CARD_HTML5_VIDEO_TRACK_TEST_ID", CARD_HTML5_VIDEO_SROUCE_TEST_ID: "CARD_HTML5_VIDEO_SROUCE_TEST_ID", CARD_ALERT_TEST_ID: "CARD_ALERT_TEST_ID", CARD_FOOTER_TEST_ID: "CARD_FOOTER_TEST_ID", CARD_BUTTON_ONE_TEST_ID: "CARD_BUTTON_ONE_TEST_ID", CARD_BUTTON_TWO_TEST_ID: "CARD_BUTTON_TWO_TEST_ID", CARD_BUTTON_THREE_TEST_ID: "CARD_BUTTON_THREE_TEST_ID", CARD_CONTENT_WRAPPER_TEST_ID: "CARD_CONTENT_WRAPPER_TEST_ID", CARD_CONTENT_TEST_ID: "CARD_CONTENT_TEST_ID", CARD_TITLE_CONTAINER_TEST_ID: "CARD_TITLE_CONTAINER_TEST_ID", CARD_TITLE_TEST_ID: "CARD_TITLE_TEST_ID", CARD_OVERFLOW_MENU_CONTAINER_TEST_ID: "CARD_OVERFLOW_MENU_CONTAINER_TEST_ID", CARD_OVERFLOW_MENU_ICON_TEST_ID: "CARD_OVERFLOW_MENU_ICON_TEST_ID", CARD_SUBTITLE_TEST_ID: "CARD_SUBTITLE_TEST_ID", CARD_CONTENT_BODY_TEST_ID: "CARD_CONTENT_BODY_TEST_ID" }, fi = react__WEBPACK_IMPORTED_MODULE_1__.createContext({ isQuiet: !1 }), u1 = ({ children: t, cardClassName: e, span: n, isHorizontal: r = !1, isQuiet: a = !1, imageRightAligned: i = !1, imageHorizontalSpan: o, isSelected: s = !1, dataTestId: l = ye.CARD_DEFAULT_DATA_TEST_ID }) => { const d = o === 3 ? fe.HORIZONTAL_25 : o === 9 ? fe.HORIZONTAL_75 : void 0, c = n ? `fds-layout-grid__cell--span-${n}` : r ? "fds-layout-grid__cell--span-12" : "fds-layout-grid__cell--span-4"; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { id: "FDSCard", "data-testid": l, className: E( fe.COMPONENT, r && fe.HORIZONTAL, r && d, r && i && fe.HORIZONTAL_REVERSE, a && fe.QUIET, s && fe.SELECTED, c, e ), "aria-selected": !!s, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(fi.Provider, { value: { isQuiet: a }, children: t }) } ); }, f1 = ({ alertLabel: t, alertType: e = "default", className: n, dataTestId: r = ye.CARD_ALERT_TEST_ID }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { role: "alert", "data-testid": r, className: E( fe.ALERT, e === "success" && fe.ALERT_SUCCESS, e === "caution" && fe.ALERT_CAUTION, e === "error" && fe.ALERT_ERROR, n ), children: t } ), h1 = ({ children: t, title: e, isTitleLowercased: n, subtitle: r, overflowMenu: a, footer: i, buttonOneText: o, buttonOneOnClick: s, buttonOneStyle: l = "primary", buttonTwoText: d, buttonTwoOnClick: c, buttonTwoStyle: f = "outlined", buttonThreeText: h, buttonThreeOnClick: p, buttonThreeStyle: m = "secondary", className: _, dataTestId: g = ye.CARD_CONTENT_WRAPPER_TEST_ID }) => { react__WEBPACK_IMPORTED_MODULE_1__.useContext(fi); const v = (N, y) => { if (N === "primary") return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Tt, { ...y }); if (N === "outlined") return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Tt, { outlined: !0, ...y }); if (N === "secondary") return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ui, { chevronRight: !0, ...y }); }, $ = i ? ( // Custom footer /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": ye.CARD_FOOTER_TEST_ID, "aria-label": "Card footer", className: E(fe.FOOTER), children: i } ) ) : ( // Built-in footer buttons (o || d || h) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { "data-testid": ye.CARD_FOOTER_TEST_ID, "aria-label": "Card footer", className: E(fe.FOOTER), children: [ o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": ye.CARD_BUTTON_ONE_TEST_ID, className: E(fe.FOOTER_BUTTON_CONTAINER), children: v(l, { title: o, onClick: s }) } ), o && d && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": ye.CARD_BUTTON_TWO_TEST_ID, className: E(fe.FOOTER_BUTTON_CONTAINER), children: v(f, { title: d, onClick: c }) } ), o && d && h && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": ye.CARD_BUTTON_THREE_TEST_ID, className: E(fe.FOOTER_BUTTON_CONTAINER), children: v(m, { title: h, onClick: p }) } ) ] } ) ); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": g, "aria-label": "Card content", className: E(fe.CONTENT_WRAPPER, _), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { "data-testid": ye.CARD_CONTENT_TEST_ID, className: E(fe.CONTENT), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { "data-testid": ye.CARD_TITLE_CONTAINER_TEST_ID, className: E(fe.TITLE_CONTAINER), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "h2", { "data-testid": ye.CARD_TITLE_TEST_ID, className: E( fe.TITLE, !n && fe.UPPER_CASE ), children: e } ), a ] } ), r && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "h3", { "data-testid": ye.CARD_SUBTITLE_TEST_ID, className: E(fe.SUBTITLE), children: r } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": ye.CARD_CONTENT_BODY_TEST_ID, className: E(fe.BODY), children: t } ), $ ] } ) } ); }, p1 = ({ children: t, imageSrc: e, imageAlt: n, imagePosition: r = "center center", className: a, dataTestId: i = ye.CARD_IMAGE_MDEIA_TEST_ID }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { "data-testid": i, "aria-label": "Image media", className: E(fe.MEDIA, a), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "img", { "data-testid": ye.CARD_IMAGE_TEST_ID, className: E(fe.IMAGE), src: e || "https://via.placeholder.com/350x150", alt: n || "", style: { objectPosition: r } } ), t ] } ), m1 = ({ children: t, videoCover: e, videoCoverPosition: n = "center center", videoSize: r = "wide", isVideoPlaying: a = !1, videoTrackProps: i, videoSources: o, videoRef: s, onPlayCustomVideoMedia: l, className: d, dataTestId: c = ye.CARD_VIDEO_MEDIA_TEST_ID, ...f }) => { const [h, p] = react__WEBPACK_IMPORTED_MODULE_1__.useState(!1), m = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null); react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => { m?.current && h && m.current.play(); }, [h]); const _ = () => { t && l ? l() : m?.current && m.current.paused && p(!0); }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { "data-testid": c, "aria-label": "Video media", role: "button", tabIndex: 0, className: E( fe.MEDIA, fe.VIDEO, r === "full" && fe.VIDEO_FULL, (a || h) && fe.VIDEO_PLAYING, d ), onClick: _, onKeyPress: (g) => g.key === "Enter" && _(), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": ye.CARD_VIDEO_COVER_TEST_ID, className: E(fe.VIDEO_COVER), style: e ? { backgroundImage: `url(${e})`, backgroundSize: "cover", backgroundRepeat: "no-repeat", backgroundPosition: n || "center center", zIndex: a || h ? 0 : 1 } : void 0 } ), t, !t && o ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "video", { "data-testid": ye.CARD_HTML5_VIDEO_TEST_ID, width: "100%", ref: void 0, controls: a || h, style: { zIndex: a || h ? 1 : 0 }, ...f, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "track", { "data-testid": ye.CARD_HTML5_VIDEO_TRACK_TEST_ID, default: !0, kind: "captions", ...i } ), o.map((g, v) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "source", { "data-testid": `${ye.CARD_HTML5_VIDEO_SROUCE_TEST_ID}_${v}`, ...g }, v )), "Sorry, your browser doesn't support embedded videos." ] } ) : null ] } ); }, $1 = ({ children: t, cardOverflowMenuContainerClassName: e, overflowMenuContainerStyle: n, onClickOverflowMenuIcon: r, dataTestId: a = ye.CARD_OVERFLOW_MENU_CONTAINER_TEST_ID }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { "data-testid": a, className: E( fe.OVERFLOW_MENU_CONTAINER, e ), style: n, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { "data-testid": ye.CARD_OVERFLOW_MENU_ICON_TEST_ID, "aria-label": "Ellipsis icon", role: "button", tabIndex: 0, className: E(fe.OVERFLOW_MENU_ICON), onClick: r, onKeyPress: (i) => i.key === "Enter" && r?.(), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fds-icon fds-icon--24 fds-font--ford-icons__ellipsis" }) } ), t ] } ), as = "CARD_GROUP_DATA_TEST_ID", is = ({ children: t, cardGroupClassName: e, dataTestId: n = as }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { id: "FDSCardGroup", "data-testid": n, className: E( fe.GROUP, // Conditional statement added because Card Carousel style conflicts with fds-layout-grid style { ["fds-layout-grid__inner"]: e != "fmc-card-carousel-group" }, e ), children: t } ), be = { COMPONENT: "js-fmc-carousel-container fmc-carousel-container", CAROUSEL: "fmc-carousel", CARD_CAROUSEL: "fmc-card-carousel", CARD_CAROUSEL_GROUP: "fmc-card-carousel-group", CAROUSEL_INDICATOR: "fmc-carousel-indicator", CAROUSEL_INDICATOR_BILLBOARD: "fmc-billboard-carousel", CAROUSEL_INDICATOR_WRAPPER: "fmc-carousel-indicator-wrapper", DIRECTIONAL_BUTTON: "fmc-carousel-indicator__directional-button", DISABLED_DIRECTIONAL_BUTTON: "fmc-carousel-indicator__button--disabled", DIRECTIONAL_BUTTON_PREVIOUS: "fmc-carousel-indicator__directional-button--previous", DIRECTIONAL_BUTTON_NEXT: "fmc-carousel-indicator__directional-button--next", PAGINATION: "fmc-carousel-indicator__pagination", PAGINATION_TEXT: "fmc-carousel-indicator__pagination-text", SLIDE_IMAGE: "fmc-carousel__image", ACTIVE_PANCAKE_BUTTON: "fmc-carousel-indicator__button--active", PANCAKE_BUTTON: "fmc-carousel-indicator__pancake-button", PANCAKE_BUTTONS: "fmc-carousel-indicator__pancake-buttons", PANCAKE: "fmc-carousel-indicator__pancake", INLINE_DIRECTIONAL_BUTTONS: "fmc-carousel-container--inline-directional-buttons" }; function Je() { return Je = Object.assign ? Object.assign.bind() : function(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e]; for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); } return t; }, Je.apply(this, arguments); } function ot(t) { "@babel/helpers - typeof"; return ot = 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; }, ot(t); } function os(t, e) { if (ot(t) !== "object" || t === null) return t; var n = t[Symbol.toPrimitive]; if (n !== void 0) { var r = n.call(t, e || "default"); if (ot(r) !== "object") return r; throw new TypeError("@@toPrimitive must return a primitive value."); } return (e === "string" ? String : Number)(t); } function hi(t) { var e = os(t, "string"); return ot(e) === "symbol" ? e : String(e); } function re(t, e, n) { return e = hi(e), e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } function Mr(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter(function(a) { return Object.getOwnPropertyDescriptor(t, a).enumerable; })), n.push.apply(n, r); } return n; } function F(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e] != null ? arguments[e] : {}; e % 2 ? Mr(Object(n), !0).forEach(function(r) { re(t, r, n[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Mr(Object(n)).forEach(function(r) { Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r)); }); } return t; } function Et(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function kr(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, hi(r.key), r); } } function bt(t, e, n) { return e && kr(t.prototype, e), n && kr(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function ae(t) { if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t; } function jn(t, e) { return jn = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, a) { return r.__proto__ = a, r; }, jn(t, e); } function Ct(t, e) { if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && jn(t, e); } function an(t) { return an = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) { return n.__proto__ || Object.getPrototypeOf(n); }, an(t); } function ss() { 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 ls(t, e) { if (e && (ot(e) === "object" || typeof e == "function")) return e; if (e !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return ae(t); } function Nt(t) { var e = ss(); return function() { var r = an(t), a; if (e) { var i = an(this).constructor; a = Reflect.construct(r, arguments, i); } else a = r.apply(this, arguments); return ls(this, a); }; } function ds(t, e) { if (t == null) return {}; var n = {}, r = Object.keys(t), a, i; for (i = 0; i < r.length; i++) a = r[i], !(e.indexOf(a) >= 0) && (n[a] = t[a]); return n; } function cs(t, e) { if (t == null) return {}; var n = ds(t, e), r, a; if (Object.getOwnPropertySymbols) { var i = Object.getOwnPropertySymbols(t); for (a = 0; a < i.length; a++) r = i[a], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]); } return n; } var us = { animating: !1, autoplaying: null, currentDirection: 0, currentLeft: null, currentSlide: 0, direction: 1, dragging: !1, edgeDragged: !1, initialized: !1, lazyLoadedList: [], listHeight: null, listWidth: null, scrolling: !1, slideCount: null, slideHeight: null, slideWidth: null, swipeLeft: null, swiped: !1, // used by swipeEvent. differentites between touch and swipe. swiping: !1, touchObject: { startX: 0, startY: 0, curX: 0, curY: 0 }, trackStyle: {}, trackWidth: 0, targetSlide: 0 }; function fs(t, e, n) { var r = n || {}, a = r.noTrailing, i = a === void 0 ? !1 : a, o = r.noLeading, s = o === void 0 ? !1 : o, l = r.debounceMode, d = l === void 0 ? void 0 : l, c, f = !1, h = 0; function p() { c && clearTimeout(c); } function m(g) { var v = g || {}, $ = v.upcomingOnly, N = $ === void 0 ? !1 : $; p(), f = !N; } function _() { for (var g = arguments.length, v = new Array(g), $ = 0; $ < g; $++) v[$] = arguments[$]; var N = this, y = Date.now() - h; if (f) return; function T() { h = Date.now(), e.apply(N, v); } function D() { c = void 0; } !s && d && !c && T(), p(), d === void 0 && y > t ? s ? (h = Date.now(), i || (c = setTimeout(d ? D : T, t))) : T() : i !== !0 && (c = setTimeout(d ? D : T, d === void 0 ? t - y : t)); } return _.cancel = m, _; } function hs(t, e, n) { var r = n || {}, a = r.atBegin, i = a === void 0 ? !1 : a; return fs(t, e, { debounceMode: i !== !1 }); } function _r(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } function ps(t) { if (t.__esModule) return t; var e = t.default; if (typeof e == "function") { var n = function r() { if (this instanceof r) { var a = [null]; a.push.apply(a, arguments); var i = Function.bind.apply(e, a); return new i(); } return e.apply(this, arguments); }; n.prototype = e.prototype; } else n = {}; return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(t).forEach(function(r) { var a = Object.getOwnPropertyDescriptor(t, r); Object.defineProperty(n, r, a.get ? a : { enumerable: !0, get: function() { return t[r]; } }); }), n; } var pi = { exports: {} }; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ (function(t) { (function() { var e = {}.hasOwnProperty; function n() { for (var r = [], a = 0; a < arguments.length; a++) { var i = arguments[a]; if (i) { var o = typeof i; if (o === "string" || o === "number") r.push(i); else if (Array.isArray(i)) { if (i.length) { var s = n.apply(null, i); s && r.push(s); } } else if (o === "object") { if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]")) { r.push(i.toString()); continue; } for (var l in i) e.call(i, l) && i[l] && r.push(l); } } } return r.join(" "); } t.exports ? (n.default = n, t.exports = n) : window.classNames = n; })(); })(pi); var ms = pi.exports; const nt = /* @__PURE__ */ _r(ms); function Yn(t, e, n) { return Math.max(e, Math.min(t, n)); } var $t = function(e) { var n = ["onTouchStart", "onTouchMove", "onWheel"]; n.includes(e._reactName) || e.preventDefault(); }, on = function(e) { for (var n = [], r = mi(e), a = $i(e), i = r; i < a; i++) e.lazyLoadedList.indexOf(i) < 0 && n.push(i); return n; }, mi = function(e) { return e.currentSlide - $s(e); }, $i = function(e) { return e.currentSlide + _s(e); }, $s = function(e) { return e.centerMode ? Math.floor(e.slidesToShow / 2) + (parseInt(e.centerPadding) > 0 ? 1 : 0) : 0; }, _s = function(e) { return e.centerMode ? Math.floor((e.slidesToShow - 1) / 2) + 1 + (parseInt(e.centerPadding) > 0 ? 1 : 0) : e.slidesToShow; }, zn = function(e) { return e && e.offsetWidth || 0; }, gr = function(e) { return e && e.offsetHeight || 0; }, _i = function(e) { var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r, a, i, o; return r = e.startX - e.curX, a = e.startY - e.curY, i = Math.atan2(a, r), o = Math.round(i * 180 / Math.PI), o < 0 && (o = 360 - Math.abs(o)), o <= 45 && o >= 0 || o <= 360 && o >= 315 ? "left" : o >= 135 && o <= 225 ? "right" : n === !0 ? o >= 35 && o <= 135 ? "up" : "down" : "vertical"; }, _n = function(e) { var n = !0; return e.infinite || (e.centerMode && e.currentSlide >= e.slideCount - 1 || e.slideCount <= e.slidesToShow || e.currentSlide >= e.slideCount - e.slidesToShow) && (n = !1), n; }, Sn = function(e, n) { var r = {}; return n.forEach(function(a) { return r[a] = e[a]; }), r; }, gs = function(e) { var n = react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(e.children), r = e.listRef, a = Math.ceil(zn(r)), i = e.trackRef && e.trackRef.node, o = Math.ceil(zn(i)), s; if (e.vertical) s = a; else { var l = e.centerMode && parseInt(e.centerPadding) * 2; typeof e.centerPadding == "string" && e.centerPadding.slice(-1) === "%" && (l *= a / 100), s = Math.ceil((a - l) / e.slidesToShow); } var d = r && gr(r.querySelector('[data-index="0"]')), c = d * e.slidesToShow, f = e.currentSlide === void 0 ? e.initialSlide : e.currentSlide; e.rtl && e.currentSlide === void 0 && (f = n - 1 - e.initialSlide); var h = e.lazyLoadedList || [], p = on(F(F({}, e), {}, { currentSlide: f, lazyLoadedList: h })); h = h.concat(p); var m = { slideCount: n, slideWidth: s, listWidth: a, trackWidth: o, currentSlide: f, slideHeight: d, listHeight: c, lazyLoadedList: h }; return e.autoplaying === null && e.autoplay && (m.autoplaying = "playing"), m; }, Ts = function(e) { var n = e.waitForAnimate, r = e.animating, a = e.fade, i = e.infinite, o = e.index, s = e.slideCount, l = e.lazyLoad, d = e.currentSlide, c = e.centerMode, f = e.slidesToScroll, h = e.slidesToShow, p = e.useCSS, m = e.lazyLoadedList; if (n && r) return {}; var _ = o, g, v, $, N = {}, y = {}, T = i ? o : Yn(o, 0, s - 1); if (a) { if (!i && (o < 0 || o >= s)) return {}; o < 0 ? _ = o + s : o >= s && (_ = o - s), l && m.indexOf(_) < 0 && (m = m.concat(_)), N = { animating: !0, currentSlide: _, lazyLoadedList: m, targetSlide: _ }, y = { animating: !1, targetSlide: _ }; } else g = _, _ < 0 ? (g = _ + s, i ? s % f !== 0 && (g = s - s % f) : g = 0) : !_n(e) && _ > d ? _ = g = d : c && _ >= s ? (_ = i ? s : s - 1, g = i ? 0 : s - 1) : _ >= s && (g = _ - s, i ? s % f !== 0 && (g = 0) : g = s - h), !i && _ + h >= s && (g = s - h), v = Ft(F(F({}, e), {}, { slideIndex: _ })), $ = Ft(F(F({}, e), {}, { slideIndex: g })), i || (v === $ && (_ = g), v = $), l && (m = m.concat(on(F(F({}, e), {}, { currentSlide: _ })))), p ? (N = { animating: !0, currentSlide: g, trackStyle: gi(F(F({}, e), {}, { left: v })), lazyLoadedList: m, targetSlide: T }, y = { animating: !1, currentSlide: g, trackStyle: xt(F(F({}, e), {}, { left: $ })), swipeLeft: null, targetSlide: T }) : N = { currentSlide: g, trackStyle: xt(F(F({}, e), {}, { left: $ })), lazyLoadedList: m, targetSlide: T }; return { state: N, nextState: y }; }, vs = function(e, n) { var r, a, i, o, s, l = e.slidesToScroll, d = e.slidesToShow, c = e.slideCount, f = e.currentSlide, h = e.targetSlide, p = e.lazyLoad, m = e.infinite; if (o = c % l !== 0, r = o ? 0 : (c - f) % l, n.message === "previous") i = r === 0 ? l : d - r, s = f - i, p && !m && (a = f - i, s = a === -1 ? c - 1 : a), m || (s = h - l); else if (n.message === "next") i = r === 0 ? l : r, s = f + i, p && !m && (s = (f + l) % c + r), m || (s = h + l); else if (n.message === "dots") s = n.index * n.slidesToScroll; else if (n.message === "children") { if (s = n.index, m) { var _ = Os(F(F({}, e), {}, { targetSlide: s })); s > n.currentSlide && _ === "left" ? s = s - c : s < n.currentSlide && _ === "right" && (s = s + c); } } else n.message === "index" && (s = Number(n.index)); return s; }, ys = function(e, n, r) { return e.target.tagName.match("TEXTAREA|INPUT|SELECT") || !n ? "" : e.keyCode === 37 ? r ? "next" : "previous" : e.keyCode === 39 ? r ? "previous" : "next" : ""; }, Es = function(e, n, r) { return e.target.tagName === "IMG" && $t(e), !n || !r && e.type.indexOf("mouse") !== -1 ? "" : { dragging: !0, touchObject: { startX: e.touches ? e.touches[0].pageX : e.clientX, startY: e.touches ? e.touches[0].pageY : e.clientY, curX: e.touches ? e.touches[0].pageX : e.clientX, curY: e.touches ? e.touches[0].pageY : e.clientY } }; }, bs = function(e, n) { var r = n.scrolling, a = n.animating, i = n.vertical, o = n.swipeToSlide, s = n.verticalSwiping, l = n.rtl, d = n.currentSlide, c = n.edgeFriction, f = n.edgeDragged, h = n.onEdge, p = n.swiped, m = n.swiping, _ = n.slideCount, g = n.slidesToScroll, v = n.infinite, $ = n.touchObject, N = n.swipeEvent, y = n.listHeight, T = n.listWidth; if (!r) { if (a) return $t(e); i && o && s && $t(e); var D, U = {}, I = Ft(n); $.curX = e.touches ? e.touches[0].pageX : e.clientX, $.curY = e.touches ? e.touches[0].pageY : e.clientY, $.swipeLength = Math.round(Math.sqrt(Math.pow($.curX - $.startX, 2))); var R = Math.round(Math.sqrt(Math.pow($.curY - $.startY, 2))); if (!s && !m && R > 10) return { scrolling: !0 }; s && ($.swipeLength = R); var k = (l ? -1 : 1) * ($.curX > $.startX ? 1 : -1); s && (k = $.curY > $.startY ? 1 : -1); var P = Math.ceil(_ / g), V = _i(n.touchObject, s), M = $.swipeLength; return v || (d === 0 && (V === "right" || V === "down") || d + 1 >= P && (V === "left" || V === "up") || !_n(n) && (V === "left" || V === "up")) && (M = $.swipeLength * c, f === !1 && h && (h(V), U.edgeDragged = !0)), !p && N && (N(V), U.swiped = !0), i ? D = I + M * (y / T) * k : l ? D = I - M * k : D = I + M * k, s && (D = I + M * k), U = F(F({}, U), {}, { touchObject: $, swipeLeft: D, trackStyle: xt(F(F({}, n), {}, { left: D })) }), Math.abs($.curX - $.startX) < Math.abs($.curY - $.startY) * 0.8 || $.swipeLength > 10 && (U.swiping = !0, $t(e)), U; } }, Cs = function(e, n) { var r = n.dragging, a = n.swipe, i = n.touchObject, o = n.listWidth, s = n.touchThreshold, l = n.verticalSwiping, d = n.listHeight, c = n.swipeToSlide, f = n.scrolling, h = n.onSwipe, p = n.targetSlide, m = n.currentSlide, _ = n.infinite; if (!r) return a && $t(e), {}; var g = l ? d / s : o / s, v = _i(i, l), $ = { dragging: !1, edgeDragged: !1, scrolling: !1, swiping: !1, swiped: !1, swipeLeft: null, touchObject: {} }; if (f || !i.swipeLength) return $; if (i.swipeLength > g) { $t(e), h && h(v); var N, y, T = _ ? m : p; switch (v) { case "left": case "up": y = T + Ur(n), N = c ? Br(n, y) : y, $.currentDirection = 0; break; case "right": case "down": y = T - Ur(n), N = c ? Br(n, y) : y, $.currentDirection = 1; break; default: N = T; } $.triggerSlideHandler = N; } else { var D = Ft(n); $.trackStyle = gi(F(F({}, n), {}, { left: D })); } return $; }, Ns = function(e) { for (var n = e.infinite ? e.slideCount * 2 : e.slideCount, r = e.infinite ? e.slidesToShow * -1 : 0, a = e.infinite ? e.slidesToShow * -1 : 0, i = []; r < n; ) i.push(r), r = a + e.slidesToScroll, a += Math.min(e.slidesToScroll, e.slidesToShow); return i; }, Br = function(e, n) { var r = Ns(e), a = 0; if (n > r[r.length - 1]) n = r[r.length - 1]; else for (var i in r) { if (n < r[i]) { n = a; break; } a = r[i]; } return n; }, Ur = function(e) { var n = e.centerMode ? e.slideWidth * Math.floor(e.slidesToShow / 2) : 0; if (e.swipeToSlide) { var r, a = e.listRef, i = a.querySelectorAll && a.querySelectorAll(".slick-slide") || []; if (Array.from(i).every(function(l) { if (e.vertical) { if (l.offsetTop + gr(l) / 2 > e.swipeLeft * -1) return r = l, !1; } else if (l.offsetLeft - n + zn(l) / 2 > e.swipeLeft * -1) return r = l, !1; return !0; }), !r) return 0; var o = e.rtl === !0 ? e.slideCount - e.currentSlide : e.currentSlide, s = Math.abs(r.dataset.index - o) || 1; return s; } else return e.slidesToScroll; }, Tr = function(e, n) { return ( // eslint-disable-next-line no-prototype-builtins n.reduce(function(r, a) { return r && e.hasOwnProperty(a); }, !0) ? null : console.error("Keys Missing:", e) ); }, xt = function(e) { Tr(e, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth"]); var n, r, a = e.slideCount + 2 * e.slidesToShow; e.vertical ? r = a * e.slideHeight : n = Ss(e) * e.slideWidth; var i = { opacity: 1, transition: "", WebkitTransition: "" }; if (e.useTransform) { var o = e.vertical ? "translate3d(0px, " + e.left + "px, 0px)" : "translate3d(" + e.left + "px, 0px, 0px)", s = e.vertical ? "translate3d(0px, " + e.left + "px, 0px)" : "translate3d(" + e.left + "px, 0px, 0px)", l = e.vertical ? "translateY(" + e.left + "px)" : "translateX(" + e.left + "px)"; i = F(F({}, i), {}, { WebkitTransform: o, transform: s, msTransform: l }); } else e.vertical ? i.top = e.left : i.left = e.left; return e.fade && (i = { opacity: 1 }), n && (i.width = n), r && (i.height = r), window && !window.addEventListener && window.attachEvent && (e.vertical ? i.marginTop = e.left + "px" : i.marginLeft = e.left + "px"), i; }, gi = function(e) { Tr(e, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth", "speed", "cssEase"]); var n = xt(e); return e.useTransform ? (n.WebkitTransition = "-webkit-transform " + e.speed + "ms " + e.cssEase, n.transition = "transform " + e.speed + "ms " + e.cssEase) : e.vertical ? n.transition = "top " + e.speed + "ms " + e.cssEase : n.transition = "left " + e.speed + "ms " + e.cssEase, n; }, Ft = function(e) { if (e.unslick) return 0; Tr(e, ["slideIndex", "trackRef", "infinite", "centerMode", "slideCount", "slidesToShow", "slidesToScroll", "slideWidth", "listWidth", "variableWidth", "slideHeight"]); var n = e.slideIndex, r = e.trackRef, a = e.infinite, i = e.centerMode, o = e.slideCount, s = e.slidesToShow, l = e.slidesToScroll, d = e.slideWidth, c = e.listWidth, f = e.variableWidth, h = e.slideHeight, p = e.fade, m = e.vertical, _ = 0, g, v, $ = 0; if (p || e.slideCount === 1) return 0; var N = 0; if (a ? (N = -ze(e), o % l !== 0 && n + l > o && (N = -(n > o ? s - (n - o) : o % l)), i && (N += parseInt(s / 2))) : (o % l !== 0 && n + l > o && (N = s - o % l), i && (N = parseInt(s / 2))), _ = N * d, $ = N * h, m ? g = n * h * -1 + $ : g = n * d * -1 + _, f === !0) { var y, T = r && r.node; if (y = n + ze(e), v = T && T.childNodes[y], g = v ? v.offsetLeft * -1 : 0, i === !0) { y = a ? n + ze(e) : n, v = T && T.children[y], g = 0; for (var D = 0; D < y; D++) g -= T && T.children[D] && T.children[D].offsetWidth; g -= parseInt(e.centerPadding), g += v && (c - v.offsetWidth) / 2; } } return g; }, ze = function(e) { return e.unslick || !e.infinite ? 0 : e.variableWidth ? e.slideCount : e.slidesToShow + (e.centerMode ? 1 : 0); }, en = function(e) { return e.unslick || !e.infinite ? 0 : e.slideCount; }, Ss = function(e) { return e.slideCount === 1 ? 1 : ze(e) + e.slideCount + en(e); }, Os = function(e) { return e.targetSlide > e.currentSlide ? e.targetSlide > e.currentSlide + As(e) ? "left" : "right" : e.targetSlide < e.currentSlide - Is(e) ? "right" : "left"; }, As = function(e) { var n = e.slidesToShow, r = e.centerMode, a = e.rtl, i = e.centerPadding; if (r) { var o = (n - 1) / 2 + 1; return parseInt(i) > 0 && (o += 1), a && n % 2 === 0 && (o += 1), o; } return a ? 0 : n - 1; }, Is = function(e) { var n = e.slidesToShow, r = e.centerMode, a = e.rtl, i = e.centerPadding; if (r) { var o = (n - 1) / 2 + 1; return parseInt(i) > 0 && (o += 1), !a && n % 2 === 0 && (o += 1), o; } return a ? n - 1 : 0; }, Hr = function() { return !!(typeof window < "u" && window.document && window.document.createElement); }, On = function(e) { var n, r, a, i, o; e.rtl ? o = e.slideCount - 1 - e.index : o = e.index, a = o < 0 || o >= e.slideCount, e.centerMode ? (i = Math.floor(e.slidesToShow / 2), r = (o - e.currentSlide) % e.slideCount === 0, o > e.currentSlide - i - 1 && o <= e.currentSlide + i && (n = !0)) : n = e.currentSlide <= o && o < e.currentSlide + e.slidesToShow; var s; e.targetSlide < 0 ? s = e.targetSlide + e.slideCount : e.targetSlide >= e.slideCount ? s = e.targetSlide - e.slideCount : s = e.targetSlide; var l = o === s; return { "slick-slide": !0, "slick-active": n, "slick-center": r, "slick-cloned": a, "slick-current": l // dubious in case of RTL }; }, Rs = function(e) { var n = {}; return (e.variableWidth === void 0 || e.variableWidth === !1) && (n.width = e.slideWidth), e.fade && (n.position = "relative", e.vertical && e.slideHeight ? n.top = -e.index * parseInt(e.slideHeight) : n.left = -e.index * parseInt(e.slideWidth), n.opacity = e.currentSlide === e.index ? 1 : 0, e.useCSS && (n.transition = "opacity " + e.speed + "ms " + e.cssEase + ", visibility " + e.speed + "ms " + e.cssEase)), n; }, An = function(e, n) { return e.key + "-" + n; }, Ds = function(e) { var n, r = [], a = [], i = [], o = react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(e.children), s = mi(e), l = $i(e); return react__WEBPACK_IMPORTED_MODULE_1___default().Children.forEach(e.children, function(d, c) { var f, h = { message: "children", index: c, slidesToScroll: e.slidesToScroll, currentSlide: e.currentSlide }; !e.lazyLoad || e.lazyLoad && e.lazyLoadedList.indexOf(c) >= 0 ? f = d : f = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", null); var p = Rs(F(F({}, e), {}, { index: c })), m = f.props.className || "", _ = On(F(F({}, e), {}, { index: c })); if (r.push(/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(f, { key: "original" + An(f, c), "data-index": c, className: nt(_, m), tabIndex: "-1", "aria-hidden": !_["slick-active"], style: F(F({ outline: "none" }, f.props.style || {}), p), onClick: function($) { f.props && f.props.onClick && f.props.onClick($), e.focusOnSelect && e.focusOnSelect(h); } })), e.infinite && e.fade === !1) { var g = o - c; g <= ze(e) && o !== e.slidesToShow && (n = -g, n >= s && (f = d), _ = On(F(F({}, e), {}, { index: n })), a.push(/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(f, { key: "precloned" + An(f, n), "data-index": n, tabIndex: "-1", className: nt(_, m), "aria-hidden": !_["slick-active"], style: F(F({}, f.props.style || {}), p), onClick: function($) { f.props && f.props.onClick && f.props.onClick($), e.focusOnSelect && e.focusOnSelect(h); } }))), o !== e.slidesToShow && (n = o + c, n < l && (f = d), _ = On(F(F({}, e), {}, { index: n })), i.push(/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(f, { key: "postcloned" + An(f, n), "data-index": n, tabIndex: "-1", className: nt(_, m), "aria-hidden": !_["slick-active"], style: F(F({}, f.props.style || {}), p), onClick: function($) { f.props && f.props.onClick && f.props.onClick($), e.focusOnSelect && e.focusOnSelect(h); } }))); } }), e.rtl ? a.concat(r, i).reverse() : a.concat(r, i); }, Ps = /* @__PURE__ */ function(t) { Ct(n, t); var e = Nt(n); function n() { var r; Et(this, n); for (var a = arguments.length, i = new Array(a), o = 0; o < a; o++) i[o] = arguments[o]; return r = e.call.apply(e, [this].concat(i)), re(ae(r), "node", null), re(ae(r), "handleRef", function(s) { r.node = s; }), r; } return bt(n, [{ key: "render", value: function() { var a = Ds(this.props), i = this.props, o = i.onMouseEnter, s = i.onMouseOver, l = i.onMouseLeave, d = { onMouseEnter: o, onMouseOver: s, onMouseLeave: l }; return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", Je({ ref: this.handleRef, className: "slick-track", style: this.props.trackStyle }, d), a); } }]), n; }((react__WEBPACK_IMPORTED_MODULE_1___default().PureComponent)), ws = function(e) { var n; return e.infinite ? n = Math.ceil(e.slideCount / e.slidesToScroll) : n = Math.ceil((e.slideCount - e.slidesToShow) / e.slidesToScroll) + 1, n; }, Ls = /* @__PURE__ */ function(t) { Ct(n, t); var e = Nt(n); function n() { return Et(this, n), e.apply(this, arguments); } return bt(n, [{ key: "clickHandler", value: function(a, i) { i.preventDefault(), this.props.clickHandler(a); } }, { key: "render", value: function() { for (var a = this.props, i = a.onMouseEnter, o = a.onMouseOver, s = a.onMouseLeave, l = a.infinite, d = a.slidesToScroll, c = a.slidesToShow, f = a.slideCount, h = a.currentSlide, p = ws({ slideCount: f, slidesToScroll: d, slidesToShow: c, infinite: l }), m = { onMouseEnter: i, onMouseOver: o, onMouseLeave: s }, _ = [], g = 0; g < p; g++) { var v = (g + 1) * d - 1, $ = l ? v : Yn(v, 0, f - 1), N = $ - (d - 1), y = l ? N : Yn(N, 0, f - 1), T = nt({ "slick-active": l ? h >= y && h <= $ : h === y }), D = { message: "dots", index: g, slidesToScroll: d, currentSlide: h }, U = this.clickHandler.bind(this, D); _ = _.concat(/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("li", { key: g, className: T }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(this.props.customPaging(g), { onClick: U }))); } return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(this.props.appendDots(_), F({ className: this.props.dotsClass }, m)); } }]), n; }((react__WEBPACK_IMPORTED_MODULE_1___default().PureComponent)), xs = /* @__PURE__ */ function(t) { Ct(n, t); var e = Nt(n); function n() { return Et(this, n), e.apply(this, arguments); } return bt(n, [{ key: "clickHandler", value: function(a, i) { i && i.preventDefault(), this.props.clickHandler(a, i); } }, { key: "render", value: function() { var a = { "slick-arrow": !0, "slick-prev": !0 }, i = this.clickHandler.bind(this, { message: "previous" }); !this.props.infinite && (this.props.currentSlide === 0 || this.props.slideCount <= this.props.slidesToShow) && (a["slick-disabled"] = !0, i = null); var o = { key: "0", "data-role": "none", className: nt(a), style: { display: "block" }, onClick: i }, s = { currentSlide: this.props.currentSlide, slideCount: this.props.slideCount }, l; return this.props.prevArrow ? l = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(this.props.prevArrow, F(F({}, o), s)) : l = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("button", Je({ key: "0", type: "button" }, o), " ", "Previous"), l; } }]), n; }((react__WEBPACK_IMPORTED_MODULE_1___default().PureComponent)), Fs = /* @__PURE__ */ function(t) { Ct(n, t); var e = Nt(n); function n() { return Et(this, n), e.apply(this, arguments); } return bt(n, [{ key: "clickHandler", value: function(a, i) { i && i.preventDefault(), this.props.clickHandler(a, i); } }, { key: "render", value: function() { var a = { "slick-arrow": !0, "slick-next": !0 }, i = this.clickHandler.bind(this, { message: "next" }); _n(this.props) || (a["slick-disabled"] = !0, i = null); var o = { key: "1", "data-role": "none", className: nt(a), style: { display: "block" }, onClick: i }, s = { currentSlide: this.props.currentSlide, slideCount: this.props.slideCount }, l; return this.props.nextArrow ? l = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(this.props.nextArrow, F(F({}, o), s)) : l = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("button", Je({ key: "1", type: "button" }, o), " ", "Next"), l; } }]), n; }((react__WEBPACK_IMPORTED_MODULE_1___default().PureComponent)), Ti = function() { if (typeof Map < "u") return Map; function t(e, n) { var r = -1; return e.some(function(a, i) { return a[0] === n ? (r = i, !0) : !1; }), r; } return ( /** @class */ function() { function e() { this.__entries__ = []; } return Object.defineProperty(e.prototype, "size", { /** * @returns {boolean} */ get: function() { return this.__entries__.length; }, enumerable: !0, configurable: !0 }), e.prototype.get = function(n) { var r = t(this.__entries__, n), a = this.__entries__[r]; return a && a[1]; }, e.prototype.set = function(n, r) { var a = t(this.__entries__, n); ~a ? this.__entries__[a][1] = r : this.__entries__.push([n, r]); }, e.prototype.delete = function(n) { var r = this.__entries__, a = t(r, n); ~a && r.splice(a, 1); }, e.prototype.has = function(n) { return !!~t(this.__entries__, n); }, e.prototype.clear = function() { this.__entries__.splice(0); }, e.prototype.forEach = function(n, r) { r === void 0 && (r = null); for (var a = 0, i = this.__entries__; a < i.length; a++) { var o = i[a]; n.call(r, o[1], o[0]); } }, e; }() ); }(), Xn = typeof window < "u" && typeof document < "u" && window.document === document, sn = function() { return typeof __webpack_require__.g < "u" && __webpack_require__.g.Math === Math ? __webpack_require__.g : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")(); }(), Ms = function() { return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(sn) : function(t) { return setTimeout(function() { return t(Date.now()); }, 1e3 / 60); }; }(), ks = 2; function Bs(t, e) { var n = !1, r = !1, a = 0; function i() { n && (n = !1, t()), r && s(); } function o() { Ms(i); } function s() { var l = Date.now(); if (n) { if (l - a < ks) return; r = !0; } else n = !0, r = !1, setTimeout(o, e); a = l; } return s; } var Us = 20, Hs = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], Ws = typeof MutationObserver < "u", Vs = ( /** @class */ function() { function t() { this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = Bs(this.refresh.bind(this), Us); } return t.prototype.addObserver = function(e) { ~this.observers_.indexOf(e) || this.observers_.push(e), this.connected_ || this.connect_(); }, t.prototype.removeObserver = function(e) { var n = this.observers_, r = n.indexOf(e); ~r && n.splice(r, 1), !n.length && this.connected_ && this.disconnect_(); }, t.prototype.refresh = function() { var e = this.updateObservers_(); e && this.refresh(); }, t.prototype.updateObservers_ = function() { var e = this.observers_.filter(function(n) { return n.gatherActive(), n.hasActive(); }); return e.forEach(function(n) { return n.broadcastActive(); }), e.length > 0; }, t.prototype.connect_ = function() { !Xn || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), Ws ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, { attributes: !0, childList: !0, characterData: !0, subtree: !0 })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0); }, t.prototype.disconnect_ = function() { !Xn || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1); }, t.prototype.onTransitionEnd_ = function(e) { var n = e.propertyName, r = n === void 0 ? "" : n, a = Hs.some(function(i) { return !!~r.indexOf(i); }); a && this.refresh(); }, t.getInstance = function() { return this.instance_ || (this.instance_ = new t()), this.instance_; }, t.instance_ = null, t; }() ), vi = function(t, e) { for (var n = 0, r = Object.keys(e); n < r.length; n++) { var a = r[n]; Object.defineProperty(t, a, { value: e[a], enumerable: !1, writable: !1, configurable: !0 }); } return t; }, vt = function(t) { var e = t && t.ownerDocument && t.ownerDocument.defaultView; return e || sn; }, yi = gn(0, 0, 0, 0); function ln(t) { return parseFloat(t) || 0; } function Wr(t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; return e.reduce(function(r, a) { var i = t["border-" + a + "-width"]; return r + ln(i); }, 0); } function Gs(t) { for (var e = ["top", "right", "bottom", "left"], n = {}, r = 0, a = e; r < a.length; r++) { var i = a[r], o = t["padding-" + i]; n[i] = ln(o); } return n; } function Ks(t) { var e = t.getBBox(); return gn(0, 0, e.width, e.height); } function js(t) { var e = t.clientWidth, n = t.clientHeight; if (!e && !n) return yi; var r = vt(t).getComputedStyle(t), a = Gs(r), i = a.left + a.right, o = a.top + a.bottom, s = ln(r.width), l = ln(r.height); if (r.boxSizing === "border-box" && (Math.round(s + i) !== e && (s -= Wr(r, "left", "right") + i), Math.round(l + o) !== n && (l -= Wr(r, "top", "bottom") + o)), !zs(t)) { var d = Math.round(s + i) - e, c = Math.round(l + o) - n; Math.abs(d) !== 1 && (s -= d), Math.abs(c) !== 1 && (l -= c); } return gn(a.left, a.top, s, l); } var Ys = function() { return typeof SVGGraphicsElement < "u" ? function(t) { return t instanceof vt(t).SVGGraphicsElement; } : function(t) { return t instanceof vt(t).SVGElement && typeof t.getBBox == "function"; }; }(); function zs(t) { return t === vt(t).document.documentElement; } function Xs(t) { return Xn ? Ys(t) ? Ks(t) : js(t) : yi; } function qs(t) { var e = t.x, n = t.y, r = t.width, a = t.height, i = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, o = Object.create(i.prototype); return vi(o, { x: e, y: n, width: r, height: a, top: n, right: e + r, bottom: a + n, left: e }), o; } function gn(t, e, n, r) { return { x: t, y: e, width: n, height: r }; } var Zs = ( /** @class */ function() { function t(e) { this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = gn(0, 0, 0, 0), this.target = e; } return t.prototype.isActive = function() { var e = Xs(this.target); return this.contentRect_ = e, e.width !== this.broadcastWidth || e.height !== this.broadcastHeight; }, t.prototype.broadcastRect = function() { var e = this.contentRect_; return this.broadcastWidth = e.width, this.broadcastHeight = e.height, e; }, t; }() ), Js = ( /** @class */ function() { function t(e, n) { var r = qs(n); vi(this, { target: e, contentRect: r }); } return t; }() ), Qs = ( /** @class */ function() { function t(e, n, r) { if (this.activeObservations_ = [], this.observations_ = new Ti(), typeof e != "function") throw new TypeError("The callback provided as parameter 1 is not a function."); this.callback_ = e, this.controller_ = n, this.callbackCtx_ = r; } return t.prototype.observe = function(e) { if (!arguments.length) throw new TypeError("1 argument required, but only 0 present."); if (!(typeof Element > "u" || !(Element instanceof Object))) { if (!(e instanceof vt(e).Element)) throw new TypeError('parameter 1 is not of type "Element".'); var n = this.observations_; n.has(e) || (n.set(e, new Zs(e)), this.controller_.addObserver(this), this.controller_.refresh()); } }, t.prototype.unobserve = function(e) { if (!arguments.length) throw new TypeError("1 argument required, but only 0 present."); if (!(typeof Element > "u" || !(Element instanceof Object))) { if (!(e instanceof vt(e).Element)) throw new TypeError('parameter 1 is not of type "Element".'); var n = this.observations_; n.has(e) && (n.delete(e), n.size || this.controller_.removeObserver(this)); } }, t.prototype.disconnect = function() { this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this); }, t.prototype.gatherActive = function() { var e = this; this.clearActive(), this.observations_.forEach(function(n) { n.isActive() && e.activeObservations_.push(n); }); }, t.prototype.broadcastActive = function() { if (this.hasActive()) { var e = this.callbackCtx_, n = this.activeObservations_.map(function(r) { return new Js(r.target, r.broadcastRect()); }); this.callback_.call(e, n, e), this.clearActive(); } }, t.prototype.clearActive = function() { this.activeObservations_.splice(0); }, t.prototype.hasActive = function() { return this.activeObservations_.length > 0; }, t; }() ), Ei = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new Ti(), bi = ( /** @class */ function() { function t(e) { if (!(this instanceof t)) throw new TypeError("Cannot call a class as a function."); if (!arguments.length) throw new TypeError("1 argument required, but only 0 present."); var n = Vs.getInstance(), r = new Qs(e, n, this); Ei.set(this, r); } return t; }() ); [ "observe", "unobserve", "disconnect" ].forEach(function(t) { bi.prototype[t] = function() { var e; return (e = Ei.get(this))[t].apply(e, arguments); }; }); var el = function() { return typeof sn.ResizeObserver < "u" ? sn.ResizeObserver : bi; }(), tl = ["animating"], nl = /* @__PURE__ */ function(t) { Ct(n, t); var e = Nt(n); function n(r) { var a; Et(this, n), a = e.call(this, r), re(ae(a), "listRefHandler", function(o) { return a.list = o; }), re(ae(a), "trackRefHandler", function(o) { return a.track = o; }), re(ae(a), "adaptHeight", function() { if (a.props.adaptiveHeight && a.list) { var o = a.list.querySelector('[data-index="'.concat(a.state.currentSlide, '"]')); a.list.style.height = gr(o) + "px"; } }), re(ae(a), "componentDidMount", function() { if (a.props.onInit && a.props.onInit(), a.props.lazyLoad) { var o = on(F(F({}, a.props), a.state)); o.length > 0 && (a.setState(function(l) { return { lazyLoadedList: l.lazyLoadedList.concat(o) }; }), a.props.onLazyLoad && a.props.onLazyLoad(o)); } var s = F({ listRef: a.list, trackRef: a.track }, a.props); a.updateState(s, !0, function() { a.adaptHeight(), a.props.autoplay && a.autoPlay("playing"); }), a.props.lazyLoad === "progressive" && (a.lazyLoadTimer = setInterval(a.progressiveLazyLoad, 1e3)), a.ro = new el(function() { a.state.animating ? (a.onWindowResized(!1), a.callbackTimers.push(setTimeout(function() { return a.onWindowResized(); }, a.props.speed))) : a.onWindowResized(); }), a.ro.observe(a.list), document.querySelectorAll && Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"), function(l) { l.onfocus = a.props.pauseOnFocus ? a.onSlideFocus : null, l.onblur = a.props.pauseOnFocus ? a.onSlideBlur : null; }), window.addEventListener ? window.addEventListener("resize", a.onWindowResized) : window.attachEvent("onresize", a.onWindowResized); }), re(ae(a), "componentWillUnmount", function() { a.animationEndCallback && clearTimeout(a.animationEndCallback), a.lazyLoadTimer && clearInterval(a.lazyLoadTimer), a.callbackTimers.length && (a.callbackTimers.forEach(function(o) { return clearTimeout(o); }), a.callbackTimers = []), window.addEventListener ? window.removeEventListener("resize", a.onWindowResized) : window.detachEvent("onresize", a.onWindowResized), a.autoplayTimer && clearInterval(a.autoplayTimer), a.ro.disconnect(); }), re(ae(a), "componentDidUpdate", function(o) { if (a.checkImagesLoad(), a.props.onReInit && a.props.onReInit(), a.props.lazyLoad) { var s = on(F(F({}, a.props), a.state)); s.length > 0 && (a.setState(function(c) { return { lazyLoadedList: c.lazyLoadedList.concat(s) }; }), a.props.onLazyLoad && a.props.onLazyLoad(s)); } a.adaptHeight(); var l = F(F({ listRef: a.list, trackRef: a.track }, a.props), a.state), d = a.didPropsChange(o); d && a.updateState(l, d, function() { a.state.currentSlide >= react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(a.props.children) && a.changeSlide({ message: "index", index: react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(a.props.children) - a.props.slidesToShow, currentSlide: a.state.currentSlide }), (o.autoplay !== a.props.autoplay || o.autoplaySpeed !== a.props.autoplaySpeed) && (!o.autoplay && a.props.autoplay ? a.autoPlay("playing") : a.props.autoplay ? a.autoPlay("update") : a.pause("paused")); }); }), re(ae(a), "onWindowResized", function(o) { a.debouncedResize && a.debouncedResize.cancel(), a.debouncedResize = hs(50, function() { return a.resizeWindow(o); }), a.debouncedResize(); }), re(ae(a), "resizeWindow", function() { var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, s = !!(a.track && a.track.node); if (s) { var l = F(F({ listRef: a.list, trackRef: a.track }, a.props), a.state); a.updateState(l, o, function() { a.props.autoplay ? a.autoPlay("update") : a.pause("paused"); }), a.setState({ animating: !1 }), clearTimeout(a.animationEndCallback), delete a.animationEndCallback; } }), re(ae(a), "updateState", function(o, s, l) { var d = gs(o); o = F(F(F({}, o), d), {}, { slideIndex: d.currentSlide }); var c = Ft(o); o = F(F({}, o), {}, { left: c }); var f = xt(o); (s || react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(a.props.children) !== react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(o.children)) && (d.trackStyle = f), a.setState(d, l); }), re(ae(a), "ssrInit", function() { if (a.props.variableWidth) { var o = 0, s = 0, l = [], d = ze(F(F(F({}, a.props), a.state), {}, { slideCount: a.props.children.length })), c = en(F(F(F({}, a.props), a.state), {}, { slideCount: a.props.children.length })); a.props.children.forEach(function(U) { l.push(U.props.style.width), o += U.props.style.width; }); for (var f = 0; f < d; f++) s += l[l.length - 1 - f], o += l[l.length - 1 - f]; for (var h = 0; h < c; h++) o += l[h]; for (var p = 0; p < a.state.currentSlide; p++) s += l[p]; var m = { width: o + "px", left: -s + "px" }; if (a.props.centerMode) { var _ = "".concat(l[a.state.currentSlide], "px"); m.left = "calc(".concat(m.left, " + (100% - ").concat(_, ") / 2 ) "); } return { trackStyle: m }; } var g = react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(a.props.children), v = F(F(F({}, a.props), a.state), {}, { slideCount: g }), $ = ze(v) + en(v) + g, N = 100 / a.props.slidesToShow * $, y = 100 / $, T = -y * (ze(v) + a.state.currentSlide) * N / 100; a.props.centerMode && (T += (100 - y * N / 100) / 2); var D = { width: N + "%", left: T + "%" }; return { slideWidth: y + "%", trackStyle: D }; }), re(ae(a), "checkImagesLoad", function() { var o = a.list && a.list.querySelectorAll && a.list.querySelectorAll(".slick-slide img") || [], s = o.length, l = 0; Array.prototype.forEach.call(o, function(d) { var c = function() { return ++l && l >= s && a.onWindowResized(); }; if (!d.onclick) d.onclick = function() { return d.parentNode.focus(); }; else { var f = d.onclick; d.onclick = function(h) { f(h), d.parentNode.focus(); }; } d.onload || (a.props.lazyLoad ? d.onload = function() { a.adaptHeight(), a.callbackTimers.push(setTimeout(a.onWindowResized, a.props.speed)); } : (d.onload = c, d.onerror = function() { c(), a.props.onLazyLoadError && a.props.onLazyLoadError(); })); }); }), re(ae(a), "progressiveLazyLoad", function() { for (var o = [], s = F(F({}, a.props), a.state), l = a.state.currentSlide; l < a.state.slideCount + en(s); l++) if (a.state.lazyLoadedList.indexOf(l) < 0) { o.push(l); break; } for (var d = a.state.currentSlide - 1; d >= -ze(s); d--) if (a.state.lazyLoadedList.indexOf(d) < 0) { o.push(d); break; } o.length > 0 ? (a.setState(function(c) { return { lazyLoadedList: c.lazyLoadedList.concat(o) }; }), a.props.onLazyLoad && a.props.onLazyLoad(o)) : a.lazyLoadTimer && (clearInterval(a.lazyLoadTimer), delete a.lazyLoadTimer); }), re(ae(a), "slideHandler", function(o) { var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, l = a.props, d = l.asNavFor, c = l.beforeChange, f = l.onLazyLoad, h = l.speed, p = l.afterChange, m = a.state.currentSlide, _ = Ts(F(F(F({ index: o }, a.props), a.state), {}, { trackRef: a.track, useCSS: a.props.useCSS && !s })), g = _.state, v = _.nextState; if (g) { c && c(m, g.currentSlide); var $ = g.lazyLoadedList.filter(function(N) { return a.state.lazyLoadedList.indexOf(N) < 0; }); f && $.length > 0 && f($), !a.props.waitForAnimate && a.animationEndCallback && (clearTimeout(a.animationEndCallback), p && p(m), delete a.animationEndCallback), a.setState(g, function() { d && a.asNavForIndex !== o && (a.asNavForIndex = o, d.innerSlider.slideHandler(o)), v && (a.animationEndCallback = setTimeout(function() { var N = v.animating, y = cs(v, tl); a.setState(y, function() { a.callbackTimers.push(setTimeout(function() { return a.setState({ animating: N }); }, 10)), p && p(g.currentSlide), delete a.animationEndCallback; }); }, h)); }); } }), re(ae(a), "changeSlide", function(o) { var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, l = F(F({}, a.props), a.state), d = vs(l, o); if (!(d !== 0 && !d) && (s === !0 ? a.slideHandler(d, s) : a.slideHandler(d), a.props.autoplay && a.autoPlay("update"), a.props.focusOnSelect)) { var c = a.list.querySelectorAll(".slick-current"); c[0] && c[0].focus(); } }), re(ae(a), "clickHandler", function(o) { a.clickable === !1 && (o.stopPropagation(), o.preventDefault()), a.clickable = !0; }), re(ae(a), "keyHandler", function(o) { var s = ys(o, a.props.accessibility, a.props.rtl); s !== "" && a.changeSlide({ message: s }); }), re(ae(a), "selectHandler", function(o) { a.changeSlide(o); }), re(ae(a), "disableBodyScroll", function() { var o = function(l) { l = l || window.event, l.preventDefault && l.preventDefault(), l.returnValue = !1; }; window.ontouchmove = o; }), re(ae(a), "enableBodyScroll", function() { window.ontouchmove = null; }), re(ae(a), "swipeStart", function(o) { a.props.verticalSwiping && a.disableBodyScroll(); var s = Es(o, a.props.swipe, a.props.draggable); s !== "" && a.setState(s); }), re(ae(a), "swipeMove", function(o) { var s = bs(o, F(F(F({}, a.props), a.state), {}, { trackRef: a.track, listRef: a.list, slideIndex: a.state.currentSlide })); s && (s.swiping && (a.clickable = !1), a.setState(s)); }), re(ae(a), "swipeEnd", function(o) { var s = Cs(o, F(F(F({}, a.props), a.state), {}, { trackRef: a.track, listRef: a.list, slideIndex: a.state.currentSlide })); if (s) { var l = s.triggerSlideHandler; delete s.triggerSlideHandler, a.setState(s), l !== void 0 && (a.slideHandler(l), a.props.verticalSwiping && a.enableBodyScroll()); } }), re(ae(a), "touchEnd", function(o) { a.swipeEnd(o), a.clickable = !0; }), re(ae(a), "slickPrev", function() { a.callbackTimers.push(setTimeout(function() { return a.changeSlide({ message: "previous" }); }, 0)); }), re(ae(a), "slickNext", function() { a.callbackTimers.push(setTimeout(function() { return a.changeSlide({ message: "next" }); }, 0)); }), re(ae(a), "slickGoTo", function(o) { var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; if (o = Number(o), isNaN(o)) return ""; a.callbackTimers.push(setTimeout(function() { return a.changeSlide({ message: "index", index: o, currentSlide: a.state.currentSlide }, s); }, 0)); }), re(ae(a), "play", function() { var o; if (a.props.rtl) o = a.state.currentSlide - a.props.slidesToScroll; else if (_n(F(F({}, a.props), a.state))) o = a.state.currentSlide + a.props.slidesToScroll; else return !1; a.slideHandler(o); }), re(ae(a), "autoPlay", function(o) { a.autoplayTimer && clearInterval(a.autoplayTimer); var s = a.state.autoplaying; if (o === "update") { if (s === "hovered" || s === "focused" || s === "paused") return; } else if (o === "leave") { if (s === "paused" || s === "focused") return; } else if (o === "blur" && (s === "paused" || s === "hovered")) return; a.autoplayTimer = setInterval(a.play, a.props.autoplaySpeed + 50), a.setState({ autoplaying: "playing" }); }), re(ae(a), "pause", function(o) { a.autoplayTimer && (clearInterval(a.autoplayTimer), a.autoplayTimer = null); var s = a.state.autoplaying; o === "paused" ? a.setState({ autoplaying: "paused" }) : o === "focused" ? (s === "hovered" || s === "playing") && a.setState({ autoplaying: "focused" }) : s === "playing" && a.setState({ autoplaying: "hovered" }); }), re(ae(a), "onDotsOver", function() { return a.props.autoplay && a.pause("hovered"); }), re(ae(a), "onDotsLeave", function() { return a.props.autoplay && a.state.autoplaying === "hovered" && a.autoPlay("leave"); }), re(ae(a), "onTrackOver", function() { return a.props.autoplay && a.pause("hovered"); }), re(ae(a), "onTrackLeave", function() { return a.props.autoplay && a.state.autoplaying === "hovered" && a.autoPlay("leave"); }), re(ae(a), "onSlideFocus", function() { return a.props.autoplay && a.pause("focused"); }), re(ae(a), "onSlideBlur", function() { return a.props.autoplay && a.state.autoplaying === "focused" && a.autoPlay("blur"); }), re(ae(a), "render", function() { var o = nt("slick-slider", a.props.className, { "slick-vertical": a.props.vertical, "slick-initialized": !0 }), s = F(F({}, a.props), a.state), l = Sn(s, ["fade", "cssEase", "speed", "infinite", "centerMode", "focusOnSelect", "currentSlide", "lazyLoad", "lazyLoadedList", "rtl", "slideWidth", "slideHeight", "listHeight", "vertical", "slidesToShow", "slidesToScroll", "slideCount", "trackStyle", "variableWidth", "unslick", "centerPadding", "targetSlide", "useCSS"]), d = a.props.pauseOnHover; l = F(F({}, l), {}, { onMouseEnter: d ? a.onTrackOver : null, onMouseLeave: d ? a.onTrackLeave : null, onMouseOver: d ? a.onTrackOver : null, focusOnSelect: a.props.focusOnSelect && a.clickable ? a.selectHandler : null }); var c; if (a.props.dots === !0 && a.state.slideCount >= a.props.slidesToShow) { var f = Sn(s, ["dotsClass", "slideCount", "slidesToShow", "currentSlide", "slidesToScroll", "clickHandler", "children", "customPaging", "infinite", "appendDots"]), h = a.props.pauseOnDotsHover; f = F(F({}, f), {}, { clickHandler: a.changeSlide, onMouseEnter: h ? a.onDotsLeave : null, onMouseOver: h ? a.onDotsOver : null, onMouseLeave: h ? a.onDotsLeave : null }), c = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Ls, f); } var p, m, _ = Sn(s, ["infinite", "centerMode", "currentSlide", "slideCount", "slidesToShow", "prevArrow", "nextArrow"]); _.clickHandler = a.changeSlide, a.props.arrows && (p = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(xs, _), m = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Fs, _)); var g = null; a.props.vertical && (g = { height: a.state.listHeight }); var v = null; a.props.vertical === !1 ? a.props.centerMode === !0 && (v = { padding: "0px " + a.props.centerPadding }) : a.props.centerMode === !0 && (v = { padding: a.props.centerPadding + " 0px" }); var $ = F(F({}, g), v), N = a.props.touchMove, y = { className: "slick-list", style: $, onClick: a.clickHandler, onMouseDown: N ? a.swipeStart : null, onMouseMove: a.state.dragging && N ? a.swipeMove : null, onMouseUp: N ? a.swipeEnd : null, onMouseLeave: a.state.dragging && N ? a.swipeEnd : null, onTouchStart: N ? a.swipeStart : null, onTouchMove: a.state.dragging && N ? a.swipeMove : null, onTouchEnd: N ? a.touchEnd : null, onTouchCancel: a.state.dragging && N ? a.swipeEnd : null, onKeyDown: a.props.accessibility ? a.keyHandler : null }, T = { className: o, dir: "ltr", style: a.props.style }; return a.props.unslick && (y = { className: "slick-list" }, T = { className: o }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", T, a.props.unslick ? "" : p, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", Je({ ref: a.listRefHandler }, y), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Ps, Je({ ref: a.trackRefHandler }, l), a.props.children)), a.props.unslick ? "" : m, a.props.unslick ? "" : c); }), a.list = null, a.track = null, a.state = F(F({}, us), {}, { currentSlide: a.props.initialSlide, slideCount: react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(a.props.children) }), a.callbackTimers = [], a.clickable = !0, a.debouncedResize = null; var i = a.ssrInit(); return a.state = F(F({}, a.state), i), a; } return bt(n, [{ key: "didPropsChange", value: function(a) { for (var i = !1, o = 0, s = Object.keys(this.props); o < s.length; o++) { var l = s[o]; if (!a.hasOwnProperty(l)) { i = !0; break; } if (!(ot(a[l]) === "object" || typeof a[l] == "function") && a[l] !== this.props[l]) { i = !0; break; } } return i || react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(this.props.children) !== react__WEBPACK_IMPORTED_MODULE_1___default().Children.count(a.children); } }]), n; }((react__WEBPACK_IMPORTED_MODULE_1___default().Component)), rl = function(t) { return t.replace(/[A-Z]/g, function(e) { return "-" + e.toLowerCase(); }).toLowerCase(); }, al = rl, il = al, ol = function(t) { var e = /[height|width]$/; return e.test(t); }, Vr = function(t) { var e = "", n = Object.keys(t); return n.forEach(function(r, a) { var i = t[r]; r = il(r), ol(r) && typeof i == "number" && (i = i + "px"), i === !0 ? e += r : i === !1 ? e += "not " + r : e += "(" + r + ": " + i + ")", a < n.length - 1 && (e += " and "); }), e; }, sl = function(t) { var e = ""; return typeof t == "string" ? t : t instanceof Array ? (t.forEach(function(n, r) { e += Vr(n), r < t.length - 1 && (e += ", "); }), e) : Vr(t); }, ll = sl; const In = /* @__PURE__ */ _r(ll); var Gr = { accessibility: !0, adaptiveHeight: !1, afterChange: null, appendDots: function(e) { return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("ul", { style: { display: "block" } }, e); }, arrows: !0, autoplay: !1, autoplaySpeed: 3e3, beforeChange: null, centerMode: !1, centerPadding: "50px", className: "", cssEase: "ease", customPaging: function(e) { return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("button", null, e + 1); }, dots: !1, dotsClass: "slick-dots", draggable: !0, easing: "linear", edgeFriction: 0.35, fade: !1, focusOnSelect: !1, infinite: !0, initialSlide: 0, lazyLoad: null, nextArrow: null, onEdge: null, onInit: null, onLazyLoadError: null, onReInit: null, pauseOnDotsHover: !1, pauseOnFocus: !1, pauseOnHover: !0, prevArrow: null, responsive: null, rows: 1, rtl: !1, slide: "div", slidesPerRow: 1, slidesToScroll: 1, slidesToShow: 1, speed: 500, swipe: !0, swipeEvent: null, swipeToSlide: !1, touchMove: !0, touchThreshold: 5, useCSS: !0, useTransform: !0, variableWidth: !1, vertical: !1, waitForAnimate: !0 }, dl = /* @__PURE__ */ function(t) { Ct(n, t); var e = Nt(n); function n(r) { var a; return Et(this, n), a = e.call(this, r), re(ae(a), "innerSliderRefHandler", function(i) { return a.innerSlider = i; }), re(ae(a), "slickPrev", function() { return a.innerSlider.slickPrev(); }), re(ae(a), "slickNext", function() { return a.innerSlider.slickNext(); }), re(ae(a), "slickGoTo", function(i) { var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; return a.innerSlider.slickGoTo(i, o); }), re(ae(a), "slickPause", function() { return a.innerSlider.pause("paused"); }), re(ae(a), "slickPlay", function() { return a.innerSlider.autoPlay("play"); }), a.state = { breakpoint: null }, a._responsiveMediaHandlers = [], a; } return bt(n, [{ key: "media", value: function(a, i) { var o = window.matchMedia(a), s = function(d) { var c = d.matches; c && i(); }; o.addListener(s), s(o), this._responsiveMediaHandlers.push({ mql: o, query: a, listener: s }); } // handles responsive breakpoints }, { key: "componentDidMount", value: function() { var a = this; if (this.props.responsive) { var i = this.props.responsive.map(function(s) { return s.breakpoint; }); i.sort(function(s, l) { return s - l; }), i.forEach(function(s, l) { var d; l === 0 ? d = In({ minWidth: 0, maxWidth: s }) : d = In({ minWidth: i[l - 1] + 1, maxWidth: s }), Hr() && a.media(d, function() { a.setState({ breakpoint: s }); }); }); var o = In({ minWidth: i.slice(-1)[0] }); Hr() && this.media(o, function() { a.setState({ breakpoint: null }); }); } } }, { key: "componentWillUnmount", value: function() { this._responsiveMediaHandlers.forEach(function(a) { a.mql.removeListener(a.listener); }); } }, { key: "render", value: function() { var a = this, i, o; this.state.breakpoint ? (o = this.props.responsive.filter(function(g) { return g.breakpoint === a.state.breakpoint; }), i = o[0].settings === "unslick" ? "unslick" : F(F(F({}, Gr), this.props), o[0].settings)) : i = F(F({}, Gr), this.props), i.centerMode && (i.slidesToScroll > 1 && "development" !== "production" && console.warn("slidesToScroll should be equal to 1 in centerMode, you are using ".concat(i.slidesToScroll)), i.slidesToScroll = 1), i.fade && (i.slidesToShow > 1 && "development" !== "production" && console.warn("slidesToShow should be equal to 1 when fade is true, you're using ".concat(i.slidesToShow)), i.slidesToScroll > 1 && "development" !== "production" && console.warn("slidesToScroll should be equal to 1 when fade is true, you're using ".concat(i.slidesToScroll)), i.slidesToShow = 1, i.slidesToScroll = 1); var s = react__WEBPACK_IMPORTED_MODULE_1___default().Children.toArray(this.props.children); s = s.filter(function(g) { return typeof g == "string" ? !!g.trim() : !!g; }), i.variableWidth && (i.rows > 1 || i.slidesPerRow > 1) && (console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"), i.variableWidth = !1); for (var l = [], d = null, c = 0; c < s.length; c += i.rows * i.slidesPerRow) { for (var f = [], h = c; h < c + i.rows * i.slidesPerRow; h += i.slidesPerRow) { for (var p = [], m = h; m < h + i.slidesPerRow && (i.variableWidth && s[m].props.style && (d = s[m].props.style.width), !(m >= s.length)); m += 1) p.push(/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(s[m], { key: 100 * c + 10 * h + m, tabIndex: -1, style: { width: "".concat(100 / i.slidesPerRow, "%"), display: "inline-block" } })); f.push(/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { key: 10 * c + h }, p)); } i.variableWidth ? l.push(/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { key: c, style: { width: d } }, f)) : l.push(/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { key: c }, f)); } if (i === "unslick") { var _ = "regular slider " + (this.props.className || ""); return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: _ }, s); } else l.length <= i.slidesToShow && (i.unslick = !0); return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(nl, Je({ style: this.props.style, ref: this.innerSliderRefHandler }, i), l); } }]), n; }((react__WEBPACK_IMPORTED_MODULE_1___default().Component)); const cl = "CAROUSEL_INDICATOR_DATA_TEST_ID_NEXT_BUTTON", ul = "CAROUSEL_INDICATOR_DATA_TEST_ID_PREV_BUTTON", fl = (t) => `CAROUSEL_INDICATOR_TEST_ID_PANCAKE_BUTTON_${t}`, hl = "CAROUSEL_INDICATOR_TEST_ID_NO_PANCAKE_BUTTON", vr = ({ billboard: t, children: e, className: n, currentSlideIndex: r = 0, inlineDirectionalButtons: a = !1, numOfSlides: i = 1, numOfDisplayedSlides: o = 1, noPancakes: s = !1, settings: l = { dots: !1, arrows: !1, infinite: !1, speed: 500, slidesToShow: 1, slidesToScroll: 1 } }) => { const [d, c] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)( r ), f = !d, h = d === i - o, [p, m] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), _ = (T) => { p.slickGoTo(T); }, g = []; for (let T = 0; T < i; T++) g.push( /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "li", { className: E( T === d && be.ACTIVE_PANCAKE_BUTTON ), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: be.PANCAKE_BUTTON, onClick: () => _(T), "aria-label": `Click or press enter to view ${T + 1} of ${i}`, "data-testid": fl(T + 1), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: be.PANCAKE }) } ) }, T ) ); const v = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: be.PANCAKE_BUTTONS, children: g }), $ = d + 1, N = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": hl, role: "button", className: be.PAGINATION_TEXT, "aria-label": `You are currently on Slide ${$} of ${i}`, tabIndex: 0, onKeyUp: (T) => { ["Enter", " "].includes(T.key) && !h && _(d + 1); }, children: o > 1 ? `${$} - ${d + o} of ${i}` : `${$} / ${i}` } ); window.onkeydown = (T) => !(T.key === " " && T.target?.className === be.PAGINATION_TEXT); const y = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: E( be.DIRECTIONAL_BUTTON, be.DIRECTIONAL_BUTTON_PREVIOUS, f && be.DISABLED_DIRECTIONAL_BUTTON ), onClick: () => _(d - 1), disabled: f, "aria-label": "previous button", "data-testid": ul } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: be.PAGINATION, children: i > 4 || s ? N : v }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: E( be.DIRECTIONAL_BUTTON, be.DIRECTIONAL_BUTTON_NEXT, h && be.DISABLED_DIRECTIONAL_BUTTON ), disabled: h, onClick: () => _(d + 1), "aria-label": "next button", "data-testid": cl } ) ] }); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( be.COMPONENT, a && be.INLINE_DIRECTIONAL_BUTTONS, t && be.CAROUSEL_INDICATOR_BILLBOARD, n ), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( dl, { ...l, initialSlide: d, ref: (T) => m(T), afterChange: (T) => { c(T); }, children: e } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: be.CAROUSEL_INDICATOR, children: t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: be.CAROUSEL_INDICATOR_WRAPPER, children: y }) : y }) ] } ); }, _1 = ({ className: t, currentSlideIndex: e = 0, children: n = [] }) => { const r = Array.isArray(n); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( vr, { billboard: !0, className: t, currentSlideIndex: e, numOfSlides: r ? n.length : 1, children: (r ? n : [n]).map((a, i) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: be.SLIDE_IMAGE, children: a }, `billboard-slide-wrapper-${i + 1}` )) } ); }; function Kr() { const { innerWidth: t, innerHeight: e } = window; return { width: t, height: e }; } function Ci() { const [t, e] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(Kr()); return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { function n() { e(Kr()); } return window.addEventListener("resize", n), () => window.removeEventListener("resize", n); }, []), t; } const pl = 1024, g1 = ({ className: t, currentSlideIndex: e = 0, children: n = [] }) => { (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const { width: r } = Ci(), a = r < pl, i = Array.isArray(n), o = { dots: !1, arrows: !1, infinite: !1, speed: 500, slidesToShow: a ? 1 : 3, slidesToScroll: 1 }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( vr, { className: t, currentSlideIndex: e, noPancakes: !0, numOfSlides: i ? n.length : 1, numOfDisplayedSlides: a ? 1 : 3, settings: o, children: (i ? n : [n]).map((s, l) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( is, { cardGroupClassName: be.CARD_CAROUSEL_GROUP, children: s }, `CardCarousel-CardGroup-${l + 1}` )) } ); }, T1 = ({ className: t, currentSlideIndex: e = 0, inlineDirectionalButtons: n, children: r = [] }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( vr, { className: t, currentSlideIndex: e, inlineDirectionalButtons: n, numOfSlides: r.length, children: r } ) }), v1 = ({ notificationStyle: t = "default", message: e = "", visible: n = void 0, className: r, onDismiss: a }) => { function i() { a && a(); } return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fds-app", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E("fds-banner-notification__section", r), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "aria-live": "assertive", "aria-atomic": "true", className: E("fds-banner-notification__section__type--dismissible"), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { id: "FDSDismissibleSuccessNotification", className: E( "fds-banner-notification", "fds-banner-notification__type--dismissible", t === "warning" && "fds-banner-notification__style--warning", t === "error" && "fds-banner-notification__style--error", t === "default" && "fds-banner-notification__style--default", t === "success" && "fds-banner-notification__style--success", n === !1 && "fds-banner-notification--hide", n === !0 && "fds-banner-notification--show" ), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fds-banner-notification__wrapper", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fds-banner-notification__content", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fds-banner-notification__text", children: e }) }) }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: "fds-banner-notification__close-button fds-font--ford-icons__clear fds-icon", "aria-label": "Close notification", onClick: i } ) ] } ) } ) }) }); }, y1 = () => { const [t, e] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(void 0), [n, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("default"), [a, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), o = () => e(!t), s = async () => { t === !0 && (l(), await Bo(600)), e(!0); }, l = () => { t && e(!1); }; return { visible: t, notificationStyle: n, notificationMessage: a, setNotificationStyle: r, setNotificationMessage: i, toggleNotification: o, showNotification: s, hideNotification: l }; }, ml = "BREADCRUMBS_DATA_TEST_ID", E1 = ({ className: t, children: e, dataTestId: n = ml }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E(t), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { "aria-label": "breadcrumbs", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "fmc-breadcrumbs", "data-testid": n, children: e }) }) }), $l = ({ children: t, className: e, dataTestId: n = "BREADCRUMB__ITEM_DATA_TEST_ID" }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E(e), "data-testid": n, children: t }); $l.displayName = "BreadcrumbItem"; const jr = { ANCHOR_TAG: "a", SPAN_TAG: "span" }, _l = ({ key: t, href: e, as: n, children: r, active: a = !1, className: i, dataTestId: o = "BREADCRUMB__LINK_DATA_TEST_ID", ...s }) => { const d = a ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( "fmc-breadcrumbs__text", "fmc-breadcrumbs__text__last", i ), "data-testid": o, "aria-current": "page", role: jr.SPAN_TAG, children: r }, t ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( n || "a", { href: e, className: "fmc-breadcrumbs__link", ...s, role: jr.ANCHOR_TAG, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E("fmc-breadcrumbs__text", i), "data-testid": o, children: r }, t ) } ); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: d }); }; _l.displayName = "BreadcrumbLink"; const gl = 100, Tl = 50, st = "SINGLE_DATE", Vt = "RANGE", Mt = "MUTLI_DATE", Yr = (t, e) => Array.from(Array(t).keys()).map((n) => ({ value: n + 1, id: `${e}-${n}` })), Fe = (t, e) => !t || !e ? !1 : t.day === e.day && t.month === e.month && t.year === e.year, Dt = (t) => ({ ...t }), vl = (t) => JSON.parse(JSON.stringify(t, (e, n) => typeof n > "u" ? null : n)), qn = (t, e) => { const n = e === "NEXT" ? 1 : -1; let r = t.month + n, a = t.year; return r < 1 && (r = 12, a -= 1), r > 12 && (r = 1, a += 1), { year: a, month: r, day: 1 }; }, Pt = (t, e) => Object.prototype.hasOwnProperty.call(t || {}, e), yt = (t) => { if (Array.isArray(t)) return Mt; if (Pt(t, "from") && Pt(t, "to")) return Vt; if (!t || Pt(t, "year") && Pt(t, "month") && Pt(t, "day")) return st; throw new TypeError( "The passed value is malformed! Please make sure you're using one of the valid value types for date picker." ); }, yl = (t) => t && t[0].toUpperCase() + t.slice(1) || "", El = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], bl = (t = "en-US", e = "long") => { const n = new Intl.DateTimeFormat(t, { month: e }).format; return El.map((r) => yl(n(new Date(Date.UTC(2021, (r + 1) % 12))))); }, Cl = [0, 1, 2, 3, 4, 5, 6], Nl = (t = "es-US", e = "long") => { const n = new Intl.DateTimeFormat(t, { weekday: e }).format; return Cl.map((r) => { const a = n(new Date(Date.UTC(2021, 5, r))); return { name: n(new Date(Date.UTC(2021, 5, r))), short: a.charAt(0).toUpperCase(), isWeekend: !(r % 6) }; }); }, Ni = (t) => typeof t == "string" ? { months: bl(t), weekDays: Nl(t), weekStartingIndex: 0, getToday(e) { return e; }, toNativeDate(e) { return new Date(e.year, e.month - 1, e.day); }, getMonthLength(e) { return new Date(e.year, e.month, 0).getDate(); }, transformDigit(e) { return e; }, nextMonth: "Next Month", previousMonth: "Previous Month", openMonthSelector: "Open Month Selector", openYearSelector: "Open Year Selector", closeMonthSelector: "Close Month Selector", closeYearSelector: "Close Year Selector", from: "from", to: "to", defaultPlaceholder: "Select...", digitSeparator: "/", yearLetterSkip: 0, isRtl: !1 } : t, Sl = (t = "en_US") => { const { months: e, getToday: n, toNativeDate: r, getMonthLength: a, weekStartingIndex: i, transformDigit: o } = typeof t == "string" ? Ni(t) : t; return { getToday: () => { const p = /* @__PURE__ */ new Date(), m = p.getFullYear(), _ = p.getMonth() + 1, g = p.getDate(); return n({ year: m, month: _, day: g }); }, getMonthName: (p) => e[p - 1], getMonthNumber: (p) => e.indexOf(p) + 1, getMonthLength: a, getMonthFirstWeekday: (p) => (r({ ...p, day: 1 }).getDay() + i) % 7, isBeforeDate: (p, m) => !p || !m ? !1 : r(p) < r(m), checkDayInDayRange: ({ day: p, from: m, to: _ }) => { if (!p || !m || !_) return !1; const g = r(p), v = r(m), $ = r(_); return g > v && g < $; }, getLanguageDigits: o }; }, Gt = (t) => (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => Sl(t), [t]), Kt = (t) => (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => Ni(t), [t]), Si = ({ parent: t, isInitialActiveChild: e, activeDate: n, monthChangeDirection: r }) => { if (!t) return e ? n : qn(n, "NEXT"); const a = t.children[e ? 0 : 1]; return a.classList.contains("-shown") || a.classList.contains("-shownAnimated") ? n : qn(n, r); }, Oi = ({ parent: t, direction: e }) => { const n = Array.from(t.children), r = n.find((l) => l.classList.contains("-shown")), a = n.find((l) => l !== r), i = r.classList[0], o = e === "NEXT", s = (l) => l ? "-hiddenNext" : "-hiddenPrevious"; a.style.transition = "none", r.style.transition = "", r.className = `${i} ${s(!o)}`, a.className = `${i} ${s(o)}`, a.classList.add("-shownAnimated"); }, Zn = ({ target: t }) => { t.classList.remove("-hiddenNext"), t.classList.remove("-hiddenPrevious"), t.classList.replace("-shownAnimated", "-shown"); }, Ol = ({ maximumDate: t, minimumDate: e, onMonthChange: n, activeDate: r, monthChangeDirection: a, onMonthSelect: i, onYearSelect: o, isMonthSelectorOpen: s, isYearSelectorOpen: l, locale: d }) => { const c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), { getMonthName: h, isBeforeDate: p, getLanguageDigits: m } = Gt(d), { isRtl: _, nextMonth: g, previousMonth: v, openMonthSelector: $, closeMonthSelector: N, openYearSelector: y, closeYearSelector: T } = Kt(d); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { a && Oi({ direction: a, parent: f.current }); }, [a]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const P = s || l, V = c.current.querySelector( ".Calendar__monthYear.-shown .Calendar__monthText" ), M = V.nextSibling, C = (q) => q.classList.contains("-activeBackground"); if (!P && !C(V) && !C(M)) return; [ ...c.current.querySelectorAll(".Calendar__monthArrowWrapper") ]; const x = s || C(V), b = x ? V : M, w = x ? M : V; let Z = x ? 1 : -1; _ && (Z *= -1); const S = P ? 1 : 0.95, A = P ? `${Z * w.offsetWidth / 2}` : 0; P ? w.setAttribute("aria-hidden", !0) : w.removeAttribute("aria-hidden"), w.setAttribute("tabindex", P ? "-1" : "0"), w.style.transform = "", b.style.transform = `scale(${S}) ${A ? `translateX(${A}px)` : ""}`, b.classList.toggle("-activeBackground"), w.classList.toggle("-hidden"); }, [s, l]); const D = (P) => { const V = Si({ isInitialActiveChild: P, monthChangeDirection: a, activeDate: r, parent: f.current }), M = m(V.year); return { month: h(V.month), year: M }; }, U = t && p(t, { ...r, month: r.month + 1, day: 1 }), I = e && (p({ ...r, day: 1 }, e) || Fe(e, { ...r, day: 1 })), R = (P) => { Array.from( f.current.children ).some((M) => M.classList.contains("-shownAnimated")) || n(P); }, k = [!0, !1].map((P) => { const { month: V, year: M } = D(P), C = V === h(r.month), O = { ...C ? {} : { "aria-hidden": !0 } }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { onAnimationEnd: Zn, className: `Calendar__monthYear ${P ? "-shown" : "-hiddenNext"}`, role: "presentation", ...O, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { onClick: i, type: "button", className: "Calendar__monthText", "aria-label": s ? N : $, tabIndex: C ? "0" : "-1", ...O, children: V } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { onClick: o, type: "button", className: "Calendar__yearText", "aria-label": l ? T : y, tabIndex: C ? "0" : "-1", ...O, children: M } ) ] }, String(P) ); }); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { ref: c, className: "Calendar__header", children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: "Calendar__monthArrowWrapper -right", onClick: () => { R("PREVIOUS"); }, "aria-label": v, type: "button", disabled: I, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "Calendar__monthArrow" }) } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: "Calendar__monthYearContainer", ref: f, "data-testid": "month-year-container", children: [ " ", k ] } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: "Calendar__monthArrowWrapper -left", onClick: () => { R("NEXT"); }, "aria-label": g, type: "button", disabled: U, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "Calendar__monthArrow" }) } ) ] }); }, yr = (t, { allowVerticalArrows: e }) => { const { activeElement: n } = document, r = (_, g) => _ ? _.children[g] : null, a = (_) => _ && (_.hasAttribute("aria-hidden") ? null : _), { nextSibling: i, previousSibling: o } = n.parentElement, s = a(n.nextSibling || r(i, 0)), l = o ? o.children.length - 1 : 0, d = a( n.previousSibling || r(o, l) ), c = (_) => r(_, Array.from(n.parentElement.children).indexOf(n)), f = a(c(i)), h = a(c(o)); n.dataset.isDefaultSelectable === "true" || (n.tabIndex = "-1"); const m = (_) => { t.preventDefault(), _ && (_.setAttribute("tabindex", "0"), _.focus()); }; switch (t.key) { case "ArrowRight": m(s); break; case "ArrowLeft": m(d); break; case "ArrowDown": e && m(f); break; case "ArrowUp": e && m(h); break; } }, Al = ({ activeDate: t, maximumDate: e, minimumDate: n, onMonthSelect: r, isOpen: a, locale: i }) => { const o = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const h = a ? "add" : "remove"; o.current.classList[h]("-open"); }, [a]); const { getMonthNumber: s, isBeforeDate: l } = Gt(i), { months: d } = Kt(i); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { role: "presentation", className: "Calendar__monthSelectorAnimationWrapper", ...a ? {} : { "aria-hidden": !0 }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { role: "presentation", "data-testid": "month-selector-wrapper", className: "Calendar__monthSelectorWrapper", onKeyDown: (h) => { yr(h, { allowVerticalArrows: !1 }); }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { ref: o, className: "Calendar__monthSelector", "data-testid": "month-selector", children: (() => d.map((h) => { const p = s(h), m = { day: 1, month: p, year: t.year }, _ = e && l(e, { ...m, month: p }), g = n && (l({ ...m, month: p + 1 }, n) || Fe({ ...m, month: p + 1 }, n)), v = p === t.month; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "li", { className: `Calendar__monthSelectorItem ${v ? "-active" : ""}`, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { tabIndex: v && a ? "0" : "-1", onClick: () => { r(p); }, className: "Calendar__monthSelectorItemText", type: "button", disabled: _ || g, "aria-pressed": v, "data-is-default-selectable": v, children: h } ) }, h ); }))() }) } ) } ); }, Ai = ({ isOpen: t, activeDate: e, onYearSelect: n, selectorStartingYear: r, selectorEndingYear: a, maximumDate: i, minimumDate: o, locale: s }) => { const l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), d = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), { getLanguageDigits: c, getToday: f } = Gt(s), h = r || f().year - gl, p = a || f().year + Tl, m = []; for (let v = h; v <= p; v += 1) m.push(v); return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const v = t ? "add" : "remove", $ = l.current.querySelector( ".Calendar__yearSelectorItem.-active" ); if (!$) throw new RangeError( "Provided value for year is out of selectable year range. You're probably using a wrong locale prop value or your provided value's locale is different from the date picker locale. Try changing the 'locale' prop or the value you've provided." ); l.current.classList[v]("-faded"), d.current.scrollTop = $.offsetTop - $.offsetHeight * 5, d.current.classList[v]("-open"); }, [t]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: "Calendar__yearSelectorAnimationWrapper", role: "presentation", ...t ? {} : { "aria-hidden": !0 }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { ref: l, className: "Calendar__yearSelectorWrapper", role: "presentation", "data-testid": "year-selector-wrapper", onKeyDown: (v) => { yr(v, { allowVerticalArrows: !1 }); }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { ref: d, className: "Calendar__yearSelector", "data-testid": "year-selector", children: (() => m.map((v) => { const $ = i && v > i.year, N = o && v < o.year, y = e.year === v; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { className: `Calendar__yearSelectorItem ${y ? "-active" : ""}`, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { tabIndex: y && t ? "0" : "-1", className: "Calendar__yearSelectorText", type: "button", onClick: () => { n(v); }, disabled: $ || N, "aria-pressed": y, "data-is-default-selectable": y, children: c(v) } ) }, v); }))() }) } ) } ); }; Ai.defaultProps = { selectorStartingYear: 0, selectorEndingYear: 0 }; const Ii = ({ activeDate: t, value: e, monthChangeDirection: n, onSlideChange: r, disabledDays: a, onDisabledDayError: i, minimumDate: o, maximumDate: s, onChange: l, locale: d, calendarTodayClassName: c, calendarSelectedDayClassName: f, calendarRangeStartClassName: h, calendarRangeEndClassName: p, calendarRangeBetweenClassName: m, shouldHighlightWeekends: _, isQuickSelectorOpen: g, customDaysClassName: v }) => { const $ = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), { isRtl: N, weekDays: y } = Kt(d), { getToday: T, isBeforeDate: D, checkDayInDayRange: U, getMonthFirstWeekday: I, getMonthLength: R, getLanguageDigits: k, getMonthName: P } = Gt(d), V = T(); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { n && Oi({ direction: n, parent: $.current }); }, [n]); const M = (L) => { const G = vl(e), H = G.from && G.to ? { from: null, to: null } : G, Q = H.from ? "to" : "from"; H[Q] = L; const { from: X, to: te } = H; D(H.to, H.from) && (H.from = te, H.to = X); const oe = (_e) => U({ day: _e, from: H.from, to: H.to }), B = a.find(oe); return B ? (i(B), e) : H; }, C = (L) => { const G = e.some((X) => Fe(X, L)), H = [...e, L], Q = e.filter((X) => !Fe(X, L)); return G ? Q : H; }, O = (L) => { const H = (() => { switch (yt(e)) { case st: return L; case Vt: return M(L); case Mt: return C(L); } })(); l(H); }, x = (L) => { const G = yt(e); if (G === st) return Fe(L, e); if (G === Mt) return e.some((H) => Fe(H, L)); }, b = (L) => { const G = Fe(L, V), H = x(L), { from: Q, to: X } = e || {}, te = Fe(L, Q), oe = Fe(L, X), B = U({ day: L, from: Q, to: X }); return { isToday: G, isSelected: H, isStartingDayRange: te, isEndingDayRange: oe, isWithinRange: B }; }, w = (L) => { const { isToday: G, isSelected: H, isStartingDayRange: Q, isEndingDayRange: X, isWithinRange: te } = b(L), oe = v?.find((_e) => Fe(L, _e)); return "".concat(G && !H ? ` -today ${c}` : "").concat(L.isStandard ? "" : " -blank").concat(L.isWeekend && _ ? " -weekend" : "").concat(oe ? ` ${oe.className}` : "").concat(H ? ` -selected ${f}` : "").concat(Q ? ` -selectedStart ${h}` : "").concat(X ? ` -selectedEnd ${p}` : "").concat(te ? ` -selectedBetween ${m}` : "").concat(L.isDisabled ? " -disabled" : ""); }, Z = (L) => { const G = Yr(I(L), "starting-blank"), H = Yr(R(L)).map((X) => ({ ...X, isStandard: !0, month: L.month, year: L.year })); return [...G, ...H]; }, S = ({ isDisabled: L, ...G }) => { L ? i(G) : O(G); }, A = ({ isOnActiveSlide: L, isStandard: G, isSelected: H, isStartingDayRange: Q, isToday: X, day: te }) => { if (g || !L || !G) return !1; if (H || Q || X || te === 1) return !0; }, q = ({ id: L, value: G, month: H, year: Q, isStandard: X }, te) => { const oe = { day: G, month: H, year: Q }, B = a.some((It) => Fe(oe, It)), _e = D(oe, o), Oe = D(s, oe), K = B || X && (_e || Oe), se = y.some( (It, Co) => It.isWeekend && Co === te ), j = w({ ...oe, isWeekend: se, isStandard: X, isDisabled: K }), ce = `${y[te].name}, ${G} ${P(H)} ${Q}`, De = H === t.month, Qe = b(oe), { isSelected: vo, isStartingDayRange: yo, isEndingDayRange: Eo, isWithinRange: bo } = Qe, Pr = A({ ...oe, ...Qe, isOnActiveSlide: De, isStandard: X }); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { tabIndex: Pr ? "0" : "-1", className: `Calendar__day -${N ? "rtl" : "ltr"} ${j}`, onClick: () => { S({ ...oe, isDisabled: K }); }, onKeyDown: ({ key: It }) => { It === "Enter" && S({ ...oe, isDisabled: K }); }, "aria-disabled": K, "aria-label": ce, "aria-selected": vo || yo || Eo || bo, ...!X || !De || g ? { "aria-hidden": !0 } : {}, role: "gridcell", "data-is-default-selectable": Pr, children: X ? k(G) : "" }, L ); }, J = (L) => { const G = Si({ activeDate: t, isInitialActiveChild: L, monthChangeDirection: n, parent: $.current }), H = Z(G), Q = (X) => { const te = H.slice(X * 7, X * 7 + 7).map(q); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "Calendar__weekRow", role: "row", children: te }, String(X)); }; return Array.from(Array(6).keys()).map(Q); }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { ref: $, className: "Calendar__sectionWrapper", role: "presentation", "data-testid": "days-section-wrapper", onKeyDown: (L) => { yr(L, { allowVerticalArrows: !0 }); }, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { onAnimationEnd: (L) => { Zn(L), r(); }, className: "Calendar__section -shown", role: "rowgroup", children: J(!0) } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { onAnimationEnd: (L) => { Zn(L), r(); }, className: "Calendar__section -hiddenNext", role: "rowgroup", children: J(!1) } ) ] } ); }; Ii.defaultProps = { onChange: () => { }, onDisabledDayError: () => { }, disabledDays: [], calendarTodayClassName: "", calendarSelectedDayClassName: "", calendarRangeStartClassName: "", calendarRangeBetweenClassName: "", calendarRangeEndClassName: "", shouldHighlightWeekends: !1 }; const Il = ({ value: t, onChange: e, onDisabledDayError: n, calendarClassName: r, calendarTodayClassName: a, calendarSelectedDayClassName: i, // calendarRangeStartClassName, // calendarRangeBetweenClassName, // calendarRangeEndClassName, disabledDays: o, colorPrimary: s, colorPrimaryLight: l, // slideAnimationDuration, minimumDate: d, maximumDate: c, selectorStartingYear: f, selectorEndingYear: h, locale: p, shouldHighlightWeekends: m, // renderFooter, customDaysClassName: _ }) => { const g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), [v, $] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ activeDate: {}, monthChangeDirection: "", isMonthSelectorOpen: !1, isYearSelectorOpen: !1 }); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const w = (Z) => { Z.key === "Tab" && g.current.classList.remove("-noFocusOutline"); }; return g.current?.addEventListener( "keyup", () => w, !1 ), () => { g.current?.removeEventListener( "keyup", () => w, !1 ); }; }); const { getToday: N } = Gt(p), { weekDays: y, isRtl: T } = Kt(p), D = N(), U = (w) => () => { $({ ...v, [w]: !v[w] }); }, I = U("isMonthSelectorOpen"), R = U("isYearSelectorOpen"), k = () => { const w = yt(t); return w === Mt && t.length ? Dt(t[0]) : w === st && t ? Dt(t) : w === Vt && t.from ? Dt(t.from) : Dt(D); }, P = Object.keys(v.activeDate).length > 0 ? Dt(v.activeDate) : k(), V = y.map((w) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("abbr", { title: w.name, className: "Calendar__weekDay", children: w.short }, w.name)), M = (w) => { $({ ...v, monthChangeDirection: w }); }, C = () => { $({ ...v, activeDate: qn( P, v.monthChangeDirection ), monthChangeDirection: "" }); }, O = (w) => { $({ ...v, activeDate: { ...P, month: w }, isMonthSelectorOpen: !1 }); }, x = (w) => { $({ ...v, activeDate: { ...P, year: w }, isYearSelectorOpen: !1 }); }, b = { "--cl-color-primary": s, "--cl-color-primary-light": l // '--animation-duration': slideAnimationDuration, }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: `Calendar -noFocusOutline ${r} -${T ? "rtl" : "ltr"}`, role: "grid", style: b, ref: g, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Ol, { maximumDate: c, minimumDate: d, activeDate: P, onMonthChange: M, onMonthSelect: I, onYearSelect: R, monthChangeDirection: v.monthChangeDirection, isMonthSelectorOpen: v.isMonthSelectorOpen, isYearSelectorOpen: v.isYearSelectorOpen, locale: p } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Al, { isOpen: v.isMonthSelectorOpen, activeDate: P, onMonthSelect: O, maximumDate: c, minimumDate: d, locale: p } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Ai, { isOpen: v.isYearSelectorOpen, activeDate: P, onYearSelect: x, selectorStartingYear: f, selectorEndingYear: h, maximumDate: c, minimumDate: d, locale: p } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "Calendar__weekDays", children: V }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Ii, { activeDate: P, value: t, monthChangeDirection: v.monthChangeDirection, onSlideChange: C, disabledDays: o, onDisabledDayError: n, minimumDate: d, maximumDate: c, onChange: e, calendarTodayClassName: a, calendarSelectedDayClassName: i, locale: p, shouldHighlightWeekends: m, customDaysClassName: _, isQuickSelectorOpen: v.isYearSelectorOpen || v.isMonthSelectorOpen } ) ] } ); }, Rl = react__WEBPACK_IMPORTED_MODULE_1___default().forwardRef( ({ value: t, inputId: e, isDisabled: n = !1, inputPlaceholder: r, dateFormatOptions: a, inputClassName: i, inputName: o, formatInputText: s, // renderInput, locale: l, hasError: d, message: c }, f) => { const { from: h, to: p, // yearLetterSkip, // digitSeparator, defaultPlaceholder: m // isRtl, } = Kt(l), _ = (y) => { if (!y) return ""; const T = new Date(y.year, y.month - 1, y.day), D = a || { day: "numeric", month: "numeric", year: "numeric" }; return T.toLocaleDateString(l, D); }, g = (y) => { if (!y.from || !y.to) return ""; const { from: T, to: D } = y, U = new Date(T.year, T.month - 1, T.day), I = new Intl.DateTimeFormat("en-US").format(U).toString(), R = new Date(T.year, T.month - 1, T.day), k = new Intl.DateTimeFormat("en-US").format(R).toString(); return `${h} ${I} ${p} ${k}`; }, v = () => { if (s) return s(); switch (yt(t)) { case st: return _(t); case Vt: return g(t); default: return ""; } }, $ = r || m; return (() => ( // renderInput({ref}) || /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( "fmc-floating-label", d && "fmc-floating-label--error" ), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "input", { "data-testid": "datepicker-input", readOnly: !0, ref: f, id: e, type: "text", value: v(), name: o, placeholder: $, className: E( d && "fmc-input--error", "fmc-input", i ), "aria-label": $, disabled: n } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: e, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fmc-floating-label__text", children: $ }) }) ] } ), d && c && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E("cxc-date-picker-input__status"), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: "cxc-date-picker-input__message", "aria-live": "polite", role: "alert", children: c } ) }) ] }) ))(); } ), Dl = "CalendarInput", b1 = ({ value: t, isDisabled: e = !1, onChange: n, formatInputText: r, inputPlaceholder: a, inputClassName: i, inputName: o, // renderInput, wrapperClassName: s, calendarClassName: l, calendarTodayClassName: d, calendarSelectedDayClassName: c, // calendarRangeStartClassName, // calendarRangeBetweenClassName, // calendarRangeEndClassName, calendarPopperPosition: f, disabledDays: h, onDisabledDayError: p, colorPrimary: m = "#1700f4", colorPrimaryLight: _, //slideAnimationDuration, minimumDate: g, maximumDate: v, selectorStartingYear: $, selectorEndingYear: N, locale: y, shouldHighlightWeekends: T, // renderFooter, customDaysClassName: D, dateFormatOptions: U, hasError: I, message: R }) => { const k = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), V = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(Ve(Dl)), M = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), [C, O] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const S = () => { O(!1); }; return window.addEventListener("blur", S, !1), () => { window.removeEventListener("blur", S, !1); }; }, []), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const S = yt(t); if (S === Mt) return; (S === st ? !C : !C && t.from && t.to) && P.current.blur(); }, [t, C]); const x = (S) => { if (S.persist(), !C) return; const A = k.current.contains( S.relatedTarget ); M.current ? (M.current = !1, P.current.focus()) : A && S.relatedTarget ? S.relatedTarget.focus() : O(!1); }, b = () => { M.current || O(!0); }; (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => { if (!C) return; const { left: S, width: A, height: q, top: J } = k.current.getBoundingClientRect(), { clientWidth: Y, clientHeight: L } = document.documentElement, G = S + A > Y, H = S < 0, Q = J + q > L, X = () => { const te = S + A - Y; if (!G && !H) return ""; const oe = Math.abs(S); return G ? `calc(50% - ${te}px)` : `calc(50% + ${H ? oe : 0}px)`; }; k.current.style.left = X(), (f === "auto" && Q || f === "top") && k?.current?.classList?.add("-top"); }, [C]); const w = (S) => { const A = yt(t); n && n(S), (A === st || A === Vt) && O(!1); }, Z = (S) => { switch (S.key) { case "Enter": O(!0); break; case "Escape": O(!1), M.current = !0; break; } }; return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { !C && M.current && (P?.current?.focus(), M.current = !1); }, [M, C]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { onFocus: b, onBlur: x, onKeyUp: Z, className: `DatePicker ${s}`, role: "presentation", children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Rl, { ref: P, isDisabled: e, formatInputText: r, value: t, inputPlaceholder: a, inputClassName: i, inputName: o, locale: y, dateFormatOptions: U, hasError: I, message: R, inputId: V.current } ), C && !e && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { ref: k, className: "DatePicker__calendarContainer", "data-testid": "calendar-container", role: "presentation", onMouseDown: () => { M.current = !0; }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Il, { value: t, onChange: w, calendarClassName: l, calendarTodayClassName: d, calendarSelectedDayClassName: c, disabledDays: h, colorPrimary: m, colorPrimaryLight: _, onDisabledDayError: p, minimumDate: g, maximumDate: v, selectorStartingYear: $, selectorEndingYear: N, locale: y, shouldHighlightWeekends: T, customDaysClassName: D } ) } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "DatePicker__calendarArrow" }) ] }) ] } ); }; var Jn = { exports: {} }, lt = {}, Qn = { exports: {} }, qt = { exports: {} }, pe = {}; /** @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 zr; function Pl() { if (zr) return pe; zr = 1; var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, n = t ? Symbol.for("react.portal") : 60106, r = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, i = t ? Symbol.for("react.profiler") : 60114, o = t ? Symbol.for("react.provider") : 60109, s = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, d = t ? Symbol.for("react.concurrent_mode") : 60111, c = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, h = t ? Symbol.for("react.suspense_list") : 60120, p = t ? Symbol.for("react.memo") : 60115, m = t ? Symbol.for("react.lazy") : 60116, _ = t ? Symbol.for("react.block") : 60121, g = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, $ = t ? Symbol.for("react.scope") : 60119; function N(T) { if (typeof T == "object" && T !== null) { var D = T.$$typeof; switch (D) { case e: switch (T = T.type, T) { case l: case d: case r: case i: case a: case f: return T; default: switch (T = T && T.$$typeof, T) { case s: case c: case m: case p: case o: return T; default: return D; } } case n: return D; } } } function y(T) { return N(T) === d; } return pe.AsyncMode = l, pe.ConcurrentMode = d, pe.ContextConsumer = s, pe.ContextProvider = o, pe.Element = e, pe.ForwardRef = c, pe.Fragment = r, pe.Lazy = m, pe.Memo = p, pe.Portal = n, pe.Profiler = i, pe.StrictMode = a, pe.Suspense = f, pe.isAsyncMode = function(T) { return y(T) || N(T) === l; }, pe.isConcurrentMode = y, pe.isContextConsumer = function(T) { return N(T) === s; }, pe.isContextProvider = function(T) { return N(T) === o; }, pe.isElement = function(T) { return typeof T == "object" && T !== null && T.$$typeof === e; }, pe.isForwardRef = function(T) { return N(T) === c; }, pe.isFragment = function(T) { return N(T) === r; }, pe.isLazy = function(T) { return N(T) === m; }, pe.isMemo = function(T) { return N(T) === p; }, pe.isPortal = function(T) { return N(T) === n; }, pe.isProfiler = function(T) { return N(T) === i; }, pe.isStrictMode = function(T) { return N(T) === a; }, pe.isSuspense = function(T) { return N(T) === f; }, pe.isValidElementType = function(T) { return typeof T == "string" || typeof T == "function" || T === r || T === d || T === i || T === a || T === f || T === h || typeof T == "object" && T !== null && (T.$$typeof === m || T.$$typeof === p || T.$$typeof === o || T.$$typeof === s || T.$$typeof === c || T.$$typeof === g || T.$$typeof === v || T.$$typeof === $ || T.$$typeof === _); }, pe.typeOf = N, pe; } var me = {}; /** @license React v16.13.1 * react-is.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 Xr; function wl() { return Xr || (Xr = 1, true && function() { var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, n = t ? Symbol.for("react.portal") : 60106, r = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, i = t ? Symbol.for("react.profiler") : 60114, o = t ? Symbol.for("react.provider") : 60109, s = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, d = t ? Symbol.for("react.concurrent_mode") : 60111, c = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, h = t ? Symbol.for("react.suspense_list") : 60120, p = t ? Symbol.for("react.memo") : 60115, m = t ? Symbol.for("react.lazy") : 60116, _ = t ? Symbol.for("react.block") : 60121, g = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, $ = t ? Symbol.for("react.scope") : 60119; function N(B) { return typeof B == "string" || typeof B == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. B === r || B === d || B === i || B === a || B === f || B === h || typeof B == "object" && B !== null && (B.$$typeof === m || B.$$typeof === p || B.$$typeof === o || B.$$typeof === s || B.$$typeof === c || B.$$typeof === g || B.$$typeof === v || B.$$typeof === $ || B.$$typeof === _); } function y(B) { if (typeof B == "object" && B !== null) { var _e = B.$$typeof; switch (_e) { case e: var Oe = B.type; switch (Oe) { case l: case d: case r: case i: case a: case f: return Oe; default: var Ge = Oe && Oe.$$typeof; switch (Ge) { case s: case c: case m: case p: case o: return Ge; default: return _e; } } case n: return _e; } } } var T = l, D = d, U = s, I = o, R = e, k = c, P = r, V = m, M = p, C = n, O = i, x = a, b = f, w = !1; function Z(B) { return w || (w = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), S(B) || y(B) === l; } function S(B) { return y(B) === d; } function A(B) { return y(B) === s; } function q(B) { return y(B) === o; } function J(B) { return typeof B == "object" && B !== null && B.$$typeof === e; } function Y(B) { return y(B) === c; } function L(B) { return y(B) === r; } function G(B) { return y(B) === m; } function H(B) { return y(B) === p; } function Q(B) { return y(B) === n; } function X(B) { return y(B) === i; } function te(B) { return y(B) === a; } function oe(B) { return y(B) === f; } me.AsyncMode = T, me.ConcurrentMode = D, me.ContextConsumer = U, me.ContextProvider = I, me.Element = R, me.ForwardRef = k, me.Fragment = P, me.Lazy = V, me.Memo = M, me.Portal = C, me.Profiler = O, me.StrictMode = x, me.Suspense = b, me.isAsyncMode = Z, me.isConcurrentMode = S, me.isContextConsumer = A, me.isContextProvider = q, me.isElement = J, me.isForwardRef = Y, me.isFragment = L, me.isLazy = G, me.isMemo = H, me.isPortal = Q, me.isProfiler = X, me.isStrictMode = te, me.isSuspense = oe, me.isValidElementType = N, me.typeOf = y; }()), me; } var qr; function Ri() { return qr || (qr = 1, false ? 0 : qt.exports = wl()), qt.exports; } /* object-assign (c) Sindre Sorhus @license MIT */ var Rn, Zr; function Ll() { if (Zr) return Rn; Zr = 1; var t = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable; function r(i) { if (i == null) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(i); } function a() { try { if (!Object.assign) return !1; var i = new String("abc"); if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5") return !1; for (var o = {}, s = 0; s < 10; s++) o["_" + String.fromCharCode(s)] = s; var l = Object.getOwnPropertyNames(o).map(function(c) { return o[c]; }); if (l.join("") !== "0123456789") return !1; var d = {}; return "abcdefghijklmnopqrst".split("").forEach(function(c) { d[c] = c; }), Object.keys(Object.assign({}, d)).join("") === "abcdefghijklmnopqrst"; } catch { return !1; } } return Rn = a() ? Object.assign : function(i, o) { for (var s, l = r(i), d, c = 1; c < arguments.length; c++) { s = Object(arguments[c]); for (var f in s) e.call(s, f) && (l[f] = s[f]); if (t) { d = t(s); for (var h = 0; h < d.length; h++) n.call(s, d[h]) && (l[d[h]] = s[d[h]]); } } return l; }, Rn; } var Dn, Jr; function Er() { if (Jr) return Dn; Jr = 1; var t = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; return Dn = t, Dn; } var Pn, Qr; function Di() { return Qr || (Qr = 1, Pn = Function.call.bind(Object.prototype.hasOwnProperty)), Pn; } var wn, ea; function xl() { if (ea) return wn; ea = 1; var t = function() { }; if (true) { var e = Er(), n = {}, r = Di(); t = function(i) { var o = "Warning: " + i; typeof console < "u" && console.error(o); try { throw new Error(o); } catch { } }; } function a(i, o, s, l, d) { if (true) { for (var c in i) if (r(i, c)) { var f; try { if (typeof i[c] != "function") { var h = Error( (l || "React class") + ": " + s + " type `" + c + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[c] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." ); throw h.name = "Invariant Violation", h; } f = i[c](o, c, l, s, null, e); } catch (m) { f = m; } if (f && !(f instanceof Error) && t( (l || "React class") + ": type specification of " + s + " `" + c + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof f + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." ), f instanceof Error && !(f.message in n)) { n[f.message] = !0; var p = d ? d() : ""; t( "Failed " + s + " type: " + f.message + (p ?? "") ); } } } } return a.resetWarningCache = function() { true && (n = {}); }, wn = a, wn; } var Ln, ta; function Fl() { if (ta) return Ln; ta = 1; var t = Ri(), e = Ll(), n = Er(), r = Di(), a = xl(), i = function() { }; true && (i = function(s) { var l = "Warning: " + s; typeof console < "u" && console.error(l); try { throw new Error(l); } catch { } }); function o() { return null; } return Ln = function(s, l) { var d = typeof Symbol == "function" && Symbol.iterator, c = "@@iterator"; function f(S) { var A = S && (d && S[d] || S[c]); if (typeof A == "function") return A; } var h = "<>", p = { array: v("array"), bigint: v("bigint"), bool: v("boolean"), func: v("function"), number: v("number"), object: v("object"), string: v("string"), symbol: v("symbol"), any: $(), arrayOf: N, element: y(), elementType: T(), instanceOf: D, node: k(), objectOf: I, oneOf: U, oneOfType: R, shape: V, exact: M }; function m(S, A) { return S === A ? S !== 0 || 1 / S === 1 / A : S !== S && A !== A; } function _(S, A) { this.message = S, this.data = A && typeof A == "object" ? A : {}, this.stack = ""; } _.prototype = Error.prototype; function g(S) { if (true) var A = {}, q = 0; function J(L, G, H, Q, X, te, oe) { if (Q = Q || h, te = te || H, oe !== n) { if (l) { 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; } else if ( true && typeof console < "u") { var _e = Q + ":" + H; !A[_e] && // Avoid spamming the console because they are often not actionable except for lib authors q < 3 && (i( "You are manually calling a React.PropTypes validation function for the `" + te + "` prop on `" + Q + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." ), A[_e] = !0, q++); } } return G[H] == null ? L ? G[H] === null ? new _("The " + X + " `" + te + "` is marked as required " + ("in `" + Q + "`, but its value is `null`.")) : new _("The " + X + " `" + te + "` is marked as required in " + ("`" + Q + "`, but its value is `undefined`.")) : null : S(G, H, Q, X, te); } var Y = J.bind(null, !1); return Y.isRequired = J.bind(null, !0), Y; } function v(S) { function A(q, J, Y, L, G, H) { var Q = q[J], X = x(Q); if (X !== S) { var te = b(Q); return new _( "Invalid " + L + " `" + G + "` of type " + ("`" + te + "` supplied to `" + Y + "`, expected ") + ("`" + S + "`."), { expectedType: S } ); } return null; } return g(A); } function $() { return g(o); } function N(S) { function A(q, J, Y, L, G) { if (typeof S != "function") return new _("Property `" + G + "` of component `" + Y + "` has invalid PropType notation inside arrayOf."); var H = q[J]; if (!Array.isArray(H)) { var Q = x(H); return new _("Invalid " + L + " `" + G + "` of type " + ("`" + Q + "` supplied to `" + Y + "`, expected an array.")); } for (var X = 0; X < H.length; X++) { var te = S(H, X, Y, L, G + "[" + X + "]", n); if (te instanceof Error) return te; } return null; } return g(A); } function y() { function S(A, q, J, Y, L) { var G = A[q]; if (!s(G)) { var H = x(G); return new _("Invalid " + Y + " `" + L + "` of type " + ("`" + H + "` supplied to `" + J + "`, expected a single ReactElement.")); } return null; } return g(S); } function T() { function S(A, q, J, Y, L) { var G = A[q]; if (!t.isValidElementType(G)) { var H = x(G); return new _("Invalid " + Y + " `" + L + "` of type " + ("`" + H + "` supplied to `" + J + "`, expected a single ReactElement type.")); } return null; } return g(S); } function D(S) { function A(q, J, Y, L, G) { if (!(q[J] instanceof S)) { var H = S.name || h, Q = Z(q[J]); return new _("Invalid " + L + " `" + G + "` of type " + ("`" + Q + "` supplied to `" + Y + "`, expected ") + ("instance of `" + H + "`.")); } return null; } return g(A); } function U(S) { if (!Array.isArray(S)) return true && (arguments.length > 1 ? i( "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." ) : i("Invalid argument supplied to oneOf, expected an array.")), o; function A(q, J, Y, L, G) { for (var H = q[J], Q = 0; Q < S.length; Q++) if (m(H, S[Q])) return null; var X = JSON.stringify(S, function(oe, B) { var _e = b(B); return _e === "symbol" ? String(B) : B; }); return new _("Invalid " + L + " `" + G + "` of value `" + String(H) + "` " + ("supplied to `" + Y + "`, expected one of " + X + ".")); } return g(A); } function I(S) { function A(q, J, Y, L, G) { if (typeof S != "function") return new _("Property `" + G + "` of component `" + Y + "` has invalid PropType notation inside objectOf."); var H = q[J], Q = x(H); if (Q !== "object") return new _("Invalid " + L + " `" + G + "` of type " + ("`" + Q + "` supplied to `" + Y + "`, expected an object.")); for (var X in H) if (r(H, X)) { var te = S(H, X, Y, L, G + "." + X, n); if (te instanceof Error) return te; } return null; } return g(A); } function R(S) { if (!Array.isArray(S)) return true && i("Invalid argument supplied to oneOfType, expected an instance of array."), o; for (var A = 0; A < S.length; A++) { var q = S[A]; if (typeof q != "function") return i( "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + w(q) + " at index " + A + "." ), o; } function J(Y, L, G, H, Q) { for (var X = [], te = 0; te < S.length; te++) { var oe = S[te], B = oe(Y, L, G, H, Q, n); if (B == null) return null; B.data && r(B.data, "expectedType") && X.push(B.data.expectedType); } var _e = X.length > 0 ? ", expected one of type [" + X.join(", ") + "]" : ""; return new _("Invalid " + H + " `" + Q + "` supplied to " + ("`" + G + "`" + _e + ".")); } return g(J); } function k() { function S(A, q, J, Y, L) { return C(A[q]) ? null : new _("Invalid " + Y + " `" + L + "` supplied to " + ("`" + J + "`, expected a ReactNode.")); } return g(S); } function P(S, A, q, J, Y) { return new _( (S || "React class") + ": " + A + " type `" + q + "." + J + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + Y + "`." ); } function V(S) { function A(q, J, Y, L, G) { var H = q[J], Q = x(H); if (Q !== "object") return new _("Invalid " + L + " `" + G + "` of type `" + Q + "` " + ("supplied to `" + Y + "`, expected `object`.")); for (var X in S) { var te = S[X]; if (typeof te != "function") return P(Y, L, G, X, b(te)); var oe = te(H, X, Y, L, G + "." + X, n); if (oe) return oe; } return null; } return g(A); } function M(S) { function A(q, J, Y, L, G) { var H = q[J], Q = x(H); if (Q !== "object") return new _("Invalid " + L + " `" + G + "` of type `" + Q + "` " + ("supplied to `" + Y + "`, expected `object`.")); var X = e({}, q[J], S); for (var te in X) { var oe = S[te]; if (r(S, te) && typeof oe != "function") return P(Y, L, G, te, b(oe)); if (!oe) return new _( "Invalid " + L + " `" + G + "` key `" + te + "` supplied to `" + Y + "`.\nBad object: " + JSON.stringify(q[J], null, " ") + ` Valid keys: ` + JSON.stringify(Object.keys(S), null, " ") ); var B = oe(H, te, Y, L, G + "." + te, n); if (B) return B; } return null; } return g(A); } function C(S) { switch (typeof S) { case "number": case "string": case "undefined": return !0; case "boolean": return !S; case "object": if (Array.isArray(S)) return S.every(C); if (S === null || s(S)) return !0; var A = f(S); if (A) { var q = A.call(S), J; if (A !== S.entries) { for (; !(J = q.next()).done; ) if (!C(J.value)) return !1; } else for (; !(J = q.next()).done; ) { var Y = J.value; if (Y && !C(Y[1])) return !1; } } else return !1; return !0; default: return !1; } } function O(S, A) { return S === "symbol" ? !0 : A ? A["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && A instanceof Symbol : !1; } function x(S) { var A = typeof S; return Array.isArray(S) ? "array" : S instanceof RegExp ? "object" : O(A, S) ? "symbol" : A; } function b(S) { if (typeof S > "u" || S === null) return "" + S; var A = x(S); if (A === "object") { if (S instanceof Date) return "date"; if (S instanceof RegExp) return "regexp"; } return A; } function w(S) { var A = b(S); switch (A) { case "array": case "object": return "an " + A; case "boolean": case "date": case "regexp": return "a " + A; default: return A; } } function Z(S) { return !S.constructor || !S.constructor.name ? h : S.constructor.name; } return p.checkPropTypes = a, p.resetWarningCache = a.resetWarningCache, p.PropTypes = p, p; }, Ln; } var xn, na; function Ml() { if (na) return xn; na = 1; var t = Er(); function e() { } function n() { } return n.resetWarningCache = e, xn = function() { function r(o, s, l, d, c, f) { if (f !== t) { var h = 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 h.name = "Invariant Violation", h; } } r.isRequired = r; function a() { return r; } var i = { array: r, bigint: r, bool: r, func: r, number: r, object: r, string: r, symbol: r, any: r, arrayOf: a, element: r, elementType: r, instanceOf: a, node: r, objectOf: a, oneOf: a, oneOfType: a, shape: a, exact: a, checkPropTypes: n, resetWarningCache: e }; return i.PropTypes = i, i; }, xn; } if (true) { var kl = Ri(), Bl = !0; Qn.exports = Fl()(kl.isElement, Bl); } else {} var Pi = Qn.exports, er = { exports: {} }, He = {}, tr = { exports: {} }; (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c; /*! * Adapted from jQuery UI core * * http://jqueryui.com * * Copyright 2014 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/category/ui-core/ */ var n = "none", r = "contents", a = /input|select|textarea|button|object|iframe/; function i(f, h) { return h.getPropertyValue("overflow") !== "visible" || // if 'overflow: visible' set, check if there is actually any overflow f.scrollWidth <= 0 && f.scrollHeight <= 0; } function o(f) { var h = f.offsetWidth <= 0 && f.offsetHeight <= 0; if (h && !f.innerHTML) return !0; try { var p = window.getComputedStyle(f), m = p.getPropertyValue("display"); return h ? m !== r && i(f, p) : m === n; } catch { return console.warn("Failed to inspect element style"), !1; } } function s(f) { for (var h = f, p = f.getRootNode && f.getRootNode(); h && h !== document.body; ) { if (p && h === p && (h = p.host.parentNode), o(h)) return !1; h = h.parentNode; } return !0; } function l(f, h) { var p = f.nodeName.toLowerCase(), m = a.test(p) && !f.disabled || p === "a" && f.href || h; return m && s(f); } function d(f) { var h = f.getAttribute("tabindex"); h === null && (h = void 0); var p = isNaN(h); return (p || h >= 0) && l(f, !p); } function c(f) { var h = [].slice.call(f.querySelectorAll("*"), 0).reduce(function(p, m) { return p.concat(m.shadowRoot ? c(m.shadowRoot) : [m]); }, []); return h.filter(d); } t.exports = e.default; })(tr, tr.exports); var wi = tr.exports; Object.defineProperty(He, "__esModule", { value: !0 }); He.resetState = Vl; He.log = Gl; He.handleBlur = kt; He.handleFocus = Bt; He.markForFocusLater = Kl; He.returnFocus = jl; He.popWithoutFocus = Yl; He.setupScopedFocus = zl; He.teardownScopedFocus = Xl; var Ul = wi, Hl = Wl(Ul); function Wl(t) { return t && t.__esModule ? t : { default: t }; } var dt = [], pt = null, nr = !1; function Vl() { dt = []; } function Gl() { true && (console.log("focusManager ----------"), dt.forEach(function(t) { var e = t || {}; console.log(e.nodeName, e.className, e.id); }), console.log("end focusManager ----------")); } function kt() { nr = !0; } function Bt() { if (nr) { if (nr = !1, !pt) return; setTimeout(function() { if (!pt.contains(document.activeElement)) { var t = (0, Hl.default)(pt)[0] || pt; t.focus(); } }, 0); } } function Kl() { dt.push(document.activeElement); } function jl() { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, e = null; try { dt.length !== 0 && (e = dt.pop(), e.focus({ preventScroll: t })); return; } catch { console.warn(["You tried to return focus to", e, "but it is not in the DOM anymore"].join(" ")); } } function Yl() { dt.length > 0 && dt.pop(); } function zl(t) { pt = t, window.addEventListener ? (window.addEventListener("blur", kt, !1), document.addEventListener("focus", Bt, !0)) : (window.attachEvent("onBlur", kt), document.attachEvent("onFocus", Bt)); } function Xl() { pt = null, window.addEventListener ? (window.removeEventListener("blur", kt), document.removeEventListener("focus", Bt)) : (window.detachEvent("onBlur", kt), document.detachEvent("onFocus", Bt)); } var rr = { exports: {} }; (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o; var n = wi, r = a(n); function a(s) { return s && s.__esModule ? s : { default: s }; } function i() { var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document; return s.activeElement.shadowRoot ? i(s.activeElement.shadowRoot) : s.activeElement; } function o(s, l) { var d = (0, r.default)(s); if (!d.length) { l.preventDefault(); return; } var c = void 0, f = l.shiftKey, h = d[0], p = d[d.length - 1], m = i(); if (s === m) { if (!f) return; c = p; } if (p === m && !f && (c = h), h === m && f && (c = p), c) { l.preventDefault(), c.focus(); return; } var _ = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent), g = _ != null && _[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null; if (g) { var v = d.indexOf(m); if (v > -1 && (v += f ? -1 : 1), c = d[v], typeof c > "u") { l.preventDefault(), c = f ? p : h, c.focus(); return; } l.preventDefault(), c.focus(); } } t.exports = e.default; })(rr, rr.exports); var ql = rr.exports, We = {}, Zl = "development" !== "production", Li = function() { }; if (Zl) { var Jl = function(e, n) { var r = arguments.length; n = new Array(r > 1 ? r - 1 : 0); for (var a = 1; a < r; a++) n[a - 1] = arguments[a]; var i = 0, o = "Warning: " + e.replace(/%s/g, function() { return n[i++]; }); typeof console < "u" && console.error(o); try { throw new Error(o); } catch { } }; Li = function(t, e, n) { var r = arguments.length; n = new Array(r > 2 ? r - 2 : 0); for (var a = 2; a < r; a++) n[a - 2] = arguments[a]; if (e === void 0) throw new Error( "`warning(condition, format, ...args)` requires a warning message argument" ); t || Jl.apply(null, [e].concat(n)); }; } var Ql = Li, Be = {}, xi = { exports: {} }; /*! Copyright (c) 2015 Jed Watson. Based on code that is Copyright 2013-2015, Facebook, Inc. All rights reserved. */ (function(t) { (function() { var e = !!(typeof window < "u" && window.document && window.document.createElement), n = { canUseDOM: e, canUseWorkers: typeof Worker < "u", canUseEventListeners: e && !!(window.addEventListener || window.attachEvent), canUseViewport: e && !!window.screen }; t.exports ? t.exports = n : window.ExecutionEnvironment = n; })(); })(xi); var ed = xi.exports; Object.defineProperty(Be, "__esModule", { value: !0 }); Be.canUseDOM = Be.SafeNodeList = Be.SafeHTMLCollection = void 0; var td = ed, nd = rd(td); function rd(t) { return t && t.__esModule ? t : { default: t }; } var Tn = nd.default, ad = Tn.canUseDOM ? window.HTMLElement : {}; Be.SafeHTMLCollection = Tn.canUseDOM ? window.HTMLCollection : {}; Be.SafeNodeList = Tn.canUseDOM ? window.NodeList : {}; Be.canUseDOM = Tn.canUseDOM; Be.default = ad; Object.defineProperty(We, "__esModule", { value: !0 }); We.resetState = dd; We.log = cd; We.assertNodeList = Fi; We.setElement = ud; We.validateElement = br; We.hide = fd; We.show = hd; We.documentNotReadyOrSSRTesting = pd; var id = Ql, od = ld(id), sd = Be; function ld(t) { return t && t.__esModule ? t : { default: t }; } var Le = null; function dd() { Le && (Le.removeAttribute ? Le.removeAttribute("aria-hidden") : Le.length != null ? Le.forEach(function(t) { return t.removeAttribute("aria-hidden"); }) : document.querySelectorAll(Le).forEach(function(t) { return t.removeAttribute("aria-hidden"); })), Le = null; } function cd() { if (true) { var t = Le || {}; console.log("ariaAppHider ----------"), console.log(t.nodeName, t.className, t.id), console.log("end ariaAppHider ----------"); } } function Fi(t, e) { if (!t || !t.length) throw new Error("react-modal: No elements were found for selector " + e + "."); } function ud(t) { var e = t; if (typeof e == "string" && sd.canUseDOM) { var n = document.querySelectorAll(e); Fi(n, e), e = n; } return Le = e || Le, Le; } function br(t) { var e = t || Le; return e ? Array.isArray(e) || e instanceof HTMLCollection || e instanceof NodeList ? e : [e] : ((0, od.default)(!1, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" ")), []); } function fd(t) { var e = !0, n = !1, r = void 0; try { for (var a = br(t)[Symbol.iterator](), i; !(e = (i = a.next()).done); e = !0) { var o = i.value; o.setAttribute("aria-hidden", "true"); } } catch (s) { n = !0, r = s; } finally { try { !e && a.return && a.return(); } finally { if (n) throw r; } } } function hd(t) { var e = !0, n = !1, r = void 0; try { for (var a = br(t)[Symbol.iterator](), i; !(e = (i = a.next()).done); e = !0) { var o = i.value; o.removeAttribute("aria-hidden"); } } catch (s) { n = !0, r = s; } finally { try { !e && a.return && a.return(); } finally { if (n) throw r; } } } function pd() { Le = null; } var St = {}; Object.defineProperty(St, "__esModule", { value: !0 }); St.resetState = md; St.log = $d; var rt = {}, at = {}; function ra(t, e) { t.classList.remove(e); } function md() { var t = document.getElementsByTagName("html")[0]; for (var e in rt) ra(t, rt[e]); var n = document.body; for (var r in at) ra(n, at[r]); rt = {}, at = {}; } function $d() { if (true) { var t = document.getElementsByTagName("html")[0].className, e = `Show tracked classes: `; e += " (" + t + `): `; for (var n in rt) e += " " + n + " " + rt[n] + ` `; t = document.body.className, e += ` doc.body (` + t + `): `; for (var r in at) e += " " + r + " " + at[r] + ` `; e += ` `, console.log(e); } } var _d = function(e, n) { return e[n] || (e[n] = 0), e[n] += 1, n; }, gd = function(e, n) { return e[n] && (e[n] -= 1), n; }, Td = function(e, n, r) { r.forEach(function(a) { _d(n, a), e.add(a); }); }, vd = function(e, n, r) { r.forEach(function(a) { gd(n, a), n[a] === 0 && e.remove(a); }); }; St.add = function(e, n) { return Td(e.classList, e.nodeName.toLowerCase() == "html" ? rt : at, n.split(" ")); }; St.remove = function(e, n) { return vd(e.classList, e.nodeName.toLowerCase() == "html" ? rt : at, n.split(" ")); }; var Ot = {}; Object.defineProperty(Ot, "__esModule", { value: !0 }); Ot.log = Ed; Ot.resetState = bd; function yd(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } var Mi = function t() { var e = this; yd(this, t), this.register = function(n) { if (e.openInstances.indexOf(n) !== -1) { true && console.warn("React-Modal: Cannot register modal instance that's already open"); return; } e.openInstances.push(n), e.emit("register"); }, this.deregister = function(n) { var r = e.openInstances.indexOf(n); if (r === -1) { true && console.warn("React-Modal: Unable to deregister " + n + " as it was never registered"); return; } e.openInstances.splice(r, 1), e.emit("deregister"); }, this.subscribe = function(n) { e.subscribers.push(n); }, this.emit = function(n) { e.subscribers.forEach(function(r) { return r( n, // shallow copy to avoid accidental mutation e.openInstances.slice() ); }); }, this.openInstances = [], this.subscribers = []; }, dn = new Mi(); function Ed() { console.log("portalOpenInstances ----------"), console.log(dn.openInstances.length), dn.openInstances.forEach(function(t) { return console.log(t); }), console.log("end portalOpenInstances ----------"); } function bd() { dn = new Mi(); } Ot.default = dn; var Cr = {}; Object.defineProperty(Cr, "__esModule", { value: !0 }); Cr.resetState = Od; Cr.log = Ad; var Cd = Ot, Nd = Sd(Cd); function Sd(t) { return t && t.__esModule ? t : { default: t }; } var Ae = void 0, ke = void 0, it = []; function Od() { for (var t = [Ae, ke], e = 0; e < t.length; e++) { var n = t[e]; n && n.parentNode && n.parentNode.removeChild(n); } Ae = ke = null, it = []; } function Ad() { console.log("bodyTrap ----------"), console.log(it.length); for (var t = [Ae, ke], e = 0; e < t.length; e++) { var n = t[e], r = n || {}; console.log(r.nodeName, r.className, r.id); } console.log("edn bodyTrap ----------"); } function aa() { if (it.length === 0) { true && console.warn("React-Modal: Open instances > 0 expected"); return; } it[it.length - 1].focusContent(); } function Id(t, e) { !Ae && !ke && (Ae = document.createElement("div"), Ae.setAttribute("data-react-modal-body-trap", ""), Ae.style.position = "absolute", Ae.style.opacity = "0", Ae.setAttribute("tabindex", "0"), Ae.addEventListener("focus", aa), ke = Ae.cloneNode(), ke.addEventListener("focus", aa)), it = e, it.length > 0 ? (document.body.firstChild !== Ae && document.body.insertBefore(Ae, document.body.firstChild), document.body.lastChild !== ke && document.body.appendChild(ke)) : (Ae.parentElement && Ae.parentElement.removeChild(Ae), ke.parentElement && ke.parentElement.removeChild(ke)); } Nd.default.subscribe(Id); (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }); var n = Object.assign || function(C) { for (var O = 1; O < arguments.length; O++) { var x = arguments[O]; for (var b in x) Object.prototype.hasOwnProperty.call(x, b) && (C[b] = x[b]); } return C; }, r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(C) { return typeof C; } : function(C) { return C && typeof Symbol == "function" && C.constructor === Symbol && C !== Symbol.prototype ? "symbol" : typeof C; }, a = function() { function C(O, x) { for (var b = 0; b < x.length; b++) { var w = x[b]; w.enumerable = w.enumerable || !1, w.configurable = !0, "value" in w && (w.writable = !0), Object.defineProperty(O, w.key, w); } } return function(O, x, b) { return x && C(O.prototype, x), b && C(O, b), O; }; }(), i = (react__WEBPACK_IMPORTED_MODULE_1___default()), o = Pi, s = T(o), l = He, d = y(l), c = ql, f = T(c), h = We, p = y(h), m = St, _ = y(m), g = Be, v = T(g), $ = Ot, N = T($); function y(C) { if (C && C.__esModule) return C; var O = {}; if (C != null) for (var x in C) Object.prototype.hasOwnProperty.call(C, x) && (O[x] = C[x]); return O.default = C, O; } function T(C) { return C && C.__esModule ? C : { default: C }; } function D(C, O) { if (!(C instanceof O)) throw new TypeError("Cannot call a class as a function"); } function U(C, O) { if (!C) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return O && (typeof O == "object" || typeof O == "function") ? O : C; } function I(C, O) { if (typeof O != "function" && O !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof O); C.prototype = Object.create(O && O.prototype, { constructor: { value: C, enumerable: !1, writable: !0, configurable: !0 } }), O && (Object.setPrototypeOf ? Object.setPrototypeOf(C, O) : C.__proto__ = O); } var R = { overlay: "ReactModal__Overlay", content: "ReactModal__Content" }, k = function(O) { return O.code === "Tab" || O.keyCode === 9; }, P = function(O) { return O.code === "Escape" || O.keyCode === 27; }, V = 0, M = function(C) { I(O, C); function O(x) { D(this, O); var b = U(this, (O.__proto__ || Object.getPrototypeOf(O)).call(this, x)); return b.setOverlayRef = function(w) { b.overlay = w, b.props.overlayRef && b.props.overlayRef(w); }, b.setContentRef = function(w) { b.content = w, b.props.contentRef && b.props.contentRef(w); }, b.afterClose = function() { var w = b.props, Z = w.appElement, S = w.ariaHideApp, A = w.htmlOpenClassName, q = w.bodyOpenClassName, J = w.parentSelector, Y = J && J().ownerDocument || document; q && _.remove(Y.body, q), A && _.remove(Y.getElementsByTagName("html")[0], A), S && V > 0 && (V -= 1, V === 0 && p.show(Z)), b.props.shouldFocusAfterRender && (b.props.shouldReturnFocusAfterClose ? (d.returnFocus(b.props.preventScroll), d.teardownScopedFocus()) : d.popWithoutFocus()), b.props.onAfterClose && b.props.onAfterClose(), N.default.deregister(b); }, b.open = function() { b.beforeOpen(), b.state.afterOpen && b.state.beforeClose ? (clearTimeout(b.closeTimer), b.setState({ beforeClose: !1 })) : (b.props.shouldFocusAfterRender && (d.setupScopedFocus(b.node), d.markForFocusLater()), b.setState({ isOpen: !0 }, function() { b.openAnimationFrame = requestAnimationFrame(function() { b.setState({ afterOpen: !0 }), b.props.isOpen && b.props.onAfterOpen && b.props.onAfterOpen({ overlayEl: b.overlay, contentEl: b.content }); }); })); }, b.close = function() { b.props.closeTimeoutMS > 0 ? b.closeWithTimeout() : b.closeWithoutTimeout(); }, b.focusContent = function() { return b.content && !b.contentHasFocus() && b.content.focus({ preventScroll: !0 }); }, b.closeWithTimeout = function() { var w = Date.now() + b.props.closeTimeoutMS; b.setState({ beforeClose: !0, closesAt: w }, function() { b.closeTimer = setTimeout(b.closeWithoutTimeout, b.state.closesAt - Date.now()); }); }, b.closeWithoutTimeout = function() { b.setState({ beforeClose: !1, isOpen: !1, afterOpen: !1, closesAt: null }, b.afterClose); }, b.handleKeyDown = function(w) { k(w) && (0, f.default)(b.content, w), b.props.shouldCloseOnEsc && P(w) && (w.stopPropagation(), b.requestClose(w)); }, b.handleOverlayOnClick = function(w) { b.shouldClose === null && (b.shouldClose = !0), b.shouldClose && b.props.shouldCloseOnOverlayClick && (b.ownerHandlesClose() ? b.requestClose(w) : b.focusContent()), b.shouldClose = null; }, b.handleContentOnMouseUp = function() { b.shouldClose = !1; }, b.handleOverlayOnMouseDown = function(w) { !b.props.shouldCloseOnOverlayClick && w.target == b.overlay && w.preventDefault(); }, b.handleContentOnClick = function() { b.shouldClose = !1; }, b.handleContentOnMouseDown = function() { b.shouldClose = !1; }, b.requestClose = function(w) { return b.ownerHandlesClose() && b.props.onRequestClose(w); }, b.ownerHandlesClose = function() { return b.props.onRequestClose; }, b.shouldBeClosed = function() { return !b.state.isOpen && !b.state.beforeClose; }, b.contentHasFocus = function() { return document.activeElement === b.content || b.content.contains(document.activeElement); }, b.buildClassName = function(w, Z) { var S = (typeof Z > "u" ? "undefined" : r(Z)) === "object" ? Z : { base: R[w], afterOpen: R[w] + "--after-open", beforeClose: R[w] + "--before-close" }, A = S.base; return b.state.afterOpen && (A = A + " " + S.afterOpen), b.state.beforeClose && (A = A + " " + S.beforeClose), typeof Z == "string" && Z ? A + " " + Z : A; }, b.attributesFromObject = function(w, Z) { return Object.keys(Z).reduce(function(S, A) { return S[w + "-" + A] = Z[A], S; }, {}); }, b.state = { afterOpen: !1, beforeClose: !1 }, b.shouldClose = null, b.moveFromContentToOverlay = null, b; } return a(O, [{ key: "componentDidMount", value: function() { this.props.isOpen && this.open(); } }, { key: "componentDidUpdate", value: function(b, w) { true && (b.bodyOpenClassName !== this.props.bodyOpenClassName && console.warn('React-Modal: "bodyOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.'), b.htmlOpenClassName !== this.props.htmlOpenClassName && console.warn('React-Modal: "htmlOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.')), this.props.isOpen && !b.isOpen ? this.open() : !this.props.isOpen && b.isOpen && this.close(), this.props.shouldFocusAfterRender && this.state.isOpen && !w.isOpen && this.focusContent(); } }, { key: "componentWillUnmount", value: function() { this.state.isOpen && this.afterClose(), clearTimeout(this.closeTimer), cancelAnimationFrame(this.openAnimationFrame); } }, { key: "beforeOpen", value: function() { var b = this.props, w = b.appElement, Z = b.ariaHideApp, S = b.htmlOpenClassName, A = b.bodyOpenClassName, q = b.parentSelector, J = q && q().ownerDocument || document; A && _.add(J.body, A), S && _.add(J.getElementsByTagName("html")[0], S), Z && (V += 1, p.hide(w)), N.default.register(this); } // Don't steal focus from inner elements }, { key: "render", value: function() { var b = this.props, w = b.id, Z = b.className, S = b.overlayClassName, A = b.defaultStyles, q = b.children, J = Z ? {} : A.content, Y = S ? {} : A.overlay; if (this.shouldBeClosed()) return null; var L = { ref: this.setOverlayRef, className: this.buildClassName("overlay", S), style: n({}, Y, this.props.style.overlay), onClick: this.handleOverlayOnClick, onMouseDown: this.handleOverlayOnMouseDown }, G = n({ id: w, ref: this.setContentRef, style: n({}, J, this.props.style.content), className: this.buildClassName("content", Z), tabIndex: "-1", onKeyDown: this.handleKeyDown, onMouseDown: this.handleContentOnMouseDown, onMouseUp: this.handleContentOnMouseUp, onClick: this.handleContentOnClick, role: this.props.role, "aria-label": this.props.contentLabel }, this.attributesFromObject("aria", n({ modal: !0 }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), { "data-testid": this.props.testId }), H = this.props.contentElement(G, q); return this.props.overlayElement(L, H); } }]), O; }(i.Component); M.defaultProps = { style: { overlay: {}, content: {} }, defaultStyles: {} }, M.propTypes = { isOpen: s.default.bool.isRequired, defaultStyles: s.default.shape({ content: s.default.object, overlay: s.default.object }), style: s.default.shape({ content: s.default.object, overlay: s.default.object }), className: s.default.oneOfType([s.default.string, s.default.object]), overlayClassName: s.default.oneOfType([s.default.string, s.default.object]), parentSelector: s.default.func, bodyOpenClassName: s.default.string, htmlOpenClassName: s.default.string, ariaHideApp: s.default.bool, appElement: s.default.oneOfType([s.default.instanceOf(v.default), s.default.instanceOf(g.SafeHTMLCollection), s.default.instanceOf(g.SafeNodeList), s.default.arrayOf(s.default.instanceOf(v.default))]), onAfterOpen: s.default.func, onAfterClose: s.default.func, onRequestClose: s.default.func, closeTimeoutMS: s.default.number, shouldFocusAfterRender: s.default.bool, shouldCloseOnOverlayClick: s.default.bool, shouldReturnFocusAfterClose: s.default.bool, preventScroll: s.default.bool, role: s.default.string, contentLabel: s.default.string, aria: s.default.object, data: s.default.object, children: s.default.node, shouldCloseOnEsc: s.default.bool, overlayRef: s.default.func, contentRef: s.default.func, id: s.default.string, overlayElement: s.default.func, contentElement: s.default.func, testId: s.default.string }, e.default = M, t.exports = e.default; })(er, er.exports); var Rd = er.exports; function ki() { var t = this.constructor.getDerivedStateFromProps(this.props, this.state); t != null && this.setState(t); } function Bi(t) { function e(n) { var r = this.constructor.getDerivedStateFromProps(t, n); return r ?? null; } this.setState(e.bind(this)); } function Ui(t, e) { try { var n = this.props, r = this.state; this.props = t, this.state = e, this.__reactInternalSnapshotFlag = !0, this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate( n, r ); } finally { this.props = n, this.state = r; } } ki.__suppressDeprecationWarning = !0; Bi.__suppressDeprecationWarning = !0; Ui.__suppressDeprecationWarning = !0; function Dd(t) { var e = t.prototype; if (!e || !e.isReactComponent) throw new Error("Can only polyfill class components"); if (typeof t.getDerivedStateFromProps != "function" && typeof e.getSnapshotBeforeUpdate != "function") return t; var n = null, r = null, a = null; if (typeof e.componentWillMount == "function" ? n = "componentWillMount" : typeof e.UNSAFE_componentWillMount == "function" && (n = "UNSAFE_componentWillMount"), typeof e.componentWillReceiveProps == "function" ? r = "componentWillReceiveProps" : typeof e.UNSAFE_componentWillReceiveProps == "function" && (r = "UNSAFE_componentWillReceiveProps"), typeof e.componentWillUpdate == "function" ? a = "componentWillUpdate" : typeof e.UNSAFE_componentWillUpdate == "function" && (a = "UNSAFE_componentWillUpdate"), n !== null || r !== null || a !== null) { var i = t.displayName || t.name, o = typeof t.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()"; throw Error( `Unsafe legacy lifecycles will not be called for components using new component APIs. ` + i + " uses " + o + " but also contains the following legacy lifecycles:" + (n !== null ? ` ` + n : "") + (r !== null ? ` ` + r : "") + (a !== null ? ` ` + a : "") + ` The above lifecycles should be removed. Learn more about this warning here: https://fb.me/react-async-component-lifecycle-hooks` ); } if (typeof t.getDerivedStateFromProps == "function" && (e.componentWillMount = ki, e.componentWillReceiveProps = Bi), typeof e.getSnapshotBeforeUpdate == "function") { if (typeof e.componentDidUpdate != "function") throw new Error( "Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype" ); e.componentWillUpdate = Ui; var s = e.componentDidUpdate; e.componentDidUpdate = function(d, c, f) { var h = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : f; s.call(this, d, c, h); }; } return t; } const Pd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, polyfill: Dd }, Symbol.toStringTag, { value: "Module" })), wd = /* @__PURE__ */ ps(Pd); Object.defineProperty(lt, "__esModule", { value: !0 }); lt.bodyOpenClassName = lt.portalClassName = void 0; var ia = Object.assign || function(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e]; for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); } return t; }, Ld = function() { function t(e, n) { for (var r = 0; r < n.length; r++) { var a = n[r]; a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a); } } return function(e, n, r) { return n && t(e.prototype, n), r && t(e, r), e; }; }(), Hi = (react__WEBPACK_IMPORTED_MODULE_1___default()), cn = jt(Hi), xd = (react_dom__WEBPACK_IMPORTED_MODULE_2___default()), un = jt(xd), Fd = Pi, ie = jt(Fd), Md = Rd, oa = jt(Md), kd = We, Bd = Hd(kd), Ze = Be, sa = jt(Ze), Ud = wd; function Hd(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); return e.default = t, e; } function jt(t) { return t && t.__esModule ? t : { default: t }; } function Wd(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function la(t, e) { if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e && (typeof e == "object" || typeof e == "function") ? e : t; } function Vd(t, e) { if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof e); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e); } var Gd = lt.portalClassName = "ReactModalPortal", Kd = lt.bodyOpenClassName = "ReactModal__Body--open", tt = Ze.canUseDOM && un.default.createPortal !== void 0, ar = function(e) { return document.createElement(e); }, da = function() { return tt ? un.default.createPortal : un.default.unstable_renderSubtreeIntoContainer; }; function Zt(t) { return t(); } var At = function(t) { Vd(e, t); function e() { var n, r, a, i; Wd(this, e); for (var o = arguments.length, s = Array(o), l = 0; l < o; l++) s[l] = arguments[l]; return i = (r = (a = la(this, (n = e.__proto__ || Object.getPrototypeOf(e)).call.apply(n, [this].concat(s))), a), a.removePortal = function() { !tt && un.default.unmountComponentAtNode(a.node); var d = Zt(a.props.parentSelector); d && d.contains(a.node) ? d.removeChild(a.node) : console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.'); }, a.portalRef = function(d) { a.portal = d; }, a.renderPortal = function(d) { var c = da(), f = c(a, cn.default.createElement(oa.default, ia({ defaultStyles: e.defaultStyles }, d)), a.node); a.portalRef(f); }, r), la(a, i); } return Ld(e, [{ key: "componentDidMount", value: function() { if (Ze.canUseDOM) { tt || (this.node = ar("div")), this.node.className = this.props.portalClassName; var r = Zt(this.props.parentSelector); r.appendChild(this.node), !tt && this.renderPortal(this.props); } } }, { key: "getSnapshotBeforeUpdate", value: function(r) { var a = Zt(r.parentSelector), i = Zt(this.props.parentSelector); return { prevParent: a, nextParent: i }; } }, { key: "componentDidUpdate", value: function(r, a, i) { if (Ze.canUseDOM) { var o = this.props, s = o.isOpen, l = o.portalClassName; r.portalClassName !== l && (this.node.className = l); var d = i.prevParent, c = i.nextParent; c !== d && (d.removeChild(this.node), c.appendChild(this.node)), !(!r.isOpen && !s) && !tt && this.renderPortal(this.props); } } }, { key: "componentWillUnmount", value: function() { if (!(!Ze.canUseDOM || !this.node || !this.portal)) { var r = this.portal.state, a = Date.now(), i = r.isOpen && this.props.closeTimeoutMS && (r.closesAt || a + this.props.closeTimeoutMS); i ? (r.beforeClose || this.portal.closeWithTimeout(), setTimeout(this.removePortal, i - a)) : this.removePortal(); } } }, { key: "render", value: function() { if (!Ze.canUseDOM || !tt) return null; !this.node && tt && (this.node = ar("div")); var r = da(); return r(cn.default.createElement(oa.default, ia({ ref: this.portalRef, defaultStyles: e.defaultStyles }, this.props)), this.node); } }], [{ key: "setAppElement", value: function(r) { Bd.setElement(r); } /* eslint-disable react/no-unused-prop-types */ /* eslint-enable react/no-unused-prop-types */ }]), e; }(Hi.Component); At.propTypes = { isOpen: ie.default.bool.isRequired, style: ie.default.shape({ content: ie.default.object, overlay: ie.default.object }), portalClassName: ie.default.string, bodyOpenClassName: ie.default.string, htmlOpenClassName: ie.default.string, className: ie.default.oneOfType([ie.default.string, ie.default.shape({ base: ie.default.string.isRequired, afterOpen: ie.default.string.isRequired, beforeClose: ie.default.string.isRequired })]), overlayClassName: ie.default.oneOfType([ie.default.string, ie.default.shape({ base: ie.default.string.isRequired, afterOpen: ie.default.string.isRequired, beforeClose: ie.default.string.isRequired })]), appElement: ie.default.oneOfType([ie.default.instanceOf(sa.default), ie.default.instanceOf(Ze.SafeHTMLCollection), ie.default.instanceOf(Ze.SafeNodeList), ie.default.arrayOf(ie.default.instanceOf(sa.default))]), onAfterOpen: ie.default.func, onRequestClose: ie.default.func, closeTimeoutMS: ie.default.number, ariaHideApp: ie.default.bool, shouldFocusAfterRender: ie.default.bool, shouldCloseOnOverlayClick: ie.default.bool, shouldReturnFocusAfterClose: ie.default.bool, preventScroll: ie.default.bool, parentSelector: ie.default.func, aria: ie.default.object, data: ie.default.object, role: ie.default.string, contentLabel: ie.default.string, shouldCloseOnEsc: ie.default.bool, overlayRef: ie.default.func, contentRef: ie.default.func, id: ie.default.string, overlayElement: ie.default.func, contentElement: ie.default.func }; At.defaultProps = { isOpen: !1, portalClassName: Gd, bodyOpenClassName: Kd, role: "dialog", ariaHideApp: !0, closeTimeoutMS: 0, shouldFocusAfterRender: !0, shouldCloseOnEsc: !0, shouldCloseOnOverlayClick: !0, shouldReturnFocusAfterClose: !0, preventScroll: !1, parentSelector: function() { return document.body; }, overlayElement: function(e, n) { return cn.default.createElement( "div", e, n ); }, contentElement: function(e, n) { return cn.default.createElement( "div", e, n ); } }; At.defaultStyles = { overlay: { position: "fixed", top: 0, left: 0, right: 0, bottom: 0, backgroundColor: "rgba(255, 255, 255, 0.75)" }, content: { position: "absolute", top: "40px", left: "40px", right: "40px", bottom: "40px", border: "1px solid #ccc", background: "#fff", overflow: "auto", WebkitOverflowScrolling: "touch", borderRadius: "4px", outline: "none", padding: "20px" } }; (0, Ud.polyfill)(At); true && (At.setCreateHTMLElement = function(t) { return ar = t; }); lt.default = At; (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }); var n = lt, r = a(n); function a(i) { return i && i.__esModule ? i : { default: i }; } e.default = r.default, t.exports = e.default; })(Jn, Jn.exports); var jd = Jn.exports; const Wi = /* @__PURE__ */ _r(jd), Yd = "DIALOG_IMAGE_TEST_ID", zd = "DIALOG_CONTENT_TEST_ID", Xd = "DIALOG_DATA_TEST_ID", Jt = { MEDIA: "fmc-dialog__media-area", VIDEO: "fmc-dialog__video", VIDEO_COVER: "fmc-dialog__video-cover", VIDEO_FULL: "fmc-dialog__video--full", VIDEO_PLAYING: "fmc-dialog__video--playing" }, qd = { title: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: "You are now leaving fordpro.ca" }), body: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ "You are now leaving ", /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "https://www.fordpro.ca/en-ca/", target: "_self", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("u", { children: "fordpro.ca" }) }), ". Ford of Canada's privacy policy will no longer apply. Please refer to the redirected website for its privacy policy." ] }), buttonOneText: "Continue", ariaLabelButtonOne: "Continue to the site. Opens in a new window.", buttonTwoText: "Cancel", ariaLabelButtonTwo: "Cancel this action." }, Zd = { title: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: "Vous êtes sur le point de quitter fordpro.ca" }), body: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ "Vous êtes sur le point de quitter ", /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "https://www.fordpro.ca/fr-ca/", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("u", { children: "fordpro.ca" }) }), ". La politique de confidentialité de Ford Canada cessera de s'appliquer. Veuillez-vous reporter à la politique de confidentialité du site auquel vous serez redirigé.", /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("br", {}) ] }), buttonOneText: "Continuer", ariaLabelButtonOne: "Continuer vers le site. S’ouvre dans une nouvelle fenêtre.", buttonTwoText: "Annuler", ariaLabelButtonTwo: "Annuler cette action." }, Jd = ({ type: t = "standard", children: e, visible: n = !1, onRequestClose: r, closeOnBackdropClick: a = !1, style: i, className: o }) => { const s = react__WEBPACK_IMPORTED_MODULE_1__.useRef(); react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => { if (a) { const d = (c) => { c.target === s.current && r(); }; return window.addEventListener("click", d), () => { window.removeEventListener("click", d); }; } }, [a, r]); const l = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Wt, { name: "clear", className: E( "fmc-dialog__close", "fds-icon", "fds-font--ford-icons__clear" ), onClick: r, type: "button", "aria-label": "Close", size: 24 } ); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Wi, { style: i, isOpen: n, onRequestClose: r, className: E("fds-app"), appElement: document.getElementsByClassName("fds-app"), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { id: "FDSDialog", className: E( "fmc-dialog", n && "fmc-dialog--opened", o ), role: "dialog", "aria-modal": "true", "aria-label": "Dialog modal", ref: s, "data-testid": Xd, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: E("fmc-dialog__content"), children: [ t === "standard" && l, e ] }) } ) } ); }, Qd = ({ title: t, subtitle: e, body: n, buttonOneText: r, buttonOneOnClick: a, buttonOneStyle: i = "primary", buttonOneLink: o, buttonOneTarget: s, buttonTwoText: l, buttonTwoOnClick: d, buttonTwoStyle: c = "outlined", buttonTwoLink: f, alignment: h = "left", className: p, dataTestId: m = zd, ariaLabelButtonOne: _, ariaLabelButtonTwo: g }) => { const v = (D, U, I, R, k, P) => { const M = { title: U, onClick: I, href: R, as: R ? "a" : "button", ariaLabel: P, ...s && { target: s } }; return D === "primary" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: k, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Tt, { ...M }) }) : D === "outlined" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: k, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Tt, { outlined: !0, ...M }) }) : null; }, $ = "fmc-m--b-2", N = "fmc-mb-3-xs fmc-mb-3-sm fmc-mb-3-md", y = `fmc-mr-5-lg fmc-mr-5-xl fmc-mr-5-md fmc-mr-3-sm ${h === "left" ? "fmc-mr-3-xs" : ""}`, T = h === "left" ? "flex-start" : "center"; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { id: "FDSDialogContent", "data-testid": m, className: E(h === "center" && "fds-align--center", p), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: E("fmc-type--heading5", "fmc-mb-3", "fmc-dialog__heading-title"), children: t }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", { className: E("fmc-type--subtitle1", "fmc-mb-2"), children: e }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: E("fmc-type--body1", "fmc-mb-5"), children: n }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { style: { display: "flex", flexWrap: "wrap", justifyContent: T }, children: [ r && v( i, r, a, o, `${$} ${y} ${N} `, _ ), l && v( c, l, d, f, $, g ) ] } ) ] } ); }, C1 = ({ alt: t, className: e, imageClassName: n, dataTestId: r = Yd, ...a }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E(e), style: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "img", { "data-testid": r, className: E("fmc-pb-5", n), alt: t, ...a } ) } ), ec = "CARD_VIDEO_MEDIA_TEST_ID", tc = "CARD_VIDEO_COVER_TEST_ID", nc = "CARD_HTML5_VIDEO_TEST_ID", rc = "CARD_HTML5_VIDEO_TRACK_TEST_ID", ac = "CARD_HTML5_VIDEO_SOURCE_TEST_ID", N1 = ({ children: t, videoCover: e, isVideoPlaying: n = !1, videoTrackProps: r, videoSources: a, videoRef: i, onPlayCustomVideoMedia: o, className: s, dataTestId: l = ec, ...d }) => { const [c, f] = react__WEBPACK_IMPORTED_MODULE_1__.useState(!1), h = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null); react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => { h?.current && c && h.current.play(); }, [c]); const p = () => { t && o ? o() : h?.current && h.current.paused && f(!0); }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { id: "FDSDialogVideo", "data-testid": l, "aria-label": "Video media", role: "button", tabIndex: 0, className: E( Jt.MEDIA, Jt.VIDEO, (n || c) && Jt.VIDEO_PLAYING, "fds-m--b-2", s ), onClick: p, onKeyPress: (m) => m.key === "Enter" && p(), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": tc, className: E(Jt.VIDEO_COVER), style: e ? { backgroundImage: `url(${e})`, backgroundSize: "cover", backgroundRepeat: "no-repeat", backgroundPosition: "center center", zIndex: n || c ? 0 : 1 } : {} } ), t, !t && a ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "video", { "data-testid": nc, width: "100%", ref: void 0, controls: n || c, style: { zIndex: n || c ? 1 : 0 }, ...d, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "track", { "data-testid": rc, default: !0, kind: "captions", ...r } ), a.map((m, _) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "source", { "data-testid": `${ac}_${_}`, ...m }, _ )), "Sorry, your browser doesn't support embedded videos." ] } ) : null ] } ); }, S1 = ({ isVisible: t, onClickFunction: e, buttonOneLink: n, buttonOneAriaLabel: r }) => { const a = window.location.pathname.split("/")[1], i = a.includes("ca"), s = a.includes("fr") ? Zd : qd, l = (d) => { e && e(), i && window?._satellite && window?._satellite.track( "globalInteraction", { onclickLinkName: `exit modal:${d}`, onclick: `exit modal:${d}`, tool: "event:exit modal", toolDescriptor: `exit modal:${d}` } ); }; return react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => { t && window?._satellite && i && window?._satellite.track("globalInteraction", { onclickLinkName: "exit modal", onclick: "exit modal:modal displayed", tool: "event:exit modal", toolDescriptor: "exit modal:display" }); }, [i, t]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Jd, { visible: t, onRequestClose: () => l("cancel"), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Qd, { title: s.title, body: s.body, buttonOneText: s.buttonOneText, buttonOneOnClick: () => l("continue"), buttonOneLink: n, buttonOneTarget: "_blank", ariaLabelButtonOne: r ?? s.ariaLabelButtonOne, buttonTwoText: s.buttonTwoText, buttonTwoOnClick: () => l("cancel"), alignment: "left", ariaLabelButtonTwo: s.ariaLabelButtonTwo } ) }); }, ut = { HORIZONTAL: "fmc-divider--horizontal", FULL_HORIZONTAL: "fmc-divider--horizontal-full", VERTICAL: "fmc-divider--vertical", FULL_VERTICAL: "fmc-divider--vertical-full", LAYOUT_GRID: "fds-layout-grid__cell--span-2" }, O1 = ({ full: t = !0, className: e, horizontal: n = !0 }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "hr", { className: E( n && t && ut.FULL_HORIZONTAL, n && !t && ut.HORIZONTAL, !n && t && `${ut.FULL_VERTICAL} ${ut.LAYOUT_GRID}`, !n && !t && `${ut.VERTICAL} ${ut.LAYOUT_GRID}`, e ) } ), Vi = "FILTER_CHIPS_DATA_TEST_ID", mt = { FILTER_CHIPS: "fmc-filter-chips", FILTER_CHIPS_SCROLLABLE: "fmc-filter-chips--scrollable", FILTER_CHIPS_CHIP: "fmc-filter-chips__chip", FILTER_CHIPS_DISABLED: "fmc-filter-chips__chip--disabled", TEXT_BUTTON: "fmc-text-button", ICON_CLEAR: "fds-icon fds-icon--24 fds-icon--offset-right-sm fds-font--ford-icons__clear", ICON_OFFSET: "fds-icon fds-icon--24 fds-icon--offset-left" }, A1 = ({ isScrollable: t, children: e, dataTestId: n = Vi }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E( mt.FILTER_CHIPS, t && mt.FILTER_CHIPS_SCROLLABLE ), "data-testid": n, children: e } ), I1 = ({ text: t, isDisabled: e, thumbnail: n, onDelete: r, dataTestId: a = Vi }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( mt.FILTER_CHIPS_CHIP, e && mt.FILTER_CHIPS_DISABLED ), "data-testid": a, children: [ n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E(mt.ICON_OFFSET), children: react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(n, { style: { height: "24px", width: "24px" } }) }), t, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: E(mt.ICON_CLEAR), "aria-label": "clear", ...e && { disabled: e }, onClick: r } ) ] } ); function ca(t) { return t != null && !(Array.isArray(t) && t.length === 0); } function tn(t, e = !1) { return t && (ca(t.value) && t.value !== "" || e && ca(t.defaultValue) && t.defaultValue !== ""); } const Fn = { INPUT_DISABLED: "cxc-input-field__input--disabled", STATUS: "cxc-input-field__status", MESSAGE: "cxc-input-field__message" }, ic = "TextField", ct = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef( ({ onChange: t, onFocus: e, onBlur: n, onClick: r, defaultValue: a, role: i, multiline: o = !1, hideDateFormat: s, disabled: l = !1, hideSuccess: d = !1, error: c, placeholder: f, message: h, value: p, required: m, inputRef: _, className: g, success: v, label: $, pattern: N, labelIsVisibleWhenDisabled: y = !1, ...T }, D) => { const [U, I] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [R, k] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [P, V] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), { current: M } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(p != null), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(Ve(T.id ?? ic)), O = (L) => { n && n(L), k(!1); }, x = (L) => { k(!0), I(!0), r && r(L); }, b = (L) => { k(!0), I(!0), e && e(L); }, w = (L) => { L.key === "Tab" && x(L); }, Z = (L, ...G) => { if (!M) { const H = L.target || _.current; q({ value: H.value }); } t && t(L, ...G); }, S = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { V(!0); }, []), A = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { V(!1); }, []), q = react__WEBPACK_IMPORTED_MODULE_1__.useCallback( (L) => { tn(L) ? S && S() : A && A(); }, [S, A] ); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { M && q({ value: p }); }, [p, q, M]); const J = f || $, Y = $ || f; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E( "fds-app", "cxc-input-field", P && "cxc-input-field-filled", R && "cxc-input-field-active", l && Fn.INPUT_DISABLED, g ), ref: D, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( "fmc-floating-label", c && "fmc-floating-label--error", !d && v && "fmc-floating-label--success" ), children: [ o ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "textarea", { id: C.current, "aria-disabled": l, "aria-describedby": `${C.current}_message_id`, className: E( "cxc-multiline", c && "fmc-input--error", !d && v && "fmc-input--success", "fmc-input" ), disabled: l, value: p, placeholder: R ? void 0 : J, defaultValue: a, onBlur: O, onChange: Z, onFocus: b, onClick: x, onKeyUp: w, required: m, ref: _ } ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "input", { "aria-disabled": l, "aria-describedby": `${C.current}_message_id`, className: E( c && "fmc-input--error", !d && v && "fmc-input--success", "fmc-input" ), disabled: l, value: p, placeholder: R ? void 0 : J, defaultValue: a, onBlur: O, onChange: Z, onFocus: b, onClick: x, onKeyUp: w, required: m, ref: _, role: i, ...T, id: C.current } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "label", { htmlFor: C.current, className: E( U && !R && !P && c && i !== "date" && "cxc-base-text-label-error" ), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( "fmc-floating-label__text", i === "date" && "fmc-floating-label__text-date", U && !R && !P && i !== "date" && "cxc-base-text-no-icon", l && "cxc-disabled-label" ), children: l && y && Y || !l && (!R && !P && J || (R || P) && Y) } ) } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: Fn.STATUS, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: Fn.MESSAGE, "aria-live": "polite", role: "alert", id: `${C.current}_message_id`, children: h } ) }) ] } ) } ); } ); ct.displayName = "BaseTextField"; const Mn = { INPUT_INVALID: "cxc-password-field__input--invalid", INPUT_DIRTY: "cxc-password-field__input--dirty", INPUT_ACTIVE: "cxc-password-field__input--active" }, oc = "BASE_PASSWORD_TEXTFIELD_DATA_TEST_ID", sc = "PASSWORD_TEXTFIELD_DATA_TEST_ID", lc = "PasswordField", dc = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef( ({ onChange: t, onFocus: e, onBlur: n, onClick: r, defaultValue: a, disabled: i = !1, error: o, placeholder: s, message: l, value: d, required: c, inputRef: f, rules: h, newPasswordValidation: p = !1, hideSuccess: m = !1, className: _, name: g, label: v, ...$ }, N) => { const [y, T] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [D, U] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [I, R] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [k, P] = react__WEBPACK_IMPORTED_MODULE_1__.useState(!1), [V, M] = react__WEBPACK_IMPORTED_MODULE_1__.useState(!1), { current: C } = react__WEBPACK_IMPORTED_MODULE_1__.useRef(d != null), [O, x] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), b = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(Ve(lc)); function w(K, se) { let j = 0; return se ? (se.forEach((ce) => { S(ce.pattern, K) === !1 && j++; }), k ? j === se.length ? "weak" : j < se.length && j !== 0 ? "better" : "strong" : null) : []; } const Z = (K, se) => { const j = []; return se.forEach((ce, De) => { j.push( /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "li", { className: E( "cxc-password-field__password-reqs-list-item", S(ce.pattern, K) && "cxc-password-field__password-reqs-list-item--success" ), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: ce.message }) }, De ) ); }), j; }, S = (K, se) => new RegExp(K).test(se), A = (K) => { n && n(K), R(!1); }, q = (K) => { R(!0), T(!0), r && r(K); }, J = (K) => { K.key === "Tab" && q(K); }, Y = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { P(!0); }, []), L = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { P(!1); }, []), G = react__WEBPACK_IMPORTED_MODULE_1__.useCallback( (K) => { tn(K) ? Y && Y() : L && L(); }, [Y, L] ); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { C && G({ value: d }); }, [d, G, C]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { M(tn({ value: d }) && !o); }, [o, I, d]); const H = (K) => { if (M(!1), !C) { const se = K.target; G({ value: se.value }); } t && t(K); }, Q = (K) => { R(!0), T(!0), e && e(K); }, X = () => { x(!O); }, te = () => { U(!1); }, oe = (K) => { K.key === "Tab" && U(!0); }, B = w(d, h); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { tn({ value: d }) && B == "strong" && M(!0); }, [d, B]); function _e() { if (p) { if (d) if (I) switch (B) { case "weak": return "Password is weak"; case "better": return "Password is better"; case "strong": return "Password is strong"; } else return "Password doesn't meet the criteria."; return l; } else return l; } const Oe = s || v, Ge = v || s; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { "data-testid": sc, className: E( "fds-app", "cxc-input-field", k && `${Mn.INPUT_DIRTY} cxc-input-field-filled`, I && `${Mn.INPUT_ACTIVE} cxc-input-field-active`, o && !i && `${Mn.INPUT_INVALID}`, i && "cxc-input-field__input--disabled", "cxc-password-field", p && B === "weak" && "cxc-password-field__strength--weak", p && B === "better" && "cxc-password-field__strength--better", p && B === "strong" && "cxc-password-field__strength--strong", // newPasswordValidation && // strength === 'strong' && // success && // !hideSuccess && // value && // !disabled && // classes.INPUT_VALID, // !newPasswordValidation && // success && // !hideSuccess && // value && // !disabled && // classes.INPUT_VALID, _ ), ref: N, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "cxc-password-field__mask-container", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { tabIndex: d ? 0 : -1, className: E( "cxc-password-field__mask-button", D && "cxc-password-field__mask-button--focused" ), "aria-label": "Reveal Password", onClick: X, onKeyUp: oe, onBlur: te, type: "button", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( "fds-icon", O ? "fds-font--ford-icons__unmask" : "fds-font--ford-icons__mask" ) } ) } ) }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( "fmc-floating-label", o && "fmc-floating-label--error", !m && !i && V && "fmc-floating-label--success" ), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "input", { id: b.current, name: g, "aria-disabled": i, className: E( o && "fmc-input--error", !m && !i && V && "fmc-input--success", "fmc-input" ), autoComplete: "off", disabled: i, value: d, placeholder: I ? void 0 : Oe, defaultValue: a, onBlur: A, onChange: H, onFocus: Q, onClick: q, onKeyUp: J, ref: f, required: c, type: O ? "text" : "password", "data-testid": oc, ...$ } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "label", { htmlFor: b.current, className: E( y && !I && !k && o && "cxc-base-text-label-error" ), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( "fmc-floating-label__text", y && !I && !k && "cxc-base-text-no-icon" ), children: !i && (!I && !k && Oe || (I || k) && Ge) } ) } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "cxc-input-field__status", children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E("cxc-input-field__message"), "aria-live": "assertive", role: "alert", id: `${b.current}_message_id`, children: _e() } ), p && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E("cxc-password-field__strength"), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "cxc-password-field__strength-inner", children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "cxc-password-field__strength-tick" }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "cxc-password-field__strength-tick" }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "cxc-password-field__strength-tick" }) ] }) }) ] }), p && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "cxc-password-field__password-reqs", children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "cxc-password-field__password-reqs-message", children: "Please make sure your password meets all the requirements." }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: E("cxc-password-field__password-reqs-list"), children: Z(d, h) }) ] }) ] } ) ] } ); } ); dc.displayName = "BasePasswordField"; const Nr = (t) => t.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), Sr = ({ value: t, groupSeparator: e = ",", decimalSeparator: n = ".", allowDecimals: r = !0, decimalsLimit: a = 2, allowNegativeValue: i = !0, prefix: o = "" }) => { if (t === "-") return t; const s = [], d = new RegExp(`((^|\\D)-\\d)|(-${Nr(o)})`).test(t), c = cc(t, e), f = uc(c, [ e, n, ...s ]), h = f, p = d && i ? "-" : ""; if (n && h.includes(n)) { const [m, _] = f.split(n), g = a && _ ? _.slice(0, a) : _, v = r ? `${n}${g}` : ""; return `${p}${m}${v}`; } return `${p}${h}`; }, cc = (t, e = ",") => { const n = new RegExp(Nr(e), "g"); return t.replace(n, ""); }, uc = (t, e) => { const n = Nr(e.join("")), r = new RegExp(`[^\\d${n}]`, "gi"); return t.replace(r, ""); }, R1 = ({ currency: t = "USD", locale: e = "en", onChange: n, onValueChange: r, defaultValue: a = "", padZeroes: i = !1, onBlur: o, ...s }) => { const [l, d] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(a), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), [f, h] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const $ = c.current; $ && $.setSelectionRange(f, f); }, [c, f, l]); const p = ($, N = !1) => { const y = Intl.NumberFormat(e, { style: "currency", currency: t, maximumSignificantDigits: 18 }).formatToParts(1111.11), T = y.find( (M) => M.type === "decimal" )?.value, D = y.find( (M) => M.type === "literal" )?.value, U = y.find( (M) => M.type === "currency" )?.value, I = y.find( (M) => M.type === "group" )?.value; let R = Sr({ value: $, groupSeparator: I, decimalSeparator: T }); R = R.replace(",", "."); const k = fc(".", R), P = parseFloat(R); let V = ""; if (R.charAt(R.length - 1) !== ".") { let M = 2; N || (M = Math.min(k, 2)); const C = new Intl.NumberFormat(e, { style: "currency", currency: t, minimumFractionDigits: M, maximumFractionDigits: M }).format(P); isNaN(P) || (V = C), h( D ? C.length - // @ts-ignore (D.length + U.length) : C.length ); } else { const M = new Intl.NumberFormat(e, { style: "currency", currency: t, minimumFractionDigits: 0, maximumFractionDigits: 0 }).format(P); if (D) { const C = M.replace( `${D}${U}`, "" ); V = `${C}${T}${D}${U}`, h(`${C}${T}`.length); } else V = `${M}${T}`, h(`${M}${T}`.length); } V !== l && (d(V), r(m(V, R))); }, m = ($, N) => { const y = parseFloat(N); return { formattedValue: $, value: N, floatValue: isNaN(y) ? void 0 : y }; }, _ = ($) => { p($.target.value), n?.($); }, g = ($) => { p($.target.value, i), o?.($); }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ct, { onChange: ($) => _($), onBlur: ($) => g($), onFocus: () => { const $ = c.current; $ && setTimeout(function() { $.setSelectionRange(f, f); }, 0); }, value: l, inputRef: c, "data-testid": "currency-input", maxLength: 18, ...s } ); }, fc = function(t, e) { return t && e.split(t)[1]?.length || 0; }, Gi = { COMPONENT: "fmc-check__button", SUB_TEXT: "cxc-checkbox__sub-text" }, hc = "CHECKBOX_DATA_TEST_ID", pc = ({ checked: t, children: e, defaultChecked: n, disabled: r, id: a = "FDSCheckboxComponent", key: i, onChange: o, value: s, className: l, dataTestId: d = hc, inputClassName: c, ...f }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: E(Gi.COMPONENT, l), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "input", { id: a, "data-testid": d, type: "checkbox", value: s, defaultChecked: n, checked: t, disabled: r, onChange: o, "aria-checked": t, "aria-disabled": r, "aria-labelledby": e, className: c, ...f } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: a, children: e }) ] }, i), mc = "CHECKBOX_DATA_TEST_ID", D1 = ({ checked: t, children: e, defaultChecked: n, disabled: r, id: a = "FDSCheckboxComponent", key: i, subText: o, onChange: s, value: l, className: d, dataTestId: c = mc, ...f }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( pc, { children: e, value: l, checked: t, defaultChecked: n, disabled: r, id: a, onChange: s, dataTestId: c, className: d, ...f }, i ), o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E(Gi.SUB_TEXT), children: o }) ] }), $c = "CHECKBOX_GROUP_DATA_TEST_ID", P1 = ({ children: t, disabled: e, horizontal: n, legend: r, onChange: a, legendClassName: i, className: o, dataTestId: s = $c }) => { const l = Array.isArray(t) ? t : [t], [d, c] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)( l.map((p) => p?.props.defaultChecked ?? !1) ), f = Ve(), h = (p) => { const m = [...d]; m[p] = !m[p], c(m); }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "fieldset", { className: E( "fmc-check", n && "fmc-check--horizontal", o ), "aria-labelledby": r || "checkbox group", "data-testid": s, children: [ r && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("legend", { id: r, className: i, children: r }), l.map((p, m) => { const _ = m + 1; if (!p) return null; const g = e || p.props.disabled, v = p.props.checked ?? (d[m] && !g); return react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(p, { checked: v, defaultChecked: void 0, disabled: g, onChange($) { p.props.onChange?.($), a?.($); }, onClick() { h(m); }, onKeyUp($) { $.key === "Enter" && h(m); }, id: p.props.id ?? `FDSCheckboxComponent${_}-${f}`, dataTestId: p.props.dataTestId ?? `${s}_CHECKBOX_BUTTON_${_}` }); }) ] } ); }, he = { COMPONENT: "js-fds-dropdown", DROPDOWN: "fds-dropdown", PLACEHOLDER: "fds-dropdown__placeholder", BUTTON_WRAPPER: "fds-dropdown__button-wrapper", BUTTON: "fds-dropdown__button", SELECT: "fds-dropdown__select", FOCUSED: "fds-dropdown--focused", HOVER: "fds-dropdown--hover", ACTIVE: "fds-dropdown--active", TOUCH: "fds-dropdown--touch", DIRTY: "fds-dropdown--dirty", FOCUS_OUTLINE: "fds-dropdown__focus-outline", EYEBROW: "fds-dropdown__eyebrow", LABEL_WRAPPER: "fds-dropdown__label-wrapper", LABEL: "fds-dropdown__label", LABEL_ICON: "fds-dropdown__label-icon", FDS_ICON: "fds-icon", LIST_WRAPPER: "fds-dropdown__list-wrapper", LIST: "fds-dropdown__list", LIST_SHOW: "fds-dropdown__list--show", LIST_OPTION: "fds-dropdown__list-option", LIST_OPTION_DISABLED: "cxc-dropdown__list-option--disabled", LIST_OPTION_FOCUSED: "fds-dropdown__list-option--focused", SELECT_OPTION: "fds-dropdown__select-option", SELECT_OPTION_HIDE: "fds-dropdown__select-option--hide", HIDE: "fds-hide", DISABLED: "fds-dropdown--disabled", STATUS: "fds-dropdown__status", MESSAGE: "fds-dropdown__message", INVALID: "fds-dropdown__invalid", VALID: "fds-dropdown__valid", ERROR: "fds-font--ford-icons__error", SUCCESS: "fds-font--ford-icons__success" }, _c = 500, qe = { HOME: "home", END: "end", PREV: "prev", NEXT: "next" }, kn = (t, e) => { for (let n = 0, r = e.length; n < r; n++) if (typeof e[n].value < "u" && e[n].value === t || typeof e[n].value < "u" && typeof t < "u" && typeof t.value < "u" && e[n].value === t.value) return n; return -1; }, gc = "Dropdown", Tc = "DROPDOWN_ERROR_DATA_TEST_ID", vc = "DROPDOWN_BUTTON_DATA_TEST_ID", w1 = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef( ({ required: t = !1, placeholder: e = "Please Select", label: n, options: r = [], onChange: a, disabled: i = !1, value: o, tabIndex: s, error: l = !1, className: d, id: c, hideLabel: f = !1, onBlur: h, success: p = !1 }, m) => { const [_, g] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [v, $] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [N, y] = react__WEBPACK_IMPORTED_MODULE_1__.useState(), [T, D] = react__WEBPACK_IMPORTED_MODULE_1__.useState(!1), [U, I] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)( kn(o, r) ), [R, k] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)( kn(o, r) ), P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), [V, M] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [C, O] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), b = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(Ve(gc)); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { N && x.current && x.current.focus(); }, [N]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const j = kn(o, r); j !== R && k(j); }, [r, o]); const { STATUS: w, MESSAGE: Z } = he, S = async (j) => { j.preventDefault(), L(); }, A = () => { $(!0); }, q = (j) => { j.relatedTarget !== x.current && j.relatedTarget !== P && Y(); }, J = (j) => { (j.relatedTarget === null || !j.relatedTarget.contains(P.current)) && Y(), h && h(); }, Y = () => { H(), g(!1), $(!1); }, L = () => { i || (N ? H() : G()); }, G = () => { y(!0), $(!0), D(!1); }, H = () => { y(!1); }, Q = (j) => () => { I(j); }, X = (j) => (ce) => { ce.preventDefault(), k(j), H(), P.current && P.current.focus(), a && a(r[j]); }, te = ({ children: j, index: ce, disabled: De }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "li", { role: "option", "aria-selected": "false", onFocus: () => console.log("dropdown focused"), onMouseOver: Q(ce), onMouseDown: De ? () => { } : X(ce), className: E( he.LIST_OPTION, !De && ce === U && he.LIST_OPTION_FOCUSED, De && he.LIST_OPTION_DISABLED ), "aria-disabled": De, children: j } ), oe = (j) => { let ce = 0; switch (j) { case qe.HOME: ce = 0; break; case qe.END: ce = r.length - 1; break; case qe.NEXT: U >= r.length - 1 ? ce = 0 : ce = U + 1; break; case qe.PREV: U <= 0 ? ce = r.length - 1 : ce = U - 1; break; } I(ce), k(ce), a && a(r[ce]); }, B = (j) => { switch (j.keyCode) { case Ce.TAB: Y(); break; case Ce.SPACE: j.preventDefault(); break; case Ce.ENTER: return j.stopPropagation(), j.preventDefault(), a && a(r[U > -1 ? U : 0]), k( U > -1 ? U : 0 ), H(), P.current && P.current.focus(), !1; case Ce.ESC: H(), P.current && P.current.focus(); break; case Ce.HOME: oe(qe.HOME); break; case Ce.END: oe(qe.END); break; case Ce.UP: j.preventDefault(), oe(qe.PREV); break; case Ce.DOWN: j.preventDefault(), oe(qe.NEXT); break; default: j.preventDefault(), K(j.keyCode); break; } }, _e = (j) => { j.keyCode === Ce.TAB && (g(!0), $(!0)); }, Oe = (j) => { C && clearTimeout(C), O( // @ts-ignore setTimeout(() => { M(""), O(null); }, j) ); }, Ge = (j) => { for (let ce = 0; ce < r.length; ce++) if (r[ce].label?.toUpperCase().startsWith(j)) return ce; return null; }, K = (j) => { const ce = String.fromCharCode(j), De = V + ce; M(De), Oe(_c); const Qe = Ge(De); return Qe !== null ? (I(Qe), k(Qe), a?.(r[Qe]), !0) : !1; }, se = (j) => { switch (j.keyCode) { case Ce.TAB: Y(); break; case Ce.ENTER: case Ce.SPACE: return j.stopPropagation(), j.preventDefault(), G(), !1; case Ce.UP: case Ce.DOWN: j.preventDefault(), G(); break; default: j.preventDefault(), K(j.keyCode) && G(); break; } }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { "data-testid": he.DROPDOWN, "aria-disabled": i, className: E( he.DROPDOWN, N && he.LIST_SHOW, N && he.ACTIVE, N && he.HOVER, R > -1 && he.DIRTY, _ && he.FOCUSED, l && he.INVALID, p && he.VALID, v && !i && he.HOVER, i && he.DISABLED, d ), id: c, ref: m, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: "fds-dropdown__focus-outline", style: { height: 84 } } ), !f && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: he.EYEBROW, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: he.LABEL_WRAPPER, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "label", { htmlFor: b.current, className: he.LABEL, "data-testid": he.LABEL, children: n === "" || n ? n : e } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( he.FDS_ICON, he.LABEL_ICON, p && !i && he.SUCCESS, l && he.ERROR ) } ) ] }) }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: he.BUTTON_WRAPPER, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fds-dropdown__icon" }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( !T && he.HIDE, he.PLACEHOLDER ), "aria-hidden": "false", children: e } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { tabIndex: -1, onBlur: q, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { "data-testid": vc, id: b.current, className: he.BUTTON, onKeyDown: se, onKeyUp: _e, "data-label": n, "aria-haspopup": "listbox", "aria-expanded": N ? "true" : "false", onClick: S, onFocus: A, ref: P, disabled: i, "aria-disabled": i, tabIndex: s, children: R > -1 ? r[R].label : e } ) }) ] }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: w, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { "data-testid": Tc, className: Z, role: "alert", "aria-live": "assertive", children: p || l } ) }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": he.LIST_WRAPPER, className: he.LIST_WRAPPER, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "ul", { "data-testid": he.LIST, className: he.LIST, tabIndex: -1, role: "listbox", ref: x, onKeyDown: B, onBlur: J, children: r.map( (j, ce) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( te, { index: ce, disabled: j.disabled, children: j.label }, "key" + j.label ) ) } ) } ) ] } ); } ), yc = { COMPONENT: "fmc-check__button" }, Ec = "RADIO_WRAPPER_DATA_TEST_ID", bc = "RADIO_DATA_TEST_ID", L1 = ({ checked: t, children: e, disabled: n, id: r = "FDSRadioComponent", key: a, onChange: i, value: o, className: s, dataTestId: l = bc, ...d }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E(yc.COMPONENT, s), "data-testid": Ec, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "input", { id: r, "data-testid": l, type: "radio", value: o, checked: t, disabled: n, onChange: () => i?.(o), "aria-checked": t, "aria-disabled": n, "aria-labelledby": e, ...d } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: r, children: e }) ] }, a ), Cc = "RADIO_GROUP_DATA_TEST_ID", x1 = ({ children: t = [], disabled: e, horizontal: n, legend: r, onChange: a, value: i, className: o, legendClassName: s, dataTestId: l = Cc }) => { const d = Array.isArray(t) ? t : [t], c = () => { let m = -1; return i === null ? null : (i && (m = d.findIndex((_) => _?.props.value === i)), m > -1 ? m : d.findIndex((_) => !_?.props.disabled)); }, [f, h] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)( c() ); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const m = c(); m !== f && h(m); }, [i]); const p = Ve(); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "fieldset", { role: "radiogroup", className: E( "fmc-check", n && "fmc-check--horizontal", o ), "aria-labelledby": r || "radio group", "data-testid": l, children: [ r && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("legend", { id: r, className: s, children: r }), d.map((m, _) => { if (!m) return null; const g = _ + 1, v = e || m.props.disabled, $ = f === _ && !v; return react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(m, { checked: $, disabled: v, onChange() { a?.(m.props.value); }, onClick() { h(_); }, onKeyUp(N) { N.key === "Enter" && h(_); }, id: m.props.id ?? `FDSRadioComponent${g}-${p}`, dataTestId: m.props.dataTestId ?? `${l}_RADIO_BUTTON_${g}` }); }) ] } ); }, F1 = ({ value: t, region: e = "us", id: n = "FDSPhoneTextFieldComponent", placeholder: r, label: a, error: i, message: o, patternMismatchErrorMessage: s = "Phone number is invalid", requiredErrorMessage: l, required: d = !1, hideSuccess: c = !1, hideError: f = !1, disabled: h = !1, onValueChange: p, ...m }) => { const [_, g] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(t || ""), [v, $] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [N, y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), T = /^\([2-9]\d{2}\)\s\d{3}-\d{4}$/i, D = /^\+[1-9]{1,6}\s\d{3}\s\d{3}\s\d{4}$/i, U = "us", I = e === U ? T : D, R = (C) => { g(C), $(I.test(C)); }, k = (C) => { let O; t && !C.target ? O = t : O = C.target.value.replace(/\D/g, ""); const x = O.substring(0, 3), b = O.substring(3, 6), w = O.substring(6, 10); let Z; switch (!0) { case O.length > 6: Z = `(${x}) ${b}-${w}`, R(Z); break; case O.length > 3: Z = `(${x}) ${b}`, R(Z); break; default: R(O), g(O); break; } p && p({ //@ts-ignore formattedValue: Z, value: O, //@ts-ignore isValid: I.test(Z) }); }, P = (C) => { let O; t && !C.target ? O = t : O = C.target.value.replace(/\D/g, ""); const x = O.length > 10 ? O.length - 10 : 1, b = O.substring(0, x), w = O.substring(x, x + 3), Z = O.substring( x + 3, x + 6 ), S = O.substring(x + 6, x + 10); let A; switch (!0) { case O.length > 7: A = `+${b} ${w} ${Z} ${S}`, R(A); break; case O.length > 4: A = `+${b} ${w} ${Z}`, R(A); break; case O.length > 3: A = `+${b} ${w}`, R(A); break; default: R(O), g(O); break; } p && p({ //@ts-ignore formattedValue: A, value: O, //@ts-ignore isValid: I.test(A) }); }, V = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { v ? y("") : _.length === 0 ? y( d ? l || "Phone number is required" : "" ) : y(s); }, [ _, v, s, d, l ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { V(); }, [V]); const M = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { y(""), t && (e === "us" ? k(t) : P(t)); }, []); return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { M(); }, [M]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ct, { id: n, label: a, name: a, type: "tel", placeholder: r, onChange: e === U ? k : P, value: _, error: i || (f ? void 0 : N), message: o || (f ? void 0 : N), maxLength: e === U ? 14 : 20, hideSuccess: c || !v, disabled: h, required: d, ...m } ) }); }, Nc = (t) => { const [, e] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useReducer)((l) => l + 1, 0), n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), { replace: r, append: a } = t, i = r ? r(t.format(t.value)) : t.format(t.value), o = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), s = (l) => { if (true) { if (l.target.type === "number") { console.error("Rifm does not support input type=number, use type=tel instead."); return; } if (l.target.type === "date") { console.error("Rifm does not support input type=date."); return; } } const d = l.target.value; if (n.current = [ d, // eventValue l.target, // input d.length > i.length, // isSizeIncreaseOperation o.current, // isDeleleteButtonDown i === t.format(d) // isNoOperation ], "development" !== "production") { const c = t.format(d); d !== c && d.toLowerCase() === c.toLowerCase() && console.warn("Case enforcement does not work with format. Please use replace={value => value.toLowerCase()} instead"); } e(); }; return ( false || typeof window < "u") && (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => { if (n.current == null) return; let [ l, d, c, f, // No operation means that value itself hasn't been changed, BTW cursor, selection etc can be changed h ] = n.current; n.current = null; const p = f && h, _ = l.slice(d.selectionStart).search(t.accept || /\d/g), g = _ !== -1 ? _ : 0, v = (D) => (D.match(t.accept || /\d/g) || []).join(""), $ = v(l.substr(0, d.selectionStart)), N = (D) => { let U = 0, I = 0; for (let R = 0; R !== $.length; ++R) { let k = D.indexOf($[R], U) + 1, P = v(D).indexOf($[R], I) + 1; P - I > 1 && (k = U, P = I), I = Math.max(P, I), U = Math.max(U, k); } return U; }; if (t.mask === !0 && c && !h) { let D = N(l); const U = v(l.substr(D))[0]; D = l.indexOf(U, D), l = `${l.substr(0, D)}${l.substr(D + 1)}`; } let y = t.format(l); a != null && // cursor at the end d.selectionStart === l.length && !h && (c ? y = a(y) : v(y.slice(-1)) === "" && (y = y.slice(0, -1))); const T = r ? r(y) : y; return i === T ? e() : t.onChange(T), () => { let D = N(y); if (t.mask != null && (c || f && !p)) for (; y[D] && v(y[D]) === ""; ) D += 1; d.selectionStart = d.selectionEnd = D + (p ? 1 + g : 0); }; }), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const l = (c) => { c.code === "Delete" && (o.current = !0); }, d = (c) => { c.code === "Delete" && (o.current = !1); }; return document.addEventListener("keydown", l), document.addEventListener("keyup", d), () => { document.removeEventListener("keydown", l), document.removeEventListener("keyup", d); }; }, []), { value: n.current != null ? n.current[0] : i, onChange: s }; }, Ki = { version: 4, country_calling_codes: { 1: ["US", "AG", "AI", "AS", "BB", "BM", "BS", "CA", "DM", "DO", "GD", "GU", "JM", "KN", "KY", "LC", "MP", "MS", "PR", "SX", "TC", "TT", "VC", "VG", "VI"], 7: ["RU", "KZ"], 20: ["EG"], 27: ["ZA"], 30: ["GR"], 31: ["NL"], 32: ["BE"], 33: ["FR"], 34: ["ES"], 36: ["HU"], 39: ["IT", "VA"], 40: ["RO"], 41: ["CH"], 43: ["AT"], 44: ["GB", "GG", "IM", "JE"], 45: ["DK"], 46: ["SE"], 47: ["NO", "SJ"], 48: ["PL"], 49: ["DE"], 51: ["PE"], 52: ["MX"], 53: ["CU"], 54: ["AR"], 55: ["BR"], 56: ["CL"], 57: ["CO"], 58: ["VE"], 60: ["MY"], 61: ["AU", "CC", "CX"], 62: ["ID"], 63: ["PH"], 64: ["NZ"], 65: ["SG"], 66: ["TH"], 81: ["JP"], 82: ["KR"], 84: ["VN"], 86: ["CN"], 90: ["TR"], 91: ["IN"], 92: ["PK"], 93: ["AF"], 94: ["LK"], 95: ["MM"], 98: ["IR"], 211: ["SS"], 212: ["MA", "EH"], 213: ["DZ"], 216: ["TN"], 218: ["LY"], 220: ["GM"], 221: ["SN"], 222: ["MR"], 223: ["ML"], 224: ["GN"], 225: ["CI"], 226: ["BF"], 227: ["NE"], 228: ["TG"], 229: ["BJ"], 230: ["MU"], 231: ["LR"], 232: ["SL"], 233: ["GH"], 234: ["NG"], 235: ["TD"], 236: ["CF"], 237: ["CM"], 238: ["CV"], 239: ["ST"], 240: ["GQ"], 241: ["GA"], 242: ["CG"], 243: ["CD"], 244: ["AO"], 245: ["GW"], 246: ["IO"], 247: ["AC"], 248: ["SC"], 249: ["SD"], 250: ["RW"], 251: ["ET"], 252: ["SO"], 253: ["DJ"], 254: ["KE"], 255: ["TZ"], 256: ["UG"], 257: ["BI"], 258: ["MZ"], 260: ["ZM"], 261: ["MG"], 262: ["RE", "YT"], 263: ["ZW"], 264: ["NA"], 265: ["MW"], 266: ["LS"], 267: ["BW"], 268: ["SZ"], 269: ["KM"], 290: ["SH", "TA"], 291: ["ER"], 297: ["AW"], 298: ["FO"], 299: ["GL"], 350: ["GI"], 351: ["PT"], 352: ["LU"], 353: ["IE"], 354: ["IS"], 355: ["AL"], 356: ["MT"], 357: ["CY"], 358: ["FI", "AX"], 359: ["BG"], 370: ["LT"], 371: ["LV"], 372: ["EE"], 373: ["MD"], 374: ["AM"], 375: ["BY"], 376: ["AD"], 377: ["MC"], 378: ["SM"], 380: ["UA"], 381: ["RS"], 382: ["ME"], 383: ["XK"], 385: ["HR"], 386: ["SI"], 387: ["BA"], 389: ["MK"], 420: ["CZ"], 421: ["SK"], 423: ["LI"], 500: ["FK"], 501: ["BZ"], 502: ["GT"], 503: ["SV"], 504: ["HN"], 505: ["NI"], 506: ["CR"], 507: ["PA"], 508: ["PM"], 509: ["HT"], 590: ["GP", "BL", "MF"], 591: ["BO"], 592: ["GY"], 593: ["EC"], 594: ["GF"], 595: ["PY"], 596: ["MQ"], 597: ["SR"], 598: ["UY"], 599: ["CW", "BQ"], 670: ["TL"], 672: ["NF"], 673: ["BN"], 674: ["NR"], 675: ["PG"], 676: ["TO"], 677: ["SB"], 678: ["VU"], 679: ["FJ"], 680: ["PW"], 681: ["WF"], 682: ["CK"], 683: ["NU"], 685: ["WS"], 686: ["KI"], 687: ["NC"], 688: ["TV"], 689: ["PF"], 690: ["TK"], 691: ["FM"], 692: ["MH"], 850: ["KP"], 852: ["HK"], 853: ["MO"], 855: ["KH"], 856: ["LA"], 880: ["BD"], 886: ["TW"], 960: ["MV"], 961: ["LB"], 962: ["JO"], 963: ["SY"], 964: ["IQ"], 965: ["KW"], 966: ["SA"], 967: ["YE"], 968: ["OM"], 970: ["PS"], 971: ["AE"], 972: ["IL"], 973: ["BH"], 974: ["QA"], 975: ["BT"], 976: ["MN"], 977: ["NP"], 992: ["TJ"], 993: ["TM"], 994: ["AZ"], 995: ["GE"], 996: ["KG"], 998: ["UZ"] }, countries: { AC: ["247", "00", "(?:[01589]\\d|[46])\\d{4}", [5, 6]], AD: ["376", "00", "(?:1|6\\d)\\d{7}|[135-9]\\d{5}", [6, 8, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["[135-9]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["1"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]]], AE: ["971", "00", "(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{2,9})", "$1 $2", ["60|8"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[236]|[479][2-8]"], "0$1"], ["(\\d{3})(\\d)(\\d{5})", "$1 $2 $3", ["[479]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"]], "0"], AF: ["93", "00", "[2-7]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"]], "0"], AG: ["1", "011", "(?:268|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([457]\\d{6})$|1", "268$1", 0, "268"], AI: ["1", "011", "(?:264|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2457]\\d{6})$|1", "264$1", 0, "264"], AL: ["355", "00", "(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}", [6, 7, 8, 9], [["(\\d{3})(\\d{3,4})", "$1 $2", ["80|9"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["4[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2358][2-5]|4"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["[23578]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["6"], "0$1"]], "0"], AM: ["374", "00", "(?:[1-489]\\d|55|60|77)\\d{6}", [8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[89]0"], "0 $1"], ["(\\d{3})(\\d{5})", "$1 $2", ["2|3[12]"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["1|47"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[3-9]"], "0$1"]], "0"], AO: ["244", "00", "[29]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[29]"]]]], AR: ["54", "00", "(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}", [10, 11], [["(\\d{4})(\\d{2})(\\d{4})", "$1 $2-$3", ["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])", "2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["1"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[68]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2-$3", ["[23]"], "0$1", 1], ["(\\d)(\\d{4})(\\d{2})(\\d{4})", "$2 15-$3-$4", ["9(?:2[2-469]|3[3-578])", "9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))", "9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d)(\\d{2})(\\d{4})(\\d{4})", "$2 15-$3-$4", ["91"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d{3})(\\d{3})(\\d{5})", "$1-$2-$3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{4})", "$2 15-$3-$4", ["9"], "0$1", 0, "$1 $2 $3-$4"]], "0", 0, "0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?", "9$1"], AS: ["1", "011", "(?:[58]\\d\\d|684|900)\\d{7}", [10], 0, "1", 0, "([267]\\d{6})$|1", "684$1", 0, "684"], AT: ["43", "00", "1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{3,12})", "$1 $2", ["1(?:11|[2-9])"], "0$1"], ["(\\d{3})(\\d{2})", "$1 $2", ["517"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["5[079]"], "0$1"], ["(\\d{3})(\\d{3,10})", "$1 $2", ["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"], "0$1"], ["(\\d{4})(\\d{3,9})", "$1 $2", ["[2-467]|5[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,7})", "$1 $2 $3", ["5"], "0$1"]], "0"], AU: ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}", [5, 6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{3,4})", "$1 $2", ["16"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["16"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["14|4"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[2378]"], "(0$1)"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:30|[89])"]]], "0", 0, "(183[12])|0", 0, 0, 0, [["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}", [9]], ["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, ["163\\d{2,6}", [5, 6, 7, 8, 9]], ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], AW: ["297", "00", "(?:[25-79]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[25-9]"]]]], AX: ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}", [5, 6, 7, 8, 9, 10, 11, 12], 0, "0", 0, 0, 0, 0, "18", 0, "00"], AZ: ["994", "00", "365\\d{6}|(?:[124579]\\d|60|88)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[28]|2|365|46", "1[28]|2|365[45]|46", "1[28]|2|365(?:4|5[02])|46"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[13-9]"], "0$1"]], "0"], BA: ["387", "00", "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[1-3]|[7-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2-$3", ["[3-5]|6[56]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["6"], "0$1"]], "0"], BB: ["1", "011", "(?:246|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "246$1", 0, "246"], BD: ["880", "00", "[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{4,6})", "$1-$2", ["31[5-8]|[459]1"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1-$2", ["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"], "0$1"], ["(\\d{4})(\\d{3,6})", "$1-$2", ["[13-9]|22"], "0$1"], ["(\\d)(\\d{7,8})", "$1-$2", ["2"], "0$1"]], "0"], BE: ["32", "00", "4\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:80|9)0"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[239]|4[23]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[15-8]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4"], "0$1"]], "0"], BF: ["226", "00", "[025-7]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[025-7]"]]]], BG: ["359", "00", "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}", [6, 7, 8, 9, 12], [["(\\d)(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["43[1-6]|70[1-9]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:70|8)0"], "0$1"], ["(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3", ["43[1-7]|7"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[48]|9[08]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"]], "0"], BH: ["973", "00", "[136-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[13679]|8[047]"]]]], BI: ["257", "00", "(?:[267]\\d|31)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2367]"]]]], BJ: ["229", "00", "[24-689]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-689]"]]]], BL: ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["590(?:2[7-9]|5[12]|87)\\d{4}"], ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:395|76[018])\\d|475[0-2])\\d{4}"]]], BM: ["1", "011", "(?:441|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "441$1", 0, "441"], BN: ["673", "00", "[2-578]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-578]"]]]], BO: ["591", "00(?:1\\d)?", "(?:[2-467]\\d\\d|8001)\\d{5}", [8, 9], [["(\\d)(\\d{7})", "$1 $2", ["[23]|4[46]"]], ["(\\d{8})", "$1", ["[67]"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, "0(1\\d)?"], BQ: ["599", "00", "(?:[34]1|7\\d)\\d{5}", [7], 0, 0, 0, 0, 0, 0, "[347]"], BR: ["55", "00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)", "(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}", [8, 9, 10, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["300|4(?:0[02]|37)", "4(?:02|37)0|[34]00"]], ["(\\d{3})(\\d{2,3})(\\d{4})", "$1 $2 $3", ["(?:[358]|90)0"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"], "($1)"], ["(\\d{2})(\\d{5})(\\d{4})", "$1 $2-$3", ["[16][1-9]|[2-57-9]"], "($1)"]], "0", 0, "(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?", "$2"], BS: ["1", "011", "(?:242|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([3-8]\\d{6})$|1", "242$1", 0, "242"], BT: ["975", "00", "[17]\\d{7}|[2-8]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-68]|7[246]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|7"]]]], BW: ["267", "00", "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-79]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]]], BY: ["375", "810", "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3})", "$1 $2", ["800"], "8 $1"], ["(\\d{3})(\\d{2})(\\d{2,4})", "$1 $2 $3", ["800"], "8 $1"], ["(\\d{4})(\\d{2})(\\d{3})", "$1 $2-$3", ["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])", "1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"], "8 0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["1(?:[56]|7[467])|2[1-3]"], "8 0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-4]"], "8 0$1"], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[89]"], "8 $1"]], "8", 0, "0|80?", 0, 0, 0, 0, "8~10"], BZ: ["501", "00", "(?:0800\\d|[2-8])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-8]"]], ["(\\d)(\\d{3})(\\d{4})(\\d{3})", "$1-$2-$3-$4", ["0"]]]], CA: ["1", "011", "(?:[2-8]\\d|90)\\d{8}|3\\d{6}", [7, 10], 0, "1", 0, 0, 0, 0, 0, [["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}", [10]], ["", [10]], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}", [10]], ["900[2-9]\\d{6}", [10]], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}", [10]], 0, ["310\\d{4}", [7]], 0, ["600[2-9]\\d{6}", [10]]]], CC: ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}", [9]], ["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], CD: ["243", "00", "[189]\\d{8}|[1-68]\\d{6}", [7, 9], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[1-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]"], "0$1"]], "0"], CF: ["236", "00", "(?:[27]\\d{3}|8776)\\d{4}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[278]"]]]], CG: ["242", "00", "222\\d{6}|(?:0\\d|80)\\d{7}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[02]"]]]], CH: ["41", "00", "8\\d{11}|[2-9]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8[047]|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]|81"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["8"], "0$1"]], "0"], CI: ["225", "00", "[02]\\d{9}", [10], [["(\\d{2})(\\d{2})(\\d)(\\d{5})", "$1 $2 $3 $4", ["2"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3 $4", ["0"]]]], CK: ["682", "00", "[2-578]\\d{4}", [5], [["(\\d{2})(\\d{3})", "$1 $2", ["[2-578]"]]]], CL: ["56", "(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0", "12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}", [9, 10, 11], [["(\\d{5})(\\d{4})", "$1 $2", ["219", "2196"], "($1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["44"]], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2[1-36]"], "($1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["9[2-9]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["60|8"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{3})(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["60"]]]], CM: ["237", "00", "[26]\\d{8}|88\\d{6,7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["88"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[26]|88"]]]], CN: ["86", "00|1(?:[12]\\d|79)\\d\\d00", "1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]", "(?:10|2[0-57-9])(?:10|9[56])", "10(?:10|9[56])|2[0-57-9](?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]", "(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]", "85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])", "85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["(?:4|80)0"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|2(?:[02-57-9]|1[1-9])", "10|2(?:[02-57-9]|1[1-9])", "10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["80"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[3-578]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["1[3-9]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["[12]"], "0$1", 1]], "0", 0, "(1(?:[12]\\d|79)\\d\\d)|0", 0, 0, 0, 0, "00"], CO: ["57", "00(?:4(?:[14]4|56)|[579])", "(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}", [10, 11], [["(\\d{3})(\\d{7})", "$1 $2", ["6"], "($1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3[0-357]|91"]], ["(\\d)(\\d{3})(\\d{7})", "$1-$2-$3", ["1"], "0$1", 0, "$1 $2 $3"]], "0", 0, "0(4(?:[14]4|56)|[579])?"], CR: ["506", "00", "(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}", [8, 10], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[3-9]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[89]"]]], 0, 0, "(19(?:0[0-2468]|1[09]|20|66|77|99))"], CU: ["53", "119", "[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}", [6, 7, 8, 10], [["(\\d{2})(\\d{4,6})", "$1 $2", ["2[1-4]|[34]"], "(0$1)"], ["(\\d)(\\d{6,7})", "$1 $2", ["7"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["5"], "0$1"], ["(\\d{3})(\\d{7})", "$1 $2", ["8"], "0$1"]], "0"], CV: ["238", "0", "(?:[2-59]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-589]"]]]], CW: ["599", "00", "(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[3467]"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["9[4-8]"]]], 0, 0, 0, 0, 0, "[69]"], CX: ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}", [9]], ["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], CY: ["357", "00", "(?:[279]\\d|[58]0)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[257-9]"]]]], CZ: ["420", "00", "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]]], DE: ["49", "00", "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [["(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"], ["(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"], ["(\\d{4})(\\d{2,11})", "$1 $2", ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"], ["(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"], ["(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"], ["(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"], ["(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"], ["(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["15[0568]"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"], ["(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"], ["(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"], ["(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]], "0"], DJ: ["253", "00", "(?:2\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[27]"]]]], DK: ["45", "00", "[2-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-9]"]]]], DM: ["1", "011", "(?:[58]\\d\\d|767|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "767$1", 0, "767"], DO: ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "8001|8[024]9"], DZ: ["213", "00", "(?:[1-4]|[5-79]\\d|80)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["9"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-8]"], "0$1"]], "0"], EC: ["593", "00", "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}", [8, 9, 10, 11], [["(\\d)(\\d{3})(\\d{4})", "$1 $2-$3", ["[2-7]"], "(0$1)", 0, "$1-$2-$3"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1"]]], "0"], EE: ["372", "00", "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88", "[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]], ["(\\d{4})(\\d{3,4})", "$1 $2", ["[45]|8(?:00|[1-49])", "[45]|8(?:00[1-9]|[1-49])"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], EG: ["20", "00", "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}", [8, 9, 10], [["(\\d)(\\d{7,8})", "$1 $2", ["[23]"], "0$1"], ["(\\d{2})(\\d{6,7})", "$1 $2", ["1[35]|[4-6]|8[2468]|9[235-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[189]"], "0$1"]], "0"], EH: ["212", "00", "[5-8]\\d{8}", [9], 0, "0", 0, 0, 0, 0, "528[89]"], ER: ["291", "00", "[178]\\d{6}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[178]"], "0$1"]], "0"], ES: ["34", "00", "[5-9]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]00"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-9]"]]]], ET: ["251", "00", "(?:11|[2-579]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-579]"], "0$1"]], "0"], FI: ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d)(\\d{4,9})", "$1 $2", ["[2568][1-8]|3(?:0[1-9]|[1-9])|9"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[12]00|[368]|70[07-9]"], "0$1"], ["(\\d{2})(\\d{4,8})", "$1 $2", ["[1245]|7[135]"], "0$1"], ["(\\d{2})(\\d{6,10})", "$1 $2", ["7"], "0$1"]], "0", 0, 0, 0, 0, "1[03-79]|[2-9]", 0, "00"], FJ: ["679", "0(?:0|52)", "45\\d{5}|(?:0800\\d|[235-9])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[235-9]|45"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]]], 0, 0, 0, 0, 0, 0, 0, "00"], FK: ["500", "00", "[2-7]\\d{4}", [5]], FM: ["691", "00", "(?:[39]\\d\\d|820)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[389]"]]]], FO: ["298", "00", "[2-9]\\d{5}", [6], [["(\\d{6})", "$1", ["[2-9]"]]], 0, 0, "(10(?:01|[12]0|88))"], FR: ["33", "00", "[1-9]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0 $1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[1-79]"], "0$1"]], "0"], GA: ["241", "00", "(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}", [7, 8], [["(\\d)(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-7]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["11|[67]"], "0$1"]], 0, 0, "0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})", "$1"], GB: ["44", "00", "[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}", [7, 9, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["800", "8001", "80011", "800111", "8001111"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["845", "8454", "84546", "845464"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["800"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["1(?:38|5[23]|69|76|94)", "1(?:(?:38|69)7|5(?:24|39)|768|946)", "1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["1(?:[2-69][02-9]|[78])"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[25]|7(?:0|6[02-9])", "[25]|7(?:0|6(?:[03-9]|2[356]))"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1389]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0-579])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-2]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}", [9, 10]], ["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]], 0, " x"], GD: ["1", "011", "(?:473|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "473$1", 0, "473"], GE: ["995", "00", "(?:[3-57]\\d\\d|800)\\d{6}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["32"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[57]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[348]"], "0$1"]], "0"], GF: ["594", "00", "[56]94\\d{6}|(?:80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[56]|9[47]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[89]"], "0$1"]], "0"], GG: ["44", "00", "(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?", [7, 9, 10], 0, "0", 0, "([25-9]\\d{5})$|0", "1481$1", 0, 0, [["1481[25-9]\\d{5}", [10]], ["7(?:(?:781|839)\\d|911[17])\\d{5}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]]], GH: ["233", "00", "(?:[235]\\d{3}|800)\\d{5}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[235]"], "0$1"]], "0"], GI: ["350", "00", "(?:[25]\\d|60)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["2"]]]], GL: ["299", "00", "(?:19|[2-689]\\d|70)\\d{4}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["19|[2-9]"]]]], GM: ["220", "00", "[2-9]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], GN: ["224", "00", "722\\d{6}|(?:3|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["3"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[67]"]]]], GP: ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[569]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1289]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"], ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:395|76[018])\\d|475[0-2])\\d{4}"]]], GQ: ["240", "00", "222\\d{6}|(?:3\\d|55|[89]0)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235]"]], ["(\\d{3})(\\d{6})", "$1 $2", ["[89]"]]]], GR: ["30", "00", "5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}", [10, 11, 12], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["21|7"]], ["(\\d{4})(\\d{6})", "$1 $2", ["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2689]"]], ["(\\d{3})(\\d{3,4})(\\d{5})", "$1 $2 $3", ["8"]]]], GT: ["502", "00", "(?:1\\d{3}|[2-7])\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], GU: ["1", "011", "(?:[58]\\d\\d|671|900)\\d{7}", [10], 0, "1", 0, "([3-9]\\d{6})$|1", "671$1", 0, "671"], GW: ["245", "00", "[49]\\d{8}|4\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["40"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"]]]], GY: ["592", "001", "9008\\d{3}|(?:[2-467]\\d\\d|862)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46-9]"]]]], HK: ["852", "00(?:30|5[09]|[126-9]?)", "8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}", [5, 6, 7, 8, 9, 11], [["(\\d{3})(\\d{2,5})", "$1 $2", ["900", "9003"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{3})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], 0, 0, 0, 0, 0, 0, 0, "00"], HN: ["504", "00", "8\\d{10}|[237-9]\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["[237-9]"]]]], HR: ["385", "00", "(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}", [6, 7, 8, 9], [["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["6[01]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{4})(\\d{3})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-5]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"]], "0"], HT: ["509", "00", "(?:[2-489]\\d|55)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[2-589]"]]]], HU: ["36", "00", "[235-7]\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "06 $1"]], "06"], ID: ["62", "00[89]", "(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}", [7, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["15"]], ["(\\d{2})(\\d{5,9})", "$1 $2", ["2[124]|[36]1"], "(0$1)"], ["(\\d{3})(\\d{5,7})", "$1 $2", ["800"], "0$1"], ["(\\d{3})(\\d{5,8})", "$1 $2", ["[2-79]"], "(0$1)"], ["(\\d{3})(\\d{3,4})(\\d{3})", "$1-$2-$3", ["8[1-35-9]"], "0$1"], ["(\\d{3})(\\d{6,8})", "$1 $2", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["804"], "0$1"], ["(\\d{3})(\\d)(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["80"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1-$2-$3", ["8"], "0$1"]], "0"], IE: ["353", "00", "(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["2[24-9]|47|58|6[237-9]|9[35-9]"], "(0$1)"], ["(\\d{3})(\\d{5})", "$1 $2", ["[45]0"], "(0$1)"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2569]|4[1-69]|7[14]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["81"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["4"], "(0$1)"], ["(\\d{2})(\\d)(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], IL: ["972", "0(?:0|1[2-9])", "1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}", [7, 8, 9, 10, 11, 12], [["(\\d{4})(\\d{3})", "$1-$2", ["125"]], ["(\\d{4})(\\d{2})(\\d{2})", "$1-$2-$3", ["121"]], ["(\\d)(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-489]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1-$2-$3", ["12"]], ["(\\d{4})(\\d{6})", "$1-$2", ["159"]], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3-$4", ["1[7-9]"]], ["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})", "$1-$2 $3-$4", ["15"]]], "0"], IM: ["44", "00", "1624\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([25-8]\\d{5})$|0", "1624$1", 0, "74576|(?:16|7[56])24"], IN: ["91", "00", "(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}", [8, 9, 10, 11, 12, 13], [["(\\d{8})", "$1", ["5(?:0|2[23]|3[03]|[67]1|88)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"], 0, 1], ["(\\d{4})(\\d{4,5})", "$1 $2", ["180", "1800"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["140"], 0, 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["11|2[02]|33|4[04]|79[1-7]|80[2-46]", "11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"], "0$1", 1], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807", "1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]", "1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"], "0$1", 1], ["(\\d{5})(\\d{5})", "$1 $2", ["[6-9]"], "0$1", 1], ["(\\d{4})(\\d{2,4})(\\d{4})", "$1 $2 $3", ["1(?:6|8[06])", "1(?:6|8[06]0)"], 0, 1], ["(\\d{4})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["18"], 0, 1]], "0"], IO: ["246", "00", "3\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["3"]]]], IQ: ["964", "00", "(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-6]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0"], IR: ["98", "00", "[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}", [4, 5, 6, 7, 10], [["(\\d{4,5})", "$1", ["96"], "0$1"], ["(\\d{2})(\\d{4,5})", "$1 $2", ["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[1-8]"], "0$1"]], "0"], IS: ["354", "00|1(?:0(?:01|[12]0)|100)", "(?:38\\d|[4-9])\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, 0, "00"], IT: ["39", "00", "0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", [6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], ["(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], ["(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], ["(\\d{4})(\\d{4})", "$1 $2", ["894"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1(?:44|[679])|[378]"]], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], ["(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, [["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"], ["3[1-9]\\d{8}|3[2-9]\\d{7}", [9, 10]], ["80(?:0\\d{3}|3)\\d{3}", [6, 9]], ["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}", [6, 8, 9, 10]], ["1(?:78\\d|99)\\d{6}", [9, 10]], 0, 0, 0, ["55\\d{8}", [10]], ["84(?:[08]\\d{3}|[17])\\d{3}", [6, 9]]]], JE: ["44", "00", "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([0-24-8]\\d{5})$|0", "1534$1", 0, 0, [["1534[0-24-8]\\d{5}"], ["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"], ["80(?:07(?:35|81)|8901)\\d{4}"], ["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"], ["701511\\d{4}"], 0, ["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"], ["56\\d{8}"]]], JM: ["1", "011", "(?:[58]\\d\\d|658|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "658|876"], JO: ["962", "00", "(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0"], JP: ["81", "010", "00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}", [8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3", ["(?:12|57|99)0"], "0$1"], ["(\\d{4})(\\d)(\\d{4})", "$1-$2-$3", ["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:80|9[16])", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2-$3", ["[36]|4(?:2[09]|7[01])", "[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3", ["[14]|[289][2-9]|5[3-9]|7[2-4679]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["800"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[257-9]"], "0$1"]], "0"], KE: ["254", "000", "(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}", [7, 8, 9, 10], [["(\\d{2})(\\d{5,7})", "$1 $2", ["[24-6]"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[17]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0"], KG: ["996", "00", "8\\d{9}|(?:[235-8]\\d|99)\\d{7}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["3(?:1[346]|[24-79])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-79]|88"], "0$1"], ["(\\d{3})(\\d{3})(\\d)(\\d{2,3})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], KH: ["855", "00[14-9]", "1\\d{9}|[1-9]\\d{7,8}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], KI: ["686", "00", "(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}", [5, 8], 0, "0"], KM: ["269", "00", "[3478]\\d{6}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[3478]"]]]], KN: ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "869$1", 0, "869"], KP: ["850", "00|99", "85\\d{6}|(?:19\\d|[2-7])\\d{7}", [8, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"]], "0"], KR: ["82", "00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))", "00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}", [5, 6, 8, 9, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3,4})", "$1-$2", ["(?:3[1-3]|[46][1-4]|5[1-5])1"], "0$1"], ["(\\d{4})(\\d{4})", "$1-$2", ["1"]], ["(\\d)(\\d{3,4})(\\d{4})", "$1-$2-$3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60|8"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1-$2-$3", ["[1346]|5[1-5]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{2})(\\d{5})(\\d{4})", "$1-$2-$3", ["5"], "0$1"]], "0", 0, "0(8(?:[1-46-8]|5\\d\\d))?"], KW: ["965", "00", "18\\d{5}|(?:[2569]\\d|41)\\d{6}", [7, 8], [["(\\d{4})(\\d{3,4})", "$1 $2", ["[169]|2(?:[235]|4[1-35-9])|52"]], ["(\\d{3})(\\d{5})", "$1 $2", ["[245]"]]]], KY: ["1", "011", "(?:345|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "345$1", 0, "345"], KZ: ["7", "810", "(?:33622|8\\d{8})\\d{5}|[78]\\d{9}", [10, 14], 0, "8", 0, 0, 0, 0, "33|7", 0, "8~10"], LA: ["856", "00", "[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2[13]|3[14]|[4-8]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["30[013-9]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0"], LB: ["961", "00", "[27-9]\\d{7}|[13-9]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27-9]"]]], "0"], LC: ["1", "011", "(?:[58]\\d\\d|758|900)\\d{7}", [10], 0, "1", 0, "([2-8]\\d{6})$|1", "758$1", 0, "758"], LI: ["423", "00", "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", [7, 9], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2379]|8(?:0[09]|7)", "[2379]|8(?:0(?:02|9)|7)"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["69"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], "0", 0, "(1001)|0"], LK: ["94", "00", "[1-9]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[1-689]"], "0$1"]], "0"], LR: ["231", "00", "(?:[25]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[4-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23578]"], "0$1"]], "0"], LS: ["266", "00", "(?:[256]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2568]"]]]], LT: ["370", "00", "(?:[3469]\\d|52|[78]0)\\d{6}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["52[0-7]"], "(8-$1)", 1], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[7-9]"], "8 $1", 1], ["(\\d{2})(\\d{6})", "$1 $2", ["37|4(?:[15]|6[1-8])"], "(8-$1)", 1], ["(\\d{3})(\\d{5})", "$1 $2", ["[3-6]"], "(8-$1)", 1]], "8", 0, "[08]"], LU: ["352", "00", "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}", [4, 5, 6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{3})", "$1 $2", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["20[2-689]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4", ["2(?:[0367]|4[3-8])"]], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["80[01]|90[015]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["2(?:[0367]|4[3-8])"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]], 0, 0, "(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"], LV: ["371", "00", "(?:[268]\\d|90)\\d{6}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[269]|8[01]"]]]], LY: ["218", "00", "[2-9]\\d{8}", [9], [["(\\d{2})(\\d{7})", "$1-$2", ["[2-9]"], "0$1"]], "0"], MA: ["212", "00", "[5-8]\\d{8}", [9], [["(\\d{5})(\\d{4})", "$1-$2", ["5(?:29|38)", "5(?:29[1289]|389)", "529(?:1[1-46-9]|2[013-8]|90)|5(?:298|389)[0-46-9]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5[45]"], "0$1"], ["(\\d{4})(\\d{5})", "$1-$2", ["5(?:2[2-489]|3[5-9]|9)|892", "5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"], "0$1"], ["(\\d{2})(\\d{7})", "$1-$2", ["8"], "0$1"], ["(\\d{3})(\\d{6})", "$1-$2", ["[5-7]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["5293[01]\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|9[0-289])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[0189]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"], ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|2[0-2]|6[0-8]|8[0-3]))\\d{6}"], ["80\\d{7}"], ["89\\d{7}"], 0, 0, 0, 0, ["592(?:4[0-2]|93)\\d{4}"]]], MC: ["377", "00", "(?:[3489]|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[389]"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["6"], "0$1"]], "0"], MD: ["373", "00", "(?:[235-7]\\d|[89]0)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["22|3"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[25-7]"], "0$1"]], "0"], ME: ["382", "00", "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], "0"], MF: ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}"], ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:395|76[018])\\d|475[0-2])\\d{4}"]]], MG: ["261", "00", "[23]\\d{8}", [9], [["(\\d{2})(\\d{2})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, "([24-9]\\d{6})$|0", "20$1"], MH: ["692", "011", "329\\d{4}|(?:[256]\\d|45)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-6]"]]], "1"], MK: ["389", "00", "[2-578]\\d{7}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2|34[47]|4(?:[37]7|5[47]|64)"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[347]"], "0$1"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[58]"], "0$1"]], "0"], ML: ["223", "00", "[24-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-9]"]]]], MM: ["95", "00", "1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}", [6, 7, 8, 9, 10], [["(\\d)(\\d{2})(\\d{3})", "$1 $2 $3", ["16|2"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[4-7]|8[1-35]"], "0$1"], ["(\\d)(\\d{3})(\\d{4,6})", "$1 $2 $3", ["9(?:2[0-4]|[35-9]|4[137-9])"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["92"], "0$1"], ["(\\d)(\\d{5})(\\d{4})", "$1 $2 $3", ["9"], "0$1"]], "0"], MN: ["976", "001", "[12]\\d{7,9}|[5-9]\\d{7}", [8, 9, 10], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[12]1"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[5-9]"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[12]2[1-3]"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["[12](?:27|3[2-8]|4[2-68]|5[1-4689])", "[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["[12]"], "0$1"]], "0"], MO: ["853", "00", "0800\\d{3}|(?:28|[68]\\d)\\d{6}", [7, 8], [["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[268]"]]]], MP: ["1", "011", "[58]\\d{9}|(?:67|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "670$1", 0, "670"], MQ: ["596", "00", "596\\d{6}|(?:69|80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[569]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], MR: ["222", "00", "(?:[2-4]\\d\\d|800)\\d{5}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-48]"]]]], MS: ["1", "011", "(?:[58]\\d\\d|664|900)\\d{7}", [10], 0, "1", 0, "([34]\\d{6})$|1", "664$1", 0, "664"], MT: ["356", "00", "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2357-9]"]]]], MU: ["230", "0(?:0|[24-7]0|3[03])", "(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46]|8[013]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[57]"]], ["(\\d{5})(\\d{5})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, 0, "020"], MV: ["960", "0(?:0|19)", "(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}", [7, 10], [["(\\d{3})(\\d{4})", "$1-$2", ["[34679]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], MW: ["265", "00", "(?:[1289]\\d|31|77)\\d{7}|1\\d{6}", [7, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["1[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[137-9]"], "0$1"]], "0"], MX: ["52", "0[09]", "1(?:(?:[27]2|44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}", [10, 11], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["33|5[56]|81"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-9]"], 0, 1], ["(\\d)(\\d{2})(\\d{4})(\\d{4})", "$2 $3 $4", ["1(?:33|5[56]|81)"], 0, 1], ["(\\d)(\\d{3})(\\d{3})(\\d{4})", "$2 $3 $4", ["1"], 0, 1]], "01", 0, "0(?:[12]|4[45])|1", 0, 0, 0, 0, "00"], MY: ["60", "00", "1\\d{8,9}|(?:3\\d|[4-9])\\d{7}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1-$2 $3", ["[4-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1-$2 $3", ["1(?:[02469]|[378][1-9]|53)|8", "1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2 $3", ["3"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3-$4", ["1(?:[367]|80)"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2 $3", ["15"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2 $3", ["1"], "0$1"]], "0"], MZ: ["258", "00", "(?:2|8\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2|8[2-79]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], NA: ["264", "00", "[68]\\d{7,8}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["87"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], NC: ["687", "00", "(?:050|[2-57-9]\\d\\d)\\d{3}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1.$2.$3", ["[02-57-9]"]]]], NE: ["227", "00", "[027-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["08"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[089]|2[013]|7[04]"]]]], NF: ["672", "00", "[13]\\d{5}", [6], [["(\\d{2})(\\d{4})", "$1 $2", ["1[0-3]"]], ["(\\d)(\\d{5})", "$1 $2", ["[13]"]]], 0, 0, "([0-258]\\d{4})$", "3$1"], NG: ["234", "009", "(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}", [7, 8, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["78"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]|9(?:0[3-9]|[1-9])"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[3-7]|8[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[7-9]"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{3})(\\d{5})(\\d{5,6})", "$1 $2 $3", ["[78]"], "0$1"]], "0"], NI: ["505", "00", "(?:1800|[25-8]\\d{3})\\d{4}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[125-8]"]]]], NL: ["31", "00", "(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}", [5, 6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{4,7})", "$1 $2", ["[89]0"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["66"], "0$1"], ["(\\d)(\\d{8})", "$1 $2", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-578]|91"], "0$1"], ["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3", ["9"], "0$1"]], "0"], NO: ["47", "00", "(?:0|[2-9]\\d{3})\\d{4}", [5, 8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]"]]], 0, 0, 0, 0, 0, "[02-689]|7[0-8]"], NP: ["977", "00", "(?:1\\d|9)\\d{9}|[1-9]\\d{7}", [8, 10, 11], [["(\\d)(\\d{7})", "$1-$2", ["1[2-6]"], "0$1"], ["(\\d{2})(\\d{6})", "$1-$2", ["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"], "0$1"], ["(\\d{3})(\\d{7})", "$1-$2", ["9"]]], "0"], NR: ["674", "00", "(?:444|(?:55|8\\d)\\d|666)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-68]"]]]], NU: ["683", "00", "(?:[47]|888\\d)\\d{3}", [4, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["8"]]]], NZ: ["64", "0(?:0|161)", "[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,8})", "$1 $2", ["8[1-579]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["50[036-8]|[89]0", "50(?:[0367]|88)|[89]0"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["24|[346]|7[2-57-9]|9[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:10|74)|[59]|80"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1|2[028]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,5})", "$1 $2 $3", ["2(?:[169]|7[0-35-9])|7|86"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "00"], OM: ["968", "00", "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", [7, 8, 9], [["(\\d{3})(\\d{4,6})", "$1 $2", ["[58]"]], ["(\\d{2})(\\d{6})", "$1 $2", ["2"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[179]"]]]], PA: ["507", "00", "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", [7, 8, 10, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[1-57-9]"]], ["(\\d{4})(\\d{4})", "$1-$2", ["[68]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]]], PE: ["51", "00|19(?:1[124]|77|90)00", "(?:[14-8]|9\\d)\\d{7}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["80"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["1"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[4-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"]]], "0", 0, 0, 0, 0, 0, 0, "00", " Anexo "], PF: ["689", "00", "4\\d{5}(?:\\d{2})?|8\\d{7,8}", [6, 8, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["44"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4|8[7-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], PG: ["675", "00|140[1-3]", "(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["18|[2-69]|85"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[78]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], PH: ["63", "00", "(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}", [6, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{5})", "$1 $2", ["2"], "(0$1)"], ["(\\d{4})(\\d{4,6})", "$1 $2", ["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2", "3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"], "(0$1)"], ["(\\d{5})(\\d{4})", "$1 $2", ["346|4(?:27|9[35])|883", "3469|4(?:279|9(?:30|56))|8834"], "(0$1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|8[2-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["1"]]], "0"], PK: ["92", "00", "122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,7})", "$1 $2 $3", ["[89]0"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["1"]], ["(\\d{3})(\\d{6,7})", "$1 $2", ["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])", "9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"], "(0$1)"], ["(\\d{2})(\\d{7,8})", "$1 $2", ["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"], "(0$1)"], ["(\\d{5})(\\d{5})", "$1 $2", ["58"], "(0$1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[24-9]"], "(0$1)"]], "0"], PL: ["48", "00", "(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{5})", "$1", ["19"]], ["(\\d{3})(\\d{3})", "$1 $2", ["11|20|64"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1", "(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["64"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[2-8]|[2-7]|8[1-79]|9[145]"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["8"]]]], PM: ["508", "00", "[45]\\d{5}|(?:708|80\\d)\\d{6}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[45]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], PR: ["1", "011", "(?:[589]\\d\\d|787)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "787|939"], PS: ["970", "00", "[2489]2\\d{6}|(?:1\\d|5)\\d{8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2489]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], PT: ["351", "00", "1693\\d{5}|(?:[26-9]\\d|30)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["2[12]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["16|[236-9]"]]]], PW: ["680", "01[12]", "(?:[24-8]\\d\\d|345|900)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], PY: ["595", "00", "59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3,6})", "$1 $2", ["[2-9]0"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"], "(0$1)"], ["(\\d{3})(\\d{4,5})", "$1 $2", ["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["87"]], ["(\\d{3})(\\d{6})", "$1 $2", ["9(?:[5-79]|8[1-6])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"]]], "0"], QA: ["974", "00", "800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}", [7, 8, 9, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["2[16]|8"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[3-7]"]]]], RE: ["262", "00", "(?:26|[689]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2689]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["26(?:2\\d\\d|3(?:0\\d|1[0-3]))\\d{4}"], ["(?:69(?:2\\d\\d|3(?:0[0-46]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|6[0-6]|7[0-27]|8[0-8]|9[0-479]))|9(?:399[0-3]|479[0-2]|76(?:2[27]|3[0-37]|9\\d)))\\d{4}"], ["80\\d{7}"], ["89[1-37-9]\\d{6}"], 0, 0, 0, 0, 0, ["8(?:1[019]|2[0156]|84|90)\\d{6}"]]], RO: ["40", "00", "(?:[2378]\\d|90)\\d{7}|[23]\\d{5}", [6, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["2[3-6]", "2[3-6]\\d9"], "0$1"], ["(\\d{2})(\\d{4})", "$1 $2", ["219|31"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23]1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[237-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, " int "], RS: ["381", "00", "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}", [6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{3,9})", "$1 $2", ["(?:2[389]|39)0|[7-9]"], "0$1"], ["(\\d{2})(\\d{5,10})", "$1 $2", ["[1-36]"], "0$1"]], "0"], RU: ["7", "810", "8\\d{13}|[347-9]\\d{9}", [10, 14], [["(\\d{4})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-8]|2[1-9])", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"], "8 ($1)", 1], ["(\\d{5})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-68]|2[1-9])", "7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))", "7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[349]|8(?:[02-7]|1[1-8])"], "8 ($1)", 1], ["(\\d{4})(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["8"], "8 ($1)"]], "8", 0, 0, 0, 0, "3[04-689]|[489]", 0, "8~10"], RW: ["250", "00", "(?:06|[27]\\d\\d|[89]00)\\d{6}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"]]], "0"], SA: ["966", "00", "92\\d{7}|(?:[15]|8\\d)\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["9"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["81"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], "0"], SB: ["677", "0[01]", "(?:[1-6]|[7-9]\\d\\d)\\d{4}", [5, 7], [["(\\d{2})(\\d{5})", "$1 $2", ["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]], SC: ["248", "010|0[0-2]", "800\\d{4}|(?:[249]\\d|64)\\d{5}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[246]|9[57]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], SD: ["249", "00", "[19]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], SE: ["46", "00", "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["20"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{4})", "$1-$2", ["9(?:00|39|44|9)"], "0$1", 0, "$1 $2"], ["(\\d{2})(\\d{3})(\\d{2})", "$1-$2 $3", ["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3"], ["(\\d)(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{2,3})(\\d{3})", "$1-$2 $3", ["9(?:00|39|44)"], "0$1", 0, "$1 $2 $3"], ["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["10|7"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{3})", "$1-$2 $3 $4", ["9"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4 $5", ["[26]"], "0$1", 0, "$1 $2 $3 $4 $5"]], "0"], SG: ["65", "0[0-3]\\d", "(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-6]|[1-9])"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{4})(\\d{4})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], SH: ["290", "00", "(?:[256]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[256]"], SI: ["386", "00|10(?:22|66|88|99)", "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}", [5, 6, 7, 8], [["(\\d{2})(\\d{3,6})", "$1 $2", ["8[09]|9"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["59|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37][01]|4[0139]|51|6"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-57]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, 0, "00"], SJ: ["47", "00", "0\\d{4}|(?:[489]\\d|[57]9)\\d{6}", [5, 8], 0, 0, 0, 0, 0, 0, "79"], SK: ["421", "00", "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}", [6, 7, 9], [["(\\d)(\\d{2})(\\d{3,4})", "$1 $2 $3", ["21"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["[3-5][1-8]1", "[3-5][1-8]1[67]"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1/$2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[689]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1/$2 $3 $4", ["[3-5]"], "0$1"]], "0"], SL: ["232", "00", "(?:[237-9]\\d|66)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[236-9]"], "(0$1)"]], "0"], SM: ["378", "00", "(?:0549|[5-7]\\d)\\d{6}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]"]], ["(\\d{4})(\\d{6})", "$1 $2", ["0"]]], 0, 0, "([89]\\d{5})$", "0549$1"], SN: ["221", "00", "(?:[378]\\d|93)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[379]"]]]], SO: ["252", "00", "[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}", [6, 7, 8, 9], [["(\\d{2})(\\d{4})", "$1 $2", ["8[125]"]], ["(\\d{6})", "$1", ["[134]"]], ["(\\d)(\\d{6})", "$1 $2", ["[15]|2[0-79]|3[0-46-8]|4[0-7]"]], ["(\\d)(\\d{7})", "$1 $2", ["(?:2|90)4|[67]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[3478]|64|90"]], ["(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|6(?:0[5-7]|[1-35-9])|9[2-9]"]]], "0"], SR: ["597", "00", "(?:[2-5]|68|[78]\\d)\\d{5}", [6, 7], [["(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], ["(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], ["(\\d{3})(\\d{4})", "$1-$2", ["[6-8]"]]]], SS: ["211", "00", "[19]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], ST: ["239", "00", "(?:22|9\\d)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]]], SV: ["503", "00", "[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?", [7, 8, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[89]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[267]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[89]"]]]], SX: ["1", "011", "7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "(5\\d{6})$|1", "721$1", 0, "721"], SY: ["963", "00", "[1-39]\\d{8}|[1-5]\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-5]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1", 1]], "0"], SZ: ["268", "00", "0800\\d{4}|(?:[237]\\d|900)\\d{6}", [8, 9], [["(\\d{4})(\\d{4})", "$1 $2", ["[0237]"]], ["(\\d{5})(\\d{4})", "$1 $2", ["9"]]]], TA: ["290", "00", "8\\d{3}", [4], 0, 0, 0, 0, 0, 0, "8"], TC: ["1", "011", "(?:[58]\\d\\d|649|900)\\d{7}", [10], 0, "1", 0, "([2-479]\\d{6})$|1", "649$1", 0, "649"], TD: ["235", "00|16", "(?:22|[69]\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2679]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], TG: ["228", "00", "[279]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[279]"]]]], TH: ["66", "00[1-9]", "(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}", [8, 9, 10, 13], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[13-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], TJ: ["992", "810", "[0-57-9]\\d{8}", [9], [["(\\d{6})(\\d)(\\d{2})", "$1 $2 $3", ["331", "3317"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["[34]7|91[78]"]], ["(\\d{4})(\\d)(\\d{4})", "$1 $2 $3", ["3[1-5]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[0-57-9]"]]], 0, 0, 0, 0, 0, 0, 0, "8~10"], TK: ["690", "00", "[2-47]\\d{3,6}", [4, 5, 6, 7]], TL: ["670", "00", "7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-489]|70"]], ["(\\d{4})(\\d{4})", "$1 $2", ["7"]]]], TM: ["993", "810", "[1-6]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["12"], "(8 $1)"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-5]"], "(8 $1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["6"], "8 $1"]], "8", 0, 0, 0, 0, 0, 0, "8~10"], TN: ["216", "00", "[2-57-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-57-9]"]]]], TO: ["676", "00", "(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}", [5, 7], [["(\\d{2})(\\d{3})", "$1-$2", ["[2-4]|50|6[09]|7[0-24-69]|8[05]"]], ["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[5-9]"]]]], TR: ["90", "00", "4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}", [7, 10, 12, 13], [["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["512|8[01589]|90"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5(?:[0-59]|61)", "5(?:[0-59]|616)", "5(?:[0-59]|6161)"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24][1-8]|3[1-9]"], "(0$1)", 1], ["(\\d{3})(\\d{3})(\\d{6,7})", "$1 $2 $3", ["80"], "0$1", 1]], "0"], TT: ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-46-8]\\d{6})$|1", "868$1", 0, "868"], TV: ["688", "00", "(?:2|7\\d\\d|90)\\d{4}", [5, 6, 7], [["(\\d{2})(\\d{3})", "$1 $2", ["2"]], ["(\\d{2})(\\d{4})", "$1 $2", ["90"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], TW: ["886", "0(?:0[25-79]|19)", "[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}", [7, 8, 9, 10, 11], [["(\\d{2})(\\d)(\\d{4})", "$1 $2 $3", ["202"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[258]0"], "0$1"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]", "[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, "#"], TZ: ["255", "00[056]", "(?:[25-8]\\d|41|90)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[24]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["5"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[67]"], "0$1"]], "0"], UA: ["380", "00", "[89]\\d{9}|[3-9]\\d{8}", [9, 10], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]", "6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])", "3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|89|9[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "0~0"], UG: ["256", "00[057]", "800\\d{6}|(?:[29]0|[347]\\d)\\d{7}", [9], [["(\\d{4})(\\d{5})", "$1 $2", ["202", "2024"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[27-9]|4(?:6[45]|[7-9])"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[34]"], "0$1"]], "0"], US: ["1", "011", "[2-9]\\d{9}|3\\d{6}", [10], [["(\\d{3})(\\d{4})", "$1-$2", ["310"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], 0, 1, "$1-$2-$3"]], "1", 0, 0, 0, 0, 0, [["5056(?:[0-35-9]\\d|4[46])\\d{4}|(?:4722|505[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[0-2]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"], [""], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"], ["900[2-9]\\d{6}"], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]], UY: ["598", "0(?:0|1[3-9]\\d)", "(?:0004|4)\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}", [7, 8, 10, 13], [["(\\d{3})(\\d{4})", "$1 $2", ["405|8|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["0"]]], "0", 0, 0, 0, 0, 0, 0, "00", " int. "], UZ: ["998", "810", "(?:33|[5-79]\\d|88)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[35-9]"], "8 $1"]], "8", 0, 0, 0, 0, 0, 0, "8~10"], VA: ["39", "00", "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", [6, 7, 8, 9, 10, 11], 0, 0, 0, 0, 0, 0, "06698"], VC: ["1", "011", "(?:[58]\\d\\d|784|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "784$1", 0, "784"], VE: ["58", "00", "[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}", [10], [["(\\d{3})(\\d{7})", "$1-$2", ["[24-689]"], "0$1"]], "0"], VG: ["1", "011", "(?:284|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-578]\\d{6})$|1", "284$1", 0, "284"], VI: ["1", "011", "[58]\\d{9}|(?:34|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "340$1", 0, "340"], VN: ["84", "00", "[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["80"], "0$1", 1], ["(\\d{4})(\\d{4,6})", "$1 $2", ["1"], 0, 1], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[69]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[3578]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["2[48]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["2"], "0$1", 1]], "0"], VU: ["678", "00", "[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}", [5, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["[57-9]"]]]], WF: ["681", "00", "(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[478]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], WS: ["685", "0", "(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}", [5, 6, 7, 10], [["(\\d{5})", "$1", ["[2-5]|6[1-9]"]], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[68]"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], XK: ["383", "00", "[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[23]"], "0$1"]], "0"], YE: ["967", "00", "(?:1|7\\d)\\d{7}|[1-7]\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-6]|7(?:[24-6]|8[0-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"], "0$1"]], "0"], YT: ["262", "00", "(?:(?:(?:26|63)9|80\\d)\\d|9398)\\d{5}", [9], 0, "0", 0, 0, 0, 0, "269|63|9398"], ZA: ["27", "00", "[1-79]\\d{8}|8\\d{4,9}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,4})", "$1 $2", ["8[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["8[1-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["860"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], ZM: ["260", "00", "800\\d{6}|(?:21|63|[79]\\d)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[28]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[79]"], "0$1"]], "0"], ZW: ["263", "00", "2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}", [5, 6, 7, 8, 9, 10], [["(\\d{3})(\\d{3,5})", "$1 $2", ["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"], "0$1"], ["(\\d)(\\d{3})(\\d{2,4})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2", "2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)", "2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["29[013-9]|39|54"], "0$1"], ["(\\d{4})(\\d{3,5})", "$1 $2", ["(?:25|54)8", "258|5483"], "0$1"]], "0"] }, nonGeographic: { 800: ["800", 0, "(?:00|[1-9]\\d)\\d{6}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["\\d"]]], 0, 0, 0, 0, 0, 0, [0, 0, ["(?:00|[1-9]\\d)\\d{6}"]]], 808: ["808", 0, "[1-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[1-9]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, ["[1-9]\\d{7}"]]], 870: ["870", 0, "7\\d{11}|[35-7]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[35-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]], 878: ["878", 0, "10\\d{10}", [12], [["(\\d{2})(\\d{5})(\\d{5})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["10\\d{10}"]]], 881: ["881", 0, "[0-36-9]\\d{8}", [9], [["(\\d)(\\d{3})(\\d{5})", "$1 $2 $3", ["[0-36-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["[0-36-9]\\d{8}"]]], 882: ["882", 0, "[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5})", "$1 $2", ["16|342"]], ["(\\d{2})(\\d{6})", "$1 $2", ["49"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["1[36]|9"]], ["(\\d{2})(\\d{4})(\\d{3})", "$1 $2 $3", ["3[23]"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["16"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|23|3(?:[15]|4[57])|4|51"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["34"]], ["(\\d{2})(\\d{4,5})(\\d{5})", "$1 $2 $3", ["[1-35]"]]], 0, 0, 0, 0, 0, 0, [0, ["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}", [7, 8, 9, 10, 12]], 0, 0, 0, 0, 0, 0, ["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]], 883: ["883", 0, "(?:[1-4]\\d|51)\\d{6,10}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,8})", "$1 $2 $3", ["[14]|2[24-689]|3[02-689]|51[24-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["510"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["21"]], ["(\\d{4})(\\d{4})(\\d{4})", "$1 $2 $3", ["51[13]"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[235]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[013-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]], 888: ["888", 0, "\\d{11}", [11], [["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, ["\\d{11}"]]], 979: ["979", 0, "[1359]\\d{8}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, ["[1359]\\d{8}"]]] } }; function vn(t, e) { var n = Array.prototype.slice.call(e); return n.push(Ki), t.apply(this, n); } function ir(t) { "@babel/helpers - typeof"; return ir = 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; }, ir(t); } function ua(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function Sc(t, e, n) { return e && ua(t.prototype, e), n && ua(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function Oc(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Ac(t, e) { if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && Ut(t, e); } function Ic(t) { var e = Yi(); return function() { var r = Ht(t), a; if (e) { var i = Ht(this).constructor; a = Reflect.construct(r, arguments, i); } else a = r.apply(this, arguments); return Rc(this, a); }; } function Rc(t, e) { if (e && (ir(e) === "object" || typeof e == "function")) return e; if (e !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return ji(t); } function ji(t) { if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t; } function or(t) { var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0; return or = function(r) { if (r === null || !Dc(r)) return r; if (typeof r != "function") throw new TypeError("Super expression must either be null or a function"); if (typeof e < "u") { if (e.has(r)) return e.get(r); e.set(r, a); } function a() { return nn(r, arguments, Ht(this).constructor); } return a.prototype = Object.create(r.prototype, { constructor: { value: a, enumerable: !1, writable: !0, configurable: !0 } }), Ut(a, r); }, or(t); } function nn(t, e, n) { return Yi() ? nn = Reflect.construct : nn = function(a, i, o) { var s = [null]; s.push.apply(s, i); var l = Function.bind.apply(a, s), d = new l(); return o && Ut(d, o.prototype), d; }, nn.apply(null, arguments); } function Yi() { 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 Dc(t) { return Function.toString.call(t).indexOf("[native code]") !== -1; } function Ut(t, e) { return Ut = Object.setPrototypeOf || function(r, a) { return r.__proto__ = a, r; }, Ut(t, e); } function Ht(t) { return Ht = Object.setPrototypeOf ? Object.getPrototypeOf : function(n) { return n.__proto__ || Object.getPrototypeOf(n); }, Ht(t); } var Ye = /* @__PURE__ */ function(t) { Ac(n, t); var e = Ic(n); function n(r) { var a; return Oc(this, n), a = e.call(this, r), Object.setPrototypeOf(ji(a), n.prototype), a.name = a.constructor.name, a; } return Sc(n); }(/* @__PURE__ */ or(Error)), Or = 2, Pc = 17, wc = 3, Ie = "0-90-9٠-٩۰-۹", Lc = "-‐-―−ー-", xc = "//", Fc = "..", Mc = "  ­​⁠ ", kc = "()()[]\\[\\]", Bc = "~⁓∼~", Ue = "".concat(Lc).concat(xc).concat(Fc).concat(Mc).concat(kc).concat(Bc), yn = "++"; function fa(t, e) { t = t.split("-"), e = e.split("-"); for (var n = t[0].split("."), r = e[0].split("."), a = 0; a < 3; a++) { var i = Number(n[a]), o = Number(r[a]); if (i > o) return 1; if (o > i) return -1; if (!isNaN(i) && isNaN(o)) return 1; if (isNaN(i) && !isNaN(o)) return -1; } return t[1] && e[1] ? t[1] > e[1] ? 1 : t[1] < e[1] ? -1 : 0 : !t[1] && e[1] ? 1 : t[1] && !e[1] ? -1 : 0; } function fn(t) { "@babel/helpers - typeof"; return fn = 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; }, fn(t); } function En(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function ha(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function bn(t, e, n) { return e && ha(t.prototype, e), n && ha(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } var Uc = "1.2.0", Hc = "1.7.35", pa = " ext. ", Wc = /^\d+$/, Se = /* @__PURE__ */ function() { function t(e) { En(this, t), jc(e), this.metadata = e, zi.call(this, e); } return bn(t, [{ key: "getCountries", value: function() { return Object.keys(this.metadata.countries).filter(function(n) { return n !== "001"; }); } }, { key: "getCountryMetadata", value: function(n) { return this.metadata.countries[n]; } }, { key: "nonGeographic", value: function() { if (!(this.v1 || this.v2 || this.v3)) return this.metadata.nonGeographic || this.metadata.nonGeographical; } }, { key: "hasCountry", value: function(n) { return this.getCountryMetadata(n) !== void 0; } }, { key: "hasCallingCode", value: function(n) { if (this.getCountryCodesForCallingCode(n)) return !0; if (this.nonGeographic()) { if (this.nonGeographic()[n]) return !0; } else { var r = this.countryCallingCodes()[n]; if (r && r.length === 1 && r[0] === "001") return !0; } } }, { key: "isNonGeographicCallingCode", value: function(n) { return this.nonGeographic() ? !!this.nonGeographic()[n] : !this.getCountryCodesForCallingCode(n); } // Deprecated. }, { key: "country", value: function(n) { return this.selectNumberingPlan(n); } }, { key: "selectNumberingPlan", value: function(n, r) { if (n && Wc.test(n) && (r = n, n = null), n && n !== "001") { if (!this.hasCountry(n)) throw new Error("Unknown country: ".concat(n)); this.numberingPlan = new ma(this.getCountryMetadata(n), this); } else if (r) { if (!this.hasCallingCode(r)) throw new Error("Unknown calling code: ".concat(r)); this.numberingPlan = new ma(this.getNumberingPlanMetadata(r), this); } else this.numberingPlan = void 0; return this; } }, { key: "getCountryCodesForCallingCode", value: function(n) { var r = this.countryCallingCodes()[n]; if (r) return r.length === 1 && r[0].length === 3 ? void 0 : r; } }, { key: "getCountryCodeForCallingCode", value: function(n) { var r = this.getCountryCodesForCallingCode(n); if (r) return r[0]; } }, { key: "getNumberingPlanMetadata", value: function(n) { var r = this.getCountryCodeForCallingCode(n); if (r) return this.getCountryMetadata(r); if (this.nonGeographic()) { var a = this.nonGeographic()[n]; if (a) return a; } else { var i = this.countryCallingCodes()[n]; if (i && i.length === 1 && i[0] === "001") return this.metadata.countries["001"]; } } // Deprecated. }, { key: "countryCallingCode", value: function() { return this.numberingPlan.callingCode(); } // Deprecated. }, { key: "IDDPrefix", value: function() { return this.numberingPlan.IDDPrefix(); } // Deprecated. }, { key: "defaultIDDPrefix", value: function() { return this.numberingPlan.defaultIDDPrefix(); } // Deprecated. }, { key: "nationalNumberPattern", value: function() { return this.numberingPlan.nationalNumberPattern(); } // Deprecated. }, { key: "possibleLengths", value: function() { return this.numberingPlan.possibleLengths(); } // Deprecated. }, { key: "formats", value: function() { return this.numberingPlan.formats(); } // Deprecated. }, { key: "nationalPrefixForParsing", value: function() { return this.numberingPlan.nationalPrefixForParsing(); } // Deprecated. }, { key: "nationalPrefixTransformRule", value: function() { return this.numberingPlan.nationalPrefixTransformRule(); } // Deprecated. }, { key: "leadingDigits", value: function() { return this.numberingPlan.leadingDigits(); } // Deprecated. }, { key: "hasTypes", value: function() { return this.numberingPlan.hasTypes(); } // Deprecated. }, { key: "type", value: function(n) { return this.numberingPlan.type(n); } // Deprecated. }, { key: "ext", value: function() { return this.numberingPlan.ext(); } }, { key: "countryCallingCodes", value: function() { return this.v1 ? this.metadata.country_phone_code_to_countries : this.metadata.country_calling_codes; } // Deprecated. }, { key: "chooseCountryByCountryCallingCode", value: function(n) { return this.selectNumberingPlan(n); } }, { key: "hasSelectedNumberingPlan", value: function() { return this.numberingPlan !== void 0; } }]), t; }(), ma = /* @__PURE__ */ function() { function t(e, n) { En(this, t), this.globalMetadataObject = n, this.metadata = e, zi.call(this, n.metadata); } return bn(t, [{ key: "callingCode", value: function() { return this.metadata[0]; } // Formatting information for regions which share // a country calling code is contained by only one region // for performance reasons. For example, for NANPA region // ("North American Numbering Plan Administration", // which includes USA, Canada, Cayman Islands, Bahamas, etc) // it will be contained in the metadata for `US`. }, { key: "getDefaultCountryMetadataForRegion", value: function() { return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode()); } // Is always present. }, { key: "IDDPrefix", value: function() { if (!(this.v1 || this.v2)) return this.metadata[1]; } // Is only present when a country supports multiple IDD prefixes. }, { key: "defaultIDDPrefix", value: function() { if (!(this.v1 || this.v2)) return this.metadata[12]; } }, { key: "nationalNumberPattern", value: function() { return this.v1 || this.v2 ? this.metadata[1] : this.metadata[2]; } // "possible length" data is always present in Google's metadata. }, { key: "possibleLengths", value: function() { if (!this.v1) return this.metadata[this.v2 ? 2 : 3]; } }, { key: "_getFormats", value: function(n) { return n[this.v1 ? 2 : this.v2 ? 3 : 4]; } // For countries of the same region (e.g. NANPA) // formats are all stored in the "main" country for that region. // E.g. "RU" and "KZ", "US" and "CA". }, { key: "formats", value: function() { var n = this, r = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || []; return r.map(function(a) { return new Vc(a, n); }); } }, { key: "nationalPrefix", value: function() { return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5]; } }, { key: "_getNationalPrefixFormattingRule", value: function(n) { return n[this.v1 ? 4 : this.v2 ? 5 : 6]; } // For countries of the same region (e.g. NANPA) // national prefix formatting rule is stored in the "main" country for that region. // E.g. "RU" and "KZ", "US" and "CA". }, { key: "nationalPrefixFormattingRule", value: function() { return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion()); } }, { key: "_nationalPrefixForParsing", value: function() { return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7]; } }, { key: "nationalPrefixForParsing", value: function() { return this._nationalPrefixForParsing() || this.nationalPrefix(); } }, { key: "nationalPrefixTransformRule", value: function() { return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8]; } }, { key: "_getNationalPrefixIsOptionalWhenFormatting", value: function() { return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9]; } // For countries of the same region (e.g. NANPA) // "national prefix is optional when formatting" flag is // stored in the "main" country for that region. // E.g. "RU" and "KZ", "US" and "CA". }, { key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat", value: function() { return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion()); } }, { key: "leadingDigits", value: function() { return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10]; } }, { key: "types", value: function() { return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11]; } }, { key: "hasTypes", value: function() { return this.types() && this.types().length === 0 ? !1 : !!this.types(); } }, { key: "type", value: function(n) { if (this.hasTypes() && $a(this.types(), n)) return new Kc($a(this.types(), n), this); } }, { key: "ext", value: function() { return this.v1 || this.v2 ? pa : this.metadata[13] || pa; } }]), t; }(), Vc = /* @__PURE__ */ function() { function t(e, n) { En(this, t), this._format = e, this.metadata = n; } return bn(t, [{ key: "pattern", value: function() { return this._format[0]; } }, { key: "format", value: function() { return this._format[1]; } }, { key: "leadingDigitsPatterns", value: function() { return this._format[2] || []; } }, { key: "nationalPrefixFormattingRule", value: function() { return this._format[3] || this.metadata.nationalPrefixFormattingRule(); } }, { key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat", value: function() { return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat(); } }, { key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat", value: function() { return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat(); } // Checks whether national prefix formatting rule contains national prefix. }, { key: "usesNationalPrefix", value: function() { return !!(this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one. !Gc.test(this.nationalPrefixFormattingRule())); } }, { key: "internationalFormat", value: function() { return this._format[5] || this.format(); } }]), t; }(), Gc = /^\(?\$1\)?$/, Kc = /* @__PURE__ */ function() { function t(e, n) { En(this, t), this.type = e, this.metadata = n; } return bn(t, [{ key: "pattern", value: function() { return this.metadata.v1 ? this.type : this.type[0]; } }, { key: "possibleLengths", value: function() { if (!this.metadata.v1) return this.type[1] || this.metadata.possibleLengths(); } }]), t; }(); function $a(t, e) { switch (e) { case "FIXED_LINE": return t[0]; case "MOBILE": return t[1]; case "TOLL_FREE": return t[2]; case "PREMIUM_RATE": return t[3]; case "PERSONAL_NUMBER": return t[4]; case "VOICEMAIL": return t[5]; case "UAN": return t[6]; case "PAGER": return t[7]; case "VOIP": return t[8]; case "SHARED_COST": return t[9]; } } function jc(t) { if (!t) throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments."); if (!Bn(t) || !Bn(t.countries)) throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(Bn(t) ? "an object of shape: { " + Object.keys(t).join(", ") + " }" : "a " + Yc(t) + ": " + t, ".")); } var Bn = function(e) { return fn(e) === "object"; }, Yc = function(e) { return fn(e); }; function Ar(t, e) { if (e = new Se(e), e.hasCountry(t)) return e.country(t).countryCallingCode(); throw new Error("Unknown country: ".concat(t)); } function zc(t, e) { return e.countries[t] !== void 0; } function zi(t) { var e = t.version; typeof e == "number" ? (this.v1 = e === 1, this.v2 = e === 2, this.v3 = e === 3, this.v4 = e === 4) : e ? fa(e, Uc) === -1 ? this.v2 = !0 : fa(e, Hc) === -1 ? this.v3 = !0 : this.v4 = !0 : this.v1 = !0; } var Xc = ";ext=", ft = function(e) { return "([".concat(Ie, "]{1,").concat(e, "})"); }; function Xi(t) { var e = "20", n = "15", r = "9", a = "6", i = "[  \\t,]*", o = "[:\\..]?[  \\t,-]*", s = "#?", l = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", d = "(?:[xx##~~]|int|int)", c = "[- ]+", f = "[  \\t]*", h = "(?:,{2}|;)", p = Xc + ft(e), m = i + l + o + ft(e) + s, _ = i + d + o + ft(r) + s, g = c + ft(a) + "#", v = f + h + o + ft(n) + s, $ = f + "(?:,)+" + o + ft(r) + s; return p + "|" + m + "|" + _ + "|" + g + "|" + v + "|" + $; } var qc = "[" + Ie + "]{" + Or + "}", Zc = "[" + yn + "]{0,1}(?:[" + Ue + "]*[" + Ie + "]){3,}[" + Ue + Ie + "]*", Jc = new RegExp("^[" + yn + "]{0,1}(?:[" + Ue + "]*[" + Ie + "]){1,2}$", "i"), Qc = Zc + // Phone number extensions "(?:" + Xi() + ")?", eu = new RegExp( // Either a short two-digit-only phone number "^" + qc + "$|^" + Qc + "$", "i" ); function qi(t) { return t.length >= Or && eu.test(t); } function tu(t) { return Jc.test(t); } var _a = new RegExp("(?:" + Xi() + ")$", "i"); function nu(t) { var e = t.search(_a); if (e < 0) return {}; for (var n = t.slice(0, e), r = t.match(_a), a = 1; a < r.length; ) { if (r[a]) return { number: n, ext: r[a] }; a++; } } function ru(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = au(t)) || e && t && typeof t.length == "number") { n && (t = n); var r = 0; return function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }; } 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 au(t, e) { if (t) { if (typeof t == "string") return ga(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ga(t, e); } } function ga(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } var iu = { 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "9", "0": "0", // Fullwidth digit 0 "1": "1", // Fullwidth digit 1 "2": "2", // Fullwidth digit 2 "3": "3", // Fullwidth digit 3 "4": "4", // Fullwidth digit 4 "5": "5", // Fullwidth digit 5 "6": "6", // Fullwidth digit 6 "7": "7", // Fullwidth digit 7 "8": "8", // Fullwidth digit 8 "9": "9", // Fullwidth digit 9 "٠": "0", // Arabic-indic digit 0 "١": "1", // Arabic-indic digit 1 "٢": "2", // Arabic-indic digit 2 "٣": "3", // Arabic-indic digit 3 "٤": "4", // Arabic-indic digit 4 "٥": "5", // Arabic-indic digit 5 "٦": "6", // Arabic-indic digit 6 "٧": "7", // Arabic-indic digit 7 "٨": "8", // Arabic-indic digit 8 "٩": "9", // Arabic-indic digit 9 "۰": "0", // Eastern-Arabic digit 0 "۱": "1", // Eastern-Arabic digit 1 "۲": "2", // Eastern-Arabic digit 2 "۳": "3", // Eastern-Arabic digit 3 "۴": "4", // Eastern-Arabic digit 4 "۵": "5", // Eastern-Arabic digit 5 "۶": "6", // Eastern-Arabic digit 6 "۷": "7", // Eastern-Arabic digit 7 "۸": "8", // Eastern-Arabic digit 8 "۹": "9" // Eastern-Arabic digit 9 }; function Zi(t) { return iu[t]; } function hn(t) { for (var e = "", n = ru(t.split("")), r; !(r = n()).done; ) { var a = r.value, i = Zi(a); i && (e += i); } return e; } function ou(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = su(t)) || e && t && typeof t.length == "number") { n && (t = n); var r = 0; return function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }; } 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 su(t, e) { if (t) { if (typeof t == "string") return Ta(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ta(t, e); } } function Ta(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } function va(t) { for (var e = "", n = ou(t.split("")), r; !(r = n()).done; ) { var a = r.value; e += lu(a, e) || ""; } return e; } function lu(t, e) { return t === "+" ? e ? void 0 : "+" : Zi(t); } function du(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = cu(t)) || e && t && typeof t.length == "number") { n && (t = n); var r = 0; return function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }; } 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 cu(t, e) { if (t) { if (typeof t == "string") return ya(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ya(t, e); } } function ya(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } function uu(t, e) { for (var n = t.slice(), r = du(e), a; !(a = r()).done; ) { var i = a.value; t.indexOf(i) < 0 && n.push(i); } return n.sort(function(o, s) { return o - s; }); } function Cn(t, e) { return Ji(t, void 0, e); } function Ji(t, e, n) { var r = n.type(e), a = r && r.possibleLengths() || n.possibleLengths(); if (!a) return "IS_POSSIBLE"; if (e === "FIXED_LINE_OR_MOBILE") { if (!n.type("FIXED_LINE")) return Ji(t, "MOBILE", n); var i = n.type("MOBILE"); i && (a = uu(a, i.possibleLengths())); } else if (e && !r) return "INVALID_LENGTH"; var o = t.length, s = a[0]; return s === o ? "IS_POSSIBLE" : s > o ? "TOO_SHORT" : a[a.length - 1] < o ? "TOO_LONG" : a.indexOf(o, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH"; } function fu(t, e, n) { if (e === void 0 && (e = {}), n = new Se(n), e.v2) { if (!t.countryCallingCode) throw new Error("Invalid phone number object passed"); n.selectNumberingPlan(t.countryCallingCode); } else { if (!t.phone) return !1; if (t.country) { if (!n.hasCountry(t.country)) throw new Error("Unknown country: ".concat(t.country)); n.country(t.country); } else { if (!t.countryCallingCode) throw new Error("Invalid phone number object passed"); n.selectNumberingPlan(t.countryCallingCode); } } if (n.possibleLengths()) return Qi(t.phone || t.nationalNumber, n); if (t.countryCallingCode && n.isNonGeographicCallingCode(t.countryCallingCode)) return !0; throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.'); } function Qi(t, e) { switch (Cn(t, e)) { case "IS_POSSIBLE": return !0; default: return !1; } } function Xe(t, e) { return t = t || "", new RegExp("^(?:" + e + ")$").test(t); } function hu(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = pu(t)) || e && t && typeof t.length == "number") { n && (t = n); var r = 0; return function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }; } 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 pu(t, e) { if (t) { if (typeof t == "string") return Ea(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ea(t, e); } } function Ea(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } var mu = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"]; function Ir(t, e, n) { if (e = e || {}, !!t.country) { n = new Se(n), n.selectNumberingPlan(t.country, t.countryCallingCode); var r = e.v2 ? t.nationalNumber : t.phone; if (Xe(r, n.nationalNumberPattern())) { if (Un(r, "FIXED_LINE", n)) return n.type("MOBILE") && n.type("MOBILE").pattern() === "" || !n.type("MOBILE") || Un(r, "MOBILE", n) ? "FIXED_LINE_OR_MOBILE" : "FIXED_LINE"; for (var a = hu(mu), i; !(i = a()).done; ) { var o = i.value; if (Un(r, o, n)) return o; } } } } function Un(t, e, n) { return e = n.type(e), !e || !e.pattern() || e.possibleLengths() && e.possibleLengths().indexOf(t.length) < 0 ? !1 : Xe(t, e.pattern()); } function eo(t, e, n) { if (e = e || {}, n = new Se(n), n.selectNumberingPlan(t.country, t.countryCallingCode), n.hasTypes()) return Ir(t, e, n.metadata) !== void 0; var r = e.v2 ? t.nationalNumber : t.phone; return Xe(r, n.nationalNumberPattern()); } function $u(t, e, n) { var r = new Se(n), a = r.getCountryCodesForCallingCode(t); return a ? a.filter(function(i) { return _u(e, i, n); }) : []; } function _u(t, e, n) { var r = new Se(n); return r.selectNumberingPlan(e), r.numberingPlan.possibleLengths().indexOf(t.length) >= 0; } function to(t) { return t.replace(new RegExp("[".concat(Ue, "]+"), "g"), " ").trim(); } var no = /(\$\d)/; function ro(t, e, n) { var r = n.useInternationalFormat, a = n.withNationalPrefix; n.carrierCode, n.metadata; var i = t.replace(new RegExp(e.pattern()), r ? e.internationalFormat() : ( // This library doesn't use `domestic_carrier_code_formatting_rule`, // because that one is only used when formatting phone numbers // for dialing from a mobile phone, and this is not a dialing library. // carrierCode && format.domesticCarrierCodeFormattingRule() // // First, replace the $CC in the formatting rule with the desired carrier code. // // Then, replace the $FG in the formatting rule with the first group // // and the carrier code combined in the appropriate way. // ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode)) // : ( // withNationalPrefix && format.nationalPrefixFormattingRule() // ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) // : format.format() // ) a && e.nationalPrefixFormattingRule() ? e.format().replace(no, e.nationalPrefixFormattingRule()) : e.format() )); return r ? to(i) : i; } var gu = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/; function Tu(t, e, n) { var r = new Se(n); if (r.selectNumberingPlan(t, e), r.defaultIDDPrefix()) return r.defaultIDDPrefix(); if (gu.test(r.IDDPrefix())) return r.IDDPrefix(); } function vu(t) { var e = t.number, n = t.ext; if (!e) return ""; if (e[0] !== "+") throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.'); return "tel:".concat(e).concat(n ? ";ext=" + n : ""); } function yu(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = Eu(t)) || e && t && typeof t.length == "number") { n && (t = n); var r = 0; return function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }; } 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 Eu(t, e) { if (t) { if (typeof t == "string") return ba(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ba(t, e); } } function ba(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } function Ca(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter(function(a) { return Object.getOwnPropertyDescriptor(t, a).enumerable; })), n.push.apply(n, r); } return n; } function Na(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e] != null ? arguments[e] : {}; e % 2 ? Ca(Object(n), !0).forEach(function(r) { bu(t, r, n[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Ca(Object(n)).forEach(function(r) { Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r)); }); } return t; } function bu(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } var Sa = { formatExtension: function(e, n, r) { return "".concat(e).concat(r.ext()).concat(n); } }; function Cu(t, e, n, r) { if (n ? n = Na(Na({}, Sa), n) : n = Sa, r = new Se(r), t.country && t.country !== "001") { if (!r.hasCountry(t.country)) throw new Error("Unknown country: ".concat(t.country)); r.country(t.country); } else if (t.countryCallingCode) r.selectNumberingPlan(t.countryCallingCode); else return t.phone || ""; var a = r.countryCallingCode(), i = n.v2 ? t.nationalNumber : t.phone, o; switch (e) { case "NATIONAL": return i ? (o = pn(i, t.carrierCode, "NATIONAL", r, n), Hn(o, t.ext, r, n.formatExtension)) : ""; case "INTERNATIONAL": return i ? (o = pn(i, null, "INTERNATIONAL", r, n), o = "+".concat(a, " ").concat(o), Hn(o, t.ext, r, n.formatExtension)) : "+".concat(a); case "E.164": return "+".concat(a).concat(i); case "RFC3966": return vu({ number: "+".concat(a).concat(i), ext: t.ext }); case "IDD": if (!n.fromCountry) return; var s = Su(i, t.carrierCode, a, n.fromCountry, r); return Hn(s, t.ext, r, n.formatExtension); default: throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e, '"')); } } function pn(t, e, n, r, a) { var i = Nu(r.formats(), t); return i ? ro(t, i, { useInternationalFormat: n === "INTERNATIONAL", withNationalPrefix: !(i.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && a && a.nationalPrefix === !1), carrierCode: e, metadata: r }) : t; } function Nu(t, e) { for (var n = yu(t), r; !(r = n()).done; ) { var a = r.value; if (a.leadingDigitsPatterns().length > 0) { var i = a.leadingDigitsPatterns()[a.leadingDigitsPatterns().length - 1]; if (e.search(i) !== 0) continue; } if (Xe(e, a.pattern())) return a; } } function Hn(t, e, n, r) { return e ? r(t, e, n) : t; } function Su(t, e, n, r, a) { var i = Ar(r, a.metadata); if (i === n) { var o = pn(t, e, "NATIONAL", a); return n === "1" ? n + " " + o : o; } var s = Tu(r, void 0, a.metadata); if (s) return "".concat(s, " ").concat(n, " ").concat(pn(t, null, "INTERNATIONAL", a)); } function Oa(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter(function(a) { return Object.getOwnPropertyDescriptor(t, a).enumerable; })), n.push.apply(n, r); } return n; } function Aa(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e] != null ? arguments[e] : {}; e % 2 ? Oa(Object(n), !0).forEach(function(r) { Ou(t, r, n[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Oa(Object(n)).forEach(function(r) { Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r)); }); } return t; } function Ou(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } function Au(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Ia(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function Iu(t, e, n) { return e && Ia(t.prototype, e), n && Ia(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } var ao = /* @__PURE__ */ function() { function t(e, n, r) { if (Au(this, t), !e) throw new TypeError("`country` or `countryCallingCode` not passed"); if (!n) throw new TypeError("`nationalNumber` not passed"); if (!r) throw new TypeError("`metadata` not passed"); var a = Du(e, r), i = a.country, o = a.countryCallingCode; this.country = i, this.countryCallingCode = o, this.nationalNumber = n, this.number = "+" + this.countryCallingCode + this.nationalNumber, this.getMetadata = function() { return r; }; } return Iu(t, [{ key: "setExt", value: function(n) { this.ext = n; } }, { key: "getPossibleCountries", value: function() { return this.country ? [this.country] : $u(this.countryCallingCode, this.nationalNumber, this.getMetadata()); } }, { key: "isPossible", value: function() { return fu(this, { v2: !0 }, this.getMetadata()); } }, { key: "isValid", value: function() { return eo(this, { v2: !0 }, this.getMetadata()); } }, { key: "isNonGeographic", value: function() { var n = new Se(this.getMetadata()); return n.isNonGeographicCallingCode(this.countryCallingCode); } }, { key: "isEqual", value: function(n) { return this.number === n.number && this.ext === n.ext; } // This function was originally meant to be an equivalent for `validatePhoneNumberLength()`, // but later it was found out that it doesn't include the possible `TOO_SHORT` result // returned from `parsePhoneNumberWithError()` in the original `validatePhoneNumberLength()`, // so eventually I simply commented out this method from the `PhoneNumber` class // and just left the `validatePhoneNumberLength()` function, even though that one would require // and additional step to also validate the actual country / calling code of the phone number. // validateLength() { // const metadata = new Metadata(this.getMetadata()) // metadata.selectNumberingPlan(this.countryCallingCode) // const result = checkNumberLength(this.nationalNumber, metadata) // if (result !== 'IS_POSSIBLE') { // return result // } // } }, { key: "getType", value: function() { return Ir(this, { v2: !0 }, this.getMetadata()); } }, { key: "format", value: function(n, r) { return Cu(this, n, r ? Aa(Aa({}, r), {}, { v2: !0 }) : { v2: !0 }, this.getMetadata()); } }, { key: "formatNational", value: function(n) { return this.format("NATIONAL", n); } }, { key: "formatInternational", value: function(n) { return this.format("INTERNATIONAL", n); } }, { key: "getURI", value: function(n) { return this.format("RFC3966", n); } }]), t; }(), Ru = function(e) { return /^[A-Z]{2}$/.test(e); }; function Du(t, e) { var n, r, a = new Se(e); return Ru(t) ? (n = t, a.selectNumberingPlan(n), r = a.countryCallingCode()) : r = t, { country: n, countryCallingCode: r }; } var Pu = new RegExp("([" + Ie + "])"); function io(t, e, n, r) { if (e) { var a = new Se(r); a.selectNumberingPlan(e, n); var i = new RegExp(a.IDDPrefix()); if (t.search(i) === 0) { t = t.slice(t.match(i)[0].length); var o = t.match(Pu); if (!(o && o[1] != null && o[1].length > 0 && o[1] === "0")) return t; } } } function sr(t, e) { if (t && e.numberingPlan.nationalPrefixForParsing()) { var n = new RegExp("^(?:" + e.numberingPlan.nationalPrefixForParsing() + ")"), r = n.exec(t); if (r) { var a, i, o = r.length - 1, s = o > 0 && r[o]; if (e.nationalPrefixTransformRule() && s) a = t.replace(n, e.nationalPrefixTransformRule()), o > 1 && (i = r[1]); else { var l = r[0]; a = t.slice(l.length), s && (i = r[1]); } var d; if (s) { var c = t.indexOf(r[1]), f = t.slice(0, c); f === e.numberingPlan.nationalPrefix() && (d = e.numberingPlan.nationalPrefix()); } else d = r[0]; return { nationalNumber: a, nationalPrefix: d, carrierCode: i }; } } return { nationalNumber: t }; } function lr(t, e) { var n = sr(t, e), r = n.carrierCode, a = n.nationalNumber; if (a !== t) { if (!wu(t, a, e)) return { nationalNumber: t }; if (e.possibleLengths() && !Lu(a, e)) return { nationalNumber: t }; } return { nationalNumber: a, carrierCode: r }; } function wu(t, e, n) { return !(Xe(t, n.nationalNumberPattern()) && !Xe(e, n.nationalNumberPattern())); } function Lu(t, e) { switch (Cn(t, e)) { case "TOO_SHORT": case "INVALID_LENGTH": return !1; default: return !0; } } function oo(t, e, n, r) { var a = e ? Ar(e, r) : n; if (t.indexOf(a) === 0) { r = new Se(r), r.selectNumberingPlan(e, n); var i = t.slice(a.length), o = lr(i, r), s = o.nationalNumber, l = lr(t, r), d = l.nationalNumber; if (!Xe(d, r.nationalNumberPattern()) && Xe(s, r.nationalNumberPattern()) || Cn(d, r) === "TOO_LONG") return { countryCallingCode: a, number: i }; } return { number: t }; } function so(t, e, n, r) { if (!t) return {}; var a; if (t[0] !== "+") { var i = io(t, e, n, r); if (i && i !== t) a = !0, t = "+" + i; else { if (e || n) { var o = oo(t, e, n, r), s = o.countryCallingCode, l = o.number; if (s) return { countryCallingCodeSource: "FROM_NUMBER_WITHOUT_PLUS_SIGN", countryCallingCode: s, number: l }; } return { // No need to set it to `UNSPECIFIED`. It can be just `undefined`. // countryCallingCodeSource: 'UNSPECIFIED', number: t }; } } if (t[1] === "0") return {}; r = new Se(r); for (var d = 2; d - 1 <= wc && d <= t.length; ) { var c = t.slice(1, d); if (r.hasCallingCode(c)) return r.selectNumberingPlan(c), { countryCallingCodeSource: a ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN", countryCallingCode: c, number: t.slice(d) }; d++; } return {}; } function xu(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = Fu(t)) || e && t && typeof t.length == "number") { n && (t = n); var r = 0; return function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }; } 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 Fu(t, e) { if (t) { if (typeof t == "string") return Ra(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ra(t, e); } } function Ra(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } function lo(t, e) { var n = e.countries, r = e.defaultCountry, a = e.metadata; a = new Se(a); for (var i = [], o = xu(n), s; !(s = o()).done; ) { var l = s.value; if (a.country(l), a.leadingDigits()) { if (t && t.search(a.leadingDigits()) === 0) return l; } else if (Ir({ phone: t, country: l }, void 0, a.metadata)) if (r) { if (l === r) return l; i.push(l); } else return l; } if (i.length > 0) return i[0]; } var Mu = !1; function co(t, e) { var n = e.nationalNumber, r = e.defaultCountry, a = e.metadata; if (Mu && a.isNonGeographicCallingCode(t)) return "001"; var i = a.getCountryCodesForCallingCode(t); if (i) return i.length === 1 ? i[0] : lo(n, { countries: i, defaultCountry: r, metadata: a.metadata }); } var uo = "+", ku = "[\\-\\.\\(\\)]?", Da = "([" + Ie + "]|" + ku + ")", Bu = "^\\" + uo + Da + "*[" + Ie + "]" + Da + "*$", Uu = new RegExp(Bu, "g"), dr = Ie, Hu = "[" + dr + "]+((\\-)*[" + dr + "])*", Wu = "a-zA-Z", Vu = "[" + Wu + "]+((\\-)*[" + dr + "])*", Gu = "^(" + Hu + "\\.)*" + Vu + "\\.?$", Ku = new RegExp(Gu, "g"), Pa = "tel:", cr = ";phone-context=", ju = ";isub="; function Yu(t) { var e = t.indexOf(cr); if (e < 0) return null; var n = e + cr.length; if (n >= t.length) return ""; var r = t.indexOf(";", n); return r >= 0 ? t.substring(n, r) : t.substring(n); } function zu(t) { return t === null ? !0 : t.length === 0 ? !1 : Uu.test(t) || Ku.test(t); } function Xu(t, e) { var n = e.extractFormattedPhoneNumber, r = Yu(t); if (!zu(r)) throw new Ye("NOT_A_NUMBER"); var a; if (r === null) a = n(t) || ""; else { a = "", r.charAt(0) === uo && (a += r); var i = t.indexOf(Pa), o; i >= 0 ? o = i + Pa.length : o = 0; var s = t.indexOf(cr); a += t.substring(o, s); } var l = a.indexOf(ju); if (l > 0 && (a = a.substring(0, l)), a !== "") return a; } var qu = 250, Zu = new RegExp("[" + yn + Ie + "]"), Ju = new RegExp("[^" + Ie + "#]+$"); function fo(t, e, n) { if (e = e || {}, n = new Se(n), e.defaultCountry && !n.hasCountry(e.defaultCountry)) throw e.v2 ? new Ye("INVALID_COUNTRY") : new Error("Unknown country: ".concat(e.defaultCountry)); var r = ef(t, e.v2, e.extract), a = r.number, i = r.ext, o = r.error; if (!a) { if (e.v2) throw o === "TOO_SHORT" ? new Ye("TOO_SHORT") : new Ye("NOT_A_NUMBER"); return {}; } var s = nf(a, e.defaultCountry, e.defaultCallingCode, n), l = s.country, d = s.nationalNumber, c = s.countryCallingCode, f = s.countryCallingCodeSource, h = s.carrierCode; if (!n.hasSelectedNumberingPlan()) { if (e.v2) throw new Ye("INVALID_COUNTRY"); return {}; } if (!d || d.length < Or) { if (e.v2) throw new Ye("TOO_SHORT"); return {}; } if (d.length > Pc) { if (e.v2) throw new Ye("TOO_LONG"); return {}; } if (e.v2) { var p = new ao(c, d, n.metadata); return l && (p.country = l), h && (p.carrierCode = h), i && (p.ext = i), p.__countryCallingCodeSource = f, p; } var m = (e.extended ? n.hasSelectedNumberingPlan() : l) ? Xe(d, n.nationalNumberPattern()) : !1; return e.extended ? { country: l, countryCallingCode: c, carrierCode: h, valid: m, possible: m ? !0 : !!(e.extended === !0 && n.possibleLengths() && Qi(d, n)), phone: d, ext: i } : m ? tf(l, d, i) : {}; } function Qu(t, e, n) { if (t) { if (t.length > qu) { if (n) throw new Ye("TOO_LONG"); return; } if (e === !1) return t; var r = t.search(Zu); if (!(r < 0)) return t.slice(r).replace(Ju, ""); } } function ef(t, e, n) { var r = Xu(t, { extractFormattedPhoneNumber: function(o) { return Qu(o, n, e); } }); if (!r) return {}; if (!qi(r)) return tu(r) ? { error: "TOO_SHORT" } : {}; var a = nu(r); return a.ext ? a : { number: r }; } function tf(t, e, n) { var r = { country: t, phone: e }; return n && (r.ext = n), r; } function nf(t, e, n, r) { var a = so(va(t), e, n, r.metadata), i = a.countryCallingCodeSource, o = a.countryCallingCode, s = a.number, l; if (o) r.selectNumberingPlan(o); else if (s && (e || n)) r.selectNumberingPlan(e, n), e && (l = e), o = n || Ar(e, r.metadata); else return {}; if (!s) return { countryCallingCodeSource: i, countryCallingCode: o }; var d = lr(va(s), r), c = d.nationalNumber, f = d.carrierCode, h = co(o, { nationalNumber: c, defaultCountry: e, metadata: r }); return h && (l = h, h === "001" || r.country(l)), { country: l, countryCallingCode: o, countryCallingCodeSource: i, nationalNumber: c, carrierCode: f }; } function wa(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter(function(a) { return Object.getOwnPropertyDescriptor(t, a).enumerable; })), n.push.apply(n, r); } return n; } function La(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e] != null ? arguments[e] : {}; e % 2 ? wa(Object(n), !0).forEach(function(r) { rf(t, r, n[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : wa(Object(n)).forEach(function(r) { Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r)); }); } return t; } function rf(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } function ho(t, e, n) { return fo(t, La(La({}, e), {}, { v2: !0 }), n); } function ur(t) { "@babel/helpers - typeof"; return ur = 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; }, ur(t); } function xa(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter(function(a) { return Object.getOwnPropertyDescriptor(t, a).enumerable; })), n.push.apply(n, r); } return n; } function af(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e] != null ? arguments[e] : {}; e % 2 ? xa(Object(n), !0).forEach(function(r) { of(t, r, n[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : xa(Object(n)).forEach(function(r) { Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r)); }); } return t; } function of(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } function sf(t, e) { return uf(t) || cf(t, e) || df(t, e) || lf(); } function lf() { 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 df(t, e) { if (t) { if (typeof t == "string") return Fa(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Fa(t, e); } } function Fa(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } function cf(t, e) { var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n != null) { var r = [], a = !0, i = !1, o, s; try { for (n = n.call(t); !(a = (o = n.next()).done) && (r.push(o.value), !(e && r.length === e)); a = !0) ; } catch (l) { i = !0, s = l; } finally { try { !a && n.return != null && n.return(); } finally { if (i) throw s; } } return r; } } function uf(t) { if (Array.isArray(t)) return t; } function Rr(t) { var e = Array.prototype.slice.call(t), n = sf(e, 4), r = n[0], a = n[1], i = n[2], o = n[3], s, l, d; if (typeof r == "string") s = r; else throw new TypeError("A text for parsing must be a string."); if (!a || typeof a == "string") o ? (l = i, d = o) : (l = void 0, d = i), a && (l = af({ defaultCountry: a }, l)); else if (ff(a)) i ? (l = a, d = i) : d = a; else throw new Error("Invalid second argument: ".concat(a)); return { text: s, options: l, metadata: d }; } var ff = function(e) { return ur(e) === "object"; }; function hf() { var t = Rr(arguments), e = t.text, n = t.options, r = t.metadata; return ho(e, n, r); } function Ma(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter(function(a) { return Object.getOwnPropertyDescriptor(t, a).enumerable; })), n.push.apply(n, r); } return n; } function ka(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e] != null ? arguments[e] : {}; e % 2 ? Ma(Object(n), !0).forEach(function(r) { pf(t, r, n[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Ma(Object(n)).forEach(function(r) { Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r)); }); } return t; } function pf(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } function po(t, e, n) { e && e.defaultCountry && !zc(e.defaultCountry, n) && (e = ka(ka({}, e), {}, { defaultCountry: void 0 })); try { return ho(t, e, n); } catch (r) { if (!(r instanceof Ye)) throw r; } } function Ba(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter(function(a) { return Object.getOwnPropertyDescriptor(t, a).enumerable; })), n.push.apply(n, r); } return n; } function Ua(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e] != null ? arguments[e] : {}; e % 2 ? Ba(Object(n), !0).forEach(function(r) { mf(t, r, n[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Ba(Object(n)).forEach(function(r) { Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r)); }); } return t; } function mf(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } function $f() { var t = Rr(arguments), e = t.text, n = t.options, r = t.metadata; n = Ua(Ua({}, n), {}, { extract: !1 }); var a = po(e, n, r); return a && a.isValid() || !1; } function Ha(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter(function(a) { return Object.getOwnPropertyDescriptor(t, a).enumerable; })), n.push.apply(n, r); } return n; } function Wa(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e] != null ? arguments[e] : {}; e % 2 ? Ha(Object(n), !0).forEach(function(r) { _f(t, r, n[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Ha(Object(n)).forEach(function(r) { Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r)); }); } return t; } function _f(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } function gf() { var t = Rr(arguments), e = t.text, n = t.options, r = t.metadata; n = Wa(Wa({}, n), {}, { extract: !1 }); var a = po(e, n, r); return a && a.isPossible() || !1; } function Tf(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Va(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function vf(t, e, n) { return e && Va(t.prototype, e), n && Va(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } var yf = /* @__PURE__ */ function() { function t(e) { var n = e.onCountryChange, r = e.onCallingCodeChange; Tf(this, t), this.onCountryChange = n, this.onCallingCodeChange = r; } return vf(t, [{ key: "reset", value: function(n) { var r = n.country, a = n.callingCode; this.international = !1, this.missingPlus = !1, this.IDDPrefix = void 0, this.callingCode = void 0, this.digits = "", this.resetNationalSignificantNumber(), this.initCountryAndCallingCode(r, a); } }, { key: "resetNationalSignificantNumber", value: function() { this.nationalSignificantNumber = this.getNationalDigits(), this.nationalSignificantNumberMatchesInput = !0, this.nationalPrefix = void 0, this.carrierCode = void 0, this.complexPrefixBeforeNationalSignificantNumber = void 0; } }, { key: "update", value: function(n) { for (var r = 0, a = Object.keys(n); r < a.length; r++) { var i = a[r]; this[i] = n[i]; } } }, { key: "initCountryAndCallingCode", value: function(n, r) { this.setCountry(n), this.setCallingCode(r); } }, { key: "setCountry", value: function(n) { this.country = n, this.onCountryChange(n); } }, { key: "setCallingCode", value: function(n) { this.callingCode = n, this.onCallingCodeChange(n, this.country); } }, { key: "startInternationalNumber", value: function(n, r) { this.international = !0, this.initCountryAndCallingCode(n, r); } }, { key: "appendDigits", value: function(n) { this.digits += n; } }, { key: "appendNationalSignificantNumberDigits", value: function(n) { this.nationalSignificantNumber += n; } /** * Returns the part of `this.digits` that corresponds to the national number. * Basically, all digits that have been input by the user, except for the * international prefix and the country calling code part * (if the number is an international one). * @return {string} */ }, { key: "getNationalDigits", value: function() { return this.international ? this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0)) : this.digits; } }, { key: "getDigitsWithoutInternationalPrefix", value: function() { return this.international && this.IDDPrefix ? this.digits.slice(this.IDDPrefix.length) : this.digits; } }]), t; }(); function Ef(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = bf(t)) || e && t && typeof t.length == "number") { n && (t = n); var r = 0; return function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }; } 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 bf(t, e) { if (t) { if (typeof t == "string") return Ga(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ga(t, e); } } function Ga(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } var Me = "x", Wn = new RegExp(Me); function rn(t, e) { if (e < 1) return ""; for (var n = ""; e > 1; ) e & 1 && (n += t), e >>= 1, t += t; return n + t; } function Ka(t, e) { return t[e] === ")" && e++, Cf(t.slice(0, e)); } function Cf(t) { for (var e = [], n = 0; n < t.length; ) t[n] === "(" ? e.push(n) : t[n] === ")" && e.pop(), n++; var r = 0, a = ""; e.push(t.length); for (var i = 0, o = e; i < o.length; i++) { var s = o[i]; a += t.slice(r, s), r = s + 1; } return a; } function Nf(t, e, n) { for (var r = Ef(n.split("")), a; !(a = r()).done; ) { var i = a.value; if (t.slice(e + 1).search(Wn) < 0) return; e = t.search(Wn), t = t.replace(Wn, i); } return [t, e]; } function Sf(t, e, n) { var r = n.metadata, a = n.shouldTryNationalPrefixFormattingRule, i = n.getSeparatorAfterNationalPrefix, o = new RegExp("^(?:".concat(e.pattern(), ")$")); if (o.test(t.nationalSignificantNumber)) return Af(t, e, { metadata: r, shouldTryNationalPrefixFormattingRule: a, getSeparatorAfterNationalPrefix: i }); } function Of(t, e) { return Cn(t, e) === "IS_POSSIBLE"; } function Af(t, e, n) { var r = n.metadata, a = n.shouldTryNationalPrefixFormattingRule, i = n.getSeparatorAfterNationalPrefix; if (t.nationalSignificantNumber, t.international, t.nationalPrefix, t.carrierCode, a(e)) { var o = ja(t, e, { useNationalPrefixFormattingRule: !0, getSeparatorAfterNationalPrefix: i, metadata: r }); if (o) return o; } return ja(t, e, { useNationalPrefixFormattingRule: !1, getSeparatorAfterNationalPrefix: i, metadata: r }); } function ja(t, e, n) { var r = n.metadata, a = n.useNationalPrefixFormattingRule, i = n.getSeparatorAfterNationalPrefix, o = ro(t.nationalSignificantNumber, e, { carrierCode: t.carrierCode, useInternationalFormat: t.international, withNationalPrefix: a, metadata: r }); if (a || (t.nationalPrefix ? o = t.nationalPrefix + i(e) + o : t.complexPrefixBeforeNationalSignificantNumber && (o = t.complexPrefixBeforeNationalSignificantNumber + " " + o)), If(o, t)) return o; } function If(t, e) { return hn(t) === e.getNationalDigits(); } function Rf(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Ya(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function Df(t, e, n) { return e && Ya(t.prototype, e), n && Ya(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } var Pf = /* @__PURE__ */ function() { function t() { Rf(this, t); } return Df(t, [{ key: "parse", value: function(n) { if (this.context = [{ or: !0, instructions: [] }], this.parsePattern(n), this.context.length !== 1) throw new Error("Non-finalized contexts left when pattern parse ended"); var r = this.context[0], a = r.branches, i = r.instructions; if (a) return { op: "|", args: a.concat([Vn(i)]) }; if (i.length === 0) throw new Error("Pattern is required"); return i.length === 1 ? i[0] : i; } }, { key: "startContext", value: function(n) { this.context.push(n); } }, { key: "endContext", value: function() { this.context.pop(); } }, { key: "getContext", value: function() { return this.context[this.context.length - 1]; } }, { key: "parsePattern", value: function(n) { if (!n) throw new Error("Pattern is required"); var r = n.match(xf); if (!r) { if (Lf.test(n)) throw new Error("Illegal characters found in a pattern: ".concat(n)); this.getContext().instructions = this.getContext().instructions.concat(n.split("")); return; } var a = r[1], i = n.slice(0, r.index), o = n.slice(r.index + a.length); switch (a) { case "(?:": i && this.parsePattern(i), this.startContext({ or: !0, instructions: [], branches: [] }); break; case ")": if (!this.getContext().or) throw new Error('")" operator must be preceded by "(?:" operator'); if (i && this.parsePattern(i), this.getContext().instructions.length === 0) throw new Error('No instructions found after "|" operator in an "or" group'); var s = this.getContext(), l = s.branches; l.push(Vn(this.getContext().instructions)), this.endContext(), this.getContext().instructions.push({ op: "|", args: l }); break; case "|": if (!this.getContext().or) throw new Error('"|" operator can only be used inside "or" groups'); if (i && this.parsePattern(i), !this.getContext().branches) if (this.context.length === 1) this.getContext().branches = []; else throw new Error('"branches" not found in an "or" group context'); this.getContext().branches.push(Vn(this.getContext().instructions)), this.getContext().instructions = []; break; case "[": i && this.parsePattern(i), this.startContext({ oneOfSet: !0 }); break; case "]": if (!this.getContext().oneOfSet) throw new Error('"]" operator must be preceded by "[" operator'); this.endContext(), this.getContext().instructions.push({ op: "[]", args: wf(i) }); break; default: throw new Error("Unknown operator: ".concat(a)); } o && this.parsePattern(o); } }]), t; }(); function wf(t) { for (var e = [], n = 0; n < t.length; ) { if (t[n] === "-") { if (n === 0 || n === t.length - 1) throw new Error("Couldn't parse a one-of set pattern: ".concat(t)); for (var r = t[n - 1].charCodeAt(0) + 1, a = t[n + 1].charCodeAt(0) - 1, i = r; i <= a; ) e.push(String.fromCharCode(i)), i++; } else e.push(t[n]); n++; } return e; } var Lf = /[\(\)\[\]\?\:\|]/, xf = new RegExp( // any of: "(\\||\\(\\?\\:|\\)|\\[|\\])" ); function Vn(t) { return t.length === 1 ? t[0] : t; } function za(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = Ff(t)) || e && t && typeof t.length == "number") { n && (t = n); var r = 0; return function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }; } 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 Ff(t, e) { if (t) { if (typeof t == "string") return Xa(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Xa(t, e); } } function Xa(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } function Mf(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function qa(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function kf(t, e, n) { return e && qa(t.prototype, e), n && qa(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } var Bf = /* @__PURE__ */ function() { function t(e) { Mf(this, t), this.matchTree = new Pf().parse(e); } return kf(t, [{ key: "match", value: function(n) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = r.allowOverflow; if (!n) throw new Error("String is required"); var i = fr(n.split(""), this.matchTree, !0); if (i && i.match && delete i.matchedChars, !(i && i.overflow && !a)) return i; } }]), t; }(); function fr(t, e, n) { if (typeof e == "string") { var r = t.join(""); return e.indexOf(r) === 0 ? t.length === e.length ? { match: !0, matchedChars: t } : { partialMatch: !0 // matchedChars: characters } : r.indexOf(e) === 0 ? n && t.length > e.length ? { overflow: !0 } : { match: !0, matchedChars: t.slice(0, e.length) } : void 0; } if (Array.isArray(e)) { for (var a = t.slice(), i = 0; i < e.length; ) { var o = e[i], s = fr(a, o, n && i === e.length - 1); if (s) { if (s.overflow) return s; if (s.match) { if (a = a.slice(s.matchedChars.length), a.length === 0) return i === e.length - 1 ? { match: !0, matchedChars: t } : { partialMatch: !0 // matchedChars: characters }; } else { if (s.partialMatch) return { partialMatch: !0 // matchedChars: characters }; throw new Error(`Unsupported match result: `.concat(JSON.stringify(s, null, 2))); } } else return; i++; } return n ? { overflow: !0 } : { match: !0, matchedChars: t.slice(0, t.length - a.length) }; } switch (e.op) { case "|": for (var l, d = za(e.args), c; !(c = d()).done; ) { var f = c.value, h = fr(t, f, n); if (h) { if (h.overflow) return h; if (h.match) return { match: !0, matchedChars: h.matchedChars }; if (h.partialMatch) l = !0; else throw new Error(`Unsupported match result: `.concat(JSON.stringify(h, null, 2))); } } return l ? { partialMatch: !0 // matchedChars: ... } : void 0; case "[]": for (var p = za(e.args), m; !(m = p()).done; ) { var _ = m.value; if (t[0] === _) return t.length === 1 ? { match: !0, matchedChars: t } : n ? { overflow: !0 } : { match: !0, matchedChars: [_] }; } return; default: throw new Error("Unsupported instruction tree: ".concat(e)); } } function Za(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = Uf(t)) || e && t && typeof t.length == "number") { n && (t = n); var r = 0; return function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }; } 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 Uf(t, e) { if (t) { if (typeof t == "string") return Ja(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ja(t, e); } } function Ja(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } function Hf(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Qa(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function Wf(t, e, n) { return e && Qa(t.prototype, e), n && Qa(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } var hr = "9", Vf = 15, Gf = rn(hr, Vf), Kf = /[- ]/, jf = function() { return /\[([^\[\]])*\]/g; }, Yf = function() { return /\d(?=[^,}][^,}])/g; }, zf = new RegExp("[" + Ue + "]*\\$1[" + Ue + "]*(\\$\\d[" + Ue + "]*)*$"), ei = 3, Xf = /* @__PURE__ */ function() { function t(e) { e.state; var n = e.metadata; Hf(this, t), this.metadata = n, this.resetFormat(); } return Wf(t, [{ key: "resetFormat", value: function() { this.chosenFormat = void 0, this.template = void 0, this.nationalNumberTemplate = void 0, this.populatedNationalNumberTemplate = void 0, this.populatedNationalNumberTemplatePosition = -1; } }, { key: "reset", value: function(n, r) { this.resetFormat(), n ? (this.isNANP = n.callingCode() === "1", this.matchingFormats = n.formats(), r.nationalSignificantNumber && this.narrowDownMatchingFormats(r)) : (this.isNANP = void 0, this.matchingFormats = []); } /** * Formats an updated phone number. * @param {string} nextDigits — Additional phone number digits. * @param {object} state — `AsYouType` state. * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats. */ }, { key: "format", value: function(n, r) { var a = this; if (Of(r.nationalSignificantNumber, this.metadata)) for (var i = Za(this.matchingFormats), o; !(o = i()).done; ) { var s = o.value, l = Sf(r, s, { metadata: this.metadata, shouldTryNationalPrefixFormattingRule: function(c) { return a.shouldTryNationalPrefixFormattingRule(c, { international: r.international, nationalPrefix: r.nationalPrefix }); }, getSeparatorAfterNationalPrefix: function(c) { return a.getSeparatorAfterNationalPrefix(c); } }); if (l) return this.resetFormat(), this.chosenFormat = s, this.setNationalNumberTemplate(l.replace(/\d/g, Me), r), this.populatedNationalNumberTemplate = l, this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(Me), l; } return this.formatNationalNumberWithNextDigits(n, r); } // Formats the next phone number digits. }, { key: "formatNationalNumberWithNextDigits", value: function(n, r) { var a = this.chosenFormat, i = this.chooseFormat(r); if (i) return i === a ? this.formatNextNationalNumberDigits(n) : this.formatNextNationalNumberDigits(r.getNationalDigits()); } }, { key: "narrowDownMatchingFormats", value: function(n) { var r = this, a = n.nationalSignificantNumber, i = n.nationalPrefix, o = n.international, s = a, l = s.length - ei; l < 0 && (l = 0), this.matchingFormats = this.matchingFormats.filter(function(d) { return r.formatSuits(d, o, i) && r.formatMatches(d, s, l); }), this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1 && this.resetFormat(); } }, { key: "formatSuits", value: function(n, r, a) { return !(a && !n.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() && !n.nationalPrefixIsOptionalWhenFormattingInNationalFormat() || !r && !a && n.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()); } }, { key: "formatMatches", value: function(n, r, a) { var i = n.leadingDigitsPatterns().length; if (i === 0) return !0; a = Math.min(a, i - 1); var o = n.leadingDigitsPatterns()[a]; if (r.length < ei) try { return new Bf(o).match(r, { allowOverflow: !0 }) !== void 0; } catch (s) { return console.error(s), !0; } return new RegExp("^(".concat(o, ")")).test(r); } }, { key: "getFormatFormat", value: function(n, r) { return r ? n.internationalFormat() : n.format(); } }, { key: "chooseFormat", value: function(n) { for (var r = this, a = function() { var d = o.value; return r.chosenFormat === d ? "break" : zf.test(r.getFormatFormat(d, n.international)) ? r.createTemplateForFormat(d, n) ? (r.chosenFormat = d, "break") : (r.matchingFormats = r.matchingFormats.filter(function(c) { return c !== d; }), "continue") : "continue"; }, i = Za(this.matchingFormats.slice()), o; !(o = i()).done; ) { var s = a(); if (s === "break") break; } return this.chosenFormat || this.resetFormat(), this.chosenFormat; } }, { key: "createTemplateForFormat", value: function(n, r) { if (!(n.pattern().indexOf("|") >= 0)) { var a = this.getTemplateForFormat(n, r); if (a) return this.setNationalNumberTemplate(a, r), !0; } } }, { key: "getSeparatorAfterNationalPrefix", value: function(n) { return this.isNANP || n && n.nationalPrefixFormattingRule() && Kf.test(n.nationalPrefixFormattingRule()) ? " " : ""; } }, { key: "getInternationalPrefixBeforeCountryCallingCode", value: function(n, r) { var a = n.IDDPrefix, i = n.missingPlus; return a ? r && r.spacing === !1 ? a : a + " " : i ? "" : "+"; } }, { key: "getTemplate", value: function(n) { if (this.template) { for (var r = -1, a = 0, i = n.international ? this.getInternationalPrefixBeforeCountryCallingCode(n, { spacing: !1 }) : ""; a < i.length + n.getDigitsWithoutInternationalPrefix().length; ) r = this.template.indexOf(Me, r + 1), a++; return Ka(this.template, r + 1); } } }, { key: "setNationalNumberTemplate", value: function(n, r) { this.nationalNumberTemplate = n, this.populatedNationalNumberTemplate = n, this.populatedNationalNumberTemplatePosition = -1, r.international ? this.template = this.getInternationalPrefixBeforeCountryCallingCode(r).replace(/[\d\+]/g, Me) + rn(Me, r.callingCode.length) + " " + n : this.template = n; } /** * Generates formatting template for a national phone number, * optionally containing a national prefix, for a format. * @param {Format} format * @param {string} nationalPrefix * @return {string} */ }, { key: "getTemplateForFormat", value: function(n, r) { var a = r.nationalSignificantNumber, i = r.international, o = r.nationalPrefix, s = r.complexPrefixBeforeNationalSignificantNumber, l = n.pattern(); l = l.replace(jf(), "\\d").replace(Yf(), "\\d"); var d = Gf.match(l)[0]; if (!(a.length > d.length)) { var c = new RegExp("^" + l + "$"), f = a.replace(/\d/g, hr); c.test(f) && (d = f); var h = this.getFormatFormat(n, i), p; if (this.shouldTryNationalPrefixFormattingRule(n, { international: i, nationalPrefix: o })) { var m = h.replace(no, n.nationalPrefixFormattingRule()); if (hn(n.nationalPrefixFormattingRule()) === (o || "") + hn("$1") && (h = m, p = !0, o)) for (var _ = o.length; _ > 0; ) h = h.replace(/\d/, Me), _--; } var g = d.replace(new RegExp(l), h).replace(new RegExp(hr, "g"), Me); return p || (s ? g = rn(Me, s.length) + " " + g : o && (g = rn(Me, o.length) + this.getSeparatorAfterNationalPrefix(n) + g)), i && (g = to(g)), g; } } }, { key: "formatNextNationalNumberDigits", value: function(n) { var r = Nf(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, n); if (!r) { this.resetFormat(); return; } return this.populatedNationalNumberTemplate = r[0], this.populatedNationalNumberTemplatePosition = r[1], Ka(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1); } }, { key: "shouldTryNationalPrefixFormattingRule", value: function(n, r) { var a = r.international, i = r.nationalPrefix; if (n.nationalPrefixFormattingRule()) { var o = n.usesNationalPrefix(); if (o && i || !o && !a) return !0; } } }]), t; }(); function mo(t, e) { return Qf(t) || Jf(t, e) || Zf(t, e) || qf(); } function qf() { 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 Zf(t, e) { if (t) { if (typeof t == "string") return ti(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ti(t, e); } } function ti(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } function Jf(t, e) { var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n != null) { var r = [], a = !0, i = !1, o, s; try { for (n = n.call(t); !(a = (o = n.next()).done) && (r.push(o.value), !(e && r.length === e)); a = !0) ; } catch (l) { i = !0, s = l; } finally { try { !a && n.return != null && n.return(); } finally { if (i) throw s; } } return r; } } function Qf(t) { if (Array.isArray(t)) return t; } function e0(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function ni(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function t0(t, e, n) { return e && ni(t.prototype, e), n && ni(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } var n0 = "[" + Ue + Ie + "]+", r0 = new RegExp("^" + n0 + "$", "i"), a0 = "(?:[" + yn + "][" + Ue + Ie + "]*|[" + Ue + Ie + "]+)", i0 = new RegExp("[^" + Ue + Ie + "]+.*$"), o0 = /[^\d\[\]]/, s0 = /* @__PURE__ */ function() { function t(e) { var n = e.defaultCountry, r = e.defaultCallingCode, a = e.metadata, i = e.onNationalSignificantNumberChange; e0(this, t), this.defaultCountry = n, this.defaultCallingCode = r, this.metadata = a, this.onNationalSignificantNumberChange = i; } return t0(t, [{ key: "input", value: function(n, r) { var a = c0(n), i = mo(a, 2), o = i[0], s = i[1], l = hn(o), d; return s && (r.digits || (r.startInternationalNumber(), l || (d = !0))), l && this.inputDigits(l, r), { digits: l, justLeadingPlus: d }; } /** * Inputs "next" phone number digits. * @param {string} digits * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage". */ }, { key: "inputDigits", value: function(n, r) { var a = r.digits, i = a.length < 3 && a.length + n.length >= 3; if (r.appendDigits(n), i && this.extractIddPrefix(r), this.isWaitingForCountryCallingCode(r)) { if (!this.extractCountryCallingCode(r)) return; } else r.appendNationalSignificantNumberDigits(n); r.international || this.hasExtractedNationalSignificantNumber || this.extractNationalSignificantNumber(r.getNationalDigits(), function(o) { return r.update(o); }); } }, { key: "isWaitingForCountryCallingCode", value: function(n) { var r = n.international, a = n.callingCode; return r && !a; } // Extracts a country calling code from a number // being entered in internatonal format. }, { key: "extractCountryCallingCode", value: function(n) { var r = so("+" + n.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), a = r.countryCallingCode, i = r.number; if (a) return n.setCallingCode(a), n.update({ nationalSignificantNumber: i }), !0; } }, { key: "reset", value: function(n) { if (n) { this.hasSelectedNumberingPlan = !0; var r = n._nationalPrefixForParsing(); this.couldPossiblyExtractAnotherNationalSignificantNumber = r && o0.test(r); } else this.hasSelectedNumberingPlan = void 0, this.couldPossiblyExtractAnotherNationalSignificantNumber = void 0; } /** * Extracts a national (significant) number from user input. * Google's library is different in that it only applies `national_prefix_for_parsing` * and doesn't apply `national_prefix_transform_rule` after that. * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539 * @return {boolean} [extracted] */ }, { key: "extractNationalSignificantNumber", value: function(n, r) { if (this.hasSelectedNumberingPlan) { var a = sr(n, this.metadata), i = a.nationalPrefix, o = a.nationalNumber, s = a.carrierCode; if (o !== n) return this.onExtractedNationalNumber(i, s, o, n, r), !0; } } /** * In Google's code this function is called "attempt to extract longer NDD". * "Some national prefixes are a substring of others", they say. * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were. */ }, { key: "extractAnotherNationalSignificantNumber", value: function(n, r, a) { if (!this.hasExtractedNationalSignificantNumber) return this.extractNationalSignificantNumber(n, a); if (this.couldPossiblyExtractAnotherNationalSignificantNumber) { var i = sr(n, this.metadata), o = i.nationalPrefix, s = i.nationalNumber, l = i.carrierCode; if (s !== r) return this.onExtractedNationalNumber(o, l, s, n, a), !0; } } }, { key: "onExtractedNationalNumber", value: function(n, r, a, i, o) { var s, l, d = i.lastIndexOf(a); if (d >= 0 && d === i.length - a.length) { l = !0; var c = i.slice(0, d); c !== n && (s = c); } o({ nationalPrefix: n, carrierCode: r, nationalSignificantNumber: a, nationalSignificantNumberMatchesInput: l, complexPrefixBeforeNationalSignificantNumber: s }), this.hasExtractedNationalSignificantNumber = !0, this.onNationalSignificantNumberChange(); } }, { key: "reExtractNationalSignificantNumber", value: function(n) { if (this.extractAnotherNationalSignificantNumber(n.getNationalDigits(), n.nationalSignificantNumber, function(r) { return n.update(r); })) return !0; if (this.extractIddPrefix(n)) return this.extractCallingCodeAndNationalSignificantNumber(n), !0; if (this.fixMissingPlus(n)) return this.extractCallingCodeAndNationalSignificantNumber(n), !0; } }, { key: "extractIddPrefix", value: function(n) { var r = n.international, a = n.IDDPrefix, i = n.digits; if (n.nationalSignificantNumber, !(r || a)) { var o = io(i, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata); if (o !== void 0 && o !== i) return n.update({ IDDPrefix: i.slice(0, i.length - o.length) }), this.startInternationalNumber(n, { country: void 0, callingCode: void 0 }), !0; } } }, { key: "fixMissingPlus", value: function(n) { if (!n.international) { var r = oo(n.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), a = r.countryCallingCode; if (r.number, a) return n.update({ missingPlus: !0 }), this.startInternationalNumber(n, { country: n.country, callingCode: a }), !0; } } }, { key: "startInternationalNumber", value: function(n, r) { var a = r.country, i = r.callingCode; n.startInternationalNumber(a, i), n.nationalSignificantNumber && (n.resetNationalSignificantNumber(), this.onNationalSignificantNumberChange(), this.hasExtractedNationalSignificantNumber = void 0); } }, { key: "extractCallingCodeAndNationalSignificantNumber", value: function(n) { this.extractCountryCallingCode(n) && this.extractNationalSignificantNumber(n.getNationalDigits(), function(r) { return n.update(r); }); } }]), t; }(); function l0(t) { var e = t.search(a0); if (!(e < 0)) { t = t.slice(e); var n; return t[0] === "+" && (n = !0, t = t.slice(1)), t = t.replace(i0, ""), n && (t = "+" + t), t; } } function d0(t) { var e = l0(t) || ""; return e[0] === "+" ? [e.slice(1), !0] : [e]; } function c0(t) { var e = d0(t), n = mo(e, 2), r = n[0], a = n[1]; return r0.test(r) || (r = ""), [r, a]; } function pr(t) { "@babel/helpers - typeof"; return pr = 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; }, pr(t); } function u0(t, e) { return m0(t) || p0(t, e) || h0(t, e) || f0(); } function f0() { 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 h0(t, e) { if (t) { if (typeof t == "string") return ri(t, e); var n = Object.prototype.toString.call(t).slice(8, -1); if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ri(t, e); } } function ri(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n]; return r; } function p0(t, e) { var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n != null) { var r = [], a = !0, i = !1, o, s; try { for (n = n.call(t); !(a = (o = n.next()).done) && (r.push(o.value), !(e && r.length === e)); a = !0) ; } catch (l) { i = !0, s = l; } finally { try { !a && n.return != null && n.return(); } finally { if (i) throw s; } } return r; } } function m0(t) { if (Array.isArray(t)) return t; } function $0(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function ai(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } function _0(t, e, n) { return e && ai(t.prototype, e), n && ai(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t; } var $o = /* @__PURE__ */ function() { function t(e, n) { $0(this, t), this.metadata = new Se(n); var r = this.getCountryAndCallingCode(e), a = u0(r, 2), i = a[0], o = a[1]; this.defaultCountry = i, this.defaultCallingCode = o, this.reset(); } return _0(t, [{ key: "getCountryAndCallingCode", value: function(n) { var r, a; return n && (pr(n) === "object" ? (r = n.defaultCountry, a = n.defaultCallingCode) : r = n), r && !this.metadata.hasCountry(r) && (r = void 0), [r, a]; } /** * Inputs "next" phone number characters. * @param {string} text * @return {string} Formatted phone number characters that have been input so far. */ }, { key: "input", value: function(n) { var r = this.parser.input(n, this.state), a = r.digits, i = r.justLeadingPlus; if (i) this.formattedOutput = "+"; else if (a) { this.determineTheCountryIfNeeded(), this.state.nationalSignificantNumber && this.formatter.narrowDownMatchingFormats(this.state); var o; if (this.metadata.hasSelectedNumberingPlan() && (o = this.formatter.format(a, this.state)), o === void 0 && this.parser.reExtractNationalSignificantNumber(this.state)) { this.determineTheCountryIfNeeded(); var s = this.state.getNationalDigits(); s && (o = this.formatter.format(s, this.state)); } this.formattedOutput = o ? this.getFullNumber(o) : this.getNonFormattedNumber(); } return this.formattedOutput; } }, { key: "reset", value: function() { var n = this; return this.state = new yf({ onCountryChange: function(a) { n.country = a; }, onCallingCodeChange: function(a, i) { n.metadata.selectNumberingPlan(i, a), n.formatter.reset(n.metadata.numberingPlan, n.state), n.parser.reset(n.metadata.numberingPlan); } }), this.formatter = new Xf({ state: this.state, metadata: this.metadata }), this.parser = new s0({ defaultCountry: this.defaultCountry, defaultCallingCode: this.defaultCallingCode, metadata: this.metadata, state: this.state, onNationalSignificantNumberChange: function() { n.determineTheCountryIfNeeded(), n.formatter.reset(n.metadata.numberingPlan, n.state); } }), this.state.reset({ country: this.defaultCountry, callingCode: this.defaultCallingCode }), this.formattedOutput = "", this; } /** * Returns `true` if the phone number is being input in international format. * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`. * @return {boolean} */ }, { key: "isInternational", value: function() { return this.state.international; } /** * Returns the "calling code" part of the phone number when it's being input * in an international format. * If no valid calling code has been entered so far, returns `undefined`. * @return {string} [callingCode] */ }, { key: "getCallingCode", value: function() { if (this.isInternational()) return this.state.callingCode; } // A legacy alias. }, { key: "getCountryCallingCode", value: function() { return this.getCallingCode(); } /** * Returns a two-letter country code of the phone number. * Returns `undefined` for "non-geographic" phone numbering plans. * Returns `undefined` if no phone number has been input yet. * @return {string} [country] */ }, { key: "getCountry", value: function() { var n = this.state.digits; if (n) return this._getCountry(); } /** * Returns a two-letter country code of the phone number. * Returns `undefined` for "non-geographic" phone numbering plans. * @return {string} [country] */ }, { key: "_getCountry", value: function() { var n = this.state.country; return n; } }, { key: "determineTheCountryIfNeeded", value: function() { (!this.state.country || this.isCountryCallingCodeAmbiguous()) && this.determineTheCountry(); } // Prepends `+CountryCode ` in case of an international phone number }, { key: "getFullNumber", value: function(n) { var r = this; if (this.isInternational()) { var a = function(s) { return r.formatter.getInternationalPrefixBeforeCountryCallingCode(r.state, { spacing: !!s }) + s; }, i = this.state.callingCode; return a(i ? n ? "".concat(i, " ").concat(n) : i : "".concat(this.state.getDigitsWithoutInternationalPrefix())); } return n; } }, { key: "getNonFormattedNationalNumberWithPrefix", value: function() { var n = this.state, r = n.nationalSignificantNumber, a = n.complexPrefixBeforeNationalSignificantNumber, i = n.nationalPrefix, o = r, s = a || i; return s && (o = s + o), o; } }, { key: "getNonFormattedNumber", value: function() { var n = this.state.nationalSignificantNumberMatchesInput; return this.getFullNumber(n ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits()); } }, { key: "getNonFormattedTemplate", value: function() { var n = this.getNonFormattedNumber(); if (n) return n.replace(/[\+\d]/g, Me); } }, { key: "isCountryCallingCodeAmbiguous", value: function() { var n = this.state.callingCode, r = this.metadata.getCountryCodesForCallingCode(n); return r && r.length > 1; } // Determines the country of the phone number // entered so far based on the country phone code // and the national phone number. }, { key: "determineTheCountry", value: function() { this.state.setCountry(co(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, { nationalNumber: this.state.nationalSignificantNumber, defaultCountry: this.defaultCountry, metadata: this.metadata })); } /** * Returns a E.164 phone number value for the user's input. * * For example, for country `"US"` and input `"(222) 333-4444"` * it will return `"+12223334444"`. * * For international phone number input, it will also auto-correct * some minor errors such as using a national prefix when writing * an international phone number. For example, if the user inputs * `"+44 0 7400 000000"` then it will return an auto-corrected * `"+447400000000"` phone number value. * * Will return `undefined` if no digits have been input, * or when inputting a phone number in national format and no * default country or default "country calling code" have been set. * * @return {string} [value] */ }, { key: "getNumberValue", value: function() { var n = this.state, r = n.digits, a = n.callingCode, i = n.country, o = n.nationalSignificantNumber; if (r) { if (this.isInternational()) return a ? "+" + a + o : "+" + r; if (i || a) { var s = i ? this.metadata.countryCallingCode() : a; return "+" + s + o; } } } /** * Returns an instance of `PhoneNumber` class. * Will return `undefined` if no national (significant) number * digits have been entered so far, or if no `defaultCountry` has been * set and the user enters a phone number not in international format. */ }, { key: "getNumber", value: function() { var n = this.state, r = n.nationalSignificantNumber, a = n.carrierCode, i = n.callingCode, o = this._getCountry(); if (r && !(!o && !i)) { if (o && o === this.defaultCountry) { var s = new Se(this.metadata.metadata); s.selectNumberingPlan(o); var l = s.numberingPlan.callingCode(), d = this.metadata.getCountryCodesForCallingCode(l); if (d.length > 1) { var c = lo(r, { countries: d, defaultCountry: this.defaultCountry, metadata: this.metadata.metadata }); c && (o = c); } } var f = new ao(o || i, r, this.metadata.metadata); return a && (f.carrierCode = a), f; } } /** * Returns `true` if the phone number is "possible". * Is just a shortcut for `PhoneNumber.isPossible()`. * @return {boolean} */ }, { key: "isPossible", value: function() { var n = this.getNumber(); return n ? n.isPossible() : !1; } /** * Returns `true` if the phone number is "valid". * Is just a shortcut for `PhoneNumber.isValid()`. * @return {boolean} */ }, { key: "isValid", value: function() { var n = this.getNumber(); return n ? n.isValid() : !1; } /** * @deprecated * This method is used in `react-phone-number-input/source/input-control.js` * in versions before `3.0.16`. */ }, { key: "getNationalNumber", value: function() { return this.state.nationalSignificantNumber; } /** * Returns the phone number characters entered by the user. * @return {string} */ }, { key: "getChars", value: function() { return (this.state.international ? "+" : "") + this.state.digits; } /** * Returns the template for the formatted phone number. * @return {string} */ }, { key: "getTemplate", value: function() { return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || ""; } }]), t; }(); function M1() { return vn(hf, arguments); } function k1() { return vn($f, arguments); } function B1() { return vn(gf, arguments); } function mn(t) { return $o.call(this, t, Ki); } mn.prototype = Object.create($o.prototype, {}); mn.prototype.constructor = mn; function g0(t, e, n, r) { return n = n || {}, t.country === e && eo(t, n, r); } function T0(t, e, n) { if (typeof t != "string") throw new TypeError("number must be a string"); if (typeof e != "string") throw new TypeError("country must be a string"); var r; return qi(t) ? r = fo(t, { defaultCountry: e }, n) : r = {}, g0(r, e, void 0, n); } function U1() { return vn(T0, arguments); } const v0 = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef( ({ id: t = "FDSPhoneTextFieldComponent", country: e = "US", placeholder: n, label: r, error: a, message: i, required: o = !1, hideSuccess: s = !1, hideError: l = !1, disabled: d = !1, value: c = "", onChange: f, ...h }, p) => { const _ = Nc({ accept: /\d+/g, value: c, onChange: f, format: (g) => new mn(e).input(g) }); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ct, { id: t, ...h, type: "tel", placeholder: n, onChange: _.onChange, value: _.value, error: a, message: i, hideSuccess: s, disabled: d, required: o, inputRef: p } ); } ); v0.displayName = "PhoneTextField2"; const et = { INPUT_WRAPPER: "cxc-search__input-wrapper", FOCUSED: "cxc-search--focused", ACTIVE: "cxc-search--active", DIRTY: "cxc-search--dirty", INPUT: "cxc-search__input", WRAPPER: "AppMenu", // ICON: 'Icon', SEARCH_BAR: "SearchBar", DROPDOWN: "Dropdown", DROPDOWN_ITEM: "DropdownItem", CLEAR_BUTTON_FOCUSED: "cxc-section-search__clear-button--focused", CLEAR_BUTTON_HIDDEN: "fds-hide", CLEAR_BUTTON: "cxc-section-search__clear-button", ICON: "fds-icon", ICON_CLEAR: "fds-font--ford-icons__clear" }, y0 = { PLACEHOLDER: "placeholder", FOR: "for", ID: "id", ARIA_DESCRIBEDBY: "aria-describedby", ARIA_OWNS: "aria-owns", ARIA_EXPANDED: "aria-expanded", ARIA_ACTIVEDESCENDANT: "aria-activedescendant", ARIA_SELECTED: "aria-selected", DATA_OPTIONS: "data-options" }, H1 = ({ onChange: t, placeholder: e, value: n = "", additionalStyles: r, className: a, inputProps: i, hasError: o, message: s }) => { const [l, d] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), f = ($) => { $.preventDefault(), t?.($.currentTarget.value); }, h = () => { c && c.current && (d(!0), v || c.current.setAttribute(y0.PLACEHOLDER, "")); }, p = () => { d(!1); }, m = () => { t && t(""), c && c.current && (c.current.click(), c.current.focus()); }, _ = ($) => { $.currentTarget.classList.remove(et.CLEAR_BUTTON_FOCUSED); }, g = ($) => { const N = $.target; $.keyCode === Ce.TAB && N.classList.add(et.CLEAR_BUTTON_FOCUSED); }, v = n && n !== ""; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E( "cxc-section-search", "cxc-search", "cxc-color__bg--light", v && "cxc-search--dirty", o && "cxc-search--invalid", l && et.ACTIVE, a ), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "cxc-section-search__combobox-wrapper", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "cxc-search__combobox-wrapper", children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( "cxc-search__input-wrapper", o && "cxc-search__input-wrapper--error" ), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "input", { onChange: f, onClick: h, onBlur: p, id: "FDSLocation", value: n, className: E("cxc-search__input"), type: "text", placeholder: l ? void 0 : e, "aria-autocomplete": "list", "aria-describedby": "FDSLocationInstructions", "aria-activedescendant": "", autoComplete: "off", ref: c, title: "Start typing to find your location.", style: r, ...i } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: E( et.CLEAR_BUTTON, et.ICON, et.ICON_CLEAR, !n && et.CLEAR_BUTTON_HIDDEN ), "aria-label": "clear search", onClick: m, onKeyUp: g, onBlur: _ } ) ] } ), o && s && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E("cxc-text-field__status"), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: "cxc-search__message", "aria-live": "polite", role: "alert", children: s } ) }) ] }) }) } ); }, E0 = "SELECT_DATA_TEST_ID", Ee = { SELECT_WRAPPER: "fmc-select-wrapper", SELECT_EYEBROW: "fds-select__eyebrow", SELECT_LABEL_WRAPPER: "fds-select__label-wrapper", SELECT_ICON_WRAPPER: "fmc-select-icon-wrapper", LABEL: "fmc-label", ICON: "fds-icon", ICON_SUCCESS: "fds-font--ford-icons__success", ICON_ERROR: "fds-font--ford-icons__error", SELECT: "fmc-select", INPUT_ERROR: "fmc-input--error", INPUT_SUCCESS: "fmc-input--success", INPUT_DISABLED: "fds-set-disabled", SELECT_STATUS: "fds-select__status", SELECT_MESSAGE: "fds-select__message", SELECT_MESSAGE_SUCCESS: "fds-select__message--success", SELECT_MESSAGE_ERROR: "fds-select__message--error", DARK_MODE: "fds-color__bg--dark" }, W1 = ({ className: t, value: e, success: n = !1, error: r = !1, disabled: a = !1, label: i, message: o, mode: s = "light", children: l, onChange: d, dataTestId: c = E0 }) => { const [f, h] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e), p = (m, ..._) => { h(m.target.value), d && d(m, ..._); }; return react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => { h(e); }, [e]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( t, s == "dark" && Ee.DARK_MODE, Ee.SELECT_WRAPPER ), "data-testid": c, children: [ (i || n || r) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: Ee.SELECT_EYEBROW, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: Ee.SELECT_LABEL_WRAPPER, children: [ i && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "label", { className: E( Ee.LABEL, s == "dark" && Ee.DARK_MODE ), children: i } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( Ee.ICON, n && !a && Ee.ICON_SUCCESS, r && !a && Ee.ICON_ERROR ) } ) ] }) }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E( Ee.SELECT_ICON_WRAPPER, a && Ee.INPUT_DISABLED ), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "select", { value: f, className: E( Ee.SELECT, r && !a && Ee.INPUT_ERROR, n && !a && Ee.INPUT_SUCCESS, s == "dark" && Ee.DARK_MODE ), onChange: p, disabled: a, "aria-labelledby": "combobox", "aria-haspopup": "listbox", "aria-disabled": a, children: l } ) } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: Ee.SELECT_STATUS, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( Ee.SELECT_MESSAGE, n && !a && Ee.SELECT_MESSAGE_SUCCESS, r && !a && Ee.SELECT_MESSAGE_ERROR, s == "dark" && Ee.DARK_MODE ), "aria-live": "assertive", role: "alert", children: o } ) }) ] } ); }, ge = { PREDICTIVE_SEARCH: "cxc-predictive-search", LIGHT_BG: "cxc-color__bg--light", DARK_BG: "cxc-color__bg--dark", SHOW_OPTIONS: "cxc-show-options", ACTIVE: "cxc-predictive-search--active", FOCUSED: "cxc-predictive-search--focused", DIRTY: "cxc-predictive-search--dirty", INPUT: "cxc-predictive-search__input", TEXT_FIELD_EYEBROW: "cxc-text-field__eyebrow", TEXT_FIELD_LABEL_WRAPPER: "cxc-text-field__label-wrapper", TEXT_FIELD_LABEL: "cxc-text-field__label", SEARCH_COMBOBOX_WRAPPER: "cxc-predictive-search__combobox-wrapper", SEARCH_INPUT_WRAPPER: "cxc-predictive-search__input-wrapper", SEARCH_INPUT: "cxc-predictive-search__input", SEARCH_OPTIONS_WRAPPER: "cxc-predictive-search__options-wrapper", SEARCH_OPTION: "cxc-predictive-search__option", SEARCH_OPTION_HIGHLIGHT: "cxc-predictive-search__option--highlight", CLEAR_BUTTON_FOCUSED: "fds-section-search__clear-button--focused", CLEAR_BUTTON_HIDDEN: "fds-hide", CLEAR_BUTTON: "fds-section-search__clear-button", ICON: "fds-icon", ICON_CLEAR: "fds-font--ford-icons__clear", ICON_LEFT_OFFSET: "fds-icon--offset-left", ICON_RIGHT_OFFSET: "fds-icon--offset-right" }, ht = { HOME: "home", END: "end", PREV: "prev", NEXT: "next" }, b0 = 500, C0 = "PREDICTIVE_SEARCH_FIELD_DATA_TEST_ID", V1 = ({ onChange: t, onInputChange: e, onOptionClick: n, placeholder: r, additionalStyles: a, defaultInputValue: i = "", className: o, options: s = [], mode: l = "light", title: d, dataTestId: c = C0, icon: f = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Wt, { name: "search" }), showClearButton: h = !0, disableFiltering: p = !1, ...m }) => { let _; const [g, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [$, N] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), [y, T] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(i), [D, U] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [I, R] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(-1), [k, P] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [V, M] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [C, O] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), [ x, b ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), Z = { maxWidth: "16px", maxHeight: "16px" }; f && (_ = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: ge.ICON_RIGHT_OFFSET, children: f && react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(f, { style: Z }) })); const S = (K) => { n && n(K), T(K.label), N([]); }, A = (K) => { K.preventDefault(), v(!0); const se = K.currentTarget; let j = []; se.value.length > 0 && (j = s?.filter( (ce) => ce.label.toLocaleLowerCase().includes(se.value.toLocaleLowerCase()) ) ?? [], j.length > 0 && b(!0)), e?.(K, se.value), N(j), T(se.value), U(!0); }, q = (K) => { v(!0), U(y !== ""); }, J = () => { N([]), v(!1), P(!1), U(y !== ""); }, Y = (K) => { K.key === "Tab" && (q(), P(!0)); }, L = (K) => { e?.(K, ""), w && w.current && (w.current.click(), w.current.focus()), T(""); }, G = (K) => { K.currentTarget.classList.remove(ge.CLEAR_BUTTON_FOCUSED); }, H = (K) => { const se = K.target; K.keyCode === Ce.TAB && se.classList.add(ge.CLEAR_BUTTON_FOCUSED); }, Q = () => { R(-1), v(!1), b(!1); }, X = (K) => { for (let se = 0; se < s.length; se++) if ($[se]?.value.toUpperCase().startsWith(K)) return se; return null; }, te = (K) => { C && clearTimeout(C), O( // @ts-ignore setTimeout(() => { M(""), O(null); }, K) ); }, oe = (K) => { const se = String.fromCharCode(K), j = V + se; M(j), te(b0); const ce = X(j); return ce !== null ? (R(ce), !0) : !1; }, B = (K) => { let se = -1; switch (K) { case ht.HOME: se = -1; break; case ht.END: se = s.length - 1; break; case ht.NEXT: I >= s.length - 1 ? se = -1 : se = I + 1; break; case ht.PREV: I <= -1 ? se = s.length - 1 : se = I - 1; break; } R(se); }; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { $.length === 0 && b(!1); }, [$]); const _e = ( // boolean condition for showing options when `disableFiltering` is false x && !p || // boolean condition for showing options when `disableFiltering` is true p && !!s.length && g ), Oe = p ? s : $, Ge = (K) => { switch (K.keyCode) { case Ce.ENTER: return K.stopPropagation(), K.preventDefault(), t?.( K, I >= 0 ? Oe[I > -1 ? I : 0].value : y ), I >= 0 && S( Oe[I > -1 ? I : 0] ), Q(), !1; case Ce.ESC: K.target.blur(), Q(); break; case Ce.UP: K.preventDefault(), B(ht.PREV); break; case Ce.DOWN: K.preventDefault(), B(ht.NEXT); break; default: K.preventDefault(), oe(K.keyCode); break; } }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( ge.PREDICTIVE_SEARCH, l === "light" && ge.LIGHT_BG, l === "dark" && ge.DARK_BG, D && ge.DIRTY, g && ge.ACTIVE, k && ge.FOCUSED, _e && ge.SHOW_OPTIONS, o ), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E(ge.TEXT_FIELD_EYEBROW), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E(ge.TEXT_FIELD_LABEL_WRAPPER), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: E(ge.TEXT_FIELD_LABEL), children: r }) }) }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E(ge.SEARCH_COMBOBOX_WRAPPER), "aria-expanded": _e ? "true" : "false", "aria-owns": "FMCPredictiveSearchResults", "aria-haspopup": "listbox", children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: E(ge.SEARCH_INPUT_WRAPPER), children: [ _, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "input", { onChange: A, id: "FMCPredictiveSearch", value: y, className: ge.SEARCH_INPUT, type: "text", onKeyUp: Y, onKeyDown: (K) => { (K.key === "ArrowDown" || K.key === "ArrowUp" || K.key === "Enter" || K.key === "Escape") && Ge(K); }, placeholder: g ? "" : r, "aria-autocomplete": "list", "aria-describedby": "FMCPredictiveSearchInstructions", "aria-activedescendant": "", autoComplete: "off", ref: w, title: d, "data-testid": "predictive-search", style: a, onClick: q, onBlur: () => { setTimeout(() => { J(); }, 150), R(-1); }, ...m } ), h && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: E( ge.CLEAR_BUTTON, ge.ICON, ge.ICON_CLEAR, !y && ge.CLEAR_BUTTON_HIDDEN ), "aria-label": "clear search", onClick: L, onKeyUp: H, onBlur: G } ) ] }), Oe && _e && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": c, className: E(ge.SEARCH_OPTIONS_WRAPPER), children: Oe.map((K, se) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { onMouseOver: () => R(se), className: E( ge.SEARCH_OPTION, se === I && ge.SEARCH_OPTION_HIGHLIGHT ), onClick: () => S(K), children: K.label }, se )) } ) ] } ) ] } ); }, _t = { UK: /^([A-Z]){1}([0-9][0-9]|[0-9]|[A-Z][0-9][A-Z]|[A-Z][0-9][0-9]|[A-Z][0-9]|[0-9][A-Z]){1}([ ])?([0-9][A-z][A-z]){1}$/i, GB: /^([A-Z]){1}([0-9][0-9]|[0-9]|[A-Z][0-9][A-Z]|[A-Z][0-9][0-9]|[A-Z][0-9]|[0-9][A-Z]){1}([ ])?([0-9][A-z][A-z]){1}$/i, // JE: /^JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/, // GG: /^GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/, // IM: /^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/, US: /^([0-9]{5})(?:-([0-9]{4}))?$/, CA: /^([ABCEGHJKLMNPRSTVXY][0-9][ABCEGHJKLMNPRSTVWXYZ])\s*([0-9][ABCEGHJKLMNPRSTVWXYZ][0-9])$/i, IE: /^([AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}$/, DE: /^\d{5}$/, // JP: /^\d{3}-\d{4}$/, FR: /^\d{2}[ ]?\d{3}$/, // AU: /^\d{4}$/, IT: /^\d{5}$/, // CH: /^\d{4}$/, AT: /^(?!0)\d{4}$/, ES: /^(?:0[1-9]|[1-4]\d|5[0-2])\d{3}$/, NL: /^\d{4}[ ]?[A-Z]{2}$/, // BE: /^\d{4}$/, // DK: /^\d{4}$/, // SE: /^(SE-)?\d{3}[ ]?\d{2}$/, // NO: /^\d{4}$/, // BR: /^\d{5}[\-]?\d{3}$/, PT: /^\d{4}([\-]\d{3})?$/, // FI: /^(FI-|AX-)?\d{5}$/, // AX: /^22\d{3}$/, // KR: /^\d{5}$/, // CN: /^\d{6}$/, // TW: /^\d{3}(\d{2})?$/, // SG: /^\d{6}$/, // DZ: /^\d{5}$/, // AD: /^AD\d{3}$/, // AR: /^([A-HJ-NP-Z])?\d{4}([A-Z]{3})?$/, // AM: /^(37)?\d{4}$/, // AZ: /^\d{4}$/, // BH: /^((1[0-2]|[2-9])\d{2})?$/, // BD: /^\d{4}$/, // BB: /^(BB\d{5})?$/, // BY: /^\d{6}$/, // BM: /^[A-Z]{2}[ ]?[A-Z0-9]{2}$/, // BA: /^\d{5}$/, // IO: /^BBND 1ZZ$/, // BN: /^[A-Z]{2}[ ]?\d{4}$/, // BG: /^\d{4}$/, // KH: /^\d{5}$/, // CV: /^\d{4}$/, // CL: /^\d{7}$/, // CR: /^(\d{4,5}|\d{3}-\d{4})$/, // HR: /^(HR-)?\d{5}$/, // CY: /^\d{4}$/, // CZ: /^\d{3}[ ]?\d{2}$/, // DO: /^\d{5}$/, // EC: /^([A-Z]\d{4}[A-Z]|(?:[A-Z]{2})?\d{6})?$/, // EG: /^\d{5}$/, // EE: /^\d{5}$/, // FO: /^\d{3}$/, // GE: /^\d{4}$/, // GR: /^\d{3}[ ]?\d{2}$/, // GL: /^39\d{2}$/, // GT: /^\d{5}$/, // HT: /^\d{4}$/, // HN: /^(?:\d{5})?$/, // HU: /^\d{4}$/, // IS: /^\d{3}$/, // IN: /^\d{6}$/, // ID: /^\d{5}$/, // IL: /^\d{5,7}$/, // JO: /^\d{5}$/, // KZ: /^\d{6}$/, // KE: /^\d{5}$/, // KW: /^\d{5}$/, // KY: /^KY[123]-\d{4}$/, // LA: /^\d{5}$/, // LV: /^(LV-)?\d{4}$/, // LB: /^(\d{4}([ ]?\d{4})?)?$/, // LI: /^(948[5-9])|(949[0-7])$/, // LT: /^(LT-)?\d{5}$/, // LU: /^(L-)?\d{4}$/, // MK: /^\d{4}$/, // MY: /^\d{5}$/, // MV: /^\d{5}$/, // MT: /^[A-Z]{3}[ ]?\d{2,4}$/, // MU: /^((\d|[A-Z])\d{4})?$/, MX: /^\d{5}$/ // MD: /^\d{4}$/, // MC: /^980\d{2}$/, // MA: /^\d{5}$/, // NP: /^\d{5}$/, // NZ: /^\d{4}$/, // NI: /^((\d{4}-)?\d{3}-\d{3}(-\d{1})?)?$/, // NG: /^(\d{6})?$/, // OM: /^(PC )?\d{3}$/, // PA: /^\d{4}$/, // PK: /^\d{5}$/, // PY: /^\d{4}$/, // PH: /^\d{4}$/, // PL: /^\d{2}-\d{3}$/, // PR: /^00[679]\d{2}([ \-]\d{4})?$/, // RO: /^\d{6}$/, // RU: /^\d{6}$/, // SM: /^4789\d$/, // SA: /^\d{5}$/, // SN: /^\d{5}$/, // SK: /^\d{3}[ ]?\d{2}$/, // SI: /^(SI-)?\d{4}$/, // ZA: /^\d{4}$/, // LK: /^\d{5}$/, // TJ: /^\d{6}$/, // TH: /^\d{5}$/, // TN: /^\d{4}$/, // TR: /^\d{5}$/, // TM: /^\d{6}$/, // UA: /^\d{5}$/, // UY: /^\d{5}$/, // UZ: /^\d{6}$/, // VA: /^00120$/, // VE: /^\d{4}$/, // ZM: /^\d{5}$/, // AS: /^96799$/, // CC: /^6799$/, // CK: /^\d{4}$/, // RS: /^\d{5,6}$/, // ME: /^8\d{4}$/, // CS: /^\d{5}$/, // YU: /^\d{5}$/, // CX: /^6798$/, // ET: /^\d{4}$/, // FK: /^FIQQ 1ZZ$/, // NF: /^2899$/, // FM: /^(9694[1-4])([ \-]\d{4})?$/, // GF: /^9[78]3\d{2}$/, // GN: /^\d{3}$/, // GP: /^9[78][01]\d{2}$/, // GS: /^SIQQ 1ZZ$/, // GU: /^969[123]\d([ \-]\d{4})?$/, // GW: /^\d{4}$/, // HM: /^\d{4}$/, // IQ: /^\d{5}$/, // KG: /^\d{6}$/, // LR: /^\d{4}$/, // LS: /^\d{3}$/, // MG: /^\d{3}$/, // MH: /^969[67]\d([ \-]\d{4})?$/, // MN: /^\d{6}$/, // MP: /^9695[012]([ \-]\d{4})?$/, // MQ: /^9[78]2\d{2}$/, // NC: /^988\d{2}$/, // NE: /^\d{4}$/, // VI: /^008(([0-4]\d)|(5[01]))([ \-]\d{4})?$/, // VN: /^\d{6}$/, // PF: /^987\d{2}$/, // PG: /^\d{3}$/, // PM: /^9[78]5\d{2}$/, // PN: /^PCRN 1ZZ$/, // PW: /^96940$/, // RE: /^9[78]4\d{2}$/, // SH: /^(ASCN|STHL) 1ZZ$/, // SJ: /^\d{4}$/, // SO: /^\d{5}$/, // SZ: /^[HLMS]\d{3}$/, // TC: /^TKCA 1ZZ$/, // WF: /^986\d{2}$/, // XK: /^\d{5}$/, // YT: /^976\d{2}$/, // INTL: /^(?:[A-Z0-9]+([- ]?[A-Z0-9]+)*)?$/i, }, G1 = ({ value: t, id: e = "FDSPostalCodeTextFieldComponent", country: n = "US", placeholder: r, label: a, error: i, message: o, patternMismatchErrorMessage: s = "Postal code is invalid", requiredErrorMessage: l, required: d = !1, hideSuccess: c = !1, hideError: f = !1, disabled: h = !1, autoFormat: p = !0, onValueChange: m, ..._ }) => { function g(V) { _t[V] || console.error("PostalCodeTextField does not support this country code!"); } const v = n.toUpperCase(); g(v); const [$, N] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), [y, T] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), D = (V) => U(V, v), U = (V, M) => _t[M]?.test(V), I = (V) => { const C = V.target.value.replace(/\s\s+/g, " "); let O = C; p && (O = R( C, v )); const x = D(O); N(x), m && m({ value: C, formattedValue: O, isValid: x, countryCode: v }); }; function R(V, M) { const C = _t[M], O = V.toUpperCase(); return C ? M === "US" ? O.length >= 6 && O.charAt(5) != "-" ? O.slice(0, 5) + "-" + O.slice(5, 11) : O : M === "PT" ? O.length >= 5 && O.charAt(4) != "-" ? O.slice(0, 4) + "-" + O.slice(4, 7) : O : O.replace(C, function(x) { switch (M) { case "AT": return x; case "CA": return x.length === 6 ? x.slice(0, 3) + " " + x.slice(3, 6) : x; case "DE": return x; case "ES": return x; case "FR": return x; case "IE": return x.length === 7 ? x.slice(0, 3) + " " + x.slice(3, 7) : x; case "IT": return x; case "MX": return x; case "NL": return x.length === 6 ? x.slice(0, 4) + " " + x.slice(4, 6) : x; case "GB": case "UK": return x.length === 7 ? x.slice(0, 4) + " " + x.slice(4, 7) : x; default: return ""; } }) : ""; } const k = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { $ ? T("") : typeof t > "u" || t.length === 0 ? T( d ? l || "Postal code is required" : "" ) : T(s); }, [ n, t, $, s, d, l ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { k(); }, [k]); const P = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { T(""), t && I({ target: { value: t } }); }, []); return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { P(); }, [P]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ct, { id: e, label: a, name: a, placeholder: r, onChange: I, value: t, error: i || (f ? void 0 : y), message: o || (f ? void 0 : y), hideSuccess: c || !$, disabled: h, required: d, ..._ } ); }, K1 = (t, e) => (e = e.toUpperCase(), _t[e]?.test(t)); function N0(t) { _t[t] || console.error("PostalCodeTextField does not support this country code!"); } const j1 = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef( ({ value: t, id: e = "FDSPostalCodeTextFieldComponent", country: n = "US", placeholder: r, label: a, error: i, message: o, required: s = !1, disabled: l = !1, autoFormat: d = !0, onChange: c, ...f }, h) => { const p = n.toUpperCase(); N0(p); const m = (v) => { const $ = v.target.value; if (/^[a-z0-9\- ]{0,12}$/gi.test($)) { const N = $.replace(/\s\s+/g, " "); let y = N; d && (y = _( N, p )), c && c(y); } }; function _(v, $) { const N = _t[$], y = v.toUpperCase().replace(/[-]/g, ""); return N ? $ === "US" ? y.length >= 6 && y.charAt(5) !== "-" ? y.slice(0, 5) + "-" + y.slice(5, 11) : y : $ === "PT" ? y.length >= 5 && y.charAt(4) !== "-" ? y.slice(0, 4) + "-" + y.slice(4, 7) : y : y.replace(N, function(T) { switch ($) { case "AT": return T; case "CA": return T.length === 6 ? T.slice(0, 3) + " " + T.slice(3, 6) : T; case "DE": return T; case "ES": return T; case "FR": return T; case "IE": return T.length === 7 ? T.slice(0, 3) + " " + T.slice(3, 7) : T; case "IT": return T; case "MX": return T; case "NL": return T.length === 6 ? T.slice(0, 4) + " " + T.slice(4, 6) : T; case "GB": case "UK": return T.length === 7 ? T.slice(0, 4) + " " + T.slice(4, 7) : T; default: return ""; } }) : ""; } const g = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { t && m({ target: { value: t } }); }, []); return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { g(); }, [g]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ct, { id: e, label: a, name: a, placeholder: r, onChange: m, value: t, error: i, message: o, disabled: l, required: s, inputRef: h, ...f } ); } ), Y1 = (t, e = !1, n = "USD", r = "en") => { const a = Intl.NumberFormat(r, { style: "currency", currency: n, maximumSignificantDigits: _o }).formatToParts(1111.11), i = a.find( (p) => p.type === "decimal" )?.value, o = a.find( (p) => p.type === "literal" )?.value, s = a.find( (p) => p.type === "currency" )?.value, l = a.find( (p) => p.type === "group" )?.value; let d = Sr({ value: t, groupSeparator: l, decimalSeparator: i }); d = d.replace(",", "."); const c = go(".", d), f = parseFloat(d); let h = ""; if (d.charAt(d.length - 1) !== ".") { let p = 2; e || (p = Math.min(c, 2)); const m = new Intl.NumberFormat(r, { style: "currency", currency: n, minimumFractionDigits: p, maximumFractionDigits: p }).format(f); isNaN(f) || (h = m); } else { const p = new Intl.NumberFormat(r, { style: "currency", currency: n, minimumFractionDigits: 0, maximumFractionDigits: 0 }).format(f); o ? h = `${p.replace( `${o}${s}`, "" )}${i}${o}${s}` : h = `${p}${i}`; } return S0(h, d); }, _o = 18, go = function(t, e) { return t && e.split(t)[1]?.length || 0; }, S0 = (t, e) => { const n = parseFloat(e); return { formattedValue: t, value: e, floatValue: isNaN(n) ? void 0 : n }; }, z1 = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef( ({ currency: t = "USD", locale: e = "en", onChange: n, value: r, padZeroes: a = !1, onBlur: i, message: o, error: s, ...l }, d) => { const c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), [f, h] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const g = c.current; g && g.setSelectionRange(f, f); }, [c, f, r]); const p = (g, v, $ = !1) => { const N = Intl.NumberFormat(e, { style: "currency", currency: t, maximumSignificantDigits: 18 }).formatToParts(1111.11), y = N.find( (C) => C.type === "decimal" )?.value, T = N.find( (C) => C.type === "literal" )?.value, D = N.find((C) => C.type === "currency")?.value || "", U = N.find( (C) => C.type === "group" )?.value; let I = Sr({ value: v, groupSeparator: U, decimalSeparator: y }); I = I.replace(",", "."); const R = go(".", I), k = parseFloat(I); let P = ""; if (I.charAt(I.length - 1) !== ".") { let C = 2; $ || (C = Math.min(R, 2)); const O = new Intl.NumberFormat(e, { style: "currency", currency: t, minimumFractionDigits: C, maximumFractionDigits: C }).format(k); isNaN(k) || (P = O); } else { const C = new Intl.NumberFormat(e, { style: "currency", currency: t, minimumFractionDigits: 0, maximumFractionDigits: 0 }).format(k); T ? P = `${C.replace( `${T}${D}`, "" )}${y}${T}${D}` : P = `${C}${y}`; } const V = g.target.selectionEnd, M = r.length - P.length; r.length === 0 && T ? h(1) : M === 0 ? h(V) : M < 0 ? h(V + Math.abs(M) - 1) : h(V - Math.abs(M) + 1), P !== r && n(P); }, m = (g) => { p(g, g.target.value); }, _ = (g) => { p(g, g.target.value, a); }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: d, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ct, { onChange: (g) => m(g), onBlur: (g) => _(g), onFocus: () => { const g = c.current; g && setTimeout(function() { g.setSelectionRange(f, f); }, 0); }, value: r, inputRef: c, "data-testid": "currency-input", maxLength: _o, message: o, error: s, ...l } ) }); } ), X1 = ({ url: t = "", openInNewTab: e = !1, children: n, className: r }) => e ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "a", { href: t, "data-testid": "link-wrapper", target: "_blank", rel: "noreferrer", className: E(r), children: n } ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: t, "data-testid": "link-wrapper", className: E(r), children: n }); const q1 = ({ isOpen: t = !1, toggleModal: e, extraContentStyles: n, children: r, className: a }) => { const i = { content: { top: "50%", left: "50%", right: "auto", bottom: "auto", width: "60vw", marginRight: "-50%", transform: "translate(-50%, -50%)", alignItems: "center", padding: 0, zIndex: 3e3, ...n }, base: "ReactModal__Overlay", afterOpen: "ReactModal__Overlay--after-open", beforeClose: "ReactModal__Overlay--before-close" }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Wi, { isOpen: t, onRequestClose: e, style: i, className: E(a), children: r } ); }, Z1 = () => { const [t, e] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1); return { visible: t, toggle: () => e(!t), setVisibility: (a) => e(a) }; }, O0 = ({ className: t, square: e = !0, elevated: n = !1, ...r }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { className: E( "cxc-table-container", e && "cxc-table-container--square", n && "cxc-table-container--elevated", t ), ...r } ); O0.displayName = "TableContainer"; const Dr = react__WEBPACK_IMPORTED_MODULE_1__.createContext({ padding: "normal", size: "medium", stickyHeader: !1 }); Dr.displayName = "TableContext"; const wt = { TABLE: "fmc-table", ALTERNATING_ROWS: "fmc-table--alternating-rows", STICKY_HEADER: "cxc-table--sticky-header", HEADER_COLUMN: "fmc-table--header-column", NO_BORDERS: "fmc-table--no-borders" }, A0 = ({ className: t, padding: e = "normal", size: n = "medium", stickyHeader: r = !1, alternateRows: a = !0, headerColumn: i = !1, borders: o = !0, ...s }) => { const l = react__WEBPACK_IMPORTED_MODULE_1__.useMemo( () => ({ padding: e, size: n, stickyHeader: r, alternateRows: a }), [e, n, r, a] ), d = [wt.TABLE]; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Dr.Provider, { value: l, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "table", { role: "table", className: E( d, r && wt.STICKY_HEADER, a && wt.ALTERNATING_ROWS, i && wt.HEADER_COLUMN, !o && wt.NO_BORDERS, t ), ...s } ) }); }; A0.displayName = "Table"; const Yt = react__WEBPACK_IMPORTED_MODULE_1__.createContext({}); Yt.displayName = "TableInnerContext"; const I0 = ({ className: t, padding: e, scope: n, sortDirection: r, variant: a, size: i, align: o = "left", style: s, ...l }) => { const d = react__WEBPACK_IMPORTED_MODULE_1__.useContext(Dr), c = react__WEBPACK_IMPORTED_MODULE_1__.useContext(Yt), f = ( //@ts-ignore c && c.variant === "head" || !1 ), h = f ? "th" : "td", p = i || (d && d.size ? d.size : "medium"); let m = n; !m && f && (m = "col"); let _ = "none"; return r && (_ = r === "asc" ? "ascending" : "descending"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( h, { className: E( "fds-app", "cxc-table-cell", f && "cxc-table-cell--head-cell", o === "right" && "cxc-table-cell--align-right", o === "center" && "cxc-table-cell--align-center", o === "left" && "cxc-table-cell--align-left", o === "justify" && "cxc-table-cell--align-justify", e === "none" && "cxc-table-cell--padding-none", e === "checkbox" && "cxc-table-cell--padding-checkbox", p === "small" && "cxc-table-cell--size-small", a === "head" && d && d.stickyHeader && "cxc-table-cell--sticky-header", a === "body" && "cxc-table-cell--body-cell", a === "footer" && "cxc-table-cell--footer-cell", t ), "aria-sort": _, scope: m, style: s, ...l } ); }; I0.displayName = "TableCell"; const R0 = { variant: "body" }, D0 = ({ className: t, ...e }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Yt.Provider, { value: R0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: E("cxc-table-body", t), ...e }) }); D0.displayName = "TableBody"; const P0 = ({ className: t, hover: e = !1, selected: n = !1, onClick: r, ...a }) => { const i = react__WEBPACK_IMPORTED_MODULE_1__.useContext(Yt), o = i && //@ts-ignore i.varient === "head", s = i && //@ts-ignore i.varient === "footer"; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "tr", { role: "row", className: E( "cxc-table-row", n && "cxc-table-row--selected-enabled", e && "cxc-table-row--hover-enabled", o && "cxc-table-row--head-row", s && "cxc-table-cell--footer-row", t ), onClick: r, ...a } ); }; P0.displayName = "TableRow"; const w0 = { variant: "head" }, L0 = ({ ...t }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Yt.Provider, { value: w0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { ...t }) }); L0.displayName = "TableHead"; const Lt = "...", Qt = (t, e) => { const n = e - t + 1; return Array.from({ length: n }, (r, a) => a + t); }, x0 = ({ totalCount: t, pageSize: e = 1, siblingCount: n = 1, currentPage: r }) => (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => { const i = Math.ceil(t / e); if (n + 6 >= i) return Qt(1, i); const s = Math.max(r - n, 1), l = Math.min( r + n, i ), d = s > 2, c = l < i - 2, f = 1, h = i; if (!d && c) { const p = 3 + 2 * n; return [...Qt(1, p), Lt, i]; } if (d && !c) { const p = 3 + 2 * n, m = Qt( i - p + 1, i ); return [f, Lt, ...m]; } if (d && c) { const p = Qt(s, l); return [f, Lt, ...p, Lt, h]; } }, [t, e, n, r]), F0 = ({ page: t, count: e, onPageChange: n, siblingCount: r = 1, pageSize: a = 1, className: i, nextButtonText: o = "Next", prevButtonText: s = "Prev" }) => { const l = x0({ currentPage: t, totalCount: e, siblingCount: r, pageSize: a }); if (t === 0 || l && l.length < 2) return null; const d = () => { n(t + 1); }, c = () => { n(t - 1); }, f = l && l[l.length - 1] || 1; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "fds-app cxc-pagination__nav", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("ul", { className: E("cxc-pagination", i), children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { className: "cxc-pagination__item", children: t !== 1 ? ( // TODO: Refactor to use button tag instead of a tag /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { className: "cxc-pagination__prev", onClick: c, children: [ s, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fds-hide--visually", children: " page" }) ] }) ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( "cxc-pagination__prev", "cxc-pagination__disabled" ), children: s } ) }), l && l.map((h, p) => h === Lt ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "li", { className: "cxc-pagination__link cxc-pagination__item cxc-pagination__disabled", children: "…" }, p ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "li", { className: "cxc-pagination__item", onClick: () => n(h), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "a", { className: E( { "cxc-pagination--active": h === t }, "cxc-pagination__link" ), "aria-current": "page", children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fds-hide--visually", children: "Page " }), " ", h ] } ) }, p )), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { className: "cxc-pagination__item", children: t !== f ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { className: "cxc-pagination__next", onClick: d, children: [ o, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "fds-hide--visually", children: " page" }) ] }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E( "cxc-pagination__next", "cxc-pagination__disabled" ), children: o } ) }) ] }) }); }; F0.displayName = "TablePagination"; const M0 = (t) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", color: "#fff", fill: "#FFFFFF", "aria-hidden": "false", focusable: !1, height: "24px", width: "24px", ...t, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8l8-8z" }) } ), k0 = ({ active: t = !1, children: e, className: n, direction: r = "asc", hideSortIcon: a = !1, onClick: i, ...o }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "button", { className: E("cxc-table-sort-label", t && "cxc-table-sort-label--active", n), "aria-disabled": !1, tabIndex: 0, onClick: i, ...o, children: [ e, a && !t ? null : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( M0, { className: E( "cxc-table-sort-label__icon", r === "asc" && "cxc-table-sort-label__icon--direction-asc", (r === "desc" || r === "des") && "cxc-table-sort-label__icon--direction-desc" ) } ) ] } ); k0.displayName = "TableSortLabel"; const ii = () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {}), Pe = { COMPONENT: "js-fmc-tabs", HORIZONTAL: "fmc-tabs--horizontal", VERTICAL: "fmc-tabs--vertical", TAB_LIST_WRAPPER: "fmc-tabs__tablist-wrapper", TAB_LIST: "fmc-tabs__tablist", TAB: "fmc-tabs__tab", TAB_BORDER: "fmc-tabs__tab-border", TAB_PANELS: "fmc-tabs__tabpanels", TAB_PANEL: "fmc-tabs__tabpanel", HOVER: "fmc-tabs__tab--hover", ACTIVE: "fmc-tabs__tab--active", ACTIVE_PANEL: "fmc-tabs__tabpanel--active", FOCUSED_PANEL: "fmc-tabs__tabpanel--focus", FOCUSED: "fmc-tabs__tab--focused", VERTICAL_TAB: "cxc-vertical-tab" // Needed to support vertical tabs }, Gn = { TABLIST_ROLE: "tablist", TAB_ROLE: "tab", TABPANEL_ROLE: "tabpanel", PANEL1_ID: "Panel1", PANEL2_ID: "Panel2", TAB_WIDTH: "60px" }, oi = { UP: 38, DOWN: 40, LEFT: "ArrowLeft", RIGHT: "ArrowRight", TAB: "Tab", ENTER: 13, HOME: 36, END: 35 }, J1 = ({ defaultActiveTabIndex: t, onTabChange: e, children: n, className: r, variant: a = "horizontal", ...i }) => { const [o, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)( t || 0 ), [l, d] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(-1), [c, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), { width: h } = Ci(), p = h < ko, m = react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray( n ), _ = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => `tab_${Ve("")}`, []), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)( () => `tab_border_${Ve("")}`, [] ); function v(I, R) { const P = getComputedStyle(R), V = parseInt( P.getPropertyValue("padding-top") ), M = R.clientHeight - parseFloat(P.paddingTop) - parseFloat(P.paddingBottom), C = `${V + M + 10}px`; I.style.setProperty("top", C); const O = document.querySelectorAll( `.${Pe.VERTICAL_TAB}` ); for (let x = 0; x < O.length; x++) O[x].style.setProperty( "--hover-offset", C ); } (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const I = () => { f( //@ts-ignore react__WEBPACK_IMPORTED_MODULE_1__.Children.map(n, (R) => { if (R.type === ii) return (0,react__WEBPACK_IMPORTED_MODULE_1__.createRef)(); }) ); }; if (!p) { const R = () => { const k = document.querySelectorAll(`.${_}`)[o], P = document.querySelector( `.${g}` ); !P || !k || (a === "vertical" && v(P, k), P.style.setProperty("transform", `translateX(${k.offsetLeft}px)`), P.style.setProperty("width", `${k.offsetWidth}px`), a === "vertical" && P.style.setProperty("transform", `translateY(${k.offsetTop}px)`), P.style.setProperty("display", "block"), P.style.setProperty("transition", "none")); }; window.addEventListener("load", I), window.addEventListener("resize", I), window.addEventListener("load", R), I(); } }, [n, o, p]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { (() => { const R = document.querySelectorAll(`.${_}`)[o], k = document.querySelector( `.${g}` ); !k || !R || (a === "vertical" && v(k, R), k.style.setProperty("transition", "transform 0.3s linear"), k.style.setProperty("transform", `translateX(${R.offsetLeft}px)`), a === "vertical" && k.style.setProperty("transform", `translateY(${R.offsetTop}px)`), k.style.setProperty("width", `${R.offsetWidth}px`), k.style.setProperty("display", "block")); })(); }, [o, c]); function $(I) { s(I), e?.(I); } function N(I) { d(I); } function y(I) { d(I); } function T(I) { switch (I.code) { case oi.RIGHT: I.preventDefault(), o === c.length - 1 ? $(0) : $(o + 1); break; case oi.LEFT: $(o === 0 ? c.length - 1 : o - 1); break; default: return; } } function D() { return react__WEBPACK_IMPORTED_MODULE_1__.Children.map( m, (I, R) => I.type === ii ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: E( Pe.TAB, o === R && Pe.ACTIVE, l === R && Pe.HOVER, a === "vertical" && Pe.VERTICAL_TAB, _ ), role: Gn.TAB_ROLE, "aria-selected": o === R ? "true" : "false", "aria-controls": `FDShTabsImagesPanel${I.props.label.replace( /\s/g, "" )}`, id: `FDShTabsImagesTab${I.props.label.replace(/\s/g, "")}`, disabled: I.props.disabled, onClick: () => $(R), onMouseOver: () => N(R), onFocus: () => N(R), onMouseOut: () => y(R), onBlur: () => y(R), onKeyUp: T, ref: c[R], children: I.props.label }, `FDShTabsImagesTab${I.props.label.replace(/\s/g, "")}` ) : null ); } function U() { const I = m[o]; return I ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { id: `FDShTabsImagesPanel${I.props.label.replace( /\s/g, "" )}`, className: E( Pe.TAB_PANEL, Pe.ACTIVE_PANEL, "fds-color--gray3" ), role: Gn.TABPANEL_ROLE, "aria-labelledby": `FDShTabsImagesTab${I.props.label.replace( /\s/g, "" )}`, children: I.props.children } ) : null; } return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( Pe.COMPONENT, Pe.TAB_LIST_WRAPPER, "fmc-tabs", r ), ...i, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E(Pe.TAB_LIST_WRAPPER), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E(Pe.TAB_LIST), role: Gn.TABLIST_ROLE, "aria-label": "Features", style: { flexDirection: a === "vertical" ? "column" : "row" }, children: [ D(), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "span", { className: E(Pe.TAB_BORDER, g) } ) ] } ) }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: E(Pe.TAB_PANELS, "fds-color--gray3"), children: U() }) ] } ); }, je = { COMPONENT: "fmc-toggle", SKEUOMORPHIC: "fmc-toggle--skeuomorphic", LABEL: "fmc-toggle__label", TRACK: "fmc-toggle__track", CHECKED_VALUE: "fmc-toggle__checked-option", UNCHECKED_VALUE: "fmc-toggle__unchecked-option", FOCUSED: "cxc-toggle__focused", INPUT_WRAPPER: "cxc-toggle__input-wrapper" }, Q1 = ({ checked: t, disabled: e = !1, labelText: n, optionTextinTrack: r = !1, onChange: a, checkedTitle: i = "On", unCheckedTitle: o = "Off", enableValidation: s = !1, className: l, validationMessageType: d = "error", ...c }) => { const [f, h] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), p = (_) => { switch (_.key) { case "Tab": h(!0); break; case "Enter": case "Space": a && a(); break; } }, m = () => { h(!1); }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "label", { className: E( je.COMPONENT, je.SKEUOMORPHIC, f && je.FOCUSED, l ), "aria-disabled": e, children: [ n ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E(je.LABEL), children: n }) : null, r ? null : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E(je.UNCHECKED_VALUE), children: o }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "input", { id: "ToggleDefault", "data-testid": "toggle", type: "checkbox", disabled: e, checked: t, onKeyUp: p, onBlur: m, onChange: a } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: E(je.TRACK), children: [ r ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E(je.CHECKED_VALUE), children: i.substring(0, 4) }) : null, r ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E(je.UNCHECKED_VALUE), children: o.substring(0, 4) }) : null ] }), r ? null : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: E(je.CHECKED_VALUE), children: i }), s && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( ci, { validationMessageType: d, ...c } ) ] } ); }, $e = { COMPONENT: "js-fmc-tooltip", TOOLTIP: "fmc-tooltip", POPUP_TOOLTIP: "fmc-tooltip--popup", TRIGGER: "fmc-tooltip__trigger", CONTENT: "fmc-tooltip__content", WRAPPER: "fmc-tooltip__wrapper", POINTER: "fmc-tooltip__pointer", POINTER_FIX: "fmc-tooltip__pointer-fix", OPENED: "fmc-tooltip--opened", FOCUSED: "fmc-tooltip--focused", TOP: "fmc-tooltip--top", RIGHT: "fmc-tooltip--right", BOTTOM: "fmc-tooltip--bottom", LEFT: "fmc-tooltip--left", MEASURE: "fmc-tooltip__content--measure", CLOSE_BTN: "fmc-tooltip__close", CLEAR_ICON: "fds-font--ford-icons__clear", FDS_ICON: "fds-icon", HEADER: "fmc-tooltip__header", BODY: "fmc-tooltip__body", MOBILE: "fmc-tooltip--mobile" }, Kn = 1023, B0 = ({ className: t, position: e = "auto", tooltipContent: n, isPopupTip: r = !1, popupTipHeader: a, popupTipBody: i, uniqueIdentifier: o = "tooltip-unique-identifier", children: s, closeOnOutsideClick: l = !1, onClose: d }) => { const [c, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [h, p] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [m, _] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), $ = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), N = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); let y; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { e === "auto" && P(), r && window.addEventListener("resize", M); }, []), (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => { r && window.innerWidth < Kn && p(!0); }, [$]); const T = (C) => { C.key === "Escape" && k(); }, D = (C) => { C.key === "Tab" && (r || R()); }, U = () => { c ? k() : (V(), R()); }, I = () => { k(), N.current?.focus(); }, R = () => { V(), f(!0); }, k = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => { f(!1), r && d && d(); }, [d, r]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { if (l) { const C = (O) => { if (g.current && !g.current.contains(O.target)) { const x = document.querySelector("body"); x.style.setProperty("overflow", "unset"), x.style.setProperty("pointer-events", "unset"), c && k(); } }; return window.addEventListener("click", C), () => { window.removeEventListener("click", C); }; } else return; }, [c, k]); const P = () => { if (g.current?.classList.add($e.TOP), _("top"), !v.current) return; let C = v.current.getBoundingClientRect(); C.top < 0 && (C = v.current.getBoundingClientRect(), g.current?.classList.remove($e.TOP), g.current?.classList.add($e.RIGHT), _("right")), C.right > window.innerWidth && (C = v.current.getBoundingClientRect(), g.current?.classList.remove($e.RIGHT, $e.TOP), g.current?.classList.add($e.BOTTOM), _("bottom")), C.bottom > window.innerHeight && C.right > window.innerWidth && (C = v.current.getBoundingClientRect(), g.current?.classList.remove($e.RIGHT, $e.TOP, $e.BOTTOM), g.current?.classList.add($e.LEFT), _("left")); }, V = async () => { if ($.current) { $.current.style.removeProperty("top"), $.current.style.removeProperty("right"), $.current.style.removeProperty("bottom"), $.current.style.removeProperty("left"); const C = $.current.getBoundingClientRect(); window.innerWidth <= Kn || (C.top < 0 ? $.current.style.top = `${Math.abs(C.top)}px` : $.current.style.removeProperty("top"), window.innerWidth - C.right < 0 ? $.current.style.right = `${Math.abs( window.innerWidth - C.right )}px` : $.current.style.removeProperty("right"), C.bottom > window.innerHeight ? $.current.style.bottom = `${Math.abs( C.bottom - window.innerHeight )}px` : $.current.style.removeProperty("bottom"), C.left < 0 ? $.current.style.left = `${Math.abs(C.left)}px` : $.current.style.removeProperty("left")); } }, M = () => { r && window.innerWidth <= Kn ? p(!0) : p(!1); }; return r && (y = [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { id: `${o}-header`, className: $e.HEADER, children: a }, "header" ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { id: `${o}-body`, className: $e.BODY, children: i }, "body" ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: E( $e.CLOSE_BTN, $e.CLEAR_ICON, $e.FDS_ICON ), "aria-label": "close tooltip", onClick: I }, "close" ) ]), // eslint-disable-next-line /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( $e.COMPONENT, $e.TOOLTIP, r && $e.POPUP_TOOLTIP, c && $e.OPENED, h && $e.MOBILE, (e === "top" || m === "top") && $e.TOP, (e === "bottom" || m === "bottom") && $e.BOTTOM, (e === "left" || m === "left") && $e.LEFT, (e === "right" || m === "right") && $e.RIGHT, t ), "data-slug": o, "data-position": e, onKeyUp: () => T, ref: g, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: $e.TRIGGER, "aria-describedby": r ? void 0 : o, onClick: r ? U : void 0, onKeyUp: () => D, onMouseOver: r ? void 0 : R, onMouseOut: r ? void 0 : k, onBlur: r ? void 0 : k, ref: N, type: "button", children: s } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { id: o, className: $e.WRAPPER, role: r ? "dialog" : "tooltip", "aria-hidden": !c, "aria-modal": r ? "true" : void 0, "aria-labelledby": r ? `${o}-header` : void 0, "aria-describedby": r ? `${o}-body` : void 0, ref: v, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: $e.CONTENT, ref: $, children: [ !r && n, r && y ] }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: $e.POINTER, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: $e.POINTER_FIX }) }) ] } ) ] } ); }, Te = { COMPONENT: "js-fmc-overflow-menu", OVERFLOW_MENU: "fmc-overflow-menu", POPUP_OVERFLOW_MENU: "fmc-overflow-menu--popup", TRIGGER: "fmc-overflow-menu__trigger", CONTENT: "fmc-overflow-menu__content", WRAPPER: "fmc-overflow-menu__wrapper", POINTER: "fmc-overflow-menu__pointer", POINTER_FIX: "fmc-overflow-menu__pointer-fix", OPENED: "fmc-overflow-menu--opened", FOCUSED: "fmc-overflow-menu--focused", TOP: "fmc-overflow-menu--top", RIGHT: "fmc-overflow-menu--right", BOTTOM: "fmc-overflow-menu--bottom", LEFT: "fmc-overflow-menu--left", MEASURE: "fmc-overflow-menu--measure", CLOSE_BTN: "fmc-overflow-menu", CLEAR_ICON: "fds-font--ford-icons__clear", FDS_ICON: "fds-icon", MOBILE: "fmc-overflow-menu--mobile", DIVIDER: "fmc-overflow-menu__divider" }, U0 = 600; const e2 = ({ overflowMenuIcon: t, children: e, position: n = "auto", uniqueIdentifier: r = "overflowmenu-unique-identifier" }) => { const [a, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [o, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), d = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), h = () => { a ? _() : m(); }, p = ($) => { $.key === "Tab" && m(); }, m = () => { g(), i(!0); }, _ = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => { i(!1); }, []), g = async () => { if (c.current) { c.current.style.removeProperty("top"), c.current.style.removeProperty("right"), c.current.style.removeProperty("bottom"), c.current.style.removeProperty("left"); const $ = c.current.getBoundingClientRect(); window.innerWidth <= U0 || ($.top < 0 ? c.current.style.top = `${Math.abs($.top)}px` : c.current.style.removeProperty("top"), window.innerWidth - $.right < 0 ? c.current.style.right = `${Math.abs( window.innerWidth - $.right )}px` : c.current.style.removeProperty("right"), $.bottom > window.innerHeight ? c.current.style.bottom = `${Math.abs( $.bottom - window.innerHeight )}px` : c.current.style.removeProperty("bottom"), $.left < 0 ? c.current.style.left = `${Math.abs($.left)}px` : c.current.style.removeProperty("left")); } }; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { const $ = (N) => { l.current && !l.current.contains(N.target) && a && _(); }; return window.addEventListener("click", $), () => { window.removeEventListener("click", $); }; }, [a, _]); const v = () => { if (l.current?.classList.add(Te.TOP), s("top"), !d.current) return; let $ = d.current.getBoundingClientRect(); d.current.offsetTop < 0 && ($ = d.current.getBoundingClientRect(), l.current?.classList.remove(Te.TOP), l.current?.classList.add(Te.RIGHT), s("right")), $.right > window.innerWidth && ($ = d.current.getBoundingClientRect(), l.current?.classList.remove(Te.RIGHT, Te.TOP), l.current?.classList.add(Te.BOTTOM), s("bottom")), $.bottom > window.innerHeight && $.right > window.innerWidth && ($ = d.current.getBoundingClientRect(), l.current?.classList.remove(Te.RIGHT, Te.TOP, Te.BOTTOM), l.current?.classList.add(Te.LEFT), s("left")); }; return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { n === "auto" && v(); }, []), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { className: E( Te.COMPONENT, Te.OVERFLOW_MENU, a && Te.OPENED, (n === "top" || o === "top") && Te.TOP, (n === "bottom" || o === "bottom") && Te.BOTTOM, (n === "left" || o === "left") && Te.LEFT, (n === "right" || o === "right") && Te.RIGHT ), "data-slug": r, "data-position": n, ref: l, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: Te.TRIGGER, "aria-describedby": r, onKeyUp: () => p, onClick: h, type: "button", ref: f, children: t } ), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "div", { id: r, className: Te.WRAPPER, role: "menu", "aria-hidden": !a, ref: d, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: Te.CONTENT, children: e }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: Te.POINTER, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: Te.POINTER_FIX }) }) ] } ) ] } ); }, H0 = { COMPONENT: "cxc-overflow-menu-item" }, t2 = ({ onClick: t, children: e }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "li", { className: H0.COMPONENT, tabIndex: 0, onKeyDown: (n) => { (n.code === "Space" || n.code === "Enter") && t(); }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "item-text", onClick: t, children: e }) } ), n2 = () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: Te.DIVIDER }), si = { SLIDER: "fmc-slider", SLIDER_INPUT: "fmc-slider__input" }, W0 = "SLIDER_DATA_TEST_ID", V0 = "Slider", r2 = ({ label: t, min: e, max: n, value: r, step: a, onChange: i, name: o, id: s, dataTestId: l = W0 }) => { const [d, c] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(r), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(Ve(s ?? V0)), h = (p) => { c(p.target.value), i && i(p, p.target.value); }; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: si.SLIDER, children: [ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: f.current, children: t }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "input", { className: si.SLIDER_INPUT, type: "range", id: f.current, "data-testid": l, name: o, min: e, max: n, value: d, step: a, onChange: h } ) ] }); }, Nn = react__WEBPACK_IMPORTED_MODULE_1__.createContext({}); Nn.displayName = "TrackerContext"; const ve = { TRACKER: "fmc-tracker", EDIT_ICON: "fds-font--ford-icons__edit", SUCCESS_ICON: "fds-font--ford-icons__success", PAST_STEP: "fmc-tracker__step--complete", DOT_FILLED: "fmc-tracker__dot--filled", DISABLED_STEP: "fds__step--disabled", SIMPLE_TRACKER: "fmc-tracker--simple", TRACKER_TITLE_DISABLED: "fmc-tracker__title--disabled", TRACKER_TITLE_FUTURE: "fmc-tracker__title--future", TRACKER_STEP_DOT: "fmc-tracker__dot", TRACKER_STEP_ACTIVE_DOT: "fmc-tracker__dot--active", TRACKER_STEP_FILLED_DOT: "fmc-tracker__dot--filled cxc-tracker__dot--filled", TRACKER_STEP_SUCCESS_DOT: "fmc-tracker__dot--success", TRACKER_STEP_HOVER_DOT: "fds__step--hover", TRACKER_STEP_DISABLED_DOT: "fds__step--disabled", TRACKER_STEP_SIMPLE_DOT: "cxc-tracker__dot-simple", TRACKER_STEP_DIRTY_DOT: "cxc-tracker__dot--dirty", TRACKER_STEP_ICON: "cxc-tracker__dot_icon", TRACKER_STEP: "fmc-tracker__step", TRACKER_STEP_CURRENT: "fmc-tracker__step--current", TRACKER_STEP_COMPLETE: "fmc-tracker__step--complete", TRACKER_STEP_TOOOLTIP: "cxc-tracker__simple__step__tooltip", TRACKER_STEP_TOOOLTIP_VERTICAL: "cxc-tracker__simple__step__tooltip__vertical", TRACKER_STEP_CONTENT: "fmc-tracker__step__content", TRACKER_STEP_LABEL: "fmc-tracker__title", TRACKER_STEP_LABEL_VERTICAL: "cxc-tracker__title--vertical", VERTICAL_TRACKER: "cxc-tracker__vertical", VERTICAL_TRACKER_ANIMATION: "cxc-tracker__vertical__animation", VERTICAL_TRACKER_TITLE: "cxc-tracker__title--vertical" }, G0 = "TRACKER_WRAPPER_ELEMENT_DATA_TEST_ID", K0 = ({ disabled: t = !1, type: e = "progress", nonLinear: n = !1, animation: r = !1, children: a, orientation: i = "horizontal", activeStep: o, className: s }) => { const l = i === "horizontal", d = e === "simple", [c, f] = react__WEBPACK_IMPORTED_MODULE_1__.useState([]), [h, p] = react__WEBPACK_IMPORTED_MODULE_1__.useState(0), m = react__WEBPACK_IMPORTED_MODULE_1__.useRef([]), _ = a.type === react__WEBPACK_IMPORTED_MODULE_1__.Fragment ? a.props.children : a, g = react__WEBPACK_IMPORTED_MODULE_1__.Children.map( _, (y, T) => y.type.displayName === "TrackerStep" ? react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(y, { _stepIndex: T, disabled: t || y.props.disabled, ref: (D) => m.current[T] = D }) : react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(y, { ref: (D) => m.current[T] = D }) ); react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => { if (r) { const y = []; for (let T = 0; T < g.length; T++) l ? y.push( m.current[T]?.getBoundingClientRect().width ) : y.push( m.current[T]?.getBoundingClientRect().height ); f(y); } o > h && p(o); }, [m, o]); const v = _[o]?.props?.children?.find( (y) => y.type.displayName === "TrackerStepContent" ), $ = r ? l ? { left: `calc(50% - (${c[o]}px / 2) - ${c.reduce( (y, T, D) => y + (D < o ? T : 0), 0 )}px)`, transition: "left 0.3s ease-in-out" } : { top: `calc(50% - (${c[o]}px / 2) - ${c.reduce( (y, T, D) => y + (D < o ? T : 0), 0 )}px)`, transition: "top 0.3s ease-in-out" } : {}, N = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "ul", { style: $, className: E( ve.TRACKER, !l && ve.VERTICAL_TRACKER, r && !l && ve.VERTICAL_TRACKER_ANIMATION, d && ve.SIMPLE_TRACKER, s ), "data-testid": G0, children: g }, "TRACKER_STEPS_WRAPPER" ); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( Nn.Provider, { value: { activeStep: o, numberOfSteps: g.length, isHorizontal: l, type: e, nonLinear: n, highestViewedStep: h }, children: [ N, l && v ] } ); }; K0.displayName = "Tracker"; const j0 = "STEP_LABEL_DATA_TEST_ID", To = ({ children: t, className: e, dataTestId: n = j0 }) => { const { isHorizontal: r } = react__WEBPACK_IMPORTED_MODULE_1__.useContext(Nn), a = ["number", "string"].includes(typeof t) ? "p" : "div"; return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( a, { className: E( ve.TRACKER_STEP_LABEL, !r && ve.TRACKER_STEP_LABEL_VERTICAL, e ), "data-testid": n, children: t } ); }; To.displayName = "TrackerStepLabel"; const Y0 = "TRACKER_STEP_ICON_ELEMENT_DATA_TEST_ID", z0 = "BUTTON_DATA_TEST_ID", X0 = "TRACKER_STEP_LABEL_TEST_ID", q0 = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef( ({ key: t, _stepIndex: e, disabled: n, onClick: r, children: a, completed: i, editable: o = !1, className: s, dataTestId: l = "TRACKER_STEP_DATA_TEST_ID" }, d) => { const { isHorizontal: c, activeStep: f, type: h, numberOfSteps: p, nonLinear: m, highestViewedStep: _ } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Nn), g = f === e, v = f > e, $ = f < e, N = i === void 0 ? v : i, y = v || N, T = h === "simple", D = h !== "simple" && e <= _ && !g && !N, [U, I] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { o && N && (I(!0), setTimeout(() => I(!1), 300)); }, [N]); const R = Array.isArray(a) ? a : [a], k = R.find( (Z) => Z.type?.displayName === "TrackerStepContent" ), P = ["number", "string", "boolean"].includes( typeof a ) ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(To, { children: a }) : react__WEBPACK_IMPORTED_MODULE_1__.Children.map( R.filter( (Z) => Z.type.displayName !== "TrackerStepContent" ), (Z) => Z.type.displayName === "TrackerStepLabel" ? react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(Z, { className: E( n && ve.TRACKER_TITLE_DISABLED, $ && ve.TRACKER_TITLE_FUTURE, Z.props.className ) }) : Z ), V = () => T ? !1 : y || D || g, M = () => g && !i && !o || g && o ? "edit" : D ? "warning-filled" : o && !U ? "edit" : "success", C = V() ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( Wt, { name: M(), dataTestId: `${Y0}_${e}`, className: ve.TRACKER_STEP_ICON } ) : T ? "" : h === "timeline" ? e + 1 : `${e + 1}/${p}`, O = `${e + 1} of ${p}`, x = m || o && v || T && v, b = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "button", { className: E( ve.TRACKER_STEP_DOT, g && ve.TRACKER_STEP_ACTIVE_DOT, y && ve.TRACKER_STEP_FILLED_DOT, v && ve.TRACKER_STEP_SUCCESS_DOT, x && ve.TRACKER_STEP_HOVER_DOT, n && ve.TRACKER_STEP_DISABLED_DOT, T && ve.TRACKER_STEP_SIMPLE_DOT, D && ve.TRACKER_STEP_DIRTY_DOT ), disabled: n, onClick: x ? (Z) => r?.(Z) : void 0, "aria-label": N ? "Complete" : void 0, "aria-current": g ? "step" : void 0, "data-testid": `${z0}_${e}`, children: C } ), w = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( B0, { className: E( ve.TRACKER_STEP_TOOOLTIP, !c && ve.TRACKER_STEP_TOOOLTIP_VERTICAL ), position: "top", tooltipContent: O, children: b } ); return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)( "li", { className: E( ve.TRACKER_STEP, g && ve.TRACKER_STEP_CURRENT, v && ve.TRACKER_STEP_COMPLETE, s ), "data-testid": l, ref: d, children: [ T ? w : b, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { "data-testid": `${X0}_${e}`, children: [ P, g && !c && k ] }) ] }, t ); } ); q0.displayName = "TrackerStep"; const Z0 = "TRACKER_STEP_CONTENT_DATA_TEST_ID", J0 = ({ children: t, className: e, dataTestId: n = Z0 }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)( "div", { "data-testid": n, className: E(ve.TRACKER_STEP_CONTENT, e), children: t } ); J0.displayName = "TrackerStepContent"; const Q0 = 7e3, a2 = () => { const [t, e] = react__WEBPACK_IMPORTED_MODULE_1___default().useState(""), [n, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(void 0), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), i = () => { e(""), r(void 0); }, o = (d = " Success ✔︎") => { e(d), r("success"); }; return { validationMessage: t, validationMessageType: n, clearValidation: i, setValidationSuccess: o, setValidationError: (d = "An error occurred") => { e(d), r("error"); }, setTimedValidationSuccess: (d = Q0) => { a.current && clearTimeout(a.current), o(), a.current = setTimeout(() => { e(""); }, d); } }; }; /***/ }), /***/ "./node_modules/@cxc/react-universal-components/index.js": /*!***************************************************************!*\ !*** ./node_modules/@cxc/react-universal-components/index.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CART_REFRESH_EVENT: () => (/* binding */ CART_REFRESH_EVENT), /* harmony export */ CART_STORAGE_KEY: () => (/* binding */ CART_STORAGE_KEY), /* harmony export */ SCOPEDCONTEXT_STORAGEKEY: () => (/* binding */ SCOPEDCONTEXT_STORAGEKEY), /* harmony export */ UNIVERSALCONTEXTPUSH: () => (/* binding */ UNIVERSALCONTEXTPUSH), /* harmony export */ UNIVERSALCONTEXTSCOPEDPROPERTYPUSH: () => (/* binding */ UNIVERSALCONTEXTSCOPEDPROPERTYPUSH), /* harmony export */ UNIVERSALCONTEXTSCOPEDPROPERTYUPDATE: () => (/* binding */ UNIVERSALCONTEXTSCOPEDPROPERTYUPDATE), /* harmony export */ UNIVERSALCONTEXTUPDATE: () => (/* binding */ UNIVERSALCONTEXTUPDATE), /* harmony export */ UNIVERSALCONTEXT_REQUEST_ROUTER_NAVIGATE_EVENT: () => (/* binding */ UNIVERSALCONTEXT_REQUEST_ROUTER_NAVIGATE_EVENT), /* harmony export */ UNIVERSALCONTEXT_STORAGEKEY: () => (/* binding */ UNIVERSALCONTEXT_STORAGEKEY), /* harmony export */ UniversalContextDefaultStateProxy: () => (/* binding */ UniversalContextDefaultStateProxy), /* harmony export */ UniversalContextProvider: () => (/* binding */ UniversalContextProvider), /* harmony export */ universalStateSubscribe: () => (/* binding */ universalStateSubscribe), /* harmony export */ useUniversalContext: () => (/* binding */ useUniversalContext) /* harmony export */ }); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.assign.js */ "./node_modules/core-js/modules/es.object.assign.js"); /* harmony import */ var core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react/react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var valtio__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! valtio */ "./node_modules/valtio/esm/vanilla.mjs"); /* harmony import */ var valtio__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! valtio */ "./node_modules/valtio/esm/react.mjs"); function transformEnvironmentString(envString) { switch (envString.toLowerCase()) { case 'development': case 'dev': case 'test': return 'dev'; case 'stage': case 'stg': return 'stg'; case 'production': case 'prd': case 'prod': return 'prd'; case 'local': return 'local'; default: return envString; } } // Unique ID creation requires a high quality random # generator. In the browser we therefore // require the crypto API and do not support built-in fallback to lower quality random number // generators (like Math.random()). let getRandomValues; const rnds8 = new Uint8Array(16); function rng() { // lazy load so that environments that need to polyfill have a chance to do so if (!getRandomValues) { // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); if (!getRandomValues) { throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); } } return getRandomValues(rnds8); } /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ const byteToHex = []; for (let i = 0; i < 256; ++i) { byteToHex.push((i + 0x100).toString(16).slice(1)); } function unsafeStringify(arr, offset = 0) { // Note: Be careful editing this code! It's been tuned for performance // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); var native = { randomUUID }; function v4(options, buf, offset) { if (native.randomUUID && !buf && !options) { return native.randomUUID(); } options = options || {}; const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = rnds[6] & 0x0f | 0x40; rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided if (buf) { offset = offset || 0; for (let i = 0; i < 16; ++i) { buf[offset + i] = rnds[i]; } return buf; } return unsafeStringify(rnds); } const initialUniversalStateObject = { language: 'en-us', environment: undefined, isLoggedIn: false, user: undefined, notifications: [] }; const UniversalContextDefaultStateProxy = (0,valtio__WEBPACK_IMPORTED_MODULE_6__.proxy)(initialUniversalStateObject); const universalStateSubscribe = callback => { return (0,valtio__WEBPACK_IMPORTED_MODULE_6__.subscribe)(UniversalContextDefaultStateProxy, () => callback(UniversalContextDefaultStateProxy)); }; const CART_REFRESH_EVENT = 'cartRefresh'; const CART_STORAGE_KEY = 'cart'; const SCOPEDCONTEXT_STORAGEKEY = 'scoped-context'; const UNIVERSALCONTEXT_STORAGEKEY = 'universal-context'; const UNIVERSALCONTEXTUPDATE = 'universal-context-update'; const UNIVERSALCONTEXTPUSH = 'universal-context-push'; const UNIVERSALCONTEXTSCOPEDPROPERTYUPDATE = 'universal-context-scoped-property-update'; const UNIVERSALCONTEXTSCOPEDPROPERTYPUSH = 'universal-context-scoped-property-push'; const UNIVERSALCONTEXT_REQUEST_ROUTER_NAVIGATE_EVENT = 'universal-context-request-router-navigate'; const validateCartItem = cartItem => { const stringTypeCheck = value => { return Object.prototype.toString.call(value) === '[object String]'; }; const intTypeCheck = value => { return Object.prototype.toString.call(value) === '[object Number]'; }; if ( // eslint-disable-next-line no-prototype-builtins !cartItem.hasOwnProperty('id') || // eslint-disable-next-line no-prototype-builtins !cartItem.hasOwnProperty('name') || // eslint-disable-next-line no-prototype-builtins !cartItem.hasOwnProperty('imageUrls') || // eslint-disable-next-line no-prototype-builtins !cartItem.hasOwnProperty('price') || // eslint-disable-next-line no-prototype-builtins !cartItem.hasOwnProperty('description') || // eslint-disable-next-line no-prototype-builtins !cartItem.hasOwnProperty('quantity') || // eslint-disable-next-line no-prototype-builtins !cartItem.hasOwnProperty('metadata')) { throw new Error('Invalid Cart item'); } if (!stringTypeCheck(cartItem.id) || !stringTypeCheck(cartItem.name) || !Array.isArray(cartItem.imageUrls) || !intTypeCheck(cartItem.price) || !stringTypeCheck(cartItem.description) || !intTypeCheck(cartItem.quantity)) { throw new Error('Invalid Cart item'); } }; let existingScopedContextInStorage; try { existingScopedContextInStorage = JSON.parse(sessionStorage.getItem(SCOPEDCONTEXT_STORAGEKEY)); // eslint-disable-next-line no-empty } catch (error) {} const scopedContextProxy = (0,valtio__WEBPACK_IMPORTED_MODULE_6__.proxy)([...new Array(), ...(existingScopedContextInStorage || [])]); let existingContextInStorage; try { existingContextInStorage = JSON.parse(sessionStorage.getItem(UNIVERSALCONTEXT_STORAGEKEY)); } catch (error) { existingContextInStorage = null; } const contextProxy = (0,valtio__WEBPACK_IMPORTED_MODULE_6__.proxy)(Object.assign(Object.assign({}, initialUniversalStateObject), existingContextInStorage)); const useUniversalContext = state => { if (state) { Object.keys(state).forEach(key => { if (existingContextInStorage === null || existingContextInStorage === void 0 ? void 0 : existingContextInStorage[key]) { contextProxy[key] = existingContextInStorage[key]; } else { contextProxy[key] = state[key]; } }); } const { language, environment, isLoggedIn, user, notifications } = (0,valtio__WEBPACK_IMPORTED_MODULE_7__.useSnapshot)(contextProxy); const broadcastUniversalContextUpdate = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)((propertyName, propertyValue) => { const payload = { language, environment, isLoggedIn, user, [propertyName]: propertyValue }; sessionStorage.setItem(UNIVERSALCONTEXT_STORAGEKEY, JSON.stringify(payload)); const event = new CustomEvent(UNIVERSALCONTEXTUPDATE, { detail: payload }); document.dispatchEvent(event); }, [language, environment, isLoggedIn, user]); (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => { const silentUpdateProperty = (propertyName, propertyValue) => { contextProxy[propertyName] = propertyValue; broadcastUniversalContextUpdate(propertyName, propertyValue); }; document.addEventListener(UNIVERSALCONTEXTPUSH, e => silentUpdateProperty(e.detail.propertyName, e.detail.propertyValue)); return document.removeEventListener(UNIVERSALCONTEXTPUSH, e => silentUpdateProperty(e.detail.propertyName, e.detail.propertyValue)); }, [broadcastUniversalContextUpdate]); //setters const setIsLoggedIn = isLoggedIn => { contextProxy.isLoggedIn = isLoggedIn; broadcastUniversalContextUpdate('isLoggedIn', isLoggedIn); return isLoggedIn; }; const setEnvironment = environment => { contextProxy.environment = transformEnvironmentString(environment); broadcastUniversalContextUpdate('environment', environment); return contextProxy.environment; }; const setLanguage = language => { contextProxy.language = language; broadcastUniversalContextUpdate('language', language); return language; }; const setPropertyValue = (propertyName, propertyValue) => { contextProxy[propertyName] = propertyValue; broadcastUniversalContextUpdate(propertyName, propertyValue); }; const setUser = user => { contextProxy.user = user; broadcastUniversalContextUpdate('user', user); return user; }; const addNotification = notification => { contextProxy.notifications = [...contextProxy.notifications, Object.assign(Object.assign({}, notification), { id: v4() })]; broadcastUniversalContextUpdate('notifications', contextProxy.notifications); return notifications; }; const removeNotification = id => { contextProxy.notifications = [...contextProxy.notifications.filter(notification => notification.id !== id)]; broadcastUniversalContextUpdate('notifications', contextProxy.notifications); return notifications; }; const getCartItems = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)(() => { const cartItems = localStorage.getItem(CART_STORAGE_KEY); return cartItems ? JSON.parse(cartItems) : []; }, []); const addToCart = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)(item => { validateCartItem(item); const updatedCart = [...getCartItems(), item]; localStorage.setItem(CART_STORAGE_KEY, JSON.stringify(updatedCart)); document.dispatchEvent(new CustomEvent(CART_REFRESH_EVENT, { detail: updatedCart })); }, [getCartItems]); const getCartItemById = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)(itemId => { return getCartItems().find(item => item.id === itemId); }, [getCartItems]); const removeCartItemById = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)(itemId => { const updatedCart = [...getCartItems().filter(item => item.id !== itemId)]; localStorage.setItem(CART_STORAGE_KEY, JSON.stringify(updatedCart)); document.dispatchEvent(new CustomEvent(CART_REFRESH_EVENT, { detail: updatedCart })); }, [getCartItems]); const updateCartItemById = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)((updatedItemId, payload) => { validateCartItem(payload); let updatedCartItem = getCartItems().find(item => item.id === updatedItemId); updatedCartItem = Object.assign(Object.assign({}, updatedCartItem), payload); const updatedCart = getCartItems().map(item => { if (item.id === updatedItemId) { return updatedCartItem; } return item; }); localStorage.setItem(CART_STORAGE_KEY, JSON.stringify(updatedCart)); document.dispatchEvent(new CustomEvent(CART_REFRESH_EVENT, { detail: updatedCart })); }, [getCartItems]); const clearCart = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)(() => { localStorage.setItem(CART_STORAGE_KEY, JSON.stringify([])); document.dispatchEvent(new CustomEvent(CART_REFRESH_EVENT, { detail: [] })); }, []); const scopedContextSnapShot = (0,valtio__WEBPACK_IMPORTED_MODULE_7__.useSnapshot)(scopedContextProxy); const setScopedValue = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)((scope, propertyName, propertyValue, isScopedToUser) => { //find the context or create it const propertyScope = scopedContextProxy.find(sp => sp.scope === scope); if (!propertyScope) { scopedContextProxy.push({ scope, isScopedToUser, properties: [{ name: propertyName, value: propertyValue }] }); } else { //it already exists, so update let scopedProperty = propertyScope.properties.find(v => v.name === propertyName); if (!scopedProperty) { scopedProperty = { name: propertyName, value: propertyValue }; propertyScope.properties.push(scopedProperty); } scopedProperty.value = propertyValue; } sessionStorage.setItem(SCOPEDCONTEXT_STORAGEKEY, JSON.stringify(scopedContextProxy)); const event = new CustomEvent(UNIVERSALCONTEXTSCOPEDPROPERTYUPDATE, { detail: { scope, propertyName, propertyValue, isScopedToUser, scopedContext: JSON.parse(JSON.stringify(scopedContextProxy)) } }); document.dispatchEvent(event); }, []); (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => { document.addEventListener(UNIVERSALCONTEXTSCOPEDPROPERTYPUSH, e => setScopedValue(e.detail.scope, e.detail.propertyName, e.detail.propertyValue, e.detail.isScopedToUser)); return document.removeEventListener(UNIVERSALCONTEXTSCOPEDPROPERTYPUSH, e => setScopedValue(e.detail.scope, e.detail.propertyName, e.detail.propertyValue, e.detail.isScopedToUser)); }, [setScopedValue]); const subscribeScopedValue = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)((scope, propertyName) => { const scopedContext = scopedContextSnapShot.find(sp => sp.scope === scope); if (!scopedContext) { return null; } const scopedProperty = scopedContext.properties.find(v => v.name === propertyName); if (!scopedProperty) { return null; } return scopedProperty.value; }, [scopedContextSnapShot]); /* Method to clear the scoped properties. This method will clear all scoped properties unless a scope is specified in which case only properties for that scope will be cleared. */ const clearScopedValues = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)(scope => { //if you don't specify scope, remove everything if (!scope) { scopedContextProxy.forEach((context, index, array) => array.pop()); } else { //remove only the properties on the specified scope const scopedContext = scopedContextProxy.find(sp => sp.scope === scope); if (!scopedContext) { return; } scopedContext.properties = []; } sessionStorage.setItem(SCOPEDCONTEXT_STORAGEKEY, JSON.stringify(scopedContextProxy)); const event = new CustomEvent(UNIVERSALCONTEXTSCOPEDPROPERTYUPDATE, { detail: { scope, scopedContext: JSON.parse(JSON.stringify(scopedContextProxy)) } }); document.dispatchEvent(event); }, []); /* Method to clear all isScopedToUser scoped properties. This method will clear all scoped properties where the property isScopedToUser equals true on the scoped property. */ const clearScopedToUserProperties = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)(() => { scopedContextProxy.forEach((context, index, array) => { if (context.isScopedToUser) { array.splice(index, 1); } }); sessionStorage.setItem(SCOPEDCONTEXT_STORAGEKEY, JSON.stringify(scopedContextProxy)); const event = new CustomEvent(UNIVERSALCONTEXTSCOPEDPROPERTYUPDATE, { detail: { clearScopedToUserProperties: true, scopedContext: JSON.parse(JSON.stringify(scopedContextProxy)) } }); document.dispatchEvent(event); }, []); /* Broadcast a navigation request */ const navigate = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)((to, replace, state) => { const event = new CustomEvent(UNIVERSALCONTEXT_REQUEST_ROUTER_NAVIGATE_EVENT, { detail: { to, replace, state } }); document.dispatchEvent(event); }, []); /* Broadcast a caught error */ const reportError = (0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)(error => { const errorId = v4(); //Emit a notification upon errors being reported (only if it's a non-view error) if (!error.viewContext) { const errorNotification = { id: errorId, variant: 'error', body: error.errorPayload }; contextProxy.notifications = [...contextProxy.notifications, errorNotification]; } }, []); return { setIsLoggedIn, isLoggedIn, setEnvironment, environment, setLanguage, language, setPropertyValue, setScopedValue, subscribeScopedValue, clearScopedValues, clearScopedToUserProperties, addToCart, getCartItems, getCartItemById, removeCartItemById, updateCartItemById, clearCart, user: user, setUser, notifications: notifications, addNotification, removeNotification, CART_REFRESH_EVENT, navigate, UNIVERSALCONTEXT_REQUEST_ROUTER_NAVIGATE_EVENT, reportError }; }; const UniversalContextProvider = ({ children }) => { const { setLanguage, language } = useUniversalContext(); (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => { if (!language) { setLanguage(navigator.languages ? navigator.languages[0] : 'en-us'); } }, [setLanguage, language]); return children; }; /***/ }), /***/ "./node_modules/@remix-run/router/dist/router.js": /*!*******************************************************!*\ !*** ./node_modules/@remix-run/router/dist/router.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AbortedDeferredError: () => (/* binding */ AbortedDeferredError), /* harmony export */ Action: () => (/* binding */ Action), /* harmony export */ IDLE_BLOCKER: () => (/* binding */ IDLE_BLOCKER), /* harmony export */ IDLE_FETCHER: () => (/* binding */ IDLE_FETCHER), /* harmony export */ IDLE_NAVIGATION: () => (/* binding */ IDLE_NAVIGATION), /* harmony export */ UNSAFE_DEFERRED_SYMBOL: () => (/* binding */ UNSAFE_DEFERRED_SYMBOL), /* harmony export */ UNSAFE_DeferredData: () => (/* binding */ DeferredData), /* harmony export */ UNSAFE_ErrorResponseImpl: () => (/* binding */ ErrorResponseImpl), /* harmony export */ UNSAFE_convertRouteMatchToUiMatch: () => (/* binding */ convertRouteMatchToUiMatch), /* harmony export */ UNSAFE_convertRoutesToDataRoutes: () => (/* binding */ convertRoutesToDataRoutes), /* harmony export */ UNSAFE_getPathContributingMatches: () => (/* binding */ getPathContributingMatches), /* harmony export */ UNSAFE_invariant: () => (/* binding */ invariant), /* harmony export */ UNSAFE_warning: () => (/* binding */ warning), /* harmony export */ createBrowserHistory: () => (/* binding */ createBrowserHistory), /* harmony export */ createHashHistory: () => (/* binding */ createHashHistory), /* harmony export */ createMemoryHistory: () => (/* binding */ createMemoryHistory), /* harmony export */ createPath: () => (/* binding */ createPath), /* harmony export */ createRouter: () => (/* binding */ createRouter), /* harmony export */ createStaticHandler: () => (/* binding */ createStaticHandler), /* harmony export */ defer: () => (/* binding */ defer), /* harmony export */ generatePath: () => (/* binding */ generatePath), /* harmony export */ getStaticContextFromError: () => (/* binding */ getStaticContextFromError), /* harmony export */ getToPathname: () => (/* binding */ getToPathname), /* harmony export */ isDeferredData: () => (/* binding */ isDeferredData), /* harmony export */ isRouteErrorResponse: () => (/* binding */ isRouteErrorResponse), /* harmony export */ joinPaths: () => (/* binding */ joinPaths), /* harmony export */ json: () => (/* binding */ json), /* harmony export */ matchPath: () => (/* binding */ matchPath), /* harmony export */ matchRoutes: () => (/* binding */ matchRoutes), /* harmony export */ normalizePathname: () => (/* binding */ normalizePathname), /* harmony export */ parsePath: () => (/* binding */ parsePath), /* harmony export */ redirect: () => (/* binding */ redirect), /* harmony export */ redirectDocument: () => (/* binding */ redirectDocument), /* harmony export */ resolvePath: () => (/* binding */ resolvePath), /* harmony export */ resolveTo: () => (/* binding */ resolveTo), /* harmony export */ stripBasename: () => (/* binding */ stripBasename) /* harmony export */ }); /** * @remix-run/router v1.11.0 * * Copyright (c) Remix Software Inc. * * 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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } //////////////////////////////////////////////////////////////////////////////// //#region Types and Constants //////////////////////////////////////////////////////////////////////////////// /** * Actions represent the type of change to a location value. */ var Action; (function (Action) { /** * A POP indicates a change to an arbitrary index in the history stack, such * as a back or forward navigation. It does not describe the direction of the * navigation, only that the current index changed. * * Note: This is the default action for newly created history objects. */ Action["Pop"] = "POP"; /** * A PUSH indicates a new entry being added to the history stack, such as when * a link is clicked and a new page loads. When this happens, all subsequent * entries in the stack are lost. */ Action["Push"] = "PUSH"; /** * A REPLACE indicates the entry at the current index in the history stack * being replaced by a new one. */ Action["Replace"] = "REPLACE"; })(Action || (Action = {})); const PopStateEventType = "popstate"; /** * Memory history stores the current location in memory. It is designed for use * in stateful non-browser environments like tests and React Native. */ function createMemoryHistory(options) { if (options === void 0) { options = {}; } let { initialEntries = ["/"], initialIndex, v5Compat = false } = options; let entries; // Declare so we can access from createMemoryLocation entries = initialEntries.map((entry, index) => createMemoryLocation(entry, typeof entry === "string" ? null : entry.state, index === 0 ? "default" : undefined)); let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex); let action = Action.Pop; let listener = null; function clampIndex(n) { return Math.min(Math.max(n, 0), entries.length - 1); } function getCurrentLocation() { return entries[index]; } function createMemoryLocation(to, state, key) { if (state === void 0) { state = null; } let location = createLocation(entries ? getCurrentLocation().pathname : "/", to, state, key); warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in memory history: " + JSON.stringify(to)); return location; } function createHref(to) { return typeof to === "string" ? to : createPath(to); } let history = { get index() { return index; }, get action() { return action; }, get location() { return getCurrentLocation(); }, createHref, createURL(to) { return new URL(createHref(to), "http://localhost"); }, encodeLocation(to) { let path = typeof to === "string" ? parsePath(to) : to; return { pathname: path.pathname || "", search: path.search || "", hash: path.hash || "" }; }, push(to, state) { action = Action.Push; let nextLocation = createMemoryLocation(to, state); index += 1; entries.splice(index, entries.length, nextLocation); if (v5Compat && listener) { listener({ action, location: nextLocation, delta: 1 }); } }, replace(to, state) { action = Action.Replace; let nextLocation = createMemoryLocation(to, state); entries[index] = nextLocation; if (v5Compat && listener) { listener({ action, location: nextLocation, delta: 0 }); } }, go(delta) { action = Action.Pop; let nextIndex = clampIndex(index + delta); let nextLocation = entries[nextIndex]; index = nextIndex; if (listener) { listener({ action, location: nextLocation, delta }); } }, listen(fn) { listener = fn; return () => { listener = null; }; } }; return history; } /** * Browser history stores the location in regular URLs. This is the standard for * most web apps, but it requires some configuration on the server to ensure you * serve the same app at multiple URLs. * * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory */ function createBrowserHistory(options) { if (options === void 0) { options = {}; } function createBrowserLocation(window, globalHistory) { let { pathname, search, hash } = window.location; return createLocation("", { pathname, search, hash }, // state defaults to `null` because `window.history.state` does globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); } function createBrowserHref(window, to) { return typeof to === "string" ? to : createPath(to); } return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options); } /** * Hash history stores the location in window.location.hash. This makes it ideal * for situations where you don't want to send the location to the server for * some reason, either because you do cannot configure it or the URL space is * reserved for something else. * * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory */ function createHashHistory(options) { if (options === void 0) { options = {}; } function createHashLocation(window, globalHistory) { let { pathname = "/", search = "", hash = "" } = parsePath(window.location.hash.substr(1)); // Hash URL should always have a leading / just like window.location.pathname // does, so if an app ends up at a route like /#something then we add a // leading slash so all of our path-matching behaves the same as if it would // in a browser router. This is particularly important when there exists a // root splat route () since that matches internally against // "/*" and we'd expect /#something to 404 in a hash router app. if (!pathname.startsWith("/") && !pathname.startsWith(".")) { pathname = "/" + pathname; } return createLocation("", { pathname, search, hash }, // state defaults to `null` because `window.history.state` does globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); } function createHashHref(window, to) { let base = window.document.querySelector("base"); let href = ""; if (base && base.getAttribute("href")) { let url = window.location.href; let hashIndex = url.indexOf("#"); href = hashIndex === -1 ? url : url.slice(0, hashIndex); } return href + "#" + (typeof to === "string" ? to : createPath(to)); } function validateHashLocation(location, to) { warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in hash history.push(" + JSON.stringify(to) + ")"); } return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options); } function invariant(value, message) { if (value === false || value === null || typeof value === "undefined") { throw new Error(message); } } function warning(cond, message) { if (!cond) { // eslint-disable-next-line no-console if (typeof console !== "undefined") console.warn(message); try { // Welcome to debugging history! // // This error is thrown as a convenience, so you can more easily // find the source for a warning that appears in the console by // enabling "pause on exceptions" in your JavaScript debugger. throw new Error(message); // eslint-disable-next-line no-empty } catch (e) {} } } function createKey() { return Math.random().toString(36).substr(2, 8); } /** * For browser-based histories, we combine the state and key into an object */ function getHistoryState(location, index) { return { usr: location.state, key: location.key, idx: index }; } /** * Creates a Location object with a unique key from the given Path */ function createLocation(current, to, state, key) { if (state === void 0) { state = null; } let location = _extends({ pathname: typeof current === "string" ? current : current.pathname, search: "", hash: "" }, typeof to === "string" ? parsePath(to) : to, { state, // TODO: This could be cleaned up. push/replace should probably just take // full Locations now and avoid the need to run through this flow at all // But that's a pretty big refactor to the current test suite so going to // keep as is for the time being and just let any incoming keys take precedence key: to && to.key || key || createKey() }); return location; } /** * Creates a string URL path from the given pathname, search, and hash components. */ function createPath(_ref) { let { pathname = "/", search = "", hash = "" } = _ref; if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search; if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash; return pathname; } /** * Parses a string URL path into its separate pathname, search, and hash components. */ function parsePath(path) { let parsedPath = {}; if (path) { let hashIndex = path.indexOf("#"); if (hashIndex >= 0) { parsedPath.hash = path.substr(hashIndex); path = path.substr(0, hashIndex); } let searchIndex = path.indexOf("?"); if (searchIndex >= 0) { parsedPath.search = path.substr(searchIndex); path = path.substr(0, searchIndex); } if (path) { parsedPath.pathname = path; } } return parsedPath; } function getUrlBasedHistory(getLocation, createHref, validateLocation, options) { if (options === void 0) { options = {}; } let { window = document.defaultView, v5Compat = false } = options; let globalHistory = window.history; let action = Action.Pop; let listener = null; let index = getIndex(); // Index should only be null when we initialize. If not, it's because the // user called history.pushState or history.replaceState directly, in which // case we should log a warning as it will result in bugs. if (index == null) { index = 0; globalHistory.replaceState(_extends({}, globalHistory.state, { idx: index }), ""); } function getIndex() { let state = globalHistory.state || { idx: null }; return state.idx; } function handlePop() { action = Action.Pop; let nextIndex = getIndex(); let delta = nextIndex == null ? null : nextIndex - index; index = nextIndex; if (listener) { listener({ action, location: history.location, delta }); } } function push(to, state) { action = Action.Push; let location = createLocation(history.location, to, state); if (validateLocation) validateLocation(location, to); index = getIndex() + 1; let historyState = getHistoryState(location, index); let url = history.createHref(location); // try...catch because iOS limits us to 100 pushState calls :/ try { globalHistory.pushState(historyState, "", url); } catch (error) { // If the exception is because `state` can't be serialized, let that throw // outwards just like a replace call would so the dev knows the cause // https://html.spec.whatwg.org/multipage/nav-history-apis.html#shared-history-push/replace-state-steps // https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal if (error instanceof DOMException && error.name === "DataCloneError") { throw error; } // They are going to lose state here, but there is no real // way to warn them about it since the page will refresh... window.location.assign(url); } if (v5Compat && listener) { listener({ action, location: history.location, delta: 1 }); } } function replace(to, state) { action = Action.Replace; let location = createLocation(history.location, to, state); if (validateLocation) validateLocation(location, to); index = getIndex(); let historyState = getHistoryState(location, index); let url = history.createHref(location); globalHistory.replaceState(historyState, "", url); if (v5Compat && listener) { listener({ action, location: history.location, delta: 0 }); } } function createURL(to) { // window.location.origin is "null" (the literal string value) in Firefox // under certain conditions, notably when serving from a local HTML file // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297 let base = window.location.origin !== "null" ? window.location.origin : window.location.href; let href = typeof to === "string" ? to : createPath(to); invariant(base, "No window.location.(origin|href) available to create URL for href: " + href); return new URL(href, base); } let history = { get action() { return action; }, get location() { return getLocation(window, globalHistory); }, listen(fn) { if (listener) { throw new Error("A history only accepts one active listener"); } window.addEventListener(PopStateEventType, handlePop); listener = fn; return () => { window.removeEventListener(PopStateEventType, handlePop); listener = null; }; }, createHref(to) { return createHref(window, to); }, createURL, encodeLocation(to) { // Encode a Location the same way window.location would let url = createURL(to); return { pathname: url.pathname, search: url.search, hash: url.hash }; }, push, replace, go(n) { return globalHistory.go(n); } }; return history; } //#endregion var ResultType; (function (ResultType) { ResultType["data"] = "data"; ResultType["deferred"] = "deferred"; ResultType["redirect"] = "redirect"; ResultType["error"] = "error"; })(ResultType || (ResultType = {})); const immutableRouteKeys = new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]); function isIndexRoute(route) { return route.index === true; } // Walk the route tree generating unique IDs where necessary, so we are working // solely with AgnosticDataRouteObject's within the Router function convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath, manifest) { if (parentPath === void 0) { parentPath = []; } if (manifest === void 0) { manifest = {}; } return routes.map((route, index) => { let treePath = [...parentPath, index]; let id = typeof route.id === "string" ? route.id : treePath.join("-"); invariant(route.index !== true || !route.children, "Cannot specify children on an index route"); invariant(!manifest[id], "Found a route id collision on id \"" + id + "\". Route " + "id's must be globally unique within Data Router usages"); if (isIndexRoute(route)) { let indexRoute = _extends({}, route, mapRouteProperties(route), { id }); manifest[id] = indexRoute; return indexRoute; } else { let pathOrLayoutRoute = _extends({}, route, mapRouteProperties(route), { id, children: undefined }); manifest[id] = pathOrLayoutRoute; if (route.children) { pathOrLayoutRoute.children = convertRoutesToDataRoutes(route.children, mapRouteProperties, treePath, manifest); } return pathOrLayoutRoute; } }); } /** * Matches the given routes to a location and returns the match data. * * @see https://reactrouter.com/utils/match-routes */ function matchRoutes(routes, locationArg, basename) { if (basename === void 0) { basename = "/"; } let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; let pathname = stripBasename(location.pathname || "/", basename); if (pathname == null) { return null; } let branches = flattenRoutes(routes); rankRouteBranches(branches); let matches = null; for (let i = 0; matches == null && i < branches.length; ++i) { matches = matchRouteBranch(branches[i], // Incoming pathnames are generally encoded from either window.location // or from router.navigate, but we want to match against the unencoded // paths in the route definitions. Memory router locations won't be // encoded here but there also shouldn't be anything to decode so this // should be a safe operation. This avoids needing matchRoutes to be // history-aware. safelyDecodeURI(pathname)); } return matches; } function convertRouteMatchToUiMatch(match, loaderData) { let { route, pathname, params } = match; return { id: route.id, pathname, params, data: loaderData[route.id], handle: route.handle }; } function flattenRoutes(routes, branches, parentsMeta, parentPath) { if (branches === void 0) { branches = []; } if (parentsMeta === void 0) { parentsMeta = []; } if (parentPath === void 0) { parentPath = ""; } let flattenRoute = (route, index, relativePath) => { let meta = { relativePath: relativePath === undefined ? route.path || "" : relativePath, caseSensitive: route.caseSensitive === true, childrenIndex: index, route }; if (meta.relativePath.startsWith("/")) { invariant(meta.relativePath.startsWith(parentPath), "Absolute route path \"" + meta.relativePath + "\" nested under path " + ("\"" + parentPath + "\" is not valid. An absolute child route path ") + "must start with the combined path of all its parent routes."); meta.relativePath = meta.relativePath.slice(parentPath.length); } let path = joinPaths([parentPath, meta.relativePath]); let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array, so we traverse the // route tree depth-first and child routes appear before their parents in // the "flattened" version. if (route.children && route.children.length > 0) { invariant( // Our types know better, but runtime JS may not! // @ts-expect-error route.index !== true, "Index routes must not have child routes. Please remove " + ("all child routes from route path \"" + path + "\".")); flattenRoutes(route.children, branches, routesMeta, path); } // Routes without a path shouldn't ever match by themselves unless they are // index routes, so don't add them to the list of possible branches. if (route.path == null && !route.index) { return; } branches.push({ path, score: computeScore(path, route.index), routesMeta }); }; routes.forEach((route, index) => { var _route$path; // coarse-grain check for optional params if (route.path === "" || !((_route$path = route.path) != null && _route$path.includes("?"))) { flattenRoute(route, index); } else { for (let exploded of explodeOptionalSegments(route.path)) { flattenRoute(route, index, exploded); } } }); return branches; } /** * Computes all combinations of optional path segments for a given path, * excluding combinations that are ambiguous and of lower priority. * * For example, `/one/:two?/three/:four?/:five?` explodes to: * - `/one/three` * - `/one/:two/three` * - `/one/three/:four` * - `/one/three/:five` * - `/one/:two/three/:four` * - `/one/:two/three/:five` * - `/one/three/:four/:five` * - `/one/:two/three/:four/:five` */ function explodeOptionalSegments(path) { let segments = path.split("/"); if (segments.length === 0) return []; let [first, ...rest] = segments; // Optional path segments are denoted by a trailing `?` let isOptional = first.endsWith("?"); // Compute the corresponding required segment: `foo?` -> `foo` let required = first.replace(/\?$/, ""); if (rest.length === 0) { // Intepret empty string as omitting an optional segment // `["one", "", "three"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three` return isOptional ? [required, ""] : [required]; } let restExploded = explodeOptionalSegments(rest.join("/")); let result = []; // All child paths with the prefix. Do this for all children before the // optional version for all children, so we get consistent ordering where the // parent optional aspect is preferred as required. Otherwise, we can get // child sections interspersed where deeper optional segments are higher than // parent optional segments, where for example, /:two would explode _earlier_ // then /:one. By always including the parent as required _for all children_ // first, we avoid this issue result.push(...restExploded.map(subpath => subpath === "" ? required : [required, subpath].join("/"))); // Then, if this is an optional value, add all child versions without if (isOptional) { result.push(...restExploded); } // for absolute paths, ensure `/` instead of empty segment return result.map(exploded => path.startsWith("/") && exploded === "" ? "/" : exploded); } function rankRouteBranches(branches) { branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex))); } const paramRe = /^:\w+$/; const dynamicSegmentValue = 3; const indexRouteValue = 2; const emptySegmentValue = 1; const staticSegmentValue = 10; const splatPenalty = -2; const isSplat = s => s === "*"; function computeScore(path, index) { let segments = path.split("/"); let initialScore = segments.length; if (segments.some(isSplat)) { initialScore += splatPenalty; } if (index) { initialScore += indexRouteValue; } return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore); } function compareIndexes(a, b) { let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]); return siblings ? // If two routes are siblings, we should try to match the earlier sibling // first. This allows people to have fine-grained control over the matching // behavior by simply putting routes with identical paths in the order they // want them tried. a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index, // so they sort equally. 0; } function matchRouteBranch(branch, pathname) { let { routesMeta } = branch; let matchedParams = {}; let matchedPathname = "/"; let matches = []; for (let i = 0; i < routesMeta.length; ++i) { let meta = routesMeta[i]; let end = i === routesMeta.length - 1; let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/"; let match = matchPath({ path: meta.relativePath, caseSensitive: meta.caseSensitive, end }, remainingPathname); if (!match) return null; Object.assign(matchedParams, match.params); let route = meta.route; matches.push({ // TODO: Can this as be avoided? params: matchedParams, pathname: joinPaths([matchedPathname, match.pathname]), pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])), route }); if (match.pathnameBase !== "/") { matchedPathname = joinPaths([matchedPathname, match.pathnameBase]); } } return matches; } /** * Returns a path with params interpolated. * * @see https://reactrouter.com/utils/generate-path */ function generatePath(originalPath, params) { if (params === void 0) { params = {}; } let path = originalPath; if (path.endsWith("*") && path !== "*" && !path.endsWith("/*")) { warning(false, "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")); path = path.replace(/\*$/, "/*"); } // ensure `/` is added at the beginning if the path is absolute const prefix = path.startsWith("/") ? "/" : ""; const stringify = p => p == null ? "" : typeof p === "string" ? p : String(p); const segments = path.split(/\/+/).map((segment, index, array) => { const isLastSegment = index === array.length - 1; // only apply the splat if it's the last segment if (isLastSegment && segment === "*") { const star = "*"; // Apply the splat return stringify(params[star]); } const keyMatch = segment.match(/^:(\w+)(\??)$/); if (keyMatch) { const [, key, optional] = keyMatch; let param = params[key]; invariant(optional === "?" || param != null, "Missing \":" + key + "\" param"); return stringify(param); } // Remove any optional markers from optional static segments return segment.replace(/\?$/g, ""); }) // Remove empty segments .filter(segment => !!segment); return prefix + segments.join("/"); } /** * Performs pattern matching on a URL pathname and returns information about * the match. * * @see https://reactrouter.com/utils/match-path */ function matchPath(pattern, pathname) { if (typeof pattern === "string") { pattern = { path: pattern, caseSensitive: false, end: true }; } let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end); let match = pathname.match(matcher); if (!match) return null; let matchedPathname = match[0]; let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1"); let captureGroups = match.slice(1); let params = compiledParams.reduce((memo, _ref, index) => { let { paramName, isOptional } = _ref; // We need to compute the pathnameBase here using the raw splat value // instead of using params["*"] later because it will be decoded then if (paramName === "*") { let splatValue = captureGroups[index] || ""; pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1"); } const value = captureGroups[index]; if (isOptional && !value) { memo[paramName] = undefined; } else { memo[paramName] = safelyDecodeURIComponent(value || "", paramName); } return memo; }, {}); return { params, pathname: matchedPathname, pathnameBase, pattern }; } function compilePath(path, caseSensitive, end) { if (caseSensitive === void 0) { caseSensitive = false; } if (end === void 0) { end = true; } warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")); let params = []; let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below .replace(/^\/*/, "/") // Make sure it has a leading / .replace(/[\\.*+^${}|()[\]]/g, "\\$&") // Escape special regex chars .replace(/\/:(\w+)(\?)?/g, (_, paramName, isOptional) => { params.push({ paramName, isOptional: isOptional != null }); return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)"; }); if (path.endsWith("*")) { params.push({ paramName: "*" }); regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest : "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"] } else if (end) { // When matching to the end, ignore trailing slashes regexpSource += "\\/*$"; } else if (path !== "" && path !== "/") { // If our path is non-empty and contains anything beyond an initial slash, // then we have _some_ form of path in our regex, so we should expect to // match only if we find the end of this path segment. Look for an optional // non-captured trailing slash (to match a portion of the URL) or the end // of the path (if we've matched to the end). We used to do this with a // word boundary but that gives false positives on routes like // /user-preferences since `-` counts as a word boundary. regexpSource += "(?:(?=\\/|$))"; } else ; let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i"); return [matcher, params]; } function safelyDecodeURI(value) { try { return decodeURI(value); } catch (error) { warning(false, "The URL path \"" + value + "\" could not be decoded because it is is a " + "malformed URL segment. This is probably due to a bad percent " + ("encoding (" + error + ").")); return value; } } function safelyDecodeURIComponent(value, paramName) { try { return decodeURIComponent(value); } catch (error) { warning(false, "The value for the URL param \"" + paramName + "\" will not be decoded because" + (" the string \"" + value + "\" is a malformed URL segment. This is probably") + (" due to a bad percent encoding (" + error + ").")); return value; } } /** * @private */ function stripBasename(pathname, basename) { if (basename === "/") return pathname; if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) { return null; } // We want to leave trailing slash behavior in the user's control, so if they // specify a basename with a trailing slash, we should support it let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length; let nextChar = pathname.charAt(startIndex); if (nextChar && nextChar !== "/") { // pathname does not start with basename/ return null; } return pathname.slice(startIndex) || "/"; } /** * Returns a resolved path object relative to the given pathname. * * @see https://reactrouter.com/utils/resolve-path */ function resolvePath(to, fromPathname) { if (fromPathname === void 0) { fromPathname = "/"; } let { pathname: toPathname, search = "", hash = "" } = typeof to === "string" ? parsePath(to) : to; let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname; return { pathname, search: normalizeSearch(search), hash: normalizeHash(hash) }; } function resolvePathname(relativePath, fromPathname) { let segments = fromPathname.replace(/\/+$/, "").split("/"); let relativeSegments = relativePath.split("/"); relativeSegments.forEach(segment => { if (segment === "..") { // Keep the root "" segment so the pathname starts at / if (segments.length > 1) segments.pop(); } else if (segment !== ".") { segments.push(segment); } }); return segments.length > 1 ? segments.join("/") : "/"; } function getInvalidPathError(char, field, dest, path) { return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + "a string in and the router will parse it for you."; } /** * @private * * When processing relative navigation we want to ignore ancestor routes that * do not contribute to the path, such that index/pathless layout routes don't * interfere. * * For example, when moving a route element into an index route and/or a * pathless layout route, relative link behavior contained within should stay * the same. Both of the following examples should link back to the root: * * * * * * * * }> // <-- Does not contribute * // <-- Does not contribute * * */ function getPathContributingMatches(matches) { return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0); } /** * @private */ function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) { if (isPathRelative === void 0) { isPathRelative = false; } let to; if (typeof toArg === "string") { to = parsePath(toArg); } else { to = _extends({}, toArg); invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to)); invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to)); invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to)); } let isEmptyPath = toArg === "" || to.pathname === ""; let toPathname = isEmptyPath ? "/" : to.pathname; let from; // Routing is relative to the current pathname if explicitly requested. // // If a pathname is explicitly provided in `to`, it should be relative to the // route context. This is explained in `Note on `` values` in our // migration guide from v5 as a means of disambiguation between `to` values // that begin with `/` and those that do not. However, this is problematic for // `to` values that do not provide a pathname. `to` can simply be a search or // hash string, in which case we should assume that the navigation is relative // to the current location's pathname and *not* the route pathname. if (isPathRelative || toPathname == null) { from = locationPathname; } else { let routePathnameIndex = routePathnames.length - 1; if (toPathname.startsWith("..")) { let toSegments = toPathname.split("/"); // Each leading .. segment means "go up one route" instead of "go up one // URL segment". This is a key difference from how works and a // major reason we call this a "to" value instead of a "href". while (toSegments[0] === "..") { toSegments.shift(); routePathnameIndex -= 1; } to.pathname = toSegments.join("/"); } // If there are more ".." segments than parent routes, resolve relative to // the root / URL. from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/"; } let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original "to" had one let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"); // Or if this was a link to the current path which has a trailing slash let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/"); if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) { path.pathname += "/"; } return path; } /** * @private */ function getToPathname(to) { // Empty strings should be treated the same as / paths return to === "" || to.pathname === "" ? "/" : typeof to === "string" ? parsePath(to).pathname : to.pathname; } /** * @private */ const joinPaths = paths => paths.join("/").replace(/\/\/+/g, "/"); /** * @private */ const normalizePathname = pathname => pathname.replace(/\/+$/, "").replace(/^\/*/, "/"); /** * @private */ const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search; /** * @private */ const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash; /** * This is a shortcut for creating `application/json` responses. Converts `data` * to JSON and sets the `Content-Type` header. */ const json = function json(data, init) { if (init === void 0) { init = {}; } let responseInit = typeof init === "number" ? { status: init } : init; let headers = new Headers(responseInit.headers); if (!headers.has("Content-Type")) { headers.set("Content-Type", "application/json; charset=utf-8"); } return new Response(JSON.stringify(data), _extends({}, responseInit, { headers })); }; class AbortedDeferredError extends Error {} class DeferredData { constructor(data, responseInit) { this.pendingKeysSet = new Set(); this.subscribers = new Set(); this.deferredKeys = []; invariant(data && typeof data === "object" && !Array.isArray(data), "defer() only accepts plain objects"); // Set up an AbortController + Promise we can race against to exit early // cancellation let reject; this.abortPromise = new Promise((_, r) => reject = r); this.controller = new AbortController(); let onAbort = () => reject(new AbortedDeferredError("Deferred data aborted")); this.unlistenAbortSignal = () => this.controller.signal.removeEventListener("abort", onAbort); this.controller.signal.addEventListener("abort", onAbort); this.data = Object.entries(data).reduce((acc, _ref2) => { let [key, value] = _ref2; return Object.assign(acc, { [key]: this.trackPromise(key, value) }); }, {}); if (this.done) { // All incoming values were resolved this.unlistenAbortSignal(); } this.init = responseInit; } trackPromise(key, value) { if (!(value instanceof Promise)) { return value; } this.deferredKeys.push(key); this.pendingKeysSet.add(key); // We store a little wrapper promise that will be extended with // _data/_error props upon resolve/reject let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, undefined, data), error => this.onSettle(promise, key, error)); // Register rejection listeners to avoid uncaught promise rejections on // errors or aborted deferred values promise.catch(() => {}); Object.defineProperty(promise, "_tracked", { get: () => true }); return promise; } onSettle(promise, key, error, data) { if (this.controller.signal.aborted && error instanceof AbortedDeferredError) { this.unlistenAbortSignal(); Object.defineProperty(promise, "_error", { get: () => error }); return Promise.reject(error); } this.pendingKeysSet.delete(key); if (this.done) { // Nothing left to abort! this.unlistenAbortSignal(); } // If the promise was resolved/rejected with undefined, we'll throw an error as you // should always resolve with a value or null if (error === undefined && data === undefined) { let undefinedError = new Error("Deferred data for key \"" + key + "\" resolved/rejected with `undefined`, " + "you must resolve/reject with a value or `null`."); Object.defineProperty(promise, "_error", { get: () => undefinedError }); this.emit(false, key); return Promise.reject(undefinedError); } if (data === undefined) { Object.defineProperty(promise, "_error", { get: () => error }); this.emit(false, key); return Promise.reject(error); } Object.defineProperty(promise, "_data", { get: () => data }); this.emit(false, key); return data; } emit(aborted, settledKey) { this.subscribers.forEach(subscriber => subscriber(aborted, settledKey)); } subscribe(fn) { this.subscribers.add(fn); return () => this.subscribers.delete(fn); } cancel() { this.controller.abort(); this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k)); this.emit(true); } async resolveData(signal) { let aborted = false; if (!this.done) { let onAbort = () => this.cancel(); signal.addEventListener("abort", onAbort); aborted = await new Promise(resolve => { this.subscribe(aborted => { signal.removeEventListener("abort", onAbort); if (aborted || this.done) { resolve(aborted); } }); }); } return aborted; } get done() { return this.pendingKeysSet.size === 0; } get unwrappedData() { invariant(this.data !== null && this.done, "Can only unwrap data on initialized and settled deferreds"); return Object.entries(this.data).reduce((acc, _ref3) => { let [key, value] = _ref3; return Object.assign(acc, { [key]: unwrapTrackedPromise(value) }); }, {}); } get pendingKeys() { return Array.from(this.pendingKeysSet); } } function isTrackedPromise(value) { return value instanceof Promise && value._tracked === true; } function unwrapTrackedPromise(value) { if (!isTrackedPromise(value)) { return value; } if (value._error) { throw value._error; } return value._data; } const defer = function defer(data, init) { if (init === void 0) { init = {}; } let responseInit = typeof init === "number" ? { status: init } : init; return new DeferredData(data, responseInit); }; /** * A redirect response. Sets the status code and the `Location` header. * Defaults to "302 Found". */ const redirect = function redirect(url, init) { if (init === void 0) { init = 302; } let responseInit = init; if (typeof responseInit === "number") { responseInit = { status: responseInit }; } else if (typeof responseInit.status === "undefined") { responseInit.status = 302; } let headers = new Headers(responseInit.headers); headers.set("Location", url); return new Response(null, _extends({}, responseInit, { headers })); }; /** * A redirect response that will force a document reload to the new location. * Sets the status code and the `Location` header. * Defaults to "302 Found". */ const redirectDocument = (url, init) => { let response = redirect(url, init); response.headers.set("X-Remix-Reload-Document", "true"); return response; }; /** * @private * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies * * We don't export the class for public use since it's an implementation * detail, but we export the interface above so folks can build their own * abstractions around instances via isRouteErrorResponse() */ class ErrorResponseImpl { constructor(status, statusText, data, internal) { if (internal === void 0) { internal = false; } this.status = status; this.statusText = statusText || ""; this.internal = internal; if (data instanceof Error) { this.data = data.toString(); this.error = data; } else { this.data = data; } } } /** * Check if the given error is an ErrorResponse generated from a 4xx/5xx * Response thrown from an action/loader */ function isRouteErrorResponse(error) { return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error; } const validMutationMethodsArr = ["post", "put", "patch", "delete"]; const validMutationMethods = new Set(validMutationMethodsArr); const validRequestMethodsArr = ["get", ...validMutationMethodsArr]; const validRequestMethods = new Set(validRequestMethodsArr); const redirectStatusCodes = new Set([301, 302, 303, 307, 308]); const redirectPreserveMethodStatusCodes = new Set([307, 308]); const IDLE_NAVIGATION = { state: "idle", location: undefined, formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined }; const IDLE_FETCHER = { state: "idle", data: undefined, formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined }; const IDLE_BLOCKER = { state: "unblocked", proceed: undefined, reset: undefined, location: undefined }; const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i; const defaultMapRouteProperties = route => ({ hasErrorBoundary: Boolean(route.hasErrorBoundary) }); const TRANSITIONS_STORAGE_KEY = "remix-router-transitions"; //#endregion //////////////////////////////////////////////////////////////////////////////// //#region createRouter //////////////////////////////////////////////////////////////////////////////// /** * Create a router and listen to history POP navigations */ function createRouter(init) { const routerWindow = init.window ? init.window : typeof window !== "undefined" ? window : undefined; const isBrowser = typeof routerWindow !== "undefined" && typeof routerWindow.document !== "undefined" && typeof routerWindow.document.createElement !== "undefined"; const isServer = !isBrowser; invariant(init.routes.length > 0, "You must provide a non-empty routes array to createRouter"); let mapRouteProperties; if (init.mapRouteProperties) { mapRouteProperties = init.mapRouteProperties; } else if (init.detectErrorBoundary) { // If they are still using the deprecated version, wrap it with the new API let detectErrorBoundary = init.detectErrorBoundary; mapRouteProperties = route => ({ hasErrorBoundary: detectErrorBoundary(route) }); } else { mapRouteProperties = defaultMapRouteProperties; } // Routes keyed by ID let manifest = {}; // Routes in tree format for matching let dataRoutes = convertRoutesToDataRoutes(init.routes, mapRouteProperties, undefined, manifest); let inFlightDataRoutes; let basename = init.basename || "/"; // Config driven behavior flags let future = _extends({ v7_fetcherPersist: false, v7_normalizeFormMethod: false, v7_prependBasename: false }, init.future); // Cleanup function for history let unlistenHistory = null; // Externally-provided functions to call on all state changes let subscribers = new Set(); // Externally-provided object to hold scroll restoration locations during routing let savedScrollPositions = null; // Externally-provided function to get scroll restoration keys let getScrollRestorationKey = null; // Externally-provided function to get current scroll position let getScrollPosition = null; // One-time flag to control the initial hydration scroll restoration. Because // we don't get the saved positions from until _after_ // the initial render, we need to manually trigger a separate updateState to // send along the restoreScrollPosition // Set to true if we have `hydrationData` since we assume we were SSR'd and that // SSR did the initial scroll restoration. let initialScrollRestored = init.hydrationData != null; let initialMatches = matchRoutes(dataRoutes, init.history.location, basename); let initialErrors = null; if (initialMatches == null) { // If we do not match a user-provided-route, fall back to the root // to allow the error boundary to take over let error = getInternalRouterError(404, { pathname: init.history.location.pathname }); let { matches, route } = getShortCircuitMatches(dataRoutes); initialMatches = matches; initialErrors = { [route.id]: error }; } let initialized = // All initialMatches need to be loaded before we're ready. If we have lazy // functions around still then we'll need to run them in initialize() !initialMatches.some(m => m.route.lazy) && ( // And we have to either have no loaders or have been provided hydrationData !initialMatches.some(m => m.route.loader) || init.hydrationData != null); let router; let state = { historyAction: init.history.action, location: init.history.location, matches: initialMatches, initialized, navigation: IDLE_NAVIGATION, // Don't restore on initial updateState() if we were SSR'd restoreScrollPosition: init.hydrationData != null ? false : null, preventScrollReset: false, revalidation: "idle", loaderData: init.hydrationData && init.hydrationData.loaderData || {}, actionData: init.hydrationData && init.hydrationData.actionData || null, errors: init.hydrationData && init.hydrationData.errors || initialErrors, fetchers: new Map(), blockers: new Map() }; // -- Stateful internal variables to manage navigations -- // Current navigation in progress (to be committed in completeNavigation) let pendingAction = Action.Pop; // Should the current navigation prevent the scroll reset if scroll cannot // be restored? let pendingPreventScrollReset = false; // AbortController for the active navigation let pendingNavigationController; // Should the current navigation enable document.startViewTransition? let pendingViewTransitionEnabled = false; // Store applied view transitions so we can apply them on POP let appliedViewTransitions = new Map(); // Cleanup function for persisting applied transitions to sessionStorage let removePageHideEventListener = null; // We use this to avoid touching history in completeNavigation if a // revalidation is entirely uninterrupted let isUninterruptedRevalidation = false; // Use this internal flag to force revalidation of all loaders: // - submissions (completed or interrupted) // - useRevalidator() // - X-Remix-Revalidate (from redirect) let isRevalidationRequired = false; // Use this internal array to capture routes that require revalidation due // to a cancelled deferred on action submission let cancelledDeferredRoutes = []; // Use this internal array to capture fetcher loads that were cancelled by an // action navigation and require revalidation let cancelledFetcherLoads = []; // AbortControllers for any in-flight fetchers let fetchControllers = new Map(); // Track loads based on the order in which they started let incrementingLoadId = 0; // Track the outstanding pending navigation data load to be compared against // the globally incrementing load when a fetcher load lands after a completed // navigation let pendingNavigationLoadId = -1; // Fetchers that triggered data reloads as a result of their actions let fetchReloadIds = new Map(); // Fetchers that triggered redirect navigations let fetchRedirectIds = new Set(); // Most recent href/match for fetcher.load calls for fetchers let fetchLoadMatches = new Map(); // Ref-count mounted fetchers so we know when it's ok to clean them up let activeFetchers = new Map(); // Fetchers that have requested a delete when using v7_fetcherPersist, // they'll be officially removed after they return to idle let deletedFetchers = new Set(); // Store DeferredData instances for active route matches. When a // route loader returns defer() we stick one in here. Then, when a nested // promise resolves we update loaderData. If a new navigation starts we // cancel active deferreds for eliminated routes. let activeDeferreds = new Map(); // Store blocker functions in a separate Map outside of router state since // we don't need to update UI state if they change let blockerFunctions = new Map(); // Flag to ignore the next history update, so we can revert the URL change on // a POP navigation that was blocked by the user without touching router state let ignoreNextHistoryUpdate = false; // Initialize the router, all side effects should be kicked off from here. // Implemented as a Fluent API for ease of: // let router = createRouter(init).initialize(); function initialize() { // If history informs us of a POP navigation, start the navigation but do not update // state. We'll update our own state once the navigation completes unlistenHistory = init.history.listen(_ref => { let { action: historyAction, location, delta } = _ref; // Ignore this event if it was just us resetting the URL from a // blocked POP navigation if (ignoreNextHistoryUpdate) { ignoreNextHistoryUpdate = false; return; } warning(blockerFunctions.size === 0 || delta != null, "You are trying to use a blocker on a POP navigation to a location " + "that was not created by @remix-run/router. This will fail silently in " + "production. This can happen if you are navigating outside the router " + "via `window.history.pushState`/`window.location.hash` instead of using " + "router navigation APIs. This can also happen if you are using " + "createHashRouter and the user manually changes the URL."); let blockerKey = shouldBlockNavigation({ currentLocation: state.location, nextLocation: location, historyAction }); if (blockerKey && delta != null) { // Restore the URL to match the current UI, but don't update router state ignoreNextHistoryUpdate = true; init.history.go(delta * -1); // Put the blocker into a blocked state updateBlocker(blockerKey, { state: "blocked", location, proceed() { updateBlocker(blockerKey, { state: "proceeding", proceed: undefined, reset: undefined, location }); // Re-do the same POP navigation we just blocked init.history.go(delta); }, reset() { let blockers = new Map(state.blockers); blockers.set(blockerKey, IDLE_BLOCKER); updateState({ blockers }); } }); return; } return startNavigation(historyAction, location); }); if (isBrowser) { // FIXME: This feels gross. How can we cleanup the lines between // scrollRestoration/appliedTransitions persistance? restoreAppliedTransitions(routerWindow, appliedViewTransitions); let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions); routerWindow.addEventListener("pagehide", _saveAppliedTransitions); removePageHideEventListener = () => routerWindow.removeEventListener("pagehide", _saveAppliedTransitions); } // Kick off initial data load if needed. Use Pop to avoid modifying history // Note we don't do any handling of lazy here. For SPA's it'll get handled // in the normal navigation flow. For SSR it's expected that lazy modules are // resolved prior to router creation since we can't go into a fallbackElement // UI for SSR'd apps if (!state.initialized) { startNavigation(Action.Pop, state.location); } return router; } // Clean up a router and it's side effects function dispose() { if (unlistenHistory) { unlistenHistory(); } if (removePageHideEventListener) { removePageHideEventListener(); } subscribers.clear(); pendingNavigationController && pendingNavigationController.abort(); state.fetchers.forEach((_, key) => deleteFetcher(key)); state.blockers.forEach((_, key) => deleteBlocker(key)); } // Subscribe to state updates for the router function subscribe(fn) { subscribers.add(fn); return () => subscribers.delete(fn); } // Update our state and notify the calling context of the change function updateState(newState, viewTransitionOpts) { state = _extends({}, state, newState); // Prep fetcher cleanup so we can tell the UI which fetcher data entries // can be removed let completedFetchers = []; let deletedFetchersKeys = []; if (future.v7_fetcherPersist) { state.fetchers.forEach((fetcher, key) => { if (fetcher.state === "idle") { if (deletedFetchers.has(key)) { // Unmounted from the UI and can be totally removed deletedFetchersKeys.push(key); } else { // Returned to idle but still mounted in the UI, so semi-remains for // revalidations and such completedFetchers.push(key); } } }); } subscribers.forEach(subscriber => subscriber(state, { deletedFetchers: deletedFetchersKeys, unstable_viewTransitionOpts: viewTransitionOpts })); // Remove idle fetchers from state since we only care about in-flight fetchers. if (future.v7_fetcherPersist) { completedFetchers.forEach(key => state.fetchers.delete(key)); deletedFetchersKeys.forEach(key => deleteFetcher(key)); } } // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION // and setting state.[historyAction/location/matches] to the new route. // - Location is a required param // - Navigation will always be set to IDLE_NAVIGATION // - Can pass any other state in newState function completeNavigation(location, newState) { var _location$state, _location$state2; // Deduce if we're in a loading/actionReload state: // - We have committed actionData in the store // - The current navigation was a mutation submission // - We're past the submitting state and into the loading state // - The location being loaded is not the result of a redirect let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true; let actionData; if (newState.actionData) { if (Object.keys(newState.actionData).length > 0) { actionData = newState.actionData; } else { // Empty actionData -> clear prior actionData due to an action error actionData = null; } } else if (isActionReload) { // Keep the current data if we're wrapping up the action reload actionData = state.actionData; } else { // Clear actionData on any other completed navigations actionData = null; } // Always preserve any existing loaderData from re-used routes let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData; // On a successful navigation we can assume we got through all blockers // so we can start fresh let blockers = state.blockers; if (blockers.size > 0) { blockers = new Map(blockers); blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER)); } // Always respect the user flag. Otherwise don't reset on mutation // submission navigations unless they redirect let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location.state) == null ? void 0 : _location$state2._isRedirect) !== true; if (inFlightDataRoutes) { dataRoutes = inFlightDataRoutes; inFlightDataRoutes = undefined; } if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) { init.history.push(location, location.state); } else if (pendingAction === Action.Replace) { init.history.replace(location, location.state); } let viewTransitionOpts; // On POP, enable transitions if they were enabled on the original navigation if (pendingAction === Action.Pop) { // Forward takes precedence so they behave like the original navigation let priorPaths = appliedViewTransitions.get(state.location.pathname); if (priorPaths && priorPaths.has(location.pathname)) { viewTransitionOpts = { currentLocation: state.location, nextLocation: location }; } else if (appliedViewTransitions.has(location.pathname)) { // If we don't have a previous forward nav, assume we're popping back to // the new location and enable if that location previously enabled viewTransitionOpts = { currentLocation: location, nextLocation: state.location }; } } else if (pendingViewTransitionEnabled) { // Store the applied transition on PUSH/REPLACE let toPaths = appliedViewTransitions.get(state.location.pathname); if (toPaths) { toPaths.add(location.pathname); } else { toPaths = new Set([location.pathname]); appliedViewTransitions.set(state.location.pathname, toPaths); } viewTransitionOpts = { currentLocation: state.location, nextLocation: location }; } updateState(_extends({}, newState, { actionData, loaderData, historyAction: pendingAction, location, initialized: true, navigation: IDLE_NAVIGATION, revalidation: "idle", restoreScrollPosition: getSavedScrollPosition(location, newState.matches || state.matches), preventScrollReset, blockers }), viewTransitionOpts); // Reset stateful navigation vars pendingAction = Action.Pop; pendingPreventScrollReset = false; pendingViewTransitionEnabled = false; isUninterruptedRevalidation = false; isRevalidationRequired = false; cancelledDeferredRoutes = []; cancelledFetcherLoads = []; } // Trigger a navigation event, which can either be a numerical POP or a PUSH // replace with an optional submission async function navigate(to, opts) { if (typeof to === "number") { init.history.go(to); return; } let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative); let { path, submission, error } = normalizeNavigateOptions(future.v7_normalizeFormMethod, false, normalizedPath, opts); let currentLocation = state.location; let nextLocation = createLocation(state.location, path, opts && opts.state); // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded // URL from window.location, so we need to encode it here so the behavior // remains the same as POP and non-data-router usages. new URL() does all // the same encoding we'd get from a history.pushState/window.location read // without having to touch history nextLocation = _extends({}, nextLocation, init.history.encodeLocation(nextLocation)); let userReplace = opts && opts.replace != null ? opts.replace : undefined; let historyAction = Action.Push; if (userReplace === true) { historyAction = Action.Replace; } else if (userReplace === false) ; else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) { // By default on submissions to the current location we REPLACE so that // users don't have to double-click the back button to get to the prior // location. If the user redirects to a different location from the // action/loader this will be ignored and the redirect will be a PUSH historyAction = Action.Replace; } let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : undefined; let blockerKey = shouldBlockNavigation({ currentLocation, nextLocation, historyAction }); if (blockerKey) { // Put the blocker into a blocked state updateBlocker(blockerKey, { state: "blocked", location: nextLocation, proceed() { updateBlocker(blockerKey, { state: "proceeding", proceed: undefined, reset: undefined, location: nextLocation }); // Send the same navigation through navigate(to, opts); }, reset() { let blockers = new Map(state.blockers); blockers.set(blockerKey, IDLE_BLOCKER); updateState({ blockers }); } }); return; } return await startNavigation(historyAction, nextLocation, { submission, // Send through the formData serialization error if we have one so we can // render at the right error boundary after we match routes pendingError: error, preventScrollReset, replace: opts && opts.replace, enableViewTransition: opts && opts.unstable_viewTransition }); } // Revalidate all current loaders. If a navigation is in progress or if this // is interrupted by a navigation, allow this to "succeed" by calling all // loaders during the next loader round function revalidate() { interruptActiveLoads(); updateState({ revalidation: "loading" }); // If we're currently submitting an action, we don't need to start a new // navigation, we'll just let the follow up loader execution call all loaders if (state.navigation.state === "submitting") { return; } // If we're currently in an idle state, start a new navigation for the current // action/location and mark it as uninterrupted, which will skip the history // update in completeNavigation if (state.navigation.state === "idle") { startNavigation(state.historyAction, state.location, { startUninterruptedRevalidation: true }); return; } // Otherwise, if we're currently in a loading state, just start a new // navigation to the navigation.location but do not trigger an uninterrupted // revalidation so that history correctly updates once the navigation completes startNavigation(pendingAction || state.historyAction, state.navigation.location, { overrideNavigation: state.navigation }); } // Start a navigation to the given action/location. Can optionally provide a // overrideNavigation which will override the normalLoad in the case of a redirect // navigation async function startNavigation(historyAction, location, opts) { // Abort any in-progress navigations and start a new one. Unset any ongoing // uninterrupted revalidations unless told otherwise, since we want this // new navigation to update history normally pendingNavigationController && pendingNavigationController.abort(); pendingNavigationController = null; pendingAction = historyAction; isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; // Save the current scroll position every time we start a new navigation, // and track whether we should reset scroll on completion saveScrollPosition(state.location, state.matches); pendingPreventScrollReset = (opts && opts.preventScrollReset) === true; pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true; let routesToUse = inFlightDataRoutes || dataRoutes; let loadingNavigation = opts && opts.overrideNavigation; let matches = matchRoutes(routesToUse, location, basename); // Short circuit with a 404 on the root error boundary if we match nothing if (!matches) { let error = getInternalRouterError(404, { pathname: location.pathname }); let { matches: notFoundMatches, route } = getShortCircuitMatches(routesToUse); // Cancel all pending deferred on 404s since we don't keep any routes cancelActiveDeferreds(); completeNavigation(location, { matches: notFoundMatches, loaderData: {}, errors: { [route.id]: error } }); return; } // Short circuit if it's only a hash change and not a revalidation or // mutation submission. // // Ignore on initial page loads because since the initial load will always // be "same hash". For example, on /page#hash and submit a
// which will default to a navigation to /page if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) { completeNavigation(location, { matches }); return; } // Create a controller/Request for this navigation pendingNavigationController = new AbortController(); let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission); let pendingActionData; let pendingError; if (opts && opts.pendingError) { // If we have a pendingError, it means the user attempted a GET submission // with binary FormData so assign here and skip to handleLoaders. That // way we handle calling loaders above the boundary etc. It's not really // different from an actionError in that sense. pendingError = { [findNearestBoundary(matches).route.id]: opts.pendingError }; } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) { // Call action if we received an action submission let actionOutput = await handleAction(request, location, opts.submission, matches, { replace: opts.replace }); if (actionOutput.shortCircuited) { return; } pendingActionData = actionOutput.pendingActionData; pendingError = actionOutput.pendingActionError; loadingNavigation = getLoadingNavigation(location, opts.submission); // Create a GET request for the loaders request = new Request(request.url, { signal: request.signal }); } // Call loaders let { shortCircuited, loaderData, errors } = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, pendingActionData, pendingError); if (shortCircuited) { return; } // Clean up now that the action/loaders have completed. Don't clean up if // we short circuited because pendingNavigationController will have already // been assigned to a new controller for the next navigation pendingNavigationController = null; completeNavigation(location, _extends({ matches }, pendingActionData ? { actionData: pendingActionData } : {}, { loaderData, errors })); } // Call the action matched by the leaf route for this navigation and handle // redirects/errors async function handleAction(request, location, submission, matches, opts) { if (opts === void 0) { opts = {}; } interruptActiveLoads(); // Put us in a submitting state let navigation = getSubmittingNavigation(location, submission); updateState({ navigation }); // Call our action and get the result let result; let actionMatch = getTargetMatch(matches, location); if (!actionMatch.route.action && !actionMatch.route.lazy) { result = { type: ResultType.error, error: getInternalRouterError(405, { method: request.method, pathname: location.pathname, routeId: actionMatch.route.id }) }; } else { result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties, basename); if (request.signal.aborted) { return { shortCircuited: true }; } } if (isRedirectResult(result)) { let replace; if (opts && opts.replace != null) { replace = opts.replace; } else { // If the user didn't explicity indicate replace behavior, replace if // we redirected to the exact same location we're currently at to avoid // double back-buttons replace = result.location === state.location.pathname + state.location.search; } await startRedirectNavigation(state, result, { submission, replace }); return { shortCircuited: true }; } if (isErrorResult(result)) { // Store off the pending error - we use it to determine which loaders // to call and will commit it when we complete the navigation let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); // By default, all submissions are REPLACE navigations, but if the // action threw an error that'll be rendered in an errorElement, we fall // back to PUSH so that the user can use the back button to get back to // the pre-submission form location to try again if ((opts && opts.replace) !== true) { pendingAction = Action.Push; } return { // Send back an empty object we can use to clear out any prior actionData pendingActionData: {}, pendingActionError: { [boundaryMatch.route.id]: result.error } }; } if (isDeferredResult(result)) { throw getInternalRouterError(400, { type: "defer-action" }); } return { pendingActionData: { [actionMatch.route.id]: result.data } }; } // Call all applicable loaders for the given matches, handling redirects, // errors, etc. async function handleLoaders(request, location, matches, overrideNavigation, submission, fetcherSubmission, replace, pendingActionData, pendingError) { // Figure out the right navigation we want to use for data loading let loadingNavigation = overrideNavigation || getLoadingNavigation(location, submission); // If this was a redirect from an action we don't have a "submission" but // we have it on the loading navigation so use that if available let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation); let routesToUse = inFlightDataRoutes || dataRoutes; let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError); // Cancel pending deferreds for no-longer-matched routes or routes we're // about to reload. Note that if this is an action reload we would have // already cancelled all pending deferreds so this would be a no-op cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId)); pendingNavigationLoadId = ++incrementingLoadId; // Short circuit if we have no loaders to run if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) { let updatedFetchers = markFetchRedirectsDone(); completeNavigation(location, _extends({ matches, loaderData: {}, // Commit pending error if we're short circuiting errors: pendingError || null }, pendingActionData ? { actionData: pendingActionData } : {}, updatedFetchers ? { fetchers: new Map(state.fetchers) } : {})); return { shortCircuited: true }; } // If this is an uninterrupted revalidation, we remain in our current idle // state. If not, we need to switch to our loading state and load data, // preserving any new action data or existing action data (in the case of // a revalidation interrupting an actionReload) if (!isUninterruptedRevalidation) { revalidatingFetchers.forEach(rf => { let fetcher = state.fetchers.get(rf.key); let revalidatingFetcher = getLoadingFetcher(undefined, fetcher ? fetcher.data : undefined); state.fetchers.set(rf.key, revalidatingFetcher); }); let actionData = pendingActionData || state.actionData; updateState(_extends({ navigation: loadingNavigation }, actionData ? Object.keys(actionData).length === 0 ? { actionData: null } : { actionData } : {}, revalidatingFetchers.length > 0 ? { fetchers: new Map(state.fetchers) } : {})); } revalidatingFetchers.forEach(rf => { if (fetchControllers.has(rf.key)) { abortFetcher(rf.key); } if (rf.controller) { // Fetchers use an independent AbortController so that aborting a fetcher // (via deleteFetcher) does not abort the triggering navigation that // triggered the revalidation fetchControllers.set(rf.key, rf.controller); } }); // Proxy navigation abort through to revalidation fetchers let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(f => abortFetcher(f.key)); if (pendingNavigationController) { pendingNavigationController.signal.addEventListener("abort", abortPendingFetchRevalidations); } let { results, loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, request); if (request.signal.aborted) { return { shortCircuited: true }; } // Clean up _after_ loaders have completed. Don't clean up if we short // circuited because fetchControllers would have been aborted and // reassigned to new controllers for the next navigation if (pendingNavigationController) { pendingNavigationController.signal.removeEventListener("abort", abortPendingFetchRevalidations); } revalidatingFetchers.forEach(rf => fetchControllers.delete(rf.key)); // If any loaders returned a redirect Response, start a new REPLACE navigation let redirect = findRedirect(results); if (redirect) { if (redirect.idx >= matchesToLoad.length) { // If this redirect came from a fetcher make sure we mark it in // fetchRedirectIds so it doesn't get revalidated on the next set of // loader executions let fetcherKey = revalidatingFetchers[redirect.idx - matchesToLoad.length].key; fetchRedirectIds.add(fetcherKey); } await startRedirectNavigation(state, redirect.result, { replace }); return { shortCircuited: true }; } // Process and commit output from loaders let { loaderData, errors } = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds); // Wire up subscribers to update loaderData as promises settle activeDeferreds.forEach((deferredData, routeId) => { deferredData.subscribe(aborted => { // Note: No need to updateState here since the TrackedPromise on // loaderData is stable across resolve/reject // Remove this instance if we were aborted or if promises have settled if (aborted || deferredData.done) { activeDeferreds.delete(routeId); } }); }); let updatedFetchers = markFetchRedirectsDone(); let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId); let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0; return _extends({ loaderData, errors }, shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {}); } function getFetcher(key) { if (future.v7_fetcherPersist) { activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1); // If this fetcher was previously marked for deletion, unmark it since we // have a new instance if (deletedFetchers.has(key)) { deletedFetchers.delete(key); } } return state.fetchers.get(key) || IDLE_FETCHER; } // Trigger a fetcher load/submit for the given fetcher key function fetch(key, routeId, href, opts) { if (isServer) { throw new Error("router.fetch() was called during the server render, but it shouldn't be. " + "You are likely calling a useFetcher() method in the body of your component. " + "Try moving it to a useEffect or a callback."); } if (fetchControllers.has(key)) abortFetcher(key); let routesToUse = inFlightDataRoutes || dataRoutes; let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, routeId, opts == null ? void 0 : opts.relative); let matches = matchRoutes(routesToUse, normalizedPath, basename); if (!matches) { setFetcherError(key, routeId, getInternalRouterError(404, { pathname: normalizedPath })); return; } let { path, submission, error } = normalizeNavigateOptions(future.v7_normalizeFormMethod, true, normalizedPath, opts); if (error) { setFetcherError(key, routeId, error); return; } let match = getTargetMatch(matches, path); pendingPreventScrollReset = (opts && opts.preventScrollReset) === true; if (submission && isMutationMethod(submission.formMethod)) { handleFetcherAction(key, routeId, path, match, matches, submission); return; } // Store off the match so we can call it's shouldRevalidate on subsequent // revalidations fetchLoadMatches.set(key, { routeId, path }); handleFetcherLoader(key, routeId, path, match, matches, submission); } // Call the action for the matched fetcher.submit(), and then handle redirects, // errors, and revalidation async function handleFetcherAction(key, routeId, path, match, requestMatches, submission) { interruptActiveLoads(); fetchLoadMatches.delete(key); if (!match.route.action && !match.route.lazy) { let error = getInternalRouterError(405, { method: submission.formMethod, pathname: path, routeId: routeId }); setFetcherError(key, routeId, error); return; } // Put this fetcher into it's submitting state let existingFetcher = state.fetchers.get(key); let fetcher = getSubmittingFetcher(submission, existingFetcher); state.fetchers.set(key, fetcher); updateState({ fetchers: new Map(state.fetchers) }); // Call the action for the fetcher let abortController = new AbortController(); let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission); fetchControllers.set(key, abortController); let originatingLoadId = incrementingLoadId; let actionResult = await callLoaderOrAction("action", fetchRequest, match, requestMatches, manifest, mapRouteProperties, basename); if (fetchRequest.signal.aborted) { // We can delete this so long as we weren't aborted by our own fetcher // re-submit which would have put _new_ controller is in fetchControllers if (fetchControllers.get(key) === abortController) { fetchControllers.delete(key); } return; } if (deletedFetchers.has(key)) { state.fetchers.set(key, getDoneFetcher(undefined)); updateState({ fetchers: new Map(state.fetchers) }); return; } if (isRedirectResult(actionResult)) { fetchControllers.delete(key); if (pendingNavigationLoadId > originatingLoadId) { // A new navigation was kicked off after our action started, so that // should take precedence over this redirect navigation. We already // set isRevalidationRequired so all loaders for the new route should // fire unless opted out via shouldRevalidate let doneFetcher = getDoneFetcher(undefined); state.fetchers.set(key, doneFetcher); updateState({ fetchers: new Map(state.fetchers) }); return; } else { fetchRedirectIds.add(key); let loadingFetcher = getLoadingFetcher(submission); state.fetchers.set(key, loadingFetcher); updateState({ fetchers: new Map(state.fetchers) }); return startRedirectNavigation(state, actionResult, { fetcherSubmission: submission }); } } // Process any non-redirect errors thrown if (isErrorResult(actionResult)) { setFetcherError(key, routeId, actionResult.error); return; } if (isDeferredResult(actionResult)) { throw getInternalRouterError(400, { type: "defer-action" }); } // Start the data load for current matches, or the next location if we're // in the middle of a navigation let nextLocation = state.navigation.location || state.location; let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal); let routesToUse = inFlightDataRoutes || dataRoutes; let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches; invariant(matches, "Didn't find any matches after fetcher action"); let loadId = ++incrementingLoadId; fetchReloadIds.set(key, loadId); let loadFetcher = getLoadingFetcher(submission, actionResult.data); state.fetchers.set(key, loadFetcher); let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, { [match.route.id]: actionResult.data }, undefined // No need to send through errors since we short circuit above ); // Put all revalidating fetchers into the loading state, except for the // current fetcher which we want to keep in it's current loading state which // contains it's action submission info + action data revalidatingFetchers.filter(rf => rf.key !== key).forEach(rf => { let staleKey = rf.key; let existingFetcher = state.fetchers.get(staleKey); let revalidatingFetcher = getLoadingFetcher(undefined, existingFetcher ? existingFetcher.data : undefined); state.fetchers.set(staleKey, revalidatingFetcher); if (fetchControllers.has(staleKey)) { abortFetcher(staleKey); } if (rf.controller) { fetchControllers.set(staleKey, rf.controller); } }); updateState({ fetchers: new Map(state.fetchers) }); let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(rf => abortFetcher(rf.key)); abortController.signal.addEventListener("abort", abortPendingFetchRevalidations); let { results, loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, revalidationRequest); if (abortController.signal.aborted) { return; } abortController.signal.removeEventListener("abort", abortPendingFetchRevalidations); fetchReloadIds.delete(key); fetchControllers.delete(key); revalidatingFetchers.forEach(r => fetchControllers.delete(r.key)); let redirect = findRedirect(results); if (redirect) { if (redirect.idx >= matchesToLoad.length) { // If this redirect came from a fetcher make sure we mark it in // fetchRedirectIds so it doesn't get revalidated on the next set of // loader executions let fetcherKey = revalidatingFetchers[redirect.idx - matchesToLoad.length].key; fetchRedirectIds.add(fetcherKey); } return startRedirectNavigation(state, redirect.result); } // Process and commit output from loaders let { loaderData, errors } = processLoaderData(state, state.matches, matchesToLoad, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds); // Since we let revalidations complete even if the submitting fetcher was // deleted, only put it back to idle if it hasn't been deleted if (state.fetchers.has(key)) { let doneFetcher = getDoneFetcher(actionResult.data); state.fetchers.set(key, doneFetcher); } abortStaleFetchLoads(loadId); // If we are currently in a navigation loading state and this fetcher is // more recent than the navigation, we want the newer data so abort the // navigation and complete it with the fetcher data if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) { invariant(pendingAction, "Expected pending action"); pendingNavigationController && pendingNavigationController.abort(); completeNavigation(state.navigation.location, { matches, loaderData, errors, fetchers: new Map(state.fetchers) }); } else { // otherwise just update with the fetcher data, preserving any existing // loaderData for loaders that did not need to reload. We have to // manually merge here since we aren't going through completeNavigation updateState({ errors, loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors), fetchers: new Map(state.fetchers) }); isRevalidationRequired = false; } } // Call the matched loader for fetcher.load(), handling redirects, errors, etc. async function handleFetcherLoader(key, routeId, path, match, matches, submission) { let existingFetcher = state.fetchers.get(key); // Put this fetcher into it's loading state let loadingFetcher = getLoadingFetcher(submission, existingFetcher ? existingFetcher.data : undefined); state.fetchers.set(key, loadingFetcher); updateState({ fetchers: new Map(state.fetchers) }); // Call the loader for this fetcher route match let abortController = new AbortController(); let fetchRequest = createClientSideRequest(init.history, path, abortController.signal); fetchControllers.set(key, abortController); let originatingLoadId = incrementingLoadId; let result = await callLoaderOrAction("loader", fetchRequest, match, matches, manifest, mapRouteProperties, basename); // Deferred isn't supported for fetcher loads, await everything and treat it // as a normal load. resolveDeferredData will return undefined if this // fetcher gets aborted, so we just leave result untouched and short circuit // below if that happens if (isDeferredResult(result)) { result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result; } // We can delete this so long as we weren't aborted by our our own fetcher // re-load which would have put _new_ controller is in fetchControllers if (fetchControllers.get(key) === abortController) { fetchControllers.delete(key); } if (fetchRequest.signal.aborted) { return; } if (deletedFetchers.has(key)) { state.fetchers.set(key, getDoneFetcher(undefined)); updateState({ fetchers: new Map(state.fetchers) }); return; } // If the loader threw a redirect Response, start a new REPLACE navigation if (isRedirectResult(result)) { if (pendingNavigationLoadId > originatingLoadId) { // A new navigation was kicked off after our loader started, so that // should take precedence over this redirect navigation let doneFetcher = getDoneFetcher(undefined); state.fetchers.set(key, doneFetcher); updateState({ fetchers: new Map(state.fetchers) }); return; } else { fetchRedirectIds.add(key); await startRedirectNavigation(state, result); return; } } // Process any non-redirect errors thrown if (isErrorResult(result)) { setFetcherError(key, routeId, result.error); return; } invariant(!isDeferredResult(result), "Unhandled fetcher deferred data"); // Put the fetcher back into an idle state let doneFetcher = getDoneFetcher(result.data); state.fetchers.set(key, doneFetcher); updateState({ fetchers: new Map(state.fetchers) }); } /** * Utility function to handle redirects returned from an action or loader. * Normally, a redirect "replaces" the navigation that triggered it. So, for * example: * * - user is on /a * - user clicks a link to /b * - loader for /b redirects to /c * * In a non-JS app the browser would track the in-flight navigation to /b and * then replace it with /c when it encountered the redirect response. In * the end it would only ever update the URL bar with /c. * * In client-side routing using pushState/replaceState, we aim to emulate * this behavior and we also do not update history until the end of the * navigation (including processed redirects). This means that we never * actually touch history until we've processed redirects, so we just use * the history action from the original navigation (PUSH or REPLACE). */ async function startRedirectNavigation(state, redirect, _temp) { let { submission, fetcherSubmission, replace } = _temp === void 0 ? {} : _temp; if (redirect.revalidate) { isRevalidationRequired = true; } let redirectLocation = createLocation(state.location, redirect.location, { _isRedirect: true }); invariant(redirectLocation, "Expected a location on the redirect navigation"); if (isBrowser) { let isDocumentReload = false; if (redirect.reloadDocument) { // Hard reload if the response contained X-Remix-Reload-Document isDocumentReload = true; } else if (ABSOLUTE_URL_REGEX.test(redirect.location)) { const url = init.history.createURL(redirect.location); isDocumentReload = // Hard reload if it's an absolute URL to a new origin url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename stripBasename(url.pathname, basename) == null; } if (isDocumentReload) { if (replace) { routerWindow.location.replace(redirect.location); } else { routerWindow.location.assign(redirect.location); } return; } } // There's no need to abort on redirects, since we don't detect the // redirect until the action/loaders have settled pendingNavigationController = null; let redirectHistoryAction = replace === true ? Action.Replace : Action.Push; // Use the incoming submission if provided, fallback on the active one in // state.navigation let { formMethod, formAction, formEncType } = state.navigation; if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) { submission = getSubmissionFromNavigation(state.navigation); } // If this was a 307/308 submission we want to preserve the HTTP method and // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the // redirected location let activeSubmission = submission || fetcherSubmission; if (redirectPreserveMethodStatusCodes.has(redirect.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) { await startNavigation(redirectHistoryAction, redirectLocation, { submission: _extends({}, activeSubmission, { formAction: redirect.location }), // Preserve this flag across redirects preventScrollReset: pendingPreventScrollReset }); } else { // If we have a navigation submission, we will preserve it through the // redirect navigation let overrideNavigation = getLoadingNavigation(redirectLocation, submission); await startNavigation(redirectHistoryAction, redirectLocation, { overrideNavigation, // Send fetcher submissions through for shouldRevalidate fetcherSubmission, // Preserve this flag across redirects preventScrollReset: pendingPreventScrollReset }); } } async function callLoadersAndMaybeResolveData(currentMatches, matches, matchesToLoad, fetchersToLoad, request) { // Call all navigation loaders and revalidating fetcher loaders in parallel, // then slice off the results into separate arrays so we can handle them // accordingly let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties, basename)), ...fetchersToLoad.map(f => { if (f.matches && f.match && f.controller) { return callLoaderOrAction("loader", createClientSideRequest(init.history, f.path, f.controller.signal), f.match, f.matches, manifest, mapRouteProperties, basename); } else { let error = { type: ResultType.error, error: getInternalRouterError(404, { pathname: f.path }) }; return error; } })]); let loaderResults = results.slice(0, matchesToLoad.length); let fetcherResults = results.slice(matchesToLoad.length); await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, loaderResults.map(() => request.signal), false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map(f => f.match), fetcherResults, fetchersToLoad.map(f => f.controller ? f.controller.signal : null), true)]); return { results, loaderResults, fetcherResults }; } function interruptActiveLoads() { // Every interruption triggers a revalidation isRevalidationRequired = true; // Cancel pending route-level deferreds and mark cancelled routes for // revalidation cancelledDeferredRoutes.push(...cancelActiveDeferreds()); // Abort in-flight fetcher loads fetchLoadMatches.forEach((_, key) => { if (fetchControllers.has(key)) { cancelledFetcherLoads.push(key); abortFetcher(key); } }); } function setFetcherError(key, routeId, error) { let boundaryMatch = findNearestBoundary(state.matches, routeId); deleteFetcher(key); updateState({ errors: { [boundaryMatch.route.id]: error }, fetchers: new Map(state.fetchers) }); } function deleteFetcher(key) { let fetcher = state.fetchers.get(key); // Don't abort the controller if this is a deletion of a fetcher.submit() // in it's loading phase since - we don't want to abort the corresponding // revalidation and want them to complete and land if (fetchControllers.has(key) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))) { abortFetcher(key); } fetchLoadMatches.delete(key); fetchReloadIds.delete(key); fetchRedirectIds.delete(key); deletedFetchers.delete(key); state.fetchers.delete(key); } function deleteFetcherAndUpdateState(key) { if (future.v7_fetcherPersist) { let count = (activeFetchers.get(key) || 0) - 1; if (count <= 0) { activeFetchers.delete(key); deletedFetchers.add(key); } else { activeFetchers.set(key, count); } } else { deleteFetcher(key); } updateState({ fetchers: new Map(state.fetchers) }); } function abortFetcher(key) { let controller = fetchControllers.get(key); invariant(controller, "Expected fetch controller: " + key); controller.abort(); fetchControllers.delete(key); } function markFetchersDone(keys) { for (let key of keys) { let fetcher = getFetcher(key); let doneFetcher = getDoneFetcher(fetcher.data); state.fetchers.set(key, doneFetcher); } } function markFetchRedirectsDone() { let doneKeys = []; let updatedFetchers = false; for (let key of fetchRedirectIds) { let fetcher = state.fetchers.get(key); invariant(fetcher, "Expected fetcher: " + key); if (fetcher.state === "loading") { fetchRedirectIds.delete(key); doneKeys.push(key); updatedFetchers = true; } } markFetchersDone(doneKeys); return updatedFetchers; } function abortStaleFetchLoads(landedId) { let yeetedKeys = []; for (let [key, id] of fetchReloadIds) { if (id < landedId) { let fetcher = state.fetchers.get(key); invariant(fetcher, "Expected fetcher: " + key); if (fetcher.state === "loading") { abortFetcher(key); fetchReloadIds.delete(key); yeetedKeys.push(key); } } } markFetchersDone(yeetedKeys); return yeetedKeys.length > 0; } function getBlocker(key, fn) { let blocker = state.blockers.get(key) || IDLE_BLOCKER; if (blockerFunctions.get(key) !== fn) { blockerFunctions.set(key, fn); } return blocker; } function deleteBlocker(key) { state.blockers.delete(key); blockerFunctions.delete(key); } // Utility function to update blockers, ensuring valid state transitions function updateBlocker(key, newBlocker) { let blocker = state.blockers.get(key) || IDLE_BLOCKER; // Poor mans state machine :) // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM invariant(blocker.state === "unblocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "proceeding" || blocker.state === "blocked" && newBlocker.state === "unblocked" || blocker.state === "proceeding" && newBlocker.state === "unblocked", "Invalid blocker state transition: " + blocker.state + " -> " + newBlocker.state); let blockers = new Map(state.blockers); blockers.set(key, newBlocker); updateState({ blockers }); } function shouldBlockNavigation(_ref2) { let { currentLocation, nextLocation, historyAction } = _ref2; if (blockerFunctions.size === 0) { return; } // We ony support a single active blocker at the moment since we don't have // any compelling use cases for multi-blocker yet if (blockerFunctions.size > 1) { warning(false, "A router only supports one blocker at a time"); } let entries = Array.from(blockerFunctions.entries()); let [blockerKey, blockerFunction] = entries[entries.length - 1]; let blocker = state.blockers.get(blockerKey); if (blocker && blocker.state === "proceeding") { // If the blocker is currently proceeding, we don't need to re-check // it and can let this navigation continue return; } // At this point, we know we're unblocked/blocked so we need to check the // user-provided blocker function if (blockerFunction({ currentLocation, nextLocation, historyAction })) { return blockerKey; } } function cancelActiveDeferreds(predicate) { let cancelledRouteIds = []; activeDeferreds.forEach((dfd, routeId) => { if (!predicate || predicate(routeId)) { // Cancel the deferred - but do not remove from activeDeferreds here - // we rely on the subscribers to do that so our tests can assert proper // cleanup via _internalActiveDeferreds dfd.cancel(); cancelledRouteIds.push(routeId); activeDeferreds.delete(routeId); } }); return cancelledRouteIds; } // Opt in to capturing and reporting scroll positions during navigations, // used by the component function enableScrollRestoration(positions, getPosition, getKey) { savedScrollPositions = positions; getScrollPosition = getPosition; getScrollRestorationKey = getKey || null; // Perform initial hydration scroll restoration, since we miss the boat on // the initial updateState() because we've not yet rendered // and therefore have no savedScrollPositions available if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) { initialScrollRestored = true; let y = getSavedScrollPosition(state.location, state.matches); if (y != null) { updateState({ restoreScrollPosition: y }); } } return () => { savedScrollPositions = null; getScrollPosition = null; getScrollRestorationKey = null; }; } function getScrollKey(location, matches) { if (getScrollRestorationKey) { let key = getScrollRestorationKey(location, matches.map(m => convertRouteMatchToUiMatch(m, state.loaderData))); return key || location.key; } return location.key; } function saveScrollPosition(location, matches) { if (savedScrollPositions && getScrollPosition) { let key = getScrollKey(location, matches); savedScrollPositions[key] = getScrollPosition(); } } function getSavedScrollPosition(location, matches) { if (savedScrollPositions) { let key = getScrollKey(location, matches); let y = savedScrollPositions[key]; if (typeof y === "number") { return y; } } return null; } function _internalSetRoutes(newRoutes) { manifest = {}; inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties, undefined, manifest); } router = { get basename() { return basename; }, get state() { return state; }, get routes() { return dataRoutes; }, get window() { return routerWindow; }, initialize, subscribe, enableScrollRestoration, navigate, fetch, revalidate, // Passthrough to history-aware createHref used by useHref so we get proper // hash-aware URLs in DOM paths createHref: to => init.history.createHref(to), encodeLocation: to => init.history.encodeLocation(to), getFetcher, deleteFetcher: deleteFetcherAndUpdateState, dispose, getBlocker, deleteBlocker, _internalFetchControllers: fetchControllers, _internalActiveDeferreds: activeDeferreds, // TODO: Remove setRoutes, it's temporary to avoid dealing with // updating the tree while validating the update algorithm. _internalSetRoutes }; return router; } //#endregion //////////////////////////////////////////////////////////////////////////////// //#region createStaticHandler //////////////////////////////////////////////////////////////////////////////// const UNSAFE_DEFERRED_SYMBOL = Symbol("deferred"); function createStaticHandler(routes, opts) { invariant(routes.length > 0, "You must provide a non-empty routes array to createStaticHandler"); let manifest = {}; let basename = (opts ? opts.basename : null) || "/"; let mapRouteProperties; if (opts != null && opts.mapRouteProperties) { mapRouteProperties = opts.mapRouteProperties; } else if (opts != null && opts.detectErrorBoundary) { // If they are still using the deprecated version, wrap it with the new API let detectErrorBoundary = opts.detectErrorBoundary; mapRouteProperties = route => ({ hasErrorBoundary: detectErrorBoundary(route) }); } else { mapRouteProperties = defaultMapRouteProperties; } let dataRoutes = convertRoutesToDataRoutes(routes, mapRouteProperties, undefined, manifest); /** * The query() method is intended for document requests, in which we want to * call an optional action and potentially multiple loaders for all nested * routes. It returns a StaticHandlerContext object, which is very similar * to the router state (location, loaderData, actionData, errors, etc.) and * also adds SSR-specific information such as the statusCode and headers * from action/loaders Responses. * * It _should_ never throw and should report all errors through the * returned context.errors object, properly associating errors to their error * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be * used to emulate React error boundaries during SSr by performing a second * pass only down to the boundaryId. * * The one exception where we do not return a StaticHandlerContext is when a * redirect response is returned or thrown from any action/loader. We * propagate that out and return the raw Response so the HTTP server can * return it directly. */ async function query(request, _temp2) { let { requestContext } = _temp2 === void 0 ? {} : _temp2; let url = new URL(request.url); let method = request.method; let location = createLocation("", createPath(url), null, "default"); let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't if (!isValidMethod(method) && method !== "HEAD") { let error = getInternalRouterError(405, { method }); let { matches: methodNotAllowedMatches, route } = getShortCircuitMatches(dataRoutes); return { basename, location, matches: methodNotAllowedMatches, loaderData: {}, actionData: null, errors: { [route.id]: error }, statusCode: error.status, loaderHeaders: {}, actionHeaders: {}, activeDeferreds: null }; } else if (!matches) { let error = getInternalRouterError(404, { pathname: location.pathname }); let { matches: notFoundMatches, route } = getShortCircuitMatches(dataRoutes); return { basename, location, matches: notFoundMatches, loaderData: {}, actionData: null, errors: { [route.id]: error }, statusCode: error.status, loaderHeaders: {}, actionHeaders: {}, activeDeferreds: null }; } let result = await queryImpl(request, location, matches, requestContext); if (isResponse(result)) { return result; } // When returning StaticHandlerContext, we patch back in the location here // since we need it for React Context. But this helps keep our submit and // loadRouteData operating on a Request instead of a Location return _extends({ location, basename }, result); } /** * The queryRoute() method is intended for targeted route requests, either * for fetch ?_data requests or resource route requests. In this case, we * are only ever calling a single action or loader, and we are returning the * returned value directly. In most cases, this will be a Response returned * from the action/loader, but it may be a primitive or other value as well - * and in such cases the calling context should handle that accordingly. * * We do respect the throw/return differentiation, so if an action/loader * throws, then this method will throw the value. This is important so we * can do proper boundary identification in Remix where a thrown Response * must go to the Catch Boundary but a returned Response is happy-path. * * One thing to note is that any Router-initiated Errors that make sense * to associate with a status code will be thrown as an ErrorResponse * instance which include the raw Error, such that the calling context can * serialize the error as they see fit while including the proper response * code. Examples here are 404 and 405 errors that occur prior to reaching * any user-defined loaders. */ async function queryRoute(request, _temp3) { let { routeId, requestContext } = _temp3 === void 0 ? {} : _temp3; let url = new URL(request.url); let method = request.method; let location = createLocation("", createPath(url), null, "default"); let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") { throw getInternalRouterError(405, { method }); } else if (!matches) { throw getInternalRouterError(404, { pathname: location.pathname }); } let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location); if (routeId && !match) { throw getInternalRouterError(403, { pathname: location.pathname, routeId }); } else if (!match) { // This should never hit I don't think? throw getInternalRouterError(404, { pathname: location.pathname }); } let result = await queryImpl(request, location, matches, requestContext, match); if (isResponse(result)) { return result; } let error = result.errors ? Object.values(result.errors)[0] : undefined; if (error !== undefined) { // If we got back result.errors, that means the loader/action threw // _something_ that wasn't a Response, but it's not guaranteed/required // to be an `instanceof Error` either, so we have to use throw here to // preserve the "error" state outside of queryImpl. throw error; } // Pick off the right state value to return if (result.actionData) { return Object.values(result.actionData)[0]; } if (result.loaderData) { var _result$activeDeferre; let data = Object.values(result.loaderData)[0]; if ((_result$activeDeferre = result.activeDeferreds) != null && _result$activeDeferre[match.route.id]) { data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id]; } return data; } return undefined; } async function queryImpl(request, location, matches, requestContext, routeMatch) { invariant(request.signal, "query()/queryRoute() requests must contain an AbortController signal"); try { if (isMutationMethod(request.method.toLowerCase())) { let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), requestContext, routeMatch != null); return result; } let result = await loadRouteData(request, matches, requestContext, routeMatch); return isResponse(result) ? result : _extends({}, result, { actionData: null, actionHeaders: {} }); } catch (e) { // If the user threw/returned a Response in callLoaderOrAction, we throw // it to bail out and then return or throw here based on whether the user // returned or threw if (isQueryRouteResponse(e)) { if (e.type === ResultType.error) { throw e.response; } return e.response; } // Redirects are always returned since they don't propagate to catch // boundaries if (isRedirectResponse(e)) { return e; } throw e; } } async function submit(request, matches, actionMatch, requestContext, isRouteRequest) { let result; if (!actionMatch.route.action && !actionMatch.route.lazy) { let error = getInternalRouterError(405, { method: request.method, pathname: new URL(request.url).pathname, routeId: actionMatch.route.id }); if (isRouteRequest) { throw error; } result = { type: ResultType.error, error }; } else { result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties, basename, { isStaticRequest: true, isRouteRequest, requestContext }); if (request.signal.aborted) { let method = isRouteRequest ? "queryRoute" : "query"; throw new Error(method + "() call aborted: " + request.method + " " + request.url); } } if (isRedirectResult(result)) { // Uhhhh - this should never happen, we should always throw these from // callLoaderOrAction, but the type narrowing here keeps TS happy and we // can get back on the "throw all redirect responses" train here should // this ever happen :/ throw new Response(null, { status: result.status, headers: { Location: result.location } }); } if (isDeferredResult(result)) { let error = getInternalRouterError(400, { type: "defer-action" }); if (isRouteRequest) { throw error; } result = { type: ResultType.error, error }; } if (isRouteRequest) { // Note: This should only be non-Response values if we get here, since // isRouteRequest should throw any Response received in callLoaderOrAction if (isErrorResult(result)) { throw result.error; } return { matches: [actionMatch], loaderData: {}, actionData: { [actionMatch.route.id]: result.data }, errors: null, // Note: statusCode + headers are unused here since queryRoute will // return the raw Response or value statusCode: 200, loaderHeaders: {}, actionHeaders: {}, activeDeferreds: null }; } if (isErrorResult(result)) { // Store off the pending error - we use it to determine which loaders // to call and will commit it when we complete the navigation let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); let context = await loadRouteData(request, matches, requestContext, undefined, { [boundaryMatch.route.id]: result.error }); // action status codes take precedence over loader status codes return _extends({}, context, { statusCode: isRouteErrorResponse(result.error) ? result.error.status : 500, actionData: null, actionHeaders: _extends({}, result.headers ? { [actionMatch.route.id]: result.headers } : {}) }); } // Create a GET request for the loaders let loaderRequest = new Request(request.url, { headers: request.headers, redirect: request.redirect, signal: request.signal }); let context = await loadRouteData(loaderRequest, matches, requestContext); return _extends({}, context, result.statusCode ? { statusCode: result.statusCode } : {}, { actionData: { [actionMatch.route.id]: result.data }, actionHeaders: _extends({}, result.headers ? { [actionMatch.route.id]: result.headers } : {}) }); } async function loadRouteData(request, matches, requestContext, routeMatch, pendingActionError) { let isRouteRequest = routeMatch != null; // Short circuit if we have no loaders to run (queryRoute()) if (isRouteRequest && !(routeMatch != null && routeMatch.route.loader) && !(routeMatch != null && routeMatch.route.lazy)) { throw getInternalRouterError(400, { method: request.method, pathname: new URL(request.url).pathname, routeId: routeMatch == null ? void 0 : routeMatch.route.id }); } let requestMatches = routeMatch ? [routeMatch] : getLoaderMatchesUntilBoundary(matches, Object.keys(pendingActionError || {})[0]); let matchesToLoad = requestMatches.filter(m => m.route.loader || m.route.lazy); // Short circuit if we have no loaders to run (query()) if (matchesToLoad.length === 0) { return { matches, // Add a null for all matched routes for proper revalidation on the client loaderData: matches.reduce((acc, m) => Object.assign(acc, { [m.route.id]: null }), {}), errors: pendingActionError || null, statusCode: 200, loaderHeaders: {}, activeDeferreds: null }; } let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties, basename, { isStaticRequest: true, isRouteRequest, requestContext }))]); if (request.signal.aborted) { let method = isRouteRequest ? "queryRoute" : "query"; throw new Error(method + "() call aborted: " + request.method + " " + request.url); } // Process and commit output from loaders let activeDeferreds = new Map(); let context = processRouteLoaderData(matches, matchesToLoad, results, pendingActionError, activeDeferreds); // Add a null for any non-loader matches for proper revalidation on the client let executedLoaders = new Set(matchesToLoad.map(match => match.route.id)); matches.forEach(match => { if (!executedLoaders.has(match.route.id)) { context.loaderData[match.route.id] = null; } }); return _extends({}, context, { matches, activeDeferreds: activeDeferreds.size > 0 ? Object.fromEntries(activeDeferreds.entries()) : null }); } return { dataRoutes, query, queryRoute }; } //#endregion //////////////////////////////////////////////////////////////////////////////// //#region Helpers //////////////////////////////////////////////////////////////////////////////// /** * Given an existing StaticHandlerContext and an error thrown at render time, * provide an updated StaticHandlerContext suitable for a second SSR render */ function getStaticContextFromError(routes, context, error) { let newContext = _extends({}, context, { statusCode: 500, errors: { [context._deepestRenderedBoundaryId || routes[0].id]: error } }); return newContext; } function isSubmissionNavigation(opts) { return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== undefined); } function normalizeTo(location, matches, basename, prependBasename, to, fromRouteId, relative) { let contextualMatches; let activeRouteMatch; if (fromRouteId != null && relative !== "path") { // Grab matches up to the calling route so our route-relative logic is // relative to the correct source route. When using relative:path, // fromRouteId is ignored since that is always relative to the current // location path contextualMatches = []; for (let match of matches) { contextualMatches.push(match); if (match.route.id === fromRouteId) { activeRouteMatch = match; break; } } } else { contextualMatches = matches; activeRouteMatch = matches[matches.length - 1]; } // Resolve the relative path let path = resolveTo(to ? to : ".", getPathContributingMatches(contextualMatches).map(m => m.pathnameBase), stripBasename(location.pathname, basename) || location.pathname, relative === "path"); // When `to` is not specified we inherit search/hash from the current // location, unlike when to="." and we just inherit the path. // See https://github.com/remix-run/remix/issues/927 if (to == null) { path.search = location.search; path.hash = location.hash; } // Add an ?index param for matched index routes if we don't already have one if ((to == null || to === "" || to === ".") && activeRouteMatch && activeRouteMatch.route.index && !hasNakedIndexQuery(path.search)) { path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index"; } // If we're operating within a basename, prepend it to the pathname. If // this is a root navigation, then just use the raw basename which allows // the basename to have full control over the presence of a trailing slash // on root actions if (prependBasename && basename !== "/") { path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]); } return createPath(path); } // Normalize navigation options by converting formMethod=GET formData objects to // URLSearchParams so they behave identically to links with query params function normalizeNavigateOptions(normalizeFormMethod, isFetcher, path, opts) { // Return location verbatim on non-submission navigations if (!opts || !isSubmissionNavigation(opts)) { return { path }; } if (opts.formMethod && !isValidMethod(opts.formMethod)) { return { path, error: getInternalRouterError(405, { method: opts.formMethod }) }; } let getInvalidBodyError = () => ({ path, error: getInternalRouterError(400, { type: "invalid-body" }) }); // Create a Submission on non-GET navigations let rawFormMethod = opts.formMethod || "get"; let formMethod = normalizeFormMethod ? rawFormMethod.toUpperCase() : rawFormMethod.toLowerCase(); let formAction = stripHashFromPath(path); if (opts.body !== undefined) { if (opts.formEncType === "text/plain") { // text only support POST/PUT/PATCH/DELETE submissions if (!isMutationMethod(formMethod)) { return getInvalidBodyError(); } let text = typeof opts.body === "string" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ? // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data Array.from(opts.body.entries()).reduce((acc, _ref3) => { let [name, value] = _ref3; return "" + acc + name + "=" + value + "\n"; }, "") : String(opts.body); return { path, submission: { formMethod, formAction, formEncType: opts.formEncType, formData: undefined, json: undefined, text } }; } else if (opts.formEncType === "application/json") { // json only supports POST/PUT/PATCH/DELETE submissions if (!isMutationMethod(formMethod)) { return getInvalidBodyError(); } try { let json = typeof opts.body === "string" ? JSON.parse(opts.body) : opts.body; return { path, submission: { formMethod, formAction, formEncType: opts.formEncType, formData: undefined, json, text: undefined } }; } catch (e) { return getInvalidBodyError(); } } } invariant(typeof FormData === "function", "FormData is not available in this environment"); let searchParams; let formData; if (opts.formData) { searchParams = convertFormDataToSearchParams(opts.formData); formData = opts.formData; } else if (opts.body instanceof FormData) { searchParams = convertFormDataToSearchParams(opts.body); formData = opts.body; } else if (opts.body instanceof URLSearchParams) { searchParams = opts.body; formData = convertSearchParamsToFormData(searchParams); } else if (opts.body == null) { searchParams = new URLSearchParams(); formData = new FormData(); } else { try { searchParams = new URLSearchParams(opts.body); formData = convertSearchParamsToFormData(searchParams); } catch (e) { return getInvalidBodyError(); } } let submission = { formMethod, formAction, formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded", formData, json: undefined, text: undefined }; if (isMutationMethod(submission.formMethod)) { return { path, submission }; } // Flatten submission onto URLSearchParams for GET submissions let parsedPath = parsePath(path); // On GET navigation submissions we can drop the ?index param from the // resulting location since all loaders will run. But fetcher GET submissions // only run a single loader so we need to preserve any incoming ?index params if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) { searchParams.append("index", ""); } parsedPath.search = "?" + searchParams; return { path: createPath(parsedPath), submission }; } // Filter out all routes below any caught error as they aren't going to // render so we don't need to load them function getLoaderMatchesUntilBoundary(matches, boundaryId) { let boundaryMatches = matches; if (boundaryId) { let index = matches.findIndex(m => m.route.id === boundaryId); if (index >= 0) { boundaryMatches = matches.slice(0, index); } } return boundaryMatches; } function getMatchesToLoad(history, state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError) { let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : undefined; let currentUrl = history.createURL(state.location); let nextUrl = history.createURL(location); // Pick navigation matches that are net-new or qualify for revalidation let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined; let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId); let navigationMatches = boundaryMatches.filter((match, index) => { if (match.route.lazy) { // We haven't loaded this route yet so we don't know if it's got a loader! return true; } if (match.route.loader == null) { return false; } // Always call the loader on new route instances and pending defer cancellations if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some(id => id === match.route.id)) { return true; } // This is the default implementation for when we revalidate. If the route // provides it's own implementation, then we give them full control but // provide this value so they can leverage it if needed after they check // their own specific use cases let currentRouteMatch = state.matches[index]; let nextRouteMatch = match; return shouldRevalidateLoader(match, _extends({ currentUrl, currentParams: currentRouteMatch.params, nextUrl, nextParams: nextRouteMatch.params }, submission, { actionResult, defaultShouldRevalidate: // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate isRevalidationRequired || // Clicked the same link, resubmitted a GET form currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search || // Search params affect all loaders currentUrl.search !== nextUrl.search || isNewRouteInstance(currentRouteMatch, nextRouteMatch) })); }); // Pick fetcher.loads that need to be revalidated let revalidatingFetchers = []; fetchLoadMatches.forEach((f, key) => { // Don't revalidate if fetcher won't be present in the subsequent render if (!matches.some(m => m.route.id === f.routeId)) { return; } let fetcherMatches = matchRoutes(routesToUse, f.path, basename); // If the fetcher path no longer matches, push it in with null matches so // we can trigger a 404 in callLoadersAndMaybeResolveData. Note this is // currently only a use-case for Remix HMR where the route tree can change // at runtime and remove a route previously loaded via a fetcher if (!fetcherMatches) { revalidatingFetchers.push({ key, routeId: f.routeId, path: f.path, matches: null, match: null, controller: null }); return; } // Revalidating fetchers are decoupled from the route matches since they // load from a static href. They revalidate based on explicit revalidation // (submission, useRevalidator, or X-Remix-Revalidate) let fetcher = state.fetchers.get(key); let fetcherMatch = getTargetMatch(fetcherMatches, f.path); let shouldRevalidate = false; if (fetchRedirectIds.has(key)) { // Never trigger a revalidation of an actively redirecting fetcher shouldRevalidate = false; } else if (cancelledFetcherLoads.includes(key)) { // Always revalidate if the fetcher was cancelled shouldRevalidate = true; } else if (fetcher && fetcher.state !== "idle" && fetcher.data === undefined) { // If the fetcher hasn't ever completed loading yet, then this isn't a // revalidation, it would just be a brand new load if an explicit // revalidation is required shouldRevalidate = isRevalidationRequired; } else { // Otherwise fall back on any user-defined shouldRevalidate, defaulting // to explicit revalidations only shouldRevalidate = shouldRevalidateLoader(fetcherMatch, _extends({ currentUrl, currentParams: state.matches[state.matches.length - 1].params, nextUrl, nextParams: matches[matches.length - 1].params }, submission, { actionResult, defaultShouldRevalidate: isRevalidationRequired })); } if (shouldRevalidate) { revalidatingFetchers.push({ key, routeId: f.routeId, path: f.path, matches: fetcherMatches, match: fetcherMatch, controller: new AbortController() }); } }); return [navigationMatches, revalidatingFetchers]; } function isNewLoader(currentLoaderData, currentMatch, match) { let isNew = // [a] -> [a, b] !currentMatch || // [a, b] -> [a, c] match.route.id !== currentMatch.route.id; // Handle the case that we don't have data for a re-used route, potentially // from a prior error or from a cancelled pending deferred let isMissingData = currentLoaderData[match.route.id] === undefined; // Always load if this is a net-new route or we don't yet have data return isNew || isMissingData; } function isNewRouteInstance(currentMatch, match) { let currentPath = currentMatch.route.path; return ( // param change for this match, /users/123 -> /users/456 currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path // e.g. /files/images/avatar.jpg -> files/finances.xls currentPath != null && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"] ); } function shouldRevalidateLoader(loaderMatch, arg) { if (loaderMatch.route.shouldRevalidate) { let routeChoice = loaderMatch.route.shouldRevalidate(arg); if (typeof routeChoice === "boolean") { return routeChoice; } } return arg.defaultShouldRevalidate; } /** * Execute route.lazy() methods to lazily load route modules (loader, action, * shouldRevalidate) and update the routeManifest in place which shares objects * with dataRoutes so those get updated as well. */ async function loadLazyRouteModule(route, mapRouteProperties, manifest) { if (!route.lazy) { return; } let lazyRoute = await route.lazy(); // If the lazy route function was executed and removed by another parallel // call then we can return - first lazy() to finish wins because the return // value of lazy is expected to be static if (!route.lazy) { return; } let routeToUpdate = manifest[route.id]; invariant(routeToUpdate, "No route found in manifest"); // Update the route in place. This should be safe because there's no way // we could yet be sitting on this route as we can't get there without // resolving lazy() first. // // This is different than the HMR "update" use-case where we may actively be // on the route being updated. The main concern boils down to "does this // mutation affect any ongoing navigations or any current state.matches // values?". If not, it should be safe to update in place. let routeUpdates = {}; for (let lazyRouteProperty in lazyRoute) { let staticRouteValue = routeToUpdate[lazyRouteProperty]; let isPropertyStaticallyDefined = staticRouteValue !== undefined && // This property isn't static since it should always be updated based // on the route updates lazyRouteProperty !== "hasErrorBoundary"; warning(!isPropertyStaticallyDefined, "Route \"" + routeToUpdate.id + "\" has a static property \"" + lazyRouteProperty + "\" " + "defined but its lazy function is also returning a value for this property. " + ("The lazy route property \"" + lazyRouteProperty + "\" will be ignored.")); if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) { routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty]; } } // Mutate the route with the provided updates. Do this first so we pass // the updated version to mapRouteProperties Object.assign(routeToUpdate, routeUpdates); // Mutate the `hasErrorBoundary` property on the route based on the route // updates and remove the `lazy` function so we don't resolve the lazy // route again. Object.assign(routeToUpdate, _extends({}, mapRouteProperties(routeToUpdate), { lazy: undefined })); } async function callLoaderOrAction(type, request, match, matches, manifest, mapRouteProperties, basename, opts) { if (opts === void 0) { opts = {}; } let resultType; let result; let onReject; let runHandler = handler => { // Setup a promise we can race against so that abort signals short circuit let reject; let abortPromise = new Promise((_, r) => reject = r); onReject = () => reject(); request.signal.addEventListener("abort", onReject); return Promise.race([handler({ request, params: match.params, context: opts.requestContext }), abortPromise]); }; try { let handler = match.route[type]; if (match.route.lazy) { if (handler) { // Run statically defined handler in parallel with lazy() let handlerError; let values = await Promise.all([ // If the handler throws, don't let it immediately bubble out, // since we need to let the lazy() execution finish so we know if this // route has a boundary that can handle the error runHandler(handler).catch(e => { handlerError = e; }), loadLazyRouteModule(match.route, mapRouteProperties, manifest)]); if (handlerError) { throw handlerError; } result = values[0]; } else { // Load lazy route module, then run any returned handler await loadLazyRouteModule(match.route, mapRouteProperties, manifest); handler = match.route[type]; if (handler) { // Handler still run even if we got interrupted to maintain consistency // with un-abortable behavior of handler execution on non-lazy or // previously-lazy-loaded routes result = await runHandler(handler); } else if (type === "action") { let url = new URL(request.url); let pathname = url.pathname + url.search; throw getInternalRouterError(405, { method: request.method, pathname, routeId: match.route.id }); } else { // lazy() route has no loader to run. Short circuit here so we don't // hit the invariant below that errors on returning undefined. return { type: ResultType.data, data: undefined }; } } } else if (!handler) { let url = new URL(request.url); let pathname = url.pathname + url.search; throw getInternalRouterError(404, { pathname }); } else { result = await runHandler(handler); } invariant(result !== undefined, "You defined " + (type === "action" ? "an action" : "a loader") + " for route " + ("\"" + match.route.id + "\" but didn't return anything from your `" + type + "` ") + "function. Please return a value or `null`."); } catch (e) { resultType = ResultType.error; result = e; } finally { if (onReject) { request.signal.removeEventListener("abort", onReject); } } if (isResponse(result)) { let status = result.status; // Process redirects if (redirectStatusCodes.has(status)) { let location = result.headers.get("Location"); invariant(location, "Redirects returned/thrown from loaders/actions must have a Location header"); // Support relative routing in internal redirects if (!ABSOLUTE_URL_REGEX.test(location)) { location = normalizeTo(new URL(request.url), matches.slice(0, matches.indexOf(match) + 1), basename, true, location); } else if (!opts.isStaticRequest) { // Strip off the protocol+origin for same-origin + same-basename absolute // redirects. If this is a static request, we can let it go back to the // browser as-is let currentUrl = new URL(request.url); let url = location.startsWith("//") ? new URL(currentUrl.protocol + location) : new URL(location); let isSameBasename = stripBasename(url.pathname, basename) != null; if (url.origin === currentUrl.origin && isSameBasename) { location = url.pathname + url.search + url.hash; } } // Don't process redirects in the router during static requests requests. // Instead, throw the Response and let the server handle it with an HTTP // redirect. We also update the Location header in place in this flow so // basename and relative routing is taken into account if (opts.isStaticRequest) { result.headers.set("Location", location); throw result; } return { type: ResultType.redirect, status, location, revalidate: result.headers.get("X-Remix-Revalidate") !== null, reloadDocument: result.headers.get("X-Remix-Reload-Document") !== null }; } // For SSR single-route requests, we want to hand Responses back directly // without unwrapping. We do this with the QueryRouteResponse wrapper // interface so we can know whether it was returned or thrown if (opts.isRouteRequest) { let queryRouteResponse = { type: resultType === ResultType.error ? ResultType.error : ResultType.data, response: result }; throw queryRouteResponse; } let data; let contentType = result.headers.get("Content-Type"); // Check between word boundaries instead of startsWith() due to the last // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type if (contentType && /\bapplication\/json\b/.test(contentType)) { data = await result.json(); } else { data = await result.text(); } if (resultType === ResultType.error) { return { type: resultType, error: new ErrorResponseImpl(status, result.statusText, data), headers: result.headers }; } return { type: ResultType.data, data, statusCode: result.status, headers: result.headers }; } if (resultType === ResultType.error) { return { type: resultType, error: result }; } if (isDeferredData(result)) { var _result$init, _result$init2; return { type: ResultType.deferred, deferredData: result, statusCode: (_result$init = result.init) == null ? void 0 : _result$init.status, headers: ((_result$init2 = result.init) == null ? void 0 : _result$init2.headers) && new Headers(result.init.headers) }; } return { type: ResultType.data, data: result }; } // Utility method for creating the Request instances for loaders/actions during // client-side navigations and fetches. During SSR we will always have a // Request instance from the static handler (query/queryRoute) function createClientSideRequest(history, location, signal, submission) { let url = history.createURL(stripHashFromPath(location)).toString(); let init = { signal }; if (submission && isMutationMethod(submission.formMethod)) { let { formMethod, formEncType } = submission; // Didn't think we needed this but it turns out unlike other methods, patch // won't be properly normalized to uppercase and results in a 405 error. // See: https://fetch.spec.whatwg.org/#concept-method init.method = formMethod.toUpperCase(); if (formEncType === "application/json") { init.headers = new Headers({ "Content-Type": formEncType }); init.body = JSON.stringify(submission.json); } else if (formEncType === "text/plain") { // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) init.body = submission.text; } else if (formEncType === "application/x-www-form-urlencoded" && submission.formData) { // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) init.body = convertFormDataToSearchParams(submission.formData); } else { // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) init.body = submission.formData; } } return new Request(url, init); } function convertFormDataToSearchParams(formData) { let searchParams = new URLSearchParams(); for (let [key, value] of formData.entries()) { // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs searchParams.append(key, typeof value === "string" ? value : value.name); } return searchParams; } function convertSearchParamsToFormData(searchParams) { let formData = new FormData(); for (let [key, value] of searchParams.entries()) { formData.append(key, value); } return formData; } function processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds) { // Fill in loaderData/errors from our loaders let loaderData = {}; let errors = null; let statusCode; let foundError = false; let loaderHeaders = {}; // Process loader results into state.loaderData/state.errors results.forEach((result, index) => { let id = matchesToLoad[index].route.id; invariant(!isRedirectResult(result), "Cannot handle redirect results in processLoaderData"); if (isErrorResult(result)) { // Look upwards from the matched route for the closest ancestor // error boundary, defaulting to the root match let boundaryMatch = findNearestBoundary(matches, id); let error = result.error; // If we have a pending action error, we report it at the highest-route // that throws a loader error, and then clear it out to indicate that // it was consumed if (pendingError) { error = Object.values(pendingError)[0]; pendingError = undefined; } errors = errors || {}; // Prefer higher error values if lower errors bubble to the same boundary if (errors[boundaryMatch.route.id] == null) { errors[boundaryMatch.route.id] = error; } // Clear our any prior loaderData for the throwing route loaderData[id] = undefined; // Once we find our first (highest) error, we set the status code and // prevent deeper status codes from overriding if (!foundError) { foundError = true; statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500; } if (result.headers) { loaderHeaders[id] = result.headers; } } else { if (isDeferredResult(result)) { activeDeferreds.set(id, result.deferredData); loaderData[id] = result.deferredData.data; } else { loaderData[id] = result.data; } // Error status codes always override success status codes, but if all // loaders are successful we take the deepest status code. if (result.statusCode != null && result.statusCode !== 200 && !foundError) { statusCode = result.statusCode; } if (result.headers) { loaderHeaders[id] = result.headers; } } }); // If we didn't consume the pending action error (i.e., all loaders // resolved), then consume it here. Also clear out any loaderData for the // throwing route if (pendingError) { errors = pendingError; loaderData[Object.keys(pendingError)[0]] = undefined; } return { loaderData, errors, statusCode: statusCode || 200, loaderHeaders }; } function processLoaderData(state, matches, matchesToLoad, results, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds) { let { loaderData, errors } = processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds); // Process results from our revalidating fetchers for (let index = 0; index < revalidatingFetchers.length; index++) { let { key, match, controller } = revalidatingFetchers[index]; invariant(fetcherResults !== undefined && fetcherResults[index] !== undefined, "Did not find corresponding fetcher result"); let result = fetcherResults[index]; // Process fetcher non-redirect errors if (controller && controller.signal.aborted) { // Nothing to do for aborted fetchers continue; } else if (isErrorResult(result)) { let boundaryMatch = findNearestBoundary(state.matches, match == null ? void 0 : match.route.id); if (!(errors && errors[boundaryMatch.route.id])) { errors = _extends({}, errors, { [boundaryMatch.route.id]: result.error }); } state.fetchers.delete(key); } else if (isRedirectResult(result)) { // Should never get here, redirects should get processed above, but we // keep this to type narrow to a success result in the else invariant(false, "Unhandled fetcher revalidation redirect"); } else if (isDeferredResult(result)) { // Should never get here, deferred data should be awaited for fetchers // in resolveDeferredResults invariant(false, "Unhandled fetcher deferred data"); } else { let doneFetcher = getDoneFetcher(result.data); state.fetchers.set(key, doneFetcher); } } return { loaderData, errors }; } function mergeLoaderData(loaderData, newLoaderData, matches, errors) { let mergedLoaderData = _extends({}, newLoaderData); for (let match of matches) { let id = match.route.id; if (newLoaderData.hasOwnProperty(id)) { if (newLoaderData[id] !== undefined) { mergedLoaderData[id] = newLoaderData[id]; } } else if (loaderData[id] !== undefined && match.route.loader) { // Preserve existing keys not included in newLoaderData and where a loader // wasn't removed by HMR mergedLoaderData[id] = loaderData[id]; } if (errors && errors.hasOwnProperty(id)) { // Don't keep any loader data below the boundary break; } } return mergedLoaderData; } // Find the nearest error boundary, looking upwards from the leaf route (or the // route specified by routeId) for the closest ancestor error boundary, // defaulting to the root match function findNearestBoundary(matches, routeId) { let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches]; return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0]; } function getShortCircuitMatches(routes) { // Prefer a root layout route if present, otherwise shim in a route object let route = routes.length === 1 ? routes[0] : routes.find(r => r.index || !r.path || r.path === "/") || { id: "__shim-error-route__" }; return { matches: [{ params: {}, pathname: "", pathnameBase: "", route }], route }; } function getInternalRouterError(status, _temp4) { let { pathname, routeId, method, type } = _temp4 === void 0 ? {} : _temp4; let statusText = "Unknown Server Error"; let errorMessage = "Unknown @remix-run/router error"; if (status === 400) { statusText = "Bad Request"; if (method && pathname && routeId) { errorMessage = "You made a " + method + " request to \"" + pathname + "\" but " + ("did not provide a `loader` for route \"" + routeId + "\", ") + "so there is no way to handle the request."; } else if (type === "defer-action") { errorMessage = "defer() is not supported in actions"; } else if (type === "invalid-body") { errorMessage = "Unable to encode submission body"; } } else if (status === 403) { statusText = "Forbidden"; errorMessage = "Route \"" + routeId + "\" does not match URL \"" + pathname + "\""; } else if (status === 404) { statusText = "Not Found"; errorMessage = "No route matches URL \"" + pathname + "\""; } else if (status === 405) { statusText = "Method Not Allowed"; if (method && pathname && routeId) { errorMessage = "You made a " + method.toUpperCase() + " request to \"" + pathname + "\" but " + ("did not provide an `action` for route \"" + routeId + "\", ") + "so there is no way to handle the request."; } else if (method) { errorMessage = "Invalid request method \"" + method.toUpperCase() + "\""; } } return new ErrorResponseImpl(status || 500, statusText, new Error(errorMessage), true); } // Find any returned redirect errors, starting from the lowest match function findRedirect(results) { for (let i = results.length - 1; i >= 0; i--) { let result = results[i]; if (isRedirectResult(result)) { return { result, idx: i }; } } } function stripHashFromPath(path) { let parsedPath = typeof path === "string" ? parsePath(path) : path; return createPath(_extends({}, parsedPath, { hash: "" })); } function isHashChangeOnly(a, b) { if (a.pathname !== b.pathname || a.search !== b.search) { return false; } if (a.hash === "") { // /page -> /page#hash return b.hash !== ""; } else if (a.hash === b.hash) { // /page#hash -> /page#hash return true; } else if (b.hash !== "") { // /page#hash -> /page#other return true; } // If the hash is removed the browser will re-perform a request to the server // /page#hash -> /page return false; } function isDeferredResult(result) { return result.type === ResultType.deferred; } function isErrorResult(result) { return result.type === ResultType.error; } function isRedirectResult(result) { return (result && result.type) === ResultType.redirect; } function isDeferredData(value) { let deferred = value; return deferred && typeof deferred === "object" && typeof deferred.data === "object" && typeof deferred.subscribe === "function" && typeof deferred.cancel === "function" && typeof deferred.resolveData === "function"; } function isResponse(value) { return value != null && typeof value.status === "number" && typeof value.statusText === "string" && typeof value.headers === "object" && typeof value.body !== "undefined"; } function isRedirectResponse(result) { if (!isResponse(result)) { return false; } let status = result.status; let location = result.headers.get("Location"); return status >= 300 && status <= 399 && location != null; } function isQueryRouteResponse(obj) { return obj && isResponse(obj.response) && (obj.type === ResultType.data || obj.type === ResultType.error); } function isValidMethod(method) { return validRequestMethods.has(method.toLowerCase()); } function isMutationMethod(method) { return validMutationMethods.has(method.toLowerCase()); } async function resolveDeferredResults(currentMatches, matchesToLoad, results, signals, isFetcher, currentLoaderData) { for (let index = 0; index < results.length; index++) { let result = results[index]; let match = matchesToLoad[index]; // If we don't have a match, then we can have a deferred result to do // anything with. This is for revalidating fetchers where the route was // removed during HMR if (!match) { continue; } let currentMatch = currentMatches.find(m => m.route.id === match.route.id); let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined; if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) { // Note: we do not have to touch activeDeferreds here since we race them // against the signal in resolveDeferredData and they'll get aborted // there if needed let signal = signals[index]; invariant(signal, "Expected an AbortSignal for revalidating fetcher deferred result"); await resolveDeferredData(result, signal, isFetcher).then(result => { if (result) { results[index] = result || results[index]; } }); } } } async function resolveDeferredData(result, signal, unwrap) { if (unwrap === void 0) { unwrap = false; } let aborted = await result.deferredData.resolveData(signal); if (aborted) { return; } if (unwrap) { try { return { type: ResultType.data, data: result.deferredData.unwrappedData }; } catch (e) { // Handle any TrackedPromise._error values encountered while unwrapping return { type: ResultType.error, error: e }; } } return { type: ResultType.data, data: result.deferredData.data }; } function hasNakedIndexQuery(search) { return new URLSearchParams(search).getAll("index").some(v => v === ""); } function getTargetMatch(matches, location) { let search = typeof location === "string" ? parsePath(location).search : location.search; if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) { // Return the leaf index route when index is present return matches[matches.length - 1]; } // Otherwise grab the deepest "path contributing" match (ignoring index and // pathless layout routes) let pathMatches = getPathContributingMatches(matches); return pathMatches[pathMatches.length - 1]; } function getSubmissionFromNavigation(navigation) { let { formMethod, formAction, formEncType, text, formData, json } = navigation; if (!formMethod || !formAction || !formEncType) { return; } if (text != null) { return { formMethod, formAction, formEncType, formData: undefined, json: undefined, text }; } else if (formData != null) { return { formMethod, formAction, formEncType, formData, json: undefined, text: undefined }; } else if (json !== undefined) { return { formMethod, formAction, formEncType, formData: undefined, json, text: undefined }; } } function getLoadingNavigation(location, submission) { if (submission) { let navigation = { state: "loading", location, formMethod: submission.formMethod, formAction: submission.formAction, formEncType: submission.formEncType, formData: submission.formData, json: submission.json, text: submission.text }; return navigation; } else { let navigation = { state: "loading", location, formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined }; return navigation; } } function getSubmittingNavigation(location, submission) { let navigation = { state: "submitting", location, formMethod: submission.formMethod, formAction: submission.formAction, formEncType: submission.formEncType, formData: submission.formData, json: submission.json, text: submission.text }; return navigation; } function getLoadingFetcher(submission, data) { if (submission) { let fetcher = { state: "loading", formMethod: submission.formMethod, formAction: submission.formAction, formEncType: submission.formEncType, formData: submission.formData, json: submission.json, text: submission.text, data }; return fetcher; } else { let fetcher = { state: "loading", formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined, data }; return fetcher; } } function getSubmittingFetcher(submission, existingFetcher) { let fetcher = { state: "submitting", formMethod: submission.formMethod, formAction: submission.formAction, formEncType: submission.formEncType, formData: submission.formData, json: submission.json, text: submission.text, data: existingFetcher ? existingFetcher.data : undefined }; return fetcher; } function getDoneFetcher(data) { let fetcher = { state: "idle", formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined, data }; return fetcher; } function restoreAppliedTransitions(_window, transitions) { try { let sessionPositions = _window.sessionStorage.getItem(TRANSITIONS_STORAGE_KEY); if (sessionPositions) { let json = JSON.parse(sessionPositions); for (let [k, v] of Object.entries(json || {})) { if (v && Array.isArray(v)) { transitions.set(k, new Set(v || [])); } } } } catch (e) { // no-op, use default empty object } } function persistAppliedTransitions(_window, transitions) { if (transitions.size > 0) { let json = {}; for (let [k, v] of transitions) { json[k] = [...v]; } try { _window.sessionStorage.setItem(TRANSITIONS_STORAGE_KEY, JSON.stringify(json)); } catch (error) { warning(false, "Failed to save applied view transitions in sessionStorage (" + error + ")."); } } } //#endregion //# sourceMappingURL=router.js.map /***/ }), /***/ "./node_modules/axios/index.js": /*!*************************************!*\ !*** ./node_modules/axios/index.js ***! \*************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Axios: () => (/* binding */ Axios), /* harmony export */ AxiosError: () => (/* binding */ AxiosError), /* harmony export */ AxiosHeaders: () => (/* binding */ AxiosHeaders), /* harmony export */ Cancel: () => (/* binding */ Cancel), /* harmony export */ CancelToken: () => (/* binding */ CancelToken), /* harmony export */ CanceledError: () => (/* binding */ CanceledError), /* harmony export */ HttpStatusCode: () => (/* binding */ HttpStatusCode), /* harmony export */ VERSION: () => (/* binding */ VERSION), /* harmony export */ all: () => (/* binding */ all), /* harmony export */ "default": () => (/* reexport safe */ _lib_axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]), /* harmony export */ formToJSON: () => (/* binding */ formToJSON), /* harmony export */ getAdapter: () => (/* binding */ getAdapter), /* harmony export */ isAxiosError: () => (/* binding */ isAxiosError), /* harmony export */ isCancel: () => (/* binding */ isCancel), /* harmony export */ mergeConfig: () => (/* binding */ mergeConfig), /* harmony export */ spread: () => (/* binding */ spread), /* harmony export */ toFormData: () => (/* binding */ toFormData) /* harmony export */ }); /* harmony import */ var _lib_axios_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/axios.js */ "./node_modules/axios/lib/axios.js"); // This module is intended to unwrap Axios default export as named. // Keep top-level export same with static properties // so that it can keep same with es module or cjs const { Axios, AxiosError, CanceledError, isCancel, CancelToken, VERSION, all, Cancel, isAxiosError, spread, toFormData, AxiosHeaders, HttpStatusCode, formToJSON, getAdapter, mergeConfig } = _lib_axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; /***/ }), /***/ "./node_modules/axios/lib/adapters/adapters.js": /*!*****************************************************!*\ !*** ./node_modules/axios/lib/adapters/adapters.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ "./node_modules/axios/lib/helpers/null.js"); /* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xhr.js */ "./node_modules/axios/lib/adapters/xhr.js"); /* harmony import */ var _fetch_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fetch.js */ "./node_modules/axios/lib/adapters/fetch.js"); /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); const knownAdapters = { http: _http_js__WEBPACK_IMPORTED_MODULE_0__["default"], xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__["default"], fetch: _fetch_js__WEBPACK_IMPORTED_MODULE_2__["default"] } _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(knownAdapters, (fn, value) => { if (fn) { try { Object.defineProperty(fn, 'name', {value}); } catch (e) { // eslint-disable-next-line no-empty } Object.defineProperty(fn, 'adapterName', {value}); } }); const renderReason = (reason) => `- ${reason}`; const isResolvedHandle = (adapter) => _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isFunction(adapter) || adapter === null || adapter === false; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ getAdapter: (adapters) => { adapters = _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isArray(adapters) ? adapters : [adapters]; const {length} = adapters; let nameOrAdapter; let adapter; const rejectedReasons = {}; for (let i = 0; i < length; i++) { nameOrAdapter = adapters[i]; let id; adapter = nameOrAdapter; if (!isResolvedHandle(nameOrAdapter)) { adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; if (adapter === undefined) { throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"](`Unknown adapter '${id}'`); } } if (adapter) { break; } rejectedReasons[id || '#' + i] = adapter; } if (!adapter) { const reasons = Object.entries(rejectedReasons) .map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build') ); let s = length ? (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : 'as no adapter specified'; throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"]( `There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT' ); } return adapter; }, adapters: knownAdapters }); /***/ }), /***/ "./node_modules/axios/lib/adapters/fetch.js": /*!**************************************************!*\ !*** ./node_modules/axios/lib/adapters/fetch.js ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); /* harmony import */ var _helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/composeSignals.js */ "./node_modules/axios/lib/helpers/composeSignals.js"); /* harmony import */ var _helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/trackStream.js */ "./node_modules/axios/lib/helpers/trackStream.js"); /* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); /* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ "./node_modules/axios/lib/helpers/progressEventReducer.js"); /* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ "./node_modules/axios/lib/helpers/resolveConfig.js"); /* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function'; const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function'; // used only inside the fetch adapter const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()) ); const test = (fn, ...args) => { try { return !!fn(...args); } catch (e) { return false } } const supportsRequestStream = isReadableStreamSupported && test(() => { let duplexAccessed = false; const hasContentType = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, { body: new ReadableStream(), method: 'POST', get duplex() { duplexAccessed = true; return 'half'; }, }).headers.has('Content-Type'); return duplexAccessed && !hasContentType; }); const DEFAULT_CHUNK_SIZE = 64 * 1024; const supportsResponseStream = isReadableStreamSupported && test(() => _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isReadableStream(new Response('').body)); const resolvers = { stream: supportsResponseStream && ((res) => res.body) }; isFetchSupported && (((res) => { ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { !resolvers[type] && (resolvers[type] = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFunction(res[type]) ? (res) => res[type]() : (_, config) => { throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](`Response type '${type}' is not supported`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_NOT_SUPPORT, config); }) }); })(new Response)); const getBodyLength = async (body) => { if (body == null) { return 0; } if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isBlob(body)) { return body.size; } if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isSpecCompliantForm(body)) { const _request = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, { method: 'POST', body, }); return (await _request.arrayBuffer()).byteLength; } if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArrayBufferView(body) || _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArrayBuffer(body)) { return body.byteLength; } if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isURLSearchParams(body)) { body = body + ''; } if(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(body)) { return (await encodeText(body)).byteLength; } } const resolveBodyLength = async (headers, body) => { const length = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].toFiniteNumber(headers.getContentLength()); return length == null ? getBodyLength(body) : length; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isFetchSupported && (async (config) => { let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = 'same-origin', fetchOptions } = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(config); responseType = responseType ? (responseType + '').toLowerCase() : 'text'; let composedSignal = (0,_helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_4__["default"])([signal, cancelToken && cancelToken.toAbortSignal()], timeout); let request; const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { composedSignal.unsubscribe(); }); let requestContentLength; try { if ( onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && (requestContentLength = await resolveBodyLength(headers, data)) !== 0 ) { let _request = new Request(url, { method: 'POST', body: data, duplex: "half" }); let contentTypeHeader; if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { headers.setContentType(contentTypeHeader) } if (_request.body) { const [onProgress, flush] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventDecorator)( requestContentLength, (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.asyncDecorator)(onUploadProgress)) ); data = (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__.trackStream)(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); } } if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(withCredentials)) { withCredentials = withCredentials ? 'include' : 'omit'; } // Cloudflare Workers throws when credentials are defined // see https://github.com/cloudflare/workerd/issues/902 const isCredentialsSupported = "credentials" in Request.prototype; request = new Request(url, { ...fetchOptions, signal: composedSignal, method: method.toUpperCase(), headers: headers.normalize().toJSON(), body: data, duplex: "half", credentials: isCredentialsSupported ? withCredentials : undefined }); let response = await fetch(request); const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { const options = {}; ['status', 'statusText', 'headers'].forEach(prop => { options[prop] = response[prop]; }); const responseContentLength = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].toFiniteNumber(response.headers.get('content-length')); const [onProgress, flush] = onDownloadProgress && (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventDecorator)( responseContentLength, (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.asyncDecorator)(onDownloadProgress), true) ) || []; response = new Response( (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__.trackStream)(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { flush && flush(); unsubscribe && unsubscribe(); }), options ); } responseType = responseType || 'text'; let responseData = await resolvers[_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].findKey(resolvers, responseType) || 'text'](response, config); !isStreamResponse && unsubscribe && unsubscribe(); return await new Promise((resolve, reject) => { (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_7__["default"])(resolve, reject, { data: responseData, headers: _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__["default"].from(response.headers), status: response.status, statusText: response.statusText, config, request }) }) } catch (err) { unsubscribe && unsubscribe(); if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) { throw Object.assign( new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_NETWORK, config, request), { cause: err.cause || err } ) } throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].from(err, err && err.code, config, request); } })); /***/ }), /***/ "./node_modules/axios/lib/adapters/xhr.js": /*!************************************************!*\ !*** ./node_modules/axios/lib/adapters/xhr.js ***! \************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); /* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); /* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); /* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "./node_modules/axios/lib/helpers/parseProtocol.js"); /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); /* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); /* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ "./node_modules/axios/lib/helpers/progressEventReducer.js"); /* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ "./node_modules/axios/lib/helpers/resolveConfig.js"); const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) { return new Promise(function dispatchXhrRequest(resolve, reject) { const _config = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_0__["default"])(config); let requestData = _config.data; const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(_config.headers).normalize(); let {responseType, onUploadProgress, onDownloadProgress} = _config; let onCanceled; let uploadThrottled, downloadThrottled; let flushUpload, flushDownload; function done() { flushUpload && flushUpload(); // flush events flushDownload && flushDownload(); // flush events _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); _config.signal && _config.signal.removeEventListener('abort', onCanceled); } let request = new XMLHttpRequest(); request.open(_config.method.toUpperCase(), _config.url, true); // Set the request timeout in MS request.timeout = _config.timeout; function onloadend() { if (!request) { return; } // Prepare the response const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from( 'getAllResponseHeaders' in request && request.getAllResponseHeaders() ); const responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response; const response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config, request }; (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function _resolve(value) { resolve(value); done(); }, function _reject(err) { reject(err); done(); }, response); // Clean up request request = null; } if ('onloadend' in request) { // Use onloadend if available request.onloadend = onloadend; } else { // Listen for ready state to emulate onloadend request.onreadystatechange = function handleLoad() { if (!request || request.readyState !== 4) { return; } // The request errored out and we didn't get a response, this will be // handled by onerror instead // With one exception: request that using file: protocol, most browsers // will return status as 0 even though it's a successful request if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { return; } // readystate handler is calling before onerror or ontimeout handlers, // so we should call onloadend on the next 'tick' setTimeout(onloadend); }; } // Handle browser request cancellation (as opposed to a manual cancellation) request.onabort = function handleAbort() { if (!request) { return; } reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ECONNABORTED, config, request)); // Clean up request request = null; }; // Handle low level network errors request.onerror = function handleError() { // Real errors are hidden from us by the browser // onerror should only fire if it's a network error reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ERR_NETWORK, config, request)); // Clean up request request = null; }; // Handle timeout request.ontimeout = function handleTimeout() { let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; const transitional = _config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_4__["default"]; if (_config.timeoutErrorMessage) { timeoutErrorMessage = _config.timeoutErrorMessage; } reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]( timeoutErrorMessage, transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ECONNABORTED, config, request)); // Clean up request request = null; }; // Remove Content-Type if data is undefined requestData === undefined && requestHeaders.setContentType(null); // Add headers to the request if ('setRequestHeader' in request) { _utils_js__WEBPACK_IMPORTED_MODULE_5__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { request.setRequestHeader(key, val); }); } // Add withCredentials to request if needed if (!_utils_js__WEBPACK_IMPORTED_MODULE_5__["default"].isUndefined(_config.withCredentials)) { request.withCredentials = !!_config.withCredentials; } // Add responseType to request if needed if (responseType && responseType !== 'json') { request.responseType = _config.responseType; } // Handle progress if needed if (onDownloadProgress) { ([downloadThrottled, flushDownload] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventReducer)(onDownloadProgress, true)); request.addEventListener('progress', downloadThrottled); } // Not all browsers support upload events if (onUploadProgress && request.upload) { ([uploadThrottled, flushUpload] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventReducer)(onUploadProgress)); request.upload.addEventListener('progress', uploadThrottled); request.upload.addEventListener('loadend', flushUpload); } if (_config.cancelToken || _config.signal) { // Handle cancellation // eslint-disable-next-line func-names onCanceled = cancel => { if (!request) { return; } reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_7__["default"](null, config, request) : cancel); request.abort(); request = null; }; _config.cancelToken && _config.cancelToken.subscribe(onCanceled); if (_config.signal) { _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); } } const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_8__["default"])(_config.url); if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_9__["default"].protocols.indexOf(protocol) === -1) { reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ERR_BAD_REQUEST, config)); return; } // Send the request request.send(requestData || null); }); }); /***/ }), /***/ "./node_modules/axios/lib/axios.js": /*!*****************************************!*\ !*** ./node_modules/axios/lib/axios.js ***! \*****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); /* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/Axios.js */ "./node_modules/axios/lib/core/Axios.js"); /* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); /* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); /* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); /* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); /* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "./node_modules/axios/lib/cancel/CancelToken.js"); /* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); /* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./env/data.js */ "./node_modules/axios/lib/env/data.js"); /* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); /* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/spread.js */ "./node_modules/axios/lib/helpers/spread.js"); /* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "./node_modules/axios/lib/helpers/isAxiosError.js"); /* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); /* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); /* harmony import */ var _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers/HttpStatusCode.js */ "./node_modules/axios/lib/helpers/HttpStatusCode.js"); /** * Create an instance of Axios * * @param {Object} defaultConfig The default config for the instance * * @returns {Axios} A new instance of Axios */ function createInstance(defaultConfig) { const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"](defaultConfig); const instance = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.request, context); // Copy axios.prototype to instance _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype, context, {allOwnKeys: true}); // Copy context to instance _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, context, null, {allOwnKeys: true}); // Factory for creating new instances instance.create = function create(instanceConfig) { return createInstance((0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig)); }; return instance; } // Create the default instance to be exported const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]); // Expose Axios class to allow class inheritance axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; // Expose Cancel & CancelToken axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__["default"]; axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__["default"]; axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__["default"]; axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_8__.VERSION; axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__["default"]; // Expose AxiosError class axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__["default"]; // alias for CanceledError for backward compatibility axios.Cancel = axios.CanceledError; // Expose all/spread axios.all = function all(promises) { return Promise.all(promises); }; axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__["default"]; // Expose isAxiosError axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__["default"]; // Expose mergeConfig axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"]; axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__["default"]; axios.formToJSON = thing => (0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isHTMLForm(thing) ? new FormData(thing) : thing); axios.getAdapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_15__["default"].getAdapter; axios.HttpStatusCode = _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_16__["default"]; axios.default = axios; // this module should only have a default export /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (axios); /***/ }), /***/ "./node_modules/axios/lib/cancel/CancelToken.js": /*!******************************************************!*\ !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); /** * A `CancelToken` is an object that can be used to request cancellation of an operation. * * @param {Function} executor The executor function. * * @returns {CancelToken} */ class CancelToken { constructor(executor) { if (typeof executor !== 'function') { throw new TypeError('executor must be a function.'); } let resolvePromise; this.promise = new Promise(function promiseExecutor(resolve) { resolvePromise = resolve; }); const token = this; // eslint-disable-next-line func-names this.promise.then(cancel => { if (!token._listeners) return; let i = token._listeners.length; while (i-- > 0) { token._listeners[i](cancel); } token._listeners = null; }); // eslint-disable-next-line func-names this.promise.then = onfulfilled => { let _resolve; // eslint-disable-next-line func-names const promise = new Promise(resolve => { token.subscribe(resolve); _resolve = resolve; }).then(onfulfilled); promise.cancel = function reject() { token.unsubscribe(_resolve); }; return promise; }; executor(function cancel(message, config, request) { if (token.reason) { // Cancellation has already been requested return; } token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request); resolvePromise(token.reason); }); } /** * Throws a `CanceledError` if cancellation has been requested. */ throwIfRequested() { if (this.reason) { throw this.reason; } } /** * Subscribe to the cancel signal */ subscribe(listener) { if (this.reason) { listener(this.reason); return; } if (this._listeners) { this._listeners.push(listener); } else { this._listeners = [listener]; } } /** * Unsubscribe from the cancel signal */ unsubscribe(listener) { if (!this._listeners) { return; } const index = this._listeners.indexOf(listener); if (index !== -1) { this._listeners.splice(index, 1); } } toAbortSignal() { const controller = new AbortController(); const abort = (err) => { controller.abort(err); }; this.subscribe(abort); controller.signal.unsubscribe = () => this.unsubscribe(abort); return controller.signal; } /** * Returns an object that contains a new `CancelToken` and a function that, when called, * cancels the `CancelToken`. */ static source() { let cancel; const token = new CancelToken(function executor(c) { cancel = c; }); return { token, cancel }; } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken); /***/ }), /***/ "./node_modules/axios/lib/cancel/CanceledError.js": /*!********************************************************!*\ !*** ./node_modules/axios/lib/cancel/CanceledError.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /** * A `CanceledError` is an object that is thrown when an operation is canceled. * * @param {string=} message The message. * @param {Object=} config The config. * @param {Object=} request The request. * * @returns {CanceledError} The created error. */ function CanceledError(message, config, request) { // eslint-disable-next-line no-eq-null,eqeqeq _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request); this.name = 'CanceledError'; } _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], { __CANCEL__: true }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanceledError); /***/ }), /***/ "./node_modules/axios/lib/cancel/isCancel.js": /*!***************************************************!*\ !*** ./node_modules/axios/lib/cancel/isCancel.js ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isCancel) /* harmony export */ }); function isCancel(value) { return !!(value && value.__CANCEL__); } /***/ }), /***/ "./node_modules/axios/lib/core/Axios.js": /*!**********************************************!*\ !*** ./node_modules/axios/lib/core/Axios.js ***! \**********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); /* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InterceptorManager.js */ "./node_modules/axios/lib/core/InterceptorManager.js"); /* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dispatchRequest.js */ "./node_modules/axios/lib/core/dispatchRequest.js"); /* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); /* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); /* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/validator.js */ "./node_modules/axios/lib/helpers/validator.js"); /* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].validators; /** * Create a new instance of Axios * * @param {Object} instanceConfig The default config for the instance * * @return {Axios} A new instance of Axios */ class Axios { constructor(instanceConfig) { this.defaults = instanceConfig; this.interceptors = { request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"](), response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"]() }; } /** * Dispatch a request * * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) * @param {?Object} config * * @returns {Promise} The Promise to be fulfilled */ async request(configOrUrl, config) { try { return await this._request(configOrUrl, config); } catch (err) { if (err instanceof Error) { let dummy = {}; Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); // slice off the Error: ... line const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; try { if (!err.stack) { err.stack = stack; // match without the 2 top stack lines } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { err.stack += '\n' + stack } } catch (e) { // ignore the case where "stack" is an un-writable property } } throw err; } } _request(configOrUrl, config) { /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API if (typeof configOrUrl === 'string') { config = config || {}; config.url = configOrUrl; } else { config = configOrUrl || {}; } config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); const {transitional, paramsSerializer, headers} = config; if (transitional !== undefined) { _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(transitional, { silentJSONParsing: validators.transitional(validators.boolean), forcedJSONParsing: validators.transitional(validators.boolean), clarifyTimeoutError: validators.transitional(validators.boolean) }, false); } if (paramsSerializer != null) { if (_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].isFunction(paramsSerializer)) { config.paramsSerializer = { serialize: paramsSerializer } } else { _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(paramsSerializer, { encode: validators.function, serialize: validators.function }, true); } } // Set config.allowAbsoluteUrls if (config.allowAbsoluteUrls !== undefined) { // do nothing } else if (this.defaults.allowAbsoluteUrls !== undefined) { config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; } else { config.allowAbsoluteUrls = true; } _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(config, { baseUrl: validators.spelling('baseURL'), withXsrfToken: validators.spelling('withXSRFToken') }, true); // Set config.method config.method = (config.method || this.defaults.method || 'get').toLowerCase(); // Flatten headers let contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].merge( headers.common, headers[config.method] ); headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach( ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => { delete headers[method]; } ); config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].concat(contextHeaders, headers); // filter out skipped interceptors const requestInterceptorChain = []; let synchronousRequestInterceptors = true; this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { return; } synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); }); const responseInterceptorChain = []; this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); }); let promise; let i = 0; let len; if (!synchronousRequestInterceptors) { const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].bind(this), undefined]; chain.unshift.apply(chain, requestInterceptorChain); chain.push.apply(chain, responseInterceptorChain); len = chain.length; promise = Promise.resolve(config); while (i < len) { promise = promise.then(chain[i++], chain[i++]); } return promise; } len = requestInterceptorChain.length; let newConfig = config; i = 0; while (i < len) { const onFulfilled = requestInterceptorChain[i++]; const onRejected = requestInterceptorChain[i++]; try { newConfig = onFulfilled(newConfig); } catch (error) { onRejected.call(this, error); break; } } try { promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, newConfig); } catch (error) { return Promise.reject(error); } i = 0; len = responseInterceptorChain.length; while (i < len) { promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); } return promise; } getUri(config) { config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__["default"])(config.baseURL, config.url, config.allowAbsoluteUrls); return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])(fullPath, config.params, config.paramsSerializer); } } // Provide aliases for supported request methods _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { /*eslint func-names:0*/ Axios.prototype[method] = function(url, config) { return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { method, url, data: (config || {}).data })); }; }); _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { /*eslint func-names:0*/ function generateHTTPMethod(isForm) { return function httpMethod(url, data, config) { return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { method, headers: isForm ? { 'Content-Type': 'multipart/form-data' } : {}, url, data })); }; } Axios.prototype[method] = generateHTTPMethod(); Axios.prototype[method + 'Form'] = generateHTTPMethod(true); }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios); /***/ }), /***/ "./node_modules/axios/lib/core/AxiosError.js": /*!***************************************************!*\ !*** ./node_modules/axios/lib/core/AxiosError.js ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /** * Create an Error with the specified message, config, error code, request and response. * * @param {string} message The error message. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [config] The config. * @param {Object} [request] The request. * @param {Object} [response] The response. * * @returns {Error} The created error. */ function AxiosError(message, code, config, request, response) { Error.call(this); if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } else { this.stack = (new Error()).stack; } this.message = message; this.name = 'AxiosError'; code && (this.code = code); config && (this.config = config); request && (this.request = request); if (response) { this.response = response; this.status = response.status ? response.status : null; } } _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, { toJSON: function toJSON() { return { // Standard message: this.message, name: this.name, // Microsoft description: this.description, number: this.number, // Mozilla fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, // Axios config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config), code: this.code, status: this.status }; } }); const prototype = AxiosError.prototype; const descriptors = {}; [ 'ERR_BAD_OPTION_VALUE', 'ERR_BAD_OPTION', 'ECONNABORTED', 'ETIMEDOUT', 'ERR_NETWORK', 'ERR_FR_TOO_MANY_REDIRECTS', 'ERR_DEPRECATED', 'ERR_BAD_RESPONSE', 'ERR_BAD_REQUEST', 'ERR_CANCELED', 'ERR_NOT_SUPPORT', 'ERR_INVALID_URL' // eslint-disable-next-line func-names ].forEach(code => { descriptors[code] = {value: code}; }); Object.defineProperties(AxiosError, descriptors); Object.defineProperty(prototype, 'isAxiosError', {value: true}); // eslint-disable-next-line func-names AxiosError.from = (error, code, config, request, response, customProps) => { const axiosError = Object.create(prototype); _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) { return obj !== Error.prototype; }, prop => { return prop !== 'isAxiosError'; }); AxiosError.call(axiosError, error.message, code, config, request, response); axiosError.cause = error; axiosError.name = error.name; customProps && Object.assign(axiosError, customProps); return axiosError; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError); /***/ }), /***/ "./node_modules/axios/lib/core/AxiosHeaders.js": /*!*****************************************************!*\ !*** ./node_modules/axios/lib/core/AxiosHeaders.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js"); const $internals = Symbol('internals'); function normalizeHeader(header) { return header && String(header).trim().toLowerCase(); } function normalizeValue(value) { if (value === false || value == null) { return value; } return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value); } function parseTokens(str) { const tokens = Object.create(null); const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; let match; while ((match = tokensRE.exec(str))) { tokens[match[1]] = match[2]; } return tokens; } const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) { return filter.call(this, value, header); } if (isHeaderNameFilter) { value = header; } if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return; if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) { return value.indexOf(filter) !== -1; } if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) { return filter.test(value); } } function formatHeader(header) { return header.trim() .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { return char.toUpperCase() + str; }); } function buildAccessors(obj, header) { const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header); ['get', 'set', 'has'].forEach(methodName => { Object.defineProperty(obj, methodName + accessorName, { value: function(arg1, arg2, arg3) { return this[methodName].call(this, header, arg1, arg2, arg3); }, configurable: true }); }); } class AxiosHeaders { constructor(headers) { headers && this.set(headers); } set(header, valueOrRewrite, rewrite) { const self = this; function setHeader(_value, _header, _rewrite) { const lHeader = normalizeHeader(_header); if (!lHeader) { throw new Error('header name must be a non-empty string'); } const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader); if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { self[key || _header] = normalizeValue(_value); } } const setHeaders = (headers, _rewrite) => _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) { setHeaders(header, valueOrRewrite) } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite); } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHeaders(header)) { for (const [key, value] of header.entries()) { setHeader(value, key, rewrite); } } else { header != null && setHeader(valueOrRewrite, header, rewrite); } return this; } get(header, parser) { header = normalizeHeader(header); if (header) { const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); if (key) { const value = this[key]; if (!parser) { return value; } if (parser === true) { return parseTokens(value); } if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) { return parser.call(this, value, key); } if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) { return parser.exec(value); } throw new TypeError('parser must be boolean|regexp|function'); } } } has(header, matcher) { header = normalizeHeader(header); if (header) { const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); } return false; } delete(header, matcher) { const self = this; let deleted = false; function deleteHeader(_header) { _header = normalizeHeader(_header); if (_header) { const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header); if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { delete self[key]; deleted = true; } } } if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) { header.forEach(deleteHeader); } else { deleteHeader(header); } return deleted; } clear(matcher) { const keys = Object.keys(this); let i = keys.length; let deleted = false; while (i--) { const key = keys[i]; if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { delete this[key]; deleted = true; } } return deleted; } normalize(format) { const self = this; const headers = {}; _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header); if (key) { self[key] = normalizeValue(value); delete self[header]; return; } const normalized = format ? formatHeader(header) : String(header).trim(); if (normalized !== header) { delete self[header]; } self[normalized] = normalizeValue(value); headers[normalized] = true; }); return this; } concat(...targets) { return this.constructor.concat(this, ...targets); } toJSON(asStrings) { const obj = Object.create(null); _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value); }); return obj; } [Symbol.iterator]() { return Object.entries(this.toJSON())[Symbol.iterator](); } toString() { return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); } get [Symbol.toStringTag]() { return 'AxiosHeaders'; } static from(thing) { return thing instanceof this ? thing : new this(thing); } static concat(first, ...targets) { const computed = new this(first); targets.forEach((target) => computed.set(target)); return computed; } static accessor(header) { const internals = this[$internals] = (this[$internals] = { accessors: {} }); const accessors = internals.accessors; const prototype = this.prototype; function defineAccessor(_header) { const lHeader = normalizeHeader(_header); if (!accessors[lHeader]) { buildAccessors(prototype, _header); accessors[lHeader] = true; } } _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); return this; } } AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); // reserved names hotfix _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` return { get: () => value, set(headerValue) { this[mapped] = headerValue; } } }); _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders); /***/ }), /***/ "./node_modules/axios/lib/core/InterceptorManager.js": /*!***********************************************************!*\ !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); class InterceptorManager { constructor() { this.handlers = []; } /** * Add a new interceptor to the stack * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` * * @return {Number} An ID used to remove interceptor later */ use(fulfilled, rejected, options) { this.handlers.push({ fulfilled, rejected, synchronous: options ? options.synchronous : false, runWhen: options ? options.runWhen : null }); return this.handlers.length - 1; } /** * Remove an interceptor from the stack * * @param {Number} id The ID that was returned by `use` * * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise */ eject(id) { if (this.handlers[id]) { this.handlers[id] = null; } } /** * Clear all interceptors from the stack * * @returns {void} */ clear() { if (this.handlers) { this.handlers = []; } } /** * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor * * @returns {void} */ forEach(fn) { _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) { if (h !== null) { fn(h); } }); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterceptorManager); /***/ }), /***/ "./node_modules/axios/lib/core/buildFullPath.js": /*!******************************************************!*\ !*** ./node_modules/axios/lib/core/buildFullPath.js ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ buildFullPath) /* harmony export */ }); /* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); /* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "./node_modules/axios/lib/helpers/combineURLs.js"); /** * Creates a new URL by combining the baseURL with the requestedURL, * only when the requestedURL is not already an absolute URL. * If the requestURL is absolute, this function returns the requestedURL untouched. * * @param {string} baseURL The base URL * @param {string} requestedURL Absolute or relative URL to combine * * @returns {string} The combined full path */ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { let isRelativeUrl = !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL); if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) { return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL); } return requestedURL; } /***/ }), /***/ "./node_modules/axios/lib/core/dispatchRequest.js": /*!********************************************************!*\ !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ dispatchRequest) /* harmony export */ }); /* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformData.js */ "./node_modules/axios/lib/core/transformData.js"); /* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); /* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); /* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); /* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); /* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); /** * Throws a `CanceledError` if cancellation has been requested. * * @param {Object} config The config that is to be used for the request * * @returns {void} */ function throwIfCancellationRequested(config) { if (config.cancelToken) { config.cancelToken.throwIfRequested(); } if (config.signal && config.signal.aborted) { throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](null, config); } } /** * Dispatch a request to the server using the configured adapter. * * @param {object} config The config that is to be used for the request * * @returns {Promise} The Promise to be fulfilled */ function dispatchRequest(config) { throwIfCancellationRequested(config); config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers); // Transform request data config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( config, config.transformRequest ); if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { config.headers.setContentType('application/x-www-form-urlencoded', false); } const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].adapter); return adapter(config).then(function onAdapterResolution(response) { throwIfCancellationRequested(config); // Transform response data response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( config, config.transformResponse, response ); response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(response.headers); return response; }, function onAdapterRejection(reason) { if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__["default"])(reason)) { throwIfCancellationRequested(config); // Transform response data if (reason && reason.response) { reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( config, config.transformResponse, reason.response ); reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(reason.response.headers); } } return Promise.reject(reason); }); } /***/ }), /***/ "./node_modules/axios/lib/core/mergeConfig.js": /*!****************************************************!*\ !*** ./node_modules/axios/lib/core/mergeConfig.js ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ mergeConfig) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? { ...thing } : thing; /** * Config-specific merge-function which creates a new config-object * by merging two configuration objects together. * * @param {Object} config1 * @param {Object} config2 * * @returns {Object} New object resulting from merging config2 to config1 */ function mergeConfig(config1, config2) { // eslint-disable-next-line no-param-reassign config2 = config2 || {}; const config = {}; function getMergedValue(target, source, prop, caseless) { if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({caseless}, target, source); } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge({}, source); } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArray(source)) { return source.slice(); } return source; } // eslint-disable-next-line consistent-return function mergeDeepProperties(a, b, prop , caseless) { if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { return getMergedValue(a, b, prop , caseless); } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { return getMergedValue(undefined, a, prop , caseless); } } // eslint-disable-next-line consistent-return function valueFromConfig2(a, b) { if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { return getMergedValue(undefined, b); } } // eslint-disable-next-line consistent-return function defaultToConfig2(a, b) { if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { return getMergedValue(undefined, b); } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { return getMergedValue(undefined, a); } } // eslint-disable-next-line consistent-return function mergeDirectKeys(a, b, prop) { if (prop in config2) { return getMergedValue(a, b); } else if (prop in config1) { return getMergedValue(undefined, a); } } const mergeMap = { url: valueFromConfig2, method: valueFromConfig2, data: valueFromConfig2, baseURL: defaultToConfig2, transformRequest: defaultToConfig2, transformResponse: defaultToConfig2, paramsSerializer: defaultToConfig2, timeout: defaultToConfig2, timeoutMessage: defaultToConfig2, withCredentials: defaultToConfig2, withXSRFToken: defaultToConfig2, adapter: defaultToConfig2, responseType: defaultToConfig2, xsrfCookieName: defaultToConfig2, xsrfHeaderName: defaultToConfig2, onUploadProgress: defaultToConfig2, onDownloadProgress: defaultToConfig2, decompress: defaultToConfig2, maxContentLength: defaultToConfig2, maxBodyLength: defaultToConfig2, beforeRedirect: defaultToConfig2, transport: defaultToConfig2, httpAgent: defaultToConfig2, httpsAgent: defaultToConfig2, cancelToken: defaultToConfig2, socketPath: defaultToConfig2, responseEncoding: defaultToConfig2, validateStatus: mergeDirectKeys, headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true) }; _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { const merge = mergeMap[prop] || mergeDeepProperties; const configValue = merge(config1[prop], config2[prop], prop); (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); }); return config; } /***/ }), /***/ "./node_modules/axios/lib/core/settle.js": /*!***********************************************!*\ !*** ./node_modules/axios/lib/core/settle.js ***! \***********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ settle) /* harmony export */ }); /* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); /** * Resolve or reject a Promise based on response status. * * @param {Function} resolve A function that resolves the promise. * @param {Function} reject A function that rejects the promise. * @param {object} response The response. * * @returns {object} The response. */ function settle(resolve, reject, response) { const validateStatus = response.config.validateStatus; if (!response.status || !validateStatus || validateStatus(response.status)) { resolve(response); } else { reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"]( 'Request failed with status code ' + response.status, [_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response )); } } /***/ }), /***/ "./node_modules/axios/lib/core/transformData.js": /*!******************************************************!*\ !*** ./node_modules/axios/lib/core/transformData.js ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ transformData) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); /* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); /** * Transform the data for a request or a response * * @param {Array|Function} fns A single function or Array of functions * @param {?Object} response The response object * * @returns {*} The resulting transformed data */ function transformData(fns, response) { const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]; const context = response || config; const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(context.headers); let data = context.data; _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(fns, function transform(fn) { data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); }); headers.normalize(); return data; } /***/ }), /***/ "./node_modules/axios/lib/defaults/index.js": /*!**************************************************!*\ !*** ./node_modules/axios/lib/defaults/index.js ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); /* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); /* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); /* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "./node_modules/axios/lib/helpers/toURLEncodedForm.js"); /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); /* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); /** * It takes a string, tries to parse it, and if it fails, it returns the stringified version * of the input * * @param {any} rawValue - The value to be stringified. * @param {Function} parser - A function that parses a string into a JavaScript object. * @param {Function} encoder - A function that takes a value and returns a string. * * @returns {string} A stringified version of the rawValue. */ function stringifySafely(rawValue, parser, encoder) { if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) { try { (parser || JSON.parse)(rawValue); return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue); } catch (e) { if (e.name !== 'SyntaxError') { throw e; } } } return (encoder || JSON.stringify)(rawValue); } const defaults = { transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_1__["default"], adapter: ['xhr', 'http', 'fetch'], transformRequest: [function transformRequest(data, headers) { const contentType = headers.getContentType() || ''; const hasJSONContentType = contentType.indexOf('application/json') > -1; const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data); if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) { data = new FormData(data); } const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data); if (isFormData) { return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data)) : data; } if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isReadableStream(data) ) { return data; } if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) { return data.buffer; } if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) { headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); return data.toString(); } let isFileList; if (isObjectPayload) { if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data, this.formSerializer).toString(); } if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { const _FormData = this.env && this.env.FormData; return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__["default"])( isFileList ? {'files[]': data} : data, _FormData && new _FormData(), this.formSerializer ); } } if (isObjectPayload || hasJSONContentType ) { headers.setContentType('application/json', false); return stringifySafely(data); } return data; }], transformResponse: [function transformResponse(data) { const transitional = this.transitional || defaults.transitional; const forcedJSONParsing = transitional && transitional.forcedJSONParsing; const JSONRequested = this.responseType === 'json'; if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isResponse(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isReadableStream(data)) { return data; } if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { const silentJSONParsing = transitional && transitional.silentJSONParsing; const strictJSONParsing = !silentJSONParsing && JSONRequested; try { return JSON.parse(data); } catch (e) { if (strictJSONParsing) { if (e.name === 'SyntaxError') { throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__["default"].ERR_BAD_RESPONSE, this, null, this.response); } throw e; } } } return data; }], /** * A timeout in milliseconds to abort a request. If set to 0 (default) a * timeout is not created. */ timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.FormData, Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.Blob }, validateStatus: function validateStatus(status) { return status >= 200 && status < 300; }, headers: { common: { 'Accept': 'application/json, text/plain, */*', 'Content-Type': undefined } } }; _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { defaults.headers[method] = {}; }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults); /***/ }), /***/ "./node_modules/axios/lib/defaults/transitional.js": /*!*********************************************************!*\ !*** ./node_modules/axios/lib/defaults/transitional.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }); /***/ }), /***/ "./node_modules/axios/lib/env/data.js": /*!********************************************!*\ !*** ./node_modules/axios/lib/env/data.js ***! \********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ VERSION: () => (/* binding */ VERSION) /* harmony export */ }); const VERSION = "1.8.2"; /***/ }), /***/ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js": /*!****************************************************************!*\ !*** ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); /** * It encodes a string by replacing all characters that are not in the unreserved set with * their percent-encoded equivalents * * @param {string} str - The string to encode. * * @returns {string} The encoded string. */ function encode(str) { const charMap = { '!': '%21', "'": '%27', '(': '%28', ')': '%29', '~': '%7E', '%20': '+', '%00': '\x00' }; return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { return charMap[match]; }); } /** * It takes a params object and converts it to a FormData object * * @param {Object} params - The parameters to be converted to a FormData object. * @param {Object} options - The options object passed to the Axios constructor. * * @returns {void} */ function AxiosURLSearchParams(params, options) { this._pairs = []; params && (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options); } const prototype = AxiosURLSearchParams.prototype; prototype.append = function append(name, value) { this._pairs.push([name, value]); }; prototype.toString = function toString(encoder) { const _encode = encoder ? function(value) { return encoder.call(this, value, encode); } : encode; return this._pairs.map(function each(pair) { return _encode(pair[0]) + '=' + _encode(pair[1]); }, '').join('&'); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosURLSearchParams); /***/ }), /***/ "./node_modules/axios/lib/helpers/HttpStatusCode.js": /*!**********************************************************!*\ !*** ./node_modules/axios/lib/helpers/HttpStatusCode.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const HttpStatusCode = { Continue: 100, SwitchingProtocols: 101, Processing: 102, EarlyHints: 103, Ok: 200, Created: 201, Accepted: 202, NonAuthoritativeInformation: 203, NoContent: 204, ResetContent: 205, PartialContent: 206, MultiStatus: 207, AlreadyReported: 208, ImUsed: 226, MultipleChoices: 300, MovedPermanently: 301, Found: 302, SeeOther: 303, NotModified: 304, UseProxy: 305, Unused: 306, TemporaryRedirect: 307, PermanentRedirect: 308, BadRequest: 400, Unauthorized: 401, PaymentRequired: 402, Forbidden: 403, NotFound: 404, MethodNotAllowed: 405, NotAcceptable: 406, ProxyAuthenticationRequired: 407, RequestTimeout: 408, Conflict: 409, Gone: 410, LengthRequired: 411, PreconditionFailed: 412, PayloadTooLarge: 413, UriTooLong: 414, UnsupportedMediaType: 415, RangeNotSatisfiable: 416, ExpectationFailed: 417, ImATeapot: 418, MisdirectedRequest: 421, UnprocessableEntity: 422, Locked: 423, FailedDependency: 424, TooEarly: 425, UpgradeRequired: 426, PreconditionRequired: 428, TooManyRequests: 429, RequestHeaderFieldsTooLarge: 431, UnavailableForLegalReasons: 451, InternalServerError: 500, NotImplemented: 501, BadGateway: 502, ServiceUnavailable: 503, GatewayTimeout: 504, HttpVersionNotSupported: 505, VariantAlsoNegotiates: 506, InsufficientStorage: 507, LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511, }; Object.entries(HttpStatusCode).forEach(([key, value]) => { HttpStatusCode[value] = key; }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HttpStatusCode); /***/ }), /***/ "./node_modules/axios/lib/helpers/bind.js": /*!************************************************!*\ !*** ./node_modules/axios/lib/helpers/bind.js ***! \************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ bind) /* harmony export */ }); function bind(fn, thisArg) { return function wrap() { return fn.apply(thisArg, arguments); }; } /***/ }), /***/ "./node_modules/axios/lib/helpers/buildURL.js": /*!****************************************************!*\ !*** ./node_modules/axios/lib/helpers/buildURL.js ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ buildURL) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); /** * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their * URI encoded counterparts * * @param {string} val The value to be encoded. * * @returns {string} The encoded value. */ function encode(val) { return encodeURIComponent(val). replace(/%3A/gi, ':'). replace(/%24/g, '$'). replace(/%2C/gi, ','). replace(/%20/g, '+'). replace(/%5B/gi, '['). replace(/%5D/gi, ']'); } /** * Build a URL by appending params to the end * * @param {string} url The base of the url (e.g., http://www.google.com) * @param {object} [params] The params to be appended * @param {?(object|Function)} options * * @returns {string} The formatted url */ function buildURL(url, params, options) { /*eslint no-param-reassign:0*/ if (!params) { return url; } const _encode = options && options.encode || encode; if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(options)) { options = { serialize: options }; } const serializeFn = options && options.serialize; let serializedParams; if (serializeFn) { serializedParams = serializeFn(params, options); } else { serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ? params.toString() : new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode); } if (serializedParams) { const hashmarkIndex = url.indexOf("#"); if (hashmarkIndex !== -1) { url = url.slice(0, hashmarkIndex); } url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; } return url; } /***/ }), /***/ "./node_modules/axios/lib/helpers/combineURLs.js": /*!*******************************************************!*\ !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ combineURLs) /* harmony export */ }); /** * Creates a new URL by combining the specified URLs * * @param {string} baseURL The base URL * @param {string} relativeURL The relative URL * * @returns {string} The combined URL */ function combineURLs(baseURL, relativeURL) { return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; } /***/ }), /***/ "./node_modules/axios/lib/helpers/composeSignals.js": /*!**********************************************************!*\ !*** ./node_modules/axios/lib/helpers/composeSignals.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); const composeSignals = (signals, timeout) => { const {length} = (signals = signals ? signals.filter(Boolean) : []); if (timeout || length) { let controller = new AbortController(); let aborted; const onabort = function (reason) { if (!aborted) { aborted = true; unsubscribe(); const err = reason instanceof Error ? reason : this.reason; controller.abort(err instanceof _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? err : new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_1__["default"](err instanceof Error ? err.message : err)); } } let timer = timeout && setTimeout(() => { timer = null; onabort(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"](`timeout ${timeout} of ms exceeded`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ETIMEDOUT)) }, timeout) const unsubscribe = () => { if (signals) { timer && clearTimeout(timer); timer = null; signals.forEach(signal => { signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); }); signals = null; } } signals.forEach((signal) => signal.addEventListener('abort', onabort)); const {signal} = controller; signal.unsubscribe = () => _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].asap(unsubscribe); return signal; } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (composeSignals); /***/ }), /***/ "./node_modules/axios/lib/helpers/cookies.js": /*!***************************************************!*\ !*** ./node_modules/axios/lib/helpers/cookies.js ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv ? // Standard browser envs support document.cookie { write(name, value, expires, path, domain, secure) { const cookie = [name + '=' + encodeURIComponent(value)]; _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(path) && cookie.push('path=' + path); _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(domain) && cookie.push('domain=' + domain); secure === true && cookie.push('secure'); document.cookie = cookie.join('; '); }, read(name) { const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); return (match ? decodeURIComponent(match[3]) : null); }, remove(name) { this.write(name, '', Date.now() - 86400000); } } : // Non-standard browser env (web workers, react-native) lack needed support. { write() {}, read() { return null; }, remove() {} }); /***/ }), /***/ "./node_modules/axios/lib/helpers/formDataToJSON.js": /*!**********************************************************!*\ !*** ./node_modules/axios/lib/helpers/formDataToJSON.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /** * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] * * @param {string} name - The name of the property to get. * * @returns An array of strings. */ function parsePropPath(name) { // foo[x][y][z] // foo.x.y.z // foo-x-y-z // foo x y z return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => { return match[0] === '[]' ? '' : match[1] || match[0]; }); } /** * Convert an array to an object. * * @param {Array} arr - The array to convert to an object. * * @returns An object with the same keys and values as the array. */ function arrayToObject(arr) { const obj = {}; const keys = Object.keys(arr); let i; const len = keys.length; let key; for (i = 0; i < len; i++) { key = keys[i]; obj[key] = arr[key]; } return obj; } /** * It takes a FormData object and returns a JavaScript object * * @param {string} formData The FormData object to convert to JSON. * * @returns {Object | null} The converted object. */ function formDataToJSON(formData) { function buildPath(path, value, target, index) { let name = path[index++]; if (name === '__proto__') return true; const isNumericKey = Number.isFinite(+name); const isLast = index >= path.length; name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name; if (isLast) { if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) { target[name] = [target[name], value]; } else { target[name] = value; } return !isNumericKey; } if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) { target[name] = []; } const result = buildPath(path, value, target[name], index); if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) { target[name] = arrayToObject(target[name]); } return !isNumericKey; } if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) { const obj = {}; _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => { buildPath(parsePropPath(name), value, obj, 0); }); return obj; } return null; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON); /***/ }), /***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": /*!*********************************************************!*\ !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isAbsoluteURL) /* harmony export */ }); /** * Determines whether the specified URL is absolute * * @param {string} url The URL to test * * @returns {boolean} True if the specified URL is absolute, otherwise false */ function isAbsoluteURL(url) { // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed // by any combination of letters, digits, plus, period, or hyphen. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); } /***/ }), /***/ "./node_modules/axios/lib/helpers/isAxiosError.js": /*!********************************************************!*\ !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isAxiosError) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); /** * Determines whether the payload is an error thrown by Axios * * @param {*} payload The value to test * * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false */ function isAxiosError(payload) { return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true); } /***/ }), /***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": /*!***********************************************************!*\ !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { url = new URL(url, _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin); return ( origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port) ); })( new URL(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin), _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator && /(msie|trident)/i.test(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator.userAgent) ) : () => true); /***/ }), /***/ "./node_modules/axios/lib/helpers/null.js": /*!************************************************!*\ !*** ./node_modules/axios/lib/helpers/null.js ***! \************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); // eslint-disable-next-line strict /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (null); /***/ }), /***/ "./node_modules/axios/lib/helpers/parseHeaders.js": /*!********************************************************!*\ !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); // RawAxiosHeaders whose duplicates are ignored by node // c.f. https://nodejs.org/api/http.html#http_message_headers const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([ 'age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent' ]); /** * Parse headers into an object * * ``` * Date: Wed, 27 Aug 2014 08:58:49 GMT * Content-Type: application/json * Connection: keep-alive * Transfer-Encoding: chunked * ``` * * @param {String} rawHeaders Headers needing to be parsed * * @returns {Object} Headers parsed into an object */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rawHeaders => { const parsed = {}; let key; let val; let i; rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { i = line.indexOf(':'); key = line.substring(0, i).trim().toLowerCase(); val = line.substring(i + 1).trim(); if (!key || (parsed[key] && ignoreDuplicateOf[key])) { return; } if (key === 'set-cookie') { if (parsed[key]) { parsed[key].push(val); } else { parsed[key] = [val]; } } else { parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; } }); return parsed; }); /***/ }), /***/ "./node_modules/axios/lib/helpers/parseProtocol.js": /*!*********************************************************!*\ !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ parseProtocol) /* harmony export */ }); function parseProtocol(url) { const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); return match && match[1] || ''; } /***/ }), /***/ "./node_modules/axios/lib/helpers/progressEventReducer.js": /*!****************************************************************!*\ !*** ./node_modules/axios/lib/helpers/progressEventReducer.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ asyncDecorator: () => (/* binding */ asyncDecorator), /* harmony export */ progressEventDecorator: () => (/* binding */ progressEventDecorator), /* harmony export */ progressEventReducer: () => (/* binding */ progressEventReducer) /* harmony export */ }); /* harmony import */ var _speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./speedometer.js */ "./node_modules/axios/lib/helpers/speedometer.js"); /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/axios/lib/helpers/throttle.js"); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); const progressEventReducer = (listener, isDownloadStream, freq = 3) => { let bytesNotified = 0; const _speedometer = (0,_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250); return (0,_throttle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(e => { const loaded = e.loaded; const total = e.lengthComputable ? e.total : undefined; const progressBytes = loaded - bytesNotified; const rate = _speedometer(progressBytes); const inRange = loaded <= total; bytesNotified = loaded; const data = { loaded, total, progress: total ? (loaded / total) : undefined, bytes: progressBytes, rate: rate ? rate : undefined, estimated: rate && total && inRange ? (total - loaded) / rate : undefined, event: e, lengthComputable: total != null, [isDownloadStream ? 'download' : 'upload']: true }; listener(data); }, freq); } const progressEventDecorator = (total, throttled) => { const lengthComputable = total != null; return [(loaded) => throttled[0]({ lengthComputable, total, loaded }), throttled[1]]; } const asyncDecorator = (fn) => (...args) => _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].asap(() => fn(...args)); /***/ }), /***/ "./node_modules/axios/lib/helpers/resolveConfig.js": /*!*********************************************************!*\ !*** ./node_modules/axios/lib/helpers/resolveConfig.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isURLSameOrigin.js */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); /* harmony import */ var _cookies_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cookies.js */ "./node_modules/axios/lib/helpers/cookies.js"); /* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); /* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); /* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); /* harmony import */ var _buildURL_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((config) => { const newConfig = (0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, config); let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig; newConfig.headers = headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(headers); newConfig.url = (0,_buildURL_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_3__["default"])(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer); // HTTP basic authentication if (auth) { headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) ); } let contentType; if (_utils_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFormData(data)) { if (_platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].hasStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].hasStandardBrowserWebWorkerEnv) { headers.setContentType(undefined); // Let the browser set it } else if ((contentType = headers.getContentType()) !== false) { // fix semicolon duplication issue for ReactNative FormData implementation const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; headers.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); } } // Add xsrf header // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (_platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].hasStandardBrowserEnv) { withXSRFToken && _utils_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); if (withXSRFToken || (withXSRFToken !== false && (0,_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_6__["default"])(newConfig.url))) { // Add xsrf header const xsrfValue = xsrfHeaderName && xsrfCookieName && _cookies_js__WEBPACK_IMPORTED_MODULE_7__["default"].read(xsrfCookieName); if (xsrfValue) { headers.set(xsrfHeaderName, xsrfValue); } } } return newConfig; }); /***/ }), /***/ "./node_modules/axios/lib/helpers/speedometer.js": /*!*******************************************************!*\ !*** ./node_modules/axios/lib/helpers/speedometer.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /** * Calculate data maxRate * @param {Number} [samplesCount= 10] * @param {Number} [min= 1000] * @returns {Function} */ function speedometer(samplesCount, min) { samplesCount = samplesCount || 10; const bytes = new Array(samplesCount); const timestamps = new Array(samplesCount); let head = 0; let tail = 0; let firstSampleTS; min = min !== undefined ? min : 1000; return function push(chunkLength) { const now = Date.now(); const startedAt = timestamps[tail]; if (!firstSampleTS) { firstSampleTS = now; } bytes[head] = chunkLength; timestamps[head] = now; let i = tail; let bytesCount = 0; while (i !== head) { bytesCount += bytes[i++]; i = i % samplesCount; } head = (head + 1) % samplesCount; if (head === tail) { tail = (tail + 1) % samplesCount; } if (now - firstSampleTS < min) { return; } const passed = startedAt && now - startedAt; return passed ? Math.round(bytesCount * 1000 / passed) : undefined; }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (speedometer); /***/ }), /***/ "./node_modules/axios/lib/helpers/spread.js": /*!**************************************************!*\ !*** ./node_modules/axios/lib/helpers/spread.js ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ spread) /* harmony export */ }); /** * Syntactic sugar for invoking a function and expanding an array for arguments. * * Common use case would be to use `Function.prototype.apply`. * * ```js * function f(x, y, z) {} * var args = [1, 2, 3]; * f.apply(null, args); * ``` * * With `spread` this example can be re-written. * * ```js * spread(function(x, y, z) {})([1, 2, 3]); * ``` * * @param {Function} callback * * @returns {Function} */ function spread(callback) { return function wrap(arr) { return callback.apply(null, arr); }; } /***/ }), /***/ "./node_modules/axios/lib/helpers/throttle.js": /*!****************************************************!*\ !*** ./node_modules/axios/lib/helpers/throttle.js ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /** * Throttle decorator * @param {Function} fn * @param {Number} freq * @return {Function} */ function throttle(fn, freq) { let timestamp = 0; let threshold = 1000 / freq; let lastArgs; let timer; const invoke = (args, now = Date.now()) => { timestamp = now; lastArgs = null; if (timer) { clearTimeout(timer); timer = null; } fn.apply(null, args); } const throttled = (...args) => { const now = Date.now(); const passed = now - timestamp; if ( passed >= threshold) { invoke(args, now); } else { lastArgs = args; if (!timer) { timer = setTimeout(() => { timer = null; invoke(lastArgs) }, threshold - passed); } } } const flush = () => lastArgs && invoke(lastArgs); return [throttled, flush]; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (throttle); /***/ }), /***/ "./node_modules/axios/lib/helpers/toFormData.js": /*!******************************************************!*\ !*** ./node_modules/axios/lib/helpers/toFormData.js ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); /* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ "./node_modules/axios/lib/helpers/null.js"); /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; // temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored /** * Determines if the given thing is a array or js object. * * @param {string} thing - The object or array to be visited. * * @returns {boolean} */ function isVisitable(thing) { return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing); } /** * It removes the brackets from the end of a string * * @param {string} key - The key of the parameter. * * @returns {string} the key without the brackets. */ function removeBrackets(key) { return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key; } /** * It takes a path, a key, and a boolean, and returns a string * * @param {string} path - The path to the current key. * @param {string} key - The key of the current object being iterated over. * @param {string} dots - If true, the key will be rendered with dots instead of brackets. * * @returns {string} The path to the current key. */ function renderKey(path, key, dots) { if (!path) return key; return path.concat(key).map(function each(token, i) { // eslint-disable-next-line no-param-reassign token = removeBrackets(token); return !dots && i ? '[' + token + ']' : token; }).join(dots ? '.' : ''); } /** * If the array is an array and none of its elements are visitable, then it's a flat array. * * @param {Array} arr - The array to check * * @returns {boolean} */ function isFlatArray(arr) { return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable); } const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) { return /^is[A-Z]/.test(prop); }); /** * Convert a data object to FormData * * @param {Object} obj * @param {?Object} [formData] * @param {?Object} [options] * @param {Function} [options.visitor] * @param {Boolean} [options.metaTokens = true] * @param {Boolean} [options.dots = false] * @param {?Boolean} [options.indexes = false] * * @returns {Object} **/ /** * It converts an object into a FormData object * * @param {Object} obj - The object to convert to form data. * @param {string} formData - The FormData object to append to. * @param {Object} options * * @returns */ function toFormData(obj, formData, options) { if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { throw new TypeError('target must be an object'); } // eslint-disable-next-line no-param-reassign formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"] || FormData)(); // eslint-disable-next-line no-param-reassign options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, { metaTokens: true, dots: false, indexes: false }, false, function defined(option, source) { // eslint-disable-next-line no-eq-null,eqeqeq return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]); }); const metaTokens = options.metaTokens; // eslint-disable-next-line no-use-before-define const visitor = options.visitor || defaultVisitor; const dots = options.dots; const indexes = options.indexes; const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData); if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) { throw new TypeError('visitor must be a function'); } function convertValue(value) { if (value === null) return ''; if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) { return value.toISOString(); } if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) { throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Blob is not supported. Use a Buffer instead.'); } if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) { return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); } return value; } /** * Default visitor. * * @param {*} value * @param {String|Number} key * @param {Array} path * @this {FormData} * * @returns {boolean} return true to visit the each prop of the value recursively */ function defaultVisitor(value, key, path) { let arr = value; if (value && !path && typeof value === 'object') { if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) { // eslint-disable-next-line no-param-reassign key = metaTokens ? key : key.slice(0, -2); // eslint-disable-next-line no-param-reassign value = JSON.stringify(value); } else if ( (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) || ((_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toArray(value)) )) { // eslint-disable-next-line no-param-reassign key = removeBrackets(key); arr.forEach(function each(el, index) { !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append( // eslint-disable-next-line no-nested-ternary indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), convertValue(el) ); }); return false; } } if (isVisitable(value)) { return true; } formData.append(renderKey(path, key, dots), convertValue(value)); return false; } const stack = []; const exposedHelpers = Object.assign(predicates, { defaultVisitor, convertValue, isVisitable }); function build(value, path) { if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return; if (stack.indexOf(value) !== -1) { throw Error('Circular reference detected in ' + path.join('.')); } stack.push(value); _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) { const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call( formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers ); if (result === true) { build(el, path ? path.concat(key) : [key]); } }); stack.pop(); } if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { throw new TypeError('data must be an object'); } build(obj); return formData; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData); /***/ }), /***/ "./node_modules/axios/lib/helpers/toURLEncodedForm.js": /*!************************************************************!*\ !*** ./node_modules/axios/lib/helpers/toURLEncodedForm.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ toURLEncodedForm) /* harmony export */ }); /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); /* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); /* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); function toURLEncodedForm(data, options) { return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].classes.URLSearchParams(), Object.assign({ visitor: function(value, key, path, helpers) { if (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isBuffer(value)) { this.append(key, value.toString('base64')); return false; } return helpers.defaultVisitor.apply(this, arguments); } }, options)); } /***/ }), /***/ "./node_modules/axios/lib/helpers/trackStream.js": /*!*******************************************************!*\ !*** ./node_modules/axios/lib/helpers/trackStream.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ readBytes: () => (/* binding */ readBytes), /* harmony export */ streamChunk: () => (/* binding */ streamChunk), /* harmony export */ trackStream: () => (/* binding */ trackStream) /* harmony export */ }); const streamChunk = function* (chunk, chunkSize) { let len = chunk.byteLength; if (!chunkSize || len < chunkSize) { yield chunk; return; } let pos = 0; let end; while (pos < len) { end = pos + chunkSize; yield chunk.slice(pos, end); pos = end; } } const readBytes = async function* (iterable, chunkSize) { for await (const chunk of readStream(iterable)) { yield* streamChunk(chunk, chunkSize); } } const readStream = async function* (stream) { if (stream[Symbol.asyncIterator]) { yield* stream; return; } const reader = stream.getReader(); try { for (;;) { const {done, value} = await reader.read(); if (done) { break; } yield value; } } finally { await reader.cancel(); } } const trackStream = (stream, chunkSize, onProgress, onFinish) => { const iterator = readBytes(stream, chunkSize); let bytes = 0; let done; let _onFinish = (e) => { if (!done) { done = true; onFinish && onFinish(e); } } return new ReadableStream({ async pull(controller) { try { const {done, value} = await iterator.next(); if (done) { _onFinish(); controller.close(); return; } let len = value.byteLength; if (onProgress) { let loadedBytes = bytes += len; onProgress(loadedBytes); } controller.enqueue(new Uint8Array(value)); } catch (err) { _onFinish(err); throw err; } }, cancel(reason) { _onFinish(reason); return iterator.return(); } }, { highWaterMark: 2 }) } /***/ }), /***/ "./node_modules/axios/lib/helpers/validator.js": /*!*****************************************************!*\ !*** ./node_modules/axios/lib/helpers/validator.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js"); /* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); const validators = {}; // eslint-disable-next-line func-names ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { validators[type] = function validator(thing) { return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; }; }); const deprecatedWarnings = {}; /** * Transitional option validator * * @param {function|boolean?} validator - set to false if the transitional option has been removed * @param {string?} version - deprecated version / removed since version * @param {string?} message - some message with additional info * * @returns {function} */ validators.transitional = function transitional(validator, version, message) { function formatMessage(opt, desc) { return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); } // eslint-disable-next-line func-names return (value, opt, opts) => { if (validator === false) { throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]( formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED ); } if (version && !deprecatedWarnings[opt]) { deprecatedWarnings[opt] = true; // eslint-disable-next-line no-console console.warn( formatMessage( opt, ' has been deprecated since v' + version + ' and will be removed in the near future' ) ); } return validator ? validator(value, opt, opts) : true; }; }; validators.spelling = function spelling(correctSpelling) { return (value, opt) => { // eslint-disable-next-line no-console console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); return true; } }; /** * Assert object's properties type * * @param {object} options * @param {object} schema * @param {boolean?} allowUnknown * * @returns {object} */ function assertOptions(options, schema, allowUnknown) { if (typeof options !== 'object') { throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); } const keys = Object.keys(options); let i = keys.length; while (i-- > 0) { const opt = keys[i]; const validator = schema[opt]; if (validator) { const value = options[opt]; const result = value === undefined || validator(value, opt, options); if (result !== true) { throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); } continue; } if (allowUnknown !== true) { throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION); } } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ assertOptions, validators }); /***/ }), /***/ "./node_modules/axios/lib/platform/browser/classes/Blob.js": /*!*****************************************************************!*\ !*** ./node_modules/axios/lib/platform/browser/classes/Blob.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof Blob !== 'undefined' ? Blob : null); /***/ }), /***/ "./node_modules/axios/lib/platform/browser/classes/FormData.js": /*!*********************************************************************!*\ !*** ./node_modules/axios/lib/platform/browser/classes/FormData.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof FormData !== 'undefined' ? FormData : null); /***/ }), /***/ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": /*!****************************************************************************!*\ !*** ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***! \****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), /***/ "./node_modules/axios/lib/platform/browser/index.js": /*!**********************************************************!*\ !*** ./node_modules/axios/lib/platform/browser/index.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"); /* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "./node_modules/axios/lib/platform/browser/classes/FormData.js"); /* harmony import */ var _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/Blob.js */ "./node_modules/axios/lib/platform/browser/classes/Blob.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ isBrowser: true, classes: { URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"], FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"], Blob: _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__["default"] }, protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] }); /***/ }), /***/ "./node_modules/axios/lib/platform/common/utils.js": /*!*********************************************************!*\ !*** ./node_modules/axios/lib/platform/common/utils.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ hasBrowserEnv: () => (/* binding */ hasBrowserEnv), /* harmony export */ hasStandardBrowserEnv: () => (/* binding */ hasStandardBrowserEnv), /* harmony export */ hasStandardBrowserWebWorkerEnv: () => (/* binding */ hasStandardBrowserWebWorkerEnv), /* harmony export */ navigator: () => (/* binding */ _navigator), /* harmony export */ origin: () => (/* binding */ origin) /* harmony export */ }); const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; const _navigator = typeof navigator === 'object' && navigator || undefined; /** * Determine if we're running in a standard browser environment * * This allows axios to run in a web worker, and react-native. * Both environments support XMLHttpRequest, but not fully standard globals. * * web workers: * typeof window -> undefined * typeof document -> undefined * * react-native: * navigator.product -> 'ReactNative' * nativescript * navigator.product -> 'NativeScript' or 'NS' * * @returns {boolean} */ const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); /** * Determine if we're running in a standard browser webWorker environment * * Although the `isStandardBrowserEnv` method indicates that * `allows axios to run in a web worker`, the WebWorker will still be * filtered out due to its judgment standard * `typeof window !== 'undefined' && typeof document !== 'undefined'`. * This leads to a problem when axios post `FormData` in webWorker */ const hasStandardBrowserWebWorkerEnv = (() => { return ( typeof WorkerGlobalScope !== 'undefined' && // eslint-disable-next-line no-undef self instanceof WorkerGlobalScope && typeof self.importScripts === 'function' ); })(); const origin = hasBrowserEnv && window.location.href || 'http://localhost'; /***/ }), /***/ "./node_modules/axios/lib/platform/index.js": /*!**************************************************!*\ !*** ./node_modules/axios/lib/platform/index.js ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _node_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); /* harmony import */ var _common_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common/utils.js */ "./node_modules/axios/lib/platform/common/utils.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._common_utils_js__WEBPACK_IMPORTED_MODULE_0__, ..._node_index_js__WEBPACK_IMPORTED_MODULE_1__["default"] }); /***/ }), /***/ "./node_modules/axios/lib/utils.js": /*!*****************************************!*\ !*** ./node_modules/axios/lib/utils.js ***! \*****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); /* provided dependency */ var process = __webpack_require__(/*! process/browser */ "./node_modules/process/browser.js"); // utils is a library of generic helper functions non-specific to axios const {toString} = Object.prototype; const {getPrototypeOf} = Object; const kindOf = (cache => thing => { const str = toString.call(thing); return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); })(Object.create(null)); const kindOfTest = (type) => { type = type.toLowerCase(); return (thing) => kindOf(thing) === type } const typeOfTest = type => thing => typeof thing === type; /** * Determine if a value is an Array * * @param {Object} val The value to test * * @returns {boolean} True if value is an Array, otherwise false */ const {isArray} = Array; /** * Determine if a value is undefined * * @param {*} val The value to test * * @returns {boolean} True if the value is undefined, otherwise false */ const isUndefined = typeOfTest('undefined'); /** * Determine if a value is a Buffer * * @param {*} val The value to test * * @returns {boolean} True if value is a Buffer, otherwise false */ function isBuffer(val) { return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); } /** * Determine if a value is an ArrayBuffer * * @param {*} val The value to test * * @returns {boolean} True if value is an ArrayBuffer, otherwise false */ const isArrayBuffer = kindOfTest('ArrayBuffer'); /** * Determine if a value is a view on an ArrayBuffer * * @param {*} val The value to test * * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false */ function isArrayBufferView(val) { let result; if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { result = ArrayBuffer.isView(val); } else { result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); } return result; } /** * Determine if a value is a String * * @param {*} val The value to test * * @returns {boolean} True if value is a String, otherwise false */ const isString = typeOfTest('string'); /** * Determine if a value is a Function * * @param {*} val The value to test * @returns {boolean} True if value is a Function, otherwise false */ const isFunction = typeOfTest('function'); /** * Determine if a value is a Number * * @param {*} val The value to test * * @returns {boolean} True if value is a Number, otherwise false */ const isNumber = typeOfTest('number'); /** * Determine if a value is an Object * * @param {*} thing The value to test * * @returns {boolean} True if value is an Object, otherwise false */ const isObject = (thing) => thing !== null && typeof thing === 'object'; /** * Determine if a value is a Boolean * * @param {*} thing The value to test * @returns {boolean} True if value is a Boolean, otherwise false */ const isBoolean = thing => thing === true || thing === false; /** * Determine if a value is a plain Object * * @param {*} val The value to test * * @returns {boolean} True if value is a plain Object, otherwise false */ const isPlainObject = (val) => { if (kindOf(val) !== 'object') { return false; } const prototype = getPrototypeOf(val); return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); } /** * Determine if a value is a Date * * @param {*} val The value to test * * @returns {boolean} True if value is a Date, otherwise false */ const isDate = kindOfTest('Date'); /** * Determine if a value is a File * * @param {*} val The value to test * * @returns {boolean} True if value is a File, otherwise false */ const isFile = kindOfTest('File'); /** * Determine if a value is a Blob * * @param {*} val The value to test * * @returns {boolean} True if value is a Blob, otherwise false */ const isBlob = kindOfTest('Blob'); /** * Determine if a value is a FileList * * @param {*} val The value to test * * @returns {boolean} True if value is a File, otherwise false */ const isFileList = kindOfTest('FileList'); /** * Determine if a value is a Stream * * @param {*} val The value to test * * @returns {boolean} True if value is a Stream, otherwise false */ const isStream = (val) => isObject(val) && isFunction(val.pipe); /** * Determine if a value is a FormData * * @param {*} thing The value to test * * @returns {boolean} True if value is an FormData, otherwise false */ const isFormData = (thing) => { let kind; return thing && ( (typeof FormData === 'function' && thing instanceof FormData) || ( isFunction(thing.append) && ( (kind = kindOf(thing)) === 'formdata' || // detect form-data instance (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') ) ) ) } /** * Determine if a value is a URLSearchParams object * * @param {*} val The value to test * * @returns {boolean} True if value is a URLSearchParams object, otherwise false */ const isURLSearchParams = kindOfTest('URLSearchParams'); const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); /** * Trim excess whitespace off the beginning and end of a string * * @param {String} str The String to trim * * @returns {String} The String freed of excess whitespace */ const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); /** * Iterate over an Array or an Object invoking a function for each item. * * If `obj` is an Array callback will be called passing * the value, index, and complete array for each item. * * If 'obj' is an Object callback will be called passing * the value, key, and complete object for each property. * * @param {Object|Array} obj The object to iterate * @param {Function} fn The callback to invoke for each item * * @param {Boolean} [allOwnKeys = false] * @returns {any} */ function forEach(obj, fn, {allOwnKeys = false} = {}) { // Don't bother if no value provided if (obj === null || typeof obj === 'undefined') { return; } let i; let l; // Force an array if not already something iterable if (typeof obj !== 'object') { /*eslint no-param-reassign:0*/ obj = [obj]; } if (isArray(obj)) { // Iterate over array values for (i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj); } } else { // Iterate over object keys const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); const len = keys.length; let key; for (i = 0; i < len; i++) { key = keys[i]; fn.call(null, obj[key], key, obj); } } } function findKey(obj, key) { key = key.toLowerCase(); const keys = Object.keys(obj); let i = keys.length; let _key; while (i-- > 0) { _key = keys[i]; if (key === _key.toLowerCase()) { return _key; } } return null; } const _global = (() => { /*eslint no-undef:0*/ if (typeof globalThis !== "undefined") return globalThis; return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : __webpack_require__.g) })(); const isContextDefined = (context) => !isUndefined(context) && context !== _global; /** * Accepts varargs expecting each argument to be an object, then * immutably merges the properties of each object and returns result. * * When multiple objects contain the same key the later object in * the arguments list will take precedence. * * Example: * * ```js * var result = merge({foo: 123}, {foo: 456}); * console.log(result.foo); // outputs 456 * ``` * * @param {Object} obj1 Object to merge * * @returns {Object} Result of all merge properties */ function merge(/* obj1, obj2, obj3, ... */) { const {caseless} = isContextDefined(this) && this || {}; const result = {}; const assignValue = (val, key) => { const targetKey = caseless && findKey(result, key) || key; if (isPlainObject(result[targetKey]) && isPlainObject(val)) { result[targetKey] = merge(result[targetKey], val); } else if (isPlainObject(val)) { result[targetKey] = merge({}, val); } else if (isArray(val)) { result[targetKey] = val.slice(); } else { result[targetKey] = val; } } for (let i = 0, l = arguments.length; i < l; i++) { arguments[i] && forEach(arguments[i], assignValue); } return result; } /** * Extends object a by mutably adding to it the properties of object b. * * @param {Object} a The object to be extended * @param {Object} b The object to copy properties from * @param {Object} thisArg The object to bind function to * * @param {Boolean} [allOwnKeys] * @returns {Object} The resulting value of object a */ const extend = (a, b, thisArg, {allOwnKeys}= {}) => { forEach(b, (val, key) => { if (thisArg && isFunction(val)) { a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg); } else { a[key] = val; } }, {allOwnKeys}); return a; } /** * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) * * @param {string} content with BOM * * @returns {string} content value without BOM */ const stripBOM = (content) => { if (content.charCodeAt(0) === 0xFEFF) { content = content.slice(1); } return content; } /** * Inherit the prototype methods from one constructor into another * @param {function} constructor * @param {function} superConstructor * @param {object} [props] * @param {object} [descriptors] * * @returns {void} */ const inherits = (constructor, superConstructor, props, descriptors) => { constructor.prototype = Object.create(superConstructor.prototype, descriptors); constructor.prototype.constructor = constructor; Object.defineProperty(constructor, 'super', { value: superConstructor.prototype }); props && Object.assign(constructor.prototype, props); } /** * Resolve object with deep prototype chain to a flat object * @param {Object} sourceObj source object * @param {Object} [destObj] * @param {Function|Boolean} [filter] * @param {Function} [propFilter] * * @returns {Object} */ const toFlatObject = (sourceObj, destObj, filter, propFilter) => { let props; let i; let prop; const merged = {}; destObj = destObj || {}; // eslint-disable-next-line no-eq-null,eqeqeq if (sourceObj == null) return destObj; do { props = Object.getOwnPropertyNames(sourceObj); i = props.length; while (i-- > 0) { prop = props[i]; if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { destObj[prop] = sourceObj[prop]; merged[prop] = true; } } sourceObj = filter !== false && getPrototypeOf(sourceObj); } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); return destObj; } /** * Determines whether a string ends with the characters of a specified string * * @param {String} str * @param {String} searchString * @param {Number} [position= 0] * * @returns {boolean} */ const endsWith = (str, searchString, position) => { str = String(str); if (position === undefined || position > str.length) { position = str.length; } position -= searchString.length; const lastIndex = str.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; } /** * Returns new array from array like object or null if failed * * @param {*} [thing] * * @returns {?Array} */ const toArray = (thing) => { if (!thing) return null; if (isArray(thing)) return thing; let i = thing.length; if (!isNumber(i)) return null; const arr = new Array(i); while (i-- > 0) { arr[i] = thing[i]; } return arr; } /** * Checking if the Uint8Array exists and if it does, it returns a function that checks if the * thing passed in is an instance of Uint8Array * * @param {TypedArray} * * @returns {Array} */ // eslint-disable-next-line func-names const isTypedArray = (TypedArray => { // eslint-disable-next-line func-names return thing => { return TypedArray && thing instanceof TypedArray; }; })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); /** * For each entry in the object, call the function with the key and value. * * @param {Object} obj - The object to iterate over. * @param {Function} fn - The function to call for each entry. * * @returns {void} */ const forEachEntry = (obj, fn) => { const generator = obj && obj[Symbol.iterator]; const iterator = generator.call(obj); let result; while ((result = iterator.next()) && !result.done) { const pair = result.value; fn.call(obj, pair[0], pair[1]); } } /** * It takes a regular expression and a string, and returns an array of all the matches * * @param {string} regExp - The regular expression to match against. * @param {string} str - The string to search. * * @returns {Array} */ const matchAll = (regExp, str) => { let matches; const arr = []; while ((matches = regExp.exec(str)) !== null) { arr.push(matches); } return arr; } /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ const isHTMLForm = kindOfTest('HTMLFormElement'); const toCamelCase = str => { return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { return p1.toUpperCase() + p2; } ); }; /* Creating a function that will check if an object has a property. */ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); /** * Determine if a value is a RegExp object * * @param {*} val The value to test * * @returns {boolean} True if value is a RegExp object, otherwise false */ const isRegExp = kindOfTest('RegExp'); const reduceDescriptors = (obj, reducer) => { const descriptors = Object.getOwnPropertyDescriptors(obj); const reducedDescriptors = {}; forEach(descriptors, (descriptor, name) => { let ret; if ((ret = reducer(descriptor, name, obj)) !== false) { reducedDescriptors[name] = ret || descriptor; } }); Object.defineProperties(obj, reducedDescriptors); } /** * Makes all methods read-only * @param {Object} obj */ const freezeMethods = (obj) => { reduceDescriptors(obj, (descriptor, name) => { // skip restricted props in strict mode if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { return false; } const value = obj[name]; if (!isFunction(value)) return; descriptor.enumerable = false; if ('writable' in descriptor) { descriptor.writable = false; return; } if (!descriptor.set) { descriptor.set = () => { throw Error('Can not rewrite read-only method \'' + name + '\''); }; } }); } const toObjectSet = (arrayOrString, delimiter) => { const obj = {}; const define = (arr) => { arr.forEach(value => { obj[value] = true; }); } isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); return obj; } const noop = () => {} const toFiniteNumber = (value, defaultValue) => { return value != null && Number.isFinite(value = +value) ? value : defaultValue; } /** * If the thing is a FormData object, return true, otherwise return false. * * @param {unknown} thing - The thing to check. * * @returns {boolean} */ function isSpecCompliantForm(thing) { return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); } const toJSONObject = (obj) => { const stack = new Array(10); const visit = (source, i) => { if (isObject(source)) { if (stack.indexOf(source) >= 0) { return; } if(!('toJSON' in source)) { stack[i] = source; const target = isArray(source) ? [] : {}; forEach(source, (value, key) => { const reducedValue = visit(value, i + 1); !isUndefined(reducedValue) && (target[key] = reducedValue); }); stack[i] = undefined; return target; } } return source; } return visit(obj, 0); } const isAsyncFn = kindOfTest('AsyncFunction'); const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); // original code // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 const _setImmediate = ((setImmediateSupported, postMessageSupported) => { if (setImmediateSupported) { return setImmediate; } return postMessageSupported ? ((token, callbacks) => { _global.addEventListener("message", ({source, data}) => { if (source === _global && data === token) { callbacks.length && callbacks.shift()(); } }, false); return (cb) => { callbacks.push(cb); _global.postMessage(token, "*"); } })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); })( typeof setImmediate === 'function', isFunction(_global.postMessage) ); const asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate); // ********************* /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ isArray, isArrayBuffer, isBuffer, isFormData, isArrayBufferView, isString, isNumber, isBoolean, isObject, isPlainObject, isReadableStream, isRequest, isResponse, isHeaders, isUndefined, isDate, isFile, isBlob, isRegExp, isFunction, isStream, isURLSearchParams, isTypedArray, isFileList, forEach, merge, extend, trim, stripBOM, inherits, toFlatObject, kindOf, kindOfTest, endsWith, toArray, forEachEntry, matchAll, isHTMLForm, hasOwnProperty, hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors, freezeMethods, toObjectSet, toCamelCase, noop, toFiniteNumber, findKey, global: _global, isContextDefined, isSpecCompliantForm, toJSONObject, isAsyncFn, isThenable, setImmediate: _setImmediate, asap }); /***/ }), /***/ "./node_modules/base64-js/index.js": /*!*****************************************!*\ !*** ./node_modules/base64-js/index.js ***! \*****************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; exports.byteLength = byteLength exports.toByteArray = toByteArray exports.fromByteArray = fromByteArray var lookup = [] var revLookup = [] var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' for (var i = 0, len = code.length; i < len; ++i) { lookup[i] = code[i] revLookup[code.charCodeAt(i)] = i } // Support decoding URL-safe base64 strings, as Node.js does. // See: https://en.wikipedia.org/wiki/Base64#URL_applications revLookup['-'.charCodeAt(0)] = 62 revLookup['_'.charCodeAt(0)] = 63 function getLens (b64) { var len = b64.length if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } // Trim off extra bytes after placeholder bytes are found // See: https://github.com/beatgammit/base64-js/issues/42 var validLen = b64.indexOf('=') if (validLen === -1) validLen = len var placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4) return [validLen, placeHoldersLen] } // base64 is 4/3 + up to two characters of the original data function byteLength (b64) { var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function _byteLength (b64, validLen, placeHoldersLen) { return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function toByteArray (b64) { var tmp var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) var curByte = 0 // if there are placeholders, only get up to the last complete 4 chars var len = placeHoldersLen > 0 ? validLen - 4 : validLen var i for (i = 0; i < len; i += 4) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] arr[curByte++] = (tmp >> 16) & 0xFF arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 2) { tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 1) { tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } return arr } function tripletToBase64 (num) { return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] } function encodeChunk (uint8, start, end) { var tmp var output = [] for (var i = start; i < end; i += 3) { tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF) output.push(tripletToBase64(tmp)) } return output.join('') } function fromByteArray (uint8) { var tmp var len = uint8.length var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes var parts = [] var maxChunkLength = 16383 // must be multiple of 3 // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) } // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1] parts.push( lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3F] + '==' ) } else if (extraBytes === 2) { tmp = (uint8[len - 2] << 8) + uint8[len - 1] parts.push( lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3F] + lookup[(tmp << 2) & 0x3F] + '=' ) } return parts.join('') } /***/ }), /***/ "./node_modules/buffer/index.js": /*!**************************************!*\ !*** ./node_modules/buffer/index.js ***! \**************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ /* eslint-disable no-proto */ const base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js") const ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js") const customInspectSymbol = (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation : null exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer exports.INSPECT_MAX_BYTES = 50 const K_MAX_LENGTH = 0x7fffffff exports.kMaxLength = K_MAX_LENGTH /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Print warning and recommend using `buffer` v4.x which has an Object * implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * We report that the browser does not support typed arrays if the are not subclassable * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support * for __proto__ and has a buggy typed array implementation. */ Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { console.error( 'This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' ) } function typedArraySupport () { // Can typed array instances can be augmented? try { const arr = new Uint8Array(1) const proto = { foo: function () { return 42 } } Object.setPrototypeOf(proto, Uint8Array.prototype) Object.setPrototypeOf(arr, proto) return arr.foo() === 42 } catch (e) { return false } } Object.defineProperty(Buffer.prototype, 'parent', { enumerable: true, get: function () { if (!Buffer.isBuffer(this)) return undefined return this.buffer } }) Object.defineProperty(Buffer.prototype, 'offset', { enumerable: true, get: function () { if (!Buffer.isBuffer(this)) return undefined return this.byteOffset } }) function createBuffer (length) { if (length > K_MAX_LENGTH) { throw new RangeError('The value "' + length + '" is invalid for option "size"') } // Return an augmented `Uint8Array` instance const buf = new Uint8Array(length) Object.setPrototypeOf(buf, Buffer.prototype) return buf } /** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */ function Buffer (arg, encodingOrOffset, length) { // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new TypeError( 'The "string" argument must be of type string. Received type number' ) } return allocUnsafe(arg) } return from(arg, encodingOrOffset, length) } Buffer.poolSize = 8192 // not used by this implementation function from (value, encodingOrOffset, length) { if (typeof value === 'string') { return fromString(value, encodingOrOffset) } if (ArrayBuffer.isView(value)) { return fromArrayView(value) } if (value == null) { throw new TypeError( 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + (typeof value) ) } if (isInstance(value, ArrayBuffer) || (value && isInstance(value.buffer, ArrayBuffer))) { return fromArrayBuffer(value, encodingOrOffset, length) } if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || (value && isInstance(value.buffer, SharedArrayBuffer)))) { return fromArrayBuffer(value, encodingOrOffset, length) } if (typeof value === 'number') { throw new TypeError( 'The "value" argument must not be of type number. Received type number' ) } const valueOf = value.valueOf && value.valueOf() if (valueOf != null && valueOf !== value) { return Buffer.from(valueOf, encodingOrOffset, length) } const b = fromObject(value) if (b) return b if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length) } throw new TypeError( 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + (typeof value) ) } /** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/ Buffer.from = function (value, encodingOrOffset, length) { return from(value, encodingOrOffset, length) } // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: // https://github.com/feross/buffer/pull/148 Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype) Object.setPrototypeOf(Buffer, Uint8Array) function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be of type number') } else if (size < 0) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } } function alloc (size, fill, encoding) { assertSize(size) if (size <= 0) { return createBuffer(size) } if (fill !== undefined) { // Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpreted as a start offset. return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill) } return createBuffer(size) } /** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/ Buffer.alloc = function (size, fill, encoding) { return alloc(size, fill, encoding) } function allocUnsafe (size) { assertSize(size) return createBuffer(size < 0 ? 0 : checked(size) | 0) } /** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */ Buffer.allocUnsafe = function (size) { return allocUnsafe(size) } /** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ Buffer.allocUnsafeSlow = function (size) { return allocUnsafe(size) } function fromString (string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } const length = byteLength(string, encoding) | 0 let buf = createBuffer(length) const actual = buf.write(string, encoding) if (actual !== length) { // Writing a hex string, for example, that contains invalid characters will // cause everything after the first invalid character to be ignored. (e.g. // 'abxxcd' will be treated as 'ab') buf = buf.slice(0, actual) } return buf } function fromArrayLike (array) { const length = array.length < 0 ? 0 : checked(array.length) | 0 const buf = createBuffer(length) for (let i = 0; i < length; i += 1) { buf[i] = array[i] & 255 } return buf } function fromArrayView (arrayView) { if (isInstance(arrayView, Uint8Array)) { const copy = new Uint8Array(arrayView) return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) } return fromArrayLike(arrayView) } function fromArrayBuffer (array, byteOffset, length) { if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('"offset" is outside of buffer bounds') } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('"length" is outside of buffer bounds') } let buf if (byteOffset === undefined && length === undefined) { buf = new Uint8Array(array) } else if (length === undefined) { buf = new Uint8Array(array, byteOffset) } else { buf = new Uint8Array(array, byteOffset, length) } // Return an augmented `Uint8Array` instance Object.setPrototypeOf(buf, Buffer.prototype) return buf } function fromObject (obj) { if (Buffer.isBuffer(obj)) { const len = checked(obj.length) | 0 const buf = createBuffer(len) if (buf.length === 0) { return buf } obj.copy(buf, 0, 0, len) return buf } if (obj.length !== undefined) { if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { return createBuffer(0) } return fromArrayLike(obj) } if (obj.type === 'Buffer' && Array.isArray(obj.data)) { return fromArrayLike(obj.data) } } function checked (length) { // Note: cannot use `length < K_MAX_LENGTH` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= K_MAX_LENGTH) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') } return length | 0 } function SlowBuffer (length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0 } return Buffer.alloc(+length) } Buffer.isBuffer = function isBuffer (b) { return b != null && b._isBuffer === true && b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false } Buffer.compare = function compare (a, b) { if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' ) } if (a === b) return 0 let x = a.length let y = b.length for (let i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i] y = b[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function isEncoding (encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'latin1': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true default: return false } } Buffer.concat = function concat (list, length) { if (!Array.isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers') } if (list.length === 0) { return Buffer.alloc(0) } let i if (length === undefined) { length = 0 for (i = 0; i < list.length; ++i) { length += list[i].length } } const buffer = Buffer.allocUnsafe(length) let pos = 0 for (i = 0; i < list.length; ++i) { let buf = list[i] if (isInstance(buf, Uint8Array)) { if (pos + buf.length > buffer.length) { if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf) buf.copy(buffer, pos) } else { Uint8Array.prototype.set.call( buffer, buf, pos ) } } else if (!Buffer.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers') } else { buf.copy(buffer, pos) } pos += buf.length } return buffer } function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { throw new TypeError( 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + typeof string ) } const len = string.length const mustMatch = (arguments.length > 2 && arguments[2] === true) if (!mustMatch && len === 0) return 0 // Use a for loop to avoid recursion let loweredCase = false for (;;) { switch (encoding) { case 'ascii': case 'latin1': case 'binary': return len case 'utf8': case 'utf-8': return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return len * 2 case 'hex': return len >>> 1 case 'base64': return base64ToBytes(string).length default: if (loweredCase) { return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 } encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.byteLength = byteLength function slowToString (encoding, start, end) { let loweredCase = false // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if (start === undefined || start < 0) { start = 0 } // Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if (start > this.length) { return '' } if (end === undefined || end > this.length) { end = this.length } if (end <= 0) { return '' } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. end >>>= 0 start >>>= 0 if (end <= start) { return '' } if (!encoding) encoding = 'utf8' while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end) case 'utf8': case 'utf-8': return utf8Slice(this, start, end) case 'ascii': return asciiSlice(this, start, end) case 'latin1': case 'binary': return latin1Slice(this, start, end) case 'base64': return base64Slice(this, start, end) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = (encoding + '').toLowerCase() loweredCase = true } } } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) // to detect a Buffer instance. It's not possible to use `instanceof Buffer` // reliably in a browserify context because there could be multiple different // copies of the 'buffer' package in use. This method works even for Buffer // instances that were created from another copy of the `buffer` package. // See: https://github.com/feross/buffer/issues/154 Buffer.prototype._isBuffer = true function swap (b, n, m) { const i = b[n] b[n] = b[m] b[m] = i } Buffer.prototype.swap16 = function swap16 () { const len = this.length if (len % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits') } for (let i = 0; i < len; i += 2) { swap(this, i, i + 1) } return this } Buffer.prototype.swap32 = function swap32 () { const len = this.length if (len % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits') } for (let i = 0; i < len; i += 4) { swap(this, i, i + 3) swap(this, i + 1, i + 2) } return this } Buffer.prototype.swap64 = function swap64 () { const len = this.length if (len % 8 !== 0) { throw new RangeError('Buffer size must be a multiple of 64-bits') } for (let i = 0; i < len; i += 8) { swap(this, i, i + 7) swap(this, i + 1, i + 6) swap(this, i + 2, i + 5) swap(this, i + 3, i + 4) } return this } Buffer.prototype.toString = function toString () { const length = this.length if (length === 0) return '' if (arguments.length === 0) return utf8Slice(this, 0, length) return slowToString.apply(this, arguments) } Buffer.prototype.toLocaleString = Buffer.prototype.toString Buffer.prototype.equals = function equals (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') if (this === b) return true return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function inspect () { let str = '' const max = exports.INSPECT_MAX_BYTES str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() if (this.length > max) str += ' ... ' return '' } if (customInspectSymbol) { Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { if (isInstance(target, Uint8Array)) { target = Buffer.from(target, target.offset, target.byteLength) } if (!Buffer.isBuffer(target)) { throw new TypeError( 'The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + (typeof target) ) } if (start === undefined) { start = 0 } if (end === undefined) { end = target ? target.length : 0 } if (thisStart === undefined) { thisStart = 0 } if (thisEnd === undefined) { thisEnd = this.length } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError('out of range index') } if (thisStart >= thisEnd && start >= end) { return 0 } if (thisStart >= thisEnd) { return -1 } if (start >= end) { return 1 } start >>>= 0 end >>>= 0 thisStart >>>= 0 thisEnd >>>= 0 if (this === target) return 0 let x = thisEnd - thisStart let y = end - start const len = Math.min(x, y) const thisCopy = this.slice(thisStart, thisEnd) const targetCopy = target.slice(start, end) for (let i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x = thisCopy[i] y = targetCopy[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, // OR the last index of `val` in `buffer` at offset <= `byteOffset`. // // Arguments: // - buffer - a Buffer to search // - val - a string, Buffer, or number // - byteOffset - an index into `buffer`; will be clamped to an int32 // - encoding - an optional encoding, relevant is val is a string // - dir - true for indexOf, false for lastIndexOf function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } byteOffset = +byteOffset // Coerce to Number. if (numberIsNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) } // Normalize byteOffset: negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = buffer.length + byteOffset if (byteOffset >= buffer.length) { if (dir) return -1 else byteOffset = buffer.length - 1 } else if (byteOffset < 0) { if (dir) byteOffset = 0 else return -1 } // Normalize val if (typeof val === 'string') { val = Buffer.from(val, encoding) } // Finally, search either indexOf (if dir is true) or lastIndexOf if (Buffer.isBuffer(val)) { // Special case: looking for empty string/buffer always fails if (val.length === 0) { return -1 } return arrayIndexOf(buffer, val, byteOffset, encoding, dir) } else if (typeof val === 'number') { val = val & 0xFF // Search for a byte value [0-255] if (typeof Uint8Array.prototype.indexOf === 'function') { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) } } return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) } throw new TypeError('val must be string, number or Buffer') } function arrayIndexOf (arr, val, byteOffset, encoding, dir) { let indexSize = 1 let arrLength = arr.length let valLength = val.length if (encoding !== undefined) { encoding = String(encoding).toLowerCase() if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { if (arr.length < 2 || val.length < 2) { return -1 } indexSize = 2 arrLength /= 2 valLength /= 2 byteOffset /= 2 } } function read (buf, i) { if (indexSize === 1) { return buf[i] } else { return buf.readUInt16BE(i * indexSize) } } let i if (dir) { let foundIndex = -1 for (i = byteOffset; i < arrLength; i++) { if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i if (i - foundIndex + 1 === valLength) return foundIndex * indexSize } else { if (foundIndex !== -1) i -= i - foundIndex foundIndex = -1 } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength for (i = byteOffset; i >= 0; i--) { let found = true for (let j = 0; j < valLength; j++) { if (read(arr, i + j) !== read(val, j)) { found = false break } } if (found) return i } } return -1 } Buffer.prototype.includes = function includes (val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1 } Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 const remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } const strLen = string.length if (length > strLen / 2) { length = strLen / 2 } let i for (i = 0; i < length; ++i) { const parsed = parseInt(string.substr(i * 2, 2), 16) if (numberIsNaN(parsed)) return i buf[offset + i] = parsed } return i } function utf8Write (buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) } function ucs2Write (buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } Buffer.prototype.write = function write (string, offset, length, encoding) { // Buffer#write(string) if (offset === undefined) { encoding = 'utf8' length = this.length offset = 0 // Buffer#write(string, encoding) } else if (length === undefined && typeof offset === 'string') { encoding = offset length = this.length offset = 0 // Buffer#write(string, offset[, length][, encoding]) } else if (isFinite(offset)) { offset = offset >>> 0 if (isFinite(length)) { length = length >>> 0 if (encoding === undefined) encoding = 'utf8' } else { encoding = length length = undefined } } else { throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported' ) } const remaining = this.length - offset if (length === undefined || length > remaining) length = remaining if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { throw new RangeError('Attempt to write outside buffer bounds') } if (!encoding) encoding = 'utf8' let loweredCase = false for (;;) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length) case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length) case 'ascii': case 'latin1': case 'binary': return asciiWrite(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write return base64Write(this, string, offset, length) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.prototype.toJSON = function toJSON () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } } function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } } function utf8Slice (buf, start, end) { end = Math.min(buf.length, end) const res = [] let i = start while (i < end) { const firstByte = buf[i] let codePoint = null let bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 : (firstByte > 0xBF) ? 2 : 1 if (i + bytesPerSequence <= end) { let secondByte, thirdByte, fourthByte, tempCodePoint switch (bytesPerSequence) { case 1: if (firstByte < 0x80) { codePoint = firstByte } break case 2: secondByte = buf[i + 1] if ((secondByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) if (tempCodePoint > 0x7F) { codePoint = tempCodePoint } } break case 3: secondByte = buf[i + 1] thirdByte = buf[i + 2] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { codePoint = tempCodePoint } } break case 4: secondByte = buf[i + 1] thirdByte = buf[i + 2] fourthByte = buf[i + 3] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { codePoint = tempCodePoint } } } } if (codePoint === null) { // we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint = 0xFFFD bytesPerSequence = 1 } else if (codePoint > 0xFFFF) { // encode to utf16 (surrogate pair dance) codePoint -= 0x10000 res.push(codePoint >>> 10 & 0x3FF | 0xD800) codePoint = 0xDC00 | codePoint & 0x3FF } res.push(codePoint) i += bytesPerSequence } return decodeCodePointsArray(res) } // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety const MAX_ARGUMENTS_LENGTH = 0x1000 function decodeCodePointsArray (codePoints) { const len = codePoints.length if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } // Decode in chunks to avoid "call stack size exceeded". let res = '' let i = 0 while (i < len) { res += String.fromCharCode.apply( String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) ) } return res } function asciiSlice (buf, start, end) { let ret = '' end = Math.min(buf.length, end) for (let i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 0x7F) } return ret } function latin1Slice (buf, start, end) { let ret = '' end = Math.min(buf.length, end) for (let i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]) } return ret } function hexSlice (buf, start, end) { const len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len let out = '' for (let i = start; i < end; ++i) { out += hexSliceLookupTable[buf[i]] } return out } function utf16leSlice (buf, start, end) { const bytes = buf.slice(start, end) let res = '' // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) for (let i = 0; i < bytes.length - 1; i += 2) { res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) } return res } Buffer.prototype.slice = function slice (start, end) { const len = this.length start = ~~start end = end === undefined ? len : ~~end if (start < 0) { start += len if (start < 0) start = 0 } else if (start > len) { start = len } if (end < 0) { end += len if (end < 0) end = 0 } else if (end > len) { end = len } if (end < start) end = start const newBuf = this.subarray(start, end) // Return an augmented `Uint8Array` instance Object.setPrototypeOf(newBuf, Buffer.prototype) return newBuf } /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) let val = this[offset] let mul = 1 let i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } return val } Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { checkOffset(offset, byteLength, this.length) } let val = this[offset + --byteLength] let mul = 1 while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul } return val } Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | (this[offset + 1] << 8) } Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) return (this[offset] << 8) | this[offset + 1] } Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ((this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16)) + (this[offset + 3] * 0x1000000) } Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] * 0x1000000) + ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3]) } Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { offset = offset >>> 0 validateNumber(offset, 'offset') const first = this[offset] const last = this[offset + 7] if (first === undefined || last === undefined) { boundsError(offset, this.length - 8) } const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24 const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24 return BigInt(lo) + (BigInt(hi) << BigInt(32)) }) Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) { offset = offset >>> 0 validateNumber(offset, 'offset') const first = this[offset] const last = this[offset + 7] if (first === undefined || last === undefined) { boundsError(offset, this.length - 8) } const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset] const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last return (BigInt(hi) << BigInt(32)) + BigInt(lo) }) Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) let val = this[offset] let mul = 1 let i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) let i = byteLength let mul = 1 let val = this[offset + --i] while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 1, this.length) if (!(this[offset] & 0x80)) return (this[offset]) return ((0xff - this[offset] + 1) * -1) } Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) const val = this[offset] | (this[offset + 1] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) const val = this[offset + 1] | (this[offset] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16) | (this[offset + 3] << 24) } Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] << 24) | (this[offset + 1] << 16) | (this[offset + 2] << 8) | (this[offset + 3]) } Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) { offset = offset >>> 0 validateNumber(offset, 'offset') const first = this[offset] const last = this[offset + 7] if (first === undefined || last === undefined) { boundsError(offset, this.length - 8) } const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24) // Overflow return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24) }) Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) { offset = offset >>> 0 validateNumber(offset, 'offset') const first = this[offset] const last = this[offset + 7] if (first === undefined || last === undefined) { boundsError(offset, this.length - 8) } const val = (first << 24) + // Overflow this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset] return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last) }) Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, false, 52, 8) } function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') if (offset + ext > buf.length) throw new RangeError('Index out of range') } Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { const maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } let mul = 1 let i = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { const maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } let i = byteLength - 1 let mul = 1 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) return offset + 2 } Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) return offset + 2 } Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) this[offset + 3] = (value >>> 24) this[offset + 2] = (value >>> 16) this[offset + 1] = (value >>> 8) this[offset] = (value & 0xff) return offset + 4 } Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) return offset + 4 } function wrtBigUInt64LE (buf, value, offset, min, max) { checkIntBI(value, min, max, buf, offset, 7) let lo = Number(value & BigInt(0xffffffff)) buf[offset++] = lo lo = lo >> 8 buf[offset++] = lo lo = lo >> 8 buf[offset++] = lo lo = lo >> 8 buf[offset++] = lo let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)) buf[offset++] = hi hi = hi >> 8 buf[offset++] = hi hi = hi >> 8 buf[offset++] = hi hi = hi >> 8 buf[offset++] = hi return offset } function wrtBigUInt64BE (buf, value, offset, min, max) { checkIntBI(value, min, max, buf, offset, 7) let lo = Number(value & BigInt(0xffffffff)) buf[offset + 7] = lo lo = lo >> 8 buf[offset + 6] = lo lo = lo >> 8 buf[offset + 5] = lo lo = lo >> 8 buf[offset + 4] = lo let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)) buf[offset + 3] = hi hi = hi >> 8 buf[offset + 2] = hi hi = hi >> 8 buf[offset + 1] = hi hi = hi >> 8 buf[offset] = hi return offset + 8 } Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) { return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) }) Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) { return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) }) Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { const limit = Math.pow(2, (8 * byteLength) - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } let i = 0 let mul = 1 let sub = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { const limit = Math.pow(2, (8 * byteLength) - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } let i = byteLength - 1 let mul = 1 let sub = 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (value < 0) value = 0xff + value + 1 this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) return offset + 2 } Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) return offset + 2 } Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) this[offset + 2] = (value >>> 16) this[offset + 3] = (value >>> 24) return offset + 4 } Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (value < 0) value = 0xffffffff + value + 1 this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) return offset + 4 } Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) { return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) }) Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) { return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) }) function checkIEEE754 (buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range') if (offset < 0) throw new RangeError('Index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } ieee754.write(buf, value, offset, littleEndian, 23, 4) return offset + 4 } Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert) } function writeDouble (buf, value, offset, littleEndian, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) } ieee754.write(buf, value, offset, littleEndian, 52, 8) return offset + 8 } Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function copy (target, targetStart, start, end) { if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') if (!start) start = 0 if (!end && end !== 0) end = this.length if (targetStart >= target.length) targetStart = target.length if (!targetStart) targetStart = 0 if (end > 0 && end < start) end = start // Copy 0 bytes; we're done if (end === start) return 0 if (target.length === 0 || this.length === 0) return 0 // Fatal error conditions if (targetStart < 0) { throw new RangeError('targetStart out of bounds') } if (start < 0 || start >= this.length) throw new RangeError('Index out of range') if (end < 0) throw new RangeError('sourceEnd out of bounds') // Are we oob? if (end > this.length) end = this.length if (target.length - targetStart < end - start) { end = target.length - targetStart + start } const len = end - start if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { // Use built-in when available, missing from IE11 this.copyWithin(targetStart, start, end) } else { Uint8Array.prototype.set.call( target, this.subarray(start, end), targetStart ) } return len } // Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill = function fill (val, start, end, encoding) { // Handle string cases: if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = this.length } else if (typeof end === 'string') { encoding = end end = this.length } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } if (val.length === 1) { const code = val.charCodeAt(0) if ((encoding === 'utf8' && code < 128) || encoding === 'latin1') { // Fast path: If `val` fits into a single byte, use that numeric value. val = code } } } else if (typeof val === 'number') { val = val & 255 } else if (typeof val === 'boolean') { val = Number(val) } // Invalid ranges are not set to a default, so can range check early. if (start < 0 || this.length < start || this.length < end) { throw new RangeError('Out of range index') } if (end <= start) { return this } start = start >>> 0 end = end === undefined ? this.length : end >>> 0 if (!val) val = 0 let i if (typeof val === 'number') { for (i = start; i < end; ++i) { this[i] = val } } else { const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding) const len = bytes.length if (len === 0) { throw new TypeError('The value "' + val + '" is invalid for argument "value"') } for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len] } } return this } // CUSTOM ERRORS // ============= // Simplified versions from Node, changed for Buffer-only usage const errors = {} function E (sym, getMessage, Base) { errors[sym] = class NodeError extends Base { constructor () { super() Object.defineProperty(this, 'message', { value: getMessage.apply(this, arguments), writable: true, configurable: true }) // Add the error code to the name to include it in the stack trace. this.name = `${this.name} [${sym}]` // Access the stack to generate the error message including the error code // from the name. this.stack // eslint-disable-line no-unused-expressions // Reset the name to the actual name. delete this.name } get code () { return sym } set code (value) { Object.defineProperty(this, 'code', { configurable: true, enumerable: true, value, writable: true }) } toString () { return `${this.name} [${sym}]: ${this.message}` } } } E('ERR_BUFFER_OUT_OF_BOUNDS', function (name) { if (name) { return `${name} is outside of buffer bounds` } return 'Attempt to access memory outside buffer bounds' }, RangeError) E('ERR_INVALID_ARG_TYPE', function (name, actual) { return `The "${name}" argument must be of type number. Received type ${typeof actual}` }, TypeError) E('ERR_OUT_OF_RANGE', function (str, range, input) { let msg = `The value of "${str}" is out of range.` let received = input if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { received = addNumericalSeparator(String(input)) } else if (typeof input === 'bigint') { received = String(input) if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { received = addNumericalSeparator(received) } received += 'n' } msg += ` It must be ${range}. Received ${received}` return msg }, RangeError) function addNumericalSeparator (val) { let res = '' let i = val.length const start = val[0] === '-' ? 1 : 0 for (; i >= start + 4; i -= 3) { res = `_${val.slice(i - 3, i)}${res}` } return `${val.slice(0, i)}${res}` } // CHECK FUNCTIONS // =============== function checkBounds (buf, offset, byteLength) { validateNumber(offset, 'offset') if (buf[offset] === undefined || buf[offset + byteLength] === undefined) { boundsError(offset, buf.length - (byteLength + 1)) } } function checkIntBI (value, min, max, buf, offset, byteLength) { if (value > max || value < min) { const n = typeof min === 'bigint' ? 'n' : '' let range if (byteLength > 3) { if (min === 0 || min === BigInt(0)) { range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}` } else { range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + `${(byteLength + 1) * 8 - 1}${n}` } } else { range = `>= ${min}${n} and <= ${max}${n}` } throw new errors.ERR_OUT_OF_RANGE('value', range, value) } checkBounds(buf, offset, byteLength) } function validateNumber (value, name) { if (typeof value !== 'number') { throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value) } } function boundsError (value, length, type) { if (Math.floor(value) !== value) { validateNumber(value, type) throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value) } if (length < 0) { throw new errors.ERR_BUFFER_OUT_OF_BOUNDS() } throw new errors.ERR_OUT_OF_RANGE(type || 'offset', `>= ${type ? 1 : 0} and <= ${length}`, value) } // HELPER FUNCTIONS // ================ const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g function base64clean (str) { // Node takes equal signs as end of the Base64 encoding str = str.split('=')[0] // Node strips out invalid characters like \n and \t from the string, base64-js does not str = str.trim().replace(INVALID_BASE64_RE, '') // Node converts strings with length < 2 to '' if (str.length < 2) return '' // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '=' } return str } function utf8ToBytes (string, units) { units = units || Infinity let codePoint const length = string.length let leadSurrogate = null const bytes = [] for (let i = 0; i < length; ++i) { codePoint = string.charCodeAt(i) // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (!leadSurrogate) { // no lead yet if (codePoint > 0xDBFF) { // unexpected trail if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } else if (i + 1 === length) { // unpaired lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // valid lead leadSurrogate = codePoint continue } // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) leadSurrogate = codePoint continue } // valid surrogate pair codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) } leadSurrogate = null // encode utf8 if (codePoint < 0x80) { if ((units -= 1) < 0) break bytes.push(codePoint) } else if (codePoint < 0x800) { if ((units -= 2) < 0) break bytes.push( codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break bytes.push( codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x110000) { if ((units -= 4) < 0) break bytes.push( codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else { throw new Error('Invalid code point') } } return bytes } function asciiToBytes (str) { const byteArray = [] for (let i = 0; i < str.length; ++i) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF) } return byteArray } function utf16leToBytes (str, units) { let c, hi, lo const byteArray = [] for (let i = 0; i < str.length; ++i) { if ((units -= 2) < 0) break c = str.charCodeAt(i) hi = c >> 8 lo = c % 256 byteArray.push(lo) byteArray.push(hi) } return byteArray } function base64ToBytes (str) { return base64.toByteArray(base64clean(str)) } function blitBuffer (src, dst, offset, length) { let i for (i = 0; i < length; ++i) { if ((i + offset >= dst.length) || (i >= src.length)) break dst[i + offset] = src[i] } return i } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass // the `instanceof` check but they should be treated as of that type. // See: https://github.com/feross/buffer/issues/166 function isInstance (obj, type) { return obj instanceof type || (obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name) } function numberIsNaN (obj) { // For IE11 support return obj !== obj // eslint-disable-line no-self-compare } // Create lookup table for `toString('hex')` // See: https://github.com/feross/buffer/issues/219 const hexSliceLookupTable = (function () { const alphabet = '0123456789abcdef' const table = new Array(256) for (let i = 0; i < 16; ++i) { const i16 = i * 16 for (let j = 0; j < 16; ++j) { table[i16 + j] = alphabet[i] + alphabet[j] } } return table })() // Return not function with Error if BigInt not supported function defineBigIntMethod (fn) { return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn } function BufferBigIntNotDefined () { throw new Error('BigInt not supported') } /***/ }), /***/ "./node_modules/core-js/internals/a-callable.js": /*!******************************************************!*\ !*** ./node_modules/core-js/internals/a-callable.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var tryToString = __webpack_require__(/*! ../internals/try-to-string */ "./node_modules/core-js/internals/try-to-string.js"); var $TypeError = TypeError; // `Assert: IsCallable(argument) is true` module.exports = function (argument) { if (isCallable(argument)) return argument; throw new $TypeError(tryToString(argument) + ' is not a function'); }; /***/ }), /***/ "./node_modules/core-js/internals/a-possible-prototype.js": /*!****************************************************************!*\ !*** ./node_modules/core-js/internals/a-possible-prototype.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var $String = String; var $TypeError = TypeError; module.exports = function (argument) { if (typeof argument == 'object' || isCallable(argument)) return argument; throw new $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; /***/ }), /***/ "./node_modules/core-js/internals/add-to-unscopables.js": /*!**************************************************************!*\ !*** ./node_modules/core-js/internals/add-to-unscopables.js ***! \**************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js"); var defineProperty = (__webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f); var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] === undefined) { defineProperty(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }); } // add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; /***/ }), /***/ "./node_modules/core-js/internals/an-object.js": /*!*****************************************************!*\ !*** ./node_modules/core-js/internals/an-object.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js"); var $String = String; var $TypeError = TypeError; // `Assert: Type(argument) is Object` module.exports = function (argument) { if (isObject(argument)) return argument; throw new $TypeError($String(argument) + ' is not an object'); }; /***/ }), /***/ "./node_modules/core-js/internals/array-includes.js": /*!**********************************************************!*\ !*** ./node_modules/core-js/internals/array-includes.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js"); var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js"); var lengthOfArrayLike = __webpack_require__(/*! ../internals/length-of-array-like */ "./node_modules/core-js/internals/length-of-array-like.js"); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(O); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el !== el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check if (value !== value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; /***/ }), /***/ "./node_modules/core-js/internals/classof-raw.js": /*!*******************************************************!*\ !*** ./node_modules/core-js/internals/classof-raw.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); module.exports = function (it) { return stringSlice(toString(it), 8, -1); }; /***/ }), /***/ "./node_modules/core-js/internals/classof.js": /*!***************************************************!*\ !*** ./node_modules/core-js/internals/classof.js ***! \***************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var classofRaw = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js"); var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Object = Object; // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result; }; /***/ }), /***/ "./node_modules/core-js/internals/copy-constructor-properties.js": /*!***********************************************************************!*\ !*** ./node_modules/core-js/internals/copy-constructor-properties.js ***! \***********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var ownKeys = __webpack_require__(/*! ../internals/own-keys */ "./node_modules/core-js/internals/own-keys.js"); var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js"); var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js"); module.exports = function (target, source, exceptions) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) { defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } }; /***/ }), /***/ "./node_modules/core-js/internals/correct-prototype-getter.js": /*!********************************************************************!*\ !*** ./node_modules/core-js/internals/correct-prototype-getter.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); module.exports = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype; }); /***/ }), /***/ "./node_modules/core-js/internals/create-iter-result-object.js": /*!*********************************************************************!*\ !*** ./node_modules/core-js/internals/create-iter-result-object.js ***! \*********************************************************************/ /***/ ((module) => { "use strict"; // `CreateIterResultObject` abstract operation // https://tc39.es/ecma262/#sec-createiterresultobject module.exports = function (value, done) { return { value: value, done: done }; }; /***/ }), /***/ "./node_modules/core-js/internals/create-non-enumerable-property.js": /*!**************************************************************************!*\ !*** ./node_modules/core-js/internals/create-non-enumerable-property.js ***! \**************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js"); var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js"); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /***/ "./node_modules/core-js/internals/create-property-descriptor.js": /*!**********************************************************************!*\ !*** ./node_modules/core-js/internals/create-property-descriptor.js ***! \**********************************************************************/ /***/ ((module) => { "use strict"; module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /***/ "./node_modules/core-js/internals/define-built-in-accessor.js": /*!********************************************************************!*\ !*** ./node_modules/core-js/internals/define-built-in-accessor.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var makeBuiltIn = __webpack_require__(/*! ../internals/make-built-in */ "./node_modules/core-js/internals/make-built-in.js"); var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js"); module.exports = function (target, name, descriptor) { if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); return defineProperty.f(target, name, descriptor); }; /***/ }), /***/ "./node_modules/core-js/internals/define-built-in.js": /*!***********************************************************!*\ !*** ./node_modules/core-js/internals/define-built-in.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js"); var makeBuiltIn = __webpack_require__(/*! ../internals/make-built-in */ "./node_modules/core-js/internals/make-built-in.js"); var defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ "./node_modules/core-js/internals/define-global-property.js"); module.exports = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; if (isCallable(value)) makeBuiltIn(value, name, options); if (options.global) { if (simple) O[key] = value; else defineGlobalProperty(key, value); } else { try { if (!options.unsafe) delete O[key]; else if (O[key]) simple = true; } catch (error) { /* empty */ } if (simple) O[key] = value; else definePropertyModule.f(O, key, { value: value, enumerable: false, configurable: !options.nonConfigurable, writable: !options.nonWritable }); } return O; }; /***/ }), /***/ "./node_modules/core-js/internals/define-global-property.js": /*!******************************************************************!*\ !*** ./node_modules/core-js/internals/define-global-property.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; module.exports = function (key, value) { try { defineProperty(global, key, { value: value, configurable: true, writable: true }); } catch (error) { global[key] = value; } return value; }; /***/ }), /***/ "./node_modules/core-js/internals/descriptors.js": /*!*******************************************************!*\ !*** ./node_modules/core-js/internals/descriptors.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); // Detect IE8's incomplete defineProperty implementation module.exports = !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); /***/ }), /***/ "./node_modules/core-js/internals/document-all.js": /*!********************************************************!*\ !*** ./node_modules/core-js/internals/document-all.js ***! \********************************************************/ /***/ ((module) => { "use strict"; var documentAll = typeof document == 'object' && document.all; // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined; module.exports = { all: documentAll, IS_HTMLDDA: IS_HTMLDDA }; /***/ }), /***/ "./node_modules/core-js/internals/document-create-element.js": /*!*******************************************************************!*\ !*** ./node_modules/core-js/internals/document-create-element.js ***! \*******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js"); var document = global.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; /***/ }), /***/ "./node_modules/core-js/internals/dom-iterables.js": /*!*********************************************************!*\ !*** ./node_modules/core-js/internals/dom-iterables.js ***! \*********************************************************/ /***/ ((module) => { "use strict"; // iterable DOM collections // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods module.exports = { CSSRuleList: 0, CSSStyleDeclaration: 0, CSSValueList: 0, ClientRectList: 0, DOMRectList: 0, DOMStringList: 0, DOMTokenList: 1, DataTransferItemList: 0, FileList: 0, HTMLAllCollection: 0, HTMLCollection: 0, HTMLFormElement: 0, HTMLSelectElement: 0, MediaList: 0, MimeTypeArray: 0, NamedNodeMap: 0, NodeList: 1, PaintRequestList: 0, Plugin: 0, PluginArray: 0, SVGLengthList: 0, SVGNumberList: 0, SVGPathSegList: 0, SVGPointList: 0, SVGStringList: 0, SVGTransformList: 0, SourceBufferList: 0, StyleSheetList: 0, TextTrackCueList: 0, TextTrackList: 0, TouchList: 0 }; /***/ }), /***/ "./node_modules/core-js/internals/dom-token-list-prototype.js": /*!********************************************************************!*\ !*** ./node_modules/core-js/internals/dom-token-list-prototype.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList` var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js"); var classList = documentCreateElement('span').classList; var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype; module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype; /***/ }), /***/ "./node_modules/core-js/internals/engine-user-agent.js": /*!*************************************************************!*\ !*** ./node_modules/core-js/internals/engine-user-agent.js ***! \*************************************************************/ /***/ ((module) => { "use strict"; module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; /***/ }), /***/ "./node_modules/core-js/internals/engine-v8-version.js": /*!*************************************************************!*\ !*** ./node_modules/core-js/internals/engine-v8-version.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/core-js/internals/engine-user-agent.js"); var process = global.process; var Deno = global.Deno; var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10 // but their correct versions are not interesting for us version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` // so check `userAgent` even if `.v8` exists, but 0 if (!version && userAgent) { match = userAgent.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent.match(/Chrome\/(\d+)/); if (match) version = +match[1]; } } module.exports = version; /***/ }), /***/ "./node_modules/core-js/internals/enum-bug-keys.js": /*!*********************************************************!*\ !*** ./node_modules/core-js/internals/enum-bug-keys.js ***! \*********************************************************/ /***/ ((module) => { "use strict"; // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; /***/ }), /***/ "./node_modules/core-js/internals/export.js": /*!**************************************************!*\ !*** ./node_modules/core-js/internals/export.js ***! \**************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var getOwnPropertyDescriptor = (__webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js").f); var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js"); var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "./node_modules/core-js/internals/define-built-in.js"); var defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ "./node_modules/core-js/internals/define-global-property.js"); var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/core-js/internals/copy-constructor-properties.js"); var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js"); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.dontCallGetSet - prevent calling a getter on target options.name - the .name of the function if it does not match the key */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } defineBuiltIn(target, key, sourceProperty, options); } }; /***/ }), /***/ "./node_modules/core-js/internals/fails.js": /*!*************************************************!*\ !*** ./node_modules/core-js/internals/fails.js ***! \*************************************************/ /***/ ((module) => { "use strict"; module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; /***/ }), /***/ "./node_modules/core-js/internals/function-bind-native.js": /*!****************************************************************!*\ !*** ./node_modules/core-js/internals/function-bind-native.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); module.exports = !fails(function () { // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe return typeof test != 'function' || test.hasOwnProperty('prototype'); }); /***/ }), /***/ "./node_modules/core-js/internals/function-call.js": /*!*********************************************************!*\ !*** ./node_modules/core-js/internals/function-call.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ "./node_modules/core-js/internals/function-bind-native.js"); var call = Function.prototype.call; module.exports = NATIVE_BIND ? call.bind(call) : function () { return call.apply(call, arguments); }; /***/ }), /***/ "./node_modules/core-js/internals/function-name.js": /*!*********************************************************!*\ !*** ./node_modules/core-js/internals/function-name.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var FunctionPrototype = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn(FunctionPrototype, 'name'); // additional protection from minified / mangled / dropped function names var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable)); module.exports = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; /***/ }), /***/ "./node_modules/core-js/internals/function-uncurry-this-accessor.js": /*!**************************************************************************!*\ !*** ./node_modules/core-js/internals/function-uncurry-this-accessor.js ***! \**************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var aCallable = __webpack_require__(/*! ../internals/a-callable */ "./node_modules/core-js/internals/a-callable.js"); module.exports = function (object, key, method) { try { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { /* empty */ } }; /***/ }), /***/ "./node_modules/core-js/internals/function-uncurry-this.js": /*!*****************************************************************!*\ !*** ./node_modules/core-js/internals/function-uncurry-this.js ***! \*****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ "./node_modules/core-js/internals/function-bind-native.js"); var FunctionPrototype = Function.prototype; var call = FunctionPrototype.call; var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) { return function () { return call.apply(fn, arguments); }; }; /***/ }), /***/ "./node_modules/core-js/internals/get-built-in.js": /*!********************************************************!*\ !*** ./node_modules/core-js/internals/get-built-in.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var aFunction = function (argument) { return isCallable(argument) ? argument : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method]; }; /***/ }), /***/ "./node_modules/core-js/internals/get-method.js": /*!******************************************************!*\ !*** ./node_modules/core-js/internals/get-method.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var aCallable = __webpack_require__(/*! ../internals/a-callable */ "./node_modules/core-js/internals/a-callable.js"); var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "./node_modules/core-js/internals/is-null-or-undefined.js"); // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod module.exports = function (V, P) { var func = V[P]; return isNullOrUndefined(func) ? undefined : aCallable(func); }; /***/ }), /***/ "./node_modules/core-js/internals/global.js": /*!**************************************************!*\ !*** ./node_modules/core-js/internals/global.js ***! \**************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var check = function (it) { return it && it.Math === Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe check(typeof self == 'object' && self) || check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || this || Function('return this')(); /***/ }), /***/ "./node_modules/core-js/internals/has-own-property.js": /*!************************************************************!*\ !*** ./node_modules/core-js/internals/has-own-property.js ***! \************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js"); var hasOwnProperty = uncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty // eslint-disable-next-line es/no-object-hasown -- safe module.exports = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject(it), key); }; /***/ }), /***/ "./node_modules/core-js/internals/hidden-keys.js": /*!*******************************************************!*\ !*** ./node_modules/core-js/internals/hidden-keys.js ***! \*******************************************************/ /***/ ((module) => { "use strict"; module.exports = {}; /***/ }), /***/ "./node_modules/core-js/internals/html.js": /*!************************************************!*\ !*** ./node_modules/core-js/internals/html.js ***! \************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js"); module.exports = getBuiltIn('document', 'documentElement'); /***/ }), /***/ "./node_modules/core-js/internals/ie8-dom-define.js": /*!**********************************************************!*\ !*** ./node_modules/core-js/internals/ie8-dom-define.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); var createElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js"); // Thanks to IE8 for its funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a !== 7; }); /***/ }), /***/ "./node_modules/core-js/internals/indexed-object.js": /*!**********************************************************!*\ !*** ./node_modules/core-js/internals/indexed-object.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js"); var $Object = Object; var split = uncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !$Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) === 'String' ? split(it, '') : $Object(it); } : $Object; /***/ }), /***/ "./node_modules/core-js/internals/inspect-source.js": /*!**********************************************************!*\ !*** ./node_modules/core-js/internals/inspect-source.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js"); var functionToString = uncurryThis(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable(store.inspectSource)) { store.inspectSource = function (it) { return functionToString(it); }; } module.exports = store.inspectSource; /***/ }), /***/ "./node_modules/core-js/internals/internal-state.js": /*!**********************************************************!*\ !*** ./node_modules/core-js/internals/internal-state.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var NATIVE_WEAK_MAP = __webpack_require__(/*! ../internals/weak-map-basic-detection */ "./node_modules/core-js/internals/weak-map-basic-detection.js"); var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js"); var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js"); var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var shared = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js"); var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js"); var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js"); var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError = global.TypeError; var WeakMap = global.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw new TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP || shared.state) { var store = shared.state || (shared.state = new WeakMap()); /* eslint-disable no-self-assign -- prototype methods protection */ store.get = store.get; store.has = store.has; store.set = store.set; /* eslint-enable no-self-assign -- prototype methods protection */ set = function (it, metadata) { if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store.set(it, metadata); return metadata; }; get = function (it) { return store.get(it) || {}; }; has = function (it) { return store.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function (it) { return hasOwn(it, STATE) ? it[STATE] : {}; }; has = function (it) { return hasOwn(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; /***/ }), /***/ "./node_modules/core-js/internals/is-callable.js": /*!*******************************************************!*\ !*** ./node_modules/core-js/internals/is-callable.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $documentAll = __webpack_require__(/*! ../internals/document-all */ "./node_modules/core-js/internals/document-all.js"); var documentAll = $documentAll.all; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable module.exports = $documentAll.IS_HTMLDDA ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; /***/ }), /***/ "./node_modules/core-js/internals/is-forced.js": /*!*****************************************************!*\ !*** ./node_modules/core-js/internals/is-forced.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; /***/ }), /***/ "./node_modules/core-js/internals/is-null-or-undefined.js": /*!****************************************************************!*\ !*** ./node_modules/core-js/internals/is-null-or-undefined.js ***! \****************************************************************/ /***/ ((module) => { "use strict"; // we can't use just `it == null` since of `document.all` special case // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec module.exports = function (it) { return it === null || it === undefined; }; /***/ }), /***/ "./node_modules/core-js/internals/is-object.js": /*!*****************************************************!*\ !*** ./node_modules/core-js/internals/is-object.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var $documentAll = __webpack_require__(/*! ../internals/document-all */ "./node_modules/core-js/internals/document-all.js"); var documentAll = $documentAll.all; module.exports = $documentAll.IS_HTMLDDA ? function (it) { return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll; } : function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; /***/ }), /***/ "./node_modules/core-js/internals/is-pure.js": /*!***************************************************!*\ !*** ./node_modules/core-js/internals/is-pure.js ***! \***************************************************/ /***/ ((module) => { "use strict"; module.exports = false; /***/ }), /***/ "./node_modules/core-js/internals/is-symbol.js": /*!*****************************************************!*\ !*** ./node_modules/core-js/internals/is-symbol.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ "./node_modules/core-js/internals/object-is-prototype-of.js"); var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/core-js/internals/use-symbol-as-uid.js"); var $Object = Object; module.exports = USE_SYMBOL_AS_UID ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; /***/ }), /***/ "./node_modules/core-js/internals/iterator-create-constructor.js": /*!***********************************************************************!*\ !*** ./node_modules/core-js/internals/iterator-create-constructor.js ***! \***********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var IteratorPrototype = (__webpack_require__(/*! ../internals/iterators-core */ "./node_modules/core-js/internals/iterators-core.js").IteratorPrototype); var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js"); var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js"); var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js"); var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js"); var returnThis = function () { return this; }; module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); Iterators[TO_STRING_TAG] = returnThis; return IteratorConstructor; }; /***/ }), /***/ "./node_modules/core-js/internals/iterator-define.js": /*!***********************************************************!*\ !*** ./node_modules/core-js/internals/iterator-define.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js"); var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js"); var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js"); var FunctionName = __webpack_require__(/*! ../internals/function-name */ "./node_modules/core-js/internals/function-name.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var createIteratorConstructor = __webpack_require__(/*! ../internals/iterator-create-constructor */ "./node_modules/core-js/internals/iterator-create-constructor.js"); var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js"); var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js"); var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "./node_modules/core-js/internals/set-to-string-tag.js"); var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js"); var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "./node_modules/core-js/internals/define-built-in.js"); var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js"); var IteratorsCore = __webpack_require__(/*! ../internals/iterators-core */ "./node_modules/core-js/internals/iterators-core.js"); var PROPER_FUNCTION_NAME = FunctionName.PROPER; var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; var IteratorPrototype = IteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR = wellKnownSymbol('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis = function () { return this; }; module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND]; switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } return function () { return new IteratorConstructor(this); }; }; var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; var CurrentIteratorPrototype, methods, KEY; // fix native if (anyNativeIterator) { CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { if (setPrototypeOf) { setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) { defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis); } } // Set @@toStringTag to native iterators setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; } } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) { if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty(IterablePrototype, 'name', VALUES); } else { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return call(nativeIterator, this); }; } } // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) }; if (FORCED) for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { defineBuiltIn(IterablePrototype, KEY, methods[KEY]); } } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } // define iterator if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); } Iterators[NAME] = defaultIterator; return methods; }; /***/ }), /***/ "./node_modules/core-js/internals/iterators-core.js": /*!**********************************************************!*\ !*** ./node_modules/core-js/internals/iterators-core.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js"); var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js"); var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "./node_modules/core-js/internals/object-get-prototype-of.js"); var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "./node_modules/core-js/internals/define-built-in.js"); var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js"); var ITERATOR = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS = false; // `%IteratorPrototype%` object // https://tc39.es/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; /* eslint-disable es/no-array-prototype-keys -- safe */ if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; else { PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype[ITERATOR].call(test) !== test; }); if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); // `%IteratorPrototype%[@@iterator]()` method // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator if (!isCallable(IteratorPrototype[ITERATOR])) { defineBuiltIn(IteratorPrototype, ITERATOR, function () { return this; }); } module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; /***/ }), /***/ "./node_modules/core-js/internals/iterators.js": /*!*****************************************************!*\ !*** ./node_modules/core-js/internals/iterators.js ***! \*****************************************************/ /***/ ((module) => { "use strict"; module.exports = {}; /***/ }), /***/ "./node_modules/core-js/internals/length-of-array-like.js": /*!****************************************************************!*\ !*** ./node_modules/core-js/internals/length-of-array-like.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js"); // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike module.exports = function (obj) { return toLength(obj.length); }; /***/ }), /***/ "./node_modules/core-js/internals/make-built-in.js": /*!*********************************************************!*\ !*** ./node_modules/core-js/internals/make-built-in.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(/*! ../internals/function-name */ "./node_modules/core-js/internals/function-name.js").CONFIGURABLE); var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js"); var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js"); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var $String = String; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; var stringSlice = uncurryThis(''.slice); var replace = uncurryThis(''.replace); var join = uncurryThis([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); var makeBuiltIn = module.exports = function (value, name, options) { if (stringSlice($String(name), 0, 7) === 'Symbol(') { name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); else value.name = name; } if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { defineProperty(value, 'length', { value: options.arity }); } try { if (options && hasOwn(options, 'constructor') && options.constructor) { if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false }); // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable } else if (value.prototype) value.prototype = undefined; } catch (error) { /* empty */ } var state = enforceInternalState(value); if (!hasOwn(state, 'source')) { state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); } return value; }; // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative // eslint-disable-next-line no-extend-native -- required Function.prototype.toString = makeBuiltIn(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); /***/ }), /***/ "./node_modules/core-js/internals/math-trunc.js": /*!******************************************************!*\ !*** ./node_modules/core-js/internals/math-trunc.js ***! \******************************************************/ /***/ ((module) => { "use strict"; var ceil = Math.ceil; var floor = Math.floor; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc // eslint-disable-next-line es/no-math-trunc -- safe module.exports = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor : ceil)(n); }; /***/ }), /***/ "./node_modules/core-js/internals/object-assign.js": /*!*********************************************************!*\ !*** ./node_modules/core-js/internals/object-assign.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js"); var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js"); var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js"); var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js"); var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js"); var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js"); // eslint-disable-next-line es/no-object-assign -- safe var $assign = Object.assign; // eslint-disable-next-line es/no-object-defineproperty -- required for testing var defineProperty = Object.defineProperty; var concat = uncurryThis([].concat); // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign module.exports = !$assign || fails(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', { enumerable: true, get: function () { defineProperty(this, 'b', { value: 3, enumerable: false }); } }), { b: 2 })).b !== 1) return true; // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; // eslint-disable-next-line es/no-symbol -- safe var symbol = Symbol('assign detection'); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` var T = toObject(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; var propertyIsEnumerable = propertyIsEnumerableModule.f; while (argumentsLength > index) { var S = IndexedObject(arguments[index++]); var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key]; } } return T; } : $assign; /***/ }), /***/ "./node_modules/core-js/internals/object-create.js": /*!*********************************************************!*\ !*** ./node_modules/core-js/internals/object-create.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* global ActiveXObject -- old IE, WSH */ var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); var definePropertiesModule = __webpack_require__(/*! ../internals/object-define-properties */ "./node_modules/core-js/internals/object-define-properties.js"); var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js"); var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js"); var html = __webpack_require__(/*! ../internals/html */ "./node_modules/core-js/internals/html.js"); var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js"); var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js"); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; // avoid memory leak return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create // eslint-disable-next-line es/no-object-create -- safe module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; /***/ }), /***/ "./node_modules/core-js/internals/object-define-properties.js": /*!********************************************************************!*\ !*** ./node_modules/core-js/internals/object-define-properties.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ "./node_modules/core-js/internals/v8-prototype-define-bug.js"); var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js"); var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js"); var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js"); // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var props = toIndexedObject(Properties); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]); return O; }; /***/ }), /***/ "./node_modules/core-js/internals/object-define-property.js": /*!******************************************************************!*\ !*** ./node_modules/core-js/internals/object-define-property.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js"); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ "./node_modules/core-js/internals/v8-prototype-define-bug.js"); var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); var toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ "./node_modules/core-js/internals/to-property-key.js"); var $TypeError = TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE = 'configurable'; var WRITABLE = 'writable'; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor(O, P); if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], writable: false }; } } return $defineProperty(O, P, Attributes); } : $defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /***/ "./node_modules/core-js/internals/object-get-own-property-descriptor.js": /*!******************************************************************************!*\ !*** ./node_modules/core-js/internals/object-get-own-property-descriptor.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js"); var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js"); var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js"); var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js"); var toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ "./node_modules/core-js/internals/to-property-key.js"); var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js"); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPropertyKey(P); if (IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); }; /***/ }), /***/ "./node_modules/core-js/internals/object-get-own-property-names.js": /*!*************************************************************************!*\ !*** ./node_modules/core-js/internals/object-get-own-property-names.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js"); var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js"); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames // eslint-disable-next-line es/no-object-getownpropertynames -- safe exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; /***/ }), /***/ "./node_modules/core-js/internals/object-get-own-property-symbols.js": /*!***************************************************************************!*\ !*** ./node_modules/core-js/internals/object-get-own-property-symbols.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe exports.f = Object.getOwnPropertySymbols; /***/ }), /***/ "./node_modules/core-js/internals/object-get-prototype-of.js": /*!*******************************************************************!*\ !*** ./node_modules/core-js/internals/object-get-prototype-of.js ***! \*******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js"); var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js"); var CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ "./node_modules/core-js/internals/correct-prototype-getter.js"); var IE_PROTO = sharedKey('IE_PROTO'); var $Object = Object; var ObjectPrototype = $Object.prototype; // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof // eslint-disable-next-line es/no-object-getprototypeof -- safe module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { var object = toObject(O); if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable(constructor) && object instanceof constructor) { return constructor.prototype; } return object instanceof $Object ? ObjectPrototype : null; }; /***/ }), /***/ "./node_modules/core-js/internals/object-is-prototype-of.js": /*!******************************************************************!*\ !*** ./node_modules/core-js/internals/object-is-prototype-of.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); module.exports = uncurryThis({}.isPrototypeOf); /***/ }), /***/ "./node_modules/core-js/internals/object-keys-internal.js": /*!****************************************************************!*\ !*** ./node_modules/core-js/internals/object-keys-internal.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js"); var indexOf = (__webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").indexOf); var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js"); var push = uncurryThis([].push); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); // Don't enum bug & hidden keys while (names.length > i) if (hasOwn(O, key = names[i++])) { ~indexOf(result, key) || push(result, key); } return result; }; /***/ }), /***/ "./node_modules/core-js/internals/object-keys.js": /*!*******************************************************!*\ !*** ./node_modules/core-js/internals/object-keys.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js"); var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js"); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; /***/ }), /***/ "./node_modules/core-js/internals/object-property-is-enumerable.js": /*!*************************************************************************!*\ !*** ./node_modules/core-js/internals/object-property-is-enumerable.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; /***/ }), /***/ "./node_modules/core-js/internals/object-set-prototype-of.js": /*!*******************************************************************!*\ !*** ./node_modules/core-js/internals/object-set-prototype-of.js ***! \*******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint-disable no-proto -- safe */ var uncurryThisAccessor = __webpack_require__(/*! ../internals/function-uncurry-this-accessor */ "./node_modules/core-js/internals/function-uncurry-this-accessor.js"); var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); var aPossiblePrototype = __webpack_require__(/*! ../internals/a-possible-prototype */ "./node_modules/core-js/internals/a-possible-prototype.js"); // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. // eslint-disable-next-line es/no-object-setprototypeof -- safe module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); /***/ }), /***/ "./node_modules/core-js/internals/ordinary-to-primitive.js": /*!*****************************************************************!*\ !*** ./node_modules/core-js/internals/ordinary-to-primitive.js ***! \*****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js"); var $TypeError = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive module.exports = function (input, pref) { var fn, val; if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val; if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; throw new $TypeError("Can't convert object to primitive value"); }; /***/ }), /***/ "./node_modules/core-js/internals/own-keys.js": /*!****************************************************!*\ !*** ./node_modules/core-js/internals/own-keys.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js"); var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js"); var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js"); var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); var concat = uncurryThis([].concat); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; }; /***/ }), /***/ "./node_modules/core-js/internals/regexp-flags.js": /*!********************************************************!*\ !*** ./node_modules/core-js/internals/regexp-flags.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); // `RegExp.prototype.flags` getter implementation // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags module.exports = function () { var that = anObject(this); var result = ''; if (that.hasIndices) result += 'd'; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.dotAll) result += 's'; if (that.unicode) result += 'u'; if (that.unicodeSets) result += 'v'; if (that.sticky) result += 'y'; return result; }; /***/ }), /***/ "./node_modules/core-js/internals/regexp-get-flags.js": /*!************************************************************!*\ !*** ./node_modules/core-js/internals/regexp-get-flags.js ***! \************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js"); var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ "./node_modules/core-js/internals/object-is-prototype-of.js"); var regExpFlags = __webpack_require__(/*! ../internals/regexp-flags */ "./node_modules/core-js/internals/regexp-flags.js"); var RegExpPrototype = RegExp.prototype; module.exports = function (R) { var flags = R.flags; return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags; }; /***/ }), /***/ "./node_modules/core-js/internals/require-object-coercible.js": /*!********************************************************************!*\ !*** ./node_modules/core-js/internals/require-object-coercible.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "./node_modules/core-js/internals/is-null-or-undefined.js"); var $TypeError = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it); return it; }; /***/ }), /***/ "./node_modules/core-js/internals/set-to-string-tag.js": /*!*************************************************************!*\ !*** ./node_modules/core-js/internals/set-to-string-tag.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var defineProperty = (__webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f); var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); module.exports = function (target, TAG, STATIC) { if (target && !STATIC) target = target.prototype; if (target && !hasOwn(target, TO_STRING_TAG)) { defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG }); } }; /***/ }), /***/ "./node_modules/core-js/internals/shared-key.js": /*!******************************************************!*\ !*** ./node_modules/core-js/internals/shared-key.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js"); var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js"); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; /***/ }), /***/ "./node_modules/core-js/internals/shared-store.js": /*!********************************************************!*\ !*** ./node_modules/core-js/internals/shared-store.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ "./node_modules/core-js/internals/define-global-property.js"); var SHARED = '__core-js_shared__'; var store = global[SHARED] || defineGlobalProperty(SHARED, {}); module.exports = store; /***/ }), /***/ "./node_modules/core-js/internals/shared.js": /*!**************************************************!*\ !*** ./node_modules/core-js/internals/shared.js ***! \**************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js"); var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js"); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.33.2', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE', source: 'https://github.com/zloirock/core-js' }); /***/ }), /***/ "./node_modules/core-js/internals/symbol-constructor-detection.js": /*!************************************************************************!*\ !*** ./node_modules/core-js/internals/symbol-constructor-detection.js ***! \************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/core-js/internals/engine-v8-version.js"); var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var $String = global.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing module.exports = !!Object.getOwnPropertySymbols && !fails(function () { var symbol = Symbol('symbol detection'); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, // of course, fail. return !$String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); /***/ }), /***/ "./node_modules/core-js/internals/to-absolute-index.js": /*!*************************************************************!*\ !*** ./node_modules/core-js/internals/to-absolute-index.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "./node_modules/core-js/internals/to-integer-or-infinity.js"); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), /***/ "./node_modules/core-js/internals/to-indexed-object.js": /*!*************************************************************!*\ !*** ./node_modules/core-js/internals/to-indexed-object.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js"); var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js"); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; /***/ }), /***/ "./node_modules/core-js/internals/to-integer-or-infinity.js": /*!******************************************************************!*\ !*** ./node_modules/core-js/internals/to-integer-or-infinity.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var trunc = __webpack_require__(/*! ../internals/math-trunc */ "./node_modules/core-js/internals/math-trunc.js"); // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity module.exports = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check return number !== number || number === 0 ? 0 : trunc(number); }; /***/ }), /***/ "./node_modules/core-js/internals/to-length.js": /*!*****************************************************!*\ !*** ./node_modules/core-js/internals/to-length.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "./node_modules/core-js/internals/to-integer-or-infinity.js"); var min = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength module.exports = function (argument) { return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; /***/ }), /***/ "./node_modules/core-js/internals/to-object.js": /*!*****************************************************!*\ !*** ./node_modules/core-js/internals/to-object.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js"); var $Object = Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject module.exports = function (argument) { return $Object(requireObjectCoercible(argument)); }; /***/ }), /***/ "./node_modules/core-js/internals/to-primitive.js": /*!********************************************************!*\ !*** ./node_modules/core-js/internals/to-primitive.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js"); var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js"); var isSymbol = __webpack_require__(/*! ../internals/is-symbol */ "./node_modules/core-js/internals/is-symbol.js"); var getMethod = __webpack_require__(/*! ../internals/get-method */ "./node_modules/core-js/internals/get-method.js"); var ordinaryToPrimitive = __webpack_require__(/*! ../internals/ordinary-to-primitive */ "./node_modules/core-js/internals/ordinary-to-primitive.js"); var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); var $TypeError = TypeError; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive module.exports = function (input, pref) { if (!isObject(input) || isSymbol(input)) return input; var exoticToPrim = getMethod(input, TO_PRIMITIVE); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call(exoticToPrim, input, pref); if (!isObject(result) || isSymbol(result)) return result; throw new $TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; /***/ }), /***/ "./node_modules/core-js/internals/to-property-key.js": /*!***********************************************************!*\ !*** ./node_modules/core-js/internals/to-property-key.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js"); var isSymbol = __webpack_require__(/*! ../internals/is-symbol */ "./node_modules/core-js/internals/is-symbol.js"); // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey module.exports = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; }; /***/ }), /***/ "./node_modules/core-js/internals/to-string-tag-support.js": /*!*****************************************************************!*\ !*** ./node_modules/core-js/internals/to-string-tag-support.js ***! \*****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; /***/ }), /***/ "./node_modules/core-js/internals/to-string.js": /*!*****************************************************!*\ !*** ./node_modules/core-js/internals/to-string.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js"); var $String = String; module.exports = function (argument) { if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; /***/ }), /***/ "./node_modules/core-js/internals/try-to-string.js": /*!*********************************************************!*\ !*** ./node_modules/core-js/internals/try-to-string.js ***! \*********************************************************/ /***/ ((module) => { "use strict"; var $String = String; module.exports = function (argument) { try { return $String(argument); } catch (error) { return 'Object'; } }; /***/ }), /***/ "./node_modules/core-js/internals/uid.js": /*!***********************************************!*\ !*** ./node_modules/core-js/internals/uid.js ***! \***********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var id = 0; var postfix = Math.random(); var toString = uncurryThis(1.0.toString); module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; /***/ }), /***/ "./node_modules/core-js/internals/use-symbol-as-uid.js": /*!*************************************************************!*\ !*** ./node_modules/core-js/internals/use-symbol-as-uid.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ "./node_modules/core-js/internals/symbol-constructor-detection.js"); module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; /***/ }), /***/ "./node_modules/core-js/internals/v8-prototype-define-bug.js": /*!*******************************************************************!*\ !*** ./node_modules/core-js/internals/v8-prototype-define-bug.js ***! \*******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 module.exports = DESCRIPTORS && fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, writable: false }).prototype !== 42; }); /***/ }), /***/ "./node_modules/core-js/internals/weak-map-basic-detection.js": /*!********************************************************************!*\ !*** ./node_modules/core-js/internals/weak-map-basic-detection.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var WeakMap = global.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); /***/ }), /***/ "./node_modules/core-js/internals/well-known-symbol.js": /*!*************************************************************!*\ !*** ./node_modules/core-js/internals/well-known-symbol.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js"); var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js"); var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ "./node_modules/core-js/internals/symbol-constructor-detection.js"); var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/core-js/internals/use-symbol-as-uid.js"); var Symbol = global.Symbol; var WellKnownSymbolsStore = shared('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!hasOwn(WellKnownSymbolsStore, name)) { WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) ? Symbol[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; /***/ }), /***/ "./node_modules/core-js/modules/es.array.iterator.js": /*!***********************************************************!*\ !*** ./node_modules/core-js/modules/es.array.iterator.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js"); var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "./node_modules/core-js/internals/add-to-unscopables.js"); var Iterators = __webpack_require__(/*! ../internals/iterators */ "./node_modules/core-js/internals/iterators.js"); var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js"); var defineProperty = (__webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f); var defineIterator = __webpack_require__(/*! ../internals/iterator-define */ "./node_modules/core-js/internals/iterator-define.js"); var createIterResultObject = __webpack_require__(/*! ../internals/create-iter-result-object */ "./node_modules/core-js/internals/create-iter-result-object.js"); var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js"); var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method // https://tc39.es/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.es/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.es/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.es/ecma262/#sec-createarrayiterator module.exports = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState(this); var target = state.target; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return createIterResultObject(undefined, true); } switch (state.kind) { case 'keys': return createIterResultObject(index, false); case 'values': return createIterResultObject(target[index], false); } return createIterResultObject([index, target[index]], false); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.es/ecma262/#sec-createunmappedargumentsobject // https://tc39.es/ecma262/#sec-createmappedargumentsobject var values = Iterators.Arguments = Iterators.Array; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); // V8 ~ Chrome 45- bug if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try { defineProperty(values, 'name', { value: 'values' }); } catch (error) { /* empty */ } /***/ }), /***/ "./node_modules/core-js/modules/es.object.assign.js": /*!**********************************************************!*\ !*** ./node_modules/core-js/modules/es.object.assign.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js"); var assign = __webpack_require__(/*! ../internals/object-assign */ "./node_modules/core-js/internals/object-assign.js"); // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign // eslint-disable-next-line es/no-object-assign -- required for testing $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, { assign: assign }); /***/ }), /***/ "./node_modules/core-js/modules/es.regexp.to-string.js": /*!*************************************************************!*\ !*** ./node_modules/core-js/modules/es.regexp.to-string.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var PROPER_FUNCTION_NAME = (__webpack_require__(/*! ../internals/function-name */ "./node_modules/core-js/internals/function-name.js").PROPER); var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "./node_modules/core-js/internals/define-built-in.js"); var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); var $toString = __webpack_require__(/*! ../internals/to-string */ "./node_modules/core-js/internals/to-string.js"); var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); var getRegExpFlags = __webpack_require__(/*! ../internals/regexp-get-flags */ "./node_modules/core-js/internals/regexp-get-flags.js"); var TO_STRING = 'toString'; var RegExpPrototype = RegExp.prototype; var nativeToString = RegExpPrototype[TO_STRING]; var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; }); // FF44- RegExp#toString has a wrong name var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING; // `RegExp.prototype.toString` method // https://tc39.es/ecma262/#sec-regexp.prototype.tostring if (NOT_GENERIC || INCORRECT_NAME) { defineBuiltIn(RegExp.prototype, TO_STRING, function toString() { var R = anObject(this); var pattern = $toString(R.source); var flags = $toString(getRegExpFlags(R)); return '/' + pattern + '/' + flags; }, { unsafe: true }); } /***/ }), /***/ "./node_modules/core-js/modules/es.symbol.description.js": /*!***************************************************************!*\ !*** ./node_modules/core-js/modules/es.symbol.description.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // `Symbol.prototype.description` getter // https://tc39.es/ecma262/#sec-symbol.prototype.description var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js"); var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js"); var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js"); var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js"); var isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ "./node_modules/core-js/internals/object-is-prototype-of.js"); var toString = __webpack_require__(/*! ../internals/to-string */ "./node_modules/core-js/internals/to-string.js"); var defineBuiltInAccessor = __webpack_require__(/*! ../internals/define-built-in-accessor */ "./node_modules/core-js/internals/define-built-in-accessor.js"); var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/core-js/internals/copy-constructor-properties.js"); var NativeSymbol = global.Symbol; var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) || // Safari 12 bug NativeSymbol().description !== undefined )) { var EmptyStringDescriptionStore = {}; // wrap Symbol constructor for correct work with undefined description var SymbolWrapper = function Symbol() { var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]); var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' : description === undefined ? NativeSymbol() : NativeSymbol(description); if (description === '') EmptyStringDescriptionStore[result] = true; return result; }; copyConstructorProperties(SymbolWrapper, NativeSymbol); SymbolWrapper.prototype = SymbolPrototype; SymbolPrototype.constructor = SymbolWrapper; var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)'; var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf); var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString); var regexp = /^Symbol\((.*)\)[^)]+$/; var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { var symbol = thisSymbolValue(this); if (hasOwn(EmptyStringDescriptionStore, symbol)) return ''; var string = symbolDescriptiveString(symbol); var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1'); return desc === '' ? undefined : desc; } }); $({ global: true, constructor: true, forced: true }, { Symbol: SymbolWrapper }); } /***/ }), /***/ "./node_modules/core-js/modules/web.dom-collections.iterator.js": /*!**********************************************************************!*\ !*** ./node_modules/core-js/modules/web.dom-collections.iterator.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "./node_modules/core-js/internals/dom-iterables.js"); var DOMTokenListPrototype = __webpack_require__(/*! ../internals/dom-token-list-prototype */ "./node_modules/core-js/internals/dom-token-list-prototype.js"); var ArrayIteratorMethods = __webpack_require__(/*! ../modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js"); var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js"); var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); var ITERATOR = wellKnownSymbol('iterator'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var ArrayValues = ArrayIteratorMethods.values; var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { if (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[ITERATOR] !== ArrayValues) try { createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); } catch (error) { CollectionPrototype[ITERATOR] = ArrayValues; } if (!CollectionPrototype[TO_STRING_TAG]) { createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); } if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); } catch (error) { CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; } } } }; for (var COLLECTION_NAME in DOMIterables) { handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME); } handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); /***/ }), /***/ "./node_modules/ieee754/index.js": /*!***************************************!*\ !*** ./node_modules/ieee754/index.js ***! \***************************************/ /***/ ((__unused_webpack_module, exports) => { /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var nBits = -7 var i = isLE ? (nBytes - 1) : 0 var d = isLE ? -1 : 1 var s = buffer[offset + i] i += d e = s & ((1 << (-nBits)) - 1) s >>= (-nBits) nBits += eLen for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} m = e & ((1 << (-nBits)) - 1) e >>= (-nBits) nBits += mLen for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias } else if (e === eMax) { return m ? NaN : ((s ? -1 : 1) * Infinity) } else { m = m + Math.pow(2, mLen) e = e - eBias } return (s ? -1 : 1) * m * Math.pow(2, e - mLen) } exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { var e, m, c var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) var i = isLE ? 0 : (nBytes - 1) var d = isLE ? 1 : -1 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 value = Math.abs(value) if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0 e = eMax } else { e = Math.floor(Math.log(value) / Math.LN2) if (value * (c = Math.pow(2, -e)) < 1) { e-- c *= 2 } if (e + eBias >= 1) { value += rt / c } else { value += rt * Math.pow(2, 1 - eBias) } if (value * c >= 2) { e++ c /= 2 } if (e + eBias >= eMax) { m = 0 e = eMax } else if (e + eBias >= 1) { m = ((value * c) - 1) * Math.pow(2, mLen) e = e + eBias } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) e = 0 } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = (e << mLen) | m eLen += mLen for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128 } /***/ }), /***/ "./node_modules/object-assign/index.js": /*!*********************************************!*\ !*** ./node_modules/object-assign/index.js ***! \*********************************************/ /***/ ((module) => { "use strict"; /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }), /***/ "./node_modules/process/browser.js": /*!*****************************************!*\ !*** ./node_modules/process/browser.js ***! \*****************************************/ /***/ ((module) => { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /***/ "./node_modules/proxy-compare/dist/index.modern.js": /*!*********************************************************!*\ !*** ./node_modules/proxy-compare/dist/index.modern.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ affectedToPathList: () => (/* binding */ w), /* harmony export */ createProxy: () => (/* binding */ a), /* harmony export */ getUntracked: () => (/* binding */ y), /* harmony export */ isChanged: () => (/* binding */ p), /* harmony export */ markToTrack: () => (/* binding */ h), /* harmony export */ replaceNewProxy: () => (/* binding */ O), /* harmony export */ trackMemo: () => (/* binding */ g) /* harmony export */ }); const e=Symbol(),t=Symbol(),r="a",n="w";let o=(e,t)=>new Proxy(e,t);const s=Object.getPrototypeOf,c=new WeakMap,l=e=>e&&(c.has(e)?c.get(e):s(e)===Object.prototype||s(e)===Array.prototype),f=e=>"object"==typeof e&&null!==e,i=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(e=>{e.configurable=!0}),Object.create(s(e),t)},u=e=>e[t]||e,a=(s,c,f,p)=>{if(!l(s))return s;let g=p&&p.get(s);if(!g){const e=u(s);g=(e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.configurable&&!e.writable))(e)?[e,i(e)]:[e],null==p||p.set(s,g)}const[y,h]=g;let w=f&&f.get(y);return w&&w[1].f===!!h||(w=((o,s)=>{const c={f:s};let l=!1;const f=(e,t)=>{if(!l){let s=c[r].get(o);if(s||(s={},c[r].set(o,s)),e===n)s[n]=!0;else{let r=s[e];r||(r=new Set,s[e]=r),r.add(t)}}},i={get:(e,n)=>n===t?o:(f("k",n),a(Reflect.get(e,n),c[r],c.c)),has:(t,n)=>n===e?(l=!0,c[r].delete(o),!0):(f("h",n),Reflect.has(t,n)),getOwnPropertyDescriptor:(e,t)=>(f("o",t),Reflect.getOwnPropertyDescriptor(e,t)),ownKeys:e=>(f(n),Reflect.ownKeys(e))};return s&&(i.set=i.deleteProperty=()=>!1),[i,c]})(y,!!h),w[1].p=o(h||y,w[0]),f&&f.set(y,w)),w[1][r]=c,w[1].c=f,w[1].p},p=(e,t,r,o)=>{if(Object.is(e,t))return!1;if(!f(e)||!f(t))return!0;const s=r.get(u(e));if(!s)return!0;if(o){const r=o.get(e);if(r&&r.n===t)return r.g;o.set(e,{n:t,g:!1})}let c=null;try{for(const r of s.h||[])if(c=Reflect.has(e,r)!==Reflect.has(t,r),c)return c;if(!0===s[n]){if(c=((e,t)=>{const r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((e,t)=>e!==n[t])})(e,t),c)return c}else for(const r of s.o||[])if(c=!!Reflect.getOwnPropertyDescriptor(e,r)!=!!Reflect.getOwnPropertyDescriptor(t,r),c)return c;for(const n of s.k||[])if(c=p(e[n],t[n],r,o),c)return c;return null===c&&(c=!0),c}finally{o&&o.set(e,{n:t,g:c})}},g=t=>!!l(t)&&e in t,y=e=>l(e)&&e[t]||null,h=(e,t=!0)=>{c.set(e,t)},w=(e,t,r)=>{const o=[],s=new WeakSet,c=(e,l)=>{if(s.has(e))return;f(e)&&s.add(e);const i=f(e)&&t.get(u(e));if(i){var a,p;if(null==(a=i.h)||a.forEach(e=>{const t=`:has(${String(e)})`;o.push(l?[...l,t]:[t])}),!0===i[n]){const e=":ownKeys";o.push(l?[...l,e]:[e])}else{var g;null==(g=i.o)||g.forEach(e=>{const t=`:hasOwn(${String(e)})`;o.push(l?[...l,t]:[t])})}null==(p=i.k)||p.forEach(t=>{r&&!("value"in(Object.getOwnPropertyDescriptor(e,t)||{}))||c(e[t],l?[...l,t]:[t])})}else l&&o.push(l)};return c(e),o},O=e=>{o=e}; //# sourceMappingURL=index.modern.mjs.map /***/ }), /***/ "./node_modules/react-dom/cjs/react-dom.development.js": /*!*************************************************************!*\ !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** @license React v17.0.2 * react-dom.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. */ if (true) { (function() { 'use strict'; var React = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react/react"); var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); var Scheduler = __webpack_require__(/*! scheduler */ "./node_modules/scheduler/index.js"); var tracing = __webpack_require__(/*! scheduler/tracing */ "./node_modules/scheduler/tracing.js"); var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // by calls to these methods by a Babel plugin. // // In PROD (or in packages without access to React internals), // they are left as they are instead. function warn(format) { { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning('warn', format, args); } } function error(format) { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning('error', format, args); } } function printWarning(level, format, args) { // When changing this logic, you might want to also // update consoleWithStackDev.www.js as well. { var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame.getStackAddendum(); if (stack !== '') { format += '%s'; args = args.concat([stack]); } var argsWithFormat = args.map(function (item) { return '' + item; }); // Careful: RN currently depends on this prefix argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it // breaks IE9: https://github.com/facebook/react/issues/13610 // eslint-disable-next-line react-internal/no-production-logging Function.prototype.apply.call(console[level], console, argsWithFormat); } } if (!React) { { throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." ); } } var FunctionComponent = 0; var ClassComponent = 1; var IndeterminateComponent = 2; // Before we know whether it is function or class var HostRoot = 3; // Root of a host tree. Could be nested inside another node. var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. var HostComponent = 5; var HostText = 6; var Fragment = 7; var Mode = 8; var ContextConsumer = 9; var ContextProvider = 10; var ForwardRef = 11; var Profiler = 12; var SuspenseComponent = 13; var MemoComponent = 14; var SimpleMemoComponent = 15; var LazyComponent = 16; var IncompleteClassComponent = 17; var DehydratedFragment = 18; var SuspenseListComponent = 19; var FundamentalComponent = 20; var ScopeComponent = 21; var Block = 22; var OffscreenComponent = 23; var LegacyHiddenComponent = 24; // Filter certain DOM attributes (e.g. src, href) if their values are empty strings. var enableProfilerTimer = true; // Record durations for commit and passive effects phases. var enableFundamentalAPI = false; // Experimental Scope support. var enableNewReconciler = false; // Errors that are thrown while unmounting (or after in the case of passive effects) var warnAboutStringRefs = false; var allNativeEvents = new Set(); /** * Mapping from registration name to event name */ var registrationNameDependencies = {}; /** * Mapping from lowercase registration names to the properly cased version, * used to warn in the case of missing event handlers. Available * only in true. * @type {Object} */ var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true function registerTwoPhaseEvent(registrationName, dependencies) { registerDirectEvent(registrationName, dependencies); registerDirectEvent(registrationName + 'Capture', dependencies); } function registerDirectEvent(registrationName, dependencies) { { if (registrationNameDependencies[registrationName]) { error('EventRegistry: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName); } } registrationNameDependencies[registrationName] = dependencies; { var lowerCasedName = registrationName.toLowerCase(); possibleRegistrationNames[lowerCasedName] = registrationName; if (registrationName === 'onDoubleClick') { possibleRegistrationNames.ondblclick = registrationName; } } for (var i = 0; i < dependencies.length; i++) { allNativeEvents.add(dependencies[i]); } } var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); // A reserved attribute. // It is handled by React separately and shouldn't be written to the DOM. var RESERVED = 0; // A simple string attribute. // Attributes that aren't in the filter are presumed to have this type. var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called // "enumerated" attributes with "true" and "false" as possible values. // When true, it should be set to a "true" string. // When false, it should be set to a "false" string. var BOOLEANISH_STRING = 2; // A real boolean attribute. // When true, it should be present (set either to an empty string or its name). // When false, it should be omitted. var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. // When true, it should be present (set either to an empty string or its name). // When false, it should be omitted. // For any other value, should be present with that value. var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. // When falsy, it should be removed. var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. // When falsy, it should be removed. var POSITIVE_NUMERIC = 6; /* eslint-disable max-len */ var ATTRIBUTE_NAME_START_CHAR = ":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"; /* eslint-enable max-len */ var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); var hasOwnProperty = Object.prototype.hasOwnProperty; var illegalAttributeNameCache = {}; var validatedAttributeNameCache = {}; function isAttributeNameSafe(attributeName) { if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { return true; } if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { return false; } if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { validatedAttributeNameCache[attributeName] = true; return true; } illegalAttributeNameCache[attributeName] = true; { error('Invalid attribute name: `%s`', attributeName); } return false; } function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null) { return propertyInfo.type === RESERVED; } if (isCustomComponentTag) { return false; } if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { return true; } return false; } function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null && propertyInfo.type === RESERVED) { return false; } switch (typeof value) { case 'function': // $FlowIssue symbol is perfectly valid here case 'symbol': // eslint-disable-line return true; case 'boolean': { if (isCustomComponentTag) { return false; } if (propertyInfo !== null) { return !propertyInfo.acceptsBooleans; } else { var prefix = name.toLowerCase().slice(0, 5); return prefix !== 'data-' && prefix !== 'aria-'; } } default: return false; } } function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { if (value === null || typeof value === 'undefined') { return true; } if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { return true; } if (isCustomComponentTag) { return false; } if (propertyInfo !== null) { switch (propertyInfo.type) { case BOOLEAN: return !value; case OVERLOADED_BOOLEAN: return value === false; case NUMERIC: return isNaN(value); case POSITIVE_NUMERIC: return isNaN(value) || value < 1; } } return false; } function getPropertyInfo(name) { return properties.hasOwnProperty(name) ? properties[name] : null; } function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; this.attributeName = attributeName; this.attributeNamespace = attributeNamespace; this.mustUseProperty = mustUseProperty; this.propertyName = name; this.type = type; this.sanitizeURL = sanitizeURL; this.removeEmptyString = removeEmptyString; } // When adding attributes to this list, be sure to also add them to // the `possibleStandardNames` module to ensure casing and incorrect // name warnings. var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular // elements (not just inputs). Now that ReactDOMInput assigns to the // defaultValue property -- do we need this? 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']; reservedProps.forEach(function (name) { properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // A few React string attributes have a different name. // This is a mapping from React prop names to the attribute names. [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { var name = _ref[0], attributeName = _ref[1]; properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are "enumerated" HTML attributes that accept "true" and "false". // In React, we let users pass `true` and `false` even though technically // these aren't boolean attributes (they are coerced to strings). ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are "enumerated" SVG attributes that accept "true" and "false". // In React, we let users pass `true` and `false` even though technically // these aren't boolean attributes (they are coerced to strings). // Since these are SVG attributes, their attribute names are case-sensitive. ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML boolean attributes. ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM // on the client side because the browsers are inconsistent. Instead we call focus(). 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata 'itemScope'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are the few React props that we set as DOM properties // rather than attributes. These are all booleans. ['checked', // Note: `option.selected` is not updated if `select.multiple` is // disabled with `removeAttribute`. We have special logic for handling this. 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML attributes that are "overloaded booleans": they behave like // booleans, but can also accept a string value. ['capture', 'download' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML attributes that must be positive numbers. ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML attributes that must be numbers. ['rowSpan', 'start'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); var CAMELIZE = /[\-\:]([a-z])/g; var capitalize = function (token) { return token[1].toUpperCase(); }; // This is a list of all SVG attributes that need special casing, namespacing, // or boolean value assignment. Regular attributes that just accept strings // and have the same names are omitted, just like in the HTML attribute filter. // Some of these attributes can be hard to find. This list was created by // scraping the MDN documentation. ['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' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, null, // attributeNamespace false, // sanitizeURL false); }); // String SVG attributes with the xlink namespace. ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL false); }); // String SVG attributes with the xml namespace. ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL false); }); // These attribute exists both in HTML and SVG. // The attribute name is case-sensitive in SVG so we can't just use // the React name like we do for attributes that exist only in HTML. ['tabIndex', 'crossOrigin'].forEach(function (attributeName) { properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These attributes accept URLs. These must not allow javascript: URLS. // These will also need to accept Trusted Types object in the future. var xlinkHref = 'xlinkHref'; properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL false); ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace true, // sanitizeURL true); }); // and any newline or tab are filtered out as if they're not part of the URL. // https://url.spec.whatwg.org/#url-parsing // Tab or newline are defined as \r\n\t: // https://infra.spec.whatwg.org/#ascii-tab-or-newline // A C0 control is a code point in the range \u0000 NULL to \u001F // INFORMATION SEPARATOR ONE, inclusive: // https://infra.spec.whatwg.org/#c0-control-or-space /* eslint-disable max-len */ var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; var didWarn = false; function sanitizeURL(url) { { if (!didWarn && isJavaScriptProtocol.test(url)) { didWarn = true; error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); } } } /** * Get the value for a property on a node. Only used in DEV for SSR validation. * The "expected" argument is used as a hint of what the expected value is. * Some properties have multiple equivalent values. */ function getValueForProperty(node, name, expected, propertyInfo) { { if (propertyInfo.mustUseProperty) { var propertyName = propertyInfo.propertyName; return node[propertyName]; } else { if ( propertyInfo.sanitizeURL) { // If we haven't fully disabled javascript: URLs, and if // the hydration is successful of a javascript: URL, we // still want to warn on the client. sanitizeURL('' + expected); } var attributeName = propertyInfo.attributeName; var stringValue = null; if (propertyInfo.type === OVERLOADED_BOOLEAN) { if (node.hasAttribute(attributeName)) { var value = node.getAttribute(attributeName); if (value === '') { return true; } if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { return value; } if (value === '' + expected) { return expected; } return value; } } else if (node.hasAttribute(attributeName)) { if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { // We had an attribute but shouldn't have had one, so read it // for the error message. return node.getAttribute(attributeName); } if (propertyInfo.type === BOOLEAN) { // If this was a boolean, it doesn't matter what the value is // the fact that we have it is the same as the expected. return expected; } // Even if this property uses a namespace we use getAttribute // because we assume its namespaced name is the same as our config. // To use getAttributeNS we need the local name which we don't have // in our config atm. stringValue = node.getAttribute(attributeName); } if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { return stringValue === null ? expected : stringValue; } else if (stringValue === '' + expected) { return expected; } else { return stringValue; } } } } /** * Get the value for a attribute on a node. Only used in DEV for SSR validation. * The third argument is used as a hint of what the expected value is. Some * attributes have multiple equivalent values. */ function getValueForAttribute(node, name, expected) { { if (!isAttributeNameSafe(name)) { return; } // If the object is an opaque reference ID, it's expected that // the next prop is different than the server value, so just return // expected if (isOpaqueHydratingObject(expected)) { return expected; } if (!node.hasAttribute(name)) { return expected === undefined ? undefined : null; } var value = node.getAttribute(name); if (value === '' + expected) { return expected; } return value; } } /** * Sets the value for a property on a node. * * @param {DOMElement} node * @param {string} name * @param {*} value */ function setValueForProperty(node, name, value, isCustomComponentTag) { var propertyInfo = getPropertyInfo(name); if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { return; } if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { value = null; } // If the prop isn't in the special list, treat it as a simple attribute. if (isCustomComponentTag || propertyInfo === null) { if (isAttributeNameSafe(name)) { var _attributeName = name; if (value === null) { node.removeAttribute(_attributeName); } else { node.setAttribute(_attributeName, '' + value); } } return; } var mustUseProperty = propertyInfo.mustUseProperty; if (mustUseProperty) { var propertyName = propertyInfo.propertyName; if (value === null) { var type = propertyInfo.type; node[propertyName] = type === BOOLEAN ? false : ''; } else { // Contrary to `setAttribute`, object properties are properly // `toString`ed by IE8/9. node[propertyName] = value; } return; } // The rest are treated as attributes with special cases. var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace; if (value === null) { node.removeAttribute(attributeName); } else { var _type = propertyInfo.type; var attributeValue; if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { // If attribute type is boolean, we know for sure it won't be an execution sink // and we won't require Trusted Type here. attributeValue = ''; } else { // `setAttribute` with objects becomes only `[object]` in IE8/9, // ('' + value) makes it output the correct toString()-value. { attributeValue = '' + value; } if (propertyInfo.sanitizeURL) { sanitizeURL(attributeValue.toString()); } } if (attributeNamespace) { node.setAttributeNS(attributeNamespace, attributeName, attributeValue); } else { node.setAttribute(attributeName, attributeValue); } } } // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var REACT_ELEMENT_TYPE = 0xeac7; var REACT_PORTAL_TYPE = 0xeaca; var REACT_FRAGMENT_TYPE = 0xeacb; var REACT_STRICT_MODE_TYPE = 0xeacc; var REACT_PROFILER_TYPE = 0xead2; var REACT_PROVIDER_TYPE = 0xeacd; var REACT_CONTEXT_TYPE = 0xeace; var REACT_FORWARD_REF_TYPE = 0xead0; var REACT_SUSPENSE_TYPE = 0xead1; var REACT_SUSPENSE_LIST_TYPE = 0xead8; var REACT_MEMO_TYPE = 0xead3; var REACT_LAZY_TYPE = 0xead4; var REACT_BLOCK_TYPE = 0xead9; var REACT_SERVER_BLOCK_TYPE = 0xeada; var REACT_FUNDAMENTAL_TYPE = 0xead5; var REACT_SCOPE_TYPE = 0xead7; var REACT_OPAQUE_ID_TYPE = 0xeae0; var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; var REACT_OFFSCREEN_TYPE = 0xeae2; var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; if (typeof Symbol === 'function' && Symbol.for) { var symbolFor = Symbol.for; REACT_ELEMENT_TYPE = symbolFor('react.element'); REACT_PORTAL_TYPE = symbolFor('react.portal'); REACT_FRAGMENT_TYPE = symbolFor('react.fragment'); REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); REACT_PROFILER_TYPE = symbolFor('react.profiler'); REACT_PROVIDER_TYPE = symbolFor('react.provider'); REACT_CONTEXT_TYPE = symbolFor('react.context'); REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); REACT_MEMO_TYPE = symbolFor('react.memo'); REACT_LAZY_TYPE = symbolFor('react.lazy'); REACT_BLOCK_TYPE = symbolFor('react.block'); REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); REACT_SCOPE_TYPE = symbolFor('react.scope'); REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); } var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== 'object') { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === 'function') { return maybeIterator; } return null; } // Helpers to patch console.logs to avoid logging during side-effect free // replaying on render function. This currently only patches the object // lazily which won't cover if the log function was extracted eagerly. // We could also eagerly patch the method. var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() {} disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); /* eslint-enable react-internal/no-production-logging */ } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ var props = { configurable: true, enumerable: true, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { log: _assign({}, props, { value: prevLog }), info: _assign({}, props, { value: prevInfo }), warn: _assign({}, props, { value: prevWarn }), error: _assign({}, props, { value: prevError }), group: _assign({}, props, { value: prevGroup }), groupCollapsed: _assign({}, props, { value: prevGroupCollapsed }), groupEnd: _assign({}, props, { value: prevGroupEnd }) }); /* eslint-enable react-internal/no-production-logging */ } if (disabledDepth < 0) { error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); } } } var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === undefined) { // Extract the VM specific prefix used by each line. try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ''; } } // We use the prefix to ensure our stacks line up with native stack frames. return '\n' + prefix + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { // If something asked for a stack inside a fake render, it should get ignored. if (!fn || reentry) { return ''; } { var frame = componentFrameCache.get(fn); if (frame !== undefined) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. Error.prepareStackTrace = undefined; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function // for warnings. ReactCurrentDispatcher.current = null; disableLogs(); } try { // This should throw. if (construct) { // Something should be setting the props in the constructor. var Fake = function () { throw Error(); }; // $FlowFixMe Object.defineProperty(Fake.prototype, 'props', { set: function () { // We use a throwing setter instead of frozen or non-writable props // because that won't throw in a non-strict mode function. throw Error(); } }); if (typeof Reflect === 'object' && Reflect.construct) { // We construct a different control for this case to include any extra // frames added by the construct call. try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { // This is inlined manually because closure doesn't do it for us. if (sample && control && typeof sample.stack === 'string') { // This extracts the first frame from the sample that isn't also in the control. // Skipping one frame that we assume is the frame that calls the two. var sampleLines = sample.stack.split('\n'); var controlLines = control.stack.split('\n'); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { // We expect at least one stack frame to be shared. // Typically this will be the root most one. However, stack frames may be // cut off due to maximum stack limits. In this case, one maybe cut off // earlier than the other. We assume that the sample is longer or the same // and there for cut off earlier. So we should find the root most frame in // the sample somewhere in the control. c--; } for (; s >= 1 && c >= 0; s--, c--) { // Next we find the first one that isn't the same which should be the // frame that called our sample function and the control. if (sampleLines[s] !== controlLines[c]) { // In V8, the first line is describing the message but other VMs don't. // If we're about to return the first line, and the control is also on the same // line, that's a pretty good indicator that our sample threw at same line as // the control. I.e. before we entered the sample frame. So we ignore this result. // This can happen if you passed a class to function component, or non-function. if (s !== 1 || c !== 1) { do { s--; c--; // We may still have similar intermediate frames from the construct call. // The next one that isn't the same should be our match though. if (c < 0 || sampleLines[s] !== controlLines[c]) { // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); { if (typeof fn === 'function') { componentFrameCache.set(fn, _frame); } } // Return the line we found. return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } // Fallback to just using the name if we couldn't make it throw. var name = fn ? fn.displayName || fn.name : ''; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; { if (typeof fn === 'function') { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeClassComponentFrame(ctor, source, ownerFn) { { return describeNativeComponentFrame(ctor, true); } } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ''; } if (typeof type === 'function') { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === 'string') { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame('Suspense'); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame('SuspenseList'); } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: // Memo may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_BLOCK_TYPE: return describeFunctionComponentFrame(type._render); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { // Lazy may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) {} } } } return ''; } function describeFiber(fiber) { var owner = fiber._debugOwner ? fiber._debugOwner.type : null ; var source = fiber._debugSource ; switch (fiber.tag) { case HostComponent: return describeBuiltInComponentFrame(fiber.type); case LazyComponent: return describeBuiltInComponentFrame('Lazy'); case SuspenseComponent: return describeBuiltInComponentFrame('Suspense'); case SuspenseListComponent: return describeBuiltInComponentFrame('SuspenseList'); case FunctionComponent: case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); case ForwardRef: return describeFunctionComponentFrame(fiber.type.render); case Block: return describeFunctionComponentFrame(fiber.type._render); case ClassComponent: return describeClassComponentFrame(fiber.type); default: return ''; } } function getStackByFiberInDevAndProd(workInProgress) { try { var info = ''; var node = workInProgress; do { info += describeFiber(node); node = node.return; } while (node); return info; } catch (x) { return '\nError generating stack: ' + x.message + '\n' + x.stack; } } function getWrappedName(outerType, innerType, wrapperName) { var functionName = innerType.displayName || innerType.name || ''; return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); } function getContextName(type) { return type.displayName || 'Context'; } function getComponentName(type) { if (type == null) { // Host root, text node or just invalid type. return null; } { if (typeof type.tag === 'number') { error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); } } if (typeof type === 'function') { return type.displayName || type.name || null; } if (typeof type === 'string') { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return 'Fragment'; case REACT_PORTAL_TYPE: return 'Portal'; case REACT_PROFILER_TYPE: return 'Profiler'; case REACT_STRICT_MODE_TYPE: return 'StrictMode'; case REACT_SUSPENSE_TYPE: return 'Suspense'; case REACT_SUSPENSE_LIST_TYPE: return 'SuspenseList'; } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + '.Consumer'; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + '.Provider'; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: return getComponentName(type.type); case REACT_BLOCK_TYPE: return getComponentName(type._render); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentName(init(payload)); } catch (x) { return null; } } } } return null; } var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var current = null; var isRendering = false; function getCurrentFiberOwnerNameInDevOrNull() { { if (current === null) { return null; } var owner = current._debugOwner; if (owner !== null && typeof owner !== 'undefined') { return getComponentName(owner.type); } } return null; } function getCurrentFiberStackInDev() { { if (current === null) { return ''; } // Safe because if current fiber exists, we are reconciling, // and it is guaranteed to be the work-in-progress version. return getStackByFiberInDevAndProd(current); } } function resetCurrentFiber() { { ReactDebugCurrentFrame.getCurrentStack = null; current = null; isRendering = false; } } function setCurrentFiber(fiber) { { ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev; current = fiber; isRendering = false; } } function setIsRendering(rendering) { { isRendering = rendering; } } function getIsRendering() { { return isRendering; } } // Flow does not allow string concatenation of most non-string types. To work // around this limitation, we use an opaque type that can only be obtained by // passing the value through getToStringValue first. function toString(value) { return '' + value; } function getToStringValue(value) { switch (typeof value) { case 'boolean': case 'number': case 'object': case 'string': case 'undefined': return value; default: // function, symbol are assigned as empty strings return ''; } } var hasReadOnlyValue = { button: true, checkbox: true, image: true, hidden: true, radio: true, reset: true, submit: true }; function checkControlledValueProps(tagName, props) { { if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); } if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); } } } function isCheckable(elem) { var type = elem.type; var nodeName = elem.nodeName; return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); } function getTracker(node) { return node._valueTracker; } function detachTracker(node) { node._valueTracker = null; } function getValueFromNode(node) { var value = ''; if (!node) { return value; } if (isCheckable(node)) { value = node.checked ? 'true' : 'false'; } else { value = node.value; } return value; } function trackValueOnNode(node) { var valueField = isCheckable(node) ? 'checked' : 'value'; var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail // and don't track value will cause over reporting of changes, // but it's better then a hard failure // (needed for certain tests that spyOn input values and Safari) if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { return; } var get = descriptor.get, set = descriptor.set; Object.defineProperty(node, valueField, { configurable: true, get: function () { return get.call(this); }, set: function (value) { currentValue = '' + value; set.call(this, value); } }); // We could've passed this the first time // but it triggers a bug in IE11 and Edge 14/15. // Calling defineProperty() again should be equivalent. // https://github.com/facebook/react/issues/11768 Object.defineProperty(node, valueField, { enumerable: descriptor.enumerable }); var tracker = { getValue: function () { return currentValue; }, setValue: function (value) { currentValue = '' + value; }, stopTracking: function () { detachTracker(node); delete node[valueField]; } }; return tracker; } function track(node) { if (getTracker(node)) { return; } // TODO: Once it's just Fiber we can move this to node._wrapperState node._valueTracker = trackValueOnNode(node); } function updateValueIfChanged(node) { if (!node) { return false; } var tracker = getTracker(node); // if there is no tracker at this point it's unlikely // that trying again will succeed if (!tracker) { return true; } var lastValue = tracker.getValue(); var nextValue = getValueFromNode(node); if (nextValue !== lastValue) { tracker.setValue(nextValue); return true; } return false; } function getActiveElement(doc) { doc = doc || (typeof document !== 'undefined' ? document : undefined); if (typeof doc === 'undefined') { return null; } try { return doc.activeElement || doc.body; } catch (e) { return doc.body; } } var didWarnValueDefaultValue = false; var didWarnCheckedDefaultChecked = false; var didWarnControlledToUncontrolled = false; var didWarnUncontrolledToControlled = false; function isControlled(props) { var usesChecked = props.type === 'checkbox' || props.type === 'radio'; return usesChecked ? props.checked != null : props.value != null; } /** * Implements an host component that allows setting these optional * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. * * If `checked` or `value` are not supplied (or null/undefined), user actions * that affect the checked state or value will trigger updates to the element. * * If they are supplied (and not null/undefined), the rendered element will not * trigger updates to the element. Instead, the props must change in order for * the rendered element to be updated. * * The rendered element will be initialized as unchecked (or `defaultChecked`) * with an empty value (or `defaultValue`). * * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html */ function getHostProps(element, props) { var node = element; var checked = props.checked; var hostProps = _assign({}, props, { defaultChecked: undefined, defaultValue: undefined, value: undefined, checked: checked != null ? checked : node._wrapperState.initialChecked }); return hostProps; } function initWrapperState(element, props) { { checkControlledValueProps('input', props); if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); didWarnCheckedDefaultChecked = true; } if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); didWarnValueDefaultValue = true; } } var node = element; var defaultValue = props.defaultValue == null ? '' : props.defaultValue; node._wrapperState = { initialChecked: props.checked != null ? props.checked : props.defaultChecked, initialValue: getToStringValue(props.value != null ? props.value : defaultValue), controlled: isControlled(props) }; } function updateChecked(element, props) { var node = element; var checked = props.checked; if (checked != null) { setValueForProperty(node, 'checked', checked, false); } } function updateWrapper(element, props) { var node = element; { var controlled = isControlled(props); if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by the value changing from undefined to ' + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components'); didWarnUncontrolledToControlled = true; } if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { error('A component is changing a controlled input to be uncontrolled. ' + 'This is likely caused by the value changing from a defined to ' + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components'); didWarnControlledToUncontrolled = true; } } updateChecked(element, props); var value = getToStringValue(props.value); var type = props.type; if (value != null) { if (type === 'number') { if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible. // eslint-disable-next-line node.value != value) { node.value = toString(value); } } else if (node.value !== toString(value)) { node.value = toString(value); } } else if (type === 'submit' || type === 'reset') { // Submit/reset inputs need the attribute removed completely to avoid // blank-text buttons. node.removeAttribute('value'); return; } { // When syncing the value attribute, the value comes from a cascade of // properties: // 1. The value React property // 2. The defaultValue React property // 3. Otherwise there should be no change if (props.hasOwnProperty('value')) { setDefaultValue(node, props.type, value); } else if (props.hasOwnProperty('defaultValue')) { setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); } } { // When syncing the checked attribute, it only changes when it needs // to be removed, such as transitioning from a checkbox into a text input if (props.checked == null && props.defaultChecked != null) { node.defaultChecked = !!props.defaultChecked; } } } function postMountWrapper(element, props, isHydrating) { var node = element; // Do not assign value if it is already set. This prevents user text input // from being lost during SSR hydration. if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { var type = props.type; var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the // default value provided by the browser. See: #12872 if (isButton && (props.value === undefined || props.value === null)) { return; } var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input // from being lost during SSR hydration. if (!isHydrating) { { // When syncing the value attribute, the value property should use // the wrapperState._initialValue property. This uses: // // 1. The value React property when present // 2. The defaultValue React property when present // 3. An empty string if (initialValue !== node.value) { node.value = initialValue; } } } { // Otherwise, the value attribute is synchronized to the property, // so we assign defaultValue to the same thing as the value property // assignment step above. node.defaultValue = initialValue; } } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug // this is needed to work around a chrome bug where setting defaultChecked // will sometimes influence the value of checked (even after detachment). // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 // We need to temporarily unset name to avoid disrupting radio button groups. var name = node.name; if (name !== '') { node.name = ''; } { // When syncing the checked attribute, both the checked property and // attribute are assigned at the same time using defaultChecked. This uses: // // 1. The checked React property when present // 2. The defaultChecked React property when present // 3. Otherwise, false node.defaultChecked = !node.defaultChecked; node.defaultChecked = !!node._wrapperState.initialChecked; } if (name !== '') { node.name = name; } } function restoreControlledState(element, props) { var node = element; updateWrapper(node, props); updateNamedCousins(node, props); } function updateNamedCousins(rootNode, props) { var name = props.name; if (props.type === 'radio' && name != null) { var queryRoot = rootNode; while (queryRoot.parentNode) { queryRoot = queryRoot.parentNode; } // If `rootNode.form` was non-null, then we could try `form.elements`, // but that sometimes behaves strangely in IE8. We could also try using // `form.getElementsByName`, but that will only return direct children // and won't include inputs that use the HTML5 `form=` attribute. Since // the input might not even be in a form. It might not even be in the // document. Let's just use the local `querySelectorAll` to ensure we don't // miss anything. var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); for (var i = 0; i < group.length; i++) { var otherNode = group[i]; if (otherNode === rootNode || otherNode.form !== rootNode.form) { continue; } // This will throw if radio buttons rendered by different copies of React // and the same name are rendered into the same form (same as #1939). // That's probably okay; we don't support it just as we don't support // mixing React radio buttons with non-React ones. var otherProps = getFiberCurrentPropsFromNode(otherNode); if (!otherProps) { { throw Error( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." ); } } // We need update the tracked value on the named cousin since the value // was changed but the input saw no event or value set updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that // was previously checked to update will cause it to be come re-checked // as appropriate. updateWrapper(otherNode, otherProps); } } } // In Chrome, assigning defaultValue to certain input types triggers input validation. // For number inputs, the display value loses trailing decimal points. For email inputs, // Chrome raises "The specified value is not a valid email address". // // Here we check to see if the defaultValue has actually changed, avoiding these problems // when the user is inputting text // // https://github.com/facebook/react/issues/7253 function setDefaultValue(node, type, value) { if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js type !== 'number' || getActiveElement(node.ownerDocument) !== node) { if (value == null) { node.defaultValue = toString(node._wrapperState.initialValue); } else if (node.defaultValue !== toString(value)) { node.defaultValue = toString(value); } } } var didWarnSelectedSetOnOption = false; var didWarnInvalidChild = false; function flattenChildren(children) { var content = ''; // Flatten children. We'll warn if they are invalid // during validateProps() which runs for hydration too. // Note that this would throw on non-element objects. // Elements are stringified (which is normally irrelevant // but matters for ). React.Children.forEach(children, function (child) { if (child == null) { return; } content += child; // Note: we don't warn about invalid children here. // Instead, this is done separately below so that // it happens during the hydration code path too. }); return content; } /** * Implements an