notificare-react-preview-components 1.0.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.
@@ -0,0 +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 * // &center=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&#39;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&#39;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}:){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})))$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]{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","className","_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","NotificareNotificationPreview","applicationId","showControls","variant","setApplication","ok","notificationPreviewVariants","_e","notificationResult","validTypes","messages","showNotificationErrors"],"mappings":"mVAkHO,SAASA,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,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