notificare-react-preview-components 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -6
- package/dist/cjs/index.js +9 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +9 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types.d.ts +126 -7
- package/package.json +19 -16
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../node_modules/tslib/tslib.es6.js","../../node_modules/style-inject/dist/style-inject.es.js","../../src/internal/NotificareNotificationPreview/components/Controls/Selector/Selector.tsx","../../src/internal/NotificareNotificationPreview/components/Controls/ToggleGroup/ToggleGroup.tsx","../../src/internal/NotificareNotificationPreview/components/Controls/Controls.tsx","../../src/internal/NotificareNotificationPreview/components/OptionsProvider/OptionsProvider.tsx","../../src/internal/NotificareNotificationPreview/helpers/getAppIconURL.ts","../../src/internal/NotificareNotificationPreview/components/shared-components/AndroidPhoneBackground/AndroidPhoneBackground.tsx","../../src/internal/NotificareNotificationPreview/components/shared-components/UnavailablePreview/UnavailablePreview.tsx","../../src/internal/NotificareNotificationPreview/components/shared-components/LoadingIcon/LoadingIcon.tsx","../../src/internal/NotificareNotificationPreview/components/shared-components/PreviewError/PreviewError.tsx","../../src/internal/NotificareNotificationPreview/components/shared-components/Webshot/Webshot.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/NavigationBar/NavigationBar.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/AppRecommendationNotification/AppRecommendationNotification.tsx","../../src/internal/NotificareNotificationPreview/helpers/notification-utils.ts","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/DigitalCardNotification/DigitalCardNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/ImagesNotification/ImagesNotification.tsx","../../src/internal/NotificareNotificationPreview/helpers/getURLMainDomain.ts","../../src/internal/NotificareNotificationPreview/helpers/isSecureURL.ts","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/InAppBrowserNotification/InAppBrowserBar/InAppBrowserBar.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/InAppBrowserNotification/InAppBrowserNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/LockScreenNotification/LockScreenNotification.tsx","../../node_modules/fast-deep-equal/index.js","../../node_modules/@vis.gl/react-google-maps/dist/index.modern.mjs","../../src/internal/NotificareNotificationPreview/components/shared-components/MapRichContent/MapRichContent.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/MapNotification/MapNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/RateNotification/RateNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/TextAlertNotification/TextAlertNotification.tsx","../../src/internal/NotificareNotificationPreview/helpers/fetchWebsiteMarkup.ts","../../src/internal/NotificareNotificationPreview/helpers/markupHasNotificareOpenActionQueryParameter.ts","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/URLNotification/URLNotification.tsx","../../src/internal/NotificareNotificationPreview/components/shared-components/VideoRichContent/VideoRichContent.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/VideoNotification/VideoNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/WebViewNotification/WebViewNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/NotificationAndroidPreview.tsx","../../src/internal/NotificareNotificationPreview/components/shared-components/IOSPhoneBackground/IOSPhoneBackground.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/AppRecommendationNotification/StarRating/StarRating.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/AppRecommendationNotification/AppRecommendationNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/TitleBar/TitleBar.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/DigitalCardNotification/DigitalCardNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/ImagesNotification/ImagesNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/InAppBrowserNotification/InAppBrowserBar/InAppBrowserBar.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/InAppBrowserNotification/InAppBrowserNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/LockScreenNotification/LockScreenNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/MapNotification/MapNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/RateNotification/RateNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/TextAlertNotification/TextAlertNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/URLNotification/URLNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/VideoNotification/VideoNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/WebViewNotification/WebViewNotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/NotificationIOSPreview.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationWebPreview/WebMacOSNotification/ExpandButton/ExpandButton.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationWebPreview/WebMacOSNotification/WebMacOSNotification.tsx","../../node_modules/zod/lib/index.mjs","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationWebPreview/WebMobileAppUINotification/WebMobileAppUINotification.tsx","../../src/internal/NotificareNotificationPreview/components/preview-components/NotificationWebPreview/NotificationWebPreview.tsx","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/action-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/attachment-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/alert-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/image-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/in-app-browser-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/map-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/passbook-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/rate-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/store-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/url-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/video-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/internal/web-view-schema.ts","../../src/internal/NotificareNotificationPreview/schemas/notificare-notification/notificare-notification-schema.ts","../../src/components/NotificareNotificationPreview/NotificareNotificationPreview.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import './Selector.css';\nimport { useEffect, useRef, useState } from 'react';\n\nexport default function Selector<T extends string | undefined>({\n options,\n selected,\n setSelected,\n}: SelectorProps<T>) {\n const [isExpanded, setIsExpanded] = useState(false);\n const optionsRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n setIsExpanded(false);\n\n if (!options.find((option) => option.key === selected) || !selected) {\n setSelected(options[0].key);\n }\n }, []);\n\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n if (optionsRef.current && !optionsRef.current.contains(event.target as Node)) {\n setIsExpanded(false);\n }\n }\n\n document.addEventListener('mousedown', handleClickOutside);\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, []);\n\n if (options.length > 0) {\n return (\n <div className=\"notificare__push__preview-controls-selector\">\n <p className=\"notificare__push__preview-controls-selector-label\">Variant</p>\n <button\n className=\"notificare__push__preview-controls-selector-button\"\n onClick={() => setIsExpanded(!isExpanded)}\n >\n {options.find((option) => option.key === selected)?.label}\n <svg\n className=\"notificare__push__preview-controls-selector-button-expand-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n >\n <path d=\"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\" />\n </svg>\n </button>\n\n {isExpanded && (\n <div className=\"notificare__push__preview-controls-selector-options\" ref={optionsRef}>\n {options.map((option) => (\n <button\n key={option.key}\n className={`notificare__push__preview-controls-selector-option-button ${selected === option.key ? 'notificare__push__preview-controls-selector-option-button--selected' : ''}`}\n onClick={() => {\n setSelected(option.key);\n setIsExpanded(false);\n }}\n data-testid={`selector-option-${option.key}`}\n >\n {option.label}\n </button>\n ))}\n </div>\n )}\n </div>\n );\n }\n}\n\ninterface SelectorProps<T> {\n options: { key: T; label: string }[];\n selected: T;\n setSelected: (value: T) => void;\n}\n","import { Fragment, ReactNode, useEffect } from 'react';\nimport './ToggleGroup.css';\n\nexport default function ToggleGroup<T extends string | undefined>({\n label,\n options,\n selected,\n setSelected,\n}: NewToggleGroupProps<T>) {\n useEffect(() => {\n if (!selected) {\n setSelected(options[0].key);\n }\n }, []);\n\n return (\n <div className=\"notificare__push__preview-controls-toggle-group\">\n <p className=\"notificare__push__preview-controls-toggle-group-label\"> {label} </p>\n <div className=\"notificare__push__preview-controls-toggle-group-options\">\n {options.map((option, index) => (\n <Fragment key={option.key}>\n <button\n className={`notificare__push__preview-controls-toggle-group-option ${selected === option.key ? 'notificare__push__preview-controls-toggle-group-option--selected' : ''}`}\n onClick={() => setSelected(option.key)}\n aria-label={`Button with option '${option.key}'`}\n data-testid={`toggle-option-${option.key}`}\n >\n <div\n className={`notificare__push__preview-controls-toggle-group-option-icon ${selected === option.key ? 'notificare__push__preview-controls-toggle-group-option-icon--selected' : ''}`}\n >\n {option.icon}\n </div>\n </button>\n {index !== options.length - 1 && (\n <div className=\"notificare__push__preview-controls-toggle-group-divisor\" />\n )}\n </Fragment>\n ))}\n </div>\n </div>\n );\n}\n\ninterface NewToggleGroupProps<T> {\n label: string;\n options: { key: T; icon: ReactNode }[];\n selected: T;\n setSelected: (value: T) => void;\n}\n","import './Controls.css';\nimport { ReactNode } from 'react';\nimport { NotificationPreviewVariant } from '../../models/notification-preview-variant';\nimport Selector from './Selector/Selector';\nimport ToggleGroup from './ToggleGroup/ToggleGroup';\n\nexport default function Controls({\n platform,\n mobileVariant,\n webDevice,\n webMobileType,\n webDesktopOS,\n setPlatform,\n setMobileVariant,\n setWebDevice,\n setWebMobileType,\n setWebDesktopOS,\n}: ControlsProps) {\n /* Toggle Groups data */\n\n const platforms: OptionsGroup<typeof platform>[] = [\n {\n key: 'android',\n icon: (\n <svg\n key=\"Android Icon\"\n width=\"22px\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 576 512\"\n >\n <path d=\"M420.6 301.9a24 24 0 1 1 24-24 24 24 0 0 1 -24 24m-265.1 0a24 24 0 1 1 24-24 24 24 0 0 1 -24 24m273.7-144.5 47.9-83a10 10 0 1 0 -17.3-10h0l-48.5 84.1a301.3 301.3 0 0 0 -246.6 0L116.2 64.5a10 10 0 1 0 -17.3 10h0l47.9 83C64.5 202.2 8.2 285.6 0 384H576c-8.2-98.5-64.5-181.8-146.9-226.6\" />\n </svg>\n ) as ReactNode,\n },\n {\n key: 'ios',\n icon: (\n <svg key=\"iOS Icon\" width=\"20px\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\">\n <path d=\"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z\" />\n </svg>\n ) as ReactNode,\n },\n {\n key: 'web',\n icon: (\n <svg key=\"Web Icon\" width=\"22px\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\">\n <path d=\"M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z\" />\n </svg>\n ) as ReactNode,\n },\n ];\n\n const webDevices: OptionsGroup<typeof webDevice>[] = [\n {\n key: 'desktop',\n icon: (\n <svg\n key=\"Desktop Icon\"\n width=\"22px\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 576 512\"\n >\n <path d=\"M64 0C28.7 0 0 28.7 0 64L0 352c0 35.3 28.7 64 64 64l176 0-10.7 32L160 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-69.3 0L336 416l176 0c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64L64 0zM512 64l0 288L64 352 64 64l448 0z\" />\n </svg>\n ) as ReactNode,\n },\n {\n key: 'phone',\n icon: (\n <svg key=\"Phone Icon\" width=\"19px\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\">\n <path d=\"M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM224 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM304 64L80 64l0 320 224 0 0-320z\" />\n </svg>\n ) as ReactNode,\n },\n ];\n\n const webMobileTypes: OptionsGroup<typeof webMobileType>[] = [\n {\n key: 'android',\n icon: (\n <svg key=\"iOS Icon\" width=\"22px\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path d=\"M420.6 301.9a24 24 0 1 1 24-24 24 24 0 0 1 -24 24m-265.1 0a24 24 0 1 1 24-24 24 24 0 0 1 -24 24m273.7-144.5 47.9-83a10 10 0 1 0 -17.3-10h0l-48.5 84.1a301.3 301.3 0 0 0 -246.6 0L116.2 64.5a10 10 0 1 0 -17.3 10h0l47.9 83C64.5 202.2 8.2 285.6 0 384H576c-8.2-98.5-64.5-181.8-146.9-226.6\" />\n </svg>\n ) as ReactNode,\n },\n {\n key: 'iphone',\n icon: (\n <svg key=\"iOS Icon\" width=\"20px\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\">\n <path d=\"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z\" />\n </svg>\n ) as ReactNode,\n },\n ];\n\n return (\n <div className=\"notificare__push__preview-controls\" data-testid=\"controls\">\n {/* Toggle Groups */}\n\n <div className=\"notificare__push__preview-controls-toggle-groups\">\n <ToggleGroup\n label=\"Platform\"\n options={platforms.map((platform) => platform)}\n selected={platform}\n setSelected={setPlatform}\n />\n\n {platform === 'web' && (\n <>\n <ToggleGroup\n label=\"Form Factor\"\n options={webDevices.map((webDevice) => webDevice)}\n selected={webDevice}\n setSelected={setWebDevice}\n />\n\n {webDevice === 'phone' && (\n <ToggleGroup\n label=\"Phone Model\"\n options={webMobileTypes.map((webMobileType) => webMobileType)}\n selected={webMobileType}\n setSelected={setWebMobileType}\n />\n )}\n </>\n )}\n </div>\n\n {/* Selectors */}\n\n {(platform === 'ios' || platform === 'android') && (\n <Selector\n options={[\n { key: 'lockscreen', label: 'Lock Screen' },\n { key: 'lockscreen-expanded', label: 'Lock Screen Expanded' },\n { key: 'app-ui', label: 'App UI' },\n ]}\n selected={mobileVariant}\n setSelected={setMobileVariant}\n />\n )}\n\n {platform === 'web' && (\n <>\n {webDevice === 'phone' && (\n <Selector\n options={[{ key: 'app-ui', label: 'App UI' }]}\n selected={mobileVariant}\n setSelected={setMobileVariant}\n />\n )}\n\n {webDevice === 'desktop' && (\n <Selector\n options={[{ key: 'macOS', label: 'macOS' }]}\n selected={webDesktopOS}\n setSelected={setWebDesktopOS}\n />\n )}\n </>\n )}\n </div>\n );\n}\n\ninterface ControlsProps {\n platform: NotificationPreviewVariant['platform'];\n mobileVariant: NotificationPreviewVariant['mobileVariant'];\n webDevice: NotificationPreviewVariant['webDevice'];\n webMobileType: NotificationPreviewVariant['webMobileType'];\n webDesktopOS: NotificationPreviewVariant['webDesktopOS'];\n setPlatform: (value: NotificationPreviewVariant['platform']) => void;\n setMobileVariant: (value: NotificationPreviewVariant['mobileVariant']) => void;\n setWebDevice: (value: NotificationPreviewVariant['webDevice']) => void;\n setWebMobileType: (value: NotificationPreviewVariant['webMobileType']) => void;\n setWebDesktopOS: (value: NotificationPreviewVariant['webDesktopOS']) => void;\n}\n\ntype OptionsGroup<T> = {\n key: T;\n icon: ReactNode;\n};\n","import { createContext, ReactNode, useContext } from 'react';\nimport { NotificareNotificationOptions } from '../../../../components/NotificareNotificationPreview/models/notificare-notification-config';\n\nexport function OptionsProvider({ options, children }: OptionsProviderProps) {\n return <OptionsContext.Provider value={{ options }}>{children}</OptionsContext.Provider>;\n}\n\ninterface OptionsProviderProps {\n options: NotificareNotificationOptions;\n children: ReactNode;\n}\n\nexport const useOptions = () => {\n const context = useContext(OptionsContext);\n if (!context) {\n throw new Error('useOptions should be used inside an OptionsProvider');\n }\n return context;\n};\n\nconst OptionsContext = createContext<{ options: NotificareNotificationOptions } | undefined>(\n undefined,\n);\n","import { getPushAPIHost } from '../../../config/api';\n\nexport function getAppIconURL(appIcon: string) {\n if (!appIcon.startsWith('https://') && !appIcon.startsWith('http://')) {\n return `${getPushAPIHost()}/upload${appIcon}`;\n } else {\n return appIcon;\n }\n}\n","import './AndroidPhoneBackground.css';\nimport { ReactNode } from 'react';\n\ninterface AndroidPhoneBackgroundProps {\n children: ReactNode;\n theme: 'dark' | 'light';\n}\n\nexport default function AndroidPhoneBackground({ children, theme }: AndroidPhoneBackgroundProps) {\n return (\n <div\n className={`notificare__push__android__phone-background ${theme === 'dark' ? 'notificare__push__android__phone-background--dark' : ''}`}\n data-testid=\"android-phone-background\"\n >\n <div className=\"notificare__push__android__phone-background-camera\" />\n <div className=\"notificare__push__android__phone-background-content\">{children}</div>\n </div>\n );\n}\n","import './UnavailablePreview.css';\n\nexport default function UnavailablePreview({\n message,\n showConsoleWarning,\n}: UnavailablePreviewProps) {\n return (\n <div data-testid=\"notificare-push-unavailable-preview\">\n <div className=\"notificare__push__unavailable-preview-warning\">\n <svg\n className=\"notificare__push__unavailable-preview-alert-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\" />\n </svg>\n\n <div className=\"notificare__push__unavailable-preview-text-container\">\n <div className=\"notificare__push__unavailable-preview-title\">\n Preview could not be loaded\n </div>\n <div\n className=\"notificare__push__unavailable-preview-reason-text\"\n data-testid=\"notificare-push-unavailable-preview-reason-text\"\n >\n {message}\n </div>\n </div>\n </div>\n\n {showConsoleWarning && (\n <div className=\"notificare__push__unavailable-preview-check-console-text\">\n Check console for more information\n </div>\n )}\n </div>\n );\n}\n\ninterface UnavailablePreviewProps {\n message: string;\n showConsoleWarning: boolean;\n}\n","import './LoadingIcon.css';\n\nexport default function LoadingIcon() {\n return (\n <div className=\"notificare__push__webshot-loading-icon\" data-testid=\"loading-icon\">\n <svg\n className=\"notificare__push__webshot-loading-icon-svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n >\n <path\n d=\"M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z\"\n fill=\"#64706e\"\n />\n </svg>\n </div>\n );\n}\n","import './PreviewError.css';\n\nexport default function PreviewError({ message }: PreviewErrorProps) {\n return (\n <div className=\"notificare__push__preview-error\" data-testid=\"preview-error\">\n <svg\n className=\"notificare__push__preview-error-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\" />\n </svg>\n <p className=\"notificare__push__preview-error-text\">\n Preview could not be generated\n {message && (\n <>\n <br /> <br /> {message}\n </>\n )}\n </p>\n </div>\n );\n}\n\ninterface PreviewErrorProps {\n message?: string;\n}\n","import { useEffect, useState } from 'react';\nimport './Webshot.css';\nimport { getPushAPIHost } from '../../../../../config/api';\nimport { useOptions } from '../../OptionsProvider/OptionsProvider';\nimport LoadingIcon from '../LoadingIcon/LoadingIcon';\nimport PreviewError from '../PreviewError/PreviewError';\n\nexport default function Webshot({\n url,\n platform,\n width,\n height,\n onLoadingChange,\n canShow = true,\n}: WebshotProps) {\n const { serviceKey } = useOptions().options;\n\n const [webshot, setWebshot] = useState('');\n const [hasError, setHasError] = useState(false);\n const [isLoading, setIsLoading] = useState<boolean>(true);\n\n useEffect(() => {\n if (!serviceKey) {\n setHasError(true);\n console.error('The service key is missing');\n return;\n }\n\n if (!isValidUrl(url)) {\n setHasError(true);\n console.error('The URL is invalid');\n return;\n }\n\n setIsLoading(true);\n onLoadingChange?.(true);\n setHasError(false);\n\n let checkStatusLoop: NodeJS.Timeout;\n\n const debounce = setTimeout(async () => {\n try {\n const webshotId = await requestWebshot(url, width, height, platform, serviceKey);\n\n checkStatusLoop = setInterval(async () => {\n const webshotStatus = await getWebshotStatus(webshotId, serviceKey);\n\n if (webshotStatus === 'error') {\n setHasError(true);\n setIsLoading(false);\n onLoadingChange?.(false);\n clearInterval(checkStatusLoop);\n } else if (webshotStatus === 'finished') {\n const webshot = await getWebshot(webshotId, serviceKey);\n setWebshot(webshot);\n setIsLoading(false);\n onLoadingChange?.(false);\n clearInterval(checkStatusLoop);\n }\n }, 3000);\n } catch (error) {\n console.error(error);\n setHasError(true);\n setIsLoading(false);\n onLoadingChange?.(false);\n }\n }, 3000);\n\n return () => {\n clearTimeout(debounce);\n clearInterval(checkStatusLoop);\n };\n }, [url]);\n\n return (\n <div className=\"notificare__push__webshot-background\" style={{ width: width, height: height }}>\n {hasError ? (\n <PreviewError />\n ) : isLoading || !canShow ? (\n <LoadingIcon />\n ) : (\n <img src={webshot} alt=\"Webshot\" data-testid=\"webshot\" />\n )}\n </div>\n );\n}\n\ninterface WebshotProps {\n url: string;\n platform: 'Android' | 'iOS' | 'Web';\n width: number;\n height: number;\n onLoadingChange?: (isLoading: boolean) => void;\n canShow?: boolean;\n}\n\n/* Webshot requests */\n\nasync function requestWebshot(\n url: string,\n width: number,\n height: number,\n platform: 'Android' | 'iOS' | 'Web',\n serviceKey: string,\n) {\n const response = await fetch(`${getPushAPIHost()}/webshot?apiKey=${serviceKey}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n url: url,\n delay: 3000,\n platform: platform,\n type: 'png',\n params: {\n width: width,\n height: height,\n },\n }),\n });\n\n const data = await response.json();\n return data.webshot.id;\n}\n\nasync function getWebshotStatus(id: string, serviceKey: string) {\n const response = await fetch(`${getPushAPIHost()}/webshot/${id}?apiKey=${serviceKey}`);\n const data = await response.json();\n return data.webshot.status;\n}\n\nasync function getWebshot(id: string, serviceKey: string) {\n const response = await fetch(`${getPushAPIHost()}/webshot/${id}/result?apiKey=${serviceKey}`);\n\n const blob = await response.blob();\n return URL.createObjectURL(blob);\n}\n\n/* URL validation */\n\nfunction isValidUrl(url: string): boolean {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n","import './NavigationBar.css';\n\nexport default function NavigationBar({ appName, title, showOptions }: NavigationBarProps) {\n return (\n <div className=\"notificare__push__android__app-ui__navigation-bar\">\n <svg\n className=\"notificare__push__android__app-ui__navigation-bar-arrow-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 448 512\"\n >\n <path d=\"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z\" />\n </svg>\n <div className=\"notificare__push__android__app-ui__navigation-bar-title\">\n {title || appName}\n </div>\n\n {showOptions && (\n <svg\n className=\"notificare__push__android__app-ui__navigation-bar-options-button\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 128 512\"\n data-testid=\"android-app-ui-navigation-bar-options-button\"\n >\n <path d=\"M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z\" />\n </svg>\n )}\n </div>\n );\n}\n\ninterface NavigationBarProps {\n appName: string;\n title?: string;\n showOptions: boolean;\n}\n","import './AppRecommendationNotification.css';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport Webshot from '../../../shared-components/Webshot/Webshot';\nimport NavigationBar from '../NavigationBar/NavigationBar';\n\nexport default function AppRecommendationNotification({\n notification,\n appName,\n}: AppRecommendationNotificationProps) {\n return (\n <div data-testid=\"android-app-ui-app-recommendation-notification\">\n <NavigationBar appName={appName} title={notification.title} showOptions={false} />\n <Webshot\n url={getUrlByContentType(notification.content[0])}\n platform=\"Android\"\n width={338}\n height={570}\n />\n </div>\n );\n}\n\ninterface AppRecommendationNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Store' }>;\n appName: string;\n}\n\nfunction getUrlByContentType(\n content: Extract<\n NotificareNotificationSchema,\n { type: 're.notifica.notification.Store' }\n >['content'][number],\n) {\n switch (content.type) {\n case 're.notifica.content.GooglePlayDetails':\n return `https://play.google.com/store/apps/details?id=${content.data}`;\n\n case 're.notifica.content.GooglePlayDeveloper':\n return `https://play.google.com/store/apps/dev?id=${content.data}`;\n\n case 're.notifica.content.GooglePlayCollection':\n return `https://play.google.com/store/apps/collection/${content.data}`;\n\n case 're.notifica.content.GooglePlaySearch':\n return `https://play.google.com/store/search?q=${content.data}&c=apps`;\n\n default:\n return '';\n }\n}\n","import { NotificareNotificationSchema } from '../schemas/notificare-notification/notificare-notification-schema';\n\nexport function hasActions(notification: NotificareNotificationSchema) {\n return !!(notification.actions && notification.actions.length > 0);\n}\n\nexport function hasSingleAction(notification: NotificareNotificationSchema) {\n return !!(notification.actions && notification.actions.length === 1);\n}\n\nexport function hasMultipleActions(notification: NotificareNotificationSchema) {\n return !!(notification.actions && notification.actions.length > 1);\n}\n\nexport function hasFirstAttachment(notification: NotificareNotificationSchema) {\n return !!notification.attachments?.[0];\n}\n\nexport function getMarkersFromNotification(\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Map' }>,\n) {\n const markers: {\n title: string;\n latitude: number;\n longitude: number;\n }[] = [];\n\n notification.content.forEach((contentRow) => {\n markers.push({\n title: contentRow.data.title,\n latitude: contentRow.data.latitude,\n longitude: contentRow.data.longitude,\n });\n });\n\n return markers;\n}\n","import './DigitalCardNotification.css';\nimport { getPushAPIHost } from '../../../../../../config/api';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport Webshot from '../../../shared-components/Webshot/Webshot';\nimport NavigationBar from '../NavigationBar/NavigationBar';\n\nexport default function DigitalCardNotification({\n notification,\n appName,\n}: DigitalCardNotificationProps) {\n return (\n <div data-testid=\"android-app-ui-passbook-notification\">\n <NavigationBar\n appName={appName}\n title={notification.title}\n showOptions={hasActions(notification)}\n />\n <Webshot\n url={`${getPushAPIHost()}/pass/web/${notification.content[0].data.split('/')[5]}`}\n platform=\"Android\"\n width={338}\n height={570}\n />\n )\n </div>\n );\n}\n\ninterface DigitalCardNotificationProps {\n notification: Extract<\n NotificareNotificationSchema,\n { type: 're.notifica.notification.Passbook' }\n >;\n appName: string;\n}\n","import './ImagesNotification.css';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport NavigationBar from '../NavigationBar/NavigationBar';\n\nexport default function ImagesNotification({ notification, appName }: ImagesNotificationProps) {\n return (\n <div data-testid=\"android-app-ui-images-notification\">\n <NavigationBar\n appName={appName}\n title={notification.title}\n showOptions={hasActions(notification)}\n />\n <div className=\"notificare__push__android__image__app-ui__rich-content\">\n <div className=\"notificare__push__android__image__app-ui__image-slider\">\n {notification.content.map((image, index) => (\n <img\n key={index}\n className=\"notificare__push__android__image__app-ui__image-slider-item\"\n src={image.data}\n alt=\"Slider image\"\n />\n ))}\n </div>\n </div>\n </div>\n );\n}\n\ninterface ImagesNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Image' }>;\n appName: string;\n}\n","export function getUrlMainDomain(url: string) {\n try {\n const hostname = new URL(url).hostname;\n const parts = hostname.split('.');\n\n if (parts.length > 2) {\n return parts.slice(-2).join('.');\n }\n return hostname;\n } catch (e) {\n console.error('Invalid URL:', e);\n return '';\n }\n}\n","export function isSecureUrl(url: string): boolean {\n try {\n const protocol = new URL(url).protocol;\n return protocol === 'https:';\n } catch {\n return false;\n }\n}\n","import { useEffect, useState } from 'react';\nimport './InAppBrowserBar.css';\nimport { getPushAPIHost } from '../../../../../../../config/api';\nimport { getUrlMainDomain } from '../../../../../helpers/getURLMainDomain';\nimport { isSecureUrl } from '../../../../../helpers/isSecureURL';\nimport { useOptions } from '../../../../OptionsProvider/OptionsProvider';\n\nexport default function InAppBrowserBar({ url, onLoadingChange, canShow }: InAppBrowserBarProps) {\n const [pageTitle, setPageTitle] = useState('');\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const { serviceKey } = useOptions().options;\n\n useEffect(() => {\n (async () => {\n setIsLoading(true);\n\n const pageTitle = await getPageTitle(serviceKey, url);\n setPageTitle(pageTitle);\n\n setIsLoading(false);\n onLoadingChange?.(false);\n })();\n }, [url]);\n\n return (\n <div className=\"notificare__push__android__in-app-browser__app-ui__bar\">\n <svg\n className=\"notificare__push__android__in-app-browser__app-ui__x-mark-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n >\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\" />\n </svg>\n\n {isSecureUrl(url) ? (\n <svg\n className=\"notificare__push__android__in-app-browser__app-ui__bar-lock-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 448 512\"\n >\n <path d=\"M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z\" />\n </svg>\n ) : (\n <svg\n className=\"notificare__push__android__in-app-browser__app-ui__loading-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\" />\n </svg>\n )}\n\n <div className=\"notificare__push__android__in-app-browser__app-ui__bar-domain\">\n <p className=\"notificare__push__android__in-app-browser__app-ui__bar-text notificare__push__android__in-app-browser__app-ui__bar-text--title\">\n {!isLoading && canShow ? pageTitle : 'Loading...'}\n </p>\n <p className=\"notificare__push__android__in-app-browser__app-ui__bar-text notificare__push__android__in-app-browser__app-ui__bar-text--url\">\n {getUrlMainDomain(url)}\n </p>\n </div>\n </div>\n );\n}\n\ninterface InAppBrowserBarProps {\n url: string;\n onLoadingChange?: (isLoading: boolean) => void;\n canShow: boolean;\n}\n\nasync function getPageTitle(apiKey: string, url: string) {\n try {\n const params = new URLSearchParams({ apiKey, url });\n const response = await fetch(`${getPushAPIHost()}/proxy/?${params.toString()}`);\n const html = await response.text();\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, 'text/html');\n\n return doc.querySelector('title')?.textContent ?? '';\n } catch (error) {\n console.error('Error getting page title: ', error);\n return '';\n }\n}\n","import { useState } from 'react';\nimport './InAppBrowserNotification.css';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport Webshot from '../../../shared-components/Webshot/Webshot';\nimport InAppBrowserBar from './InAppBrowserBar/InAppBrowserBar';\n\nexport default function InAppBrowserNotification({ notification }: InAppBrowserNotificationProps) {\n const [isPageTitleLoading, setIsPageTitleLoading] = useState(true);\n const [isWebshotLoading, setIsWebshotLoading] = useState(true);\n\n const url = notification.content[0].data;\n\n return (\n <div data-testid=\"android-app-ui-in-app-browser-notification\">\n <InAppBrowserBar\n url={url}\n onLoadingChange={setIsPageTitleLoading}\n canShow={!isWebshotLoading}\n />\n <Webshot\n url={url}\n platform=\"Android\"\n width={338}\n height={570}\n onLoadingChange={setIsWebshotLoading}\n canShow={!isPageTitleLoading}\n />\n </div>\n );\n}\n\ninterface InAppBrowserNotificationProps {\n notification: Extract<\n NotificareNotificationSchema,\n { type: 're.notifica.notification.InAppBrowser' }\n >;\n appName: string;\n}\n","import './LockScreenNotification.css';\nimport { hasFirstAttachment } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\n\nexport default function LockScreenNotification({\n notification,\n appName,\n appIcon,\n expanded,\n}: AndroidLockScreenPushProps) {\n return (\n <div\n className=\"notificare__push__android__lock-screen\"\n data-testid=\"android-lock-screen-notification\"\n >\n <div className=\"notificare__push__android__lock-screen__app-icon\">\n <img\n className=\"notificare__push__android__lock-screen__app-icon-image\"\n alt=\"App icon\"\n src={appIcon}\n />\n </div>\n <div className=\"notificare__push__android__lock-screen__text-content\">\n <div className=\"notificare__push__android__lock-screen__text-content-top\">\n <div\n className={`notificare__push__android__lock-screen__title-and-subtitle ${hasFirstAttachment(notification) && !expanded ? 'notificare__push__android__lock-screen__title-and-subtitle--has-media' : ''}`}\n >\n <p className=\"notificare__push__android__lock-screen__text notificare__push__android__lock-screen__text--title\">\n {!expanded ? notification.title || appName : appName}\n </p>\n {notification.subtitle && !hasFirstAttachment(notification) && (\n <p className=\"notificare__push__android__lock-screen__text notificare__push__android__lock-screen__text--subtitle\">\n {notification.subtitle}\n </p>\n )}\n </div>\n <p className=\"notificare__push__android__lock-screen__text notificare__push__android__lock-screen__text--time\">\n now\n </p>\n </div>\n\n {expanded && (\n <p className=\"notificare__push__android__lock-screen__text notificare__push__android__lock-screen__text--expanded-title\">\n {notification.title}\n </p>\n )}\n\n <p\n className={`notificare__push__android__lock-screen__text ${expanded ? 'notificare__push__android__lock-screen__text--expanded-message' : ''} ${hasFirstAttachment(notification) && !expanded ? 'notificare__push__android__lock-screen__text--message-with-media' : 'notificare__push__android__lock-screen__text--message-without-media'}`}\n >\n {notification.message}\n </p>\n\n {hasFirstAttachment(notification) && expanded && (\n <div\n className=\"notificare__push__android__lock-screen__expanded-media\"\n data-testid=\"android-lock-screen-notification-expanded-media\"\n >\n <img\n className=\"notificare__push__android__lock-screen__expanded-media-image\"\n src={notification.attachments?.[0].uri}\n alt=\"Expanded media\"\n />\n </div>\n )}\n </div>\n\n {hasFirstAttachment(notification) && !expanded && (\n <div\n className=\"notificare__push__android__lock-screen__media\"\n data-testid=\"android-lock-screen-notification-media\"\n >\n <img\n className=\"notificare__push__android__lock-screen__media-image\"\n src={notification.attachments?.[0].uri}\n alt=\"Media icon\"\n />\n </div>\n )}\n </div>\n );\n}\n\nexport interface AndroidLockScreenPushProps {\n notification: NotificareNotificationSchema;\n appName: string;\n appIcon: string;\n expanded: boolean;\n}\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","import React, { useMemo, useState, useReducer, useCallback, useEffect, useRef, useContext, useLayoutEffect, forwardRef, useImperativeHandle, Children } from 'react';\nimport { createPortal } from 'react-dom';\nimport isDeepEqual from 'fast-deep-equal';\n\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nfunction _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\n\nconst APILoadingStatus = {\n NOT_LOADED: 'NOT_LOADED',\n LOADING: 'LOADING',\n LOADED: 'LOADED',\n FAILED: 'FAILED',\n AUTH_FAILURE: 'AUTH_FAILURE'\n};\n\nconst MAPS_API_BASE_URL = 'https://maps.googleapis.com/maps/api/js';\n/**\n * A GoogleMapsApiLoader to reliably load and unload the Google Maps JavaScript API.\n *\n * The actual loading and unloading is delayed into the microtask queue, to\n * allow using the API in an useEffect hook, without worrying about multiple API loads.\n */\nclass GoogleMapsApiLoader {\n /**\n * Loads the Maps JavaScript API with the specified parameters.\n * Since the Maps library can only be loaded once per page, this will\n * produce a warning when called multiple times with different\n * parameters.\n *\n * The returned promise resolves when loading completes\n * and rejects in case of an error or when the loading was aborted.\n */\n static async load(params, onLoadingStatusChange) {\n var _window$google;\n const libraries = params.libraries ? params.libraries.split(',') : [];\n const serializedParams = this.serializeParams(params);\n this.listeners.push(onLoadingStatusChange);\n // Note: if `google.maps.importLibrary` has been defined externally, we\n // assume that loading is complete and successful.\n // If it was defined by a previous call to this method, a warning\n // message is logged if there are differences in api-parameters used\n // for both calls.\n if ((_window$google = window.google) != null && (_window$google = _window$google.maps) != null && _window$google.importLibrary) {\n // no serialized parameters means it was loaded externally\n if (!this.serializedApiParams) {\n this.loadingStatus = APILoadingStatus.LOADED;\n }\n this.notifyLoadingStatusListeners();\n } else {\n this.serializedApiParams = serializedParams;\n this.initImportLibrary(params);\n }\n if (this.serializedApiParams && this.serializedApiParams !== serializedParams) {\n console.warn(`[google-maps-api-loader] The maps API has already been loaded ` + `with different parameters and will not be loaded again. Refresh the ` + `page for new values to have effect.`);\n }\n const librariesToLoad = ['maps', ...libraries];\n await Promise.all(librariesToLoad.map(name => google.maps.importLibrary(name)));\n }\n /**\n * Serialize the parameters used to load the library for easier comparison.\n */\n static serializeParams(params) {\n return [params.v, params.key, params.language, params.region, params.authReferrerPolicy, params.solutionChannel].join('/');\n }\n /**\n * Creates the global `google.maps.importLibrary` function for bootstrapping.\n * This is essentially a formatted version of the dynamic loading script\n * from the official documentation with some minor adjustments.\n *\n * The created importLibrary function will load the Google Maps JavaScript API,\n * which will then replace the `google.maps.importLibrary` function with the full\n * implementation.\n *\n * @see https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import\n */\n static initImportLibrary(params) {\n if (!window.google) window.google = {};\n if (!window.google.maps) window.google.maps = {};\n if (window.google.maps['importLibrary']) {\n console.error('[google-maps-api-loader-internal]: initImportLibrary must only be called once');\n return;\n }\n let apiPromise = null;\n const loadApi = () => {\n if (apiPromise) return apiPromise;\n apiPromise = new Promise((resolve, reject) => {\n var _document$querySelect;\n const scriptElement = document.createElement('script');\n const urlParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n const urlParamName = key.replace(/[A-Z]/g, t => '_' + t[0].toLowerCase());\n urlParams.set(urlParamName, String(value));\n }\n urlParams.set('loading', 'async');\n urlParams.set('callback', '__googleMapsCallback__');\n scriptElement.async = true;\n scriptElement.src = MAPS_API_BASE_URL + `?` + urlParams.toString();\n scriptElement.nonce = ((_document$querySelect = document.querySelector('script[nonce]')) == null ? void 0 : _document$querySelect.nonce) || '';\n scriptElement.onerror = () => {\n this.loadingStatus = APILoadingStatus.FAILED;\n this.notifyLoadingStatusListeners();\n reject(new Error('The Google Maps JavaScript API could not load.'));\n };\n window.__googleMapsCallback__ = () => {\n this.loadingStatus = APILoadingStatus.LOADED;\n this.notifyLoadingStatusListeners();\n resolve();\n };\n window.gm_authFailure = () => {\n this.loadingStatus = APILoadingStatus.AUTH_FAILURE;\n this.notifyLoadingStatusListeners();\n };\n this.loadingStatus = APILoadingStatus.LOADING;\n this.notifyLoadingStatusListeners();\n document.head.append(scriptElement);\n });\n return apiPromise;\n };\n // for the first load, we declare an importLibrary function that will\n // be overwritten once the api is loaded.\n google.maps.importLibrary = libraryName => loadApi().then(() => google.maps.importLibrary(libraryName));\n }\n /**\n * Calls all registered loadingStatusListeners after a status update.\n */\n static notifyLoadingStatusListeners() {\n for (const fn of this.listeners) {\n fn(this.loadingStatus);\n }\n }\n}\n/**\n * The current loadingStatus of the API.\n */\nGoogleMapsApiLoader.loadingStatus = APILoadingStatus.NOT_LOADED;\n/**\n * The parameters used for first loading the API.\n */\nGoogleMapsApiLoader.serializedApiParams = void 0;\n/**\n * A list of functions to be notified when the loading status changes.\n */\nGoogleMapsApiLoader.listeners = [];\n\nconst _excluded$3 = [\"onLoad\", \"onError\", \"apiKey\", \"version\", \"libraries\"],\n _excluded2$1 = [\"children\"];\nconst DEFAULT_SOLUTION_CHANNEL = 'GMP_visgl_rgmlibrary_v1_default';\nconst APIProviderContext = React.createContext(null);\n/**\n * local hook to set up the map-instance management context.\n */\nfunction useMapInstances() {\n const [mapInstances, setMapInstances] = useState({});\n const addMapInstance = (mapInstance, id = 'default') => {\n setMapInstances(instances => _extends({}, instances, {\n [id]: mapInstance\n }));\n };\n const removeMapInstance = (id = 'default') => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setMapInstances(_ref => {\n let remaining = _objectWithoutPropertiesLoose(_ref, [id].map(_toPropertyKey));\n return remaining;\n });\n };\n const clearMapInstances = () => {\n setMapInstances({});\n };\n return {\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances\n };\n}\n/**\n * local hook to handle the loading of the maps API, returns the current loading status\n * @param props\n */\nfunction useGoogleMapsApiLoader(props) {\n const {\n onLoad,\n onError,\n apiKey,\n version,\n libraries = []\n } = props,\n otherApiParams = _objectWithoutPropertiesLoose(props, _excluded$3);\n const [status, setStatus] = useState(GoogleMapsApiLoader.loadingStatus);\n const [loadedLibraries, addLoadedLibrary] = useReducer((loadedLibraries, action) => {\n return loadedLibraries[action.name] ? loadedLibraries : _extends({}, loadedLibraries, {\n [action.name]: action.value\n });\n }, {});\n const librariesString = useMemo(() => libraries == null ? void 0 : libraries.join(','), [libraries]);\n const serializedParams = useMemo(() => JSON.stringify(_extends({\n apiKey,\n version\n }, otherApiParams)), [apiKey, version, otherApiParams]);\n const importLibrary = useCallback(async name => {\n var _google;\n if (loadedLibraries[name]) {\n return loadedLibraries[name];\n }\n if (!((_google = google) != null && (_google = _google.maps) != null && _google.importLibrary)) {\n throw new Error('[api-provider-internal] importLibrary was called before ' + 'google.maps.importLibrary was defined.');\n }\n const res = await window.google.maps.importLibrary(name);\n addLoadedLibrary({\n name,\n value: res\n });\n return res;\n }, [loadedLibraries]);\n useEffect(() => {\n (async () => {\n try {\n const params = _extends({\n key: apiKey\n }, otherApiParams);\n if (version) params.v = version;\n if ((librariesString == null ? void 0 : librariesString.length) > 0) params.libraries = librariesString;\n if (params.channel === undefined || params.channel < 0 || params.channel > 999) delete params.channel;\n if (params.solutionChannel === undefined) params.solutionChannel = DEFAULT_SOLUTION_CHANNEL;else if (params.solutionChannel === '') delete params.solutionChannel;\n await GoogleMapsApiLoader.load(params, status => setStatus(status));\n for (const name of ['core', 'maps', ...libraries]) {\n await importLibrary(name);\n }\n if (onLoad) {\n onLoad();\n }\n } catch (error) {\n if (onError) {\n onError(error);\n } else {\n console.error('<ApiProvider> failed to load the Google Maps JavaScript API', error);\n }\n }\n })();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [apiKey, librariesString, serializedParams]);\n return {\n status,\n loadedLibraries,\n importLibrary\n };\n}\n/**\n * Component to wrap the components from this library and load the Google Maps JavaScript API\n */\nconst APIProvider = props => {\n const {\n children\n } = props,\n loaderProps = _objectWithoutPropertiesLoose(props, _excluded2$1);\n const {\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances\n } = useMapInstances();\n const {\n status,\n loadedLibraries,\n importLibrary\n } = useGoogleMapsApiLoader(loaderProps);\n const contextValue = useMemo(() => ({\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances,\n status,\n loadedLibraries,\n importLibrary\n }), [mapInstances, addMapInstance, removeMapInstance, clearMapInstances, status, loadedLibraries, importLibrary]);\n return /*#__PURE__*/React.createElement(APIProviderContext.Provider, {\n value: contextValue\n }, children);\n};\n\n/**\n * Sets up effects to bind event-handlers for all event-props in MapEventProps.\n * @internal\n */\nfunction useMapEvents(map, props) {\n // note: calling a useEffect hook from within a loop is prohibited by the\n // rules of hooks, but it's ok here since it's unconditional and the number\n // and order of iterations is always strictly the same.\n // (see https://legacy.reactjs.org/docs/hooks-rules.html)\n for (const propName of eventPropNames) {\n // fixme: this cast is essentially a 'trust me, bro' for typescript, but\n // a proper solution seems way too complicated right now\n const handler = props[propName];\n const eventType = propNameToEventType[propName];\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!map) return;\n if (!handler) return;\n const listener = google.maps.event.addListener(map, eventType, ev => {\n handler(createMapEvent(eventType, map, ev));\n });\n return () => listener.remove();\n }, [map, eventType, handler]);\n }\n}\n/**\n * Create the wrapped map-events used for the event-props.\n * @param type the event type as it is specified to the maps api\n * @param map the map instance the event originates from\n * @param srcEvent the source-event if there is one.\n */\nfunction createMapEvent(type, map, srcEvent) {\n const ev = {\n type,\n map,\n detail: {},\n stoppable: false,\n stop: () => {}\n };\n if (cameraEventTypes.includes(type)) {\n const camEvent = ev;\n const center = map.getCenter();\n const zoom = map.getZoom();\n const heading = map.getHeading() || 0;\n const tilt = map.getTilt() || 0;\n const bounds = map.getBounds();\n if (!center || !bounds || !Number.isFinite(zoom)) {\n console.warn('[createEvent] at least one of the values from the map ' + 'returned undefined. This is not expected to happen. Please ' + 'report an issue at https://github.com/visgl/react-google-maps/issues/new');\n }\n camEvent.detail = {\n center: (center == null ? void 0 : center.toJSON()) || {\n lat: 0,\n lng: 0\n },\n zoom: zoom || 0,\n heading: heading,\n tilt: tilt,\n bounds: (bounds == null ? void 0 : bounds.toJSON()) || {\n north: 90,\n east: 180,\n south: -90,\n west: -180\n }\n };\n return camEvent;\n } else if (mouseEventTypes.includes(type)) {\n var _srcEvent$latLng;\n if (!srcEvent) throw new Error('[createEvent] mouse events must provide a srcEvent');\n const mouseEvent = ev;\n mouseEvent.domEvent = srcEvent.domEvent;\n mouseEvent.stoppable = true;\n mouseEvent.stop = () => srcEvent.stop();\n mouseEvent.detail = {\n latLng: ((_srcEvent$latLng = srcEvent.latLng) == null ? void 0 : _srcEvent$latLng.toJSON()) || null,\n placeId: srcEvent.placeId\n };\n return mouseEvent;\n }\n return ev;\n}\n/**\n * maps the camelCased names of event-props to the corresponding event-types\n * used in the maps API.\n */\nconst propNameToEventType = {\n onBoundsChanged: 'bounds_changed',\n onCenterChanged: 'center_changed',\n onClick: 'click',\n onContextmenu: 'contextmenu',\n onDblclick: 'dblclick',\n onDrag: 'drag',\n onDragend: 'dragend',\n onDragstart: 'dragstart',\n onHeadingChanged: 'heading_changed',\n onIdle: 'idle',\n onIsFractionalZoomEnabledChanged: 'isfractionalzoomenabled_changed',\n onMapCapabilitiesChanged: 'mapcapabilities_changed',\n onMapTypeIdChanged: 'maptypeid_changed',\n onMousemove: 'mousemove',\n onMouseout: 'mouseout',\n onMouseover: 'mouseover',\n onProjectionChanged: 'projection_changed',\n onRenderingTypeChanged: 'renderingtype_changed',\n onTilesLoaded: 'tilesloaded',\n onTiltChanged: 'tilt_changed',\n onZoomChanged: 'zoom_changed',\n // note: onCameraChanged is an alias for the bounds_changed event,\n // since that is going to be fired in every situation where the camera is\n // updated.\n onCameraChanged: 'bounds_changed'\n};\nconst cameraEventTypes = ['bounds_changed', 'center_changed', 'heading_changed', 'tilt_changed', 'zoom_changed'];\nconst mouseEventTypes = ['click', 'contextmenu', 'dblclick', 'mousemove', 'mouseout', 'mouseover'];\nconst eventPropNames = Object.keys(propNameToEventType);\n\nfunction useDeepCompareEffect(effect, deps) {\n const ref = useRef(undefined);\n if (!ref.current || !isDeepEqual(deps, ref.current)) {\n ref.current = deps;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(effect, ref.current);\n}\n\nconst mapOptionKeys = new Set(['backgroundColor', 'clickableIcons', 'controlSize', 'disableDefaultUI', 'disableDoubleClickZoom', 'draggable', 'draggableCursor', 'draggingCursor', 'fullscreenControl', 'fullscreenControlOptions', 'gestureHandling', 'headingInteractionEnabled', 'isFractionalZoomEnabled', 'keyboardShortcuts', 'mapTypeControl', 'mapTypeControlOptions', 'mapTypeId', 'maxZoom', 'minZoom', 'noClear', 'panControl', 'panControlOptions', 'restriction', 'rotateControl', 'rotateControlOptions', 'scaleControl', 'scaleControlOptions', 'scrollwheel', 'streetView', 'streetViewControl', 'streetViewControlOptions', 'styles', 'tiltInteractionEnabled', 'zoomControl', 'zoomControlOptions']);\n/**\n * Internal hook to update the map-options when props are changed.\n *\n * @param map the map instance\n * @param mapProps the props to update the map-instance with\n * @internal\n */\nfunction useMapOptions(map, mapProps) {\n /* eslint-disable react-hooks/exhaustive-deps --\n *\n * The following effects aren't triggered when the map is changed.\n * In that case, the values will be or have been passed to the map\n * constructor via mapOptions.\n */\n const mapOptions = {};\n const keys = Object.keys(mapProps);\n for (const key of keys) {\n if (!mapOptionKeys.has(key)) continue;\n mapOptions[key] = mapProps[key];\n }\n // update the map options when mapOptions is changed\n // Note: due to the destructuring above, mapOptions will be seen as changed\n // with every re-render, so we're assuming the maps-api will properly\n // deal with unchanged option-values passed into setOptions.\n useDeepCompareEffect(() => {\n if (!map) return;\n map.setOptions(mapOptions);\n }, [mapOptions]);\n /* eslint-enable react-hooks/exhaustive-deps */\n}\n\nfunction useApiLoadingStatus() {\n var _useContext;\n return ((_useContext = useContext(APIProviderContext)) == null ? void 0 : _useContext.status) || APILoadingStatus.NOT_LOADED;\n}\n\n/**\n * Internal hook that updates the camera when deck.gl viewState changes.\n * @internal\n */\nfunction useDeckGLCameraUpdate(map, props) {\n const {\n viewport,\n viewState\n } = props;\n const isDeckGlControlled = !!viewport;\n useLayoutEffect(() => {\n if (!map || !viewState) return;\n const {\n latitude,\n longitude,\n bearing: heading,\n pitch: tilt,\n zoom\n } = viewState;\n map.moveCamera({\n center: {\n lat: latitude,\n lng: longitude\n },\n heading,\n tilt,\n zoom: zoom + 1\n });\n }, [map, viewState]);\n return isDeckGlControlled;\n}\n\nfunction isLatLngLiteral(obj) {\n if (!obj || typeof obj !== 'object') return false;\n if (!('lat' in obj && 'lng' in obj)) return false;\n return Number.isFinite(obj.lat) && Number.isFinite(obj.lng);\n}\nfunction latLngEquals(a, b) {\n if (!a || !b) return false;\n const A = toLatLngLiteral(a);\n const B = toLatLngLiteral(b);\n if (A.lat !== B.lat || A.lng !== B.lng) return false;\n return true;\n}\nfunction toLatLngLiteral(obj) {\n if (isLatLngLiteral(obj)) return obj;\n return obj.toJSON();\n}\n\nfunction useMapCameraParams(map, cameraStateRef, mapProps) {\n const center = mapProps.center ? toLatLngLiteral(mapProps.center) : null;\n let lat = null;\n let lng = null;\n if (center && Number.isFinite(center.lat) && Number.isFinite(center.lng)) {\n lat = center.lat;\n lng = center.lng;\n }\n const zoom = Number.isFinite(mapProps.zoom) ? mapProps.zoom : null;\n const heading = Number.isFinite(mapProps.heading) ? mapProps.heading : null;\n const tilt = Number.isFinite(mapProps.tilt) ? mapProps.tilt : null;\n // the following effect runs for every render of the map component and checks\n // if there are differences between the known state of the map instance\n // (cameraStateRef, which is updated by all bounds_changed events) and the\n // desired state in the props.\n useLayoutEffect(() => {\n if (!map) return;\n const nextCamera = {};\n let needsUpdate = false;\n if (lat !== null && lng !== null && (cameraStateRef.current.center.lat !== lat || cameraStateRef.current.center.lng !== lng)) {\n nextCamera.center = {\n lat,\n lng\n };\n needsUpdate = true;\n }\n if (zoom !== null && cameraStateRef.current.zoom !== zoom) {\n nextCamera.zoom = zoom;\n needsUpdate = true;\n }\n if (heading !== null && cameraStateRef.current.heading !== heading) {\n nextCamera.heading = heading;\n needsUpdate = true;\n }\n if (tilt !== null && cameraStateRef.current.tilt !== tilt) {\n nextCamera.tilt = tilt;\n needsUpdate = true;\n }\n if (needsUpdate) {\n map.moveCamera(nextCamera);\n }\n });\n}\n\nconst AuthFailureMessage = () => {\n const style = {\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n zIndex: 999,\n display: 'flex',\n flexFlow: 'column nowrap',\n textAlign: 'center',\n justifyContent: 'center',\n fontSize: '.8rem',\n color: 'rgba(0,0,0,0.6)',\n background: '#dddddd',\n padding: '1rem 1.5rem'\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n style: style\n }, /*#__PURE__*/React.createElement(\"h2\", null, \"Error: AuthFailure\"), /*#__PURE__*/React.createElement(\"p\", null, \"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the \", /*#__PURE__*/React.createElement(\"code\", null, \"APIProvider.apiKey\"), \" prop is correct. Check the error-message in the console for further details.\"));\n};\n\nfunction useCallbackRef() {\n const [el, setEl] = useState(null);\n const ref = useCallback(value => setEl(value), [setEl]);\n return [el, ref];\n}\n\n/**\n * Hook to check if the Maps JavaScript API is loaded\n */\nfunction useApiIsLoaded() {\n const status = useApiLoadingStatus();\n return status === APILoadingStatus.LOADED;\n}\n\nfunction useForceUpdate() {\n const [, forceUpdate] = useReducer(x => x + 1, 0);\n return forceUpdate;\n}\n\nfunction handleBoundsChange(map, ref) {\n const center = map.getCenter();\n const zoom = map.getZoom();\n const heading = map.getHeading() || 0;\n const tilt = map.getTilt() || 0;\n const bounds = map.getBounds();\n if (!center || !bounds || !Number.isFinite(zoom)) {\n console.warn('[useTrackedCameraState] at least one of the values from the map ' + 'returned undefined. This is not expected to happen. Please ' + 'report an issue at https://github.com/visgl/react-google-maps/issues/new');\n }\n // fixme: do we need the `undefined` cases for the camera-params? When are they used in the maps API?\n Object.assign(ref.current, {\n center: (center == null ? void 0 : center.toJSON()) || {\n lat: 0,\n lng: 0\n },\n zoom: zoom || 0,\n heading: heading,\n tilt: tilt\n });\n}\n/**\n * Creates a mutable ref object to track the last known state of the map camera.\n * This is used in `useMapCameraParams` to reduce stuttering in normal operation\n * by avoiding updates of the map camera with values that have already been processed.\n */\nfunction useTrackedCameraStateRef(map) {\n const forceUpdate = useForceUpdate();\n const ref = useRef({\n center: {\n lat: 0,\n lng: 0\n },\n heading: 0,\n tilt: 0,\n zoom: 0\n });\n // Record camera state with every bounds_changed event dispatched by the map.\n // This data is used to prevent feeding these values back to the\n // map-instance when a typical \"controlled component\" setup (state variable is\n // fed into and updated by the map).\n useEffect(() => {\n if (!map) return;\n const listener = google.maps.event.addListener(map, 'bounds_changed', () => {\n handleBoundsChange(map, ref);\n // When an event is occured, we have to update during the next cycle.\n // The application could decide to ignore the event and not update any\n // camera props of the map, meaning that in that case we will have to\n // 'undo' the change to the camera.\n forceUpdate();\n });\n return () => listener.remove();\n }, [map, forceUpdate]);\n return ref;\n}\n\nconst _excluded$2 = [\"id\", \"defaultBounds\", \"defaultCenter\", \"defaultZoom\", \"defaultHeading\", \"defaultTilt\", \"reuseMaps\", \"renderingType\", \"colorScheme\"],\n _excluded2 = [\"padding\"];\n/**\n * Stores a stack of map-instances for each mapId. Whenever an\n * instance is used, it is removed from the stack while in use,\n * and returned to the stack when the component unmounts.\n * This allows us to correctly implement caching for multiple\n * maps om the same page, while reusing as much as possible.\n *\n * FIXME: while it should in theory be possible to reuse maps solely\n * based on the mapId (as all other parameters can be changed at\n * runtime), we don't yet have good enough tracking of options to\n * reliably unset all the options that have been set.\n */\nclass CachedMapStack {\n static has(key) {\n return this.entries[key] && this.entries[key].length > 0;\n }\n static pop(key) {\n if (!this.entries[key]) return null;\n return this.entries[key].pop() || null;\n }\n static push(key, value) {\n if (!this.entries[key]) this.entries[key] = [];\n this.entries[key].push(value);\n }\n}\n/**\n * The main hook takes care of creating map-instances and registering them in\n * the api-provider context.\n * @return a tuple of the map-instance created (or null) and the callback\n * ref that will be used to pass the map-container into this hook.\n * @internal\n */\nCachedMapStack.entries = {};\nfunction useMapInstance(props, context) {\n const apiIsLoaded = useApiIsLoaded();\n const [map, setMap] = useState(null);\n const [container, containerRef] = useCallbackRef();\n const cameraStateRef = useTrackedCameraStateRef(map);\n const {\n id,\n defaultBounds,\n defaultCenter,\n defaultZoom,\n defaultHeading,\n defaultTilt,\n reuseMaps,\n renderingType,\n colorScheme\n } = props,\n mapOptions = _objectWithoutPropertiesLoose(props, _excluded$2);\n const hasZoom = props.zoom !== undefined || props.defaultZoom !== undefined;\n const hasCenter = props.center !== undefined || props.defaultCenter !== undefined;\n if (!defaultBounds && (!hasZoom || !hasCenter)) {\n console.warn('<Map> component is missing configuration. ' + 'You have to provide zoom and center (via the `zoom`/`defaultZoom` and ' + '`center`/`defaultCenter` props) or specify the region to show using ' + '`defaultBounds`. See ' + 'https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required');\n }\n // apply default camera props if available and not overwritten by controlled props\n if (!mapOptions.center && defaultCenter) mapOptions.center = defaultCenter;\n if (!mapOptions.zoom && Number.isFinite(defaultZoom)) mapOptions.zoom = defaultZoom;\n if (!mapOptions.heading && Number.isFinite(defaultHeading)) mapOptions.heading = defaultHeading;\n if (!mapOptions.tilt && Number.isFinite(defaultTilt)) mapOptions.tilt = defaultTilt;\n for (const key of Object.keys(mapOptions)) if (mapOptions[key] === undefined) delete mapOptions[key];\n const savedMapStateRef = useRef(undefined);\n // create the map instance and register it in the context\n useEffect(() => {\n if (!container || !apiIsLoaded) return;\n const {\n addMapInstance,\n removeMapInstance\n } = context;\n // note: colorScheme (upcoming feature) isn't yet in the typings, remove once that is fixed:\n const {\n mapId\n } = props;\n const cacheKey = `${mapId || 'default'}:${renderingType || 'default'}:${colorScheme || 'LIGHT'}`;\n let mapDiv;\n let map;\n if (reuseMaps && CachedMapStack.has(cacheKey)) {\n map = CachedMapStack.pop(cacheKey);\n mapDiv = map.getDiv();\n container.appendChild(mapDiv);\n map.setOptions(mapOptions);\n // detaching the element from the DOM lets the map fall back to its default\n // size, setting the center will trigger reloading the map.\n setTimeout(() => map.setCenter(map.getCenter()), 0);\n } else {\n mapDiv = document.createElement('div');\n mapDiv.style.height = '100%';\n container.appendChild(mapDiv);\n map = new google.maps.Map(mapDiv, _extends({}, mapOptions, renderingType ? {\n renderingType: renderingType\n } : {}, colorScheme ? {\n colorScheme: colorScheme\n } : {}));\n }\n setMap(map);\n addMapInstance(map, id);\n if (defaultBounds) {\n const {\n padding\n } = defaultBounds,\n defBounds = _objectWithoutPropertiesLoose(defaultBounds, _excluded2);\n map.fitBounds(defBounds, padding);\n }\n // prevent map not rendering due to missing configuration\n else if (!hasZoom || !hasCenter) {\n map.fitBounds({\n east: 180,\n west: -180,\n south: -90,\n north: 90\n });\n }\n // the savedMapState is used to restore the camera parameters when the mapId is changed\n if (savedMapStateRef.current) {\n const {\n mapId: savedMapId,\n cameraState: savedCameraState\n } = savedMapStateRef.current;\n if (savedMapId !== mapId) {\n map.setOptions(savedCameraState);\n }\n }\n return () => {\n savedMapStateRef.current = {\n mapId,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n cameraState: cameraStateRef.current\n };\n // detach the map-div from the dom\n mapDiv.remove();\n if (reuseMaps) {\n // push back on the stack\n CachedMapStack.push(cacheKey, map);\n } else {\n // remove all event-listeners to minimize the possibility of memory-leaks\n google.maps.event.clearInstanceListeners(map);\n }\n setMap(null);\n removeMapInstance(id);\n };\n },\n // some dependencies are ignored in the list below:\n // - defaultBounds and the default* camera props will only be used once, and\n // changes should be ignored\n // - mapOptions has special hooks that take care of updating the options\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [container, apiIsLoaded, id,\n // these props can't be changed after initialization and require a new\n // instance to be created\n props.mapId, props.renderingType, props.colorScheme]);\n return [map, containerRef, cameraStateRef];\n}\n\nconst GoogleMapsContext = React.createContext(null);\n// ColorScheme and RenderingType are redefined here to make them usable before the\n// maps API has been fully loaded.\nconst ColorScheme = {\n DARK: 'DARK',\n LIGHT: 'LIGHT',\n FOLLOW_SYSTEM: 'FOLLOW_SYSTEM'\n};\nconst RenderingType = {\n VECTOR: 'VECTOR',\n RASTER: 'RASTER',\n UNINITIALIZED: 'UNINITIALIZED'\n};\nconst Map = props => {\n const {\n children,\n id,\n className,\n style\n } = props;\n const context = useContext(APIProviderContext);\n const loadingStatus = useApiLoadingStatus();\n if (!context) {\n throw new Error('<Map> can only be used inside an <ApiProvider> component.');\n }\n const [map, mapRef, cameraStateRef] = useMapInstance(props, context);\n useMapCameraParams(map, cameraStateRef, props);\n useMapEvents(map, props);\n useMapOptions(map, props);\n const isDeckGlControlled = useDeckGLCameraUpdate(map, props);\n const isControlledExternally = !!props.controlled;\n // disable interactions with the map for externally controlled maps\n useEffect(() => {\n if (!map) return;\n // fixme: this doesn't seem to belong here (and it's mostly there for convenience anyway).\n // The reasoning is that a deck.gl canvas will be put on top of the map, rendering\n // any default map controls pretty much useless\n if (isDeckGlControlled) {\n map.setOptions({\n disableDefaultUI: true\n });\n }\n // disable all control-inputs when the map is controlled externally\n if (isDeckGlControlled || isControlledExternally) {\n map.setOptions({\n gestureHandling: 'none',\n keyboardShortcuts: false\n });\n }\n return () => {\n map.setOptions({\n gestureHandling: props.gestureHandling,\n keyboardShortcuts: props.keyboardShortcuts\n });\n };\n }, [map, isDeckGlControlled, isControlledExternally, props.gestureHandling, props.keyboardShortcuts]);\n // setup a stable cameraOptions object that can be used as dependency\n const center = props.center ? toLatLngLiteral(props.center) : null;\n let lat = null;\n let lng = null;\n if (center && Number.isFinite(center.lat) && Number.isFinite(center.lng)) {\n lat = center.lat;\n lng = center.lng;\n }\n const cameraOptions = useMemo(() => {\n var _lat, _lng, _props$zoom, _props$heading, _props$tilt;\n return {\n center: {\n lat: (_lat = lat) != null ? _lat : 0,\n lng: (_lng = lng) != null ? _lng : 0\n },\n zoom: (_props$zoom = props.zoom) != null ? _props$zoom : 0,\n heading: (_props$heading = props.heading) != null ? _props$heading : 0,\n tilt: (_props$tilt = props.tilt) != null ? _props$tilt : 0\n };\n }, [lat, lng, props.zoom, props.heading, props.tilt]);\n // externally controlled mode: reject all camera changes that don't correspond to changes in props\n useLayoutEffect(() => {\n if (!map || !isControlledExternally) return;\n map.moveCamera(cameraOptions);\n const listener = map.addListener('bounds_changed', () => {\n map.moveCamera(cameraOptions);\n });\n return () => listener.remove();\n }, [map, isControlledExternally, cameraOptions]);\n const combinedStyle = useMemo(() => _extends({\n width: '100%',\n height: '100%',\n position: 'relative',\n // when using deckgl, the map should be sent to the back\n zIndex: isDeckGlControlled ? -1 : 0\n }, style), [style, isDeckGlControlled]);\n const contextValue = useMemo(() => ({\n map\n }), [map]);\n if (loadingStatus === APILoadingStatus.AUTH_FAILURE) {\n return /*#__PURE__*/React.createElement(\"div\", {\n style: _extends({\n position: 'relative'\n }, className ? {} : combinedStyle),\n className: className\n }, /*#__PURE__*/React.createElement(AuthFailureMessage, null));\n }\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: mapRef,\n \"data-testid\": 'map',\n style: className ? undefined : combinedStyle,\n className: className\n }, id ? {\n id\n } : {}), map ? /*#__PURE__*/React.createElement(GoogleMapsContext.Provider, {\n value: contextValue\n }, children) : null);\n};\n// The deckGLViewProps flag here indicates to deck.gl that the Map component is\n// able to handle viewProps from deck.gl when deck.gl is used to control the map.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nMap.deckGLViewProps = true;\n\nconst shownMessages = new Set();\nfunction logErrorOnce(...args) {\n const key = JSON.stringify(args);\n if (!shownMessages.has(key)) {\n shownMessages.add(key);\n console.error(...args);\n }\n}\n\n/**\n * Retrieves a map-instance from the context. This is either an instance\n * identified by id or the parent map instance if no id is specified.\n * Returns null if neither can be found.\n */\nconst useMap = (id = null) => {\n const ctx = useContext(APIProviderContext);\n const {\n map\n } = useContext(GoogleMapsContext) || {};\n if (ctx === null) {\n logErrorOnce('useMap(): failed to retrieve APIProviderContext. ' + 'Make sure that the <APIProvider> component exists and that the ' + 'component you are calling `useMap()` from is a sibling of the ' + '<APIProvider>.');\n return null;\n }\n const {\n mapInstances\n } = ctx;\n // if an id is specified, the corresponding map or null is returned\n if (id !== null) return mapInstances[id] || null;\n // otherwise, return the closest ancestor\n if (map) return map;\n // finally, return the default map instance\n return mapInstances['default'] || null;\n};\n\nfunction useMapsLibrary(name) {\n const apiIsLoaded = useApiIsLoaded();\n const ctx = useContext(APIProviderContext);\n useEffect(() => {\n if (!apiIsLoaded || !ctx) return;\n // Trigger loading the libraries via our proxy-method.\n // The returned promise is ignored, since importLibrary will update loadedLibraries\n // list in the context, triggering a re-render.\n void ctx.importLibrary(name);\n }, [apiIsLoaded, ctx, name]);\n return (ctx == null ? void 0 : ctx.loadedLibraries[name]) || null;\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Internally used to bind events to Maps JavaScript API objects.\n * @internal\n */\nfunction useMapsEventListener(target, name, callback) {\n useEffect(() => {\n if (!target || !name || !callback) return;\n const listener = google.maps.event.addListener(target, name, callback);\n return () => listener.remove();\n }, [target, name, callback]);\n}\n\n/**\n * Internally used to copy values from props into API-Objects\n * whenever they change.\n *\n * @example\n * usePropBinding(marker, 'position', position);\n *\n * @internal\n */\nfunction usePropBinding(object, prop, value) {\n useEffect(() => {\n if (!object) return;\n object[prop] = value;\n }, [object, prop, value]);\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Internally used to bind events to DOM nodes.\n * @internal\n */\nfunction useDomEventListener(target, name, callback) {\n useEffect(() => {\n if (!target || !name || !callback) return;\n target.addEventListener(name, callback);\n return () => target.removeEventListener(name, callback);\n }, [target, name, callback]);\n}\n\n/* eslint-disable complexity */\nfunction isAdvancedMarker(marker) {\n return marker.content !== undefined;\n}\nfunction isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Copy of the `google.maps.CollisionBehavior` constants.\n * They have to be duplicated here since we can't wait for the maps API to load to be able to use them.\n */\nconst CollisionBehavior = {\n REQUIRED: 'REQUIRED',\n REQUIRED_AND_HIDES_OPTIONAL: 'REQUIRED_AND_HIDES_OPTIONAL',\n OPTIONAL_AND_HIDES_LOWER_PRIORITY: 'OPTIONAL_AND_HIDES_LOWER_PRIORITY'\n};\nconst AdvancedMarkerContext = React.createContext(null);\n// [xPosition, yPosition] when the top left corner is [0, 0]\nconst AdvancedMarkerAnchorPoint = {\n TOP_LEFT: ['0%', '0%'],\n TOP_CENTER: ['50%', '0%'],\n TOP: ['50%', '0%'],\n TOP_RIGHT: ['100%', '0%'],\n LEFT_CENTER: ['0%', '50%'],\n LEFT_TOP: ['0%', '0%'],\n LEFT: ['0%', '50%'],\n LEFT_BOTTOM: ['0%', '100%'],\n RIGHT_TOP: ['100%', '0%'],\n RIGHT: ['100%', '50%'],\n RIGHT_CENTER: ['100%', '50%'],\n RIGHT_BOTTOM: ['100%', '100%'],\n BOTTOM_LEFT: ['0%', '100%'],\n BOTTOM_CENTER: ['50%', '100%'],\n BOTTOM: ['50%', '100%'],\n BOTTOM_RIGHT: ['100%', '100%'],\n CENTER: ['50%', '50%']\n};\nconst MarkerContent = ({\n children,\n styles,\n className,\n anchorPoint\n}) => {\n const [xTranslation, yTranslation] = anchorPoint != null ? anchorPoint : AdvancedMarkerAnchorPoint['BOTTOM'];\n let xTranslationFlipped = `-${xTranslation}`;\n let yTranslationFlipped = `-${yTranslation}`;\n if (xTranslation.trimStart().startsWith('-')) {\n xTranslationFlipped = xTranslation.substring(1);\n }\n if (yTranslation.trimStart().startsWith('-')) {\n yTranslationFlipped = yTranslation.substring(1);\n }\n // The \"translate(50%, 100%)\" is here to counter and reset the default anchoring of the advanced marker element\n // that comes from the api\n const transformStyle = `translate(50%, 100%) translate(${xTranslationFlipped}, ${yTranslationFlipped})`;\n return (\n /*#__PURE__*/\n // anchoring container\n React.createElement(\"div\", {\n style: {\n transform: transformStyle\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: styles\n }, children))\n );\n};\nfunction useAdvancedMarker(props) {\n const [marker, setMarker] = useState(null);\n const [contentContainer, setContentContainer] = useState(null);\n const map = useMap();\n const markerLibrary = useMapsLibrary('marker');\n const {\n children,\n onClick,\n className,\n onMouseEnter,\n onMouseLeave,\n onDrag,\n onDragStart,\n onDragEnd,\n collisionBehavior,\n clickable,\n draggable,\n position,\n title,\n zIndex\n } = props;\n const numChildren = Children.count(children);\n // create an AdvancedMarkerElement instance and add it to the map once available\n useEffect(() => {\n if (!map || !markerLibrary) return;\n const newMarker = new markerLibrary.AdvancedMarkerElement();\n newMarker.map = map;\n setMarker(newMarker);\n // create the container for marker content if there are children\n let contentElement = null;\n if (numChildren > 0) {\n contentElement = document.createElement('div');\n // We need some kind of flag to identify the custom marker content\n // in the infowindow component. Choosing a custom property instead of a className\n // to not encourage users to style the marker content directly.\n contentElement.isCustomMarker = true;\n newMarker.content = contentElement;\n setContentContainer(contentElement);\n }\n return () => {\n var _contentElement;\n newMarker.map = null;\n (_contentElement = contentElement) == null || _contentElement.remove();\n setMarker(null);\n setContentContainer(null);\n };\n }, [map, markerLibrary, numChildren]);\n // When no children are present we don't have our own wrapper div\n // which usually gets the user provided className. In this case\n // we set the className directly on the marker.content element that comes\n // with the AdvancedMarker.\n useEffect(() => {\n if (!marker || !marker.content || numChildren > 0) return;\n marker.content.className = className || '';\n }, [marker, className, numChildren]);\n // copy other props\n usePropBinding(marker, 'position', position);\n usePropBinding(marker, 'title', title != null ? title : '');\n usePropBinding(marker, 'zIndex', zIndex);\n usePropBinding(marker, 'collisionBehavior', collisionBehavior);\n // set gmpDraggable from props (when unspecified, it's true if any drag-event\n // callbacks are specified)\n useEffect(() => {\n if (!marker) return;\n if (draggable !== undefined) marker.gmpDraggable = draggable;else if (onDrag || onDragStart || onDragEnd) marker.gmpDraggable = true;else marker.gmpDraggable = false;\n }, [marker, draggable, onDrag, onDragEnd, onDragStart]);\n // set gmpClickable from props (when unspecified, it's true if the onClick or one of\n // the hover events callbacks are specified)\n useEffect(() => {\n if (!marker) return;\n const gmpClickable = clickable !== undefined || Boolean(onClick) || Boolean(onMouseEnter) || Boolean(onMouseLeave);\n // gmpClickable is only available in beta version of the\n // maps api (as of 2024-10-10)\n marker.gmpClickable = gmpClickable;\n // enable pointer events for the markers with custom content\n if (gmpClickable && marker != null && marker.content && isElementNode(marker.content)) {\n marker.content.style.pointerEvents = 'none';\n if (marker.content.firstElementChild) {\n marker.content.firstElementChild.style.pointerEvents = 'all';\n }\n }\n }, [marker, clickable, onClick, onMouseEnter, onMouseLeave]);\n useMapsEventListener(marker, 'click', onClick);\n useMapsEventListener(marker, 'drag', onDrag);\n useMapsEventListener(marker, 'dragstart', onDragStart);\n useMapsEventListener(marker, 'dragend', onDragEnd);\n useDomEventListener(marker == null ? void 0 : marker.element, 'mouseenter', onMouseEnter);\n useDomEventListener(marker == null ? void 0 : marker.element, 'mouseleave', onMouseLeave);\n return [marker, contentContainer];\n}\nconst AdvancedMarker = forwardRef((props, ref) => {\n const {\n children,\n style,\n className,\n anchorPoint\n } = props;\n const [marker, contentContainer] = useAdvancedMarker(props);\n const advancedMarkerContextValue = useMemo(() => marker ? {\n marker\n } : null, [marker]);\n useImperativeHandle(ref, () => marker, [marker]);\n if (!contentContainer) return null;\n return /*#__PURE__*/React.createElement(AdvancedMarkerContext.Provider, {\n value: advancedMarkerContextValue\n }, createPortal(/*#__PURE__*/React.createElement(MarkerContent, {\n anchorPoint: anchorPoint,\n styles: style,\n className: className\n }, children), contentContainer));\n});\nfunction useAdvancedMarkerRef() {\n const [marker, setMarker] = useState(null);\n const refCallback = useCallback(m => {\n setMarker(m);\n }, []);\n return [refCallback, marker];\n}\n\nfunction setValueForStyles(element, styles, prevStyles) {\n if (styles != null && typeof styles !== 'object') {\n throw new Error('The `style` prop expects a mapping from style properties to values, ' + \"not a string. For example, style={{marginRight: spacing + 'em'}} when \" + 'using JSX.');\n }\n const elementStyle = element.style;\n // without `prevStyles`, just set all values\n if (prevStyles == null) {\n if (styles == null) return;\n for (const styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) continue;\n setValueForStyle(elementStyle, styleName, styles[styleName]);\n }\n return;\n }\n // unset all styles in `prevStyles` that aren't in `styles`\n for (const styleName in prevStyles) {\n if (prevStyles.hasOwnProperty(styleName) && (styles == null || !styles.hasOwnProperty(styleName))) {\n // Clear style\n const isCustomProperty = styleName.indexOf('--') === 0;\n if (isCustomProperty) {\n elementStyle.setProperty(styleName, '');\n } else if (styleName === 'float') {\n elementStyle.cssFloat = '';\n } else {\n elementStyle[styleName] = '';\n }\n }\n }\n // only assign values from `styles` that are different from `prevStyles`\n if (styles == null) return;\n for (const styleName in styles) {\n const value = styles[styleName];\n if (styles.hasOwnProperty(styleName) && prevStyles[styleName] !== value) {\n setValueForStyle(elementStyle, styleName, value);\n }\n }\n}\nfunction setValueForStyle(elementStyle, styleName, value) {\n const isCustomProperty = styleName.indexOf('--') === 0;\n // falsy values will unset the style property\n if (value == null || typeof value === 'boolean' || value === '') {\n if (isCustomProperty) {\n elementStyle.setProperty(styleName, '');\n } else if (styleName === 'float') {\n elementStyle.cssFloat = '';\n } else {\n elementStyle[styleName] = '';\n }\n }\n // custom properties can't be directly assigned\n else if (isCustomProperty) {\n elementStyle.setProperty(styleName, value);\n }\n // numeric values are treated as 'px' unless the style property expects unitless numbers\n else if (typeof value === 'number' && value !== 0 && !isUnitlessNumber(styleName)) {\n elementStyle[styleName] = value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n // everything else can just be assigned\n else {\n if (styleName === 'float') {\n elementStyle.cssFloat = value;\n } else {\n elementStyle[styleName] = ('' + value).trim();\n }\n }\n}\n// CSS properties which accept numbers but are not in units of \"px\".\nconst unitlessNumbers = new Set(['animationIterationCount', 'aspectRatio', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'columns', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'gridArea', 'gridRow', 'gridRowEnd', 'gridRowSpan', 'gridRowStart', 'gridColumn', 'gridColumnEnd', 'gridColumnSpan', 'gridColumnStart', 'fontWeight', 'lineClamp', 'lineHeight', 'opacity', 'order', 'orphans', 'scale', 'tabSize', 'widows', 'zIndex', 'zoom', 'fillOpacity',\n// SVG-related properties\n'floodOpacity', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth']);\nfunction isUnitlessNumber(name) {\n return unitlessNumbers.has(name);\n}\n\nconst _excluded$1 = [\"children\", \"headerContent\", \"style\", \"className\", \"pixelOffset\", \"anchor\", \"shouldFocus\", \"onClose\", \"onCloseClick\"];\n/**\n * Component to render an Info Window with the Maps JavaScript API\n */\nconst InfoWindow = props => {\n const {\n // content options\n children,\n headerContent,\n style,\n className,\n pixelOffset,\n // open options\n anchor,\n shouldFocus,\n // events\n onClose,\n onCloseClick\n // other options\n } = props,\n infoWindowOptions = _objectWithoutPropertiesLoose(props, _excluded$1);\n // ## create infowindow instance once the mapsLibrary is available.\n const mapsLibrary = useMapsLibrary('maps');\n const [infoWindow, setInfoWindow] = useState(null);\n const contentContainerRef = useRef(null);\n const headerContainerRef = useRef(null);\n useEffect(() => {\n if (!mapsLibrary) return;\n contentContainerRef.current = document.createElement('div');\n headerContainerRef.current = document.createElement('div');\n const opts = infoWindowOptions;\n if (pixelOffset) {\n opts.pixelOffset = new google.maps.Size(pixelOffset[0], pixelOffset[1]);\n }\n if (headerContent) {\n // if headerContent is specified as string we can directly forward it,\n // otherwise we'll pass the element the portal will render into\n opts.headerContent = typeof headerContent === 'string' ? headerContent : headerContainerRef.current;\n }\n // intentionally shadowing the state variables here\n const infoWindow = new google.maps.InfoWindow(infoWindowOptions);\n infoWindow.setContent(contentContainerRef.current);\n setInfoWindow(infoWindow);\n // unmount: remove infoWindow and content elements (note: close is called in a different effect-cleanup)\n return () => {\n var _contentContainerRef$, _headerContainerRef$c;\n infoWindow.setContent(null);\n (_contentContainerRef$ = contentContainerRef.current) == null || _contentContainerRef$.remove();\n (_headerContainerRef$c = headerContainerRef.current) == null || _headerContainerRef$c.remove();\n contentContainerRef.current = null;\n headerContainerRef.current = null;\n setInfoWindow(null);\n };\n },\n // `infoWindowOptions` and other props are missing from dependencies:\n //\n // We don't want to re-create the infowindow instance\n // when the options change.\n // Updating the options is handled in the useEffect below.\n //\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [mapsLibrary]);\n // ## update className and styles for `contentContainer`\n // stores previously applied style properties, so they can be removed when unset\n const prevStyleRef = useRef(null);\n useEffect(() => {\n if (!infoWindow || !contentContainerRef.current) return;\n setValueForStyles(contentContainerRef.current, style || null, prevStyleRef.current);\n prevStyleRef.current = style || null;\n if (className !== contentContainerRef.current.className) contentContainerRef.current.className = className || '';\n }, [infoWindow, className, style]);\n // ## update options\n useDeepCompareEffect(() => {\n if (!infoWindow) return;\n const opts = infoWindowOptions;\n if (!pixelOffset) {\n opts.pixelOffset = null;\n } else {\n opts.pixelOffset = new google.maps.Size(pixelOffset[0], pixelOffset[1]);\n }\n if (!headerContent) {\n opts.headerContent = null;\n } else {\n opts.headerContent = typeof headerContent === 'string' ? headerContent : headerContainerRef.current;\n }\n infoWindow.setOptions(infoWindowOptions);\n },\n // dependency `infoWindow` isn't needed since options are also passed\n // to the constructor when a new infoWindow is created.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [infoWindowOptions, pixelOffset, headerContent]);\n // ## bind event handlers\n useMapsEventListener(infoWindow, 'close', onClose);\n useMapsEventListener(infoWindow, 'closeclick', onCloseClick);\n // ## open info window when content and map are available\n const map = useMap();\n useDeepCompareEffect(() => {\n // `anchor === null` means an anchor is defined but not ready yet.\n if (!map || !infoWindow || anchor === null) return;\n const isOpenedWithAnchor = !!anchor;\n const openOptions = {\n map\n };\n if (anchor) {\n openOptions.anchor = anchor;\n // Only do the infowindow adjusting when dealing with an AdvancedMarker\n if (isAdvancedMarker(anchor) && anchor.content instanceof Element) {\n const wrapper = anchor.content;\n const wrapperBcr = wrapper == null ? void 0 : wrapper.getBoundingClientRect();\n // This checks whether or not the anchor has custom content with our own\n // div wrapper. If not, that means we have a regular AdvancedMarker without any children.\n // In that case we do not want to adjust the infowindow since it is all handled correctly\n // by the Google Maps API.\n if (wrapperBcr && wrapper != null && wrapper.isCustomMarker) {\n var _anchor$content$first;\n // We can safely typecast here since we control that element and we know that\n // it is a div\n const anchorDomContent = (_anchor$content$first = anchor.content.firstElementChild) == null ? void 0 : _anchor$content$first.firstElementChild;\n const contentBcr = anchorDomContent == null ? void 0 : anchorDomContent.getBoundingClientRect();\n // center infowindow above marker\n const anchorOffsetX = contentBcr.x - wrapperBcr.x + (contentBcr.width - wrapperBcr.width) / 2;\n const anchorOffsetY = contentBcr.y - wrapperBcr.y;\n const opts = infoWindowOptions;\n opts.pixelOffset = new google.maps.Size(pixelOffset ? pixelOffset[0] + anchorOffsetX : anchorOffsetX, pixelOffset ? pixelOffset[1] + anchorOffsetY : anchorOffsetY);\n infoWindow.setOptions(opts);\n }\n }\n }\n if (shouldFocus !== undefined) {\n openOptions.shouldFocus = shouldFocus;\n }\n infoWindow.open(openOptions);\n return () => {\n // Note: when the infowindow has an anchor, it will automatically show up again when the\n // anchor was removed from the map before infoWindow.close() is called but the it gets\n // added back to the map after that.\n // More information here: https://issuetracker.google.com/issues/343750849\n if (isOpenedWithAnchor) infoWindow.set('anchor', null);\n infoWindow.close();\n };\n }, [infoWindow, anchor, map, shouldFocus, infoWindowOptions, pixelOffset]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, contentContainerRef.current && createPortal(children, contentContainerRef.current), headerContainerRef.current !== null && createPortal(headerContent, headerContainerRef.current));\n};\n\n/**\n * Formats a location into a string representation suitable for Google Static Maps API.\n *\n * @param location - The location to format, can be either a string or an object with lat/lng properties\n * @returns A string representation of the location in the format \"lat,lng\" or the original string\n *\n * @example\n * // Returns \"40.714728,-73.998672\"\n * formatLocation({ lat: 40.714728, lng: -73.998672 })\n *\n * @example\n * // Returns \"New York, NY\"\n * formatLocation(\"New York, NY\")\n */\nfunction formatLocation(location) {\n return typeof location === 'string' ? location : `${location.lat},${location.lng}`;\n}\n// Used for removing the leading pipe from the param string\nfunction formatParam(string) {\n return string.slice(1);\n}\n\n/**\n * Assembles marker parameters for static maps.\n *\n * This function takes an array of markers and groups them by their style properties.\n * It then creates a string representation of these markers, including their styles and locations,\n * which can be used as parameters for static map APIs.\n *\n * @param {StaticMapsMarker[]} [markers=[]] - An array of markers to be processed. Each marker can have properties such as color, label, size, scale, icon, anchor, and location.\n * @returns {string[]} An array of strings, each representing a group of markers with their styles and locations.\n *\n * @example\n * const markers = [\n * { color: 'blue', label: 'A', size: 'mid', location: '40.714728,-73.998672' },\n * { color: 'blue', label: 'B', size: 'mid', location: '40.714728,-73.998672' },\n * { icon: 'http://example.com/icon.png', location: { lat: 40.714728, lng: -73.998672 } }\n * ];\n * const params = assembleMarkerParams(markers);\n * // Params will be an array of strings representing the marker parameters\n * Example output: [\n * \"color:blue|label:A|size:mid|40.714728,-73.998672|40.714728,-73.998672\",\n * \"color:blue|label:B|size:mid|40.714728,-73.998672|40.714728,-73.998672\",\n * \"icon:http://example.com/icon.png|40.714728,-73.998672\"\n * ]\n */\nfunction assembleMarkerParams(markers = []) {\n const markerParams = [];\n // Group markers by style\n const markersByStyle = markers == null ? void 0 : markers.reduce((styles, marker) => {\n const {\n color = 'red',\n label,\n size,\n scale,\n icon,\n anchor\n } = marker;\n // Create a unique style key based on either icon properties or standard marker properties\n const relevantProps = icon ? [icon, anchor, scale] : [color, label, size];\n const key = relevantProps.filter(Boolean).join('-');\n styles[key] = styles[key] || [];\n styles[key].push(marker);\n return styles;\n }, {});\n Object.values(markersByStyle != null ? markersByStyle : {}).forEach(markers => {\n let markerParam = '';\n const {\n icon\n } = markers[0];\n // Create marker style from first marker in group since all markers share the same style.\n Object.entries(markers[0]).forEach(([key, value]) => {\n // Determine which properties to include based on whether marker uses custom icon\n const relevantKeys = icon ? ['icon', 'anchor', 'scale'] : ['color', 'label', 'size'];\n if (relevantKeys.includes(key)) {\n markerParam += `|${key}:${value}`;\n }\n });\n // Add location coordinates for each marker in the style group\n // Handles both string locations and lat/lng object formats.\n for (const marker of markers) {\n const location = typeof marker.location === 'string' ? marker.location : `${marker.location.lat},${marker.location.lng}`;\n markerParam += `|${location}`;\n }\n markerParams.push(markerParam);\n });\n return markerParams.map(formatParam);\n}\n\n/**\n * Assembles path parameters for the Static Maps Api from an array of paths.\n *\n * This function groups paths by their style properties (color, weight, fillcolor, geodesic)\n * and then constructs a string of path parameters for each group. Each path parameter string\n * includes the style properties and the coordinates of the paths.\n *\n * @param {Array<StaticMapsPath>} [paths=[]] - An array of paths to be assembled into path parameters.\n * @returns {Array<string>} An array of path parameter strings.\n *\n * @example\n * const paths = [\n * {\n * color: 'red',\n * weight: 5,\n * coordinates: [\n * { lat: 40.714728, lng: -73.998672 },\n * { lat: 40.718217, lng: -73.998284 }\n * ]\n * }\n * ];\n *\n * const pathParams = assemblePathParams(paths);\n * Output: [\n * 'color:red|weight:5|40.714728,-73.998672|40.718217,-73.998284'\n * ]\n */\nfunction assemblePathParams(paths = []) {\n const pathParams = [];\n // Group paths by their style properties (color, weight, fillcolor, geodesic)\n // to combine paths with identical styles into single parameter strings\n const pathsByStyle = paths == null ? void 0 : paths.reduce((styles, path) => {\n const {\n color = 'default',\n weight,\n fillcolor,\n geodesic\n } = path;\n // Create unique key for this style combination\n const key = [color, weight, fillcolor, geodesic].filter(Boolean).join('-');\n styles[key] = styles[key] || [];\n styles[key].push(path);\n return styles;\n }, {});\n // Process each group of paths with identical styles\n Object.values(pathsByStyle != null ? pathsByStyle : {}).forEach(paths => {\n let pathParam = '';\n // Build style parameter string using properties from first path in group\n // since all paths in this group share the same style\n Object.entries(paths[0]).forEach(([key, value]) => {\n if (['color', 'weight', 'fillcolor', 'geodesic'].includes(key)) {\n pathParam += `|${key}:${value}`;\n }\n });\n // Add location for all marker in style group\n for (const path of paths) {\n if (typeof path.coordinates === 'string') {\n pathParam += `|${decodeURIComponent(path.coordinates)}`;\n } else {\n for (const location of path.coordinates) {\n pathParam += `|${formatLocation(location)}`;\n }\n }\n }\n pathParams.push(pathParam);\n });\n return pathParams.map(formatParam);\n}\n\n/**\n * Converts an array of Google Maps style objects into an array of style strings\n * compatible with the Google Static Maps API.\n *\n * @param styles - An array of Google Maps MapTypeStyle objects that define the styling rules\n * @returns An array of formatted style strings ready to be used with the Static Maps API\n *\n * @example\n * const styles = [{\n * featureType: \"road\",\n * elementType: \"geometry\",\n * stylers: [{color: \"#ff0000\"}, {weight: 1}]\n * }];\n *\n * const styleStrings = assembleMapTypeStyles(styles);\n * // Returns: [\"|feature:road|element:geometry|color:0xff0000|weight:1\"]\n *\n * Each style string follows the format:\n * \"feature:{featureType}|element:{elementType}|{stylerName}:{stylerValue}\"\n *\n * Note: Color values with hexadecimal notation (#) are automatically converted\n * to the required 0x format for the Static Maps API.\n */\nfunction assembleMapTypeStyles(styles) {\n return styles.map(mapTypeStyle => {\n const {\n featureType,\n elementType,\n stylers = []\n } = mapTypeStyle;\n let styleString = '';\n if (featureType) {\n styleString += `|feature:${featureType}`;\n }\n if (elementType) {\n styleString += `|element:${elementType}`;\n }\n for (const styler of stylers) {\n Object.entries(styler).forEach(([name, value]) => {\n styleString += `|${name}:${String(value).replace('#', '0x')}`;\n });\n }\n return styleString;\n }).map(formatParam);\n}\n\nconst STATIC_MAPS_BASE = 'https://maps.googleapis.com/maps/api/staticmap';\n/**\n * Creates a URL for the Google Static Maps API with the specified parameters.\n *\n * @param {Object} options - The configuration options for the static map\n * @param {string} options.apiKey - Your Google Maps API key (required)\n * @param {number} options.width - The width of the map image in pixels (required)\n * @param {number} options.height - The height of the map image in pixels (required)\n * @param {StaticMapsLocation} [options.center] - The center point of the map (lat/lng or address).\n * Required if no markers or paths or \"visible locations\" are provided.\n * @param {number} [options.zoom] - The zoom level of the map. Required if no markers or paths or \"visible locations\" are provided.\n * @param {1|2|4} [options.scale] - The resolution of the map (1, 2, or 4)\n * @param {string} [options.format] - The image format (png, png8, png32, gif, jpg, jpg-baseline)\n * @param {string} [options.mapType] - The type of map (roadmap, satellite, terrain, hybrid)\n * @param {string} [options.language] - The language of the map labels\n * @param {string} [options.region] - The region code for the map\n * @param {string} [options.map_id] - The Cloud-based map style ID\n * @param {StaticMapsMarker[]} [options.markers=[]] - Array of markers to display on the map\n * @param {StaticMapsPath[]} [options.paths=[]] - Array of paths to display on the map\n * @param {StaticMapsLocation[]} [options.visible=[]] - Array of locations that should be visible on the map\n * @param {MapTypeStyle[]} [options.style=[]] - Array of style objects to customize the map appearance\n *\n * @returns {string} The complete Google Static Maps API URL\n *\n * @throws {Error} If API key is not provided\n * @throws {Error} If width or height is not provided\n *\n * @example\n * const url = createStaticMapsUrl({\n * apiKey: 'YOUR_API_KEY',\n * width: 600,\n * height: 400,\n * center: { lat: 40.714728, lng: -73.998672 },\n * zoom: 12,\n * markers: [\n * {\n * location: { lat: 40.714728, lng: -73.998672 },\n * color: 'red',\n * label: 'A'\n * }\n * ],\n * paths: [\n * {\n * coordinates: [\n * { lat: 40.714728, lng: -73.998672 },\n * { lat: 40.719728, lng: -73.991672 }\n * ],\n * color: '0x0000ff',\n * weight: 5\n * }\n * ],\n * style: [\n * {\n * featureType: 'road',\n * elementType: 'geometry',\n * stylers: [{color: '#00ff00'}]\n * }\n * ]\n * });\n *\n * // Results in URL similar to:\n * // https://maps.googleapis.com/maps/api/staticmap?key=YOUR_API_KEY\n * // &size=600x400\n * // ¢er=40.714728,-73.998672&zoom=12\n * // &markers=color:red|label:A|40.714728,-73.998672\n * // &path=color:0x0000ff|weight:5|40.714728,-73.998672|40.719728,-73.991672\n * // &style=feature:road|element:geometry|color:0x00ff00\n */\nfunction createStaticMapsUrl({\n apiKey,\n width,\n height,\n center,\n zoom,\n scale,\n format,\n mapType,\n language,\n region,\n mapId,\n markers = [],\n paths = [],\n visible = [],\n style = []\n}) {\n if (!apiKey) {\n console.warn('API key is required');\n }\n if (!width || !height) {\n console.warn('Width and height are required');\n }\n const params = _extends({\n key: apiKey,\n size: `${width}x${height}`\n }, center && {\n center: formatLocation(center)\n }, zoom && {\n zoom\n }, scale && {\n scale\n }, format && {\n format\n }, mapType && {\n maptype: mapType\n }, language && {\n language\n }, region && {\n region\n }, mapId && {\n map_id: mapId\n });\n const url = new URL(STATIC_MAPS_BASE);\n // Params that don't need special handling\n Object.entries(params).forEach(([key, value]) => {\n url.searchParams.append(key, String(value));\n });\n // Assemble Markers\n for (const markerParam of assembleMarkerParams(markers)) {\n url.searchParams.append('markers', markerParam);\n }\n // Assemble Paths\n for (const pathParam of assemblePathParams(paths)) {\n url.searchParams.append('path', pathParam);\n }\n // Assemble visible locations\n if (visible.length) {\n url.searchParams.append('visible', visible.map(location => formatLocation(location)).join('|'));\n }\n // Assemble Map Type Styles\n for (const styleString of assembleMapTypeStyles(style)) {\n url.searchParams.append('style', styleString);\n }\n return url.toString();\n}\n\nconst StaticMap = props => {\n const {\n url,\n className\n } = props;\n if (!url) throw new Error('URL is required');\n return /*#__PURE__*/React.createElement(\"img\", {\n className: className,\n src: url,\n width: \"100%\"\n });\n};\n\n/**\n * Copy of the `google.maps.ControlPosition` constants.\n * They have to be duplicated here since we can't wait for the maps API to load to be able to use them.\n */\nconst ControlPosition = {\n TOP_LEFT: 1,\n TOP_CENTER: 2,\n TOP: 2,\n TOP_RIGHT: 3,\n LEFT_CENTER: 4,\n LEFT_TOP: 5,\n LEFT: 5,\n LEFT_BOTTOM: 6,\n RIGHT_TOP: 7,\n RIGHT: 7,\n RIGHT_CENTER: 8,\n RIGHT_BOTTOM: 9,\n BOTTOM_LEFT: 10,\n BOTTOM_CENTER: 11,\n BOTTOM: 11,\n BOTTOM_RIGHT: 12,\n CENTER: 13,\n BLOCK_START_INLINE_START: 14,\n BLOCK_START_INLINE_CENTER: 15,\n BLOCK_START_INLINE_END: 16,\n INLINE_START_BLOCK_CENTER: 17,\n INLINE_START_BLOCK_START: 18,\n INLINE_START_BLOCK_END: 19,\n INLINE_END_BLOCK_START: 20,\n INLINE_END_BLOCK_CENTER: 21,\n INLINE_END_BLOCK_END: 22,\n BLOCK_END_INLINE_START: 23,\n BLOCK_END_INLINE_CENTER: 24,\n BLOCK_END_INLINE_END: 25\n};\nconst MapControl = ({\n children,\n position\n}) => {\n const controlContainer = useMemo(() => document.createElement('div'), []);\n const map = useMap();\n useEffect(() => {\n if (!map) return;\n const controls = map.controls[position];\n controls.push(controlContainer);\n return () => {\n const controlsArray = controls.getArray();\n // controlsArray could be undefined if the map is in an undefined state (e.g. invalid API-key, see #276\n if (!controlsArray) return;\n const index = controlsArray.indexOf(controlContainer);\n controls.removeAt(index);\n };\n }, [controlContainer, map, position]);\n return createPortal(children, controlContainer);\n};\n\nconst _excluded = [\"onClick\", \"onDrag\", \"onDragStart\", \"onDragEnd\", \"onMouseOver\", \"onMouseOut\"];\nfunction useMarker(props) {\n const [marker, setMarker] = useState(null);\n const map = useMap();\n const {\n onClick,\n onDrag,\n onDragStart,\n onDragEnd,\n onMouseOver,\n onMouseOut\n } = props,\n markerOptions = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n position,\n draggable\n } = markerOptions;\n // create marker instance and add to the map once the map is available\n useEffect(() => {\n if (!map) {\n if (map === undefined) console.error('<Marker> has to be inside a Map component.');\n return;\n }\n const newMarker = new google.maps.Marker(markerOptions);\n newMarker.setMap(map);\n setMarker(newMarker);\n return () => {\n newMarker.setMap(null);\n setMarker(null);\n };\n // We do not want to re-render the whole marker when the options change.\n // Marker options update is handled in a useEffect below.\n // Excluding markerOptions from dependency array on purpose here.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [map]);\n // attach and re-attach event-handlers when any of the properties change\n useEffect(() => {\n if (!marker) return;\n const m = marker;\n // Add event listeners\n const gme = google.maps.event;\n if (onClick) gme.addListener(m, 'click', onClick);\n if (onDrag) gme.addListener(m, 'drag', onDrag);\n if (onDragStart) gme.addListener(m, 'dragstart', onDragStart);\n if (onDragEnd) gme.addListener(m, 'dragend', onDragEnd);\n if (onMouseOver) gme.addListener(m, 'mouseover', onMouseOver);\n if (onMouseOut) gme.addListener(m, 'mouseout', onMouseOut);\n marker.setDraggable(Boolean(draggable));\n return () => {\n gme.clearInstanceListeners(m);\n };\n }, [marker, draggable, onClick, onDrag, onDragStart, onDragEnd, onMouseOver, onMouseOut]);\n // update markerOptions (note the dependencies aren't properly checked\n // here, we just assume that setOptions is smart enough to not waste a\n // lot of time updating values that didn't change)\n useEffect(() => {\n if (!marker) return;\n if (markerOptions) marker.setOptions(markerOptions);\n }, [marker, markerOptions]);\n // update position when changed\n useEffect(() => {\n // Should not update position when draggable\n if (draggable || !position || !marker) return;\n marker.setPosition(position);\n }, [draggable, position, marker]);\n return marker;\n}\n/**\n * Component to render a marker on a map\n */\nconst Marker = forwardRef((props, ref) => {\n const marker = useMarker(props);\n useImperativeHandle(ref, () => marker, [marker]);\n return /*#__PURE__*/React.createElement(React.Fragment, null);\n});\nfunction useMarkerRef() {\n const [marker, setMarker] = useState(null);\n const refCallback = useCallback(m => {\n setMarker(m);\n }, []);\n return [refCallback, marker];\n}\n\n/**\n * Component to configure the appearance of an AdvancedMarker\n */\nconst Pin = props => {\n var _useContext;\n const advancedMarker = (_useContext = useContext(AdvancedMarkerContext)) == null ? void 0 : _useContext.marker;\n const glyphContainer = useMemo(() => document.createElement('div'), []);\n // Create Pin View instance\n useEffect(() => {\n var _advancedMarker$conte;\n if (!advancedMarker) {\n if (advancedMarker === undefined) {\n console.error('The <Pin> component can only be used inside <AdvancedMarker>.');\n }\n return;\n }\n if (props.glyph && props.children) {\n logErrorOnce('The <Pin> component only uses children to render the glyph if both the glyph property and children are present.');\n }\n if (Children.count(props.children) > 1) {\n logErrorOnce('Passing multiple children to the <Pin> component might lead to unexpected results.');\n }\n const pinViewOptions = _extends({}, props);\n const pinElement = new google.maps.marker.PinElement(pinViewOptions);\n // Set glyph to glyph container if children are present (rendered via portal).\n // If both props.glyph and props.children are present, props.children takes priority.\n if (props.children) {\n pinElement.glyph = glyphContainer;\n }\n // Set content of Advanced Marker View to the Pin View element\n // Here we are selecting the anchor container.\n // The hierarchy is as follows:\n // \"advancedMarker.content\" (from google) -> \"pointer events reset div\" -> \"anchor container\"\n const markerContent = (_advancedMarker$conte = advancedMarker.content) == null || (_advancedMarker$conte = _advancedMarker$conte.firstChild) == null ? void 0 : _advancedMarker$conte.firstChild;\n while (markerContent != null && markerContent.firstChild) {\n markerContent.removeChild(markerContent.firstChild);\n }\n if (markerContent) {\n markerContent.appendChild(pinElement.element);\n }\n }, [advancedMarker, glyphContainer, props]);\n return createPortal(props.children, glyphContainer);\n};\n\nconst mapLinear = (x, a1, a2, b1, b2) => b1 + (x - a1) * (b2 - b1) / (a2 - a1);\nconst getMapMaxTilt = zoom => {\n if (zoom <= 10) {\n return 30;\n }\n if (zoom >= 15.5) {\n return 67.5;\n }\n // range [10...14]\n if (zoom <= 14) {\n return mapLinear(zoom, 10, 14, 30, 45);\n }\n // range [14...15.5]\n return mapLinear(zoom, 14, 15.5, 45, 67.5);\n};\n/**\n * Function to limit the tilt range of the Google map when updating the view state\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst limitTiltRange = ({\n viewState\n}) => {\n const pitch = viewState.pitch;\n const gmZoom = viewState.zoom + 1;\n const maxTilt = getMapMaxTilt(gmZoom);\n return _extends({}, viewState, {\n fovy: 25,\n pitch: Math.min(maxTilt, pitch)\n });\n};\n\nexport { APILoadingStatus, APIProvider, APIProviderContext, AdvancedMarker, AdvancedMarkerAnchorPoint, AdvancedMarkerContext, CollisionBehavior, ColorScheme, ControlPosition, GoogleMapsContext, InfoWindow, Map, MapControl, Marker, Pin, RenderingType, StaticMap, createStaticMapsUrl, isAdvancedMarker, isLatLngLiteral, latLngEquals, limitTiltRange, toLatLngLiteral, useAdvancedMarkerRef, useApiIsLoaded, useApiLoadingStatus, useMap, useMapsLibrary, useMarkerRef };\n//# sourceMappingURL=index.modern.mjs.map\n","import './MapRichContent.css';\nimport { useEffect, useMemo, useState } from 'react';\nimport {\n APIProvider,\n Map,\n Marker,\n useApiLoadingStatus,\n APILoadingStatus,\n} from '@vis.gl/react-google-maps';\nimport { getMarkersFromNotification } from '../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../schemas/notificare-notification/notificare-notification-schema';\nimport { useOptions } from '../../OptionsProvider/OptionsProvider';\nimport LoadingIcon from '../LoadingIcon/LoadingIcon';\nimport PreviewError from '../PreviewError/PreviewError';\n\nexport default function MapRichContent({ notification, width, height }: MapRichContentProps) {\n const { googleMapsAPIKey } = useOptions().options;\n\n const markers = getMarkersFromNotification(notification).map((marker, index) => ({\n id: index,\n lat: marker.latitude,\n lng: marker.longitude,\n title: marker.title,\n }));\n\n const [isClient, setIsClient] = useState(false);\n\n const center = useMemo(() => {\n if (markers.length > 0) {\n return { lat: markers[0].lat, lng: markers[0].lng };\n }\n return { lat: 0, lng: 0 };\n }, [markers]);\n\n useEffect(() => {\n setIsClient(true);\n }, []);\n\n if (markers.length === 0 || !isClient) {\n return <LoadingIcon />;\n }\n\n return (\n <div data-testid=\"map-notification\">\n <APIProvider apiKey={googleMapsAPIKey || ''}>\n <MapWithStatus markers={markers} center={center} width={width} height={height} />\n </APIProvider>\n </div>\n );\n}\n\nfunction MapWithStatus({\n markers,\n center,\n width,\n height,\n}: {\n markers: { id: number; lat: number; lng: number; title: string }[];\n center: { lat: number; lng: number };\n width: string;\n height: string;\n}) {\n const apiLoadStatus = useApiLoadingStatus();\n\n return (\n <div\n style={{\n width,\n height,\n backgroundColor: 'white',\n position: 'relative',\n overflow: 'hidden',\n }}\n >\n {apiLoadStatus === APILoadingStatus.LOADING && <LoadingIcon />}\n\n {apiLoadStatus === APILoadingStatus.AUTH_FAILURE && (\n <PreviewError message=\"Authentication failure. Your Google Maps API key might be invalid. Check console for more information.\" />\n )}\n\n {apiLoadStatus === APILoadingStatus.FAILED && (\n <PreviewError message=\"Google Maps failed to be loaded. Check console for more information.\" />\n )}\n\n {apiLoadStatus === APILoadingStatus.LOADED && (\n <Map\n style={{ width, height }}\n defaultCenter={center}\n defaultZoom={10}\n gestureHandling=\"greedy\"\n disableDefaultUI={true}\n >\n {markers.map((marker) => (\n <Marker\n key={marker.id}\n position={{ lat: marker.lat, lng: marker.lng }}\n title={marker.title}\n />\n ))}\n </Map>\n )}\n </div>\n );\n}\n\ninterface MapRichContentProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Map' }>;\n width: string;\n height: string;\n}\n","import './MapNotification.css';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport MapRichContent from '../../../shared-components/MapRichContent/MapRichContent';\nimport NavigationBar from '../NavigationBar/NavigationBar';\n\nexport default function MapNotification({ notification, appName }: MapNotificationProps) {\n return (\n <div data-testid=\"android-app-ui-map-notification\">\n <NavigationBar appName={appName} showOptions={hasActions(notification)} />\n <MapRichContent notification={notification} width=\"100%\" height=\"570px\" />\n </div>\n );\n}\n\ninterface MapNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Map' }>;\n appName: string;\n}\n","import './RateNotification.css';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport Webshot from '../../../shared-components/Webshot/Webshot';\nimport NavigationBar from '../NavigationBar/NavigationBar';\n\nexport default function RateNotification({\n notification,\n appName,\n appAndroidPackageName,\n}: RateNotificationProps) {\n return (\n <div data-testid=\"android-app-ui-rate-notification\">\n <NavigationBar appName={appName} title={notification.title} showOptions={false} />\n <Webshot\n url={`https://play.google.com/store/apps/details?id=${appAndroidPackageName}&hl=en`}\n platform={'Android'}\n width={338}\n height={570}\n />\n </div>\n );\n}\n\ninterface RateNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Rate' }>;\n appName: string;\n appAndroidPackageName: string;\n}\n","import './TextAlertNotification.css';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\n\nexport default function TextAlertNotification({\n notification,\n appName,\n appIcon,\n}: TextAlertNotificationProps) {\n return (\n <div\n className=\"notificare__push__android__alert__app-ui\"\n data-testid=\"android-app-ui-text-alert-notification\"\n >\n <div className=\"notificare__push__android__alert__app-ui__wrapper\">\n <div className=\"notificare__push__android__alert__app-ui__header\">\n <div className=\"notificare__push__android__alert__app-ui__app-icon\">\n <img\n className=\"notificare__push__android__alert__app-ui__app-icon-image\"\n alt=\"App icon\"\n src={appIcon}\n />\n </div>\n <p className=\"notificare__push__android__alert__app-ui__title\">\n {notification.title || appName}\n </p>\n </div>\n <p className=\"notificare__push__android__alert__app-ui__message\">{notification.message}</p>\n\n {hasActions(notification) && (\n <div className=\"notificare__push__android__alert__app-ui__actions\">\n {notification.actions?.map((action, index) => (\n <p\n key={index}\n className=\"notificare__push__android__alert__app-ui__action-label\"\n data-testid={`android-app-ui-text-alert-notification-action-${index}`}\n >\n {action.label}\n </p>\n ))}\n <p\n className=\"notificare__push__android__alert__app-ui__cancel-label\"\n key=\"cancel-button-label\"\n >\n Cancel\n </p>\n </div>\n )}\n </div>\n </div>\n );\n}\n\ninterface TextAlertNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Alert' }>;\n appName: string;\n appIcon: string;\n}\n","import { getPushAPIHost } from '../../../config/api';\n\nexport async function fetchWebsiteMarkup(apiKey: string, url: string) {\n try {\n const params = new URLSearchParams({ apiKey, url });\n const response = await fetch(`${getPushAPIHost()}/proxy/?${params.toString()}`);\n return response.text();\n } catch (error) {\n console.error('Error fetching website', error);\n return '';\n }\n}\n","export function markupHasNotificareOpenActionQueryParameter(html: string) {\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, 'text/html');\n\n const links = doc.querySelectorAll('a');\n\n let hasParameter = false;\n\n links.forEach((link) => {\n const url = new URL(link.href, window.location.origin);\n if (url.searchParams.has('notificareOpenAction')) {\n hasParameter = true;\n }\n });\n\n return hasParameter;\n}\n","import './URLNotification.css';\nimport { useEffect, useState } from 'react';\nimport { fetchWebsiteMarkup } from '../../../../helpers/fetchWebsiteMarkup';\nimport { markupHasNotificareOpenActionQueryParameter } from '../../../../helpers/markupHasNotificareOpenActionQueryParameter';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport { useOptions } from '../../../OptionsProvider/OptionsProvider';\nimport Webshot from '../../../shared-components/Webshot/Webshot';\nimport NavigationBar from '../NavigationBar/NavigationBar';\n\nexport default function URLNotification({ notification, appName }: URLNotificationProps) {\n const url = notification.content[0].data;\n\n const [websiteMarkup, setWebsiteMarkup] = useState('');\n\n const { serviceKey } = useOptions().options;\n\n useEffect(() => {\n (async () => {\n setWebsiteMarkup(await fetchWebsiteMarkup(serviceKey, url));\n })();\n }, []);\n\n return (\n <div data-testid=\"android-app-ui-url-notification\">\n <NavigationBar\n appName={appName}\n title={notification.title}\n showOptions={\n hasActions(notification) && !markupHasNotificareOpenActionQueryParameter(websiteMarkup)\n }\n />\n <Webshot url={url} platform=\"Android\" width={338} height={570} />\n </div>\n );\n}\n\ninterface URLNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.URL' }>;\n appName: string;\n}\n","import './VideoRichContent.css';\nimport { NotificareNotificationSchema } from '../../../schemas/notificare-notification/notificare-notification-schema';\n\nexport default function VideoRichContent({ videoData, width, height }: VideoRichContentProps) {\n const getVideoUrl = (): string => {\n switch (videoData.type) {\n case 're.notifica.content.YouTube':\n return `https://www.youtube.com/embed/${videoData.data}`;\n\n case 're.notifica.content.Vimeo':\n return `https://player.vimeo.com/video/${videoData.data}`;\n\n case 're.notifica.content.HTML5Video':\n return videoData.data;\n\n default:\n return '';\n }\n };\n\n if (\n videoData.type === 're.notifica.content.YouTube' ||\n videoData.type === 're.notifica.content.Vimeo'\n ) {\n return (\n <iframe\n className=\"notificare__push__video-rich-content\"\n src={getVideoUrl()}\n sandbox=\"allow-scripts allow-same-origin\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n width={width}\n height={height}\n />\n );\n } else {\n return (\n <video\n className=\"notificare__push__video-rich-content\"\n width={width}\n height={height}\n autoPlay\n controls\n >\n <source src={getVideoUrl()} type=\"video/mp4\" />\n </video>\n );\n }\n}\n\ninterface VideoRichContentProps {\n videoData: Extract<\n NotificareNotificationSchema,\n { type: 're.notifica.notification.Video' }\n >['content'][number];\n width: string;\n height: string;\n}\n","import './VideoNotification.css';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport VideoRichContent from '../../../shared-components/VideoRichContent/VideoRichContent';\nimport NavigationBar from '../NavigationBar/NavigationBar';\n\nexport default function VideoNotification(props: VideoNotificationProps) {\n const { notification, appName } = props;\n\n return (\n <div data-testid=\"android-app-ui-video-notification\">\n <NavigationBar\n appName={appName}\n title={notification.title}\n showOptions={hasActions(notification)}\n />\n <VideoRichContent videoData={notification.content[0]} width=\"100%\" height=\"570px\" />\n </div>\n );\n}\n\ninterface VideoNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Video' }>;\n appName: string;\n}\n","import './WebViewNotification.css';\nimport { markupHasNotificareOpenActionQueryParameter } from '../../../../helpers/markupHasNotificareOpenActionQueryParameter';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport NavigationBar from '../NavigationBar/NavigationBar';\n\nexport default function WebViewNotification(props: WebViewNotificationProps) {\n const { notification, appName } = props;\n\n const html = notification.content[0].data;\n\n return (\n <div data-testid=\"android-app-ui-web-view-notification\">\n <NavigationBar\n appName={appName}\n title={notification.title}\n showOptions={hasActions(notification) && !markupHasNotificareOpenActionQueryParameter(html)}\n />\n\n <iframe\n className=\"notificare__push__android__web-view__app-ui__content\"\n srcDoc={html}\n sandbox=\"allow-same-origin\"\n />\n </div>\n );\n}\n\ninterface WebViewNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.WebView' }>;\n appName: string;\n}\n","import './NotificationAndroidPreview.css';\nimport { NotificareApplication } from '../../../../../components/NotificareNotificationPreview/models/notificare-application';\nimport { getAppIconURL } from '../../../helpers/getAppIconURL';\nimport { NotificationPreviewVariant } from '../../../models/notification-preview-variant';\nimport { NotificareNotificationSchema } from '../../../schemas/notificare-notification/notificare-notification-schema';\nimport { useOptions } from '../../OptionsProvider/OptionsProvider';\nimport AndroidPhoneBackground from '../../shared-components/AndroidPhoneBackground/AndroidPhoneBackground';\nimport UnavailablePreview from '../../shared-components/UnavailablePreview/UnavailablePreview';\nimport AppRecommendationNotification from './AppRecommendationNotification/AppRecommendationNotification';\nimport DigitalCardNotification from './DigitalCardNotification/DigitalCardNotification';\nimport ImagesNotification from './ImagesNotification/ImagesNotification';\nimport InAppBrowserNotification from './InAppBrowserNotification/InAppBrowserNotification';\nimport LockScreenNotification from './LockScreenNotification/LockScreenNotification';\nimport MapNotification from './MapNotification/MapNotification';\nimport RateNotification from './RateNotification/RateNotification';\nimport TextAlertNotification from './TextAlertNotification/TextAlertNotification';\nimport URLNotification from './URLNotification/URLNotification';\nimport VideoNotification from './VideoNotification/VideoNotification';\nimport WebViewNotification from './WebViewNotification/WebViewNotification';\n\nexport function NotificationAndroidPreview({\n notification,\n application,\n mobileVariant,\n}: NotificationAndroidPreviewProps) {\n const { googleMapsAPIKey } = useOptions().options;\n\n if (\n notification.type === 're.notifica.notification.Map' &&\n !googleMapsAPIKey &&\n mobileVariant === 'app-ui'\n ) {\n return (\n <UnavailablePreview\n message=\"→ A Google Maps API key should be provided\"\n showConsoleWarning={false}\n />\n );\n }\n\n return (\n <AndroidPhoneBackground theme={getTheme(notification.type, mobileVariant)}>\n <div className=\"notificare__push__android__preview\">\n {(mobileVariant === 'lockscreen' || mobileVariant === 'lockscreen-expanded') && (\n <LockScreenNotification\n notification={notification}\n appName={application.name}\n appIcon={getAppIconURL(application.websitePushConfig.icon)}\n expanded={mobileVariant === 'lockscreen-expanded'}\n />\n )}\n\n {mobileVariant === 'app-ui' &&\n (() => {\n switch (notification.type) {\n case 're.notifica.notification.Alert':\n return (\n <TextAlertNotification\n notification={notification}\n appName={application.name}\n appIcon={getAppIconURL(application.websitePushConfig.icon)}\n />\n );\n\n case 're.notifica.notification.WebView':\n return (\n <WebViewNotification notification={notification} appName={application.name} />\n );\n\n case 're.notifica.notification.URL':\n return <URLNotification notification={notification} appName={application.name} />;\n\n case 're.notifica.notification.InAppBrowser':\n return (\n <InAppBrowserNotification\n notification={notification}\n appName={application.name}\n />\n );\n\n case 're.notifica.notification.Image':\n return (\n <ImagesNotification notification={notification} appName={application.name} />\n );\n\n case 're.notifica.notification.Map':\n return <MapNotification notification={notification} appName={application.name} />;\n\n case 're.notifica.notification.Rate':\n return (\n <RateNotification\n notification={notification}\n appName={application.name}\n appAndroidPackageName={application.androidPackageName}\n />\n );\n\n case 're.notifica.notification.Passbook':\n return (\n <DigitalCardNotification notification={notification} appName={application.name} />\n );\n\n case 're.notifica.notification.Video':\n return <VideoNotification notification={notification} appName={application.name} />;\n\n case 're.notifica.notification.Store':\n return (\n <AppRecommendationNotification\n notification={notification}\n appName={application.name}\n />\n );\n }\n })()}\n </div>\n </AndroidPhoneBackground>\n );\n}\n\ninterface NotificationAndroidPreviewProps {\n notification: NotificareNotificationSchema;\n application: NotificareApplication;\n mobileVariant: NotificationPreviewVariant['mobileVariant'];\n}\n\nfunction getTheme(\n notificationType: NotificareNotificationSchema['type'],\n mobileVariant: NotificationPreviewVariant['mobileVariant'],\n) {\n if (mobileVariant !== 'app-ui') {\n return 'light';\n }\n\n const darkThemeTypes: NotificareNotificationSchema['type'][] = ['re.notifica.notification.Alert'];\n return darkThemeTypes.includes(notificationType) ? 'dark' : 'light';\n}\n","import './IOSPhoneBackground.css';\nimport { ReactNode } from 'react';\n\ninterface IosPhoneBackgroundProps {\n children: ReactNode;\n theme: 'dark' | 'light';\n}\n\nexport default function IOSPhoneBackground({ children, theme }: IosPhoneBackgroundProps) {\n return (\n <div\n className={`notificare__push__ios__phone-background ${theme === 'dark' ? 'notificare__push__ios__phone-background--dark' : ''}`}\n data-testid=\"ios-phone-background\"\n >\n <div className=\"notificare__push__ios__phone-background-camera\" />\n <div className=\"notificare__push__ios__phone-background-content\">{children}</div>\n </div>\n );\n}\n","import './StarRating.css';\n\ntype StarRatingProps = {\n rating: number;\n};\n\nexport default function StarRating(props: StarRatingProps) {\n const { rating } = props;\n\n const totalStars = 5;\n const stars = [];\n\n for (let i = 1; i <= totalStars; i++) {\n if (i <= rating) {\n stars.push(<FullStar key={i} />);\n } else if (i - 0.5 <= rating) {\n stars.push(<HalfStar key={i} />);\n } else {\n stars.push(<EmptyStar key={i} />);\n }\n }\n\n return <div className=\"notificare__push__ios__store__app-ui__star-rating\">{stars}</div>;\n}\n\nconst FullStar = () => (\n <svg width=\"10px\" height=\"10px\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path d=\"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z\" />\n </svg>\n);\n\nconst HalfStar = () => (\n <svg width=\"10px\" height=\"10px\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <defs>\n <linearGradient id=\"halfGrad\">\n <stop offset=\"50%\" stopColor=\"#1e3050\" />\n <stop offset=\"50%\" stopColor=\"#ccc\" />\n </linearGradient>\n </defs>\n <path\n fill=\"url(#halfGrad)\"\n d=\"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z\"\n />\n </svg>\n);\n\nconst EmptyStar = () => (\n <svg width=\"10px\" height=\"10px\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path\n fill=\"#EAEAEA\"\n d=\"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z\"\n />\n </svg>\n);\n","import './AppRecommendationNotification.css';\nimport { useEffect, useState } from 'react';\nimport { AppStoreApp } from '../../../../models/app-store-app';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport LoadingIcon from '../../../shared-components/LoadingIcon/LoadingIcon';\nimport PreviewError from '../../../shared-components/PreviewError/PreviewError';\nimport StarRating from './StarRating/StarRating';\n\nexport default function AppRecommendationNotification({\n notification,\n}: AppRecommendationNotificationProps) {\n const content = notification.content[0];\n\n const [hasError, setHasError] = useState(false);\n const [appStoreData, setAppStoreData] = useState<AppStoreApp>();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n useEffect(() => {\n (async () => {\n setIsLoading(true);\n\n if (content.type === 're.notifica.content.AppStore' && typeof content.data !== 'string') {\n try {\n const response = await fetch(\n `https://itunes.apple.com/lookup?country=GB&id=${content.data.identifier}`,\n );\n\n const data = await response.json();\n setAppStoreData(data);\n\n if (appStoreData?.resultCount === 0) {\n setHasError(true);\n }\n } catch {\n setHasError(true);\n }\n } else {\n setHasError(true);\n }\n\n setIsLoading(false);\n })();\n }, [content.data]);\n\n return (\n <div data-testid=\"ios-app-ui-app-recommendation-notification\">\n <div className=\"notificare__push__ios__store__app-ui__bar\">Done</div>\n <div className=\"notificare__push__ios__store__app-ui\">\n {hasError ? (\n <PreviewError />\n ) : isLoading ? (\n <LoadingIcon />\n ) : (\n appStoreData && (\n <div className=\"notificare__push__ios__store__app-ui__page\">\n <div className=\"notificare__push__ios__store__app-ui__page-header\">\n <img\n src={appStoreData.results[0].artworkUrl512}\n className=\"notificare__push__ios__store__app-ui__app-icon\"\n alt=\"App icon\"\n />\n <div className=\"notificare__push__ios__store__app-ui__page-app-info\">\n <div>\n <p className=\"notificare__push__ios__store__app-ui__page-app-name\">\n {appStoreData.results[0].trackName}\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-app-category\">\n {appStoreData.results[0].primaryGenreName}\n </p>\n </div>\n <div className=\"notificare__push__ios__store__app-ui__page-install\">Install</div>\n </div>\n </div>\n\n <div className=\"notificare__push__ios__store__app-ui__page-other-app-info-wrapper\">\n <div className=\"notificare__push__ios__store__app-ui__page-other-app-info\">\n <div className=\"notificare__push__ios__store__app-ui__page-info-block\">\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-title\">\n {formatNumber(appStoreData.results[0].userRatingCount)} RATINGS\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-value\">\n {appStoreData.results[0].averageUserRating.toFixed(1)}\n </p>\n\n <StarRating rating={appStoreData.results[0].averageUserRating} />\n </div>\n\n <div className=\"notificare__push__ios__store__app-ui__page-info-block\">\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-title\">\n AGE\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-value\">\n {appStoreData.results[0].trackContentRating}\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-bottom-text\">\n Years Old\n </p>\n </div>\n <div className=\"notificare__push__ios__store__app-ui__page-info-block\">\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-title\">\n CATEGORY\n </p>\n <svg\n className=\"notificare__push__ios__store__app-ui__page-info-block-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 576 512\"\n >\n <path d=\"M264.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 149.8C37.4 145.8 32 137.3 32 128s5.4-17.9 13.9-21.8L264.5 5.2zM476.9 209.6l53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 277.8C37.4 273.8 32 265.3 32 256s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0l152-70.2zm-152 198.2l152-70.2 53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 405.8C37.4 401.8 32 393.3 32 384s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0z\" />\n </svg>\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-bottom-text\">\n {appStoreData.results[0].primaryGenreName}\n </p>\n </div>\n <div className=\"notificare__push__ios__store__app-ui__page-info-block\">\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-title\">\n DEVELOPER\n </p>\n <svg\n className=\"notificare__push__ios__store__app-ui__page-info-block-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n >\n <path d=\"M399 384.2C376.9 345.8 335.4 320 288 320l-64 0c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z\" />\n </svg>\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-bottom-text\">\n {appStoreData.results[0].sellerName}\n </p>\n </div>\n </div>\n </div>\n\n <div className=\"notificare__push__ios__store__app-ui__page-history\">\n <p className=\"notificare__push__ios__store__app-ui__page-history-title\">\n What's New\n </p>\n <div className=\"notificare__push__ios__store__app-ui__page-history-version-last-update\">\n <p className=\"notificare__push__ios__store__app-ui__page-history-version\">\n Version {appStoreData.results[0].version}\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-history-last-update\">\n {timeAgo(appStoreData.results[0].currentVersionReleaseDate)}\n </p>\n </div>\n <p className=\"notificare__push__ios__store__app-ui__page-history-notes\">\n {appStoreData.results[0].releaseNotes}\n </p>\n </div>\n\n <div className=\"notificare__push__ios__store__app-ui__page-previews\">\n <p className=\"notificare__push__ios__store__app-ui__page-previews-title\">Preview</p>\n <div className=\"notificare__push__ios__store__app-ui__page-previews-images\">\n <img\n src={appStoreData.results[0].screenshotUrls[0]}\n className=\"notificare__push__ios__store__app-ui__page-preview-image\"\n alt=\"App preview\"\n />\n <img\n src={appStoreData.results[0].screenshotUrls[1]}\n className=\"notificare__push__ios__store__app-ui__page-preview-image\"\n alt=\"App preview\"\n />\n </div>\n </div>\n </div>\n )\n )}\n </div>\n </div>\n );\n}\n\ninterface AppRecommendationNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Store' }>;\n}\n\nfunction timeAgo(isoDate: string) {\n const date = new Date(isoDate);\n const now = new Date();\n const diffInSeconds = Math.floor((now.getTime() - date.getTime()) / 1000);\n\n const intervals: { value: number; label: string }[] = [\n { value: 60, label: 'second' },\n { value: 60 * 60, label: 'minute' },\n { value: 60 * 60 * 24, label: 'hour' },\n { value: 60 * 60 * 24 * 7, label: 'day' },\n { value: 60 * 60 * 24 * 30, label: 'week' },\n { value: 60 * 60 * 24 * 365, label: 'month' },\n { value: Infinity, label: 'year' },\n ];\n\n for (let i = 0; i < intervals.length; i++) {\n const { value, label } = intervals[i];\n if (diffInSeconds < value) {\n const count = Math.floor(diffInSeconds / (intervals[i - 1]?.value || 1));\n return count <= 1 ? `a ${label} ago` : `${count} ${label}s ago`;\n }\n }\n\n return 'a long time ago';\n}\n\nfunction formatNumber(num: number): string {\n if (num >= 1_000_000) {\n return (num / 1_000_000).toFixed(1) + 'M';\n } else if (num >= 1_000) {\n return (num / 1_000).toFixed(1) + 'K';\n }\n return num.toString();\n}\n","import './TitleBar.css';\n\ninterface TitleBarProps {\n appName: string;\n title?: string;\n showOptions: boolean;\n}\n\nexport default function TitleBar({ appName, title, showOptions }: TitleBarProps) {\n return (\n <div className=\"notificare__push__ios__app-ui__title-bar\">\n <div className=\"notificare__push__ios__app-ui__title-bar-text\">{title || appName}</div>\n\n {showOptions && (\n <svg\n className=\"notificare__push__ios__app-ui__title-bar-options-button\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 448 512\"\n data-testid=\"ios-app-ui-title-bar-options-button\"\n >\n <path d=\"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z\" />\n </svg>\n )}\n </div>\n );\n}\n","import './DigitalCardNotification.css';\nimport { getPushAPIHost } from '../../../../../../config/api';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport Webshot from '../../../shared-components/Webshot/Webshot';\nimport TitleBar from '../TitleBar/TitleBar';\n\nexport default function DigitalCardNotification({\n notification,\n appName,\n}: DigitalCardNotificationProps) {\n return (\n <div data-testid=\"ios-app-ui-passbook-notification\">\n <TitleBar\n appName={appName}\n title={notification.title}\n showOptions={hasActions(notification)}\n />\n\n <Webshot\n url={`${getPushAPIHost()}/pass/web/${notification.content[0].data.split('/')[5]}`}\n platform=\"Web\"\n width={338}\n height={566}\n />\n </div>\n );\n}\n\ninterface DigitalCardNotificationProps {\n notification: Extract<\n NotificareNotificationSchema,\n { type: 're.notifica.notification.Passbook' }\n >;\n appName: string;\n}\n","import './ImagesNotification.css';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport TitleBar from '../TitleBar/TitleBar';\n\nexport default function ImagesNotification({ notification, appName }: ImagesNotificationProps) {\n return (\n <div data-testid=\"ios-app-ui-images-notification\">\n <TitleBar\n appName={appName}\n title={notification.title}\n showOptions={hasActions(notification)}\n />\n <div className=\"notificare__push__ios__image__app-ui__rich-content\">\n <div className=\"notificare__push__ios__image__app-ui__slider\">\n {notification.content.map((image, index) => (\n <img\n key={index}\n className=\"notificare__push__ios__image__app-ui__slider-item\"\n src={image.data}\n alt=\"Slider image\"\n />\n ))}\n </div>\n </div>\n </div>\n );\n}\n\ninterface ImagesNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Image' }>;\n appName: string;\n}\n","import './InAppBrowserBar.css';\nimport { getUrlMainDomain } from '../../../../../helpers/getURLMainDomain';\nimport { isSecureUrl } from '../../../../../helpers/isSecureURL';\n\ninterface InAppBrowserBarProps {\n url: string;\n}\n\nexport default function InAppBrowserBar(props: InAppBrowserBarProps) {\n const { url } = props;\n\n return (\n <div className=\"notificare__push__ios__in-app-browser__app-ui__bar\">\n <p className=\"notificare__push__ios__in-app-browser__app-ui__bar-done-button\"> Done </p>\n <div className=\"notificare__push__ios__in-app-browser__app-ui__bar-domain\">\n {isSecureUrl(url) ? (\n <>\n <svg\n className=\"notificare__push__ios__in-app-browser__app-ui__bar-lock-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 448 512\"\n >\n <path d=\"M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z\" />\n </svg>\n </>\n ) : (\n <p className=\"notificare__push__ios__in-app-browser__app-ui__bar-not-secure\">\n Not Secure —\n </p>\n )}\n\n <p className=\"notificare__push__ios__in-app-browser__app-ui__bar-url\">\n {getUrlMainDomain(url)}\n </p>\n </div>\n </div>\n );\n}\n","import './InAppBrowserNotification.css';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport Webshot from '../../../shared-components/Webshot/Webshot';\nimport InAppBrowserBar from './InAppBrowserBar/InAppBrowserBar';\n\nexport default function InAppBrowserNotification({ notification }: URLNotificationProps) {\n const url = notification.content[0].data;\n\n return (\n <div data-testid=\"ios-app-ui-in-app-browser-notification\">\n <InAppBrowserBar url={url} />\n <Webshot url={url} platform=\"iOS\" width={338} height={564} />\n </div>\n );\n}\n\ninterface URLNotificationProps {\n notification: Extract<\n NotificareNotificationSchema,\n { type: 're.notifica.notification.InAppBrowser' }\n >;\n}\n","import './LockScreenNotification.css';\nimport { hasFirstAttachment } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\n\nexport default function LockScreenNotification(props: IOSLockScreenPushProps) {\n const { notification, appName, appIcon, expanded } = props;\n\n return (\n <div className=\"notificare__push__ios__lock-screen\" data-testid=\"ios-lock-screen-notification\">\n <div className=\"notificare__push__ios__lock-screen__main-content\">\n <div className=\"notificare__push__ios__lock-screen__app-icon\">\n <img\n className=\"notificare__push__ios__lock-screen__app-icon-image\"\n alt=\"App icon\"\n src={appIcon}\n />\n </div>\n <div className=\"notificare__push__ios__lock-screen__text-content\">\n <div className=\"notificare__push__ios__lock-screen__title-and-time\">\n <p\n className={`notificare__push__ios__lock-screen__text ${!expanded ? 'notificare__push__ios__lock-screen__text--title-or-subtitle' : 'notificare__push__ios__lock-screen__text--expanded-title-or-subtitle'}`}\n >\n {notification.title || appName}\n </p>\n\n <p className=\"notificare__push__ios__lock-screen__text notificare__push__ios__lock-screen__text--time\">\n Now\n </p>\n </div>\n\n {notification.subtitle && (\n <p\n className={`notificare__push__ios__lock-screen__text ${!expanded ? 'notificare__push__ios__lock-screen__text--title-or-subtitle' : 'notificare__push__ios__lock-screen__text--expanded-title-or-subtitle'}`}\n >\n {notification.subtitle}\n </p>\n )}\n\n <div className=\"notificare__push__ios__lock-screen__message-and-media\">\n <p\n className={`notificare__push__ios__lock-screen__text ${hasFirstAttachment(notification) && !expanded ? 'notificare__push__ios__lock-screen__text--message-with-media' : 'notificare__push__ios__lock-screen__text--message-without-media'}`}\n >\n {notification.message}\n </p>\n\n {hasFirstAttachment(notification) && !expanded && (\n <img\n className=\"notificare__push__ios__lock-screen__media-image\"\n src={notification.attachments?.[0].uri}\n alt=\"Media icon\"\n data-testid=\"ios-lock-screen-notification-media\"\n />\n )}\n </div>\n </div>\n </div>\n {hasFirstAttachment(notification) && expanded && (\n <img\n className=\"notificare__push__ios__lock-screen__expanded-media\"\n src={notification.attachments?.[0].uri}\n alt=\"Media icon\"\n data-testid=\"ios-lock-screen-notification-expanded-media\"\n />\n )}\n </div>\n );\n}\n\ninterface IOSLockScreenPushProps {\n notification: NotificareNotificationSchema;\n appName: string;\n appIcon: string;\n expanded: boolean;\n}\n","import './MapNotification.css';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport MapRichContent from '../../../shared-components/MapRichContent/MapRichContent';\nimport TitleBar from '../TitleBar/TitleBar';\n\nexport default function MapNotification({ notification, appName }: MapNotificationProps) {\n return (\n <div data-testid=\"ios-app-ui-map-notification\">\n <TitleBar\n appName={appName}\n title={notification.title}\n showOptions={hasActions(notification)}\n />\n <MapRichContent notification={notification} width=\"100%\" height=\"566px\" />\n </div>\n );\n}\n\ninterface MapNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Map' }>;\n appName: string;\n}\n","import './RateNotification.css';\n\nexport default function RateNotification({ appName, title }: RateAppNotificationProps) {\n return (\n <div className=\"notificare__push__ios__rate__app-ui\" data-testid=\"ios-app-ui-rate-notification\">\n <div className=\"notificare__push__ios__rate__app-ui__wrapper\">\n <p className=\"notificare__push__ios__rate__app-ui__header\">{title || appName}</p>\n\n <div className=\"notificare__push__ios__rate__app-ui__action\">Yes, I'll Rate Now</div>\n <div className=\"notificare__push__ios__rate__app-ui__action\">No, Thanks</div>\n </div>\n </div>\n );\n}\n\ninterface RateAppNotificationProps {\n appName: string;\n title: string | undefined;\n}\n","import './TextAlertNotification.css';\nimport { hasSingleAction, hasMultipleActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\n\nexport default function TextAlertNotification({\n notification,\n appName,\n}: TextAlertNotificationProps) {\n return (\n <div\n className=\"notificare__push__ios__alert__app-ui\"\n data-testid=\"ios-app-ui-text-alert-notification\"\n >\n <div className=\"notificare__push__ios__alert__app-ui__background\">\n <div className=\"notificare__push__ios__alert__app-ui__title-and-message\">\n <p className=\"notificare__push__ios__alert__app-ui__title\">\n {notification.title || appName}\n </p>\n <p className=\"notificare__push__ios__alert__app-ui__message\">{notification.message}</p>\n </div>\n <div className=\"notificare__push__ios__alert__app-ui__actions\">\n {hasSingleAction(notification) ? (\n <div className=\"notificare__push__ios__alert__app-ui__actions-single\">\n <div className=\"notificare__push__ios__alert__app-ui__single-cancel\">Cancel</div>\n <div\n className=\"notificare__push__ios__alert__app-ui__action notificare__push__ios__alert__app-ui__action--single\"\n data-testid=\"ios-app-ui-text-alert-notification-single-action\"\n >\n {notification.actions?.[0].label}\n </div>\n </div>\n ) : hasMultipleActions(notification) ? (\n <div className=\"notificare__push__ios__alert__app-ui__actions-multiple\">\n {notification.actions?.map((action, index) => (\n <div\n key={index}\n className=\"notificare__push__ios__alert__app-ui__action notificare__push__ios__alert__app-ui__action--multiple\"\n data-testid={`ios-app-ui-text-alert-notification-action-${index}`}\n >\n {action.label}\n </div>\n ))}\n <div className=\"notificare__push__ios__alert__app-ui__multiple-cancel\">Cancel</div>\n </div>\n ) : (\n <div className=\"notificare__push__ios__alert__app-ui__no-actions\">OK</div>\n )}\n </div>\n </div>\n </div>\n );\n}\n\ninterface TextAlertNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Alert' }>;\n appName: string;\n}\n","import './URLNotification.css';\nimport { useEffect, useState } from 'react';\nimport { fetchWebsiteMarkup } from '../../../../helpers/fetchWebsiteMarkup';\nimport { markupHasNotificareOpenActionQueryParameter } from '../../../../helpers/markupHasNotificareOpenActionQueryParameter';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport { useOptions } from '../../../OptionsProvider/OptionsProvider';\nimport Webshot from '../../../shared-components/Webshot/Webshot';\nimport TitleBar from '../TitleBar/TitleBar';\n\nexport default function URLNotification({ notification, appName }: URLNotificationProps) {\n const url = notification.content[0].data;\n\n const [websiteMarkup, setWebsiteMarkup] = useState('');\n\n const { serviceKey } = useOptions().options;\n\n useEffect(() => {\n (async () => {\n setWebsiteMarkup(await fetchWebsiteMarkup(serviceKey, url));\n })();\n }, []);\n\n return (\n <div data-testid=\"ios-app-ui-url-notification\">\n <TitleBar\n appName={appName}\n title={notification.title}\n showOptions={\n hasActions(notification) && !markupHasNotificareOpenActionQueryParameter(websiteMarkup)\n }\n />\n <Webshot url={url} platform=\"iOS\" width={338} height={566} />\n </div>\n );\n}\n\ninterface URLNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.URL' }>;\n appName: string;\n}\n","import './VideoNotification.css';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport VideoRichContent from '../../../shared-components/VideoRichContent/VideoRichContent';\nimport TitleBar from '../TitleBar/TitleBar';\n\nexport default function VideoNotification({ notification, appName }: VideoNotificationProps) {\n const videoData = notification.content[0];\n\n return (\n <div data-testid=\"ios-app-ui-video-notification\">\n <TitleBar\n appName={appName}\n title={notification.title}\n showOptions={hasActions(notification)}\n />\n <VideoRichContent videoData={videoData} width=\"100%\" height=\"566px\" />\n </div>\n );\n}\n\ninterface VideoNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.Video' }>;\n appName: string;\n}\n","import './WebViewNotification.css';\nimport { markupHasNotificareOpenActionQueryParameter } from '../../../../helpers/markupHasNotificareOpenActionQueryParameter';\nimport { hasActions } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport TitleBar from '../TitleBar/TitleBar';\n\nexport default function WebViewNotification({ notification, appName }: WebViewNotificationProps) {\n const html = notification.content[0].data;\n\n return (\n <div data-testid=\"ios-app-ui-web-view-notification\">\n <TitleBar\n appName={appName}\n title={notification.title}\n showOptions={hasActions(notification) && !markupHasNotificareOpenActionQueryParameter(html)}\n />\n <iframe\n className=\"notificare__push__ios__web-view__app-ui__content\"\n srcDoc={html}\n sandbox=\"allow-same-origin\"\n />\n </div>\n );\n}\n\ninterface WebViewNotificationProps {\n notification: Extract<NotificareNotificationSchema, { type: 're.notifica.notification.WebView' }>;\n appName: string;\n}\n","import './NotificationIOSPreview.css';\nimport { NotificareApplication } from '../../../../../components/NotificareNotificationPreview/models/notificare-application';\nimport { getAppIconURL } from '../../../helpers/getAppIconURL';\nimport { NotificationPreviewVariant } from '../../../models/notification-preview-variant';\nimport { NotificareNotificationSchema } from '../../../schemas/notificare-notification/notificare-notification-schema';\nimport { useOptions } from '../../OptionsProvider/OptionsProvider';\nimport IOSPhoneBackground from '../../shared-components/IOSPhoneBackground/IOSPhoneBackground';\nimport UnavailablePreview from '../../shared-components/UnavailablePreview/UnavailablePreview';\nimport AppRecommendationNotification from './AppRecommendationNotification/AppRecommendationNotification';\nimport DigitalCardNotification from './DigitalCardNotification/DigitalCardNotification';\nimport ImagesNotification from './ImagesNotification/ImagesNotification';\nimport InAppBrowserNotification from './InAppBrowserNotification/InAppBrowserNotification';\nimport LockScreenNotification from './LockScreenNotification/LockScreenNotification';\nimport MapNotification from './MapNotification/MapNotification';\nimport RateNotification from './RateNotification/RateNotification';\nimport TextAlertNotification from './TextAlertNotification/TextAlertNotification';\nimport URLNotification from './URLNotification/URLNotification';\nimport VideoNotification from './VideoNotification/VideoNotification';\nimport WebViewNotification from './WebViewNotification/WebViewNotification';\n\nexport default function NotificationIOSPreview({\n notification,\n application,\n mobileVariant,\n}: NotificationIOSPreviewProps) {\n const { googleMapsAPIKey } = useOptions().options;\n\n if (\n notification.type === 're.notifica.notification.Map' &&\n !googleMapsAPIKey &&\n mobileVariant === 'app-ui'\n ) {\n return (\n <UnavailablePreview\n message=\"→ A Google Maps API key should be provided\"\n showConsoleWarning={false}\n />\n );\n }\n\n return (\n <IOSPhoneBackground theme={getTheme(notification.type, mobileVariant)}>\n <div className=\"notificare__push__ios__preview\">\n {(mobileVariant === 'lockscreen' || mobileVariant === 'lockscreen-expanded') && (\n <LockScreenNotification\n notification={notification}\n appName={application.name}\n appIcon={getAppIconURL(application.websitePushConfig.icon)}\n expanded={mobileVariant === 'lockscreen-expanded'}\n />\n )}\n\n {mobileVariant === 'app-ui' &&\n (() => {\n switch (notification.type) {\n case 're.notifica.notification.Alert':\n return (\n <TextAlertNotification notification={notification} appName={application.name} />\n );\n\n case 're.notifica.notification.WebView':\n return (\n <WebViewNotification notification={notification} appName={application.name} />\n );\n\n case 're.notifica.notification.URL':\n return <URLNotification notification={notification} appName={application.name} />;\n\n case 're.notifica.notification.InAppBrowser':\n return <InAppBrowserNotification notification={notification} />;\n\n case 're.notifica.notification.Image':\n return (\n <ImagesNotification notification={notification} appName={application.name} />\n );\n\n case 're.notifica.notification.Map':\n return <MapNotification notification={notification} appName={application.name} />;\n\n case 're.notifica.notification.Rate':\n return <RateNotification title={notification.title} appName={application.name} />;\n\n case 're.notifica.notification.Passbook':\n return (\n <DigitalCardNotification notification={notification} appName={application.name} />\n );\n\n case 're.notifica.notification.Video':\n return <VideoNotification notification={notification} appName={application.name} />;\n\n case 're.notifica.notification.Store':\n return <AppRecommendationNotification notification={notification} />;\n }\n })()}\n </div>\n </IOSPhoneBackground>\n );\n}\n\ninterface NotificationIOSPreviewProps {\n notification: NotificareNotificationSchema;\n application: NotificareApplication;\n mobileVariant: NotificationPreviewVariant['mobileVariant'];\n}\n\nfunction getTheme(\n notificationType: NotificareNotificationSchema['type'],\n mobileVariant: NotificationPreviewVariant['mobileVariant'],\n) {\n if (mobileVariant !== 'app-ui') {\n return 'light';\n }\n\n const darkThemeTypes: NotificareNotificationSchema['type'][] = [\n 're.notifica.notification.Alert',\n 're.notifica.notification.WebView',\n 're.notifica.notification.URL',\n 're.notifica.notification.InAppBrowser',\n 're.notifica.notification.Image',\n 're.notifica.notification.Rate',\n 're.notifica.notification.Passbook',\n 're.notifica.notification.Video',\n 're.notifica.notification.Store',\n 're.notifica.notification.Map',\n ];\n return darkThemeTypes.includes(notificationType) ? 'dark' : 'light';\n}\n","import './ExpandButton.css';\n\ninterface ExpandButtonProps {\n open: boolean;\n disabled: boolean;\n onToggle: () => void;\n}\n\nexport default function ExpandButton(props: ExpandButtonProps) {\n const { open, disabled, onToggle } = props;\n\n return (\n <button\n disabled={disabled}\n className={`notificare__push__web__desktop__lock-screen__expand-button ${open ? 'notificare__push__web__desktop__lock-screen__expand-button--rotated' : ''}`}\n onClick={onToggle}\n data-testid=\"web-desktop-expand-button\"\n >\n <svg\n className=\"notificare__push__web__desktop__lock-screen__expand-button-svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n >\n <path d=\"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z\" />\n </svg>\n </button>\n );\n}\n","import { Key, useEffect, useRef, useState } from 'react';\nimport './WebMacOSNotification.css';\nimport { hasFirstAttachment } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport ExpandButton from './ExpandButton/ExpandButton';\n\nexport default function WebMacOSNotification({ notification, appName, appDomain }: WebPushProps) {\n const [expanded, setExpanded] = useState<boolean>(false);\n const [mouseOverNotification, setMouseOverNotification] = useState<boolean>(false);\n const [mouseOverButtonIndex, setMouseOverButtonIndex] = useState<number>(-1);\n const [expandable, setExpandable] = useState<boolean>(false);\n const [openOptions, setOpenOptions] = useState<boolean>(false);\n const [isClosing, setIsClosing] = useState<boolean>(false);\n const [isExpanding, setIsExpanding] = useState<boolean>(false);\n const [initialPreviewHeight, setInitialPreviewHeight] = useState<string>('');\n //const [initialMessageHeight, setInitialMessageHeight] = useState<string>('');\n const previewRef = useRef<HTMLDivElement>(null);\n const messageRef = useRef<HTMLDivElement>(null);\n const maxMessageLines = 3;\n const messageLineHeight = 16.7;\n\n useEffect(() => {\n if (previewRef.current && messageRef.current) {\n const fullTextHeight = messageRef.current.scrollHeight;\n setExpandable(fullTextHeight > maxMessageLines * messageLineHeight);\n\n const previewHeight = `${previewRef.current.scrollHeight}px`;\n previewRef.current.style.height = previewHeight;\n setInitialPreviewHeight(previewHeight);\n }\n\n if (hasFirstAttachment(notification)) {\n setExpandable(true);\n }\n }, []);\n\n return (\n <div\n ref={previewRef}\n className=\"notificare__push__web__desktop__lock-screen\"\n onMouseEnter={() => setMouseOverNotification(() => true)}\n onMouseLeave={() => setMouseOverNotification(() => openOptions)}\n data-testid=\"web-desktop-notification\"\n >\n {((expandable && mouseOverNotification) || expanded || isClosing) && (\n <div className=\"notificare__push__web__desktop__lock-screen__expand-button-container\">\n <ExpandButton\n open={expanded}\n disabled={isClosing || isExpanding}\n onToggle={() => {\n const previewElement = previewRef.current;\n const messageElement = messageRef.current;\n\n if (previewElement && messageElement) {\n if (expanded) {\n previewElement.style.backgroundColor = '#f4f4f4';\n previewElement.style.height = initialPreviewHeight;\n //messageElement.style.height = initialMessageHeight;\n setIsClosing(true);\n setExpanded(false);\n setTimeout(() => {\n setIsClosing(false);\n previewElement.style.overflow = '';\n }, 300);\n } else {\n previewElement.style.backgroundColor = '#fff';\n previewElement.style.overflow = 'hidden';\n setIsExpanding(true);\n setExpanded(true);\n setTimeout(() => {\n previewElement.style.height = `${previewElement.scrollHeight - messageElement.clientHeight + messageElement.scrollHeight}px`;\n //messageElement.style.height = `${messageElement.scrollHeight}px`;\n }, 10);\n setTimeout(() => {\n setIsExpanding(false);\n }, 300);\n }\n\n setOpenOptions(false);\n }\n }}\n />\n </div>\n )}\n\n {!mouseOverNotification && !expanded && !isClosing && (\n <div className=\"notificare__push__web__desktop__lock-screen__time-container\">\n <p className=\"notificare__push__web__desktop__lock-screen__time\"> now </p>\n </div>\n )}\n\n <div className=\"notificare__push__web__desktop__lock-screen__main-content\">\n <div className=\"notificare__push__web__desktop__lock-screen__browser-icon\">\n <div className=\"notificare__push__web__desktop__lock-screen__browser-icon-background\">\n <img\n className=\"notificare__push__web__desktop__lock-screen__browser-icon-image\"\n src=\"https://upload.wikimedia.org/wikipedia/commons/e/e1/Google_Chrome_icon_%28February_2022%29.svg\"\n alt=\"Google Chrome Icon\"\n />\n </div>\n </div>\n\n <div className=\"notificare__push__web__desktop__lock-screen__text-content\">\n <p className=\"notificare__push__web__desktop__lock-screen__text notificare__push__web__desktop__lock-screen__text--title\">\n {notification.title || appName}\n </p>\n <p className=\"notificare__push__web__desktop__lock-screen__text notificare__push__web__desktop__lock-screen__text--domain\">\n {extractDomain(appDomain)}\n </p>\n <p\n ref={messageRef}\n className={`notificare__push__web__desktop__lock-screen__text ${expanded || isClosing ? 'notificare__push__web__desktop__lock-screen__text--expandable-message' : 'notificare__push__web__desktop__lock-screen__text--message'}`}\n >\n {notification.message}\n </p>\n </div>\n\n {hasFirstAttachment(notification) && !expanded && !isClosing && !mouseOverNotification && (\n <img\n className=\"notificare__push__web__desktop__lock-screen__small-media\"\n src={notification.attachments?.[0].uri}\n alt=\"Small media icon\"\n />\n )}\n\n {mouseOverNotification && !expanded && !isClosing && (\n <div className=\"notificare__push__web__desktop__lock-screen__settings-button-container\">\n {notification.actions && notification.actions.length > 0 ? (\n <>\n <button\n className=\"notificare__push__web__desktop__lock-screen__settings-button\"\n onClick={() => setOpenOptions((prevState) => !prevState)}\n data-testid=\"web-desktop-settings-button\"\n >\n Options\n <svg\n className=\"notificare__push__web__desktop__lock-screen__settings-button-expand-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n >\n <path d=\"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\" />\n </svg>\n </button>\n\n {openOptions && (\n <div className=\"notificare__push__web__desktop__lock-screen__settings-selector\">\n {notification.actions.map((option, index) => (\n <button\n key={index}\n className=\"notificare__push__web__desktop__lock-screen__settings-selector-option\"\n data-testid={`web-desktop-options-action-${index}`}\n >\n {option.label}\n </button>\n ))}\n\n <button className=\"notificare__push__web__desktop__lock-screen__settings-selector-option\">\n Settings\n </button>\n </div>\n )}\n </>\n ) : (\n <button className=\"notificare__push__web__desktop__lock-screen__settings-button\">\n Settings\n </button>\n )}\n </div>\n )}\n </div>\n\n {(expanded || isClosing) && (\n <div className=\"notificare__push__web__desktop__lock-screen__expanded-content\">\n {hasFirstAttachment(notification) && (\n <img\n className=\"notificare__push__web__desktop__lock-screen__expanded-media\"\n src={notification.attachments?.[0].uri}\n alt=\"Expanded media\"\n />\n )}\n\n <hr className=\"notificare__push__web__desktop__lock-screen__expanded-divisor\" />\n\n {notification.actions?.map((action, index) => (\n <div key={index} className=\"notificare__push__web__desktop__lock-screen__action\">\n <button\n className=\"notificare__push__web__desktop__lock-screen__expanded-button\"\n onMouseEnter={() => setMouseOverButtonIndex(index)}\n onMouseLeave={() => setMouseOverButtonIndex(-1)}\n data-testid={`web-desktop-expanded-action-${index}`}\n >\n {action.label}\n </button>\n\n <hr\n className={`notificare__push__web__desktop__lock-screen__expanded-buttons-divisor ${(mouseOverButtonIndex === index || mouseOverButtonIndex - 1 === index) && 'notificare__push__web__desktop__lock-screen__expanded-buttons-divisor--transparent'}`}\n />\n </div>\n ))}\n\n <button\n className={'notificare__push__web__desktop__lock-screen__expanded-button'}\n onMouseEnter={() => setMouseOverButtonIndex(notification.actions?.length || -1)}\n onMouseLeave={() => setMouseOverButtonIndex(-1)}\n >\n Settings\n </button>\n </div>\n )}\n </div>\n );\n}\n\ninterface WebPushProps {\n key?: Key;\n notification: NotificareNotificationSchema;\n appName: string;\n appDomain: string;\n}\n\nfunction extractDomain(url: string): string {\n try {\n const parsedUrl = new URL(url);\n return parsedUrl.hostname;\n } catch {\n return '';\n }\n}\n","var util;\n(function (util) {\n util.assertEqual = (val) => val;\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array\n .map((val) => (typeof val === \"string\" ? `'${val}'` : val))\n .join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nvar objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nconst ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nconst getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then &&\n typeof data.then === \"function\" &&\n data.catch &&\n typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n\nconst ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nconst quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nclass ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `smaller than or equal to`\n : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\n\nlet overrideErrorMap = errorMap;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\nfunction getErrorMap() {\n return overrideErrorMap;\n}\n\nconst makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nconst EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === errorMap ? undefined : errorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nclass ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" &&\n (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nconst INVALID = Object.freeze({\n status: \"aborted\",\n});\nconst DIRTY = (value) => ({ status: \"dirty\", value });\nconst OK = (value) => ({ status: \"valid\", value });\nconst isAborted = (x) => x.status === \"aborted\";\nconst isDirty = (x) => x.status === \"dirty\";\nconst isValid = (x) => x.status === \"valid\";\nconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nvar errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message === null || message === void 0 ? void 0 : message.message;\n})(errorUtil || (errorUtil = {}));\n\nvar _ZodEnum_cache, _ZodNativeEnum_cache;\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (this._key instanceof Array) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n var _a, _b;\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message !== null && message !== void 0 ? message : ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nclass ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n var _a;\n const ctx = {\n common: {\n issues: [],\n async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n var _a, _b;\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n async: true,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult)\n ? maybeAsyncResult\n : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\"\n ? refinementData(val, ctx)\n : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nconst ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/;\n// const ipv6Regex =\n// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4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-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst dateRegexSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n let secondsRegexSource = `[0-5]\\\\d`;\n if (args.precision) {\n secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n }\n const secondsQuantifier = args.precision ? \"+\" : \"?\"; // require seconds if precision is nonzero\n return `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nfunction datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (!decoded.typ || !decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nclass ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"nanoid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch (_a) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"duration\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"jwt\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cidr\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n var _a, _b;\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,\n local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options === null || options === void 0 ? void 0 : options.position,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n var _a;\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / Math.pow(10, decCount);\n}\nclass ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" ||\n (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null, min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" ||\n ch.kind === \"int\" ||\n ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch (_a) {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n var _a;\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\nclass ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nclass ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nclass ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nclass ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nclass ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nclass ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nclass ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nclass ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nclass ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nclass ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<T, Augmentation>,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n return (this._cached = { shape, keys });\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever &&\n this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") ;\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n var _a, _b, _c, _d;\n const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n util.objectKeys(mask).forEach((key) => {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nclass ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nclass ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util\n .objectKeys(a)\n .filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date &&\n bType === ZodParsedType.date &&\n +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nclass ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\nclass ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nclass ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nclass ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nclass ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nclass ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(async function (...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args\n .parseAsync(args, params)\n .catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args\n ? args\n : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nclass ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nclass ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nclass ZodEnum extends ZodType {\n constructor() {\n super(...arguments);\n _ZodEnum_cache.set(this, void 0);\n }\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!__classPrivateFieldGet(this, _ZodEnum_cache, \"f\")) {\n __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), \"f\");\n }\n if (!__classPrivateFieldGet(this, _ZodEnum_cache, \"f\").has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\n_ZodEnum_cache = new WeakMap();\nZodEnum.create = createZodEnum;\nclass ZodNativeEnum extends ZodType {\n constructor() {\n super(...arguments);\n _ZodNativeEnum_cache.set(this, void 0);\n }\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string &&\n ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, \"f\")) {\n __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), \"f\");\n }\n if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, \"f\").has(input.data)) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\n_ZodNativeEnum_cache = new WeakMap();\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nclass ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise &&\n ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise\n ? ctx.data\n : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nclass ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return base;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((base) => {\n if (!isValid(base))\n return base;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nclass ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nclass ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nclass ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\"\n ? params.default\n : () => params.default,\n ...processCreateParams(params),\n });\n};\nclass ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nclass ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nconst BRAND = Symbol(\"zod_brand\");\nclass ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nclass ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nclass ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if (isValid(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return isAsync(result)\n ? result.then((data) => freeze(data))\n : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\"\n ? params(data)\n : typeof params === \"string\"\n ? { message: params }\n : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nfunction custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n var _a, _b;\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n var _a, _b;\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nconst late = {\n object: ZodObject.lazycreate,\n};\nvar ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\nconst instanceOfType = (\n// const instanceOfType = <T extends new (...args: any[]) => any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nconst coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nconst NEVER = INVALID;\n\nvar z = /*#__PURE__*/Object.freeze({\n __proto__: null,\n defaultErrorMap: errorMap,\n setErrorMap: setErrorMap,\n getErrorMap: getErrorMap,\n makeIssue: makeIssue,\n EMPTY_PATH: EMPTY_PATH,\n addIssueToContext: addIssueToContext,\n ParseStatus: ParseStatus,\n INVALID: INVALID,\n DIRTY: DIRTY,\n OK: OK,\n isAborted: isAborted,\n isDirty: isDirty,\n isValid: isValid,\n isAsync: isAsync,\n get util () { return util; },\n get objectUtil () { return objectUtil; },\n ZodParsedType: ZodParsedType,\n getParsedType: getParsedType,\n ZodType: ZodType,\n datetimeRegex: datetimeRegex,\n ZodString: ZodString,\n ZodNumber: ZodNumber,\n ZodBigInt: ZodBigInt,\n ZodBoolean: ZodBoolean,\n ZodDate: ZodDate,\n ZodSymbol: ZodSymbol,\n ZodUndefined: ZodUndefined,\n ZodNull: ZodNull,\n ZodAny: ZodAny,\n ZodUnknown: ZodUnknown,\n ZodNever: ZodNever,\n ZodVoid: ZodVoid,\n ZodArray: ZodArray,\n ZodObject: ZodObject,\n ZodUnion: ZodUnion,\n ZodDiscriminatedUnion: ZodDiscriminatedUnion,\n ZodIntersection: ZodIntersection,\n ZodTuple: ZodTuple,\n ZodRecord: ZodRecord,\n ZodMap: ZodMap,\n ZodSet: ZodSet,\n ZodFunction: ZodFunction,\n ZodLazy: ZodLazy,\n ZodLiteral: ZodLiteral,\n ZodEnum: ZodEnum,\n ZodNativeEnum: ZodNativeEnum,\n ZodPromise: ZodPromise,\n ZodEffects: ZodEffects,\n ZodTransformer: ZodEffects,\n ZodOptional: ZodOptional,\n ZodNullable: ZodNullable,\n ZodDefault: ZodDefault,\n ZodCatch: ZodCatch,\n ZodNaN: ZodNaN,\n BRAND: BRAND,\n ZodBranded: ZodBranded,\n ZodPipeline: ZodPipeline,\n ZodReadonly: ZodReadonly,\n custom: custom,\n Schema: ZodType,\n ZodSchema: ZodType,\n late: late,\n get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },\n coerce: coerce,\n any: anyType,\n array: arrayType,\n bigint: bigIntType,\n boolean: booleanType,\n date: dateType,\n discriminatedUnion: discriminatedUnionType,\n effect: effectsType,\n 'enum': enumType,\n 'function': functionType,\n 'instanceof': instanceOfType,\n intersection: intersectionType,\n lazy: lazyType,\n literal: literalType,\n map: mapType,\n nan: nanType,\n nativeEnum: nativeEnumType,\n never: neverType,\n 'null': nullType,\n nullable: nullableType,\n number: numberType,\n object: objectType,\n oboolean: oboolean,\n onumber: onumber,\n optional: optionalType,\n ostring: ostring,\n pipeline: pipelineType,\n preprocess: preprocessType,\n promise: promiseType,\n record: recordType,\n set: setType,\n strictObject: strictObjectType,\n string: stringType,\n symbol: symbolType,\n transformer: effectsType,\n tuple: tupleType,\n 'undefined': undefinedType,\n union: unionType,\n unknown: unknownType,\n 'void': voidType,\n NEVER: NEVER,\n ZodIssueCode: ZodIssueCode,\n quotelessJson: quotelessJson,\n ZodError: ZodError\n});\n\nexport { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodReadonly, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, datetimeRegex, z as default, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z };\n","import './WebMobileAppUINotification.css';\nimport { hasFirstAttachment } from '../../../../helpers/notification-utils';\nimport { NotificareNotificationSchema } from '../../../../schemas/notificare-notification/notificare-notification-schema';\nimport MapRichContent from '../../../shared-components/MapRichContent/MapRichContent';\nimport VideoRichContent from '../../../shared-components/VideoRichContent/VideoRichContent';\nimport Webshot from '../../../shared-components/Webshot/Webshot';\n\nexport default function WebMobileAppUINotification({\n notification,\n appName,\n appIcon,\n}: WebMobileAppUIProps) {\n if (\n notification.type === 're.notifica.notification.Alert' ||\n notification.type === 're.notifica.notification.Map' ||\n notification.type === 're.notifica.notification.WebView' ||\n notification.type === 're.notifica.notification.URL' ||\n notification.type === 're.notifica.notification.Video' ||\n notification.type === 're.notifica.notification.Image'\n ) {\n return (\n <div className=\"notificare__web__phone__app-ui\">\n <div className=\"notificare__web__phone__app-ui__background\">\n <div className=\"notificare__web__phone__app-ui__header\">\n <img\n className=\"notificare__web__phone__app-ui__app-icon\"\n src={appIcon}\n alt=\"App icon\"\n />\n <p className=\"notificare__web__phone__app-ui__app-name\">{appName}</p>\n <button className=\"notificare__web__phone__app-ui__close-button\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 48 48\"\n className=\"notificare__web__phone__app-ui__close-button-icon\"\n >\n <path d=\"m12.45 37.65-2.1-2.1L21.9 24 10.35 12.45l2.1-2.1L24 21.9l11.55-11.55 2.1 2.1L26.1 24l11.55 11.55-2.1 2.1L24 26.1Z\"></path>\n </svg>\n </button>\n </div>\n\n {notification.type === 're.notifica.notification.Alert' && (\n <div data-testid=\"web-mobile-app-ui-text-alert-notification\">\n {hasFirstAttachment(notification) && (\n <img\n className=\"notificare__web__phone__alert__app-ui__media\"\n src={notification.attachments?.[0].uri}\n alt=\"Notification attachment\"\n />\n )}\n\n <div>\n <p className=\"notificare__web__phone__alert__app-ui__title\">{notification.title}</p>\n <p className=\"notificare__web__phone__alert__app-ui__subtitle\">\n {notification.subtitle}\n </p>\n <p className=\"notificare__web__phone__alert__app-ui__message\">\n {notification.message}\n </p>\n </div>\n </div>\n )}\n\n {notification.type === 're.notifica.notification.WebView' && (\n <iframe\n className=\"notificare__web__phone__web-view__app-ui__content\"\n srcDoc={notification.content[0].data}\n sandbox=\"allow-same-origin\"\n data-testid=\"web-mobile-app-ui-web-view-notification\"\n />\n )}\n\n {notification.type === 're.notifica.notification.Map' && (\n <MapRichContent notification={notification} width={'100%'} height={'400px'} />\n )}\n\n {notification.type == 're.notifica.notification.URL' && (\n <div data-testid=\"web-mobile-app-ui-url-notification\">\n <Webshot\n url={notification.content[0].data}\n platform={'Web'}\n width={268}\n height={430}\n />\n </div>\n )}\n\n {notification.type === 're.notifica.notification.Video' && (\n <div data-testid=\"web-mobile-app-ui-video-notification\">\n <VideoRichContent videoData={notification.content[0]} width=\"100%\" height=\"430px\" />\n </div>\n )}\n\n {notification.type === 're.notifica.notification.Image' && (\n <div\n className=\"notificare__web__phone__image__app-ui__image-slider\"\n data-testid=\"web-mobile-app-ui-image-notification\"\n >\n {notification.content.map((image, index) => (\n <img\n key={index}\n className=\"notificare__web__phone__image__app-ui__image-slider-item\"\n src={image.data}\n alt=\"Slider image\"\n />\n ))}\n </div>\n )}\n\n {notification.actions && (\n <div\n className={`${notification.actions.length >= 3 ? 'notificare__web__phone__app-ui__actions-column' : 'notificare__web__phone__app-ui__actions-row'}`}\n >\n {notification.actions.map((action, index) => (\n <button\n key={index}\n className={`notificare__web__phone__app-ui__action ${index === 0 ? 'notificare__web__phone__app-ui__action--primary' : 'notificare__web__phone__app-ui__action--secondary'}`}\n data-testid={`web-mobile-app-ui-action-${index}`}\n >\n {action.label}\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n }\n}\n\ninterface WebMobileAppUIProps {\n notification: NotificareNotificationSchema;\n appName: string;\n appIcon: string;\n}\n","import { NotificareApplication } from '../../../../../components/NotificareNotificationPreview/models/notificare-application';\nimport { getAppIconURL } from '../../../helpers/getAppIconURL';\nimport { NotificationPreviewVariant } from '../../../models/notification-preview-variant';\nimport { NotificareNotificationSchema } from '../../../schemas/notificare-notification/notificare-notification-schema';\nimport { useOptions } from '../../OptionsProvider/OptionsProvider';\nimport AndroidPhoneBackground from '../../shared-components/AndroidPhoneBackground/AndroidPhoneBackground';\nimport IOSPhoneBackground from '../../shared-components/IOSPhoneBackground/IOSPhoneBackground';\nimport UnavailablePreview from '../../shared-components/UnavailablePreview/UnavailablePreview';\nimport WebMacOSNotification from './WebMacOSNotification/WebMacOSNotification';\nimport WebMobileAppUINotification from './WebMobileAppUINotification/WebMobileAppUINotification';\n\nexport function NotificationWebPreview({\n notification,\n application,\n mobileVariant,\n webDevice,\n webMobileType,\n webDesktopOS,\n}: NotificationWebPreviewProps) {\n const { googleMapsAPIKey } = useOptions().options;\n\n if (webDevice === 'desktop' && webDesktopOS === 'macOS') {\n return (\n <WebMacOSNotification\n key={notification.message}\n notification={notification}\n appName={application.name}\n appDomain={application.websitePushConfig.allowedDomains[0]}\n />\n );\n }\n\n if (webDevice === 'phone' && mobileVariant === 'app-ui') {\n if (\n !(\n notification.type === 're.notifica.notification.Alert' ||\n notification.type === 're.notifica.notification.Map' ||\n notification.type === 're.notifica.notification.WebView' ||\n notification.type === 're.notifica.notification.URL' ||\n notification.type === 're.notifica.notification.Video' ||\n notification.type === 're.notifica.notification.Image'\n )\n ) {\n return (\n <UnavailablePreview\n message={`→ The preview for the notification type '${notification.type}' does not exist in this variant`}\n showConsoleWarning={false}\n />\n );\n }\n\n if (notification.type === 're.notifica.notification.Map' && !googleMapsAPIKey) {\n return (\n <UnavailablePreview\n message=\"→ A Google Maps API key should be provided\"\n showConsoleWarning={false}\n />\n );\n }\n\n const PhoneBackground =\n webMobileType === 'android'\n ? AndroidPhoneBackground\n : webMobileType === 'iphone'\n ? IOSPhoneBackground\n : null;\n\n if (PhoneBackground) {\n return (\n <PhoneBackground theme={getTheme(notification.type)}>\n <WebMobileAppUINotification\n notification={notification}\n appName={application.name}\n appIcon={getAppIconURL(application.websitePushConfig.icon)}\n />\n </PhoneBackground>\n );\n }\n }\n}\n\ninterface NotificationWebPreviewProps {\n notification: NotificareNotificationSchema;\n application: NotificareApplication;\n mobileVariant: NotificationPreviewVariant['mobileVariant'];\n webDevice: NotificationPreviewVariant['webDevice'];\n webMobileType: NotificationPreviewVariant['webMobileType'];\n webDesktopOS: NotificationPreviewVariant['webDesktopOS'];\n}\n\nfunction getTheme(notificationType: NotificareNotificationSchema['type']) {\n const darkThemeTypes: NotificareNotificationSchema['type'][] = [\n 're.notifica.notification.Alert',\n 're.notifica.notification.Map',\n 're.notifica.notification.WebView',\n 're.notifica.notification.URL',\n 're.notifica.notification.Video',\n 're.notifica.notification.Image',\n ];\n return darkThemeTypes.includes(notificationType) ? 'dark' : 'light';\n}\n","import { z } from 'zod';\n\nexport const actionSchema = z.object({\n type: z.string({ message: \"Action property 'type' should be a string\" }),\n label: z.string({ message: \"Action property 'label' should be a string\" }),\n target: z.string({ message: \"Action property 'target' should be a string\" }).optional(),\n camera: z.boolean({ message: \"Action property 'camera' should be a boolean\" }).optional(),\n keyboard: z.boolean({ message: \"Action property 'keyboard' should be a boolean\" }).optional(),\n});\n","import { z } from 'zod';\n\nexport const attachmentSchema = z.object({\n mimeType: z.string({ message: \"Attachment property 'mimeType' should be a string\" }),\n uri: z\n .string({ message: \"Attachment property 'uri' should be a string\" })\n .url(\"Attachment 'uri' property should be a valid URL\"),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const alertSchema = z.object({\n type: z.literal('re.notifica.notification.Alert'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty(\"Property 'message' is mandatory\"),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const imageSchema = z.object({\n type: z.literal('re.notifica.notification.Image'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty(\"Property 'message' is mandatory\"),\n content: z.array(\n z.object({\n type: z.enum(\n ['re.notifica.content.PNG', 're.notifica.content.JPEG', 're.notifica.content.GIF'],\n {\n message:\n \"Content objects should be of type 're.notifica.content.PNG', 're.notifica.content.JPEG' or 're.notifica.content.GIF'\",\n },\n ),\n data: z\n .string({ message: 'Content objects data should be strings' })\n .url('Content objects data should be valid URLs'),\n }),\n ),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const inAppBrowserSchema = z.object({\n type: z.literal('re.notifica.notification.InAppBrowser'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty(\"Property 'message' is mandatory\"),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.URL', {\n message: \"Content object should be of type 're.notifica.content.URL'\",\n }),\n data: z\n .string({ message: 'Content object data should be a string' })\n .url('Content object data should be a valid URL'),\n }),\n ),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const mapSchema = z.object({\n type: z.literal('re.notifica.notification.Map'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty(\"Property 'message' is mandatory\"),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.Marker', {\n message: \"Content objects should be of type 're.notifica.content.Marker'\",\n }),\n data: z.object({\n title: z.string({ message: \"Content object data property 'title' should be a string\" }),\n description: z.string({\n message: \"Content object data property 'description' should be a string\",\n }),\n latitude: z\n .number({ message: \"Content object data property 'latitude' should be a number\" })\n .min(-90, \"Content object data property 'latitude' should be a minimum of -90\")\n .max(90, \"Content object data property 'latitude' should be a maximum of 90\"),\n longitude: z\n .number({ message: \"Content object data property 'longitude' should be a number\" })\n .min(-180, \"Content object data property 'longitude' must be at least -180\")\n .max(180, \"Content object data property 'longitude' must be at most 180\"),\n }),\n }),\n ),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const passbookSchema = z.object({\n type: z.literal('re.notifica.notification.Passbook'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty(\"Property 'message' is mandatory\"),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.PKPass', {\n message: \"Content object should be of type 're.notifica.content.PKPass'\",\n }),\n data: z\n .string({ message: 'Content object data should be a string' })\n .url('Content object data should be a valid URL'),\n }),\n ),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const rateSchema = z.object({\n type: z.literal('re.notifica.notification.Rate'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty(\"Property 'message' is mandatory\"),\n content: z\n .array(\n z.object({\n type: z.string({ message: 'Content object type should be a string' }),\n data: z.unknown(),\n }),\n )\n .optional(),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const storeSchema = z.object({\n type: z.literal('re.notifica.notification.Store'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty(\"Property 'message' is mandatory\"),\n content: z\n .array(\n z.object({\n type: z.string({ message: 'Content object type should be a string' }),\n data: z.union([\n z.string().nonempty('Content object data is mandatory'),\n z.object({\n identifier: z.string({\n message: \"Content object data property 'identifier' should be a string\",\n }),\n campaignToken: z\n .string({\n message: \"Content object data property 'campaignToken' should be a string\",\n })\n .optional(),\n affiliateToken: z\n .string({\n message: \"Content object data property 'affiliateToken' should be a string\",\n })\n .optional(),\n providerToken: z\n .string({\n message: \"Content object data property 'providerToken' should be a string\",\n })\n .optional(),\n }),\n ]),\n }),\n )\n .superRefine((contentArray, ctx) => {\n contentArray.forEach((content, index) => {\n const validTypes = [\n 're.notifica.content.GooglePlayDetails',\n 're.notifica.content.GooglePlayDeveloper',\n 're.notifica.content.GooglePlayCollection',\n 're.notifica.content.GooglePlaySearch',\n 're.notifica.content.AppGalleryDetails',\n 're.notifica.content.AppGallerySearch',\n 're.notifica.content.AppStore',\n ];\n\n if (!validTypes.includes(content.type)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n \"Content object type should be one of: 're.notifica.content.GooglePlayDetails', 're.notifica.content.GooglePlayDeveloper', 're.notifica.content.GooglePlayCollection', 're.notifica.content.GooglePlaySearch', 're.notifica.content.AppGalleryDetails', 're.notifica.content.AppGallerySearch', 're.notifica.content.AppStore'\",\n path: ['content', index, 'type'],\n });\n }\n\n // App store content object data validation\n if (content.type === 're.notifica.content.AppStore' && typeof content.data !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n \"AppStore content object data must be an object with 'identifier' (mandatory), 'campaignToken', 'affiliateToken', or 'providerToken'\",\n path: ['content', index, 'data'],\n });\n }\n\n // Google & AppGallery content object data validation\n if (content.type !== 're.notifica.content.AppStore' && typeof content.data !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'GooglePlay and AppGallery content object data must be a string',\n path: ['content', index, 'data'],\n });\n }\n });\n }),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const urlSchema = z.object({\n type: z.literal('re.notifica.notification.URL'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty(\"Property 'message' is mandatory\"),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.URL', {\n message: \"Content object should be of type 're.notifica.content.URL'\",\n }),\n data: z\n .string({ message: 'Content object data should be a string' })\n .url('Content object data should be a valid URL'),\n }),\n ),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const videoSchema = z.object({\n type: z.literal('re.notifica.notification.Video'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty(\"Property 'message' is mandatory\"),\n content: z\n .array(\n z.object({\n type: z.string({ message: 'Content object type should be a string' }),\n data: z.string().nonempty('Content object data is mandatory'),\n }),\n )\n .superRefine((contentArray, ctx) => {\n contentArray.forEach((content, index) => {\n const validTypes = [\n 're.notifica.content.YouTube',\n 're.notifica.content.Vimeo',\n 're.notifica.content.HTML5Video',\n ];\n\n if (!validTypes.includes(content.type)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n \"Content object should be of type 're.notifica.content.YouTube', 're.notifica.content.Vimeo' or 're.notifica.content.HTML5Video'\",\n path: ['content', index, 'type'],\n });\n }\n\n // HTML5Video content object data validation\n if (content.type === 're.notifica.content.HTML5Video') {\n try {\n new URL(content.data);\n } catch {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'For a HTML5Video, content object data should be a valid URL',\n path: ['content', index, 'data'],\n });\n }\n }\n });\n }),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { actionSchema } from './action-schema';\nimport { attachmentSchema } from './attachment-schema';\n\nexport const webViewSchema = z.object({\n type: z.literal('re.notifica.notification.WebView'),\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .nonempty('Message is mandatory'),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.HTML', {\n message: \"Content object should be of type 're.notifica.content.HTML'\",\n }),\n data: z.string({ message: 'Content data should be a string containing the HTML markup' }),\n }),\n ),\n actions: z.array(actionSchema).optional(),\n attachments: z.array(attachmentSchema).optional(),\n});\n","import { z } from 'zod';\nimport { alertSchema } from './internal/alert-schema';\nimport { imageSchema } from './internal/image-schema';\nimport { inAppBrowserSchema } from './internal/in-app-browser-schema';\nimport { mapSchema } from './internal/map-schema';\nimport { passbookSchema } from './internal/passbook-schema';\nimport { rateSchema } from './internal/rate-schema';\nimport { storeSchema } from './internal/store-schema';\nimport { urlSchema } from './internal/url-schema';\nimport { videoSchema } from './internal/video-schema';\nimport { webViewSchema } from './internal/web-view-schema';\n\nexport const notificareNotificationSchema = z.discriminatedUnion('type', [\n alertSchema,\n webViewSchema,\n urlSchema,\n inAppBrowserSchema,\n imageSchema,\n mapSchema,\n rateSchema,\n passbookSchema,\n videoSchema,\n storeSchema,\n]);\n\nexport type NotificareNotificationSchema = z.infer<typeof notificareNotificationSchema>;\n","import '../../preset.css';\nimport './NotificareNotificationPreview.css';\nimport { useEffect, useState } from 'react';\nimport { ZodIssue } from 'zod';\nimport { getPushAPIHost } from '../../config/api';\nimport Controls from '../../internal/NotificareNotificationPreview/components/Controls/Controls';\nimport { OptionsProvider } from '../../internal/NotificareNotificationPreview/components/OptionsProvider/OptionsProvider';\nimport { NotificationAndroidPreview } from '../../internal/NotificareNotificationPreview/components/preview-components/NotificationAndroidPreview/NotificationAndroidPreview';\nimport NotificationIOSPreview from '../../internal/NotificareNotificationPreview/components/preview-components/NotificationIOSPreview/NotificationIOSPreview';\nimport { NotificationWebPreview } from '../../internal/NotificareNotificationPreview/components/preview-components/NotificationWebPreview/NotificationWebPreview';\nimport LoadingIcon from '../../internal/NotificareNotificationPreview/components/shared-components/LoadingIcon/LoadingIcon';\nimport UnavailablePreview from '../../internal/NotificareNotificationPreview/components/shared-components/UnavailablePreview/UnavailablePreview';\nimport { NotificationPreviewVariant } from '../../internal/NotificareNotificationPreview/models/notification-preview-variant';\nimport { notificareNotificationSchema } from '../../internal/NotificareNotificationPreview/schemas/notificare-notification/notificare-notification-schema';\nimport { NotificareApplication } from './models/notificare-application';\nimport { NotificareNotification } from './models/notificare-notification';\nimport { NotificareNotificationVariant } from './models/notificare-notification-variant';\n\nconst defaultApplication: NotificareApplication = {\n name: 'My App',\n androidPackageName: 'com.example.app',\n websitePushConfig: {\n icon: 'https://avatars.githubusercontent.com/u/1728060?s=200&v=4',\n allowedDomains: ['https://my-app.com/'],\n },\n};\n\nexport default function NotificareNotificationPreview({\n notification,\n applicationId,\n showControls = true,\n variant = 'android-lockscreen',\n serviceKey,\n googleMapsAPIKey,\n}: NotificareNotificationPreviewProps) {\n const [application, setApplication] = useState<NotificareApplication>();\n\n useEffect(() => {\n (async function fetchApplicationData() {\n if (applicationId) {\n try {\n const response = await fetch(\n `${getPushAPIHost()}/application/${applicationId}/info?apiKey=${serviceKey}`,\n );\n\n if (!response.ok) {\n const { error } = await response.json();\n console.error(`There was an error trying to get the application: ${error}`);\n setApplication(defaultApplication);\n } else {\n const { application } = await response.json();\n setApplication(application);\n }\n } catch (error) {\n console.error('Error fetching the application: ', error);\n setApplication(defaultApplication);\n }\n } else {\n setApplication(defaultApplication);\n }\n })();\n }, [applicationId, serviceKey]);\n\n const notificationPreviewVariants = new Map<\n NotificareNotificationPreviewProps['variant'],\n NotificationPreviewVariant\n >([\n ['android-lockscreen', { platform: 'android', mobileVariant: 'lockscreen' }],\n ['android-lockscreen-expanded', { platform: 'android', mobileVariant: 'lockscreen-expanded' }],\n ['android-app-ui', { platform: 'android', mobileVariant: 'app-ui' }],\n ['ios-lockscreen', { platform: 'ios', mobileVariant: 'lockscreen' }],\n ['ios-lockscreen-expanded', { platform: 'ios', mobileVariant: 'lockscreen-expanded' }],\n ['ios-app-ui', { platform: 'ios', mobileVariant: 'app-ui' }],\n ['web-desktop-macos', { platform: 'web', webDevice: 'desktop', webDesktopOS: 'macOS' }],\n [\n 'web-iphone-app-ui',\n { platform: 'web', webDevice: 'phone', webMobileType: 'iphone', mobileVariant: 'app-ui' },\n ],\n [\n 'web-android-app-ui',\n { platform: 'web', webDevice: 'phone', webMobileType: 'android', mobileVariant: 'app-ui' },\n ],\n ]);\n\n const [platform, setPlatform] = useState<NotificationPreviewVariant['platform']>(\n notificationPreviewVariants.get(variant)?.platform,\n );\n const [mobileVariant, setMobileVariant] = useState<NotificationPreviewVariant['mobileVariant']>(\n notificationPreviewVariants.get(variant)?.mobileVariant,\n );\n const [webDevice, setWebDevice] = useState<NotificationPreviewVariant['webDevice']>(\n notificationPreviewVariants.get(variant)?.webDevice,\n );\n const [webMobileType, setWebMobileType] = useState<NotificationPreviewVariant['webMobileType']>(\n notificationPreviewVariants.get(variant)?.webMobileType,\n );\n const [webDesktopOS, setWebDesktopOS] = useState<NotificationPreviewVariant['webDesktopOS']>(\n notificationPreviewVariants.get(variant)?.webDesktopOS,\n );\n\n const notificationResult = notificareNotificationSchema.safeParse(notification);\n\n if (!notificationResult.success) {\n showNotificationErrors(notificationResult.error.errors);\n }\n\n return (\n <OptionsProvider options={{ serviceKey, googleMapsAPIKey }}>\n <div className=\"notificare\">\n <div className=\"notificare__push__preview-wrapper\">\n {showControls && (\n <Controls\n platform={platform}\n mobileVariant={mobileVariant}\n webDevice={webDevice}\n webMobileType={webMobileType}\n webDesktopOS={webDesktopOS}\n setPlatform={setPlatform}\n setMobileVariant={setMobileVariant}\n setWebDesktopOS={setWebDesktopOS}\n setWebDevice={setWebDevice}\n setWebMobileType={setWebMobileType}\n />\n )}\n\n {application ? (\n <div className=\"notificare__push__preview\">\n {notificationResult.success ? (\n <>\n {platform === 'android' && (\n <NotificationAndroidPreview\n notification={notificationResult.data}\n application={application}\n mobileVariant={mobileVariant}\n />\n )}\n\n {platform === 'ios' && (\n <NotificationIOSPreview\n notification={notificationResult.data}\n application={application}\n mobileVariant={mobileVariant}\n />\n )}\n\n {platform === 'web' && (\n <NotificationWebPreview\n notification={notificationResult.data}\n application={application}\n mobileVariant={mobileVariant}\n webDevice={webDevice}\n webMobileType={webMobileType}\n webDesktopOS={webDesktopOS}\n />\n )}\n </>\n ) : (\n <UnavailablePreview message={'→ Invalid Notification'} showConsoleWarning={true} />\n )}\n </div>\n ) : (\n <LoadingIcon />\n )}\n </div>\n </div>\n </OptionsProvider>\n );\n}\n\n/**\n * Component that displays a notification preview for different platforms.\n *\n * @param {NotificareNotification} notification - The notification to be displayed in the preview.\n * @param {string} applicationId - The unique identifier of a Notificare application (optional).\n * @param {boolean} [showControls] - Whether the controls should be shown (optional). It's true by default.\n * @param {NotificareNotificationVariant} variant - The variant of the notification preview (optional). It's 'android-lockscreen' by default.\n * @property {string} [serviceKey] - A service key provided by a Notificare admin.\n * @property {string} [googleMapsAPIKey] - A Google Maps API key (optional).\n */\ninterface NotificareNotificationPreviewProps {\n notification: NotificareNotification;\n applicationId?: string;\n showControls?: boolean;\n variant?: NotificareNotificationVariant;\n serviceKey: string;\n googleMapsAPIKey?: string;\n}\n\nfunction showNotificationErrors(errors: ZodIssue[]) {\n const invalidType = errors.find(\n (e) => e.code === 'invalid_union_discriminator' && e.path.includes('type'), // check if notification type is valid\n );\n\n if (invalidType) {\n const validTypes = notificareNotificationSchema.options.map(\n (schema) => schema.shape.type.value,\n );\n\n console.error(\n `Notification error: \\n\\nInvalid notification type. Expected one of: ${validTypes.join(', ')}`,\n );\n } else {\n // Other errors besides 'type'\n const messages = errors.map((e) => e.message);\n console.error('Notification errors:\\n\\n' + messages.join('\\n'));\n }\n}\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","SuppressedError","Selector","options","selected","setSelected","isExpanded","setIsExpanded","useState","optionsRef","useRef","useEffect","find","option","key","handleClickOutside","event","current","contains","target","addEventListener","removeEventListener","length","_jsxs","jsxs","className","_jsx","jsx","children","onClick","_a","label","xmlns","viewBox","d","map","ToggleGroup","index","Fragment","icon","Controls","platform","mobileVariant","webDevice","webMobileType","webDesktopOS","setPlatform","setMobileVariant","setWebDevice","setWebMobileType","setWebDesktopOS","platforms","width","webDevices","webMobileTypes","_Fragment","OptionsProvider","OptionsContext","Provider","useOptions","context","useContext","Error","createContext","undefined","getAppIconURL","appIcon","startsWith","AndroidPhoneBackground","theme","UnavailablePreview","message","showConsoleWarning","LoadingIcon","fill","PreviewError","Webshot","url","height","onLoadingChange","canShow","serviceKey","webshot","setWebshot","hasError","setHasError","isLoading","setIsLoading","console","error","URL","isValidUrl","checkStatusLoop","debounce","setTimeout","this","webshotId","response","fetch","method","headers","body","JSON","stringify","delay","params","json","id","requestWebshot","setInterval","webshotStatus","status","getWebshotStatus","clearInterval","blob","createObjectURL","getWebshot","clearTimeout","src","alt","NavigationBar","appName","title","showOptions","AppRecommendationNotification","notification","getUrlByContentType","content","data","hasActions","actions","hasSingleAction","hasMultipleActions","hasFirstAttachment","attachments","DigitalCardNotification","split","ImagesNotification","image","getUrlMainDomain","hostname","parts","slice","join","isSecureUrl","protocol","InAppBrowserBar","pageTitle","setPageTitle","apiKey","URLSearchParams","toString","html","text","parser","DOMParser","_b","parseFromString","querySelector","textContent","getPageTitle","InAppBrowserNotification","isPageTitleLoading","setIsPageTitleLoading","isWebshotLoading","setIsWebshotLoading","LockScreenNotification","expanded","subtitle","uri","fastDeepEqual","equal","a","b","constructor","i","keys","Array","isArray","RegExp","source","flags","valueOf","Object","prototype","hasOwnProperty","call","_extends","assign","bind","n","arguments","t","r","_objectWithoutPropertiesLoose","indexOf","_toPropertyKey","Symbol","toPrimitive","TypeError","_toPrimitive","APILoadingStatus","GoogleMapsApiLoader","load","onLoadingStatusChange","_window$google","libraries","serializedParams","serializeParams","listeners","push","window","google","maps","importLibrary","serializedApiParams","loadingStatus","notifyLoadingStatusListeners","initImportLibrary","warn","librariesToLoad","all","name","v","language","region","authReferrerPolicy","solutionChannel","apiPromise","loadApi","_document$querySelect","scriptElement","urlParams","entries","urlParamName","replace","toLowerCase","set","String","async","MAPS_API_BASE_URL","nonce","onerror","__googleMapsCallback__","gm_authFailure","append","libraryName","fn","_excluded$3","_excluded2$1","APIProviderContext","React","APIProvider","props","loaderProps","mapInstances","addMapInstance","removeMapInstance","clearMapInstances","setMapInstances","mapInstance","instances","_ref","useMapInstances","loadedLibraries","onLoad","onError","version","otherApiParams","setStatus","addLoadedLibrary","useReducer","action","librariesString","useMemo","useCallback","_google","res","channel","useGoogleMapsApiLoader","contextValue","createMapEvent","srcEvent","ev","detail","stoppable","stop","cameraEventTypes","includes","camEvent","center","getCenter","zoom","getZoom","heading","getHeading","tilt","getTilt","bounds","getBounds","Number","isFinite","toJSON","lat","lng","north","east","south","west","mouseEventTypes","_srcEvent$latLng","mouseEvent","domEvent","latLng","placeId","propNameToEventType","onBoundsChanged","onCenterChanged","onContextmenu","onDblclick","onDrag","onDragend","onDragstart","onHeadingChanged","onIdle","onIsFractionalZoomEnabledChanged","onMapCapabilitiesChanged","onMapTypeIdChanged","onMousemove","onMouseout","onMouseover","onProjectionChanged","onRenderingTypeChanged","onTilesLoaded","onTiltChanged","onZoomChanged","onCameraChanged","eventPropNames","mapOptionKeys","Set","useMapOptions","mapProps","mapOptions","has","effect","deps","isDeepEqual","useDeepCompareEffect","setOptions","useApiLoadingStatus","_useContext","toLatLngLiteral","obj","isLatLngLiteral","AuthFailureMessage","position","top","left","bottom","right","zIndex","display","flexFlow","textAlign","justifyContent","fontSize","color","background","padding","useApiIsLoaded","useTrackedCameraStateRef","forceUpdate","x","useForceUpdate","listener","addListener","handleBoundsChange","remove","_excluded$2","_excluded2","CachedMapStack","pop","useMapInstance","apiIsLoaded","setMap","container","containerRef","el","setEl","useCallbackRef","cameraStateRef","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme","hasZoom","hasCenter","savedMapStateRef","mapId","cacheKey","mapDiv","getDiv","setCenter","Map","defBounds","fitBounds","savedMapId","cameraState","savedCameraState","clearInstanceListeners","GoogleMapsContext","mapRef","useLayoutEffect","nextCamera","needsUpdate","moveCamera","useMapCameraParams","propName","handler","eventType","useMapEvents","isDeckGlControlled","viewport","viewState","latitude","longitude","bearing","pitch","useDeckGLCameraUpdate","isControlledExternally","controlled","disableDefaultUI","gestureHandling","keyboardShortcuts","cameraOptions","_lat","_lng","_props$zoom","_props$heading","_props$tilt","combinedStyle","deckGLViewProps","shownMessages","useMap","ctx","args","add","logErrorOnce","useMapsEventListener","callback","usePropBinding","object","prop","useDomEventListener","AdvancedMarkerContext","AdvancedMarkerAnchorPoint","BOTTOM","MarkerContent","styles","anchorPoint","xTranslation","yTranslation","xTranslationFlipped","yTranslationFlipped","trimStart","substring","transformStyle","transform","useAdvancedMarker","marker","setMarker","contentContainer","setContentContainer","markerLibrary","useMapsLibrary","onMouseEnter","onMouseLeave","onDragStart","onDragEnd","collisionBehavior","clickable","draggable","numChildren","Children","count","newMarker","AdvancedMarkerElement","contentElement","isCustomMarker","_contentElement","gmpDraggable","gmpClickable","Boolean","nodeType","Node","ELEMENT_NODE","pointerEvents","firstElementChild","element","forwardRef","advancedMarkerContextValue","useImperativeHandle","createPortal","_excluded","Marker","onMouseOver","onMouseOut","markerOptions","m","gme","setDraggable","setPosition","useMarker","MapRichContent","googleMapsAPIKey","markers","forEach","contentRow","getMarkersFromNotification","isClient","setIsClient","MapWithStatus","apiLoadStatus","backgroundColor","overflow","MapNotification","RateNotification","appAndroidPackageName","TextAlertNotification","fetchWebsiteMarkup","markupHasNotificareOpenActionQueryParameter","links","querySelectorAll","hasParameter","link","href","location","origin","searchParams","URLNotification","websiteMarkup","setWebsiteMarkup","VideoRichContent","videoData","getVideoUrl","sandbox","allow","autoPlay","controls","VideoNotification","WebViewNotification","srcDoc","NotificationAndroidPreview","application","getTheme","websitePushConfig","androidPackageName","notificationType","IOSPhoneBackground","StarRating","rating","stars","FullStar","HalfStar","EmptyStar","offset","stopColor","appStoreData","setAppStoreData","identifier","resultCount","results","artworkUrl512","trackName","primaryGenreName","formatNumber","userRatingCount","averageUserRating","toFixed","trackContentRating","sellerName","timeAgo","currentVersionReleaseDate","releaseNotes","screenshotUrls","isoDate","date","Date","now","diffInSeconds","Math","floor","getTime","intervals","Infinity","num","TitleBar","NotificationIOSPreview","ExpandButton","open","disabled","onToggle","WebMacOSNotification","appDomain","setExpanded","mouseOverNotification","setMouseOverNotification","mouseOverButtonIndex","setMouseOverButtonIndex","expandable","setExpandable","openOptions","setOpenOptions","isClosing","setIsClosing","isExpanding","setIsExpanding","initialPreviewHeight","setInitialPreviewHeight","previewRef","messageRef","fullTextHeight","scrollHeight","previewHeight","previewElement","messageElement","clientHeight","extractDomain","prevState","_c","util","objectUtil","WebMobileAppUINotification","NotificationWebPreview","allowedDomains","PhoneBackground","assertEqual","val","assertIs","_arg","assertNever","_x","arrayToEnum","items","item","getValidEnumValues","validKeys","objectKeys","filter","k","filtered","objectValues","arr","checker","isInteger","joinValues","array","separator","jsonStringifyReplacer","_","mergeShapes","first","second","ZodParsedType","getParsedType","string","isNaN","nan","number","boolean","function","bigint","symbol","null","catch","promise","unknown","ZodIssueCode","ZodError","errors","issues","super","addIssue","sub","addIssues","subs","actualProto","setPrototypeOf","__proto__","format","_mapper","mapper","issue","fieldErrors","_errors","processError","code","unionErrors","returnTypeError","argumentsError","path","curr","assert","isEmpty","flatten","formErrors","create","errorMap","_ctx","invalid_type","received","expected","invalid_literal","unrecognized_keys","invalid_union","invalid_union_discriminator","invalid_enum_value","invalid_arguments","invalid_return_type","invalid_date","invalid_string","validation","endsWith","too_small","exact","inclusive","minimum","too_big","maximum","custom","invalid_intersection_types","not_multiple_of","multipleOf","not_finite","defaultError","overrideErrorMap","getErrorMap","makeIssue","errorMaps","issueData","fullPath","fullIssue","errorMessage","reverse","addIssueToContext","overrideMap","common","contextualErrorMap","schemaErrorMap","ParseStatus","dirty","abort","mergeArray","arrayValue","s","INVALID","mergeObjectAsync","pairs","syncPairs","pair","mergeObjectSync","finalObject","alwaysSet","freeze","DIRTY","OK","isAborted","isDirty","isValid","isAsync","__classPrivateFieldGet","receiver","state","kind","f","get","__classPrivateFieldSet","errorUtil","_ZodEnum_cache","_ZodNativeEnum_cache","errToObj","ParseInputLazyPath","parent","_cachedPath","_path","_key","handleResult","success","_error","processCreateParams","invalid_type_error","required_error","description","iss","ZodType","_def","_getType","input","_getOrReturnCtx","parsedType","_processInputParams","_parseSync","_parse","_parseAsync","parse","safeParse","err","parseAsync","safeParseAsync","maybeAsyncResult","refine","check","getIssueProperties","_refinement","setError","refinement","refinementData","ZodEffects","schema","typeName","ZodFirstPartyTypeKind","superRefine","def","spa","optional","nullable","nullish","or","and","brand","default","describe","pipe","readonly","isNullable","isOptional","vendor","validate","ZodOptional","ZodNullable","ZodArray","ZodPromise","ZodUnion","incoming","ZodIntersection","defaultValueFunc","ZodDefault","innerType","defaultValue","ZodBranded","catchValueFunc","ZodCatch","catchValue","This","ZodPipeline","ZodReadonly","cuidRegex","cuid2Regex","ulidRegex","uuidRegex","nanoidRegex","jwtRegex","durationRegex","emailRegex","emojiRegex","ipv4Regex","ipv4CidrRegex","ipv6Regex","ipv6CidrRegex","base64Regex","base64urlRegex","dateRegexSource","dateRegex","timeRegexSource","secondsRegexSource","precision","datetimeRegex","regex","opts","local","isValidJWT","jwt","alg","test","header","base64","padEnd","decoded","atob","typ","isValidCidr","ip","ZodString","coerce","checks","tooBig","tooSmall","lastIndex","trim","toUpperCase","_regex","_addCheck","email","emoji","uuid","nanoid","cuid","cuid2","ulid","base64url","cidr","datetime","time","duration","min","minLength","max","maxLength","len","nonempty","isDatetime","ch","isDate","isTime","isDuration","isEmail","isURL","isEmoji","isUUID","isNANOID","isCUID","isCUID2","isULID","isIP","isCIDR","isBase64","isBase64url","floatSafeRemainder","valDecCount","stepDecCount","decCount","parseInt","pow","ZodNumber","gte","lte","setLimit","gt","lt","int","positive","negative","nonpositive","nonnegative","finite","safe","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","minValue","maxValue","isInt","ZodBigInt","BigInt","_getInvalidInput","ZodBoolean","ZodDate","minDate","maxDate","ZodSymbol","ZodUndefined","ZodNull","ZodAny","_any","ZodUnknown","_unknown","ZodNever","never","ZodVoid","void","exactLength","deepPartialify","ZodObject","newShape","shape","fieldSchema","unwrap","ZodTuple","_cached","nonstrict","passthrough","augment","extend","_getCached","shapeKeys","extraKeys","catchall","unknownKeys","keyValidator","strict","_d","strip","augmentation","merge","merging","setKey","pick","mask","omit","deepPartial","partial","required","newField","keyof","createZodEnum","strictCreate","lazycreate","childCtx","types","getDiscriminator","ZodLazy","ZodLiteral","ZodEnum","ZodNativeEnum","enum","ZodDiscriminatedUnion","discriminator","discriminatorValue","optionsMap","from","discriminatorValues","mergeValues","aType","bType","valid","bKeys","sharedKeys","newObj","sharedValue","newArray","handleParsed","parsedLeft","parsedRight","merged","rest","itemIndex","schemas","ZodRecord","keySchema","keyType","valueSchema","valueType","third","ZodMap","finalMap","ZodSet","minSize","size","maxSize","finalizeSet","elements","parsedSet","values","ZodFunction","implement","makeArgsIssue","makeReturnsIssue","returns","me","parsedArgs","Reflect","parsedReturns","parameters","returnType","func","strictImplement","getter","expectedValues","enumValues","Values","Enum","extract","newDef","exclude","opt","WeakMap","nativeEnumValues","promisified","sourceType","checkCtx","arg","fatal","processed","executeRefinement","acc","inner","base","createWithPreprocess","preprocess","removeDefault","newCtx","removeCatch","ZodNaN","BRAND","inResult","in","out","handleAsync","cleanParams","p","_params","_fatal","late","stringType","numberType","nanType","bigIntType","booleanType","dateType","symbolType","undefinedType","nullType","anyType","unknownType","neverType","voidType","arrayType","objectType","strictObjectType","unionType","discriminatedUnionType","intersectionType","tupleType","recordType","mapType","setType","functionType","lazyType","literalType","enumType","nativeEnumType","promiseType","effectsType","optionalType","nullableType","preprocessType","pipelineType","NEVER","z","defaultErrorMap","setErrorMap","EMPTY_PATH","ZodTransformer","Schema","ZodSchema","any","discriminatedUnion","instanceof","cls","intersection","lazy","literal","nativeEnum","oboolean","onumber","ostring","pipeline","record","strictObject","transformer","tuple","union","quotelessJson","actionSchema","camera","keyboard","attachmentSchema","mimeType","alertSchema","imageSchema","inAppBrowserSchema","mapSchema","passbookSchema","rateSchema","storeSchema","campaignToken","affiliateToken","providerToken","contentArray","urlSchema","videoSchema","webViewSchema","notificareNotificationSchema","defaultApplication","applicationId","showControls","variant","setApplication","ok","notificationPreviewVariants","_e","notificationResult","validTypes","messages","showNotification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C,IAAA,MAAA,CAAKF,UAAU,sBACbF,EAAAA,KAAK,MAAA,CAAAE,UAAU,oCACZG,SAAA,CAAAkpC,GACCppC,EAAAC,IAACa,EACC,CAAAC,SAAUA,EACVC,cAAeA,EACfC,UAAWA,EACXC,cAAeA,EACfC,aAAcA,EACdC,YAAaA,EACbC,iBAAkBA,EAClBG,gBAAiBA,EACjBF,aAAcA,EACdC,iBAAkBA,IAIrB4f,EACCnhB,aAAKD,UAAU,4BACZG,SAAAwpC,EAAmB7Z,QAClBhwB,EAAAA,KAAAgC,EAAAA,SAAA,CAAA3B,SAAA,CACgB,YAAba,GACCf,EAAAA,IAACkhB,GACC,CAAA/a,aAAcujC,EAAmBpjC,KACjC6a,YAAaA,EACbngB,cAAeA,IAIL,QAAbD,GACCf,EAAAA,IAAC+jB,GAAsB,CACrB5d,aAAcujC,EAAmBpjC,KACjC6a,YAAaA,EACbngB,cAAeA,IAIL,QAAbD,GACCf,EAAAA,IAACmmB,IACChgB,aAAcujC,EAAmBpjC,KACjC6a,YAAaA,EACbngB,cAAeA,EACfC,UAAWA,EACXC,cAAeA,EACfC,aAAcA,OAKpBnB,EAACC,IAAA2C,GAAmBC,QAAS,yBAA0BC,oBAAoB,MAI/E9C,EAAAA,IAAC+C,EAAW,CAAA,SAMxB","x_google_ignoreList":[0,1,22,23,53]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../node_modules/tslib/tslib.es6.js","../../node_modules/@formatjs/fast-memoize/lib/index.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../../node_modules/intl-messageformat/lib/src/error.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../../node_modules/intl-messageformat/lib/src/formatters.js","../../node_modules/intl-messageformat/lib/src/core.js","../../node_modules/@formatjs/intl/lib/src/error.js","../../node_modules/@formatjs/intl/lib/src/utils.js","../../node_modules/@formatjs/intl/lib/src/message.js","../../node_modules/@formatjs/intl/lib/src/dateTime.js","../../node_modules/@formatjs/intl/lib/src/displayName.js","../../node_modules/@formatjs/intl/lib/src/list.js","../../node_modules/@formatjs/intl/lib/src/plural.js","../../node_modules/@formatjs/intl/lib/src/relativeTime.js","../../node_modules/@formatjs/intl/lib/src/number.js","../../node_modules/@formatjs/intl/lib/src/create-intl.js","../../node_modules/react-intl/lib/src/utils.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js","../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../node_modules/react-intl/lib/src/components/injectIntl.js","../../node_modules/react-intl/lib/src/components/createFormattedComponent.js","../../node_modules/react-intl/lib/src/components/useIntl.js","../../node_modules/react-intl/lib/src/components/createIntl.js","../../node_modules/react-intl/lib/src/components/message.js","../../node_modules/react-intl/lib/src/components/provider.js","../../node_modules/style-inject/dist/style-inject.es.js","../../node_modules/react-intl/lib/index.js","../../src/internal/components/shared/AndroidPhoneBackground/AndroidPhoneBackground.tsx","../../src/assets/loading.svg","../../src/internal/components/shared/IOSPhoneBackground/IOSPhoneBackground.tsx","../../src/assets/alert.svg","../../src/internal/components/shared/Loading/Loading.tsx","../../src/locales/push/en.ts","../../src/assets/expand.svg","../../src/internal/components/shared/PreviewError/PreviewError.tsx","../../src/internal/network/errors.ts","../../src/internal/network/requests/application.ts","../../src/internal/hooks/application-loader.ts","../../src/internal/network/api.ts","../../src/internal/hooks/debounce.ts","../../src/internal/utils/locale.ts","../../src/locales/in-app-messaging/en.ts","../../src/locales/in-app-messaging/fr.ts","../../src/locales/in-app-messaging/pt.ts","../../src/locales/push/fr.ts","../../src/locales/push/pt.ts","../../src/internal/hooks/localization-loader.ts","../../src/internal/components/shared/Selector/Selector.tsx","../../src/internal/hooks/outside-click.ts","../../src/internal/components/shared/ToggleGroup/ToggleGroup.tsx","../../src/internal/components/shared/UnavailablePreview/UnavailablePreview.tsx","../../src/internal/context/options.tsx","../../src/internal/utils/url.ts","../../src/internal/components/shared/Webshot/hooks/index.ts","../../src/internal/network/requests/webshot.ts","../../src/assets/locker.svg","../../src/internal/components/shared/Webshot/Webshot.tsx","../../src/assets/x-mark.svg","../../src/internal/components/push/platforms/android/app-ui/InAppBrowserNotification/InAppBrowserBar/InAppBrowserBar.tsx","../../src/internal/components/push/platforms/android/app-ui/InAppBrowserNotification/InAppBrowserNotification.tsx","../../src/internal/context/application.tsx","../../src/internal/network/requests/website-markup.ts","../../src/internal/utils/push-previews/notification.ts","../../src/assets/left-arrow.svg","../../src/assets/options.svg","../../src/internal/components/push/platforms/android/app-ui/NavigationBar/NavigationBar.tsx","../../src/internal/utils/url-resolver.ts","../../src/internal/components/push/platforms/android/app-ui/URLNotification/URLNotification.tsx","../../src/internal/components/push/platforms/android/app-ui/URLResolverNotification/URLResolverNotification.tsx","../../src/internal/components/push/platforms/android/app-ui/AppRecommendationNotification/AppRecommendationNotification.tsx","../../src/internal/components/push/platforms/android/app-ui/DigitalCardNotification/DigitalCardNotification.tsx","../../src/internal/components/push/platforms/android/app-ui/ImagesNotification/ImagesNotification.tsx","../../node_modules/fast-deep-equal/index.js","../../node_modules/@vis.gl/react-google-maps/dist/index.modern.mjs","../../src/internal/components/push/platforms/shared/MapRichContent/MapRichContent.tsx","../../src/internal/components/push/platforms/android/app-ui/MapNotification/MapNotification.tsx","../../src/assets/default-app-icon.svg","../../src/internal/components/push/platforms/android/app-ui/RateNotification/RateNotification.tsx","../../src/internal/components/push/platforms/android/app-ui/TextAlertNotification/TextAlertNotification.tsx","../../src/internal/components/push/platforms/shared/VideoRichContent/VideoRichContent.tsx","../../src/internal/components/push/platforms/android/app-ui/VideoNotification/VideoNotification.tsx","../../src/internal/components/push/platforms/android/app-ui/WebViewNotification/WebViewNotification.tsx","../../src/internal/components/push/platforms/android/lock-screen/LockScreenNotification.tsx","../../src/internal/components/push/platforms/android/NotificationAndroidPreview.tsx","../../src/internal/components/push/platforms/ios/app-ui/InAppBrowserNotification/InAppBrowserBar/InAppBrowserBar.tsx","../../src/internal/components/push/platforms/ios/app-ui/InAppBrowserNotification/InAppBrowserNotification.tsx","../../src/internal/components/push/platforms/ios/app-ui/TitleBar/TitleBar.tsx","../../src/assets/layer-group.svg","../../src/internal/components/push/platforms/ios/app-ui/URLNotification/URLNotification.tsx","../../src/internal/components/push/platforms/ios/app-ui/URLResolverNotification/URLResolverNotification.tsx","../../src/assets/user.svg","../../src/assets/full-star.svg","../../src/internal/components/push/platforms/ios/app-ui/AppRecommendationNotification/hooks/index.ts","../../src/internal/components/push/platforms/ios/app-ui/AppRecommendationNotification/requests/ios-store-app.ts","../../src/internal/utils/time-ago.ts","../../src/assets/half-star.svg","../../src/internal/components/push/platforms/ios/app-ui/AppRecommendationNotification/StarRating/StarRating.tsx","../../src/internal/components/push/platforms/ios/app-ui/AppRecommendationNotification/AppRecommendationNotification.tsx","../../src/internal/components/push/platforms/ios/app-ui/DigitalCardNotification/DigitalCardNotification.tsx","../../src/internal/components/push/platforms/ios/app-ui/ImagesNotification/ImagesNotification.tsx","../../src/internal/components/push/platforms/ios/app-ui/MapNotification/MapNotification.tsx","../../src/internal/components/push/platforms/ios/app-ui/RateNotification/RateNotification.tsx","../../src/internal/components/push/platforms/ios/app-ui/TextAlertNotification/TextAlertNotification.tsx","../../src/internal/components/push/platforms/ios/app-ui/VideoNotification/VideoNotification.tsx","../../src/internal/components/push/platforms/ios/app-ui/WebViewNotification/WebViewNotification.tsx","../../src/internal/components/push/platforms/ios/lock-screen/LockScreenNotification.tsx","../../src/assets/thin-x-mark.svg","../../src/internal/components/push/platforms/ios/NotificationIOSPreview.tsx","../../src/internal/components/push/platforms/web/app-ui/mobile/URLNotification/URLNotification.tsx","../../src/internal/components/push/platforms/web/app-ui/mobile/URLResolverNotification/URLResolverNotification.tsx","../../src/internal/components/push/platforms/web/app-ui/mobile/AlertNotification/AlertNotification.tsx","../../src/internal/components/push/platforms/web/app-ui/mobile/ImageNotification/ImageNotification.tsx","../../src/internal/components/push/platforms/web/app-ui/mobile/WebViewNotification/WebViewNotification.tsx","../../src/assets/google-chrome.svg","../../src/internal/components/push/platforms/web/app-ui/mobile/WebMobileAppUINotification.tsx","../../src/internal/components/push/platforms/web/lockscreen/ExpandButton/ExpandButton.tsx","../../src/internal/components/push/platforms/web/lockscreen/WebMacOSNotification.tsx","../../src/internal/components/push/platforms/web/NotificationWebPreview.tsx","../../src/internal/components/push/NotificationPreview.tsx","../../src/assets/android.svg","../../src/assets/desktop.svg","../../src/assets/html5.svg","../../src/assets/ios.svg","../../src/assets/phone.svg","../../src/internal/components/push/preview-controls/Controls.tsx","../../src/internal/components/push/preview-wrapper/NotificationPreviewWrapper.tsx","../../node_modules/zod/dist/esm/v3/helpers/util.js","../../node_modules/zod/dist/esm/v3/ZodError.js","../../node_modules/zod/dist/esm/v3/locales/en.js","../../node_modules/zod/dist/esm/v3/errors.js","../../node_modules/zod/dist/esm/v3/helpers/parseUtil.js","../../node_modules/zod/dist/esm/v3/helpers/errorUtil.js","../../node_modules/zod/dist/esm/v3/types.js","../../src/internal/schemas/notificare-notification/base.ts","../../src/internal/schemas/notificare-notification/variants/none.ts","../../src/internal/schemas/notificare-notification/variants/url-resolver.ts","../../src/internal/schemas/notificare-notification/variants/alert.ts","../../src/internal/schemas/notificare-notification/variants/image.ts","../../src/internal/schemas/notificare-notification/variants/in-app-browser.ts","../../src/internal/schemas/notificare-notification/variants/map.ts","../../src/internal/schemas/notificare-notification/variants/passbook.ts","../../src/internal/schemas/notificare-notification/variants/rate.ts","../../src/internal/schemas/notificare-notification/variants/store.ts","../../src/internal/schemas/notificare-notification/index.ts","../../src/internal/schemas/notificare-notification/variants/url.ts","../../src/internal/schemas/notificare-notification/variants/url-scheme.ts","../../src/internal/schemas/notificare-notification/variants/video.ts","../../src/internal/schemas/notificare-notification/variants/web-view.ts","../../src/internal/components/push/validation-error/NotificationValidationError.tsx","../../src/internal/components/in-app-messaging/message-types/banner-message/BannerMessage.tsx","../../src/internal/components/in-app-messaging/message-types/card-message/CardMessage.tsx","../../src/internal/components/in-app-messaging/message-types/fullscreen-message/FullscreenMessage.tsx","../../src/internal/components/in-app-messaging/preview/InAppMessagePreview.tsx","../../src/internal/schemas/in-app-message/variants/banner.ts","../../src/internal/schemas/in-app-message/index.ts","../../src/internal/schemas/in-app-message/variants/card.ts","../../src/internal/schemas/in-app-message/variants/fullscreen.ts","../../src/internal/components/in-app-messaging/validation-error/InAppMessageValidationError.tsx","../../src/components/NotificareInAppMessagePreview/NotificareInAppMessagePreview.tsx","../../src/components/NotificareNotificationPreview/NotificareNotificationPreview.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","//\n// Main\n//\nexport function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nvar ObjectWithoutPrototypeCache = /** @class */ (function () {\n function ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n }\n ObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n };\n ObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n };\n return ObjectWithoutPrototypeCache;\n}());\nvar cacheDefault = {\n create: function create() {\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo</123>`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: milliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n case 'rounding-mode-floor':\n result.roundingMode = 'floor';\n continue;\n case 'rounding-mode-ceiling':\n result.roundingMode = 'ceil';\n continue;\n case 'rounding-mode-down':\n result.roundingMode = 'trunc';\n continue;\n case 'rounding-mode-up':\n result.roundingMode = 'expand';\n continue;\n case 'rounding-mode-half-even':\n result.roundingMode = 'halfEven';\n continue;\n case 'rounding-mode-half-down':\n result.roundingMode = 'halfTrunc';\n continue;\n case 'rounding-mode-half-up':\n result.roundingMode = 'halfExpand';\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"419\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"AX\": [\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BI\": [\n \"H\",\n \"h\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"BO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BY\": [\n \"H\",\n \"h\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CL\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"CW\": [\n \"H\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EC\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FO\": [\n \"H\",\n \"h\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GL\": [\n \"H\",\n \"h\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GT\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HN\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"HU\": [\n \"H\",\n \"h\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JP\": [\n \"H\",\n \"K\",\n \"h\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MG\": [\n \"H\",\n \"h\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MT\": [\n \"H\",\n \"h\"\n ],\n \"MU\": [\n \"H\",\n \"h\"\n ],\n \"MV\": [\n \"H\",\n \"h\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MX\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NI\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"NO\": [\n \"H\",\n \"h\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PL\": [\n \"H\",\n \"h\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"PY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"RW\": [\n \"H\",\n \"h\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"SV\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TH\": [\n \"H\",\n \"h\"\n ],\n \"TJ\": [\n \"H\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TM\": [\n \"H\",\n \"h\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VN\": [\n \"H\",\n \"h\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZW\": [\n \"H\",\n \"h\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-HK\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-IL\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"en-MY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ]\n};\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith && '_a'.startsWith('a', 1);\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"</\" tagName (whitespace)* \">\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('</')) {\n if (this.isEOF() || !_isAlpha(this.char())) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n var closingTagNameStartPosition = this.clonePosition();\n var closingTagName = this.parseTagName();\n if (tagName !== closingTagName) {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (!this.bumpIf('>')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","import { __extends } from \"tslib\";\nexport var ErrorCode;\n(function (ErrorCode) {\n // When we have a placeholder but no value to format\n ErrorCode[\"MISSING_VALUE\"] = \"MISSING_VALUE\";\n // When value supplied is invalid\n ErrorCode[\"INVALID_VALUE\"] = \"INVALID_VALUE\";\n // When we need specific Intl API but it's not available\n ErrorCode[\"MISSING_INTL_API\"] = \"MISSING_INTL_API\";\n})(ErrorCode || (ErrorCode = {}));\nvar FormatError = /** @class */ (function (_super) {\n __extends(FormatError, _super);\n function FormatError(msg, code, originalMessage) {\n var _this = _super.call(this, msg) || this;\n _this.code = code;\n _this.originalMessage = originalMessage;\n return _this;\n }\n FormatError.prototype.toString = function () {\n return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n };\n return FormatError;\n}(Error));\nexport { FormatError };\nvar InvalidValueError = /** @class */ (function (_super) {\n __extends(InvalidValueError, _super);\n function InvalidValueError(variableId, value, options, originalMessage) {\n return _super.call(this, \"Invalid values for \\\"\".concat(variableId, \"\\\": \\\"\").concat(value, \"\\\". Options are \\\"\").concat(Object.keys(options).join('\", \"'), \"\\\"\"), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueError;\n}(FormatError));\nexport { InvalidValueError };\nvar InvalidValueTypeError = /** @class */ (function (_super) {\n __extends(InvalidValueTypeError, _super);\n function InvalidValueTypeError(value, type, originalMessage) {\n return _super.call(this, \"Value for \\\"\".concat(value, \"\\\" must be of type \").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueTypeError;\n}(FormatError));\nexport { InvalidValueTypeError };\nvar MissingValueError = /** @class */ (function (_super) {\n __extends(MissingValueError, _super);\n function MissingValueError(variableId, originalMessage) {\n return _super.call(this, \"The intl string context variable \\\"\".concat(variableId, \"\\\" was not provided to the string \\\"\").concat(originalMessage, \"\\\"\"), ErrorCode.MISSING_VALUE, originalMessage) || this;\n }\n return MissingValueError;\n}(FormatError));\nexport { MissingValueError };\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n// only for testing\nexport var _Parser = Parser;\nexport { isStructurallySame } from './manipulator';\n","import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTagElement, isTimeElement, } from '@formatjs/icu-messageformat-parser';\nimport { ErrorCode, FormatError, InvalidValueError, InvalidValueTypeError, MissingValueError, } from './error';\nexport var PART_TYPE;\n(function (PART_TYPE) {\n PART_TYPE[PART_TYPE[\"literal\"] = 0] = \"literal\";\n PART_TYPE[PART_TYPE[\"object\"] = 1] = \"object\";\n})(PART_TYPE || (PART_TYPE = {}));\nfunction mergeLiteral(parts) {\n if (parts.length < 2) {\n return parts;\n }\n return parts.reduce(function (all, part) {\n var lastPart = all[all.length - 1];\n if (!lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal) {\n all.push(part);\n }\n else {\n lastPart.value += part.value;\n }\n return all;\n }, []);\n}\nexport function isFormatXMLElementFn(el) {\n return typeof el === 'function';\n}\n// TODO(skeleton): add skeleton support\nexport function formatToParts(els, locales, formatters, formats, values, currentPluralValue, \n// For debugging\noriginalMessage) {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ];\n }\n var result = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n });\n continue;\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n });\n }\n continue;\n }\n var varName = el.value;\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage);\n }\n var value = values[varName];\n if (isArgumentElement(el)) {\n if (!value || typeof value === 'string' || typeof value === 'number') {\n value =\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '';\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: value,\n });\n continue;\n }\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTimeElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isNumberElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n if (style && style.scale) {\n value =\n value *\n (style.scale || 1);\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTagElement(el)) {\n var children = el.children, value_1 = el.value;\n var formatFn = values[value_1];\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value_1, 'function', originalMessage);\n }\n var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);\n var chunks = formatFn(parts.map(function (p) { return p.value; }));\n if (!Array.isArray(chunks)) {\n chunks = [chunks];\n }\n result.push.apply(result, chunks.map(function (c) {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n };\n }));\n }\n if (isSelectElement(el)) {\n var opt = el.options[value] || el.options.other;\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));\n continue;\n }\n if (isPluralElement(el)) {\n var opt = el.options[\"=\".concat(value)];\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API, originalMessage);\n }\n var rule = formatters\n .getPluralRules(locales, { type: el.pluralType })\n .select(value - (el.offset || 0));\n opt = el.options[rule] || el.options.other;\n }\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));\n continue;\n }\n }\n return mergeLiteral(result);\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { __assign, __rest, __spreadArray } from \"tslib\";\nimport { memoize, strategies } from '@formatjs/fast-memoize';\nimport { parse, } from '@formatjs/icu-messageformat-parser';\nimport { formatToParts, PART_TYPE, } from './formatters';\n// -- MessageFormat --------------------------------------------------------\nfunction mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n}\nfunction mergeConfigs(defaultConfig, configs) {\n if (!configs) {\n return defaultConfig;\n }\n return Object.keys(defaultConfig).reduce(function (all, k) {\n all[k] = mergeConfig(defaultConfig[k], configs[k]);\n return all;\n }, __assign({}, defaultConfig));\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\nfunction createDefaultFormatters(cache) {\n if (cache === void 0) { cache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }; }\n return {\n getNumberFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n };\n}\nvar IntlMessageFormat = /** @class */ (function () {\n function IntlMessageFormat(message, locales, overrideFormats, opts) {\n if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }\n var _this = this;\n this.formatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n };\n this.format = function (values) {\n var parts = _this.formatToParts(values);\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value;\n }\n var result = parts.reduce(function (all, part) {\n if (!all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string') {\n all.push(part.value);\n }\n else {\n all[all.length - 1] += part.value;\n }\n return all;\n }, []);\n if (result.length <= 1) {\n return result[0] || '';\n }\n return result;\n };\n this.formatToParts = function (values) {\n return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);\n };\n this.resolvedOptions = function () {\n var _a;\n return ({\n locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) ||\n Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],\n });\n };\n this.getAst = function () { return _this.ast; };\n // Defined first because it's used to build the format pattern.\n this.locales = locales;\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);\n if (typeof message === 'string') {\n this.message = message;\n if (!IntlMessageFormat.__parse) {\n throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');\n }\n var _a = opts || {}, formatters = _a.formatters, parseOpts = __rest(_a, [\"formatters\"]);\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, __assign(__assign({}, parseOpts), { locale: this.resolvedLocale }));\n }\n else {\n this.ast = message;\n }\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.');\n }\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);\n }\n Object.defineProperty(IntlMessageFormat, \"defaultLocale\", {\n get: function () {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale;\n }\n return IntlMessageFormat.memoizedDefaultLocale;\n },\n enumerable: false,\n configurable: true\n });\n IntlMessageFormat.memoizedDefaultLocale = null;\n IntlMessageFormat.resolveLocale = function (locales) {\n if (typeof Intl.Locale === 'undefined') {\n return;\n }\n var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0]);\n }\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]);\n };\n IntlMessageFormat.__parse = parse;\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n IntlMessageFormat.formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n percent: {\n style: 'percent',\n },\n },\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n };\n return IntlMessageFormat;\n}());\nexport { IntlMessageFormat };\n","import { __extends } from \"tslib\";\nexport var IntlErrorCode;\n(function (IntlErrorCode) {\n IntlErrorCode[\"FORMAT_ERROR\"] = \"FORMAT_ERROR\";\n IntlErrorCode[\"UNSUPPORTED_FORMATTER\"] = \"UNSUPPORTED_FORMATTER\";\n IntlErrorCode[\"INVALID_CONFIG\"] = \"INVALID_CONFIG\";\n IntlErrorCode[\"MISSING_DATA\"] = \"MISSING_DATA\";\n IntlErrorCode[\"MISSING_TRANSLATION\"] = \"MISSING_TRANSLATION\";\n})(IntlErrorCode || (IntlErrorCode = {}));\nvar IntlError = /** @class */ (function (_super) {\n __extends(IntlError, _super);\n function IntlError(code, message, exception) {\n var _this = this;\n var err = exception\n ? exception instanceof Error\n ? exception\n : new Error(String(exception))\n : undefined;\n _this = _super.call(this, \"[@formatjs/intl Error \".concat(code, \"] \").concat(message, \"\\n\").concat(err ? \"\\n\".concat(err.message, \"\\n\").concat(err.stack) : '')) || this;\n _this.code = code;\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (typeof Error.captureStackTrace === 'function') {\n // @ts-ignore just so we don't need to declare dep on @types/node\n Error.captureStackTrace(_this, IntlError);\n }\n return _this;\n }\n return IntlError;\n}(Error));\nexport { IntlError };\nvar UnsupportedFormatterError = /** @class */ (function (_super) {\n __extends(UnsupportedFormatterError, _super);\n function UnsupportedFormatterError(message, exception) {\n return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this;\n }\n return UnsupportedFormatterError;\n}(IntlError));\nexport { UnsupportedFormatterError };\nvar InvalidConfigError = /** @class */ (function (_super) {\n __extends(InvalidConfigError, _super);\n function InvalidConfigError(message, exception) {\n return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this;\n }\n return InvalidConfigError;\n}(IntlError));\nexport { InvalidConfigError };\nvar MissingDataError = /** @class */ (function (_super) {\n __extends(MissingDataError, _super);\n function MissingDataError(message, exception) {\n return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this;\n }\n return MissingDataError;\n}(IntlError));\nexport { MissingDataError };\nvar IntlFormatError = /** @class */ (function (_super) {\n __extends(IntlFormatError, _super);\n function IntlFormatError(message, locale, exception) {\n var _this = _super.call(this, IntlErrorCode.FORMAT_ERROR, \"\".concat(message, \"\\nLocale: \").concat(locale, \"\\n\"), exception) || this;\n _this.locale = locale;\n return _this;\n }\n return IntlFormatError;\n}(IntlError));\nexport { IntlFormatError };\nvar MessageFormatError = /** @class */ (function (_super) {\n __extends(MessageFormatError, _super);\n function MessageFormatError(message, locale, descriptor, exception) {\n var _this = _super.call(this, \"\".concat(message, \"\\nMessageID: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, \"\\nDefault Message: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, \"\\nDescription: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, \"\\n\"), locale, exception) || this;\n _this.descriptor = descriptor;\n _this.locale = locale;\n return _this;\n }\n return MessageFormatError;\n}(IntlFormatError));\nexport { MessageFormatError };\nvar MissingTranslationError = /** @class */ (function (_super) {\n __extends(MissingTranslationError, _super);\n function MissingTranslationError(descriptor, locale) {\n var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, \"Missing message: \\\"\".concat(descriptor.id, \"\\\" for locale \\\"\").concat(locale, \"\\\", using \").concat(descriptor.defaultMessage\n ? \"default message (\".concat(typeof descriptor.defaultMessage === 'string'\n ? descriptor.defaultMessage\n : descriptor.defaultMessage\n .map(function (e) { var _a; return (_a = e.value) !== null && _a !== void 0 ? _a : JSON.stringify(e); })\n .join(), \")\")\n : 'id', \" as fallback.\")) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MissingTranslationError;\n}(IntlError));\nexport { MissingTranslationError };\n","import { __assign, __spreadArray } from \"tslib\";\nimport { memoize, strategies } from '@formatjs/fast-memoize';\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport { UnsupportedFormatterError } from './error';\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\nexport function filterProps(props, allowlist, defaults) {\n if (defaults === void 0) { defaults = {}; }\n return allowlist.reduce(function (filtered, name) {\n if (name in props) {\n filtered[name] = props[name];\n }\n else if (name in defaults) {\n filtered[name] = defaults[name];\n }\n return filtered;\n }, {});\n}\nvar defaultErrorHandler = function (error) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.error(error);\n }\n};\nvar defaultWarnHandler = function (warning) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n};\nexport var DEFAULT_INTL_CONFIG = {\n formats: {},\n messages: {},\n timeZone: undefined,\n defaultLocale: 'en',\n defaultFormats: {},\n fallbackOnEmptyString: true,\n onError: defaultErrorHandler,\n onWarn: defaultWarnHandler,\n};\nexport function createIntlCache() {\n return {\n dateTime: {},\n number: {},\n message: {},\n relativeTime: {},\n pluralRules: {},\n list: {},\n displayNames: {},\n };\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\n/**\n * Create intl formatters and populate cache\n * @param cache explicit cache to prevent leaking memory\n */\nexport function createFormatters(cache) {\n if (cache === void 0) { cache = createIntlCache(); }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n var ListFormat = Intl.ListFormat;\n var DisplayNames = Intl.DisplayNames;\n var getDateTimeFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n });\n var getNumberFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n });\n var getPluralRules = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n });\n return {\n getDateTimeFormat: getDateTimeFormat,\n getNumberFormat: getNumberFormat,\n getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {\n return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {\n getNumberFormat: getNumberFormat,\n getDateTimeFormat: getDateTimeFormat,\n getPluralRules: getPluralRules,\n } }, (opts || {})));\n }, {\n cache: createFastMemoizeCache(cache.message),\n strategy: strategies.variadic,\n }),\n getRelativeTimeFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.relativeTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: getPluralRules,\n getListFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.list),\n strategy: strategies.variadic,\n }),\n getDisplayNames: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.displayNames),\n strategy: strategies.variadic,\n }),\n };\n}\nexport function getNamedFormat(formats, type, name, onError) {\n var formatType = formats && formats[type];\n var format;\n if (formatType) {\n format = formatType[name];\n }\n if (format) {\n return format;\n }\n onError(new UnsupportedFormatterError(\"No \".concat(type, \" format named: \").concat(name)));\n}\n","import { __assign } from \"tslib\";\nimport { TYPE } from '@formatjs/icu-messageformat-parser';\nimport { IntlMessageFormat, } from 'intl-messageformat';\nimport { MessageFormatError, MissingTranslationError } from './error';\nimport { invariant } from './utils';\nfunction setTimeZoneInOptions(opts, timeZone) {\n return Object.keys(opts).reduce(function (all, k) {\n all[k] = __assign({ timeZone: timeZone }, opts[k]);\n return all;\n }, {});\n}\nfunction deepMergeOptions(opts1, opts2) {\n var keys = Object.keys(__assign(__assign({}, opts1), opts2));\n return keys.reduce(function (all, k) {\n all[k] = __assign(__assign({}, (opts1[k] || {})), (opts2[k] || {}));\n return all;\n }, {});\n}\nfunction deepMergeFormatsAndSetTimeZone(f1, timeZone) {\n if (!timeZone) {\n return f1;\n }\n var mfFormats = IntlMessageFormat.formats;\n return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });\n}\nexport var formatMessage = function (_a, state, messageDescriptor, values, opts) {\n var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, fallbackOnEmptyString = _a.fallbackOnEmptyString, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;\n if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }\n var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;\n // `id` is a required field of a Message Descriptor.\n invariant(!!msgId, \"[@formatjs/intl] An `id` must be provided to format a message. You can either:\\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.github.io/docs/tooling/babel-plugin)\\nor [@formatjs/ts-transformer](https://formatjs.github.io/docs/tooling/ts-transformer) OR\\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.github.io/docs/tooling/linter#enforce-id)\\nto autofix this issue\");\n var id = String(msgId);\n var message = \n // In case messages is Object.create(null)\n // e.g import('foo.json') from webpack)\n // See https://github.com/formatjs/formatjs/issues/1914\n messages &&\n Object.prototype.hasOwnProperty.call(messages, id) &&\n messages[id];\n // IMPORTANT: Hot path if `message` is AST with a single literal node\n if (Array.isArray(message) &&\n message.length === 1 &&\n message[0].type === TYPE.literal) {\n return message[0].value;\n }\n // IMPORTANT: Hot path straight lookup for performance\n if (!values &&\n message &&\n typeof message === 'string' &&\n !defaultRichTextElements) {\n return message.replace(/'\\{(.*?)\\}'/gi, \"{$1}\");\n }\n values = __assign(__assign({}, defaultRichTextElements), (values || {}));\n formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);\n defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);\n if (!message) {\n if (fallbackOnEmptyString === false && message === '') {\n return message;\n }\n if (!defaultMessage ||\n (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {\n // This prevents warnings from littering the console in development\n // when no `messages` are passed into the <IntlProvider> for the\n // default locale.\n onError(new MissingTranslationError(messageDescriptor, locale));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting default message for: \\\"\".concat(id, \"\\\", rendering default message verbatim\"), locale, messageDescriptor, e));\n return typeof defaultMessage === 'string' ? defaultMessage : id;\n }\n }\n return id;\n }\n // We have the translated message\n try {\n var formatter = state.getMessageFormat(message, locale, formats, __assign({ formatters: state }, (opts || {})));\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting message: \\\"\".concat(id, \"\\\", using \").concat(defaultMessage ? 'default message' : 'id', \" as fallback.\"), locale, messageDescriptor, e));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting the default message for: \\\"\".concat(id, \"\\\", rendering message verbatim\"), locale, messageDescriptor, e));\n }\n }\n if (typeof message === 'string') {\n return message;\n }\n if (typeof defaultMessage === 'string') {\n return defaultMessage;\n }\n return id;\n};\n","import { __assign } from \"tslib\";\nimport { IntlFormatError } from './error';\nimport { filterProps, getNamedFormat } from './utils';\nvar DATE_TIME_FORMAT_OPTIONS = [\n 'formatMatcher',\n 'timeZone',\n 'hour12',\n 'weekday',\n 'era',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'timeZoneName',\n 'hourCycle',\n 'dateStyle',\n 'timeStyle',\n 'calendar',\n // 'dayPeriod',\n 'numberingSystem',\n 'fractionalSecondDigits',\n];\nexport function getFormatter(_a, type, getDateTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError, timeZone = _a.timeZone;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);\n if (type === 'time' &&\n !filteredOptions.hour &&\n !filteredOptions.minute &&\n !filteredOptions.second &&\n !filteredOptions.timeStyle &&\n !filteredOptions.dateStyle) {\n // Add default formatting options if hour, minute, or second isn't defined.\n filteredOptions = __assign(__assign({}, filteredOptions), { hour: 'numeric', minute: 'numeric' });\n }\n return getDateTimeFormat(locale, filteredOptions);\n}\nexport function formatDate(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting date.', config.locale, e));\n }\n return String(date);\n}\nexport function formatTime(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting time.', config.locale, e));\n }\n return String(date);\n}\nexport function formatDateTimeRange(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var from = _a[0], to = _a[1], _b = _a[2], options = _b === void 0 ? {} : _b;\n var fromDate = typeof from === 'string' ? new Date(from || 0) : from;\n var toDate = typeof to === 'string' ? new Date(to || 0) : to;\n try {\n return getFormatter(config, 'dateTimeRange', getDateTimeFormat, options).formatRange(fromDate, toDate);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting date time range.', config.locale, e));\n }\n return String(fromDate);\n}\nexport function formatDateToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting date.', config.locale, e));\n }\n return [];\n}\nexport function formatTimeToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting time.', config.locale, e));\n }\n return [];\n}\n","import { filterProps } from './utils';\nimport { ErrorCode, FormatError } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar DISPLAY_NAMES_OPTONS = [\n 'style',\n 'type',\n 'fallback',\n 'languageDisplay',\n];\nexport function formatDisplayName(_a, getDisplayNames, value, options) {\n var locale = _a.locale, onError = _a.onError;\n var DisplayNames = Intl.DisplayNames;\n if (!DisplayNames) {\n onError(new FormatError(\"Intl.DisplayNames is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-displaynames\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, DISPLAY_NAMES_OPTONS);\n try {\n return getDisplayNames(locale, filteredOptions).of(value);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting display name.', locale, e));\n }\n}\n","import { __assign } from \"tslib\";\nimport { ErrorCode, FormatError } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nimport { filterProps } from './utils';\nvar LIST_FORMAT_OPTIONS = [\n 'type',\n 'style',\n];\nvar now = Date.now();\nfunction generateToken(i) {\n return \"\".concat(now, \"_\").concat(i, \"_\").concat(now);\n}\nexport function formatList(opts, getListFormat, values, options) {\n if (options === void 0) { options = {}; }\n var results = formatListToParts(opts, getListFormat, values, options).reduce(function (all, el) {\n var val = el.value;\n if (typeof val !== 'string') {\n all.push(val);\n }\n else if (typeof all[all.length - 1] === 'string') {\n all[all.length - 1] += val;\n }\n else {\n all.push(val);\n }\n return all;\n }, []);\n return results.length === 1 ? results[0] : results.length === 0 ? '' : results;\n}\nexport function formatListToParts(_a, getListFormat, values, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var ListFormat = Intl.ListFormat;\n if (!ListFormat) {\n onError(new FormatError(\"Intl.ListFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-listformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, LIST_FORMAT_OPTIONS);\n try {\n var richValues_1 = {};\n var serializedValues = values.map(function (v, i) {\n if (typeof v === 'object') {\n var id = generateToken(i);\n richValues_1[id] = v;\n return id;\n }\n return String(v);\n });\n return getListFormat(locale, filteredOptions)\n .formatToParts(serializedValues)\n .map(function (part) {\n return (part.type === 'literal'\n ? part\n : __assign(__assign({}, part), { value: richValues_1[part.value] || part.value }));\n });\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting list.', locale, e));\n }\n // @ts-ignore\n return values;\n}\n","import { ErrorCode, FormatError } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nimport { filterProps } from './utils';\nvar PLURAL_FORMAT_OPTIONS = ['type'];\nexport function formatPlural(_a, getPluralRules, value, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n if (!Intl.PluralRules) {\n onError(new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);\n try {\n return getPluralRules(locale, filteredOptions).select(value);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting plural.', locale, e));\n }\n return 'other';\n}\n","import { getNamedFormat, filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar RELATIVE_TIME_FORMAT_OPTIONS = ['numeric', 'style'];\nfunction getFormatter(_a, getRelativeTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = (!!format && getNamedFormat(formats, 'relative', format, onError)) || {};\n var filteredOptions = filterProps(options, RELATIVE_TIME_FORMAT_OPTIONS, defaults);\n return getRelativeTimeFormat(locale, filteredOptions);\n}\nexport function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options) {\n if (options === void 0) { options = {}; }\n if (!unit) {\n unit = 'second';\n }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n if (!RelativeTimeFormat) {\n config.onError(new FormatError(\"Intl.RelativeTimeFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-relativetimeformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n try {\n return getFormatter(config, getRelativeTimeFormat, options).format(value, unit);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));\n }\n return String(value);\n}\n","import { IntlFormatError } from './error';\nimport { filterProps, getNamedFormat } from './utils';\nvar NUMBER_FORMAT_OPTIONS = [\n 'style',\n 'currency',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits',\n // ES2020 NumberFormat\n 'compactDisplay',\n 'currencyDisplay',\n 'currencySign',\n 'notation',\n 'signDisplay',\n 'unit',\n 'unitDisplay',\n 'numberingSystem',\n // ES2023 NumberFormat\n 'trailingZeroDisplay',\n 'roundingPriority',\n 'roundingIncrement',\n 'roundingMode',\n];\nexport function getFormatter(_a, getNumberFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = ((format &&\n getNamedFormat(formats, 'number', format, onError)) ||\n {});\n var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults);\n return getNumberFormat(locale, filteredOptions);\n}\nexport function formatNumber(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).format(value);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting number.', config.locale, e));\n }\n return String(value);\n}\nexport function formatNumberToParts(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).formatToParts(value);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting number.', config.locale, e));\n }\n return [];\n}\n","import { __assign } from \"tslib\";\nimport { formatDate, formatDateTimeRange, formatDateToParts, formatTime, formatTimeToParts, } from './dateTime';\nimport { formatDisplayName } from './displayName';\nimport { InvalidConfigError, MissingDataError } from './error';\nimport { formatList, formatListToParts } from './list';\nimport { formatMessage } from './message';\nimport { formatNumber, formatNumberToParts } from './number';\nimport { formatPlural } from './plural';\nimport { formatRelativeTime } from './relativeTime';\nimport { createFormatters, DEFAULT_INTL_CONFIG } from './utils';\nfunction messagesContainString(messages) {\n var firstMessage = messages ? messages[Object.keys(messages)[0]] : undefined;\n return typeof firstMessage === 'string';\n}\nfunction verifyConfigMessages(config) {\n if (config.onWarn &&\n config.defaultRichTextElements &&\n messagesContainString(config.messages || {})) {\n config.onWarn(\"[@formatjs/intl] \\\"defaultRichTextElements\\\" was specified but \\\"message\\\" was not pre-compiled. \\nPlease consider using \\\"@formatjs/cli\\\" to pre-compile your messages for performance.\\nFor more details see https://formatjs.github.io/docs/getting-started/message-distribution\");\n }\n}\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport function createIntl(config, cache) {\n var formatters = createFormatters(cache);\n var resolvedConfig = __assign(__assign({}, DEFAULT_INTL_CONFIG), config);\n var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;\n if (!locale) {\n if (onError) {\n onError(new InvalidConfigError(\"\\\"locale\\\" was not configured, using \\\"\".concat(defaultLocale, \"\\\" as fallback. See https://formatjs.github.io/docs/react-intl/api#intlshape for more details\")));\n }\n // Since there's no registered locale data for `locale`, this will\n // fallback to the `defaultLocale` to make sure things can render.\n // The `messages` are overridden to the `defaultProps` empty object\n // to maintain referential equality across re-renders. It's assumed\n // each <FormattedMessage> contains a `defaultMessage` prop.\n resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';\n }\n else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.NumberFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.github.io/docs/react-intl#runtime-requirements for more details\")));\n }\n else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&\n onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.DateTimeFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.github.io/docs/react-intl#runtime-requirements for more details\")));\n }\n verifyConfigMessages(resolvedConfig);\n return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), $t: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });\n}\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { DEFAULT_INTL_CONFIG as CORE_DEFAULT_INTL_CONFIG } from '@formatjs/intl';\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\nexport function invariantIntlContext(intl) {\n invariant(intl, '[React Intl] Could not find required `intl` object. ' +\n '<IntlProvider> needs to exist in the component ancestry.');\n}\nexport var DEFAULT_INTL_CONFIG = __assign(__assign({}, CORE_DEFAULT_INTL_CONFIG), { textComponent: React.Fragment });\nvar arbitraryKeyProps = { key: 42 };\nvar toArbitrarilyKeyedReactNode = function (reactNode) {\n return React.isValidElement(reactNode)\n ? React.createElement(React.Fragment, arbitraryKeyProps, reactNode)\n : reactNode;\n};\n/**\n * Builds an array of {@link React.ReactNode}s with index-based keys, similar to\n * {@link React.Children.toArray}. However, this function tells React that it\n * was intentional, so they won't produce a bunch of warnings about it.\n *\n * React doesn't recommend doing this because it makes reordering inefficient,\n * but we mostly need this for message chunks, which don't tend to reorder to\n * begin with.\n */\nexport var toKeyedReactNodeArray = function (children) { var _a; \n/**\n * Note: {@link React.Children.map} will add its own index-based prefix to\n * every key anyway, so the auto-injected one doesn't even have to be unique.\n * This basically just tells React that it's explicit/intentional.\n */\nreturn (_a = React.Children.map(children, toArbitrarilyKeyedReactNode)) !== null && _a !== void 0 ? _a : []; };\n/**\n * Takes a `formatXMLElementFn`, and composes it in function, which passes\n * argument `parts` through, assigning unique key to each part, to prevent\n * \"Each child in a list should have a unique \"key\"\" React error.\n * @param formatXMLElementFn\n */\nexport function assignUniqueKeysToParts(formatXMLElementFn) {\n return function (parts) {\n // eslint-disable-next-line prefer-rest-params\n return formatXMLElementFn(React.Children.toArray(parts));\n };\n}\nexport function shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n if (!objA || !objB) {\n return false;\n }\n var aKeys = Object.keys(objA);\n var bKeys = Object.keys(objB);\n var len = aKeys.length;\n if (bKeys.length !== len) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n var key = aKeys[i];\n if (objA[key] !== objB[key] ||\n !Object.prototype.hasOwnProperty.call(objB, key)) {\n return false;\n }\n }\n return true;\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n 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.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","import { __assign } from \"tslib\";\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { invariantIntlContext } from '../utils';\nfunction getDisplayName(Component) {\n return Component.displayName || Component.name || 'Component';\n}\n// This is primarily dealing with packaging systems where multiple copies of react-intl\n// might exist\nvar IntlContext = typeof window !== 'undefined' && !window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__\n ? window.__REACT_INTL_CONTEXT__ ||\n (window.__REACT_INTL_CONTEXT__ = React.createContext(null))\n : React.createContext(null);\nvar IntlConsumer = IntlContext.Consumer, IntlProvider = IntlContext.Provider;\nexport var Provider = IntlProvider;\nexport var Context = IntlContext;\nexport default function injectIntl(WrappedComponent, options) {\n var _a = options || {}, _b = _a.intlPropName, intlPropName = _b === void 0 ? 'intl' : _b, _c = _a.forwardRef, forwardRef = _c === void 0 ? false : _c, _d = _a.enforceContext, enforceContext = _d === void 0 ? true : _d;\n var WithIntl = function (props) { return (React.createElement(IntlConsumer, null, function (intl) {\n var _a;\n if (enforceContext) {\n invariantIntlContext(intl);\n }\n var intlProp = (_a = {}, _a[intlPropName] = intl, _a);\n return (React.createElement(WrappedComponent, __assign({}, props, intlProp, { ref: forwardRef ? props.forwardedRef : null })));\n })); };\n WithIntl.displayName = \"injectIntl(\".concat(getDisplayName(WrappedComponent), \")\");\n WithIntl.WrappedComponent = WrappedComponent;\n if (forwardRef) {\n return hoistNonReactStatics(\n // @ts-expect-error\n React.forwardRef(function (props, ref) { return (React.createElement(WithIntl, __assign({}, props, { forwardedRef: ref }))); }), WrappedComponent);\n }\n return hoistNonReactStatics(WithIntl, WrappedComponent);\n}\n","import { __rest } from \"tslib\";\nimport * as React from 'react';\nimport useIntl from './useIntl';\nvar DisplayName;\n(function (DisplayName) {\n DisplayName[\"formatDate\"] = \"FormattedDate\";\n DisplayName[\"formatTime\"] = \"FormattedTime\";\n DisplayName[\"formatNumber\"] = \"FormattedNumber\";\n DisplayName[\"formatList\"] = \"FormattedList\";\n // Note that this DisplayName is the locale display name, not to be confused with\n // the name of the enum, which is for React component display name in dev tools.\n DisplayName[\"formatDisplayName\"] = \"FormattedDisplayName\";\n})(DisplayName || (DisplayName = {}));\nvar DisplayNameParts;\n(function (DisplayNameParts) {\n DisplayNameParts[\"formatDate\"] = \"FormattedDateParts\";\n DisplayNameParts[\"formatTime\"] = \"FormattedTimeParts\";\n DisplayNameParts[\"formatNumber\"] = \"FormattedNumberParts\";\n DisplayNameParts[\"formatList\"] = \"FormattedListParts\";\n})(DisplayNameParts || (DisplayNameParts = {}));\nexport var FormattedNumberParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n return children(intl.formatNumberToParts(value, formatProps));\n};\nFormattedNumberParts.displayName = 'FormattedNumberParts';\nexport var FormattedListParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n return children(intl.formatListToParts(value, formatProps));\n};\nFormattedNumberParts.displayName = 'FormattedNumberParts';\nexport function createFormattedDateTimePartsComponent(name) {\n var ComponentParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n var formattedParts = name === 'formatDate'\n ? intl.formatDateToParts(date, formatProps)\n : intl.formatTimeToParts(date, formatProps);\n return children(formattedParts);\n };\n ComponentParts.displayName = DisplayNameParts[name];\n return ComponentParts;\n}\nexport function createFormattedComponent(name) {\n var Component = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props\n // TODO: fix TS type definition for localeMatcher upstream\n , [\"value\", \"children\"]);\n // TODO: fix TS type definition for localeMatcher upstream\n var formattedValue = intl[name](value, formatProps);\n if (typeof children === 'function') {\n return children(formattedValue);\n }\n var Text = intl.textComponent || React.Fragment;\n return React.createElement(Text, null, formattedValue);\n };\n Component.displayName = DisplayName[name];\n return Component;\n}\n","import * as React from 'react';\nimport { invariantIntlContext } from '../utils';\nimport { Context } from './injectIntl';\nexport default function useIntl() {\n var intl = React.useContext(Context);\n invariantIntlContext(intl);\n return intl;\n}\n","/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\nimport { __assign, __rest, __spreadArray } from \"tslib\";\nimport { createIntl as coreCreateIntl, formatMessage as coreFormatMessage, } from '@formatjs/intl';\nimport { isFormatXMLElementFn, } from 'intl-messageformat';\nimport { DEFAULT_INTL_CONFIG, assignUniqueKeysToParts, toKeyedReactNodeArray, } from '../utils';\nfunction assignUniqueKeysToFormatXMLElementFnArgument(values) {\n if (!values) {\n return values;\n }\n return Object.keys(values).reduce(function (acc, k) {\n var v = values[k];\n acc[k] = isFormatXMLElementFn(v)\n ? assignUniqueKeysToParts(v)\n : v;\n return acc;\n }, {});\n}\nvar formatMessage = function (config, formatters, descriptor, rawValues) {\n var rest = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n rest[_i - 4] = arguments[_i];\n }\n var values = assignUniqueKeysToFormatXMLElementFnArgument(rawValues);\n var chunks = coreFormatMessage.apply(void 0, __spreadArray([config,\n formatters,\n descriptor,\n values], rest, false));\n if (Array.isArray(chunks)) {\n return toKeyedReactNodeArray(chunks);\n }\n return chunks;\n};\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport var createIntl = function (_a, cache) {\n var rawDefaultRichTextElements = _a.defaultRichTextElements, config = __rest(_a, [\"defaultRichTextElements\"]);\n var defaultRichTextElements = assignUniqueKeysToFormatXMLElementFnArgument(rawDefaultRichTextElements);\n var coreIntl = coreCreateIntl(__assign(__assign(__assign({}, DEFAULT_INTL_CONFIG), config), { defaultRichTextElements: defaultRichTextElements }), cache);\n var resolvedConfig = {\n locale: coreIntl.locale,\n timeZone: coreIntl.timeZone,\n fallbackOnEmptyString: coreIntl.fallbackOnEmptyString,\n formats: coreIntl.formats,\n defaultLocale: coreIntl.defaultLocale,\n defaultFormats: coreIntl.defaultFormats,\n messages: coreIntl.messages,\n onError: coreIntl.onError,\n defaultRichTextElements: defaultRichTextElements,\n };\n return __assign(__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, resolvedConfig, coreIntl.formatters), $t: formatMessage.bind(null, resolvedConfig, coreIntl.formatters) });\n};\n","/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\nimport { __rest } from \"tslib\";\nimport * as React from 'react';\nimport { shallowEqual } from '../utils';\nimport useIntl from './useIntl';\nfunction areEqual(prevProps, nextProps) {\n var values = prevProps.values, otherProps = __rest(prevProps, [\"values\"]);\n var nextValues = nextProps.values, nextOtherProps = __rest(nextProps, [\"values\"]);\n return (shallowEqual(nextValues, values) &&\n shallowEqual(otherProps, nextOtherProps));\n}\nfunction FormattedMessage(props) {\n var intl = useIntl();\n var formatMessage = intl.formatMessage, _a = intl.textComponent, Text = _a === void 0 ? React.Fragment : _a;\n var id = props.id, description = props.description, defaultMessage = props.defaultMessage, values = props.values, children = props.children, _b = props.tagName, Component = _b === void 0 ? Text : _b, ignoreTag = props.ignoreTag;\n var descriptor = { id: id, description: description, defaultMessage: defaultMessage };\n var nodes = formatMessage(descriptor, values, {\n ignoreTag: ignoreTag,\n });\n if (typeof children === 'function') {\n return children(Array.isArray(nodes) ? nodes : [nodes]);\n }\n if (Component) {\n return React.createElement(Component, null, nodes);\n }\n return React.createElement(React.Fragment, null, nodes);\n}\nFormattedMessage.displayName = 'FormattedMessage';\nvar MemoizedFormattedMessage = React.memo(FormattedMessage, areEqual);\nMemoizedFormattedMessage.displayName = 'MemoizedFormattedMessage';\nexport default MemoizedFormattedMessage;\n","/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\nimport { __extends } from \"tslib\";\nimport { createIntlCache } from '@formatjs/intl';\nimport * as React from 'react';\nimport { DEFAULT_INTL_CONFIG, invariantIntlContext, shallowEqual, } from '../utils';\nimport { createIntl } from './createIntl';\nimport { Provider } from './injectIntl';\nfunction processIntlConfig(config) {\n return {\n locale: config.locale,\n timeZone: config.timeZone,\n fallbackOnEmptyString: config.fallbackOnEmptyString,\n formats: config.formats,\n textComponent: config.textComponent,\n messages: config.messages,\n defaultLocale: config.defaultLocale,\n defaultFormats: config.defaultFormats,\n onError: config.onError,\n onWarn: config.onWarn,\n wrapRichTextChunksInFragment: config.wrapRichTextChunksInFragment,\n defaultRichTextElements: config.defaultRichTextElements,\n };\n}\nvar IntlProvider = /** @class */ (function (_super) {\n __extends(IntlProvider, _super);\n function IntlProvider() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.cache = createIntlCache();\n _this.state = {\n cache: _this.cache,\n intl: createIntl(processIntlConfig(_this.props), _this.cache),\n prevConfig: processIntlConfig(_this.props),\n };\n return _this;\n }\n IntlProvider.getDerivedStateFromProps = function (props, _a) {\n var prevConfig = _a.prevConfig, cache = _a.cache;\n var config = processIntlConfig(props);\n if (!shallowEqual(prevConfig, config)) {\n return {\n intl: createIntl(config, cache),\n prevConfig: config,\n };\n }\n return null;\n };\n IntlProvider.prototype.render = function () {\n invariantIntlContext(this.state.intl);\n return React.createElement(Provider, { value: this.state.intl }, this.props.children);\n };\n IntlProvider.displayName = 'IntlProvider';\n IntlProvider.defaultProps = DEFAULT_INTL_CONFIG;\n return IntlProvider;\n}(React.PureComponent));\nexport default IntlProvider;\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import { createFormattedComponent, createFormattedDateTimePartsComponent, } from './src/components/createFormattedComponent';\nimport { createIntl } from './src/components/createIntl';\nimport FormattedDateTimeRange from './src/components/dateTimeRange';\nimport injectIntl, { Context as IntlContext, Provider as RawIntlProvider, } from './src/components/injectIntl';\nimport FormattedMessage from './src/components/message';\nimport FormattedPlural from './src/components/plural';\nimport IntlProvider from './src/components/provider';\nimport FormattedRelativeTime from './src/components/relative';\nimport useIntl from './src/components/useIntl';\nexport { createIntlCache, InvalidConfigError, MessageFormatError, MissingDataError, MissingTranslationError, IntlError as ReactIntlError, IntlErrorCode as ReactIntlErrorCode, UnsupportedFormatterError, } from '@formatjs/intl';\nexport { createIntl, FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, injectIntl, IntlContext, IntlProvider, RawIntlProvider, useIntl, };\nexport function defineMessages(msgs) {\n return msgs;\n}\nexport function defineMessage(msg) {\n return msg;\n}\n// IMPORTANT: Explicit here to prevent api-extractor from outputing `import('./src/types').CustomFormatConfig`\nexport var FormattedDate = createFormattedComponent('formatDate');\nexport var FormattedTime = createFormattedComponent('formatTime');\nexport var FormattedNumber = createFormattedComponent('formatNumber');\nexport var FormattedList = createFormattedComponent('formatList');\nexport var FormattedDisplayName = createFormattedComponent('formatDisplayName');\nexport var FormattedDateParts = createFormattedDateTimePartsComponent('formatDate');\nexport var FormattedTimeParts = createFormattedDateTimePartsComponent('formatTime');\nexport { FormattedListParts, FormattedNumberParts, } from './src/components/createFormattedComponent';\n","import { ReactNode } from 'react';\n\nimport './AndroidPhoneBackground.css';\n\nexport function AndroidPhoneBackground({ children, theme }: AndroidPhoneBackgroundProps) {\n return (\n <div\n className={`notificare__android-phone-background__wrapper ${theme === 'dark' ? 'notificare__android-phone-background__wrapper--dark' : ''}`}\n data-testid=\"android-phone-background\"\n >\n <div className=\"notificare__android-phone-background__camera\" />\n <div className=\"notificare__android-phone-background__content\">{children}</div>\n </div>\n );\n}\n\nexport interface AndroidPhoneBackgroundProps {\n children: ReactNode;\n theme: 'dark' | 'light';\n}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z\" fill=\"#64706e\"/>\n</svg>","import { ReactNode } from 'react';\n\nimport './IOSPhoneBackground.css';\n\nexport function IOSPhoneBackground({ children, theme }: IosPhoneBackgroundProps) {\n return (\n <div\n className={`notificare__ios-phone-background__wrapper ${theme === 'dark' ? 'notificare__ios-phone-background__wrapper--dark' : ''}`}\n data-testid=\"ios-phone-background\"\n >\n <div className=\"notificare__ios-phone-background__camera\" />\n <div className=\"notificare__ios-phone-background__content\">{children}</div>\n </div>\n );\n}\n\nexport interface IosPhoneBackgroundProps {\n children: ReactNode;\n theme: 'dark' | 'light';\n}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\" />\n</svg>","import LoadingIcon from '~/assets/loading.svg';\n\nimport './Loading.css';\n\nexport function Loading() {\n return (\n <div className=\"notificare__loading__wrapper\" data-testid=\"loading\">\n <LoadingIcon className=\"notificare__loading__icon\" />\n </div>\n );\n}\n","export const PUSH_TRANSLATIONS = {\n 'controls.platform': 'Platform',\n 'controls.formFactor': 'Form Factor',\n 'controls.operatingSystem': 'OS',\n 'controls.operatingSystem.macos': 'macOS',\n 'controls.variant': 'Variant',\n 'controls.displayMode.lockScreen': 'Lock Screen',\n 'controls.displayMode.expandedLockScreen': 'Lock Screen - Expanded',\n 'controls.displayMode.appUi': 'App UI',\n 'preview.error.notGeneratedPreview': 'Preview could not be generated',\n 'preview.error.checkConsole': 'Check console for more information',\n 'preview.error.invalidNotification': '→ Invalid Notification',\n 'preview.error.provideGoogleMapsApiKey': '→ A Google Maps API key should be provided',\n 'preview.error.notSupportedPreviewVariant': '→ Not supported variant',\n 'preview.error.invalidUrl': 'The URL is invalid.',\n 'preview.error.iosStoreAppNotFound':\n 'The app was not found. Check the unique identifier and try again',\n 'preview.error.webshotFail': 'Webshot failed to be loaded. Check console for more details.',\n 'preview.error.notSupportedNotificationTypePreviewVariant':\n \"→ Previewing notifications of type ''{notificationType}'' is not possible in this variant\",\n 'preview.error.notSupportedUrlResolverWithUrlSchemePreview':\n \"→ Previewing notifications of type 're.notifica.notification.URLResolver' with a custom URL Scheme is not possible\",\n 'preview.error.urlResolverInvalidUrl': '→ The provided URL is invalid',\n 'preview.error.urlResolverNoNotificareWebViewQueryParameter':\n \"→ Previewing notifications of type 're.notifica.notification.URLResolver' with an HTTP URL without 'notificareWebView' query parameter is not possible in this variant\",\n 'preview.error.notSupportedUrlResolverWithDynamicLink':\n \"→ Previewing notifications of type 're.notifica.notification.URLResolver' with a dynamic link is not possible\",\n 'preview.error.notSupportedUrlResolverWithRelativeUrl':\n \"→ Previewing notifications of type 're.notifica.notification.URLResolver' with a relative URL (starts with '/') is not possible\",\n 'preview.error.googleMapsAuthFailure':\n 'Authentication failure. Your Google Maps API key might be invalid. Check console for more information.',\n 'preview.error.googleMapsLoadFailure':\n 'Google Maps failed to be loaded. Check console for more information.',\n 'preview.error.noValidContentObject': 'No valid content object was provided',\n 'preview.error.iosStoreAppLoadFailure':\n 'The app failed to be loaded. Check console for more details',\n 'preview.android.alert.appUi.cancel': 'Cancel',\n 'preview.android.inAppBrowser.appUi.pageTitleLoading': 'Loading...',\n 'preview.android.lockscreen.time': 'now',\n 'preview.ios.alert.appUi.cancel': 'Cancel',\n 'preview.ios.alert.appUi.ok': 'OK',\n 'preview.ios.inAppBrowser.appUi.done': 'Done',\n 'preview.ios.inAppBrowser.appUi.notSecure': 'Not Secure —',\n 'preview.ios.rate.appUi.rateNow': \"Yes, I'll Rate Now\",\n 'preview.ios.rate.appUi.doNotRate': 'No, Thanks',\n 'preview.ios.store.appUi.done': 'Done',\n 'preview.ios.store.appUi.install': 'Install',\n 'preview.ios.store.appUi.ratings': '{userRatingCount, number, ::compact-short} Ratings',\n 'preview.ios.store.appUi.age': 'Age',\n 'preview.ios.store.appUi.yearsOld': 'Years Old',\n 'preview.ios.store.appUi.category': 'Category',\n 'preview.ios.store.appUi.developer': 'Developer',\n 'preview.ios.store.appUi.whatsNew': \"What's New\",\n 'preview.ios.store.appUi.historyVersion': 'Version {version}',\n 'preview.ios.store.appUi.screenshots': 'Screenshots',\n 'preview.ios.lockScreen.time': 'Now',\n 'preview.web.desktop.macos.lockScreen.time': 'now',\n 'preview.web.desktop.macos.lockScreen.settings': 'Settings',\n 'preview.web.desktop.macos.lockScreen.options': 'Options',\n};\n\n/**\n * The set of translation keys for push notification previews.\n */\nexport type NotificarePushTranslationKey = keyof typeof PUSH_TRANSLATIONS;\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n>\n <path d=\"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\" />\n</svg>","import { useIntl } from 'react-intl';\nimport AlertIcon from '~/assets/alert.svg';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './PreviewError.css';\n\nexport function PreviewError({ message }: PreviewErrorProps) {\n const intl = useIntl();\n\n return (\n <div className=\"notificare__preview-error__wrapper\" data-testid=\"preview-error\">\n <AlertIcon className=\"notificare__preview-error__icon\" />\n <p className=\"notificare__preview-error__text\">\n {intl.formatMessage({\n id: 'preview.error.notGeneratedPreview',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.notGeneratedPreview'],\n })}\n {message && (\n <>\n <br /> <br /> {message}\n </>\n )}\n </p>\n </div>\n );\n}\n\nexport interface PreviewErrorProps {\n message?: string;\n}\n","export class NetworkRequestError extends Error {\n constructor(public readonly response: Response) {\n super(`Failed to fetch a resource with response code '${response.status}'.`);\n this.name = 'NetworkRequestError';\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, NetworkRequestError);\n }\n }\n}\n","import { getPushAPIHost } from '~/internal/network/api';\nimport { NetworkRequestError } from '~/internal/network/errors';\nimport { ApplicationInfo } from '~/internal/types/application-info';\n\nexport async function fetchApplication(id: string, serviceKey: string): Promise<ApplicationInfo> {\n const url = new URL(`/application/${encodeURIComponent(id)}/info`, getPushAPIHost());\n url.searchParams.set('apiKey', serviceKey);\n\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new NetworkRequestError(response);\n }\n\n const { application } = await response.json();\n return {\n name: application.name,\n icon: application.icon,\n androidPackageName: application.androidPackageName,\n websitePushConfig: application.websitePushConfig && {\n icon: application.websitePushConfig.icon\n ? calculateCompleteIconUrl(application.websitePushConfig.icon)\n : undefined,\n allowedDomains: application.websitePushConfig.allowedDomains,\n },\n };\n}\n\nfunction calculateCompleteIconUrl(url: string) {\n if (!url.startsWith('https://') && !url.startsWith('http://')) {\n return `${getPushAPIHost()}/upload${url}`;\n } else {\n return url;\n }\n}\n","import { useEffect, useState } from 'react';\nimport { fetchApplication } from '~/internal/network/requests/application';\nimport { RequestState } from '~/internal/network/state';\nimport { ApplicationInfo } from '~/internal/types/application-info';\n\nconst DEFAULT_APPLICATION = {\n name: 'My app',\n icon: undefined,\n androidPackageName: 'com.example.app',\n websitePushConfig: {\n icon: undefined,\n allowedDomains: ['https://my-app.com/'],\n },\n} satisfies ApplicationInfo;\n\nexport function useApplicationLoader({ id, serviceKey }: ApplicationLoaderParams) {\n const [state, setState] = useState<ApplicationLoaderState>({ status: 'idle' });\n\n useEffect(() => {\n if (!id) {\n setState({ status: 'success', data: DEFAULT_APPLICATION });\n return;\n }\n\n fetchApplication(id, serviceKey)\n .then((application) => {\n setState({ status: 'success', data: application });\n })\n .catch((error) => {\n console.error('Error fetching the application: ', error);\n setState({ status: 'success', data: DEFAULT_APPLICATION });\n });\n }, [id]);\n\n return state;\n}\n\nexport type ApplicationLoaderParams = {\n id: string | undefined;\n serviceKey: string;\n};\n\nexport type ApplicationLoaderState = Exclude<RequestState<ApplicationInfo>, { status: 'error' }>;\n","export const PUSH_API_PROD_HOST = 'https://push.notifica.re';\nexport const PUSH_API_TEST_HOST = 'https://push-test.notifica.re';\n\nlet pushAPIHost = PUSH_API_PROD_HOST;\n\nexport const getPushAPIHost = () => pushAPIHost;\nexport const setPushAPIHost = (host: string) => {\n pushAPIHost = host;\n};\n","import { useEffect, useState } from 'react';\n\nexport function useDebounce<T>(value: T, delay: number): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return debouncedValue;\n}\n","export function isValidLocale(locale: string): boolean {\n try {\n return Intl.NumberFormat.supportedLocalesOf([locale]).length > 0;\n } catch {\n return false;\n }\n}\n","export const IN_APP_MESSAGING_TRANSLATIONS = {\n 'preview.error.invalidInAppMessage': '→ Invalid in-app message',\n 'preview.error.notGeneratedPreview': 'Preview could not be generated',\n 'preview.error.checkConsole': 'Check console for more information',\n};\n\n/**\n * The set of translation keys for in-app message previews.\n */\nexport type NotificareInAppMessagingTranslationKey = keyof typeof IN_APP_MESSAGING_TRANSLATIONS;\n","import { NotificareInAppMessagingTranslationKey } from '~/locales';\n\nexport const IN_APP_MESSAGING_TRANSLATIONS_FR: Record<\n NotificareInAppMessagingTranslationKey,\n string\n> = {\n 'preview.error.invalidInAppMessage': '→ Message intégré invalide',\n 'preview.error.notGeneratedPreview': \"L'aperçu n’a pas pu être généré\",\n 'preview.error.checkConsole': 'Consultez la console pour plus d’informations',\n};\n","import { NotificareInAppMessagingTranslationKey } from '~/locales';\n\nexport const IN_APP_MESSAGING_TRANSLATIONS_PT: Record<\n NotificareInAppMessagingTranslationKey,\n string\n> = {\n 'preview.error.invalidInAppMessage': '→ Mensagem in-app inválida',\n 'preview.error.notGeneratedPreview': 'Não foi possível gerar a pré-visualização',\n 'preview.error.checkConsole': 'Consulte a consola para mais informações',\n};\n","import { NotificarePushTranslationKey } from '~/locales';\n\nexport const PUSH_TRANSLATIONS_FR: Record<NotificarePushTranslationKey, string> = {\n 'controls.platform': 'Plateforme',\n 'controls.formFactor': 'Format',\n 'controls.operatingSystem': 'SE',\n 'controls.operatingSystem.macos': 'macOS',\n 'controls.variant': 'Variante',\n 'controls.displayMode.lockScreen': 'Écran verrouillé',\n 'controls.displayMode.expandedLockScreen': 'Écran verrouillé - Étendu',\n 'controls.displayMode.appUi': 'App UI',\n 'preview.error.notGeneratedPreview': 'Aperçu non généré',\n 'preview.error.checkConsole': 'Consultez la console pour plus d’informations',\n 'preview.error.invalidNotification': '→ Notification invalide',\n 'preview.error.provideGoogleMapsApiKey': '→ Une clé API Google Maps doit être fournie',\n 'preview.error.notSupportedPreviewVariant': '→ Variante non prise en charge',\n 'preview.error.invalidUrl': 'L’URL est invalide.',\n 'preview.error.iosStoreAppNotFound':\n \"L'application n’a pas été trouvée. Vérifiez l’identifiant unique et réessayez\",\n 'preview.error.webshotFail':\n 'La capture Web a échoué. Consultez la console pour plus de détails.',\n 'preview.error.notSupportedNotificationTypePreviewVariant':\n \"→ L’aperçu des notifications de type ''{notificationType}'' n’est pas possible dans cette variante\",\n 'preview.error.notSupportedUrlResolverWithUrlSchemePreview':\n \"→ L’aperçu des notifications de type 're.notifica.notification.URLResolver' avec un schéma d’URL personnalisé (URL Scheme) n’est pas possible\",\n 'preview.error.urlResolverInvalidUrl': '→ L’URL fournie est invalide',\n 'preview.error.urlResolverNoNotificareWebViewQueryParameter':\n \"→ L’aperçu des notifications de type 're.notifica.notification.URLResolver' avec une URL HTTP sans le paramètre de requête 'notificareWebView' n’est pas possible dans cette variante\",\n 'preview.error.notSupportedUrlResolverWithDynamicLink':\n \"→ L’aperçu des notifications de type 're.notifica.notification.URLResolver' avec un lien dynamique n’est pas possible\",\n 'preview.error.notSupportedUrlResolverWithRelativeUrl':\n \"→ L’aperçu des notifications de type 're.notifica.notification.URLResolver' avec une URL relative (commençant par '/') n’est pas possible\",\n 'preview.error.googleMapsAuthFailure':\n 'Échec de l’authentification. Votre clé API Google Maps pourrait être invalide. Consultez la console pour plus d’informations.',\n 'preview.error.googleMapsLoadFailure':\n 'Échec du chargement de Google Maps. Consultez la console pour plus d’informations.',\n 'preview.error.noValidContentObject': 'Aucun objet de contenu valide fourni',\n 'preview.error.iosStoreAppLoadFailure':\n 'Échec du chargement de l’application. Consultez la console pour plus de détails',\n 'preview.android.alert.appUi.cancel': 'Annuler',\n 'preview.android.inAppBrowser.appUi.pageTitleLoading': 'Chargement...',\n 'preview.android.lockscreen.time': 'maintenant',\n 'preview.ios.alert.appUi.cancel': 'Annuler',\n 'preview.ios.alert.appUi.ok': 'OK',\n 'preview.ios.inAppBrowser.appUi.done': 'Terminé',\n 'preview.ios.inAppBrowser.appUi.notSecure': 'Non Sécurisé —',\n 'preview.ios.rate.appUi.rateNow': 'Oui, je vais noter maintenant',\n 'preview.ios.rate.appUi.doNotRate': 'Non, Merci',\n 'preview.ios.store.appUi.done': 'Terminé',\n 'preview.ios.store.appUi.install': 'Installer',\n 'preview.ios.store.appUi.ratings': '{userRatingCount, number, ::compact-short} Évaluations',\n 'preview.ios.store.appUi.age': 'Âge',\n 'preview.ios.store.appUi.yearsOld': 'Ans',\n 'preview.ios.store.appUi.category': 'Catégorie',\n 'preview.ios.store.appUi.developer': 'Développeur',\n 'preview.ios.store.appUi.whatsNew': 'Nouveautés',\n 'preview.ios.store.appUi.historyVersion': 'Version {version}',\n 'preview.ios.store.appUi.screenshots': 'Captures d’écran',\n 'preview.ios.lockScreen.time': 'Maintenant',\n 'preview.web.desktop.macos.lockScreen.time': 'maintenant',\n 'preview.web.desktop.macos.lockScreen.settings': 'Réglages',\n 'preview.web.desktop.macos.lockScreen.options': 'Options',\n};\n","import { NotificarePushTranslationKey } from '~/locales';\n\nexport const PUSH_TRANSLATIONS_PT: Record<NotificarePushTranslationKey, string> = {\n 'controls.platform': 'Plataforma',\n 'controls.formFactor': 'Formato',\n 'controls.operatingSystem': 'SO',\n 'controls.operatingSystem.macos': 'macOS',\n 'controls.variant': 'Variante',\n 'controls.displayMode.lockScreen': 'Ecrã de Bloqueio',\n 'controls.displayMode.expandedLockScreen': 'Ecrã de Bloqueio - Expandido',\n 'controls.displayMode.appUi': 'App UI',\n 'preview.error.notGeneratedPreview': 'Não foi possível gerar a pré-visualização',\n 'preview.error.checkConsole': 'Consulte a consola para mais informações',\n 'preview.error.invalidNotification': '→ Notificação inválida',\n 'preview.error.provideGoogleMapsApiKey': '→ Deve ser fornecida uma chave de API do Google Maps',\n 'preview.error.notSupportedPreviewVariant': '→ Variante não suportada',\n 'preview.error.invalidUrl': 'A URL é inválida.',\n 'preview.error.iosStoreAppNotFound':\n 'A aplicação não foi encontrada. Verifique o identificador único e tente novamente',\n 'preview.error.webshotFail':\n 'Não foi possível efetuar a captura da página web. Consulte a consola para mais informações.',\n 'preview.error.notSupportedNotificationTypePreviewVariant':\n \"→ A pré-visualização de notificações do tipo ''{notificationType}'' não é possível nesta variante\",\n 'preview.error.notSupportedUrlResolverWithUrlSchemePreview':\n \"→ A pré-visualização de notificações do tipo 're.notifica.notification.URLResolver' com um esquema de URL personalizado (URL Scheme) não é possível\",\n 'preview.error.urlResolverInvalidUrl': '→ O URL fornecido é inválido',\n 'preview.error.urlResolverNoNotificareWebViewQueryParameter':\n \"→ A pré-visualização de notificações do tipo 're.notifica.notification.URLResolver' com um URL HTTP sem o parâmetro de query 'notificareWebView' não é possível nesta variante\",\n 'preview.error.notSupportedUrlResolverWithDynamicLink':\n \"→ A pré-visualização de notificações do tipo 're.notifica.notification.URLResolver' com um link dinâmico não é possível\",\n 'preview.error.notSupportedUrlResolverWithRelativeUrl':\n \"→ A pré-visualização de notificações do tipo 're.notifica.notification.URLResolver' com um URL relativo (que começa por '/') não é possível\",\n 'preview.error.googleMapsAuthFailure':\n 'Falha de autenticação. A chave da API do Google Maps poderá ser inválida. Consulte a consola para mais informações.',\n 'preview.error.googleMapsLoadFailure':\n 'Não foi possível carregar o Google Maps. Consulte a consola para mais informações.',\n 'preview.error.noValidContentObject': 'Nenhum objeto válido foi fornecido',\n 'preview.error.iosStoreAppLoadFailure':\n 'Não foi possível carregar a aplicação. Consulte a consola para mais informações',\n 'preview.android.alert.appUi.cancel': 'Cancelar',\n 'preview.android.inAppBrowser.appUi.pageTitleLoading': 'A carregar...',\n 'preview.android.lockscreen.time': 'agora',\n 'preview.ios.alert.appUi.cancel': 'Cancelar',\n 'preview.ios.alert.appUi.ok': 'OK',\n 'preview.ios.inAppBrowser.appUi.done': 'Concluído',\n 'preview.ios.inAppBrowser.appUi.notSecure': 'Não seguro —',\n 'preview.ios.rate.appUi.rateNow': 'Sim, avaliar agora',\n 'preview.ios.rate.appUi.doNotRate': 'Não, obrigado',\n 'preview.ios.store.appUi.done': 'OK',\n 'preview.ios.store.appUi.install': 'Obter',\n 'preview.ios.store.appUi.ratings': '{userRatingCount, number, ::compact-short} Classificações',\n 'preview.ios.store.appUi.age': 'Idade',\n 'preview.ios.store.appUi.yearsOld': 'Anos',\n 'preview.ios.store.appUi.category': 'Categoria',\n 'preview.ios.store.appUi.developer': 'Programador',\n 'preview.ios.store.appUi.whatsNew': 'Novidades',\n 'preview.ios.store.appUi.historyVersion': 'Versão {version}',\n 'preview.ios.store.appUi.screenshots': 'Capturas de ecrã',\n 'preview.ios.lockScreen.time': 'Agora',\n 'preview.web.desktop.macos.lockScreen.time': 'agora',\n 'preview.web.desktop.macos.lockScreen.settings': 'Definições',\n 'preview.web.desktop.macos.lockScreen.options': 'Opções',\n};\n","import { useEffect, useMemo, useState } from 'react';\nimport { RequestState } from '~/internal/network/state';\nimport { isValidLocale } from '~/internal/utils/locale';\nimport { NotificarePushTranslationKey, NotificareInAppMessagingTranslationKey } from '~/locales';\nimport { IN_APP_MESSAGING_TRANSLATIONS } from '~/locales/in-app-messaging/en';\nimport { IN_APP_MESSAGING_TRANSLATIONS_FR } from '~/locales/in-app-messaging/fr';\nimport { IN_APP_MESSAGING_TRANSLATIONS_PT } from '~/locales/in-app-messaging/pt';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { PUSH_TRANSLATIONS_FR } from '~/locales/push/fr';\nimport { PUSH_TRANSLATIONS_PT } from '~/locales/push/pt';\n\nexport function useLocalizationLoader<T extends LocalizedFeatureTranslationKeys>({\n locale,\n customTranslations,\n type,\n}: LocalizationLoaderParams<T>) {\n const [state, setState] = useState<LocalizationLoaderState>({ status: 'idle' });\n\n const defaultTranslations = useMemo(() => {\n if (!isValidLocale(locale)) return null;\n\n const language = new Intl.Locale(locale).language;\n\n return getDefaultTranslations(language, type);\n }, [locale, type]);\n\n useEffect(\n function loadLocaleAndTranslations() {\n if (!isValidLocale(locale)) {\n setState({\n status: 'error',\n error: new Error(\n '→ The locale you chose is invalid. Choose a different one and try again',\n ),\n });\n return;\n }\n\n setState({\n status: 'success',\n data: {\n locale: locale,\n translations: { ...defaultTranslations, ...customTranslations },\n },\n });\n },\n [locale, customTranslations, defaultTranslations],\n );\n\n return state;\n}\n\nexport type LocalizationLoaderParams<T extends LocalizedFeatureTranslationKeys> = {\n locale: string;\n type: T;\n customTranslations?: Partial<Record<LocalizedFeatureTranslations[T], string>>;\n};\n\ntype LocalizedFeatureTranslations = {\n push: NotificarePushTranslationKey;\n 'in-app': NotificareInAppMessagingTranslationKey;\n};\n\nexport type LocalizedFeatureTranslationKeys = keyof LocalizedFeatureTranslations;\n\nexport type LocalizationLoaderState = Exclude<\n RequestState<{ locale: string; translations: Record<string, string> }>,\n { status: 'loading' }\n>;\n\nfunction getDefaultTranslations<T extends LocalizedFeatureTranslationKeys>(\n language: string,\n type: T,\n) {\n switch (language) {\n case 'en':\n return type === 'push' ? PUSH_TRANSLATIONS : IN_APP_MESSAGING_TRANSLATIONS;\n\n case 'pt':\n return type === 'push' ? PUSH_TRANSLATIONS_PT : IN_APP_MESSAGING_TRANSLATIONS_PT;\n\n case 'fr':\n return type === 'push' ? PUSH_TRANSLATIONS_FR : IN_APP_MESSAGING_TRANSLATIONS_FR;\n\n default:\n return null;\n }\n}\n","import { Key, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\nimport ExpandIcon from '~/assets/expand.svg';\nimport { useOutsideClick } from '~/internal/hooks';\n\nimport './Selector.css';\n\nexport function Selector<T extends Key>({\n label,\n options,\n value,\n onValueChanged,\n disabled = false,\n}: SelectorProps<T>) {\n const intl = useIntl();\n\n const [expanded, setExpanded] = useState(false);\n const [currentOptionLabel, setCurrentOptionLabel] = useState<string>(loadDefaultOptionLabel);\n const optionsRef = useRef<HTMLDivElement>(null);\n const selectorButtonRef = useRef<HTMLButtonElement>(null);\n\n function loadDefaultOptionLabel() {\n const option = options.find((option) => option.value === value);\n\n if (!option) {\n throw new Error(`Value \"${String(value)}\" not found in the Selector options.`);\n }\n\n return intl.formatMessage({ id: option.labelId, defaultMessage: option.defaultLabel });\n }\n\n useOutsideClick({\n refs: [optionsRef, selectorButtonRef],\n onClickOutside: () => setExpanded(false),\n });\n\n return (\n <div className=\"notificare__selector__wrapper\">\n <p className=\"notificare__selector__label\">{label}</p>\n\n <button\n className=\"notificare__selector__button\"\n onClick={() => setExpanded(!expanded)}\n disabled={disabled}\n ref={selectorButtonRef}\n >\n {currentOptionLabel}\n <ExpandIcon className=\"notificare__selector__button-expand-icon\" />\n </button>\n\n {expanded && (\n <div className=\"notificare__selector__options\" ref={optionsRef}>\n {options.map((option) => (\n <button\n key={option.value}\n className={`notificare__selector__option-button ${value === option.value ? 'notificare__selector__option-button--selected' : ''}`}\n onClick={() => {\n onValueChanged?.(option.value);\n setExpanded(false);\n setCurrentOptionLabel(\n intl.formatMessage({ id: option.labelId, defaultMessage: option.defaultLabel }),\n );\n }}\n data-testid={`selector-option-${option.value}`}\n >\n {intl.formatMessage({ id: option.labelId, defaultMessage: option.defaultLabel })}\n </button>\n ))}\n </div>\n )}\n </div>\n );\n}\n\nexport interface SelectorProps<T> {\n label: string;\n options: { value: T; labelId: string; defaultLabel: string }[];\n value: T;\n onValueChanged?: (value: T) => void;\n disabled?: boolean;\n}\n","import { useEffect, RefObject } from 'react';\n\nexport function useOutsideClick({ refs, onClickOutside }: OutsideClickParams) {\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n const isOutside = refs.every((ref) => {\n return !ref.current || !ref.current.contains(event.target as Node);\n });\n\n if (isOutside) {\n onClickOutside();\n }\n }\n\n document.addEventListener('mousedown', handleClickOutside);\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [refs]);\n}\n\nexport type OutsideClickParams = {\n refs: RefObject<HTMLElement | null>[];\n onClickOutside: () => void;\n};\n","import { Fragment, Key, ReactNode } from 'react';\n\nimport './ToggleGroup.css';\n\nexport function ToggleGroup<T extends Key>({\n label,\n options,\n value,\n onValueChanged,\n}: ToggleGroupProps<T>) {\n return (\n <div className=\"notificare__toggle-group__wrapper\">\n <p className=\"notificare__toggle-group__label\" data-testid={`toggle-group-${label}`}>\n {label}\n </p>\n <div className=\"notificare__toggle-group__options\">\n {options.map((option, index) => (\n <Fragment key={option.value}>\n <button\n className={`notificare__toggle-group__option-button ${value === option.value ? 'notificare__toggle-group__option-button--selected' : ''}`}\n onClick={() => onValueChanged(option.value)}\n aria-label={`Button with option '${option.value}'`}\n data-testid={`toggle-group-option-${option.value}`}\n >\n <div\n className={`notificare__toggle-group__option-button-icon ${value === option.value ? 'notificare__toggle-group__option-button-icon--selected' : ''}`}\n >\n {option.icon}\n </div>\n </button>\n {index !== options.length - 1 && <div className=\"notificare__toggle-group__border\" />}\n </Fragment>\n ))}\n </div>\n </div>\n );\n}\n\nexport interface ToggleGroupProps<T> {\n label: string;\n options: { value: T; icon: ReactNode }[];\n value: T;\n onValueChanged: (value: T) => void;\n}\n","import { FormattedMessage } from 'react-intl';\nimport AlertIcon from '~/assets/alert.svg';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './UnavailablePreview.css';\n\nexport function UnavailablePreview({ message, showConsoleWarning }: UnavailablePreviewProps) {\n return (\n <div className=\"notificare__unavailable-preview__wrapper\" data-testid=\"unavailable-preview\">\n <div className=\"notificare__unavailable-preview__warning\">\n <AlertIcon className=\"notificare__unavailable-preview__alert-icon\" />\n\n <div className=\"notificare__unavailable-preview__text-container\">\n <div className=\"notificare__unavailable-preview__title\">\n <FormattedMessage\n id=\"preview.error.notGeneratedPreview\"\n defaultMessage={PUSH_TRANSLATIONS['preview.error.notGeneratedPreview']}\n />\n </div>\n <div\n className=\"notificare__unavailable-preview__reason-text\"\n data-testid=\"unavailable-preview-reason-text\"\n >\n {message}\n </div>\n </div>\n </div>\n\n {showConsoleWarning && (\n <div className=\"notificare__unavailable-preview__check-console-text\">\n <FormattedMessage\n id=\"preview.error.checkConsole\"\n defaultMessage={PUSH_TRANSLATIONS['preview.error.checkConsole']}\n />\n </div>\n )}\n </div>\n );\n}\n\nexport interface UnavailablePreviewProps {\n message: string;\n showConsoleWarning?: boolean;\n}\n","import { createContext, PropsWithChildren, useContext } from 'react';\n\nconst OptionsContext = createContext<OptionsProviderProps | undefined>(undefined);\n\nexport function OptionsProvider({ children, ...props }: PropsWithChildren<OptionsProviderProps>) {\n return <OptionsContext.Provider value={props}>{children}</OptionsContext.Provider>;\n}\n\nexport interface OptionsProviderProps {\n serviceKey: string;\n googleMapsAPIKey?: string;\n}\n\nexport function useOptions() {\n const context = useContext(OptionsContext);\n if (!context) {\n throw new Error('useOptions should be used inside an OptionsProvider');\n }\n return context;\n}\n","export function isValidUrl(url: string): boolean {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function isSecureUrl(url: string): boolean {\n try {\n const protocol = new URL(url).protocol;\n return protocol === 'https:';\n } catch {\n return false;\n }\n}\n\nexport function getTopLevelDomain(url: string) {\n try {\n const hostname = new URL(url).hostname;\n const parts = hostname.split('.');\n\n if (parts.length > 2) {\n return parts.slice(-2).join('.');\n }\n return hostname;\n } catch (e) {\n console.error('Invalid URL:', e);\n return '';\n }\n}\n","import { useEffect, useState } from 'react';\nimport { useIntl } from 'react-intl';\nimport { useOptions } from '~/internal/context/options';\nimport { useDebounce } from '~/internal/hooks';\nimport {\n createWebshotRequest,\n fetchWebshotRequestStatus,\n fetchWebshotResult,\n} from '~/internal/network/requests/webshot';\nimport { RequestState } from '~/internal/network/state';\nimport { isValidUrl } from '~/internal/utils/url';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nexport function useWebshotRequest(props: UseWebshotRequestProps): WebshotState {\n const { serviceKey } = useOptions();\n const intl = useIntl();\n const { url, platform, width, height } = useDebounce(props, 500);\n\n const [state, setState] = useState<WebshotState>({ status: 'idle' });\n const [webshotId, setWebshotId] = useState<string>();\n\n useEffect(\n function createRequest() {\n if (!isValidUrl(url)) {\n setState({\n status: 'error',\n error: new Error(\n intl.formatMessage({\n id: 'preview.error.invalidUrl',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.invalidUrl'],\n }),\n ),\n });\n return;\n }\n\n setState({ status: 'loading' });\n setWebshotId(undefined);\n\n createWebshotRequest(url, width, height, platform, serviceKey)\n .then(setWebshotId)\n .catch((error) => {\n console.error('Webshot error:\\n\\n' + error);\n\n setState({\n status: 'error',\n error: new Error(\n intl.formatMessage({\n id: 'preview.error.webshotFail',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.webshotFail'],\n }),\n ),\n });\n });\n },\n [url, width, height, platform, serviceKey],\n );\n\n useEffect(\n function loadWebshotResult() {\n if (!webshotId) return;\n\n // eslint-disable-next-line prefer-const\n let handler: NodeJS.Timeout;\n\n const checkStatus = async () => {\n try {\n const statusResponse = await fetchWebshotRequestStatus(webshotId, serviceKey);\n\n if (statusResponse.status === 'finished') {\n const webshot = await fetchWebshotResult(webshotId, serviceKey);\n setState({ status: 'success', data: webshot });\n\n clearInterval(handler);\n } else if (statusResponse.status === 'error') {\n console.error('Webshot error:\\n\\n' + statusResponse.result);\n\n setState({\n status: 'error',\n error: new Error(\n intl.formatMessage({\n id: 'preview.error.webshotFail',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.webshotFail'],\n }),\n ),\n });\n\n clearInterval(handler);\n }\n } catch (error) {\n console.error('Webshot error:\\n\\n' + error);\n\n setState({\n status: 'error',\n error: new Error(\n intl.formatMessage({\n id: 'preview.error.webshotFail',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.webshotFail'],\n }),\n ),\n });\n\n clearInterval(handler);\n }\n };\n\n handler = setInterval(checkStatus, 3000);\n return () => clearInterval(handler);\n },\n [webshotId, serviceKey],\n );\n\n return state;\n}\n\nexport type UseWebshotRequestProps = {\n url: string;\n platform: 'Android' | 'iOS' | 'Web';\n width: number;\n height: number;\n};\n\nexport type WebshotState = RequestState<string>;\n","import { getPushAPIHost } from '../api';\nimport { NetworkRequestError } from '../errors';\n\nexport async function createWebshotRequest(\n url: string,\n width: number,\n height: number,\n platform: 'Android' | 'iOS' | 'Web',\n serviceKey: string,\n): Promise<string> {\n const webshotUrl = new URL('/webshot', getPushAPIHost());\n webshotUrl.searchParams.set('apiKey', serviceKey);\n\n const response = await fetch(webshotUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n url: url,\n delay: 3000,\n platform: platform,\n type: 'png',\n params: {\n width: width,\n height: height,\n },\n }),\n });\n\n if (!response.ok) {\n throw new NetworkRequestError(response);\n }\n\n const data = await response.json();\n return data.webshot.id;\n}\n\nexport async function fetchWebshotRequestStatus(\n id: string,\n serviceKey: string,\n): Promise<WebshotRequestStatusResponse> {\n const url = new URL(`/webshot/${encodeURIComponent(id)}`, getPushAPIHost());\n url.searchParams.set('apiKey', serviceKey);\n\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new NetworkRequestError(response);\n }\n\n const data = await response.json();\n return data.webshot;\n}\n\nexport type WebshotRequestStatusResponse =\n | { status: 'finished' }\n | { status: 'error'; result: string };\n\nexport async function fetchWebshotResult(id: string, serviceKey: string): Promise<string> {\n const url = new URL(`/webshot/${encodeURIComponent(id)}/result`, getPushAPIHost());\n url.searchParams.set('apiKey', serviceKey);\n\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new NetworkRequestError(response);\n }\n\n const blob = await response.blob();\n return URL.createObjectURL(blob);\n}\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 448 512\"\n>\n <path d=\"M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z\" />\n</svg>","import { useEffect } from 'react';\nimport { Loading } from '~/internal/components/shared/Loading/Loading';\nimport { PreviewError } from '~/internal/components/shared/PreviewError/PreviewError';\nimport { useWebshotRequest } from '~/internal/components/shared/Webshot/hooks';\n\nimport './Webshot.css';\n\nexport function Webshot({\n url,\n platform,\n width,\n height,\n onLoadingChanged,\n canShow = true,\n}: WebshotProps) {\n const state = useWebshotRequest({ url, platform, width, height });\n\n useEffect(\n function dispatchLoadingChange() {\n switch (state.status) {\n case 'idle':\n case 'loading':\n onLoadingChanged?.(true);\n break;\n case 'success':\n case 'error':\n onLoadingChanged?.(false);\n break;\n }\n },\n [state],\n );\n\n return (\n <div className=\"notificare__webshot__wrapper\" style={{ width: width, height: height }}>\n {state.status === 'loading' && <Loading />}\n\n {state.status === 'success' && canShow && (\n <img src={state.data} alt=\"Webshot\" data-testid=\"webshot\" />\n )}\n\n {state.status === 'error' && <PreviewError message={state.error.message} />}\n </div>\n );\n}\n\nexport interface WebshotProps {\n url: string;\n platform: 'Android' | 'iOS' | 'Web';\n width: number;\n height: number;\n onLoadingChanged?: (loading: boolean) => void;\n canShow?: boolean;\n}\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\" />\n</svg>","import { Dispatch, SetStateAction, useEffect, useState } from 'react';\nimport { useIntl } from 'react-intl';\nimport AlertIcon from '~/assets/alert.svg';\nimport LockerIcon from '~/assets/locker.svg';\nimport XMarkIcon from '~/assets/x-mark.svg';\nimport { useOptions } from '~/internal/context/options';\nimport { getPushAPIHost } from '~/internal/network/api';\nimport { getTopLevelDomain, isSecureUrl } from '~/internal/utils/url';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './InAppBrowserBar.css';\n\nexport function InAppBrowserBar({ url, onLoadingChanged, canShow }: InAppBrowserBarProps) {\n const [pageTitle, setPageTitle] = useState('');\n const [status, setStatus] = useState<StatusState>({ isLoading: true });\n\n const { serviceKey } = useOptions();\n const intl = useIntl();\n\n useEffect(\n function loadPageTitle() {\n (async () => {\n updateComponentStatus(true, setStatus, onLoadingChanged);\n\n try {\n const pageTitle = await fetchPageTitle(serviceKey, url);\n setPageTitle(pageTitle);\n } catch (error) {\n console.error('Error while getting page title:\\n\\n', error);\n }\n\n updateComponentStatus(false, setStatus, onLoadingChanged);\n })();\n },\n [url],\n );\n\n return (\n <div className=\"notificare__push__android__in-app-browser__app-ui__bar\">\n <XMarkIcon className=\"notificare__push__android__in-app-browser__app-ui__x-mark-icon\" />\n\n {isSecureUrl(url) ? (\n <LockerIcon className=\"notificare__push__android__in-app-browser__app-ui__bar-lock-icon\" />\n ) : (\n <AlertIcon className=\"notificare__push__android__in-app-browser__app-ui__alert-icon\" />\n )}\n\n <div className=\"notificare__push__android__in-app-browser__app-ui__bar-domain\">\n <p className=\"notificare__push__android__in-app-browser__app-ui__bar-text notificare__push__android__in-app-browser__app-ui__bar-text--title\">\n {!status.isLoading && canShow\n ? pageTitle\n : intl.formatMessage({\n id: 'preview.android.inAppBrowser.appUi.pageTitleLoading',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.android.inAppBrowser.appUi.pageTitleLoading'],\n })}\n </p>\n <p className=\"notificare__push__android__in-app-browser__app-ui__bar-text notificare__push__android__in-app-browser__app-ui__bar-text--url\">\n {getTopLevelDomain(url)}\n </p>\n </div>\n </div>\n );\n}\n\nexport interface InAppBrowserBarProps {\n url: string;\n onLoadingChanged?: Dispatch<SetStateAction<boolean>>;\n canShow: boolean;\n}\n\ntype StatusState = {\n isLoading: boolean;\n};\n\nasync function fetchPageTitle(serviceKey: string, websiteUrl: string) {\n const url = new URL('/proxy', getPushAPIHost());\n url.searchParams.set('apiKey', serviceKey);\n url.searchParams.set('url', websiteUrl);\n const response = await fetch(url);\n const html = await response.text();\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, 'text/html');\n\n return doc.querySelector('title')?.textContent ?? '';\n}\n\n/* Status update */\n\nfunction updateComponentStatus(\n isLoading: boolean,\n setStatus: Dispatch<SetStateAction<StatusState>>,\n notifyLoadingChange?: Dispatch<SetStateAction<boolean>>,\n) {\n setStatus({ isLoading: isLoading });\n notifyLoadingChange?.(isLoading);\n return;\n}\n","import { useState } from 'react';\nimport { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { InAppBrowserBar } from './InAppBrowserBar/InAppBrowserBar';\n\nimport './InAppBrowserNotification.css';\n\nexport function InAppBrowserNotification({ notification }: InAppBrowserNotificationProps) {\n const [isPageTitleLoading, setIsPageTitleLoading] = useState(true);\n const [isWebshotLoading, setIsWebshotLoading] = useState(true);\n\n const url = notification.content[0].data;\n\n return (\n <div data-testid=\"android-app-ui-in-app-browser-notification\">\n <InAppBrowserBar\n url={url}\n onLoadingChanged={setIsPageTitleLoading}\n canShow={!isWebshotLoading}\n />\n <Webshot\n url={url}\n platform=\"Android\"\n width={338}\n height={570}\n onLoadingChanged={setIsWebshotLoading}\n canShow={!isPageTitleLoading}\n />\n </div>\n );\n}\n\nexport interface InAppBrowserNotificationProps {\n notification: Extract<\n VerifiedNotification,\n { type: 're.notifica.notification.InAppBrowser' | 're.notifica.notification.URLResolver' }\n >;\n}\n","import { createContext, PropsWithChildren, useContext } from 'react';\nimport { ApplicationInfo } from '~/internal/types/application-info';\n\nexport const ApplicationContext = createContext<ApplicationInfo | undefined>(undefined);\n\nexport function ApplicationProvider({\n application,\n children,\n}: PropsWithChildren<ApplicationProviderProps>) {\n return <ApplicationContext.Provider value={application}>{children}</ApplicationContext.Provider>;\n}\n\nexport interface ApplicationProviderProps {\n application: ApplicationInfo;\n}\n\nexport function useApplication() {\n const context = useContext(ApplicationContext);\n if (!context) {\n throw new Error('useApplication should be used inside an ApplicationProvider');\n }\n return context;\n}\n","import { getPushAPIHost } from '../api';\n\nexport async function fetchWebsiteMarkup(serviceKey: string, websiteUrl: string) {\n const url = new URL('/proxy', getPushAPIHost());\n url.searchParams.set('apiKey', serviceKey);\n url.searchParams.set('url', websiteUrl);\n\n const response = await fetch(url);\n return response.text();\n}\n","import { VerifiedNotification } from '~/internal/schemas/notificare-notification';\n\nexport function hasActions(notification: VerifiedNotification) {\n return !!(notification.actions && notification.actions.length > 0);\n}\n\nexport function hasSingleAction(notification: VerifiedNotification) {\n return !!(notification.actions && notification.actions.length === 1);\n}\n\nexport function hasMultipleActions(notification: VerifiedNotification) {\n return !!(notification.actions && notification.actions.length > 1);\n}\n\nexport function hasFirstAttachment(notification: VerifiedNotification) {\n return !!notification.attachments?.[0];\n}\n\nexport function getMarkersFromNotification(\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Map' }>,\n) {\n const markers: {\n title: string;\n latitude: number;\n longitude: number;\n }[] = [];\n\n notification.content.forEach((contentRow) => {\n markers.push({\n title: contentRow.data.title,\n latitude: contentRow.data.latitude,\n longitude: contentRow.data.longitude,\n });\n });\n\n return markers;\n}\n\nexport function markupContainsNotificareOpenActionQueryParameter(html: string) {\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, 'text/html');\n\n const links = doc.querySelectorAll('a');\n\n let hasParameter = false;\n\n links.forEach((link) => {\n const url = new URL(link.href, window.location.origin);\n if (url.searchParams.has('notificareOpenAction')) {\n hasParameter = true;\n }\n });\n\n return hasParameter;\n}\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 448 512\"\n>\n <path d=\"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z\" />\n</svg>","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 128 512\"\n data-testid=\"android-app-ui-navigation-bar-options-button\"\n>\n <path d=\"M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z\" />\n</svg>","import LeftArrowIcon from '~/assets/left-arrow.svg';\nimport OptionsIcon from '~/assets/options.svg';\n\nimport './NavigationBar.css';\n\nexport function NavigationBar({ title, showOptions }: NavigationBarProps) {\n return (\n <div className=\"notificare__push__android__app-ui__navigation-bar\">\n <LeftArrowIcon className=\"notificare__push__android__app-ui__navigation-bar-arrow-icon\" />\n <div className=\"notificare__push__android__app-ui__navigation-bar-title\">{title}</div>\n {showOptions && (\n <OptionsIcon\n data-testid=\"android-app-ui-navigation-bar-options-button\"\n className=\"notificare__push__android__app-ui__navigation-bar-options-button\"\n />\n )}\n </div>\n );\n}\n\nexport interface NavigationBarProps {\n title: string;\n showOptions: boolean;\n}\n","export function getUrlResolverPreviewTypeByUrl(urlStr: string) {\n urlStr = urlStr.trim();\n\n if (!urlStr) return UrlResolverPreviewTypeResult.INVALID_URL;\n\n if (urlStr.startsWith('/')) {\n return UrlResolverPreviewTypeResult.RELATIVE_URL;\n }\n\n let url: URL;\n\n try {\n url = new URL(urlStr);\n } catch {\n return UrlResolverPreviewTypeResult.INVALID_URL;\n }\n\n const isHttpUrl = url.protocol === 'http:' || url.protocol === 'https:';\n const isDynamicLink = url.host.endsWith('ntc.re');\n\n if (!isHttpUrl) {\n return UrlResolverPreviewTypeResult.URL_SCHEME;\n }\n\n if (isDynamicLink) {\n return UrlResolverPreviewTypeResult.DYNAMIC_LINK;\n }\n\n const webViewQueryParameter = url.searchParams.get('notificareWebView');\n const isWebViewMode =\n webViewQueryParameter === '1' || webViewQueryParameter?.toLowerCase() === 'true';\n\n return isWebViewMode\n ? UrlResolverPreviewTypeResult.WEB_VIEW\n : UrlResolverPreviewTypeResult.IN_APP_BROWSER;\n}\n\nexport enum UrlResolverPreviewTypeResult {\n INVALID_URL = 'invalid-url',\n DYNAMIC_LINK = 'dynamic-link',\n WEB_VIEW = 'web-view',\n IN_APP_BROWSER = 'in-app-browser',\n URL_SCHEME = 'url-scheme',\n RELATIVE_URL = 'relative-url',\n}\n","import { useEffect, useState } from 'react';\nimport { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { useApplication } from '~/internal/context/application';\nimport { useOptions } from '~/internal/context/options';\nimport { fetchWebsiteMarkup } from '~/internal/network/requests/website-markup';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport {\n hasActions,\n markupContainsNotificareOpenActionQueryParameter,\n} from '~/internal/utils/push-previews/notification';\nimport { NavigationBar } from '../NavigationBar/NavigationBar';\n\nimport './URLNotification.css';\n\nexport function URLNotification({ notification }: URLNotificationProps) {\n const application = useApplication();\n const url = notification.content[0].data;\n\n const [websiteMarkup, setWebsiteMarkup] = useState('');\n\n const { serviceKey } = useOptions();\n\n useEffect(function loadWebsiteMarkup() {\n (async () => {\n try {\n const response = await fetchWebsiteMarkup(serviceKey, url);\n setWebsiteMarkup(response);\n } catch (error) {\n console.error('Error fetching website markup:\\n\\n', error);\n }\n })();\n }, []);\n\n return (\n <div data-testid=\"android-app-ui-url-notification\">\n <NavigationBar\n title={notification.title || application.name}\n showOptions={\n hasActions(notification) &&\n !markupContainsNotificareOpenActionQueryParameter(websiteMarkup)\n }\n />\n <Webshot url={url} platform=\"Android\" width={338} height={570} />\n </div>\n );\n}\n\nexport interface URLNotificationProps {\n notification: Extract<\n VerifiedNotification,\n { type: 're.notifica.notification.URL' | 're.notifica.notification.URLResolver' }\n >;\n}\n","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport { InAppBrowserNotification } from '~/internal/components/push/platforms/android/app-ui/InAppBrowserNotification/InAppBrowserNotification';\nimport { URLNotification } from '~/internal/components/push/platforms/android/app-ui/URLNotification/URLNotification';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { getUrlResolverPreviewTypeByUrl } from '~/internal/utils/url-resolver';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nexport function URLResolverNotification({ notification, onError }: URLNotificationProps) {\n const intl = useIntl();\n\n const url = notification.content[0].data;\n\n const urlResolverResult = getUrlResolverPreviewTypeByUrl(url);\n\n useEffect(\n function handleUrlResolverError() {\n switch (urlResolverResult) {\n case 'invalid-url':\n onError(\n intl.formatMessage({\n id: 'preview.error.urlResolverInvalidUrl',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.urlResolverInvalidUrl'],\n }),\n );\n break;\n\n case 'url-scheme':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedUrlResolverWithUrlSchemePreview',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedUrlResolverWithUrlSchemePreview'],\n }),\n );\n break;\n\n case 'dynamic-link':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedUrlResolverWithDynamicLink',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedUrlResolverWithDynamicLink'],\n }),\n );\n break;\n\n case 'relative-url':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedUrlResolverWithRelativeUrl',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedUrlResolverWithRelativeUrl'],\n }),\n );\n break;\n }\n },\n [url],\n );\n\n switch (urlResolverResult) {\n case 'invalid-url':\n case 'url-scheme':\n case 'dynamic-link':\n case 'relative-url':\n return undefined;\n\n case 'web-view':\n return <URLNotification notification={notification} />;\n\n case 'in-app-browser':\n return <InAppBrowserNotification notification={notification} />;\n }\n}\n\nexport interface URLNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.URLResolver' }>;\n onError: (message: string) => void;\n}\n","import { useIntl } from 'react-intl';\nimport { PreviewError } from '~/internal/components/shared/PreviewError/PreviewError';\nimport { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { NavigationBar } from '../NavigationBar/NavigationBar';\n\nimport './AppRecommendationNotification.css';\n\nexport function AppRecommendationNotification({\n notification,\n}: AppRecommendationNotificationProps) {\n const application = useApplication();\n const intl = useIntl();\n\n const url = getUrlByContentType(notification.content);\n\n return (\n <div data-testid=\"android-app-ui-app-recommendation-notification\">\n <NavigationBar title={notification.title || application.name} showOptions={false} />\n {url ? (\n <Webshot url={url} platform=\"Android\" width={338} height={570} />\n ) : (\n <PreviewError\n message={intl.formatMessage({\n id: 'preview.error.noValidContentObject',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.noValidContentObject'],\n })}\n />\n )}\n </div>\n );\n}\n\nexport interface AppRecommendationNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Store' }>;\n}\n\nfunction getUrlByContentType(\n contentList: Extract<VerifiedNotification, { type: 're.notifica.notification.Store' }>['content'],\n) {\n const base = 'https://play.google.com';\n\n for (const content of contentList) {\n switch (content.type) {\n case 're.notifica.content.GooglePlayDetails': {\n const url = new URL('/store/apps/details', base);\n url.searchParams.set('id', content.data);\n\n return url.toString();\n }\n\n case 're.notifica.content.GooglePlayDeveloper': {\n const url = new URL('/store/apps/dev', base);\n url.searchParams.set('id', content.data);\n\n return url.toString();\n }\n\n case 're.notifica.content.GooglePlayCollection': {\n return new URL(\n `/store/apps/collection/${encodeURIComponent(content.data)}`,\n base,\n ).toString();\n }\n\n case 're.notifica.content.GooglePlaySearch': {\n const url = new URL('/store/search', base);\n url.searchParams.set('q', content.data);\n url.searchParams.set('c', 'apps');\n\n return url.toString();\n }\n }\n }\n\n return null;\n}\n","import { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { useApplication } from '~/internal/context/application';\nimport { getPushAPIHost } from '~/internal/network/api';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasActions } from '~/internal/utils/push-previews/notification';\nimport { NavigationBar } from '../NavigationBar/NavigationBar';\n\nimport './DigitalCardNotification.css';\n\nexport function DigitalCardNotification({ notification }: DigitalCardNotificationProps) {\n const application = useApplication();\n\n return (\n <div data-testid=\"android-app-ui-passbook-notification\">\n <NavigationBar\n title={notification.title || application.name}\n showOptions={hasActions(notification)}\n />\n <Webshot\n url={`${getPushAPIHost()}/pass/web/${notification.content[0].data.split('/')[5]}`}\n platform=\"Android\"\n width={338}\n height={570}\n />\n )\n </div>\n );\n}\n\nexport interface DigitalCardNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Passbook' }>;\n}\n","import { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasActions } from '~/internal/utils/push-previews/notification';\nimport { NavigationBar } from '../NavigationBar/NavigationBar';\n\nimport './ImagesNotification.css';\n\nexport function ImagesNotification({ notification }: ImagesNotificationProps) {\n const application = useApplication();\n\n return (\n <div data-testid=\"android-app-ui-images-notification\">\n <NavigationBar\n title={notification.title || application.name}\n showOptions={hasActions(notification)}\n />\n <div className=\"notificare__push__android__image__app-ui__rich-content\">\n <div className=\"notificare__push__android__image__app-ui__image-slider\">\n {notification.content.map((image, index) => (\n <img\n key={index}\n className=\"notificare__push__android__image__app-ui__image-slider-item\"\n src={image.data}\n alt=\"Slider image\"\n />\n ))}\n </div>\n </div>\n </div>\n );\n}\n\nexport interface ImagesNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Image' }>;\n}\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","import React, { useMemo, useState, useReducer, useCallback, useEffect, useRef, useContext, useLayoutEffect, forwardRef, useImperativeHandle, Children } from 'react';\nimport { createPortal } from 'react-dom';\nimport isDeepEqual from 'fast-deep-equal';\n\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nfunction _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\n\nconst APILoadingStatus = {\n NOT_LOADED: 'NOT_LOADED',\n LOADING: 'LOADING',\n LOADED: 'LOADED',\n FAILED: 'FAILED',\n AUTH_FAILURE: 'AUTH_FAILURE'\n};\n\nconst MAPS_API_BASE_URL = 'https://maps.googleapis.com/maps/api/js';\n/**\n * A GoogleMapsApiLoader to reliably load and unload the Google Maps JavaScript API.\n *\n * The actual loading and unloading is delayed into the microtask queue, to\n * allow using the API in an useEffect hook, without worrying about multiple API loads.\n */\nclass GoogleMapsApiLoader {\n /**\n * Loads the Maps JavaScript API with the specified parameters.\n * Since the Maps library can only be loaded once per page, this will\n * produce a warning when called multiple times with different\n * parameters.\n *\n * The returned promise resolves when loading completes\n * and rejects in case of an error or when the loading was aborted.\n */\n static async load(params, onLoadingStatusChange) {\n var _window$google;\n const libraries = params.libraries ? params.libraries.split(',') : [];\n const serializedParams = this.serializeParams(params);\n this.listeners.push(onLoadingStatusChange);\n // Note: if `google.maps.importLibrary` has been defined externally, we\n // assume that loading is complete and successful.\n // If it was defined by a previous call to this method, a warning\n // message is logged if there are differences in api-parameters used\n // for both calls.\n if ((_window$google = window.google) != null && (_window$google = _window$google.maps) != null && _window$google.importLibrary) {\n // no serialized parameters means it was loaded externally\n if (!this.serializedApiParams) {\n this.loadingStatus = APILoadingStatus.LOADED;\n }\n this.notifyLoadingStatusListeners();\n } else {\n this.serializedApiParams = serializedParams;\n this.initImportLibrary(params);\n }\n if (this.serializedApiParams && this.serializedApiParams !== serializedParams) {\n console.warn(`[google-maps-api-loader] The maps API has already been loaded ` + `with different parameters and will not be loaded again. Refresh the ` + `page for new values to have effect.`);\n }\n const librariesToLoad = ['maps', ...libraries];\n await Promise.all(librariesToLoad.map(name => google.maps.importLibrary(name)));\n }\n /**\n * Serialize the parameters used to load the library for easier comparison.\n */\n static serializeParams(params) {\n return [params.v, params.key, params.language, params.region, params.authReferrerPolicy, params.solutionChannel].join('/');\n }\n /**\n * Creates the global `google.maps.importLibrary` function for bootstrapping.\n * This is essentially a formatted version of the dynamic loading script\n * from the official documentation with some minor adjustments.\n *\n * The created importLibrary function will load the Google Maps JavaScript API,\n * which will then replace the `google.maps.importLibrary` function with the full\n * implementation.\n *\n * @see https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import\n */\n static initImportLibrary(params) {\n if (!window.google) window.google = {};\n if (!window.google.maps) window.google.maps = {};\n if (window.google.maps['importLibrary']) {\n console.error('[google-maps-api-loader-internal]: initImportLibrary must only be called once');\n return;\n }\n let apiPromise = null;\n const loadApi = () => {\n if (apiPromise) return apiPromise;\n apiPromise = new Promise((resolve, reject) => {\n var _document$querySelect;\n const scriptElement = document.createElement('script');\n const urlParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n const urlParamName = key.replace(/[A-Z]/g, t => '_' + t[0].toLowerCase());\n urlParams.set(urlParamName, String(value));\n }\n urlParams.set('loading', 'async');\n urlParams.set('callback', '__googleMapsCallback__');\n scriptElement.async = true;\n scriptElement.src = MAPS_API_BASE_URL + `?` + urlParams.toString();\n scriptElement.nonce = ((_document$querySelect = document.querySelector('script[nonce]')) == null ? void 0 : _document$querySelect.nonce) || '';\n scriptElement.onerror = () => {\n this.loadingStatus = APILoadingStatus.FAILED;\n this.notifyLoadingStatusListeners();\n reject(new Error('The Google Maps JavaScript API could not load.'));\n };\n window.__googleMapsCallback__ = () => {\n this.loadingStatus = APILoadingStatus.LOADED;\n this.notifyLoadingStatusListeners();\n resolve();\n };\n window.gm_authFailure = () => {\n this.loadingStatus = APILoadingStatus.AUTH_FAILURE;\n this.notifyLoadingStatusListeners();\n };\n this.loadingStatus = APILoadingStatus.LOADING;\n this.notifyLoadingStatusListeners();\n document.head.append(scriptElement);\n });\n return apiPromise;\n };\n // for the first load, we declare an importLibrary function that will\n // be overwritten once the api is loaded.\n google.maps.importLibrary = libraryName => loadApi().then(() => google.maps.importLibrary(libraryName));\n }\n /**\n * Calls all registered loadingStatusListeners after a status update.\n */\n static notifyLoadingStatusListeners() {\n for (const fn of this.listeners) {\n fn(this.loadingStatus);\n }\n }\n}\n/**\n * The current loadingStatus of the API.\n */\nGoogleMapsApiLoader.loadingStatus = APILoadingStatus.NOT_LOADED;\n/**\n * The parameters used for first loading the API.\n */\nGoogleMapsApiLoader.serializedApiParams = void 0;\n/**\n * A list of functions to be notified when the loading status changes.\n */\nGoogleMapsApiLoader.listeners = [];\n\nconst _excluded$3 = [\"onLoad\", \"onError\", \"apiKey\", \"version\", \"libraries\"],\n _excluded2$1 = [\"children\"];\nconst DEFAULT_SOLUTION_CHANNEL = 'GMP_visgl_rgmlibrary_v1_default';\nconst APIProviderContext = React.createContext(null);\n/**\n * local hook to set up the map-instance management context.\n */\nfunction useMapInstances() {\n const [mapInstances, setMapInstances] = useState({});\n const addMapInstance = (mapInstance, id = 'default') => {\n setMapInstances(instances => _extends({}, instances, {\n [id]: mapInstance\n }));\n };\n const removeMapInstance = (id = 'default') => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setMapInstances(_ref => {\n let remaining = _objectWithoutPropertiesLoose(_ref, [id].map(_toPropertyKey));\n return remaining;\n });\n };\n const clearMapInstances = () => {\n setMapInstances({});\n };\n return {\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances\n };\n}\n/**\n * local hook to handle the loading of the maps API, returns the current loading status\n * @param props\n */\nfunction useGoogleMapsApiLoader(props) {\n const {\n onLoad,\n onError,\n apiKey,\n version,\n libraries = []\n } = props,\n otherApiParams = _objectWithoutPropertiesLoose(props, _excluded$3);\n const [status, setStatus] = useState(GoogleMapsApiLoader.loadingStatus);\n const [loadedLibraries, addLoadedLibrary] = useReducer((loadedLibraries, action) => {\n return loadedLibraries[action.name] ? loadedLibraries : _extends({}, loadedLibraries, {\n [action.name]: action.value\n });\n }, {});\n const librariesString = useMemo(() => libraries == null ? void 0 : libraries.join(','), [libraries]);\n const serializedParams = useMemo(() => JSON.stringify(_extends({\n apiKey,\n version\n }, otherApiParams)), [apiKey, version, otherApiParams]);\n const importLibrary = useCallback(async name => {\n var _google;\n if (loadedLibraries[name]) {\n return loadedLibraries[name];\n }\n if (!((_google = google) != null && (_google = _google.maps) != null && _google.importLibrary)) {\n throw new Error('[api-provider-internal] importLibrary was called before ' + 'google.maps.importLibrary was defined.');\n }\n const res = await window.google.maps.importLibrary(name);\n addLoadedLibrary({\n name,\n value: res\n });\n return res;\n }, [loadedLibraries]);\n useEffect(() => {\n (async () => {\n try {\n const params = _extends({\n key: apiKey\n }, otherApiParams);\n if (version) params.v = version;\n if ((librariesString == null ? void 0 : librariesString.length) > 0) params.libraries = librariesString;\n if (params.channel === undefined || params.channel < 0 || params.channel > 999) delete params.channel;\n if (params.solutionChannel === undefined) params.solutionChannel = DEFAULT_SOLUTION_CHANNEL;else if (params.solutionChannel === '') delete params.solutionChannel;\n await GoogleMapsApiLoader.load(params, status => setStatus(status));\n for (const name of ['core', 'maps', ...libraries]) {\n await importLibrary(name);\n }\n if (onLoad) {\n onLoad();\n }\n } catch (error) {\n if (onError) {\n onError(error);\n } else {\n console.error('<ApiProvider> failed to load the Google Maps JavaScript API', error);\n }\n }\n })();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [apiKey, librariesString, serializedParams]);\n return {\n status,\n loadedLibraries,\n importLibrary\n };\n}\n/**\n * Component to wrap the components from this library and load the Google Maps JavaScript API\n */\nconst APIProvider = props => {\n const {\n children\n } = props,\n loaderProps = _objectWithoutPropertiesLoose(props, _excluded2$1);\n const {\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances\n } = useMapInstances();\n const {\n status,\n loadedLibraries,\n importLibrary\n } = useGoogleMapsApiLoader(loaderProps);\n const contextValue = useMemo(() => ({\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances,\n status,\n loadedLibraries,\n importLibrary\n }), [mapInstances, addMapInstance, removeMapInstance, clearMapInstances, status, loadedLibraries, importLibrary]);\n return /*#__PURE__*/React.createElement(APIProviderContext.Provider, {\n value: contextValue\n }, children);\n};\n\n/**\n * Sets up effects to bind event-handlers for all event-props in MapEventProps.\n * @internal\n */\nfunction useMapEvents(map, props) {\n // note: calling a useEffect hook from within a loop is prohibited by the\n // rules of hooks, but it's ok here since it's unconditional and the number\n // and order of iterations is always strictly the same.\n // (see https://legacy.reactjs.org/docs/hooks-rules.html)\n for (const propName of eventPropNames) {\n // fixme: this cast is essentially a 'trust me, bro' for typescript, but\n // a proper solution seems way too complicated right now\n const handler = props[propName];\n const eventType = propNameToEventType[propName];\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!map) return;\n if (!handler) return;\n const listener = google.maps.event.addListener(map, eventType, ev => {\n handler(createMapEvent(eventType, map, ev));\n });\n return () => listener.remove();\n }, [map, eventType, handler]);\n }\n}\n/**\n * Create the wrapped map-events used for the event-props.\n * @param type the event type as it is specified to the maps api\n * @param map the map instance the event originates from\n * @param srcEvent the source-event if there is one.\n */\nfunction createMapEvent(type, map, srcEvent) {\n const ev = {\n type,\n map,\n detail: {},\n stoppable: false,\n stop: () => {}\n };\n if (cameraEventTypes.includes(type)) {\n const camEvent = ev;\n const center = map.getCenter();\n const zoom = map.getZoom();\n const heading = map.getHeading() || 0;\n const tilt = map.getTilt() || 0;\n const bounds = map.getBounds();\n if (!center || !bounds || !Number.isFinite(zoom)) {\n console.warn('[createEvent] at least one of the values from the map ' + 'returned undefined. This is not expected to happen. Please ' + 'report an issue at https://github.com/visgl/react-google-maps/issues/new');\n }\n camEvent.detail = {\n center: (center == null ? void 0 : center.toJSON()) || {\n lat: 0,\n lng: 0\n },\n zoom: zoom || 0,\n heading: heading,\n tilt: tilt,\n bounds: (bounds == null ? void 0 : bounds.toJSON()) || {\n north: 90,\n east: 180,\n south: -90,\n west: -180\n }\n };\n return camEvent;\n } else if (mouseEventTypes.includes(type)) {\n var _srcEvent$latLng;\n if (!srcEvent) throw new Error('[createEvent] mouse events must provide a srcEvent');\n const mouseEvent = ev;\n mouseEvent.domEvent = srcEvent.domEvent;\n mouseEvent.stoppable = true;\n mouseEvent.stop = () => srcEvent.stop();\n mouseEvent.detail = {\n latLng: ((_srcEvent$latLng = srcEvent.latLng) == null ? void 0 : _srcEvent$latLng.toJSON()) || null,\n placeId: srcEvent.placeId\n };\n return mouseEvent;\n }\n return ev;\n}\n/**\n * maps the camelCased names of event-props to the corresponding event-types\n * used in the maps API.\n */\nconst propNameToEventType = {\n onBoundsChanged: 'bounds_changed',\n onCenterChanged: 'center_changed',\n onClick: 'click',\n onContextmenu: 'contextmenu',\n onDblclick: 'dblclick',\n onDrag: 'drag',\n onDragend: 'dragend',\n onDragstart: 'dragstart',\n onHeadingChanged: 'heading_changed',\n onIdle: 'idle',\n onIsFractionalZoomEnabledChanged: 'isfractionalzoomenabled_changed',\n onMapCapabilitiesChanged: 'mapcapabilities_changed',\n onMapTypeIdChanged: 'maptypeid_changed',\n onMousemove: 'mousemove',\n onMouseout: 'mouseout',\n onMouseover: 'mouseover',\n onProjectionChanged: 'projection_changed',\n onRenderingTypeChanged: 'renderingtype_changed',\n onTilesLoaded: 'tilesloaded',\n onTiltChanged: 'tilt_changed',\n onZoomChanged: 'zoom_changed',\n // note: onCameraChanged is an alias for the bounds_changed event,\n // since that is going to be fired in every situation where the camera is\n // updated.\n onCameraChanged: 'bounds_changed'\n};\nconst cameraEventTypes = ['bounds_changed', 'center_changed', 'heading_changed', 'tilt_changed', 'zoom_changed'];\nconst mouseEventTypes = ['click', 'contextmenu', 'dblclick', 'mousemove', 'mouseout', 'mouseover'];\nconst eventPropNames = Object.keys(propNameToEventType);\n\nfunction useDeepCompareEffect(effect, deps) {\n const ref = useRef(undefined);\n if (!ref.current || !isDeepEqual(deps, ref.current)) {\n ref.current = deps;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(effect, ref.current);\n}\n\nconst mapOptionKeys = new Set(['backgroundColor', 'clickableIcons', 'controlSize', 'disableDefaultUI', 'disableDoubleClickZoom', 'draggable', 'draggableCursor', 'draggingCursor', 'fullscreenControl', 'fullscreenControlOptions', 'gestureHandling', 'headingInteractionEnabled', 'isFractionalZoomEnabled', 'keyboardShortcuts', 'mapTypeControl', 'mapTypeControlOptions', 'mapTypeId', 'maxZoom', 'minZoom', 'noClear', 'panControl', 'panControlOptions', 'restriction', 'rotateControl', 'rotateControlOptions', 'scaleControl', 'scaleControlOptions', 'scrollwheel', 'streetView', 'streetViewControl', 'streetViewControlOptions', 'styles', 'tiltInteractionEnabled', 'zoomControl', 'zoomControlOptions']);\n/**\n * Internal hook to update the map-options when props are changed.\n *\n * @param map the map instance\n * @param mapProps the props to update the map-instance with\n * @internal\n */\nfunction useMapOptions(map, mapProps) {\n /* eslint-disable react-hooks/exhaustive-deps --\n *\n * The following effects aren't triggered when the map is changed.\n * In that case, the values will be or have been passed to the map\n * constructor via mapOptions.\n */\n const mapOptions = {};\n const keys = Object.keys(mapProps);\n for (const key of keys) {\n if (!mapOptionKeys.has(key)) continue;\n mapOptions[key] = mapProps[key];\n }\n // update the map options when mapOptions is changed\n // Note: due to the destructuring above, mapOptions will be seen as changed\n // with every re-render, so we're assuming the maps-api will properly\n // deal with unchanged option-values passed into setOptions.\n useDeepCompareEffect(() => {\n if (!map) return;\n map.setOptions(mapOptions);\n }, [mapOptions]);\n /* eslint-enable react-hooks/exhaustive-deps */\n}\n\nfunction useApiLoadingStatus() {\n var _useContext;\n return ((_useContext = useContext(APIProviderContext)) == null ? void 0 : _useContext.status) || APILoadingStatus.NOT_LOADED;\n}\n\n/**\n * Internal hook that updates the camera when deck.gl viewState changes.\n * @internal\n */\nfunction useDeckGLCameraUpdate(map, props) {\n const {\n viewport,\n viewState\n } = props;\n const isDeckGlControlled = !!viewport;\n useLayoutEffect(() => {\n if (!map || !viewState) return;\n const {\n latitude,\n longitude,\n bearing: heading,\n pitch: tilt,\n zoom\n } = viewState;\n map.moveCamera({\n center: {\n lat: latitude,\n lng: longitude\n },\n heading,\n tilt,\n zoom: zoom + 1\n });\n }, [map, viewState]);\n return isDeckGlControlled;\n}\n\nfunction isLatLngLiteral(obj) {\n if (!obj || typeof obj !== 'object') return false;\n if (!('lat' in obj && 'lng' in obj)) return false;\n return Number.isFinite(obj.lat) && Number.isFinite(obj.lng);\n}\nfunction latLngEquals(a, b) {\n if (!a || !b) return false;\n const A = toLatLngLiteral(a);\n const B = toLatLngLiteral(b);\n if (A.lat !== B.lat || A.lng !== B.lng) return false;\n return true;\n}\nfunction toLatLngLiteral(obj) {\n if (isLatLngLiteral(obj)) return obj;\n return obj.toJSON();\n}\n\nfunction useMapCameraParams(map, cameraStateRef, mapProps) {\n const center = mapProps.center ? toLatLngLiteral(mapProps.center) : null;\n let lat = null;\n let lng = null;\n if (center && Number.isFinite(center.lat) && Number.isFinite(center.lng)) {\n lat = center.lat;\n lng = center.lng;\n }\n const zoom = Number.isFinite(mapProps.zoom) ? mapProps.zoom : null;\n const heading = Number.isFinite(mapProps.heading) ? mapProps.heading : null;\n const tilt = Number.isFinite(mapProps.tilt) ? mapProps.tilt : null;\n // the following effect runs for every render of the map component and checks\n // if there are differences between the known state of the map instance\n // (cameraStateRef, which is updated by all bounds_changed events) and the\n // desired state in the props.\n useLayoutEffect(() => {\n if (!map) return;\n const nextCamera = {};\n let needsUpdate = false;\n if (lat !== null && lng !== null && (cameraStateRef.current.center.lat !== lat || cameraStateRef.current.center.lng !== lng)) {\n nextCamera.center = {\n lat,\n lng\n };\n needsUpdate = true;\n }\n if (zoom !== null && cameraStateRef.current.zoom !== zoom) {\n nextCamera.zoom = zoom;\n needsUpdate = true;\n }\n if (heading !== null && cameraStateRef.current.heading !== heading) {\n nextCamera.heading = heading;\n needsUpdate = true;\n }\n if (tilt !== null && cameraStateRef.current.tilt !== tilt) {\n nextCamera.tilt = tilt;\n needsUpdate = true;\n }\n if (needsUpdate) {\n map.moveCamera(nextCamera);\n }\n });\n}\n\nconst AuthFailureMessage = () => {\n const style = {\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n zIndex: 999,\n display: 'flex',\n flexFlow: 'column nowrap',\n textAlign: 'center',\n justifyContent: 'center',\n fontSize: '.8rem',\n color: 'rgba(0,0,0,0.6)',\n background: '#dddddd',\n padding: '1rem 1.5rem'\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n style: style\n }, /*#__PURE__*/React.createElement(\"h2\", null, \"Error: AuthFailure\"), /*#__PURE__*/React.createElement(\"p\", null, \"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the \", /*#__PURE__*/React.createElement(\"code\", null, \"APIProvider.apiKey\"), \" prop is correct. Check the error-message in the console for further details.\"));\n};\n\nfunction useCallbackRef() {\n const [el, setEl] = useState(null);\n const ref = useCallback(value => setEl(value), [setEl]);\n return [el, ref];\n}\n\n/**\n * Hook to check if the Maps JavaScript API is loaded\n */\nfunction useApiIsLoaded() {\n const status = useApiLoadingStatus();\n return status === APILoadingStatus.LOADED;\n}\n\nfunction useForceUpdate() {\n const [, forceUpdate] = useReducer(x => x + 1, 0);\n return forceUpdate;\n}\n\nfunction handleBoundsChange(map, ref) {\n const center = map.getCenter();\n const zoom = map.getZoom();\n const heading = map.getHeading() || 0;\n const tilt = map.getTilt() || 0;\n const bounds = map.getBounds();\n if (!center || !bounds || !Number.isFinite(zoom)) {\n console.warn('[useTrackedCameraState] at least one of the values from the map ' + 'returned undefined. This is not expected to happen. Please ' + 'report an issue at https://github.com/visgl/react-google-maps/issues/new');\n }\n // fixme: do we need the `undefined` cases for the camera-params? When are they used in the maps API?\n Object.assign(ref.current, {\n center: (center == null ? void 0 : center.toJSON()) || {\n lat: 0,\n lng: 0\n },\n zoom: zoom || 0,\n heading: heading,\n tilt: tilt\n });\n}\n/**\n * Creates a mutable ref object to track the last known state of the map camera.\n * This is used in `useMapCameraParams` to reduce stuttering in normal operation\n * by avoiding updates of the map camera with values that have already been processed.\n */\nfunction useTrackedCameraStateRef(map) {\n const forceUpdate = useForceUpdate();\n const ref = useRef({\n center: {\n lat: 0,\n lng: 0\n },\n heading: 0,\n tilt: 0,\n zoom: 0\n });\n // Record camera state with every bounds_changed event dispatched by the map.\n // This data is used to prevent feeding these values back to the\n // map-instance when a typical \"controlled component\" setup (state variable is\n // fed into and updated by the map).\n useEffect(() => {\n if (!map) return;\n const listener = google.maps.event.addListener(map, 'bounds_changed', () => {\n handleBoundsChange(map, ref);\n // When an event is occured, we have to update during the next cycle.\n // The application could decide to ignore the event and not update any\n // camera props of the map, meaning that in that case we will have to\n // 'undo' the change to the camera.\n forceUpdate();\n });\n return () => listener.remove();\n }, [map, forceUpdate]);\n return ref;\n}\n\nconst _excluded$2 = [\"id\", \"defaultBounds\", \"defaultCenter\", \"defaultZoom\", \"defaultHeading\", \"defaultTilt\", \"reuseMaps\", \"renderingType\", \"colorScheme\"],\n _excluded2 = [\"padding\"];\n/**\n * Stores a stack of map-instances for each mapId. Whenever an\n * instance is used, it is removed from the stack while in use,\n * and returned to the stack when the component unmounts.\n * This allows us to correctly implement caching for multiple\n * maps om the same page, while reusing as much as possible.\n *\n * FIXME: while it should in theory be possible to reuse maps solely\n * based on the mapId (as all other parameters can be changed at\n * runtime), we don't yet have good enough tracking of options to\n * reliably unset all the options that have been set.\n */\nclass CachedMapStack {\n static has(key) {\n return this.entries[key] && this.entries[key].length > 0;\n }\n static pop(key) {\n if (!this.entries[key]) return null;\n return this.entries[key].pop() || null;\n }\n static push(key, value) {\n if (!this.entries[key]) this.entries[key] = [];\n this.entries[key].push(value);\n }\n}\n/**\n * The main hook takes care of creating map-instances and registering them in\n * the api-provider context.\n * @return a tuple of the map-instance created (or null) and the callback\n * ref that will be used to pass the map-container into this hook.\n * @internal\n */\nCachedMapStack.entries = {};\nfunction useMapInstance(props, context) {\n const apiIsLoaded = useApiIsLoaded();\n const [map, setMap] = useState(null);\n const [container, containerRef] = useCallbackRef();\n const cameraStateRef = useTrackedCameraStateRef(map);\n const {\n id,\n defaultBounds,\n defaultCenter,\n defaultZoom,\n defaultHeading,\n defaultTilt,\n reuseMaps,\n renderingType,\n colorScheme\n } = props,\n mapOptions = _objectWithoutPropertiesLoose(props, _excluded$2);\n const hasZoom = props.zoom !== undefined || props.defaultZoom !== undefined;\n const hasCenter = props.center !== undefined || props.defaultCenter !== undefined;\n if (!defaultBounds && (!hasZoom || !hasCenter)) {\n console.warn('<Map> component is missing configuration. ' + 'You have to provide zoom and center (via the `zoom`/`defaultZoom` and ' + '`center`/`defaultCenter` props) or specify the region to show using ' + '`defaultBounds`. See ' + 'https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required');\n }\n // apply default camera props if available and not overwritten by controlled props\n if (!mapOptions.center && defaultCenter) mapOptions.center = defaultCenter;\n if (!mapOptions.zoom && Number.isFinite(defaultZoom)) mapOptions.zoom = defaultZoom;\n if (!mapOptions.heading && Number.isFinite(defaultHeading)) mapOptions.heading = defaultHeading;\n if (!mapOptions.tilt && Number.isFinite(defaultTilt)) mapOptions.tilt = defaultTilt;\n for (const key of Object.keys(mapOptions)) if (mapOptions[key] === undefined) delete mapOptions[key];\n const savedMapStateRef = useRef(undefined);\n // create the map instance and register it in the context\n useEffect(() => {\n if (!container || !apiIsLoaded) return;\n const {\n addMapInstance,\n removeMapInstance\n } = context;\n // note: colorScheme (upcoming feature) isn't yet in the typings, remove once that is fixed:\n const {\n mapId\n } = props;\n const cacheKey = `${mapId || 'default'}:${renderingType || 'default'}:${colorScheme || 'LIGHT'}`;\n let mapDiv;\n let map;\n if (reuseMaps && CachedMapStack.has(cacheKey)) {\n map = CachedMapStack.pop(cacheKey);\n mapDiv = map.getDiv();\n container.appendChild(mapDiv);\n map.setOptions(mapOptions);\n // detaching the element from the DOM lets the map fall back to its default\n // size, setting the center will trigger reloading the map.\n setTimeout(() => map.setCenter(map.getCenter()), 0);\n } else {\n mapDiv = document.createElement('div');\n mapDiv.style.height = '100%';\n container.appendChild(mapDiv);\n map = new google.maps.Map(mapDiv, _extends({}, mapOptions, renderingType ? {\n renderingType: renderingType\n } : {}, colorScheme ? {\n colorScheme: colorScheme\n } : {}));\n }\n setMap(map);\n addMapInstance(map, id);\n if (defaultBounds) {\n const {\n padding\n } = defaultBounds,\n defBounds = _objectWithoutPropertiesLoose(defaultBounds, _excluded2);\n map.fitBounds(defBounds, padding);\n }\n // prevent map not rendering due to missing configuration\n else if (!hasZoom || !hasCenter) {\n map.fitBounds({\n east: 180,\n west: -180,\n south: -90,\n north: 90\n });\n }\n // the savedMapState is used to restore the camera parameters when the mapId is changed\n if (savedMapStateRef.current) {\n const {\n mapId: savedMapId,\n cameraState: savedCameraState\n } = savedMapStateRef.current;\n if (savedMapId !== mapId) {\n map.setOptions(savedCameraState);\n }\n }\n return () => {\n savedMapStateRef.current = {\n mapId,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n cameraState: cameraStateRef.current\n };\n // detach the map-div from the dom\n mapDiv.remove();\n if (reuseMaps) {\n // push back on the stack\n CachedMapStack.push(cacheKey, map);\n } else {\n // remove all event-listeners to minimize the possibility of memory-leaks\n google.maps.event.clearInstanceListeners(map);\n }\n setMap(null);\n removeMapInstance(id);\n };\n },\n // some dependencies are ignored in the list below:\n // - defaultBounds and the default* camera props will only be used once, and\n // changes should be ignored\n // - mapOptions has special hooks that take care of updating the options\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [container, apiIsLoaded, id,\n // these props can't be changed after initialization and require a new\n // instance to be created\n props.mapId, props.renderingType, props.colorScheme]);\n return [map, containerRef, cameraStateRef];\n}\n\nconst GoogleMapsContext = React.createContext(null);\n// ColorScheme and RenderingType are redefined here to make them usable before the\n// maps API has been fully loaded.\nconst ColorScheme = {\n DARK: 'DARK',\n LIGHT: 'LIGHT',\n FOLLOW_SYSTEM: 'FOLLOW_SYSTEM'\n};\nconst RenderingType = {\n VECTOR: 'VECTOR',\n RASTER: 'RASTER',\n UNINITIALIZED: 'UNINITIALIZED'\n};\nconst Map = props => {\n const {\n children,\n id,\n className,\n style\n } = props;\n const context = useContext(APIProviderContext);\n const loadingStatus = useApiLoadingStatus();\n if (!context) {\n throw new Error('<Map> can only be used inside an <ApiProvider> component.');\n }\n const [map, mapRef, cameraStateRef] = useMapInstance(props, context);\n useMapCameraParams(map, cameraStateRef, props);\n useMapEvents(map, props);\n useMapOptions(map, props);\n const isDeckGlControlled = useDeckGLCameraUpdate(map, props);\n const isControlledExternally = !!props.controlled;\n // disable interactions with the map for externally controlled maps\n useEffect(() => {\n if (!map) return;\n // fixme: this doesn't seem to belong here (and it's mostly there for convenience anyway).\n // The reasoning is that a deck.gl canvas will be put on top of the map, rendering\n // any default map controls pretty much useless\n if (isDeckGlControlled) {\n map.setOptions({\n disableDefaultUI: true\n });\n }\n // disable all control-inputs when the map is controlled externally\n if (isDeckGlControlled || isControlledExternally) {\n map.setOptions({\n gestureHandling: 'none',\n keyboardShortcuts: false\n });\n }\n return () => {\n map.setOptions({\n gestureHandling: props.gestureHandling,\n keyboardShortcuts: props.keyboardShortcuts\n });\n };\n }, [map, isDeckGlControlled, isControlledExternally, props.gestureHandling, props.keyboardShortcuts]);\n // setup a stable cameraOptions object that can be used as dependency\n const center = props.center ? toLatLngLiteral(props.center) : null;\n let lat = null;\n let lng = null;\n if (center && Number.isFinite(center.lat) && Number.isFinite(center.lng)) {\n lat = center.lat;\n lng = center.lng;\n }\n const cameraOptions = useMemo(() => {\n var _lat, _lng, _props$zoom, _props$heading, _props$tilt;\n return {\n center: {\n lat: (_lat = lat) != null ? _lat : 0,\n lng: (_lng = lng) != null ? _lng : 0\n },\n zoom: (_props$zoom = props.zoom) != null ? _props$zoom : 0,\n heading: (_props$heading = props.heading) != null ? _props$heading : 0,\n tilt: (_props$tilt = props.tilt) != null ? _props$tilt : 0\n };\n }, [lat, lng, props.zoom, props.heading, props.tilt]);\n // externally controlled mode: reject all camera changes that don't correspond to changes in props\n useLayoutEffect(() => {\n if (!map || !isControlledExternally) return;\n map.moveCamera(cameraOptions);\n const listener = map.addListener('bounds_changed', () => {\n map.moveCamera(cameraOptions);\n });\n return () => listener.remove();\n }, [map, isControlledExternally, cameraOptions]);\n const combinedStyle = useMemo(() => _extends({\n width: '100%',\n height: '100%',\n position: 'relative',\n // when using deckgl, the map should be sent to the back\n zIndex: isDeckGlControlled ? -1 : 0\n }, style), [style, isDeckGlControlled]);\n const contextValue = useMemo(() => ({\n map\n }), [map]);\n if (loadingStatus === APILoadingStatus.AUTH_FAILURE) {\n return /*#__PURE__*/React.createElement(\"div\", {\n style: _extends({\n position: 'relative'\n }, className ? {} : combinedStyle),\n className: className\n }, /*#__PURE__*/React.createElement(AuthFailureMessage, null));\n }\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: mapRef,\n \"data-testid\": 'map',\n style: className ? undefined : combinedStyle,\n className: className\n }, id ? {\n id\n } : {}), map ? /*#__PURE__*/React.createElement(GoogleMapsContext.Provider, {\n value: contextValue\n }, children) : null);\n};\n// The deckGLViewProps flag here indicates to deck.gl that the Map component is\n// able to handle viewProps from deck.gl when deck.gl is used to control the map.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nMap.deckGLViewProps = true;\n\nconst shownMessages = new Set();\nfunction logErrorOnce(...args) {\n const key = JSON.stringify(args);\n if (!shownMessages.has(key)) {\n shownMessages.add(key);\n console.error(...args);\n }\n}\n\n/**\n * Retrieves a map-instance from the context. This is either an instance\n * identified by id or the parent map instance if no id is specified.\n * Returns null if neither can be found.\n */\nconst useMap = (id = null) => {\n const ctx = useContext(APIProviderContext);\n const {\n map\n } = useContext(GoogleMapsContext) || {};\n if (ctx === null) {\n logErrorOnce('useMap(): failed to retrieve APIProviderContext. ' + 'Make sure that the <APIProvider> component exists and that the ' + 'component you are calling `useMap()` from is a sibling of the ' + '<APIProvider>.');\n return null;\n }\n const {\n mapInstances\n } = ctx;\n // if an id is specified, the corresponding map or null is returned\n if (id !== null) return mapInstances[id] || null;\n // otherwise, return the closest ancestor\n if (map) return map;\n // finally, return the default map instance\n return mapInstances['default'] || null;\n};\n\nfunction useMapsLibrary(name) {\n const apiIsLoaded = useApiIsLoaded();\n const ctx = useContext(APIProviderContext);\n useEffect(() => {\n if (!apiIsLoaded || !ctx) return;\n // Trigger loading the libraries via our proxy-method.\n // The returned promise is ignored, since importLibrary will update loadedLibraries\n // list in the context, triggering a re-render.\n void ctx.importLibrary(name);\n }, [apiIsLoaded, ctx, name]);\n return (ctx == null ? void 0 : ctx.loadedLibraries[name]) || null;\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Internally used to bind events to Maps JavaScript API objects.\n * @internal\n */\nfunction useMapsEventListener(target, name, callback) {\n useEffect(() => {\n if (!target || !name || !callback) return;\n const listener = google.maps.event.addListener(target, name, callback);\n return () => listener.remove();\n }, [target, name, callback]);\n}\n\n/**\n * Internally used to copy values from props into API-Objects\n * whenever they change.\n *\n * @example\n * usePropBinding(marker, 'position', position);\n *\n * @internal\n */\nfunction usePropBinding(object, prop, value) {\n useEffect(() => {\n if (!object) return;\n object[prop] = value;\n }, [object, prop, value]);\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Internally used to bind events to DOM nodes.\n * @internal\n */\nfunction useDomEventListener(target, name, callback) {\n useEffect(() => {\n if (!target || !name || !callback) return;\n target.addEventListener(name, callback);\n return () => target.removeEventListener(name, callback);\n }, [target, name, callback]);\n}\n\n/* eslint-disable complexity */\nfunction isAdvancedMarker(marker) {\n return marker.content !== undefined;\n}\nfunction isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Copy of the `google.maps.CollisionBehavior` constants.\n * They have to be duplicated here since we can't wait for the maps API to load to be able to use them.\n */\nconst CollisionBehavior = {\n REQUIRED: 'REQUIRED',\n REQUIRED_AND_HIDES_OPTIONAL: 'REQUIRED_AND_HIDES_OPTIONAL',\n OPTIONAL_AND_HIDES_LOWER_PRIORITY: 'OPTIONAL_AND_HIDES_LOWER_PRIORITY'\n};\nconst AdvancedMarkerContext = React.createContext(null);\n// [xPosition, yPosition] when the top left corner is [0, 0]\nconst AdvancedMarkerAnchorPoint = {\n TOP_LEFT: ['0%', '0%'],\n TOP_CENTER: ['50%', '0%'],\n TOP: ['50%', '0%'],\n TOP_RIGHT: ['100%', '0%'],\n LEFT_CENTER: ['0%', '50%'],\n LEFT_TOP: ['0%', '0%'],\n LEFT: ['0%', '50%'],\n LEFT_BOTTOM: ['0%', '100%'],\n RIGHT_TOP: ['100%', '0%'],\n RIGHT: ['100%', '50%'],\n RIGHT_CENTER: ['100%', '50%'],\n RIGHT_BOTTOM: ['100%', '100%'],\n BOTTOM_LEFT: ['0%', '100%'],\n BOTTOM_CENTER: ['50%', '100%'],\n BOTTOM: ['50%', '100%'],\n BOTTOM_RIGHT: ['100%', '100%'],\n CENTER: ['50%', '50%']\n};\nconst MarkerContent = ({\n children,\n styles,\n className,\n anchorPoint\n}) => {\n const [xTranslation, yTranslation] = anchorPoint != null ? anchorPoint : AdvancedMarkerAnchorPoint['BOTTOM'];\n let xTranslationFlipped = `-${xTranslation}`;\n let yTranslationFlipped = `-${yTranslation}`;\n if (xTranslation.trimStart().startsWith('-')) {\n xTranslationFlipped = xTranslation.substring(1);\n }\n if (yTranslation.trimStart().startsWith('-')) {\n yTranslationFlipped = yTranslation.substring(1);\n }\n // The \"translate(50%, 100%)\" is here to counter and reset the default anchoring of the advanced marker element\n // that comes from the api\n const transformStyle = `translate(50%, 100%) translate(${xTranslationFlipped}, ${yTranslationFlipped})`;\n return (\n /*#__PURE__*/\n // anchoring container\n React.createElement(\"div\", {\n style: {\n transform: transformStyle\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: styles\n }, children))\n );\n};\nfunction useAdvancedMarker(props) {\n const [marker, setMarker] = useState(null);\n const [contentContainer, setContentContainer] = useState(null);\n const map = useMap();\n const markerLibrary = useMapsLibrary('marker');\n const {\n children,\n onClick,\n className,\n onMouseEnter,\n onMouseLeave,\n onDrag,\n onDragStart,\n onDragEnd,\n collisionBehavior,\n clickable,\n draggable,\n position,\n title,\n zIndex\n } = props;\n const numChildren = Children.count(children);\n // create an AdvancedMarkerElement instance and add it to the map once available\n useEffect(() => {\n if (!map || !markerLibrary) return;\n const newMarker = new markerLibrary.AdvancedMarkerElement();\n newMarker.map = map;\n setMarker(newMarker);\n // create the container for marker content if there are children\n let contentElement = null;\n if (numChildren > 0) {\n contentElement = document.createElement('div');\n // We need some kind of flag to identify the custom marker content\n // in the infowindow component. Choosing a custom property instead of a className\n // to not encourage users to style the marker content directly.\n contentElement.isCustomMarker = true;\n newMarker.content = contentElement;\n setContentContainer(contentElement);\n }\n return () => {\n var _contentElement;\n newMarker.map = null;\n (_contentElement = contentElement) == null || _contentElement.remove();\n setMarker(null);\n setContentContainer(null);\n };\n }, [map, markerLibrary, numChildren]);\n // When no children are present we don't have our own wrapper div\n // which usually gets the user provided className. In this case\n // we set the className directly on the marker.content element that comes\n // with the AdvancedMarker.\n useEffect(() => {\n if (!marker || !marker.content || numChildren > 0) return;\n marker.content.className = className || '';\n }, [marker, className, numChildren]);\n // copy other props\n usePropBinding(marker, 'position', position);\n usePropBinding(marker, 'title', title != null ? title : '');\n usePropBinding(marker, 'zIndex', zIndex);\n usePropBinding(marker, 'collisionBehavior', collisionBehavior);\n // set gmpDraggable from props (when unspecified, it's true if any drag-event\n // callbacks are specified)\n useEffect(() => {\n if (!marker) return;\n if (draggable !== undefined) marker.gmpDraggable = draggable;else if (onDrag || onDragStart || onDragEnd) marker.gmpDraggable = true;else marker.gmpDraggable = false;\n }, [marker, draggable, onDrag, onDragEnd, onDragStart]);\n // set gmpClickable from props (when unspecified, it's true if the onClick or one of\n // the hover events callbacks are specified)\n useEffect(() => {\n if (!marker) return;\n const gmpClickable = clickable !== undefined || Boolean(onClick) || Boolean(onMouseEnter) || Boolean(onMouseLeave);\n // gmpClickable is only available in beta version of the\n // maps api (as of 2024-10-10)\n marker.gmpClickable = gmpClickable;\n // enable pointer events for the markers with custom content\n if (gmpClickable && marker != null && marker.content && isElementNode(marker.content)) {\n marker.content.style.pointerEvents = 'none';\n if (marker.content.firstElementChild) {\n marker.content.firstElementChild.style.pointerEvents = 'all';\n }\n }\n }, [marker, clickable, onClick, onMouseEnter, onMouseLeave]);\n useMapsEventListener(marker, 'click', onClick);\n useMapsEventListener(marker, 'drag', onDrag);\n useMapsEventListener(marker, 'dragstart', onDragStart);\n useMapsEventListener(marker, 'dragend', onDragEnd);\n useDomEventListener(marker == null ? void 0 : marker.element, 'mouseenter', onMouseEnter);\n useDomEventListener(marker == null ? void 0 : marker.element, 'mouseleave', onMouseLeave);\n return [marker, contentContainer];\n}\nconst AdvancedMarker = forwardRef((props, ref) => {\n const {\n children,\n style,\n className,\n anchorPoint\n } = props;\n const [marker, contentContainer] = useAdvancedMarker(props);\n const advancedMarkerContextValue = useMemo(() => marker ? {\n marker\n } : null, [marker]);\n useImperativeHandle(ref, () => marker, [marker]);\n if (!contentContainer) return null;\n return /*#__PURE__*/React.createElement(AdvancedMarkerContext.Provider, {\n value: advancedMarkerContextValue\n }, createPortal(/*#__PURE__*/React.createElement(MarkerContent, {\n anchorPoint: anchorPoint,\n styles: style,\n className: className\n }, children), contentContainer));\n});\nfunction useAdvancedMarkerRef() {\n const [marker, setMarker] = useState(null);\n const refCallback = useCallback(m => {\n setMarker(m);\n }, []);\n return [refCallback, marker];\n}\n\nfunction setValueForStyles(element, styles, prevStyles) {\n if (styles != null && typeof styles !== 'object') {\n throw new Error('The `style` prop expects a mapping from style properties to values, ' + \"not a string. For example, style={{marginRight: spacing + 'em'}} when \" + 'using JSX.');\n }\n const elementStyle = element.style;\n // without `prevStyles`, just set all values\n if (prevStyles == null) {\n if (styles == null) return;\n for (const styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) continue;\n setValueForStyle(elementStyle, styleName, styles[styleName]);\n }\n return;\n }\n // unset all styles in `prevStyles` that aren't in `styles`\n for (const styleName in prevStyles) {\n if (prevStyles.hasOwnProperty(styleName) && (styles == null || !styles.hasOwnProperty(styleName))) {\n // Clear style\n const isCustomProperty = styleName.indexOf('--') === 0;\n if (isCustomProperty) {\n elementStyle.setProperty(styleName, '');\n } else if (styleName === 'float') {\n elementStyle.cssFloat = '';\n } else {\n elementStyle[styleName] = '';\n }\n }\n }\n // only assign values from `styles` that are different from `prevStyles`\n if (styles == null) return;\n for (const styleName in styles) {\n const value = styles[styleName];\n if (styles.hasOwnProperty(styleName) && prevStyles[styleName] !== value) {\n setValueForStyle(elementStyle, styleName, value);\n }\n }\n}\nfunction setValueForStyle(elementStyle, styleName, value) {\n const isCustomProperty = styleName.indexOf('--') === 0;\n // falsy values will unset the style property\n if (value == null || typeof value === 'boolean' || value === '') {\n if (isCustomProperty) {\n elementStyle.setProperty(styleName, '');\n } else if (styleName === 'float') {\n elementStyle.cssFloat = '';\n } else {\n elementStyle[styleName] = '';\n }\n }\n // custom properties can't be directly assigned\n else if (isCustomProperty) {\n elementStyle.setProperty(styleName, value);\n }\n // numeric values are treated as 'px' unless the style property expects unitless numbers\n else if (typeof value === 'number' && value !== 0 && !isUnitlessNumber(styleName)) {\n elementStyle[styleName] = value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n // everything else can just be assigned\n else {\n if (styleName === 'float') {\n elementStyle.cssFloat = value;\n } else {\n elementStyle[styleName] = ('' + value).trim();\n }\n }\n}\n// CSS properties which accept numbers but are not in units of \"px\".\nconst unitlessNumbers = new Set(['animationIterationCount', 'aspectRatio', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'columns', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'gridArea', 'gridRow', 'gridRowEnd', 'gridRowSpan', 'gridRowStart', 'gridColumn', 'gridColumnEnd', 'gridColumnSpan', 'gridColumnStart', 'fontWeight', 'lineClamp', 'lineHeight', 'opacity', 'order', 'orphans', 'scale', 'tabSize', 'widows', 'zIndex', 'zoom', 'fillOpacity',\n// SVG-related properties\n'floodOpacity', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth']);\nfunction isUnitlessNumber(name) {\n return unitlessNumbers.has(name);\n}\n\nconst _excluded$1 = [\"children\", \"headerContent\", \"style\", \"className\", \"pixelOffset\", \"anchor\", \"shouldFocus\", \"onClose\", \"onCloseClick\"];\n/**\n * Component to render an Info Window with the Maps JavaScript API\n */\nconst InfoWindow = props => {\n const {\n // content options\n children,\n headerContent,\n style,\n className,\n pixelOffset,\n // open options\n anchor,\n shouldFocus,\n // events\n onClose,\n onCloseClick\n // other options\n } = props,\n infoWindowOptions = _objectWithoutPropertiesLoose(props, _excluded$1);\n // ## create infowindow instance once the mapsLibrary is available.\n const mapsLibrary = useMapsLibrary('maps');\n const [infoWindow, setInfoWindow] = useState(null);\n const contentContainerRef = useRef(null);\n const headerContainerRef = useRef(null);\n useEffect(() => {\n if (!mapsLibrary) return;\n contentContainerRef.current = document.createElement('div');\n headerContainerRef.current = document.createElement('div');\n const opts = infoWindowOptions;\n if (pixelOffset) {\n opts.pixelOffset = new google.maps.Size(pixelOffset[0], pixelOffset[1]);\n }\n if (headerContent) {\n // if headerContent is specified as string we can directly forward it,\n // otherwise we'll pass the element the portal will render into\n opts.headerContent = typeof headerContent === 'string' ? headerContent : headerContainerRef.current;\n }\n // intentionally shadowing the state variables here\n const infoWindow = new google.maps.InfoWindow(infoWindowOptions);\n infoWindow.setContent(contentContainerRef.current);\n setInfoWindow(infoWindow);\n // unmount: remove infoWindow and content elements (note: close is called in a different effect-cleanup)\n return () => {\n var _contentContainerRef$, _headerContainerRef$c;\n infoWindow.setContent(null);\n (_contentContainerRef$ = contentContainerRef.current) == null || _contentContainerRef$.remove();\n (_headerContainerRef$c = headerContainerRef.current) == null || _headerContainerRef$c.remove();\n contentContainerRef.current = null;\n headerContainerRef.current = null;\n setInfoWindow(null);\n };\n },\n // `infoWindowOptions` and other props are missing from dependencies:\n //\n // We don't want to re-create the infowindow instance\n // when the options change.\n // Updating the options is handled in the useEffect below.\n //\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [mapsLibrary]);\n // ## update className and styles for `contentContainer`\n // stores previously applied style properties, so they can be removed when unset\n const prevStyleRef = useRef(null);\n useEffect(() => {\n if (!infoWindow || !contentContainerRef.current) return;\n setValueForStyles(contentContainerRef.current, style || null, prevStyleRef.current);\n prevStyleRef.current = style || null;\n if (className !== contentContainerRef.current.className) contentContainerRef.current.className = className || '';\n }, [infoWindow, className, style]);\n // ## update options\n useDeepCompareEffect(() => {\n if (!infoWindow) return;\n const opts = infoWindowOptions;\n if (!pixelOffset) {\n opts.pixelOffset = null;\n } else {\n opts.pixelOffset = new google.maps.Size(pixelOffset[0], pixelOffset[1]);\n }\n if (!headerContent) {\n opts.headerContent = null;\n } else {\n opts.headerContent = typeof headerContent === 'string' ? headerContent : headerContainerRef.current;\n }\n infoWindow.setOptions(infoWindowOptions);\n },\n // dependency `infoWindow` isn't needed since options are also passed\n // to the constructor when a new infoWindow is created.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [infoWindowOptions, pixelOffset, headerContent]);\n // ## bind event handlers\n useMapsEventListener(infoWindow, 'close', onClose);\n useMapsEventListener(infoWindow, 'closeclick', onCloseClick);\n // ## open info window when content and map are available\n const map = useMap();\n useDeepCompareEffect(() => {\n // `anchor === null` means an anchor is defined but not ready yet.\n if (!map || !infoWindow || anchor === null) return;\n const isOpenedWithAnchor = !!anchor;\n const openOptions = {\n map\n };\n if (anchor) {\n openOptions.anchor = anchor;\n // Only do the infowindow adjusting when dealing with an AdvancedMarker\n if (isAdvancedMarker(anchor) && anchor.content instanceof Element) {\n const wrapper = anchor.content;\n const wrapperBcr = wrapper == null ? void 0 : wrapper.getBoundingClientRect();\n // This checks whether or not the anchor has custom content with our own\n // div wrapper. If not, that means we have a regular AdvancedMarker without any children.\n // In that case we do not want to adjust the infowindow since it is all handled correctly\n // by the Google Maps API.\n if (wrapperBcr && wrapper != null && wrapper.isCustomMarker) {\n var _anchor$content$first;\n // We can safely typecast here since we control that element and we know that\n // it is a div\n const anchorDomContent = (_anchor$content$first = anchor.content.firstElementChild) == null ? void 0 : _anchor$content$first.firstElementChild;\n const contentBcr = anchorDomContent == null ? void 0 : anchorDomContent.getBoundingClientRect();\n // center infowindow above marker\n const anchorOffsetX = contentBcr.x - wrapperBcr.x + (contentBcr.width - wrapperBcr.width) / 2;\n const anchorOffsetY = contentBcr.y - wrapperBcr.y;\n const opts = infoWindowOptions;\n opts.pixelOffset = new google.maps.Size(pixelOffset ? pixelOffset[0] + anchorOffsetX : anchorOffsetX, pixelOffset ? pixelOffset[1] + anchorOffsetY : anchorOffsetY);\n infoWindow.setOptions(opts);\n }\n }\n }\n if (shouldFocus !== undefined) {\n openOptions.shouldFocus = shouldFocus;\n }\n infoWindow.open(openOptions);\n return () => {\n // Note: when the infowindow has an anchor, it will automatically show up again when the\n // anchor was removed from the map before infoWindow.close() is called but the it gets\n // added back to the map after that.\n // More information here: https://issuetracker.google.com/issues/343750849\n if (isOpenedWithAnchor) infoWindow.set('anchor', null);\n infoWindow.close();\n };\n }, [infoWindow, anchor, map, shouldFocus, infoWindowOptions, pixelOffset]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, contentContainerRef.current && createPortal(children, contentContainerRef.current), headerContainerRef.current !== null && createPortal(headerContent, headerContainerRef.current));\n};\n\n/**\n * Formats a location into a string representation suitable for Google Static Maps API.\n *\n * @param location - The location to format, can be either a string or an object with lat/lng properties\n * @returns A string representation of the location in the format \"lat,lng\" or the original string\n *\n * @example\n * // Returns \"40.714728,-73.998672\"\n * formatLocation({ lat: 40.714728, lng: -73.998672 })\n *\n * @example\n * // Returns \"New York, NY\"\n * formatLocation(\"New York, NY\")\n */\nfunction formatLocation(location) {\n return typeof location === 'string' ? location : `${location.lat},${location.lng}`;\n}\n// Used for removing the leading pipe from the param string\nfunction formatParam(string) {\n return string.slice(1);\n}\n\n/**\n * Assembles marker parameters for static maps.\n *\n * This function takes an array of markers and groups them by their style properties.\n * It then creates a string representation of these markers, including their styles and locations,\n * which can be used as parameters for static map APIs.\n *\n * @param {StaticMapsMarker[]} [markers=[]] - An array of markers to be processed. Each marker can have properties such as color, label, size, scale, icon, anchor, and location.\n * @returns {string[]} An array of strings, each representing a group of markers with their styles and locations.\n *\n * @example\n * const markers = [\n * { color: 'blue', label: 'A', size: 'mid', location: '40.714728,-73.998672' },\n * { color: 'blue', label: 'B', size: 'mid', location: '40.714728,-73.998672' },\n * { icon: 'http://example.com/icon.png', location: { lat: 40.714728, lng: -73.998672 } }\n * ];\n * const params = assembleMarkerParams(markers);\n * // Params will be an array of strings representing the marker parameters\n * Example output: [\n * \"color:blue|label:A|size:mid|40.714728,-73.998672|40.714728,-73.998672\",\n * \"color:blue|label:B|size:mid|40.714728,-73.998672|40.714728,-73.998672\",\n * \"icon:http://example.com/icon.png|40.714728,-73.998672\"\n * ]\n */\nfunction assembleMarkerParams(markers = []) {\n const markerParams = [];\n // Group markers by style\n const markersByStyle = markers == null ? void 0 : markers.reduce((styles, marker) => {\n const {\n color = 'red',\n label,\n size,\n scale,\n icon,\n anchor\n } = marker;\n // Create a unique style key based on either icon properties or standard marker properties\n const relevantProps = icon ? [icon, anchor, scale] : [color, label, size];\n const key = relevantProps.filter(Boolean).join('-');\n styles[key] = styles[key] || [];\n styles[key].push(marker);\n return styles;\n }, {});\n Object.values(markersByStyle != null ? markersByStyle : {}).forEach(markers => {\n let markerParam = '';\n const {\n icon\n } = markers[0];\n // Create marker style from first marker in group since all markers share the same style.\n Object.entries(markers[0]).forEach(([key, value]) => {\n // Determine which properties to include based on whether marker uses custom icon\n const relevantKeys = icon ? ['icon', 'anchor', 'scale'] : ['color', 'label', 'size'];\n if (relevantKeys.includes(key)) {\n markerParam += `|${key}:${value}`;\n }\n });\n // Add location coordinates for each marker in the style group\n // Handles both string locations and lat/lng object formats.\n for (const marker of markers) {\n const location = typeof marker.location === 'string' ? marker.location : `${marker.location.lat},${marker.location.lng}`;\n markerParam += `|${location}`;\n }\n markerParams.push(markerParam);\n });\n return markerParams.map(formatParam);\n}\n\n/**\n * Assembles path parameters for the Static Maps Api from an array of paths.\n *\n * This function groups paths by their style properties (color, weight, fillcolor, geodesic)\n * and then constructs a string of path parameters for each group. Each path parameter string\n * includes the style properties and the coordinates of the paths.\n *\n * @param {Array<StaticMapsPath>} [paths=[]] - An array of paths to be assembled into path parameters.\n * @returns {Array<string>} An array of path parameter strings.\n *\n * @example\n * const paths = [\n * {\n * color: 'red',\n * weight: 5,\n * coordinates: [\n * { lat: 40.714728, lng: -73.998672 },\n * { lat: 40.718217, lng: -73.998284 }\n * ]\n * }\n * ];\n *\n * const pathParams = assemblePathParams(paths);\n * Output: [\n * 'color:red|weight:5|40.714728,-73.998672|40.718217,-73.998284'\n * ]\n */\nfunction assemblePathParams(paths = []) {\n const pathParams = [];\n // Group paths by their style properties (color, weight, fillcolor, geodesic)\n // to combine paths with identical styles into single parameter strings\n const pathsByStyle = paths == null ? void 0 : paths.reduce((styles, path) => {\n const {\n color = 'default',\n weight,\n fillcolor,\n geodesic\n } = path;\n // Create unique key for this style combination\n const key = [color, weight, fillcolor, geodesic].filter(Boolean).join('-');\n styles[key] = styles[key] || [];\n styles[key].push(path);\n return styles;\n }, {});\n // Process each group of paths with identical styles\n Object.values(pathsByStyle != null ? pathsByStyle : {}).forEach(paths => {\n let pathParam = '';\n // Build style parameter string using properties from first path in group\n // since all paths in this group share the same style\n Object.entries(paths[0]).forEach(([key, value]) => {\n if (['color', 'weight', 'fillcolor', 'geodesic'].includes(key)) {\n pathParam += `|${key}:${value}`;\n }\n });\n // Add location for all marker in style group\n for (const path of paths) {\n if (typeof path.coordinates === 'string') {\n pathParam += `|${decodeURIComponent(path.coordinates)}`;\n } else {\n for (const location of path.coordinates) {\n pathParam += `|${formatLocation(location)}`;\n }\n }\n }\n pathParams.push(pathParam);\n });\n return pathParams.map(formatParam);\n}\n\n/**\n * Converts an array of Google Maps style objects into an array of style strings\n * compatible with the Google Static Maps API.\n *\n * @param styles - An array of Google Maps MapTypeStyle objects that define the styling rules\n * @returns An array of formatted style strings ready to be used with the Static Maps API\n *\n * @example\n * const styles = [{\n * featureType: \"road\",\n * elementType: \"geometry\",\n * stylers: [{color: \"#ff0000\"}, {weight: 1}]\n * }];\n *\n * const styleStrings = assembleMapTypeStyles(styles);\n * // Returns: [\"|feature:road|element:geometry|color:0xff0000|weight:1\"]\n *\n * Each style string follows the format:\n * \"feature:{featureType}|element:{elementType}|{stylerName}:{stylerValue}\"\n *\n * Note: Color values with hexadecimal notation (#) are automatically converted\n * to the required 0x format for the Static Maps API.\n */\nfunction assembleMapTypeStyles(styles) {\n return styles.map(mapTypeStyle => {\n const {\n featureType,\n elementType,\n stylers = []\n } = mapTypeStyle;\n let styleString = '';\n if (featureType) {\n styleString += `|feature:${featureType}`;\n }\n if (elementType) {\n styleString += `|element:${elementType}`;\n }\n for (const styler of stylers) {\n Object.entries(styler).forEach(([name, value]) => {\n styleString += `|${name}:${String(value).replace('#', '0x')}`;\n });\n }\n return styleString;\n }).map(formatParam);\n}\n\nconst STATIC_MAPS_BASE = 'https://maps.googleapis.com/maps/api/staticmap';\n/**\n * Creates a URL for the Google Static Maps API with the specified parameters.\n *\n * @param {Object} options - The configuration options for the static map\n * @param {string} options.apiKey - Your Google Maps API key (required)\n * @param {number} options.width - The width of the map image in pixels (required)\n * @param {number} options.height - The height of the map image in pixels (required)\n * @param {StaticMapsLocation} [options.center] - The center point of the map (lat/lng or address).\n * Required if no markers or paths or \"visible locations\" are provided.\n * @param {number} [options.zoom] - The zoom level of the map. Required if no markers or paths or \"visible locations\" are provided.\n * @param {1|2|4} [options.scale] - The resolution of the map (1, 2, or 4)\n * @param {string} [options.format] - The image format (png, png8, png32, gif, jpg, jpg-baseline)\n * @param {string} [options.mapType] - The type of map (roadmap, satellite, terrain, hybrid)\n * @param {string} [options.language] - The language of the map labels\n * @param {string} [options.region] - The region code for the map\n * @param {string} [options.map_id] - The Cloud-based map style ID\n * @param {StaticMapsMarker[]} [options.markers=[]] - Array of markers to display on the map\n * @param {StaticMapsPath[]} [options.paths=[]] - Array of paths to display on the map\n * @param {StaticMapsLocation[]} [options.visible=[]] - Array of locations that should be visible on the map\n * @param {MapTypeStyle[]} [options.style=[]] - Array of style objects to customize the map appearance\n *\n * @returns {string} The complete Google Static Maps API URL\n *\n * @throws {Error} If API key is not provided\n * @throws {Error} If width or height is not provided\n *\n * @example\n * const url = createStaticMapsUrl({\n * apiKey: 'YOUR_API_KEY',\n * width: 600,\n * height: 400,\n * center: { lat: 40.714728, lng: -73.998672 },\n * zoom: 12,\n * markers: [\n * {\n * location: { lat: 40.714728, lng: -73.998672 },\n * color: 'red',\n * label: 'A'\n * }\n * ],\n * paths: [\n * {\n * coordinates: [\n * { lat: 40.714728, lng: -73.998672 },\n * { lat: 40.719728, lng: -73.991672 }\n * ],\n * color: '0x0000ff',\n * weight: 5\n * }\n * ],\n * style: [\n * {\n * featureType: 'road',\n * elementType: 'geometry',\n * stylers: [{color: '#00ff00'}]\n * }\n * ]\n * });\n *\n * // Results in URL similar to:\n * // https://maps.googleapis.com/maps/api/staticmap?key=YOUR_API_KEY\n * // &size=600x400\n * // ¢er=40.714728,-73.998672&zoom=12\n * // &markers=color:red|label:A|40.714728,-73.998672\n * // &path=color:0x0000ff|weight:5|40.714728,-73.998672|40.719728,-73.991672\n * // &style=feature:road|element:geometry|color:0x00ff00\n */\nfunction createStaticMapsUrl({\n apiKey,\n width,\n height,\n center,\n zoom,\n scale,\n format,\n mapType,\n language,\n region,\n mapId,\n markers = [],\n paths = [],\n visible = [],\n style = []\n}) {\n if (!apiKey) {\n console.warn('API key is required');\n }\n if (!width || !height) {\n console.warn('Width and height are required');\n }\n const params = _extends({\n key: apiKey,\n size: `${width}x${height}`\n }, center && {\n center: formatLocation(center)\n }, zoom && {\n zoom\n }, scale && {\n scale\n }, format && {\n format\n }, mapType && {\n maptype: mapType\n }, language && {\n language\n }, region && {\n region\n }, mapId && {\n map_id: mapId\n });\n const url = new URL(STATIC_MAPS_BASE);\n // Params that don't need special handling\n Object.entries(params).forEach(([key, value]) => {\n url.searchParams.append(key, String(value));\n });\n // Assemble Markers\n for (const markerParam of assembleMarkerParams(markers)) {\n url.searchParams.append('markers', markerParam);\n }\n // Assemble Paths\n for (const pathParam of assemblePathParams(paths)) {\n url.searchParams.append('path', pathParam);\n }\n // Assemble visible locations\n if (visible.length) {\n url.searchParams.append('visible', visible.map(location => formatLocation(location)).join('|'));\n }\n // Assemble Map Type Styles\n for (const styleString of assembleMapTypeStyles(style)) {\n url.searchParams.append('style', styleString);\n }\n return url.toString();\n}\n\nconst StaticMap = props => {\n const {\n url,\n className\n } = props;\n if (!url) throw new Error('URL is required');\n return /*#__PURE__*/React.createElement(\"img\", {\n className: className,\n src: url,\n width: \"100%\"\n });\n};\n\n/**\n * Copy of the `google.maps.ControlPosition` constants.\n * They have to be duplicated here since we can't wait for the maps API to load to be able to use them.\n */\nconst ControlPosition = {\n TOP_LEFT: 1,\n TOP_CENTER: 2,\n TOP: 2,\n TOP_RIGHT: 3,\n LEFT_CENTER: 4,\n LEFT_TOP: 5,\n LEFT: 5,\n LEFT_BOTTOM: 6,\n RIGHT_TOP: 7,\n RIGHT: 7,\n RIGHT_CENTER: 8,\n RIGHT_BOTTOM: 9,\n BOTTOM_LEFT: 10,\n BOTTOM_CENTER: 11,\n BOTTOM: 11,\n BOTTOM_RIGHT: 12,\n CENTER: 13,\n BLOCK_START_INLINE_START: 14,\n BLOCK_START_INLINE_CENTER: 15,\n BLOCK_START_INLINE_END: 16,\n INLINE_START_BLOCK_CENTER: 17,\n INLINE_START_BLOCK_START: 18,\n INLINE_START_BLOCK_END: 19,\n INLINE_END_BLOCK_START: 20,\n INLINE_END_BLOCK_CENTER: 21,\n INLINE_END_BLOCK_END: 22,\n BLOCK_END_INLINE_START: 23,\n BLOCK_END_INLINE_CENTER: 24,\n BLOCK_END_INLINE_END: 25\n};\nconst MapControl = ({\n children,\n position\n}) => {\n const controlContainer = useMemo(() => document.createElement('div'), []);\n const map = useMap();\n useEffect(() => {\n if (!map) return;\n const controls = map.controls[position];\n controls.push(controlContainer);\n return () => {\n const controlsArray = controls.getArray();\n // controlsArray could be undefined if the map is in an undefined state (e.g. invalid API-key, see #276\n if (!controlsArray) return;\n const index = controlsArray.indexOf(controlContainer);\n controls.removeAt(index);\n };\n }, [controlContainer, map, position]);\n return createPortal(children, controlContainer);\n};\n\nconst _excluded = [\"onClick\", \"onDrag\", \"onDragStart\", \"onDragEnd\", \"onMouseOver\", \"onMouseOut\"];\nfunction useMarker(props) {\n const [marker, setMarker] = useState(null);\n const map = useMap();\n const {\n onClick,\n onDrag,\n onDragStart,\n onDragEnd,\n onMouseOver,\n onMouseOut\n } = props,\n markerOptions = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n position,\n draggable\n } = markerOptions;\n // create marker instance and add to the map once the map is available\n useEffect(() => {\n if (!map) {\n if (map === undefined) console.error('<Marker> has to be inside a Map component.');\n return;\n }\n const newMarker = new google.maps.Marker(markerOptions);\n newMarker.setMap(map);\n setMarker(newMarker);\n return () => {\n newMarker.setMap(null);\n setMarker(null);\n };\n // We do not want to re-render the whole marker when the options change.\n // Marker options update is handled in a useEffect below.\n // Excluding markerOptions from dependency array on purpose here.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [map]);\n // attach and re-attach event-handlers when any of the properties change\n useEffect(() => {\n if (!marker) return;\n const m = marker;\n // Add event listeners\n const gme = google.maps.event;\n if (onClick) gme.addListener(m, 'click', onClick);\n if (onDrag) gme.addListener(m, 'drag', onDrag);\n if (onDragStart) gme.addListener(m, 'dragstart', onDragStart);\n if (onDragEnd) gme.addListener(m, 'dragend', onDragEnd);\n if (onMouseOver) gme.addListener(m, 'mouseover', onMouseOver);\n if (onMouseOut) gme.addListener(m, 'mouseout', onMouseOut);\n marker.setDraggable(Boolean(draggable));\n return () => {\n gme.clearInstanceListeners(m);\n };\n }, [marker, draggable, onClick, onDrag, onDragStart, onDragEnd, onMouseOver, onMouseOut]);\n // update markerOptions (note the dependencies aren't properly checked\n // here, we just assume that setOptions is smart enough to not waste a\n // lot of time updating values that didn't change)\n useEffect(() => {\n if (!marker) return;\n if (markerOptions) marker.setOptions(markerOptions);\n }, [marker, markerOptions]);\n // update position when changed\n useEffect(() => {\n // Should not update position when draggable\n if (draggable || !position || !marker) return;\n marker.setPosition(position);\n }, [draggable, position, marker]);\n return marker;\n}\n/**\n * Component to render a marker on a map\n */\nconst Marker = forwardRef((props, ref) => {\n const marker = useMarker(props);\n useImperativeHandle(ref, () => marker, [marker]);\n return /*#__PURE__*/React.createElement(React.Fragment, null);\n});\nfunction useMarkerRef() {\n const [marker, setMarker] = useState(null);\n const refCallback = useCallback(m => {\n setMarker(m);\n }, []);\n return [refCallback, marker];\n}\n\n/**\n * Component to configure the appearance of an AdvancedMarker\n */\nconst Pin = props => {\n var _useContext;\n const advancedMarker = (_useContext = useContext(AdvancedMarkerContext)) == null ? void 0 : _useContext.marker;\n const glyphContainer = useMemo(() => document.createElement('div'), []);\n // Create Pin View instance\n useEffect(() => {\n var _advancedMarker$conte;\n if (!advancedMarker) {\n if (advancedMarker === undefined) {\n console.error('The <Pin> component can only be used inside <AdvancedMarker>.');\n }\n return;\n }\n if (props.glyph && props.children) {\n logErrorOnce('The <Pin> component only uses children to render the glyph if both the glyph property and children are present.');\n }\n if (Children.count(props.children) > 1) {\n logErrorOnce('Passing multiple children to the <Pin> component might lead to unexpected results.');\n }\n const pinViewOptions = _extends({}, props);\n const pinElement = new google.maps.marker.PinElement(pinViewOptions);\n // Set glyph to glyph container if children are present (rendered via portal).\n // If both props.glyph and props.children are present, props.children takes priority.\n if (props.children) {\n pinElement.glyph = glyphContainer;\n }\n // Set content of Advanced Marker View to the Pin View element\n // Here we are selecting the anchor container.\n // The hierarchy is as follows:\n // \"advancedMarker.content\" (from google) -> \"pointer events reset div\" -> \"anchor container\"\n const markerContent = (_advancedMarker$conte = advancedMarker.content) == null || (_advancedMarker$conte = _advancedMarker$conte.firstChild) == null ? void 0 : _advancedMarker$conte.firstChild;\n while (markerContent != null && markerContent.firstChild) {\n markerContent.removeChild(markerContent.firstChild);\n }\n if (markerContent) {\n markerContent.appendChild(pinElement.element);\n }\n }, [advancedMarker, glyphContainer, props]);\n return createPortal(props.children, glyphContainer);\n};\n\nconst mapLinear = (x, a1, a2, b1, b2) => b1 + (x - a1) * (b2 - b1) / (a2 - a1);\nconst getMapMaxTilt = zoom => {\n if (zoom <= 10) {\n return 30;\n }\n if (zoom >= 15.5) {\n return 67.5;\n }\n // range [10...14]\n if (zoom <= 14) {\n return mapLinear(zoom, 10, 14, 30, 45);\n }\n // range [14...15.5]\n return mapLinear(zoom, 14, 15.5, 45, 67.5);\n};\n/**\n * Function to limit the tilt range of the Google map when updating the view state\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst limitTiltRange = ({\n viewState\n}) => {\n const pitch = viewState.pitch;\n const gmZoom = viewState.zoom + 1;\n const maxTilt = getMapMaxTilt(gmZoom);\n return _extends({}, viewState, {\n fovy: 25,\n pitch: Math.min(maxTilt, pitch)\n });\n};\n\nexport { APILoadingStatus, APIProvider, APIProviderContext, AdvancedMarker, AdvancedMarkerAnchorPoint, AdvancedMarkerContext, CollisionBehavior, ColorScheme, ControlPosition, GoogleMapsContext, InfoWindow, Map, MapControl, Marker, Pin, RenderingType, StaticMap, createStaticMapsUrl, isAdvancedMarker, isLatLngLiteral, latLngEquals, limitTiltRange, toLatLngLiteral, useAdvancedMarkerRef, useApiIsLoaded, useApiLoadingStatus, useMap, useMapsLibrary, useMarkerRef };\n//# sourceMappingURL=index.modern.mjs.map\n","import { useEffect, useMemo, useState } from 'react';\nimport {\n APIProvider,\n Map,\n Marker,\n useApiLoadingStatus,\n APILoadingStatus,\n} from '@vis.gl/react-google-maps';\nimport { useIntl } from 'react-intl';\nimport { Loading } from '~/internal/components/shared/Loading/Loading';\nimport { PreviewError } from '~/internal/components/shared/PreviewError/PreviewError';\nimport { useOptions } from '~/internal/context/options';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { getMarkersFromNotification } from '~/internal/utils/push-previews/notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './MapRichContent.css';\n\nexport function MapRichContent({ notification, width, height }: MapRichContentProps) {\n const { googleMapsAPIKey } = useOptions();\n const [isClient, setIsClient] = useState(false);\n\n const markers = useMemo(() => {\n return getMarkersFromNotification(notification).map((marker, index) => ({\n id: index,\n lat: marker.latitude,\n lng: marker.longitude,\n title: marker.title,\n }));\n }, [notification.content]);\n\n const center = useMemo(() => {\n if (markers.length > 0) {\n return { lat: markers[0].lat, lng: markers[0].lng };\n }\n return { lat: 0, lng: 0 };\n }, [markers]);\n\n useEffect(() => {\n setIsClient(true);\n }, []);\n\n if (markers.length === 0 || !isClient) {\n return <Loading />;\n }\n\n return (\n <div data-testid=\"map-notification\">\n <APIProvider apiKey={googleMapsAPIKey || ''}>\n <MapWithStatus markers={markers} center={center} width={width} height={height} />\n </APIProvider>\n </div>\n );\n}\n\nfunction MapWithStatus({\n markers,\n center,\n width,\n height,\n}: {\n markers: { id: number; lat: number; lng: number; title: string }[];\n center: { lat: number; lng: number };\n width: string;\n height: string;\n}) {\n const apiLoadStatus = useApiLoadingStatus();\n const intl = useIntl();\n\n return (\n <div\n style={{\n width,\n height,\n backgroundColor: 'white',\n position: 'relative',\n overflow: 'hidden',\n }}\n >\n {apiLoadStatus === APILoadingStatus.LOADING && <Loading />}\n\n {apiLoadStatus === APILoadingStatus.AUTH_FAILURE && (\n <PreviewError\n message={intl.formatMessage({\n id: 'preview.error.googleMapsAuthFailure',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.googleMapsAuthFailure'],\n })}\n />\n )}\n\n {apiLoadStatus === APILoadingStatus.FAILED && (\n <PreviewError\n message={intl.formatMessage({\n id: 'preview.error.googleMapsLoadFailure',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.googleMapsLoadFailure'],\n })}\n />\n )}\n\n {apiLoadStatus === APILoadingStatus.LOADED && (\n <Map\n style={{ width, height }}\n defaultCenter={center}\n defaultZoom={10}\n gestureHandling=\"greedy\"\n disableDefaultUI={true}\n >\n {markers.map((marker) => (\n <Marker\n key={marker.id}\n position={{ lat: marker.lat, lng: marker.lng }}\n title={marker.title}\n />\n ))}\n </Map>\n )}\n </div>\n );\n}\n\nexport interface MapRichContentProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Map' }>;\n width: string;\n height: string;\n}\n","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport { MapRichContent } from '~/internal/components/push/platforms/shared/MapRichContent/MapRichContent';\nimport { useApplication } from '~/internal/context/application';\nimport { useOptions } from '~/internal/context/options';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasActions } from '~/internal/utils/push-previews/notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { NavigationBar } from '../NavigationBar/NavigationBar';\n\nimport './MapNotification.css';\n\nexport function MapNotification({ notification, onError }: MapNotificationProps) {\n const application = useApplication();\n const { googleMapsAPIKey } = useOptions();\n const intl = useIntl();\n\n useEffect(\n function handleMissingGoogleMapsApiKey() {\n if (!googleMapsAPIKey) {\n onError(\n intl.formatMessage({\n id: 'preview.error.provideGoogleMapsApiKey',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.provideGoogleMapsApiKey'],\n }),\n );\n }\n },\n [googleMapsAPIKey],\n );\n\n if (!googleMapsAPIKey) {\n return undefined;\n }\n\n return (\n <div data-testid=\"android-app-ui-map-notification\">\n <NavigationBar title={application.name} showOptions={hasActions(notification)} />\n <MapRichContent notification={notification} width=\"100%\" height=\"570px\" />\n </div>\n );\n}\n\nexport interface MapNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Map' }>;\n onError: (message: string) => void;\n}\n","<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"900\" height=\"900\" viewBox=\"1757.501 1648.178 806.546 806.694\" preserveAspectRatio=\"xMidYMid slice\">\n <rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill=\"transparent\"/>\n <g transform=\"matrix(1 0 0 1 450 450)\" id=\"background-layer\">\n <rect x=\"-450\" y=\"-450\" width=\"900\" height=\"900\" style=\"fill: rgb(255,255,255); visibility: hidden;\"/>\n </g>\n <g transform=\"matrix(12.2 0 0 12.2 2160.42 2051.46)\" id=\"base-square\">\n <rect x=\"-33.085\" y=\"-33.085\" width=\"66.17\" height=\"66.17\" style=\"fill: rgb(35,44,42); stroke-width: 1;\"/>\n </g>\n <g transform=\"matrix(7.2 0 0 7.2 2160.42 2051.79)\" id=\"center-circle\">\n <circle cx=\"0\" cy=\"0\" r=\"35\" style=\"fill: rgb(35,44,42); stroke: rgb(68,68,68); stroke-width: 1;\"/>\n </g>\n <g transform=\"matrix(-10.74 -10.74 -0.05 0.05 2160.33 2052.81)\" id=\"shape-1\">\n <rect x=\"-17.46\" y=\"-19.415\" width=\"34.92\" height=\"38.83\" style=\"fill: rgb(68,68,68); stroke: rgb(68,68,68); stroke-width: 40;\"/>\n </g>\n <g transform=\"matrix(10.71 -10.71 -0.05 -0.05 2160.62 2052.92)\" id=\"shape-2\">\n <rect x=\"-17.46\" y=\"-19.415\" width=\"34.92\" height=\"38.83\" style=\"fill: rgb(68,68,68); stroke: rgb(68,68,68); stroke-width: 40;\"/>\n </g>\n <g transform=\"matrix(10.69 0 0 -0.07 2160.36 2053.16)\" id=\"shape-3\">\n <rect x=\"-17.46\" y=\"-19.415\" width=\"34.92\" height=\"38.83\" style=\"fill: rgb(68,68,68); stroke: rgb(68,68,68); stroke-width: 40;\"/>\n </g>\n <g transform=\"matrix(0 -10.69 -0.07 0 1896.9 2052.81)\" id=\"shape-4\">\n <rect x=\"-17.46\" y=\"-19.415\" width=\"34.92\" height=\"38.83\" style=\"fill: rgb(68,68,68); stroke: rgb(68,68,68); stroke-width: 40;\"/>\n </g>\n <g transform=\"matrix(0 -10.69 -0.07 0 2423.68 2053.49)\" id=\"shape-5\">\n <rect x=\"-17.46\" y=\"-19.415\" width=\"34.92\" height=\"38.83\" style=\"fill: rgb(68,68,68); stroke: rgb(68,68,68); stroke-width: 40;\"/>\n </g>\n <g transform=\"matrix(-10.69 0 0 0.07 2160.38 1790.29)\" id=\"shape-6\">\n <rect x=\"-17.46\" y=\"-19.415\" width=\"34.92\" height=\"38.83\" style=\"fill: rgb(68,68,68); stroke: rgb(68,68,68); stroke-width: 40;\"/>\n </g>\n <g transform=\"matrix(-10.68, 0, 0, 0.07, 2160.419922, 2313.820068)\" id=\"shape-7\">\n <rect x=\"-17.46\" y=\"-19.415\" width=\"34.92\" height=\"38.83\" style=\"fill: rgb(68,68,68); stroke: rgb(68,68,68); stroke-width: 40;\"/>\n </g>\n</svg>","import { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { NavigationBar } from '../NavigationBar/NavigationBar';\n\nimport './RateNotification.css';\n\nexport function RateNotification({ notification }: RateNotificationProps) {\n const application = useApplication();\n\n const url = new URL('/store/apps/details', 'https://play.google.com');\n url.searchParams.set('id', application.androidPackageName || '');\n\n return (\n <div data-testid=\"android-app-ui-rate-notification\">\n <NavigationBar title={notification.title || application.name} showOptions={false} />\n <Webshot url={url.toString()} platform=\"Android\" width={338} height={570} />\n </div>\n );\n}\n\nexport interface RateNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Rate' }>;\n}\n","import { FormattedMessage } from 'react-intl';\nimport DefaultAppIcon from '~/assets/default-app-icon.svg';\nimport { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasActions } from '~/internal/utils/push-previews/notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './TextAlertNotification.css';\n\nexport function TextAlertNotification({ notification }: TextAlertNotificationProps) {\n const application = useApplication();\n\n return (\n <div\n className=\"notificare__push__android__alert__app-ui\"\n data-testid=\"android-app-ui-text-alert-notification\"\n >\n <div className=\"notificare__push__android__alert__app-ui__wrapper\">\n <div className=\"notificare__push__android__alert__app-ui__header\">\n <div className=\"notificare__push__android__alert__app-ui__app-icon\">\n {application.icon ? (\n <img\n className=\"notificare__push__android__alert__app-ui__app-icon-image\"\n alt=\"App icon\"\n src={application.icon}\n />\n ) : (\n <DefaultAppIcon className=\"notificare__push__android__alert__app-ui__default-app-icon\" />\n )}\n </div>\n <p className=\"notificare__push__android__alert__app-ui__title\">\n {notification.title || application.name}\n </p>\n </div>\n <p className=\"notificare__push__android__alert__app-ui__message\">{notification.message}</p>\n\n {hasActions(notification) && (\n <div className=\"notificare__push__android__alert__app-ui__actions\">\n {notification.actions?.map((action, index) => (\n <p\n key={index}\n className=\"notificare__push__android__alert__app-ui__action-label\"\n data-testid={`android-app-ui-text-alert-notification-action-${index}`}\n >\n {action.label}\n </p>\n ))}\n <p\n className=\"notificare__push__android__alert__app-ui__cancel-label\"\n key=\"cancel-button-label\"\n >\n <FormattedMessage\n id=\"preview.android.alert.appUi.cancel\"\n defaultMessage={PUSH_TRANSLATIONS['preview.android.alert.appUi.cancel']}\n />\n </p>\n </div>\n )}\n </div>\n </div>\n );\n}\n\nexport interface TextAlertNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Alert' }>;\n}\n","import { VerifiedNotification } from '~/internal/schemas/notificare-notification';\n\nimport './VideoRichContent.css';\n\nexport function VideoRichContent({ videoData, width, height }: VideoRichContentProps) {\n const getVideoUrl = (): string => {\n switch (videoData.type) {\n case 're.notifica.content.YouTube':\n return `https://www.youtube.com/embed/${videoData.data}`;\n\n case 're.notifica.content.Vimeo':\n return `https://player.vimeo.com/video/${videoData.data}`;\n\n case 're.notifica.content.HTML5Video':\n return videoData.data;\n\n default:\n return '';\n }\n };\n\n if (\n videoData.type === 're.notifica.content.YouTube' ||\n videoData.type === 're.notifica.content.Vimeo'\n ) {\n return (\n <iframe\n className=\"notificare__push__video-rich-content\"\n src={getVideoUrl()}\n sandbox=\"allow-scripts allow-same-origin\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n width={width}\n height={height}\n />\n );\n } else {\n return (\n <video\n className=\"notificare__push__video-rich-content\"\n width={width}\n height={height}\n autoPlay\n controls\n >\n <source src={getVideoUrl()} type=\"video/mp4\" />\n </video>\n );\n }\n}\n\nexport interface VideoRichContentProps {\n videoData: Extract<\n VerifiedNotification,\n { type: 're.notifica.notification.Video' }\n >['content'][number];\n width: string;\n height: string;\n}\n","import { VideoRichContent } from '~/internal/components/push/platforms/shared/VideoRichContent/VideoRichContent';\nimport { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasActions } from '~/internal/utils/push-previews/notification';\nimport { NavigationBar } from '../NavigationBar/NavigationBar';\n\nimport './VideoNotification.css';\n\nexport function VideoNotification({ notification }: VideoNotificationProps) {\n const application = useApplication();\n\n return (\n <div data-testid=\"android-app-ui-video-notification\">\n <NavigationBar\n title={notification.title || application.name}\n showOptions={hasActions(notification)}\n />\n <VideoRichContent videoData={notification.content[0]} width=\"100%\" height=\"570px\" />\n </div>\n );\n}\n\nexport interface VideoNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Video' }>;\n}\n","import { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport {\n hasActions,\n markupContainsNotificareOpenActionQueryParameter,\n} from '~/internal/utils/push-previews/notification';\nimport { NavigationBar } from '../NavigationBar/NavigationBar';\n\nimport './WebViewNotification.css';\n\nexport function WebViewNotification({ notification }: WebViewNotificationProps) {\n const application = useApplication();\n const html = notification.content[0].data;\n\n return (\n <div data-testid=\"android-app-ui-web-view-notification\">\n <NavigationBar\n title={notification.title || application.name}\n showOptions={\n hasActions(notification) && !markupContainsNotificareOpenActionQueryParameter(html)\n }\n />\n\n <iframe\n className=\"notificare__push__android__web-view__app-ui__content\"\n srcDoc={html}\n sandbox=\"allow-same-origin\"\n />\n </div>\n );\n}\n\nexport interface WebViewNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.WebView' }>;\n}\n","import { FormattedMessage } from 'react-intl';\nimport DefaultAppIcon from '~/assets/default-app-icon.svg';\nimport { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasFirstAttachment } from '~/internal/utils/push-previews/notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './LockScreenNotification.css';\n\nexport function LockScreenNotification({ notification, expanded }: AndroidLockScreenPushProps) {\n const application = useApplication();\n\n return (\n <div\n className=\"notificare__push__android__lock-screen\"\n data-testid=\"android-lock-screen-notification\"\n >\n <div className=\"notificare__push__android__lock-screen__app-icon\">\n {application.icon ? (\n <img\n className=\"notificare__push__android__lock-screen__app-icon-image\"\n alt=\"App icon\"\n src={application.icon}\n />\n ) : (\n <DefaultAppIcon className=\"notificare__push__android__lock-screen__default-app-icon\" />\n )}\n </div>\n <div className=\"notificare__push__android__lock-screen__text-content\">\n <div\n className={`notificare__push__android__lock-screen__text-content-top ${hasFirstAttachment(notification) && !expanded ? 'notificare__push__android__lock-screen__text-content-top--has-media' : ''}`}\n >\n <div className=\"notificare__push__android__lock-screen__title-and-subtitle\">\n <p className=\"notificare__push__android__lock-screen__text notificare__push__android__lock-screen__text--title\">\n {!expanded ? notification.title || application.name : application.name}\n </p>\n {notification.subtitle && !hasFirstAttachment(notification) && (\n <p className=\"notificare__push__android__lock-screen__text notificare__push__android__lock-screen__text--subtitle\">\n {notification.subtitle}\n </p>\n )}\n </div>\n <p className=\"notificare__push__android__lock-screen__text notificare__push__android__lock-screen__text--time\">\n <FormattedMessage\n id=\"preview.android.lockscreen.time\"\n defaultMessage={PUSH_TRANSLATIONS['preview.android.lockscreen.time']}\n />\n </p>\n </div>\n\n {expanded && (\n <p className=\"notificare__push__android__lock-screen__text notificare__push__android__lock-screen__text--expanded-title\">\n {notification.title}\n </p>\n )}\n\n <p\n className={`notificare__push__android__lock-screen__text ${expanded ? 'notificare__push__android__lock-screen__text--expanded-message' : ''} ${hasFirstAttachment(notification) && !expanded ? 'notificare__push__android__lock-screen__text--message-with-media' : 'notificare__push__android__lock-screen__text--message-without-media'}`}\n >\n {notification.message}\n </p>\n\n {hasFirstAttachment(notification) && expanded && (\n <img\n className=\"notificare__push__android__lock-screen__expanded-media\"\n src={notification.attachments?.[0].uri}\n alt=\"Expanded media\"\n data-testid=\"android-lock-screen-notification-expanded-media\"\n />\n )}\n </div>\n\n {hasFirstAttachment(notification) && !expanded && (\n <img\n className=\"notificare__push__android__lock-screen__media\"\n src={notification.attachments?.[0].uri}\n alt=\"Media icon\"\n data-testid=\"android-lock-screen-notification-media\"\n />\n )}\n </div>\n );\n}\n\nexport interface AndroidLockScreenPushProps {\n notification: VerifiedNotification;\n expanded: boolean;\n}\n","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport {\n NotificationPreviewDisplayMode,\n NotificationPreviewStateMobile,\n} from '~/internal/components/push/notification-preview-state';\nimport { URLResolverNotification } from '~/internal/components/push/platforms/android/app-ui/URLResolverNotification/URLResolverNotification';\nimport { AndroidPhoneBackground } from '~/internal/components/shared/AndroidPhoneBackground/AndroidPhoneBackground';\nimport { VerifiedNotification, NotificationType } from '~/internal/schemas/notificare-notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { AppRecommendationNotification } from './app-ui/AppRecommendationNotification/AppRecommendationNotification';\nimport { DigitalCardNotification } from './app-ui/DigitalCardNotification/DigitalCardNotification';\nimport { ImagesNotification } from './app-ui/ImagesNotification/ImagesNotification';\nimport { InAppBrowserNotification } from './app-ui/InAppBrowserNotification/InAppBrowserNotification';\nimport { MapNotification } from './app-ui/MapNotification/MapNotification';\nimport { RateNotification } from './app-ui/RateNotification/RateNotification';\nimport { TextAlertNotification } from './app-ui/TextAlertNotification/TextAlertNotification';\nimport { URLNotification } from './app-ui/URLNotification/URLNotification';\nimport { VideoNotification } from './app-ui/VideoNotification/VideoNotification';\nimport { WebViewNotification } from './app-ui/WebViewNotification/WebViewNotification';\nimport { LockScreenNotification } from './lock-screen/LockScreenNotification';\n\nimport './NotificationAndroidPreview.css';\n\nexport function NotificationAndroidPreview({\n notification,\n previewState,\n onError,\n}: NotificationAndroidPreviewProps) {\n const intl = useIntl();\n\n useEffect(\n function handleInvalidPreviewError() {\n if (!isValidPreviewType(notification.type, previewState.displayMode)) {\n onError(\n intl.formatMessage(\n {\n id: 'preview.error.notSupportedNotificationTypePreviewVariant',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedNotificationTypePreviewVariant'],\n },\n { notificationType: notification.type },\n ),\n );\n }\n },\n [previewState, notification.type],\n );\n\n if (!isValidPreviewType(notification.type, previewState.displayMode)) {\n return undefined;\n }\n\n return (\n <AndroidPhoneBackground theme={getTheme(notification.type, previewState.displayMode)}>\n <div className=\"notificare__push__android__preview\">\n {(() => {\n switch (previewState.displayMode) {\n case 'lockscreen':\n case 'lockscreen-expanded':\n return (\n <LockScreenNotification\n notification={notification}\n expanded={previewState.displayMode === 'lockscreen-expanded'}\n />\n );\n\n case 'app-ui':\n switch (notification.type) {\n case 're.notifica.notification.Alert':\n return <TextAlertNotification notification={notification} />;\n\n case 're.notifica.notification.WebView':\n return <WebViewNotification notification={notification} />;\n\n case 're.notifica.notification.URL':\n return <URLNotification notification={notification} />;\n\n case 're.notifica.notification.InAppBrowser':\n return <InAppBrowserNotification notification={notification} />;\n\n case 're.notifica.notification.Image':\n return <ImagesNotification notification={notification} />;\n\n case 're.notifica.notification.Map':\n return <MapNotification notification={notification} onError={onError} />;\n\n case 're.notifica.notification.Rate':\n return <RateNotification notification={notification} />;\n\n case 're.notifica.notification.Passbook':\n return <DigitalCardNotification notification={notification} />;\n\n case 're.notifica.notification.Video':\n return <VideoNotification notification={notification} />;\n\n case 're.notifica.notification.Store':\n return <AppRecommendationNotification notification={notification} />;\n\n case 're.notifica.notification.URLResolver':\n return (\n <URLResolverNotification notification={notification} onError={onError} />\n );\n }\n }\n })()}\n </div>\n </AndroidPhoneBackground>\n );\n}\n\nexport interface NotificationAndroidPreviewProps {\n notification: VerifiedNotification;\n previewState: NotificationPreviewStateMobile;\n onError: (message: string) => void;\n}\n\nfunction getTheme(notificationType: NotificationType, displayMode: NotificationPreviewDisplayMode) {\n switch (displayMode) {\n case 'app-ui':\n switch (notificationType) {\n case 're.notifica.notification.Alert':\n return 'dark';\n\n default:\n return 'light';\n }\n\n default:\n return 'light';\n }\n}\n\nfunction isValidPreviewType(\n notificationType: NotificationType,\n displayMode: NotificationPreviewDisplayMode,\n) {\n switch (displayMode) {\n case 'app-ui':\n switch (notificationType) {\n case 're.notifica.notification.Alert':\n case 're.notifica.notification.WebView':\n case 're.notifica.notification.URL':\n case 're.notifica.notification.InAppBrowser':\n case 're.notifica.notification.Image':\n case 're.notifica.notification.Map':\n case 're.notifica.notification.Rate':\n case 're.notifica.notification.Passbook':\n case 're.notifica.notification.Video':\n case 're.notifica.notification.Store':\n case 're.notifica.notification.URLResolver':\n return true;\n default:\n return false;\n }\n\n default:\n return true;\n }\n}\n","import { FormattedMessage } from 'react-intl';\nimport LockerIcon from '~/assets/locker.svg';\nimport { getTopLevelDomain, isSecureUrl } from '~/internal/utils/url';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './InAppBrowserBar.css';\n\nexport function InAppBrowserBar(props: InAppBrowserBarProps) {\n const { url } = props;\n\n return (\n <div className=\"notificare__push__ios__in-app-browser__app-ui__bar\">\n <p className=\"notificare__push__ios__in-app-browser__app-ui__bar-done-button\">\n <FormattedMessage\n id=\"preview.ios.inAppBrowser.appUi.done\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.inAppBrowser.appUi.done']}\n />\n </p>\n <div className=\"notificare__push__ios__in-app-browser__app-ui__bar-domain\">\n {isSecureUrl(url) ? (\n <LockerIcon className=\"notificare__push__ios__in-app-browser__app-ui__bar-lock-icon\" />\n ) : (\n <p className=\"notificare__push__ios__in-app-browser__app-ui__bar-not-secure\">\n <FormattedMessage\n id=\"preview.ios.inAppBrowser.appUi.notSecure\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.inAppBrowser.appUi.notSecure']}\n />\n </p>\n )}\n\n <p className=\"notificare__push__ios__in-app-browser__app-ui__bar-url\">\n {getTopLevelDomain(url)}\n </p>\n </div>\n </div>\n );\n}\n\nexport interface InAppBrowserBarProps {\n url: string;\n}\n","import { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { InAppBrowserBar } from './InAppBrowserBar/InAppBrowserBar';\n\nimport './InAppBrowserNotification.css';\n\nexport function InAppBrowserNotification({ notification }: URLNotificationProps) {\n const url = notification.content[0].data;\n\n return (\n <div data-testid=\"ios-app-ui-in-app-browser-notification\">\n <InAppBrowserBar url={url} />\n <Webshot url={url} platform=\"iOS\" width={338} height={564} />\n </div>\n );\n}\n\nexport interface URLNotificationProps {\n notification: Extract<\n VerifiedNotification,\n { type: 're.notifica.notification.InAppBrowser' | 're.notifica.notification.URLResolver' }\n >;\n}\n","import OptionsIcon from '~/assets/options.svg';\n\nimport './TitleBar.css';\n\nexport function TitleBar({ title, showOptions }: TitleBarProps) {\n return (\n <div className=\"notificare__push__ios__app-ui__title-bar\">\n <div className=\"notificare__push__ios__app-ui__title-bar-text\">{title}</div>\n\n {showOptions && (\n <OptionsIcon\n className=\"notificare__push__ios__app-ui__title-bar-options-button\"\n data-testid=\"ios-app-ui-title-bar-options-button\"\n />\n )}\n </div>\n );\n}\n\nexport interface TitleBarProps {\n title: string;\n showOptions: boolean;\n}\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 576 512\"\n>\n <path d=\"M264.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 149.8C37.4 145.8 32 137.3 32 128s5.4-17.9 13.9-21.8L264.5 5.2zM476.9 209.6l53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 277.8C37.4 273.8 32 265.3 32 256s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0l152-70.2zm-152 198.2l152-70.2 53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 405.8C37.4 401.8 32 393.3 32 384s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0z\" />\n</svg>","import { useEffect, useState } from 'react';\nimport { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { useApplication } from '~/internal/context/application';\nimport { useOptions } from '~/internal/context/options';\nimport { fetchWebsiteMarkup } from '~/internal/network/requests/website-markup';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport {\n hasActions,\n markupContainsNotificareOpenActionQueryParameter,\n} from '~/internal/utils/push-previews/notification';\nimport { TitleBar } from '../TitleBar/TitleBar';\n\nimport './URLNotification.css';\n\nexport function URLNotification({ notification }: URLNotificationProps) {\n const url = notification.content[0].data;\n const application = useApplication();\n\n const [websiteMarkup, setWebsiteMarkup] = useState('');\n\n const { serviceKey } = useOptions();\n\n useEffect(function loadWebsiteMarkup() {\n (async () => {\n try {\n const response = await fetchWebsiteMarkup(serviceKey, url);\n setWebsiteMarkup(response);\n } catch (error) {\n console.error('Error fetching website markup:\\n\\n', error);\n }\n })();\n }, []);\n\n return (\n <div data-testid=\"ios-app-ui-url-notification\">\n <TitleBar\n title={notification.title || application.name}\n showOptions={\n hasActions(notification) &&\n !markupContainsNotificareOpenActionQueryParameter(websiteMarkup)\n }\n />\n <Webshot url={url} platform=\"iOS\" width={338} height={566} />\n </div>\n );\n}\n\nexport interface URLNotificationProps {\n notification: Extract<\n VerifiedNotification,\n { type: 're.notifica.notification.URL' | 're.notifica.notification.URLResolver' }\n >;\n}\n","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport { InAppBrowserNotification } from '~/internal/components/push/platforms/ios/app-ui/InAppBrowserNotification/InAppBrowserNotification';\nimport { URLNotification } from '~/internal/components/push/platforms/ios/app-ui/URLNotification/URLNotification';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { getUrlResolverPreviewTypeByUrl } from '~/internal/utils/url-resolver';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nexport function URLResolverNotification({ notification, onError }: URLNotificationProps) {\n const intl = useIntl();\n\n const url = notification.content[0].data;\n\n const urlResolverResult = getUrlResolverPreviewTypeByUrl(url);\n\n useEffect(\n function handleUrlResolverError() {\n switch (urlResolverResult) {\n case 'invalid-url':\n onError(\n intl.formatMessage({\n id: 'preview.error.urlResolverInvalidUrl',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.urlResolverInvalidUrl'],\n }),\n );\n break;\n\n case 'url-scheme':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedUrlResolverWithUrlSchemePreview',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedUrlResolverWithUrlSchemePreview'],\n }),\n );\n break;\n\n case 'dynamic-link':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedUrlResolverWithDynamicLink',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedUrlResolverWithDynamicLink'],\n }),\n );\n break;\n\n case 'relative-url':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedUrlResolverWithRelativeUrl',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedUrlResolverWithRelativeUrl'],\n }),\n );\n break;\n }\n },\n [url],\n );\n\n switch (urlResolverResult) {\n case 'invalid-url':\n case 'url-scheme':\n case 'dynamic-link':\n case 'relative-url':\n return undefined;\n\n case 'web-view':\n return <URLNotification notification={notification} />;\n\n case 'in-app-browser':\n return <InAppBrowserNotification notification={notification} />;\n }\n}\n\nexport interface URLNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.URLResolver' }>;\n onError: (message: string) => void;\n}\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n>\n <path d=\"M399 384.2C376.9 345.8 335.4 320 288 320l-64 0c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z\" />\n</svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path d=\"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z\" />\n</svg>","import { useEffect, useState } from 'react';\nimport { useIntl } from 'react-intl';\nimport { fetchIosStoreApp } from '~/internal/components/push/platforms/ios/app-ui/AppRecommendationNotification/requests/ios-store-app';\nimport { IosStoreAppData } from '~/internal/components/push/platforms/ios/app-ui/AppRecommendationNotification/types/ios-store-app';\nimport { useDebounce } from '~/internal/hooks';\nimport { RequestState } from '~/internal/network/state';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nexport function useStoreRequest(props: UseStoreRequestProps): StoreState {\n const { contentList } = useDebounce(props, 500);\n\n const intl = useIntl();\n const [state, setState] = useState<StoreState>({ status: 'idle' });\n\n useEffect(\n function loadAppData() {\n (async () => {\n const appId = getAppId(contentList);\n\n if (!appId) {\n setState({\n status: 'error',\n error: new Error(\n intl.formatMessage({\n id: 'preview.error.noValidContentObject',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.noValidContentObject'],\n }),\n ),\n });\n return;\n }\n\n setState({ status: 'loading' });\n\n fetchIosStoreApp(appId)\n .then((app) => {\n if (app.resultCount === 0) {\n setState({\n status: 'error',\n error: new Error(\n intl.formatMessage({\n id: 'preview.error.iosStoreAppNotFound',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.iosStoreAppNotFound'],\n }),\n ),\n });\n return;\n }\n\n setState({ status: 'success', data: app.results[0] });\n })\n .catch((error) => {\n console.error('Error getting App Store app:\\n\\n' + error);\n\n setState({\n status: 'error',\n error: new Error(\n intl.formatMessage({\n id: 'preview.error.iosStoreAppLoadFailure',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.iosStoreAppLoadFailure'],\n }),\n ),\n });\n });\n })();\n },\n [contentList],\n );\n\n return state;\n}\n\nexport type UseStoreRequestProps = {\n contentList: Extract<VerifiedNotification, { type: 're.notifica.notification.Store' }>['content'];\n};\n\nexport type StoreState = RequestState<IosStoreAppData>;\n\nfunction getAppId(\n contentList: Extract<VerifiedNotification, { type: 're.notifica.notification.Store' }>['content'],\n) {\n for (const content of contentList) {\n if (content.type === 're.notifica.content.AppStore') {\n return content.data.identifier;\n }\n }\n\n return null;\n}\n","import { IosStoreApp } from '~/internal/components/push/platforms/ios/app-ui/AppRecommendationNotification/types/ios-store-app';\nimport { NetworkRequestError } from '~/internal/network/errors';\n\nexport async function fetchIosStoreApp(appId: string): Promise<IosStoreApp> {\n const url = new URL('/lookup', 'https://itunes.apple.com');\n url.searchParams.set('country', 'NL');\n url.searchParams.set('id', appId);\n\n const timestamp = (Date.now() / 1000).toString();\n url.searchParams.set('x', timestamp);\n\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new NetworkRequestError(response);\n }\n\n return await response.json();\n}\n","export function timeAgo(isoDate: string, locale: string) {\n const rtf = new Intl.RelativeTimeFormat(locale, { style: 'long' });\n\n const date = new Date(isoDate);\n const now = new Date();\n const diffInSeconds = Math.floor((now.getTime() - date.getTime()) / 1000);\n\n const intervals: { value: number; unit: Intl.RelativeTimeFormatUnit }[] = [\n { value: 60, unit: 'second' },\n { value: 60 * 60, unit: 'minute' },\n { value: 60 * 60 * 24, unit: 'hour' },\n { value: 60 * 60 * 24 * 7, unit: 'day' },\n { value: 60 * 60 * 24 * 30, unit: 'week' },\n { value: 60 * 60 * 24 * 365, unit: 'month' },\n ];\n\n for (let i = 0; i < intervals.length; i++) {\n const { value, unit } = intervals[i];\n\n if (diffInSeconds < value) {\n const count = Math.floor(diffInSeconds / (intervals[i - 1]?.value || 1));\n return rtf.format(-count, unit);\n }\n }\n\n const count = Math.floor(diffInSeconds / intervals[intervals.length - 1].value);\n return rtf.format(-count, 'year');\n}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <defs>\n <linearGradient id=\"halfGrad\">\n <stop offset=\"50%\" stop-color=\"#000\" />\n <stop offset=\"50%\" stop-color=\"#ccc\" />\n </linearGradient>\n </defs>\n <path\n fill=\"url(#halfGrad)\"\n d=\"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z\"\n />\n</svg>","import FullStar from '~/assets/full-star.svg';\nimport HalfStar from '~/assets/half-star.svg';\n\nimport './StarRating.css';\n\nexport function StarRating(props: StarRatingProps) {\n const { rating } = props;\n\n const totalStars = 5;\n const stars = [];\n\n for (let i = 1; i <= totalStars; i++) {\n if (i <= rating) {\n stars.push(<FullStar key={i} className=\"notificare__push__ios__store__app-ui__star-icon\" />);\n } else if (i - 0.5 <= rating) {\n stars.push(<HalfStar key={i} className=\"notificare__push__ios__store__app-ui__star-icon\" />);\n } else {\n stars.push(\n <FullStar\n key={i}\n className=\"notificare__push__ios__store__app-ui__star-icon notificare__push__ios__store__app-ui__star-icon--empty\"\n />,\n );\n }\n }\n\n return <div className=\"notificare__push__ios__store__app-ui__star-rating\">{stars}</div>;\n}\n\nexport type StarRatingProps = {\n rating: number;\n};\n","import { FormattedMessage, useIntl } from 'react-intl';\nimport LayerGroupIcon from '~/assets/layer-group.svg';\nimport UserIcon from '~/assets/user.svg';\nimport { useStoreRequest } from '~/internal/components/push/platforms/ios/app-ui/AppRecommendationNotification/hooks';\nimport { Loading } from '~/internal/components/shared/Loading/Loading';\nimport { PreviewError } from '~/internal/components/shared/PreviewError/PreviewError';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { timeAgo } from '~/internal/utils/time-ago';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { StarRating } from './StarRating/StarRating';\n\nimport './AppRecommendationNotification.css';\n\nexport function AppRecommendationNotification({\n notification,\n}: AppRecommendationNotificationProps) {\n const contentList = notification.content;\n\n const intl = useIntl();\n const state = useStoreRequest({ contentList });\n\n return (\n <div data-testid=\"ios-app-ui-app-recommendation-notification\">\n <div className=\"notificare__push__ios__store__app-ui__bar\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.done\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.done']}\n />\n </div>\n <div className=\"notificare__push__ios__store__app-ui\">\n {state.status === 'loading' && <Loading />}\n\n {state.status === 'error' && <PreviewError message={state.error.message} />}\n\n {state.status === 'success' && (\n <div className=\"notificare__push__ios__store__app-ui__page\">\n <div className=\"notificare__push__ios__store__app-ui__page-header\">\n <img\n src={state.data.artworkUrl512}\n className=\"notificare__push__ios__store__app-ui__app-icon\"\n alt=\"App icon\"\n />\n <div className=\"notificare__push__ios__store__app-ui__page-app-info\">\n <div>\n <p className=\"notificare__push__ios__store__app-ui__page-app-name\">\n {state.data.trackName}\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-app-category\">\n {state.data.primaryGenreName}\n </p>\n </div>\n <div className=\"notificare__push__ios__store__app-ui__page-install\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.install\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.install']}\n />\n </div>\n </div>\n </div>\n\n <div className=\"notificare__push__ios__store__app-ui__page-other-app-info-wrapper\">\n <div className=\"notificare__push__ios__store__app-ui__page-other-app-info\">\n <div className=\"notificare__push__ios__store__app-ui__page-info-block\">\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-title\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.ratings\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.ratings']}\n values={{ userRatingCount: state.data.userRatingCount }}\n />\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-value\">\n {state.data.averageUserRating.toFixed(1)}\n </p>\n\n <StarRating rating={state.data.averageUserRating} />\n </div>\n\n <div className=\"notificare__push__ios__store__app-ui__page-info-block\">\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-title\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.age\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.age']}\n />\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-value\">\n {state.data.trackContentRating}\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-bottom-text\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.yearsOld\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.yearsOld']}\n />\n </p>\n </div>\n <div className=\"notificare__push__ios__store__app-ui__page-info-block\">\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-title\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.category\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.category']}\n />\n </p>\n <LayerGroupIcon className=\"notificare__push__ios__store__app-ui__page-info-block-icon\" />\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-bottom-text\">\n {state.data.primaryGenreName}\n </p>\n </div>\n <div className=\"notificare__push__ios__store__app-ui__page-info-block\">\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-title\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.developer\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.developer']}\n />\n </p>\n <UserIcon className=\"notificare__push__ios__store__app-ui__page-info-block-icon\" />\n <p className=\"notificare__push__ios__store__app-ui__page-info-block-bottom-text\">\n {state.data.sellerName}\n </p>\n </div>\n </div>\n </div>\n\n <div className=\"notificare__push__ios__store__app-ui__page-history\">\n <p className=\"notificare__push__ios__store__app-ui__page-history-title\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.whatsNew\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.whatsNew']}\n />\n </p>\n <div className=\"notificare__push__ios__store__app-ui__page-history-version-last-update\">\n <p className=\"notificare__push__ios__store__app-ui__page-history-version\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.historyVersion\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.historyVersion']}\n values={{ version: state.data.version }}\n />\n </p>\n <p className=\"notificare__push__ios__store__app-ui__page-history-last-update\">\n {timeAgo(state.data.currentVersionReleaseDate, intl.locale)}\n </p>\n </div>\n <p className=\"notificare__push__ios__store__app-ui__page-history-notes\">\n {state.data.releaseNotes}\n </p>\n </div>\n\n <div className=\"notificare__push__ios__store__app-ui__page-previews\">\n <p className=\"notificare__push__ios__store__app-ui__page-previews-title\">\n <FormattedMessage\n id=\"preview.ios.store.appUi.screenshots\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.store.appUi.screenshots']}\n />\n </p>\n <div className=\"notificare__push__ios__store__app-ui__page-previews-images\">\n <img\n src={state.data.screenshotUrls[0]}\n className=\"notificare__push__ios__store__app-ui__page-preview-image\"\n alt=\"App preview\"\n />\n <img\n src={state.data.screenshotUrls[1]}\n className=\"notificare__push__ios__store__app-ui__page-preview-image\"\n alt=\"App preview\"\n />\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n\nexport interface AppRecommendationNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Store' }>;\n}\n","import { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { useApplication } from '~/internal/context/application';\nimport { getPushAPIHost } from '~/internal/network/api';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasActions } from '~/internal/utils/push-previews/notification';\nimport { TitleBar } from '../TitleBar/TitleBar';\n\nimport './DigitalCardNotification.css';\n\nexport function DigitalCardNotification({ notification }: DigitalCardNotificationProps) {\n const application = useApplication();\n\n return (\n <div data-testid=\"ios-app-ui-passbook-notification\">\n <TitleBar\n title={notification.title || application.name}\n showOptions={hasActions(notification)}\n />\n\n <Webshot\n url={`${getPushAPIHost()}/pass/web/${notification.content[0].data.split('/')[5]}`}\n platform=\"Web\"\n width={338}\n height={566}\n />\n </div>\n );\n}\n\nexport interface DigitalCardNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Passbook' }>;\n}\n","import { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasActions } from '~/internal/utils/push-previews/notification';\nimport { TitleBar } from '../TitleBar/TitleBar';\n\nimport './ImagesNotification.css';\n\nexport function ImagesNotification({ notification }: ImagesNotificationProps) {\n const application = useApplication();\n\n return (\n <div data-testid=\"ios-app-ui-images-notification\">\n <TitleBar\n title={notification.title || application.name}\n showOptions={hasActions(notification)}\n />\n <div className=\"notificare__push__ios__image__app-ui__rich-content\">\n <div className=\"notificare__push__ios__image__app-ui__slider\">\n {notification.content.map((image, index) => (\n <img\n key={index}\n className=\"notificare__push__ios__image__app-ui__slider-item\"\n src={image.data}\n alt=\"Slider image\"\n />\n ))}\n </div>\n </div>\n </div>\n );\n}\n\nexport interface ImagesNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Image' }>;\n}\n","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport { MapRichContent } from '~/internal/components/push/platforms/shared/MapRichContent/MapRichContent';\nimport { useApplication } from '~/internal/context/application';\nimport { useOptions } from '~/internal/context/options';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasActions } from '~/internal/utils/push-previews/notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { TitleBar } from '../TitleBar/TitleBar';\n\nimport './MapNotification.css';\n\nexport function MapNotification({ notification, onError }: MapNotificationProps) {\n const application = useApplication();\n const { googleMapsAPIKey } = useOptions();\n const intl = useIntl();\n\n useEffect(\n function handleMissingGoogleMapsApiKey() {\n if (!googleMapsAPIKey) {\n onError(\n intl.formatMessage({\n id: 'preview.error.provideGoogleMapsApiKey',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.provideGoogleMapsApiKey'],\n }),\n );\n }\n },\n [googleMapsAPIKey],\n );\n\n if (!googleMapsAPIKey) {\n return undefined;\n }\n\n return (\n <div data-testid=\"ios-app-ui-map-notification\">\n <TitleBar\n title={notification.title || application.name}\n showOptions={hasActions(notification)}\n />\n <MapRichContent notification={notification} width=\"100%\" height=\"566px\" />\n </div>\n );\n}\n\nexport interface MapNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Map' }>;\n onError: (message: string) => void;\n}\n","import { FormattedMessage } from 'react-intl';\nimport { useApplication } from '~/internal/context/application';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './RateNotification.css';\n\nexport function RateNotification({ title }: RateAppNotificationProps) {\n const application = useApplication();\n\n return (\n <div className=\"notificare__push__ios__rate__app-ui\" data-testid=\"ios-app-ui-rate-notification\">\n <div className=\"notificare__push__ios__rate__app-ui__wrapper\">\n <p className=\"notificare__push__ios__rate__app-ui__header\">{title || application.name}</p>\n <div className=\"notificare__push__ios__rate__app-ui__action\">\n <FormattedMessage\n id=\"preview.ios.rate.appUi.rateNow\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.rate.appUi.rateNow']}\n />\n </div>\n <div className=\"notificare__push__ios__rate__app-ui__action\">\n <FormattedMessage\n id=\"preview.ios.rate.appUi.doNotRate\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.rate.appUi.doNotRate']}\n />\n </div>\n </div>\n </div>\n );\n}\n\nexport interface RateAppNotificationProps {\n title: string | undefined;\n}\n","import { FormattedMessage } from 'react-intl';\nimport { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasSingleAction, hasMultipleActions } from '~/internal/utils/push-previews/notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './TextAlertNotification.css';\n\nexport function TextAlertNotification({ notification }: TextAlertNotificationProps) {\n const application = useApplication();\n\n return (\n <div\n className=\"notificare__push__ios__alert__app-ui\"\n data-testid=\"ios-app-ui-text-alert-notification\"\n >\n <div className=\"notificare__push__ios__alert__app-ui__background\">\n <div className=\"notificare__push__ios__alert__app-ui__title-and-message\">\n <p className=\"notificare__push__ios__alert__app-ui__title\">\n {notification.title || application.name}\n </p>\n <p className=\"notificare__push__ios__alert__app-ui__message\">{notification.message}</p>\n </div>\n <div className=\"notificare__push__ios__alert__app-ui__actions\">\n {hasSingleAction(notification) ? (\n <div className=\"notificare__push__ios__alert__app-ui__actions-single\">\n <div className=\"notificare__push__ios__alert__app-ui__single-cancel\">\n <FormattedMessage\n id=\"preview.ios.alert.appUi.cancel\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.alert.appUi.cancel']}\n />\n </div>\n <div\n className=\"notificare__push__ios__alert__app-ui__action notificare__push__ios__alert__app-ui__action--single\"\n data-testid=\"ios-app-ui-text-alert-notification-single-action\"\n >\n {notification.actions?.[0].label}\n </div>\n </div>\n ) : hasMultipleActions(notification) ? (\n <div className=\"notificare__push__ios__alert__app-ui__actions-multiple\">\n {notification.actions?.map((action, index) => (\n <div\n key={index}\n className=\"notificare__push__ios__alert__app-ui__action notificare__push__ios__alert__app-ui__action--multiple\"\n data-testid={`ios-app-ui-text-alert-notification-action-${index}`}\n >\n {action.label}\n </div>\n ))}\n <div className=\"notificare__push__ios__alert__app-ui__multiple-cancel\">\n <FormattedMessage\n id=\"preview.ios.alert.appUi.cancel\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.alert.appUi.cancel']}\n />\n </div>\n </div>\n ) : (\n <div className=\"notificare__push__ios__alert__app-ui__no-actions\">\n <FormattedMessage\n id=\"preview.ios.alert.appUi.ok\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.alert.appUi.ok']}\n />\n </div>\n )}\n </div>\n </div>\n </div>\n );\n}\n\nexport interface TextAlertNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Alert' }>;\n}\n","import { VideoRichContent } from '~/internal/components/push/platforms/shared/VideoRichContent/VideoRichContent';\nimport { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasActions } from '~/internal/utils/push-previews/notification';\nimport { TitleBar } from '../TitleBar/TitleBar';\n\nimport './VideoNotification.css';\n\nexport function VideoNotification({ notification }: VideoNotificationProps) {\n const videoData = notification.content[0];\n const application = useApplication();\n\n return (\n <div data-testid=\"ios-app-ui-video-notification\">\n <TitleBar\n title={notification.title || application.name}\n showOptions={hasActions(notification)}\n />\n <VideoRichContent videoData={videoData} width=\"100%\" height=\"566px\" />\n </div>\n );\n}\n\nexport interface VideoNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Video' }>;\n}\n","import { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport {\n hasActions,\n markupContainsNotificareOpenActionQueryParameter,\n} from '~/internal/utils/push-previews/notification';\nimport { TitleBar } from '../TitleBar/TitleBar';\n\nimport './WebViewNotification.css';\n\nexport function WebViewNotification({ notification }: WebViewNotificationProps) {\n const html = notification.content[0].data;\n const application = useApplication();\n\n return (\n <div data-testid=\"ios-app-ui-web-view-notification\">\n <TitleBar\n title={notification.title || application.name}\n showOptions={\n hasActions(notification) && !markupContainsNotificareOpenActionQueryParameter(html)\n }\n />\n <iframe\n className=\"notificare__push__ios__web-view__app-ui__content\"\n srcDoc={html}\n sandbox=\"allow-same-origin\"\n />\n </div>\n );\n}\n\nexport interface WebViewNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.WebView' }>;\n}\n","import { FormattedMessage } from 'react-intl';\nimport DefaultAppIcon from '~/assets/default-app-icon.svg';\nimport { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasFirstAttachment } from '~/internal/utils/push-previews/notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport './LockScreenNotification.css';\n\nexport function LockScreenNotification({ notification, expanded }: IOSLockScreenPushProps) {\n const application = useApplication();\n\n return (\n <div className=\"notificare__push__ios__lock-screen\" data-testid=\"ios-lock-screen-notification\">\n <div className=\"notificare__push__ios__lock-screen__main-content\">\n <div className=\"notificare__push__ios__lock-screen__app-icon\">\n {application.icon ? (\n <img\n className=\"notificare__push__ios__lock-screen__app-icon-image\"\n alt=\"App icon\"\n src={application.icon}\n />\n ) : (\n <DefaultAppIcon className=\"notificare__push__ios__lock-screen__default-app-icon\" />\n )}\n </div>\n <div className=\"notificare__push__ios__lock-screen__text-content\">\n <div className=\"notificare__push__ios__lock-screen__title-and-time\">\n <p\n className={`notificare__push__ios__lock-screen__text ${!expanded ? 'notificare__push__ios__lock-screen__text--title-or-subtitle' : 'notificare__push__ios__lock-screen__text--expanded-title-or-subtitle'}`}\n >\n {notification.title || application.name}\n </p>\n\n <p className=\"notificare__push__ios__lock-screen__text notificare__push__ios__lock-screen__text--time\">\n <FormattedMessage\n id=\"preview.ios.lockScreen.time\"\n defaultMessage={PUSH_TRANSLATIONS['preview.ios.lockScreen.time']}\n />\n </p>\n </div>\n\n {notification.subtitle && (\n <p\n className={`notificare__push__ios__lock-screen__text ${!expanded ? 'notificare__push__ios__lock-screen__text--title-or-subtitle' : 'notificare__push__ios__lock-screen__text--expanded-title-or-subtitle'}`}\n >\n {notification.subtitle}\n </p>\n )}\n\n <div className=\"notificare__push__ios__lock-screen__message-and-media\">\n <p\n className={`notificare__push__ios__lock-screen__text ${hasFirstAttachment(notification) && !expanded ? 'notificare__push__ios__lock-screen__text--message-with-media' : 'notificare__push__ios__lock-screen__text--message-without-media'}`}\n >\n {notification.message}\n </p>\n\n {hasFirstAttachment(notification) && !expanded && (\n <img\n className=\"notificare__push__ios__lock-screen__media-image\"\n src={notification.attachments?.[0].uri}\n alt=\"Media icon\"\n data-testid=\"ios-lock-screen-notification-media\"\n />\n )}\n </div>\n </div>\n </div>\n {hasFirstAttachment(notification) && expanded && (\n <img\n className=\"notificare__push__ios__lock-screen__expanded-media\"\n src={notification.attachments?.[0].uri}\n alt=\"Media icon\"\n data-testid=\"ios-lock-screen-notification-expanded-media\"\n />\n )}\n </div>\n );\n}\n\nexport interface IOSLockScreenPushProps {\n notification: VerifiedNotification;\n expanded: boolean;\n}\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 48 48\"\n>\n <path d=\"m12.45 37.65-2.1-2.1L21.9 24 10.35 12.45l2.1-2.1L24 21.9l11.55-11.55 2.1 2.1L26.1 24l11.55 11.55-2.1 2.1L24 26.1Z\" />\n</svg>","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport {\n NotificationPreviewDisplayMode,\n NotificationPreviewStateMobile,\n} from '~/internal/components/push/notification-preview-state';\nimport { URLResolverNotification } from '~/internal/components/push/platforms/ios/app-ui/URLResolverNotification/URLResolverNotification';\nimport { IOSPhoneBackground } from '~/internal/components/shared/IOSPhoneBackground/IOSPhoneBackground';\nimport { VerifiedNotification, NotificationType } from '~/internal/schemas/notificare-notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { AppRecommendationNotification } from './app-ui/AppRecommendationNotification/AppRecommendationNotification';\nimport { DigitalCardNotification } from './app-ui/DigitalCardNotification/DigitalCardNotification';\nimport { ImagesNotification } from './app-ui/ImagesNotification/ImagesNotification';\nimport { InAppBrowserNotification } from './app-ui/InAppBrowserNotification/InAppBrowserNotification';\nimport { MapNotification } from './app-ui/MapNotification/MapNotification';\nimport { RateNotification } from './app-ui/RateNotification/RateNotification';\nimport { TextAlertNotification } from './app-ui/TextAlertNotification/TextAlertNotification';\nimport { URLNotification } from './app-ui/URLNotification/URLNotification';\nimport { VideoNotification } from './app-ui/VideoNotification/VideoNotification';\nimport { WebViewNotification } from './app-ui/WebViewNotification/WebViewNotification';\nimport { LockScreenNotification } from './lock-screen/LockScreenNotification';\n\nimport './NotificationIOSPreview.css';\n\nexport function NotificationIOSPreview({\n notification,\n previewState,\n onError,\n}: NotificationIOSPreviewProps) {\n const intl = useIntl();\n\n useEffect(\n function handleInvalidPreviewError() {\n if (!isValidPreviewType(notification.type, previewState.displayMode)) {\n onError(\n intl.formatMessage(\n {\n id: 'preview.error.notSupportedNotificationTypePreviewVariant',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedNotificationTypePreviewVariant'],\n },\n { notificationType: notification.type },\n ),\n );\n }\n },\n [previewState, notification.type],\n );\n\n if (!isValidPreviewType(notification.type, previewState.displayMode)) {\n return undefined;\n }\n\n return (\n <IOSPhoneBackground theme={getTheme(notification.type, previewState.displayMode)}>\n <div className=\"notificare__push__ios__preview\">\n {(() => {\n switch (previewState.displayMode) {\n case 'lockscreen':\n case 'lockscreen-expanded':\n return (\n <LockScreenNotification\n notification={notification}\n expanded={previewState.displayMode === 'lockscreen-expanded'}\n />\n );\n\n case 'app-ui':\n switch (notification.type) {\n case 're.notifica.notification.Alert':\n return <TextAlertNotification notification={notification} />;\n\n case 're.notifica.notification.WebView':\n return <WebViewNotification notification={notification} />;\n\n case 're.notifica.notification.URL':\n return <URLNotification notification={notification} />;\n\n case 're.notifica.notification.InAppBrowser':\n return <InAppBrowserNotification notification={notification} />;\n\n case 're.notifica.notification.Image':\n return <ImagesNotification notification={notification} />;\n\n case 're.notifica.notification.Map':\n return <MapNotification notification={notification} onError={onError} />;\n\n case 're.notifica.notification.Rate':\n return <RateNotification title={notification.title} />;\n\n case 're.notifica.notification.Passbook':\n return <DigitalCardNotification notification={notification} />;\n\n case 're.notifica.notification.Video':\n return <VideoNotification notification={notification} />;\n\n case 're.notifica.notification.Store':\n return <AppRecommendationNotification notification={notification} />;\n\n case 're.notifica.notification.URLResolver':\n return (\n <URLResolverNotification notification={notification} onError={onError} />\n );\n }\n }\n })()}\n </div>\n </IOSPhoneBackground>\n );\n}\n\nexport interface NotificationIOSPreviewProps {\n notification: VerifiedNotification;\n previewState: NotificationPreviewStateMobile;\n onError: (message: string) => void;\n}\n\nfunction getTheme(notificationType: NotificationType, displayMode: NotificationPreviewDisplayMode) {\n switch (displayMode) {\n case 'app-ui':\n switch (notificationType) {\n case 're.notifica.notification.Alert':\n case 're.notifica.notification.WebView':\n case 're.notifica.notification.URL':\n case 're.notifica.notification.InAppBrowser':\n case 're.notifica.notification.Image':\n case 're.notifica.notification.Rate':\n case 're.notifica.notification.Passbook':\n case 're.notifica.notification.Video':\n case 're.notifica.notification.Store':\n case 're.notifica.notification.Map':\n case 're.notifica.notification.URLResolver':\n return 'dark';\n\n default:\n return 'light';\n }\n\n default:\n return 'light';\n }\n}\n\nfunction isValidPreviewType(\n notificationType: NotificationType,\n displayMode: NotificationPreviewDisplayMode,\n) {\n switch (displayMode) {\n case 'app-ui':\n switch (notificationType) {\n case 're.notifica.notification.Alert':\n case 're.notifica.notification.WebView':\n case 're.notifica.notification.URL':\n case 're.notifica.notification.InAppBrowser':\n case 're.notifica.notification.Image':\n case 're.notifica.notification.Map':\n case 're.notifica.notification.Rate':\n case 're.notifica.notification.Passbook':\n case 're.notifica.notification.Video':\n case 're.notifica.notification.Store':\n case 're.notifica.notification.URLResolver':\n return true;\n default:\n return false;\n }\n\n default:\n return true;\n }\n}\n","import { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\n\nexport function URLNotification({ notification }: URLNotificationProps) {\n return (\n <div data-testid=\"web-mobile-app-ui-url-notification\">\n <Webshot url={notification.content[0].data} platform={'Web'} width={268} height={430} />\n </div>\n );\n}\n\nexport interface URLNotificationProps {\n notification: Extract<\n VerifiedNotification,\n { type: 're.notifica.notification.URL' | 're.notifica.notification.URLResolver' }\n >;\n}\n","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport { URLNotification } from '~/internal/components/push/platforms/web/app-ui/mobile/URLNotification/URLNotification';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { getUrlResolverPreviewTypeByUrl } from '~/internal/utils/url-resolver';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nexport function URLResolverNotification({ notification, onError }: URLNotificationProps) {\n const intl = useIntl();\n\n const url = notification.content[0].data;\n\n const urlResolverResult = getUrlResolverPreviewTypeByUrl(url);\n\n useEffect(\n function handleUrlResolverError() {\n switch (urlResolverResult) {\n case 'invalid-url':\n onError(\n intl.formatMessage({\n id: 'preview.error.urlResolverInvalidUrl',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.urlResolverInvalidUrl'],\n }),\n );\n break;\n\n case 'url-scheme':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedUrlResolverWithUrlSchemePreview',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedUrlResolverWithUrlSchemePreview'],\n }),\n );\n break;\n\n case 'in-app-browser':\n onError(\n intl.formatMessage({\n id: 'preview.error.urlResolverNoNotificareWebViewQueryParameter',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.urlResolverNoNotificareWebViewQueryParameter'],\n }),\n );\n break;\n\n case 'dynamic-link':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedUrlResolverWithDynamicLink',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedUrlResolverWithDynamicLink'],\n }),\n );\n break;\n\n case 'relative-url':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedUrlResolverWithRelativeUrl',\n defaultMessage:\n PUSH_TRANSLATIONS['preview.error.notSupportedUrlResolverWithRelativeUrl'],\n }),\n );\n break;\n }\n },\n [urlResolverResult],\n );\n\n switch (urlResolverResult) {\n case 'invalid-url':\n case 'url-scheme':\n case 'in-app-browser':\n case 'dynamic-link':\n case 'relative-url':\n return undefined;\n\n case 'web-view':\n return <URLNotification notification={notification} />;\n }\n}\n\nexport interface URLNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.URLResolver' }>;\n onError: (message: string) => void;\n}\n","import { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasFirstAttachment } from '~/internal/utils/push-previews/notification';\n\nimport './AlertNotification.css';\n\nexport function AlertNotification({ notification }: AlertNotificationProps) {\n return (\n <div data-testid=\"web-mobile-app-ui-text-alert-notification\">\n {hasFirstAttachment(notification) && (\n <img\n className=\"notificare__web__phone__alert__app-ui__media\"\n src={notification.attachments?.[0].uri}\n alt=\"Notification attachment\"\n />\n )}\n\n <div>\n <p className=\"notificare__web__phone__alert__app-ui__title\">{notification.title}</p>\n <p className=\"notificare__web__phone__alert__app-ui__subtitle\">{notification.subtitle}</p>\n <p className=\"notificare__web__phone__alert__app-ui__message\">{notification.message}</p>\n </div>\n </div>\n );\n}\n\nexport interface AlertNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Alert' }>;\n}\n","import { VerifiedNotification } from '~/internal/schemas/notificare-notification';\n\nimport './ImageNotification.css';\n\nexport function ImageNotification({ notification }: ImageNotificationProps) {\n return (\n <div\n className=\"notificare__web__phone__image__app-ui__image-slider\"\n data-testid=\"web-mobile-app-ui-image-notification\"\n >\n {notification.content.map((image, index) => (\n <img\n key={index}\n className=\"notificare__web__phone__image__app-ui__image-slider-item\"\n src={image.data}\n alt=\"Slider image\"\n />\n ))}\n </div>\n );\n}\n\nexport interface ImageNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.Image' }>;\n}\n","import { VerifiedNotification } from '~/internal/schemas/notificare-notification';\n\nimport './WebViewNotification.css';\n\nexport function WebViewNotification({ notification }: WebViewNotificationProps) {\n return (\n <iframe\n className=\"notificare__web__phone__web-view__app-ui__content\"\n srcDoc={notification.content[0].data}\n sandbox=\"allow-same-origin\"\n data-testid=\"web-mobile-app-ui-web-view-notification\"\n />\n );\n}\n\nexport interface WebViewNotificationProps {\n notification: Extract<VerifiedNotification, { type: 're.notifica.notification.WebView' }>;\n}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\" height=\"48\" width=\"48\"><defs><linearGradient id=\"a\" x1=\"3.2173\" y1=\"15\" x2=\"44.7812\" y2=\"15\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#d93025\"/><stop offset=\"1\" stop-color=\"#ea4335\"/></linearGradient><linearGradient id=\"b\" x1=\"20.7219\" y1=\"47.6791\" x2=\"41.5039\" y2=\"11.6837\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#fcc934\"/><stop offset=\"1\" stop-color=\"#fbbc04\"/></linearGradient><linearGradient id=\"c\" x1=\"26.5981\" y1=\"46.5015\" x2=\"5.8161\" y2=\"10.506\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#1e8e3e\"/><stop offset=\"1\" stop-color=\"#34a853\"/></linearGradient></defs><circle cx=\"24\" cy=\"23.9947\" r=\"12\" style=\"fill:#fff\"/><path d=\"M3.2154,36A24,24,0,1,0,12,3.2154,24,24,0,0,0,3.2154,36ZM34.3923,18A12,12,0,1,1,18,13.6077,12,12,0,0,1,34.3923,18Z\" style=\"fill:none\"/><path d=\"M24,12H44.7812a23.9939,23.9939,0,0,0-41.5639.0029L13.6079,30l.0093-.0024A11.9852,11.9852,0,0,1,24,12Z\" style=\"fill:url(#a)\"/><circle cx=\"24\" cy=\"24\" r=\"9.5\" style=\"fill:#1a73e8\"/><path d=\"M34.3913,30.0029,24.0007,48A23.994,23.994,0,0,0,44.78,12.0031H23.9989l-.0025.0093A11.985,11.985,0,0,1,34.3913,30.0029Z\" style=\"fill:url(#b)\"/><path d=\"M13.6086,30.0031,3.218,12.006A23.994,23.994,0,0,0,24.0025,48L34.3931,30.0029l-.0067-.0068a11.9852,11.9852,0,0,1-20.7778.007Z\" style=\"fill:url(#c)\"/></svg>","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport DefaultAppIcon from '~/assets/default-app-icon.svg';\nimport ThinXMarkIcon from '~/assets/thin-x-mark.svg';\nimport { MapRichContent } from '~/internal/components/push/platforms/shared/MapRichContent/MapRichContent';\nimport { VideoRichContent } from '~/internal/components/push/platforms/shared/VideoRichContent/VideoRichContent';\nimport { URLResolverNotification } from '~/internal/components/push/platforms/web/app-ui/mobile/URLResolverNotification/URLResolverNotification';\nimport { Webshot } from '~/internal/components/shared/Webshot/Webshot';\nimport { useApplication } from '~/internal/context/application';\nimport { useOptions } from '~/internal/context/options';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { AlertNotification } from './AlertNotification/AlertNotification';\nimport { ImageNotification } from './ImageNotification/ImageNotification';\nimport { WebViewNotification } from './WebViewNotification/WebViewNotification';\n\nimport './WebMobileAppUINotification.css';\n\nexport function WebMobileAppUINotification({ notification, onError }: WebMobileAppUIProps) {\n const application = useApplication();\n const { googleMapsAPIKey } = useOptions();\n const intl = useIntl();\n\n useEffect(\n function handleInvalidPreviews() {\n if (!googleMapsAPIKey && notification.type === 're.notifica.notification.Map') {\n onError(\n intl.formatMessage({\n id: 'preview.error.provideGoogleMapsApiKey',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.provideGoogleMapsApiKey'],\n }),\n );\n }\n },\n [notification.type, googleMapsAPIKey],\n );\n\n return (\n <div className=\"notificare__web__phone__app-ui\">\n <div className=\"notificare__web__phone__app-ui__background\">\n <div className=\"notificare__web__phone__app-ui__header\">\n <div className=\"notificare__web__phone__app-ui__app-icon\">\n {application.websitePushConfig.icon ? (\n <img\n className=\"notificare__web__phone__app-ui__app-icon-image\"\n src={application.websitePushConfig.icon}\n alt=\"App icon\"\n />\n ) : (\n <DefaultAppIcon className=\"notificare__web__phone__app-ui__default-app-icon\" />\n )}\n </div>\n\n <p className=\"notificare__web__phone__app-ui__app-name\">{application.name}</p>\n <button className=\"notificare__web__phone__app-ui__close-button\">\n <ThinXMarkIcon className=\"notificare__web__phone__app-ui__close-button-icon\" />\n </button>\n </div>\n\n {(() => {\n switch (notification.type) {\n case 're.notifica.notification.Alert':\n return <AlertNotification notification={notification} />;\n\n case 're.notifica.notification.WebView':\n return <WebViewNotification notification={notification} />;\n\n case 're.notifica.notification.URL':\n return (\n <div data-testid=\"web-mobile-app-ui-url-notification\">\n <Webshot\n url={notification.content[0].data}\n platform={'Web'}\n width={268}\n height={430}\n />\n </div>\n );\n\n case 're.notifica.notification.Image':\n return <ImageNotification notification={notification} />;\n\n case 're.notifica.notification.Map':\n return <MapRichContent notification={notification} width={'100%'} height={'400px'} />;\n\n case 're.notifica.notification.Video':\n return (\n <div data-testid=\"web-mobile-app-ui-video-notification\">\n <VideoRichContent\n videoData={notification.content[0]}\n width=\"100%\"\n height=\"430px\"\n />\n </div>\n );\n\n case 're.notifica.notification.URLResolver':\n return <URLResolverNotification notification={notification} onError={onError} />;\n }\n })()}\n\n {notification.actions && (\n <div\n className={`${notification.actions.length >= 3 ? 'notificare__web__phone__app-ui__actions-column' : 'notificare__web__phone__app-ui__actions-row'}`}\n >\n {notification.actions.map((action, index) => (\n <button\n key={index}\n className={`notificare__web__phone__app-ui__action ${index === 0 ? 'notificare__web__phone__app-ui__action--primary' : 'notificare__web__phone__app-ui__action--secondary'}`}\n data-testid={`web-mobile-app-ui-action-${index}`}\n >\n {action.label}\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n}\n\nexport interface WebMobileAppUIProps {\n notification: VerifiedNotification;\n onError: (message: string) => void;\n}\n","import ExpandButtonIcon from '~/assets/expand.svg';\n\nimport './ExpandButton.css';\n\nexport function ExpandButton(props: ExpandButtonProps) {\n const { open, disabled, onToggle } = props;\n\n return (\n <button\n disabled={disabled}\n className={`notificare__push__web__desktop__lock-screen__expand-button ${open ? 'notificare__push__web__desktop__lock-screen__expand-button--rotated' : ''}`}\n onClick={onToggle}\n data-testid=\"web-desktop-expand-button\"\n >\n <ExpandButtonIcon className=\"notificare__push__web__desktop__lock-screen__expand-button-svg\" />\n </button>\n );\n}\n\nexport interface ExpandButtonProps {\n open: boolean;\n disabled: boolean;\n onToggle: () => void;\n}\n","import { Key, useEffect, useRef, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport ExpandIcon from '~/assets/expand.svg';\nimport GoogleChromeIcon from '~/assets/google-chrome.svg';\nimport { useApplication } from '~/internal/context/application';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { hasFirstAttachment } from '~/internal/utils/push-previews/notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { ExpandButton } from './ExpandButton/ExpandButton';\n\nimport './WebMacOSNotification.css';\n\nconst maxMessageLines = 3;\nconst messageLineHeight = 16.7;\n\nexport function WebMacOSNotification({ notification }: WebPushProps) {\n const [expanded, setExpanded] = useState<boolean>(false);\n const [mouseOverNotification, setMouseOverNotification] = useState<boolean>(false);\n const [mouseOverButtonIndex, setMouseOverButtonIndex] = useState<number>(-1);\n const [expandable, setExpandable] = useState<boolean>(false);\n const [openOptions, setOpenOptions] = useState<boolean>(false);\n const [isClosing, setIsClosing] = useState<boolean>(false);\n const [isExpanding, setIsExpanding] = useState<boolean>(false);\n const [initialPreviewHeight, setInitialPreviewHeight] = useState<string>('');\n const previewRef = useRef<HTMLDivElement>(null);\n const messageRef = useRef<HTMLDivElement>(null);\n\n const application = useApplication();\n\n useEffect(function enableExpandableOnMessageHeightAndSetInitialPreviewHeight() {\n if (previewRef.current && messageRef.current) {\n // calculate the message height\n const fullTextHeight = messageRef.current.scrollHeight;\n setExpandable(fullTextHeight > maxMessageLines * messageLineHeight);\n\n // set the scroll height of the preview as the REAL height of the preview and keep it in a state. It's necessary for expand/collapse animations to work properly\n const previewHeight = `${previewRef.current.scrollHeight}px`;\n previewRef.current.style.height = previewHeight;\n setInitialPreviewHeight(previewHeight);\n }\n }, []);\n\n useEffect(function enableExpandableOnAttachment() {\n if (hasFirstAttachment(notification)) {\n setExpandable(true);\n }\n }, []);\n\n return (\n <div\n ref={previewRef}\n className=\"notificare__push__web__desktop__lock-screen\"\n onMouseEnter={() => setMouseOverNotification(() => true)}\n onMouseLeave={() => setMouseOverNotification(() => openOptions)}\n data-testid=\"web-desktop-notification\"\n >\n {((expandable && mouseOverNotification) || expanded || isClosing) && (\n <div className=\"notificare__push__web__desktop__lock-screen__expand-button-container\">\n <ExpandButton\n open={expanded}\n disabled={isClosing || isExpanding}\n onToggle={function animatePreview() {\n const previewElement = previewRef.current;\n const messageElement = messageRef.current;\n\n if (previewElement && messageElement) {\n if (expanded) {\n previewElement.style.backgroundColor = '#f4f4f4';\n previewElement.style.height = initialPreviewHeight; // reset the preview height to the initial height so the animation starts\n setIsClosing(true);\n setExpanded(false);\n setTimeout(() => {\n setIsClosing(false);\n previewElement.style.overflow = ''; // unset overflow property (if it's 'hidden', it hides the expanded options)\n }, 300);\n } else {\n previewElement.style.backgroundColor = '#fff';\n previewElement.style.overflow = 'hidden'; // set preview overflow property to 'hidden' so the expanded content is not shown immediately (but progressively with the animation)\n setIsExpanding(true);\n setExpanded(true);\n setTimeout(() => {\n // update the preview element REAL height with the current scroll height to start the animation\n previewElement.style.height = `${previewElement.scrollHeight}px`;\n }, 10);\n setTimeout(() => {\n setIsExpanding(false);\n }, 300);\n }\n\n setOpenOptions(false);\n }\n }}\n />\n </div>\n )}\n\n {!mouseOverNotification && !expanded && !isClosing && (\n <div className=\"notificare__push__web__desktop__lock-screen__time-container\">\n <p className=\"notificare__push__web__desktop__lock-screen__time\">\n <FormattedMessage\n id=\"preview.web.desktop.macos.lockScreen.time\"\n defaultMessage={PUSH_TRANSLATIONS['preview.web.desktop.macos.lockScreen.time']}\n />\n </p>\n </div>\n )}\n\n <div className=\"notificare__push__web__desktop__lock-screen__main-content\">\n <div className=\"notificare__push__web__desktop__lock-screen__browser-icon\">\n <div className=\"notificare__push__web__desktop__lock-screen__browser-icon-background\">\n <GoogleChromeIcon\n className=\"notificare__push__web__desktop__lock-screen__browser-icon-svg\"\n aria-label=\"Google Chrome icon\"\n />\n </div>\n </div>\n\n <div className=\"notificare__push__web__desktop__lock-screen__text-content\">\n <p className=\"notificare__push__web__desktop__lock-screen__text notificare__push__web__desktop__lock-screen__text--title\">\n {notification.title || application.name}\n </p>\n <p className=\"notificare__push__web__desktop__lock-screen__text notificare__push__web__desktop__lock-screen__text--domain\">\n {application.websitePushConfig.allowedDomains.length > 0\n ? extractDomain(application.websitePushConfig.allowedDomains[0])\n : 'example.com'}\n </p>\n <p\n ref={messageRef}\n className={`notificare__push__web__desktop__lock-screen__text ${expanded || isClosing ? 'notificare__push__web__desktop__lock-screen__text--expandable-message' : 'notificare__push__web__desktop__lock-screen__text--message'}`}\n >\n {notification.message}\n </p>\n </div>\n\n {hasFirstAttachment(notification) && !expanded && !isClosing && !mouseOverNotification && (\n <img\n className=\"notificare__push__web__desktop__lock-screen__small-media\"\n src={notification.attachments?.[0].uri}\n alt=\"Small media icon\"\n />\n )}\n\n {mouseOverNotification && !expanded && !isClosing && (\n <div className=\"notificare__push__web__desktop__lock-screen__settings-button-container\">\n {notification.actions && notification.actions.length > 0 ? (\n <>\n <button\n className=\"notificare__push__web__desktop__lock-screen__settings-button\"\n onClick={() => setOpenOptions((prevState) => !prevState)}\n data-testid=\"web-desktop-settings-button\"\n >\n <FormattedMessage\n id=\"preview.web.desktop.macos.lockScreen.options\"\n defaultMessage={\n PUSH_TRANSLATIONS['preview.web.desktop.macos.lockScreen.options']\n }\n />\n <ExpandIcon className=\"notificare__push__web__desktop__lock-screen__settings-button-expand-icon\" />\n </button>\n\n {openOptions && (\n <div className=\"notificare__push__web__desktop__lock-screen__settings-selector\">\n {notification.actions.map((option, index) => (\n <button\n key={index}\n className=\"notificare__push__web__desktop__lock-screen__settings-selector-option\"\n data-testid={`web-desktop-options-action-${index}`}\n >\n {option.label}\n </button>\n ))}\n\n <button className=\"notificare__push__web__desktop__lock-screen__settings-selector-option\">\n <FormattedMessage\n id=\"preview.web.desktop.macos.lockScreen.settings\"\n defaultMessage={\n PUSH_TRANSLATIONS['preview.web.desktop.macos.lockScreen.settings']\n }\n />\n </button>\n </div>\n )}\n </>\n ) : (\n <button className=\"notificare__push__web__desktop__lock-screen__settings-button\">\n <FormattedMessage\n id=\"preview.web.desktop.macos.lockScreen.settings\"\n defaultMessage={\n PUSH_TRANSLATIONS['preview.web.desktop.macos.lockScreen.settings']\n }\n />\n </button>\n )}\n </div>\n )}\n </div>\n\n {(expanded || isClosing) && (\n <div className=\"notificare__push__web__desktop__lock-screen__expanded-content\">\n {hasFirstAttachment(notification) && (\n <img\n className=\"notificare__push__web__desktop__lock-screen__expanded-media\"\n src={notification.attachments?.[0].uri}\n alt=\"Expanded media\"\n />\n )}\n\n <hr className=\"notificare__push__web__desktop__lock-screen__expanded-divisor\" />\n\n {notification.actions?.map((action, index) => (\n <div key={index} className=\"notificare__push__web__desktop__lock-screen__action\">\n <button\n className=\"notificare__push__web__desktop__lock-screen__expanded-button\"\n onMouseEnter={() => setMouseOverButtonIndex(index)}\n onMouseLeave={() => setMouseOverButtonIndex(-1)}\n data-testid={`web-desktop-expanded-action-${index}`}\n >\n {action.label}\n </button>\n\n <hr\n className={`notificare__push__web__desktop__lock-screen__expanded-buttons-divisor ${(mouseOverButtonIndex === index || mouseOverButtonIndex - 1 === index) && 'notificare__push__web__desktop__lock-screen__expanded-buttons-divisor--transparent'}`}\n />\n </div>\n ))}\n\n <button\n className={'notificare__push__web__desktop__lock-screen__expanded-button'}\n onMouseEnter={() => setMouseOverButtonIndex(notification.actions?.length || -1)}\n onMouseLeave={() => setMouseOverButtonIndex(-1)}\n >\n <FormattedMessage\n id=\"preview.web.desktop.macos.lockScreen.settings\"\n defaultMessage={PUSH_TRANSLATIONS['preview.web.desktop.macos.lockScreen.settings']}\n />\n </button>\n </div>\n )}\n </div>\n );\n}\n\nexport interface WebPushProps {\n key?: Key; // why do we receive a key?\n notification: VerifiedNotification;\n}\n\nfunction extractDomain(url: string): string {\n try {\n const parsedUrl = new URL(url);\n return parsedUrl.hostname;\n } catch {\n return '';\n }\n}\n","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport {\n NotificationPreviewStateWebDesktop,\n NotificationPreviewStateWebMobile,\n} from '~/internal/components/push/notification-preview-state';\nimport { AndroidPhoneBackground } from '~/internal/components/shared/AndroidPhoneBackground/AndroidPhoneBackground';\nimport { IOSPhoneBackground } from '~/internal/components/shared/IOSPhoneBackground/IOSPhoneBackground';\nimport { VerifiedNotification, NotificationType } from '~/internal/schemas/notificare-notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport { WebMobileAppUINotification } from './app-ui/mobile/WebMobileAppUINotification';\nimport { WebMacOSNotification } from './lockscreen/WebMacOSNotification';\n\nexport function NotificationWebPreview({\n notification,\n previewState,\n onError,\n}: NotificationWebPreviewProps) {\n const intl = useIntl();\n\n useEffect(\n function handleInvalidPreviewError() {\n switch (previewState.formFactor) {\n case 'phone':\n switch (previewState.displayMode) {\n case 'lockscreen':\n case 'lockscreen-expanded':\n onError(\n intl.formatMessage({\n id: 'preview.error.notSupportedPreviewVariant',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.notSupportedPreviewVariant'],\n }),\n );\n break;\n\n case 'app-ui':\n switch (notification.type) {\n case 're.notifica.notification.InAppBrowser':\n case 're.notifica.notification.Rate':\n case 're.notifica.notification.Store':\n case 're.notifica.notification.Passbook':\n case 're.notifica.notification.None':\n case 're.notifica.notification.URLScheme':\n onError(\n intl.formatMessage(\n {\n id: 'preview.error.notSupportedNotificationTypePreviewVariant',\n defaultMessage:\n PUSH_TRANSLATIONS[\n 'preview.error.notSupportedNotificationTypePreviewVariant'\n ],\n },\n { notificationType: notification.type },\n ),\n );\n break;\n }\n }\n }\n },\n [previewState, notification.type],\n );\n\n switch (previewState.formFactor) {\n case 'phone':\n switch (previewState.displayMode) {\n case 'app-ui':\n switch (notification.type) {\n case 're.notifica.notification.Alert':\n case 're.notifica.notification.WebView':\n case 're.notifica.notification.URL':\n case 're.notifica.notification.Image':\n case 're.notifica.notification.Map':\n case 're.notifica.notification.Video':\n case 're.notifica.notification.URLResolver':\n switch (previewState.os) {\n case 'android':\n return (\n <AndroidPhoneBackground theme={getTheme(notification.type)}>\n <WebMobileAppUINotification notification={notification} onError={onError} />\n </AndroidPhoneBackground>\n );\n\n case 'ios':\n return (\n <IOSPhoneBackground theme={getTheme(notification.type)}>\n <WebMobileAppUINotification notification={notification} onError={onError} />\n </IOSPhoneBackground>\n );\n }\n }\n }\n break;\n\n case 'desktop':\n switch (previewState.os) {\n case 'macos':\n return <WebMacOSNotification key={notification.message} notification={notification} />;\n }\n }\n}\n\nexport interface NotificationWebPreviewProps {\n notification: VerifiedNotification;\n previewState: NotificationPreviewStateWebDesktop | NotificationPreviewStateWebMobile;\n onError: (message: string) => void;\n}\n\nfunction getTheme(notificationType: NotificationType) {\n switch (notificationType) {\n case 're.notifica.notification.Alert':\n case 're.notifica.notification.Map':\n case 're.notifica.notification.WebView':\n case 're.notifica.notification.URL':\n case 're.notifica.notification.Video':\n case 're.notifica.notification.Image':\n case 're.notifica.notification.URLResolver':\n return 'dark';\n\n default:\n return 'light';\n }\n}\n","import { useState } from 'react';\nimport { UnavailablePreview } from '~/internal/components/shared';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { NotificationPreviewState } from './notification-preview-state';\nimport { NotificationAndroidPreview } from './platforms/android/NotificationAndroidPreview';\nimport { NotificationIOSPreview } from './platforms/ios/NotificationIOSPreview';\nimport { NotificationWebPreview } from './platforms/web/NotificationWebPreview';\n\nexport function NotificationPreview({\n notification,\n previewState,\n}: {\n notification: VerifiedNotification;\n previewState: NotificationPreviewState;\n}) {\n const [error, setError] = useState<string | null>(null);\n const [previousPreviewState, setPreviousPreviewState] = useState(previewState);\n\n if (previousPreviewState !== previewState) {\n setError(null);\n setPreviousPreviewState(previewState);\n }\n\n if (error) {\n return <UnavailablePreview message={error} showConsoleWarning={false} />;\n }\n\n switch (previewState.platform) {\n case 'android':\n return (\n <NotificationAndroidPreview\n notification={notification}\n previewState={previewState}\n onError={setError}\n />\n );\n case 'ios':\n return (\n <NotificationIOSPreview\n notification={notification}\n previewState={previewState}\n onError={setError}\n />\n );\n case 'web':\n return (\n <NotificationWebPreview\n notification={notification}\n previewState={previewState}\n onError={setError}\n />\n );\n }\n}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path d=\"M420.6 301.9a24 24 0 1 1 24-24 24 24 0 0 1 -24 24m-265.1 0a24 24 0 1 1 24-24 24 24 0 0 1 -24 24m273.7-144.5 47.9-83a10 10 0 1 0 -17.3-10h0l-48.5 84.1a301.3 301.3 0 0 0 -246.6 0L116.2 64.5a10 10 0 1 0 -17.3 10h0l47.9 83C64.5 202.2 8.2 285.6 0 384H576c-8.2-98.5-64.5-181.8-146.9-226.6\" />\n</svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path d=\"M64 0C28.7 0 0 28.7 0 64L0 352c0 35.3 28.7 64 64 64l176 0-10.7 32L160 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-69.3 0L336 416l176 0c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64L64 0zM512 64l0 288L64 352 64 64l448 0z\" />\n</svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\">\n <path d=\"M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z\" />\n</svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\">\n <path d=\"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z\" />\n</svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\">\n <path d=\"M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM224 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM304 64L80 64l0 320 224 0 0-320z\" />\n</svg>","import { ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\nimport AndroidIcon from '~/assets/android.svg';\nimport DesktopIcon from '~/assets/desktop.svg';\nimport HTML5Icon from '~/assets/html5.svg';\nimport IOSIcon from '~/assets/ios.svg';\nimport PhoneIcon from '~/assets/phone.svg';\nimport { Selector } from '~/internal/components/shared/Selector/Selector';\nimport { ToggleGroup } from '~/internal/components/shared/ToggleGroup/ToggleGroup';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport {\n NotificationPreviewDesktopOperatingSystem,\n NotificationPreviewDisplayMode,\n NotificationPreviewFormFactor,\n NotificationPreviewMobileOperatingSystem,\n NotificationPreviewPlatform,\n NotificationPreviewState,\n} from '../notification-preview-state';\n\nimport './Controls.css';\n\nexport function Controls({ previewState, onPreviewStateChanged }: ControlsProps) {\n const intl = useIntl();\n\n function handlePlatformChanged(platform: NotificationPreviewPlatform) {\n if (previewState.platform === platform) return;\n\n switch (platform) {\n case 'android':\n case 'ios':\n onPreviewStateChanged({\n ...previewState,\n platform,\n });\n break;\n case 'web':\n onPreviewStateChanged({\n ...previewState,\n platform: 'web',\n formFactor: 'desktop',\n os: 'macos',\n // Reset the display mode to a value supported by the Web Desktop Notification component.\n displayMode: 'lockscreen',\n });\n break;\n }\n }\n\n function handleFormFactorChanged(formFactor: NotificationPreviewFormFactor) {\n if (previewState.platform !== 'web' || previewState.formFactor === formFactor) return;\n\n switch (formFactor) {\n case 'desktop':\n onPreviewStateChanged({\n ...previewState,\n formFactor,\n os: 'macos',\n // Reset the display mode to a value supported by the Web Desktop Notification component.\n displayMode: 'lockscreen',\n });\n break;\n case 'phone':\n onPreviewStateChanged({\n ...previewState,\n formFactor,\n os: 'android',\n // Reset the display mode to a value supported by the Web Mobile Notification component.\n displayMode: 'app-ui',\n });\n break;\n }\n }\n\n function handleOperatingSystemChanged(os: NotificationPreviewMobileOperatingSystem) {\n if (\n previewState.platform !== 'web' ||\n previewState.formFactor !== 'phone' ||\n previewState.os === os\n ) {\n return;\n }\n\n onPreviewStateChanged({\n ...previewState,\n os,\n });\n }\n\n function handleDisplayModeChanged(displayMode: NotificationPreviewDisplayMode) {\n if (previewState.displayMode === displayMode) return;\n\n onPreviewStateChanged({\n ...previewState,\n displayMode,\n });\n }\n\n return (\n <div className=\"notificare__push__preview-controls\" data-testid=\"controls\">\n <div className=\"notificare__push__preview-controls-toggle-groups\">\n <ToggleGroup\n label={intl.formatMessage({\n id: 'controls.platform',\n defaultMessage: PUSH_TRANSLATIONS['controls.platform'],\n })}\n options={PLATFORM_OPTIONS}\n value={previewState.platform}\n onValueChanged={handlePlatformChanged}\n />\n\n {previewState.platform === 'web' && (\n <ToggleGroup\n label={intl.formatMessage({\n id: 'controls.formFactor',\n defaultMessage: PUSH_TRANSLATIONS['controls.formFactor'],\n })}\n options={FORM_FACTOR_OPTIONS}\n value={previewState.formFactor}\n onValueChanged={handleFormFactorChanged}\n />\n )}\n\n {previewState.platform === 'web' && previewState.formFactor === 'phone' && (\n <ToggleGroup\n label={intl.formatMessage({\n id: 'controls.operatingSystem',\n defaultMessage: PUSH_TRANSLATIONS['controls.operatingSystem'],\n })}\n options={MOBILE_OPERATING_SYSTEM_OPTIONS}\n value={previewState.os}\n onValueChanged={handleOperatingSystemChanged}\n />\n )}\n </div>\n\n {(previewState.platform === 'android' || previewState.platform === 'ios') && (\n <Selector\n label={intl.formatMessage({\n id: 'controls.variant',\n defaultMessage: PUSH_TRANSLATIONS['controls.variant'],\n })}\n options={DISPLAY_MODE_OPTIONS}\n value={previewState.displayMode}\n onValueChanged={handleDisplayModeChanged}\n />\n )}\n\n {previewState.platform === 'web' && previewState.formFactor === 'desktop' && (\n <Selector\n label={intl.formatMessage({\n id: 'controls.operatingSystem',\n defaultMessage: PUSH_TRANSLATIONS['controls.operatingSystem'],\n })}\n options={DESKTOP_OPERATING_SYSTEM_OPTIONS}\n value={previewState.os}\n disabled\n />\n )}\n\n {previewState.platform === 'web' && previewState.formFactor === 'phone' && (\n <Selector\n label={intl.formatMessage({\n id: 'controls.variant',\n defaultMessage: PUSH_TRANSLATIONS['controls.variant'],\n })}\n options={DISPLAY_MODE_OPTIONS}\n value=\"app-ui\"\n disabled\n />\n )}\n </div>\n );\n}\n\nexport interface ControlsProps {\n previewState: NotificationPreviewState;\n onPreviewStateChanged: (state: NotificationPreviewState) => void;\n}\n\nconst PLATFORM_OPTIONS = [\n {\n value: 'android',\n icon: (\n <AndroidIcon\n key=\"platforms-android-icon\"\n className=\"notificare__push__preview-controls-android-icon\"\n />\n ),\n },\n {\n value: 'ios',\n icon: (\n <IOSIcon key=\"platform-ios-icon\" className=\"notificare__push__preview-controls-ios-icon\" />\n ),\n },\n {\n value: 'web',\n icon: (\n <HTML5Icon\n key=\"platform-html5-icon\"\n className=\"notificare__push__preview-controls-html5-icon\"\n />\n ),\n },\n] satisfies Array<{ value: NotificationPreviewPlatform; icon: ReactNode }>;\n\nconst FORM_FACTOR_OPTIONS = [\n {\n value: 'desktop',\n icon: (\n <DesktopIcon\n key=\"form-factor-desktop-icon\"\n className=\"notificare__push__preview-controls-desktop-icon\"\n />\n ),\n },\n {\n value: 'phone',\n icon: (\n <PhoneIcon\n key=\"form-factor-phone-icon\"\n className=\"notificare__push__preview-controls-phone-icon\"\n />\n ),\n },\n] satisfies Array<{ value: NotificationPreviewFormFactor; icon: ReactNode }>;\n\nconst MOBILE_OPERATING_SYSTEM_OPTIONS = [\n {\n value: 'android',\n icon: (\n <AndroidIcon\n key=\"device-android-icon\"\n className=\"notificare__push__preview-controls-android-icon\"\n />\n ),\n },\n {\n value: 'ios',\n icon: (\n <IOSIcon key=\"device-iphone-icon\" className=\"notificare__push__preview-controls-ios-icon\" />\n ),\n },\n] satisfies Array<{ value: NotificationPreviewMobileOperatingSystem; icon: ReactNode }>;\n\nconst DESKTOP_OPERATING_SYSTEM_OPTIONS = [\n {\n value: 'macos',\n labelId: 'controls.operatingSystem.macos',\n defaultLabel: PUSH_TRANSLATIONS['controls.operatingSystem.macos'],\n },\n] satisfies Array<{\n value: NotificationPreviewDesktopOperatingSystem;\n labelId: string;\n defaultLabel: string;\n}>;\n\nconst DISPLAY_MODE_OPTIONS = [\n {\n value: 'lockscreen',\n labelId: 'controls.displayMode.lockScreen',\n defaultLabel: PUSH_TRANSLATIONS['controls.displayMode.lockScreen'],\n },\n {\n value: 'lockscreen-expanded',\n labelId: 'controls.displayMode.expandedLockScreen',\n defaultLabel: PUSH_TRANSLATIONS['controls.displayMode.expandedLockScreen'],\n },\n {\n value: 'app-ui',\n labelId: 'controls.displayMode.appUi',\n defaultLabel: PUSH_TRANSLATIONS['controls.displayMode.appUi'],\n },\n] satisfies Array<{\n value: NotificationPreviewDisplayMode;\n labelId: string;\n defaultLabel: string;\n}>;\n","import { useState } from 'react';\nimport { NotificationPreviewState } from '~/internal/components/push/notification-preview-state';\nimport { NotificationPreview } from '~/internal/components/push/NotificationPreview';\nimport { Controls } from '~/internal/components/push/preview-controls/Controls';\nimport { Loading } from '~/internal/components/shared/Loading/Loading';\nimport { ApplicationProvider } from '~/internal/context/application';\nimport { useOptions } from '~/internal/context/options';\nimport { useApplicationLoader } from '~/internal/hooks';\nimport { VerifiedNotification } from '~/internal/schemas/notificare-notification';\nimport { NotificareNotificationPreviewVariant } from '~/models';\n\nimport '~/preset.css';\nimport './NotificationPreviewWrapper.css';\n\nconst DEFAULT_STATES = {\n 'android-lockscreen': {\n platform: 'android',\n displayMode: 'lockscreen',\n },\n 'android-lockscreen-expanded': {\n platform: 'android',\n displayMode: 'lockscreen-expanded',\n },\n 'android-app-ui': {\n platform: 'android',\n displayMode: 'app-ui',\n },\n 'ios-lockscreen': {\n platform: 'ios',\n displayMode: 'lockscreen',\n },\n 'ios-lockscreen-expanded': {\n platform: 'ios',\n displayMode: 'lockscreen-expanded',\n },\n 'ios-app-ui': {\n platform: 'ios',\n displayMode: 'app-ui',\n },\n 'web-desktop-macos': {\n platform: 'web',\n displayMode: 'lockscreen',\n formFactor: 'desktop',\n os: 'macos',\n },\n 'web-android-app-ui': {\n platform: 'web',\n displayMode: 'app-ui',\n formFactor: 'phone',\n os: 'android',\n },\n 'web-iphone-app-ui': {\n platform: 'web',\n displayMode: 'app-ui',\n formFactor: 'phone',\n os: 'ios',\n },\n} satisfies Record<NotificareNotificationPreviewVariant, NotificationPreviewState>;\n\nexport function NotificationPreviewWrapper({\n notification,\n applicationId,\n showControls = true,\n variant = 'android-lockscreen',\n}: NotificareNotificationPreviewContentProps) {\n const [previewState, setPreviewState] = useState<NotificationPreviewState>(\n DEFAULT_STATES[variant],\n );\n\n const { serviceKey } = useOptions();\n\n const applicationState = useApplicationLoader({\n id: applicationId,\n serviceKey,\n });\n\n return (\n <div className=\"notificare__push__preview-wrapper\">\n {showControls && (\n <Controls previewState={previewState} onPreviewStateChanged={setPreviewState} />\n )}\n {(() => {\n switch (applicationState.status) {\n case 'idle':\n case 'loading':\n return <Loading />;\n case 'success':\n return (\n <ApplicationProvider application={applicationState.data}>\n <div className=\"notificare__push__preview\">\n <NotificationPreview notification={notification} previewState={previewState} />\n </div>\n </ApplicationProvider>\n );\n }\n })()}\n </div>\n );\n}\n\nexport interface NotificareNotificationPreviewContentProps {\n notification: VerifiedNotification;\n applicationId?: string;\n showControls?: boolean;\n variant?: NotificareNotificationPreviewVariant;\n}\n","export var util;\n(function (util) {\n util.assertEqual = (_) => { };\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => (typeof val === \"string\" ? `'${val}'` : val)).join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nexport var objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nexport const ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n","import { util } from \"./helpers/util.js\";\nexport const ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nexport const quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexport class ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n","import { ZodIssueCode } from \"../ZodError.js\";\nimport { util, ZodParsedType } from \"../helpers/util.js\";\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\nexport default errorMap;\n","import defaultErrorMap from \"./locales/en.js\";\nlet overrideErrorMap = defaultErrorMap;\nexport { defaultErrorMap };\nexport function setErrorMap(map) {\n overrideErrorMap = map;\n}\nexport function getErrorMap() {\n return overrideErrorMap;\n}\n","import { getErrorMap } from \"../errors.js\";\nimport defaultErrorMap from \"../locales/en.js\";\nexport const makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexport const EMPTY_PATH = [];\nexport function addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nexport class ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexport const INVALID = Object.freeze({\n status: \"aborted\",\n});\nexport const DIRTY = (value) => ({ status: \"dirty\", value });\nexport const OK = (value) => ({ status: \"valid\", value });\nexport const isAborted = (x) => x.status === \"aborted\";\nexport const isDirty = (x) => x.status === \"dirty\";\nexport const isValid = (x) => x.status === \"valid\";\nexport const isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n","export var errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (errorUtil = {}));\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _ZodEnum_cache, _ZodNativeEnum_cache;\nimport { ZodError, ZodIssueCode, } from \"./ZodError.js\";\nimport { defaultErrorMap, getErrorMap } from \"./errors.js\";\nimport { errorUtil } from \"./helpers/errorUtil.js\";\nimport { DIRTY, INVALID, OK, ParseStatus, addIssueToContext, isAborted, isAsync, isDirty, isValid, makeIssue, } from \"./helpers/parseUtil.js\";\nimport { util, ZodParsedType, getParsedType } from \"./helpers/util.js\";\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (Array.isArray(this._key)) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message ?? ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: message ?? required_error ?? ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: message ?? invalid_type_error ?? ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nexport class ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n const ctx = {\n common: {\n issues: [],\n async: params?.async ?? false,\n contextualErrorMap: params?.errorMap,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if (err?.message?.toLowerCase()?.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params?.errorMap,\n async: true,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nconst ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/;\n// const ipv6Regex =\n// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\nconst ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\nconst ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst dateRegexSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n let secondsRegexSource = `[0-5]\\\\d`;\n if (args.precision) {\n secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n }\n const secondsQuantifier = args.precision ? \"+\" : \"?\"; // require seconds if precision is nonzero\n return `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (\"typ\" in decoded && decoded?.typ !== \"JWT\")\n return false;\n if (!decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nexport class ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"nanoid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"duration\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"jwt\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cidr\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n offset: options?.offset ?? false,\n local: options?.local ?? false,\n ...errorUtil.errToObj(options?.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n ...errorUtil.errToObj(options?.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options?.position,\n ...errorUtil.errToObj(options?.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nexport class ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" || (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null;\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (Number.isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: params?.coerce || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nexport class ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nexport class ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nexport class ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nexport class ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nexport class ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nexport class ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nexport class ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nexport class ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<T, Augmentation>,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n this._cached = { shape, keys };\n return this._cached;\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") {\n }\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: errorUtil.errToObj(message).message ?? defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n for (const key of util.objectKeys(mask)) {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nexport class ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nexport class ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\n// type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];\nexport class ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nexport class ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nexport class ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nexport class ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nexport class ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(async function (...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nexport class ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nexport class ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nexport class ZodEnum extends ZodType {\n constructor() {\n super(...arguments);\n _ZodEnum_cache.set(this, void 0);\n }\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!__classPrivateFieldGet(this, _ZodEnum_cache, \"f\")) {\n __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), \"f\");\n }\n if (!__classPrivateFieldGet(this, _ZodEnum_cache, \"f\").has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\n_ZodEnum_cache = new WeakMap();\nZodEnum.create = createZodEnum;\nexport class ZodNativeEnum extends ZodType {\n constructor() {\n super(...arguments);\n _ZodNativeEnum_cache.set(this, void 0);\n }\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, \"f\")) {\n __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), \"f\");\n }\n if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, \"f\").has(input.data)) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\n_ZodNativeEnum_cache = new WeakMap();\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nexport class ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nexport class ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return base;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {\n if (!isValid(base))\n return base;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({\n status: status.value,\n value: result,\n }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nexport { ZodEffects as ZodTransformer };\nexport class ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nexport class ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nexport class ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n ...processCreateParams(params),\n });\n};\nexport class ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nexport class ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nexport const BRAND = Symbol(\"zod_brand\");\nexport class ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nexport class ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nexport class ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if (isValid(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\" ? params(data) : typeof params === \"string\" ? { message: params } : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nexport function custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nexport { ZodType as Schema, ZodType as ZodSchema };\nexport const late = {\n object: ZodObject.lazycreate,\n};\nexport var ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\n// requires TS 4.4+\nclass Class {\n constructor(..._) { }\n}\nconst instanceOfType = (\n// const instanceOfType = <T extends new (...args: any[]) => any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nexport const coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nexport { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };\nexport const NEVER = INVALID;\n","import { z } from 'zod';\n\nexport const BaseSchema = z.object({\n title: z.string({ message: \"Property 'title' should be a string\" }).optional(),\n subtitle: z.string({ message: \"Property 'subtitle' should be a string\" }).optional(),\n message: z\n .string({ message: \"Property 'message' is required and should be a string\" })\n .nonempty(\"Property 'message' cannot be empty\"),\n actions: z\n .array(\n z.object({\n type: z.string({ message: \"Action property 'type' is required and should be a string\" }),\n label: z.string({ message: \"Action property 'label' is required and should be a string\" }),\n target: z.string({ message: \"Action property 'target' should be a string\" }).optional(),\n camera: z.boolean({ message: \"Action property 'camera' should be a boolean\" }).optional(),\n keyboard: z\n .boolean({ message: \"Action property 'keyboard' should be a boolean\" })\n .optional(),\n }),\n )\n .optional(),\n attachments: z\n .array(\n z.object({\n mimeType: z.string({\n message: \"Attachment property 'mimeType' is required and should be a string\",\n }),\n uri: z\n .string({ message: \"Attachment property 'uri' is required and should be a string\" })\n .url(\"Attachment property 'uri' should be a valid URL\"),\n }),\n )\n .optional(),\n});\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const NoneSchema = z\n .object({\n type: z.literal('re.notifica.notification.None'),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const UrlResolverSchema = z\n .object({\n type: z.literal('re.notifica.notification.URLResolver'),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.URL', {\n message: \"Content object should be of type 're.notifica.content.URL'\",\n }),\n data: z.string({ message: 'Content object data is required and should be a string' }),\n }),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n ),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const AlertSchema = z\n .object({\n type: z.literal('re.notifica.notification.Alert'),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const ImageSchema = z\n .object({\n type: z.literal('re.notifica.notification.Image'),\n content: z.array(\n z.object({\n type: z.enum(\n ['re.notifica.content.PNG', 're.notifica.content.JPEG', 're.notifica.content.GIF'],\n {\n message:\n \"Content objects should be of type 're.notifica.content.PNG', 're.notifica.content.JPEG' or 're.notifica.content.GIF'\",\n },\n ),\n data: z\n .string({ message: 'Content objects data should be strings' })\n .url('Content objects data should be valid URLs'),\n }),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n ),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const InAppBrowserSchema = z\n .object({\n type: z.literal('re.notifica.notification.InAppBrowser'),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.URL', {\n message: \"Content object should be of type 're.notifica.content.URL'\",\n }),\n data: z\n .string({ message: 'Content object data is required and should be a string' })\n .url('Content object data should be a valid URL'),\n }),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n ),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const MapSchema = z\n .object({\n type: z.literal('re.notifica.notification.Map'),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.Marker', {\n message: \"Content objects should be of type 're.notifica.content.Marker'\",\n }),\n data: z.object({\n title: z.string({\n message: \"Content object data property 'title' is required and should be a string\",\n }),\n description: z.string({\n message: \"Content object data property 'description' is required should be a string\",\n }),\n latitude: z\n .number({\n message: \"Content object data property 'latitude' is required and should be a number\",\n })\n .min(-90, \"Content object data property 'latitude' should be a minimum of -90\")\n .max(90, \"Content object data property 'latitude' should be a maximum of 90\"),\n longitude: z\n .number({\n message:\n \"Content object data property 'longitude' is required and should be a number\",\n })\n .min(-180, \"Content object data property 'longitude' must be at least -180\")\n .max(180, \"Content object data property 'longitude' must be at most 180\"),\n }),\n }),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n ),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const PassbookSchema = z\n .object({\n type: z.literal('re.notifica.notification.Passbook'),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.PKPass', {\n message: \"Content object should be of type 're.notifica.content.PKPass'\",\n }),\n data: z\n .string({ message: 'Content object data is required and should be a string' })\n .url('Content object data should be a valid URL'),\n }),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n ),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const RateSchema = z\n .object({\n type: z.literal('re.notifica.notification.Rate'),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const StoreSchema = z\n .object({\n type: z.literal('re.notifica.notification.Store'),\n content: z.array(\n z.discriminatedUnion('type', [\n z.object({\n type: z.literal('re.notifica.content.AppStore'),\n data: z.object(\n {\n identifier: z.string({\n message:\n \"Content object data property 'identifier' is mandatory and should be a string\",\n }),\n campaignToken: z\n .string({\n message: \"Content object data property 'campaignToken' should be a string\",\n })\n .optional(),\n affiliateToken: z\n .string({\n message: \"Content object data property 'affiliateToken' should be a string\",\n })\n .optional(),\n providerToken: z\n .string({\n message: \"Content object data property 'providerToken' should be a string\",\n })\n .optional(),\n },\n {\n message:\n \"AppStore content object data is required and must be an object with 'identifier' (mandatory), 'campaignToken', 'affiliateToken', or 'providerToken'\",\n },\n ),\n }),\n\n z.object({\n type: z.enum([\n 're.notifica.content.GooglePlayDetails',\n 're.notifica.content.GooglePlayDeveloper',\n 're.notifica.content.GooglePlayCollection',\n 're.notifica.content.GooglePlaySearch',\n 're.notifica.content.AppGalleryDetails',\n 're.notifica.content.AppGallerySearch',\n ]),\n data: z\n .string({\n message:\n 'GooglePlay and AppGallery content object data is required and must be a string',\n })\n .nonempty('GooglePlay and AppGallery content object data cannot be empty'),\n }),\n ]),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n ),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { NoneSchema } from '~/internal/schemas/notificare-notification/variants/none';\nimport { UrlResolverSchema } from '~/internal/schemas/notificare-notification/variants/url-resolver';\nimport { AlertSchema } from './variants/alert';\nimport { ImageSchema } from './variants/image';\nimport { InAppBrowserSchema } from './variants/in-app-browser';\nimport { MapSchema } from './variants/map';\nimport { PassbookSchema } from './variants/passbook';\nimport { RateSchema } from './variants/rate';\nimport { StoreSchema } from './variants/store';\nimport { UrlSchema } from './variants/url';\nimport { UrlSchemeSchema } from './variants/url-scheme';\nimport { VideoSchema } from './variants/video';\nimport { WebViewSchema } from './variants/web-view';\n\nexport const NotificationSchema = z.discriminatedUnion('type', [\n AlertSchema,\n ImageSchema,\n InAppBrowserSchema,\n MapSchema,\n NoneSchema,\n PassbookSchema,\n RateSchema,\n StoreSchema,\n UrlResolverSchema,\n UrlSchema,\n UrlSchemeSchema,\n VideoSchema,\n WebViewSchema,\n]);\n\nexport type VerifiedNotification = z.infer<typeof NotificationSchema>;\n\nexport type NotificationType = VerifiedNotification['type'];\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const UrlSchema = z\n .object({\n type: z.literal('re.notifica.notification.URL'),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.URL', {\n message: \"Content object should be of type 're.notifica.content.URL'\",\n }),\n data: z\n .string({ message: 'Content object data is required and should be a string' })\n .url('Content object data should be a valid URL'),\n }),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n ),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const UrlSchemeSchema = z\n .object({\n type: z.literal('re.notifica.notification.URLScheme'),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.URL', {\n message: \"Content object should be of type 're.notifica.content.URL'\",\n }),\n data: z.string({ message: 'Content object data is required and should be a string' }),\n }),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n ),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const VideoSchema = z\n .object({\n type: z.literal('re.notifica.notification.Video'),\n content: z\n .array(\n z.object({\n type: z.string({ message: 'Content object type is required and should be a string' }),\n data: z\n .string({ message: 'Content object data is required and should be a string' })\n .nonempty('Content object data cannot be empty'),\n }),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n )\n .superRefine((contentArray, ctx) => {\n contentArray.forEach((content, index) => {\n const validTypes = [\n 're.notifica.content.YouTube',\n 're.notifica.content.Vimeo',\n 're.notifica.content.HTML5Video',\n ];\n\n if (!validTypes.includes(content.type)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n \"Content object should be of type 're.notifica.content.YouTube', 're.notifica.content.Vimeo' or 're.notifica.content.HTML5Video'\",\n path: ['content', index, 'type'],\n });\n }\n\n // HTML5Video content object data validation\n if (content.type === 're.notifica.content.HTML5Video') {\n try {\n new URL(content.data);\n } catch {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'For a HTML5Video, content object data should be a valid URL',\n path: ['content', index, 'data'],\n });\n }\n }\n });\n }),\n })\n .merge(BaseSchema);\n","import { z } from 'zod';\nimport { BaseSchema } from '../base';\n\nexport const WebViewSchema = z\n .object({\n type: z.literal('re.notifica.notification.WebView'),\n content: z.array(\n z.object({\n type: z.literal('re.notifica.content.HTML', {\n message: \"Content object should be of type 're.notifica.content.HTML'\",\n }),\n data: z.string({\n message: 'Content data is required and should be a string containing the HTML markup',\n }),\n }),\n { message: \"The notification must be content-rich. Property 'content' is required\" },\n ),\n })\n .merge(BaseSchema);\n","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport { ZodIssue } from 'zod';\nimport { UnavailablePreview } from '~/internal/components/shared/UnavailablePreview/UnavailablePreview';\nimport { NotificationSchema } from '~/internal/schemas/notificare-notification';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\n\nimport '~/preset.css';\nimport './NotificationValidationError.css';\n\nexport function NotificationValidationError({ errors }: NotificationValidationErrorProps) {\n const intl = useIntl();\n\n useEffect(\n function handleValidationErrors() {\n logErrors(errors);\n },\n [errors],\n );\n\n return (\n <UnavailablePreview\n message={intl.formatMessage({\n id: 'preview.error.invalidNotification',\n defaultMessage: PUSH_TRANSLATIONS['preview.error.invalidNotification'],\n })}\n showConsoleWarning={true}\n />\n );\n}\n\nexport interface NotificationValidationErrorProps {\n errors: ZodIssue[];\n}\n\nfunction logErrors(errors: ZodIssue[]) {\n // Errors related to notification types and content types are handled manually here\n // discriminatedUnion() from Zod do not support custom messages when a discriminator doesn't correspond\n\n const invalidNotificationType = errors.find(\n (e) =>\n e.code === 'invalid_union_discriminator' &&\n e.path.includes('type') &&\n !e.path.includes('content'),\n );\n\n if (invalidNotificationType) {\n const validNotificationTypes = NotificationSchema.options.map(\n (schema) => schema.shape.type.value,\n );\n\n console.error(\n `Notification error:\\n\\nInvalid notification type. Expected one of: ${validNotificationTypes.join(', ')}\\n`,\n );\n } else {\n const messages = errors.map((e) => {\n if (\n e.code === 'invalid_union_discriminator' &&\n e.path.includes('type') &&\n e.path.includes('content')\n ) {\n return `Invalid content type. Expected one of: ${e.options.join(', ')}\\n`;\n }\n return e.message;\n });\n console.error('Notification errors:\\n\\n' + messages.join('\\n'));\n }\n}\n","import { VerifiedInAppMessage } from '~/internal/schemas/in-app-message';\n\nimport './BannerMessage.css';\n\nexport function BannerMessage({ inAppMessage }: BannerMessageProps) {\n return (\n <div\n className=\"notificare__in-app-messaging__banner__wrapper\"\n data-testid=\"in-app-messaging-banner-preview-wrapper\"\n >\n <div className=\"notificare__in-app-messaging__banner__window\">\n {inAppMessage.image && (\n <img\n alt=\"App icon\"\n className=\"notificare__in-app-messaging__banner__image\"\n src={inAppMessage.image}\n data-testid=\"in-app-messaging-banner-preview-image\"\n />\n )}\n\n <div className=\"notificare__in-app-messaging__banner__text-content\">\n <p\n className=\"notificare__in-app-messaging__banner__title\"\n data-testid=\"in-app-messaging-banner-preview-title\"\n >\n {inAppMessage.title}\n </p>\n <p\n className=\"notificare__in-app-messaging__banner__message\"\n data-testid=\"in-app-messaging-banner-preview-message\"\n >\n {inAppMessage.message}\n </p>\n </div>\n </div>\n </div>\n );\n}\n\ninterface BannerMessageProps {\n inAppMessage: Extract<VerifiedInAppMessage, { type: 're.notifica.inappmessage.Banner' }>;\n}\n","import ThinXMark from '~/assets/thin-x-mark.svg';\nimport { VerifiedInAppMessage } from '~/internal/schemas/in-app-message';\n\nimport './CardMessage.css';\n\nexport function CardMessage({ inAppMessage }: CardMessageProps) {\n return (\n <div\n className=\"notificare__in-app-messaging__card__wrapper\"\n data-testid=\"in-app-messaging-card-preview-wrapper\"\n >\n <div className=\"notificare__in-app-messaging__card__window\">\n <div className=\"notificare__in-app-messaging__card__header\">\n <button className=\"notificare__in-app-messaging__card__close-button\">\n <ThinXMark className=\"notificare__in-app-messaging__card__close-button-icon\" />\n </button>\n <img\n alt=\"App icon\"\n className=\"notificare__in-app-messaging__card__image\"\n src={inAppMessage.image}\n data-testid=\"in-app-messaging-card-preview-image\"\n />\n </div>\n <div className=\"notificare__in-app-messaging__card__text-content\">\n <p\n className=\"notificare__in-app-messaging__card__title\"\n data-testid=\"in-app-messaging-card-preview-title\"\n >\n {inAppMessage.title}\n </p>\n <p\n className=\"notificare__in-app-messaging__card__message\"\n data-testid=\"in-app-messaging-card-preview-message\"\n >\n {inAppMessage.message}\n </p>\n </div>\n\n <div className=\"notificare__in-app-messaging__card__actions\">\n <button\n className={`notificare__in-app-messaging__card__action-button notificare__in-app-messaging__card__action-button--primary ${inAppMessage.primaryAction.destructive ? 'notificare__in-app-messaging__card__action-button--destructive' : ''}`}\n data-testid=\"in-app-messaging-card-preview-primary-action-label\"\n >\n {inAppMessage.primaryAction.label}\n </button>\n\n {inAppMessage.secondaryAction && (\n <button\n className={`notificare__in-app-messaging__card__action-button notificare__in-app-messaging__card__action-button--secondary ${inAppMessage.secondaryAction.destructive ? 'notificare__in-app-messaging__card__action-button--destructive' : ''}`}\n data-testid=\"in-app-messaging-card-preview-secondary-action-label\"\n >\n {inAppMessage.secondaryAction.label}\n </button>\n )}\n </div>\n </div>\n </div>\n );\n}\n\ninterface CardMessageProps {\n inAppMessage: Extract<VerifiedInAppMessage, { type: 're.notifica.inappmessage.Card' }>;\n}\n","import ThinXMark from '~/assets/thin-x-mark.svg';\nimport { VerifiedInAppMessage } from '~/internal/schemas/in-app-message';\n\nimport './FullscreenMessage.css';\n\nexport function FullscreenMessage({ inAppMessage }: FullscreenMessageProps) {\n return (\n <div\n className=\"notificare__in-app-messaging__fullscreen__wrapper\"\n data-testid=\"in-app-messaging-fullscreen-preview-wrapper\"\n >\n <div className=\"notificare__in-app-messaging__fullscreen__window\">\n <img\n alt=\"App icon\"\n className=\"notificare__in-app-messaging__fullscreen__background-image\"\n src={inAppMessage.image}\n data-testid=\"in-app-messaging-fullscreen-preview-image\"\n />\n <button className=\"notificare__in-app-messaging__fullscreen__close-button\">\n <ThinXMark className=\"notificare__in-app-messaging__fullscreen__close-button-icon\" />\n </button>\n <div className=\"notificare__in-app-messaging__fullscreen__text-content\">\n <div\n className=\"notificare__in-app-messaging__fullscreen__title\"\n data-testid=\"in-app-messaging-fullscreen-preview-title\"\n >\n {inAppMessage.title}\n </div>\n <div\n className=\"notificare__in-app-messaging__fullscreen__message\"\n data-testid=\"in-app-messaging-fullscreen-preview-message\"\n >\n {inAppMessage.message}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\ninterface FullscreenMessageProps {\n inAppMessage: Extract<VerifiedInAppMessage, { type: 're.notifica.inappmessage.Fullscreen' }>;\n}\n","import {\n BannerMessage,\n CardMessage,\n FullscreenMessage,\n} from '~/internal/components/in-app-messaging/message-types';\nimport { AndroidPhoneBackground } from '~/internal/components/shared';\nimport { VerifiedInAppMessage } from '~/internal/schemas/in-app-message';\n\nimport './InAppMessagePreview.css';\n\nexport function InAppMessagePreview({ inAppMessage }: InAppMessagePreviewProps) {\n return (\n <div className=\"notificare__in-app-messaging__preview\">\n <AndroidPhoneBackground theme=\"dark\">\n {(() => {\n switch (inAppMessage.type) {\n case 're.notifica.inappmessage.Banner':\n return <BannerMessage inAppMessage={inAppMessage} />;\n case 're.notifica.inappmessage.Card':\n return <CardMessage inAppMessage={inAppMessage} />;\n case 're.notifica.inappmessage.Fullscreen':\n return <FullscreenMessage inAppMessage={inAppMessage} />;\n }\n })()}\n </AndroidPhoneBackground>\n </div>\n );\n}\n\ninterface InAppMessagePreviewProps {\n inAppMessage: VerifiedInAppMessage;\n}\n","import { z } from 'zod';\n\nexport const BannerSchema = z.object({\n type: z.literal('re.notifica.inappmessage.Banner'),\n title: z\n .string({ message: \"Property 'title' is required and should be a string\" })\n .max(256, \"Property 'title' cannot contain more than 256 characters\")\n .nonempty(\"Property 'title' cannot be empty\"),\n message: z\n .string({ message: \"Property 'message' is required and should be a string\" })\n .max(256, \"Property 'message' cannot contain more than 256 characters\")\n .nonempty(\"Property 'message' cannot be empty\"),\n image: z\n .string({ message: \"Property 'image' should be a string\" })\n .url(\"Property 'image' should be a valid URL\")\n .optional(),\n});\n","import { z } from 'zod';\nimport { BannerSchema } from '~/internal/schemas/in-app-message/variants/banner';\nimport { CardSchema } from '~/internal/schemas/in-app-message/variants/card';\nimport { FullscreenSchema } from '~/internal/schemas/in-app-message/variants/fullscreen';\n\nexport const InAppMessageSchema = z.discriminatedUnion('type', [\n BannerSchema,\n CardSchema,\n FullscreenSchema,\n]);\n\nexport type VerifiedInAppMessage = z.infer<typeof InAppMessageSchema>;\n","import { z } from 'zod';\n\nexport const CardSchema = z.object({\n type: z.literal('re.notifica.inappmessage.Card'),\n title: z\n .string({ message: \"Property 'title' is required and should be a string\" })\n .max(256, \"Property 'title' cannot contain more than 256 characters\")\n .nonempty(\"Property 'title' cannot be empty\"),\n message: z\n .string({ message: \"Property 'message' is required and should be a string\" })\n .max(256, \"Property 'message' cannot contain more than 256 characters\")\n .nonempty(\"Property 'message' cannot be empty\"),\n image: z\n .string({ message: \"Property 'image' should be a string\" })\n .url(\"Property 'image' should be a valid URL\")\n .optional(),\n primaryAction: z.object(\n {\n label: z\n .string({ message: \"Primary action property 'label' is required and should be a string\" })\n .max(32, \"Primary action property 'label' cannot contain more than 32 characters\")\n .nonempty(\"Primary action property 'label' cannot be empty\"),\n destructive: z\n .boolean({ message: \"Primary action property 'destructive' should be a boolean\" })\n .optional(),\n },\n { message: \"A Card must contain a primary action. Property 'primaryAction' is required\" },\n ),\n secondaryAction: z\n .object({\n label: z\n .string({ message: \"Secondary action property 'label' is required and should be a string\" })\n .max(32, \"Secondary action property 'label' cannot contain more than 32 characters\")\n .nonempty(\"Secondary action property 'label' cannot be empty\"),\n destructive: z\n .boolean({ message: \"Secondary action property 'destructive' should be a boolean\" })\n .optional(),\n })\n .optional(),\n});\n","import { z } from 'zod';\n\nexport const FullscreenSchema = z.object({\n type: z.literal('re.notifica.inappmessage.Fullscreen'),\n title: z\n .string({ message: \"Property 'title' should be a string\" })\n .max(256, \"Property 'title' cannot contain more than 256 characters\")\n .optional(),\n message: z\n .string({ message: \"Property 'message' should be a string\" })\n .max(256, \"Property 'message' cannot contain more than 256 characters\")\n .optional(),\n image: z\n .string({ message: \"Property 'image' is required and should be a string\" })\n .url(\"Property 'image' should be a valid URL\"),\n});\n","import { useEffect } from 'react';\nimport { useIntl } from 'react-intl';\nimport { ZodIssue } from 'zod';\nimport { UnavailablePreview } from '~/internal/components/shared';\nimport { InAppMessageSchema } from '~/internal/schemas/in-app-message';\nimport { IN_APP_MESSAGING_TRANSLATIONS } from '~/locales/in-app-messaging/en';\n\nexport function InAppMessageValidationError({ errors }: InAppMessageValidationErrorProps) {\n const intl = useIntl();\n\n useEffect(\n function handleValidationErrors() {\n logErrors(errors);\n },\n [errors],\n );\n\n return (\n <UnavailablePreview\n message={intl.formatMessage({\n id: 'preview.error.invalidInAppMessage',\n defaultMessage: IN_APP_MESSAGING_TRANSLATIONS['preview.error.invalidInAppMessage'],\n })}\n showConsoleWarning={true}\n />\n );\n}\n\nexport interface InAppMessageValidationErrorProps {\n errors: ZodIssue[];\n}\n\nfunction logErrors(errors: ZodIssue[]) {\n // Errors related to in-app message types are handled manually here\n // discriminatedUnion() from Zod do not support custom messages when a discriminator doesn't correspond\n\n const invalidInAppMessageType = errors.find(\n (e) => e.code === 'invalid_union_discriminator' && e.path.includes('type'),\n );\n\n if (invalidInAppMessageType) {\n const validInAppMessageTypes = InAppMessageSchema.options.map(\n (schema) => schema.shape.type.value,\n );\n\n console.error(\n `In-app message error:\\n\\nInvalid type. Expected one of: ${validInAppMessageTypes.join(', ')}`,\n );\n } else {\n const messages = errors.map(({ message }) => message);\n\n console.error(`In-app message errors:\\n\\n' + ${messages.join('\\n')}`);\n }\n}\n","import { useMemo } from 'react';\nimport { IntlProvider } from 'react-intl';\nimport { InAppMessagePreview } from '~/internal/components/in-app-messaging/preview/InAppMessagePreview';\nimport { InAppMessageValidationError } from '~/internal/components/in-app-messaging/validation-error/InAppMessageValidationError';\nimport { UnavailablePreview } from '~/internal/components/shared/UnavailablePreview/UnavailablePreview';\nimport { useLocalizationLoader } from '~/internal/hooks';\nimport { InAppMessageSchema } from '~/internal/schemas/in-app-message';\nimport { NotificareInAppMessagingTranslationKey } from '~/locales';\nimport { IN_APP_MESSAGING_TRANSLATIONS } from '~/locales/in-app-messaging/en';\nimport { NotificareInAppMessage } from '~/models';\n\nimport '~/preset.css';\n\n/**\n * Component that displays an in-app message preview.\n *\n * @param {NotificareInAppMessage} inAppMessage - The in-app message to be displayed in the preview.\n * @param {string} [locale] - The language/region code for the UI (optional). It's 'en-US' by default.\n * @param {string} [translations] - A set of custom translations to override the default ones (optional).\n */\nexport function NotificareInAppMessagePreview({\n inAppMessage,\n locale = 'en-US',\n translations,\n}: NotificareInAppMessagePreviewProps) {\n const localization = useLocalizationLoader({\n locale,\n customTranslations: translations,\n type: 'in-app',\n });\n\n const inAppMessageResult = useMemo(\n () => InAppMessageSchema.safeParse(inAppMessage),\n [inAppMessage],\n );\n\n return (\n <div className=\"notificare\">\n {localization.status === 'success' && (\n <IntlProvider\n locale={localization.data.locale}\n defaultLocale=\"en-US\"\n messages={localization.data.translations}\n >\n {inAppMessageResult.success ? (\n <InAppMessagePreview inAppMessage={inAppMessageResult.data} />\n ) : (\n <InAppMessageValidationError errors={inAppMessageResult.error.errors} />\n )}\n </IntlProvider>\n )}\n\n {localization.status === 'error' && (\n <IntlProvider locale=\"en-US\" messages={IN_APP_MESSAGING_TRANSLATIONS}>\n <UnavailablePreview message={localization.error.message} />\n </IntlProvider>\n )}\n </div>\n );\n}\n\nexport interface NotificareInAppMessagePreviewProps {\n inAppMessage: NotificareInAppMessage;\n locale?: string;\n translations?: Partial<Record<NotificareInAppMessagingTranslationKey, string>>;\n}\n","import { useMemo } from 'react';\nimport { IntlProvider } from 'react-intl';\nimport { NotificationPreviewWrapper } from '~/internal/components/push/preview-wrapper/NotificationPreviewWrapper';\nimport { NotificationValidationError } from '~/internal/components/push/validation-error/NotificationValidationError';\nimport { UnavailablePreview } from '~/internal/components/shared/UnavailablePreview/UnavailablePreview';\nimport { OptionsProvider } from '~/internal/context/options';\nimport { useLocalizationLoader } from '~/internal/hooks';\nimport { NotificationSchema } from '~/internal/schemas/notificare-notification';\nimport { NotificarePushTranslationKey } from '~/locales';\nimport { PUSH_TRANSLATIONS } from '~/locales/push/en';\nimport {\n NotificareNotification,\n NotificareNotificationPreviewVariant,\n NotificareNotificationPreviewLocale,\n} from '~/models';\n\nimport '~/preset.css';\n\n/**\n * Component that displays a notification preview for different platforms.\n *\n * @param {NotificareNotification} notification - The notification to be displayed in the preview.\n * @param {string} applicationId - The unique identifier of a Notificare application (optional).\n * @param {boolean} [showControls] - Whether the controls should be shown (optional). It's true by default.\n * @param {NotificareNotificationPreviewVariant} variant - The variant of the notification preview (optional). It's 'android-lockscreen' by default.\n * @param {string} [serviceKey] - A service key provided by a Notificare admin.\n * @param {string} [googleMapsAPIKey] - A Google Maps API key (optional).\n * @param {string} [locale] - The language/region code for the UI (optional). It's 'en-US' by default.\n * @param {string} [translations] - A set of custom translations to override the default ones (optional).\n */\nexport function NotificareNotificationPreview({\n notification,\n applicationId,\n showControls = true,\n variant = 'android-lockscreen',\n serviceKey,\n googleMapsAPIKey,\n locale = 'en-US',\n translations,\n}: NotificareNotificationPreviewProps) {\n const localization = useLocalizationLoader({\n locale,\n customTranslations: translations,\n type: 'push',\n });\n\n const notificationResult = useMemo(() => {\n return NotificationSchema.safeParse(notification);\n }, [notification]);\n\n return (\n <div className=\"notificare\">\n {localization.status === 'success' && (\n <IntlProvider\n locale={localization.data.locale}\n defaultLocale=\"en-US\"\n messages={localization.data.translations}\n >\n <OptionsProvider serviceKey={serviceKey} googleMapsAPIKey={googleMapsAPIKey}>\n {notificationResult.success ? (\n <NotificationPreviewWrapper\n notification={notificationResult.data}\n applicationId={applicationId}\n showControls={showControls}\n variant={variant}\n />\n ) : (\n <NotificationValidationError errors={notificationResult.error.errors} />\n )}\n </OptionsProvider>\n </IntlProvider>\n )}\n\n {localization.status === 'error' && (\n <IntlProvider locale=\"en-US\" messages={PUSH_TRANSLATIONS}>\n <UnavailablePreview message={localization.error.message} />\n </IntlProvider>\n )}\n </div>\n );\n}\n\nexport interface NotificareNotificationPreviewProps {\n notification: NotificareNotification;\n applicationId?: string;\n showControls?: boolean;\n variant?: NotificareNotificationPreviewVariant;\n serviceKey: string;\n googleMapsAPIKey?: string;\n locale?: NotificareNotificationPreviewLocale;\n translations?: Partial<Record<NotificarePushTranslationKey, string>>;\n}\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","rejected","result","done","then","__spreadArray","to","from","pack","ar","l","slice","concat","memoize","fn","options","cache","cacheDefault","serializer","serializerDefault","strategy","strategyDefault","monadic","arg","cacheKey","computedValue","get","set","variadic","args","assemble","context","serialize","bind","SuppressedError","ErrorKind","TYPE","SKELETON_TYPE","JSON","stringify","ObjectWithoutPrototypeCache","key","strategies","isLiteralElement","el","type","literal","isArgumentElement","argument","isNumberElement","number","isDateElement","date","isTimeElement","time","isSelectElement","select","isPluralElement","plural","isPoundElement","pound","isTagElement","tag","isNumberSkeleton","isDateTimeSkeleton","dateTime","SPACE_SEPARATOR_REGEX","DATE_TIME_REGEX","parseDateTimeSkeleton","skeleton","replace","match","len","era","year","RangeError","month","day","weekday","hour12","hourCycle","hour","minute","second","timeZoneName","WHITE_SPACE_REGEX","FRACTION_PRECISION_REGEX","SIGNIFICANT_PRECISION_REGEX","INTEGER_WIDTH_REGEX","CONCISE_INTEGER_WIDTH_REGEX","parseSignificantPrecision","str","roundingPriority","_","g1","g2","minimumSignificantDigits","maximumSignificantDigits","parseSign","signDisplay","currencySign","parseConciseScientificAndEngineeringStem","stem","notation","test","Error","minimumIntegerDigits","parseNotationOptions","opt","signOpts","parseNumberSkeleton","tokens","_i","tokens_1","token","style","scale","currency","useGrouping","maximumFractionDigits","unit","compactDisplay","reduce","all","currencyDisplay","unitDisplay","parseFloat","roundingMode","g3","g4","g5","minimumFractionDigits","trailingZeroDisplay","conciseScientificAndEngineeringOpts","_a","timeData","AC","AD","AE","AF","AG","AI","AL","AM","AO","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CP","CR","CU","CV","CW","CX","CY","CZ","DE","DG","DJ","DK","DM","DO","DZ","EA","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GT","GU","GW","GY","HK","HN","HR","HU","IC","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TA","TC","TD","TF","TG","TH","TJ","TL","TM","TN","TO","TR","TT","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW","getDefaultHourSymbolFromLocale","locale","undefined","hourCycles","regionTag","languageTag","language","maximize","region","SPACE_SEPARATOR_START_REGEX","RegExp","source","SPACE_SEPARATOR_END_REGEX","createLocation","start","end","hasNativeStartsWith","startsWith","hasNativeFromCodePoint","fromCodePoint","hasNativeFromEntries","fromEntries","hasNativeCodePointAt","codePointAt","hasTrimStart","trimStart","hasTrimEnd","trimEnd","isSafeInteger","Number","isFinite","Math","floor","abs","REGEX_SUPPORTS_U_AND_Y","exec","matchIdentifierAtIndex","search","position","codePoints","code","elements","fromCharCode","entries","obj","entries_1","k","v","index","size","first","charCodeAt","flag","IDENTIFIER_PREFIX_RE_1","lastIndex","c","_isWhiteSpace","_isPatternSyntax","push","ErrorCode","Parser","message","offset","line","column","ignoreTag","requiresOtherClause","shouldParseSkeletons","parse","parseMessage","nestingLevel","parentArgType","expectingCloseTag","isEOF","char","parseArgument","err","val","peek","error","UNMATCHED_CLOSING_TAG","clonePosition","_isAlpha","parseTag","parseLiteral","bump","location","startPosition","tagName","parseTagName","bumpSpace","bumpIf","childrenResult","children","endTagStartPosition","INVALID_TAG","closingTagNameStartPosition","UNCLOSED_TAG","startOffset","parseQuoteResult","tryParseQuote","parseUnquotedResult","tryParseUnquoted","parseLeftAngleResult","tryParseLeftAngleBracket","codepoint","ch","openingBracePosition","EXPECT_ARGUMENT_CLOSING_BRACE","EMPTY_ARGUMENT","parseIdentifierIfPossible","MALFORMED_ARGUMENT","parseArgumentOptions","startingPosition","endOffset","bumpTo","typeStartPosition","argType","typeEndPosition","EXPECT_ARGUMENT_TYPE","styleAndLocation","styleStartPosition","parseSimpleArgStyleIfPossible","EXPECT_ARGUMENT_STYLE","styleLocation","argCloseResult","tryParseArgumentClose","location_1","parseNumberSkeletonFromString","EXPECT_DATE_TIME_SKELETON","dateTimePattern","skeletonCopy","patternPos","patternChar","charAt","extraLength","hourLen","dayPeriodLen","hourChar","getBestPattern","pattern","parsedOptions","typeEndPosition_1","EXPECT_SELECT_ARGUMENT_OPTIONS","identifierAndLocation","pluralOffset","EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE","tryParseDecimalInteger","INVALID_PLURAL_ARGUMENT_OFFSET_VALUE","optionsResult","tryParsePluralOrSelectOptions","location_2","pluralType","INVALID_ARGUMENT_TYPE","nestedBraces","apostrophePosition","bumpUntil","UNCLOSED_QUOTE_IN_ARGUMENT_STYLE","stringTokens_1","split","filter","x","stemAndOptions","options_1","INVALID_NUMBER_SKELETON","expectCloseTag","parsedFirstIdentifier","hasOtherClause","parsedSelectors","Set","selector","selectorLocation","EXPECT_PLURAL_ARGUMENT_SELECTOR","INVALID_PLURAL_ARGUMENT_SELECTOR","has","DUPLICATE_SELECT_ARGUMENT_SELECTOR","DUPLICATE_PLURAL_ARGUMENT_SELECTOR","EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT","EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT","fragmentResult","add","EXPECT_SELECT_ARGUMENT_SELECTOR","MISSING_OTHER_CLAUSE","expectNumberError","invalidNumberError","sign","hasDigits","decimal","kind","prefix","currentOffset","targetOffset","min","nextCode","pruneLocation","els","forEach","opts","SyntaxError","originalMessage","captureLocation","PART_TYPE","FormatError","_super","msg","_this","toString","InvalidValueError","variableId","keys","join","INVALID_VALUE","InvalidValueTypeError","MissingValueError","MISSING_VALUE","isFormatXMLElementFn","formatToParts","locales","formatters","formats","values","currentPluralValue","els_1","getNumberFormat","format","varName","object","getDateTimeFormat","medium","value_1","formatFn","chunks","map","isArray","other","Intl","PluralRules","MISSING_INTL_API","rule","getPluralRules","parts","part","lastPart","mergeLiteral","mergeConfigs","defaultConfig","configs","c1","c2","createFastMemoizeCache","store","IntlErrorCode","IntlMessageFormat","overrideFormats","defaultLocale","formatterCache","pluralRules","ast","resolvedOptions","resolvedLocale","NumberFormat","supportedLocalesOf","getAst","resolveLocale","__parse","parseOpts","DateTimeFormat","defineProperty","memoizedDefaultLocale","enumerable","configurable","Locale","supportedLocales","integer","percent","short","long","full","IntlError","exception","stack","captureStackTrace","UnsupportedFormatterError","UNSUPPORTED_FORMATTER","InvalidConfigError","INVALID_CONFIG","MissingDataError","MISSING_DATA","IntlFormatError","FORMAT_ERROR","MessageFormatError","descriptor","id","defaultMessage","description","MissingTranslationError","MISSING_TRANSLATION","filterProps","props","allowlist","defaults","filtered","name","DEFAULT_INTL_CONFIG","messages","timeZone","defaultFormats","fallbackOnEmptyString","onError","process","env","NODE_ENV","console","onWarn","warning","warn","getNamedFormat","formatType","setTimeZoneInOptions","deepMergeOptions","opts1","opts2","deepMergeFormatsAndSetTimeZone","f1","mfFormats","formatMessage","state","messageDescriptor","defaultRichTextElements","msgId","condition","Err","invariant","toLowerCase","getMessageFormat","DATE_TIME_FORMAT_OPTIONS","getFormatter","filteredOptions","timeStyle","dateStyle","formatDate","config","_b","Date","formatTime","formatDateTimeRange","fromDate","toDate","formatRange","formatDateToParts","formatTimeToParts","DISPLAY_NAMES_OPTONS","formatDisplayName","getDisplayNames","DisplayNames","of","LIST_FORMAT_OPTIONS","now","formatList","getListFormat","results","formatListToParts","ListFormat","richValues_1","serializedValues","generateToken","PLURAL_FORMAT_OPTIONS","formatPlural","RELATIVE_TIME_FORMAT_OPTIONS","formatRelativeTime","getRelativeTimeFormat","RelativeTimeFormat","NUMBER_FORMAT_OPTIONS","formatNumber","formatNumberToParts","verifyConfigMessages","createIntl","relativeTime","list","displayNames","createFormatters","resolvedConfig","$t","invariantIntlContext","intl","CORE_DEFAULT_INTL_CONFIG","textComponent","React","Fragment","arbitraryKeyProps","toArbitrarilyKeyedReactNode","reactNode","isValidElement","createElement","shallowEqual","objA","objB","aKeys","bKeys","reactIsModule","exports","Symbol","for","f","g","h","m","q","r","w","y","z","a","u","$$typeof","A","reactIs_production_min","AsyncMode","ConcurrentMode","ContextConsumer","Element","ForwardRef","Lazy","Portal","Profiler","StrictMode","Suspense","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isProfiler","isStrictMode","isSuspense","isValidElementType","typeOf","require$$0","hasSymbol","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_ASYNC_MODE_TYPE","REACT_CONCURRENT_MODE_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_BLOCK_TYPE","REACT_FUNDAMENTAL_TYPE","REACT_RESPONDER_TYPE","REACT_SCOPE_TYPE","$$typeofType","ContextProvider","Memo","hasWarnedAboutDeprecatedIsAsyncMode","reactIs_development","isPortal","reactIs","REACT_STATICS","childContextTypes","contextType","contextTypes","defaultProps","displayName","getDefaultProps","getDerivedStateFromError","getDerivedStateFromProps","mixins","propTypes","KNOWN_STATICS","caller","callee","arity","MEMO_STATICS","compare","TYPE_STATICS","getStatics","component","render","getOwnPropertyNames","getOwnPropertyDescriptor","getPrototypeOf","objectPrototype","hoistNonReactStatics_cjs","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","IntlContext","window","__REACT_INTL_BYPASS_GLOBAL_CONTEXT__","createContext","__REACT_INTL_CONTEXT__","Consumer","DisplayName","DisplayNameParts","Provider","Context","useIntl","useContext","createFormattedDateTimePartsComponent","ComponentParts","formatProps","createFormattedComponent","Component","formattedValue","Text","assignUniqueKeysToFormatXMLElementFnArgument","acc","formatXMLElementFn","Children","toArray","rawValues","rest","coreFormatMessage","toKeyedReactNodeArray","rawDefaultRichTextElements","coreIntl","coreCreateIntl","FormattedMessage","nodes","MemoizedFormattedMessage","memo","prevProps","nextProps","otherProps","nextValues","nextOtherProps","processIntlConfig","wrapRichTextChunksInFragment","IntlProvider","prevConfig","PureComponent","styleInject","css","ref","insertAt","document","head","getElementsByTagName","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","AndroidPhoneBackground","theme","_jsxs","jsxs","className","_jsx","jsx","_path","IOSPhoneBackground","_extends","SvgLoading","xmlns","viewBox","width","height","fill","Loading","LoadingIcon","SvgAlert","PUSH_TRANSLATIONS","PreviewError","AlertIcon","SvgExpand","NetworkRequestError","response","super","status","calculateCompleteIconUrl","url","DEFAULT_APPLICATION","icon","androidPackageName","websitePushConfig","allowedDomains","useApplicationLoader","serviceKey","setState","useState","useEffect","URL","encodeURIComponent","searchParams","fetch","ok","application","json","fetchApplication","data","catch","useDebounce","delay","debouncedValue","setDebouncedValue","handler","setTimeout","clearTimeout","isValidLocale","IN_APP_MESSAGING_TRANSLATIONS","IN_APP_MESSAGING_TRANSLATIONS_FR","IN_APP_MESSAGING_TRANSLATIONS_PT","PUSH_TRANSLATIONS_FR","PUSH_TRANSLATIONS_PT","useLocalizationLoader","customTranslations","defaultTranslations","useMemo","getDefaultTranslations","translations","Selector","label","onValueChanged","disabled","expanded","setExpanded","currentOptionLabel","setCurrentOptionLabel","option","find","labelId","defaultLabel","optionsRef","useRef","selectorButtonRef","refs","onClickOutside","handleClickOutside","event","every","current","contains","target","addEventListener","removeEventListener","useOutsideClick","onClick","ExpandIcon","ToggleGroup","UnavailablePreview","showConsoleWarning","OptionsContext","OptionsProvider","useOptions","isSecureUrl","protocol","getTopLevelDomain","hostname","useWebshotRequest","platform","webshotId","setWebshotId","isValidUrl","webshotUrl","method","headers","body","params","webshot","createWebshotRequest","setInterval","statusResponse","fetchWebshotRequestStatus","blob","createObjectURL","fetchWebshotResult","clearInterval","Webshot","onLoadingChanged","canShow","src","alt","SvgLocker","SvgXMark","InAppBrowserBar","pageTitle","setPageTitle","setStatus","isLoading","updateComponentStatus","websiteUrl","html","text","DOMParser","parseFromString","querySelector","textContent","fetchPageTitle","XMarkIcon","LockerIcon","notifyLoadingChange","InAppBrowserNotification","notification","isPageTitleLoading","setIsPageTitleLoading","isWebshotLoading","setIsWebshotLoading","content","ApplicationContext","ApplicationProvider","useApplication","fetchWebsiteMarkup","hasActions","actions","hasSingleAction","hasMultipleActions","hasFirstAttachment","attachments","markupContainsNotificareOpenActionQueryParameter","links","querySelectorAll","hasParameter","link","href","origin","SvgLeftArrow","SvgOptions","NavigationBar","title","showOptions","LeftArrowIcon","OptionsIcon","UrlResolverPreviewTypeResult","URLNotification","websiteMarkup","setWebsiteMarkup","getUrlResolverPreviewTypeByUrl","urlStr","trim","INVALID_URL","RELATIVE_URL","isHttpUrl","isDynamicLink","host","endsWith","URL_SCHEME","DYNAMIC_LINK","webViewQueryParameter","WEB_VIEW","IN_APP_BROWSER","URLResolverNotification","urlResolverResult","AppRecommendationNotification","contentList","base","getUrlByContentType","DigitalCardNotification","ImagesNotification","image","fastDeepEqual","equal","flags","valueOf","_objectWithoutPropertiesLoose","_toPropertyKey","toPrimitive","_toPrimitive","APILoadingStatus","GoogleMapsApiLoader","load","onLoadingStatusChange","_window$google","libraries","serializedParams","serializeParams","listeners","google","maps","importLibrary","serializedApiParams","loadingStatus","notifyLoadingStatusListeners","initImportLibrary","librariesToLoad","authReferrerPolicy","solutionChannel","apiPromise","loadApi","_document$querySelect","scriptElement","urlParams","URLSearchParams","urlParamName","async","MAPS_API_BASE_URL","nonce","onerror","__googleMapsCallback__","gm_authFailure","append","libraryName","_excluded$3","_excluded2$1","APIProviderContext","APIProvider","loaderProps","mapInstances","addMapInstance","removeMapInstance","clearMapInstances","setMapInstances","mapInstance","instances","_ref","useMapInstances","loadedLibraries","onLoad","apiKey","version","otherApiParams","addLoadedLibrary","useReducer","action","librariesString","useCallback","_google","res","channel","useGoogleMapsApiLoader","contextValue","createMapEvent","srcEvent","ev","detail","stoppable","stop","cameraEventTypes","includes","camEvent","center","getCenter","zoom","getZoom","heading","getHeading","tilt","getTilt","bounds","getBounds","toJSON","lat","lng","north","east","south","west","mouseEventTypes","_srcEvent$latLng","mouseEvent","domEvent","latLng","placeId","propNameToEventType","onBoundsChanged","onCenterChanged","onContextmenu","onDblclick","onDrag","onDragend","onDragstart","onHeadingChanged","onIdle","onIsFractionalZoomEnabledChanged","onMapCapabilitiesChanged","onMapTypeIdChanged","onMousemove","onMouseout","onMouseover","onProjectionChanged","onRenderingTypeChanged","onTilesLoaded","onTiltChanged","onZoomChanged","onCameraChanged","eventPropNames","mapOptionKeys","useMapOptions","mapProps","mapOptions","effect","deps","isDeepEqual","useDeepCompareEffect","setOptions","useApiLoadingStatus","_useContext","toLatLngLiteral","isLatLngLiteral","AuthFailureMessage","top","left","bottom","right","zIndex","display","flexFlow","textAlign","justifyContent","fontSize","color","background","padding","useApiIsLoaded","useTrackedCameraStateRef","forceUpdate","useForceUpdate","listener","addListener","handleBoundsChange","remove","_excluded$2","_excluded2","CachedMapStack","pop","useMapInstance","apiIsLoaded","setMap","container","containerRef","setEl","useCallbackRef","cameraStateRef","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme","hasZoom","hasCenter","savedMapStateRef","mapId","mapDiv","getDiv","setCenter","Map","defBounds","fitBounds","savedMapId","cameraState","savedCameraState","clearInstanceListeners","GoogleMapsContext","mapRef","useLayoutEffect","nextCamera","needsUpdate","moveCamera","useMapCameraParams","propName","eventType","useMapEvents","isDeckGlControlled","viewport","viewState","latitude","longitude","bearing","pitch","useDeckGLCameraUpdate","isControlledExternally","controlled","disableDefaultUI","gestureHandling","keyboardShortcuts","cameraOptions","_lat","_lng","_props$zoom","_props$heading","_props$tilt","combinedStyle","deckGLViewProps","shownMessages","useMap","ctx","logErrorOnce","useMapsEventListener","callback","usePropBinding","prop","useDomEventListener","AdvancedMarkerContext","AdvancedMarkerAnchorPoint","BOTTOM","MarkerContent","styles","anchorPoint","xTranslation","yTranslation","xTranslationFlipped","yTranslationFlipped","substring","transformStyle","transform","useAdvancedMarker","marker","setMarker","contentContainer","setContentContainer","markerLibrary","useMapsLibrary","onMouseEnter","onMouseLeave","onDragStart","onDragEnd","collisionBehavior","clickable","draggable","numChildren","count","newMarker","AdvancedMarkerElement","contentElement","isCustomMarker","_contentElement","gmpDraggable","gmpClickable","Boolean","nodeType","Node","ELEMENT_NODE","pointerEvents","firstElementChild","element","forwardRef","advancedMarkerContextValue","useImperativeHandle","createPortal","_excluded","Marker","onMouseOver","onMouseOut","markerOptions","gme","setDraggable","setPosition","useMarker","MapRichContent","googleMapsAPIKey","isClient","setIsClient","markers","contentRow","getMarkersFromNotification","MapWithStatus","apiLoadStatus","backgroundColor","overflow","MapNotification","_rect","RateNotification","SvgDefaultAppIcon","preserveAspectRatio","strokeWidth","stroke","TextAlertNotification","DefaultAppIcon","VideoRichContent","videoData","getVideoUrl","sandbox","allow","autoPlay","controls","VideoNotification","WebViewNotification","srcDoc","LockScreenNotification","subtitle","uri","NotificationAndroidPreview","previewState","isValidPreviewType","displayMode","notificationType","getTheme","TitleBar","SvgLayerGroup","SvgUser","useStoreRequest","appId","identifier","getAppId","timestamp","fetchIosStoreApp","app","resultCount","timeAgo","isoDate","rtf","diffInSeconds","getTime","intervals","_defs","SvgFullStar","SvgHalfStar","stopColor","StarRating","rating","stars","FullStar","HalfStar","artworkUrl512","trackName","primaryGenreName","userRatingCount","averageUserRating","toFixed","trackContentRating","LayerGroupIcon","UserIcon","sellerName","currentVersionReleaseDate","releaseNotes","screenshotUrls","NotificationIOSPreview","SvgThinXMark","AlertNotification","ImageNotification","WebMobileAppUINotification","ThinXMarkIcon","SvgGoogleChrome","x1","x2","y1","y2","gradientUnits","cx","cy","ExpandButton","open","onToggle","ExpandButtonIcon","WebMacOSNotification","mouseOverNotification","setMouseOverNotification","mouseOverButtonIndex","setMouseOverButtonIndex","expandable","setExpandable","openOptions","setOpenOptions","isClosing","setIsClosing","isExpanding","setIsExpanding","initialPreviewHeight","setInitialPreviewHeight","previewRef","messageRef","fullTextHeight","scrollHeight","previewHeight","previewElement","messageElement","GoogleChromeIcon","extractDomain","prevState","_c","NotificationWebPreview","formFactor","os","NotificationPreview","setError","previousPreviewState","setPreviousPreviewState","SvgAndroid","SvgIos","Controls","onPreviewStateChanged","PLATFORM_OPTIONS","FORM_FACTOR_OPTIONS","MOBILE_OPERATING_SYSTEM_OPTIONS","DISPLAY_MODE_OPTIONS","DESKTOP_OPERATING_SYSTEM_OPTIONS","AndroidIcon","IOSIcon","DEFAULT_STATES","NotificationPreviewWrapper","applicationId","showControls","variant","setPreviewState","applicationState","util","objectUtil","assertEqual","assertIs","_arg","assertNever","_x","arrayToEnum","items","item","getValidEnumValues","validKeys","objectKeys","objectValues","arr","checker","isInteger","joinValues","array","separator","jsonStringifyReplacer","mergeShapes","ZodParsedType","getParsedType","string","isNaN","nan","boolean","function","bigint","symbol","null","promise","unknown","ZodIssueCode","ZodError","errors","issues","addIssue","sub","addIssues","subs","actualProto","_mapper","mapper","issue","fieldErrors","_errors","processError","unionErrors","returnTypeError","argumentsError","path","curr","assert","isEmpty","flatten","formErrors","errorMap","_ctx","invalid_type","received","expected","invalid_literal","unrecognized_keys","invalid_union","invalid_union_discriminator","invalid_enum_value","invalid_arguments","invalid_return_type","invalid_date","invalid_string","validation","too_small","exact","inclusive","minimum","too_big","maximum","custom","invalid_intersection_types","not_multiple_of","multipleOf","not_finite","defaultError","overrideErrorMap","defaultErrorMap","addIssueToContext","issueData","overrideMap","errorMaps","fullPath","fullIssue","errorMessage","reverse","makeIssue","common","contextualErrorMap","schemaErrorMap","ParseStatus","dirty","abort","mergeArray","arrayValue","INVALID","mergeObjectAsync","pairs","syncPairs","pair","mergeObjectSync","finalObject","alwaysSet","freeze","DIRTY","OK","isAborted","isDirty","isValid","isAsync","errorUtil","errToObj","_ZodEnum_cache","_ZodNativeEnum_cache","__classPrivateFieldGet","receiver","__classPrivateFieldSet","ParseInputLazyPath","parent","_cachedPath","_key","handleResult","success","_error","processCreateParams","invalid_type_error","required_error","iss","ZodType","_def","_getType","input","_getOrReturnCtx","parsedType","_processInputParams","_parseSync","_parse","_parseAsync","safeParse","parseAsync","safeParseAsync","maybeAsyncResult","refine","check","getIssueProperties","_refinement","refinement","refinementData","ZodEffects","schema","typeName","ZodFirstPartyTypeKind","superRefine","def","spa","optional","nullable","nullish","or","and","brand","default","describe","pipe","readonly","isNullable","isOptional","vendor","validate","ZodOptional","ZodNullable","ZodArray","ZodPromise","ZodUnion","incoming","ZodIntersection","defaultValueFunc","ZodDefault","innerType","defaultValue","ZodBranded","catchValueFunc","ZodCatch","catchValue","This","ZodPipeline","ZodReadonly","cuidRegex","cuid2Regex","ulidRegex","uuidRegex","nanoidRegex","jwtRegex","durationRegex","emailRegex","emojiRegex","ipv4Regex","ipv4CidrRegex","ipv6Regex","ipv6CidrRegex","base64Regex","base64urlRegex","dateRegexSource","dateRegex","timeRegexSource","secondsRegexSource","precision","datetimeRegex","regex","local","isValidJWT","jwt","alg","header","base64","padEnd","decoded","atob","typ","isValidCidr","ip","ZodString","coerce","checks","tooBig","tooSmall","toUpperCase","_regex","_addCheck","email","emoji","uuid","nanoid","cuid","cuid2","ulid","base64url","cidr","datetime","duration","minLength","max","maxLength","nonempty","isDatetime","isDate","isTime","isDuration","isEmail","isURL","isEmoji","isUUID","isNANOID","isCUID","isCUID2","isULID","isIP","isCIDR","isBase64","isBase64url","floatSafeRemainder","valDecCount","stepDecCount","decCount","parseInt","ZodNumber","gte","lte","setLimit","gt","lt","int","positive","negative","nonpositive","nonnegative","finite","safe","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","minValue","maxValue","isInt","ZodBigInt","BigInt","_getInvalidInput","ZodBoolean","ZodDate","minDate","maxDate","ZodSymbol","ZodUndefined","ZodNull","ZodAny","_any","ZodUnknown","_unknown","ZodNever","never","ZodVoid","void","exactLength","deepPartialify","ZodObject","newShape","shape","fieldSchema","unwrap","ZodTuple","_cached","nonstrict","passthrough","augment","extend","_getCached","shapeKeys","extraKeys","catchall","unknownKeys","keyValidator","strict","strip","augmentation","merge","merging","setKey","pick","mask","omit","deepPartial","partial","required","newField","keyof","createZodEnum","strictCreate","lazycreate","childCtx","types","getDiscriminator","ZodLazy","ZodLiteral","ZodEnum","ZodNativeEnum","enum","ZodDiscriminatedUnion","discriminator","discriminatorValue","optionsMap","discriminatorValues","mergeValues","aType","bType","valid","sharedKeys","newObj","sharedValue","newArray","handleParsed","parsedLeft","parsedRight","merged","itemIndex","schemas","ZodMap","keySchema","keyType","valueSchema","valueType","finalMap","ZodSet","minSize","maxSize","finalizeSet","parsedSet","getter","expectedValues","enumValues","Values","Enum","extract","newDef","exclude","WeakMap","nativeEnumValues","promisified","sourceType","checkCtx","fatal","processed","executeRefinement","inner","createWithPreprocess","preprocess","removeDefault","newCtx","removeCatch","ZodNaN","inResult","in","out","handleAsync","stringType","numberType","booleanType","arrayType","objectType","discriminatedUnionType","literalType","enumType","BaseSchema","z.object","z.string","z\n .string","z\n .array","camera","z.boolean","keyboard","z\n .boolean","mimeType","z\n .string","NoneSchema","z\n .object","z.literal","UrlResolverSchema","z.array","AlertSchema","ImageSchema","z.enum","InAppBrowserSchema","MapSchema","z\n .number","PassbookSchema","RateSchema","StoreSchema","z.discriminatedUnion","campaignToken","z\n .string","affiliateToken","providerToken","z\n .string","NotificationSchema","contentArray","z.ZodIssueCode","NotificationValidationError","invalidNotificationType","validNotificationTypes","logErrors","BannerMessage","inAppMessage","CardMessage","ThinXMark","primaryAction","destructive","secondaryAction","FullscreenMessage","InAppMessagePreview","InAppMessageSchema","z\n .object","InAppMessageValidationError","invalidInAppMessageType","validInAppMessageTypes","localization","inAppMessageResult","notificationResult"],"mappings":"wWAgBIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAg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A,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KACA,KAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,KACA,KAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,IACA,KAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KACA,IACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,KAEJC,GAAM,CACF,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,KACA,KACA,IACA,KAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KAEJC,GAAM,CACF,IACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA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ACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACM,OAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACM,OAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACM,OAANA,GACM,OAANA,GACM,OAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,KACf,OAANA,GACM,OAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,KAC7B,CGvvCA,SAAS2I,GAAcC,GACnBA,EAAIC,SAAQ,SAAUzhB,GAElB,UADOA,EAAG2a,SACNha,EAAgBX,IAAOa,EAAgBb,GACvC,IAAK,IAAImY,KAAKnY,EAAG7B,eACN6B,EAAG7B,QAAQga,GAAGwC,SACrB4G,GAAcvhB,EAAG7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